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
Initialize the contents of the frame.
private void initialize() { this.nativeLookAndFeel(); setBounds(100, 100, 300, 270); setTitle("Gestion Usuarios"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setResizable(false); getContentPane().setLayout(null); lblLoading = new JLabel(new ImageIcon(Main.class.getResource("Resources/Icons/loading2.gif"))); lblLoading.setBounds(90, 46, 100, 100); lblLoading.setVisible(false); getContentPane().add(lblLoading); txtUsuario = new JTextField(); txtUsuario.setFont(new Font("Tahoma", Font.PLAIN, 14)); txtUsuario.setBounds(42, 46, 200, 25); getContentPane().add(txtUsuario); txtUsuario.setDocument(new JTextFieldLimit(20)); btnLogIn = new JButton("Log in"); btnLogIn.setFont(new Font("Tahoma", Font.BOLD, 16)); btnLogIn.setBounds(42, 170, 200, 44); getContentPane().add(btnLogIn); txtPassword = new JPasswordField(); txtPassword.setFont(new Font("Tahoma", Font.PLAIN, 14)); txtPassword.setBounds(42, 121, 200, 25); getContentPane().add(txtPassword); lblUsuario = new JLabel("Usuario"); lblUsuario.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblUsuario.setBounds(42, 15, 63, 20); getContentPane().add(lblUsuario); lblPassword = new JLabel("Password"); lblPassword.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblPassword.setBounds(42, 90, 63, 20); getContentPane().add(lblPassword); setLocationRelativeTo(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BreukFrame() {\n super();\n initialize();\n }", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "private void initialize() {\n\t\tthis.setSize(211, 449);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setTitle(\"JFrame\");\n\t}", "public SiscobanFrame() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(0, 0, 1100, 800);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tsetUIComponents();\n\t\tsetControllers();\n\n\t}", "private void initialize() {\r\n\t\tthis.setSize(530, 329);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t}", "private void initialize() {\r\n\t\tthis.setSize(300, 200);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\taddSampleData();\n\t\tsetDefaultSettings();\n\t\topenHomePage();\n\t\tframe.setVisible(true);\n\t}", "private void initialize() {\n\t\tframe = new JFrame(\"Media Inventory\");\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(0, 0, 1000, 700);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tframeContent = new JPanel();\n\t\tframe.getContentPane().add(frameContent);\n\t\tframeContent.setBounds(10, 10, 700, 640);\n\t\tframeContent.setLayout(null);\n\t\t\n\t\tinfoPane = new JPanel();\n\t\tframe.getContentPane().add(infoPane);\n\t\tinfoPane.setBounds(710, 10, 300, 640);\n\t\tinfoPane.setLayout(null);\n\t}", "private void initialize() {\n\t\tframe = new JFrame(\"BirdSong\");\n\t\tframe.pack();\n\t\tframe.setVisible(true);\n\t\tframe.setBounds(100, 100, 400, 200);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tabc = new BirdPanel();\n\t\ttime = new TimePanel();\n\t\tgetContentPane().setLayout(new BoxLayout(frame, BoxLayout.Y_AXIS));\n\n\t\tframe.getContentPane().add(abc, BorderLayout.NORTH);\n\t\tframe.getContentPane().add(time, BorderLayout.CENTER);\n\t}", "private void initialize() {\r\n\t\tthis.setSize(311, 153);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t\tsetCancelButton( btnCancel );\r\n\t}", "public Frame() {\n initComponents();\n }", "public Frame() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(497, 316);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t\tthis.setExtendedState(JFrame.MAXIMIZED_BOTH);\r\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "protected HFrame(){\n\t\tinit();\n\t}", "private void initializeFields() {\r\n myFrame = new JFrame();\r\n myFrame.setSize(DEFAULT_SIZE);\r\n }", "private void initialize() {\n\t\tthis.setSize(329, 270);\n\t\tthis.setContentPane(getJContentPane());\n\t}", "private void initialize() {\r\n\t\t//setFrame\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(125,175, 720, 512);\r\n\t\tframe.setTitle(\"Periodic Table\");\r\n\t\tframe.setResizable(false);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void initFrame() {\n setLayout(new BorderLayout());\n }", "private void initialize() {\n\t\tthis.setSize(300, 300);\n\t\tthis.setIconifiable(true);\n\t\tthis.setClosable(true);\n\t\tthis.setTitle(\"Sobre\");\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setFrameIcon(new ImageIcon(\"images/16x16/info16x16.gif\"));\n\t}", "public FrameControl() {\n initComponents();\n }", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "public MainFrame() {\n initComponents();\n \n }", "private void init(Element frame) {\n\t\tthis.frameWidth = Integer.parseInt(frame.attributeValue(\"width\"));\n\t\tthis.frameHeight = Integer.parseInt(frame.attributeValue(\"height\"));\n\t\tthis.paddle = Integer.parseInt(frame.attributeValue(\"paddle\"));\n\t\tthis.size = Integer.parseInt(frame.attributeValue(\"size\"));\n\t}", "public MainFrame() {\n \n initComponents();\n \n this.initNetwork();\n \n this.render();\n \n }", "public internalFrame() {\r\n initComponents();\r\n }", "private void initialize() {\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setSize(810, 600);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);\n\t\tthis.setModal(true);\n\t\tthis.setResizable(false);\n\t\tthis.setName(\"FramePrincipalLR\");\n\t\tthis.setTitle(\"CR - Lista de Regalos\");\n\t\tthis.setLocale(new java.util.Locale(\"es\", \"VE\", \"\"));\n\t\tthis.setUndecorated(false);\n\t}", "public Mainframe() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(392, 496);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"Informações\");\r\n\t}", "private void initialize() {\n this.setSize(253, 175);\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setContentPane(getJContentPane());\n this.setTitle(\"Breuken vereenvoudigen\");\n }", "private void initialize() {\r\n\t\t// Initialize main frame\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(Constants.C_MAIN_PREFERED_POSITION_X_AT_START, Constants.C_MAIN_PREFERED_POSITION_Y_AT_START, \r\n\t\t\t\tConstants.C_MAIN_PREFERED_SIZE_X, Constants.C_MAIN_PREFERED_SIZE_Y);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.setTitle(Constants.C_MAIN_WINDOW_TITLE);\r\n\t\t\r\n\t\t// Tab panel and their panels\r\n\t\tmainTabbedPane = new JTabbedPane(JTabbedPane.TOP);\r\n\t\tframe.getContentPane().add(mainTabbedPane, BorderLayout.CENTER);\r\n\t\t\r\n\t\tpanelDecision = new DecisionPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_DECISION_TITLE, null, panelDecision, null);\r\n\t\t\r\n\t\tpanelCalculation = new CalculationPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_CALCULATION_TITLE, null, panelCalculation, null);\r\n\t\t\r\n\t\tpanelLibrary = new LibraryPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_LIBRARY_TITLE, null, panelLibrary, null);\r\n\t\t\r\n\t\t// Menu bar\r\n\t\tmenuBar = new JMenuBar();\r\n\t\tframe.setJMenuBar(menuBar);\r\n\t\tcreateMenus();\r\n\t}", "public void initializeFrame() {\n frame.getContentPane().removeAll();\n createComponents(frame.getContentPane());\n// frame.setSize(new Dimension(1000, 600));\n }", "private void initialize() {\r\n\t\t// this.setSize(271, 295);\r\n\t\tthis.setSize(495, 392);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(ResourceBundle.getBundle(\"Etiquetas\").getString(\"MainTitle\"));\r\n\t}", "private void initializeFrame() {\n add(container);\n setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\n pack();\n }", "private void initialize() {\n this.setSize(300, 200);\n this.setContentPane(getJContentPane());\n this.pack();\n }", "private void initialize() {\n\t\tframe = new JFrame(\"DB Filler\");\n\t\tframe.setBounds(100, 100, 700, 500);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tdbc = new DataBaseConnector();\n\t\tcreateFileChooser();\n\n\t\taddTabbedPane();\n\t\tsl_panel = new SpringLayout();\n\t\taddAddFilePanel();\n\t}", "public mainframe() {\n initComponents();\n }", "public FrameDesign() {\n initComponents();\n }", "public Jframe() {\n initComponents();\n setIndice();\n loadTextBoxs();\n }", "public JGSFrame() {\n\tsuper();\n\tinitialize();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n try {\n initComponents();\n initElements();\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Error \" + e.getMessage());\n }\n }", "private void initialize() {\n this.setSize(495, 276);\n this.setTitle(\"Translate Frost\");\n this.setContentPane(getJContentPane());\n }", "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}", "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}", "public void initializePanelToFrame() {\n\t\tnew ColorResources();\n\t\tnew TextResources().changeLanguage();\n\t\tpanel = new JPanel();\n\t\tpanel.setLayout(null);\n\t\tpanel.setPreferredSize(new Dimension(375, 812));\n\n\t\tconfigureLabels();\n\t\tconfigureButtons();\n\t\taddListeners();\n\t\taddComponentsToPanel();\n\n\t\tthis.setContentPane(panel);\n\t\tthis.pack();\n\t}", "private void initialize() {\n this.setLayout(new BorderLayout());\n this.setSize(new java.awt.Dimension(564, 229));\n this.add(getMessagePanel(), java.awt.BorderLayout.NORTH);\n this.add(getBalloonSettingsListBox(), java.awt.BorderLayout.CENTER);\n this.add(getBalloonSettingsButtonPane(), java.awt.BorderLayout.SOUTH);\n\n editBalloonSettingsFrame = new EditBalloonSettingsFrame();\n\n }", "public SMFrame() {\n initComponents();\n updateComponents();\n }", "private void initialize() {\n m_frame = new JFrame(\"Video Recorder\");\n m_frame.setResizable(false);\n m_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n m_frame.setLayout(new BorderLayout());\n m_frame.add(buildContentPanel(), BorderLayout.CENTER);\n\n JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 5));\n JButton startButton = new JButton(\"Start\");\n startButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent ae) {\n listen();\n }\n });\n buttonPanel.add(startButton);\n\n m_connectionLabel = new JLabel(\"Disconnected\");\n m_connectionLabel.setOpaque(true);\n m_connectionLabel.setBackground(Color.RED);\n m_connectionLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 3));\n m_connectionLabel.setPreferredSize(new Dimension(100, 26));\n m_connectionLabel.setHorizontalAlignment(SwingConstants.CENTER);\n buttonPanel.add(m_connectionLabel);\n\n m_frame.add(buttonPanel, BorderLayout.PAGE_END);\n }", "public FirstNewFrame() {\n\t\tjbInit();\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJButton btnNewButton = new JButton(\"Play\");\n\t\tbtnNewButton.setFont(new Font(\"Bodoni 72\", Font.BOLD, 13));\n\t\tbtnNewButton.setBounds(frame.getWidth() / 2 - 60, 195, 120, 30);\n\t\tframe.getContentPane().add(btnNewButton);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"Space Escape\");\n\t\tlblNewLabel.setForeground(Color.WHITE);\n\t\tlblNewLabel.setFont(new Font(\"Bodoni 72\", Font.BOLD, 24));\n\t\tlblNewLabel.setBounds(frame.getWidth() / 2 - 60, 30, 135, 25);\n\t\tframe.getContentPane().add(lblNewLabel);\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"New label\");\n\t\tlblNewLabel_1.setBounds(0, 0, frame.getWidth(), frame.getHeight());\n\t\tframe.getContentPane().add(lblNewLabel_1);\n\t}", "private void initializeFrame()\r\n\t{\r\n\t\tthis.setResizable(false);\r\n\r\n\t\tsetSize(DIMENSIONS); // set the correct dimensions\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\tsetLayout( new GridLayout(1,1) );\r\n\t}", "private void setupFrame()\n\t{\n\t\tthis.setContentPane(botPanel);\n\t\tthis.setSize(800,700);\n\t\tthis.setTitle(\"- Chatbot v.2.1 -\");\n\t\tthis.setResizable(true);\n\t\tthis.setVisible(true);\n\t}", "public MainFrame() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public EmulatorFrame() {\r\n\t\tsuper(\"Troyboy Chip8 Emulator\");\r\n\t\t\r\n\t\tsetNativeLAndF();\r\n\t\tinitComponents();\r\n\t\tinitMenubar();\r\n\t\tsetupLayout();\r\n\t\tinitFrame();\r\n\t\t//frame is now ready to run a game\r\n\t\t//running of any games must be started by loading a ROM\r\n\t}", "public void init()\n {\n buildUI(getContentPane());\n }", "private void initialize()\n {\n this.setTitle( \"SerialComm\" ); // Generated\n this.setSize( 500, 300 );\n this.setContentPane( getJContentPane() );\n }", "public launchFrame() {\n \n initComponents();\n \n }", "private void initialize() {\r\n\t\tthis.setSize(378, 283);\r\n\t\tthis.setJMenuBar(getMenubar());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JAVIER\");\r\n\t}", "private void initialize() {\n\t\tthis.setSize(430, 280);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setUndecorated(true);\n\t\tthis.setModal(true);\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setTitle(\"Datos del Invitado\");\n\t\tthis.addComponentListener(this);\n\t}", "public PilaFrame() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 900, 900);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tgame = new Game();\n\t\t\n\t\tGameTable puzzle = new GameTable(game.getPuzzle());\n\t\tpuzzle.setBounds(100, 100, 700, 700);\n\t\t\n\t\tframe.add(puzzle);\n\t\t\n\t\tSystem.out.println(\"SAD\");\n\t\t\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setResizable(false);\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tPanel mainFramePanel = new Panel();\r\n\t\tmainFramePanel.setBounds(10, 10, 412, 235);\r\n\t\tframe.getContentPane().add(mainFramePanel);\r\n\t\tmainFramePanel.setLayout(null);\r\n\t\t\r\n\t\tfinal TextField textField = new TextField();\r\n\t\ttextField.setBounds(165, 62, 79, 24);\r\n\t\tmainFramePanel.add(textField);\r\n\t\t\r\n\t\tButton changeTextButt = new Button(\"Change Text\");\r\n\t\tchangeTextButt.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\ttextField.setText(\"Domograf\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tchangeTextButt.setBounds(165, 103, 79, 24);\r\n\t\tmainFramePanel.add(changeTextButt);\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setResizable(false);\n\t\tframe.setAlwaysOnTop(true);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t}", "StudentFrame() {\n \tgetContentPane().setFont(new Font(\"Times New Roman\", Font.PLAIN, 11));\n s1 = null; // setting to null\n initializeComponents(); // causes frame components to be initialized\n }", "private void initialize() {\r\n\t\tthis.setSize(300, 200);\r\n\t\tthis.setTitle(\"Error\");\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "public NewFrame() {\n initComponents();\n }", "public SerialCommFrame()\n {\n super();\n initialize();\n }", "public LoginFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public BaseFrame() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(733, 427);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"jProxyChecker\");\r\n\t}", "public frame() {\r\n\t\tadd(createMainPanel());\r\n\t\tsetTitle(\"Lunch Date\");\r\n\t\tsetSize(FRAME_WIDTH, FRAME_HEIGHT);\r\n\r\n\t}", "public MercadoFrame() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 800, 800);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tJPanel browserPanel = new JPanel();\n\t\tframe.getContentPane().add(browserPanel, BorderLayout.CENTER);\n\t\t\n\t\t// create javafx panel for browser\n browserFxPanel = new JFXPanel();\n browserPanel.add(browserFxPanel);\n \n // create JavaFX scene\n Platform.runLater(new Runnable() {\n public void run() {\n createScene();\n }\n });\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(X_FRAME, Y_FRAME, WIDTH_FRAME, HEIGHT_FRAME);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tJButton btnAddSong = new JButton(\"Add song\");\r\n\t\tbtnAddSong.setBounds(X_BTN, Y_ADDSONG, WIDTH_BTN, HEIGHT_BTN);\r\n\t\tframe.getContentPane().add(btnAddSong);\r\n\t\t\r\n\t\tJTextPane txtpnBlancoYNegro = new JTextPane();\r\n\t\ttxtpnBlancoYNegro.setText(\"Blanco y negro\\r\\nThe Spectre\\r\\nGirasoles\\r\\nFaded\\r\\nTu Foto\\r\\nEsencial\");\r\n\t\ttxtpnBlancoYNegro.setBounds(X_TXT, Y_TXT, WIDTH_TXT, HEIGHT_TXT);\r\n\t\tframe.getContentPane().add(txtpnBlancoYNegro);\r\n\t\t\r\n\t\tJLabel lblSongs = new JLabel(\"Songs\");\r\n\t\tlblSongs.setBounds(X_LBL, Y_LBL, WIDTH_LBL, HEIGHT_LBL);\r\n\t\tframe.getContentPane().add(lblSongs);\r\n\t\t\r\n\t\tJButton btnAddAlbum = new JButton(\"Add album\");\r\n\t\tbtnAddAlbum.setBounds(X_BTN, Y_ADDALBUM, WIDTH_BTN, HEIGHT_BTN);\r\n\t\tframe.getContentPane().add(btnAddAlbum);\r\n\t}", "public holdersframe() {\n initComponents();\n }", "public void init() {\n\t\tsetSize(500,300);\n\t}", "private void setupFrame()\n\t\t{\n\t\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\tthis.setResizable(false);\n\t\t\tthis.setSize(800, 600);\n\t\t\tthis.setTitle(\"SEKA Client\");\n\t\t\tthis.setContentPane(panel);\n\t\t\tthis.setVisible(true);\n\t\t}", "public addStFrame() {\n initComponents();\n }", "public JFrame() {\n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame(\"View Report\");\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\n\t\tJButton backButton = new JButton(\"Back\");\n\t\tbackButton.setBounds(176, 227, 89, 23);\n\t\tframe.getContentPane().add(backButton);\n\t\tbackButton.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tframe.setVisible(false);\n\t\t\t}\n\t\t});\n\t\t\n\t\tJTextArea textArea = new JTextArea();\n\t\ttextArea.setBounds(50, 30, 298, 173);\n\t\tframe.getContentPane().add(textArea);\n\t\ttextArea.append(control.seeReport());\n\t\tframe.setVisible(true);\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() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblSubmission = new JLabel(\"Submission\");\n\t\tlblSubmission.setForeground(Color.WHITE);\n\t\tlblSubmission.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 16));\n\t\tlblSubmission.setBounds(164, 40, 83, 14);\n\t\tframe.getContentPane().add(lblSubmission);\n\t\t\n\t\tJLabel lblTitle = new JLabel(\"Title:\");\n\t\tlblTitle.setForeground(Color.WHITE);\n\t\tlblTitle.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tlblTitle.setBounds(77, 117, 41, 14);\n\t\tframe.getContentPane().add(lblTitle);\n\t\t\n\t\tJLabel lblPath = new JLabel(\"Path:\");\n\t\tlblPath.setForeground(Color.WHITE);\n\t\tlblPath.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tlblPath.setBounds(85, 155, 33, 14);\n\t\tframe.getContentPane().add(lblPath);\n\t\t\n\t\ttitle = new JTextField();\n\t\ttitle.setBounds(128, 116, 197, 20);\n\t\tframe.getContentPane().add(title);\n\t\ttitle.setColumns(10);\n\t\t\n\t\tpath = new JTextField();\n\t\tpath.setBounds(128, 154, 197, 20);\n\t\tframe.getContentPane().add(path);\n\t\tpath.setColumns(10);\n\t\t\n\t\tbtnSubmit = new JButton(\"Submit\");\n\t\tbtnSubmit.setBackground(Color.BLACK);\n\t\tbtnSubmit.setForeground(Color.WHITE);\n\t\tbtnSubmit.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tbtnSubmit.setBounds(158, 210, 89, 23);\n\t\tframe.getContentPane().add(btnSubmit);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tframe.setVisible(true);\n\t}", "public void init() {\r\n\t\t\r\n\t\tsetSize(WIDTH, HEIGHT);\r\n\t\tColor backgroundColor = new Color(60, 0, 60);\r\n\t\tsetBackground(backgroundColor);\r\n\t\tintro = new GImage(\"EvilMehranIntroGraphic.png\");\r\n\t\tintro.setLocation(0,0);\r\n\t\tadd(intro);\r\n\t\tplayMusic(new File(\"EvilMehransLairThemeMusic.wav\"));\r\n\t\tinitAnimationArray();\r\n\t\taddKeyListeners();\r\n\t\taddMouseListeners();\r\n\t\twaitForClick();\r\n\t\tbuildWorld();\r\n\t}", "public FrameIntroGUI() {\n\t\ttry {\n\t\t\tjbInit();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initialize() {\n\t\tthis.setBounds(100, 100, 950, 740);\n\t\tthis.setLayout(null);\n\n\t\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblCoisa = new JLabel(\"Coisa\");\n\t\tlblCoisa.setBounds(10, 11, 46, 14);\n\t\tframe.getContentPane().add(lblCoisa);\n\t\t\n\t\ttextField = new JTextField();\n\t\ttextField.setBounds(39, 8, 86, 20);\n\t\tframe.getContentPane().add(textField);\n\t\ttextField.setColumns(10);\n\t}", "private void initialize() {\n\t\tthis.setExtendedState(Frame.MAXIMIZED_BOTH);\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tthis.setResizable(true);\n\t\tthis.screenDimensions = Toolkit.getDefaultToolkit().getScreenSize();\n\t\tthis.getContentPane().setLayout(new BorderLayout());\n\t\t// Initialize SubComponents and GUI Commands\n\t\tthis.initializeSplitPane();\n\t\tthis.initializeExplorer();\n\t\tthis.initializeConsole();\n\t\tthis.initializeMenuBar();\n\t\tthis.pack();\n\t\tthis.hydraExplorer.refreshExplorer();\n\t}" ]
[ "0.77704835", "0.75652915", "0.7442664", "0.7369101", "0.7366378", "0.7358479", "0.73146075", "0.73096764", "0.72987294", "0.72978777", "0.7278321", "0.72729623", "0.7269468", "0.7269468", "0.7215727", "0.7180792", "0.71682984", "0.7140954", "0.7140953", "0.7126852", "0.7107974", "0.7100368", "0.7092515", "0.708178", "0.70652425", "0.70630395", "0.70621413", "0.7060283", "0.70517516", "0.7043992", "0.6996167", "0.6978269", "0.6971387", "0.6956391", "0.6938475", "0.6929829", "0.6929629", "0.69251114", "0.6921989", "0.6920365", "0.6914633", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.69020075", "0.68911743", "0.6886017", "0.6873457", "0.6870402", "0.68686837", "0.68669385", "0.686311", "0.68616706", "0.68552315", "0.68537515", "0.681551", "0.68141145", "0.68094325", "0.67992085", "0.67930394", "0.6782133", "0.6765297", "0.6748138", "0.6731745", "0.6716807", "0.6711878", "0.6706194", "0.6697453", "0.6692831", "0.66927665", "0.6689213", "0.66724384", "0.66606426", "0.664954", "0.6642464", "0.6640775", "0.6638488", "0.663824", "0.663545", "0.66264987", "0.6625419", "0.6611392", "0.6608291", "0.6600817", "0.66005784", "0.6591052", "0.65869486", "0.65862876", "0.65753394", "0.6575285", "0.6570335", "0.655961" ]
0.0
-1
Cambia el LookAndFeel al nativo del systema
private void nativeLookAndFeel() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void LookAndFeel() {\n try {\n // Set System L&F\n BasicLookAndFeel darcula = new DarculaLaf();\n UIManager.setLookAndFeel(darcula);\n } catch (UnsupportedLookAndFeelException e) {\n // handle exception\n }\n }", "private LookAndFeelManager() {}", "private void configuraInterface() {\n\t\tJFrame.setDefaultLookAndFeelDecorated(true);\n\t\ttry\t{\n\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tSystem.out.println(\"Falhou o carregamento do L&F: \");\n\t\t\tSystem.out.println(ex);\n\t\t}\n\t}", "public static void LookAndFeel() {\n\t\ttry {\n\t\t\tUIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); // uniformed\n\t\t} catch (Exception exc) {\n\t\t}\n\t}", "public void lookandfeel(){\n \n try{\n UIManager.setLookAndFeel(seta_look);\n SwingUtilities.updateComponentTreeUI(this);\n }\n catch(Exception erro){\n JOptionPane.showMessageDialog(null, erro);\n \n }\n}", "private static void setLook() {\r\n try {\r\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n } catch (IllegalAccessException ex) {\r\n ex.printStackTrace();\r\n } catch (UnsupportedLookAndFeelException ex) {\r\n ex.printStackTrace();\r\n } catch (ClassNotFoundException ex) {\r\n ex.printStackTrace();\r\n } catch (InstantiationException ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public static void setLookAndFeel(){\n\t\t\n\t\tUIManager.put(\"nimbusBase\", new Color(0,68,102));\n\t\tUIManager.put(\"nimbusBlueGrey\", new Color(60,145,144));\n\t\tUIManager.put(\"control\", new Color(43,82,102));\n\t\tUIManager.put(\"text\", new Color(255,255,255));\n\t\tUIManager.put(\"Table.alternateRowColor\", new Color(0,68,102));\n\t\tUIManager.put(\"TextField.font\", new Font(\"Font\", Font.BOLD, 12));\n\t\tUIManager.put(\"TextField.textForeground\", new Color(0,0,0));\n\t\tUIManager.put(\"PasswordField.foreground\", new Color(0,0,0));\n\t\tUIManager.put(\"TextArea.foreground\", new Color(0,0,0));\n\t\tUIManager.put(\"FormattedTextField.foreground\", new Color(0,0,0));\n\t\t\n\t\tUIManager.put(\"ComboBox:\\\"ComboBox.listRenderer\\\".background\", new Color(0,68,102));\n\t\tUIManager.put(\"ComboBox:\\\"ComboBox.listRenderer\\\"[Selected].background\", new Color(0,0,0));\n\t\t\n\t\t//TODO nie chca dzialac tooltipy na mapie\n\t\tBorder border = BorderFactory.createLineBorder(new Color(0,0,0)); //#4c4f53\n\t\tUIManager.put(\"ToolTip.border\", border);\n\n\t\t//UIManager.put(\"ToolTip.foregroundInactive\", new Color(0,0,0));\n\t\t//UIManager.put(\"ToolTip.backgroundInactive\", new Color(0,0,0));\n\t\t//UIManager.put(\"ToolTip.background\", new Color(0,0,0)); //#fff7c8\n\t\t//UIManager.put(\"ToolTip.foreground\", new Color(0,0,0));\n\t\t Painter<Component> p = new Painter<Component>() {\n\t\t public void paint(Graphics2D g, Component c, int width, int height) {\n\t\t g.setColor(new Color(20,36,122));\n\t\t //and so forth\n\t\t }\n\t\t };\n\t\t \n\t\tUIManager.put(\"ToolTip[Enabled].backgroundPainter\", p);\n\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.foregroundInactive\", new Color(255, 255, 255));\n//\t\tUIManager.getLookAndFeelDefaults().put(\"backgroundInactive\", new Color(255, 255, 255));\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.background\", new Color(255, 255, 255)); //#fff7c8\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.foreground\", new Color(255, 255, 255));\n//\t\t\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.foregroundInactive\",new ColorUIResource(new Color(255, 255, 255)));\n//\t\tUIManager.getLookAndFeelDefaults().put(\"backgroundInactive\", new ColorUIResource((new Color(255, 255, 255))));\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.background\", new ColorUIResource(new Color(255, 255, 255))); //#fff7c8\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.foreground\", new ColorUIResource(new Color(255, 255, 255)));\n\t\t\n\t \n\t\ttry {\n\t\t for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n\t\t if (\"Nimbus\".equals(info.getName())) {\n\t\t UIManager.setLookAndFeel(info.getClassName());\n\t\t break;\n\t\t }\n\t\t }\n\t\t} catch (Exception e) {\n\t\t // If Nimbus is not available, you can set the GUI to another look and feel.\n\t\t}\n\n\t\tUIManager.getLookAndFeelDefaults().put(\"Table:\\\"Table.cellRenderer\\\".background\", new ColorUIResource(new Color(74,144,178)));\n\t\tUIManager.getLookAndFeelDefaults().put(\"Table.background\", new ColorUIResource(new Color(74,144,178)));\n\t\t\n\n\t}", "public void applyLookAndFeel() {\n\r\n\t\tLookAndFeelInfo[] infos = UIManager.getInstalledLookAndFeels();\r\n\r\n\t\tif (look < 0) {\r\n\t\t\tfor (int i = 0; i < infos.length; i++) {\r\n\t\t\t\tif (infos[i].getName().toUpperCase().contains(\"NIMBUS\")) {\r\n\t\t\t\t\tlook = 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\r\n\t\tif (look < 0) {\r\n\t\t\tfor (int i = 0; i < infos.length; i++) {\r\n\t\t\t\tif (infos[i].getName().toUpperCase().contains(\"WINDOW\")) {\r\n\t\t\t\t\tlook = 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\r\n\t\tlook = (Math.abs(look) % infos.length);\r\n\r\n\t\tString lookName = infos[look].getName();\r\n\r\n\t\ttry {\r\n \t\tUIManager.setLookAndFeel(infos[look].getClassName());\r\n \t\tsetTitle(JMTKResizer.ABOUT + \" - \" + lookName);\r\n \tSwingUtilities.updateComponentTreeUI(this);\r\n \t\t//pack();\r\n\r\n \t} catch (Exception e) {\r\n \t\te.printStackTrace();\r\n \t}\r\n\t}", "private static void initLookAndFeel()\n {\n try \n {\n UIManager.setLookAndFeel(\"de.javasoft.plaf.synthetica.SyntheticaAluOxideLookAndFeel\");\n }\n \n catch(ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e)\n {\n JOptionPane.showMessageDialog(null, \"Failed to load resource package\");\n }\n }", "public static void windowLookAndFeel(){\r\n\t try{\r\n\t UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t }catch (Exception e) {\r\n\t System.out.println(\"Look and Feel error: \" + e);\r\n\t }\r\n\t}", "public JFind2() {\n try {\n String metal = \"javax.swing.plaf.metal.MetalLookAndFeel\";\n String synth = \"javax.swing.plaf.synth.SynthLookAndFeel\"; // --> since JDK-1.5\n\n String gtk = \"com.sun.java.swing.plaf.gtk.GTKLookAndFeel\"; // -> since JDK-1.4\n\n String motif = \"com.sun.java.swing.plaf.motif.MotifLookAndFeel\";\n String windows = \"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\";\n\n String os = System.getProperty(\"os.name\");\n if (os.startsWith(\"Linux\")) {\n try // Install client system look and feel.\n {\n UIManager.setLookAndFeel(metal);\n } catch (Exception e) {\n }\n } else {\n try // Install client system look and feel.\n {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n } catch (Exception e) {\n }\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n\n preInit();\n initComponents();\n postInit();\n\n }", "private void setupLookAndFeel() {\n SwingUtilities.invokeLater(() -> {\n model.getUserPreferences().getThemeSubject().subscribe((skin) -> {\n try {\n UIManager.setLookAndFeel(new SubstanceLookAndFeel(\n (SubstanceSkin) skin.getTheme().newInstance()\n ) {\n });\n if (frame != null) {\n frame.repaint();\n }\n } catch (UnsupportedLookAndFeelException | InstantiationException | IllegalAccessException e) {\n ExceptionHandler.get().handle(e);\n }\n });\n });\n }", "private void setNativeLAndF() {\r\n\t\ttry {\r\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t\t} catch (Exception e) {\r\n\t\t\t//do nothing. It will default to normal\r\n\t\t}\r\n\t}", "private static void setLookAndFeel() { \r\n try {\r\n UIManager.setLookAndFeel(\"javax.swing.plaf.metal.MetalLookAndFeel\"); \r\n } catch (final UnsupportedLookAndFeelException e) {\r\n System.out.println(\"UnsupportedLookAndFeelException\");\r\n } catch (final ClassNotFoundException e) {\r\n System.out.println(\"ClassNotFoundException\");\r\n } catch (final InstantiationException e) {\r\n System.out.println(\"InstantiationException\");\r\n } catch (final IllegalAccessException e) {\r\n System.out.println(\"IllegalAccessException\");\r\n } \r\n }", "private static void setLookAndFeel() {\n\tSystem.setProperty(\"apple.laf.useScreenMenuBar\", \"true\");\n\n\ttry {\n\t UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\n\t //copy progress bar of System LAF\n\t HashMap<Object, Object> progressDefaults = new HashMap<Object, Object>();\n\t for (Map.Entry<Object, Object> entry : UIManager.getDefaults()\n\t\t .entrySet()) {\n\t\tif (entry.getKey().getClass() == String.class\n\t\t\t&& ((String) entry.getKey()).startsWith(\"ProgressBar\")) {\n\t\t progressDefaults.put(entry.getKey(), entry.getValue());\n\t\t}\n\t }\n\n\t prepareLayout();\n\n\t UIManager\n\t\t .setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n\n\t // copy back progress bar of metal Look and Feel\n\t for (Map.Entry<Object, Object> entry : progressDefaults.entrySet()) {\n\t\tUIManager.getDefaults().put(entry.getKey(), entry.getValue());\n\t }\n\t} catch (ClassNotFoundException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (InstantiationException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (IllegalAccessException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (UnsupportedLookAndFeelException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t}\n\n }", "protected static void initLnF() {\r\n try {\r\n if (!\"com.sun.java.swing.plaf.motif.MotifLookAndFeel\".equals(UIManager.getSystemLookAndFeelClassName())\r\n && !\"com.sun.java.swing.plaf.gtk.GTKLookAndFeel\".equals(UIManager.getSystemLookAndFeelClassName())\r\n && !UIManager.getSystemLookAndFeelClassName().equals(UIManager.getLookAndFeel().getClass().getName())) {\r\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void setLAF(String lookAndFeelStr) {\n String exceptionNotice = \"\";\n try {\n // Set the font for Metal LAF to non-bold, in case Metal is used\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE);\n if (lookAndFeelStr == null || lookAndFeelStr.equalsIgnoreCase(\"Metal\")) {\n UIManager.setLookAndFeel(new MetalLookAndFeel());\n } else\n if (lookAndFeelStr.equalsIgnoreCase(\"Nimbus\")) {\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (info.getName().equals(\"Nimbus\")) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } else {\n UIManager.setLookAndFeel(lookAndFeelStr);\n }\n } catch (UnsupportedLookAndFeelException e) {\n exceptionNotice = \"UnsupportedLookAndFeelException\";\n } catch (ClassNotFoundException e) {\n exceptionNotice = \"ClassNotFoundException\";\n } catch (InstantiationException e) {\n exceptionNotice = \"InstantiationException\";\n } catch (IllegalAccessException e) {\n exceptionNotice = \"IllegalAccessException\";\n } finally {\n if (! exceptionNotice.isEmpty()) {\n try {\n // The desired LAF was not created, so try to use the Metal LAF as a default.\n UIManager.setLookAndFeel(new MetalLookAndFeel());\n } catch (UnsupportedLookAndFeelException e) {\n logger.error(\"Could not initialize the Swing Look and Feel settings, MCT is closing.\");\n System.exit(1);\n }\n }\n }\n // Look and Feel has been successfully created, now set colors\n initializeColors(UIManager.getLookAndFeel());\n Properties props = new Properties();\n String filename = System.getProperty(viewColor,\"resources/properties/viewColor.properties\");\n FileReader reader = null;\n try {\n \treader = new FileReader(filename);\n \tprops.load(reader);\n BASE_PROPERTIES = new ColorScheme(props);\n BASE_PROPERTIES.applyColorScheme(); // Apply top-level color bindings\n } catch (Exception e) {\n logger.warn(\"Using default color and font properties because could not open viewColor properties file :\"+filename);\n BASE_PROPERTIES = new ColorScheme();\n } finally {\n \ttry {\n if (reader != null) reader.close();\n } catch(IOException ioe1){ }\n }\n }", "private void applyInitialLook() {\r\n\t\tthis.control.setFont(this.initialFont);\r\n\t\tthis.control.setBackground(this.initialBackgroundColor);\r\n\t\tthis.control.setForeground(this.initialForegroundColor);\r\n\t}", "private void configureUI() {\r\n // UIManager.put(\"ToolTip.hideAccelerator\", Boolean.FALSE);\r\n\r\n Options.setDefaultIconSize(new Dimension(18, 18));\r\n\r\n Options.setUseNarrowButtons(settings.isUseNarrowButtons());\r\n\r\n // Global options\r\n Options.setTabIconsEnabled(settings.isTabIconsEnabled());\r\n UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY,\r\n settings.isPopupDropShadowEnabled());\r\n\r\n // Swing Settings\r\n LookAndFeel selectedLaf = settings.getSelectedLookAndFeel();\r\n if (selectedLaf instanceof PlasticLookAndFeel) {\r\n PlasticLookAndFeel.setPlasticTheme(settings.getSelectedTheme());\r\n PlasticLookAndFeel.setTabStyle(settings.getPlasticTabStyle());\r\n PlasticLookAndFeel.setHighContrastFocusColorsEnabled(\r\n settings.isPlasticHighContrastFocusEnabled());\r\n } else if (selectedLaf.getClass() == MetalLookAndFeel.class) {\r\n MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());\r\n }\r\n\r\n // Work around caching in MetalRadioButtonUI\r\n JRadioButton radio = new JRadioButton();\r\n radio.getUI().uninstallUI(radio);\r\n JCheckBox checkBox = new JCheckBox();\r\n checkBox.getUI().uninstallUI(checkBox);\r\n\r\n try {\r\n UIManager.setLookAndFeel(selectedLaf);\r\n } catch (Exception e) {\r\n System.out.println(\"Can't change L&F: \" + e);\r\n }\r\n\r\n }", "public static void setLookAndFeel() {\n try {\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n\n // TODO: Configure theming colors. UIManager.put(property, new Color(...));\n // {@see http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/_nimbusDefaults.html}\n\n\t\t\tfinal NimbusLookAndFeel laf = new NimbusLookAndFeel();\n UIManager.setLookAndFeel(laf);\n UIDefaults defaults = laf.getDefaults();\n defaults.put(\"List[Selected].textForeground\",\n laf.getDerivedColor(\"nimbusLightBackground\", 0.0f, 0.0f, 0.0f, 0, false));\n defaults.put(\"List[Selected].textBackground\",\n laf.getDerivedColor(\"nimbusSelectionBackground\", 0.0f, 0.0f, 0.0f, 0, false));\n defaults.put(\"List[Disabled+Selected].textBackground\",\n laf.getDerivedColor(\"nimbusSelectionBackground\", 0.0f, 0.0f, 0.0f, 0, false));\n defaults.put(\"List[Disabled].textForeground\",\n laf.getDerivedColor(\"nimbusDisabledText\", 0.0f, 0.0f, 0.0f, 0, false));\n defaults.put(\"List:\\\"List.cellRenderer\\\"[Disabled].background\",\n laf.getDerivedColor(\"nimbusSelectionBackground\", 0.0f, 0.0f, 0.0f, 0, false));\n\n } catch (Exception e) {}\n }", "private void setupSwing() {\r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n \r\n try {\r\n for (LookAndFeelInfo info: UIManager.getInstalledLookAndFeels()) {\r\n if (info.getName().equals(\"Windows\")) {\r\n UIManager.setLookAndFeel(info.getClassName());\r\n }\r\n }\r\n } catch (ClassNotFoundException \r\n | InstantiationException\r\n | IllegalAccessException \r\n | UnsupportedLookAndFeelException e) {\r\n e.printStackTrace(System.err);\r\n }\r\n \r\n window = new ManagerWindow(MetagridManager.this);\r\n window.pack();\r\n window.setVisible(true);\r\n }\r\n });\r\n }", "public Q4() {\n initComponents();\n looks=UIManager.getInstalledLookAndFeels();\n }", "public examreports() {\n dblogincred();\n initComponents();\n try {\n for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n} catch (Exception e) {\n // If Nimbus is not available, you can set the GUI to another look and feel.\n}\n }", "@Override\r\n\tprotected void init() {\r\n\r\n\t\t// enable:\r\n\t\tObject obj = UIManager.getLookAndFeelDefaults().get(this.getComponentKeyName() + \"[Enabled].foreground\");\r\n\t\tif (obj instanceof Paint) {\r\n\t\t\tthis.foregroundColorEnabled = (Paint) obj;\r\n\t\t} else {\r\n\t\t\tthis.foregroundColorEnabled = this.color2;\r\n\t\t}\r\n\r\n\t\t// disable:\r\n\t\tobj = UIManager.getLookAndFeelDefaults().get(this.getComponentKeyName() + \"[Disabled].foreground\");\r\n\t\tif (obj instanceof Paint) {\r\n\t\t\tthis.foregroundColorDisabled = (Paint) obj;\r\n\t\t} else {\r\n\t\t\tthis.foregroundColorDisabled = this.color1;\r\n\t\t}\r\n\r\n\t\t// pressed:\r\n\t\tobj = UIManager.getLookAndFeelDefaults().get(this.getComponentKeyName() + \"[Pressed].foreground\");\r\n\t\tif (obj instanceof Paint) {\r\n\t\t\tthis.foregroundColorPressed = (Paint) obj;\r\n\t\t} else {\r\n\t\t\tthis.foregroundColorPressed = this.color3;\r\n\t\t}\r\n\r\n\t\t// mouseover:\r\n\t\tobj = UIManager.getLookAndFeelDefaults().get(this.getComponentKeyName() + \"[MouseOver].foreground\");\r\n\t\tif (obj instanceof Paint) {\r\n\t\t\tthis.foregroundColorMouseOver = (Paint) obj;\r\n\t\t} else {\r\n\t\t\tthis.foregroundColorMouseOver = this.color4;\r\n\t\t}\r\n\r\n\t}", "protected void installDefaults() {\n\t\tColor bg = this.controlPanel.getBackground();\n\t\tif (bg == null || bg instanceof UIResource) {\n\t\t\tthis.controlPanel.setBackground(FlamingoUtilities.getColor(\n\t\t\t\t\tColor.lightGray, \"ControlPanel.background\",\n\t\t\t\t\t\"Panel.background\"));\n\t\t}\n\n\t\tBorder b = this.controlPanel.getBorder();\n\t\tif (b == null || b instanceof UIResource) {\n\t\t\tBorder toSet = UIManager.getBorder(\"ControlPanel.border\");\n\t\t\tif (toSet == null)\n\t\t\t\tnew BorderUIResource.EmptyBorderUIResource(1, 2, 1, 2);\n\t\t\tthis.controlPanel.setBorder(toSet);\n\t\t}\n\t\t\n\t\tFont font = this.controlPanel.getFont();\n if (font == null || font instanceof UIResource) {\n Font toSet = UIManager.getFont(\"Panel.font\");\n this.controlPanel.setFont(toSet);\n }\n\t}", "@Override\n\tpublic LookAndFeelMenu createLookAndFeelMenu() {\n\t\treturn null;\n\t}", "public void loadSkin()\n {\n try\n {\n bgImage = ImageIO.read(BrandingActivator.getResources().\n getImageURL(\"plugin.branding.ABOUT_WINDOW_BACKGROUND\"));\n\n this.setPreferredSize(new Dimension(bgImage.getWidth(this),\n bgImage.getHeight(this)));\n }\n catch (IOException e)\n {\n logger.error(\"Error cannot obtain background image\", e);\n bgImage = null;\n }\n }", "public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException,\n\t\t\tUnsupportedLookAndFeelException {\n\t\tdetermineOS();\n\t\tif (currentOs == MAC_OS) {\n\t\t\tSystem.setProperty(\"com.apple.mrj.application.apple.menu.about.name\", \"UP-Admin\");\n\t\t\tSystem.setProperty(\"apple.laf.useScreenMenuBar\", \"true\");\n\t\t\tSystem.setProperty(\"com.apple.mrj.application.live-resize\", \"true\");\n\n\t\t\ttry {\n\t\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (InstantiationException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (UnsupportedLookAndFeelException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else if ((currentOs == WIN_OS) || (currentOs == null)) {\n\n\t\t\tUIManager.put(\"nimbusBase\", new Color(0x525252));\n\t\t\tUIManager.put(\"control\", new Color(0x949494));\n\t\t\tUIManager.put(\"nimbusSelectionBackground\", new Color(0x171717));\n\t\t\tUIManager.put(\"Menu.background\", new Color(0x2B2B2B));\n\t\t\tUIManager.put(\"background\", new Color(0x171717));\n\t\t\tUIManager.put(\"DesktopIcon.background\", new Color(0x171717));\n\t\t\tUIManager.put(\"nimbusLightBackground\", new Color(0xE3E3E3));\n\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n\t\t\t\n\t\t}\n\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tFrame frame = new Frame();\n\t\t\t\t\tframe.setVisible(true);\n\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}", "private void setAppearance(String className) {\n DweezilUIManager.setLookAndFeel(className, new Component[]{MainFrame.getInstance(), StatusWindow.getInstance(),\n PrefsSettingsPanel.this.getParent().getParent()});\n\n }", "public Mainwindow(){\n \n try \n {\n //LookAndFeel asd = new SyntheticaAluOxideLookAndFeel();\n //UIManager.setLookAndFeel(asd);\n } \n catch (Exception e) \n {\n e.printStackTrace();\n }\n initComponents();\n \n \n userinitComponents();\n \n \n }", "private void initialization() {\n this.setLocationRelativeTo(null);\n this.setDefaultCloseOperation(HIDE_ON_CLOSE);\n inputSearch.setBackground(new Color(0,0,0,0));\n inputSearch.setBorder(BorderFactory.createMatteBorder(0, 0, 2, 0, new Color(12,152,232)));\n }", "public void setTheme(String name) {\n\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (name.equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n }", "public void setTheme(){\r\n\r\n for (int i = 0; i < 3; i++) {\r\n\r\n buttons[i].setBackground(theme.getButtonTheme()[0][0]);\r\n buttons[i].setForeground(theme.getButtonTheme()[0][1]);\r\n\r\n if(i < 2) {\r\n\r\n panels[i].setBackground(theme.getBackGroundTheme()[0]);\r\n\r\n }\r\n\r\n }\r\n\r\n menuBars[0].setBackground(theme.getInsomniaTheme()[0]);\r\n\r\n menus[0].setForeground(theme.getInsomniaTheme()[1]);\r\n\r\n buttons[0].setIcon(new ImageIcon(theme.getAddressIcons()+\"icons8_list_30px.png\"));\r\n\r\n buttons[1].setIcon(new ImageIcon(theme.getAddressIcons()+\"icons8_sort_down_10px.png\"));\r\n\r\n buttons[2].setIcon(new ImageIcon(theme.getAddressIcons()+\"icons8_sort_down_&&_plus_25px.png\"));\r\n\r\n menus[2].getItem(0).setIcon(new ImageIcon(theme.getAddressIcons()+\"icons8_joyent_15px.png\"));\r\n menus[2].getItem(1).setIcon(new ImageIcon(theme.getAddressIcons()+\"icons8_doctors_folder_15px.png\"));\r\n\r\n filter.setBackground(theme.getTextFieldTheme()[0][0]);\r\n filter.setForeground(theme.getTextFieldTheme()[0][1]);\r\n\r\n }", "public Lent() {\n\t\tinitComponents();\n\t\tthis.setBounds(150, 50, 1050, 650);\n\t\t//设置背景\n\t\tsetBackgroudImage();\n\t\t//窗体大小不可变\n\t\tthis.setResizable(false);\n\t\t//设置窗体图标\n\t\tToolkit tool = this.getToolkit(); //得到一个Toolkit对象\n\t\tImage myimage = tool.getImage(\"img/4.png\"); //由tool获取图像\n\t\tthis.setIconImage(myimage);\n\t}", "static public LookAndFeelManager createDefaultLookAndFeelManager()\n {\n LookAndFeelManager manager = new LookAndFeelManager();\n\n /* =-=AEW DO NOT register the external look-and-feels; these\n class names are UIX 2.2 look-and-feels, which won't (and can't)\n work in UIX 3, given the different class names. Only uncomment\n if and when such classes are ported to UIX 3.\n // support requests from iasWireless if laf can be found\n _registerExternalLookAndFeel(manager, iaswLaf, _IASW_SCORER);\n\n // register OA's Text LAF if laf can be found\n _registerExternalLookAndFeel(manager, _OA_TEXT_LAF, _OA_TEXT_SCORER);\n */\n\n // Base lafs\n BaseDesktopUtils.registerLookAndFeel(manager);\n\n SimpleDesktopUtils.registerLookAndFeel(manager);\n SimplePdaUtils.registerLookAndFeel(manager);\n\n return manager;\n }", "public final static void setDesign() {\n\t\t\ttry{\n\t\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n\t\t\t}catch(Exception e){\n\t\t\t\tSystem.out.println(\"Prob with setDesign()\");\n\t\t\t}\n\t\t\t\n\t\t}", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\ttry {\r\n\t\t\tString className = UIManager.getCrossPlatformLookAndFeelClassName();\r\n\t\t\tUIManager.setLookAndFeel(className);\r\n\t\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\t\r\n\t\t}\r\n\t\t\tEventQueue.invokeLater(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\t@SuppressWarnings(\"unused\")\r\n\t\t\t\tGUIMemoryCards vista = new GUIMemoryCards();\r\n\t\t\t\t}\r\n\t\t\t});\t\r\n\t}", "private void setupGUI() {\r\n\t\tPaperToolkit.initializeLookAndFeel();\r\n\t\tgetMainFrame();\r\n\t}", "public void initialize() throws BackingStoreException {\n\t\t /*try {\n\t\t UIManager.setLookAndFeel( UIManager.getCrossPlatformLookAndFeelClassName() );\n\t\t } catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t }*/\n\t \n\t\tgetChordManager();\n\t\tservoSettings = ServoSettings.loadCorrectionsFrom(new File(preferences.getCorrectionsFile()), ROBOTAR_FOLDER);\n\t\tmessages = ResourceBundle.getBundle(\"com.robotar.util.RoboTarBundle\", preferences.getLocale());\n\t\t\n\t\tfrmBlueAhuizote = new JFrame();\n\t\t\n\t\tJPanel frmBlueAhuizotePC = new JPanel() {\n\n\t\t\t@Override\n\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\n\t\t RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t \n\t\t GradientPaint gp = new GradientPaint(0, 0,\n\t\t Const.BACKGROUND_COLOR.brighter(), 0, getHeight(),\n\t\t Color.BLUE);\n\t\t \n\t\t g2d.setPaint(gp);\n\t\t g2d.fillRect(0, 0, getWidth(), getHeight());\n\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t}\n\t\t};\n\t\tfrmBlueAhuizotePC.setOpaque(false);\n\t\tfrmBlueAhuizote.setContentPane(frmBlueAhuizotePC);\n\t\t//frmBlueAhuizote.setBackground(new Color(0, 0, 255));\n\t\t//frmBlueAhuizote.setBounds(100, 100, 800, 600);\n\t\t//frmBlueAhuizote.getContentPane().setBackground(Color.BLUE); //Const.BACKGROUND_COLOR);\n\t\tfrmBlueAhuizote.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);\n\t\tfrmBlueAhuizote.getContentPane().setLayout(new BorderLayout(0, 0));\n\t\tfrmBlueAhuizotePC.setBorder(new EmptyBorder(5, 5, 5, 5));\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"\");\n\t\tlblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tjava.net.URL res = RoboTarPC.class.getResource(\"/data/BlueAhuizoteIcon.png\");\n\t\tlblNewLabel.setIcon(new ImageIcon(res));\n\t\t//lblNewLabel.setIcon(new ImageIcon(RoboTarStartPage.class.getResource(\"/data/BlueAhuizoteIcon.png\")));\n\t\tlblNewLabel.setBorder(null);\n\t\tfrmBlueAhuizote.getContentPane().add(lblNewLabel, BorderLayout.WEST);\n\t\t\n\t\tAction startChordsAction = new StartChordsPageAction(messages.getString(\"robotar.menu.chords\"), KeyEvent.VK_C);\n\t\tbtnChords = new JButton(\"\");\n\t\tbtnChords.addActionListener(startChordsAction);\n\t\tbtnChords.setBorderPainted(false);\n\t\tbtnChords.setMargin(new Insets(0, 0, 0, 0));\n\t\tbtnChords.setToolTipText(\"Create or Browse Chords\");\n\t\tbtnChords.setIcon(new ImageIcon(RoboTarPC.class.getResource(\"/data/chords.png\")));\n\t\tfrmBlueAhuizote.getContentPane().add(btnChords, BorderLayout.CENTER);\n\t\t\n\t\tAction startSongsAction = new StartSongsPageAction(messages.getString(\"robotar.menu.songs\"), KeyEvent.VK_S);\n\t\tbtnSongs = new JButton(\"\");\n\t\tbtnSongs.addActionListener(startSongsAction);\n\t\tbtnSongs.setBorderPainted(false);\n\t\tbtnSongs.setMargin(new Insets(0, 0, 0, 0));\n\t\tbtnSongs.setToolTipText(\"Select or Create Songs\");\n\t\tbtnSongs.setIcon(new ImageIcon(RoboTarPC.class.getResource(\"/data/SheetMusic.png\")));\n\t\tfrmBlueAhuizote.getContentPane().add(btnSongs, BorderLayout.EAST);\n\t\t\n\t\tioioReconnectAction = new IOIOReconnectAction(messages.getString(\"robotar.menu.reconnect\"), KeyEvent.VK_R);\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"\");\n\t\tlblNewLabel_1.setForeground(new Color(30, 144, 255));\n\t\tlblNewLabel_1.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tlblNewLabel_1.setIcon(new ImageIcon(RoboTarPC.class.getResource(\"/data/RoboTarLogoFont3.png\")));\n\t\tlblNewLabel_1.setBackground(Color.GRAY);\n\t\tfrmBlueAhuizote.getContentPane().add(lblNewLabel_1, BorderLayout.NORTH);\n\t\t\n\t\tJLabel lblNewLabel_2 = new JLabel(\"\");\n\t\tlblNewLabel_2.setIcon(new ImageIcon(RoboTarPC.class.getResource(\"/data/junglespeakermountainsmall.png\")));\n\t\tlblNewLabel_2.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tfrmBlueAhuizote.getContentPane().add(lblNewLabel_2, BorderLayout.SOUTH);\n\t\t\n frmBlueAhuizote.addWindowListener(new ExitAdapter());\n \n\t\tJMenuBar menuBar = new JMenuBar();\n\t\tfrmBlueAhuizote.setJMenuBar(menuBar);\n\t\t\n\t\tJMenu mnFileMenu = new JMenu(messages.getString(\"robotar.menu.file\"));\n\t\tmenuBar.add(mnFileMenu);\n\t\t\n\t\tJMenuItem mntmAbout = new JMenuItem(new AboutAction(messages.getString(\"robotar.menu.about\")));\n\t\tmnFileMenu.add(mntmAbout);\n\t\t\n\t\tJMenuItem mntmExit = new JMenuItem(messages.getString(\"robotar.menu.exit\"));\n\t\tmntmExit.addActionListener(new ExitListener());\n\t\tmntmExit.setMnemonic(KeyEvent.VK_X);\n\t\tmnFileMenu.add(mntmExit);\n\t\t\n\t\tJMenu mnLauncher = new JMenu(messages.getString(\"robotar.menu.launcher\"));\n\t\tmenuBar.add(mnLauncher);\n\t\t\n\t\tJMenuItem mntmChords = new JMenuItem(startChordsAction);\n\t\tmnLauncher.add(mntmChords);\n\t\t\n\t\tJMenuItem mntmSongs = new JMenuItem(startSongsAction);\n\t\tmnLauncher.add(mntmSongs);\n\t\t\n\t\tJMenu mnIOIO = new JMenu(messages.getString(\"robotar.menu.ioio\"));\n\t\tmenuBar.add(mnIOIO);\n\t\t\n\t\tJMenuItem mntmReconnect = new JMenuItem(ioioReconnectAction);\n\t\tioioReconnectAction.setEnabled(false); // until it will be implemented...\n\t\tmnIOIO.add(mntmReconnect);\n\t\t\n\t\tJMenu mnUtilities = new JMenu(messages.getString(\"robotar.menu.utilities\"));\n\t\tmenuBar.add(mnUtilities);\n\t\t\n\t\tJMenuItem corr = new JMenuItem(new CorrectionsAction(messages.getString(\"robotar.menu.servo_corrections\"), KeyEvent.VK_E));\n\t\tmnUtilities.add(corr);\n\t\t\n\t\tJMenuItem mntmSettings = new JMenuItem(new StartSettingsPageAction(messages.getString(\"robotar.menu.settings\"), KeyEvent.VK_T));\n\t\tmnUtilities.add(mntmSettings);\n\t\t\n\t\tJMenuItem mntmTuner = new JMenuItem(messages.getString(\"robotar.menu.tuner\"));\n\t\tmntmTuner.setEnabled(false);\n\t\tmnUtilities.add(mntmTuner);\n\t\t\n\t\tJMenuItem mntmMetronome = new JMenuItem(messages.getString(\"robotar.menu.metronome\"));\n\t\tmntmMetronome.setEnabled(false);\n\t\tmnUtilities.add(mntmMetronome);\n\t\t\n\t\tJMenuItem mntmSongDownloads = new JMenuItem(messages.getString(\"robotar.menu.song_downloads\"));\n\t\tmntmSongDownloads.setEnabled(false);\n\t\tmnUtilities.add(mntmSongDownloads);\n\t\t\n\t\tfinal JCheckBoxMenuItem mntmShow = new JCheckBoxMenuItem(messages.getString(\"robotar.menu.show\"));\n\t\tmnUtilities.add(mntmShow);\n\t\tmntmShow.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tshowChecked = !showChecked;\n\t\t\t\tmntmShow.setSelected(showChecked);\n\t\t\t\tif (patterns != null && !showChecked) {\n\t\t\t\t\tpatterns.quit();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tJMenu mnLang = new JMenu(messages.getString(\"robotar.menu.lang_sel\"));\n\t\tmenuBar.add(mnLang);\n\t\t\n\t\tJMenuItem mntmEnglish = new JMenuItem(messages.getString(\"robotar.menu.english\"));\n\t\tmnLang.add(mntmEnglish);\n\t\tmntmEnglish.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tupdateLocale(Locale.ENGLISH);\n\t\t\t}\n\t\t});\n\t\tJMenuItem mntmSpanish = new JMenuItem(messages.getString(\"robotar.menu.spanish\"));\n\t\t//mntmSpanish.setEnabled(false);\n\t\tmnLang.add(mntmSpanish);\n\t\tmntmSpanish.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tupdateLocale(new Locale(\"es\", \"ES\"));\n\t\t\t}\n\t\t});\n\t\tJMenuItem mntmCzech = new JMenuItem(messages.getString(\"robotar.menu.czech\"));\n\t\tmnLang.add(mntmCzech);\n\t\tmntmCzech.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tupdateLocale(new Locale(\"cs\", \"CZ\"));\n\t\t\t}\n\t\t});\n\t\tJMenuItem mntmGerman = new JMenuItem(messages.getString(\"robotar.menu.german\"));\n\t\tmnLang.add(mntmGerman);\n\t\tmntmGerman.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tupdateLocale(new Locale(\"de\", \"DE\"));\n\t\t\t}\n\t\t});\n\t\t\n\t\tJMenu mnHelp = new JMenu(messages.getString(\"robotar.menu.help\"));\n\t\tmenuBar.add(mnHelp);\n\t\t\n\t\tAction startHelpAction = new StartHelpPageAction(messages.getString(\"robotar.menu.help\"), KeyEvent.VK_H);\n\t\tJMenuItem mntmHelp = new JMenuItem(messages.getString(\"robotar.menu.robotar_help\"));\n\t\tmnHelp.add(mntmHelp);\n\t\tmntmHelp.addActionListener(startHelpAction);\n\t\t\n\t\t\n\t\tfrmBlueAhuizote.setSize(818, 560);\n\t\tfrmBlueAhuizote.setPreferredSize(new Dimension(818, 560));\n\t\tfrmBlueAhuizote.pack();\n\t\tfrmBlueAhuizote.setLocationByPlatform(true);\n\t\tfrmBlueAhuizote.setVisible(true);\n\t\tfrmBlueAhuizote.setTitle(messages.getString(\"robotar.name\"));\n\t\t\n\t\t// display warning if device not yet configured!\n\t\tif (!servoSettings.isAnyCorrectionSet()) {\n\t\t\t// this is crucial, therefore it is modal dialog box (connection to ioio is stopped)\n\t\t\tJOptionPane.showMessageDialog(frmBlueAhuizote, \n\t\t\t\t\tmessages.getString(\"robotar.corrections.notset\"), \n\t\t\t\t\t\"RoboTar WARNING\", JOptionPane.WARNING_MESSAGE);\n\t\t}\n\t\t\n\t\t// check for newer versions\n\t\tif (displayVersionNotification() && isNewerVersionAvailable()) {\n\t\t\t// this is informational only, therefore it is modeless, connection to ioio continues\n\t\t\tJDialog dialog3 = new JDialog(frmBlueAhuizote, messages.getString(\"robotar.version.title\"));\n\t\t dialog3.setBounds(200, 300, 500, 120);\n\t\t dialog3.setBackground(Const.BACKGROUND_COLOR);\n\t\t\t\n\t\t JLabel label = new JLabel(MessageFormat.format(messages.getString(\"robotar.version.available\"), remoteVersion));\n\t\t JLabel labelYours = new JLabel(MessageFormat.format(messages.getString(\"robotar.version.yours\"), localVersion));\n\t\t JTextField textUrl = new JTextField(\"https://github.com/kleekru/RoboTarPC/releases/latest\");\n\t\t textUrl.setEditable(false);\n\t\t JLabel labelDesc = new JLabel(messages.getString(\"robotar.version.desc\"));\n\t\t dialog3.getContentPane().setLayout(new BoxLayout(dialog3.getContentPane(), BoxLayout.Y_AXIS));\n\t\t dialog3.getContentPane().add(label);\n\t\t dialog3.getContentPane().add(labelYours);\n\t\t dialog3.getContentPane().add(labelDesc);\n\t\t dialog3.getContentPane().add(textUrl);\n\t\t //dialog3.pack();\n\t\t dialog3.setVisible(true);\n\t\t dialog3.repaint();\n\t\t}\n\t}", "public void initGui() {\n setOpaque(true);\n // Setter utgangsfargen til ruten\n if (this.farge.equals(\"hvit\")) setBackground(GUISettings.Hvit());\n if (this.farge.equals(\"sort\")) setBackground(GUISettings.Sort());\n if (this.farge.equals(\"roed\")) setBackground(GUISettings.Roed());\n if (this.farge.equals(\"blaa\")) setBackground(GUISettings.Blaa());\n }", "public void Themes21()\n {\n theme2= new Label(\"Theme\");\n theme2.setPrefWidth(150);\n theme2.setFont(new Font(13));\n theme2.setPrefHeight(40);\n theme2.setBackground(new Background(new BackgroundFill(Color.YELLOW,CornerRadii.EMPTY,Insets.EMPTY)));\n \n \n dikoma2 = new Label(\"Dikoma\");\n dikoma2.setFont(new Font(13));\n dikoma2.setPrefWidth(150);\n dikoma2.setPrefHeight(40);\n dikoma2.setBackground(new Background(new BackgroundFill(Color.GREEN,CornerRadii.EMPTY,Insets.EMPTY)));\n \n diagelo2 = new Label(\"Diagelo\");\n diagelo2.setFont(new Font(13));\n diagelo2.setPrefWidth(150);\n diagelo2.setPrefHeight(40);\n diagelo2.setBackground(new Background(new BackgroundFill(Color.YELLOW,CornerRadii.EMPTY,Insets.EMPTY)));\n \n \n abuse2 = new Label(\"Woman & children abuse\");\n abuse2.setPrefWidth(150);\n abuse2.setFont(new Font(13));\n abuse2.setPrefHeight(40);\n abuse2.setBackground(new Background(new BackgroundFill(Color.GREEN,CornerRadii.EMPTY,Insets.EMPTY)));\n \n \n trafficking2 = new Label(\"Human trafficking\");\n trafficking2.setFont(new Font(13));\n trafficking2.setPrefWidth(150);\n trafficking2.setPrefHeight(40);\n trafficking2.setBackground(new Background(new BackgroundFill(Color.YELLOW,CornerRadii.EMPTY,Insets.EMPTY)));\n }", "protected void installDefaults() {\n this.controlPanel.setBackground(null);\n\n Font font = this.controlPanel.getFont();\n if (font == null || font instanceof UIResource) {\n Font toSet = RadianceThemingCortex.GlobalScope.getFontPolicy().getFontSet().\n getControlFont();\n this.controlPanel.setFont(toSet);\n }\n }", "public void Themes31()\n {\n theme3= new Label(\"Theme\");\n theme3.setPrefWidth(150);\n theme3.setFont(new Font(13));\n theme3.setPrefHeight(40);\n theme3.setBackground(new Background(new BackgroundFill(Color.YELLOW,CornerRadii.EMPTY,Insets.EMPTY)));\n \n \n dikoma3 = new Label(\"Dikoma\");\n dikoma3.setFont(new Font(13));\n dikoma3.setPrefWidth(150);\n dikoma3.setPrefHeight(40);\n dikoma3.setBackground(new Background(new BackgroundFill(Color.GREEN,CornerRadii.EMPTY,Insets.EMPTY)));\n \n diagelo3 = new Label(\"Diagelo\");\n diagelo3.setFont(new Font(13));\n diagelo3.setPrefWidth(150);\n diagelo3.setPrefHeight(40);\n diagelo3.setBackground(new Background(new BackgroundFill(Color.YELLOW,CornerRadii.EMPTY,Insets.EMPTY)));\n \n \n abuse3 = new Label(\"Woman & children abuse\");\n abuse3.setPrefWidth(150);\n abuse3.setFont(new Font(13));\n abuse3.setPrefHeight(40);\n abuse3.setBackground(new Background(new BackgroundFill(Color.GREEN,CornerRadii.EMPTY,Insets.EMPTY)));\n \n \n trafficking3 = new Label(\"Human trafficking\");\n trafficking3.setFont(new Font(13));\n trafficking3.setPrefWidth(150);\n trafficking3.setPrefHeight(40);\n trafficking3.setBackground(new Background(new BackgroundFill(Color.YELLOW,CornerRadii.EMPTY,Insets.EMPTY)));\n }", "private void configuracoes() {\n setLocationRelativeTo(null);\n this.setIconImage(new ImageIcon(getClass().getResource(SystemMessage.IMAGE_URL)).getImage());\n this.setTitle(SystemMessage.SYSTEM_NAME + \" -\");\n }", "private String getLookAndFeelClassName(String nimbus) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@Override\n public void initStyle() {\n\t// NOTE THAT EACH CLASS SHOULD CORRESPOND TO\n\t// A STYLE CLASS SPECIFIED IN THIS APPLICATION'S\n\t// CSS FILE\n \n // FOR CHANGING THE ITEMS INSIDE THE EDIT TOOLBAR\n editToolbarPane.getStyleClass().add(CLASS_EDITTOOLBAR_PANE);\n \n mapNameLabel.getStyleClass().add(CLASS_MAPNAME_LABEL);\n mapName.getStyleClass().add(CLASS_MAPNAME_TEXTFIELD);\n backgroundColorLabel.getStyleClass().add(CLASS_LABEL);\n borderColorLabel.getStyleClass().add(CLASS_LABEL);\n borderThicknessLabel.getStyleClass().add(CLASS_LABEL);\n zoomLabel.getStyleClass().add(CLASS_MAPNAME_LABEL);\n borderThicknessSlider.getStyleClass().add(CLASS_BORDER_SLIDER);\n mapZoomingSlider.getStyleClass().add(CLASS_ZOOM_SLIDER);\n buttonBox.getStyleClass().add(CLASS_PADDING);\n // FIRST THE WORKSPACE PANE\n workspace.getStyleClass().add(CLASS_BORDERED_PANE);\n }", "private void initUI() {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\trenderer = new LWJGLRenderer();\n\t\t\tgui = new GUI(stateWidget, renderer);\n\t\t\tthemeManager = ThemeManager.createThemeManager(StateWidget.class.getResource(\"gameui.xml\"), renderer);\n\t\t\tgui.applyTheme(themeManager);\n\t\t\t\n\t\t} catch (LWJGLException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initMainComponents() {\n\t\tsetBackground(Color.RED);\n\t\tsetTitle(\"TABL\");\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tsetBounds(100, 100, 974, 842);\n\t\tcontentPane = new JPanel();\n\t\tcontentPane.setBackground(new Color(100, 149, 237));\n\t\tcontentPane.setBorder(new EmptyBorder(5, 5, 5, 5));\n\t\tsetContentPane(contentPane);\n\t\t\n\t\tcontentPane.setVisible(true);\n\t\tcontentPane.setLayout(null);\n\t\t\n\t\t\n\t\tlayeredPane = new JLayeredPane();\n\t\tlayeredPane.setBounds(10, 40, 941, 757);\n\t\tcontentPane.add(layeredPane);\n\t\t\n\t\tsetForeground(Color.BLACK);\n\t\tsetIconImage(Toolkit.getDefaultToolkit().getImage(AdminManageUsers.class.getResource(\"/resources/Logo.PNG\")));\n\n\t}", "private static void createAndShowGUI() {\n\t\tJFrame.setDefaultLookAndFeelDecorated(true);\n\n\t\tLevelEditor le = new LevelEditor();\n\t}", "public MainWindowAlt() {\n initComponents();\n //this.getContentPane().setBackground(Color.CYAN);\n }", "@SuppressWarnings(\"unused\")\n private static void activateNimbus() //just for testing reasons\n {\n try {\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (Exception e) {\n log.warn(\"error in nimbus activation?\", e);\n }\n }", "public HomeScreen() {\n initComponents();\n pnlInicio.setVisible(true);\n pnlConselhos.setVisible(false);\n pnlDisciplinas.setVisible(false);\n pnlProfessores.setVisible(false);\n pnlAlunos.setVisible(false);\n pnlResponsaveis.setVisible(false);\n pnlCoordenadores.setVisible(false);\n pnlCursos.setVisible(false);\n pnlEtapas.setVisible(false);\n \n \n tabInicio.setBackground(new Color(255,255,255));\n tabAlunos.setBackground(new Color(204,204,255));\n tabDisciplinas.setBackground(new Color(204,204,255));\n tabProfessores.setBackground(new Color(204,204,255));\n tabConselhos.setBackground(new Color(204,204,255));\n tabTecAdm.setBackground(new Color(204,204,255));\n tabCursos.setBackground(new Color(204,204,255));\n tabResponsaveis.setBackground(new Color(204,204,255));\n tabEtapas.setBackground(new Color(204,204,255));\n \n //moque();\n CmbBoxCursos();\n \n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\"> \n private void initComponents() {\n\n setBackground(new java.awt.Color(102, 0, 102));\n setForeground(new java.awt.Color(153, 0, 102));\n\n org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 300, Short.MAX_VALUE)\n );\n }", "private void initComponents() {\n\n setBackground(java.awt.Color.lightGray);\n setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 394, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 294, Short.MAX_VALUE)\n );\n }", "public static String setLookAndFeel(String look) {\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE); //$NON-NLS-1$\n // Display slider value is set to false (already in all LAF by the panel title), used by GTK LAF\n UIManager.put(\"Slider.paintValue\", Boolean.FALSE); //$NON-NLS-1$\n\n String laf = getAvailableLookAndFeel(look);\n try {\n UIManager.setLookAndFeel(laf);\n } catch (Exception e) {\n laf = UIManager.getSystemLookAndFeelClassName();\n LOGGER.error(\"Unable to set the Look&Feel\", e); //$NON-NLS-1$\n }\n // Fix font issue for displaying some Asiatic characters. Some L&F have special fonts.\n setUIFont(new javax.swing.plaf.FontUIResource(\"SansSerif\", Font.PLAIN, 12)); //$NON-NLS-1$\n return laf;\n }", "static public LookAndFeelManager getDefaultLookAndFeelManager()\n {\n if (_sDefaultInstance == null)\n _sDefaultInstance = createDefaultLookAndFeelManager();\n\n return _sDefaultInstance;\n }", "public Egresos() {\n this.setUndecorated(true);\n initComponents();\n }", "public MuestraColores() {\n\t\tenableEvents(64L);\n\t\ttry {\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tinitialize();\n\t}", "private void configureWindow() {\n\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n background.setBackground(Color.BLACK);\n setSize(initialWindowWidth, initialWindowHeight);\n setVisible(true);\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n \n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n \n \n /* Create and display the form */ \n \n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new home().setVisible(true);\n }\n });\n }", "public String _buildtheme() throws Exception{\n_theme.Initialize(\"pagetheme\");\r\n //BA.debugLineNum = 91;BA.debugLine=\"theme.AddABMTheme(ABMShared.MyTheme)\";\r\n_theme.AddABMTheme(_abmshared._mytheme);\r\n //BA.debugLineNum = 94;BA.debugLine=\"theme.AddLabelTheme(\\\"lightblue\\\")\";\r\n_theme.AddLabelTheme(\"lightblue\");\r\n //BA.debugLineNum = 95;BA.debugLine=\"theme.Label(\\\"lightblue\\\").ForeColor = ABM.COLOR_LI\";\r\n_theme.Label(\"lightblue\").ForeColor = _abm.COLOR_LIGHTBLUE;\r\n //BA.debugLineNum = 96;BA.debugLine=\"End Sub\";\r\nreturn \"\";\r\n}", "private void setBackgrond(){\t\n this.background = new JLabel();\n this.background.setIcon(backgrondP);\n this.background.setVisible(true);\n this.background.setLocation(0, 0);\n this.background.setSize(backgrondP.getIconWidth(),backgrondP.getIconHeight());\n this.add(background);\n\t}", "private void initialize() {\r\n this.setSize(new Dimension(374, 288));\r\n this.setContentPane(getJPanel());\r\n this.setResizable(false);\r\n this.setModal(true);\r\n this.setTitle(\"颜色选择面板\");\r\n addJPanel();\r\n\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\ttry{\n\t\t\t\tUIManager.setLookAndFeel(className);\n\t\t\t\tSwingUtilities.updateComponentTreeUI(PlatFrame.this);\n\t\t\t\tpack();\n\t\t\t}catch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public CalculatorGUI() {\n initComponents();\n setTitle(\"Calculator\");\n //setLookAndFeel(\"Windows\");\n }", "private void appearance()\r\n\t\t{\n\t\tgridLayout.setHgap(5);\r\n\t\tgridLayout.setVgap(5);\r\n\r\n\t\t//set the padding + external border with title inside the box\r\n\t\tBorder lineBorder = BorderFactory.createLineBorder(Color.BLACK);\r\n\t\tBorder outsideBorder = BorderFactory.createTitledBorder(lineBorder, title, TitledBorder.CENTER, TitledBorder.TOP);\r\n\t\tBorder marginBorder = BorderFactory.createEmptyBorder(5, 5, 5, 5);\r\n\t\tthis.setBorder(BorderFactory.createCompoundBorder(outsideBorder, marginBorder));\r\n\r\n\t\t//set initial value to builder\r\n\t\tdiceBuilder.setInterval(min, max);\r\n\t\t}", "private void initDesign(){\n\t\tlabel.setLayoutX(xPos);\n\t\tlabel.setLayoutY(yPos);\n\t\tlabel.setStyle(\"-fx-border-color: green\");\n\t}", "public Main() throws FileNotFoundException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {\n\n setIconImage(new javax.swing.ImageIcon(getClass().getResource(\"/images/receiptsList.png\")).getImage());\n createDirs();\n // if (Options.toBoolean(Options.DEBUG)) {\n createLogger();\n // }\n Options.getOptions();\n Fonts f = new Fonts();\n f.setDefaultFont(\"Arial\");\n LookAndFeels laf = new LookAndFeels();\n try {\n laf.setLookAndFeel(Options.toString(Options.LOOK_FEEL));\n } catch (Exception ex) {\n try {\n laf.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());\n } catch (Exception ex1) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex1);\n }\n }\n SwingUtilities.updateComponentTreeUI(this);\n\n \n //Skin skin = new Skin(Color.yellow);\n //Skin.applySkin();\n\n logger.log(Level.INFO, \"Initializing components\");\n initComponents();\n\n glassPane = new MyDisabledGlassPane();\n JRootPane root = SwingUtilities.getRootPane(this);\n root.setGlassPane(glassPane);\n logger.log(Level.FINE, \"Components initialized\");\n logger.log(Level.INFO, \"Creating connection to database\");\n Database.createConnection(false);\n if (Options.toBoolean(Options.START_UP_BACKUP)) {\n backUpDb();\n }\n logger.log(Level.FINE, \"Connected to database: {0}\", Options.toString(Options.DATABASE));\n logger.log(Level.INFO, \"Setting the year\");\n setYear();\n logger.log(Level.FINE, \"Year set to : {0}\", Options.YEAR);\n setAppTitle();\n logger.log(Level.INFO, \"Updating panels\");\n updateReceiptPanel();\n updateTotalsPanel();\n logger.log(Level.FINE, \"Panels updated\");\n setLocationRelativeTo(null);\n if (Options.toBoolean(Options.AUTO_UPDATE)) {\n CheckUpdate c = new CheckUpdate(true);\n }\n setVisible(true);\n\n }", "protected void uninstallDefaults() {\n LookAndFeel.uninstallBorder(this.controlPanel);\n }", "public static void main(String[] args) {\r\n SageLife sagelife = new SageLife();\r\n\r\n try {\r\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\r\n if (\"Nimbus\".equals(info.getName())) {\r\n UIManager.setLookAndFeel(info.getClassName());\r\n break;\r\n }\r\n }\r\n } catch (Exception e) {\r\n // If Nimbus is not available, you can set the GUI to another look and feel.\r\n }\r\n\r\n sagelife.createLayout();\r\n }", "public Libreta() {\n\n this.setUndecorated(true);\n initComponents();\n this.setLocationRelativeTo(null);\n transparenciButton();\n }", "@Override\r\n\tpublic void run() {\n\t\ttry {\r\n\t\t\tLookAndFeelInfo look[] = UIManager.getInstalledLookAndFeels();\r\n\t\t\tfor (LookAndFeelInfo lookAndFeelInfo : look) {\r\n\r\n\t\t\t\tSystem.out.println(lookAndFeelInfo.getClassName());\r\n\t\t\t}\r\n\t\t\tUIManager.setLookAndFeel(this.config.getLookAndFeel());\r\n\t\t} catch (ClassNotFoundException | InstantiationException\r\n\t\t\t\t| IllegalAccessException | UnsupportedLookAndFeelException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tsetVisible(true);\r\n\t}", "public ShiBai1() {\n initComponents();\n this.getContentPane().setBackground(new Color(95,158,160)); \n this.getContentPane().setVisible(true);//如果改为true那么就变成了红色。 \n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n Center.setCenter(this);\n this.setVisible(true);\n }", "public PumpkinFrame() {\r\n setLook(\"Pumpkin Maker\",100,100,800,480);\r\n setDefaultCloseOperation(EXIT_ON_CLOSE);\r\n }", "public FrameProduto() { \n this.getContentPane().setBackground(new Color(47, 64, 80));\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public HoloJFrame() {\n Java2.setSystemLookAndFeel();\n initComponents();\n initFileList(holoCB);\n initFileList(refCB);\n\t\t\n }", "public void windowsConfiguration() {\n\t\tthis.setTitle(\"Segaleo\");\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tthis.setResizable(false);\n\t\tthis.setLocationRelativeTo(null);\n\t}", "private void initialize() {\n this.nativeLookAndFeel();\n setBounds(100, 100, 300, 270);\n setTitle(\"Gestion Usuarios\");\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n setResizable(false);\n getContentPane().setLayout(null);\n\n lblLoading = new JLabel(new ImageIcon(Main.class.getResource(\"Resources/Icons/loading2.gif\")));\n lblLoading.setBounds(90, 46, 100, 100);\n lblLoading.setVisible(false);\n getContentPane().add(lblLoading);\n\n txtUsuario = new JTextField();\n txtUsuario.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n txtUsuario.setBounds(42, 46, 200, 25);\n getContentPane().add(txtUsuario);\n txtUsuario.setDocument(new JTextFieldLimit(20));\n\n btnLogIn = new JButton(\"Log in\");\n btnLogIn.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n btnLogIn.setBounds(42, 170, 200, 44);\n getContentPane().add(btnLogIn);\n\n txtPassword = new JPasswordField();\n txtPassword.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n txtPassword.setBounds(42, 121, 200, 25);\n getContentPane().add(txtPassword);\n\n lblUsuario = new JLabel(\"Usuario\");\n lblUsuario.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n lblUsuario.setBounds(42, 15, 63, 20);\n getContentPane().add(lblUsuario);\n\n lblPassword = new JLabel(\"Password\");\n lblPassword.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n lblPassword.setBounds(42, 90, 63, 20);\n getContentPane().add(lblPassword);\n\n setLocationRelativeTo(null);\n\n }", "private void changeUIdefaults() {\n\t\tUIManager.put(\"TaskPaneContainer.useGradient\", Boolean.FALSE);\n\t\tUIManager.put(\"TaskPaneContainer.background\",\n\t\t\t\tColors.LightGray.color(0.5f));\n\n\t\t// setting taskpane defaults\n\t\tUIManager.put(\"TaskPane.font\", new FontUIResource(new Font(\"Verdana\",\n\t\t\t\tFont.BOLD, 16)));\n\t\tUIManager.put(\"TaskPane.titleBackgroundGradientStart\",\n\t\t\t\tColors.White.color());\n\t\tUIManager.put(\"TaskPane.titleBackgroundGradientEnd\",\n\t\t\t\tColors.LightBlue.color());\n\t}", "public void arreglarBoton()\r\n\t{\r\n\t\tthis.setBorder(BorderFactory.createLineBorder(Color.white, 4));\r\n\t\tthis.setFont(new Font(\"Arial\", Font.BOLD, 17));\r\n\t}", "static void customizeNimbus()\r\n\t\tthrows Exception\r\n\t{\n\t\tUIManager.put(\"control\", BACKGROUND);\r\n\r\n\t\t// TODO: imilne 04/SEP/2009 - No longer working since JRE 1.6.0_u13\r\n\t\tif (SystemUtils.isWindows())\r\n\t\t{\r\n\t\t\tUIManager.put(\"defaultFont\", FONT);\r\n\t\t\tUIManager.put(\"Label[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"Table[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"TableHeader[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"TabbedPane[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"ComboBox[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"Button[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"ToggleButton[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"TextField[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"CheckBox[Enabled].font\", FONT);\r\n\t\t}\r\n\r\n\t\tfor (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels())\r\n\t\t\tif (laf.getName().equals(\"Nimbus\"))\r\n\t\t\t\tUIManager.setLookAndFeel(laf.getClassName());\r\n\r\n\r\n\t\tUIManager.put(\"SplitPane[Enabled].size\", 8);\r\n\r\n\t\tUIManager.put(\"nimbusOrange\", new Color(51, 98, 140));\r\n//\t\tUIManager.put(\"nimbusOrange\", new Color(57, 105, 138));\r\n//\t\tUIManager.put(\"nimbusOrange\", new Color(115, 164, 209));\r\n\r\n\r\n\t\t// Reset non-Aqua look and feels to use CMD+C/X/V rather than CTRL for copy/paste stuff\r\n\t\tif (SystemUtils.isMacOS())\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Setting OS X keyboard shortcuts\");\r\n\r\n\t\t\tInputMap textField = (InputMap) UIManager.get(\"TextField.focusInputMap\");\r\n\t\t\ttextField.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.META_DOWN_MASK), DefaultEditorKit.copyAction);\r\n\t\t\ttextField.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.META_DOWN_MASK), DefaultEditorKit.pasteAction);\r\n\t\t\ttextField.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_DOWN_MASK), DefaultEditorKit.cutAction);\r\n\t\t\ttextField.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK), DefaultEditorKit.selectAllAction);\r\n\r\n\t\t\tInputMap textArea = (InputMap) UIManager.get(\"TextArea.focusInputMap\");\r\n\t\t\ttextArea.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.META_DOWN_MASK), DefaultEditorKit.copyAction);\r\n\t\t\ttextArea.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.META_DOWN_MASK), DefaultEditorKit.pasteAction);\r\n\t\t\ttextArea.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_DOWN_MASK), DefaultEditorKit.cutAction);\r\n\t\t\ttextArea.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK), DefaultEditorKit.selectAllAction);\r\n\t\t}\r\n\t}", "private void setUpLayout() {\n\n this.setLayout(new GridLayout(7, 1, 40, 37));\n this.setBackground(new Color(72, 0, 0));\n this.setBorder(BorderFactory.createEmptyBorder(8, 150, 8, 150));\n }", "public LookAndFeelChooser (LookAndFeelInfo [] looks , MainWindow mainWindow){\n\t\tsuper();\n\n\t\tthis.mainWindow = mainWindow;\n\t\tthis.setLayout(new FlowLayout());\n\t\tString [] lookStrings = new String [looks.length];\n\t\tfor (int i = 0 ; i< looks.length ; i++){\n\t\t\tlookStrings[i] = looks[i].getClassName();\n\t\t\tSystem.out.println(\"look \" + i + \" = \" + lookStrings[i]);\n\t\t}\n\t\tJComboBox lookPick = new JComboBox(lookStrings);\n\n\t\tlookPick.addActionListener(this);\n\t\tthis.add(lookPick);\n\t\tthis.setBorder(\n\t\t\t\tBorderFactory.createCompoundBorder(\n\t\t\t\t\t\tBorderFactory.createTitledBorder(\"Will Destroy Current MainWindow and rebuild\"),\n\t\t\t\t\t\tBorderFactory.createEmptyBorder(5,5,5,5)));\n\t}", "public static void main(String args[]) {\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n javax.swing.SwingUtilities.invokeLater(new Runnable() {\n public void run() {\n JFrame.setDefaultLookAndFeelDecorated(true);\n }\n });\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n \n new MainFrame().setVisible(true);\n \n }\n });\n }", "@Override\n\t\tpublic void popupMenuWillBecomeInvisible(PopupMenuEvent e) {\n\t\t\tif (cbx.getSelectedIndex()==0)\n\t\t\t\treturn;\n\t\t\ttry{\n\t\t\t\tif (cbx.getSelectedItem().equals(\"Windows (Initial)\")){\n\t\t\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n\t\t\t\t}\n\t\t\t\telse if (cbx.getSelectedItem().equals(\"WindowsClassic\")){\n\t\t\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel\");\n\t\t\t\t}\n\t\t\t\telse if (cbx.getSelectedItem().equals(\"Motif\")){\n\t\t\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.motif.MotifLookAndFeel\");\n\t\t\t\t}\n\t\t\t\t//else if (cbx.getSelectedItem().equals(\"Nimbus\")){\n\t\t\t\t//\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n\t\t\t\t//}\n\t\t\t\tSwingUtilities.updateComponentTreeUI(f);\n\t\t\t\tSwingUtilities.updateComponentTreeUI(main);\n\t\t\t} catch (Exception ex){}\n\t\t}", "public void loadSkin()\n {\n if(versionLabel.getUI() instanceof Skinnable)\n ((Skinnable)versionLabel.getUI()).loadSkin();\n }", "public Vista_Login() {\n \t\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Vista_Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Vista_Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Vista_Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Vista_Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public void loadSkin()\n {\n this.setIcon(new ImageIcon(\n ImageLoader.getImage(ImageLoader.CALL_16x16_ICON)));\n }", "protected void installDefaults() {\n spinner.setLayout(createLayout());\n LookAndFeel.installBorder(spinner, \"Spinner.border\");\n LookAndFeel.installColorsAndFont(spinner, \"Spinner.background\", \"Spinner.foreground\", \"Spinner.font\"); }", "private void styleApp(String backgroundColor){\n MenuPane.setStyle(backgroundColor);\n ingredBtn.setStyle(backgroundColor);\n mealsBtn.setStyle(backgroundColor);\n plannerBtn.setStyle(backgroundColor);\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setAlwaysOnTop(true);\n\t\tframe.setResizable(false);\n\t\tframe.setUndecorated(true);\n\t\tframe.setBounds(100, 100, 587, 465);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblName = new JLabel(\"\");\n\t\tlblName.setIcon(new ImageIcon(SpriteBar.class.getResource(\"/pic/common/Sprite_Name.png\")));\n\t\tlblName.setBackground(Color.WHITE);\n\t\tlblName.setForeground(new Color(102, 102, 51));\n\t\tlblName.setFont(new Font(\"Comic Sans MS\", Font.ITALIC, 23));\n\t\tlblName.setBounds(26, 60, 117, 40);\n\t\tframe.getContentPane().add(lblName);\n\t\t\n\t\tJLabel lblLevel = new JLabel(\"\");\n\t\tlblLevel.setIcon(new ImageIcon(SpriteBar.class.getResource(\"/pic/common/Sprite_Level.png\")));\n\t\tlblLevel.setBackground(Color.WHITE);\n\t\tlblLevel.setForeground(new Color(102, 102, 51));\n\t\tlblLevel.setFont(new Font(\"Comic Sans MS\", Font.ITALIC, 23));\n\t\tlblLevel.setBounds(26, 105, 117, 40);\n\t\tframe.getContentPane().add(lblLevel);\n\t\t\n\t\tJLabel lblHp = new JLabel(\"\");\n\t\tlblHp.setIcon(new ImageIcon(SpriteBar.class.getResource(\"/pic/common/Sprite_HP.png\")));\n\t\tlblHp.setBackground(Color.WHITE);\n\t\tlblHp.setForeground(new Color(102, 102, 51));\n\t\tlblHp.setFont(new Font(\"Comic Sans MS\", Font.ITALIC, 23));\t\n\t\tlblHp.setBounds(26, 150, 117, 40);\n\t\tframe.getContentPane().add(lblHp);\n\t\t\n\t\tJLabel lblMp = new JLabel(\"\");\n\t\tlblMp.setIcon(new ImageIcon(SpriteBar.class.getResource(\"/pic/common/Sprite_MP.png\")));\n\t\tlblMp.setBackground(Color.WHITE);\n\t\tlblMp.setForeground(new Color(102, 102, 51));\n\t\tlblMp.setFont(new Font(\"Comic Sans MS\", Font.ITALIC, 23));\n\t\tlblMp.setBounds(26, 195, 117, 40);\n\t\tframe.getContentPane().add(lblMp);\n\t\t\n\t\tJLabel lblStrength = new JLabel(\"\");\n\t\tlblStrength.setIcon(new ImageIcon(SpriteBar.class.getResource(\"/pic/common/Sprite_Strength.png\")));\n\t\tlblStrength.setBackground(Color.WHITE);\n\t\tlblStrength.setForeground(new Color(102, 102, 51));\n\t\tlblStrength.setFont(new Font(\"Comic Sans MS\", Font.ITALIC, 23));\n\t\tlblStrength.setBounds(26, 245, 127, 40);\n\t\tframe.getContentPane().add(lblStrength);\n\t\t\n\t\tJLabel lblAttack = new JLabel(\"\");\n\t\tlblAttack.setIcon(new ImageIcon(SpriteBar.class.getResource(\"/pic/common/Sprite_Attack.png\")));\n\t\tlblAttack.setBackground(Color.WHITE);\n\t\tlblAttack.setForeground(new Color(102, 102, 51));\n\t\tlblAttack.setFont(new Font(\"Comic Sans MS\", Font.ITALIC, 23));\n\t\tlblAttack.setBounds(26, 290, 127, 40);\n\t\tframe.getContentPane().add(lblAttack);\n\t\t\n\t\tJLabel lblDefence = new JLabel(\"\");\n\t\tlblDefence.setIcon(new ImageIcon(SpriteBar.class.getResource(\"/pic/common/Sprite_Defence.png\")));\n\t\tlblDefence.setBackground(Color.WHITE);\n\t\tlblDefence.setForeground(new Color(102, 102, 51));\n\t\tlblDefence.setFont(new Font(\"Comic Sans MS\", Font.ITALIC, 23));\n\t\tlblDefence.setBounds(26, 335, 127, 40);\n\t\tframe.getContentPane().add(lblDefence);\n\t\t\n\t\tJLabel name = new JLabel(\"name\");\n\t\tname.setText(sprite.getName());\n\t\tname.setFont(new Font(\"Comic Sans MS\", Font.BOLD, 21));\n\t\tname.setForeground(new Color(204, 102, 0));\n\t\tname.setBounds(163, 71, 110, 18);\n\t\tframe.getContentPane().add(name);\n\t\t\n\t\tJLabel level = new JLabel(\"level\");\n\t\tlevel.setText(\"\" + sprite.getLevel());\n\t\tlevel.setForeground(new Color(0, 204, 0));\n\t\tlevel.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 21));\n\t\tlevel.setBounds(163, 117, 72, 18);\n\t\tframe.getContentPane().add(level);\n\t\t\n\t\tJLabel hp = new JLabel(\"hp\");\n\t\thp.setText(sprite.getHp() + \"/\" + sprite.getMaxHp());\n\t\thp.setForeground(new Color(255, 0, 0));\n\t\thp.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 21));\n\t\thp.setBounds(163, 160, 110, 18);\n\t\tframe.getContentPane().add(hp);\n\t\t\n\t\tJLabel mp = new JLabel(\"mp\");\n\t\tmp.setText(sprite.getMp() + \"/\" + sprite.getMaxMp());\n\t\tmp.setForeground(new Color(51, 51, 255));\n\t\tmp.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 21));\n\t\tmp.setBounds(163, 209, 110, 18);\n\t\tframe.getContentPane().add(mp);\n\t\t\n\t\tJLabel strength = new JLabel(\"strength\");\n\t\tstrength.setText(\"\" + sprite.getStrength());\n\t\tstrength.setForeground(new Color(153, 0, 255));\n\t\tstrength.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 21));\n\t\tstrength.setBounds(163, 258, 72, 18);\n\t\tframe.getContentPane().add(strength);\n\t\t\n\t\tJLabel attack = new JLabel(\"attack\");\n\t\tattack.setText(\"\" + sprite.getAttack());\n\t\tattack.setForeground(new Color(153, 51, 255));\n\t\tattack.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 21));\n\t\tattack.setBounds(163, 303, 72, 18);\n\t\tframe.getContentPane().add(attack);\n\t\t\n\t\tJLabel defence = new JLabel(\"defence\");\n\t\tdefence.setText(\"\" + sprite.getDefence());\n\t\tdefence.setForeground(new Color(153, 51, 255));\n\t\tdefence.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 21));\n\t\tdefence.setBounds(163, 348, 72, 18);\n\t\tframe.getContentPane().add(defence);\n\t\t\n\t\tJButton btnBack = new JButton(\"\");\n\t\tbtnBack.setIcon(new ImageIcon(SpriteBar.class.getResource(\"/pic/menu/Back.png\")));\n\t\tbtnBack.addMouseListener(new MouseAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tif(menuBar == null)\n\t\t\t\t\tmenuBar = new MenuBar(sprite);\n\t\t\t\telse\n\t\t\t\t\tmenuBar.updateSprite(sprite);\n\t\t\t\tmenuBar.main();\n\t\t\t\tframe.dispose();\n\t\t\t}\n\t\t});\n\t\tbtnBack.setIcon(new ImageIcon(MenuBar.class.getResource(\"/pic/menu/back_1.png\")));\n\t\tbtnBack.setRolloverIcon(new ImageIcon(MenuBar.class.getResource(\"/pic/menu/back_2.png\")));\n\t\tbtnBack.setBorderPainted(false);\n\t\tbtnBack.setOpaque(false);\t\n\t\tbtnBack.setBounds(14, 385, 110, 59);\n\t\tbtnBack.setBackground(Color.BLACK);\n\t\tframe.getContentPane().add(btnBack);\n\t\t\n\t\tJLabel lblBackground = new JLabel(\"\");\n\t\tlblBackground.setIcon(new ImageIcon(SpriteBar.class.getResource(\"/pic/common/demo1.png\")));\n\t\tlblBackground.setBounds(0, 0, 587, 465);\n\t\tframe.getContentPane().add(lblBackground);\n\t}", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(HFGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(HFGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(HFGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(HFGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new HFGUI().setVisible(true);\n }\n });\n }", "private static void createAndShowGUI() {\n JFrame.setDefaultLookAndFeelDecorated(true);\r\n\r\n //Create and set up the window.\r\n frame = new JFrame(\"ATC simulator\");\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\r\n atcscreen = new AtcScreen();\r\n atcscreen.setOpaque(true);\r\n frame.setContentPane(atcscreen);\r\n \r\n //Display the window.\r\n frame.setSize(1000,1000);\r\n //atcscreen.setSize(300,300);\r\n //frame.pack();\r\n frame.setVisible(true);\r\n }", "public static void main(String[] args) {\n\t\ttry {\r\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t\t} catch (Exception ex) {\r\n\t\t}\r\n\t}", "@Override\r\n\tprotected void pack() {\r\n\r\n\t\tRectangle displayarea = shell.getDisplay().getPrimaryMonitor().getBounds();\r\n\t\tRectangle windowarea = shell.getBounds();\r\n\t\tshell.setBounds((displayarea.width - windowarea.width) / 2,\r\n\t\t\t\t(displayarea.height - windowarea.height) / 2,\r\n\t\t\t\twindowarea.width, windowarea.height);\r\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}", "public Colaborador() {\n\n this.setUndecorated(true);\n initComponents();\n this.setLocationRelativeTo(null);\n transparenciButton();\n }", "private void settings() {\n\t\tthis.setVisible(true);\n\t\tthis.setSize(800,200);\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.getContentPane().setLayout(null);\n\t\tframe.setExtendedState(JFrame.MAXIMIZED_BOTH);\n\t\t\n\t\tJLabel lblDesignCopyrights = new JLabel(\"design copyrights \\u00A9 chinmaya\");\n\t\tlblDesignCopyrights.setFont(new Font(\"Times New Roman\", Font.PLAIN, 14));\n\t\tlblDesignCopyrights.setForeground(new Color(255, 255, 224));\n\t\tlblDesignCopyrights.setBounds(1711, 1018, 183, 23);\n\t\tframe.getContentPane().add(lblDesignCopyrights);\n\t\t\n\t\tJPanel background = new JPanel();\n\t\tbackground.setLayout(null);\n\t\tbackground.setBackground(Color.DARK_GRAY);\n\t\tbackground.setBounds(14, 200, 1880, 809);\n\t\tframe.getContentPane().add(background);\n\t\t\n\t\t\n\t\tJLabel lblTypesOfMachine = new JLabel(\"MACHINE NAME\");\n\t\tlblTypesOfMachine.setHorizontalAlignment(SwingConstants.LEFT);\n\t\tlblTypesOfMachine.setVerticalAlignment(SwingConstants.TOP);\n\t\tlblTypesOfMachine.setForeground(Color.WHITE);\n\t\tlblTypesOfMachine.setFont(new Font(\"Times New Roman\", Font.PLAIN, 19));\n\t\tlblTypesOfMachine.setBounds(69, 378, 178, 30);\n\t\tbackground.add(lblTypesOfMachine);\n\t\t\n\t\t\n\t\tJLabel lblAppointment = new JLabel(\"LIST TO DO\");\n\t\tlblAppointment.setForeground(Color.WHITE);\n\t\tlblAppointment.setFont(new Font(\"Times New Roman\", Font.PLAIN, 30));\n\t\tlblAppointment.setBounds(69, 117, 319, 48);\n\t\tbackground.add(lblAppointment);\n\t\t\n\t\tJLabel lblQuantity = new JLabel(\"QUANTITY\");\n\t\tlblQuantity.setHorizontalAlignment(SwingConstants.LEFT);\n\t\tlblQuantity.setVerticalAlignment(SwingConstants.TOP);\n\t\tlblQuantity.setForeground(Color.WHITE);\n\t\tlblQuantity.setFont(new Font(\"Times New Roman\", Font.PLAIN, 19));\n\t\tlblQuantity.setBounds(69, 428, 178, 30);\n\t\tbackground.add(lblQuantity);\n\t\t\n\t\tPanel panel = new Panel();\n\t\tpanel.setLayout(null);\n\t\tpanel.setBackground(Color.BLACK);\n\t\tpanel.setBounds(0, 30, 1880, 67);\n\t\tbackground.add(panel);\n\t\t\n\t\tJButton cusbtn = new JButton(\"CUSTOMER\");\n\t\tcusbtn.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\t customer cr = new customer();\n\t\t cr.csStart();\n\t\t frame.dispose();\n\t\t\t}\n\t\t});\n\t\tcusbtn.setForeground(Color.WHITE);\n\t\tcusbtn.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tcusbtn.setBackground(Color.BLACK);\n\t\tcusbtn.setBounds(1257, 11, 613, 44);\n\t\tpanel.add(cusbtn);\n\t\t\n\t\tJButton bilbtn = new JButton(\"INVOICE\");\n\t\tbilbtn.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tadminInvoice inv= new adminInvoice();\n\t\t\t\tinv. adminInvoiceStart();\n\t\t\t\tframe.dispose();\n\n\t\t\t}\n\t\t});\n\t\tbilbtn.setForeground(Color.WHITE);\n\t\tbilbtn.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tbilbtn.setBackground(Color.BLACK);\n\t\tbilbtn.setBounds(633, 11, 613, 44);\n\t\tpanel.add(bilbtn);\n\t\t\n\t\tJButton prdbtn = new JButton(\"PRODUCTS\");\n\t\tprdbtn.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\tadminproducts prd = new adminproducts();\n\t\t\t\tprd.adminPrd();\n\t\t\t\tframe.dispose();\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tprdbtn.setForeground(Color.WHITE);\n\t\tprdbtn.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tprdbtn.setBackground(Color.BLACK);\n\t\tprdbtn.setBounds(10, 11, 613, 44);\n\t\tpanel.add(prdbtn);\n\t\t\n\t\tJLabel lblCustomerName = new JLabel(\"CUSTOMER NAME\");\n\t\tlblCustomerName.setVerticalAlignment(SwingConstants.TOP);\n\t\tlblCustomerName.setHorizontalAlignment(SwingConstants.LEFT);\n\t\tlblCustomerName.setForeground(Color.WHITE);\n\t\tlblCustomerName.setFont(new Font(\"Times New Roman\", Font.PLAIN, 19));\n\t\tlblCustomerName.setBounds(69, 278, 178, 30);\n\t\tbackground.add(lblCustomerName);\n\t\t\n\t\tJLabel lblMachineType = new JLabel(\"MACHINE TYPE\");\n\t\tlblMachineType.setVerticalAlignment(SwingConstants.TOP);\n\t\tlblMachineType.setHorizontalAlignment(SwingConstants.LEFT);\n\t\tlblMachineType.setForeground(Color.WHITE);\n\t\tlblMachineType.setFont(new Font(\"Times New Roman\", Font.PLAIN, 19));\n\t\tlblMachineType.setBounds(69, 328, 178, 30);\n\t\tbackground.add(lblMachineType);\n\t\t\n\t\t\n\t\tJButton btnStore = new JButton(\"STORE\");\n\t\tbtnStore.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\tString dateEntry=date.getText();\n\t\t\t\tString cusname= customerName.getText();\t\n\t\t\t\tString machType=machineType.getText();\n\t\t\t\tString machName=machineName.getText();\n\t\t\t\tString quan=quantity.getText();\n\t\t\t\tString dl= deadline.getText();\n\t\t\t\tConnection con;\n\t\t\t\tPreparedStatement insert;\n\t\t\t\t\n\t\t\t\tif(dateEntry.isEmpty()||cusname.isEmpty()||machName.isEmpty()||machType.isEmpty()||quan.isEmpty()||dl.isEmpty()) \n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"no field must be left empty\",\"registration error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\t\n\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \" Appointment added!!\");\n\t\t\t\t}\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\t\t\tcon = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/machine_works\", \"root\", \"\");\n\t\t\t\t\tinsert = con.prepareStatement(\"insert into appointment (date,cusname,machType,machName,quan,deadline) values (?,?,?,?,?,?)\");\n\t\t insert.setString(1, dateEntry);\n\t\t insert.setString(2, cusname);\n\t\t insert.setString(3, machType);\n\t\t insert.setString(4, machName);\n\t\t insert.setString(5, quan);\n\t\t insert.setString(6, dl);\n\t\t insert.executeUpdate();\n\t\t\t\t}\n\t\t\t\tcatch(Exception E)\n\t\t\t\t{\n\t\t\t\t\tE.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tbtnStore.setForeground(Color.WHITE);\n\t\tbtnStore.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tbtnStore.setBackground(Color.BLACK);\n\t\tbtnStore.setBounds(580, 578, 116, 44);\n\t\tbackground.add(btnStore);\n\t\t\n\t\tJScrollPane scrollPane = new JScrollPane();\n\t\tscrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);\n\t\tscrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);\n\t\tscrollPane.setBounds(1000, 230, 613, 267);\n\t\tbackground.add(scrollPane);\n\t\t\n\t\tinvoice = new JTable();\n\t\tscrollPane.setViewportView(invoice);\n\t\t\n\t\tJLabel lblInvoice = new JLabel(\"VIEW TO-DO LIST\");\n\t\tlblInvoice.setForeground(Color.WHITE);\n\t\tlblInvoice.setFont(new Font(\"Times New Roman\", Font.PLAIN, 30));\n\t\tlblInvoice.setBounds(1010, 117, 387, 48);\n\t\tbackground.add(lblInvoice);\n\t\t\n\t\tquantity = new JTextField();\n\t\tquantity.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tquantity.setColumns(10);\n\t\tquantity.setBounds(279, 428, 289, 30);\n\t\tbackground.add(quantity);\n\t\t\n\t\tmachineName = new JTextField();\n\t\tmachineName.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tmachineName.setColumns(10);\n\t\tmachineName.setBounds(279, 328, 289, 30);\n\t\tbackground.add(machineName);\n\t\t\n\t\tmachineType = new JTextField();\n\t\tmachineType.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tmachineType.setColumns(10);\n\t\tmachineType.setBounds(279, 378, 289, 30);\n\t\tbackground.add(machineType);\n\t\t\n\t\tcustomerName = new JTextField();\n\t\tcustomerName.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tcustomerName.setColumns(10);\n\t\tcustomerName.setBounds(279, 278, 289, 30);\n\t\tbackground.add(customerName);\n\t\t\n\t\tJLabel deadlineLbl = new JLabel(\"DEADLINE\");\n\t\tdeadlineLbl.setVerticalAlignment(SwingConstants.TOP);\n\t\tdeadlineLbl.setHorizontalAlignment(SwingConstants.LEFT);\n\t\tdeadlineLbl.setForeground(Color.WHITE);\n\t\tdeadlineLbl.setFont(new Font(\"Times New Roman\", Font.PLAIN, 19));\n\t\tdeadlineLbl.setBounds(69, 481, 178, 30);\n\t\tbackground.add(deadlineLbl);\n\t\t\n\t\tJLabel lblDate = new JLabel(\"DATE\");\n\t\tlblDate.setVerticalAlignment(SwingConstants.TOP);\n\t\tlblDate.setHorizontalAlignment(SwingConstants.LEFT);\n\t\tlblDate.setForeground(Color.WHITE);\n\t\tlblDate.setFont(new Font(\"Times New Roman\", Font.PLAIN, 19));\n\t\tlblDate.setBounds(69, 228, 178, 30);\n\t\tbackground.add(lblDate);\n\t\t\n\t\tdate = new JTextField();\n\t\tdate.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tdate.setColumns(10);\n\t\tdate.setBounds(279, 228, 289, 30);\n\t\tbackground.add(date);\n\t\t\n\t\tJButton btnView = new JButton(\"VIEW\");\n\t\tbtnView.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\tConnection con = null;\n\t\t\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\t\t\tcon = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/machine_works\", \"root\", \"\");\n\t\t String query=\"select * from appointment \";\n\t\t\t\t\tPreparedStatement pst = con.prepareStatement(query);\n\t\t\t\t\tResultSet rs = pst.executeQuery();\n\t\t\t\t\t\n\t\t\t\t\tinvoice.setModel(DbUtils.resultSetToTableModel(rs));\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\tcatch(Exception E)\n\t\t\t\t{\n\t\t\t\t\tE.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtnView.setForeground(Color.WHITE);\n\t\tbtnView.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tbtnView.setBackground(Color.BLACK);\n\t\tbtnView.setBounds(1584, 578, 116, 44);\n\t\tbackground.add(btnView);\n\t\t\n\t\tdeadline = new JTextField();\n\t\tdeadline.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tdeadline.setColumns(10);\n\t\tdeadline.setBounds(279, 481, 289, 30);\n\t\tbackground.add(deadline);\n\t\t\n\t\tJPanel header = new JPanel();\n\t\theader.setLayout(null);\n\t\theader.setBackground(Color.DARK_GRAY);\n\t\theader.setBounds(14, 23, 1880, 163);\n\t\tframe.getContentPane().add(header);\n\t\t\n\t\tJPanel mwtitle = new JPanel();\n\t\tmwtitle.setLayout(null);\n\t\tmwtitle.setForeground(Color.WHITE);\n\t\tmwtitle.setBackground(Color.BLACK);\n\t\tmwtitle.setBounds(209, 7, 649, 151);\n\t\theader.add(mwtitle);\n\t\t\n\t\tJLabel label = new JLabel(\"MACHINE WORKS\");\n\t\tlabel.setForeground(Color.WHITE);\n\t\tlabel.setFont(new Font(\"Times New Roman\", Font.PLAIN, 69));\n\t\tlabel.setBounds(20, 11, 605, 72);\n\t\tmwtitle.add(label);\n\t\t\n\t\tJLabel lblWhereAllThe = new JLabel(\"Where all the WORK is done by MACHINE\");\n\t\tlblWhereAllThe.setForeground(Color.ORANGE);\n\t\tlblWhereAllThe.setFont(new Font(\"Times New Roman\", Font.PLAIN, 30));\n\t\tlblWhereAllThe.setBounds(38, 94, 581, 48);\n\t\tmwtitle.add(lblWhereAllThe);\n\t\t\n\t\tJLabel logolbl = new JLabel(\"\");\n\t\tlogolbl.setIcon(new ImageIcon(\"C:\\\\Users\\\\CHINMAYA SH\\\\Pictures\\\\download.png\"));\n\t\tlogolbl.setBounds(58, 7, 151, 151);\n\t\theader.add(logolbl);\n\t\t\n\t\tJButton lgbtn = new JButton(\"LOGOUT\");\n\t\tlgbtn.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Logged out Successfull !!\");\n\t\t\t\tindex ind = new index();\n\t\t\t\tind.indexStart();\n\t\t\t\tframe.dispose();\n\t\t\t}\n\t\t});\n\t\tlgbtn.setForeground(Color.WHITE);\n\t\tlgbtn.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tlgbtn.setBackground(Color.BLACK);\n\t\tlgbtn.setBounds(1674, 60, 116, 44);\n\t\theader.add(lgbtn);\n\t\t\n\t\tJButton button_1 = new JButton(\"SIGN UP\");\n\t\tbutton_1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\tsignup sg = new signup();\n\t\t\t\tsg.signupStart();\n\t\t\t\tframe.dispose();\n\t\t\t}\n\t\t});\n\t\tbutton_1.setForeground(Color.WHITE);\n\t\tbutton_1.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tbutton_1.setBackground(Color.BLACK);\n\t\tbutton_1.setBounds(1488, 60, 116, 44);\n\t\theader.add(button_1);\n\t\t\n\t\tJButton btnAppointment = new JButton(\"TO-DO\");\n\t\tbtnAppointment.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\tappointments ap = new appointments();\n\t\t\t\tap.appointmentList();\n\t\t\t\tframe.dispose();\n\t\t\t}\n\t\t});\n\t\tbtnAppointment.setForeground(Color.WHITE);\n\t\tbtnAppointment.setFont(new Font(\"Times New Roman\", Font.PLAIN, 15));\n\t\tbtnAppointment.setBackground(Color.BLACK);\n\t\tbtnAppointment.setBounds(1309, 60, 125, 44);\n\t\theader.add(btnAppointment);\n\t\tframe.setBackground(Color.BLACK);\n\t\tframe.setBounds(100, 100, 1920\t, 1080);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\n\t}", "private void colorSetup(){\n Color color2 = Color.GRAY;\n Color color = Color.LIGHT_GRAY;\n this.setBackground(color);\n this.mainPanel.setBackground(color);\n this.leftPanel.setBackground(color);\n this.rightPanel.setBackground(color);\n this.rightCenPanel.setBackground(color);\n this.rightLowPanel.setBackground(color);\n this.rightTopPanel.setBackground(color);\n this.inputPanel.setBackground(color);\n this.controlPanel.setBackground(color);\n this.setupPanel.setBackground(color);\n this.cameraPanel.setBackground(color);\n this.jPanel4.setBackground(color);\n this.sensSlider.setBackground(color); \n }" ]
[ "0.82003844", "0.8013756", "0.75259256", "0.7512265", "0.7306867", "0.72500557", "0.7214766", "0.717893", "0.70934266", "0.7035303", "0.7004367", "0.6905258", "0.6782702", "0.67705065", "0.6712186", "0.6534111", "0.6509128", "0.6382541", "0.6370439", "0.62706536", "0.6241465", "0.61946034", "0.6157423", "0.61008", "0.609867", "0.6087217", "0.60716385", "0.60567623", "0.6041023", "0.6037305", "0.6014827", "0.6008639", "0.6003679", "0.59713763", "0.5938388", "0.5930506", "0.5927431", "0.5913413", "0.5908934", "0.58937556", "0.5879979", "0.5846731", "0.58438575", "0.58355063", "0.58279836", "0.5820766", "0.5814849", "0.579408", "0.57589644", "0.5754278", "0.5753923", "0.57448936", "0.5743689", "0.5738009", "0.573678", "0.5733609", "0.57269275", "0.57257104", "0.5713933", "0.57039034", "0.5703177", "0.57014245", "0.57003576", "0.5699894", "0.56807536", "0.56751776", "0.567339", "0.5654989", "0.5653039", "0.5649773", "0.56430465", "0.5628583", "0.56263614", "0.56191933", "0.5617052", "0.5608995", "0.5604585", "0.56030494", "0.56023616", "0.5597726", "0.5594092", "0.55935895", "0.55898786", "0.558179", "0.5580708", "0.55774754", "0.55721915", "0.55717796", "0.55598474", "0.55478483", "0.5543014", "0.55325", "0.55231595", "0.55198056", "0.5517452", "0.5505228", "0.55009234", "0.5490729", "0.5488454", "0.5485898" ]
0.68721634
12
POST /saveEmployee > saveEmployee the Employee.
@RequestMapping(value = "/employee", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<?> saveEmployee(@Valid @RequestBody EmployeeDTO employeeDTO, HttpServletRequest request) { log.info("Inside the saveEmployee -" + employeeDTO); log.info("Inside Save employee"+employeeDTO.getManagerId()); long userId = SecurityUtils.getCurrentUserId(); log.info("save Employee call - userId "+userId); employeeDTO.setUserId(userId); try { EmployeeDTO employeeDto = employeeService.createEmployeeInformation(employeeDTO); /* if(employeeDto.isCreateUser()) { UserDTO userDto = new UserDTO(); userDto.setLogin(employeeDto.getEmpId()); userDto.setFirstName(employeeDto.getName()); userDto.setLastName(employeeDto.getLastName()); userDto.setEmployeeId(employeeDto.getId()); userDto.setEmployeeName(employeeDto.getName()); userService.createUserInformation(userDto); } */ }catch(Exception e) { throw new TimesheetException(e, employeeDTO); } return new ResponseEntity<>(HttpStatus.CREATED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void post(Employee employee) {\n\t\t empdao.save(employee);\r\n\t}", "@PostMapping(\"/save\")\n\tpublic ResponseEntity<String> createEmployee(@RequestBody Employee employee) {\n\t\tInteger id = service.saveEmployee(employee);\n\t\tString message = \"Employee '\" + id + \"' Created!\";\n\t\treturn new ResponseEntity<String>(message, HttpStatus.CREATED); // 201\n\t}", "public void saveEmployee(Employe employee) {\n\t\t\n\t}", "@PostMapping(\"/saveEmployee\")\n\tpublic String saveEmployee(@ModelAttribute(\"employee\") Employees employee) {\n\t\tservice.saveEmployee(employee);\n\t\treturn \"redirect:/employees\";\n\t}", "@PostMapping(\"/employee\")\n\tpublic Employee createEmployee(@RequestBody Employee employee) {\n\t\treturn emprepo.save(employee);\n\t}", "@PostMapping(\"/saveEmployee\")\r\n\tpublic String saveEmployee(@ModelAttribute(\"employee\") Employee employee) {\n\t\tempServ.saveEmployee(employee);\r\n\t\treturn \"redirect:/\";\r\n\t}", "void save(Employee employee);", "@Override\r\n\tpublic void saveEmployee(Employee employee) {\n\t\t\r\n\t}", "@PostMapping(\"/createEmployee\")\n\tpublic Employee createEmployee(@RequestBody Employee employee) {\n\t\treturn repo.save(employee);\n\t}", "@PostMapping(\"/register\")\n\tpublic ResponseEntity<Employee> saveEmployee(@RequestBody Employee emp){\n\t\tEmployee addedEmployee = employeeService.saveEmployee(emp);\n\t\treturn new ResponseEntity<Employee>(addedEmployee, HttpStatus.OK);\n\t}", "@PostMapping(\"/employee\")\r\n\tpublic Employee createEmployee(@RequestBody Employee emp)\r\n\t{\r\n\t\treturn empdao.save(emp);\t\r\n\t}", "@PostMapping(\"/employee\")\r\n\tpublic void add(@RequestBody Employee employee) {\r\n\t\tempService.save(employee);\r\n\t}", "@Override\n\tpublic void save(Employee employee) {\n\t\temployeeDao.save(employee);\n\t\t\n\t}", "@Override\n\tpublic void save(Employee theEmployee) {\n\t\t\n\t}", "@Override\n\tpublic int saveEmployee() {\n\t\tEmployeeDao dao= new EmployeeDao();\n\t\tint result=dao.saveEmployee(new Employee(101349, \"Deevanshu\", 50000));\n\t\treturn result;\n\t}", "@PostMapping(\"/employees\")\n\tpublic Employee addEmployee(@RequestBody Employee theEmployee) {\n\t\t theEmployee.setId(0);\n\t\t employeeService.save(theEmployee);\n\t\t \n\t return theEmployee;\n\t}", "@PostMapping(value=\"/employes\")\n\tpublic void createEmployeeDeatils(@RequestBody Employee employee){\n\t\t\t\n\t\temployeeService.saveEmployeeDetails(employee);\n\t\t\n\t}", "@Transactional\n\t\tpublic void saveEmployee(EmployeeEntity employeeEntity) {\n\t\t\temployeedao.saveEmployee(employeeEntity);\n\t\t}", "@Override\n\tpublic Employee saveEmployee(Employee emp) {\n\t\tlog.debug(\"EmplyeeService.saveEmployee(Employee emp) save Employee object\");\n\t\treturn repositary.save(emp);\n\t}", "EmployeeDetail save(EmployeeDetail detail) throws DBException;", "@RequestMapping(value = \"/employee\", method = RequestMethod.POST)\r\n\tpublic Employee addEmployee(@RequestBody Employee employee) throws EmployeeMaintainceException {\r\n\r\n\t\ttry {\r\n\t\t\treturn eService.addEmp(employee);\r\n\t\t}\r\n\r\n\t\tcatch (Exception e) {\r\n\t\t\tthrow new EmployeeMaintainceException(400, e.getMessage());\r\n\t\t}\r\n\r\n\t}", "public void saveEmployee(CreateOrEditEmployeeRequestDto employee);", "@POST\n @Consumes( { \"application/xml\", \"text/xml\", \"application/json\" })\n public Response createEmployee(Employee employee) {\n final int staffNo = this.employeeMgr.createEmployee(employee);\n final URI location = createdLocation(staffNo);\n return Response.created(location).build();\n }", "public void save(Employee employee) {\n String objectStr = MyUtils.serializeIntoAString(employee);\n Connection connection = null;\n Statement stmt = null;\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n connection = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/MyDB\", \"root\", \"password\");\n stmt = connection.createStatement();\n stmt.execute(\"INSERT INTO EMPLOYEE VALUES(\" + objectStr + \")\");\n } catch (SQLException | ClassNotFoundException throwables) {\n throwables.printStackTrace();\n }\n }", "@PostMapping(\"/employees\")\r\n\tpublic Employee addEmployee(@RequestBody Employee theEmployee) {\r\n\t\t\r\n\t\t// also just in case the pass an id in JSON... set id to 0\r\n\t\t// this force a save of new item...instead of update\r\n\t\ttheEmployee.setId(0);\r\n\t\t\r\n\t\temployeeService.saveEmployee(theEmployee);\r\n\t\t\r\n\t\treturn theEmployee;\r\n\t\t\r\n\t}", "private void saveEmployee(Employee employee) {\n ContentValues contentValues = new ContentValues();\n contentValues.put(ReportContract.EmployeeEntry.COLUMN_KEY, employee.getKey());\n contentValues.put(ReportContract.EmployeeEntry.COLUMN_VALUE, employee.getValue());\n\n getContext().getContentResolver().insert(\n ReportContract.EmployeeEntry.CONTENT_URI,\n contentValues\n );\n\n }", "@PostMapping(\"/addNewEmployee/save\")\n public String saveEmployee(@ModelAttribute(\"employee\") Employee employee){\n employeeService.saveEmployee(employee);\n return \"redirect:/\";\n }", "@Override\n\tpublic Employee save(Employee employee) {\n\t\treturn employeeRepository.save(employee);\n\t}", "public Employee save(Employee employee){\n return employeeRepository.save(employee);\n }", "@PostMapping(value = \"/addEmployee\")\n\tpublic void addEmployee() {\n\t\tEmployee e = new Employee(\"Iftekhar Khan\");\n\t\tdataServiceImpl.add(e);\n\t}", "@PostMapping(\"/addEmployee\")\n\tpublic ResponseEntity<EmployeeMon> createEmployee(@RequestBody EmployeeMon employee)\n\t{\n\t\ttry {\n\t\t\tEmployeeMon stud = repository.save(\n\t\t\t\t\tnew EmployeeMon(employee.getId(),employee.getName(),employee.getAddress(), employee.getEmail(),\n\t\t\t\t\t\t\temployee.getSalary()));\n\t\t\tLOGGER.info(\"Inserted data into Table\");\n\t\t\treturn new ResponseEntity<>(stud, HttpStatus.CREATED);\n\t\t} catch(Exception e) {\n\t\t\treturn new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);\n\t\t}\n\t}", "public void saveEmployee(Employee emp){\n System.out.println(\"saved\" + emp);\n\n }", "@Override\n\t@Transactional\n\tpublic Employee save(Employee employee) {\n\t\treturn employeeDao.save(employee);\n\t}", "@PostMapping(path=\"/api/employees/createEmployee\",consumes = MediaType.APPLICATION_JSON_VALUE, produces =\n MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<Employee> savePC(@RequestBody Employee employee) throws Exception {\n Employee emp = employeeService.saveEmployee(employee);\n if (emp == null) {\n throw new Exception();\n } else {\n ResponseEntity<Employee> tResponseEntity = new ResponseEntity<>(emp, HttpStatus.CREATED);\n return tResponseEntity;\n }\n }", "@Override\n\tpublic void save(Employee employee) {\n\t\tSession currentSession = entityManager.unwrap(Session.class);\n\t\t\n\t\t// Save an Employee\n\t\tcurrentSession.saveOrUpdate(employee);\n\t\t\n\t}", "@Override\n\t@Transactional\n\tpublic boolean saveEmployee(Employee employee) {\n\t\t\n\t\tentityManager.persist(employee);\n\t\tentityManager.flush();\n\t\treturn false;\n\t}", "@PostMapping(\"/add_employee\")\n public ResponseEntity<?> createEmployee(@Valid @RequestBody Employee employee){\n\n employeeService.add_employee(employee);\n\n return new ResponseEntity<>(\"Employee was added successfully!\", HttpStatus.OK);\n }", "@Override\n\tpublic void addEmployee(Employee employee) {\n\t\tem.getTransaction().begin();\n\t\tem.persist(employee);\n\t\tem.getTransaction().commit();\n\t\tSystem.out.println(\"Data Added successfully\");\n\t\tlogger.log(Level.INFO, \"Data Added successfully\");\n\n\t}", "@PostMapping(value = {\"\", \"/\"})\n public ResponseEntity<Employee> saveEmployee(@Valid @RequestBody CreateEmployeeRequest inputData){\n Employee employee = employeeService.saveEmployee(inputData);\n return new ResponseEntity<>(employee, HttpStatus.OK);\n }", "public void addEmployee(Employee employee) {\n employeeRepository.save(employee);\n }", "@POST\n @Produces(MediaType.APPLICATION_JSON)\n @Consumes(MediaType.APPLICATION_JSON)\n public Response handlePostCreate(String body) {\n Gson gson = GSONFactory.getInstance();\n\n Employee createdEmployee = createEmployee(body);\n\n String serializedEmployee = gson.toJson(createdEmployee);\n\n Response response = Response.status(201).entity(serializedEmployee).build();\n return response;\n }", "@PostMapping(\"addEmployee\")\r\n\tpublic String addEmployee(@ModelAttribute(\"employee\") Employee employee) {\r\n\r\n\t\temployeeDao.addEmployee(employee);\r\n\t\t\r\n\t\treturn \"EmployeeDetails\";\r\n\t}", "@Override\r\n\tpublic Employee save(Employee emp) {\n\t\t return empdao.save(emp);\r\n\t}", "public long saveEmployee(Employee employee) {\n return employeeRepository.save(employee).getId();\n }", "@PostMapping(value = \"/v1/bfs/employees\", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)\n ResponseEntity<Employee> insertEmployee(\n \t\t@RequestHeader String uuid,\n \t\t@Valid @RequestBody Employee employee) throws BadRequestException;", "public void addEmployee(final Employee employee) {\r\n\t\tfinal Session session = sessionFactory.getCurrentSession();\t\r\n\t\tsession.save(employee);\r\n\t}", "@Override\n\tpublic ResponseEntity<Employee> save(Employee t) {\n\t\treturn null;\n\t}", "@RequestMapping(value=\"/addEmployeeSubmit\", method=RequestMethod.POST)\n /* Add submitted new employee details to database, and then redirect to listEmployees */\n public String addEmployeeSubmit(Employee employee) {\n employeeservice.saveEmployee(employee);\n\n return \"redirect:/employee/listEmployees\";\n }", "@POST\n\t@Consumes(MediaType.APPLICATION_JSON)\n\tpublic Response addEmployee(EmployeeVO emVo) throws SQLException {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\t\tboolean result = employeeFacade.save(emVo);\n\t\tif (result)\n\t\t\treturn Response.status(200).build();\n\t\telse\n\t\t\treturn Response.status(409).build();\n\t}", "@RequestMapping(value=\"/employee/registerEmployee.htm\", method = RequestMethod.POST)\r\n\t@ResponseBody\r\n\tpublic String registerEmployee(@RequestBody EmployeeModel employeeModel, HttpServletRequest request) {\r\n\t\tString result = employeeService.addEmployee(employeeModel);\r\n\t\treturn result;\r\n\t}", "@Transactional(readOnly = false)\r\n\tpublic void saveEmployee(Employee employee) {\r\n\t\tem.merge(employee);\r\n\t}", "@Override\n\tpublic Employee createEmployee(Employee employee) {\n\t\tSession sess = sessionFactory.openSession();\n\t\tTransaction tx = sess.beginTransaction();\n\t\tsess.save(employee);\n\t\ttx.commit();\n\t\tsess.close();\n\n\t\treturn employee;\n\t}", "public void createemployee(Employeee em) {\n\t\temployeerepo.save(em);\n\t}", "@Override\r\n\tpublic boolean registerEmployee(EmployeeEO employeeEORef) {\n\t\temployeeDAORepoRef.save(employeeEORef);\r\n\t\treturn true;\r\n\t}", "@PutMapping(\"/employees/{employeeId}\")\r\n\tpublic Employee updateEmployee(@RequestBody Employee theEmployee) {\r\n\t\t\r\n\t\t\temployeeService.saveEmployee(theEmployee);\r\n\t\t\r\n\t\treturn theEmployee;\r\n\t}", "public Employee createOne(Employee employee) {\n return employeeRepository.save(employee);\n }", "@PostMapping(\"/AddEmployee\")\r\n public Serializable addStudentService(@RequestBody Employee employee) {\r\n return admin.addEmployeeService(employee);\r\n }", "@Override\n\tpublic void add(Employee employee) {\n\t\temployeeDao.save(employee);\t\t\n\t}", "@Override\n public void save(Employee employee) {\n Employee dbEmployee = entityManager.merge(employee);\n \n //update with id from database so we can generate id for save/insert\n employee.setId(dbEmployee.getId());\n \n }", "@FXML\r\n\tprivate void saveEmployee(ActionEvent event) {\r\n\t\tif (validateFields()) {\r\n\t\t\tEmployee e;\r\n\t\t\tif (newEmployee) {\r\n\t\t\t\te = new Employee();\r\n\t\t\t\tlistaStaff.getItems().add(e);\r\n\t\t\t} else {\r\n\t\t\t\te = listaStaff.getSelectionModel().getSelectedItem();\r\n\t\t\t}\r\n\t\t\te.setUsername(txUsuario.getText());\r\n\t\t\te.setPassword(txPassword.getText());\r\n\t\t\tif (checkAdmin.isSelected())\r\n\t\t\t\te.setIsAdmin(1);\r\n\t\t\telse\r\n\t\t\t\te.setIsAdmin(0);\r\n\t\t\tif (checkTPV.isSelected())\r\n\t\t\t\te.setTpvPrivilege(1);\r\n\t\t\telse\r\n\t\t\t\te.setTpvPrivilege(0);\r\n\t\t\tif (newEmployee) {\r\n\t\t\t\tservice.saveEmployee(e);\r\n\t\t\t\tnewEmployee = false;\r\n\t\t\t} else\r\n\t\t\t\tservice.updateEmployee(e);\r\n\t\t\tbtGuardar.setDisable(true);\r\n\t\t\tbtEditar.setDisable(false);\r\n\t\t\tconmuteFields();\r\n\t\t\tupdateList();\r\n\t\t}\r\n\t}", "@PostMapping(\"/employees\")\n public Mono<ResponseEntity> addEmployee(@Valid @RequestBody Employee theEmployee) {\n theEmployee.setId(0);\n\n return this.employeeService.save(theEmployee).map(employee -> new ResponseEntity<>(new DataResponse<>(HttpStatus.CREATED.value(), \"Employee added successfully\", employee), HttpStatus.CREATED));\n }", "void addEmployee(Employee emp){\n\t\tEntityManager em = emf.createEntityManager();\n\t\tEntityTransaction tx = em.getTransaction();\n\t\ttx.begin();\n\t\tem.persist(emp);\n\t\ttx.commit();\n\t\tem.close();\n\t}", "public EmployeeDTO updateEmployee(final EmployeeDTO createEmployeeDTO) throws ApplicationCustomException;", "@Override\n public ResponseEntity<Void> createEmployee(EmployeeDTO employeeDTO) throws RestException {\n Employee employee = EmployeeToEmployeeDTOMapper.INSTANCE.employeeDTOToEmployee(employeeDTO);\n employeesService.createEmployee(employee);\n return new ResponseEntity<>(HttpStatus.CREATED);\n }", "@POST\n\t@Path(\"create\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic String createEmployee(@QueryParam(\"employee\") String employeeJsonString) throws ParseException{\n\t\tint id = 0;\n\t\tJSONObject employee = (JSONObject) parser.parse(employeeJsonString);\n\t\tJSONObject employeesJsonObject = (JSONObject) parser.parse(getFileContent());\n\t\tJSONArray employeesArray = (JSONArray) employeesJsonObject.get(\"employee\");\n\t\t\n\t\tif(employeesArray.size() > 0) {\n\t\t\tid = Integer.parseInt(((JSONObject) employeesArray.get(employeesArray.size() - 1)).get(\"id\").toString());\n\t\t}\n\t\taddEmployee(id + 1, employee);\n\t\temployeesArray.add(employee);\n\t\tinsertIntoFile(employeesJsonObject.toString());\n\t\treturn employee.toString();\n\t}", "@Override\n\tpublic void createEmployee(Employee e) {\n\t\t\n\t}", "@Override\n\tpublic Employee saveEmployee(EmployeeDto registerDTO) {\n\n\t\tModelMapper modelMapper = new ModelMapper();\n\n\t\tEmployee employee = modelMapper.map(registerDTO, Employee.class);\n\n\t\treturn employeeDao.saveEmployee(employee);\n\t}", "@Override\n\tpublic Employee registerEmployee(Employee employee) {\n\t\tEmployee updatedEmployee = null;\n\t\ttry {\n\t\t\tlogger.info(\"saving employee = {}\", employee);\n\t\t\tupdatedEmployee = employeeDao.registerEmployee(employee);\n\t\t} catch (Exception exception) {\n\t\t\tlogger.error(exception.getMessage());\n\t\t}\n\t\treturn updatedEmployee;\n\t}", "@Override\n public ResponseEntity createEmployee(@Valid Employee employeeRequest) {\n Employee savedemployee = employeeService.create(employeeRequest);\n URI location= ServletUriComponentsBuilder.fromCurrentRequest().path(\"/{id}\").buildAndExpand(savedemployee.getId()).toUri();\n return ResponseEntity.created(location).build();\n\n }", "@RequestMapping(value = \"/save\", method = RequestMethod.POST)\r\n\tpublic String saveEmployee(HttpServletRequest request,\r\n\t\t\t@ModelAttribute(\"command\") Employee employee, BindingResult result,\r\n\t\t\t@RequestParam String action) {\r\n\t\tSystem.out.println(\"------------- saving or updating emp --------------\");\r\n\t\tSystem.out.println(employee);\r\n\t\tif(action.equalsIgnoreCase(\"Submit\")){\r\n\t\t\tdao.addOrUpdateEmployee(employee);\r\n\t\t}\r\n\t\treturn \"redirect:/\";\r\n\t}", "public void update(Employee employee){\n employeeRepository.save(employee);\n }", "@RequestMapping(params = \"saveEmployee\", method = RequestMethod.POST)\n\tpublic ModelAndView addEmployee(\n\t\t\t@ModelAttribute(\"employee\") Employee employee,\n\t\t\tBindingResult result, Model m) {\n\n\t\temployee.setCreateddate(new Timestamp(new Date().getTime()));\n\t\temployee.setModifieddate(new Timestamp(new Date().getTime()));\n\t\tint empId = empServiceimpl.addUsers(employee);\n\t\tSystem.out.println(\"Employee id after save is \" + empId);\n\t\tString message = \"Employee: \" + empId + \" has been added successfully\";\n\t\t/*\n\t\t * @SuppressWarnings(\"unchecked\") List<Employee> lists =\n\t\t * service.fetchAllDetails(); m.addAttribute(\"lists\", lists);\n\t\t */\n\t\treturn new ModelAndView(\"index\", \"message\", message);\n\t}", "@RequestMapping(value = BASE_URL_API, method=RequestMethod.POST)\r\n public ResponseEntity<?> addNewEmployee(@RequestBody EmployeeVO newEmployeeVO) {\r\n\r\n checkLogin();\r\n\r\n EmployeeVO employeeVO = employeeService.addEmployee(newEmployeeVO);\r\n\r\n return new ResponseEntity<>(employeeVO, HttpStatus.CREATED);\r\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n String firstName = request.getParameter(\"firstname\");\n String lastName = request.getParameter(\"lastname\");\n Date birthDate = null;\n float salary = 0.0f;\n Employee emp = null;\n\n // Try the conversion of the birth and salary strings\n try {\n SimpleDateFormat df = new SimpleDateFormat(\"MMM d, yyyy\");\n String birthDateStr = request.getParameter(\"birthdate\").trim();\n birthDate = new Date(df.parse(birthDateStr).getTime());\n String salaryStr = request.getParameter(\"salary\").trim();\n salary = Float.parseFloat(salaryStr);\n emp = new Employee(firstName, lastName, birthDate, salary);\n } catch (NumberFormatException | ParseException pe) {\n request.setAttribute(\"errorMessage\", \"Exception parsing: \" + pe);\n RequestDispatcher rd = request.getRequestDispatcher(\"failure.jsp\");\n rd.forward(request, response);\n }\n\n // Solution code\n EntityManager em = null;\n try {\n em = emf.createEntityManager();\n utx.begin();\n em.persist(emp);\n utx.commit();\n } catch (NotSupportedException | SystemException | RollbackException | HeuristicMixedException | HeuristicRollbackException | SecurityException | IllegalStateException e) {\n request.setAttribute(\"errorMessage\", \"Exception: \" + e);\n RequestDispatcher rd = request.getRequestDispatcher(\"failure.jsp\");\n rd.forward(request, response);\n }\n\n try {\n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<title>Success</title>\");\n out.println(\"</head>\");\n out.println(\"<body>\");\n out.println(\"<h1>Created New Employee</h1><br/>\");\n out.println(\"ID: \" + emp.getId() + \"<br/>\");\n out.println(\"First Name: \" + emp.getFirstName() + \"<br/>\");\n out.println(\"Last Name: \" + emp.getLastName() + \"<br/>\");\n out.println(\"Birth Date: \" + emp.getBirthDate() + \"<br/>\");\n out.println(\"Salary: \" + emp.getSalary() + \"<br/>\");\n out.println(\"<p><a href=\" + request.getContextPath() + \">Back</a>\");\n out.println(\"</body>\");\n out.println(\"</html>\");\n } finally {\n out.close();\n em.close();\n }\n }", "@Override\r\n\tpublic String AddEmployeeDetails(EmployeeEntity employee) throws CustomException {\n\t\tString strMessage=\"\";\r\n\t\trepository.save(employee);\r\n\t\tstrMessage=\"Employee data has been saved\";\r\n\t\treturn strMessage;\r\n\t}", "public int saveEmp(Emp emp) throws Exception {\n\t\tSession session = null;\n\t\ttry {\n\t\t\tsession = sf.openSession();\n\t\t\tsession.save(emp);\n\t\t\tsession.flush();\n\t\t\treturn 1;\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t\treturn -1;\n\t\t} finally {\n\t\t\tif (session != null)\n\t\t\t\tsession.close();\n\t\t}\n\t}", "@Override\r\n\tpublic int insertEmployee(Employee employee) {\n\t\treturn employeedao.insertEmployee(employee);\r\n\t}", "public void addEmployee(ActionRequest request, ActionResponse response)\n\t\t\tthrows SystemException, IOException, PortalException {\n\t\tlong employeeId = CounterLocalServiceUtil.increment(Employee.class.getName());\n\t\tEmployee employee = null;\n\t\temployee = EmployeeLocalServiceUtil.createEmployee(employeeId);\n\t\temployee.setEmployeeName(ParamUtil.getString(request, \"employeeName\"));\n\t\temployee.setEmployeeDesignation(ParamUtil.getString(request, \"employeeDesignation\"));\n\t\temployee.setAddress(ParamUtil.getString(request, \"address\"));\n\t\temployee.setEmail(ParamUtil.getString(request, \"email\"));\n\t\temployee.setPhoneNumber(ParamUtil.getString(request, \"phoneNumber\"));\n\t\t/* Uploading employee documents */\n\t\tThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);\n\t\t// Checking permission for ADD_EMPLOYEE\n//\t\tEmployeePermission.insertPermission(themeDisplay);\n\t\tcreateFolder(request, themeDisplay);\n\t\tlong fileEntryId = fileUpload(employee, themeDisplay, request);\n\t\temployee.setFileEntryId(fileEntryId);\n\t\t// setting groupId\n\t\temployee.setGroupId(themeDisplay.getScopeGroupId());\n\t\tEmployeeLocalServiceUtil.addEmployee(employee);\n\t\tResourceLocalServiceUtil.addResources(themeDisplay.getCompanyId(), themeDisplay.getScopeGroupId(),\n\t\t\t\tthemeDisplay.getUserId(), Employee.class.getName(), employeeId, false, true, true);\n\t}", "@PostMapping\n\t@Secured(Roles.ADMIN)\n\tpublic ResponseEntity<?> create(@Valid @RequestBody EmployeeDto employeeDto, @RequestParam(required = false) Boolean isBoss) {\n\t\tLogStepIn();\n\n\t\t// Checking if the job type specified in the dto exists or not\n\t\tJobType jobType = jobTypeRepository.findById(employeeDto.jobTypeId.longValue());\n\t\tif(jobType == null)\n\t\t\treturn LogStepOut(ResponseEntity.badRequest().body(\"The Job Type you are trying to bind does not exist!\"));\n\n\t\t// Validation for name & e-mail attribute\n\t\tList<Employee> employeeList = employeeRepository.findAll();\n\t\tfor (Employee employeeElement : employeeList) {\n\t\t\tif(employeeElement.getName().equals(employeeDto.name) || employeeElement.getEmail().equals(employeeDto.email))\n\t\t\t\treturn LogStepOut(ResponseEntity.badRequest().body(\"An employee with this name and email combination already exists!\"));\n\t\t}\n\n\t\t// Validation for work status\n\t\tif(WorkStatus.get(employeeDto.workStatus) == null)\n\t\t\treturn LogStepOut(ResponseEntity.badRequest().body(\"The work status of the employee is invalid!\"));\n\n\t\t// Saving the entity\n\t\tEmployee employee = toEntity(employeeDto, jobType);\n\n\t\t// Saving the entity\n\t\tEmployee createdEmployee = employeeRepository.save(employee);\n\t\tEmployeeDto createdEmployeeDto = toDto(createdEmployee);\n\n\t\t// Creating a user from the employee\n\t\tPasswordEncoder encoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();\n\t\tUser user = new User();\n\t\tuser.setName(createdEmployee.getName());\n\t\tString randomPass = generateRandomPassword(10);\n\t\tuser.setPassword(encoder.encode(randomPass));\n\t\tuser.setRoles(Collections.singletonList((isBoss != null && isBoss) ? Roles.BOSS : Roles.WORKER));\n\t\tuser.setEmployee(createdEmployee);\n\t\tUser createdUser = userRepository.save(user);\n\n\t\t// Binding the user to the employee\n\t\tcreatedEmployee.setUser(createdUser);\n\n\t\t// Sending email about creation\n\t\temailService.sendEmail(EmailConfig.serviceEmailAddress, createdEmployee.getEmail(), \"Welcome\",\n\t\t\t\tMessageFormat.format(\n\t\t\t\t\"Welcome to our organization.\" +\n\t\t\t\t\t\t\"\\nYour password is: {0}\" +\n\t\t\t\t\t\t\"\\nYou can login to your account here: {1}\",\n\t\t\trandomPass, \"http://localhost:8080/login\"));\n\n\t\t// Getting the request URI for created status location header\n\t\tServletUriComponentsBuilder builder = ServletUriComponentsBuilder.fromCurrentRequestUri();\n\t\tbuilder.path(\"/\" + createdEmployeeDto.id);\n\n\t\treturn LogStepOut(ResponseEntity.created(builder.build().toUri()).body(createdEmployeeDto));\n\t}", "@Transactional\n\t@CacheEvict(cacheNames = {\"allEmployeesCache\"}, allEntries = true)\n\tpublic void addEmployee(Employee employee) throws Exception {\n\t\tString password = passwordService.createPassword();\n\t\tString passwordEncode = passwordEncoder.encode(password);\n\t\tUser user = employee.getUser();\n\t\tuser.setEnabled(true);\n\t\tuser.setPassword(passwordEncode);\n\t\tOptional<Role> role1 = roleRepository.findById(1L);\n\t\tOptional<Role> role4 = roleRepository.findById(4L);\n List<Role> roles = new ArrayList<>();\n roles.add(role1.get());\n roles.add(role4.get());\n user.setRoles(roles);\n employee.setRegisterDateTime(LocalDateTime.now());\n final User userFromRequest = getUserFromRequest();\n employee.setUserRegister(userFromRequest);\n\t\temployeeRepository.save(employee);\n\t\tsendEmailForAddAdminEmployee(employee, password);\n\t}", "@Override\r\n\tpublic <S extends Employee> S save(S arg0) {\n\t\treturn null;\r\n\t}", "public String addEmployee(EmployeeDetails employeeDetails) throws NullPointerException;", "@RequestMapping(value=\"/employeeupdt\", method=RequestMethod.POST)\npublic String UpdateSave(EmployeeRegmodel erm)\n{\n\tEmployeeRegmodel erm1 = ergserv.findOne(erm.getEmployee_id());\n\t\n\term1.setEmployee_address(erm.getEmployee_address());\n\term1.setEmail(erm.getEmail());\n\term1.setEmployee_dob(erm.getEmployee_dob());\n\term1.setEmployee_phoneno(erm.getEmployee_phoneno());\n\term1.setEmployee_password(erm.getEmployee_password());\n\term1.setEmployee_fullname(erm.getEmployee_fullname());\n\term1.setEmployee_fname(erm.getEmployee_fname());\n\t\n\tergserv.updateEmployeeRegmodel(erm1);\n\treturn \"update.jsp\";\n}", "public void updateEmployee(Long employeeId, CreateOrEditEmployeeRequestDto employee) throws ApiDemoBusinessException;", "private void addEmployee(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\tString firstName = request.getParameter(\"firstName\");\r\n\t\tString lastName = request.getParameter(\"lastName\");\r\n\t\tString gender = request.getParameter(\"gender\");\r\n\t\tint age = Integer.parseInt(request.getParameter(\"age\"));\r\n\t\tString email = request.getParameter(\"email\");\t\t\r\n\t\t\r\n\t\t// create a new employee object\r\n\t\tEmployee theEmployee = new Employee (firstName, lastName,gender,age, email);\r\n\t\t\r\n\t\t// add the employee to the database\r\n\t\temployeeDAO.addEmployee(theEmployee);\r\n\t\t\t\t\r\n\t\t// send back to main page (the student list)\r\n\t\tlistEmployees(request, response);\r\n\t}", "@RequestMapping(value = \"/employee/{empId}\", method = RequestMethod.PUT)\r\n\tpublic Employee updateEmployee(@RequestBody Employee employee, @PathVariable int empId)\r\n\t\t\tthrows EmployeeMaintainceException {\r\n\t\ttry {\r\n\t\t\treturn eService.updateEmployee(employee, empId);\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new EmployeeMaintainceException(400, e.getMessage());\r\n\t\t}\r\n\r\n\t}", "@PostMapping\n private ResponseEntity<EmployeeDto> create(@RequestBody EmployeeDto employeeDto){\n Employee employeeRequest = modelMapper.map(employeeDto, Employee.class);\n\n // Save data to DB using create method()\n // passing converted Dto -> entity as parameter\n Employee employee = employeeService.create(employeeRequest);\n\n // Convert back from Entity -> Dto\n // for returning values to the front end\n EmployeeDto employeeResponse = modelMapper.map(employee, EmployeeDto.class);\n\n return new ResponseEntity<EmployeeDto>(employeeResponse, HttpStatus.CREATED);\n }", "@Override\n public void save(Employee theEmployee) {\n Employee dbEmployee = entityManager.merge(theEmployee);\n theEmployee.setId(dbEmployee.getId());\n }", "@PutMapping(\"/UpdateEmployee/{empId}\")\r\n public String updateEmployee(@RequestBody Employee employee, @PathVariable String empId) {\r\n return admin.updateEmployeeService(employee, empId);\r\n }", "public EmployeeDTO createEmployee(final EmployeeDTO createEmployeeDTO) throws ApplicationCustomException;", "@PutMapping(\"/update\")\n\t public Employee updateEmployee(@RequestBody Employee emp)\n\t {\n\t\treturn employeeService.editEmployee(emp);\n\t }", "@POST\n @Consumes(MediaType.APPLICATION_JSON)\n public void newEmployee(String task) {\n Employee employee = new Employee(\"Bruno\");\n employeeService.updateTask(employee);\n }", "@Override\r\n\tpublic String save(Emp e) {\n\t\treturn \"JPA :Emp saved with ID \" + e.getEmpId(); \r\n\t}", "@Override\n\tpublic Employee updateEmployee(Employee emp) {\n\t\tlog.debug(\"EmplyeeService.updateEmployee(Employee emp) update Employee object whos id is\" + emp.getId());\n\t\treturn repositary.save(emp);\n\t}", "@Override \n\tpublic Integer saveEmployee(EmployeeBean employeeBean, DepartmentBean departmentBean) throws EmployeeAgeException {\n\t\t\n\t\tLOGGER.info(\"starts saveEmployee method\");\n\t\t\n\t\tlong age = DateCalculation.getAge(employeeBean.getDob());\n\t\t\n\t\tif(age < 25)\n\t\t{\n\t\t\tthrow new EmployeeAgeException();\n\t\t}\n\t\t\n\t\tLOGGER.info(\"Ends saveEmployee method\");\n\t\treturn adminEmployeeDao.saveEmployee(employeeBean);\n\t}", "public static void registerEmployee(RequestHandler handler) {\n\n\t\tEmployee e = new Employee();\n\t\te.setId(-1);\n\n\t\tStringBuilder sb;\n\t\tsb = new StringBuilder();\n\t\tsb.append(\"\\nPlease enter employee email: \");\n\t\thandler.sendMessage(sb);\n\t\tString eEmail = handler.getMessage();\n\n\t\tif (eEmail != null) {\n\t\t\thandler.sendMessage(\"RECEIVED: \" + eEmail);\n\t\t\tif (Utils.isValidEmailAddress(eEmail)) {\n\t\t\t\tif (!EmployeeData.emailExists(eEmail)) {\n\t\t\t\t\t// we have a valid, unique email address\n\t\t\t\t\te.setEmail(eEmail);\n\t\t\t\t\thandler.sendMessage(\"Please enter employee name: \");\n\t\t\t\t\teEmail = null;\n\n\t\t\t\t\tString eName = handler.getMessage();\n\t\t\t\t\tif (eName != null && eName.length() > 0) {\n\n\t\t\t\t\t\te.setName(eName);\n\t\t\t\t\t\thandler.sendMessage(\"Please enter department name: \");\n\t\t\t\t\t\teName = null;\n\n\t\t\t\t\t\tString eDept = handler.getMessage();\n\t\t\t\t\t\tif (eDept != null && eDept.length() > 0) {\n\t\t\t\t\t\t\te.setDepartment(eDept);\n\n\t\t\t\t\t\t\tif (EmployeeData.addEmployee(e)) {\n\t\t\t\t\t\t\t\thandler.sendMessage(\"Employee \" + e.getEmail() + \" successfully added with ID \" + e.getId());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thandler.sendMessage(\"Failed to add employee \" + e.getEmail() + \", reason unknown\");\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 {\n\t\t\t\t\thandler.sendMessage(\"User with email \" + eEmail + \" already exists on system - ABORTING\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler.sendMessage(\"Invalid email address format for: \" + eEmail + \" - ABORTING\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public void updateemployee(Employeee em) {\n\t\temployeerepo.save(em);\n\t}", "private void updateEmployee(HttpServletRequest request, HttpServletResponse response)\r\n\t\tthrows Exception {\n\t\tint id = Integer.parseInt(request.getParameter(\"employeeId\"));\r\n\t\tString firstName = request.getParameter(\"firstName\");\r\n\t\tString lastName = request.getParameter(\"lastName\");\r\n\t\tint age = Integer.parseInt(request.getParameter(\"age\"));\r\n\t\tString gender = request.getParameter(\"gender\");\r\n\t\tString email = request.getParameter(\"email\");\r\n\t\t\r\n\t\t// create a new student object\r\n\t\tEmployee theEmployee = new Employee (id, firstName, lastName,gender,age, email);\r\n\t\t\r\n\t\t// perform update on database\r\n\t\temployeeDAO.updateEmployee(theEmployee);\r\n\t\t\r\n\t\t// send them back to the \"list students\" page\r\n\t\tlistEmployees(request, response);\r\n\t\t\r\n\t}", "public void addEmployee(Employee emp) {\n\t\t\r\n\t}", "@RequestMapping(path = \"/saveemployee\", method = RequestMethod.POST)\r\n\tpublic String saveproject(@ModelAttribute(\"employee\") Employee employee,\r\n\t\t\t@RequestParam(\"skills\") String[] skills) {\r\n\t\tSystem.out.println(skills[0]);\r\n\t\tif (employee != null && employee.getId() == 0) {\r\n\r\n\t\t\tboolean status = employeeService.checkByEmail(employee.getEmail());\r\n\r\n\t\t\tif (status) {\r\n\t\t\t\treturn \"redirect:/admin/editEmployee\";\r\n\t\t\t}\r\n\r\n\t\t\tString employeeId = \"E18/\" + employee.getFirstName() + \"/\"\r\n\t\t\t\t\t+ employee.getLastname();\r\n\t\t\temployee.setEmployee_id(employeeId);\r\n\r\n\t\t\temployeeService.createEmployee(employee);\r\n\t\t\t// loop to insert in skill relation\r\n\t\t\tfor (int i = 0; i < skills.length; i++) {\r\n\r\n\t\t\t\tSkill skill = skillService.getSkillById(Integer\r\n\t\t\t\t\t\t.parseInt(skills[i]));\r\n\t\t\t\tEmployeeSkills empSkills = new EmployeeSkills();\r\n\t\t\t\tempSkills.setEmployeeId(employee.getId());\r\n\t\t\t\tempSkills.setSkillId(skill.getId());\r\n\t\t\t\tskillService.insertInSkillRelation(empSkills);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\temployeeService.updateEmployee(employee);\r\n\t\t}\r\n\t\treturn \"redirect:/admin/employee\";\r\n\t}" ]
[ "0.79641026", "0.7951724", "0.7836914", "0.7825303", "0.7798182", "0.7797847", "0.77581966", "0.7704043", "0.76252", "0.76142955", "0.75735116", "0.75677377", "0.7549596", "0.74815434", "0.7481348", "0.74735445", "0.7448704", "0.74108285", "0.7374687", "0.733961", "0.73273724", "0.728026", "0.7257548", "0.7235721", "0.72302186", "0.7222177", "0.7206104", "0.72016895", "0.71548736", "0.7146161", "0.7146003", "0.7108465", "0.710336", "0.70751804", "0.6985273", "0.6977752", "0.69715595", "0.6942829", "0.692542", "0.68901753", "0.6855662", "0.6841436", "0.68361074", "0.6820893", "0.67366123", "0.6733944", "0.67323506", "0.67103916", "0.6704009", "0.6680683", "0.665628", "0.66075885", "0.65989506", "0.65380263", "0.6530613", "0.65103817", "0.64838386", "0.64533645", "0.64523816", "0.6435387", "0.6422626", "0.6416692", "0.64045626", "0.63900065", "0.63603544", "0.63488954", "0.63352686", "0.6311165", "0.62810457", "0.6258798", "0.62510014", "0.62468946", "0.62441456", "0.62277734", "0.62174505", "0.620953", "0.62033415", "0.61874664", "0.61762404", "0.61541164", "0.61489606", "0.61466414", "0.6143113", "0.61392653", "0.61250395", "0.61019164", "0.60806584", "0.607757", "0.6068097", "0.6049009", "0.60476625", "0.6043774", "0.60265666", "0.6025972", "0.60192865", "0.6013164", "0.6008739", "0.6003138", "0.59826696", "0.5981817" ]
0.71543944
29
log.debug("ExportStatus fileId "+ fileId);
@RequestMapping(value = "/employee/export/{fileId}/status",method = RequestMethod.GET) public ExportResult exportStatus(@PathVariable("fileId") String fileId) { ExportResult result = employeeService.getExportStatus(fileId); if(result!=null && result.getStatus() != null) { //log.info("result.getSTATUS----------"+result.getStatus()); switch(result.getStatus()) { case "PROCESSING" : result.setMsg("Exporting..."); break; case "COMPLETED" : result.setMsg("Download"); //log.info("FILE-ID--------"+fileId); result.setFile("/api/employee/export/"+fileId); //log.info("FILE-ID AFTER RESULT--------"+result); break; case "FAILED" : result.setMsg("Failed to export. Please try again"); break; default : result.setMsg("Failed to export. Please try again"); break; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void run() {\n\t\t\t\tString filePath = env.getProperty(\"export.file.path\");\n\t\t\t\tFileSystem fileSystem = FileSystems.getDefault();\n\t\t\t\tif (StringUtils.isNotEmpty(empId)) {\n\t\t\t\t\tfilePath += \"/\" + empId;\n\t\t\t\t}\n\t\t\t\tPath path = fileSystem.getPath(filePath);\n\t\t\t\t// path = path.resolve(String.valueOf(empId));\n\t\t\t\tif (!Files.exists(path)) {\n\t\t\t\t\tPath newEmpPath = Paths.get(filePath);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tFiles.createDirectory(newEmpPath);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlog.error(\"Error while creating path \" + newEmpPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfilePath += \"/\" + exportFileName;\n\t\t\t\ttry {\n\t\t\t\t\t// initialize FileWriter object\n\t\t\t\t\tlog.debug(\"filePath = \" + filePath + \", isAppend=\" + isAppend);\n\t\t\t\t\tfileWriter = new FileWriter(filePath, isAppend);\n\t\t\t\t\tString siteName = null;\n\n\t\t\t\t\t// initialize CSVPrinter object\n\t\t\t\t\tcsvFilePrinter = new CSVPrinter(fileWriter, csvFileFormat);\n\t\t\t\t\tif (!isAppend) {\n\t\t\t\t\t\t// Create CSV file header\n\t\t\t\t\t\tcsvFilePrinter.printRecord(CONSOLIDATED_REPORT_FILE_HEADER);\n\t\t\t\t\t}\n\t\t\t\t\tfor (ReportResult transaction : content) {\n\t\t\t\t\t\tif (StringUtils.isEmpty(siteName) || !siteName.equalsIgnoreCase(transaction.getSiteName())) {\n\t\t\t\t\t\t\tcsvFilePrinter.printRecord(\"\");\n\t\t\t\t\t\t\tcsvFilePrinter\n\t\t\t\t\t\t\t\t\t.printRecord(\"CLIENT - \" + projName + \" SITE - \" + transaction.getSiteName());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tList record = new ArrayList();\n\t\t\t\t\t\tlog.debug(\"Writing transaction record for site :\" + transaction.getSiteName());\n\t\t\t\t\t\trecord.add(transaction.getSiteName());\n\t\t\t\t\t\trecord.add(transaction.getLocatinName());\n\t\t\t\t\t\trecord.add(transaction.getAssignedJobCount());\n\t\t\t\t\t\trecord.add(transaction.getCompletedJobCount());\n\t\t\t\t\t\trecord.add(transaction.getOverdueJobCount());\n\t\t\t\t\t\trecord.add(transaction.getTat());\n\t\t\t\t\t\tcsvFilePrinter.printRecord(record);\n\t\t\t\t\t}\n\t\t\t\t\tlog.info(exportFileName + \" CSV file was created successfully !!!\");\n\t\t\t\t\tstatusMap.put(exportFileName, \"COMPLETED\");\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlog.error(\"Error in CsvFileWriter !!!\");\n\t\t\t\t\tstatusMap.put(exportFileName, \"FAILED\");\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfileWriter.flush();\n\t\t\t\t\t\tfileWriter.close();\n\t\t\t\t\t\tcsvFilePrinter.close();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlog.error(\"Error while flushing/closing fileWriter/csvPrinter !!!\");\n\t\t\t\t\t\tstatusMap.put(exportFileName, \"FAILED\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlock.unlock();\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tString filePath = env.getProperty(\"export.file.path\");\n\t\t\t\tFileSystem fileSystem = FileSystems.getDefault();\n\t\t\t\tif (StringUtils.isNotEmpty(empId)) {\n\t\t\t\t\tfilePath += \"/\" + empId;\n\t\t\t\t}\n\t\t\t\tPath path = fileSystem.getPath(filePath);\n\t\t\t\t// path = path.resolve(String.valueOf(empId));\n\t\t\t\tif (!Files.exists(path)) {\n\t\t\t\t\tPath newEmpPath = Paths.get(filePath);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tFiles.createDirectory(newEmpPath);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlog.error(\"Error while creating path \" + newEmpPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfilePath += \"/\" + exportFileName;\n\t\t\t\ttry {\n\t\t\t\t\t// initialize FileWriter object\n\t\t\t\t\tlog.debug(\"filePath = \" + filePath + \", isAppend=\" + isAppend);\n\t\t\t\t\tfileWriter = new FileWriter(filePath, isAppend);\n\t\t\t\t\t// initialize CSVPrinter object\n\t\t\t\t\tcsvFilePrinter = new CSVPrinter(fileWriter, csvFileFormat);\n\t\t\t\t\tif (!isAppend) {\n\t\t\t\t\t\t// Create CSV file header\n\t\t\t\t\t\tcsvFilePrinter.printRecord(JOB_DETAIL_REPORT_FILE_HEADER);\n\t\t\t\t\t}\n\t\t\t\t\tfor (JobDTO transaction : content) {\n\t\t\t\t\t\tList record = new ArrayList();\n\t\t\t\t\t\tlog.debug(\"Writing transaction record for site :\" + transaction.getSiteName());\n\t\t\t\t\t\trecord.add(transaction.getSiteName());\n\t\t\t\t\t\trecord.add(String.valueOf(transaction.getTitle()));\n\t\t\t\t\t\trecord.add(transaction.getEmployeeName());\n\t\t\t\t\t\trecord.add(transaction.getJobType());\n\t\t\t\t\t\trecord.add(transaction.getPlannedStartTime());\n\t\t\t\t\t\trecord.add(transaction.getActualEndTime());\n\t\t\t\t\t\trecord.add(transaction.getJobStatus() != null ? transaction.getJobStatus().name()\n\t\t\t\t\t\t\t\t: JobStatus.OPEN.name());\n\t\t\t\t\t\tcsvFilePrinter.printRecord(record);\n\t\t\t\t\t}\n\t\t\t\t\tlog.info(exportFileName + \" CSV file was created successfully !!!\");\n\t\t\t\t\tstatusMap.put(exportFileName, \"COMPLETED\");\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlog.error(\"Error in CsvFileWriter !!! \" + e);\n\t\t\t\t\tstatusMap.put(exportFileName, \"FAILED\");\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfileWriter.flush();\n\t\t\t\t\t\tfileWriter.close();\n\t\t\t\t\t\tcsvFilePrinter.close();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlog.error(\"Error while flushing/closing fileWriter/csvPrinter !!!\");\n\t\t\t\t\t\tstatusMap.put(exportFileName, \"FAILED\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlock.unlock();\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tString filePath = env.getProperty(\"export.file.path\");\n\t\t\t\tFileSystem fileSystem = FileSystems.getDefault();\n\t\t\t\tif (StringUtils.isNotEmpty(empId)) {\n\t\t\t\t\tfilePath += \"/\" + empId;\n\t\t\t\t}\n\t\t\t\tPath path = fileSystem.getPath(filePath);\n\t\t\t\t// path = path.resolve(String.valueOf(empId));\n\t\t\t\tif (!Files.exists(path)) {\n\t\t\t\t\tPath newEmpPath = Paths.get(filePath);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tFiles.createDirectory(newEmpPath);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlog.error(\"Error while creating path \" + newEmpPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfilePath += \"/\" + exportFileName;\n\t\t\t\ttry {\n\t\t\t\t\t// initialize FileWriter object\n\t\t\t\t\tlog.debug(\"filePath = \" + filePath + \", isAppend=\" + isAppend);\n\t\t\t\t\tfileWriter = new FileWriter(filePath, isAppend);\n\t\t\t\t\t// initialize CSVPrinter object\n\t\t\t\t\tcsvFilePrinter = new CSVPrinter(fileWriter, csvFileFormat);\n\t\t\t\t\tif (!isAppend) {\n\t\t\t\t\t\t// Create CSV file header\n\t\t\t\t\t\tcsvFilePrinter.printRecord(DETAIL_REPORT_FILE_HEADER);\n\t\t\t\t\t}\n\t\t\t\t\t// Write a new student object list to the CSV file\n\t\t\t\t\tfor (AttendanceDTO transaction : content) {\n\t\t\t\t\t\tList record = new ArrayList();\n\t\t\t\t\t\tlog.debug(\"Writing transaction record for Employee id :\" + transaction.getEmployeeEmpId());\n\t\t\t\t\t\trecord.add(transaction.getSiteName());\n\t\t\t\t\t\trecord.add(transaction.getCreatedDate());\n\t\t\t\t\t\trecord.add(String.valueOf(transaction.getEmployeeEmpId()));\n\t\t\t\t\t\trecord.add(transaction.getEmployeeFullName());\n\t\t\t\t\t\trecord.add(DateUtil.convertUTCToIST(transaction.getCheckInTime()));\n\t\t\t\t\t\trecord.add(DateUtil.convertUTCToIST(transaction.getCheckOutTime()));\n\t\t\t\t\t\tcsvFilePrinter.printRecord(record);\n\t\t\t\t\t}\n\t\t\t\t\tlog.info(exportFileName + \" CSV file was created successfully !!!\");\n\t\t\t\t\tstatusMap.put(exportFileName, \"COMPLETED\");\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlog.error(\"Error in CsvFileWriter !!!\");\n\t\t\t\t\tstatusMap.put(exportFileName, \"FAILED\");\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfileWriter.flush();\n\t\t\t\t\t\tfileWriter.close();\n\t\t\t\t\t\tcsvFilePrinter.close();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlog.error(\"Error while flushing/closing fileWriter/csvPrinter !!!\");\n\t\t\t\t\t\tstatusMap.put(exportFileName, \"FAILED\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlock.unlock();\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tString filePath = env.getProperty(\"export.file.path\");\n\t\t\t\tFileSystem fileSystem = FileSystems.getDefault();\n\t\t\t\t// if(StringUtils.isNotEmpty(empId)) {\n\t\t\t\t// filePath += \"/\" + empId;\n\t\t\t\t// }\n\t\t\t\tPath path = fileSystem.getPath(filePath);\n\t\t\t\t// path = path.resolve(String.valueOf(empId));\n\t\t\t\tif (!Files.exists(path)) {\n\t\t\t\t\tPath newEmpPath = Paths.get(filePath);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tFiles.createDirectory(newEmpPath);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlog.error(\"Error while creating path \" + newEmpPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfilePath += \"/\" + exportFileName;\n\t\t\t\ttry {\n\t\t\t\t\t// initialize FileWriter object\n\t\t\t\t\tlog.debug(\"filePath = \" + filePath + \", isAppend=\" + isAppend);\n\t\t\t\t\tfileWriter = new FileWriter(filePath, isAppend);\n\t\t\t\t\t// initialize CSVPrinter object\n\t\t\t\t\tcsvFilePrinter = new CSVPrinter(fileWriter, csvFileFormat);\n\t\t\t\t\tif (!isAppend) {\n\t\t\t\t\t\t// Create CSV file header\n\t\t\t\t\t\tcsvFilePrinter.printRecord(EMPLOYEE_DETAIL_REPORT_FILE_HEADER);\n\t\t\t\t\t}\n\t\t\t\t\t// Write a new student object list to the CSV file\n\t\t\t\t\tfor (EmployeeDTO transaction : content) {\n\t\t\t\t\t\tList record = new ArrayList();\n\t\t\t\t\t\t// log.debug(\"Writing transaction record for Employee id :\"+\n\t\t\t\t\t\t// transaction.getEmployeeEmpId());\n\t\t\t\t\t\trecord.add(transaction.getEmpId());\n\t\t\t\t\t\trecord.add(transaction.getName());\n\t\t\t\t\t\trecord.add(transaction.getDesignation());\n\t\t\t\t\t\trecord.add(transaction.getManagerName());\n\t\t\t\t\t\trecord.add(transaction.getProjectName());\n\t\t\t\t\t\trecord.add(transaction.getSiteName());\n\t\t\t\t\t\trecord.add(transaction.getActive());\n\t\t\t\t\t\tcsvFilePrinter.printRecord(record);\n\t\t\t\t\t}\n\t\t\t\t\tlog.info(exportFileName + \" CSV file was created successfully !!!\");\n\t\t\t\t\tstatusMap.put(exportFileName, \"COMPLETED\");\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlog.error(\"Error in CsvFileWriter !!!\");\n\t\t\t\t\tstatusMap.put(exportFileName, \"FAILED\");\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfileWriter.flush();\n\t\t\t\t\t\tfileWriter.close();\n\t\t\t\t\t\tcsvFilePrinter.close();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlog.error(\"Error while flushing/closing fileWriter/csvPrinter !!!\");\n\t\t\t\t\t\tstatusMap.put(exportFileName, \"FAILED\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlock.unlock();\n\t\t\t}", "private void logToFile() {\n }", "public Long getFileId() {\n/* 35:35 */ return this.fileId;\n/* 36: */ }", "public void dumpLog(String filename){\n }", "public Long getFileID()\n/* */ {\n/* 88 */ return this.fileID;\n/* */ }", "@Test\n public void fileIdTest() {\n // TODO: test fileId\n }", "private void exportFiles()\n\t{\n\t\tloading.setVisibility(View.VISIBLE);\n\t\t\n\t\t// Report String\n\t\t//----------------\n\t\tString reportString = \"Date,Location Latitude, Location Longitude,Vehicle,Description\\n\";\t\n\t\t\n\t\tStringBuilder reportBuilder = new StringBuilder();\n\t\treportBuilder.append(reportString);\n\t\t\n\t\tString objectString = \"\"+ \n\t\t\t\tincident.getDate()+\",\" +\n\t\t\t\tincident.getLatitude() + \",\" +\n\t\t\t\tincident.getLongitude()+\",\" +\n\t\t\t\tincident.getVehicleReg()+\",\" +\n\t\t\t\tincident.getDescription()+\",\" + \"\\n\";\n\t\t\n\t\treportBuilder.append(objectString);\n\t\t\n\t\t// Witnesses String\n\t\t//----------------\n\t\tString witnessString = \"witnessName,witnessEmail,witnessNumber,witnessStatement\\n\";\n\t\t\n\t\tStringBuilder witnessesBuilder = new StringBuilder();\n\t\twitnessesBuilder.append(witnessString);\n\t\t\n\t\tfor(int i=0; i<incident.getWitnesses().size(); i++)\n\t\t{\n\t\t\tobjectString = \"\"+ \n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessName\")+\",\" +\n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessEmail\") + \",\" +\n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessNumber\")+\",\" +\n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessStatement\")+\",\" + \"\\n\";\n\t\t\t\n\t\t\twitnessesBuilder.append(objectString);\n\t\t}\n\t\t//-------------------------------------------------\n\t\t\n\t\t// Create file\n\t\t//===========================================\n\t\t// Incident Report\n\t\t//-------------------------------------------------\n\t\tfinal File reportFile = new File(getFilesDir() + \"/\" + \"incident_report.csv\");\n\t\treportFile.setReadable(true,false);\n\t\t\n\t\tif( reportFile != null )\n\t\t{\n\t\t try \n\t\t {\n\t\t \tFileOutputStream fOut = openFileOutput(\"incident_report.csv\", Context.MODE_WORLD_READABLE);\n\t\t \tOutputStreamWriter osw = new OutputStreamWriter(fOut); \n\t\t \tosw.write(reportBuilder.toString());\n\t\t\t\tosw.flush();\n\t\t\t\tosw.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t//-------------------------------------------------\n\t\t\n\t\t// Witnesses file\n\t\t//-------------------------------------------------\n\t\tfinal File witnessesFile = new File(getFilesDir() + \"/\" + \"witnesses.csv\");\n\t\twitnessesFile.setReadable(true,false);\n\t\t\n\t\tif( witnessesFile != null )\n\t\t{\n\t\t try \n\t\t {\n\t\t \tFileOutputStream fOut = openFileOutput(\"witnesses.csv\", Context.MODE_WORLD_READABLE);\n\t\t \tOutputStreamWriter osw = new OutputStreamWriter(fOut); \n\t\t \tosw.write(witnessesBuilder.toString());\n\t\t\t\tosw.flush();\n\t\t\t\tosw.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t//-------------------------------------------------\n\t\t\n\t\t// Media files\n\t\t//-------------------------------------------------\t\n\t\tParseQuery<ParseObject> query = ParseQuery.getQuery(\"DCIncident\");\n\t\tquery.getInBackground(incident.getId(),new GetCallback<ParseObject>() \n\t\t{\n\t\t\t@Override\n\t\t\tpublic void done(final ParseObject parseIncident, ParseException e) \n\t\t\t{\n\t\t\t\tif(e == null)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t// Get number of photos attached\n\t\t\t\t\tParseQuery<ParseObject> queryPhotos = parseIncident.getRelation(\"incidentPhotos\").getQuery();\n\t\t\t\t\tqueryPhotos.findInBackground(new FindCallback<ParseObject>()\n\t\t\t\t\t{\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void done(List<ParseObject> parsePhotos, ParseException e) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tArrayList<byte[]> bytes = new ArrayList<byte[]>();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(int i=0; i<parsePhotos.size(); i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Get photo from the parse\n\t\t\t\t\t\t\t\tParseFile photo = (ParseFile) parsePhotos.get(i).get(\"photoFile\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tbytes.add(photo.getData());\n\t\t\t\t\t\t\t\t} catch (ParseException e1) {\n\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tphotoFiles = AssetsUtilities.saveIncidentPhoto(ReviewReportActivity.this, bytes);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Video\n\t\t\t\t\t\t\tParseFile parseVideo = (ParseFile) parseIncident.get(\"incidentVideo\");\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(parseVideo != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tparseVideo.getDataInBackground(new GetDataCallback()\n\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 done(byte[] data, ParseException e) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif(e == null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// Save file\n\t\t\t\t\t\t\t\t\t\t\tvideoFile = AssetsUtilities.saveIncidentVideo(ReviewReportActivity.this,data);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tfinishSendingEmail(reportFile, witnessesFile);\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\tfinishSendingEmail(reportFile, witnessesFile);\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 Long getEventFileID()\n/* */ {\n/* 40 */ return this.eventFileID;\n/* */ }", "private void saveLocalFile(ByteArrayOutputStream out) {\n //sava in local files\n FileWriter fw;\n File file = new File(\"/home/shaowen2/testdata/\" + \"vm\" +servers.getServerAddress().substring(15, 17) +\"-ouput.log\");\n\n try {\n if (!file.exists()) {\n file.createNewFile();\n }\n fw = new FileWriter(file);\n BufferedWriter bw = new BufferedWriter(fw);\n bw.write(out.toString());\n //bw.write(\"\\n\" + \"Query Count:\" + count + \"|| Time:\" + new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").format(new Date()) + \"\\n\");\n bw.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void reportFiles(Observable<RepositoryStatusFileInformation> files) {\n \n }", "@Override\n public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {\n progressBar.setVisibility(View.GONE);\n Toast.makeText(getContext(), \"Your file is saved in \" + localFile.toString(), Toast.LENGTH_LONG).show();\n }", "public static void exportData(Context context){\r\n \t\tinvokeLoggerService(context, MainPipeline.ACTION_ARCHIVE_DATA);\r\n \t}", "public CATMFGDWInvoicePush_FlatFile(){\n\n}", "public void setFileId(Long fileId) {\n/* 31:31 */ this.fileId = fileId;\n/* 32: */ }", "@Override\n\tpublic int getFileStatus() {\n\t\treturn 0;\n\t}", "public String getFileName() {\n/* 43:43 */ return this.fileName;\n/* 44: */ }", "void setupFileLogging();", "public void onDownloadSuccess(String fileInfo);", "public void working(final String fileName) {\n Intent intent = new Intent(Constant.ACTION_IMPORTING_EXPORING);\n WorkingState workState = isExport() ? WorkingState.EXPORTING : WorkingState.IMPORTING;\n intent.putExtra(\"workingstate\", workState.ordinal());\n intent.putExtra(\"workingname\", fileName);\n mContext.sendBroadcast(intent);\n // showNotification(fileName);\n mHandler.post(new Runnable() {\n @Override\n public void run() {\n showProgressDlg(fileName);\n }\n });\n }", "void downloadProjectedEto(File file, int id) throws IOException, SQLException;", "@Override\n\tpublic void printToFile() {\n\t\t\n\t}", "IFileLogger log();", "@Override\n public void progress(FileStatus status) {\n progressReporter.progress();\n }", "void fileSent(IMSession session, String requestId, String fileId);", "private static void printFileInfo(File file) {\n window.putLog(String.format(\"[%6dkb] Modified %s @%s\", 1 + file.length() / 1024,\n new SimpleDateFormat(\"YYYY-MM-dd HH:mm\").format(new Date(file.lastModified())),\n file.getPath().substring(workingDirectory.getParent().length())));\n }", "@Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\tif(filename==null){\n\t\t\t\t\t\t\tcommond.setToast( getApplication().getString(R.string.dilog_digtool_empty));\n\t\t\t\t\t\t}\n\t\t\t\t\t Xlsmake xls=new Xlsmake(xyz);\n\t\t\t\t try {\n xls.toxls(fname);\n commond.setToast( getApplication().getString(R.string.dilog_export_success));\n //Toast.makeText(getApplicationContext(), \"导出成功\", Toast.LENGTH_SHORT).show();\n } catch (RowsExceededException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n commond.setToast( getApplication().getString(R.string.dilog_export_fail));\n //Toast.makeText(getApplicationContext(), \"导出失败\", Toast.LENGTH_LONG).show();\n return ;\n } catch (WriteException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n commond.setToast( getApplication().getString(R.string.dilog_export_fail));\n //Toast.makeText(getApplicationContext(), \"导出失败\", Toast.LENGTH_LONG).show();\n return ;\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n commond.setToast( getApplication().getString(R.string.dilog_export_fail));\n //Toast.makeText(getApplicationContext(), \"导出失败\", Toast.LENGTH_LONG).show();\n return ;\n }\n\t\t\t\t}", "private String setFileName() {\n Calendar c = Calendar.getInstance();\n\n String LOG = \"\";\n\n LOG += c.get(Calendar.YEAR);\n\n if (c.get(Calendar.MONTH) < 10)\n LOG += \"0\";\n LOG += c.get(Calendar.MONTH) + 1;\n\n if (c.get(Calendar.DATE) < 10)\n LOG += \"0\";\n LOG += c.get(Calendar.DATE);\n\n if (c.get(Calendar.HOUR_OF_DAY) < 10)\n LOG += \"0\";\n LOG += c.get(Calendar.HOUR_OF_DAY);\n\n if (c.get(Calendar.MINUTE) < 10)\n LOG += \"0\";\n LOG += c.get(Calendar.MINUTE);\n\n LOG += \".csv\";\n\n return LOG;\n }", "public abstract String getExportLocation();", "public void setFileID(Long fileID)\n/* */ {\n/* 100 */ this.fileID = fileID;\n/* */ }", "public String uploadFile(String filename, InputStream is)\n {\n String url=null;\n try {\n \n FileMetadata metadata = client.files().uploadBuilder(\"/\"+filename).uploadAndFinish(is);\n SharedLinkMetadata sharedLinkMetadata = client.sharing().createSharedLinkWithSettings(\"/\"+filename);\n url=sharedLinkMetadata.getUrl();\n url=url.substring(0, url.length()-1)+\"1\";\n \n }\n// catch (FileNotFoundException fne)\n// {\n// System.out.println(\"96 : FileNotFoundException Caused By \"+fne.getLocalizedMessage());\n// }\n catch (IOException ioe)\n {\n System.out.println(\"100 : IOException Caused By \"+ioe.getLocalizedMessage());\n }\n// catch (DbxException dbxe)\n// {\n// \n// System.out.println(\"105 : DbxException Caused By \"+dbxe.getLocalizedMessage());\n// }\n catch(DbxException e)\n {\n System.out.println(\"--++--------+++++\");\n session = sfobj.openSession();\n tx = session.beginTransaction();\n\n System.out.println(\"line no= \"+e.getStackTrace()[2].getLineNumber());\n System.out.println(\"mathod name= \"+e.getStackTrace()[2].getMethodName());\n System.out.println(\"type= \"+e.toString());\n String nameofCurrMethod = new Throwable() \n .getStackTrace()[2] \n .getMethodName(); \n System.out.println(\"----method\"+nameofCurrMethod);\n // System.out.println(ea.getStackTrace().toString());\n System.out.println(\"class name= \"+e.getStackTrace()[2].getFileName());\n Errors ee=new Errors();\n ee.setGymid(gymid);\n ee.setError_name(\"line no= \"+e.getStackTrace()[2].getLineNumber()+\"type= \"+e.toString());\n ee.setMethod_name(e.getStackTrace()[2].getMethodName());\n session.save(ee);\n tx.commit();\n session.close();\n }\n return url;\n }", "public String GetDocumentTransactionID (int fileID);", "void onDownloadFileCreated(DownloadFileInfo downloadFileInfo);", "public abstract boolean exportStatistics(String statsFileName) throws SQLException;", "public void writereport() {\n\t\n}", "void fileTransferProgress(IMSession session, String requestId, String fileId, long bytesTransferred, long bytesTotal);", "public void exportMedia(){\r\n \r\n }", "public int getFileId() {\n return fileId;\n }", "public void setFileId (String fileId) {\n this.fileId = fileId;\n logData.setSourceId (fileId);\n }", "int insert(TParklotstatusFile record);", "@Override\n public String toString() {\n return fileEmpty(); //when file is empty\n }", "public String getFileId() {\n return fileId;\n }", "public String getFileId() {\n return fileId;\n }", "public String getFileId() {\n return fileId;\n }", "void downloadEvi(File file, int id) throws IOException, SQLException;", "private void checkFileStatus() throws CustomException, IOException\n\t{\n\t\t//For all .mgf files\n\t\tfor (int i=0; i<mgfFiles.size(); i++)\n\t\t{\n\n\t\t\tString resultFileName = \n\t\t\t\t\tmgfFiles.get(i).substring(0,mgfFiles.get(i).lastIndexOf(\".\"))+\"_Results.csv\";\n\t\t\t//TODO: Cannot write files if checking for file. \n\t\t\t/*\n\t\t\tif (isFileUnlocked(resultFileName))\n\t\t\t\tthrow new CustomException(\"Please close \"+resultFileName, null);\n\t\t\t */\n\t\t}\n\n\t}", "private void writePresentFilesKey() {\n writeSpacesCorrespondingToNestedLevel(COMMIT_METADATA_NEST_LEVEL);\n writer.println(\"present:\");\n }", "private void export(){\n //get available number for file name\n int number = getPosition();\n\n //creates the file\n final File file = new File(Environment.getExternalStorageDirectory().getPath() + \"/csv_\" + number + \".csv\");\n\n //creates a output stream and then streams the file to the external storage\n try {\n file.createNewFile();\n FileOutputStream fOut = new FileOutputStream(file);\n OutputStreamWriter myOutWriter = new OutputStreamWriter(fOut);\n myOutWriter.append(csvFile.toString());\n\n //closes the writer and stream\n\n myOutWriter.close();\n\n fOut.flush();\n fOut.close();\n\n Toast.makeText(this, \"CSV created\", Toast.LENGTH_LONG).show();\n\n Intent intentShareFile = new Intent(Intent.ACTION_SEND);\n\n //opens the chooser pop-up to choose share function\n if(file.exists()) {\n intentShareFile.setType(\"text/*\");\n intentShareFile.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));\n\n intentShareFile.putExtra(Intent.EXTRA_SUBJECT,\"CSV\");\n intentShareFile.putExtra(Intent.EXTRA_TEXT, \"The exported CSV File\");\n\n StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();\n StrictMode.setVmPolicy(builder.build());\n\n startActivity(Intent.createChooser(intentShareFile, \"Share File\"));\n }\n } catch (IOException e) {\n e.printStackTrace();\n Log.d(\"csvError\", e.getMessage());\n }\n }", "private void downloadReport() {\n // Get Employees and Tasks\n ArrayList<Employee> inUnit = Main.getEmployeesInUnit();\n ArrayList<Task> allTasks = Main.getAllTasks();\n\n // Create BufferedWriter Object\n String fileName = fileDate.format(new Date()) + \"_report.csv\";\n BufferedWriter writer = null;\n try {\n writer = new BufferedWriter(new FileWriter(fileName));\n } catch (IOException e) {\n e.printStackTrace();\n System.out.println(\"Filename already exists.\");\n }\n\n try {\n // Write Header\n writer.write(\n \"Task ID,Task Description,Employee ID, Employee Name, WiGrow Needed, Incomplete Scheduling, Exception Report Needed\\n\");\n // Look through employee and their task\n for (int i = 0; i < inUnit.size(); ++i) {\n Employee current = inUnit.get(i);\n for (int j = 0; j < allTasks.size(); ++j) {\n Task currentTask = allTasks.get(j);\n // If found, write to file\n if (currentTask.getEmployees().contains(current)) {\n writer.write(currentTask.getID() + \",\" + currentTask.getDescription() + \",\"\n + current.getId() + \",\" + current.getName() + \",\" + current.isWiGrow() + \",\"\n + current.isScheduling() + \",\" + current.isExceptionReport() + \"\\n\");\n }\n }\n }\n writer.close();\n } catch (IOException e) {\n // Do nothing\n\n }\n // Alert pop up\n Alert downloadSuccess = new Alert(AlertType.NONE, \"Successfully Downloaded Report! It is named \"\n + fileName + \" and is located in your program's local directory.\");\n downloadSuccess.setTitle(\"Download File\");\n downloadSuccess.getButtonTypes().add(ButtonType.OK);\n downloadSuccess.showAndWait();\n }", "public void saveImportLog(JSONObject requestJobj, String msg, int total, int failed, int moduleID) {\n\n try {\n HashMap<String, Object> logDataMap = new HashMap<>();\n logDataMap.put(\"FileName\", ImportLog.getActualFileName(requestJobj.getString(\"filename\")));\n logDataMap.put(\"StorageName\", requestJobj.getString(\"filename\"));\n logDataMap.put(\"Log\", msg);\n logDataMap.put(\"Type\", \"csv\");\n logDataMap.put(\"FailureFileType\", failed > 0 ? \"csv\" : \"\");\n logDataMap.put(\"TotalRecs\", total);\n logDataMap.put(\"Rejected\", failed);\n logDataMap.put(\"Module\", moduleID);\n logDataMap.put(\"ImportDate\", new Date());\n logDataMap.put(\"User\", requestJobj.getString(Constants.useridKey));\n logDataMap.put(\"Company\", requestJobj.getString(Constants.companyKey));\n importDao.saveImportLog(logDataMap);\n } catch (Exception ex) {\n Logger.getLogger(accSalesOrderServiceImpl.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void run()\n\tthrows ScheduledTaskException\n{\n\tLog.customer.debug(\"%s::Start of CATMFGDWInvoicePush_FlatFile task ...\",classname);\n\n\t// Read the USPOFlagAction info from cat.dwAction.util\n\tMFGIRFlagAction = ResourceService.getString(\"cat.dwAction\", \"MFGIRFlagAction\");\n\tLog.customer.debug(\"%s::usPOFlagAction ...\", MFGIRFlagAction, classname);\n if (MFGIRFlagAction!=null && ! MFGIRFlagAction.equals(\"None\") && MFGIRFlagAction.indexOf(\"not found\")==-1)\n\t\tisCompletedFlgUpdate = false;\n\tif ( MFGIRFlagAction!=null && MFGIRFlagAction.equals(\"Completed\")&& MFGIRFlagAction.indexOf(\"not found\")==-1)\n \tisCompletedFlgUpdate = true;\n\n\tstartTime = DateFormatter.getStringValue(new ariba.util.core.Date(), \"EEE MMM d hh:mm:ss a z yyyy\", TimeZone.getTimeZone(\"CST\"));\n\tperiodenddate = DateFormatter.toYearMonthDate(Date.getNow());\n\ttry {\n\t\t File out_FlatFile = new File(flatFilePath);\n\t\t Log.customer.debug(\"%s::FilePath:%s\",classname,out_FlatFile);\n\t\t if (!out_FlatFile.exists()) {\n\t\t \tLog.customer.debug(\"%s::if file does not exit then create 1\",classname);\n\t\t\tout_FlatFile.createNewFile();\n\t\t }\n\t\t Log.customer.debug(\"%s::Creating aprint writer obj:\",classname);\n\t\t PrintWriter outPW_FlatFile = new PrintWriter(IOUtil.bufferedOutputStream(out_FlatFile), true);\n\t\t p = Base.getSession().getPartition();\n\t\t message = new FastStringBuffer();\n\t\t mailSubject = \"CATMFGDWInvoicePush_FlatFile Task Completion Status - Completed Successfully\";\n\t\t try\n\t\t {\n\t\t isHeader = false;\n\t\t // Start : SpringRelease_RSD 129 (FDD_131_4.1,4.2 / TDD_131_1.1,1.2)\n\t\t \t\t\t\t\tquery = \"select from ariba.invoicing.core.InvoiceReconciliation\"\n\t\t \t\t\t\t\t+ \" where (DWInvoiceFlag = 'InProcess' or DWInvoiceFlag = 'Processing') \"\n\t\t \t\t\t\t\t+ \"AND this NOT IN (select this from ariba.invoicing.core.InvoiceReconciliation \"\n\t\t \t\t\t\t\t+ \"where (LineItems.Amount.Amount = 0 OR LineItems.Quantity = 0) \"\n\t\t \t\t\t\t\t+ \"AND LineItems.LineType.Category = 1) \";\n \t\t\t\t\t // End : SpringRelease_RSD 129 (FDD_131_4.1,4.2 / TDD_131_1.1,1.2)\n\t\t Log.customer.debug(query);\n AQLQuery aqlquery = null;\n\t\t AQLOptions options = null;\n\t\t AQLResultCollection results = null;\n\n //String topicname = new String(\"InvoiceReconciliationPush\");\n\t\t //String eventsource = new String(\"ibm_caps_invoicereconpush\");\n\n\t\t aqlquery = AQLQuery.parseQuery(query);\n\t\t options = new AQLOptions(p);\n\t\t results = Base.getService().executeQuery(aqlquery, options);\n\t\t totalNumberOfIrs = results.getSize();\n\t\t if(results.getErrors() != null)\n\t\t \tLog.customer.debug(\"ERROR GETTING RESULTS in Results\");\n while(results.next()){\n\t\t\t\tinvrecon = (InvoiceReconciliation)(results.getBaseId(\"InvoiceReconciliation\").get());\n\t\t\t\tif(invrecon != null){\n\t\t\t\t\ttry{\n \tIrLineItem = (BaseVector)invrecon.getLineItems();\n\t\t\t\t\t\tLog.customer.debug(\"%s::Ir Line Item:%s\",classname,IrLineItem);\n\t\t\t\t\t\t// Shaila : Issue 754 : To ensure no IR with zero line item is processed\n\t\t\t\t\t\tint lineCount = invrecon.getLineItemsCount();\n\t\t\t\t\t\tLog.customer.debug(\"%s::Line Item count for IR:%s \",classname,lineCount);\n\t\t\t\t\t\tLog.customer.debug(\"%s::IR_periodenddate:%s\",classname,periodenddate);\n\t\t\t\t\t\tLog.customer.debug(\"%s::IR_datasetFacilityCode:%s\",classname,datasetFacilityCode);\n\t\t\t\t\t\t//outPW_FlatFile.write(periodenddate);\n\t\t\t\t\t\t//outPW_FlatFile.write(datasetFacilityCode);\n\t\t\t\t\t\tpartitionNumber = invrecon.getPartitionNumber();\n\t\t\t\t\t\t//String partition_name = String(partitionName);\n\t\t\t\t\t\tLog.customer.debug(\"%s::IR_Partition:%s\",classname,partitionNumber);\n\n\t\t\t\t\t\tif (partitionNumber==3){\n\t\t\t\t\t\t\t//Date pSD = (Date)invrecon.getFieldValue(\"BlockStampDate\");\n\t\t\t\t\t\t\t// Issue 215\n\t\t\t\t\t\t\t//Date pSD = (Date)invrecon.getFieldValue(\"ControlDate\");\n\t\t\t\t\t\t\tDate pSD = (Date)invrecon.getFieldValue(\"ApprovedDate\");\n\t\t\t\t\t\t\tperiodStartdate = DateFormatter.toYearMonthDate(pSD);\n\t\t\t\t\t\t\tLog.customer.debug(\"%s::Period Start Date:%s\",pSD,classname);\n\t\t\t\t\t\t\tpartitionName = \"mfg1\";\n\t\t\t\t\t\t\tihBookdate = DateFormatter.toYearMonthDate(pSD);\n\t\t\t\t\t\t\t//outPW_FlatFile.write(periodStartdate+\"~/\");\n\t\t\t\t\t\t \t//outPW_FlatFile.write(\"U9\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (lineCount > 0){\n \tint IrLineItem_vector = IrLineItem.size();\n\t\t\t\t\t\t\tfor (int i =0; i<IrLineItem_vector;i++){\n\t\t\t\t\t\t\t\tLineItem irli = (LineItem)IrLineItem.get(i);\n\t\t\t\t\t\t\t\toutPW_FlatFile.write(partitionName+\"~|\");\n\t\t\t\t\t\t\t\tirFacilityFlag = (String)invrecon.getFieldValue(\"FacilityFlag\");\n\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Ir facility flag:%s\",classname,irFacilityFlag);\n\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(irFacilityFlag)){\n\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irFacilityFlag+\"~|\");\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\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//outPW_FlatFile.write(recordType+\"~|\");\n\t\t\t\t\t\t\t\t//outPW_FlatFile.write(fileLayoutVersion+\"~|\"+\"M\"+\"~|\");\n\n\t\t\t\t\t\t\t\tirUniqueName = (String)invrecon.getFieldValue(\"UniqueName\");\n\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::irUniqueName: %s\",classname,irUniqueName);\n\t\t\t\t\t\t\t\t//Start: Q4 2013 - RSD117 - FDD 2/TDD 2\n\t\t\t\t\t\t\t\t//outPW_FlatFile.write(irUniqueName+\"~|\");\n\n\t\t\t\t\t\t\t\tString SupInvNumber = (String)invrecon.getDottedFieldValue(\"Invoice.InvoiceNumber\");\n\t\t\t\t\t\t\t\tLog.customer.debug(\"CATMFGDWInvoicePush_FlatFile: SupInvNumber: \"+ SupInvNumber);\n\t\t\t\t\t\t\t\tint invleng = SupInvNumber.length();\n\t\t\t\t\t\t\t\tif (invleng > 35)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tString SupInvNumber1 = getFormatattedTxt(SupInvNumber);\n\t\t\t\t\t\t\t\t\tint invleng1 = SupInvNumber1.length();\n\t\t\t\t\t\t\t\t\tLog.customer.debug(\"CATMFGDWInvoicePush_FlatFile: invleng1: \"+ invleng1);\n\t\t\t\t\t\t\t\t\tString FormattedirUniqueName = getFormatattedTxt(irUniqueName, invleng1);\n\t\t\t\t\t\t\t\t\tLog.customer.debug(\"CATMFGDWInvoicePush_FlatFile: FormattedirUniqueName: \"+ FormattedirUniqueName);\n\n\t\t\t\t\t\t\t\t\t// Writing IH-Invoice-No - 4\n\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(FormattedirUniqueName+\"~|\");\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\tString FormattedirUniqueName = getFormatattedTxt(irUniqueName, invleng);\n\t\t\t\t\t\t\t\t\tLog.customer.debug(\"CATMFGDWInvoicePush_FlatFile: FormattedirUniqueName: \"+ FormattedirUniqueName);\n\n\t\t\t\t\t\t\t\t\t// Writing IH-Invoice-No - 4\n\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(FormattedirUniqueName+\"~|\");\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//End: Q4 2013 - RSD117 - FDD 2/TDD 2\n\n\t\t\t\t\t\t\t\t// Start : SpringRelease_RSD 129 (FDD_129_4.1 / TDD_129_1.1)\n\t\t\t\t\t\t\t\tif(invrecon.getFieldValue(\"Supplier\") != null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tirSupplierLocation = (String)invrecon.getDottedFieldValue(\"Supplier.UniqueName\");\n\t\t\t\t\t\t\t\t\t// End : SpringRelease_RSD 129 (FDD_129_4.1 / TDD_129_1.1)\n\t\t\t\t\t\t\t\t\tif (irSupplierLocation != null){\n\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::irSupplierLocation:%s\",classname,irSupplierLocation);\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irSupplierLocation+\"~|\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\tDate Ir_invDate = (Date)invrecon.getFieldValue(\"InvoiceDate\");\n\t\t\t\t\t\t\t\tif (Ir_invDate!=null){\n\t\t\t\t\t\t\t\t\tIrinvdateyymmdd = DateFormatter.toYearMonthDate(Ir_invDate);\n\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Invoice Date:%s\",classname,Irinvdateyymmdd);\n\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(Irinvdateyymmdd+\"~|\");\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\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Log.customer.debug(\"%s::ihRecordStatus:%s\",classname,ihRecordStatus);\n\t\t\t\t\t\t\t\t//outPW_FlatFile.write(ihRecordStatus+\"~|\");\n\n\t\t\t\t\t\t\t\tMoney IrTotalcost = (Money)invrecon.getFieldValue(\"TotalCost\");\n\t\t\t\t\t\t\t\tif (IrTotalcost!=null){\n\t\t\t\t\t\t\t\t\tIrtotalcostamount = (BigDecimal)invrecon.getDottedFieldValue(\"TotalCost.Amount\");\n\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Total cost amount:%s\",classname,Irtotalcostamount);\n\t\t\t\t\t\t\t\t\tif (Irtotalcostamount!=null) {\n\t\t\t\t\t\t\t\t\t\tint Ir_tca = Irtotalcostamount.intValue();\n\t\t\t\t\t\t\t\t\t\tif (Ir_tca >= 0) {\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"01\"+\"~|\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (Ir_tca < 0){\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"02\"+\"~|\");\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\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(ihBookdate+\"~|\");\n\t\t\t\t\t\t\t\t\t\tirTotalCostCurrency = IrTotalcost.getCurrency().getUniqueName();\n\t\t\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(irTotalCostCurrency)){\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::TotalCost Currency:%s\",classname,irTotalCostCurrency);\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irTotalCostCurrency+\"~|\");\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\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tirstngTotalCost = BigDecimalFormatter.getStringValue(Irtotalcostamount);\n\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Writing IR total cost:%s\",classname,irstngTotalCost);\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irstngTotalCost+\"~|\");\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t else {\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(ihBookdate+\"~|\");\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\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\telse {\n\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(ihBookdate+\"~|\");\n\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t}\n irTotalInvoiceDiscountDollarAmount = (BigDecimal)invrecon.getDottedFieldValue(\"TotalInvoiceDiscountDollarAmount.Amount\");\n\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::TotalInvoiceDiscountDollarAmount:%s\",classname,irTotalInvoiceDiscountDollarAmount);\n\t\t\t\t\t\t\t\t/* if (irTotalInvoiceDiscountDollarAmount==Constants.ZeroBigDecimal) {\n\t\t\t\t\t\t\t\t\t//Log.customer.debug(\"%s::TotalInvoiceDiscountDollarAmount is:%s\",classname,TotalInvoiceDiscountDollarAmount_2);\n\t\t\t\t\t\t\t\t\t outPW_FlatFile.write(\"0000000000000.00\"+\"\\n\");\n\t\t\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t\t\tif (irTotalInvoiceDiscountDollarAmount!=null) {\n\t\t\t\t\t\t\t\t\t\tint ir_TIDDA = irTotalInvoiceDiscountDollarAmount.intValue();\n\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::TotalInvoiceDiscountDollarAmount integer value:%s\",classname,ir_TIDDA);\n\t\t\t\t\t\t\t\t\t\tif (ir_TIDDA==0){\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"0000000000000.00\"+\"~|\");\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\tstrgDiscountAmount = BigDecimalFormatter.getStringValue(irTotalInvoiceDiscountDollarAmount);\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Writting the discount amount:%s\",classname,strgDiscountAmount);\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(strgDiscountAmount+\"~|\");\n\t\t\t\t\t\t\t\t\t\t}\n }\n else {\n\t\t\t\t\t\t\t\t\t \tLog.customer.debug(\"%s::No value for irTotalInvoiceDiscountDollarAmount so leaving it blanck\");\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t IrLineItem2 = (InvoiceReconciliationLineItem)IrLineItem.get(i);\n\t\t\t\t\t\t\t\t\t IrnumberInCollection = IrLineItem2.getNumberInCollection();\n\t\t\t\t\t\t\t\t\t numberInCollection = IntegerFormatter.getStringValue(IrnumberInCollection);\n\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::IR number in collection:%s\",classname,numberInCollection);\n\t\t\t\t\t\t\t\t\t outPW_FlatFile.write(numberInCollection+\"~|\");\n\n\t\t\t\t\t\t\t\t\t IrLineDescritpiton = IrLineItem2.getDescription();\n\t\t\t\t\t\t\t\t\t if (IrLineDescritpiton!=null){\n\t\t\t\t\t\t\t\t\t \tLog.customer.debug(\"%s::IR_LineDescription:%s\",classname,IrLineDescritpiton);\n\t\t\t\t\t\t\t\t\t\tirDescItemNumber = IrLineDescritpiton.getItemNumber(); //what if this is blanck, right now considering blanck also as null\n\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Writing IR_LineDescription Item Number:%s\",classname,irDescItemNumber);\n\t\t\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(irDescItemNumber)){\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irDescItemNumber+\"~|\");\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"K\"+\"~|\");\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\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"0\"+\"~|\");\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t//Writing item desc-15\n\t\t\t\t\t\t\t\t\t\t// Start : SpringRelease_RSD 129 (FDD_129_4.2 / TDD_129_1.2)\n\t\t\t\t\t\t\t\t\t\tString descDescription = \"\";\n\t\t\t\t\t\t\t\t\t\tString commonCCId = \"\";\n\t\t\t\t\t\t\t\t\t\tdescDescription_temp = (String)IrLineDescritpiton.getFieldValue(\"Description\");\n\t\t\t\t\t\t\t\t\t\tcommonCC = IrLineDescritpiton.getCommonCommodityCode();\n\t\t\t\t\t\t\t\t\t\tif (commonCC!=null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcommonCCId = (String)commonCC.getName().getPrimaryString();\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::IR Description CommodityCode UniqueName:%s\",classname,commonCCId);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::CommonCommdityCode:%s\",classname,commonCCId);\n\n\n\t\t\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(descDescription_temp))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::itemDescription array is:%s\",classname,descDescription_temp);\n\n\t\t\t\t\t\t\t\t\t\t char[] c_array;\n\t\t\t\t\t\t\t\t\t\t String c_string;\n\t\t\t\t\t\t\t\t\t\t byte[] c_byte_array;\n\t\t\t\t\t\t\t\t\t\t c_array = descDescription_temp.toCharArray();\n\n\t\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::itemDescription:%s\",classname,c_array);\n\t\t\t\t\t\t\t\t\t\t for (char c : c_array)\n\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t c_string = Character.toString(c);\n\n\t\t\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::itemDescription:%s\",classname,c_string);\n\n\t\t\t\t\t\t\t\t\t\t\t System.out.print(c_string);\n\t\t\t\t\t\t\t\t\t\t\t c_byte_array = c_string.getBytes();\n\n\t\t\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::itemDescription byte array:%s\",classname,c_byte_array);\n\t\t\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::itemDescription byte array length:%s\",classname,c_byte_array.length);\n\n\t\t\t\t\t\t\t\t\t\t\t if (c_byte_array.length > 1)\n\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::itemDescription byte array length > 1\",classname);\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::itemDescription:%s\",classname,c_byte_array);\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::itemDescription:%s\",classname,c_string);\n\t\t\t\t\t\t\t\t\t\t\t\t\tdescDescription_temp = commonCCId;\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Setting Description as Common commodity code:%s\",classname,descDescription_temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\n\t\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\t\t// End : SpringRelease_RSD 129 (FDD_129_4.2 / TDD_129_1.2)\n\n\t\t\t\t\t\t\t\t\t\t\t// Filtering Non-ASCII characters\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Description after checking bytes is:%s\",classname,descDescription_temp);\n\n\n\t\t\t\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(descDescription_temp))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tdescDescription = descDescription_temp.replaceAll(\"[^\\\\p{ASCII}]\", \"\");\n\t\t\t\t\t\t\t\t\t\t\t\tdescDescription = StringUtil.replaceCharByChar(descDescription,'\\r',' ');\n\t\t\t\t\t\t\t\t\t\t\t\tdescDescription = StringUtil.replaceCharByChar(descDescription,'\\t',' ');\n\t\t\t\t\t\t\t\t\t\t\t\tdescDescription = StringUtil.replaceCharByChar(descDescription,'\\n',' ');\n\t\t\t\t\t\t\t\t\t\t\t\tdescDescription = StringUtil.replaceCharByChar(descDescription,'\\'',' ');\n\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Description:%s\",classname,descDescription);\n\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(descDescription+\"~|\");\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{\n\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\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{\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tirCommodityCode = IrLineDescritpiton.getCommonCommodityCode();\n\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::IR Description CommodityCode:%s\",classname,irCommodityCode);\n\t\t\t\t\t\t\t\t\t\tif (irCommodityCode!=null){\n\t\t\t\t\t\t\t\t\t\t\tccUniqueName = irCommodityCode.getUniqueName();\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::IR Description CommodityCode UniqueName:%s\",classname,ccUniqueName);\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(ccUniqueName+\"~|\");\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\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdescSupplierPartNumber = IrLineDescritpiton.getSupplierPartNumber();\n\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Description_SupplierPartNumber:%s\",classname,descSupplierPartNumber);\n\t\t\t\t\t\t\t\t\t\tif(!StringUtil.nullOrEmptyOrBlankString(descSupplierPartNumber)){\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Writing Description_SupplierPartNumber:%s\",classname,descSupplierPartNumber);\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(descSupplierPartNumber+\"~|\");\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\toutPW_FlatFile.write(\"~|\");\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\telse {\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tIrLineType = IrLineItem2.getLineType();\n\t\t\t\t\t\t\t\t\tif(IrLineType!=null){\n\t\t\t\t\t\t\t\t\t\tint category = IrLineType.getCategory();\n\t\t\t\t\t\t\t\t\t\tif (category==1){\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"01\"+\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\telse if (category==2){\n\t\t\t\t\t\t\t\t\t\t\tString irLineTypeString = (String)IrLineType.getFieldValue(\"UniqueName\");\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s:: LineType of Ir Line::%s\",classname,irLineTypeString);\n\t\t\t\t\t\t\t\t\t\t\tif(irLineTypeString.equals(\"VATCharge\")){\n\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"96\"+\"~|\");\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\toutPW_FlatFile.write(\"02\"+\"~|\");\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 if (category==4){\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"05\"+\"~|\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (category==8) {\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"27\"+\"~|\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (category==16){\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"13\"+\"~|\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (category==32) {\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"12\"+\"~|\");\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\telse {\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\tBoolean isHaz = (Boolean)IrLineItem2.getFieldValue(\"IsHazmat\");\n\t\t\t\t\t\t\t\t\t// irHazmat = BooleanFormatter.getStringValue(IrLineItem2.getFieldValue(\"IsHazmat\"));\n\t\t\t\t\t\t\t\t\tif(isHaz != null)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t boolean irHazmatBoolean = isHaz.booleanValue();\n\t\t\t\t\t\t\t\t\t// Log.customer.debug(\"Ir Hazmat value:\",irHazmatBoolean);\n\t\t\t\t\t\t\t\t\t if(irHazmatBoolean)\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"3\"+\"~|\");\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\toutPW_FlatFile.write(\"0\"+\"~|\");\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 else {\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"0~|\");\n\t\t\t\t\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\tirHazmat = BooleanFormatter.getStringValue(IrLineItem2.getFieldValue(\"IsHazmat\"));\n\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Ir Hazmat value:%s\",classname,irHazmat);\n\t\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(irHazmat)){\n\t\t\t\t\t\t\t\t\t\tif (irHazmat==\"true\"){\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"3\"+\"~|\");\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\toutPW_FlatFile.write(\"0\"+\"~|\");\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\telse {\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"0~|\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t*/\n\n\n\t\t\t\t\t\t\t\t\t// Start : SpringRelease_RSD 129/131 (FDD_129_4.4 / TDD_129_1.4 / FDD_131_4.4/TDD_131_1.5)\n\t\t\t\t\t\t\t\t\t //BigDecimal irliAmount = IrLineItem2.getAmount().getAmount();\n\t\t\t\t\t\t\t\t\t BigDecimal IrLineQuantity1 = IrLineItem2.getQuantity();\n\t\t\t\t\t\t\t\t\t Log.customer.debug(\"::IR LineQuantity:\" +IrLineQuantity1);\n\t\t\t\t\t\t\t\t\t String irliQuantity = \"\";\n\n\t\t\t\t\t\t\t\t\t // Writing IL-Bill-Qty-20\n\t\t\t\t\t\t\t\t\t if (IrLineQuantity1 != null)\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\tif(IrLineType!=null && IrLineType.getCategory()== 2)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"Its Tax line item passing Quantity as 1: \"+taxLineQuantity);\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(taxLineQuantity+\"~|\");\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (IrLineItem2.getAmount().isNegative())\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif(IrLineQuantity1.intValue() < 0)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"IR LineAmount is negative and quantity is also negative no change required:\" +IrLineQuantity1);\n\t\t\t\t\t\t\t\t\t\t\t\tirliQuantity = BigDecimalFormatter.getStringValue(IrLineQuantity1);\n\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::IR LineQuantity:%s\",classname,irliQuantity);\n\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irliQuantity+\"~|\");\n\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{\n\t\t\t\t\t\t\t\t\t\t\t\tIrLineQuantity1 = IrLineQuantity1.multiply(new BigDecimal(-1));\n\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"IR LineAmount is negative hence setting LI Quantity as negative:\" +IrLineQuantity1);\n\t\t\t\t\t\t\t\t\t\t\t\tirliQuantity = BigDecimalFormatter.getStringValue(IrLineQuantity1);\n\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::IR LineQuantity:%s\",classname,irliQuantity);\n\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irliQuantity+\"~|\");\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{\n\t\t\t\t\t\t\t\t\t\t\tirliQuantity = BigDecimalFormatter.getStringValue(IrLineQuantity1);\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::IR LineQuantity:%s\",classname,irliQuantity);\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irliQuantity+\"~|\");\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 else\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\t //End : SpringRelease_RSD 129/131 (FDD_129_4.4 / TDD_129_1.4 / FDD_131_4.4/TDD_131_1.5)\n\n\n\n\t\t\t\t\t\t\t\t\t//IrUOM = (UnitOfMeasure)IrLineDescritpiton.getUnitOfMeasure();\n\n\t\t\t\t\t\t\t\t\t// Start : SpringRelease_RSD 131 (FDD_131_4.4 / TDD_131_1.5)\n\n\t\t\t\t\t\t\t\t\t // Writing IL-Bill-Qty-Unit-Of-Measure-21\n\t\t\t\t\t\t\t\t\t //IrUOM = (UnitOfMeasure)IrLineDescritpiton.getUnitOfMeasure();\n\t\t\t\t\t\t\t\t\t String irUOM_UniqueName1 = \"\";\n\n\t\t\t\t\t\t\t\t \tif(IrLineType!=null && IrLineType.getCategory()== 2)\n\t\t\t\t\t\t\t\t \t{\n\t\t\t\t\t\t\t\t\t\t Log.customer.debug(\"Its Tax line item passing UOM as LOT: \");\n\t\t\t\t\t\t\t\t\t\t outPW_FlatFile.write(irUOM_UniqueName+\"~|\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if ( IrLineItem2.getDottedFieldValue(\"Description.UnitOfMeasure\") != null)\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t// End : SpringRelease_RSD 131 (FDD_131_4.4 / TDD_131_1.5)\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"Not tax line item\");\n\t\t\t\t\t\t\t\t\t\t\tString uOMUniqueName = (String)IrLineItem2.getDottedFieldValue(\"Description.UnitOfMeasure.UniqueName\");\n\t\t\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::uOMUniqueName 1 %s\",classname,uOMUniqueName);\n\t\t\t\t\t\t\t\t\t\t\t Object irUOM_object = \tIrLineItem2.getDottedFieldValue(\"Description.UnitOfMeasure.CAPSUnitOfMeasure\");\n\t\t\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::irUOM_object 2 %s\",classname,irUOM_object);\n\t\t\t\t\t\t\t\t\t\t\t if(irUOM_object != null)\n\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\tirUOM_UniqueName1 = irUOM_object.toString();\n\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::IR Desc UOM 3:%s\",classname,irUOM_UniqueName1);\n\t\t\t\t\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(irUOM_UniqueName1))\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\t\toutPW_FlatFile.write(irUOM_UniqueName1+\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::irUOM_UniqueName writen ti file 4 %s\",classname,irUOM_UniqueName1);\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\telse\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\t\t\t IF CAPSUnitOfMeasure = Enpty THEN LineItems.Description.UnitOfMeasure.UniqueName\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(uOMUniqueName))\n\t\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(uOMUniqueName+\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::CAPSUnitOfMeasure = Enpty 5 %s\",classname,uOMUniqueName);\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\telse\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t// IF CAPSUnitOfMeasure = NULL THEN LineItems.Description.UnitOfMeasure.UniqueName\n\t\t\t\t\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(uOMUniqueName))\n\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(uOMUniqueName+\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::CAPSUnitOfMeasure = Enpty 6 %s\",classname,uOMUniqueName);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\tif (IrTotalcost!=null){\n\t\t\t\t\t\t\t\t\t\tirTotalCostCurrency = IrTotalcost.getCurrency().getUniqueName();\n\t\t\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(irTotalCostCurrency)){\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::TotalCost Currency:%s\",classname,irTotalCostCurrency);\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irTotalCostCurrency+\"~|\");\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\toutPW_FlatFile.write(\"~|\");\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 else {\n\t\t\t\t\t\t\t\t\t \toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\n\n\t\t\t\t\t\t\t\t\t// Start : SpringRelease_RSD 129 (FDD_129_4.4 / TDD_129_1.4)\n\t\t\t\t\t\t\t\t\tirdecsPrice = BigDecimalFormatter.getStringValue(IrLineDescritpiton.getPrice().getAmount().abs());\n\t\t\t\t\t\t\t\t\t // End : SpringRelease_RSD 129 (FDD_129_4.4 / TDD_129_1.4)\n\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::Ir desc Price:%s\",classname,irdecsPrice);\n\t\t\t\t\t\t\t\t\t if (!StringUtil.nullOrEmptyOrBlankString(irdecsPrice)){\n\t\t\t\t\t\t\t\t\t \toutPW_FlatFile.write(irdecsPrice+\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t else {\n\t\t\t\t\t\t\t\t\t \toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\n\n\t\t\t\t\t\t\t\t\t // Start : SpringRelease_RSD 131 (FDD_131_4.4 / TDD_131_1.5)\n\t\t\t\t\t\t\t\t\tString irUOM_UniqueName2 = \"\";\n\n\t\t\t\t\t\t\t\t if ( IrLineItem2.getDottedFieldValue(\"Description.UnitOfMeasure\") != null)\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t if(IrLineType!=null && IrLineType.getCategory()== 2)\n\t\t\t\t\t\t\t\t\t {\n\n\t\t\t\t\t\t\t\t\t\t\t Log.customer.debug(\"Its Tax line item passing UOM as LOT: \");\n\t\t\t\t\t\t\t\t\t\t\t outPW_FlatFile.write(irUOM_UniqueName+\"~|\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// End : SpringRelease_RSD 131 (FDD_131_4.4 / TDD_131_1.5)\n\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"Not tax line item\");\n\t\t\t\t\t\t\t\t\t\tString uOMUniqueName = (String)IrLineItem2.getDottedFieldValue(\"Description.UnitOfMeasure.UniqueName\");\n\t\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::uOMUniqueName 1 %s\",classname,uOMUniqueName);\n\t\t\t\t\t\t\t\t\t\t Object irUOM_object = \tIrLineItem2.getDottedFieldValue(\"Description.UnitOfMeasure.CAPSUnitOfMeasure\");\n\t\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::irUOM_object 2 %s\",classname,irUOM_object);\n\t\t\t\t\t\t\t\t\t\t if(irUOM_object != null)\n\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\tirUOM_UniqueName2 = irUOM_object.toString();\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::IR Desc UOM 3:%s\",classname,irUOM_UniqueName2);\n\t\t\t\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(irUOM_UniqueName2))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irUOM_UniqueName2+\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::irUOM_UniqueName writen ti file 4 %s\",classname,irUOM_UniqueName2);\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{\n//\t\t\t\t\t\t\t\t\t\t\t\t\t IF CAPSUnitOfMeasure = Enpty THEN LineItems.Description.UnitOfMeasure.UniqueName\n\t\t\t\t\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(uOMUniqueName))\n\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(uOMUniqueName+\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::CAPSUnitOfMeasure = Enpty 5 %s\",classname,uOMUniqueName);\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{\n\t\t\t\t\t\t\t\t\t\t\t// IF CAPSUnitOfMeasure = NULL THEN LineItems.Description.UnitOfMeasure.UniqueName\n\t\t\t\t\t\t\t\t\t\t\tif (!StringUtil.nullOrEmptyOrBlankString(uOMUniqueName))\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(uOMUniqueName+\"~|\");\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::CAPSUnitOfMeasure = Enpty 6 %s\",classname,uOMUniqueName);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t else {\n\t\t\t\t\t\t\t\t\t \toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\t outPW_FlatFile.write(\"1.0\"+\"~|\");\n\t\t\t\t\t\t\t\t\t irLineAmount = BigDecimalFormatter.getStringValue(IrLineItem2.getAmount().getAmount());\n\t\t\t\t\t\t\t\t\t if (!StringUtil.nullOrEmptyOrBlankString(irLineAmount)) {\n\t\t\t\t\t\t\t\t\t \tLog.customer.debug(\"%s::Ir Line Amount:%s\",classname,irLineAmount);\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irLineAmount+\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t else {\n\t\t\t\t\t\t\t\t\t \toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t outPW_FlatFile.write(\"00000.0000\"+\"~|\");\n\t\t\t\t\t\t\t\t\t irLineCapsCharge = (ClusterRoot)IrLineItem2.getFieldValue(\"CapsChargeCode\");\n\t\t\t\t\t\t\t\t\t if (irLineCapsCharge!=null){\n\t\t\t\t\t\t\t\t\t \tLog.customer.debug(\"%s::Ir Line caps charge code:%s\",classname,irLineCapsCharge);\n\t\t\t\t\t\t\t\t\t\tirCapsUniqueName = (String)irLineCapsCharge.getFieldValue(\"UniqueName\");\n\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Ir Line caps charge code UniqueName:%s\",classname,irCapsUniqueName);\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irCapsUniqueName+\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t else {\n\t\t\t\t\t\t\t\t\t \toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t irLinePoNumber = (String)invrecon.getFieldValue(\"PONumber\");\n\t\t\t\t\t\t\t\t\t if (!StringUtil.nullOrEmptyOrBlankString(irLinePoNumber)){\n\t\t\t\t\t\t\t\t\t \tLog.customer.debug(\"%s::IR Line PO Number:%s\",classname,irLinePoNumber);\n\t\t\t\t\t\t\t\t\t \toutPW_FlatFile.write(irLinePoNumber+\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t else {\n\t\t\t\t\t\t\t\t\t \toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t irLinePoLineNumber = IntegerFormatter.getIntValue(IrLineItem2.getFieldValue(\"POLineItemNumber\"));\n\t\t\t\t\t\t\t\t\t irLinePoLinenoString = IntegerFormatter.getStringValue(irLinePoLineNumber);\n\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::Line po Line number:%s\",classname,irLinePoLineNumber);\n\t\t\t\t\t\t\t\t\t if (!StringUtil.nullOrEmptyOrBlankString(irLinePoLinenoString) && !irLinePoLinenoString.equals(\"0\")){\n\n\t\t\t\t\t\t\t\t\t \t\tLog.customer.debug(\"%s::Ir Line Po Line Number:%s\",classname,irLinePoLinenoString);\n\t\t\t\t\t\t\t\t\t \t\t//String irLinePoLinenoString = IntegerFormatter.getStringValue(irLinePoLineNumber);\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irLinePoLinenoString+\"~|\");\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\t// IF IR.LineItems. POLineItemNumber is NULL THEN SEND VALUE OF 1\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"1\"+\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t if (irLinePoNumber!=null){\n\t\t\t\t\t\t\t\t\t \tif (StringUtil.startsWithIgnoreCase(irLinePoNumber , \"C\")){\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"C\"+\"~|\");\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\toutPW_FlatFile.write(\"P\"+\"~|\");\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 else {\n\t\t\t\t\t\t\t\t\t \toutPW_FlatFile.write(\"N\"+\"~|\");\n\t\t\t\t\t\t\t\t\t }\n\n\n\t\t\t\t\t\t\t\t\t int partitionNumber_2 = invrecon.getPartitionNumber();\n\t\t\t\t\t\t\t\t\t Log.customer.debug(\"%s::partiton number 2nd place:%s\",classname,partitionNumber_2);\n\t\t\t\t\t\t\t\t\t if (partitionNumber_2==2){\n\t\t\t\t\t\t\t\t\t \tirAccounting = IrLineItem2.getAccountings();\n\t\t\t\t\t\t\t\t\t\tif (irAccounting!=null){\n\t\t\t\t\t\t\t\t\t\t\tirSplitAccounting = (BaseVector)irAccounting.getSplitAccountings();\n\t\t\t\t\t\t\t\t\t\t\tirSplitaccSize = irSplitAccounting.size();\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Split acc size:%s\",classname,irSplitaccSize);\n\t\t\t\t\t\t\t\t\t\t\tif (irSplitaccSize > 0){\n\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug (\"%s::getting accounting facility\",classname);\n\t\t\t\t\t\t\t\t\t\t\t\tString ir_AccFac= null;\n\t\t\t\t\t\t\t\t\t\t\t\tString ir_Order_name = null;\n\t\t\t\t\t\t\t\t\t\t\t\tfor (int j = 0; j<irSplitaccSize;j++){\n\t\t\t\t\t\t\t\t\t\t\t\t\tirSplitAccounting2 = (SplitAccounting)irSplitAccounting.get(0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t//String irAccountingFacility = (String)irSplitAccounting2.getFieldValue(\"AccountingFacility\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tString irAccountingFacility = (String)irSplitAccounting2.getFieldValue(\"Facility.UniqueName\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Accounting facility:%s\",classname,irAccountingFacility);\n\t\t\t\t\t\t\t\t\t\t\t\t\tString ir_Order = (String)irSplitAccounting2.getFieldValue(\"Order\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(!StringUtil.nullOrEmptyOrBlankString(irAccountingFacility)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Accounting facility:%s\",classname,irAccountingFacility);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tir_AccFac = irAccountingFacility+\"~|\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(irAccountingFacility+\"~|\");\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\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tir_AccFac = (\"AA\"+\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// outPW_FlatFile.write(\"~|\"+\"\\n\");\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\tif (!StringUtil.nullOrEmptyOrBlankString(ir_Order)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Accounting Order:%s\",classname,ir_Order);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tir_Order_name = ir_Order;\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\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tir_Order_name =(\"~|\");\n }\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\toutPW_FlatFile.write(ir_AccFac);\n\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(ir_Order_name);\n }\n\t\t\t\t\t\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t\t\t\t \toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(\"~|\"+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t\t \toutPW_FlatFile.write(\"~|\");\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\t else {\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\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 else {\n\t\t\t\t\t\t\t\t\t \tirAccounting = IrLineItem2.getAccountings();\n\t\t\t\t\t\t\t\t\t\tif (irAccounting!=null){\n\t\t\t\t\t\t\t\t\t\t\tirSplitAccounting = (BaseVector)irAccounting.getSplitAccountings();\n\t\t\t\t\t\t\t\t\t\t\tirSplitaccSize = irSplitAccounting.size();\n\t\t\t\t\t\t\t\t\t\t\tif (irSplitaccSize > 0){\n\n\t\t\t\t\t\t\t\t\t\t\t\tfor (int k = 0; k<irSplitaccSize;k++){\n\t\t\t\t\t\t\t\t\t\t\t\t\tirSplitAccounting2 = (SplitAccounting)irSplitAccounting.get(0);\n\t\t\t\t\t\t\t\t\t\t\t\t\tirFacility = (ClusterRoot)irSplitAccounting2.getFieldValue(\"Facility\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (irFacility!=null){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tIrFacilityUniqueName = (String)irFacility.getFieldValue(\"UniqueName\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!StringUtil.nullOrEmptyOrBlankString(IrFacilityUniqueName)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s:: IR Facility:%s\",classname,IrFacilityUniqueName);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tirFac = IrFacilityUniqueName+\"~|\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tirFac2 = IrFacilityUniqueName+\"~|\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(IrFacilityUniqueName+\"\\n\");\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\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tirFac = (\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tirFac2 = (\"AA\"+\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(\"~|\"+\"\\n\");\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\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tirFac = (\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tirFac2 = (\"AA\"+\"~|\");\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\tirCostCenter = (ClusterRoot)irSplitAccounting2.getFieldValue(\"CostCenter\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (irCostCenter!=null){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tirCC = (String)irCostCenter.getFieldValue(\"CostCenterCode\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!StringUtil.nullOrEmptyOrBlankString(irCC)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s:: IR Cost Center:%s\",classname,irCC);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tirCCString = irCC+\"~|\";\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\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tirCCString = (\"~|\");\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\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tirCCString = (\"~|\");\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\tirSubAcc = (ClusterRoot)irSplitAccounting2.getFieldValue(\"SubAccount\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (irSubAcc!=null){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tirSubAccStrng = (String)irSubAcc.getFieldValue(\"UniqueName\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!StringUtil.nullOrEmptyOrBlankString(irSubAccStrng)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s:: IR Sub Account:%s\",classname,irSubAccStrng);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tirStrngsubacc = irSubAccStrng+\"~|\";\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\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tirStrngsubacc = (\"~|\");\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\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tirStrngsubacc = (\"~|\");\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\tirAccount = (ClusterRoot)irSplitAccounting2.getFieldValue(\"Account\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(irAccount!=null){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tirAccCode = (String)irAccount.getFieldValue(\"AccountCode\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!StringUtil.nullOrEmptyOrBlankString(irAccCode)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s:: IR Account code:%s\",classname,irAccCode);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tirAccCodeStrng = irAccCode+\"~|\";\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\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tirAccCodeStrng = (\"~|\");\n\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 else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t \tirAccCodeStrng = (\"~|\");\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\toutPW_FlatFile.write(irFac);\n\t\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irFac2);\n\t\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irFac);\n\t\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irCCString);\n\t\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irStrngsubacc);\n\t\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irAccCodeStrng);\n\t\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irFac);\n }\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\tirBuyerCode = (ClusterRoot)IrLineItem2.getFieldValue(\"BuyerCode\");\n\t\t\t\t\t\t\t\t\t\t\tif (irBuyerCode!=null){\n\t\t\t\t\t\t\t\t\t\t\t\tirBuyercc = (String)irBuyerCode.getFieldValue(\"BuyerCode\");\n\t\t\t\t\t\t\t\t\t\t\t\tif(!StringUtil.nullOrEmptyOrBlankString(irBuyercc)){\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s:: IR Buyer Code:%s\",classname,irBuyercc);\n\t\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irBuyercc);\n\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(\"\\n\");\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\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(\"\\n\");\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\telse {\n\t\t\t\t\t\t\t\t\t\t\t\tirLineOrder = (DirectOrder)IrLineItem2.getOrder();\n\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::IR line Purchase Order:%s\",classname,irLineOrder);\n\t\t\t\t\t\t\t\t\t\t\t\tif (irLineOrder!=null){\n\t\t\t\t\t\t\t\t\t\t\t\t\tirOrderLineItem = (ariba.purchasing.core.POLineItem)IrLineItem2.getOrderLineItem();\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Order Line Item:%s\",classname,irOrderLineItem);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (irOrderLineItem!=null){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tirPOLineBuyerCode = (ClusterRoot)irOrderLineItem.getFieldValue(\"BuyerCode\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (irPOLineBuyerCode!= null){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tirPOlinebuyercc = (String)irPOLineBuyerCode.getFieldValue(\"BuyerCode\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::Ir PO Line Buyer Code\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(irPOlinebuyercc +\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(\"\\n\");\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\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(\"\\n\");\n\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 }\n\t\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(\"\\n\");\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 }\n\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t//outPW_FlatFile.write(\"\\n\");\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//IsAdHoc - catalog or non catalog, Issue #269 - Dharshan\n\t\t\t\t\t\t\t\t\t\tisAdHocBoolean = true;\n\t\t\t\t\t\t\t\t\t\tisAdHoc = null;\n\t\t\t\t\t\t\t\t\t\tif (irli.getDottedFieldValue(\"IsAdHoc\") != null) {\n\t\t\t\t\t\t\t\t\t\t\tisAdHoc = (Boolean) irli.getDottedFieldValue(\"IsAdHoc\");\n\t\t\t\t\t\t\t\t\t\t\tisAdHocBoolean = BooleanFormatter.getBooleanValue(isAdHoc);\n\t\t\t\t\t\t\t\t\t\t\tLog.customer.debug(\"%s::isAdHocBoolean:%s\",classname,isAdHocBoolean);\n\t\t\t\t\t\t\t\t\t\t\tif(isAdHocBoolean == false){\n\t\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|Catalog Item:\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse {Log.customer.debug(\"%s::isAdHocBoolean is true, not catalog item\",classname);\n\t\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\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 {Log.customer.debug(\"%s::isAdHocBoolean is null, leave blank\",classname);\n\t\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"~|\");\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\toutPW_FlatFile.write(\"\\n\");\n\n\n\n\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t totalNumberOfIrWritten++;\n\t\t\t\t\t\t\t\t\t if(isCompletedFlgUpdate) {\n\t\t\t\t\t\t\t\t\t \tLog.customer.debug(\"%s::MFGIRFlagAction is Completed setting DWInvoiceFlag ...\", classname);\n\t\t\t\t\t\t\t\t\t \tinvrecon.setFieldValue(\"DWInvoiceFlag\", \"Completed\");\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t else {\n\t\t\t\t\t\t\t\t\t \tLog.customer.debug(\"%s::MFGIRFlagAction is None no action req DWInvoiceFlag ...\", classname);\n\t\t\t\t\t\t\t\t\t \tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t catch(Exception e){\n\t\t\t\t\t\t\t \tLog.customer.debug(e.toString());\n\t\t\t\t\t\t\t \tnew ScheduledTaskException(\"Error : \" + e.toString(), e);\n throw new ScheduledTaskException(\"Error : \" + e.toString(), e);\n\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t //Base.getSession().transactionCommit();\n\t\t\t\t\t\t\t Log.customer.debug(\"Ending DWInvoicePush program .....\");\n\t\t\t\t\t\t\t //invrecon.setFieldValue(\"DWInvoiceFlag\", \"Completed\");\n\t\t\t\t\t\t\t //Update DWPOFlag in DO based on config\n\n\t\t\t\t\t }\n\t\t\t\t }\n }\n\t\t\tcatch(Exception e){\n\t\t\t\tLog.customer.debug(e.toString());\n\t\t\t\tnew ScheduledTaskException(\"Error : \" + e.toString(), e);\n throw new ScheduledTaskException(\"Error : \" + e.toString(), e);\n\n\t\t\t}\n\t\t\tif (outPW_FlatFile!=null){\n\t\t\t\toutPW_FlatFile.flush();\n\t\t\t\toutPW_FlatFile.close();\n\t\t\t}\n\t\t\tendTime = DateFormatter.getStringValue(new Date(), \"EEE MMM d hh:mm:ss a z yyyy\", TimeZone.getTimeZone(\"CST\"));\n //Process runDWFTP = Runtime.getRuntime().exec(\"/usr/bin/sh /msc/arb821/Server/config/java/schedule/DWFileFTP_UK.sh\");\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tLog.customer.debug(e.toString());\n\t\t\tmessage.append(\"Task start time : \"+ startTime);\n\t\t\tmessage.append(\"\\n\");\n\t\t\tmessage.append(\"Task end time : \" + endTime);\n\t\t\tmessage.append(\"\\n\");\n\t\t\tmessage.append(\"No of IR Written for DW : \"+ totalNumberOfIrWritten);\n\t\t\tmessage.append(\"\\n\");\n\t\t\tmessage.append(\"No of IR could not be Written :\"+ (totalNumberOfIrs - totalNumberOfIrWritten));\n\t\t\tmessage.append(\"\\n\");\n\t\t\tmessage.append(\"CATMFGDWInvoicePush_FlatFile Task Failed - Exception details below\");\n\t\t\tmessage.append(\"\\n\");\n\t\t\tmessage.append(e.toString());\n\t\t\tmailSubject = \"CATMFGDWInvoicePush_FlatFile Task Failed\";\n\t\t\tLog.customer.debug(\"%s: Inside Exception message \"+ message.toString() , classname);\n\t\t\tnew ScheduledTaskException(\"Error : \" + e.toString(), e);\n throw new ScheduledTaskException(\"Error : \" + e.toString(), e);\n\t\t}\n\t\tfinally {\n\n\t\t\t\t//Change made by Soumya begins\n\t\t\t\tLog.customer.debug(\"%s::Archive File Path:%s\",classname,archiveFileDataPath);\n\t\t\t\tLog.customer.debug(\"CATMFGDWInvoicePush_FlatFile:Starting Copying the flat file to Archive \");\n\t\t\t\tCATFaltFileUtil.copyFile(flatFilePath, archiveFileDataPath);\n\t\t\t\tLog.customer.debug(\"CATMFGDWInvoicePush_FlatFile:Completed Copying the flat file to Archive \");\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tLog.customer.debug(\"CATMFGDWInvoicePush_FlatFile:Changing file permission of Data file.\");\n\t\t\t\t\tRuntime.getRuntime().exec(\"chmod 666 \" + flatFilePath);\n\t\t\t\t\tLog.customer.debug(\"CATMFGDWInvoicePush_FlatFile:Changed file permission of Data file.\");\n\t\t\t\t}catch (IOException e1) {\n\t\t\t\t\tLog.customer.debug(\"CATMFGDWInvoicePush_FlatFile:Error in changing Permission. \"+ e1);\n\t\t\t\t}\n\n\t\t\t\t//Change made by Soumya end\n\n\n\t\t\tLog.customer.debug(\"%s: Inside Finally \", classname);\n\t\t\tmessage.append(\"Task start time : \"+ startTime);\n\t\t\tLog.customer.debug(\"%s: Inside Finally added start time\", classname);\n\t\t\tmessage.append(\"\\n\");\n\t\t\tmessage.append(\"Task end time : \" + endTime);\n\t\t\tmessage.append(\"\\n\");\n\t\t\tmessage.append(\"Total number of IRs to be Written : \"+ totalNumberOfIrs);\n\t\t\tmessage.append(\"\\n\");\n\t\t\tmessage.append(\"Total number of IRs Written : \"+ totalNumberOfIrWritten);\n\t\t\tmessage.append(\"\\n\");\n\t\t\tLog.customer.debug(\"%s: Inside Finally message \"+ message.toString() , classname);\n\n\t\t\t// Sending email\n\t\t\tCatEmailNotificationUtil.sendEmailNotification(mailSubject, message.toString(), \"cat.java.emails\", \"DWPushNotify\");\n\t\t\tmessage = null;\n\t\t\ttotalNumberOfIrWritten =0;\n\t\t\ttotalNumberOfIrs =0;\n\t }\n}", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast\n .makeText(RecordingService.this,\n \"File uploaded!!\",\n Toast.LENGTH_SHORT)\n .show();\n }", "@Test\r\n\tpublic void findByFileInfoID() {\n\t\tSystem.out.println(123);\r\n\t\tint file_id = 1;\r\n\t\tFileInfo f= fileInfoDao.findByFileInfoID(file_id);\r\n\t\tdd(f);\r\n\t\t\r\n\t}", "void downloadEta(File file, int id) throws IOException, SQLException;", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tString filePath = env.getProperty(\"export.file.path\");\n\t\t\t\tFileSystem fileSystem = FileSystems.getDefault();\n\t\t\t\t// log.debug(\"FILE SYSTEM -----\" + fileSystem);\n\n\t\t\t\t// if(StringUtils.isNotEmpty(empId)) {\n\t\t\t\t// filePath += \"/\" + empId;\n\t\t\t\t// }\n\t\t\t\tPath path = fileSystem.getPath(filePath);\n\t\t\t\t// log.debug(\"PATH----------\" + path);\n\t\t\t\t// path = path.resolve(String.valueOf(empId));\n\t\t\t\tif (!Files.exists(path)) {\n\t\t\t\t\tPath newEmpPath = Paths.get(filePath);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tFiles.createDirectory(newEmpPath);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlog.error(\"Error while creating path \" + newEmpPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfilePath += \"/\" + exportFileName;\n\t\t\t\t// log.debug(\"NEW EXCEL_FILE PATH TO EXPORT----------\" + filePath);\n\n\t\t\t\t// create workbook\n\t\t\t\tXSSFWorkbook xssfWorkbook = new XSSFWorkbook();\n\t\t\t\t// create worksheet with title\n\t\t\t\tXSSFSheet xssfSheet = xssfWorkbook.createSheet(\"EMPLOYEE_REPORT\");\n\n\t\t\t\tRow headerRow = xssfSheet.createRow(0);\n\n\t\t\t\tfor (int i = 0; i < EMP_HEADER.length; i++) {\n\t\t\t\t\tCell cell = headerRow.createCell(i);\n\t\t\t\t\tcell.setCellValue(EMP_HEADER[i]);\n\t\t\t\t}\n\n\t\t\t\tint rowNum = 1;\n\n\t\t\t\tfor (EmployeeDTO transaction : content) {\n\n\t\t\t\t\tlog.info(\"Entered into EMP-FOR Loop--------->\");\n\n\t\t\t\t\tRow dataRow = xssfSheet.createRow(rowNum++);\n\n\t\t\t\t\tdataRow.createCell(0).setCellValue(transaction.getEmpId());\n\t\t\t\t\tdataRow.createCell(1).setCellValue(transaction.getName());\n\t\t\t\t\tdataRow.createCell(2).setCellValue(transaction.getDesignation());\n\t\t\t\t\tdataRow.createCell(3).setCellValue(transaction.getManagerName());\n\t\t\t\t\tdataRow.createCell(4).setCellValue(transaction.getProjectName());\n\t\t\t\t\tdataRow.createCell(5).setCellValue(transaction.getSiteName());\n\t\t\t\t\tdataRow.createCell(6).setCellValue(transaction.getActive());\n\t\t\t\t}\n\n\t\t\t\tfor (int i = 0; i < EMP_HEADER.length; i++) {\n\t\t\t\t\txssfSheet.autoSizeColumn(i);\n\t\t\t\t}\n\t\t\t\t// log.info(exportFileName + \" Excel file was created successfully !!!\");\n\t\t\t\tstatusMap.put(exportFileName, \"COMPLETED\");\n\n\t\t\t\t// String fName = \"F:\\\\Export\\\\Employee.xlsx\";\n\t\t\t\tFileOutputStream fileOutputStream = null;\n\t\t\t\ttry {\n\t\t\t\t\tfileOutputStream = new FileOutputStream(filePath);\n\t\t\t\t\txssfWorkbook.write(fileOutputStream);\n\t\t\t\t\tfileOutputStream.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog.error(\"Error while flushing/closing !!!\");\n\t\t\t\t\tstatusMap.put(exportFileName, \"FAILED\");\n\t\t\t\t}\n\t\t\t\tlock.unlock();\n\t\t\t}", "private void report() {\n\t\t\n\t}", "public Sim_reportfile (String filename) {\n this.filename = filename;\n }", "String saveFile(FileStoreDto dto);", "public String toStringFile(){\n return null;\n }", "private boolean checkFile(String batchName) {\r\n String message = \"\";\r\n boolean found=true;\r\n\r\n if (batchName.equals(Constant.POS_EMPLOYEE)) {\r\n found= ut.isExistFile( Constant.POS_EMPLOYEE_FILE ,Constant.IMPORT_PATH);\r\n message = lang.getString(\"MS100_RunAfterSimEm\");\r\n }\r\n else if (batchName.equals(Constant.POS_EXCHANGE_RATE)) {\r\n found= ut.isExistFile(Constant.POS_EXCHANGE_RATE_FILE,Constant.IMPORT_PATH);\r\n message = lang.getString(\"MS101_RunAfterSimExchangeRatem\");\r\n }\r\n else if (batchName.equals(Constant.POS_ITEM_PRICE)) {\r\n found= ut.isExistFile(Constant.POS_ITEM_PRICE_FILE,Constant.IMPORT_PATH);\r\n message = lang.getString(\"MS102_RunAfterSimItemPrice\");\r\n }\r\n if (!found) {\r\n ut.showMessage(frmMain, lang.getString(\"TT001\"), message +\" \"+ lang.getString(\"MS103_RunFTP\"));\r\n }\r\n return found;\r\n}", "private void printFile(Products print, String ufilename) {\n\t\tFile file = new File(\"output\"+File.separator+ufilename+fileId+\".xml\"); \n\t\tSystem.out.println(\"Exporting : \"+ file);\n\t\tJAXBContext jaxbContext;\n\t\ttry {\n\t\t\tjaxbContext = JAXBContext.newInstance(Products.class); \n\t\t\tMarshaller jaxbMarshaller = jaxbContext.createMarshaller();\n\t\t\tjaxbMarshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);\n\t\t\tjaxbMarshaller.setProperty(\"com.sun.xml.internal.bind.xmlHeaders\", \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");\n\t\t\tjaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);\n\t\t\tjaxbMarshaller.marshal(print, file); // prints the file\n\t\t\t// \t\t jaxbMarshaller.marshal(products, System.out);\n\t\t} catch (JAXBException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void downloadProjectedTrmm(File file, int id) throws IOException, SQLException;", "public String getFileName()\r\n/* 11: */ {\r\n/* 12:45 */ return this.fileName;\r\n/* 13: */ }", "@Override\n public void progress(FileStatus status) {\n progressReporter.progress();\n }", "public void OnFileComplete();", "void downloadProjectedModis(File file, ModisProduct product, int id) throws IOException, SQLException;", "private static void saveFileToDisk(String dir,MultipartFile frontFile, String fileId) throws IOException {\n String filename = frontFile.getOriginalFilename();\n File file = new File(dir+filename+\"_\"+fileId);\n //file.createNewFile();\n System.out.println(\"-----------\");\n System.out.println(file.getAbsolutePath());\n frontFile.transferTo(file);\n BufferedReader bufferedReader = new BufferedReader(new FileReader(file));\n bufferedReader.readLine();\n bufferedReader.close();\n\n }", "@FXML\n public void handleExport() throws Exception{\n \n Writer writer = null;\n String filename = file.getText();\n file.clear();\n \n try {\n File file = new File(filename+\".csv\");\n writer = new BufferedWriter(new FileWriter(file));\n for (MarkLayer1 mark : data) {\n\n String text = mark.getStunum()+\";\" + mark.getCoursename() + \";\" + mark.getClassM()\n + \";\"+ mark.getExam()+\";\"+mark.getFinalM()+\"\\n\";\n\n writer.write(text);\n msg.setText(\"Export Success\");\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n msg.setText(\"Error with export\");\n }\n finally {\n\n writer.flush();\n writer.close();\n } \n \n }", "public String getRecordFile();", "public static void status() {\n Set branchSet = commitPointers.readBranches().keySet();\n ArrayList<String> sortedBranches = (ArrayList) branchSet.stream().sorted().collect(Collectors.toList());\n String currBranch = commitPointers.readHeadCommit()[0];\n System.out.println(\"=== Branches ===\");\n for (String branch: sortedBranches) {\n if (currBranch.equals(branch)) {\n System.out.println(\"*\" + currBranch);\n } else {\n System.out.println(branch);\n }\n }\n stagingArea = Utils.readObject(STAGING_FILE, HashMap.class);\n\n ArrayList<String> sortedStaged = (ArrayList) stagingArea.keySet().stream().sorted().collect(Collectors.toList());\n System.out.println();\n System.out.println(\"=== Staged Files ===\");\n for (String staged : sortedStaged) {\n System.out.println(staged);\n }\n\n System.out.println();\n System.out.println(\"=== Removed Files ===\");\n stagingRemoveArea = Utils.readObject(STAGING_REMOVE_FILE, HashMap.class);\n ArrayList<String> sortedRemoved = (ArrayList) stagingRemoveArea.keySet().stream().sorted().collect(Collectors.toList());\n for (String removed : sortedRemoved) {\n System.out.println(removed);\n }\n System.out.println();\n\n System.out.println(\"=== Modifications Not Staged For Commit ===\");\n\n Commit Head = Utils.readObject(Utils.join(Commit.COMMIT_FOLDER, commitPointers.readHeadCommit()[1] + \".txt\"), Commit.class);\n //File blobs contains a SHAID + file name\n\n HashMap<String, String> modUntracked = new HashMap<>();\n\n //iterates through head Blobs\n for (HashMap.Entry<String, String> headfileBlob : Head.fileBlobs.entrySet()) {\n\n File cwdBFile = Utils.join(CWD, headfileBlob.getKey());\n\n if (!cwdBFile.exists() && !stagingRemoveArea.containsKey(headfileBlob.getKey())) {\n modUntracked.put(headfileBlob.getKey(), \"(deleted)\");\n }\n else if (cwdBFile.exists()){\n\n Blob tempBlob = new Blob(headfileBlob.getKey(), cwdBFile);\n String tempBlobId = Utils.sha1(Utils.serialize(tempBlob));\n\n\n if(!tempBlobId.equals(headfileBlob.getValue())) {\n //if not in staging area\n if (!stagingArea.containsKey(headfileBlob.getKey())) {\n modUntracked.put(headfileBlob.getKey(), \"(modified)\");\n }\n //TODO: IS THIS PART NECCESARY?\n else if (stagingArea.containsKey(headfileBlob.getKey()) && !stagingArea.get(headfileBlob.getKey()).equals(headfileBlob.getValue())) {\n modUntracked.put(headfileBlob.getKey(), \"(modified)\");\n }\n }\n }\n }\n\n ArrayList<String> sortedModNames = (ArrayList) modUntracked.keySet().stream().sorted().collect(Collectors.toList());\n for (String modFileName : sortedModNames){\n System.out.println(modFileName + \" \" + modUntracked.get(modFileName));\n }\n System.out.println();\n\n\n\n ArrayList<String> untracked = new ArrayList<>();\n System.out.println(\"=== Untracked Files ===\");\n for (String cwdfile : CWD.list()) {\n if(!cwdfile.equals(\".gitlet\")) {\n File currfile = Utils.join(CWD, cwdfile);\n if (currfile.exists() && !Head.fileBlobs.containsKey(cwdfile)) {\n untracked.add(cwdfile);\n }\n }\n }\n\n untracked = (ArrayList) untracked.stream().sorted().collect(Collectors.toList());\n\n for (String untrackedName : untracked){\n System.out.println(untrackedName);\n }\n }", "public void downloadCompleted(File f);", "protected void onProgressUpdate(String fileName, Integer... progress) {\n }", "@Override\r\n\t\t\t\tpublic void onFail(String desc) {\n\t\t\t\t Log.e(\"upload\",desc);\t\r\n\t\t\t\t}", "void downloadSavi(File file, int id) throws IOException, SQLException;", "public synchronized void saveFileIDInfo(String projectName, String viewName, int fileID, String appendedPath, String shortFilename, int directoryID) {\n store.saveFileIDInfo(projectName, viewName, fileID, appendedPath, shortFilename, directoryID);\n scheduleSaveOfFileIdStore();\n }", "private boolean exportResult(){\n System.out.println(\"Writing to \" + \"out_\" + inputFile);\n return true;\n }", "public Long getInfile_()\n{\nreturn getInputDataItemId(\"infile_\");\n}", "void showTarProgressMessage(String msg);", "@Override\r\n\tprotected String getExportFileTitle() {\n\t\treturn null;\r\n\t}", "public synchronized void crit_request(int ts,String filename)\n {\n out.println(\"REQUEST\");\n out.println(ts);\n out.println(my_c_id);\n out.println(filename);\n }", "public void logData(){\n }", "private void doExport() {\n\t\tSQLiteDatabase db = null;\n\t\tCursor cursor = null;\n\t\ttry {\n\t\t\tdb = openOrCreateDatabase(MyDbHelper.DATABASE_NAME, SQLiteDatabase.OPEN_READWRITE, null);\n\t\t\tcursor = db.rawQuery(\"SELECT * \" +\n \" FROM \" + LocationTable.TABLE_NAME +\n \" ORDER BY \" + LocationTable.COLUMN_TIMESTAMP + \" ASC\",\n null);\n \n\t\t\tint timestampColumnIndex = cursor.getColumnIndexOrThrow(LocationTable.COLUMN_TIMESTAMP);\n int latitudeColumnIndex = cursor.getColumnIndexOrThrow(LocationTable.COLUMN_LATITUDE);\n int longitudeColumnIndex = cursor.getColumnIndexOrThrow(LocationTable.COLUMN_LONGITUDE);\n int accuracyColumnIndex = cursor.getColumnIndexOrThrow(LocationTable.COLUMN_ACCURANCY);\n \n\t\t\tif (cursor.moveToFirst()) {\n\t\t\t\tStringBuffer fileBuf = new StringBuffer();\n\t\t\t\tString beginTimestamp = null;\n\t\t\t\tString endTimestamp = null;\n\t\t\t\tString timestamp = null;\n\t\t\t\tdo {\n\t\t\t\t\ttimestamp = cursor.getString(timestampColumnIndex);\n\t\t\t\t\tif (beginTimestamp == null) {\n\t\t\t\t\t\tbeginTimestamp = timestamp;\n\t\t\t\t\t}\n\t\t\t\t\tdouble latitude = cursor.getDouble(latitudeColumnIndex);\n\t\t\t\t\tdouble longitude = cursor.getDouble(longitudeColumnIndex);\n\t\t\t\t\tdouble accuracy = cursor.getDouble(accuracyColumnIndex);\n\t\t\t\t\tfileBuf.append(sevenSigDigits.format(longitude)+\",\"+sevenSigDigits.format(latitude)+\"\\n\");\n\t\t\t\t} while (cursor.moveToNext());\n\t\t\t\t\n\t\t\t\tendTimestamp = timestamp;\n\t\t\t\t\n\t\t\t\tcloseFileBuf(fileBuf, beginTimestamp, endTimestamp);\n\t\t\t\tString fileContents = fileBuf.toString();\n\t\t\t\tLog.d(ActivityName, fileContents);\n\t\t\t\tFile sdcard_path = Environment.getExternalStorageDirectory();\n\t\t\t\tFile sdDir = new File(sdcard_path, \"GPSLogger\");\n\t\t\t\tsdDir.mkdirs();\n\t\t\t\tFile file = new File(sdDir, zuluFormat(beginTimestamp) + \".kml\");\n\t\t\t\tFileWriter sdWriter = new FileWriter(file, false);\n\t\t\t\tsdWriter.write(fileContents);\n\t\t\t\tsdWriter.close();\n \t\t\tToast.makeText(getBaseContext(),\n \t\t\t\t\t\"Export completed!\",\n \t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t} else {\n\t\t\t\tToast.makeText(getBaseContext(),\n\t\t\t\t\t\t\"I didn't find any location points in the database, so no KML file was exported.\",\n\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t}\n\t\t} catch (FileNotFoundException fnfe) {\n\t\t\tToast.makeText(getBaseContext(),\n\t\t\t\t\t\"Error trying access the SD card. Make sure your handset is not connected to a computer and the SD card is properly installed\",\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t} catch (Exception e) {\n\t\t\tToast.makeText(getBaseContext(),\n\t\t\t\t\t\"Error trying to export: \" + e.getMessage(),\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t} finally {\n\t\t\tif (cursor != null && !cursor.isClosed()) {\n\t\t\t\tcursor.close();\n\t\t\t}\n\t\t\tif (db != null && db.isOpen()) {\n\t\t\t\tdb.close();\n\t\t\t}\n\t\t}\n\t}", "void downloadNdvi(File file, int id) throws IOException, SQLException;", "public BigDecimal getExportStatus(String id) throws ProvisioningApiException {\r\n\t\ttry {\r\n\t\t\tExportStatusResponse resp = exportApi.getExportStatus(id);\r\n\t\r\n\t\t\tif (!resp.getStatus().getCode().equals(0)) {\r\n\t\t\t\tthrow new ProvisioningApiException(\"Error getting export status. Code: \" + resp.getStatus().getCode());\r\n\t\t\t}\r\n\t\r\n\t\t\treturn resp.getData().getProgress();\r\n\t\t} catch(ApiException e) {\r\n\t\t\tthrow new ProvisioningApiException(\"Error getting export status\", e);\r\n\t\t}\r\n\t}", "public String getFileName() \n {\n return fileName;\n }", "public abstract String FileOutput();", "private static File getAssetInfoFile(MD5Key id) {\n \t\treturn new File(cacheDir.getAbsolutePath() + File.separator + id + \".info\");\n \t}", "public void recordLog(){\r\n\t\tthis.finishLog(resourceFiles.getString(\"PathHepparIITestDirectory\") + \"/\" + TEST_FILE_NAME); \r\n\t}", "private void writeLog(){\n\t\tStringBuilder str = new StringBuilder();\r\n\t\tstr.append(System.currentTimeMillis() + \", \");\r\n\t\tstr.append(fileInfo.getCreator() + \", \");\r\n\t\tstr.append(fileInfo.getFileName() + \", \");\r\n\t\tstr.append(fileInfo.getFileLength() + \", \");\r\n\t\tstr.append(networkSize + \", \");\r\n\t\tstr.append(fileInfo.getN1() + \", \");\r\n\t\tstr.append(fileInfo.getK1() + \", \");\r\n\t\tstr.append(fileInfo.getN2() + \", \");\r\n\t\tstr.append(fileInfo.getK2() + \", \");\r\n\t\tstr.append(logger.getDiff(logger.topStart, logger.topEnd-Constants.TOPOLOGY_DISCOVERY_TIMEOUT)+ \", \");\r\n\t\tstr.append(logger.getDiff(logger.optStart, logger.optStop) + \", \");\r\n\t\tstr.append(logger.getDiff(logger.encryStart, logger.encryStop) + \", \");\r\n\t\tstr.append(logger.getDiff(logger.distStart, logger.distStop) + \"\\n\");\r\n\t\t\r\n\t\tString tmp=\"\t\";\r\n\t\tfor(Integer i : fileInfo.getKeyStorage())\r\n\t\t\ttmp += i + \",\";\r\n\t\ttmp += \"\\n\";\r\n\t\tstr.append(tmp);\r\n\t\t\r\n\t\ttmp=\"\t\";\r\n\t\tfor(Integer i : fileInfo.getFileStorage())\r\n\t\t\ttmp += i + \",\";\r\n\t\ttmp += \"\\n\";\r\n\t\tstr.append(tmp);\t\t\r\n\t\t//dataLogger.appendSensorData(LogFileName.FILE_CREATION, str.toString());\t\t\r\n\t\t\r\n\t\t// Topology Discovery\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"TopologyDisc, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(logger.topStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.topStart, logger.topEnd-Constants.TOPOLOGY_DISCOVERY_TIMEOUT ) + \", \");\r\n\t\tstr.append(\"\\n\");\t\t\t\t\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\r\n\t\t\r\n\t\t// Optimization\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"Optimization, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(logger.optStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.optStart, logger.optStop) + \", \");\r\n\t\tstr.append(\"\\n\");\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\t\t\r\n\t\t\r\n\t\t\r\n\t\t// File Distribution\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"FileDistribution, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(fileInfo.getFileLength() + \", \");\r\n\t\tstr.append(logger.distStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.distStart, logger.distStop) + \", \");\r\n\t\tstr.append(\"\\n\\n\");\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\t\t\r\n\t}", "int uploadEvi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;", "private void onDownloadComplete(String file_name, String downloadPath) {\n\n file_name_nv=file_name;\n getstartshow(file_name_nv);\n }", "@Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n }", "void downloadCompleted(String blobId);", "@Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n }", "private static void LOG() {\n if (!RESULTFILE.exists()) {\n\n if (!RESULTFILE.getParentFile().exists()) {\n RESULTFILE.getParentFile().mkdirs();\n }\n\n try {\n RESULTFILE.createNewFile();\n } catch (IOException ioe) {\n System.err.println(\"Couldn't create file \" + RESULTFILE.getName());\n System.err.println(\"ERROR\" + ioe.getLocalizedMessage());\n System.out.println(\"Exiting...\");\n System.exit(1);\n }\n try {\n BufferedWriter bw = new BufferedWriter(new FileWriter(RESULTFILE, true));\n bw.write(\"rank\" + \"\\t\" + \"DBID\" + \"\\n\");\n bw.close();\n } catch (IOException ioe) {\n System.err.println(\"Couldn't write to file \" + RESULTFILE.getName());\n System.err.println(\"ERROR: \" + ioe.getLocalizedMessage());\n System.out.println(\"Exiting...\");\n System.exit(1);\n }\n try {\n ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(RESULTFILE));\n out.writeObject(RESULTS);\n out.close();\n\n } catch (IOException ioe) {\n System.err.println(\"Couldn't write to file \" + RESULTFILE.getName());\n System.err.println(\"ERROR: \" + ioe.getLocalizedMessage());\n System.out.println(\"Exiting...\");\n System.exit(1);\n }\n }\n\n /**\n * print also SQL query into a sql file\n *\n */\n if (!SQLFILE.exists()) {\n if (!SQLFILE.getParentFile().exists()) {\n SQLFILE.getParentFile().mkdirs();\n }\n try {\n SQLFILE.createNewFile();\n } catch (IOException ioe) {\n System.err.println(\"Couldn't create file \" + SQLFILE.getName());\n System.err.println(\"ERROR\" + ioe.getLocalizedMessage());\n System.out.println(\"Exiting...\");\n System.exit(1);\n }\n try {\n BufferedWriter bw = new BufferedWriter(new FileWriter(SQLFILE, true));\n bw.write(UNKNOWN.getSortedQuery() + \"\\n\");\n bw.close();\n } catch (Exception e) {\n System.err.println(\"Konnte nicht in Datei \" + SQLFILE + \" schreiben!\");\n }\n }\n }", "@Override\r\n\tprotected void onPreExecute() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onPreExecute();\r\n\r\n\t\tif (this.ti != null) {\r\n\t\t\t\r\n\t\t\t// debug\r\n\t\t\tToast.makeText(actv, \"Uploading file: \" + ti.getFile_name(), Toast.LENGTH_LONG).show();\r\n\t\t\t\r\n\t\t} else {//if (this.ti != null)\r\n\r\n\t\t\t// debug\r\n\t\t\tToast.makeText(actv, \"Uploading file\", Toast.LENGTH_LONG).show();\r\n\t\t\t\r\n\t\t}//if (this.ti != null)\r\n\t\t\r\n\t}", "@Override\n public void onClick(View v) {\n if(createFile())\n {\n new exportContactsAsync(BaseActivity.progressDialog).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }\n }", "public void setFileid(Integer fileid) {\n this.fileid = fileid;\n }" ]
[ "0.60919666", "0.6030195", "0.5948737", "0.59184426", "0.5858877", "0.5825188", "0.5802374", "0.5644611", "0.5598755", "0.5598241", "0.55178463", "0.54798555", "0.5431496", "0.5426273", "0.5395096", "0.5345545", "0.5339434", "0.53225183", "0.5317662", "0.52989125", "0.5285428", "0.52773345", "0.5252211", "0.5250472", "0.5225494", "0.5223501", "0.5221567", "0.52106065", "0.51846206", "0.5182494", "0.51817435", "0.5175309", "0.5144495", "0.5139794", "0.5135439", "0.5133464", "0.5132989", "0.5117229", "0.5113596", "0.51062465", "0.51029223", "0.50913197", "0.5082618", "0.507758", "0.507758", "0.507758", "0.5055958", "0.5047003", "0.50446963", "0.5043097", "0.5042222", "0.5039082", "0.50345606", "0.50263727", "0.50248283", "0.5018997", "0.50116235", "0.5002003", "0.49974635", "0.4976594", "0.49745008", "0.49540818", "0.49393475", "0.49386722", "0.4937898", "0.4937697", "0.49366876", "0.4933745", "0.4933613", "0.49313346", "0.49311894", "0.49182504", "0.49125734", "0.4911772", "0.4907935", "0.49041378", "0.49010766", "0.48975143", "0.48933822", "0.48930013", "0.48896605", "0.48876816", "0.48864877", "0.48852146", "0.4883294", "0.48815483", "0.48814785", "0.487734", "0.4875182", "0.4859381", "0.48553783", "0.4853671", "0.48524937", "0.48524714", "0.48514727", "0.4850937", "0.48499474", "0.48411927", "0.48398575", "0.48350656" ]
0.65356654
0
Taking input of all data from the database
private Data initialise() { getRoomsData(); getMeetingTimesData(); setLabMeetingTimes(); getInstructorsData(); getCoursesData(); getDepartmentsData(); getInstructorFixData(); for (int i=0;i<departments.size(); i++){ numberOfClasses += departments.get(i).getCourses().size(); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void getDataFromDatabase(){\r\n\t \tArrayList<Object> row = HomeActivity.dbPrograms.getDetail(SelectedID);\r\n\t \t\r\n\t\t\t// store data to variables\r\n\t \tProgramID = Integer.parseInt(row.get(0).toString());\r\n\t \tWorkoutID = Integer.parseInt(row.get(1).toString());\r\n\t \tName = row.get(2).toString();\r\n\t \tSelectedDayID = Integer.parseInt(row.get(3).toString());\r\n\t \tImage = row.get(4).toString();\r\n\t \tTime = row.get(5).toString().trim();\r\n\t \tSteps = row.get(6).toString();\r\n\t \t\r\n\t }", "public static void main(String[] args) {\n Manager m = new Manager();\n Connection con = m.connect(\"localhost\",\"users\",\"postgres\",\"corewars\");\n //String[] elems = {\"login\",\"password\"};\n //DefaultTableModel users = m.getTable(con, \"SELECT * FROM users_info;\");\n List<String[]> response = m.getTableAsList(con, \"SELECT * FROM users_info;\");\n for( String[] row: response ){\n for( String s: row ){\n System.out.print( \" \" + s );\n }\n System.out.println();\n }\n System.out.println(response.get(0)[1]);\n //users.setColumnIdentifiers(new String[] {\"userID\", \"Value\"});\n //System.out.println(users.getColumnName(0));\n //m.ask(con, \"SELECT login,password FROM users_info WHERE user_id=3;\",elems);\n m.closeConnection(con);\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n Database db = new Database();\n \n while (true) {\n String input = scanner.nextLine();\n if (input.equals(\"Quit\")) {\n break;\n } else if (input.equals(\"Add\")) {\n System.out.print(\"Name: \");\n String name = scanner.nextLine();\n System.out.print(\"Latin Name: \");\n String lname = scanner.nextLine();\n db.add(name, lname);\n } else if (input.equals(\"Observation\")) {\n System.out.print(\"What was observed:? \");\n String name = scanner.nextLine();\n db.addObservant(name);\n } else if (input.equals(\"Show\")) {\n System.out.print(\"What? \");\n String name = scanner.nextLine();\n db.printBird(name);\n } else if (input.equals(\"Statistics\")) {\n db.show();\n }\n \n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n String input = request.getParameter(\"input\");\n String sql = \"INSERT INTO EXAMPLES VALUES \" + input;\n\n try {\n Statement stmt = conn.createStatement();\n ResultSet results = stmt.executeQuery(sql);\n System.out.println(\"look what the database said! \" + results);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }", "void all_Data_retrieve() {\n\t\tStatement stm=null;\n\t\tResultSet rs=null;\n\t\ttry{\n\t\t\t//Retrieve tuples by executing SQL command\n\t\t stm=con.createStatement();\n\t String sql=\"select * from \"+tableName+\" order by id desc\";\n\t\t rs=stm.executeQuery(sql);\n\t\t DataGUI.model.setRowCount(0);\n\t\t //Add rows to table model\n\t\t while (rs.next()) {\n Vector<Object> newRow = new Vector<Object>();\n //Add cells to each row\n for (int i = 1; i <=colNum; i++) \n newRow.addElement(rs.getObject(i));\n DataGUI.model.addRow(newRow);\n }//end of while\n\t\t //Catch SQL exception\n }catch (SQLException e ) {\n \te.printStackTrace();\n\t } finally {\n\t \ttry{\n\t if (stm != null) stm.close(); \n\t }\n\t \tcatch (SQLException e ) {\n\t \t\te.printStackTrace();\n\t\t }\n\t }\n\t}", "@Override\n\tpublic void queryData() {\n\t\t\n\t}", "@Override\r\n\tpublic List<HtmlInput<?>> getInputs() throws DatabaseException\r\n\t{\n\t\treturn null;\r\n\t}", "void fillDatabase() {\n Type.type( \"FOOD\" );\n Type.type( \"HOT\" );\n Type.type( \"SNACK\" );\n }", "public void getDataFromFile() throws SQLException{\n \n //SQL database\n getGuestDate_DB();\n getHotelRoomData_DB();\n updateRoomChanges_DB();\n \n //this.displayAll();\n //this.displayAllRooms();\n \n }", "private void FetchingData() {\n\t\t try { \n\t\t\t \n\t \tmyDbhelper.onCreateDataBase();\n\t \t \t\n\t \t\n\t \t} catch (IOException ioe) {\n\t \n\t \t\tthrow new Error(\"Unable to create database\");\n\t \n\t \t} \n\t \ttry {\n\t \n\t \t\tmyDbhelper.openDataBase();\n\t \t\tmydb = myDbhelper.getWritableDatabase();\n\t\t\tSystem.out.println(\"executed\");\n\t \t\n\t \t}catch(SQLException sqle){\n\t \n\t \t\tthrow sqle;\n\t \n\t \t}\n\t}", "@Override\n\tvoid getData() {\n\t\tSystem.out.println(\"Enter Brand\");\n\t\tbrand=a.next();\n\t\tSystem.out.println(\"Enter model\");\n\t\tmodel=a.next();\n\t\tSystem.out.println(\"Enter CC\");\n\t\tcc=a.nextDouble();\n\t}", "void populateData();", "private static void selectRecordsFromDbUserTable() throws SQLException {\n\n\t\tConnection dbConnection = null;\n\t\tStatement statement = null;\n\n\t\tString selectTableSQL = \"SELECT * from spelers\";\n\n\t\ttry {\n\t\t\tdbConnection = getDBConnection();\n\t\t\tstatement = dbConnection.createStatement();\n\n\t\t\tSystem.out.println(selectTableSQL);\n\n\t\t\t// execute select SQL stetement\n\t\t\tResultSet rs = statement.executeQuery(selectTableSQL);\n\n\t\t\twhile (rs.next()) {\n \n String naam = rs.getString(\"naam\");\n\t\t\t\tint punten = rs.getInt(\"punten\");\n \n System.out.println(\"naam : \" + naam);\n\t\t\t\tSystem.out.println(\"punten : \" + punten);\n\t\t\t\t\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\n\t\t\tSystem.out.println(e.getMessage());\n\n\t\t} finally {\n\n\t\t\tif (statement != null) {\n\t\t\t\tstatement.close();\n\t\t\t}\n\n\t\t\tif (dbConnection != null) {\n\t\t\t\tdbConnection.close();\n\t\t\t}\n\n\t\t}\n\n\t}", "public static void main(String[] args) throws ClassNotFoundException, SQLException {\n\t\tDBManager db=new DBManager();\r\n\t\t\tConnection conn=db.open();\r\n\t\t\tScanner sc=new Scanner(System.in);\r\n\t\t\tString code, name;\r\n\t\t\tint choice, salary;\r\n\t\t\tdo{\r\n\t\t\t\tSystem.out.println(\"Choose an option : \\n1.Create a record\\n2.Read a record\\n3.Update a record\\n4.Delete a record\");\r\n\t\t\t\tchoice=sc.nextInt();\r\n\t\t\t\tswitch(choice)\r\n\t\t\t\t{\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tSystem.out.println(\"Enter code : \");\r\n\t\t\t\t\tcode=sc.nextLine();\r\n\t\t\t\t\tSystem.out.println(\"Enter employee name : \");\r\n\t\t\t\t\tname=sc.nextLine();\r\n\t\t\t\t\tSystem.out.println(\"Enter salary : \");\r\n\t\t\t\t\tsalary=sc.nextInt();\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}", "public static void main(String[] args) {\n\t\t\n\t\t System.out.println(\"Which operation you want to execute \\n 1.Display Data base.\\n 2.Insert into table \\n 3.Update the values \\n 4.Delete values\");\n \t\t Scanner in1=new Scanner(System.in);\n \t\t int a = in1.nextInt(); \n System.out.println(\"You entered integer \"+a);\n switch (a) {\n \t case 1:\n \t\t display();\n \t\t break;\n case 2:\n \t insert();\n \t break;\n case 3:\n \t update();\n \t break;\n case 4:\n \t remove();\n \t break;\n default:\n \t System.out.println(\"you entered wrong keyword...........\");\n \t }\n \n\t}", "static void dataToevoegen(String querry) {\n try {\n Statement stmt = connectieMaken().createStatement(); //\n stmt.execute(querry);\n } catch (SQLException se) {\n se.printStackTrace();\n }\n }", "public static void main(String args[]) {\n\tStudentDao d= new StudentDao();\r\n\tArrayList<Student> s = d.findAll();\r\n\tfor(Student k:s) {\r\n\t\tSystem.out.println(k);\r\n\t}\r\n//\tSystem.out.println(d.insert(s));\r\n\r\n \r\n }", "private void getDataFromDB() {\n ArrayList<ArtworkData> artworkData = getArtworksFromDatabase();\n if (artworkData.size() <= 0) {\n // there is no data in local DB, error\n onErrorReceived();\n } else {\n sendArtworkData(artworkData);\n }\n }", "private static void revenueData() {\n\n if(getStatus().equals(\"no database\"))\n return;\n\n clearScreen();\n\n Scanner input = new Scanner(System.in);\n char opt = '_';\n \n while(opt != 'q')\n {\n\n System.out.print(\"Type (c)ount, (d)ays, or (r)evenue to view \"\n + \"different table data (or (q)uit to exit): \");\n\n opt = input.next().toLowerCase().charAt(0);\n\n if(opt == 'c')\n displayRevenue(\"Reservations\", \n \"COUNT(*) AS Reservations\");\n \n if(opt == 'd')\n displayRevenue(\"days_occupied\", \n \"SUM(DATEDIFF(CheckOut, CheckIn)) AS days_occupied\");\n\n if(opt == 'r')\n displayRevenue(\"Revenue\", \n \"SUM(DATEDIFF(CheckOut, CheckIn) * Rate) AS Revenue\");\n\n }\n\n }", "public static void main(String[] args) {\n StudentDatabase database = null;\n\n try {\n List<String> lines = Files.readAllLines(\n Paths.get(\"./database.txt\"),\n StandardCharsets.UTF_8\n );\n\n database = new StudentDatabase(lines);\n } catch (IOException exc) {\n System.out.println(\"Error while reading the database. Terminating...\");\n System.exit(-1);\n }\n\n try (Scanner sc = new Scanner(System.in)) {\n while (true) {\n System.out.print(\"> \");\n\n if (sc.hasNext()) {\n String input = sc.nextLine().trim();\n\n if (input.equalsIgnoreCase(\"exit\")) {\n System.out.println(\"Goodbye!\");\n break;\n }\n\n if (input.startsWith(\"query \")) {\n String query = input.substring(6);\n\n try {\n List<StudentRecord> printList = query(query, database);\n\n List<String> output = RecordFormatter.format(printList);\n output.forEach(System.out::println);\n System.out.printf(\"%n\");\n } catch (QueryException exc) {\n System.out.println(\"Invalid query.\\n\");\n }\n } else {\n System.out.println(\"Invalid command.\\n\");\n }\n }\n }\n }\n }", "void ProcessInput() throws SQLException {\n \n \n if (\"\".equals(jTextField1.getText()) || \"\".equals(buttonGroup1.getSelection().getActionCommand()) || \"\".equals(jTextField2.getText()))\n {JOptionPane.showMessageDialog(null , \"Isi Form dengan benar\");}\n else\n {\n String nama = jTextField1.getText();\n String tanggal = jLabel7.getText();\n String jenis = buttonGroup1.getSelection().getActionCommand();\n String kuantitas = jTextField2.getText();\n String idPesanan = jLabel4.getText();\n String pembayaran = jLabel10.getText();\n sql1 = \"INSERT INTO vermak(tanggal, nama, jenis, kuantitas) VALUES ('\"\n +tanggal+\"','\"\n +nama+\"','\"\n +jenis+\"','\"\n +kuantitas+\"')\";\n \n sql2 = \"insert into payvermak(idPesanan, pembayaran) values ('\"+idPesanan+\"','\"+pembayaran+\"')\";\n\n stat = (com.mysql.jdbc.Statement) connection.prepareStatement(sql1);\n stat.execute(sql1);\n\n stat1 = (com.mysql.jdbc.Statement) connection.prepareStatement(sql2);\n stat1.execute(sql2);\n\n stat.close();\n stat1.close();\n }\n \n \n }", "void getData() throws SQLException, IOException {\n\t\tint i = 0;\n\t\twhile (cu.rst.next()) {\n\t\t\t\n\t\t\t\n\t\t\tcm[i].setDetails(cu.rst.getInt(1), cu.rst.getString(3),\n\t\t\t\t\tcu.rst.getString(4), cu.rst.getString(5), cu.rst.getString(6),\n\t\t\t\t\tcu.rst.getInt(7));\n\t\t\ti++;\n\n\t\t}\n\t\tSystem.out.println(\"**************************DETAILS TAKEN**************************\");\n\n\t}", "public void okButtonAction(ActionEvent actionEvent){\n\n\n System.out.println(\"okkkkkk\");\n querySpecial=null;\n\n PersistenceUtil pu= PersistenceUtil.getInstance();\n EntityManagerFactory emf =pu.getEmf();\n EntityManager em = emf.createEntityManager();\n\n ArtistRepository ar= ArtistRepository.getInstance();\n\n\n if(textField1.getText()!=null)\n {\n System.out.println(textField1.getText());\n resultArtist=ar.findById(Integer.parseInt(textField1.getText()));\n System.out.println(resultArtist.get().getName());\n writeTable();\n }\n\n\n }", "private void RetrieveEditTextData() {\n\n strFirstName = etFirstName.getText().toString();\n strMiddleName = etMiddleName.getText().toString();\n strLastName = etLastName.getText().toString();\n strEmployId = etEmployId.getText().toString();\n strDesignation = etDesignation.getText().toString();\n strCompName = etCompName.getText().toString();\n strCategory = etCategory.getText().toString();\n strDOB = etDOB.getText().toString();\n\n }", "public void formDatabaseTable() {\n }", "public void input()\n\t{\n\t\t// this facilitates the output\n\t\tScanner sc = new Scanner(System.in) ; \n\t\tSystem.out.print(\"The Bike Number:- \") ;\n\t \tthis.bno = sc.nextInt() ; \t\n\t\tSystem.out.print(\"The Biker Name:- \") ; \n\t \tthis.name = new Scanner(System.in).nextLine() ; \t\n\t\tSystem.out.print(\"The Phone number:- \") ; \n\t \tthis.phno = sc.nextInt() ; \t\n\t\tSystem.out.print(\"The number of days:- \") ; \n\t \tthis.days = sc.nextInt() ; \t\n\t}", "public static void main(String[] args)\n\t{\n\t\t\n\t\tMySQL mySQL = new MySQL();\n\t\tmySQL.setAddress(\"localhost\");\n\t\tmySQL.setPort(3306);\n\t\tmySQL.setUsername(\"luke\");\n\t\tmySQL.setPassword(\"123\");\n\t\tmySQL.setDatabaseName(\"user_system\");//Name of data base\n\t\t\n\t\tString cmdStr = \"\";\n\t\t//initial\n\t\tif( mySQL.initial() == false )\n\t\t{\n\t\t\tSystem.out.println(mySQL.getErrorMessage());\n\t\t}\t\t\n\t\t\n\t\tSystem.out.println(\"Connecting to SQL\");\n\t\tif( mySQL.connectToMySQL() == false )\n\t\t{\n\t\t\tSystem.out.println(mySQL.getErrorMessage());\n\t\t}\t\n\t\t\n\t\t//create table\n\t\tcmdStr = \"create table mytable(name char(10),id int);\";\n\t\tif( mySQL.insertData_raw(cmdStr) == false )\n\t\t{\n\t\t\tSystem.out.println(mySQL.getErrorMessage());\n\t\t\treturn;\t\t\t\t\n\t\t}\t\t\n\t\tSystem.out.println(\"create table finished\");\n\t\t\n\t\t//insert Value by raw cmd\n\t\tString name = \"Hello\";\n\t\tString idStr = \"1\";\n\t\tcmdStr = \"insert into mytable(name, id) values(\\\"\" + name + \"\\\", \" + idStr + \");\";\n\t\tif( mySQL.insertData_raw(cmdStr) == false )\n\t\t{\n\t\t\tSystem.out.println(mySQL.getErrorMessage());\n\t\t\treturn;\t\t\t\t\n\t\t}\t\t\n\t\t\n\t\t//insert Value by function\n\t\tString tableName = \"mytable\";\n\t\tObject[] valueList = new Object[2];\n\t\tvalueList[0] = new String(\"World\");\n\t\tvalueList[1] = new Integer(2);\n\t\tif( mySQL.insertData(tableName, valueList) == false )\n\t\t{\n\t\t\tSystem.out.println(mySQL.getErrorMessage());\n\t\t\treturn;\t\t\n\t\t}\n\t\tSystem.out.println(\"insert value finished\");\n\t\t\n\t\t\n\t\t//Output Value\n\t\tSystem.out.println(\"Get data from mytable:\");\n\t\ttableName = \"mytable\";\n\t\tString[] columnList = new String[2];\n\t\tcolumnList[0] = \"name\";\n\t\tcolumnList[1] = \"id\";\n\t\t//columnList[2] = \"passwd\";\n\t\tResultSet result = mySQL.outputData(tableName, columnList, false);\n\t\tif( result == null )\t{ System.out.println(mySQL.getErrorMessage()); }\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tSystem.out.println(\"name\\t\\tID\\t\\t\"); \n\t\t\t\twhile(result.next())\n\t\t\t\t{ \n\t\t\t\t System.out.println(result.getString(\"name\")+\"\\t\\t\"+ result.getInt(\"id\")+\"\\t\\t\"); \n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\tcatch(SQLException ignore) \n\t\t\t{ \n\t\t\t\tSystem.out.println(\"result get errer\");\n\t\t\t} \t\t\t\n\t\t}\t\t\n\t\t\t\t\n\t\t\n\t\t//destory table\n\t\tcmdStr = \"drop table mytable;\";\n\t\tif( mySQL.insertData_raw(cmdStr) == false )\n\t\t{\n\t\t\tSystem.out.println(mySQL.getErrorMessage());\n\t\t\treturn;\t\t\t\t\n\t\t}\t\t\n\t\tSystem.out.println(\"drop table finished\");\t\t\t\n\t\t\n\t\tif( mySQL.disConnect() == false )\n\t\t{\n\t\t\tSystem.out.println(mySQL.getErrorMessage());\n\t\t}\n\t\tSystem.out.println(\"Disconnect from SQL\");\t\t\n\n\t}", "public void insertData() throws SQLException {\n pst=con.prepareStatement(\"insert into employee values(?,?,?)\");\n System.out.println(\"Enter id: \");\n int id=sc.nextInt();\n pst.setInt(1,id);\n System.out.println(\"Enter Name: \");\n String name=sc.next();\n pst.setString(2,name);\n System.out.println(\"Enter city: \");\n String city=sc.next();\n pst.setString(3,city);\n pst.execute();\n System.out.println(\"Data inserted successfully\");\n }", "String askForData();", "@Override\n\tpublic void input() {\n\t\t// TODO Auto-generated method stub\n\t\tSystem.out.println(\"=================\");\n\t\tSystem.out.println(\"매입 매출 등록\");\n\t\tSystem.out.println(\"-----------------\");\n\t\tString pname = null;\n\t\twhile (true) {\n\t\t\tSystem.out.print(\"상품명(QUIET:입력중단)>>\");\n\t\t\tpname = scan.nextLine();\n\t\t\tif (pname.equals(\"QUIET\")) {\n\t\t\t\treturn;\n\t\t\t} else if (pname.equals(\"\")) {\n\t\t\t\tSystem.out.println(\"상품명은 반드시 입력해야합니다\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tSystem.out.print(\"거래일자(yyyy-mm-dd)\");\n\t\tString date = scan.next();\n\n\t\tSystem.out.print(\"거래처 명 >>\");\n\t\tString dname = scan.next();\n\n\t\tSystem.out.print(\"매입매출구분>>\");\n\t\tString iout = scan.next();\n\n\t\tSystem.out.print(\"수량>>\");\n\t\tInteger qty = scan.nextInt();\n\t\tInteger iprice = this.inputPrice(\"매입\");\n\t\tif (iprice == null) {\n\t\t\treturn;\n\t\t}\n\t\tInteger oprice = this.inputPrice(\"매출\");\n\t\tif (oprice == null) {\n\t\t\treturn;\n\t\t}\n\t\tIolistVO VO = new IolistVO();\n\t\tVO.setPname(pname);\n\t\tVO.setDate(date);\n\t\tVO.setDname(dname);\n\t\tVO.setInout(iout);\n\t\tVO.setIprice(iprice);\n\t\tVO.setOprice(oprice);\n\t\tVO.setQty(qty);\n\t\tiolist.add(VO);\n\t}", "void searchDatabase(String userInput)\n {\n List<Recipe> result = this.database.getRecipes(userInput);\n\n recipeListAdapter.updateRecipeList(result);\n }", "public static void main(String[] args) throws SQLException {\n\t\tdao.DBBean daodao = new dao.DBBean();\r\n\t\tString sql = \"select * from msql.peizhi where xuhao ='1'\";\r\n\t\tResultSet rs = daodao.query(sql);\r\n\t\twhile(rs.next()){\r\n\t\t\tdouble sname = rs.getDouble(\"bxishu\");\r\n\t\t\tSystem.out.println(sname);\r\n\t\t}\r\n\t\t\r\n\t\t//sql = \"insert into msql.peizhi(xuhao)values('2')\";\r\n\t\t//daodao.update(sql);\r\n\t\t\r\n\t\tsql = \"update msql.peizhi set bsensorx = '3' where xuhao = '2'\";\r\n\t\tdaodao.update(sql);\r\n\t\t}", "@Override\r\n public void read() {\r\n Connection conexao = mysql.getConnection();\r\n try {\r\n PreparedStatement stm = conexao.prepareStatement(readSQL);\r\n ResultSet rs = stm.executeQuery();\r\n\r\n while (rs.next()) {\r\n int idcodigo = rs.getInt(\"idcodigo\");\r\n String data = rs.getString(\"data\");\r\n int p_rodada = rs.getInt(\"p_rodada\");\r\n int s_rodada = rs.getInt(\"s_rodada\");\r\n int t_rodada = rs.getInt(\"t_rodada\");\r\n int total = rs.getInt(\"total\");\r\n System.out.println(\"\\nCódigo: \" + idcodigo + \"\\nData: \" + data + \"\\nPrimeira Rodada: \" + p_rodada+ \"\\nSegunda Rodada: \" + s_rodada + \"\\nTerceira Rodada: \" + t_rodada + \"\\nTotal: \" + total);\r\n }\r\n rs.close();\r\n conexao.close();\r\n\r\n } catch (final SQLException ex) {\r\n System.out.println(\"Falha de conexão com a base de dados!\");\r\n ex.printStackTrace();\r\n } catch (final Exception ex) {\r\n ex.printStackTrace();\r\n } finally {\r\n try {\r\n conexao.close();\r\n } catch (final Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n }", "private void fetchData() {\n mFirstNameLabel = \"First name:\";\n mFirstNameValue = \"Taylor\";\n mSurnameLabel = \"Surname:\";\n mSurnameValue = \"Swift\";\n\n initFields();\n }", "void runQueries();", "public File getInputDb();", "public static void main(String args[]) throws Exception\n {\n Class.forName(\"com.mysql.jdbc.Driver\");\n Connection con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/sql\",\"root\",\"\");\n Statement stmt = con.createStatement(); //Default method for ResultSet.TYPE_FORWARD_ONLY\n \n // send a SQL query to retrieve records\n ResultSet res = stmt.executeQuery(\"select *from CM\");\n // process the data\n \n int idIndex = res.findColumn(\"id\");\n int nameIndex = res.findColumn(\"name\");\nint ageIndex = res.findColumn(\"age\");\nint addressIndex = res.findColumn(\"address\");\nint salaryIndex=res.findColumn(\"salary\");\n\nwhile(res.next()) {\n int id =res.getInt(idIndex);\n String name = res.getString (nameIndex);\n int age = res.getInt (ageIndex);\n String address = res.getString (addressIndex);\n String salary =res.getString(salaryIndex);\n \n System.out.println(res.getInt(idIndex) \n + \"\\t\" + res.getString(nameIndex) + \n \"\\t\" +res.getInt(ageIndex) + \n \"\\t\" + res.getString(addressIndex) + \n \"\\t\"+ res.getDouble(salaryIndex));\n}\n // close the database connection\n res.close();\n stmt.close();\n con.close();\n }", "public static void main(String args[]) throws SQLException, IOException\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tInsertDetails i = new InsertDetails();\n\t\tUpdate u = new Update();\n\t\tPrintResluts p = new PrintResluts();\n\t\tDeleteData d = new DeleteData();\n\t\tConnectionUtil cn = new ConnectionUtil();\n\t\tConnection con = cn.getConnection();\n\t\tSystem.out.println(\"enter: 1.to insert details \\n 2. to update \\n 3. to print results \\n 4. to delete \\n 5. to exit\");\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"enter your choice : \");\n\t\t\tint n = sc.nextInt();\n\t\t\tswitch(n)\n\t\t\t{\n\t\t\tcase 1:\t\n\t\t\t\tSystem.out.println(\"no. of rows inserted is \"+i.insert(con));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(u.updateTable(con))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"given row is updated\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tSystem.out.println(\"given row is not there in table\");\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tp.results(con);\n\t\t\tcase 4:\n\t\t\t\tint rowsdeleted = d.delete(con);\n\t\t\t\tSystem.out.println(\"no. of rows deleted is \"+rowsdeleted);\n\t\t\t}\n\t\t\tif(n==5)\n\t\t\t\tbreak;\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tConnection connection = null;\n\t\tPreparedStatement pstm = null;\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:mysql://localhost/medical\",\"root\",\"\");\n\t\t\t\n\t\t\tScanner input = new Scanner(System.in);\n\t\t\tSystem.out.println(\"Enter Option:\");\n\t\t\tint op = Integer.parseInt(input.nextLine());\n\t\t\tSystem.out.println(op);\n\t\t\tString sql = null;\n\t\t\tswitch(op) {\n\t\t\t\tcase 1:\n\t\t\t\t\tsql = \"create table user_tbl(ID INT(5),NAME VARCHAR(12))\" ;\n\t\t\t\t\tpstm = connection.prepareStatement(sql);\n\t\t\t\t\tSystem.out.println(\"Table Created.\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tsql = \"select * from user_tbl\";\n\t\t\t\t\tResultSet rs = pstm.executeQuery(sql);\n\t\t\t\t\twhile(rs.next()) {\n\t\t\t\t\t\tSystem.out.println(rs.getInt(1)+\" \"+rs.getString(2));\n\t\t\t\t\t}\n\t\t\t\t\trs.close();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tsql = \"insert into user_tbl values(1,'Aditya')\";\n\t\t\t\t\tpstm = connection.prepareStatement(sql);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tSystem.out.println(\"Enter id:\");\n\t\t\t\t\tint id=Integer.parseInt(input.nextLine());\n\t\t\t\t\tsql = \"delete from user_tbl where id='\"+id+\"'\" ;\n\t\t\t\t\tpstm = connection.prepareStatement(sql);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\t\t\t\n\t\t\tpstm.execute();\n\t\t}catch(Exception e) {\n\t\t\t\n\t\t}\n\t}", "public abstract Statement queryToRetrieveData();", "public static void main(String[] args)\r\n\t{\n\r\n\t\tfinal Connection connection = getConnection(DB_URL, DB_USER, DB_PASSWORD);\r\n\t\t// String query = \"INSERT INTO VALID_ITEM (ID, NAME, QUANTITY,PRICE)\" + \"VALUES ( 1,'sandeep' ,10 ,22 )\";\r\n\t\tString query = \"select * from valid_item\";\r\n\t\tSystem.out.println(JDBCUtil.read(connection, query));\r\n\r\n\t}", "private static void LessonDAO() {\n PersonDAO personDAO = new PersonDAOImpl(); //amend in next lesson\n List<Person> personList = personDAO.getPersonList();\n\n System.out.println(\"===============================\");\n for(Person person: personList) {\n System.out.println(person.getPersonId() + \": \" + person.getFirstName() + \" \" + person.getLastName());\n }\n System.out.println(\"===============================\");\n //endregion\n\n //region Prompt User\n Scanner reader = new Scanner(System.in);\n System.out.println(\"Please Select a Person from the list: \");\n String personId = reader.nextLine();\n //endregion\n\n //region Get Person Details\n Person personDetail = personDAO.getPersonById(Integer.parseInt(personId));\n\n System.out.println(\"---Person Details---\");\n System.out.println(\"Full Name: \" + personDetail.GetFullName());\n //endregion\n }", "public static void main(String[] args){\n\r\n StringDB Database = new StringDB();\r\n Database.execute(\"INSERT INTO teachers VALUES ( 'Martin_Aumüller' , 'maau' ) ;\");\r\n\r\n\r\n\r\n }", "public static void m1()\r\n\t{ \r\n\t\tUsername.clear();\r\n\t\tPassword.clear();\r\n\t\tId.clear();\r\n\t\ttry{ \r\n\t\tClass.forName(\"com.mysql.jdbc.Driver\"); //driver registration\r\n\t\tConnection con= (Connection) DriverManager.getConnection( \r\n\t\t\"jdbc:mysql://localhost:3306/rakesh\",\"root\",\"\");//this are used to establish connection to the database,so never fiddle with this \r\n\t\t//here sonoo is database name, root is user name and password \r\n\t\t\r\n\t/*\tfor (String object: foodlist) {\r\n\t\t System.out.println(object);\r\n\t\t}\r\n\t\tUsername.forEach(a->out.println(a\\t\\t));*/\r\n\t\t\r\n\t\t\r\n\t\tStatement stmt=(Statement) con.createStatement();//helps in creating a statement \r\n\t\tResultSet rs=(ResultSet) stmt.executeQuery(\"select * from rak\"); //helps to write a query as the statement is allowed\t\t\t\r\n\t\twhile(rs.next()) \r\n\t\t{\r\n\t\t\tUsername.add(rs.getString(\"UserName\"));\r\n\t\t\tPassword.add(rs.getString(\"Password\"));\r\n\t\t\tId.add(rs.getInt(\"id\"));\r\n\t\t}\r\n\t\t\r\n\t\tcon.close(); //to close the connection\r\n\t\t}catch(Exception e){ System.out.println(e);}\r\n\t \r\n\t\t}", "static void searchProductDB() {\n\n int productID = Validate.readInt(ASK_PRODUCTID); // store product ID of user entry\n\n\n productDB.findProduct(productID); // use user entry as parameter for the findProduct method and if found will print details of product\n\n }", "public void runDatabase()\n {\n int option;\n String answer = \"\";\n String filename = (\"myvideos.txt\");\n ArrayList<Movie> movies = new ArrayList<Movie>();\n String lines = file.readText(filename);\n storeFilesToCollection(lines, movies);\n \n while (true)\n {\n Scanner console = new Scanner(System.in);\n boolean valid = false;\n \n while (!valid)\n {\n menu.menu();\n answer = console.nextLine().trim();\n valid = validation.integerMenuValidation(answer);\n }\n \n option = Integer.parseInt(answer);\n \n switch (option)\n {\n case 1:\n searchMovie(movies);break;\n \n case 2:\n addMovie(movies); break;\n \n case 3:\n deleteMovie(movies); break;\n \n case 4:\n displayFavourite(movies);break;\n \n case 5:\n displayMovie(movies);break;\n \n case 6:\n edit(movies);break;\n \n case 7:\n exit(filename, movies);break;\n \n default:\n System.out.println(\"\\n\\t\\tERROR : Invalid Input. Please enter a valid number (1-7) \\n \");\n }\n\n }\n }", "public static void main(String[] args) throws NumberFormatException, IOException, ClassNotFoundException, SQLException {\n\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\tString url=\"jdbc:mysql://localhost:3306/ctspune\";\r\n\t\tConnection conn=DriverManager.getConnection(url,\"root\",\"root\");\r\n\t\t//String query=\"insert into employee values(?,?,?,?,?)\";\r\n\t\t//String query=\"delete from employee where id=?\";\r\n\t\t\r\n\t\tString query=\"select*from employee\";\r\n\t\tPreparedStatement ps=conn.prepareStatement(query);\r\n\t\tResultSet rs=ps.executeQuery(query);\r\n\t\tint i=1;\r\n\t\t\r\n\t\twhile(rs.next())\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Employee\"+i+\"Records\");\r\n\t\t\tSystem.out.println(\"Id\"+rs.getInt(1));\r\n\t\t\tSystem.out.println(\"Name\"+rs.getString(2));\r\n\t\t\tSystem.out.println(\"Address\"+rs.getString(3));\r\n\t\t\tSystem.out.println(\"Age\"+rs.getInt(4));\r\n\t\t\tSystem.out.println(\"Phone\"+rs.getLong(5));\r\n\t\t\ti++;\r\n//\t\t\tint id=rs.getInt(1);//instead of 1 we can also write column name linke rs.getInt(\"id\")\r\n//\t\t\tString name=rs.getString(2);\r\n//\t\t\tString address=rs.getString(3);\r\n//\t\t\tint age=rs.getInt(4);\r\n//\t\t\tlong phone=rs.getLong(5);\r\n//\t\t\tSystem.out.println(id +\":\"+name+\":\"+address+\":\"+age+\":\"+phone);\r\n\t\t}\r\n\t\t}", "public void QuerryData(String sql){\n SQLiteDatabase database = getWritableDatabase();\n database.execSQL(sql);\n }", "public void execute() {\n String input;\n boolean isInputValid;\n\n do {\n isInputValid = true;\n\n System.out.print(\"Please send me the numbers using space between them like \\\"1 2 3\\\": \");\n input = sc.nextLine();\n\n try {\n validateData(input);\n } catch (NumberFormatException e) {\n System.err.println(\"NumberFormatException \" + e.getMessage());\n isInputValid = false;\n }\n\n } while (!isInputValid);\n\n System.out.println(\"Result: \" + find(input));\n }", "public static void main(String[] args) {\n\n // Initialize Database instance:\n HotelDatabase hotelDB = new HotelDatabase();\n Scanner scan = new Scanner(System.in);\n\n // Get the connection:\n hotelDB.username = \"anowilat\";\n hotelDB.password = \"doopee\";\n Connection connection = hotelDB.getConnection(hotelDB.username, hotelDB.password);\n try {\n // Populate DateList and assign generic values to price:\n hotelDB.populateDemo(connection, LocalDate.parse(\"2018-12-01\"), LocalDate.parse(\"2018-12-31\"));\n //hotelDB.searchArea(connection, \"Long Beach\", \"CA\", 94103);\n //hotelDB.createHotel(connection);\n //hotelDB.showTable(connection);\n //hotelDB.searchCustomerReservations(connection, 2);\n //hotelDB.searchHotelReservations(connection, , int branchID, LocalDate checkIn, LocalDate checkOut)\n //hotelDB.searchAvailabilityType(connection, \"Four Seasons Hotel\", 1, \"Single Suite\", LocalDate.parse(\"2018-12-01\"), LocalDate.parse(\"2018-12-01\"));\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n String query,input;\n int numberOfInputs;\n Scanner scan=new Scanner(System.in);\n numberOfInputs=scan.nextInt();\n for(int i=0;i<numberOfInputs;i++){\n query=scan.next();\n if(query.equals(\"add\")){\n input=scan.next();\n add(input);\n }\n if(query.equals(\"find\")){\n input=scan.next();\n find(input);\n }\n }\n\n }", "public List<CustomerModel> readDatabase() throws Exception{\n\nList<CustomerModel> list = new ArrayList<CustomerModel>();\n\ntry{\nlog.info(\"Loading MySql driver\");\nClass.forName(\"com.mysql.jdbc.Driver\");\n\nlog.info(\"Setting up connection with db\");\nconnect= DriverManager.getConnection(\"jdbc:mysql://localhost:3306/apidft\",\"root\",\"cisco\");\nlog.info(\"Database connection successful\");\nstatement = connect.createStatement();\n\nresultSet= statement.executeQuery(\"select * from customer\");\n\nwhile(resultSet.next()){\nlist.add(processRow(resultSet));\n}\n}\n\ncatch(Exception e){\nlog.error(\"Database connection fail\");\n}\n\nfinally{\nconnect.close();\n}\nreturn list;\n}", "private void getTextFromInput() {\n firstName = firstNameField.getText();\n lastName = lastNameField.getText();\n age = ageField.getText();\n email = emailField.getText().toLowerCase();\n }", "public void CRUDOperation() {\n\t\tCRUD: while (true) {\n\n\t\t\tprintCRUDDoctorOption();\n\t\t\tScanner sc = new Scanner(System.in);\n\n\t\t\tString input = sc.nextLine();\n\n\t\t\tswitch (input) {\n\n\t\t\tcase \"1\":\n\t\t\t\tthis.insertDoctor();\n\t\t\t\tbreak;\n\n\t\t\tcase \"2\":\n\t\t\t\tthis.listDoctors();\n\t\t\t\tbreak;\n\n\t\t\tcase \"3\":\n\t\t\t\tthis.updateDoctor();\n\t\t\t\tbreak;\n\n\t\t\tcase \"4\":\n\t\t\t\tthis.deleteDoctor();\n\t\t\t\tbreak;\n\n\t\t\tcase \"5\":\n\t\t\t\tbreak CRUD;\n\n\t\t\tdefault:\n\t\t\t\tlogger.info(\"Invalid Input!\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private Record collectInputs() {\n Record bg = new Record();\n // collect current inputs\n\n\n String inputIn = insulinInput.getText().toString();\n String inputInTy = insulinType.getSelectedItem().toString();\n String inputOthM = otherMed.getText().toString();\n String inputUpBp = bpUpperInupt.getText().toString();\n String inputLoBp = bpLowerInput.getText().toString();\n String inputHr = heartRateInput.getText().toString();\n String inputEx = getSelectedExercise();\n String inputExTM = exTimeM.getText().toString();\n String inputExTh = exTimeH.getText().toString();\n String inputOthEx = otherExercise.getText().toString();\n String inputNote = note.getText().toString();\n\n // blood glucose\n String inputGlucose = bloodGlucoseLevel.getText().toString();\n if (!inputGlucose.isEmpty()) {\n bg.setBloodGlucose(Double.parseDouble(inputGlucose));\n }\n\n // ketone\n String inputKetone = ketoneInput.getText().toString();\n if (!inputKetone.isEmpty()) {bg.setKetone(new Ketone(Double.parseDouble(inputKetone)));}\n else {bg.setKetone(new Ketone());}\n\n // date time\n if (!dateString.isEmpty() && !timeString.isEmpty()) {\n bg.setDate(dateString);\n bg.setTime(timeString);\n String format = getResources().getString(R.string.date_from_format);\n SimpleDateFormat dateFormat = new SimpleDateFormat(format, Locale.CHINA);\n dateTimeString = dateToStore+\" \"+timeString;\n Log.d(TAG,\"format: \"+format+\" datetime: \"+dateTimeString);\n try {\n dateTime = dateFormat.parse(dateTimeString);\n Log.d(TAG,\"formated: \"+dateTime);\n bg.setDateTime(dateTime);\n } catch (ParseException e){\n Log.d(TAG, \"When parsing date and time: \" + e);\n }\n } else {Log.d(TAG, \"date and time inputs are null.\");}\n\n // food\n Food f = new Food();\n f.setMealTag(getFoodTag());\n f.setMealTagTime(getFoodTagTime());\n if (!foodDetail.getText().toString().isEmpty()){\n f.setNote(foodDetail.getText().toString());\n }\n bg.setFood(f);\n\n // if insulin option is not empty, store insulin usage and type. Else store only other med\n if (!inputIn.isEmpty()) {\n bg.setMedication(new Medication(Integer.parseInt(inputIn), inputInTy, inputOthM));\n } else {bg.setMedication(new Medication(inputOthM));}\n // if bp and hr are both not empty, store them\n if (!inputUpBp.isEmpty() && !inputLoBp.isEmpty() && !inputHr.isEmpty()) {\n bg.setBpHr(new BpHr(Integer.parseInt(inputUpBp),Integer.parseInt(inputLoBp),Integer.parseInt(inputHr)));\n } else if (!inputUpBp.isEmpty() && !inputLoBp.isEmpty()) {// store only bp\n bg.setBpHr(new BpHr(Integer.parseInt(inputUpBp),Integer.parseInt(inputLoBp)));\n } else if (!inputHr.isEmpty()) {// store only hr\n bg.setBpHr(new BpHr(Integer.parseInt(inputHr)));\n } else {// store nothing\n bg.setBpHr(new BpHr());\n }\n\n // if exercise time is not empty store all, else only store type and other exercise note\n if (!inputExTM.isEmpty() && !inputExTh.isEmpty()) {\n bg.setExercise(new Exercise(inputEx, Integer.parseInt(inputExTM),Integer.parseInt(inputExTh),inputOthEx));\n } else if (!inputExTM.isEmpty()) { // minute set 0\n bg.setExercise(new Exercise(inputEx, Integer.parseInt(inputExTM),0,inputOthEx));\n } else if (!inputExTh.isEmpty()) { // hour set 0\n bg.setExercise(new Exercise(inputEx, 0,Integer.parseInt(inputExTh),inputOthEx));\n } else {\n bg.setExercise(new Exercise(inputEx, inputOthEx));\n }\n\n if (!inputNote.isEmpty()) {\n bg.setNotes(inputNote);\n } else {bg.setNotes(\"\");}\n\n return bg;\n\n }", "public void Query() {\n }", "public Data() {\n initComponents();\n koneksi_db();\n tampil_data();\n }", "private void Searchdata() {\r\n Connection con;\r\n String searchby;\r\n String sortby;\r\n String keyword;\r\n \r\n searchby = (String)cboSearchby.getSelectedItem();\r\n sortby = (String)cboSortby.getSelectedItem();\r\n keyword = txfSearch.getText();\r\n try {\r\n con = ClassSQL.getConnect();\r\n Statement stmt = con.createStatement();\r\n String sql = Searchstmt(searchby,sortby,keyword);\r\n // System.out.println(sql); //for testing purposes\r\n stmt.executeQuery(sql);\r\n con.close();\r\n } catch (SQLException ex) {\r\n ex.printStackTrace();\r\n } finally {\r\n // Place code in here that will always be run.\r\n }\r\n }", "private void loadEmployeesFromDatabase() {\n Cursor cursor = mDatabase.getAllEmployees();\n\n if (cursor.moveToFirst()) {\n\n usernameholder= cursor.getString(0);\n emailholder= cursor.getString(1);\n usertypeholder=cursor.getInt(2);\n\n\n\n\n\n }\n }", "private void sendData() {\n String Own_Easting = OEast.getText().toString();\n String Own_Northing = ONorth.getText().toString();\n String En_Easting = EEast.getText().toString();\n String En_nothing = ENorth.getText().toString();\n String OTbg = OTBG.getText().toString();\n String rt=Rt.getText().toString();\n String add=Add.getText().toString();\n\n DB bg = new DB(this);\n bg.execute(Own_Easting,Own_Northing,En_Easting,En_nothing\n ,OTbg,rt,add);\n\n }", "private void executeQuery() {\n }", "public void query(String sql) throws SQLException {\r\n Statement st = con.createStatement();\r\n ResultSet rs = st.executeQuery(sql);\r\n\r\n while (rs.next()){\r\n System.out.println(rs.getInt(\"id\")+\" \"+rs.getString(\"name\")+\" \"+rs.getString(\"surname\")+\" \"+rs.getFloat(\"grade\"));\r\n }\r\n\r\n }", "public static void main(String[] args) throws IOException, SQLException {\n\t\treadFile rf = new readFile();\n\t\trf.create();\n\t\trf.readData();\n\t\t//String sql = \"select * from examSelect\";\n\t\t//rf.select(sql);\n//\t\trf.test();\n\t\t//rf.readItem();\n\t}", "public static void main(String[] args) {\n\n DAOManager m = new DAOManager();\n ArrayList<Person> pList = m.selectPerson1();\n\n\n\n for (Person person : pList) {\n System.out.println(person.toString());\n\n }\n }", "@Override\n\tpublic void input() {\n\t\tUser u =new User();\n\t\tif(list.size() <= MAX_USER) {\n\t\tSystem.out.print(\"이름 입력 : \");\n\t\tu.setName(sc.next());\n\t\tSystem.out.print(\"나이 입력 : \");\n\t\tu.setAge(sc.nextInt());\n\t\tSystem.out.print(\"주소 입력 : \");\n\t\tu.setAddr(sc.next());\n\t\tlist.add(u);\n\t\t\n\t\t}else if(list.size() > MAX_USER) {\n\t\t\tSystem.out.println(\"최대 등록 인원은 10명입니다.\");\n\t\t}\n\t}", "private void view() {\n\n\t\ttry {\n\t\t\tString databaseUser = \"blairuser\";\n\t\t\tString databaseUserPass = \"password!\";\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\t\t\tConnection connection = null;\n\t\t\tString url = \"jdbc:postgresql://13.210.214.176/test\";\n\t\t\tconnection = DriverManager.getConnection(url, databaseUser, databaseUserPass);\n//\t\t\tStatement s = connection.createStatement();\n\t\t\ts = connection.createStatement();\n\t\t\tResultSet rs = s.executeQuery(\"select * from account;\");\n\t\t\t// while (rs.next()) {\n\t\t\tString someobject = rs.getString(\"name\") + \" \" + rs.getString(\"password\");\n\t\t\tSystem.out.println(someobject);\n\t\t\toutput.setText(someobject);\n\t\t\t// output.setText(rs);\n\t\t\t// System.out.println(rs.getString(\"name\")+\" \"+rs.getString(\"message\"));\n\t\t\t// rs.getStatement();\n\t\t\t// }\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e.getMessage());\n\t\t}\n\t\tPostgresJDBC();\n\t}", "private void getUserInput() {\n getUserTextInput();\n getUserPhotoChoice();\n getUserRoomChoice();\n getUserBedroomsChoice();\n getUserBathroomsChoice();\n getUserCoownerChoice();\n getUserIsSoldChoice();\n getUserTypeChoice();\n mAmenitiesInput = Utils.getUserAmenitiesChoice(mBinding.chipGroupAmenities.chipSchool,\n mBinding.chipGroupAmenities.chipShop, mBinding.chipGroupAmenities.chipTransport,\n mBinding.chipGroupAmenities.chipGarden);\n }", "public static void main(String[] args) throws SQLException {\n\t\tConnection con = getCon();\r\n\t\tStatement stmt = con.createStatement();\r\n\t\tMap<String, String> maps = new HashMap<String, String>();\r\n\t\tmaps.put(\"word\", \"String\");\r\n\t\tmaps.put(\"user\", \"String\");\r\n\t\tmaps.put(\"tfidf\", \"String\");\r\n//\t\tdropTable(con, \"hivetest324\");\r\n//\t\tSystem.out.println(createTable(con, \"hivetest324\", maps));\r\n\t\tString sql = \"select num from mytest\";\r\n\t\tselectTable(con, sql);\r\n\t\t\r\n//\t\tsql = \"load data local inpath 'E:/work/tfidf' overwrite into table tfidf\";\r\n//\t\tSystem.out.println(loadData(con, sql));\r\n\t\t\r\n//\t\tsql = \"show tables\";\r\n//\t\tResultSet res = stmt.executeQuery(sql);\r\n//\t\twhile(res.next()){\r\n//\t\t\tSystem.out.println(res.getString(1));\r\n//\t\t}\r\n\t}", "public static void main(String[] args) {\n DB_Utility.createConnection(\"dev\");\n\n\n// Run query \"SELECT * FROM EMPLOYEES\"\n//\n DB_Utility.runQuery(\"select * from SPARTANS\");\n//\n//// 1. Display all data in console\n// DB_Utility.displayAllData();\n//\n//// 2. Print column count\n// System.out.println(\"DB_Utility.getColumnCNT() = \" + DB_Utility.getColumnCNT());\n//\n//// 3. Print row count\n// System.out.println(\"DB_Utility.getRowCount() = \" + DB_Utility.getRowCount());\n//\n//// 4. Print out 3rd row data as a list\n// System.out.println(\"DB_Utility.getRowDataAsList(3) = \"\n// + DB_Utility.getRowDataAsList(3));\n//\n//// 5. Print out 2nd column data as a list\n// System.out.println(\"DB_Utility.getColumnDataAsList(2) = \"\n// + DB_Utility.getColumnDataAsList(2));\n//\n//// 6, Print out Name column data as a list\n// System.out.println(\"DB_Utility.getColumnDataAsList(\\\"NAME\\\") = \"\n// + DB_Utility.getColumnDataAsList(\"NAME\"));\n//\n//// 7, Print out 4th row as a Map\n// System.out.println(\"DB_Utility.getRowMap(4) = \"\n// + DB_Utility.getRowMap(4));\n\n//// 8, Print out the data at row 5, column 1\n System.out.println(\"DB_Utility.getColumnDataAtRow(5,1) = \"\n + DB_Utility.getColumnDataAtRow(5, 1));\n\n//// 9, Print out the data at row 53, phone column\n System.out.println(\"DB_Utility.getColumnDataAtRow(53,\\\"PHONE\\\") = \"\n + DB_Utility.getColumnDataAtRow(53, \"PHONE\"));\n//\n//\n//// 10. Print out all the data as List of Map\n System.out.println(\"DB_Utility.getAllDataAsListOfMap() = \"\n + \"\\n\"+DB_Utility.getAllDataAsListOfMap()+\"\\n\");\n\n\n }", "public static void main(String[] args) {\n Connection conn = null;\n Statement s;\n ResultSet rs = null;\n String dbName = \"myDB\";\n String url = protocol + dbName + \";create=true\";\n\n try {\n // create a connection object\n conn = DriverManager.getConnection(url);\n // somewhere to put our SQL statements\n s = conn.createStatement();\n // declare some SQL statements\n String createTable = \"CREATE TABLE MYTABLE ( ID INT PRIMARY KEY, NAME VARCHAR(12) )\";\n String insertData = \"INSERT INTO MYTABLE VALUES (10, 'TEN'), (20, 'TWENTY'), (30, 'THIRTY')\";\n String readData = \"SELECT * FROM MYTABLE\";\n String dropTable = \"DROP TABLE MYTABLE\";\n\n // execute SQL statements\n s.execute(createTable);\n s.execute(insertData);\n rs = s.executeQuery(readData);\n while (rs.next()){\n // get values as int, string etc.\n System.out.println(rs.getInt(1) + \"\\t\" + rs.getString(2));\n }\n\n // drop the table\n s.execute(dropTable);\n\n }\n catch(SQLException sqle) {\n System.out.println(sqle);\n }\n finally {\n\n }\n\n\n\n\n\n\n\n\n\n }", "public static void main(String[] args) {\n\t\tint choice;\n\t\tScanner s=new Scanner(System.in);\n\t\tdatabase db=new database();\n\t\tchar c;\n\t\t\n\t\tdo {\n\t\t\n\t\tSystem.out.println(\"press 1 to view all books\");\n\t\tSystem.out.println(\"press 2 to search book by title\");\n\t\tSystem.out.println(\"press 3 to insert a book\");\n\t\tSystem.out.println(\"press 4 to delete book\");\n\t\tSystem.out.println(\"press 5 to update the book\");\n\t\tSystem.out.println(\"press 6 to exit\");\n\t\t\n\t\tchoice=s.nextInt();\n\t\tswitch(choice)\n\t\t{\n\t\tcase 1:\n\t\t\t\n\t\t\tdb.showDetails();\n\t\t\t break;\n\t\tcase 2:\n\t\t\tSystem.out.println(\"enter the title of book\");\n\t\t\tString name=s.next();\n\t\t\tdb.viewByname(name);\n\t\t\tbreak;\n\t\t\t\n\t\tcase 3:\n\t\t System.out.println(\"enter the book id\");\n\t\t int id1=s.nextInt();\n\t\t System.out.println(\"enter the book name\");\n\t\t String name1=s.next();\n\t\t System.out.println(\"enter the author name\");\n\t\t String author=s.next();\n\t\t System.out.println(\"enter the book price\");\n\t\t double price=s.nextDouble();\n\t\t Book ib=new Book(id1,name1,author,price);\n\t\t db.insert(ib);\n\t\t \n\t\t break;\n\t\t \n\t\tcase 4:\n\t\t\tSystem.out.println(\"enter the id of the book you want to delete\");\n\t\t\tint id9=s.nextInt();\n\t\t\tdb.delete(id9);\n\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\tcase 5:\tSystem.out.println(\"enter the id of the book you want to update\");\n\t\t int id5=s.nextInt();\n\t\t System.out.println(\"enter the new price\");\n\t\t double price1=s.nextDouble();\n\t\t \n\t\t db.update(id5,price1);\n\t\t System.out.println(\"updated successfully\");\n\t\t\t\n\t\tcase 6:\n\t\t\tdefault:\n\t\t\t \n\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"press y for menu:\");\n\t\tc=s.next().charAt(0);\n\t\t\n\t\t\n\t\t\n\n\t}while(c=='Y' || c=='y');\n\n}", "private void GetData(){\n try {\n Connection conn =(Connection)app.pegawai.Database.koneksiDB();\n java.sql.Statement stm = conn.createStatement();\n java.sql.ResultSet sql = stm.executeQuery(\"select * from user\");\n data.setModel(DbUtils.resultSetToTableModel(sql));\n\n }\n catch (SQLException | HeadlessException e) {\n }\n}", "private void insertOperator() {\n int rowsAff = 0;\n int counter = 0;\n String query = \"\";\n System.out.print(\"Table: \");\n String table = sc.nextLine();\n System.out.print(\"Comma Separated Columns: \");\n String cols = sc.nextLine();\n System.out.print(\"Comma Separated Values: \");\n String[] vals = sc.nextLine().split(\",\");\n //transform the user input into a valid SQL insert statement\n query = \"INSERT INTO \" + table + \" (\" + cols + \") VALUES(\";\n for (counter = 0; counter < vals.length - 1; counter++) {\n query = query.concat(\"'\" + vals[counter] + \"',\");\n }\n query = query.concat(\"'\" + vals[counter] + \"');\");\n System.out.println(query);\n rowsAff = sqlMngr.insertOp(query);\n System.out.println(\"\");\n System.out.println(\"Rows affected: \" + rowsAff);\n System.out.println(\"\");\n }", "private void callForRecords() throws SQLException, NumberFormatException, ClassNotFoundException{\n\t\tResultSet rs;\n\t\toutputTA.setText(\"PURCHASE ID\"\n\t\t\t\t+\"\\t\"+\"| CUSTOMER\"\n\t\t\t\t+\"\\t\\t\"+\"| NO. OF ITEMS\"\n\t\t\t\t+\"\\t\"+\"| AMOUNT\"\n\t\t\t\t+\"\\t\"+\"| MODE OF PAYMENT\"\n\t\t\t\t+\"\\t\"+\"| TIME OF PURCHASE\"\n\t\t\t\t+\"\\n\");\n\t\tif(custTypeCB.getSelectedIndex() == 3)\n\t\t\trs = dBConnection.getRecords(Integer.parseInt(custIdTF.getText()));\n\t\telse\n\t\t\trs = dBConnection.getRecords(custTypeCB.getSelectedIndex());\n\t\t\n\t\twhile(rs.next()){\n\t\t\tString name = rs.getString(2);\n\t\t\t\n\t\t\t//trick to make all name length same so that they line up correctly in output textarea.\n\t\t\tif(name.length()<20){\n\t\t\t\tint spacesRequired = 20 - name.length();\n\t\t\t\tfor(int i = 0; i< spacesRequired; i++)\n\t\t\t\t\tname.concat(\" \");\n\t\t\t}\n\t\t\t\n\t\t\toutputTA.append(\"_________________________________________________________________\"\n\t\t\t\t\t+ \"___________________________________________\\n\");\n\t\t\toutputTA.append(rs.getString(1)\n\t\t\t\t\t+\"\\t \"+name\n\t\t\t\t\t+\"\\t\\t \"+rs.getString(3)\n\t\t\t\t\t+\"\\t \"+rs.getString(4)\n\t\t\t\t\t+\"\\t \"+rs.getString(5)\n\t\t\t\t\t+\"\\t\\t \"+rs.getString(6)+\"\\n\");\n\t\t}\n\t\tdBConnection.disconnect();\n\t}", "@ActionKey(\"db\")\n\tpublic void testDB() {\n\t\tUser user = User.dao.findById(1, \"qword_id\");\n\t\trenderText(\"data in database:\" + user.getStr(\"qword_id\"));\n\t\t\n\t}", "public static void main(String[] args) throws SQLException {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint choice;\n\t\tBookStoreSystemManager obj=new BookStoreSystemManager();\n\t\twhile(true){\n\t\t\ttry{\n\t\t\t\tdo{\n\t\t\t\t\tSystem.out.println(\" XYZ Book Store \");\n\t\t\t\t\tSystem.out.println(\"------------------------\");\n\t\t\t\t\tSystem.out.println(\"1. Display Book Details\");\n\t\t\t\t\tSystem.out.println(\"2. Purchase a book\");\n\t\t\t\t\tSystem.out.println(\"3. Exit\");\n\t\t\t\t\tSystem.out.print(\"Enter the choice:\");\n\t\t\t\t choice=scan.nextInt();\n\t\t\t\t if(choice<1 || choice>3){\n\t\t\t\t \t throw new InputMismatchException(\"dump\");\n\t\t\t\t }\n\t\t\t\t if(choice==1){\n\t\t\t\t System.out.println(\"-------------------------\");\n\t\t\t\t System.out.println(\"Available Book Categories\");\n\t\t\t\t System.out.println(\"-------------------------\");\n\t\t\t\t \n\t\t\t\t obj.getCategory();\n\t\t\t\t\t}\n\t\t\t\t\tif(choice==2){\n\t\t\t\t System.out.println(\"--------------------------\");\n\t\t\t\t System.out.println(\" Purchase Book \");\n\t\t\t\t System.out.println(\"--------------------------\");\n\t\t\t\t \n\t\t\t\t obj.getpurchase();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}while(choice!=3);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcatch(InputMismatchException e){\n\t\t\t\tSystem.out.println(\"Wrong Input Entered\");\n\t\t\t\tscan=new Scanner(System.in);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "private void TampilData(){\n try{ //\n String sql = \"SELECT * FROM buku\"; // memanggil dari php dengan tabel buku\n stt = con.createStatement(); // membuat statement baru dengan mengkonekan ke database\n rss = stt.executeQuery(sql); \n while (rss.next()){ \n Object[] o = new Object [3]; // membuat array 3 dimensi dengan nama object\n \n o[0] = rss.getString(\"judul\"); // yang pertama dengan ketentuan judul\n o[1] = rss.getString(\"penulis\"); // yang kedua dengan ketentuan penulis\n o[2] = rss.getInt(\"harga\"); // yang ketiga dengan ketentuan harga\n model.addRow(o); // memasukkan baris dengan mengkonekan di tabel model\n } \n }catch(SQLException e){ // memanipulasi kesalahan\n System.out.println(\"ini error\"); // menampilkan pesan ini error\n }\n }", "public static void main(String[] args) throws Exception {\n\n\n sqliteDatabase.createDatabase();\n\n login.user_interface();\n\n //gridMovies.Frame();\n\n //createAccount.create();\n\n /*ResultSet res =Database.getData(\"SELECT * FROM users WHERE user_mail='[email protected]'\");\n\n while (res.next()){\n System.out.println(res.getString(\"user_name\")+ \" \"+ res.getString(\"user_password\"));\n }*/\n }", "public void updatedata()throws ClassNotFoundException,SQLException {\n\t\tScanner s=new Scanner(System.in);\r\n\t\tStatement smt=(Statement) con.getConnection().createStatement();\r\n\t\tSystem.out.println(\"Enter Id:\");\r\n\t\tint rollno=s.nextInt();\r\n\t\tSystem.out.println(\"Enter new name:\");\r\n\t\tString name=s.next();\r\n\t\t//System.out.println(\"Enter new year:\");\r\n\t\t//String year=s.next();\r\n\t\t//System.out.println(\"Enter new Department:\");\r\n\t\t//String dep=s.next();\r\n\t\tPreparedStatement ps=con.getConnection().prepareStatement(\"update student set Name=? where RollNo=?\");\r\n\t\tps.setString(1, name);\r\n\t\tps.setInt(2, rollno);\r\n\t\tps.executeUpdate();\r\n\t\tSystem.out.println(\"Successfully Updated...\");\r\n\t}", "private void insertFields()\n {\n RideDetails details=new RideDetails();\n details.setStartPt(editStartingPt.getText().toString());\n details.setEndPt(editEndingPt.getText().toString());\n\n try {\n details.setTravelDate(dateFormatter.parse(editDate.getText().toString()));\n\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n details.setNoSpot(Integer.parseInt(editNoSpot.getText().toString()));\n\n\n dbOperations(details);\n\n }", "public void ViewAllData(View v){\n Cursor res = myDB.viewAllData();\n // if there are no data\n if (res.getCount() == 0) {\n // show an error message\n showMessage(\"Error\", \"Nothing found\");\n return;\n }\n\n StringBuffer buffer = new StringBuffer();\n while(res.moveToNext()){\n buffer.append(\"Id :\" + res.getString(0) + \"\\n\");\n buffer.append(\"Name :\" + res.getString(1) + \"\\n\");\n buffer.append(\"Surname :\" + res.getString(2) + \"\\n\");\n buffer.append(\"Marks :\" + res.getString(3) + \"\\n\\n\");\n }\n\n // then show all the data inside the buffer\n showMessage(\"Data\", buffer.toString());\n }", "public static void main(String[] args) {\ntry{ \r\n\t\t\t\r\n\t\t\tConnection con=DriverManager.getConnection( \r\n\t\t\t\"jdbc:mysql://localhost:3306/savion\",\"root\",\"root@0412\"); \r\n\t\t\tStatement stmt=con.createStatement(); \r\n\t\t\tResultSet rs=stmt.executeQuery(\"select uid,username from userdetails\"); \r\n\t\t\twhile(rs.next()) \r\n\t\t\tSystem.out.println(rs.getInt(1)+\" \"+rs.getString(2)); \r\n\t\t//\tstmt.executeUpdate(\"INSERT INTO userdetails \" + \"VALUES (2,'Savio','1243',48448)\");\r\n\t\t//\tcon.commit();\r\n\r\n}\r\n\t\tcatch(Exception e){\r\n\t\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\r\n\t}", "String getBarcharDataQuery();", "public static void main(String[] args) throws IOException, SQLException {\n\n\t\t \n\t\t Operationclass database=new Operationclass();\n\t\t \n\t\t //database.opendb();\n\t\t \n//\t List<songaristandalbum> list=database.getcompletedetails();\n//\t for(songaristandalbum obj:list) {\n//\t\t \n//\t\t System.out.println(obj.getArtistname()+\" \"+obj.getAlbumname()+\" \"+obj.getsongTitle());\n//\t\t \n//\t\t \n//\t\t }\n// System.out.println(database.getcount());\n// \n// \n// database.displayalbums();\n// \n// System.out.println(\" Enter the album name \");\n// \n// String albumname=sc.next(); \n// \n// List<songofalbums>list=database.getcompletelistofsongs(albumname);\n// System.out.println(list);\n//\n//for(songofalbums obj:list) {\n//\t\n//\tSystem.out.println(obj.getSongname());\n//}\n \n\n\t\t \n\t\tdatabase.insertnewsong(\"Trampoline\", \"Zayn malik\", \"Tramp\", 1);\n \n \n database.displayartist();\n \n \n \n \n \n\t}", "public void showData()\n\t\t{\n\t\t\ttry {\n\t\t\t\tcon=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/MundheElectronics1\",\"root\",\"vishakha\");\n\t\t\t\tString sql=\"select *from ComplaintsData\";\n\t\t\t\tps=con.prepareStatement(sql);\n\t\t\t\trs=ps.executeQuery();\n\t\t\t\ttable.setModel(DbUtils.resultSetToTableModel(rs));\n\t\t\t\t\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public static void main(String[] args) throws SQLException {\n\t\tDeptHandler d=new DeptHandler();\r\n\t\tVector<String> input=new Vector<>();\r\n\t\tinput.add(\"100\");\r\n\t\tinput.add(\"수원점\");\r\n\t\tinput.add(\"수원\");\r\n\t\tinput.add(\"031-333-3333\");\r\n\t\tinput.add(\"202\");\r\n\t\t\r\n\t\td.InsertRow(input);\r\n\t\t//d.deleteRow(100);\r\n\t\tVector<String> update=new Vector<>();\r\n\t\tupdate.add(\"100\");\r\n\t\tupdate.add(\"\");\r\n\t\tupdate.add(\"서울\");\r\n\t\tupdate.add(\"02-333-3333\");\r\n\t\tupdate.add(\"\");\r\n\t\td.updateRow(100,update);\r\n\t\t\r\n\r\n\t}", "@Override\n protected void runCommand(String input) {\n for (FlowTableEntry entry : core.getFlowTable()){\n log(entry.toString());\n }\n\n }", "public void readData() {\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"Enter employee ID \");\n int id = sc.nextInt();\n System.out.println(\"Enter Employee name \");\n String name = sc.next();\n System.out.println(\"Enter Employee salary \");\n double salary = sc.nextDouble();\n\n employeePayrollDataList.add(new EmployeePayrollData(id, name, salary));\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdoQuery();\n\t\t\t}", "public java.util.List<Object> execute(java.util.List<Object> inputData);", "public static void main(String[] args) {\n\t\tint id, year, ton;\n\t\tString name;\n\t\tResultSet rs;\n\t\t\n\t\tMySQL mysql = new MySQL();\n\t\t//テーブルから情報をもってくる\n\t\trs = mysql.selectAll();\n\t\t\n\t\tint []tonArray = new int[20]; //量\n\t\tString []nameArray = new String[20]; //名前\n\t\tString []yearArray = new String[20]; //年\n\t\tint count = 0; //行列の何番目か\n\t\tint rslen = 0; //行列の長さ\n\t\t\n\t\ttry {\n\t\t\twhile(rs.next()) {\n\t\t\t\tid = rs.getInt(\"id\");\n\t\t\t\trslen = id;\n\t\t\t\tname = rs.getString(\"name\");\n\t\t\t\tnameArray[count] = name;\n\t\t\t\tyear = rs.getInt(\"year\");\n\t\t\t\tyearArray[count] = Integer.toString(year);\n\t\t\t\tton = rs.getInt(\"ton\");\n\t\t\t\ttonArray[count] = ton;\n\t\t\t\tSystem.out.println(\"ID:\" + id);\n\t\t\t\tSystem.out.println(\"name:\" + name);\n\t\t\t\tSystem.out.println(\"year:\" + year);\n\t\t\t\tSystem.out.println(\"ton:\" + ton);\n\t\t\t\tSystem.out.println(tonArray[count] + nameArray[count] + yearArray[count]);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tDBconnect_view view = new DBconnect_view(rslen, tonArray, nameArray, yearArray);\n\t\tview.setBounds(5, 5, 755, 475);\n\t\tview.setVisible(true);\n\n\t}", "public void loadQuestions() \n {\n try{\n ArrayList<QuestionPojo> questionList=QuestionDao.getQuestionByExamId(editExam.getExamId());\n for(QuestionPojo obj:questionList)\n {\n qstore.addQuestion(obj);\n }\n }\n catch(SQLException ex)\n {\n JOptionPane.showMessageDialog(null, \"Error while connecting to DB!\",\"Exception!\",JOptionPane.ERROR_MESSAGE);\n ex.printStackTrace();\n\n }\n }", "public static void main(String[] args) {\n try (Connection connection = ConnectorDB.getConnection();\n Statement statement = connection.createStatement()) {\n dropTablesFromDatabase(statement);\n createTablesInDatabase(statement);\n addObjectsInList();\n insertListsInDataBase();\n } catch (SQLException e) {\n System.out.println(\"Error connection/sql query\" + e);\n e.printStackTrace();\n }\n }", "private void getScholsFromDatabase() {\n schols = new Select().all().from(Scholarship.class).execute();\n }", "void setDataFromDBContent() {\n\n }", "public static void main(String[] args) {\n Connection conn = null;\n Statement s;\n ResultSet rs = null;\n String dbName = \"myDB\";\n String url = protocol + dbName + \";create=true\";\n\n try {\n // create a connection object\n conn = DriverManager.getConnection(url);\n // somewhere to put our SQL statements\n s = conn.createStatement();\n // declare some SQL statements\n String createTable = \"CREATE TABLE IMAGETABLE \" +\n \"( ID INT PRIMARY KEY, \" +\n \"FILENAME VARCHAR(32), \" +\n \"PHOTOGRAPHER VARCHAR(32), \" +\n \"CATEGORY VARCHAR(32),\" +\n \"DESCRIPTION VARCHAR(32) )\";\n String insertData = \"INSERT INTO IMAGETABLE\" +\n \" VALUES \" +\n \" (1, 'animals01', 'Emily Kim', 'animals', 'some creature'),\" +\n \" (2, 'city02', 'Ada Long', 'city', 'some place'),\" +\n \" (3, 'people03', 'Fred Hoyle', 'people', 'some person')\";\n String readData = \"SELECT * FROM IMAGETABLE\";\n\n // execute SQL statements\n //s.execute(createTable);\n //s.execute(insertData);\n rs = s.executeQuery(readData);\n while (rs.next()){\n System.out.println(\"\" + rs.getInt(1)\n +\"\\t\"+rs.getString(2)\n +\"\\t\"+rs.getString(3)\n +\"\\t\"+rs.getString(4)\n );\n }\n }\n catch(SQLException sqle) {\n System.out.println(sqle);\n }\n finally {\n\n }\n\n\n\n\n\n\n\n\n\n }", "private void populateFromDatabase() throws Exception {\n ResultSet results = database.select(\"AnswerOptions\", \"*\", \"optionId = \" + this.optionId);\n while (results.next()) {\n this.questionId = results.getInt(\"questionId\");\n this.option = results.getString(\"option\");\n this.position = results.getInt(\"matchingPosition\");\n }\n database.closeConnection();\n }", "static ResultSet dataOphalen(String querry) {\n //declaratie anders kan er niks worden gereturnt\n ResultSet rs = null;\n try {\n Statement stmt = connectieMaken().createStatement(); //\n rs = stmt.executeQuery(querry);\n } catch (SQLException se) {\n se.printStackTrace();\n }\n return rs;\n }", "public void init () throws IOException , GateException {\n conn = getConnection(db); \n Gate.init();\n\n String query = \"SELECT \" + db.idcol + ',' + db.textcol + \" FROM \" + db.table;\n if(db.where != null && !\"\".equals(db.where)){\n query = query + \" WHERE \" + db.where;\n }\n log.debug(\"attempting to prepare query: \"+ query);\n\n // fetch a resultset \n try{\n PreparedStatement stmt = conn.prepareStatement(query);\n rs = stmt.executeQuery();\n } catch(SQLException e){\n log.error(\"Problem running SQL query\", e);\n System.exit(5);\n }\n }", "public void buildConsultantData(){\r\n // Connect to database and perform select query on user table\r\n Database db = new Database();\r\n Connection connection = null;\r\n try{\r\n connection = db.jdbc_connection.connect();\r\n Statement statement = connection.createStatement(); // Set up statement\r\n \r\n String sql = \"SELECT userID, userName FROM user\";\r\n ResultSet results = statement.executeQuery(sql); \r\n \r\n while(results.next()) { \r\n int id = results.getInt(\"userID\");\r\n String name = results.getString(\"userName\");\r\n \r\n User user = new User(id, name);\r\n user_list.add(user);\r\n }\r\n \r\n combo_user.setItems(user_list);\r\n \r\n }catch(Exception e) {\r\n System.out.println(e.getMessage());\r\n }finally {\r\n try {\r\n connection.close();\r\n } catch (Exception e2) { // Closing databse error handling\r\n System.err.println(e2.getMessage());\r\n }\r\n } \r\n }", "private void prepareData() throws InputException {\n String dia_db = getDate(dia.getValue());\n int semana_db = getWeek(dia_db);\n hrs = horas.getText();\n\n if (hrs.length() > 0) {\n horasDB = Integer.parseInt(String.valueOf(horas.getText()));\n } else {\n throw new InputException(\"Hora deve ser um valor entre 0 e 24\");\n }\n\n if( horasDB <= 0 || horasDB > 24 || hrs == null){\n throw new InputException(\"Hora deve ser um valor entre 0 e 24\");\n }\n\n TI ti_db = new TI(dia_db, semana_db, horasDB);\n Atividade atividade_db = null;\n int operation = INVALIDO;\n\n atividadeEscolhida = atividade.getSelectedItem().toString();\n if (atividadeEscolhida.equals(getString(R.string.nova_atividade))) {\n nomeAtividadeDB = nomeAtividade.getText().toString();\n if(nomeAtividadeDB.trim().equals(\"\")){\n throw new InputException(\"Nome da Atividade Inválido!\");\n }\n Categoria categoria_db = null;\n if(categoria.getValue() == TRABALHO) {\n categoria_db = Categoria.TRABALHO;\n } else if (categoria.getValue() == LAZER) {\n categoria_db = Categoria.LAZER;\n }\n\n Prioridade prioridade_db = null;\n int item_prioridade = prioridade.getSelectedItemPosition();\n if(item_prioridade == BAIXA) {\n prioridade_db = Prioridade.BAIXA;\n } else if (item_prioridade == MEDIA) {\n prioridade_db = Prioridade.MEDIA;\n } else if (item_prioridade == ALTA) {\n prioridade_db = Prioridade.ALTA;\n }\n\n operation = INSERIR;\n atividade_db = new Atividade(nomeAtividadeDB, categoria_db, prioridade_db, null);\n } else {\n operation = ATUALIZAR;\n atividade_db = mAtividade;\n }\n\n saveData(operation, atividade_db, ti_db);\n }" ]
[ "0.59852", "0.5963411", "0.5951887", "0.5925442", "0.58282083", "0.5749472", "0.5724736", "0.5719958", "0.56824154", "0.5618596", "0.5617615", "0.56081194", "0.55990493", "0.55906326", "0.5578596", "0.55546683", "0.5552713", "0.55150765", "0.5514367", "0.55121315", "0.5502864", "0.54856694", "0.5480479", "0.5476363", "0.54711396", "0.5468905", "0.5457449", "0.5401985", "0.5395859", "0.53630996", "0.5354701", "0.53479975", "0.53296524", "0.5325093", "0.5323404", "0.5321771", "0.5317286", "0.53106236", "0.53083986", "0.52953744", "0.5293746", "0.52921623", "0.52902496", "0.52870697", "0.52803695", "0.5273478", "0.5272901", "0.52586746", "0.52585524", "0.52576095", "0.5241907", "0.5235196", "0.52348274", "0.5233539", "0.52287763", "0.52247596", "0.52211875", "0.5216615", "0.52140343", "0.52115697", "0.52020323", "0.51959157", "0.5189499", "0.51885605", "0.5182496", "0.51818085", "0.51788884", "0.51765764", "0.5172397", "0.5171148", "0.5167275", "0.5166711", "0.5157233", "0.5150182", "0.5148293", "0.51459676", "0.5143022", "0.51413727", "0.5139785", "0.5134868", "0.5131487", "0.5131458", "0.5127928", "0.5119345", "0.51192987", "0.51131946", "0.5109821", "0.51080173", "0.5106681", "0.510519", "0.5104132", "0.51024115", "0.5094023", "0.5092761", "0.5091214", "0.50902367", "0.50836277", "0.50813276", "0.5075229", "0.50735", "0.5072758" ]
0.0
-1
Method for returning string of the whole order
String getOrderSummary(){ String s = ""; for (Pizza p : pizzas) { s += p.getInfo() + "\n"; } return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String traverseForToString() {\n\t\tif (this.root != null)\n\t\t\tpreorderTraverseForToString(this.root);\n\n\t\treturn this.order;\n\t}", "public String toString(){\n //return myString(root);\n printInOrder(root);\n return \"\";\n }", "public String showCurrentOrder(){\n stringBuilder = new StringBuilder();\n for (int i = 0; i < OrderManager.getInstance().getOrder().size(); i++) {\n stringBuilder.append((i + 1) + \". \" + OrderManager.getInstance().getOrder().get(i).toString() + \"\\n\");\n }\n return stringBuilder.toString();\n }", "public String toStringOrder(){\n\t\treturn \" CustomerID: \" + customerID + \"\\n Name: \" + name + \"\\n Address: \" + address + \"\\n Email: \" + email + \"\\n\\n\";\n\t}", "public String listOfOrders() {\r\n\t\t StringBuilder sb = new StringBuilder();\r\n for (Iterator<Order> it = orders.iterator(); it.hasNext();){\r\n\t\t\t Order o = (Order) it.next();\r\n \t sb.append(o.toString() + NL);\r\n }\r\n return sb.toString();\r\n }", "public String toString() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int key: levelOrder())\n\t\t\tsb.append (key + \" \");\n\t\treturn sb.toString ();\n\t}", "public String toString()\n\t{\n\t\treturn postOrder().toString();\n\t}", "public String displayOrderList(){\r\n // display = addFood() + \"\\n\" + addDrink() + \"\\n\" + addDessert();\r\n ArrayList<String> output = new ArrayList<>(); \r\n for(int i =0; i < allOrder.size(); i++){\r\n output.add(allOrder.get(i));\r\n }\r\n return String.valueOf(output);\r\n }", "private String getOrderReport() {\n String result = \"Number of items in order: \" + items.size() + System.getProperty(\"line.separator\") +\n \"List of items: \" + System.getProperty(\"line.separator\");\n for (Item i : items) {\n result += i.getListOfPlants();\n }\n result += \"Total price: \" + calculateTotalPrice() + System.getProperty(\"line.separator\") +\n \"Delivery strategy: \" + delivery.toString() + System.getProperty(\"line.separator\") +\n \"Payment strategy: \" + payment.toString();\n return result;\n }", "@Override\n\tpublic String toString(){\n\t\tString out = \"\";\n\t\tfor (Order o : orders){\n\t\t\tout += o.toString() + \"\\n\";\n\t\t}\n\t\treturn out;\n\t}", "public String formatedMenuOrderByName(){\n Random random = new Random();\n int randomIndex = random.nextInt(Pizza.values().length);\n Pizza pizzaOfTheDay = Pizza.values()[randomIndex];\n\n return Arrays.stream(Pizza.values())\n .sorted(comparing(Pizza::getName))\n .map(pizza -> String.format(\n \"%15s (%-90s) %5s %4s - %5.2f zł %1s\",\n pizza.getName(),\n pizza.getIngredients().stream().map(Ingredient::getName).collect(Collectors.joining(\", \")),\n pizza.getIngredients().stream().anyMatch(Ingredient::isSpicy) ? \"ostra\" : \"\",\n pizza.getIngredients().stream().noneMatch(Ingredient::isMeat) ? \"wege\" : \"\",\n pizza.equals(pizzaOfTheDay) ? (double) calculatePizzaPrice(pizza) * 0.5 : (double) calculatePizzaPrice(pizza),\n pizza.equals(pizzaOfTheDay) ? \"*\" : \"\"\n ))\n// .sorted(Comparator.comparing(pizza -> pizza.trim()))\n .collect(Collectors.joining(\"\\n\"));\n }", "public String generateString() {\n List<Trip<String, String, String>> sequence = super.generateSequence(startTrip, endTrip);\n sequence = sequence.subList(1, sequence.size()-1);\n String generated = \"\";\n for (int i = 0; i<sequence.size()-2; i++) generated += sequence.get(i).getThird() + \" \";\n return generated.substring(0, generated.length()-1);\n }", "private String getOrderCode(int pkgCode){\n\t\tint a = pkgCode ;\n\t\tint b = a/10 ;\n\t\tint c = b*10 ;\n//\t\tSystem.out.println(c);\n\t\treturn c+\"\" ;\n\t}", "public String toString() {\n String result = \"\";\n // for each item in stock\n for (int i = 0; i < this._noOfItems; i++) {\n // add \\n (line down) for prev. item if it's not the first item\n if (i > 0)\n result += \"\\n\";\n // add it's toString result to the final result string\n result += this._stock[i].toString();\n }\n return result;\n }", "public String sortOriginOrReturn();", "public String print() {\n Collections.sort(ordini, Comparator.comparing(o -> o.dataAcquisto));\n return ordini.stream()\n .map(o->o.toString()+\"\\n\")\n .reduce(String::concat).orElse(\"\");\n }", "java.lang.String getOrderBy();", "@Override\r\n\tpublic String toString() {\r\n\t\tIterator<HuffmanPair> temp;\r\n\t\tString result = \"\";\r\n\t\ttemp = super.iteratorPreOrder();\r\n\t\twhile (temp.hasNext()) {\r\n\t\t\tresult += temp.next().toString();\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public static String contentAscending(int quantity){\r\n String content = \"\";\r\n \r\n for (int i = 0; i < quantity; i++) {\r\n content += i + \"\\r\\n\";\r\n }\r\n \r\n return content;\r\n }", "public String toSortedString(){\n return toSortedString(root);\n }", "private String toSortedString( Node n ){\n String s = \"\";\n if(n != null){\n s += toSortedString(n.left);\n s += n.data + \"\";\n s += toSortedString(n.right);\n }\n return s;\n }", "private String computeUniqueNotation(Subquery parsedQuery) {\n if (parsedQuery.rightTerm == null) {\n parsedQuery.orderedQuery = parsedQuery.leftTerm.toString();\n return parsedQuery.leftTerm.toString();\n }\n\n String leftBare = computeUniqueNotation(parsedQuery.leftTerm instanceof Subquery ? (Subquery) parsedQuery.leftTerm : new Subquery(parsedQuery.leftTerm));\n String rightBare = computeUniqueNotation(parsedQuery.rightTerm instanceof Subquery ? (Subquery) parsedQuery.rightTerm : new Subquery(parsedQuery.rightTerm));\n\n String operator = parsedQuery.operator;\n String ordered;\n\n if (operator.equals(\"|\") || operator.equals(\"+\")) {\n if (leftBare.compareTo(rightBare) > 0) {\n ordered = rightBare + \" \" + leftBare + \" \" + operator;\n } else {\n ordered = leftBare + \" \" + rightBare + \" \" + operator;\n }\n } else {\n ordered = leftBare + \" \" + rightBare + \" \" + operator;\n }\n parsedQuery.orderedQuery = ordered;\n return ordered;\n }", "public String postorder() {\n \tresult = \"\";\n \ttraversal(root);\n return result;\n }", "public String order(int amount) {\n if (this._noOfItems < 1) {\n return \"\"; // return empty if nothing to check for\n }\n // The string to return\n String resultString = \"\";\n // stores the previous items' sum of quantitys\n int prevQuantity = 0;\n FoodItem prevItem = null;\n FoodItem currentItem = null;\n // for each item in stock, and an extra loop to check the last\n for (int i = 0; i <= this._noOfItems; i++) {\n if (i != this._noOfItems) {\n currentItem = this._stock[i];\n }\n if (i > 0) {\n // if not same item as previous OR after last item (means we are checking for last item)\n if (i == this._noOfItems || (currentItem.getName() != prevItem.getName() ||\n currentItem.getCatalogueNumber() != prevItem.getCatalogueNumber())) {\n // if the total amount of all sames is less than parameter amount\n if (prevQuantity < amount) {\n // add comma and space if nothing have been added yet\n if (!(resultString.length() == 0)) {\n resultString+=\", \";\n }\n // add name to string\n resultString += prevItem.getName();\n }\n // reset quantity, as the next to be checked (means, the current) is different\n prevQuantity = 0;\n }\n }\n // sum the quantities - have already resetted if last or different\n prevQuantity += currentItem.getQuantity();\n // anyway, set the next loop prev item to this loop current.\n prevItem = currentItem;\n }\n return resultString;\n }", "public String printSortedResult() {\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tsb.append(printStartNumberAndName() + \"; \");\n\t\tsb.append(printInfo());\n\t\t\n\t\tsb.append(printTotalTime());\n\t\t\n\t\tsb.append(errorHandler.print());\n\t\t\n\t\treturn sb.toString();\n\t}", "@Override\n\tpublic void order() {\n\t\tSystem.out.println(\"고객 판매 주문\");\n\t}", "public String processOrder() {\n notifyAllObservers();\n\n return getOrderReport();\n }", "public String toString()\r\n {\r\n String s = new String();\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=count-1;i++)\r\n {\r\n s += vi.getObject().toString()+ Static.defaultSeparator;\r\n vi = vi.getNext();\r\n }\r\n \r\n return s;\r\n }", "@Override\n\tpublic String problemOutput() {\n\t\treturn reverseFirstLast();\n\t}", "String toStringBackwards();", "public static String printTree()\n {\n \tString tree = \"\";\n ArrayList<String> letters = converter.toArrayList();\n for(int i = 0; i < letters.size(); i++)\n {\n tree += letters.get(i);\n if(i + 1 < letters.size())\n \t tree += \" \";\n }\n \n return tree;\n }", "public String cyclify() {\n return toString();\n }", "public String levelOrder() {\n\t\treturn head_.getRight().levelorder().toString();\n\t}", "@Override\n public String toString() { // display subtree in order traversal\n String output = \"[\";\n LinkedList<Node<T>> q = new LinkedList<>();\n q.add(this);\n while(!q.isEmpty()) {\n Node<T> next = q.removeFirst();\n if(next.leftChild != null) q.add(next.leftChild);\n if(next.rightChild != null) q.add(next.rightChild);\n output += next.data.toString();\n if(!q.isEmpty()) output += \", \";\n }\n return output + \"]\";\n }", "private static String getDirSuffix(int order, Context ctx) {\n \t\tString rtnStr = \"\"+order;\n \t\t\n \t\tswitch(order) {\n \t\t\tcase 1:\n \t\t\t\trtnStr += ctx.getResources().getString(R.string.first_short);\n \t\t\t\tbreak;\n \t\t\tcase 2:\n \t\t\t\trtnStr += ctx.getResources().getString(R.string.second_short);\n \t\t\t\tbreak;\n \t\t\tcase 3:\n \t\t\t\trtnStr += ctx.getResources().getString(R.string.third_short);\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\trtnStr += ctx.getResources().getString(R.string.nth_short);\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\n \t\treturn rtnStr;\n \t}", "public String toString () {\n\t\tString resumen = \"\";\n\t\tfor (int i = 0; i < this.size(); i++) {\n\t\t\tresumen = resumen + this.get(i).toString();\n\t\t}\n\t\treturn resumen;\n\t}", "public String getOutput() {\n TopologicalOrderIterator<String, DefaultEdge> iterator =\n new TopologicalOrderIterator<>(steps, Comparator.comparing((String x) -> x));\n\n // Traverse the DAG and store each vertex to a StringBuilder\n // to output once traversal is completed\n StringBuilder sb = new StringBuilder();\n while (iterator.hasNext()) {\n sb.append(iterator.next());\n }\n\n return sb.toString();\n }", "@Override\n\tpublic String morder() {\n\t\treturn \"Los anelidos muerden y se aferran\";\n\t}", "public String toString() { return new String(b,0,i_end); }", "@Override\n\tpublic String toString()\n\t{\n\n\t\tStringBuffer sb = new StringBuffer(\"top->\");\n\t\tif (!isEmpty())\n\t\t{\n for(int i = getSize() - 1; i >= 0; i--)\n {\n if(i == getSize() - 1)\n {\n sb.append(list.get(i));\n }\n else \n {\n sb.append( \"->\" + list.get(i));\n }\n }\n //System.out.println(sb.toString());\n\t\t}\n\t\treturn sb.toString();\n\t}", "public String alienOrder(String[] words) {\n String order = \"\";\n \n if (words.length == 0 || words == null) {\n return order;\n }\n \n Map<Character, Set<Character>> graph = new HashMap<>();\n Map<Character, Integer> indegree = new HashMap<>();\n \n int size = words.length;\n \n for (String word : words) {\n for (int i = 0; i < word.length(); i++) {\n indegree.put(word.charAt(i), 0);\n }\n }\n \n for (int i = 0; i < size - 1; i++) {\n String curr = words[i];\n String next = words[i + 1];\n \n int minLen = Math.min(curr.length(), next.length());\n \n for (int j = 0; j < minLen; j++) {\n char a = curr.charAt(j);\n char b = next.charAt(j);\n \n if (a != b) {\n Set<Character> hs = graph.computeIfAbsent(a, x -> new HashSet<>());\n if (!hs.contains(b)) {\n hs.add(b);\n indegree.put(b, indegree.getOrDefault(b, 0) + 1);\n }\n // 别忘了 break to save time\n break;\n }\n }\n }\n\n Queue<Character> queue = new LinkedList<>();\n\n for (Map.Entry<Character, Integer> entry : indegree.entrySet()) {\n char c = entry.getKey();\n int count = entry.getValue();\n \n if (count == 0) {\n queue.offer(c);\n }\n }\n \n while (!queue.isEmpty()) {\n char c = queue.poll();\n order += c;\n \n Set<Character> followings = graph.get(c);\n \n if (followings != null) {\n for (char follow : followings) {\n indegree.put(follow, indegree.get(follow) - 1);\n \n if (indegree.get(follow) == 0) {\n queue.offer(follow);\n }\n }\n }\n }\n \n if (order.length() != indegree.size()) {\n return \"\";\n }\n \n return order;\n }", "public String getResultadostring(){\n\t\tif (golesEquipo1>golesEquipo2){\n\t\t\treturn equipo1;\n\t\t}else if (golesEquipo1<golesEquipo2){\n\t\t\treturn equipo2;\n\t\t}\n\t\treturn \"a\";\n\t}", "public String toString(){\n String handString = \"\";\n int i = 1;\n sort();\n for(Card c: cards){\n handString += Integer.toString(i) + \": \" + c + \"\\n\";\n i++;\n }\n handString = handString.substring(0, handString.length() - 1);\n return handString;\n }", "@Override\n public LinkedList<String> orderAlphabetically(){\n LinkedList<String> stringLL = super.orderAlphabetically();\n stringLL.add(\"Years Until Tenure: \" + m_yearsUntilTenure);\n Collections.sort(stringLL);\n return stringLL;\n }", "@Override\n\tpublic String getOrder() {\n\t\treturn \"zjlxdm,asc\";\n\t}", "public String toSortString() {\r\n\t\t\r\n\t\t// to seperate between each attribute.\r\n\t\tString separator = (char) 0 + \"\"; \r\n\t\t\r\n\t\tString line = this.getLastName() + separator\r\n\t\t\t+this.getFirstName() + separator\t\t\t\r\n\t\t\t+this.getPhoneNumber();\r\n\t\t\r\n\t\treturn line;\r\n\t}", "public String getOrder() {\n return this.Order;\n }", "public String formatedMenuOrderByPrice(){\n Random random = new Random();\n int randomIndex = random.nextInt(Pizza.values().length);\n Pizza pizzaOfTheDay = Pizza.values()[randomIndex];\n\n return Arrays.stream(Pizza.values())\n .sorted(comparing(pizza -> calculatePizzaPriceWithDiscount(pizza, pizzaOfTheDay)))\n .map(pizza -> String.format(\n \"%15s (%-90s) %5s %4s - %5.2f zł %1s\",\n pizza.getName(),\n pizza.getIngredients().stream().map(Ingredient::getName).collect(Collectors.joining(\", \")),\n pizza.getIngredients().stream().anyMatch(Ingredient::isSpicy) ? \"ostra\" : \"\",\n pizza.getIngredients().stream().noneMatch(Ingredient::isMeat) ? \"wege\" : \"\",\n calculatePizzaPriceWithDiscount(pizza,pizzaOfTheDay),\n pizza.equals(pizzaOfTheDay) ? \"*\" : \"\"\n ))\n .collect(Collectors.joining(\"\\n\"));\n }", "public String getOrderHistory() {\n\n\t\treturn getOrderHistory(\"\");\n\t}", "public synchronized String printInventory(){\n String inventStr = \"\";\n\n for (int i = 0; i < titleList.size(); i++){\n inventStr += titleList.get(i) + \" \" + quantityList.get(i);\n if(i < titleList.size() - 1) {\n inventStr +=\"___\";\n }\n }\n return inventStr;\n }", "int order();", "public String toString () {\n String lLineFeed = System.getProperty(\"line.separator\");\n StringBuffer lStringBuffer = new StringBuffer();\n lStringBuffer.append (lLineFeed);\n lStringBuffer.append (\"***************************************************\" + lLineFeed);\n lStringBuffer.append (\" Order Appeasement \" + lLineFeed);\n lStringBuffer.append (\"Appeasement ID .................. \" + getId() + lLineFeed); \n lStringBuffer.append (\"Appeasement Code ................ \" + getAppeaseCode() + lLineFeed); \n lStringBuffer.append (\"Appeasement Description ......... \" + getAppeaseDescription() + lLineFeed); \n lStringBuffer.append (\"Reference ....................... \" + getReference() + lLineFeed); \n lStringBuffer.append (\"Appeasement Date ................ \" + getAppeaseDate() + lLineFeed); \n lStringBuffer.append (\"Amount .......................... \" + getAmount() + lLineFeed); \n lStringBuffer.append (\"***************************************************\");\n return lStringBuffer.toString();\n }", "@Override\n\tpublic String toString() {\n\t\t//Invert the Stack by pushing Nodes to a new Stack\n\t\tMyStack<T> invertedStack = new MyStack<T>(this.size());\n\t\twhile(!this.isEmpty()) {\n\t\t\tinvertedStack.push(this.pop());\n\t\t}\n\t\t\n\t\t//Create empty String for returning\n\t\tString returnString = \"\";\n\t\t\n\t\t//Create an iterator for traversing the Stack\n\t\tNode iteratorNode = invertedStack.topNode;\n\t\t\n\t\t//Traverse the Stack and append the individual data Strings to the return String\n\t\tfor(int i = 0; i < invertedStack.size(); i++) {\n\t\t\treturnString += iteratorNode.data.toString();\n\t\t\titeratorNode = iteratorNode.nextNode;\n\t\t}\n\t\t\n\t\t//Restore the original Stack so that it isn't destroyed\n\t\twhile(!invertedStack.isEmpty()) {\n\t\t\tthis.push(invertedStack.pop());\n\t\t}\n\t\t\n\t\t//Return the finished String to the function caller\n\t\treturn returnString;\n\t}", "public String getOrderDetails(ArrayList<Item> items){\n String detailsToString=\"\";\n\n Set<Item> setOrderItems = new HashSet<>();\n for(Item each: items){ //remove duplicates and increase quanity of item instead.\n if(!setOrderItems.add(each)){\n setOrderItems.remove(each);\n each.incQuantity();\n setOrderItems.add(each);\n }\n }\n\n for(Item each: setOrderItems){\n detailsToString = \"x\"+each.getQuantity()+\" \"+each.getName()+\"\\n\"+detailsToString;\n }\n\n return detailsToString;\n }", "public String toString()\r\n\t\t{\r\n\t\t\tString str = \" \" ;\r\n\t\t\tif (this.num.size() == 0)\r\n\t\t\t\tstr = \"<vacia>\";\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tfor (int i = 0; i < this.num.size(); i++) \r\n\t\t\t\t\tstr = str + this.num.get(i) + \" \";\r\n\t\t\t}\r\n\t\t\treturn str;\r\n\t\t}", "String getOrderId();", "public String toString2()\n {\n\t String queueToString = \"\";\n\t int i =1;\n\t for(Generics object: AL)\n\t {\n\t\t queueToString += i + \". \";\n\t\t //queueToString+= StateStatistics.KeyType.name;\n\t\t queueToString += object.getName() + \": \" + object.toString();\n\t\t queueToString += \"\\n \";\n\t\t i++;\n\t }\n\t \n\t //queueToString += \"]\";\n\t \n\t return queueToString;\n }", "java.lang.String getOrderByDataItem();", "public String toString()\n\t{\n\t\tString queueAsString = \"\";\n\t\tint index = front - 1;\n\t\tfor (int i = 0; i < counter; i++)\n\t\t{\n\t\t\tindex = next(index);\n\t\t\tqueueAsString += list[index] + \" \";\n\t\t}\n\t\treturn queueAsString;\n\t}", "public String toStringAll() {\n\t\treturn toStringEx(-1);\n\t}", "public String toString()\n\t{\n\t\tchar [] ToStringChar = new char[length];\n recursiveToString(0, ToStringChar, firstC);\n String contents = new String(ToStringChar);\n return contents;\n\t\t\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\tString newString = \"\";\r\n\r\n\t\tfor (int i = factors.length - 1; i > 0; i--) {\r\n\t\t\tnewString = newString + factors[i].toString() + \"*z^\" + i + \"+\";\r\n\t\t}\r\n\t\t// jos za nulu\r\n\t\treturn newString + factors[0].toString();\r\n\t}", "public String toString(){\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < key; i++) {\n sb.append(getArtikel(i));\n }\n return sb.toString();\n }", "@Override\n public String print() {\n ArrayList<K> inorderTraverse = inOrdorTraverseBST();\n \n System.out.print(\"In ascending order: \");\n for (int i=0; i<inorderTraverse.size(); i++) {\n System.out.print(inorderTraverse.get(i)+\" \");\n }\n System.out.println(\"\");\n return \"\";\n }", "public String getAlternativeOrderNumberSuffix();", "public String getStringRecord() {\n NumberFormat nf = new DecimalFormat(\"0000.00\");\n String delimiter = \",\";\n\n return String.format(\"%05d\", orderLineId) + delimiter + String.format(\"%05d\", orderId) + delimiter\n + String.format(\"%05d\", userId) + delimiter + String.format(\"%05d\", productId) + delimiter\n + String.format(\"%05d\", orderLineQuantity) + delimiter + nf.format(salesPrice)\n + System.getProperty(\"line.separator\");\n }", "@Override\n\tpublic String toString() {\n\t\tString string = \"\";\n\t\tfor (int i = list.size() - 1; i >= 0; i--) {\n\t\t\tstring += list.get(i) + \" \";\n\t\t}\n\t\treturn string;\n\t}", "public String toString(){\n\t\tIterator<Integer> iter = getLines().iterator();\n\t\tString word = getWord() + \"(\" + getLines().size() + \"): \";\n\t\twhile (iter.hasNext()){\n\t\t\tword += iter.next() + \", \";\n\t\t} \n\t\tword = word.substring(0, word.length() - 2);\n\t\treturn word;\n\t}", "public String toString() {\n String sorted = \"[\";\n for (int i = 0; i < size - 1; i++) {\n sorted = sorted + array[i] + \", \";\n }\n sorted = sorted + array[size - 1] + \"]\";\n return sorted;\n }", "public String toString() {\r\n String result = new String();\r\n for (int i = getSize() - 1; i >= 0; i--) result+=getDigit(i);\r\n return result;\r\n }", "public String getDatabaseOrder() {\n\t\tSqlExpression expr = this.getOrderSqlExpression();\n\t\treturn expr != null ? expr.toSqlString() : \"\";\n\t}", "public String getAlternativeOrderNumberPrefix();", "public String toString(){\n\t\tStringBuilder output = new StringBuilder();\n\t\tfor (int i=13; i<=16; i++){\n\t\t\toutput.append(linesAndStores[i].makeString());\n\t\t\toutput.append(\"\\n\");\n\t\t}\n\t\treturn output.toString();\n\t}", "public String toString() {\n\t\tString s = \"\";\n\t\tfor (INodo n : this.getDescendientes()) {\n\t\t\ts = s + \" \" + n.toString();\n\t\t}\n\t\tfor (int i = 1; i < this.getDescendientes().size(); i++) {\n\t\t\ts = this.getRaiz() + \" \" + s;\n\t\t}\n\t\treturn \"( \" + s + \" )\";\n\t}", "public String toString() {\n return toString(root) + \" \";//call helper method for in-order traversal representation\n }", "public String toString(String sp){\n StringBuffer sb=new StringBuffer();\n \n for(int i=0;i<items.size();i++){\n if(i==0)\n sb.append(items.get(i));\n else{\n sb.append(sp);\n sb.append(items.get(i));\n }\n }\n return sb.toString();\n\n }", "public String toString() {\r\n\t\tString output = \"\";\r\n\t\tfor (int n = 0; n < parts.size(); n++){\r\n\t\t\toutput = output + parts.get(n) + \", \";\r\n\t\t}\r\n\t\t\r\n\t\tint toAdd = 5 - parts.size(); \r\n\t\t\t\r\n\t\tfor( int i = 0; i < toAdd; i++ ) {\r\n \t\r\n\t\toutput = output + \"[ ], \";\r\n \r\n\t\t} \r\n\t\t\r\n\t\treturn output;\r\n\t\t\t\r\n\t}", "public String toString() {\r\n int totalPrice = 0;\r\n for (Ticket ticket : tickets) {\r\n totalPrice += ticket.price;\r\n }\r\n StringBuilder stringBuilder = new StringBuilder();\r\n stringBuilder.append(\"Costo totale : \").append(totalPrice);\r\n stringBuilder.append(String.format(\" Itinerario numero: \", itinerary.id+1));\r\n for (Ticket ticket : tickets) {\r\n stringBuilder.append(String.format(\"(Ticket numero %d prezzo %d) + \",ticket.ticketNumber, ticket.price));\r\n }\r\n if (tickets.size() == 0)\r\n stringBuilder.append(\"Itinerario non possibile\");\r\n else\r\n stringBuilder.setLength(stringBuilder.length()-2);\r\n return stringBuilder.toString();\r\n\r\n }", "@Override\n\t\tpublic String toString() {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tpreOrderTraverse(expression.root, 1, sb);\n\t\t\treturn sb.toString();\n\t\t}", "@Override\n public String toString() {\n String s = \"\"; //Comienza con un string vacio, y se le va a agregando cada cliente por medio de un ciclo.\n NodoCliente aux = cabeza;\n while (aux != null) {\n s += aux + \"\\n\";\n aux = aux.getNext();\n }\n return s;\n }", "public String postorderTraverse(){\r\n\t\t\r\n\t\t//the recursive call to the private method\r\n\t\t//StringBuffer is used because it is passed by reference\r\n\t\t//StringBuffer can be changed in recursive calls\r\n\t\treturn postorderTraverse(this, new StringBuffer(\"\"));\r\n\t}", "public String toString() {\n Node<E> current = header;\n String result = null;\n while(current.getNext() != trailer){\n result.equals(result + current.getElement().toString());\n current = current.getNext();\n }\n result.equals(result + trailer.getElement().toString());\n return result;\n }", "@Override\n\tpublic int getOrder() {\n\t\treturn Ordered.HIGHEST_PRECEDENCE + 10000;\n\t}", "public String toString() {\n\t\tString str = \"\";\n\t\tfor (int i = 1 ; i < size - 1; i++ ){\n\t\t\tstr = str + getBlock(i);\n\t\t}\n\t\treturn str;\n\t}", "public String toString()\n {\n\tString returnString = \"\";\n\treturnString += \"[ \" + cargo + \" ][ * ]--> \";\n\treturn returnString;\n }", "public void printStringsInLexicoOrder() {\n\t\t// ***** method code to be added in this class *****\n\t\t// now we just have a dummy method that prints a message.\n\n\t\tTreeNode node = root;\n\t\t\n\t\tprintStringsInLexicoOrder(node);\n\t}", "public String toString(){\n\t\tNumberFormat nf = NumberFormat.getCurrencyInstance();\r\n\t\tString lastprice = nf.format(this.price);\r\n\t\tString lasttprice = nf.format(this.bulkP);\r\n\t\tif (this.bulkQ == 0){\r\n\t\t\treturn (this.name + \", \" + lastprice);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.name + \", \" + lastprice + \" (\" + bulkQ + \" for \" + lasttprice + \")\";\r\n\t\t}\r\n\t\t\r\n\t}", "public int getOrder();", "public String toString() {\n\t\tString str = \"\";\n\t\tfor(int i = 0;i < data.length;i++) {\n\t\t\tstr = str + data[i];\n\t\t}\n\t\tif(overflow) {\n\t\t\treturn \"Overflow\";\n\t\t}else {\n\t\t\treturn str;\n\t\t}\n\t}", "public String toString()\r\n {\r\n String result = \"\";\r\n \r\n for (int index=0; index < top; index++) \r\n result = result + stack[index].toString() + \"\\n\";\r\n \r\n return result;\r\n }", "public String alienOrder(String[] words) {\n String order = \"\";\n\n if (words.length == 0 || words == null) {\n return order;\n }\n\n int size = words.length;\n\n Map<Character, Integer> inDegree = new HashMap<>();\n Map<Character, Set<Character>> graph = new HashMap<>();\n\n // at first, initialize inDegree, all characters' inDegree is 0\n for (String word : words) {\n for (int i = 0; i < word.length(); i++) {\n inDegree.put(word.charAt(i), 0);\n }\n }\n\n // graph\n for (int i = 0; i < size - 1; i++) {\n String curr = words[i];\n String next = words[i + 1];\n\n int minLen = Math.min(curr.length(), next.length());\n\n for (int j = 0; j < minLen; j++) {\n char a = curr.charAt(j);\n char b = next.charAt(j);\n\n if (a != b) {\n // update graph\n Set<Character> hs = graph.computeIfAbsent(a, x -> new HashSet<>());\n // update inDegree, 但是不要加 重 \n if (!hs.contains(b)) {\n inDegree.put(b, inDegree.getOrDefault(b, 0) + 1);\n }\n hs.add(b);\n\n break;\n }\n }\n }\n\n Queue<Character> queue = new LinkedList<>();\n\n for (Map.Entry<Character, Integer> entry : inDegree.entrySet()) {\n char c = entry.getKey();\n int val = entry.getValue();\n\n if (val == 0) {\n queue.add(c);\n }\n }\n\n while (!queue.isEmpty()) {\n char c = queue.poll();\n\n order += c;\n\n Set<Character> subsequentChars = graph.get(c);\n // c is parent to subsequentChars\n // now, remove 1 indegree for all subsequentChars\n if (subsequentChars != null) {\n for (char subsequent : subsequentChars) {\n inDegree.put(subsequent, inDegree.get(subsequent) - 1);\n\n if (inDegree.get(subsequent) == 0) {\n queue.add(subsequent);\n }\n }\n }\n }\n\n if (order.length() != inDegree.size()) {\n return \"\";\n }\n\n return order;\n }", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();" ]
[ "0.695701", "0.68562645", "0.6832996", "0.659472", "0.65882474", "0.6517432", "0.64854103", "0.6467352", "0.6438099", "0.642376", "0.6413785", "0.6280532", "0.62438524", "0.623602", "0.61784124", "0.61750513", "0.61705923", "0.61610705", "0.61073744", "0.6084163", "0.599383", "0.5986878", "0.5979568", "0.5977693", "0.596187", "0.5946008", "0.59379923", "0.59310025", "0.59254813", "0.5912924", "0.58897084", "0.5884602", "0.58667964", "0.58645964", "0.5853215", "0.5852618", "0.58414155", "0.58412755", "0.5833999", "0.5830937", "0.5825577", "0.5810645", "0.5796324", "0.57877576", "0.5786963", "0.5777579", "0.57765925", "0.57730997", "0.5772668", "0.5757456", "0.57553494", "0.5735335", "0.5735217", "0.57296234", "0.5722559", "0.5715294", "0.57093567", "0.5708772", "0.5702297", "0.5700486", "0.5698318", "0.5696832", "0.56880057", "0.5683336", "0.56820476", "0.56767774", "0.5668695", "0.5658341", "0.56558305", "0.5639942", "0.56364506", "0.56361395", "0.5634178", "0.56314415", "0.5621744", "0.561986", "0.5619583", "0.561774", "0.56136596", "0.5610637", "0.5609591", "0.5606253", "0.5589693", "0.5586827", "0.55844253", "0.5575305", "0.55716497", "0.5569508", "0.55688214", "0.5564237", "0.5560168", "0.55579793", "0.55579793", "0.55579793", "0.55579793", "0.55579793", "0.55579793", "0.55579793", "0.55579793", "0.55579793" ]
0.63196003
11
Methods for calculating and formatting order total costs
private double getOrderTotal() { double d = 0; for (Pizza p : pizzas) { d += p.calcTotalCost(); } return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void calculateOrderCost(){\n int tmpCost=0;\n for (Vehicle v : vehicleList){\n tmpCost+=v.getCost();\n }\n totalCost=tmpCost;\n }", "String getTotalCost() {\n return Double.toString(totalCost);\n }", "double getTotalCost();", "private void calculateCosts() {\r\n lb_CubicSum.setText(UtilityFormat.getStringForLabel(getColmunSum(tc_Volume)) + \" €\");\r\n lb_MaterialCostSum.setText(UtilityFormat.getStringForLabel(getColmunSum(tc_Price)) + \" €\");\r\n lb_CuttingTimeSum.setText(UtilityFormat.getStringForLabel(getColmunSum(tc_CuttingHours)) + \" €\");\r\n lb_CuttingCostSum.setText(UtilityFormat.getStringForLabel(getColmunSum(tc_CuttingPrice)) + \" €\");\r\n lb_TotalCosts.setText(UtilityFormat.getStringForLabel(getColmunSum(tc_CuttingPrice) + getColmunSum(tc_Price)) + \" €\");\r\n\r\n ModifyController.getInstance().setProject_constructionmaterialList(Boolean.TRUE);\r\n }", "double ComputeCost(double order, double tipPercent, double serviceRating, double foodRating)\r\n {\r\n // kazda gwiazdka to 2 procent od sumy zamówienia\r\n return order + order * (tipPercent/100) + (serviceRating * 0.02) * order + (foodRating * 0.02) * order;\r\n }", "BigDecimal calculateTotalPrice(Order order);", "@Override\n public double calcCost() {\n return calcSalesFee()+calcTaxes();\n }", "public float totalCost() {\n\t\tttCost = 0;\n\t\tfor (int i = 0; i < itemsOrdered.size(); i++) {\n\t\t\tttCost += itemsOrdered.get(i).getCost();\n\t\t}\n\t\treturn ttCost;\n\t}", "double calculateDeliveryCost(Cart cart);", "private double calculateTotal(){\r\n double total = 0;\r\n for(int i = 0; i < orderList.size(); i++){\r\n total += orderList.getOrder(i).calculatePrice();\r\n }\r\n return total;\r\n }", "public void calculateCost(Order currentOrder) {\n\n BigDecimal area = currentOrder.getArea();\n BigDecimal materialCost = (area.multiply(currentOrder.getProduct().getCostPerSqFt())).setScale(2);\n BigDecimal laborCost = (area.multiply(currentOrder.getProduct().getLaborCostPerSqFt()));\n BigDecimal tax = laborCost.add(materialCost).multiply(currentOrder.getState().getTaxRate().movePointLeft(2));\n BigDecimal total = materialCost.add(laborCost).add(tax);\n\n //using half_up for rounding to get the (nearest neighbor)\n //Setting each price to the object\n currentOrder.setMaterialCost(materialCost.setScale(2, RoundingMode.HALF_UP));\n currentOrder.setLaborCost(laborCost.setScale(2, RoundingMode.HALF_UP));\n currentOrder.setTax(tax.setScale(2, RoundingMode.HALF_UP));\n currentOrder.setTotal(total.setScale(2, RoundingMode.HALF_UP));\n }", "public void printCost() {\r\n double cost;\r\n cost = quantity * price;\r\n System.out.printf(\"Total cost = $%.2f\", cost);\r\n }", "public String getCost() {\n // Formats the cost amount into money format.\n NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US);\n String s = n.format(Double.parseDouble(_cost));\n return s;\n }", "public String getTotalCost() {\n return this.TotalCost;\n }", "public void calculateCost() {\n \tdouble costToShipPack;\n \tint numOfPacks = 1;\n \t\n \tfor(Package p: this.packages) {\n \t\tcostToShipPack = 3 + (p.calcVolume() - 1);\n \t\tthis.totalAmounts.put(\"Package \"+numOfPacks, costToShipPack);\n \t\tnumOfPacks++;\n \t}\n \t\n }", "public void calculateCost()\n\t{\n\t\tLogManager lgmngr = LogManager.getLogManager(); \n\t\tLogger log = lgmngr.getLogger(Logger.GLOBAL_LOGGER_NAME);\n\t\tString s = \"\";\n\t\tint costperfeet = 0;\n\t\tif (this.materialStandard.equals(\"standard materials\") && this.fullyAutomated == false)\n\t\t\tcostperfeet = 1200;\n\t\telse if (this.materialStandard.equals(\"above standard materials\") && this.fullyAutomated == false)\n\t\t\tcostperfeet = 1500;\n\t\telse if(this.materialStandard.equals(\"high standard materials\") && this.fullyAutomated == false)\n\t\t\tcostperfeet = 1800;\n\t\telse if (this.materialStandard.equals(\"high standard materials\") && this.fullyAutomated == true)\n\t\t\tcostperfeet = 2500;\n\t\t\n\t\tint totalCost = costperfeet * this.totalArea;\n\t\t/*s = \"Total Cost of Construction is :- \";\n\t\twriter.printf(\"%s\" + totalCost, s);\n\t\twriter.flush();*/\n\t\tlog.log(Level.INFO, \"Total Cost of Construction is :- \" + totalCost);\n\t}", "public void calculateOrderTotals() {\n NumberFormat formatter = NumberFormat.getCurrencyInstance();\n\n //order number increases for each order\n orderNo++;\n System.out.println(\"- \" + \"OrderNo: \" + orderNo + \" -\");\n\n //cycle through the items in the order and add to the totals\n for(Item i : items) {\n\n incrementOrderTotal(i.getNumOfItems() * i.getPriceWithTax());\n incrementOrderSalesTax(i.getNumOfItems() * i.getTaxOnItem());\n\n System.out.println(i.getDescrip() + formatter.format(i.getPriceWithTax()));\n }\n\n //print out totals\n System.out.println(\"Sales taxes: \" + formatter.format(Math.round(getOrderSalesTax() * 100.0) / 100.0));\n System.out.println(\"Order total: \" + formatter.format(Math.round(getOrderTotal() * 100.0) / 100.0));\n System.out.println(\"\\n\");\n }", "public double getTotalCostOfOrder() {\n double total = 0;\n for (AbstractProduct item :\n this.itemsReceived) {\n total += item.getPrice();\n }\n return total;\n }", "public java.math.BigDecimal getTotalCost () {\n\t\treturn totalCost;\n\t}", "public double calculateCost(Purchase purchase);", "public double calculateTotalCost() {\n finalTotal = (saleAmount + taxSubtotal + SHIPPINGCOST);\n\n return finalTotal;\n }", "private String getBillPrice() {\n double cost = 0.00;\n\n for (MenuItem item : bill.getItems()) {\n cost += (item.getPrice() * item.getQuantity());\n cost += item.getExtraIngredientPrice();\n cost -= item.getRemovedIngredientsPrice();\n }\n\n return String.format(\"%.2f\", cost);\n }", "public float totalCost() {\r\n float total = 0;\r\n for (int i=0; i<numItems; i++) {\r\n total += cart[i].getPrice();\r\n }\r\n return total;\r\n }", "public double calculate(Map<String, Order> orders) {\n\n\t\t// This is the fix to avoid null pointer exception if Cart has null\n\t\t// orders\n\t\tif (orders == null) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Orders are invalid. Input is null\");\n\t\t}\n\t\t// GrandTotal is initialized outside the loop to have the grand total\n\t\tdouble grandTotal = 0;\n\n\t\t// Iterate through the orders\n\t\tfor (Map.Entry<String, Order> entry : orders.entrySet()) {\n\t\t\tSystem.out.println(\"*******\" + entry.getKey() + \"*******\");\n\t\t\tOrder order = entry.getValue();\n\t\t\tdouble totalTax = 0;\n\t\t\tdouble total = 0;\n\n\t\t\t// Iterate through the items in the order\n\t\t\t/*\n\t\t\t * In lists indexes starts with 0 and ends with its size-1. We\n\t\t\t * should not include indexes which are not exist,it will leads to\n\t\t\t * ArrayIndexOutofBoundException. Hence logical operator = is\n\t\t\t * removed\n\t\t\t */\n\t\t\tfor (int i = 0; i < order.size(); i++) {\n\n\t\t\t\t// Calculate the taxes\n\t\t\t\tdouble tax = 0;\n\n\t\t\t\tItem item = order.get(i).getItem();\n\n\t\t\t\ttax = calculateTax(item);\n\n\t\t\t\t// Calculate the total price\n\t\t\t\tdouble totalPrice = item.getPrice() + tax;\n\n\t\t\t\t// Print out the item's total price\n\t\t\t\t// Wrong way of rounding off here it is fixed with the help of\n\t\t\t\t// BigDecimal\n\t\t\t\tSystem.out.println(item.getDescription() + \": \"\n\t\t\t\t\t\t+ roundToTwoDecimal(totalPrice));\n\n\t\t\t\t// Keep a running total\n\t\t\t\ttotalTax += tax;\n\t\t\t\ttotal += item.getPrice();\n\t\t\t}\n\n\t\t\t// Print out the total taxes\n\t\t\t// Wrong way of rounding off here it is fixed with the help of\n\t\t\t// BigDecimal\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"Sales Tax: \" + roundToTwoDecimal(totalTax) /*\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * Math.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * floor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * totalTax\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t */);\n\n\t\t\t// Fix to Total. Total should not include Tax\n\t\t\t// total = total + totalTax;\n\n\t\t\t// Print out the total amount\n\t\t\t// Wrong way of rounding off here it is fixed with the help of\n\t\t\t// BigDecimal\n\t\t\tSystem.out.println(\"Total: \" + roundToTwoDecimal(total) /*\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * Math.floor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * (total *\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * 100) /\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * 100\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t */);\n\t\t\tgrandTotal += total;\n\t\t}\n\n\t\t// grandtotal = Math.floor(grandtotal * 100) / 100;\n\t\t// Bug Fix: 10 (Wrong way of rounding. To meet the requirements, we\n\t\t// should be using BigDecimal.)\n\t\tSystem.out.println(\"Sum of orders: \" + roundToTwoDecimal(grandTotal));\n\n\t\treturn grandTotal;\n\t}", "public double getTotal() {\n return totalCost;\n }", "@Override\r\n\tpublic double getCost() {\r\n\t\tdouble total = 0;\r\n\t\t\r\n\t\tfor(Product p: parts) {\r\n\t\t\ttotal += p.getCost();\r\n\t\t}\r\n\t\t\r\n\t\treturn total;\r\n\t}", "private CharSequence calculateTotalPrice() {\n float totalPrice = 0.0f;\n totalPrice += UserScreen.fishingRodQuantity * 25.50;\n totalPrice += UserScreen.hockeyStickQuantity * 99.99;\n totalPrice += UserScreen.runningShoesQuantity * 85.99;\n totalPrice += UserScreen.proteinBarQuantity * 5.25;\n totalPrice += UserScreen.skatesQuantity * 50.79;\n return Float.toString(totalPrice);\n }", "@Override\n protected double calcTotalCost() {\n \n double totalCost, templateBasicRate = DEFAULT_BASIC_RATE;\n double extraBedrooms = 0, extraBathrooms = 0;\n\n // if there are extra beds/baths\n if (this.getNumBedrooms() > DEFAULT_NUM_BEDROOMS)\n extraBedrooms = this.getNumBedrooms() - DEFAULT_NUM_BEDROOMS;\n\n if (this.getNumBathrooms() > DEFAULT_NUM_BATHROOMS)\n extraBathrooms = this.getNumBathrooms() - DEFAULT_NUM_BATHROOMS;\n\n // multiply basic rate by 1.5 if the total area is >= 3,000 sq ft\n if (this.getTotalArea() >= 3000)\n templateBasicRate *= 1.5;\n\n // calculate total cost\n totalCost = (templateBasicRate + ((800 * extraBedrooms) + (500 * extraBathrooms)));\n\n // add tax\n totalCost += (TAX * totalCost);\n\n return totalCost;\n }", "public double calculateCost() {\n double output = price * (1 + taxRate);\n return output;\n }", "public double getTotalCost() {\r\n return totalCost;\r\n }", "@Override \r\n public double getPaymentAmount() \r\n { \r\n return getQuantity() * getPricePerItem(); // calculate total cost\r\n }", "public double calcCost() {\n if (pizzaSize.equals(\"small\")) {\n return 10.0 + ((cheeseToppings + pepperoniToppings + veggieToppings) * 2);\n\n }\n else if (pizzaSize.equals(\"medium\")) {\n return 12.0 + ((cheeseToppings + pepperoniToppings + veggieToppings) * 2);\n }\n else {\n return 14.0 + ((cheeseToppings + pepperoniToppings + veggieToppings) * 2);\n }\n }", "double getCost();", "double getCost();", "public BigDecimal calculateTotal() {\r\n BigDecimal orderTotal = BigDecimal.ZERO;\r\n \r\n final Iterator<Item> iterator = myShoppingCart.keySet().iterator();\r\n \r\n while (iterator.hasNext()) {\r\n final BigDecimal currentOrderPrice = myShoppingCart.get(iterator.next());\r\n \r\n orderTotal = orderTotal.add(currentOrderPrice);\r\n }\r\n \r\n //if membership take %10 off the total cost\r\n if (myMembership) {\r\n if (orderTotal.compareTo(new BigDecimal(\"25.00\")) == 1) { //myOrderTotal > $25\r\n final BigDecimal discount = DISCOUNT_RATE.multiply(orderTotal); \r\n orderTotal = orderTotal.subtract(discount);\r\n }\r\n }\r\n \r\n return orderTotal.setScale(2, RoundingMode.HALF_EVEN);\r\n }", "double computePrintingCost(double price){\n //TODO calculate price and return it\n return price * printer.countCharactersPrinted();\n }", "public double calcCost(){\n double cost = 0;\n cost += pMap.get(size);\n cost += cMap.get(crust);\n //Toppings are priced at 3.00 for 3-4 topppings, and 4.0 for 5+ toppings\n \n if(toppings !=null)\n {\n if((toppings.length == 3) || (toppings.length == 4)){\n cost += 3.0;\n }\n if (toppings.length > 4){\n cost += 4.0;\n }\n }\n \n return cost;\n }", "public String toStringAlt() {\n\t\t\n\t\tStringBuilder sb = new StringBuilder(\"$\");\n\t\tFormatter f = new Formatter(sb);\n\t\tf.format(\"%.2f\", cost);\n\t\tf.close();\n\t\tsb.append(\" \")\n\t\t .append(make).append(\" \")\n\t\t .append(model).append(\" for day \")\n\t\t .append(startDay.getDay())\n\t\t .append(\" to day \")\n\t\t .append(endDay.getDay());\n\t\treturn sb.toString();\n\t\t\n\t}", "private static String getTotal(ArrayList<CatalogItem> items) {\n double dTotal = 0.0;\n for (CatalogItem item : items) {\n dTotal += item.getPrice();\n }\n\n dTotal += dTotal*0.0825;\n return \"$\" + df.format(dTotal);\n }", "double info() {\n System.out.println(\"Name: \" + name);\n System.out.println(\"Quantity: \" + Integer.toString(quantity));\n System.out.println(\"Price: \" + Double.toString(price));\n System.out.println(\"Total cost: \" + Double.toString(totalCost) + \"\\n\");\n return totalCost;\n }", "public String getRealTotalCost() {\n return this.RealTotalCost;\n }", "public double calcTotal(){\n\t\tdouble total; // amount to be returned\n\t\t\n\t\t// add .50 cents for any milk that isn't whole or skim, and .35 cents for flavoring\n\t\tif ((milk != \"whole\" && milk != \"skim\") && flavor != \"no\"){\n\t\t\tcost += 0.85;\t\n\t\t}\n\t\t\n\t\t// add .35 cents for flavoring\n\t\telse if (flavor != \"no\"){\n\t\t\tcost += 0.35;\t\n\t\t}\n\t\t\n\t\t// add .50 cents for milk that isn't whole or skim\n\t\telse if (milk != \"whole\" && milk != \"skim\"){\n\t\t\tcost += 0.50;\n\t\t}\n\t\t\n\t\telse{\n\t\t}\n\t\t\n\t\t// add .50 cents for extra shot of espresso\n\t\tif (extraShot != false){\n\t\t\ttotal = cost + 0.50;\n\t\t}\n\t\telse\n\t\t\ttotal = cost;\n\t\t\n\t\treturn total;\n\t}", "public double getTotalCost(){\r\n\t\t//return the totalCost to the App\r\n\t\treturn totalCost;\r\n\t}", "public float getTotalCost() {\n return this.totalCost;\n }", "public String approximateOrderCosts(String userAuthToken, String body) {\n return sendRequest(postResponseType, userAuthToken, body, deliveryOrderCostsPath, allResult, statusCode200);\n }", "public double getTotalCost() {\r\n\t\treturn cost;\r\n\t}", "public double getCosts();", "@Override\n public double getTotalCommission() {\n double cost = 0.0;\n //increase cost for each report in the order\n for (Report report : reports.keySet()) {\n //report cost depends on the WorkType\n //audits are not capped by max employee count\n //regular orders are limited by max employee count\n int employeeCount = reports.get(report);\n cost += workType.calculateReportCost(report, employeeCount);\n }\n //increase cost of order based on priority\n //critical orders increase based on their critical loading\n //regular orders don't have an effect\n cost = priorityType.loadCost(cost);\n return cost;\n }", "public double get_additional_line_cost() {\n\t\treturn additionallinecost;\n\t}", "@SuppressWarnings(\"Duplicates\")\n private double printOrderDetails(@NotNull Order o) {\n printHeader(\"Order #\" + o.getOrderID() + \"\", 60);\n System.out.println(\"Order ID: \" + o.getOrderID());\n System.out.println(\"Order State: \" + ((o.getOrderState() == Order.OrderState.ORDER_PAID) ? \"Paid\" : \"Unpaid\"));\n System.out.println(\"Order Started On: \" + DateTimeFormatHelper.formatMillisToDateTime(o.getCreatedAt()));\n System.out.println(\"Staff Handling Order: \" + ((o.getStaff() == null) ? \"Unknown Staff\" : \"[\" + o.getStaff().getStaffId() + \"] \" + o.getStaff().getStaffName()));\n System.out.println(\"Table Number: \" + ((o.getTable() == null) ? \"Unknown Table\" : o.getTable().getTableNum()));\n System.out.println(\"List of Order Items:\");\n printBreaks(60);\n if (o.getOrderItems().size() == 0) System.out.println(\"No Items in Order\");\n else {\n o.calculateSubtotal(); // Calculate Subtotal\n OrderMenuUI.printOrderItems(o.getOrderItems(), true);\n }\n printBreaks(60);\n // Do final caclulation\n o.calculateSubtotal();\n double tax = 0.07 * o.getSubtotal();\n double total = tax + o.getSubtotal();\n System.out.printf(\"%50s $%-6.2f\\n\", \"Order Subtotal: \", o.getSubtotal());\n System.out.printf(\"%50s $%-6.2f\\n\", \"GST (7%): \", tax);\n printBreaks(60);\n System.out.printf(\"%50s $%-6.2f\\n\", \"Total: \", total);\n printBreaks(60);\n System.out.println(\"\\n\");\n return total;\n }", "public double sumMoney(){\n\t\tdouble result = 0;\n\t\tfor(DetailOrder detail : m_DetailOrder){\n\t\t\tresult += detail.calMoney();\n\t\t}\n\t\tif(exportOrder == true){\n\t\t\tresult = result * 1.1;\n\t\t}\n\t\treturn result;\n\t}", "public BigDecimal summaryPrice() {\n BigDecimal result = basePrice;\n if (options == null) {\n return result == null ? BigDecimal.ZERO : result;\n } else {\n\n for (int i = 0; i < options.length; i++) { // to jest opcja napisania metody w klasie Car zeby od razu tam sie znajdywala i dawala nam jaka jest cena , zeby cena byla od razu elementem klasy CAR\n result = result.add(options[i].getOptionPrice());\n }\n return result;\n }\n }", "private static double checkOrder() {\n double total = 0;\n System.out.println();\n System.out.println(\"Your total order : \");\n System.out.println();\n System.out.printf(\"%2s. %-40s %3s %8s%n\", \"No\", \"Title\", \"Qty\", \"Price\");\n for (int i = 0, j = 1; i < menuItems.length; i++) {\n if (menuOrder[i] == 0) continue;\n double price = menuOrder[i] * menuPrices[i];\n total += price;\n System.out.printf(\"%2d. %-40s %3d %8.2f Baht%n\", j, menuItems[i], menuOrder[i], price);\n j++;\n }\n System.out.printf(\"%47s: %8.2f Baht%n\", \"Total\", total);\n return total;\n }", "private String bulkorderqtycalculation() {\n String strSubtotal = estimatedSubTotalPriceDisplayShoppingCart.getText();\n float intSubtotal = Float.parseFloat(strSubtotal.replaceAll(\"[^0-9.]\", \"\"));\n DecimalFormat df = new DecimalFormat(\"#\");\n String forSubtotal = df.format(intSubtotal);\n int forIntSubtotal = Integer.parseInt(forSubtotal);\n System.out.println(\"=== Subtotal after trimming: \" + forIntSubtotal);\n int reqqty = 0;\n reqqty = (3000 / forIntSubtotal);\n System.out.println(\"=== Qty Require is: \" + reqqty);\n String qtystr = String.valueOf(reqqty);\n return qtystr;\n }", "@Override\n public String toString(){\n return String.format(\"%s%s%s%n%s%s%n \",super.toString(),\"The taxes is \",calcTaxes(),\n \"The total cost is \",calcCost());\n }", "public float calcOrderTotal()\r\n\t{\r\n\t\tOrderItem temp;\r\n\t\tfloat total = 0;\r\n\t\t\r\n\t\t//iterate through list and get quantity and unit price of each item\r\n\t\t//then multiply together and add to running total\r\n\t\tfor (int x = 0; x < orderItemList.size(); x++)\r\n\t\t{\r\n\t\t\ttemp = orderItemList.get(x);\r\n\t\t\ttotal = total + (temp.getProductQuant() * temp.getProductPrice());\r\n\t\t}\r\n\t\t\r\n\t\treturn total;\r\n\t}", "public String getCost() {\n\t\tString t = doc.get(\"cost\");\n\n\t\tif (t == null) {\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\treturn t;\n\t\t}\n\t}", "public double calculatingCostO(int quantity)\n { \n cost = 750 + (0.25 * quantity);\n return cost;\n \n }", "float calculatePrice () \n\t{\n\t\tfloat final_price = 0;\n\t\tfinal_price = (float)(price * quantity); // price * number of items\n\t\tfinal_price += final_price*(.10); // add tax\n\t\tif(perishable.equals(\"P\"))\n\t\t{\n\t\t\tfloat ship = (float)(20* weight)*quantity; // add shipping\n\t\t\tship += ship*.20;\n\t\t\tfinal_price += ship;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfinal_price += (20* weight)*quantity; // add shipping\n\t\t}\n\t\treturn final_price;\n\t}", "private double calculateTotalPrice(Order order) {\n int nights = (int)(order.getVaucher().getDateTo().getTime() - order.getVaucher().getDateFrom().getTime())/(24 * 60 * 60 * 1000);\n double totalPrice = (nights * order.getVaucher().getHotel().getPricePerDay() + order.getVaucher().getTour().getPrice()) * (100 - order.getUser().getDiscount())/100;\n return totalPrice;\n }", "public void updateTotalPrice(){\n\t\tBigDecimal discount = currentOrder.getDiscount();\n\t\tBigDecimal subtotal = currentOrder.getSubtotal();\n\t\tthis.subtotal.text.setText(CURR+subtotal.add(discount).toString());\n\t\tthis.discount.text.setText(CURR + discount.toString());\n\t\tthis.toPay.text.setText(CURR+subtotal.toString());\n\t}", "private void generateReceipt(){\n ArrayList<Product> productList = cart.getProductList();\n ArrayList<Float> costsList = cart.getCostsList();\n for (int i=0; i<productList.size(); i++){\n String quantity = \"\"+productList.get(i).getQuantity();\n String name = \"\"+productList.get(i).getName();\n String cost = \"\"+Math.round(costsList.get(i) * 100.0) / 100.0;\n //String cost = \"\"+costsList.get(i);\n \n reciept.addLine(quantity+\" \"+name+\": \"+cost);\n }\n \n reciept.addLine(\"Total Taxes: \"+Math.round(cart.getTotalTax() * 100.0) / 100.0);\n reciept.addLine(\"Total: \"+ Math.round((cart.getTotalTax()+cart.getTotalCost()) * 100.0) / 100.0);\n // print reciept\n }", "public BigDecimal sumCostAvoidanceTotal(MaintenanceRequest po){\n\t\tBigDecimal total = new BigDecimal(0.00).setScale(2);\n\t\t\n\t\tfor(MaintenanceRequestTask task : po.getMaintenanceRequestTasks()){\n\t\t\ttotal = total.add(MALUtilities.isEmpty(task.getCostAvoidanceAmount()) ? new BigDecimal(0) : task.getCostAvoidanceAmount());\n\t\t}\n\t\t\n\t\treturn total;\t\t\n\t}", "public void calculateAmount() {\n totalAmount = kurv.calculateTotalAmount() + \" DKK\";\n headerPrice.setText(totalAmount);\n }", "public double getTotalCost() {\n cost = spr.calculateCost();\n return cost;\n }", "@Pure\n\tdouble getCost();", "@Pure\n\tdouble getEstimatedCost();", "public abstract double getCost();", "public BigDecimal getCost() {\r\n return cost;\r\n }", "public double calculateOrderTotalWithDiscountsAndShipping(String[] order, boolean isMember){\n\t\t//TODO\n\t\t\n\t\tint a=discountByItemPrice(order,isMember);\n\t\tint b=discountByItemCount(order,isMember);\n\t\tdouble price=getOrderTotalWithoutDiscount(order);\n\t\t\n\t\tint discount= a>b ? a:b;\n\t\t\n\t\tif(isShippingFree(order,isMember)) {\n\t\t\t\n\t\t\tprice=price-(price*discount/100);\n\t\t}else {\n\t\t\tprice=price-(price*discount/100)+SHIPPING_CHARGE;\n\t\t}return price;\n\t\t\n\t}", "public BigDecimal sumGoodwillTotal(MaintenanceRequest po){\n\t\tBigDecimal total = new BigDecimal(0.00).setScale(2);\n\t\t\n\t\tfor(MaintenanceRequestTask task : po.getMaintenanceRequestTasks()){\n\t\t\ttotal = total.add(MALUtilities.isEmpty(task.getGoodwillCost()) ? new BigDecimal(0) : task.getGoodwillCost());\n\t\t}\n\t\t\n\t\treturn total;\t\t\n\t}", "public double total(){\n\tdouble total=0;\n\tfor(Map.Entry<String, Integer> pro:proScan.getProducts().entrySet()){\n\t\tString proName=pro.getKey();\n\t\tint quantity=pro.getValue();\n\t\tProductCalculator proCal=priceRule.get(proName);\n\t\tif(proCal==null)\n\t\t\tthrow new MissingProduct(proName);\n\t\t\n\t\tProductCalculator cal=priceRule.get(proName);\n\t\tdouble subtotal=cal.getTotal(quantity);\n\t\ttotal+=subtotal;\n\t\t//System.out.println(total);\n\t}\n\t//round the total price to two digit\n\treturn round(total, 2);\n}", "public int getCost() {\n\t\treturn (int) Math.round(weight*price_per_pound);\n\t\t\n\t}", "@Override\n public double cost()\n {\n return this.price * this.number;\n }", "public String getFormatTotal (){\r\n DecimalFormat formatter = new DecimalFormat(\"$###,###.00\");\r\n String formatTotal = formatter.format(total);\r\n return formatTotal; \r\n }", "@Override\n public double calcTaxes() {\n return getCost() * 0.07;\n }", "public String toString(){\r\n String output = \"\";\r\n //Display the name \r\n output += this.name;\r\n //Turn the cost int in cents to a string in dollars\r\n String totalcost = DessertShoppe.cents2dollarsAndCents(getCost());\r\n //Print out a space between the name and where the cost needs to be\r\n for (int i = this.name.length(); i < DessertShoppe.RECEIPT_WIDTH - totalcost.length(); i++){\r\n output+=\" \";\r\n }\r\n //Print outt he cost string with the dollar sign\r\n output += totalcost;\r\n return output;\r\n \r\n }", "@Override\n public String toString() {\n\n //convert cents to dollars using cents2dollarsAndCents\n String output = DessertShoppe.cents2dollarsAndCents(this.getCost());\n //create string storing cost in a string \n String costLength = Integer.toString(this.getCost());\n //find spacing needed between name and cost in reciept by subtracting 30(total spaces) by \n //length of name and length of cost\n int spacing = 30 - super.getName().length() - costLength.length() - 1;\n //loop through an add a space each time up to \"spacing\" integer\n for (int i = 0; i < spacing; i++) {\n output = \" \" + output;\n }\n //return name of cookie along with cost along with the right format posting amount of pounds with cost per pound\n return this.weight + \" lbs. \" + \"@ $\" + DessertShoppe.cents2dollarsAndCents(this.pricePerLbs) + \" /lb.\\n\" + this.getName() + output;\n }", "@Override\n\tpublic double cost() {\n\t\tdouble price = good.cost();\n\t\treturn price+price/2;\n\t}", "public void getCosts() {\n\t}", "private static String formatCost(double cost) {\n\t\tif (cost <= 1d)\n\t\t\treturn new Double(cost).toString();\n\n\t\treturn \"NaN\";\n\t}", "public BigDecimal getCost() {\n return this.cost;\n }", "public float getCost()\r\n/* 13: */ {\r\n/* 14:10 */ return this.costFromStart + this.estimatedCostToGoal;\r\n/* 15: */ }", "@Override\n public String toString() {\n String output = new String();\n for (Flight flight : itinerary) {\n output += flight.toStringWithoutCost() + \"\\n\";\n }\n\n // Gets output of two decimal places from cost.\n double cost = Math.round(price * 100) / 100.0;\n \n return (output + String.format(\"%.2f\", cost) + \"\\n\" \n + DateTime.hoursToString(travelTime));\n }", "public String getCost() {\n return cost;\n }", "public float calculateTotalPrice(ArrayList<Food> totalOrder) {\n totalPrice = 0.0f;\n for (Food itemOfFood : totalOrder) {\n totalPrice = totalPrice + itemOfFood.getPrice();\n }\n return totalPrice;\n }", "@Override\n\tpublic double cost() {\n\t\treturn Double.parseDouble(rateOfLatte);\n\t}", "@Override\n\tpublic double getSumOfCost() {\n\t String sql=\"SELECT SUM(cost) FROM supplier_product\";\n\t double total=this.getJdbcTemplate().queryForObject(sql, double.class);\n\t\treturn total;\n\t}", "public double calcCost() {\n // $2 per topping.\n double cost = 2 * (this.cheese + this.pepperoni + this.ham);\n // size cost\n switch (this.size) {\n case \"small\":\n cost += 10;\n break;\n case \"medium\":\n cost += 12;\n break;\n case \"large\":\n cost += 14;\n break;\n default:\n }\n return cost;\n }", "@Transient\n public Double getTotalOrderPrice() {\n double sum = 0;\n for (OrderItem oi : getOrderItems()) {\n sum += oi.getTotalPrice();\n }\n return sum;\n }", "public String toString() {\n\t\t\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"From day \")\n\t\t .append(startDay.getDay())\n\t\t .append(\" to day \")\n\t\t .append(endDay.getDay())\n\t\t .append(\": $\");\n\t\tFormatter f = new Formatter(sb);\n\t\tf.format(\"%.2f\", cost);\n\t\tf.close();\n\t\tsb.append(\", \")\n\t\t .append(make)\n\t\t .append(\" \")\n\t\t .append(model);\n\t\treturn sb.toString();\n\t\t\n\t}", "@Override\n public double getCost() {\n\t return 13;\n }", "public static void printOrderTotals() {\r\n System.out.println(\"\");\r\n System.out.println(\"********ORDER TOTALS********\");\r\n System.out.println(\"Total Pizza Sliders Ordered: \" + pizzaOrdered);\r\n System.out.println(\"Total Roast Beef Sliders Ordered: \" + roastOrdered);\r\n System.out.println(\"***************************\");\r\n System.out.println(\"\");\r\n }", "public double getCost() \n { \n return super.getCost() +22;\n }", "int getCost();", "int getCost();", "int getCost();", "public double calculatePrice(Order order){\r\n return order.quantity * order.itemPrice -\r\n Math.max(0, order.quantity - 500) * order.itemPrice * 0.05 +\r\n Math.min(order.quantity * order.itemPrice * 0.1, 100);\r\n }", "float getTotalCost() throws SQLException;", "@Override\n public double calcSalesFee() {\n return getCost() + getSalesPurchase();\n }" ]
[ "0.73448646", "0.73098814", "0.69224954", "0.6914807", "0.69142395", "0.6842425", "0.6819441", "0.67908436", "0.676742", "0.6736335", "0.67017084", "0.6690543", "0.6666131", "0.6656629", "0.6648985", "0.6632459", "0.6631985", "0.6631056", "0.6628238", "0.6625971", "0.6540114", "0.6522292", "0.6513756", "0.6512384", "0.64941096", "0.6442981", "0.6441444", "0.64371246", "0.64277923", "0.6426889", "0.64154613", "0.637069", "0.6363998", "0.6363998", "0.6353213", "0.6338116", "0.63248783", "0.6318492", "0.6305797", "0.62910926", "0.6263727", "0.62625444", "0.6256696", "0.6228683", "0.62048393", "0.61967015", "0.6179968", "0.6167906", "0.61565816", "0.61548626", "0.61481774", "0.6122519", "0.61065865", "0.6106231", "0.6096573", "0.6085177", "0.6079656", "0.6077044", "0.60743403", "0.607339", "0.6064787", "0.60620356", "0.60578334", "0.6047744", "0.60474604", "0.60474265", "0.60436714", "0.604354", "0.60286653", "0.60277987", "0.60230136", "0.6015118", "0.60113806", "0.59997606", "0.5997564", "0.59913003", "0.59908164", "0.5987067", "0.59789735", "0.59736294", "0.5969928", "0.59696853", "0.5955167", "0.59527135", "0.595259", "0.594499", "0.59435666", "0.59411556", "0.59368306", "0.5936037", "0.5933934", "0.5927398", "0.59204113", "0.5885219", "0.58821464", "0.58821464", "0.58821464", "0.5870518", "0.5868586", "0.58673203" ]
0.68071574
7
Method for calcuting the total number of pizzas
int numberOfPizzas() { return pizzas.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getNumber() {\n return this.numPizzas;\n }", "public static void numberOfPizzasOfSize(DeluxePizza todaysPizza[])\n\t{\n\t\tScanner keyboard = new Scanner(System.in);\n\n\t\tSystem.out.println(\"Please enter the specific size of pizza to be counted\");\n\t\tString whichSize = keyboard.next();\n\t\twhichSizeOfPizza(whichSize);\n\t\t\n\t\tboolean empty = true;\n\t\tfor(DeluxePizza x:todaysPizza)\n\t\t{\n\t\t\tif(x != null)\n\t\t\t\tempty = false;\n\t\t}\n\t\tif(!empty){\n\t\tint counter = 0;\n\t\tfor(DeluxePizza x:todaysPizza)\n\t\t{\n\t\t\tif (x == null)\n\t\t\t{\n\t\t\t\tcounter += 0;\n\t\t\t}\n\t\t\telse if (x.getPizzaSize().equals(whichSize))\n\t\t\t{\n\t\t\t\t++counter;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"You made \" + counter + \" \" + whichSize + \" pizza(s) today!\");\n\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"You haven't made any pizzas yet!\");\n\t\t\treturn;\n\t\t}\n\t}", "public int precioTotalRepuestos() {\n int sumaTotal = 0;\n for (Dispositivo dispositivo : dispositivos) {\n sumaTotal += dispositivo.getPrecioRepuesto();\n }\n return sumaTotal;\n }", "public int getTotRuptures();", "int getFaintedPokemonCount();", "public abstract int getCntPoa();", "public int calculateTotalDiscount(Map<Pizza, Integer> pizzas) {\n\t\tint totalOrderPrice = calculateTotalOrderPriceWithoutDiscount(pizzas);\n\t\tint maxPizzaPriceDiscount = calculateMaxPizzaPriceDiscount(pizzas);\n\t\tint orderPriceWithMaxPizzaPriceDiscount = totalOrderPrice - maxPizzaPriceDiscount;\n\t\t\n\t\treturn maxPizzaPriceDiscount \n\t\t\t\t+ discountCalculator.calculateDiscount(orderPriceWithMaxPizzaPriceDiscount,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taccumulativeCardSum);\n\t}", "public int getNumGruppoPacchetti();", "public int quizTotal()\n {\n if (quizScores[0] < z)\n z = quizScores[0];\n if (quizScores[1] < z)\n z = quizScores[1];\n if (quizScores[2] < z)\n z = quizScores[2];\n if (quizScores[3] < z)\n z = quizScores[3];\n if (quizScores[4] < z)\n z = quizScores[4];\n if (quizScores[5] < z)\n z = quizScores[5];\n int quizTot = quizScores[0] + quizScores[1] + quizScores[2] + quizScores[3] + quizScores[4] + quizScores[5] - z;\n if (quizTot > quizHigh)\n {\n quizName = name;\n quizHigh = quizTot;\n }\n return quizTot; \n \n }", "@Override\r\n\tpublic int precioTotal() {\n\t\treturn this.precio;\r\n\t}", "public int totalHabitantes() {\r\n\tIterator<Ciudad> it = ciudades.iterator();\r\n\tint totalhab = 0;\r\n\tint i = 0;\r\n\twhile(it.hasNext()) {\r\n\t\ttotalhab += it.next().getHabitantes();\r\n\t\t\r\n\t}\r\n\t return totalhab;\r\n\r\n }", "public void calcP() {\r\n\t\tthis.setP(sick/people.size());\r\n\t}", "int getCazuriCount();", "@java.lang.Override\n public int getFaintedPokemonCount() {\n return faintedPokemon_.size();\n }", "public int getFaintedPokemonCount() {\n if (faintedPokemonBuilder_ == null) {\n return faintedPokemon_.size();\n } else {\n return faintedPokemonBuilder_.getCount();\n }\n }", "public int totalNum(){\n return wp.size();\n }", "int getTotalCount();", "public int pizzaPrice()\r\n {\r\n int toppingCount = this.toppings.size();\r\n if (toppingCount < 1 || toppingCount > BYO_MAX_TOPPING_COUNT)\r\n {\r\n return -1;\r\n }\r\n\r\n int toppingsPrice = toppingCount * BYO_TOPPING_PRICE;\r\n\r\n if (this.size.equals(Pizza.SMALL_SIZE))\r\n {\r\n return BYO_SMALL_BASE_PRICE + toppingsPrice;\r\n }\r\n else if (this.size.equals(Pizza.MEDIUM_SIZE))\r\n {\r\n return BYO_MEDIUM_BASE_PRICE + toppingsPrice;\r\n }\r\n else if (this.size.equals(Pizza.LARGE_SIZE))\r\n {\r\n return BYO_LARGE_BASE_PRICE + toppingsPrice;\r\n }\r\n else\r\n {\r\n return -1;\r\n }\r\n }", "public int probabilidadesHastaAhora(){\n return contadorEstados + 1;\n }", "public int ardiveis() {\n\t\tint result = 0;\n\t\tfor (EstadoAmbiente[] linha : this.quadricula) {\n\t\t\tfor (EstadoAmbiente ea : linha) {\n\t\t\t\tif(ea == EstadoAmbiente.CASA || ea == EstadoAmbiente.TERRENO){\n\t\t\t\t\tresult++;\t\t\t\t \n\t\t\t\t}\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn result;\n\t}", "public int numeroHojas(){\n\t int N=0, ni=0, nd=0;\n\t Arbol <T> aux=null;\n\t if (!vacio()) {\n\t if ((aux=getHijoIzq())!=null) ni = aux.numeroHojas();\n\t if ((aux=getHijoDer())!=null) nd = aux.numeroHojas();\n\t if ((aux=getHijoDer())==null && (aux=getHijoIzq())==null)N = 1;\n\t else N = ni + nd;\n\t }\n\t\treturn N;\n\t}", "int getReservePokemonCount();", "public void sumaPuntos() {\r\n int rojo = 0;\r\n int azul = 0;\r\n for (int i = 1; i < 10; i++) {\r\n\r\n if (tablero[1][i].getTipo().equals(\"Rojo\")) {\r\n rojo += tablero[1][i].getValor();\r\n }\r\n\r\n if (tablero[8][i].getTipo().equals(\"Azul\")) {\r\n azul += tablero[8][i].getValor();\r\n }\r\n\r\n }\r\n if (rojo > azul) {\r\n this.setResultado(\"Rojo\");\r\n this.agregarVictoria(jugadorRojo);\r\n }\r\n if (azul > rojo) {\r\n this.setResultado(\"Azul\");\r\n this.agregarVictoria(jugadorAzul);\r\n }\r\n \r\n this.setReplay(true);\r\n }", "Integer getTotalStepCount();", "public int calculateTotalOrderPrice(Map<Pizza, Integer> pizzas) {\n\t\t\n\t\tint totalOrderPrice = calculateTotalOrderPriceWithoutDiscount(pizzas);\n\t\t\n\t\tint totalOrderPriceWithDiscount = totalOrderPrice - calculateTotalDiscount(pizzas); \n\t\t\n\t\tif (totalOrderPriceWithDiscount < 0) {\n\t\t\tthrow new RuntimeException(\"Total order price < 0\");\n\t\t}\n\t\t\n\t\treturn totalOrderPriceWithDiscount;\n\t}", "protected int getTotalPages(FacesContext context) {\n String forValue = (String) getAttributes().get(\"for\");\n UIData uiData = (UIData) getForm(context).findComponent(forValue);\n if (uiData == null) {\n return 0;\n }\n int rowsPerPage = uiData.getRows(); \n int totalRows = uiData.getRowCount();\n int result = totalRows / rowsPerPage;\n if (0 != (totalRows % rowsPerPage)) {\n result++;\n }\n return result;\n }", "public float capacidadeTotal() {\r\n float toneladas = 0;\r\n\r\n for (int i = 0; i < numNavios; i++) {\r\n if (navios[i] instanceof Petroleiro) {\r\n Petroleiro petroleiro = (Petroleiro) navios[i];\r\n toneladas = toneladas + petroleiro.getCapacidadeCarga();\r\n } else if (navios[i] instanceof PortaContentores) {\r\n PortaContentores portaContentores = (PortaContentores) navios[i];\r\n toneladas = toneladas + portaContentores.getMaxContentores() * 10;\r\n }\r\n }\r\n return toneladas;\r\n }", "public int count() throws TrippiException {\n try {\n int n = 0;\n while (hasNext()) {\n next();\n n++;\n }\n return n;\n } finally {\n close();\n }\n }", "public int calculateTotalOrderPriceWithoutDiscount(Map<Pizza, Integer> pizzas) {\n\t\t\n\t\tvalidatePizzas(pizzas);\n\t\t\n\t\tint orderPrice = 0;\n\t\tfor(Entry<Pizza, Integer> entry : pizzas.entrySet()) {\n\t\t\tPizza pizza = entry.getKey();\n\t\t\tInteger pizzaCount = entry.getValue();\n\t\t\torderPrice += pizza.getPrice() * pizzaCount;\n\t\t}\n\t\t\n\t\treturn orderPrice;\n\t}", "public int getTotalPics()\n {\n\t\t/*System.out.println(\"photo\"+photo.size());\n\t\tif(photo.size() == 0)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\tSystem.out.println(totalPics);*/\n return this.totalPics;\n }", "int getAcksCount();", "int getAcksCount();", "int getPointsCount();", "public int obtenerNumeroFacturas(){\n return historialFacturas.size();\n }", "public int getNumPaMethods(){\r\n\t\treturn classStat.getNPaM();\r\n\t}", "public void mostrarTotales() { \n // Inicializacion de los atributos en 0\n totalPCs = 0;\n totalLaptops = 0;\n totalDesktops = 0; \n /* Recorrido de la lista de computadores para acumular el precio usar instanceof para comparar el tipo de computador */ \n for (Computador pc : computadores){\n if (pc instanceof PCLaptop) {\n totalLaptops += pc.calcularPrecio(); \n } else if (pc instanceof PCDesktop){\n totalDesktops += pc.calcularPrecio();\n }\n }\n totalPCs = totalLaptops + totalDesktops;\n System.out.println(\"El precio total de los computadores es de \" + totalPCs); \n System.out.println(\"La suma del precio de los Laptops es de \" + totalLaptops); \n System.out.println(\"La suma del precio de los Desktops es de \" + totalDesktops);\n }", "int getPagesAmount();", "public int numberOfBoxesInPile()\n {\n if (aboveBox != null)\n {\n return 1 + aboveBox.numberOfBoxesInPile();\n }\n else\n {\n return 1;\n }\n }", "int getPriceCount();", "public int getTotal() {\n int value = 0;\n for (Map.Entry<Integer, Integer> entry : gramma.entrySet()) {\n value += entry.getKey() * entry.getValue();\n }\n return value;\n }", "int getTotalElements();", "public int numberOfTires() {\n int tires = 4;\n return tires;\n }", "public int getCantidadAvenidas();", "public int howManyPieces() {\n int totalPieces = 0;\n // for each item in stock\n for (int i = 0; i < this._noOfItems; i++) {\n // add the quantity of the item to the sum\n totalPieces += this._stock[i].getQuantity();\n }\n // and return the total of quantities\n return totalPieces;\n }", "public int getCantidadCalles();", "public double peso() {\n double peso = 0.0;\n for (Arista a : aristas())\n peso += a.peso();\n return peso;\n }", "int getTotalDepositCount();", "public int findTotalPapers() throws DAOException;", "public int totalDeApostas(int numeracao) {\n\t\treturn controlador.totalApostas(numeracao);\n\t}", "public int Promedio(List<Integer>num){\n \n Iterator i = num.iterator();\n int suma = 0;\n int conteo = 0;\n int promedio;\n \n while(i.hasNext()){\n suma += (int)i.next();\n conteo++;\n }\n promedio = suma/conteo;\n return promedio;\n }", "@JsonIgnore\r\n public int getPoints(){\r\n int lPoints = 0;\r\n for (CFantasyTeamByWeek lFantasyTeamByWeek : mFantasyTeamsByWeek){\r\n lPoints += lFantasyTeamByWeek.getPoints();\r\n }\r\n return lPoints;\r\n }", "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 }", "@Override\r\n\tpublic int countCart(String userid, int pnum) {\n\t\treturn 0;\r\n\t}", "public int getNumberOfPepperoni() {\n return this.pepperoni;\n }", "private int countPermuation(int n, int m){\n\t\tint res = 1;\n\t\tfor(int i = n - m + 1; i <= n; i++){\n\t\t\tres *= i;\n\t\t}\n\t\treturn res;\n\t}", "@Override\r\n\tpublic int getPegCount() {\r\n\t\tint shipSize = 3;\r\n\t\treturn shipSize;\r\n\t}", "public int getNUMCOPIAS() {\n return numcopias;\n }", "int getAoisCount();", "@Override\n public float calculaPreu(PreuTipusHabitacio p) {\n return p.getPreu() * this.perc;\n }", "public int calculerKgsNourritureParJour(){\r\n\t\treturn noms.size() * 10;\r\n\t}", "private static long pisano(long m) {\n long temp;\n long first = 0;\n long second = 1;\n\n long count = 0; // initial length of the pisano period\n \n while (true) {\n temp = first;\n first = second;\n second = (second + temp) % m;\n count++;\n\n if (first == 0 && second == 1) {\n return count;\n } // every pisano period begins with 0 1. When we see 0 1, we know len of pisano period.\n }\n }", "int getPickupsCount();", "public void countPoints() {\n points = 0;\n checkAnswerOne();\n checkAnswerTwo();\n checkAnswerThree();\n checkAnswerFour();\n checkAnswerFive();\n checkAnswerSix();\n checkAnswerSeven();\n checkAnswerEight();\n checkAnswerNine();\n checkAnswerTen();\n }", "private static long primeNumCount() {\n \n List<Integer> numbersList = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);\n \n return numbersList.stream()\n .filter(Prime::isPrimeInFunctionalApproach2)\n .count();\n }", "private double getOrderTotal() {\n double d = 0;\n\n for (Pizza p : pizzas) {\n d += p.calcTotalCost();\n }\n\n return d;\n }", "@Override\n\tpublic int getItemPublicacaosCount() {\n\t\treturn itemPublicacaoPersistence.countAll();\n\t}", "int getProgressCount();", "int getProgressCount();", "int getProgressCount();", "Integer total();", "long getNumberOfPeptides(String experimentAccession);", "public int getNumberPeptides() {\n return numberPeptides;\n }", "int getNumberOfAllQuestions();", "public int get_podsActuels() {\r\n\t\tint pods = 0;\r\n\t\tfor(Objet value : _items.values())\r\n\t\t{\r\n\t\t\tpods = value.getTemplate().getPod() * value.getQuantity(); \r\n\t\t}\r\n\t\treturn pods;\r\n\t}", "int numOfPillars() {\n // there are one more coordinate line than blocks in each direction\n // since each block must be hinged on a coordinate line on each side\n return (ni+1) * (nj+1);\n }", "int getNumberOfArtillery();", "public int getPais() {\n return pais;\n }", "@Override\n\tpublic double totalPresentase(UUID idPemb) {\n\t\tQuery query = sessionFactory.getCurrentSession().createQuery(\"SELECT sum(k.persentase_komponen) as res \"\n\t\t\t\t+ \"FROM komponen_nilai k WHERE id_pemb='\" + idPemb + \"'\");\n\t\tList<Object[]> results = (List<Object[]>)query.list();\n\t\tfor (Object[] result : results) {\n\t\t\tdouble res = (Double) result[0];\n\t\t\tSystem.out.println(res);\n\t\t}\n\t\treturn 0;\n\t}", "private void getTotalPreguntas(){\n try{\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"ServiceQualificationPU\");\n EntityManager em = emf.createEntityManager();\n \n String jpql = \"SELECT COUNT(i) FROM Interrogante i WHERE i.estado='a' \";\n \n \n Query query = em.createQuery(jpql);\n this.totalpreguntas = Integer.parseInt(query.getSingleResult().toString());\n //agregamos la pregunta de seleccion de departamento\n this.totalpreguntas +=1;\n em.close();\n emf.close();\n }catch(Exception e ){\n System.out.println(\"ERROR: \"+e);\n this.Error = \"ERROR: \"+e;\n } \n }", "public Integer pesquisarFaturaItemCount(Filtro filtro) throws ErroRepositorioException;", "public int findTotalPapersWithVariants() throws DAOException;", "public int getTotalPoints() {\n \tint total = 0;\n \tfor (int i = 0; i < assignments.size(); i++) {\n \t\ttotal += assignments.get(i).getWorth();\n \t}\n \treturn total;\n }", "public int numAlivePokemon() {\r\n\t\tint count = 0;\r\n\t\tfor (Pokemon p : ownedPokemon) {\r\n\t\t\tif (p.getCurrentHP() > 0) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public int GetNPoints();", "int getActAmountCount();", "@Override\n\tpublic int hitungPemasukan() {\n\t\treturn getHarga() * getPenjualan();\n\t}", "private double prixTotal() \r\n\t{\r\n\t\tdouble pt = getPrix() ; \r\n\t\t\r\n\t\tfor(Option o : option) \r\n\t\t\tpt += o.getPrix();\t\r\n\t\treturn pt;\r\n\t}", "int getCantidad();", "int getScoresCount();", "public int getNumPens(){\n return this.mFarm.getNumPens();\n }", "public void processingTotal(int i);", "public int getShipPartsNeededCount() {\n return (maxDays * 2) / 3;\n }", "private int obstaculos() {\n\t\treturn this.quadricula.length * this.quadricula[0].length - \n\t\t\t\tthis.ardiveis();\n\t}", "public Integer countGoals();", "int getPartsCount();", "int getPartsCount();", "public int nombrePions(Couleur uneCouleur) {\n\t\tCollection<Pion> pions = mesPions.values();\n\t\tint nb = 0;\n\t\tfor (Pion p: pions) {\n\t\t\tif (p.aMemeCouleur(uneCouleur))\n\t\t\tnb++; \n\t\t}\n\t\treturn nb; \n }", "public int calculateMaxPizzaPriceDiscount(Map<Pizza, Integer> pizzas) {\n\t\tint maxPizzaPrice = 0;\n\t\tif (calcTotalPizzasCount(pizzas) > PIZZA_COUNT_TO_GET_DISCOUNT) {\n\t\t\tfor(Entry<Pizza, Integer> entry : pizzas.entrySet()) {\n\t\t\t\tPizza pizza = entry.getKey();\n\t\t\t\tmaxPizzaPrice = Math.max(maxPizzaPrice, pizza.getPrice());\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn (int)(maxPizzaPrice*DISCOUNT_PERCENT_FOR_HIGHEST_PRICE_PIZZA);\n\t}", "public int getTotal_votos() {\n return total_votos;\n }", "public int getPerdidas(){\n\t\treturn perdidas;\n\t}" ]
[ "0.66596663", "0.6626703", "0.65617204", "0.6558754", "0.6485674", "0.6349346", "0.6346749", "0.6327094", "0.63012034", "0.6278564", "0.6273866", "0.61811537", "0.6138739", "0.61224884", "0.61090344", "0.60930985", "0.6085784", "0.6068583", "0.60625595", "0.6020978", "0.6016956", "0.5991487", "0.59884936", "0.59833026", "0.59674245", "0.5957098", "0.5956896", "0.59551233", "0.59543216", "0.5940558", "0.59394896", "0.59394896", "0.59374565", "0.59302527", "0.59252685", "0.59226793", "0.5915446", "0.59151465", "0.58796877", "0.5877002", "0.5837576", "0.5832535", "0.58277196", "0.58270335", "0.58259785", "0.58177423", "0.5811262", "0.58040744", "0.5799646", "0.5770299", "0.57646066", "0.5762165", "0.5759096", "0.5758481", "0.5755331", "0.5743639", "0.5742921", "0.5742018", "0.5740087", "0.5739176", "0.5738244", "0.57275355", "0.5725573", "0.5721426", "0.5715988", "0.5707951", "0.5707535", "0.5707535", "0.5707535", "0.57045853", "0.5701091", "0.570043", "0.5699121", "0.5674533", "0.5674248", "0.5670193", "0.566392", "0.56614536", "0.5653904", "0.5652089", "0.5644892", "0.56425166", "0.5636921", "0.5634212", "0.5622521", "0.562163", "0.5618185", "0.56167936", "0.56164414", "0.5611866", "0.56079686", "0.5601317", "0.559449", "0.55919343", "0.55892533", "0.55892533", "0.55873734", "0.55843693", "0.55818564", "0.5580264" ]
0.8050885
0
Method for selecting and deleting pizzas
void removePizza(Pizza p) { pizzas.remove(p); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void delete(Pizza pizza){\n for(Pizza p : pizzas){\n if(pizza.getID() == p.getID()){\n pizzas.remove(p);\n break;\n }\n }\n }", "@Override\n\tpublic void deleteSelected() {\n\n\t}", "public void clickedPresentationDelete() {\n\t\tif(mainWindow.getSelectedRowPresentation().length <= 0) ApplicationOutput.printLog(\"YOU DID NOT SELECT ANY PRESENTATION\");\n\t\telse if(mainWindow.getSelectedRowPresentation().length > 1) ApplicationOutput.printLog(\"Please select only one presentation to edit\");\n\t\telse {\n\t\t\tint tmpSelectedRow = mainWindow.getSelectedRowPresentation()[0];\n\t\t\tPresentations tmpPresentation = presentationList.remove(tmpSelectedRow);\t\t\t\n\t\t\tappDriver.hibernateProxy.deletePresentation(tmpPresentation);\t\n\t\t\trefreshPresentationTable();\t\t\t\n\t\t}\n\t}", "@Override\n\tpublic void delete(String pizzaToDelete) throws DeletePizzaException {\n\n\t}", "private void delete() {\n AltDatabase.getInstance().getAlts().remove(getCurrentAsEditable());\n if (selectedAccountIndex > 0)\n selectedAccountIndex--;\n updateQueried();\n updateButtons();\n }", "private void toDelete() {\n if(toCount()==0)\n {\n JOptionPane.showMessageDialog(rootPane,\"No paint detail has been currently added\");\n }\n else\n {\n String[] choices={\"Delete First Row\",\"Delete Last Row\",\"Delete With Index\"};\n int option=JOptionPane.showOptionDialog(rootPane, \"How would you like to delete data?\", \"Delete Data\", WIDTH, HEIGHT,null , choices, NORMAL);\n if(option==0)\n {\n jtModel.removeRow(toCount()-toCount());\n JOptionPane.showMessageDialog(rootPane,\"Successfully deleted first row\");\n }\n else if(option==1)\n {\n jtModel.removeRow(toCount()-1);\n JOptionPane.showMessageDialog(rootPane,\"Successfully deleted last row\");\n }\n else if(option==2)\n {\n toDeletIndex();\n }\n else\n {\n \n }\n }\n }", "@Override\r\n\tpublic void deletePizzaRecord(int pId) {\n\t\ttempList = new ArrayList<PizzaBean>();\r\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tpizza = (List<PizzaBean>) ois.readObject();\r\n\t\t\tfor (PizzaBean p : pizza) {\r\n\t\t\t\tif (p.getpId() == pId) {\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempList.add(p);\r\n\t\t\t\t}\r\n\t\t\t\tfos = new FileOutputStream(tempFile);\r\n\t\t\t\toos = new ObjectOutputStream(fos);\r\n\t\t\t\toos.writeObject(tempList);\r\n\t\t\t\toriginal.delete();\r\n\t\t\t\ttempFile.renameTo(original);\r\n\t\t\t\toos.flush();\r\n\t\t\t}\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t}\r\n\t\tSystem.out.println(\"Pizza deleted Successfully\");\r\n\r\n\t}", "@Override\n\tpublic void delete(Pessoa arg0) {\n\t\t\n\t}", "@Override\n public void onClick(DialogInterface dialogInterface, int i) {\n new AgendamentoDAO(MainActivity.this).delete(agendamentos.get(position));\n\n // Remover o item da lista de agendamentos que está em memória\n agendamentos.remove(position);\n\n // Atualizar lista\n adapter.notifyItemRemoved(position);\n\n // Avisar o usuário\n Toast.makeText(MainActivity.this, R.string.agendamento_excluido, Toast.LENGTH_LONG).show();\n }", "public void deletePrioritaet(int prioID) throws Exception;", "public void deleteFromPoseOrder() { \n \ttry {\n\t\t\tthis.openDataBase();\n\t\t\tmyDataBase.execSQL(DeletePoses);\n\t\t\tthis.close();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.d(\"SQL Exception\", e.toString());\n\t\t}\n \t\n }", "private void unDeleteValoresPago() {\n CQChangeStateVP( MVALORPAGO.ANULADO,MVALORPAGO.EMITIDO);\n }", "public void excluirPorChavePrimaria(@SuppressWarnings(\"rawtypes\") Class pClasse, Object pPrimaryKey);", "@Override\n public int delete( J34SiscomexPaises j34SiscomexPaises ) {\n return super.doDelete(j34SiscomexPaises);\n }", "int deleteByExample(PensionRoleMenuExample example);", "public void deleteCargaConsultorasNivel1ByEtapa(String codigoPais,String codigoEtapa);", "public void deleteSelection() {\n deleteFurniture(Home.getFurnitureSubList(this.home.getSelectedItems())); \n }", "void deleteSppprmFromPrimesRejetees(\r\n\t\t\tList<Pointage> listPointageRejetesVentilesOrderedByDateAsc);", "int deleteByExample(PruebaExample example);", "@Override\n\tpublic void deletePizzaById(int pizza_id) {\n\t\tmongoTemplate.remove(Query.query(Criteria.where(\"_id\").in(pizza_id)), Pizza.class);\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tint choice = JOptionPane.showConfirmDialog(frame, \n\t\t\t\t\t\t\"Do you want to delete the selected projects?\\nThis action cannot be undone!\", \n\t\t\t\t\t\t\"Delete Selected\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\n\t\t\t\tif(choice == 0){\n\t\t\t\t\tSystem.out.println(\"Delete\");\n\t\t\t\t\tString[] selected = sel.getSelected(); \n\t\t\t\t\tfor(int i=0;i<selected.length;i++) {\n\t\t\t\t\t\n\t\t\t\t\t\tint index = portfolio.findByCode(selected[i]);\n\t\t\t\t\t\tportfolio.remove(index, config.isUpdateDB());\n\t\t\t\t\t\tsel.remove(index);\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfpTable.setModel((TableModel) new ProjectTableModel(portfolio.getFinishedProjects()));\n\t\t\t\topTable.setModel((TableModel) new ProjectTableModel(portfolio.getOngoingProjects()));\n\t\t\t\ttoggleSaved(false);\n\t\t\t}", "@Override\n\tpublic void delete(Iterable<? extends Pessoa> arg0) {\n\t\t\n\t}", "private void deleteExec(){\r\n\t\tList<HashMap<String,String>> selectedDatas=ViewUtil.getSelectedData(jTable1);\r\n\t\tif(selectedDatas.size()<1){\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Please select at least 1 item to delete\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tint options = 1;\r\n\t\tif(selectedDatas.size() ==1 ){\r\n\t\t\toptions = JOptionPane.showConfirmDialog(null, \"Are you sure to delete this Item ?\", \"Info\",JOptionPane.YES_NO_OPTION);\r\n\t\t}else{\r\n\t\t\toptions = JOptionPane.showConfirmDialog(null, \"Are you sure to delete these \"+selectedDatas.size()+\" Items ?\", \"Info\",JOptionPane.YES_NO_OPTION);\r\n\t\t}\r\n\t\tif(options==1){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfor(HashMap<String,String> map:selectedDatas){\r\n\t\t\t\r\n\t\t\tdiscountService.deleteDiscountByMap(NameConverter.convertViewMap2PhysicMap(map, \"Discount\"));\r\n\t\t}\r\n\t\tthis.initDatas();\r\n\t}", "public void deleteParticipacao(Integer id) {\n participacaoRepository.deleteById(id);\n //listClient();\n \n}", "public void VaciarPila() {\r\n while (!PilaVacia()) {\r\n EliminarNodo();\r\n }\r\n }", "protected void deleteClicked(View view){\n PriceFinder pf = new PriceFinder();\n pf = this.itm.getItem(this.position);\n this.itm.removeItem(pf);\n try {\n save();\n } catch (IOException e) {\n e.printStackTrace();\n }\n finish();\n }", "@Override\n\tpublic void deleteCpteEpargne(CompteEpargne cpt) {\n\t\t\n\t}", "public void deletePrisoners(String pisid){\r\n String q=\"DELETE FROM prisoners WHERE Prisonerid=?\";\r\n try\r\n {\r\n int k=0;\r\n PreparedStatement st=getConnection().prepareStatement(q);\r\n st.setString(1, pisid);\r\n if(st.executeUpdate()>k){\r\n JOptionPane.showMessageDialog(null,pisid+\"deleted successively\");\r\n \r\n }\r\n }\r\n catch(SQLException x){\r\n JOptionPane.showMessageDialog(null, x.getMessage());\r\n }\r\n \r\n //defines how update can be done\r\n }", "public void localizarEremoverProdutoCodigo(Prateleira prat){\r\n //instacia um auxiliar para procura\r\n Produto mockup = new Produto();\r\n int Codigo = Integer.parseInt(JOptionPane.showInputDialog(null,\"Forneca o codigo do produto a ser removido\" ));\r\n mockup.setCodigo(Codigo); \r\n \r\n //informa que caso encontre o produto remova o da arraylist\r\n boolean resultado = prat.getPrateleira().remove(mockup);\r\n if(resultado){\r\n JOptionPane.showMessageDialog(null, \"Produto de codigo :\" +Codigo+ \" Removido\");\r\n }\r\n else {\r\n JOptionPane.showMessageDialog(null, \"Produto de codigo :\" +Codigo+ \" não encontrado\");\r\n }\r\n }", "@FXML\n\t\t \tprivate void BorrarSongfromPlylist() {\n\t\t \t\tList_Song a = new List_Song();\n\t\t \t\tPlaylist select= tablaPlayList.getSelectionModel().getSelectedItem();\n\t\t \t\tSong selected=tablaCancionesPlaylist.getSelectionModel().getSelectedItem();\n\t\t \t\tif ( selected != null && select!=null) {\n\t\t \t\t\ttry {\n\t\t \t\t\t\ta.setSong(selected);\n\t\t \t\t\t\ta.setList(select);\n\t\t \t\t\t\tList_SongDAO b = new List_SongDAO(a);\n\n\t\t \t\t\t\tb.remove_List_Song();\n\t\t \t\t\t\tconfiguraTablaPlaylist();\n\t\t \t\t\t} catch (Exception e) {\n\t\t \t\t\t\tDialog.showError(\"Eliminar cancion de una playlist\", \"Ha surgido un error al borrarla\", \"\");\n\t\t \t\t\t\te.printStackTrace();\n\t\t \t\t\t}\n\t\t \t\t} else {\n\t\t \t\t\tDialog.showWarning(\"Eliminar cancion de una playlist\", \"Selecciona Cancion\", \"\");\n\t\t \t\t}\n\n\t\t \t}", "@Override\r\n\tpublic void remover(Tipo tipo) {\n String sql = \"delete from tipos_servicos where id = ?\";\r\n try {\r\n stmt = conn.prepareStatement(sql);\r\n stmt.setInt(1, tipo.getId());\r\n \r\n stmt.execute();\r\n } catch (SQLException ex) {\r\n ex.printStackTrace();\r\n }\r\n\t}", "@FXML\n public void deleteSet(MouseEvent e) {\n //confirm first\n Alert confirmAlert = new Alert(AlertType.CONFIRMATION, \"\", ButtonType.YES, ButtonType.NO);\n confirmAlert.setHeaderText(\"Are you sure you want to delete this set?\");\n Optional<ButtonType> result = confirmAlert.showAndWait();\n if (result.get() == ButtonType.YES) {\n //delete from database\n try (\n Connection conn = dao.getConnection();\n PreparedStatement stmt = conn.prepareStatement(\"DELETE FROM Theory WHERE Title = ?\");\n ) {\n conn.setAutoCommit(false);\n stmt.setString(1, txtTitle.getText());\n stmt.executeUpdate();\n conn.commit();\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n\n //delete from interface\n VBox vbxCards = (VBox) apnSetRow.getParent();\n vbxCards.getChildren().remove(apnSetRow);\n }\n }", "int deleteByExample(PrefecturesMtExample example);", "@Override\n\tpublic void delete(BatimentoCardiaco t) {\n\t\t\n\t}", "@Override\n public void excluir(Pessoa pessoa) {\n String sql = \"DELETE FROM pessoa WHERE uuid=?\";\n try {\n this.conexao = Conexao.abrirConexao();\n PreparedStatement statement = conexao.prepareStatement(sql);\n statement.setLong(1, pessoa.getId());\n statement.executeUpdate();\n } catch (SQLException ex) {\n Logger.getLogger(PessoasJDBC.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n Conexao.fecharConexao(conexao);\n }\n\n }", "public static int delete(Periode p){ \n int status=0; \n try{ \n //membuka koneksi\n Connection con=Koneksi.openConnection(); \n //melakukan query database untuk menghapus data berdasarkan id atau primary key\n PreparedStatement ps=con.prepareStatement(\"delete from periode where id=?\"); \n ps.setInt(1,p.getId()); \n status=ps.executeUpdate(); \n }catch(Exception e){System.out.println(e);} \n\n return status; \n }", "public void delete(int posicao){\n /*\n *\n * Nega a existência da posição na Lista.\n * Uma pequena gambiarra para não aninhar expressões if e else\n *\n */\n if(!verificaPosicao(posicao))\n throw new IllegalArgumentException(\"Posição inválida\");\n\n for (int i = posicao; i < this.tamanho-1; ++i){\n this.lista[i] = this.lista[i+1];\n }\n this.tamanho--;\n }", "@Override\r\n\tpublic boolean delete(Pilote obj) {\r\n\t\tboolean succes=true;\r\n\t\tString req = \"delete from \" + TABLE + \" where numPil= ?\" + \";\";\r\n\t\tPreparedStatement pst;\r\n\t\ttry {\r\n\t\t\tpst = Connexion.getInstance().prepareStatement(req);\r\n\t\t\tpst.setInt(1, obj.getNumPil());\r\n\t\t\tpst.executeUpdate();\r\n\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tsucces=false;\r\n\t\t\tSystem.out.println(\"Echec de la tentative delete pilote : \" + e.getMessage()) ;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn succes;\r\n\t}", "public void borrarPiezasAmenazadoras(){\n this.piezasAmenazadoras.clear();\n }", "void deleteTakingPrice() throws PresentationException {\n\t\tint codebar_item = 0;\n\t\tint codeSmkt = 0;\n\n\t\tprinter.printMsg(\"Digite o código do item com tomada de preço a ser excluído: \");\n\t\tcodebar_item = 0;\n\t\tcodebar_item = reader.readNumber();\n\n\t\tprinter.printMsg(\"Digite o código do supermercado com tomada de preço a ser excluído: \");\n\t\tcodeSmkt = 0;\n\t\tcodeSmkt = reader.readNumber();\n\n\t\tprinter.printMsg(\n\t\t\t\t\" Digite a data da tomada de preço do item: (Ex.Formato: '2017-12-16 10:55:53' para 16 de dezembro de 2017, 10 horas 55 min e 53 seg)\");\n\t\tString dateTP = reader.readText();\n\t\tdateTP = reader.readText();\n\n\t\tString pattern = \"yyyy-mm-dd hh:mm:ss\";\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\tDate dateTPF = null;\n\t\ttry {\n\t\t\tdateTPF = simpleDateFormat.parse(dateTP);\n\t\t} catch (ParseException e) {\n\t\t\tthrow new PresentationException(\"Não foi possível formatar a data no padrão definido\", e);\n\t\t\t// e.printStackTrace();\n\t\t}\n\n\t\tif (tpm.deleteTakingPrice(codebar_item, codeSmkt, dateTPF)) {\n\t\t\tprinter.printMsg(\"Tomada de Preço excluído com sucesso!\");\n\t\t} else {\n\t\t\tprinter.printMsg(\"Não existe tomada de preço com estes códigos.\");\n\t\t}\n\t}", "private void eliminarDeMisPropiedades(Casilla casilla){\n if(esDeMipropiedad(casilla)){\n propiedades.remove(casilla.getTituloPropiedad());\n }\n \n }", "private void deletion(String pids) {\n\t\tDeletions(pids);\n\t\t\n\t}", "int deleteByExample(TipologiaExample example);", "@Override\n public void onClick(View v) {\n Pelicula p = MainActivity.peliculas.get(position);\n p.setFavorita(!p.isFavorita());\n }", "public void execute() {\n if (DeleteTableCommand.confirmDeletion()) {\n\n TopsoilTabPane topsoilTabPane = (TopsoilTabPane) topsoilTab.getTabPane();\n topsoilTabPane.getTabs().remove(topsoilTabPane.getSelectedTab());\n }\n\n }", "void deleteFavorite(int id);", "public void iniciarNovaPartida(Integer posicao);", "@Override\r\n\tpublic int deleteProduitPanier(Produit p, Panier pan) {\n\t\treturn 0;\r\n\t}", "@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 }", "@Override\r\n\tpublic void deleteItem() {\n\t\taPList.remove();\r\n\t}", "private void Delete(String[] p) {\n String classname = p[1];\n String attrname = p[2];\n int classid = 0;\n int attrid=0;\n String attrtype=null;\n for (ClassTableItem item:classt.classTable) {\n if (item.classname.equals(classname) && item.attrname.equals(attrname)) {\n classid = item.classid;\n attrid = item.attrid;\n attrtype = item.attrtype;\n break;\n }\n }\n //寻找需要删除的\n OandB ob2 = new OandB();\n for (Iterator it1 = topt.objectTable.iterator(); it1.hasNext();){\n ObjectTableItem item = (ObjectTableItem)it1.next();\n if(item.classid == classid){\n Tuple tuple = GetTuple(item.blockid,item.offset);\n if(Condition(attrtype,tuple,attrid,p[4])){\n //需要删除的元组\n OandB ob =new OandB(DeletebyID(item.tupleid));\n for(ObjectTableItem obj:ob.o){\n ob2.o.add(obj);\n }\n for(BiPointerTableItem bip:ob.b){\n ob2.b.add(bip);\n }\n\n }\n }\n }\n for(ObjectTableItem obj:ob2.o){\n topt.objectTable.remove(obj);\n }\n for(BiPointerTableItem bip:ob2.b) {\n biPointerT.biPointerTable.remove(bip);\n }\n\n }", "private void delete()\n\t{\n\t\ttry\n\t\t{\n\t\t\tConnection con = Connector.DBcon();\n\t\t\tString query = \"select * from items where IT_ID=?\";\n\t\t\t\n\t\t\tPreparedStatement pst = con.prepareStatement(query);\n\t\t\tpst.setString(1, txticode.getText());\n\t\t\tResultSet rs = pst.executeQuery();\n\t\t\t\n\t\t\tint count = 0;\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\tif(count == 1)\n\t\t\t{\n\t\t\t\tint choice = JOptionPane.showConfirmDialog(null, \"Are you sure you want to delete selected item data?\", \"ALERT\", JOptionPane.YES_NO_OPTION);\n\t\t\t\tif(choice==JOptionPane.YES_OPTION)\n\t\t\t\t{\n\t\t\t\t\tquery=\"delete from items where IT_ID=?\";\n\t\t\t\t\tpst = con.prepareStatement(query);\n\t\t\t\t\t\n\t\t\t\t\tpst.setString(1, txticode.getText());\n\t\t\t\t\t\n\t\t\t\t\tpst.execute();\n\t\t\t\t\t\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Deleted Successfully\", \"RESULT\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tloadData();\n\t\t\t\t\n\t\t\t\trs.close();\n\t\t\t\tpst.close();\n\t\t\t\tcon.close();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Record Not Found!\", \"Alert\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\n\t\t\trs.close();\n\t\t\tpst.close();\n\t\t\tcon.close();\n\t\t\t\n\t\t} \n\t\tcatch (Exception e)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, e);\n\t\t}\n\t}", "@Override\n public void onClick(View v) {\n long sid = allListOkLast.get(position).getId();\n Query<GpsPointDetailData> build = db.getGpsPointDetailDao().queryBuilder().where(GpsPointDetailDao.Properties.Id.eq(sid)).build();\n db.deleteGpsPointDetailData(sid);\n adapter.removeItem(position);\n }", "public boolean deletePalvelupisteet();", "public void deleteCt() {\n\t\tlog.info(\"-----deleteCt()-----\");\n\t\t//int index = selected.getCtXuatKho().getCtxuatkhoThutu().intValue() - 1;\n\t\tlistCtKhoLeTraEx.remove(selected);\n\t\tthis.count = listCtKhoLeTraEx.size();\n\t\ttinhTien();\n\t}", "private void chegada() {\n Pessoa pessoa = tablePessoa.getSelectionModel().getSelectedItem();\n if(pessoa==null){\n pessoa=tablePessoa.getItems().get(0);\n \n }\n// if(pessoa!=null){\n Chegada chegada = new Chegada(\n pessoa.getRg(),\n pessoa.getNome(),\n pessoa.getSegundoNome(),\n pessoa.getTelefone(),\n pessoa.getSexo(),\n HoraChegada,\n pessoa.getData()\n \n );\n \n// }\n mainApp.getPersonData2().add(chegada);\n \n }", "public void clickedSpeakerDelete() {\n\t\tif(mainWindow.getSelectedRowSpeaker().length <= 0) ApplicationOutput.printLog(\"YOU DID NOT SELECT ANY PRESENTATION\");\n\t\telse if(mainWindow.getSelectedRowSpeaker().length > 1) ApplicationOutput.printLog(\"Please select only one presentation to edit\");\n\t\telse {\n\t\t\tint tmpSelectedRow = mainWindow.getSelectedRowSpeaker()[0];\n\t\t\tSpeakers tmpSpeaker = speakersList.remove(tmpSelectedRow);\t\t\t\n\t\t\tappDriver.hibernateProxy.deleteSpeaker(tmpSpeaker);\t\n\t\t\trefreshSpeakerTable();\t\t\t\n\t\t}\n\t}", "protected void deleteSelectedControlPoints() {\n\t\tfor (int i = 0; i < selectedPoints.size(); ++i) {\n\t\t\tif (i == 0)\n\t\t\t\tpush();\n\n\t\t\tfor (int j = 0; j < selectedCurves.size(); ++j) {\n\t\t\t\tint temp;\n\t\t\t\t// Als het controlepunt tot de curve behoort --> het punt uit\n\t\t\t\t// die curve verwijderen.\n\t\t\t\twhile ((temp = selectedCurves.elementAt(j).containsInputPointi(\n\t\t\t\t\t\tselectedPoints.elementAt(i))) != -1) {\n\t\t\t\t\tselectedCurves.elementAt(j).getInput().remove(temp);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Het punt ook uit de container halen.\n\t\t\tselectionTool.deleteControlPoint(selectedPoints.elementAt(i).X(),\n\t\t\t\t\tselectedPoints.elementAt(i).Y());\n\t\t}\n\n\t\t// Indien curves nu leeg blijken te zijn --> die curves verwijderen.\n\t\tfor (int j = 0; j < selectedCurves.size(); ++j) {\n\t\t\tif (selectedCurves.elementAt(j).getNbInputPoints() == 0) {\n\t\t\t\tselectionTool.deleteCurve(selectedCurves.elementAt(j));\n\t\t\t\tselectedCurves.remove(j--);\n\t\t\t}\n\t\t}\n\n\t\trecalculateSelectedCurves(); // De curves herberekenen.\n\t\tcurves.addAll(selectedCurves); // De curves deselecteren.\n\t\tselectedCurves.clear();\n\t\tselectedPoints.clear();\n\t\tpushNew();\n\t}", "@Override\n public void onClick(View view) {\n long result = typeBookDAO.deleteTypeBook(typeBook.id);\n\n if (result < 0) {\n\n Toast.makeText(context,\"Xoa ko thanh cong!!!\",Toast.LENGTH_SHORT).show();\n\n } else {\n Toast.makeText(context,\"Xoa thanh cong!!!\",Toast.LENGTH_SHORT).show();\n // xoa typebook trong arraylist\n arrayList.remove(position);\n\n // f5 adapter\n notifyDataSetChanged();\n\n }\n\n\n\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t Professor p =new Professor();\n\t\t\n\t\t ArrayList<Professor>professores = new ArrayList<>();\n\t\t\n\t\t \n\t int op;\n\t\t \n\t\t \n\t\t do {\n\t\t \t\n\t\t op= Integer.parseInt(JOptionPane.showInputDialog(\"digite 1 para cadastra \\n 2 para listar \\n 3 para remover \\n 0 para sair\"));\n\t\t \n\t\t switch (op ) {\n\t\t \n\t\t case 1 :\n boolean tem=false;\n\t\t \t\n\t\t \tString pnome= JOptionPane.showInputDialog(\"digite o nome\");\n\t\t \t\t int pcodigo = Integer.parseInt(JOptionPane.showInputDialog(\"digite o codigo\"));\n\t\t\t\t\t\n\t\t \t\t for(Professor pr : professores) {\n\t\t \t\t \n\t\t\t\t \t\t if(pr.getCodigo() ==pcodigo) {\n\t\t\t\t \t\t\t \n\t\t\t\t \t\t tem=true;\n\t\t\t\t\t\t\t\n\t\t\t\t \t\t op=0;\n\t\t\t\t\t\t\t\n\t\t\t\t \t\t break;\n\t\t\t\t\t \t\t\n\t\t\t\t \t\t } \n\t\t \t\t } \n\t\t \t\t \n\t\t\t\t\t \t\t if(tem==false) {\n\t\t\t\t\t \t\t\t \n\t\t\t\t\t \t\t\t p= new Professor(pnome,pcodigo);\n\t\t\t\t\t \t\t\t professores.add(p);\n\t\t\t\t\t \t\t\t \n\t\t\t\t\t \t\t }else {\n\t\t\t\t\t \t\t\t \n\t\t\t\t\t \t\t\t System.out.print(\"Ja existe esse codigo\");\n\t\t\t\t\t \t\t\t op=0;\n\t\t\t\t\t \t\t }\n\t\t\t\t\t \t\t \n\t\t\t\t\t \t\t \n\t\t break;\n\t\t \n\t\t case 2 :\n\n\t\t \t for(Professor pr : professores) {\n\t\t \t\t\t\n\t\t \t\t\t System.out.println(\"nome: \"+pr.getNome()+\"\\ncodigo: \"+pr.getCodigo());\n\t\t \t\t\t\n\t\t \t\t }\n\t\t \t\n\t\t break;\n\t\t \n\t\t case 3 :\n \n\t\t\t \t\n\t\t \t\n\t\t \t\n\t\t \tfor(int i=0;i<professores.size();i++) {\n\t\t\t\t\t\t \n\t\t\t \t professores.remove(i);\n\t\t\t \t}\n\t\t break;\n\t\t \n\t\t \n\t\t }\n\t\t\n\t\t } while(op !=0);\n\t\t \n\t\t \n\t\t \n\t}", "private void delete() {\n\n\t}", "public abstract void borrarEstadosPropuestas();", "int deleteByExample(MovimientoExample example);", "private void limparPesquisasRecentes() {\n facade.deletarTodosTermos();\n pesquisas = facade.obterTermos();\n adapter.clear();\n adapter.notifyDataSetChanged();\n listViewPesquisas.refreshDrawableState();\n\n }", "@Override\n\tpublic void delete(CorsoDiLaurea corso) {\n\t\t\n\t}", "void remover(Professor p)throws ProfessorNExisteException;", "public void eliminar(Provincia provincia) throws BusinessErrorHelper;", "public void onClick(DialogInterface dialog, int id) {\n Pokemon crtPokemon = database.PokemonDao().getEntries().get(index);\n database.PokemonDao().delete(crtPokemon);\n finish();\n }", "@FXML\n private void setRemoveButton() {\n Coach selectedRow = coachesTable.getSelectionModel().getSelectedItem();\n try {\n Connection conn = DatabaseHandler.getInstance().getConnection();\n try (Statement st = conn.createStatement()) {\n st.execute(\"delete from szkolka.uzytkownik where id_u=\" + selectedRow.getId() + \";\");\n coachesTable.getItems().remove(coachesTable.getSelectionModel().getSelectedItem());\n removeButton.setDisable(true);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "private void populaParteCorpo()\n {\n ParteCorpo p1 = new ParteCorpo(\"Biceps\");\n parteCorpoDAO.insert(p1);\n ParteCorpo p2 = new ParteCorpo(\"Triceps\");\n parteCorpoDAO.insert(p2);\n ParteCorpo p3 = new ParteCorpo(\"Costas\");\n parteCorpoDAO.insert(p3);\n ParteCorpo p4 = new ParteCorpo(\"Lombar\");\n parteCorpoDAO.insert(p4);\n ParteCorpo p5 = new ParteCorpo(\"Peito\");\n parteCorpoDAO.insert(p5);\n ParteCorpo p6 = new ParteCorpo(\"Panturrilha\");\n parteCorpoDAO.insert(p6);\n ParteCorpo p7 = new ParteCorpo(\"Coxas\");\n parteCorpoDAO.insert(p7);\n ParteCorpo p8 = new ParteCorpo(\"Gluteos\");\n parteCorpoDAO.insert(p8);\n ParteCorpo p9 = new ParteCorpo(\"Abdomen\");\n parteCorpoDAO.insert(p9);\n ParteCorpo p10 = new ParteCorpo(\"Antebraço\");\n parteCorpoDAO.insert(p10);\n ParteCorpo p11 = new ParteCorpo(\"Trapezio\");\n parteCorpoDAO.insert(p11);\n ParteCorpo p12 = new ParteCorpo(\"Ombro\");\n parteCorpoDAO.insert(p12);\n }", "public void doDeleteconfirm ( RunData data)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\t\tSet deleteIdSet = new TreeSet();\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\tString[] deleteIds = data.getParameters ().getStrings (\"selectedMembers\");\n\t\tif (deleteIds == null)\n\t\t{\n\t\t\t// there is no resource selected, show the alert message to the user\n\t\t\taddAlert(state, rb.getString(\"choosefile3\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdeleteIdSet.addAll(Arrays.asList(deleteIds));\n\t\t\tList deleteItems = new Vector();\n\t\t\tList notDeleteItems = new Vector();\n\t\t\tList nonEmptyFolders = new Vector();\n\t\t\tList roots = (List) state.getAttribute(STATE_COLLECTION_ROOTS);\n\t\t\tIterator rootIt = roots.iterator();\n\t\t\twhile(rootIt.hasNext())\n\t\t\t{\n\t\t\t\tBrowseItem root = (BrowseItem) rootIt.next();\n\n\t\t\t\tList members = root.getMembers();\n\t\t\t\tIterator memberIt = members.iterator();\n\t\t\t\twhile(memberIt.hasNext())\n\t\t\t\t{\n\t\t\t\t\tBrowseItem member = (BrowseItem) memberIt.next();\n\t\t\t\t\tif(deleteIdSet.contains(member.getId()))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(member.isFolder())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(ContentHostingService.allowRemoveCollection(member.getId()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdeleteItems.add(member);\n\t\t\t\t\t\t\t\tif(! member.isEmpty())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnonEmptyFolders.add(member);\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{\n\t\t\t\t\t\t\t\tnotDeleteItems.add(member);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(ContentHostingService.allowRemoveResource(member.getId()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdeleteItems.add(member);\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\tnotDeleteItems.add(member);\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\tif(! notDeleteItems.isEmpty())\n\t\t\t{\n\t\t\t\tString notDeleteNames = \"\";\n\t\t\t\tboolean first_item = true;\n\t\t\t\tIterator notIt = notDeleteItems.iterator();\n\t\t\t\twhile(notIt.hasNext())\n\t\t\t\t{\n\t\t\t\t\tBrowseItem item = (BrowseItem) notIt.next();\n\t\t\t\t\tif(first_item)\n\t\t\t\t\t{\n\t\t\t\t\t\tnotDeleteNames = item.getName();\n\t\t\t\t\t\tfirst_item = false;\n\t\t\t\t\t}\n\t\t\t\t\telse if(notIt.hasNext())\n\t\t\t\t\t{\n\t\t\t\t\t\tnotDeleteNames += \", \" + item.getName();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnotDeleteNames += \" and \" + item.getName();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\taddAlert(state, rb.getString(\"notpermis14\") + notDeleteNames);\n\t\t\t}\n\n\n\t\t\t/*\n\t\t\t\t\t//htripath-SAK-1712 - Set new collectionId as resources are not deleted under 'more' requirement.\n\t\t\t\t\tif(state.getAttribute(STATE_MESSAGE) == null){\n\t\t\t\t\t String newCollectionId=ContentHostingService.getContainingCollectionId(currentId);\n\t\t\t\t\t state.setAttribute(STATE_COLLECTION_ID, newCollectionId);\n\t\t\t\t\t}\n\t\t\t*/\n\n\t\t\t// delete item\n\t\t\tstate.setAttribute (STATE_DELETE_ITEMS, deleteItems);\n\t\t\tstate.setAttribute (STATE_DELETE_ITEMS_NOT_EMPTY, nonEmptyFolders);\n\t\t}\t// if-else\n\n\t\tif (state.getAttribute(STATE_MESSAGE) == null)\n\t\t{\n\t\t\tstate.setAttribute (STATE_MODE, MODE_DELETE_CONFIRM);\n\t\t\tstate.setAttribute(STATE_LIST_SELECTIONS, deleteIdSet);\n\t\t}\n\n\n\t}", "public void ordenaPontos(){\r\n\t\tloja.ordenaPontos();\r\n\t}", "int deleteByExample(MenuInfoExample example);", "public void pesquisar() {\n\t\tthis.alunos = this.alunoDao.listarTodos();\n\t\tthis.quantPesquisada = this.alunos.size();\n\t\tSystem.out.println(\"Teste\");\n\n\t}", "@Override\n\tpublic void posDelete() {\n\t\t\n\t}", "@Override\n\tpublic void posDelete() {\n\t\t\n\t}", "@Override\n\tpublic void posDelete() {\n\t\t\n\t}", "public void delete(MainItemOrdered mainItemOrdered);", "@Override\n\tpublic List<Pizza> getAllPizzas() {\n\t\treturn mongoTemplate.findAll(Pizza.class);\n\t}", "int deleteByExample(BasicInfoPrecursorProcessTypeExample example);", "public void onClick(DialogInterface dialog,int id) {\n \n\n bookMarkList.remove(selectedItem);\n iadapter.notifyDataSetChanged();\n // Toast.makeText(getApplicationContext(),\"delete\"+ valuebpage+ \" name is \"+ valuebname,Toast.LENGTH_LONG).show();\n // dialogBookmark.dismiss();\n dialog.cancel();\n }", "private void cmd_deleteSelection(){\n\t\tm_frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));\n\t\tif (ADialog.ask(getWindowNo(), m_frame.getContainer(), \"DeleteSelection\"))\n\t\t{\t\n\t\t\tint records = deleteSelection(detail);\n\t\t\tsetStatusLine(Msg.getMsg(Env.getCtx(), \"Deleted\") + records, false);\n\t\t}\t\n\t\tm_frame.setCursor(Cursor.getDefaultCursor());\n\t\tbDelete.setSelected(false);\n\t\texecuteQuery();\n\t\t\n\t}", "@Override\r\n\tpublic void adminSelectDelete() {\n\t\t\r\n\t}", "public void deleteCita(int id){\n try {\n PreparedStatement preparedStatement = con.prepareStatement(\"DELETE FROM paciente WHERE id_paciente=?;\");\n preparedStatement.setInt(1,id);\n preparedStatement.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "private void deleteSelectedWaypoints() {\r\n\t ArrayList<String> waypointsToRemove = new ArrayList<String>();\r\n\t int size = _selectedList.size();\r\n\t for (int i = _selectedList.size() - 1; i >= 0; --i) {\r\n boolean selected = _selectedList.get(i);\r\n if (selected) {\r\n waypointsToRemove.add(UltraTeleportWaypoint.getWaypoints().get(i).getWaypointName());\r\n }\r\n }\r\n\t UltraTeleportWaypoint.removeWaypoints(waypointsToRemove);\r\n\t UltraTeleportWaypoint.notufyHasChanges();\r\n\t}", "int deleteByExample(ParUsuariosExample example);", "@SuppressWarnings(\"static-access\")\r\n\t@Test\r\n\tpublic void crearPeliculasTest() {\r\n\r\n\t\tpd.crearPeliculas();\r\n\t\tpd.pm.deletePersistent(pd.filmA);\r\n\t\tpd.pm.deletePersistent(pd.filmB);\r\n\t\tpd.pm.deletePersistent(pd.filmC);\r\n\t\tpd.pm.deletePersistent(pd.filmD);\r\n\r\n\t}", "public void pagarSaidaDaPrisao() throws Exception {\n if (listaJogadoresNaPrisao.contains(listaJogadores.get(jogadorAtual()).getNome())) {\n listaJogadoresNaPrisao.remove(listaJogadores.get(jogadorAtual()).getNome());\n listaJogadores.get(jogadorAtual()).setTentativasSairDaPrisao(0);\n listaJogadores.get(jogadorAtual()).retirarDinheiro(50);\n\n } else {\n print(\"\\tTentou tirar \" + listaJogadores.get(jogadorAtual()).getNome());\n throw new Exception(\"player is not on jail\");\n }\n\n this.pagouPrisaoRecentemente = false;\n }", "@Override\n public void deletarPessoa(int codigo) throws ErroDAOException {\n }", "int deleteByPrimaryKey(Integer prefecturesId);", "public void update(Pizza pizza, Pizza newPizza){\n for(Pizza p : pizzas){\n if(p.getID() == pizza.getID()){\n pizzas.remove(p);\n newPizza.setID(pizza.getID());\n pizzas.add(newPizza);\n break;\n }\n }\n }", "public void eliminarTipoPago(String codTipoPago) throws Exception {\n if (this.tiposPagos.containsKey(codTipoPago)) {\r\n this.generarAuditoria(\"BAJA\", \"TIPOPAGO\", codTipoPago, \"\", GuiIngresar.getUsuario());\r\n this.tiposPagos.remove(codTipoPago);\r\n setChanged();\r\n notifyObservers();\r\n //retorno = true;\r\n } else {\r\n throw new Exception(\"El tipo pago no Existe\");\r\n }\r\n //return retorno;\r\n }", "boolean delete(PageId pageId);", "public void delete(String idAvion)\n\t{\n\t}", "void removePickDetail(Question question);", "private Delete() {}", "private Delete() {}", "public static void pesquisarTest() {\n\t\t\n\t\tlistaProfissional = profissionalDAO.lista();\n\n\t\t//user.setReceitas(new ArrayList<Receita>());\n\t\t\n\t\t\n\t\tSystem.out.println(\"Entrou PEsquisar ====\");\n\t\tSystem.out.println(listaProfissional);\n\n\t}", "void deleteMataKuliah (int id);", "public void clearProteges(){\n ActiveAndroid.execSQL(\"delete from proteges\");\n }" ]
[ "0.64635384", "0.58640075", "0.58536947", "0.5838332", "0.58119774", "0.5739398", "0.5709192", "0.56969714", "0.5665282", "0.5644845", "0.56372774", "0.56353354", "0.5630396", "0.5606952", "0.5595484", "0.55952495", "0.5587653", "0.55722713", "0.5552921", "0.5550357", "0.55309075", "0.5523004", "0.5515681", "0.5482848", "0.5472173", "0.546158", "0.5452119", "0.5440627", "0.5438053", "0.54222566", "0.5409446", "0.54050016", "0.53820676", "0.53762597", "0.5374674", "0.53666914", "0.5354666", "0.5339694", "0.53266037", "0.53163844", "0.52788234", "0.5274555", "0.5265759", "0.52528477", "0.52521807", "0.52451473", "0.524337", "0.52387404", "0.5233905", "0.52313983", "0.52280414", "0.52255404", "0.522321", "0.5214681", "0.5214022", "0.52133274", "0.52068514", "0.52046674", "0.5204584", "0.52018565", "0.5200278", "0.51879543", "0.5182966", "0.51806843", "0.5176982", "0.5176618", "0.5172383", "0.5166019", "0.51608133", "0.51574606", "0.515415", "0.51454836", "0.5145103", "0.5144083", "0.5143323", "0.5143323", "0.5143323", "0.5142832", "0.5141048", "0.5140802", "0.51282686", "0.5126949", "0.5126381", "0.51254654", "0.5112689", "0.5108682", "0.5104957", "0.5103726", "0.5097998", "0.5092494", "0.50890523", "0.50885755", "0.508574", "0.5083807", "0.50769264", "0.5076532", "0.5076532", "0.5070571", "0.50632644", "0.5063152" ]
0.5894346
1
This method will be called when a MessageEvent is posted (in the UI thread for Toast)
@Subscribe(threadMode = ThreadMode.MAIN) public void onMessageEvent(MessageEventBus event) { for (int i = 0; i < list.size(); i++) { User userData = list.get(i); Integer id = userData.getId(); String name = userData.getName(); String username = userData.getUsername(); String email = userData.getEmail(); Log.i("@@@@@", "onMessageEvent : userData : " + userData.toString()); textView.append("User Id : " + id + "\n" + "Name : " + name + "\n" + "UserName : " + username + "\n" + "Email : " + email + "\n\n"); } Toast.makeText(this, event.message, Toast.LENGTH_LONG).show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onEventMainThread(MessageEvent event){\n Toast.makeText(this, event.message, Toast.LENGTH_SHORT).show();\n }", "@Subscribe(threadMode = ThreadMode.MAIN)\n public void onMessageEvent(MessageEvent event) {\n\n // Display message in TextView\n logMessage(event.getMessage());\n }", "@Subscribe(threadMode = ThreadMode.MAIN)\n public void onMessageEvent(MessageEvent event) {\n btn.setText(event.Message);\n }", "@Override\n public void run() {\n Message message = mHandler.obtainMessage(1);\n mHandler.sendMessage(message);\n }", "@Override\n public void onMessageReceived(JsonElement jsonElement) {\n try{\n mHandler.post(new Runnable() {\n @Override\n public void run() {\n\n Toast.makeText(context,jsonElement.toString(),Toast.LENGTH_LONG).show();\n }\n });}catch (Exception ex){\n ex.printStackTrace();\n }\n System.out.println(\"test we have new sms received : \"+jsonElement.toString());\n }", "@Subscribe\n public void onMessageEvent(MessageEvent event){\n// Toast.makeText(this, event.message+\"splash\", Toast.LENGTH_SHORT).show();\n }", "@Override\n public void handleMessage(Message msg) {\n Toast.makeText(context, \"complete!!!\", Toast.LENGTH_LONG);\n }", "public void handleMessageEvent(StunMessageEvent e) {\n delegate.handleMessageEvent(e);\n }", "public void handleMessageEvent(StunMessageEvent e) {\n delegate.handleMessageEvent(e);\n }", "@Override\r\n public void handleMessage(Message inputMessage) {\n actualMainActivityInstance.putDataOnPage((String)inputMessage.obj);\r\n }", "@Override\n\tpublic void onMessage(Object arg0) {\n\t\t\n\t}", "void onMessageReceived(Message message);", "@Override\n public void run() {\n setToast(recvInput);\n }", "@Override\n public void run() {\n setToast(recvInput);\n }", "@Override\n public void run() {\n setToast(recvInput);\n }", "@Override\n public void run() {\n setToast(recvInput);\n }", "@Override\n public void run() {\n setToast(recvInput);\n }", "@Override\n public void handleMessage(Message msg) {\n super.handleMessage(msg);\n Log.d(TAG,\"In Handler, Msg = \"+msg.arg1);\n }", "@Override\n public void handleMessage(Message msg) {\n Bundle bundle = msg.getData();\n /**\n * Values coming from Other thread\n */\n Log.d(\"Message\",\"Message from UI thread is\"+bundle.getString(\"MSG2_FROM_UI\")+\"\");\n Log.d(\"Message\",\"Message from First thread is\"+msg.arg1+\"\");\n }", "public void OnMessageReceived(String msg);", "@Override\n\tpublic void onMessageBackgroundThread(Object arg0) {\n\t\t\n\t}", "@Override\n public void onMessage(String channel, String message) {\n responseMessage = message;\n onPostExecute(responseMessage);\n }", "void onNewMessage(String message);", "public void onMessage(Message message) {\n lastMessage = message;\n\n }", "public void onMessage(String message) {\n\t\t\n\t}", "@Override\r\n\tpublic void onMessage(BmobMsg message) {\n\t\trefreshNewMsg(message);\r\n\t}", "public void handleMessageEvent(StunMessageEvent e) {\n delegate.processRequest(e);\n }", "private void getMessage(MessageEvent messageEvent) {\n if(GUI.getInstance().getBusiness().getCurrentChat() != null && messageEvent.getMessageIn().getChatId() == GUI.getInstance().getBusiness().getCurrentChat().getId()) {\n Platform.runLater(() -> {\n IMessageIn message = messageEvent.getMessageIn();\n messages.add(message);\n });\n }\n }", "@Override\n public void run() {\n Message message = new Message();\n message.what = 4;\n handler.sendMessage(message);\n }", "@Override\n\tpublic void onMessageRecieved(Message arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onMessage( String message ) {\n\t\tlog.info(\"received: \" + message);\n\t}", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\r\n public void onMessageReceived(RemoteMessage remoteMessage) {\n Log.d(TAG, \"From: \" + remoteMessage.getFrom());\r\n\r\n // Check if message contains a data payload.\r\n if (remoteMessage.getData().size() > 0) {\r\n Log.d(TAG, \"Message data payload: \" + remoteMessage.getData());\r\n\r\n }\r\n\r\n // Check if message contains a notification payload.\r\n if (remoteMessage.getNotification() != null) {\r\n //Log.d(TAG, \"Message Notification Body: \" + remoteMessage.getNotification().getBody());\r\n\r\n final String msg = remoteMessage.getNotification().getBody();\r\n\r\n Handler handler = new Handler(Looper.getMainLooper());\r\n handler.post(new Runnable() {\r\n\r\n @Override\r\n public void run() {\r\n Toast.makeText(MyService.this.getApplicationContext(), msg,Toast.LENGTH_SHORT).show();\r\n }\r\n });\r\n }\r\n\r\n }", "public void handleMessage(Message msg) {\n // if the message 'what' matches the constant MESSAGE_SENT, it\n // means the callback\n // to onNdefPushComplete happened which means the NFC was a\n // success\n if (msg.what == MESSAGE_SENT) {\n Toast.makeText(getApplicationContext(), \"Tag written successfully!!\", Toast.LENGTH_LONG).show();\n }\n }", "@Override\n public void run() {\n Message message = new Message();\n message.what=1;\n handler.sendMessage(message);\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n String message = intent.getStringExtra(\"message\");\n Log.d(\"receiver\", \"Got message: \" + message);\n showToastMessage(message);\n }", "@Override\n\t \t\tpublic void handleMessage(Message msg) {\n\t \t\treceive();\n\t \t\t\t// myTextView.setText(String.valueOf(cnt));\n\t \t\t}", "void onSendMessageComplete(String message);", "@Override public void run() {\n boolean looperIsNotPreparedInCurrentThread = Looper.myLooper() == null;\n\n if (looperIsNotPreparedInCurrentThread) {\n Looper.prepare();\n }\n\n handler = new Handler(new Handler.Callback() {\n @Override public boolean handleMessage(Message message) {\n Log.d(getClass().getSimpleName(), message.getData().toString());\n\n if (handlerCallback != null) {\n // note: we can avoid this callback by using event bus depending on concrete use case\n handlerCallback.handleMessage(message.getData());\n }\n return true;\n }\n });\n\n if (looperIsNotPreparedInCurrentThread) {\n Looper.loop();\n }\n }", "void onMessageToast(String string);", "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}", "@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 void onMessage(Message arg0) {\n\r\n\t}", "public void onLogMessage(String message);", "public void sendMessage()\r\n {\r\n MessageScreen messageScreen = new MessageScreen(_lastMessageSent);\r\n pushScreen(messageScreen);\r\n }", "@Override\n\tpublic void ActOnNotification(String message) {\n\t \tSystem.out.println(\"Sending Event\");\n\t}", "@Override\n public void show() {\n mHandler.obtainMessage(0).sendToTarget();\n }", "@Override\n public void handleMessage(Message message) {}", "public void tongOnUI(final String msg) {\r\n\t\trunOnUiThread(new Runnable() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\tToast.makeText(SmartActivity.this, msg, Toast.LENGTH_LONG).show();\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public void onEventMainThread(BusEventAnnouncements event) {\n Log.d(TAG, event.toString());\n List<Announcement> announcements = event.getAnnouncements();\n ChannelController.storeAnnouncements(getActivity(), announcements);\n // Announcements were refreshed. Hide loading animation.\n swipeRefreshLayout.setRefreshing(false);\n\n if (!announcements.isEmpty()) {\n // If announcement data was updated show message no matter if it was a manual or auto refresh.\n String message = getString(R.string.announcement_info_updated);\n toast.setText(message);\n toast.show();\n } else {\n if (!isAutoRefresh) {\n // Only show up to date message if a manual refresh was triggered.\n String message = getString(R.string.announcement_info_up_to_date);\n toast.setText(message);\n toast.show();\n }\n }\n }", "@Override\n public void onMessageViewClick(View view, Message message) {\n }", "@Override\r\n public void handleMessage(Message msg) {\n Context context=mContext.get();\r\n try {\r\n switch (msg.what) {\r\n case -1:\r\n Toast.makeText(context, String.format(\"Exception: %s\", (String) msg.obj), Toast.LENGTH_LONG).show();\r\n break;\r\n case -2:\r\n Toast.makeText(context, (String) msg.obj, Toast.LENGTH_LONG).show();\r\n break;\r\n case -3:\r\n Toast.makeText(context, \"keine Internetverbindung\", Toast.LENGTH_LONG).show();\r\n break;\r\n }\r\n } catch(Exception ex) {\r\n Toast.makeText(context, String.format(\"Exception: %s\", ex.getMessage()), Toast.LENGTH_LONG).show();\r\n }\r\n }", "public void run() {\n handler.post(new Runnable() {\n public void run() {\n\n //TODO CALL NOTIFICATION FUNC\n String lg_ti = \"Test.\";\n String des_ti = \"The license valid until \";\n String ban_ti = \"Warning!\";\n getNotificationData();\n //notificationShow(des_ti,lg_ti,ban_ti);\n }\n });\n }", "public void receiveMyMessage(String msg) {\n \t\n final String str = msg;\n \n mHandler.post(new Runnable() {\n @Override\n public void run() {\n // This gets executed on the UI thread so it can safely modify Views\n receivedTextView1.setText(str);\n }\n });\n }", "@Override\n public void handleMessage(Message msg) {\n super.handleMessage(msg);\n postInvalidate();\n }", "private void sendMessageToObservers(Runnable message) {\n\t\tnew Handler(Looper.getMainLooper()).post(message);\n\t}", "@Override\n public void onMessageReceived(MessageEvent messageEvent) {\n if (messageEvent.getPath().equals(\"/watch/newSmokeEvents\")) {\n\n /* ...retrieve the message */\n final byte[] receivedEvents = messageEvent.getData();\n\n Intent messageIntent = new Intent();\n messageIntent.setAction(Intent.ACTION_SEND);\n messageIntent.putExtra(\"NEW_EVENTS_DATA\", receivedEvents);\n\n /* Broadcast the received Data Layer messages locally -> send to Synchronize */\n LocalBroadcastManager.getInstance(this).sendBroadcast(messageIntent);\n }\n else if (messageEvent.getPath().equals(\"/watch/newSensorData\")){\n\n Intent synchronizeServiceIntent = new Intent(this, SynchronizeService.class);\n synchronizeServiceIntent.putExtra(\"RECEIVED_SYNC_HASH_LIST_REQUEST\", true);\n SynchronizeService.enqueueWork(this, synchronizeServiceIntent);\n\n }\n else {\n super.onMessageReceived(messageEvent);\n }\n\n }", "public void ToastMessage() {\n\n // create toast message object\n final Toast toast = Toast.makeText(Product_Details_Page_Type_4.this,\n \"Product added to cart\",Toast.LENGTH_LONG);\n // show method call to show Toast message\n toast.show();\n\n // create handler to set duration for toast message\n Handler handler = new Handler() {\n\n @Override\n public void close() {\n // set duration for toast message\n toast.setDuration(100);\n // cancel toast message\n toast.cancel();\n }\n @Override\n public void flush() {}\n\n @Override\n public void publish(LogRecord record) {}\n };\n }", "private void doToast() {\n\t\tEditText editText = (EditText) findViewById(R.id.edit_message);\r\n\t\tString message = editText.getText().toString();\r\n\t\t\r\n\t\t// Create and send toast\r\n\t\tContext context = getApplicationContext();\r\n\t\tint duration = Toast.LENGTH_SHORT;\r\n\t\tToast toast = Toast.makeText(context, message, duration);\r\n\t\ttoast.show();\r\n\t}", "@Override\n public void messageArrived(String topic, MqttMessage message) {\n if(topic.equals(UserData.topicIn)) {\n String msg = message.toString();\n GuiUpdater.updateConsoleWithResponse(msg);\n }\n }", "@Override\r\n public void handleMessage(Message message) \r\n {\r\n switch (message.what) \r\n {\r\n case BlueToothService.MESSAGE_REMOTE_CODE:\r\n Utilities.popToast (\"MESSAGE_REMOTE_CODE : \" + message.obj);\r\n break;\r\n case BlueToothService.MESSAGE_REQUEST:\r\n Utilities.popToast (\"MESSAGE_REQUEST : \" + message.obj);\r\n break;\r\n default:\r\n super.handleMessage(message);\r\n }\r\n }", "public void messageReceived(Message m) {\n\t\t\r\n\t}", "public void tingOnUI(final String msg) {\r\n\r\n\t\trunOnUiThread(new Runnable() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\tToast.makeText(SmartActivity.this, msg, Toast.LENGTH_SHORT).show();\r\n\t\t\t}\r\n\t\t});\r\n\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 }", "@Override\n\t\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\t\tsuper.handleMessage(msg);\n\t\t\t\t\tif (msg.what == touchEventId1) {\n\t\t\t\t\t\tToast.makeText(LevelActivity.this, \"scroll begin\", 100)\n\t\t\t\t\t\t\t\t.show();\n\t\t\t\t\t}\n\t\t\t\t\tif (msg.what == touchEventId2) {\n\t\t\t\t\t\tToast.makeText(LevelActivity.this, \"scroll stop\", 100)\n\t\t\t\t\t\t\t\t.show();\n\t\t\t\t\t}\n\t\t\t\t}", "@Override\n public void run() {\n mHandler.post(new Runnable() {\n\n @Override\n public void run() {\n // display toast\n locationupdate();\n }\n\n });\n }", "@Override\n public void run() {\n Toast.makeText(rootView.getContext(), mensaje,\n Toast.LENGTH_LONG).show();\n }", "@Override\n\tpublic void onDirectMessage(DirectMessage directMessage) {\n\n\t}", "@Override\r\n\t\tpublic void handleMessage(Message msg) {\n\t\t\ttry {\r\n\t\t\t\tpd.dismiss();\r\n\t\t\t}\r\n\t\t\tcatch (Exception ex)\r\n\t\t\t{\r\n\r\n\t\t\t}\r\n\t\t\tShowData();\r\n\t\t}", "@Override\r\n public void handleMessage(Message msg) {\n }", "private void showToast(final String message) {\n main.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(main.getApplicationContext(), message, Toast.LENGTH_LONG).show();\n }\n });\n }", "@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tMessage message = new Message(); \r\n\t\t\t\t\t\tmessage.what = LoginActivity.LOGIN_SUCCESS;\r\n\t\t\t\t\t\tLoginActivity.mHandler.sendMessage(message);\r\n\t\t\t\t\t}", "@Override\n public void onMessageReceived(RemoteMessage remoteMessage) {\n }", "public void onMessage(Message message)\n {\n \tObjectMessage om = (ObjectMessage) message;\n\t\tTypeMessage mess;\n\t\ttry {\n\t\t\tmess = (TypeMessage) om.getObject();\n\t\t\tint id = om.getIntProperty(\"ID\");\n\t\t\tview.updatelistTweetFeed(mess, id);\n\t\t\tSystem.out.println(\"received: \" + mess.toString());\n\t\t} catch (JMSException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t\n }", "public void MessageEvent(ChannelMessageEvent ev) {\n\t\t\n\t\tif (ev == null)\n\t\t\treturn;\n\t\tstdGroup.fireEventStatus(new StatusEvent(this,\"Channel \"+ ev.getChannelName() + \"is speaking to me\"));\n\t\tsetChanged();\n\t\tnotifyObservers(ev);\n\t\tstdGroup.fireEventStatus(new StatusEvent(this,\"Notifying for channel \"+ ev.getChannelName() + \" all views\"));\n\t\t\n\t}", "public void onMessage(Message message) {\n gameManager.onMessage(message);\n }", "@Override\n public void run() {\n Message message;\n while(true){\n logger.debug(\"SMS Reader Thread is waiting for incoming messages\");\n message = messageQueue.getInputSMS().poll() ;\n logger.debug(\"SMS message has been received from \"+ message.getFromWhom());\n view.receivedMessages.append(message.getFromWhom().toString() +\" :\");\n view.receivedMessages.append(message.getData() + \"\\n\");\n view.setPreferredSize(new Dimension(view.getSize().height+10, view.getSize().width));\n view.jScrollPaneReceivedMessages.getVerticalScrollBar().setValue(view.jScrollPaneReceivedMessages.getVerticalScrollBar().getMaximum());\n view.revalidate();\n }\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tLog.e(\"timer\",\"calling\");\n\t\t\t\tMessage message = mHandler.obtainMessage();\n\t\t\t\tmessage.sendToTarget();\n\n\t\t\t}", "@Override\n public void onEvent(EMNotifierEvent event) {\n message = (EMMessage) event.getData();\n messageBean.setGetMsgCode(MessageContant.receiveMsgByListChanged);\n messageBean.setEmMessage(message);\n\n eventBus.post(messageBean);\n }", "public void messageReceived(Message message) {\n\r\n\t\tLog.info(message.getMsg());\r\n\t}", "private void onMessage(JsonRpcMessage msg) {\n List<JsonRpcMessage> extraMessages = super.handleMessage(msg, true);\n notifyMessage(msg);\n for(JsonRpcMessage extraMsg: extraMessages) {\n notifyMessage(extraMsg);\n }\n }", "@Override\n public void handleMessage(Message message) {\n stopProgressDialog();\n swipeRefreshLayout.setRefreshing(false);\n switch (message.what) {\n case Flinnt.SUCCESS:\n try {\n //Helper.showToast(\"Success\", Toast.LENGTH_SHORT);\n if (LogWriter.isValidLevel(Log.INFO))\n LogWriter.write(\"SUCCESS_RESPONSE : \" + message.obj.toString());\n if (message.obj instanceof WishResponse) {\n updateCourseList((WishResponse) message.obj);\n }\n } catch (Exception e) {\n LogWriter.err(e);\n }\n\n break;\n case Flinnt.FAILURE:\n try {\n if (LogWriter.isValidLevel(Log.INFO))\n LogWriter.write(\"FAILURE_RESPONSE : \" + message.obj.toString());\n } catch (Exception e) {\n LogWriter.err(e);\n }\n\n break;\n default:\n super.handleMessage(message);\n }\n }", "private void execHandlerDevice( Message msg ) {\n\t\t // get the connected device's name\n\t\tString name = msg.getData().getString( BUNDLE_DEVICE_NAME );\n\t\tlog_d( \"EventDevice \" + name );\n\t\thideButtonConnect();\t\n\t\tString str = getTitleConnected( name );\n\t\tshowTitle( str );\n\t\ttoast_short( str );\n\t}", "abstract void onMessage(byte[] message);", "@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tString [] str=(String [])msg.obj;\n\t\t\tfor(int i=0;i<6;i++)\n\t\t\t{System.out.println(str[i]);}\n\t\t\t if(mDialog.isShowing()==true){\n\t\t\t\t mDialog.dismiss(); \n\t\t\t }\n\t\t\t if(str[0].toString().equals(\"anyType{}\")==true){\n//\t\t\t \tSystem.out.println(str[0]);\n\t\t\t\t title.setText(str[1]);\n\t\t\t\t time.setText(str[2]);\n\t\t\t\t type.setText(str[3]);\n\t\t\t\t content.setText(str[4]);\n\t\t\t\t name.setText(str[5]);\n//\t\t\t Toast.makeText(getApplicationContext(),\"发布成功\",Toast.LENGTH_SHORT).show();\n\t\t\t }\n\t\t\t else{\n\t\t\t \tToast.makeText(getApplicationContext(),str[0],Toast.LENGTH_SHORT).show();\n\t\t\t }\n\t\t}", "private void toastMessage (String message){\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void messageArrived(String string, MqttMessage mm) throws Exception {\n System.out.println(\"Topic==\" + string);\n System.out.println(\"message==\" + mm.toString());\n }", "@OnMessage\n\n public void onMessage(String message) {\n\n System.out.println(\"Received msg: \" + message);\n\n }", "@Override\n public void onConnected(Bundle connectionHint) {\n //Requires a new thread to avoid blocking the UI\n new SendToDataLayerThread(\"/message_path\", message + \" \" + Calendar.getInstance()).start();\n Log.i(TAG, \"sent, onConnected\" + message);\n Toast.makeText(getApplicationContext(),message,Toast.LENGTH_SHORT).show();\n }", "private void handleNow(RemoteMessage remoteMessage) {\n Log.d(TAG, \"Short lived task is done.\");\n }", "@Override\n\t\t\t\tpublic void messageArrived(MqttTopic topicName,\n\t\t\t\t\t\tMqttMessage message) throws Exception {\n\t\t\t\t\tSystem.out.println(\"messageArrived----------\");\n\t\t\t\t\tMessage msg = new Message();\n\t\t\t\t\tmsg.what = 1;\n\t\t\t\t\tmsg.obj = message.toString();\n\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t}", "@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\tcase 0:\n\t\t\t\ttv_read.setText(msg.obj.toString());\n\t\t\t\tToast.makeText(N20PINPadControllerActivity.this, \"recv\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "private void notifyOnTextReceived(String message) {\n synchronized (globalLock) {\n if (isRunning) {\n onTextReceived(message);\n }\n }\n }", "@Override\n\tpublic void onMessage(CommandMessage msg) {\n\t}", "abstract public boolean onMessageReceived(MMXMessage message);", "protected void handleMessage(Message msg) {}", "private void postMessageToThread (Object aMessage)\n\t{\n\t\t//System.err.println (\"Posting message to thread\");\n\t\tif (aMessage instanceof DispatchMessage)\n\t\t{\n\t\t\tSystem.err.println (\"Handling message # \" + ((DispatchMessage) aMessage).sequenceNumber);\n\t\t\tif (((DispatchMessage) aMessage).deferred)\n\t\t\t{\n\t\t\t\tSystem.err.println (\"Deferred message\");\n\t\t\t}\n\t\t\taMessage = ((DispatchMessage) aMessage).object;\n\t\t\t\n\t\t}\n\t\tA_MessageThread theTargetThread = (A_MessageThread) threads.removeTail ();\n\t\ttheTargetThread.setQueued (false);\n\t\ttheTargetThread.handleMessage (aMessage);\n\t}", "@Override\n\t\tpublic void onDirectMessage(DirectMessage arg0) {\n\t\t\t\n\t\t}" ]
[ "0.8003369", "0.7657992", "0.73149467", "0.7233759", "0.72178274", "0.71007574", "0.7014906", "0.6926775", "0.6926775", "0.6871278", "0.67404926", "0.67077863", "0.6676467", "0.6676467", "0.6676467", "0.6676467", "0.6676467", "0.6641495", "0.66342485", "0.6632801", "0.66263855", "0.6614649", "0.66141635", "0.66084164", "0.65949863", "0.6568968", "0.6565561", "0.6557049", "0.65568197", "0.65493274", "0.6516061", "0.64885765", "0.64885765", "0.64885765", "0.64885765", "0.6476094", "0.6454403", "0.64462084", "0.6422584", "0.6420212", "0.64167815", "0.641523", "0.64113235", "0.64054155", "0.6401948", "0.63981056", "0.6396936", "0.63771236", "0.6373567", "0.6370806", "0.6361191", "0.63527393", "0.63475096", "0.6337564", "0.63360095", "0.63238144", "0.6320851", "0.63170946", "0.63131034", "0.63130915", "0.62931484", "0.6283614", "0.6266353", "0.6266132", "0.62659323", "0.625764", "0.6248457", "0.6243606", "0.6235434", "0.623394", "0.6232694", "0.62028193", "0.62023723", "0.6201637", "0.61979514", "0.61906284", "0.61900926", "0.6183287", "0.6181826", "0.61679006", "0.61623204", "0.6158218", "0.6157472", "0.6149328", "0.6144269", "0.6142852", "0.6137291", "0.61348367", "0.61273444", "0.61200565", "0.61179197", "0.6116666", "0.6116098", "0.6111293", "0.61112785", "0.6111233", "0.6110276", "0.6103226", "0.61027426", "0.6098314", "0.6096983" ]
0.0
-1
An instance method that compares this object to other. Always check that other is not null, i) an error would occur if you tried to access other.first if other was null, ii) null is a valid argument, the method should simply return false.
public boolean equals( Combination other ) { if(this.one== other.one && this.two == other.two && this.three == other.three && other != null){ return true; } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean m4280b(Object obj, Object obj2) {\n if (obj != obj2) {\n if (obj == null || obj.equals(obj2) == null) {\n return null;\n }\n }\n return true;\n }", "public static Comparison checkEquality(JexlNode first, JexlNode second) {\n if (first == second) {\n return Comparison.IS_EQUAL;\n } else if (first == null || second == null) {\n return Comparison.notEqual(\"One tree is null: \" + first + \" vs \" + second);\n } else {\n TreeEqualityVisitor visitor = new TreeEqualityVisitor();\n return (Comparison) first.jjtAccept(visitor, second);\n }\n }", "private static <E extends Comparable<? super E>, V> boolean lessEqual(final E nonnull, final E other) {\r\n if (other == null) return true;\r\n return nonnull.compareTo(other) <= 0;\r\n }", "boolean compare(Object targetOne, Object targetTwo);", "protected boolean safeEquals(Object one, Object two) {\r\n\t\treturn one == null ? two == null : one.equals(two);\r\n\t}", "public boolean equals(Object other) {\r\n if (other == null || getClass() != other.getClass() || length != ((MoneyList) other).length)\r\n return false;\r\n\r\n MoneyNode nodeThis = first;\r\n MoneyNode nodeOther = ((MoneyList) other).first;\r\n while (nodeThis != null) {\r\n // Since the two linked lists are the same length,\r\n // they should reach null on the same iteration.\r\n\r\n if (nodeThis.data != nodeOther.data)\r\n return false;\r\n\r\n nodeThis = nodeThis.next;\r\n nodeOther = nodeOther.next;\r\n } // while\r\n\r\n return true;\r\n }", "public boolean equals(Object other){\n\t\tif (other == null){\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tif (other instanceof Entry){\n\t\t\tEntry e = (Entry) other;\n\t\t\tif (entry.compareTo(e) == 0){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ClassCastException();\n\t\t}\n\t\treturn false;\n\t}", "private boolean compare(ValueType first, ValueType second) {\r\n // TODO\r\n return false;\r\n }", "@Override\r\n\tpublic void comparo(Persona p1, Persona p2) {\n\t\t\r\n\t}", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "public boolean Equal(Element other){\n\tboolean ret_val ;\n\tint aux01 ;\n\tint aux02 ;\n\tint nt ;\n\tret_val = true ;\n\n\taux01 = other.GetAge();\n\tif (!this.Compare(aux01,Age)) ret_val = false ;\n\telse { \n\t aux02 = other.GetSalary();\n\t if (!this.Compare(aux02,Salary)) ret_val = false ;\n\t else \n\t\tif (Married) \n\t\t if (!other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t\telse\n\t\t if (other.GetMarried()) ret_val = false;\n\t\t else nt = 0 ;\n\t}\n\n\treturn ret_val ;\n }", "protected abstract int doCompare(Object o1, Object o2);", "public boolean inOrder(Data other){\n\t\treturn data.compareTo(other.getData()) <= 0; \n\t}", "private static <E extends Comparable<? super E>, V> boolean equal(final E nonnull, final E other) {\r\n if (other == null) return false;\r\n return nonnull.compareTo(other) == 0;\r\n }", "@Override\n public boolean hardDiff(FObject o1, FObject o2, FObject diff) {\n if ( this.get(o1) == null ) {\n if ( this.get(o2) == null ) {\n return false;\n } else {\n //shadow copy, since we only use to print out diff entry in journal\n this.set(diff, this.get(o2));\n return true;\n }\n }\n //Both this.get(o1) and thid.get(o2) are not null\n //The propertyInfo is instance of AbstractObjectProperty, so that there is no way to do nested propertyInfo check\n //No matter if there are point to same instance or not, treat them as difference\n //if there are point to different instance, indeed there are different\n //if there are point to same instance, we can not guarantee if there are no difference comparing with record in the journal.\n //shodow copy\n this.set(diff, this.get(o2));\n return true;\n }", "private static <E extends Comparable<? super E>, V> boolean less(final E nonnull, final E other) {\r\n if (other == null) return true;\r\n return nonnull.compareTo(other) < 0;\r\n }", "final boolean isLessThan(final GbofId other){\r\n if (source_.is_less_than(other.source()) ) return true;\r\n if (other.source().is_less_than(source_)) return false;\r\n\r\n if (creation_ts_.isLessThan(other.creation_ts())) return true;\r\n if (creation_ts_.isGreaterThan(other.creation_ts())) return false;\r\n\r\n if (is_fragment_ && !other.is_fragment_) return true;\r\n if (!is_fragment_ && other.is_fragment_) return false;\r\n \r\n if (is_fragment_) {\r\n if (frag_length_ < other.frag_length_) return true;\r\n if (other.frag_length_ < frag_length_) return false;\r\n\r\n if (frag_offset_ < other.frag_offset_) return true;\r\n if (other.frag_offset_ < frag_offset_) return false;\r\n }\r\n\r\n return false; // all equal\r\n }", "@java.lang.Override()\n public boolean equals(@org.jetbrains.annotations.Nullable()\n java.lang.Object other) {\n return false;\n }", "private boolean isEmpty() {return first == null;}", "@Override\n public int compare(final E obj1, final E obj2) {\n return comparator.compare(obj2, obj1);\n }", "protected int compareForNulls(Object o1, Object o2) {\r\n if(o1 == null && o2 == null) return 0;\r\n if(o1 == null) {\r\n if(nullIsGreater) return 1;\r\n else return -1;\r\n }\r\n else if(o2 == null) {\r\n if(nullIsGreater) return -1;\r\n else return 1;\r\n }\r\n else {\r\n return 0; // both are non-null;\r\n }\r\n }", "public boolean equals(Document other){\n boolean something = true;\r\n\r\n if(other == null){ //make sure that the object we are comparing to isn't null\r\n something = false;\r\n }\r\n if(this.getClass() != other.getClass()){ //makes sure the object are of the same class\r\n something = false;\r\n }\r\n if(!this.name.equalsIgnoreCase(other.name) || other.name == null){ //compares if the documents have the same name ignoring uppercase\r\n something = false;\r\n }\r\n if(!this.owner.equalsIgnoreCase(other.owner) || other.owner == null){ //comapre if both documents have the same owner ignoring uppercase\r\n something = false;\r\n }\r\n if(!this.id.equals(other.id) || other.id == null){ //compare if both documents have the same id\r\n something = false;\r\n }\r\n return something; //if something return true, then both documents are the same otherwise they are different\r\n }", "private boolean equalKeys(Object other) {\r\n if (this == other) {\r\n return true;\r\n }\r\n if (!(other instanceof Contacto)) {\r\n return false;\r\n }\r\n Contacto that = (Contacto) other;\r\n if (this.getIdContacto() != that.getIdContacto()) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object obj) {\n StorePairGeneric<E> o = (StorePairGeneric<E>) obj;\n return this.first.equals(o.first);\n \n // or boolean ans = this.first(temp.first);\n // return ans;\n }", "final public boolean equals (Object other)\n {\n\treturn compareTo (other) == 0;\n }", "int compare(T o1, T o2);", "public void testObjEqual()\n {\n assertEquals( true, Util.objEqual(null,null) );\n assertEquals( false,Util.objEqual(this,null) );\n assertEquals( false,Util.objEqual(null,this) );\n assertEquals( true, Util.objEqual(this,this) );\n assertEquals( true, Util.objEqual(\"12\",\"12\") );\n }" ]
[ "0.60126257", "0.5931552", "0.58006", "0.57998943", "0.57457995", "0.5740481", "0.57393545", "0.5718943", "0.571471", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.56979823", "0.5696179", "0.56393015", "0.5602108", "0.5597655", "0.5592139", "0.5591978", "0.55501306", "0.5545724", "0.5531615", "0.5524674", "0.54905766", "0.5478589", "0.5475602", "0.54659164", "0.5445916", "0.54197806" ]
0.0
-1
Returns a String representation of this Combination.
public String toString() { return this.one+":"+this.two+":"+this.three; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toString () {\n\t\tString resumen = \"\";\n\t\tfor (int i = 0; i < this.size(); i++) {\n\t\t\tresumen = resumen + this.get(i).toString();\n\t\t}\n\t\treturn resumen;\n\t}", "public String toString() {\n\t\treturn toString(this);\n\t}", "public String toString() {\n\t\treturn toString(true);\n\t}", "public String toString() {\n StringWriter writer = new StringWriter();\n this.write(writer);\n return writer.toString();\n }", "public String toString() {\n\t\treturn toString(0, 0);\n\t}", "public String toString() {\r\n\t\treturn result;\r\n\t}", "public String toString() { return stringify(this, true); }", "public String toString() {\n\n\t\tfinal StringBuilder buffer = new StringBuilder();\n\n\t\tbuffer.append(\"affCustAlgmntId=[\").append(affCustAlgmntId).append(\"] \");\n\t\tbuffer.append(\"custAlgmntId=[\").append(custAlgmntId).append(\"] \");\n\n\t\treturn buffer.toString();\n\t}", "public String toString()\n\t{\n\t\tString result = new String();\n\t\tfor (boolean bit : bits)\n\t\t{\n\t\t\tif (bit) result += '1';\n\t\t\telse result += '0';\n\t\t}\n\t\treturn result;\n\t}", "public String toString() {\n\t\treturn this.toJSON().toString();\n\t}", "public String toString() {\n\t\treturn this.toJSON().toString();\n\t}", "public String toString(){\n\n\t\tString str = \"(numStrings=\"+ getNumStrings() +\n\t\t\t\t\t\",\\nLength=\"+ getGuitarLength() +\n\t\t\t\t\t\",\\nmanufacturer=\"+ getGuitarManufacturer() +\n\t\t\t\t\t\",\\ncolor=\"+ getGuitarColorString() + \")\";\n\t\treturn str;\n\t}", "public final String toString() {\n\t\tStringWriter write = new StringWriter();\n\t\tString out = null;\n\t\ttry {\n\t\t\toutput(write);\n\t\t\twrite.flush();\n\t\t\tout = write.toString();\n\t\t\twrite.close();\n\t\t} catch (UnsupportedEncodingException use) {\n\t\t\tuse.printStackTrace();\n\t\t} catch (IOException ioe) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\t\treturn (out);\n\t}", "public String toString() {\n String result = \"\";\n Iterator<NucleiSelected> itr = nucleiSelected.iterator();\n while (itr.hasNext()) {\n result = result + itr.next().toString() + \"\\n\";\n }\n return result;\n }", "@Override\n public String toString() {\n return toString(false, true, true, null);\n }", "public String toString() {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tthis.createSpecSection(buffer);\n\t\tthis.createOperatorSection(buffer);\n\t\treturn buffer.toString();\n\t}", "public String toString()\n {\n if (stringRep == null)\n {\n StringBuilder sb = new StringBuilder();\n switch (type)\n {\n case THREE_PRIME:\n sb.append(\"DNA 3'-\");\n break;\n case FIVE_PRIME:\n sb.append(\"DNA 5'-\");\n break;\n case RNA:\n sb.append(\"RNA \");\n break;\n }\n \n for (int i = 0; i < seq.length; i++)\n {\n sb.append(seq[i]); // Java magic with Enum types -- converts to string.\n }\n \n switch (type)\n {\n case THREE_PRIME:\n sb.append(\"-5'\");\n break;\n case FIVE_PRIME:\n sb.append(\"-3'\");\n break;\n }\n \n stringRep = sb.toString();\n }\n \n return stringRep;\n }", "public String toString()\n\t{\n\t\treturn Printer.stringify(this, false);\n\t}", "public String toString(){\r\n\t\tString output=\"\";\r\n\t\toutput+=super.toString();\r\n\t\treturn output;\r\n\t}", "public String toString()\n\t{\n\t\tString output=\"\";\n\n\n\n\n\n\n\t\treturn output+\"\\n\\n\";\n\t}", "public String toString()\n\t{\n\t\tString result = \"\";\n\t\tresult += this.data;\n\t\treturn result;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn toStringBuilder(new StringBuilder()).toString();\n\t}", "public String toString() {\n \n String str = m_Classifier.getClass().getName();\n \n str += \" \"\n + Utils\n .joinOptions(((OptionHandler) m_Classifier)\n\t .getOptions());\n \n return str;\n \n }", "public String toString() {\n\t\tString s = new String(\"\");\n\t\tfor(int i=0; i<numeros.size(); i++) {\n\t\t\ts += numeros.get(i) + \" \";\n\t\t}\n\t\ts += \"| \";\n\t\tfor(int i=0; i<n_chances.size(); i++) {\n\t\t\ts += n_chances.get(i) + \" \";\n\t\t}\n\t\ts += \"\\n\";\n\t\treturn s;\n\t}", "public String toString() {\n\t\tString r = \"\";\n\t\tchar[][] a = toMatrix();\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tfor (int j = 0; j < 3; j++) {\n\t\t\t\tif (a[i][j] == '\\0')\n\t\t\t\t\tr += \"-\";\n\t\t\t\telse\n\t\t\t\t\tr += a[i][j];\n\t\t\t}\n\t\t\tr += \"\\n\";\n\t\t}\n\t\treturn r.substring(0, r.length() - 1);\n\t}", "public String toString() {\r\n\r\n\tString out = \"\";\r\n\r\n\tfor (int i = 0; i < this.getNumberChoices(); i++) {\r\n\t MenuChoice thisChoice = this.getChoices().get(i);\r\n\t out += thisChoice.getIndex() + \") \" + thisChoice.getValue() + \"\\n\";\r\n\t}\r\n\r\n\treturn out;\r\n }", "public String toString() {\r\n\t\treturn(\"This Quadcopter is manufactured by \" + this.brand + \" since \" + this.creationYear \r\n\t\t\t\t+ \". It has \" + this.cylinderNum + \" cylinders and can carry \" + this.passengerCap + \" passengers. It has \"\r\n\t\t\t\t+ this.hp + \" horse power, can fly at \" + maxFlyingSpeed + \" mph, and costs \" + this.price + \"$.\");\r\n\t}", "public synchronized String toString() {\n StringBuffer oBuffer = new StringBuffer();\n\n oBuffer\n .append(\"Preprocessing params: \").append(this.oPreprocessingParams).append(\"\\n\")\n .append(\"Feature extraction params: \").append(this.oFeatureExtractionParams).append(\"\\n\")\n .append(\"Classification params: \").append(this.oClassificationParams);\n\n return oBuffer.toString();\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn result;\r\n\t}", "public String toString() {\n return String.format(mFormat,\n format(mManufacturer),\n format(mBrand),\n format(mModel),\n mResolution,\n mDensity,\n mAndroidDensity,\n mVersion,\n mSdk,\n mLanguage);\n }", "public String toString() {\n StringBuffer sb = new StringBuffer();\r\n sb.append(\"VENDOR: \" + vendor + \"\\n\");\r\n sb.append(\"RENDERER: \" + renderer + \"\\n\");\r\n sb.append(\"VERSION: \" + version + \"\\n\");\r\n sb.append(\"EXTENSIONS: \" + extensions + \"\\n\");\r\n sb.append(\"\\n\");\r\n sb.append(\"ALIASED_POINT_SIZE_RANGE: [\" + aliased_point_size_range[0]\r\n + \", \" + aliased_point_size_range[1] + \"]\\n\");\r\n sb.append(\"SMOOTH_POINT_SIZE_RANGE: [\" + smooth_point_size_range[0]\r\n + \", \" + smooth_point_size_range[1] + \"]\\n\");\r\n sb.append(\"SMOOTH_POINT_SIZE_GRANULARITY: \"\r\n + smooth_point_size_granularity[0] + \"\\n\");\r\n sb.append(\"\\n\");\r\n sb.append(\"MAX_ELEMENTS_VERTICES: \" + elements_vertices[0] + \"\\n\");\r\n sb.append(\"MAX_ELEMENTS_INDICES: \" + elements_indices[0] + \"\\n\");\r\n sb.append(\"\\n\");\r\n sb.append(\"SUPPORTED_STENCIL_BITS: \" + stencilbuffer_bits[0] + \"\\n\");\r\n sb.append(\"\\n\");\r\n sb.append(\"NUMBER_OF_SAMPLE_BUFFERS: \" + sample_buffers[0] + \"\\n\");\r\n sb.append(\"NUMBER_OF_SAMPLES: \" + samples[0] + \"\\n\");\r\n return sb.toString();\r\n }", "public String toString() {\n return new ToStringBuilder(this)\n .append(\"number\", this.number)\n .append(\"fileSets\", this.fileSets)\n .toString();\n }", "public String toString() {\n return \"\" + this.prodCode;\n }", "public String toString() {\n\t\treturn String.format(\"Append \" + result.length() + \" chars to String\\n\" + \"final string length = \" + result.length());\n\t}", "public String toString ()\n\t{\n\t\tString s = \"\";\n for (Production production : productions.values()) s += production + \"\\n\";\n\t\treturn s;\n\t}", "@Override\n public String toString() {\n // TODO: Using Serializer\n return Serializer.toByteArray(this).toString();\n }", "public String toString() {\n if (size == 0) {\n return \"{}\";\n }\n String str = \"{\";\n for (int i = 0; i < size - 1; i++) {\n str = str + set[i] + \", \";\n } str = str + set[size - 1] + \"}\";\n return str;\n }", "@Override\n\tpublic String toString() {\n\t\tString str = \"(\";\n\t\tif(this.error) str += \"1 - \";\n\t\tint i = 0;\n\t\tfor(String component : this.components) {\n\t\t\tif(i != 0) {\n\t\t\t\tstr += \" * \";\n\t\t\t}\n\t\t\tstr += component;\n\t\t\ti++;\n\t\t}\n\t\treturn str + \")\";\n\t}", "public String toString()\r\n\t{\r\n\t\tString str = \"\"; \r\n\t\t\r\n\t\tfor(Option o : option)\r\n\t\t\tstr += o.getClass().getSimpleName() + \" \" + \"(\"+o.getPrix()+\"€)\"; \r\n\t\treturn ( \"+ \" + this.getMarque().getName() + \" : \" + getNom() + \" \" + this.moteur.toString() + \" \" + \"(\"+String.valueOf(getPrix())+\"€)\" + \" [\"+ str +\"]\" + \" d'une valeur totale de \" + this.prixTotal() + \" €\\n\" ) ; \r\n\t}", "public String toString() {\n\t\treturn GrilleLoader.serialize(this, false); //isGrlFormat=false\n\t}", "public String toString() {\n\t\t\tif (lastAppendNewLine) {\n\t\t\t\tmBuilder.deleteCharAt(mBuilder.length() - 1);\n\t\t\t}\n\t\t\treturn mBuilder.toString();\n\t\t}", "@Override\n public String toString() {\n return new JSONSerializer().serialize(this);\n }", "public String toString()\n\t{\n\t\tString str = \"\";\n\t\tstr += numer + \"/\" + denom;\n\t\treturn str;\n\t}", "public String toString() {\n String output = \"The bag of bouncy balls cost $\" + this.price + \" and contains these balls:\";\n for (BouncyBall b: bBalls) {\n output += b.toString() + \"\\n\";\n }\n return output;\n }", "public String toString(){\r\n\t\tString theString= \"\";\r\n\t\t\r\n\t\t//loop through and add values to the string\r\n\t\tfor (int i = 0; i < this.data.length; i++)\r\n\t\t{\r\n\t\t\ttheString = theString + this.data[i];\r\n\t\t\tif (i != this.data.length - 1)\r\n\t\t\t{\r\n\t\t\t\ttheString = theString + \", \";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn \"[\" + theString + \"]\";\r\n\t}", "public String toString() {\n\tString s = \"\";\n\tfor (int i = 0; i < productions.size(); i++) {\n\t s += \" \";\n\t Vector<String> prodVec = productions.get(i);\n\t for (int j = 0; j < prodVec.size(); j++) {\n\t\ts += prodVec.get(j) + \" \";\n\t }\n\t s += \"\\n\";\n\t}\n\treturn s;\n }", "public String toString() {\r\n\t\tString str;\r\n\t\tstr = (super.toString() + matureToString());\r\n\r\n\t\treturn str;\r\n\t}", "public String toString() {\n return ToStringBuilder.reflectionToString(this);\n }", "@Override\n public final String toString() {\n return asString(0, 4);\n }", "public String toString() {\r\n StringBuffer buffer = new StringBuffer();\r\n for (int i = 0; i < defaultFormat.lineSeparator.length(); i++) {\r\n char ch = defaultFormat.lineSeparator.charAt( i);\r\n switch (ch) {\r\n case '\\r': buffer.append(\"\\\\r\");\r\n break;\r\n case '\\n': buffer.append(\"\\\\n\");\r\n break;\r\n case '\\t': buffer.append(\"\\\\t\");\r\n break;\r\n default: buffer.append(\"[\" + ((int)ch) + \"]\");\r\n break;\r\n }\r\n }\r\n\r\n return (\r\n \"XMLOutputter[omitDeclaration = \" + omitDeclaration + \", \" +\r\n \"encoding = \" + encoding + \", \" +\r\n \"omitEncoding = \" + omitEncoding + \", \" +\r\n \"indent = '\" + defaultFormat.indent + \"'\" + \", \" +\r\n \"expandEmptyElements = \" + defaultFormat.expandEmptyElements + \", \" +\r\n \"newlines = \" + defaultFormat.newlines + \", \" +\r\n \"lineSeparator = '\" + buffer.toString() + \"', \" +\r\n \"trimAllWhite = \" + defaultFormat.trimAllWhite +\r\n \"textTrim = \" + defaultFormat.textTrim +\r\n \"textNormalize = \" + defaultFormat.textNormalize + \"]\"\r\n );\r\n }", "public String toString() {\n\t\treturn EPPUtil.toString(this);\n\t}", "public String toString() {\n\t\treturn EPPUtil.toString(this);\n\t}", "@Override\n public String toString() {\n return new Gson().toJson(this);\n }", "@Override()\n public String toString()\n {\n final StringBuilder buffer = new StringBuilder();\n toString(buffer);\n return buffer.toString();\n }", "public String toString() {\n String output = this.name + \"(\";\n for (int i = 0; i < attributes.size(); i++) {\n output = output + attributes.get(i) + \":\" + domains.get(i);\n // Don't add a comma on the last key, value pair\n if (i < attributes.size() - 1)\n output = output + \",\";\n }\n return output + \")\";\n }", "@Override\n public String toString() {\n ByteArrayOutputStream bs = new ByteArrayOutputStream();\n PrintStream out = new PrintStream(bs);\n output(out, \"\");\n return bs.toString();\n }", "public String toString() {\n\t\tboolean first = true;\n\t\tStringWriter buf = new StringWriter();\n\t\tbuf.append('[');\n\t\tfor(String value : values) {\n\t\t\tif(first) { first = false; } else { buf.append(\",\"); }\n\t\t\tbuf.append(value);\n\t\t}\n\t\tbuf.append(']');\n\t\treturn buf.toString();\t\t\n\t}", "public String toString() {\r\n return ToStringBuilder.reflectionToString(this,\r\n ToStringStyle.MULTI_LINE_STYLE);\r\n }", "public String toString() {\n\t\treturn String.format(\"Shape: %s,Color: %s\", shape, color);\n\t}", "public String toString() {\n\t\treturn \"[\"+this.produto + \"]\" + \"[\"+ this.preco + \"]\"+\"[\"+ this.quantidade+\"]\";\n\t\t\t\t\n\t}", "public String toString() {\n\t\tStringBuffer sb = new StringBuffer();\n\t\tsb.append(\"[\");\n\t\tfor(int i = 0; i < size(); i++) {\n\t\t\tif( i != size()-1)\n\t\t\t\tsb.append(get(i) + \" , \");\n\t\t\telse\n\t\t\t\tsb.append(get(i));\n\t\t}\n\t\tsb.append(\"]\");\n\t\tsb.append(\"\\n\");\n\t\t\n\t\treturn sb.toString();\n\t}", "public String toString() {\n StringBuilder string = new StringBuilder();\n Iterator<E> i = iterator();\n if (!this.isEmpty()) {\n while (i.hasNext()) {\n string.append(i.next());\n if (i.hasNext()) {\n string.append(\", \");\n }\n }\n }\n return string.toString();\n }", "public String toString() {\n String[] collect = new String[this.array.length];\n for (int i = 0; i < this.array.length; i++) {\n collect[i] = String.valueOf(this.array[i]);\n }\n return \"[\" + String.join(\";\", collect) + \"]\";\n }", "public String optionToString() {\n return new StringBuffer().append(\"<\").append(base16.toString(this.data)).append(\">\").toString();\n }", "public String toString() {\n String s = \"\";\n for (Vertex v : mVertices.values()) {\n s += v + \": \";\n for (Vertex w : mAdjList.get(v)) {\n s += w + \" \";\n }\n s += \"\\n\";\n }\n return s;\n }", "public String toString() {\n\t\treturn toString(Constants.get_output_precision());\n\t}", "@Override\n public String toString() {\n String arrString = \"\";\n \n //loop to add all the elements\n for (int i = 0; i < this.array.length; i++) {\n arrString = arrString + \" \" + this.array[i];\n }\n \n return arrString;\n }", "public String toString() {\n StringBuilder output = new StringBuilder();\n output.append(\"{\\n\");\n for (int i=0; i<rows; i++) {\n output.append(Arrays.toString(matrix.get(i)) + \",\\n\");\n }\n output.append(\"}\\n\");\n return output.toString();\n }", "public String toString() {\n return\n getLatitude(\"\") + \"|\" +\n getLongitude(\"\") + \"|\" +\n getDepth(\"\") + \"|\" +\n getTemperatureMin(\"\") + \"|\" +\n getTemperatureMax(\"\") + \"|\" +\n getSalinityMin(\"\") + \"|\" +\n getSalinityMax(\"\") + \"|\" +\n getOxygenMin(\"\") + \"|\" +\n getOxygenMax(\"\") + \"|\" +\n getNitrateMin(\"\") + \"|\" +\n getNitrateMax(\"\") + \"|\" +\n getPhosphateMin(\"\") + \"|\" +\n getPhosphateMax(\"\") + \"|\" +\n getSilicateMin(\"\") + \"|\" +\n getSilicateMax(\"\") + \"|\" +\n getChlorophyllMin(\"\") + \"|\" +\n getChlorophyllMax(\"\") + \"|\";\n }", "public String toString(){\n String combinedStr = this.string1 + \" \" + this.string2 + \" \" + this.string3;\n return combinedStr;\n }", "public String toString() {\n final StringBuilder builder = new StringBuilder();\n builder.append(\"Type: SAQ\\n\")\n .append(\"Question: \")\n .append(getQuestion() + \"\\n\")\n .append(\"Correct Answers: \")\n .append(getCorrectAnswerList() + \"\\n\")\n .append(\"Difficulty: \")\n .append(getDifficulty() + \"\\n\")\n .append(\"Categories: \");\n getCategories().forEach(builder::append);\n return builder.toString();\n }", "@Override\n public String toString()\n {\n String builder = new String();\n \tfor (V vertex : graph.keySet()){\n \t\tString strVertex = vertex.toString();\n \t\tbuilder = builder + strVertex + \": \";\n \t\tArrayList <V> edges = graph.get(vertex);\n \t\tint degree = edges.size();\n \t\tint i = 0;\n \t\tif (degree > 0){\n \t\t\twhile (i < degree -1){\n \t\t\t\tString strEdge = edges.get(i).toString();\n \t\t\t\tbuilder = builder + strEdge + \", \";\n \t\t\t\ti++;\n \t\t\t}\n \t\tString strEdge = edges.get(i).toString();\n \t\tbuilder = builder + strEdge + \"\\n\";\n\n \t\t}\n \t\telse{\n \t\t\tstrVertex = vertex.toString();\n \t\t\tbuilder = builder + strVertex + \": \\n\";\n \t\t}\n\n \t}\n \treturn builder;\n }", "@Override\n public String toString()\n {\n return Arrays.toString(this.toArray());\n }", "public String toString () {\n String toPrint = \"\";\n for (int i = 0; i < myCoefficients.size(); ++i) {\n if (i == 0) {\n toPrint += (myCoefficients.get(i) + \" + \");\n }\n else if (i == myCoefficients.size() - 1) {\n toPrint += (myCoefficients.get(i) + \"x^\" + i);\n }\n\n else {\n toPrint += (myCoefficients.get(i) + \"x^\" + i + \" + \");\n }\n }\n toPrint += \"\\n\";\n return toPrint;\n }", "@Override\n\tpublic String toString() {\n StringBuffer buf = new StringBuffer();\n\n// for (int i = 0; i < units.size(); i++) {\n// buf.append(\"\\nUnit \" + i + \": \" + units.get(i));\n// }\n\n buf.append(\"Connected components: \" );\n List<List<Node>> components = GraphUtils.connectedComponents(graph);\n\n for (int i = 0; i < components.size(); i++) {\n buf.append(\"\\n\" + i + \": \");\n buf.append(components.get(i));\n }\n\n buf.append(\"\\nGraph = \" );\n buf.append(graph);\n\n return buf.toString();\n }", "public String toString() {\n return toDisplayString();\n }", "public String toString(){\n String result = \"{\";\n for(LinkedList<E> list : this.data){\n for(E item : list){\n result += item.toString() + \", \";\n }\n }\n result = result.substring(0, result.length() -2);\n return result + \"}\";\n }", "public String toString() {\n\t\tString str = \"(\";\n\t\tif (this.title != null)\n\t\t\tstr += this.title;\n\t\telse if (this.varName != null)\n\t\t\tstr += this.varName;\n\t\tif (this.minVal != null)\n\t\t\tstr += \",\" + this.minVal;\n\t\tif (this.curVal != null)\n\t\t\tstr += \",\" + this.curVal;\n\t\tif (this.maxVal != null)\n\t\t\tstr += \",\" + this.maxVal;\n\t\tstr += \")\";\n\t\treturn str;\n\t}", "public String toString() {\r\n\t\tString cad = \"\";\r\n\t\tfor (int i = 0; i < nodes_.size(); i++) {\r\n\t\t\tcad += nodes_.get(i).getVal() + \" - \";\r\n\t\t}\r\n\t\treturn cad;\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn Json.pretty( this );\n\t}", "public String toString () {\r\n String display = courseCode;\r\n display += \"\\nDepartment: \" + department;\r\n display += \"\\nGrade: \" + grade;\r\n return display;\r\n }", "@Override\n\tpublic String toString() {\n\t\tif (repr == null)\n\t\t\trepr = toString(null);\n\n\t\treturn repr;\n\t}", "public String toString() {\n return \"\" + data;\n }", "@Override\n public String toString() {\n Gson gson = new Gson();\n\n String json = gson.toJson(this);\n System.out.println(\"json \\n\" + json);\n return json;\n }", "@Override\n public String toString() {\n String str = \"\";\n\n //TODO: Complete Method\n\n return str;\n }", "public String toString() {\n\t\treturn this;\n\t}", "public String toString() {\n\n // **** ****\n StringBuilder sb = new StringBuilder();\n\n sb.append(\"\\n n: \" + this.n);\n sb.append(\"\\nparents: \" + Arrays.toString(this.parents));\n\n // **** ****\n return sb.toString();\n }", "public String toString()\n {\n String str = (continuation ? \"+ \" : \"- \") ;\n for(int i = 0 ; i < values.length ; i++)\n str += values[i] + \" \";\n str += classification;\n return str ;\n }", "public String toString() {\n\t\tString resultString = \"I am a weighted Instances object.\\r\\n\" + \"I have \" + numInstances()\n\t\t\t\t+ \" instances and \" + (numAttributes() - 1) + \" conditional attributes.\\r\\n\"\n\t\t\t\t+ \"My weights are: \" + Arrays.toString(weights) + \"\\r\\n\" + \"My data are: \\r\\n\"\n\t\t\t\t+ super.toString();\n\n\t\treturn resultString;\n\t}", "public String toString()\n\t{\n\t\tint poleSize = pole.size();\n\t\tString s = \"\";\n\t\tfor(int i = 0; i < poleSize; i++)\n\t\t\ts += pole.get(i).getSize() + (i < poleSize - 1 ? \", \" : \"\");\n\t\treturn s;\n\t}", "public String toString()\n\t{\n\t\treturn toString(0);\n\t}", "public String toString()\n\t{\n\t\treturn toString(0);\n\t}", "public String toString()\n\t{\n\t\treturn toString(0);\n\t}", "public String toString() {\n\treturn createString(data);\n }", "public String toString() {\n\t\t//TODO add your own field name here\t\t\n\t\t//return buffer.append(this.yourFieldName).toString();\n\t\treturn \"\";\n\t}", "public String toString() {\n StringBuffer strb = new StringBuffer();\n strb.append(name + \",\" + dough + \",\" + sauce + \",\" + toppings);\n return strb.toString();\n }", "public String toString() {\n\t\tString s = \"\";\n\t\t// Loop through all the vertices and add their neighbors to a string\n\t\tfor (int i = 0; i < this.vertices.size(); i++) {\n\t\t\ts += this.vertices.get(i).toString() + \": \" + this.vertices.get(i).getNeighbors() + \"\\n\\n\";\n\t\t}\n\t\ts += \"Number of Total Edges: \" + this.actualTotalEdges;\n\t\treturn s;\n\t}", "public String toString()\r\n\t{\r\n\t\treturn toCharSequence().toString();\r\n\t}", "public String toString(){\r\n\t\tString output = \"\";\r\n\t\tfor(String s: this.data){\r\n\t\t\toutput = output + s + \"\\t\";\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}", "@Override\n public String toString() {\n final StringBuilder sb = new StringBuilder();\n\n if(argsIsSet) {\n for(String arg : args) {\n if(sb.length() > 0) {\n sb.append(' ');\n }\n sb.append(arg);\n }\n }\n else {\n\n // first the options\n if(options.size() > 0) {\n sb.append(DefaultOptionSet.toString(options));\n }\n // operand: <files>\n if(filesIsSet) {\n if(sb.length() > 0) {\n sb.append(' ');\n }\n sb.append(\"--\").append(\"files\");\n sb.append(\" \").append(toString(getFiles()));\n }\n // operand: <paths>\n if(pathsIsSet) {\n if(sb.length() > 0) {\n sb.append(' ');\n }\n sb.append(\"--\").append(\"paths\");\n sb.append(\" \").append(toString(getPaths()));\n }\n // operand: <args>\n if(argsIsSet) {\n if(sb.length() > 0) {\n sb.append(' ');\n }\n sb.append(\"--\").append(\"args\");\n sb.append(\" \").append(toString(getArgs()));\n }\n }\n\n return sb.toString();\n }", "public String toString(){\r\n\t\t\r\n\t\tString x =\"\";\r\n\t\t\r\n\t\tfor(int i=0; i < param.size() ; i++ ){\r\n\t\t\t\r\n\t\t\tx += param.get(i) + \"\\n\" ; \r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn x;\r\n\t}" ]
[ "0.7563533", "0.7188381", "0.71179676", "0.71085966", "0.7081577", "0.70600784", "0.7055239", "0.7007453", "0.700418", "0.700352", "0.700352", "0.69983697", "0.6977237", "0.694116", "0.6936497", "0.69339764", "0.69303447", "0.6924532", "0.6920155", "0.69125926", "0.6912311", "0.69019073", "0.6900265", "0.6898209", "0.68800044", "0.6864942", "0.68477154", "0.6846169", "0.6842464", "0.68373287", "0.6830657", "0.682624", "0.68259764", "0.6824271", "0.6819495", "0.6818988", "0.68189067", "0.6815615", "0.68053913", "0.6800504", "0.67987776", "0.6788792", "0.67853713", "0.67805403", "0.677981", "0.6750542", "0.6747697", "0.6747616", "0.67464685", "0.67317355", "0.67219687", "0.67219687", "0.6720072", "0.67078406", "0.67030317", "0.67019314", "0.66981786", "0.6695355", "0.669185", "0.668822", "0.6685146", "0.6683992", "0.6672682", "0.66641206", "0.6659242", "0.6646307", "0.66431224", "0.6638779", "0.66338605", "0.6632691", "0.662573", "0.66254944", "0.6625424", "0.662431", "0.66219604", "0.6617926", "0.661729", "0.6610645", "0.66013336", "0.6596031", "0.65952533", "0.65932524", "0.658919", "0.65891457", "0.65851986", "0.6584898", "0.65836644", "0.6583293", "0.65746725", "0.65737975", "0.65735894", "0.65735894", "0.65735894", "0.6572947", "0.6568142", "0.65669996", "0.6563535", "0.6562425", "0.6561039", "0.65605646", "0.6560485" ]
0.0
-1
Main The Interface PathfindController. Defines what a Pathfind Controller does.
public abstract interface PathfindController extends Controller { // Public Abstract Methods /** * Block next coordinate in path. */ public abstract void blockNext(); /** * Calculate pathfinding and the states for visited and blocked of the * back, front, left, right respectively. * * @return the array of states */ public abstract boolean[] calculate(); /** * Go to next coordinate in path. */ public abstract void goNext(); /** * Checks if next coordinate in path is blocked. * * @return true, if next coordinate in path is blocked */ public abstract boolean isNextBlocked(); /** * Checks if next coordinate in path is visited. * * @return true, if next coordinate in path is visited */ public abstract boolean isNextVisited(); /** * String representation of the raw graph. * * @return the string */ public abstract String rawGraphToString(); /** * Reset pathfinding. */ public abstract void reset(); /** * Rotate to the left coordinate in path. */ public abstract void rotateLeft(); /** * Rotate to the right coordinate in path. */ public abstract void rotateRight(); /** * Unblock next coordinate in path. */ public abstract void unblockNext(); /** * Visit current coordinate in path. */ public abstract void visit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Main ()\n\t{\n\t\tview = new View ();\t\t\n\t\tmodel = new Model(view);\n\t\tcontroller = new Controller(model, view);\n\t}", "public static void main(String[] args) {\n//\n// controller.setSoldierRank(0, \"Turai\");\n// controller.addModel(new Model(2, \"Lera\", \"RavSamal\"));\n// controller.updateViews();\n\n Controller controller = new Controller();\n controller.addModel(new Model(1, \"Gal\", \"Citizen\"));\n controller.addModel(new Model(12121, \"bubu\", \"Smar\"));\n controller.addModel(new Model(624, \"Groot\", \"Tree\"));\n controller.addModel(new Model(-10, \"Deadpool\", \"Awesome\"));\n controller.addModel(new Model(100, \"Nikita\", \"Citizen\"));\n\n controller.presentUI();\n\n controller.updateViews();\n }", "public MainController() {\n initializeControllers();\n initializeGui();\n runGameLoop();\n }", "public MainController() {\n\t\tcontroller = new Controller(this);\n\t}", "public interface Controller {\n\n\t/**\n\t * This method sets the Model of the controller\n\t * @param m the Model to be set for Controller\n\t */\n\tvoid setModel(Model m);\n\t\n\t/**\n\t * This method sets the View of the controller\n\t * @param v the View to be set for Controller\n\t */\n\tvoid setView(View v);\n\t/**\n\t * This method transfers messages to mView to be printed on the screen\n\t * @param toPrnt A String to be printed on the screen in the manner View chooses\n\t */\n\tvoid PrintOnScreen(String toPrnt);\n\t/**\n\t * This method gets the data that the user entered as input to View\n\t * @return the user's String-the input\n\t */\n\tString getDataFromScreen();\n//\t/**\n//\t * \n//\t * @param commandToExecute\n//\t * @param params\n//\t */\n//\tvoid excuteCommand(Command commandToExecute, String[] params);\n\t/**\n\t * This message returns a Maze3d according to a given name\n\t * @param name the name of maze to be checked\n\t * @return a maze with the name \"name\" if name does not exist returns false\n\t */\n\tMaze3d getMaze(String name);\n\t/**\n\t * This message returns the map of <String, Command>\n\t * @return A map with all the strings and commands\n\t */\n\tHashMap <String, Command> getMap();\n\t/**\n\t * This method sets the map of Strings and Commands so will know the matches/\n\t */\n\tvoid setHashMap();\n\n\t/**\n\t * This method returns the Error String in the correct format to be recognized and so the user will know\n\t * @param toPrint the mesage of the error String\n\t * @return A String[] with error in [0] and toPrint at [1]\n\t */\n\tString[] returnErrorString(String toPrint);\n\n\t/**\n\t * This method checks if the String is a legal Commad and makes it one in the correct format if it is.\n\t * if not will return a message or an error String[]\n\t * @param strToChck The String that the user entered as his command\n\t * @return a String in the format to be identified for the command to work\n\t */\n\tString[] checkIfLegalCommand(String strToChck);\n\t\n\t/**\n\t * This method execute the command that it receives with the parameters from param[]\n\t * @param commandToExecute the command to execute \n\t * @param params all the data that the command needs to execute\n\t */\n\tvoid excuteCommand(Command commandToExecute, String [] params);\n}", "public MainEntry() {\n\t\tthis.taskController = new Controller();\n\t}", "public abstract void initController();", "public Controller() {\n\t\tdoResidu = false;\n\t\tdoTime = false;\n\t\tdoReference = false;\n\t\tdoConstraint = false;\n\t\ttimeStarting = System.nanoTime();\n\t\t\n\t\tsetPath(Files.getWorkingDirectory());\n\t\tsetSystem(true);\n\t\tsetMultithreading(true);\n\t\tsetDisplayFinal(true);\n\t\tsetFFT(FFT.getFastestFFT().getDefaultFFT());\n\t\tsetNormalizationPSF(1);\n\t\tsetEpsilon(1e-6);\n\t\tsetPadding(new Padding());\n\t\tsetApodization(new Apodization());\n\n\t\tmonitors = new Monitors();\n\t\tmonitors.add(new ConsoleMonitor());\n\t\tmonitors.add(new TableMonitor(Constants.widthGUI, 240));\n\n\t\tsetVerbose(Verbose.Log);\n\t\tsetStats(new Stats(Stats.Mode.NO));\n\t\tsetConstraint(Constraint.Mode.NO);\n\t\tsetResiduMin(-1);\n\t\tsetTimeLimit(-1);\n\t\tsetReference(null);\n\t\tsetOuts(new ArrayList<Output>());\n\t}", "public static void main(String[] args){\n\t\tView view = new View();\r\n\t\tDatabaseInteraction model = new DatabaseInteraction();\r\n\r\n\t\t//Initialize controller. \r\n\t\tController controller = new Controller(view,model);\r\n\r\n\t\t//Connect database, start user interaction, and let the controller respond to user options. \r\n\t\tmodel.connectDatabase();\r\n\t\tcontroller.userInteracion();\r\n\t\tcontroller.respondToUserOption();\r\n\r\n\t}", "public NearestParksController() {\n this.bn = new BicycleNetwork();\n this.pf = new LocationFacade();\n // this.bn.loadData();\n }", "@Override\r\n protected void generateControllerPaths() {\r\n\r\n controllerPaths = new HashMap<>();\r\n\r\n controllerPaths.put( \"index\", pathRoot );\r\n controllerPaths.put( \"add\", pathRoot + \"/add\" );\r\n controllerPaths.put( \"edit\", pathRoot + \"/edit?id=\" );\r\n controllerPaths.put( \"delete\", pathRoot + \"/delete?id=\" );\r\n controllerPaths.put( \"manage\", pathRoot + \"/manage\" ); \r\n \r\n \r\n \r\n }", "boolean InitController();", "public static void main(String[] args) { \n new FlightController(); \n }", "public static void main(String[] args) {\n staticFiles.location(\"/public\");\n\n //This will listen to GET requests to /model and return a clean new model\n get(\"/model/:Version\", (req, res) -> newModel( req ));\n\n //This will listen to POST requests and expects to receive a game model, as well as location to fire to\n post(\"/fire/:Version/:row/:col/:hard\", (req, res) -> fireAt( req ));\n //This will handle the scan feature\n post(\"/scan/:Version/:row/:col/:hard\", (req, res) -> scan( req ));\n\n //This will listen to POST requests and expects to receive a game model, as well as location to place the ship\n post(\"/placeShip/:Version/:id/:row/:col/:orientation/:hard\", (req, res) -> placeShip( req ));\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\tJFrame frame = new JFrame(\"Solitaire\");\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\r\n\t\tController control = new Controller();\r\n\t\tframe.getContentPane().add(new Panel(control));\r\n\t\tframe.pack();\r\n\t\tframe.setSize(1000,500);\r\n\t\t\r\n\t\tframe.setVisible(true);\r\n\t}", "public static void main(String[] args)\r\n\t{\r\n\t\tConnectionInformation connect = new ConnectionInformation( args[0], args[1], args[2], args[3], args[4], Integer.parseInt(args[5]) );\r\n\t\tnew Controller(connect);\r\n\t}", "public static void main(String[] args) {\n\t\tAbstractDataHandlerFactory dataHandlerFactory = DataHandler.getDataHandlerInstance(); \n\t\t\n\t\t// Create a Controller object to begin the application and control code flow \n\t\tController control = new Controller(dataHandlerFactory);\t\n\t}", "@FXML\n public void getDirections(ActionEvent event) throws IOException {\n\n if (selectedBtnStart == null) {\n errorLabel.setText(\"Please Choose Start\");\n } else if (selectedBtnDest == null) {\n errorLabel.setText(\"Please Choose Destination\");\n } else if (selectedBtnStart.equals(selectedBtnDest)) {\n errorLabel.setText(\"Please Choose Different Locations\");\n } else {\n //create path finding object\n PathFinding pf = PathFindingFactory.makePathFinding((ArrayList<Node>) nodes,\n selectedBtnStart, selectedBtnDest);\n pf.pathFind();\n PathFindController.setPath(pf.getPath());\n\n\n if (pf.getPath().size() < 2) {\n errorLabel.setText(\"Invalid Path\");\n } else {\n KioskApplication.getHistory().push(() -> {\n KioskApplication.getMainScreenController().changeToDirections(\n pf.getStart(), pf.getDest());\n Platform.runLater(() -> {\n try {\n ((PathFindStartController) KioskApplication.getController())\n .getDirections(null);\n } catch (IOException ex) {\n //wont\n }\n });\n });\n KioskApplication.getMapController().drawPath(PathFindController.getPath());\n\n AnchorPane pathFindText = FXMLLoader.load(getClass()\n .getResource(\"/layout/UI_SoftEng_PathFindText.fxml\"));\n\n KioskApplication.switchPanel(mainAnchorPane, pathFindText);\n }\n }\n }", "public interface Controller {\n\tpublic void fire(Class type, Object data);\n\tpublic void register(Class type, View rec);\n\tpublic Controller getParent();\n\tpublic int getLineNumber();\n\tpublic int getSpineNumber();\n\tpublic Writer getErrStream();\n}", "public Controller()\n\t{\n\t\ttheParser = new Parser();\n\t\tstarList = theParser.getStars();\n\t\tmessierList = theParser.getMessierObjects();\n\t\tmoon = new Moon(\"moon\");\n\t\tsun = new Sun(\"sun\");\n\t\tconstellationList = theParser.getConstellations();\n\t\tplanetList = new ArrayList<Planet>();\n\t\ttheCalculator = new Calculator();\n\t\tepoch2000JD = 2451545.0;\n\t}", "public Controller() {\n\t\t//Set the file to null as default\n\t\tprojectFile = null;\n\t\t\n\t\t//Set the action log\n\t\tactionLog = new ActionLog(this);\n\t\t\n\t\t//Set the selected instrument ID\n\t\tselectedInstrumentID = 0;\n\t\t\n\t\t//Set the gson reader/writer\n\t\tgson = new GsonBuilder()\n\t\t\t\t.setPrettyPrinting()\n\t\t\t\t.create();\n\t\t\n\t\t//Set the File Chooser\n\t\tfileChooser = new FileChooser();\n\t\t\n\t\tfileChooser.setTitle(\"Save Project\");\n\t\t\n\t\tfileChooser.getExtensionFilters().add(new ExtensionFilter(\"JSON\", \"*.json\"));\n\t\t\t\t\n\t\t//Set note frequencies\n\t\tnoteFrequencies = new double[]{-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0};\n\t\t\n\t\t//Set selected notes\n\t\tselectedNotes = new Button[] {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null};\n\t}", "public CampusPathsController(CampusPaths model, CampusPathsView view) {\n\t\tthis.model = model;\n\t\tthis.view = view;\n\t\tview.getFindButton().addActionListener(new FindListener());\n\t\tview.getResetButton().addActionListener(new ResetListener());\n\t}", "public interface IPathFinderProvider {\n\t\n /**\n * Method for creating a new Maze Path Finder.\n * \n * @param mazeModel to solve\n * @return Used to solve maze\n */\n public IMazePathFinder createInstance(MazeModel mazeModel);\n}", "public interface ControllerInterface {\n\t/**\n\t * Move the player to next cell based on the direction passed.\n\t * @param direction indicates which direction an agent move to. \n\t */\n\tpublic void move(String direction);\n\t/**\n\t * Reload the maze map based on user supplied difficulty level and theme.\n\t * @param difficultyLevel indicates which difficulty level user has selected.\n\t * @param theme indicates which theme user selected. Theme mainly refers to the appearance of elements of game, such as image of the player, \n\t * background of the cell. \n\t */\n\tpublic void reStartGame(String difficultyLevel, String theme);\n\t\n\tpublic void startTimer(int timeLimit);\n}", "public static void main(String[] args) {\n staticFiles.location(\"/public\");\n //This will listen to GET requests to /model and return a clean new model\n get(\"/model\", (req, res) -> newModel());\n //This will listen to POST requests and expects to receive a game model, as well as location to fire to\n post(\"/fire/:row/:col\", (req, res) -> fireAt(req));\n //This will listen to POST requests and expects to receive a game model, as well as location to place the ship\n post(\"/placeShip/:id/:row/:col/:orientation\", (req, res) -> placeShip(req));\n }", "public interface ControllerService {\n\n /**\n * Returns the details about this NiFi necessary to communicate via site to site\n * @return\n */\n String getController(String clientId);\n\n /**\n * Retrieves details about this NiFi to put in the About dialog\n * @return\n */\n String getControllerAbout(String clientId);\n\n /**\n * Creates a new archive of this NiFi flow configuration\n * @return\n */\n String postControllerArchieve(String version, String clientId);\n\n /**\n * Retrieves the user details, including the authorities, about the user making the request\n * @param clientId\n * If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.\n * @return\n */\n String getControllerAuthorties(String clientId);\n\n /**\n * Retrieves the banners for this NiFi\n * @param clientId\n * If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.\n * @return\n */\n String getControllerBanners(String clientId);\n\n /**\n * Gets current bulletins\n *\n * @param clientId\n * If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.\n * @param after\n * Includes bulletins with an id after this value.\n * @param sourceName\n * Includes bulletins originating from this sources whose name match this regular expression.\n * @param message\n * Includes bulletins whose message that match this regular expression.\n * @param sourceId\n * Includes bulletins originating from this sources whose id match this regular expression.\n * @param groupId\n * Includes bulletins originating from this sources whose group id match this regular expression.\n * @param limit\n * The number of bulletins to limit the response to.\n *\n * @return\n */\n String getControllerBulletinBoard(String clientId, String after, String sourceName, String message, String sourceId, String groupId, String limit);\n\n /**\n * Retrieves the configuration for this NiFi\n *\n * @param clientId\n * If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.\n *\n * @return\n */\n String getControllerConfiguration(String clientId);\n\n String putControllerConfiguration(String clientId);\n\n /**\n * Gets the current status of this NiFi\n *\n * @param clientId\n * If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.\n *\n * @return\n */\n ControllerStatusEntity getControllerStatus(String clientId);\n\n /**\n * Creates a template\n *\n * @param clientId\n * If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.\n * @param name\n * The template name.\n * @param description\n * The template description.\n * @param snippetId\n * The id of the snippet whose contents will comprise the template.\n *\n * @return\n */\n String postControllerTemplate(String clientId, String name, String description, String snippetId);\n\n /**\n * Gets all templates\n *\n * @param clientId\n * If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.\n *\n * @return\n */\n String getControllerAllTemplates(String clientId);\n\n /**\n * Exports a template\n *\n * @param clientId\n * If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.\n *\n * @param templateId\n * The template id.\n *\n * @return\n */\n String getControllerTemplate(String clientId, String templateId);\n\n /**\n * Deletes a template\n *\n * @param clientId\n * If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.\n *\n * @param templateId\n * The template id.\n *\n * @return\n */\n String deleteControllertemplate(String clientId, String templateId);\n\n /**\n * Gets the diagnostics for the system NiFi is running on\n *\n * @param clientId\n * If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.\n *\n * @return\n */\n String getControllerSystemDiagnostics(String clientId);\n}", "private Controller() {\n\t\tthis.gui = GUI.getInstance();\n\t\tthis.gui.setController(this);\n\t}", "public static void main(String[] args) { //type “psvm + tab” to autocreate this\n // directing the server to immediate files it should access. Just like index\n staticFileLocation(\"/public\");\n\n\n // routes as per their handlebars templates. Make sure to read and understand what they do\n get(\"/\", (req, res) -> {\n Map<String, Object> model = new HashMap<>();\n return new ModelAndView(model, \"index.hbs\");\n }, new HandlebarsTemplateEngine());\n\n get(\"/animalnew\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n return new ModelAndView(model, \"animalForm.hbs\");\n }, new HandlebarsTemplateEngine());\n\n get(\"/endangerednew\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n return modelAndView(model,\"endangeredForm.hbs\");\n }, new HandlebarsTemplateEngine());\n\n get(\"/sightingsnew\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n return modelAndView(model,\"sightingsForm.hbs\");\n }, new HandlebarsTemplateEngine());\n\n get(\"/animals\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n List peter = Endangered.relative_All();\n System.out.println(peter.get(0));\n model.put(\"endangered\", peter);\n return modelAndView(model, \"endangered.hbs\");\n }, new HandlebarsTemplateEngine());\n\n\n get(\"/sightings\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n return modelAndView(model, \"sightings.hbs\");\n }, new HandlebarsTemplateEngine());\n\n get(\"/saved\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n List sightings = Sightings.retrieveFromSightings();\n model.put(\"sightings\", sightings);\n return new ModelAndView(model,\"sight.hbs\");\n }, new HandlebarsTemplateEngine());\n\n\n get(\"/newanimal\", (request, response) -> {\n Map<String, Object> model = new HashMap<>();\n List animal = Animal.relative_All();\n model.put(\"animals\", animal);\n return new ModelAndView(model, \"wildlife.hbs\");\n }, new HandlebarsTemplateEngine());\n\n get(\"/animals/:id/edit\", (request, response) -> {\n Map<String, Object> model = new HashMap<String, Object>();\n model.put(\"animal\", Animal.find(Integer.parseInt(request.params(\":id\"))));\n return new ModelAndView(model, \"editForm.hbs\");\n }, new HandlebarsTemplateEngine());\n\n\n get(\"/animals/:id/delete\", (request, response) -> {\n Map<String, Object> model = new HashMap<String, Object>();\n Animal.find(Integer.parseInt(request.params(\":id\"))).delete();\n response.redirect(\"/animals\");\n return null;\n }, new HandlebarsTemplateEngine());\n\n\n post(\"/animals/:id/edit\", (request, response) -> {\n Map<String, Object> model = new HashMap<String, Object>();\n int id = Integer.parseInt(request.params(\":id\"));\n String name = request.queryParams(\"name\");\n Animal animal = Animal.find(id);\n animal.setName(name);\n animal.update();\n return new ModelAndView(model, \"ess.hbs\");\n }, new HandlebarsTemplateEngine());\n\n\n post(\"/succ\", (req, res) -> { //new\n Map<String, Object> model = new HashMap<>();\n String animalname = req.queryParams(\"animalname\");\n String rangername = req.queryParams(\"ranger\");\n String location = req.queryParams(\"location\");\n Sightings sightings = new Sightings(animalname,rangername,location);\n sightings.save();\n model.put(\"sightings\", sightings);\n return modelAndView(model, \"succ.hbs\");\n }, new HandlebarsTemplateEngine());\n\n\n\n //post methods\n post(\"/success\", (req, res) -> {\n Map<String, Object> model = new HashMap<>();\n String name = req.queryParams(\"name\");\n String health = req.queryParams(\"health\");\n String age = req.queryParams(\"age\");\n Endangered endangered = new Endangered(name, health, age);\n endangered.save();\n System.out.println(\"Please enter all input fields.\");\n return new ModelAndView(model,\"success.hbs\");\n }, new HandlebarsTemplateEngine());\n\n post(\"/wildlife\", (req, res) -> {\n Map<String, Object> model = new HashMap<>();\n String name = req.queryParams(\"name\");\n Animal animal = new Animal(name);\n animal.save();\n return new ModelAndView(model,\"ess.hbs\");\n }, new HandlebarsTemplateEngine());\n }", "public static void main(String[] args) throws FileNotFoundException {\n\n\n\t\t\n\t\tGUI Window = new GUI();\n\t\tWindow.setVisible(true);\n\t\tController MyHandler = new Controller();\n\t\tWindow.setHandler(MyHandler);\n\t\tMyHandler.setWindow(Window);\n\t}", "protected abstract Controller initialScreen();", "@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\tReflections reflections = new Reflections(\"net.yourhome.server\");\r\n\t\t\t\tSet<Class<? extends IController>> controllerClasses = reflections.getSubTypesOf(IController.class);\r\n\r\n\t\t\t\tfor (final Class<? extends IController> controllerClass : controllerClasses) {\r\n\t\t\t\t\tif (!Modifier.isAbstract(controllerClass.getModifiers())) {\r\n\t\t\t\t\t\tnew Thread() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\tMethod factoryMethod;\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tfactoryMethod = controllerClass.getDeclaredMethod(\"getInstance\");\r\n\t\t\t\t\t\t\t\t\tIController controllerObject = (IController) factoryMethod.invoke(null, null);\r\n\t\t\t\t\t\t\t\t\tServer.this.controllers.put(controllerObject.getIdentifier(), controllerObject);\r\n\t\t\t\t\t\t\t\t\tSettingsManager.readSettings(controllerObject);\r\n\t\t\t\t\t\t\t\t\tcontrollerObject.init();\r\n\t\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\tServer.log.error(\"Could not instantiate \" + controllerClass.getName() + \" because getInstance is missing\", e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}.start();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}", "public End_User_0_Controller() {\r\n\t\t// primaryStage = Users_Page_Controller.primaryStage;\r\n\t\t// this.Storeinfo = primaryStage.getTitle();\r\n\t}", "public static void main(String[] args)\r\n/* 45: */ {\r\n/* 46:44 */ CauseViewer view = new CauseViewer();\r\n/* 47:45 */ Entity thing = new Entity();\r\n/* 48:46 */ thing.addType(\"dog\");\r\n/* 49:47 */ PathElementFrame pathElement = new PathElementFrame(\"toward\", thing);\r\n/* 50:48 */ JFrame frame = new JFrame();\r\n/* 51:49 */ frame.getContentPane().add(view);\r\n/* 52:50 */ frame.setBounds(0, 0, 200, 200);\r\n/* 53:51 */ frame.setVisible(true);\r\n/* 54: */ }", "public static void main(String[] args) {\n\t\t\n\t\tMyModel model = new MyModel();\n\t\t\n\t\t\n\t\tMyView my_view = new MyView();\n\t\tMyController my_controller = new MyController();\n\t\t\n\t\tmy_controller.addModel(model);\n\t\tmy_controller.addView(my_view);\n\t\tmy_view.addModel(model);\n\t\tmy_view.addController(my_controller);\n\t\t\n\n\t\t// Fill in the parameters below with your controller and view.\n\t\tGUIFunctions.createCS355Frame(my_controller, my_view);\n\t\t\n\t\t//sets up the initial scroll bars\n\t\tmy_controller.init();\n\n\t\tGUIFunctions.refresh();\n\t}", "public interface Controller {\n\n /**\n * constant timestep value, 20ms refresh rate\n */\n public static final double dt = 0.02;\n\n /**\n * resets the desired setpoint of the controller\n * @param setpoint setpoint\n */\n public void setSetpoint(double setpoint);\n\n /**\n * calculates the output power of the controller based on the current position\n */\n public void calculate();\n\n /**\n * checks whether the current value is within the required threshold to stop the controller\n * @return whether the controller has finished its feedback loop\n */\n public boolean isDone();\n}", "public void showCastMiniController() {\n }", "public void factoryMainScreen()\n\t{\n\t\t\n\t}", "public RunMVC() {\n\n\t\t//cria o Modelo e a Visao\n\t\tModel myModel \t= new Model();\n\t\tView myView \t= new View();\n\t\t//View outraView \t= new View();\n\t\tOutraView outraView \t= new OutraView();\n\n\t\t//avisa o modelo que a visao existe \n\t\tmyModel.addPropertyChangeListener(myView);\n\t\tmyModel.addPropertyChangeListener(outraView);\n\n\t\tController myController = new Controller();\n\t\tmyController.addModel(myModel);\n\t\t//myController.addView(myView);\n\t\t//myController.addView(outraView);\n\t\tmyController.initModel(start_value);\n\n\t\t//tell View about Controller \n\t\tmyView.addController(myController);\n\t\toutraView.addController(myController);\n\t\t\n\n\t}", "public static void main(String[] args) {\n MainController mainController = new MainController();\n mainController.showView();\n SessionManager.getSessionManager().getSession();\n }", "@Override\n\tprotected void setController() {\n\t\t\n\t}", "public interface Controller {\n\n void exit();\n void initialize();\n void refresh();\n void updateDataFromDataPasser();\n}", "public static void main(String[] args){\n FinagoController finagoController = new FinagoController();\n finagoController.run();\n }", "public static void main(String[] args) {\r\n \t\r\n // Creates new controller named the main controller\r\n GlobalResources.MainControl = new Control();\r\n // Starts main application\r\n GlobalResources.MainControl.StartApplication();\r\n }", "public FileManagerController() {\n fileSystemView = FileSystemView.getFileSystemView();\n desktop = Desktop.getDesktop();\n previewFactory = new PreviewFactory();\n initView();\n }", "public Controller(){\r\n\t\tthis.fabricaJogos = new JogoFactory();\r\n\t\tthis.loja = new Loja();\r\n\t\tthis.preco = 0;\r\n\t\tthis.desconto = 0;\r\n\t}", "protected Controller showScreen(String path) {\n try {\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(Main.class.getResource(path));\n\n Parent root = loader.load();\n Stage mainStage = Main.stage();\n mainStage.setScene(new Scene(root));\n mainStage.getIcons()\n .add(new Image(\"https://upload.wikimedia.org/wikipedia/en/8/8f/GeorgiaTechYellowJackets.png\"));\n mainStage.show();\n\n return loader.getController();\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }", "public PlantillaController() {\n }", "MatchController createMatchController();", "private void setUpController(){\n\n SessionController.getInstance().addCommand(new PartyCreateCommand(\"PARTY_CREATE\"));\n SessionController.getInstance().addCommand(new PartyDetailsRetrieveCommand(\"PARTY_DETAILS_RETRIEVE\"));\n SessionController.getInstance().addCommand(new PartyInvitesRetrieveCommand(\"PARTY_INVITES_RETRIEVE\"));\n SessionController.getInstance().addCommand(new PartyLeaveCommand(\"PARTY_LEAVE\"));\n SessionController.getInstance().addCommand(new PartyMemberRemoveCommand(\"PARTY_MEMBER_REMOVE\"));\n SessionController.getInstance().addCommand(new PlayerCreateCommand(\"PLAYER_CREATE\"));\n SessionController.getInstance().addCommand(new PlayerInvitesRetrieveCommand(\"PLAYER_INVITES_RETRIEVE\"));\n SessionController.getInstance().addCommand(new PlayerLogOutCommand(\"PLAYER_LOG_OUT\"));\n }", "public void start() {\n\t\tthis.controller.run();\n\t}", "@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 static void main(String[] args) {\n //Size of window\n int width = 1000;\n int height = 1100;\n Model m = new Model();\n View v = new View(m);\n Controller c = new Controller(m, v);\n v.setController(c);\n c.init(width, height);\n }", "public ConsoleController() {\n\t\tcommandDispatch = new CommandDispatch();\n\t}", "public void setup() {\n font = loadFont(\"Georgia-Italic-24.vlw\"); \n textFont(font,24);\n \n system = new System();\n keyboard = new Keyboard();\n //hmmm... controller definitions:\n //application = new Controller(); // this could contain subcontrollers?\n analyze = new Analyze();\n header = new Header();\n server = new Server();\n \n //size(640, 480, P2D);\n //size(1280, 720, P2D);\n // Or run full screen, more fun! Use with Sketch -> Present\n size(screen.width, screen.height-20, P2D);\n \n //video = new Video(this,640,480,0);\n video = new Video(this,1280,720,0);\n spectrum = new Spectrum(int (height-headerHeight)/2,int (height*(0.18))); //history (length),samplerow (row # to begin sampling)\n filter = new Filter(this);\n }", "public static void main(String[] args) {\n\t\tDrawModel model = new DrawModel();\n\t\t\n\t\t//Frame je izgled programa, korisnicki interfejs\n\t\tDrawFrame frame = new DrawFrame();\n\t\tframe.getView().setModel(model);//??????????\n\n\t\t//Controller obavlja interakciju sa korisnikom\n\t\tDrawController controller = new DrawController(model,frame);\n\t\t\n\t\tframe.setController(controller);\n\t\t\n\t\tframe.setVisible(true);\n\t\tframe.setResizable(false);\n\t\tframe.setTitle(\"Vulo project\");\n\t\tframe.setLocationRelativeTo(null);\n\t}", "public PlaneUIController() {\n this.launcherFacade = new LauncherFacade();\n }", "public void run() {\n\t\tport(8080);\n\n\t\t// Main Page, welcome\n\t\tget(\"/\", (request, response) -> \"Welcome!\");\n\n\t\t// Date\n\t\tget(\"/date\", (request, response) -> {\n\t\t\tDate d = new Date(\"frida.org\", Calendar.getInstance().get(Calendar.YEAR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DAY_OF_MONTH));\n\t\t\treturn om.writeValueAsString(d);\n\t\t});\n\n\t\t// Time\n\t\tget(\"/time\", (request, response) -> {\n\t\t\tTime t = new Time(\"frida.org\", Calendar.getInstance().get(Calendar.HOUR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MINUTE), Calendar.getInstance().get(Calendar.SECOND));\n\t\t\treturn om.writeValueAsString(t);\n\t\t});\n\t}", "public GuiController()\n {\n\n DefaultTerminalFactory terminalFactory = new DefaultTerminalFactory();\n PageStack = new ArrayDeque<>(); // Gives us a screen stack\n window = new BasicWindow(\"Just put anything, I don't even care\");\n try\n {\n screen = terminalFactory.createScreen(); //Populates screen\n screen.startScreen(); //Runs screen\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n textGUI = new MultiWindowTextGUI(screen);\n\n }", "public static void main(String[] args)\t{\n\t\tpilot.addMoveListener(pose);\t\t\t\t\t\t\t\t// enable pose tracking\n\t\tpilot.setTravelSpeed(speed);\n\t\tButton.waitForAnyPress();\n\t\t//NavPractice.goRotate(90);\t\t\t\t\t\t\t\t\t// call rotate method\n\t\tNavPractice.setNavigatorPath(10);\t\t\t\t\t\t\t// call path assignment method\n\t\tnav.followPath();\t\t\t\t\t\t\t\t\t\t\t// execute path\n\t\tButton.waitForAnyPress();\n\t}", "public ControllerProtagonista() {\n\t}", "public PacienteController() {\n\t\t\n\t\tatualizarTela();\n\t\t}", "public QueryController(String[] args){\n // Parse Args\n QueryArgs queryArgs = new QueryArgs();\n try {\n queryArgs.parseArgs(args);\n } catch (FileNotFoundException e) {\n //e.printStackTrace();\n System.err.println(\"Invalid Arguments received. Please check your arguments passed to ./search\");\n return;\n }\n\n // Run the Term Normaliser\n TermNormalizer normalizer = new TermNormalizer();\n String[] queryTerms = normalizer.transformedStringToTerms(queryArgs.queryString);\n\n //create the model\n Model model = new Model();\n model.loadCollectionFromMap(queryArgs.mapPath);\n model.loadLexicon(queryArgs.lexiconPath);\n model.loadInvertedList(queryArgs.invlistPath);\n if(queryArgs.stopListEnabled)\n {\n model.loadStopList(queryArgs.stopListPath);\n }\n if(queryArgs.printSummary && queryArgs.collectionPath != \"\")\n {\n model.setPathToCollection(queryArgs.collectionPath);\n }\n\n\n //fetch the top results from the query module\n QueryModule queryModule = new QueryModule();\n queryModule.doQuery(queryTerms, model, queryArgs.bm25Enabled);\n List<QueryResult> topResults = queryModule.getTopResult(queryArgs.maxResults);\n\n\n\n ResultsView resultsView = new ResultsView();\n if(queryArgs.printSummary)\n {\n\n DocSummary docSummary = new DocSummary();\n for(QueryResult result:topResults)\n {\n // retrieve the actualy text from the document collection\n result.setDoc(model.getDocumentCollection().getDocumentByIndex(result.getDoc().getIndex(), true));\n\n //set the summary on the result object by fetching it from the docSummary object\n result.setSummaryNQB(docSummary.getNonQueryBiasedSummary(result.getDoc(), model.getStopListModule()));\n result.setSummaryQB(docSummary.getQueryBiasedSummary(result.getDoc(), model.getStopListModule(), Arrays.asList(queryTerms)));\n }\n resultsView.printResultsWithSummary(topResults,queryArgs.queryLabel);\n }else\n {\n resultsView.printResults(topResults,queryArgs.queryLabel);\n }\n\n }", "public Controller()\n\t{\n\n\t}", "public static void main(String args[]) {\n\n\t\tFlowers example = new Flowers();\n\t\t\n\t\texample.model();\n\n\t\tif (example.search())\n\t\t\tSystem.out.println(\"Solution(s) found\");\n\t\t\n\t}", "public DocumentController() {\n\t\tthis.content = this.getstartpage();\n\t\tthis.url = \"https://\";\n\t}", "private void setupController() {\n setupWriter();\n Controller controller1 = new Controller(writer);\n controller = controller1;\n }", "public static void main(String args[]) {\n // Container fuer die Anwendung\n JFrame frame = new JFrame(\"Draw2D\"); // mit entspr. Ueberschrift\n // Inhalt der Anwendung erstellen \n // und einhaengen\n frame.getContentPane().add(new Controller(), BorderLayout.CENTER);\n\n // Close-Operation festlegen\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.pack(); // Groesse der Komponenten bestimmen\n frame.setVisible(true); // Sichtbar machen\n }", "public RunMe() throws IOException {\n\n\t\t// Load data\n\t\tloadDataMap();\n\t\t\n\t\t// Start server\n\t\tcfg = createFreemarkerConfiguration();\n\t\tsetPort(8081);\n\t\tinitializeRoutes();\n\t}", "void visit(RootController rootController);", "public static void main(String[] args) {\n LogInController logInController = new LogInController();\n logInController.initController();\n \n }", "public WorkspaceController() {\n this.workspace = new Workspace();\n pom = new ProcedureOutputManager(workspace);\t//*****\n }", "public static void main(String [] args){\n MainController run = new MainController();\n int value = run.filesExist();\n if (value == 0) {\n run.fileQUserMssgExists();\n }\n else if (value == 1) {\n run.fileQUserMssgRoomsExists();\n }\n else if (value == 2) {\n run.fileQAllExists();\n }\n run.run(value);\n }", "public EstructuraOrganicaController(){\r\n\t\tloadDefault();\r\n\t}", "public static void main(String[] args) {\n Student model = retriveStudentFromDatabase();\r\n\r\n //Create a view : to write student details on console\r\n View view = new View();\r\n\r\n Controller controller = new Controller(model, view);\r\n\r\n controller.updateView();\r\n\r\n //update model data\r\n controller.setStudentName(\"Gary\");\r\n\r\n controller.updateView();\r\n }", "public static void main() {\n \n }", "public UserPersonalInfoController() {\n\t\tMainAllControllers = controllers.MainAllControllers.getInstance();\n\t}", "public ListaSEController() {\n }", "public Controller() {\n this.model = new ModelFacade();\n this.view = new ViewFacade();\n }", "public static void main(String[] args) {\n mainController controll = new mainController(\"127.0.0.1\");\n MainFrame mf = MainFrame.getInstance();\n mf.setController(controll);\n mf.setVisible(true);\n\n //메인메뉴 띄우기\n mf.changeView(Mode.MAIN);\n }", "public MainGUI() {\n\t\tString xmlpath = \"classpath:applicationContext.xml\";\n\t\tApplicationContext applicationContext = new ClassPathXmlApplicationContext(xmlpath);\n\t\t\n\t\tcenter = (CenterController)applicationContext.getBean(\"CenterController\");\n\t\t\n\t\tinitialize();\n\t\t\n\t}", "public mainLayoutController() {\n\t }", "public static void main(String[] args) {\n ItemRegistry itemRegistry = new ItemRegistry();\n Printer printer = new Printer();\n AccountingHandler accountingHandler = new AccountingHandler();\n InventoryHandler inventoryHandler = new InventoryHandler();\n Register register = new Register(printer, itemRegistry, accountingHandler, inventoryHandler);\n Controller contr = new Controller(register);\n View view = new View(contr);\n\n view.sampleExecution();\n }", "public Solve(Controller c) \r\n\t{\r\n\t\tsuper(c);\r\n\t}", "public interface View {\r\n\t/**\r\n\t * starting the user interface\r\n\t */\r\n\tpublic void start();\r\n\t/**\r\n\t * returning the command that the user entered\r\n\t * @return string with the command that user entered\r\n\t */\r\n\tpublic String getUserCommand();\r\n\t/**\r\n\t * display the error in the commands that the client wrote\r\n\t * @param message string telling what is the error\r\n\t */\r\n\tpublic void showError(String error);\r\n\t/**\r\n\t * display the outcome of command:dir <path>\r\n\t * displaying the files and directories of the specified path\r\n\t * @param dirArray string's array with the names of files and directories in the specified path\r\n\t */\r\n\tpublic void showDirPath(String[] list);\r\n\t/**\r\n\t * display the message that the maze is ready\r\n\t * @param message string with the massege:maze is ready\r\n\t */\r\n\tpublic void showGenerate3dMaze(String message);\r\n\t/**\r\n\t * displaying the specified maze\r\n\t * @param byteArr byte array representing the maze\r\n\t */\r\n\tpublic void showDisplayName(byte[] byteArr);\r\n\t/**\r\n\t * displaying the cross section which the client asked for\r\n\t * @param crossSection 2d array with the cross section asked\r\n\t */\r\n\tpublic void showDisplayCrossSectionBy(int[][] crossSection);\r\n\t/**\r\n\t * displaying the string:the maze has been saved\r\n\t * @param str string with the word:maze has been saved\r\n\t */\r\n\tpublic void showSaveMaze(String message);\r\n\t/**\r\n\t * displaying the string:the maze has been loaded\r\n\t * @param str string with the word:maze has been loaded\r\n\t */\r\n\tpublic void showLoadMaze(String message);\r\n\t/**\r\n\t * display the maze size in memory(bytes)\r\n\t * @param size the size of the maze in bytes\r\n\t */\r\n\tpublic void showMazeSize(int size);\r\n\t/**\r\n\t * display the maze size in file(bytes)\r\n\t * @param length the size of the maze in file\r\n\t */\r\n\tpublic void showFileSize(long size);\r\n\t/**\r\n\t * displaying the string:solution for maze is ready\r\n\t * @param message string with the words:solution for maze is ready\r\n\t */\r\n\tpublic void showSolveMaze(String message);\r\n\t/**\r\n\t * displaying the solution of the specified maze\r\n\t * @param sol the solution of the maze\r\n\t */\r\n\tpublic void showDisplaySolution(Solution<Position> solution);\r\n\t/**\r\n\t * a command that only gui has:solve from <name> <algorithm> <x> <y> <z>\r\n\t * showing the outcome of this command,in other wards display the solution from specific point in the maze\r\n\t * @param message message that the solution is ready\r\n\t */\r\n\tpublic void showSolveFrom(String message);\r\n\t/**\r\n\t * a command that only gui has:display half solution <name>\r\n\t * displaying a solution for the specified maze\r\n\t * @param solution solution that was calculated in the model\r\n\t */\r\n\tpublic void showDisplayHalfSolution(Solution<Position> solution);\r\n\t/**\r\n\t * display a message about some error\r\n\t */\r\n\tpublic void showExit();\r\n\t/**\r\n\t * displaying help,which shows the commands the client can write\r\n\t */\r\n\tpublic void showHelp();\r\n\t/**\r\n\t * a command that only gui have: load xml\r\n\t * @param p properties object that was loaded by the xml file\r\n\t */\r\n\tpublic void showLoadXML(Properties p);\r\n}", "public void init() {\n\t\tkontrolleri1 = new KolikkoController(this);\n\t}", "public static void main (String[] args) {\n\n Config config = ConfigUtils.loadConfig(\"/home/gregor/git/matsim/examples/scenarios/pt-tutorial/0.config.xml\");\n// config.controler().setLastIteration(0);\n// config.plans().setHandlingOfPlansWithoutRoutingMode(PlansConfigGroup.HandlingOfPlansWithoutRoutingMode.useMainModeIdentifier);\n// Scenario scenario = ScenarioUtils.loadScenario(config);\n// Controler controler = new Controler(scenario);\n// controler.run();\n\n\n// Config config = this.utils.loadConfig(IOUtils.extendUrl(ExamplesUtils.getTestScenarioURL(\"pt-tutorial\"), \"0.config.xml\"));\n config.controler().setLastIteration(1);\n config.plans().setHandlingOfPlansWithoutRoutingMode(PlansConfigGroup.HandlingOfPlansWithoutRoutingMode.useMainModeIdentifier);\n\n\n// try {\n Controler controler = new Controler(config);\n// final EnterVehicleEventCounter enterVehicleEventCounter = new EnterVehicleEventCounter();\n// final StageActivityDurationChecker stageActivityDurationChecker = new StageActivityDurationChecker();\n// controler.addOverridingModule( new AbstractModule(){\n// @Override public void install() {\n// this.addEventHandlerBinding().toInstance( enterVehicleEventCounter );\n// this.addEventHandlerBinding().toInstance( stageActivityDurationChecker );\n// }\n// });\n controler.run();\n }", "public static void run(RobotController thisRC) \n {\n \t\n \t// Sets up our framework to run this robot.\n \trc = thisRC;\n \trcType = rc.getType();\n \tmapWidth = rc.getMapHeight();\n \tslug = new ArrayList<MapLocation>();\n \tenemyHQ = rc.senseEnemyHQLocation();\n \t\n \t// This loop controls the robot for the remainder of its life.\n \twhile (true)\n \t{\n \t\t\n \t\t// No reason to run code if our robot cannot do anything.\n \t\tif (rc.isActive())\n \t\t{\n \t\t\t\n \t\t\t// Determines how our HQ will behave.\n \t\t\tif (rcType.equals(RobotType.HQ))\n \t\t\t{\n \t\t\t\ttry \n \t\t\t\t{\n \t\t\t\t\t\n \t\t\t\t\t// We need to update our SOLDIERs goal.\n \t\t\t\t\tDeathToPASTRs.setGoal();\n \t\t\t\t\t\n \t\t\t\t\t// We try to attack nearby enemies.\n \t\t\t\t\tif (!Attack.attackRandomEnemyNotHQ())\n \t\t\t\t\t{\n \t\t\t\t\t\t\n \t\t\t\t\t\t// If there are none we spawn a new SOLDIER.\n \t\t\t\t\t\tSpawn.spawnAtAllCosts();\n \t\t\t\t\t}\n \t\t\t\t} catch (Exception e) { System.out.println(\"Caught HQ Exception.\"); e.printStackTrace(); }\n \t\t\t}\n \t\t\t\n \t\t\t// Determines how our SOLDIERs will behave.\n \t\t\tif (rcType.equals(RobotType.SOLDIER))\n \t\t\t{\n \t\t\t\ttry\n \t\t\t\t{\n \t\t\t\t\t\n \t\t\t\t\t// We try to attack nearby enemies.\n \t\t\t\t\tif (!Attack.attackRandomEnemyNotHQ())\n \t\t\t\t\t{\n \t\t\t\t\t\tint newgoal = rc.readBroadcast(1);\n \t\t\t\t\t\tif (goal != newgoal)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tslug.clear();\n \t\t\t\t\t\t\tgoal = newgoal;\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (Util.integerToLoc(goal).equals(enemyHQ))\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tSurroundHQ.surroundEnemyHQ();\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\tSlug.slug(Util.integerToLoc(goal));\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t} catch (Exception e) { System.out.println(\"Caught Soldier Exception.\"); e.printStackTrace(); }\n \t\t\t}\n \t\t}\n \t\t\n \t\t// We have finished our turn so we yield.\n \t\trc.yield();\n \t}\n }", "SpawnController createSpawnController();", "ControllerNode localNode();", "public IfController()\n\t{\n\n\t}", "public viewDos() {\n initComponents();\n setTexFieldInList();\n controller= new Controller();\n this.setVisible(true);\n }", "@Override\r\n\tpublic void start() {\n\t\tthis.controller.start();\r\n\t}", "public void run() {\n\t\t\n\n\t\tSystem.out.println(\"Iniciando ejecuci�n del robot\");\n\t\t\n\t\t// Nuestro robot ser� rojo\n\t\tsetAllColors(Color.red);\n\n\t\t//DATOS QUE DEBEN COINCIDIR CON LOS DEL PROGRAMA main DE LA CLASE RouteFinder\n\t\tlong semilla = 0;\n\t\tint nFil = 16;\n\t\tint nCol = 12;\n\t\tint nObst = 40;\n\t\tint tamCelda = 50;\n\t\t\n\t\t//Orientamos inicialmente el robot hacia arriba\n\t\tturnRight(normalRelativeAngleDegrees(0 - getHeading()));\n\t\t\n\t\t//A continuaci�n nuestro robot girar� un poco sobre s� mismo\t\t\n\t\tint k = 0;\n\t\twhile(k < 20){\n\t\t\tturnRight(90);\n\t\t\tk++;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Posicion inicial : \" + problema.getNColIni() + \",\" + problema.getNFilIni() + \" Posicion final : \" + problema.getNColFin() + \",\" + problema.getNFilFin());\n\t\t\n\t\t// AQU� DEBE:\n\t\t// 1. GENERARSE EL PROBLEMA DE B�SQUEDA\n\t\t// 2. BUSCAR LA SOLUCI�N CON UN ALGORITMO DE B�SQUEDA\n\t\t// 3. EJECUTAR LA SOLUCI�N ENCONTRADA\n\t\t\n\n\t\t\n\t\t\n\t\tabiertos= new PriorityQueue<>();\n\t\tcerrados= new PriorityQueue<>();\n\t\tproblema=new Problema(nFil,nCol,tamCelda,nObst,semilla);\n\t\tarbol = new Posicion[nFil*nCol];\n\n\t\tposFinal= new Posicion(null, problema.getNFilFin(), problema.getNColFin(),null);\n\t\tposFinal.SetdistMan(0.0);\n\t\tPosicion posactual = new Posicion(null, problema.getNColIni(), problema.getNFilIni(),posFinal);\n\t\t\n\t\tabiertos.add(posactual);\n\t\t//djikstra(abiertos,cerrados,posactual,posFinal);\n\t\twhile(posactual.getPosX()!=problema.getNFilFin() || posactual.getPosY()!=problema.getNColFin()) {\n\t\t\tif(abiertos.isEmpty()) {\n\t\t\t\tthrow new RuntimeException(\"FRACASO\");\n\t\t\t}\n\t\t\tposactual=abiertos.poll();\n\t\t\tcerrados.add(posactual);\n\n\t\t\tif(posactual.distMan==0.0) {\n\t\t\t\tint cont=0;\n\t\t\t\twhile(posactual.padre!=null) {\n\t\t\t\t\tarbol[cont]= posactual;\n\t\t\t\t\tcont++;\n\t\t\t\t\tposactual=posactual.padre;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\n\t\t\t\tif((posactual.posX-1>=0) && (problema.getMalla()[posactual.posX-1][posactual.getPosY()]!=1)) {\n\t\t\t\t\tPosicion posHijo = new Posicion(posactual, posactual.posX-1, posactual.posY, posFinal);\n\t\t\t\t\tif(!abiertos.contains(posHijo)) {\n\t\t\t\t\t\tif(!cerrados.contains(posHijo)) {\n\t\t\t\t\t\t\tabiertos.add(posHijo);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tcerrados.add(posHijo);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif((posactual.posY-1>=0) && (problema.getMalla()[posactual.posX][posactual.getPosY()-1]!=1)) {\n\t\t\t\t\tPosicion posHijo = new Posicion(posactual, posactual.posX, posactual.posY-1, posFinal);\n\t\t\t\t\tif(!abiertos.contains(posHijo)) {\n\t\t\t\t\t\tif(!cerrados.contains(posHijo)) {\n\t\t\t\t\t\t\tabiertos.add(posHijo);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tcerrados.add(posHijo);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif((posactual.posX+1<problema.getnCol()) && (problema.getMalla()[posactual.posX+1][posactual.getPosY()]!=1)) {\n\t\t\t\t\tPosicion posHijo = new Posicion(posactual, posactual.posX+1, posactual.posY, posFinal);\n\t\t\t\t\tif(!abiertos.contains(posHijo)) {\n\t\t\t\t\t\tif(!cerrados.contains(posHijo)) {\n\t\t\t\t\t\t\tabiertos.add(posHijo);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tcerrados.add(posHijo);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif((posactual.posY+1<problema.getnFil()) && (problema.getMalla()[posactual.getPosX()][posactual.getPosY()+1]!=1)) {\n\t\t\t\t\tPosicion posHijo = new Posicion(posactual, posactual.posX, posactual.posY+1, posFinal);\n\t\t\t\t\tif(!abiertos.contains(posHijo)) {\n\t\t\t\t\t\tif(!cerrados.contains(posHijo)) {\n\t\t\t\t\t\t\tabiertos.add(posHijo);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tcerrados.add(posHijo);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tint cont = 0;\n\t\tarbol= ordenararbol(arbol,cont );\n\t\t// Ahora que el arbol esta ordenado, hay que hacer que el robot se mueva;\n\t\tposactual = new Posicion(null, problema.getNColIni(), problema.getNFilIni(),posFinal);\n\t\twhile(!posactual.equals(posFinal)) {\n\t\t\t//mover el robot;\n\t\t}\n\t\t\n\t\t/*\n\t\t\n\t\t\n\t\tint n=0;\n\t\tint padre=0;\n\t\tint fin=0;\n\t\tposFinal= new Posicion(null, problema.getNFilFin(), problema.getNColFin(),null);\n\t\tposFinal.SetdistMan(0.0);\n\t\tPosicion[] abierto = new Posicion[problema.getnCol()*problema.getnFil()];\n\t\tabierto[0]= new Posicion(null,problema.getNFilIni(),problema.getNColIni(),posFinal);\n\t\tPosicion[] finall = new Posicion[problema.getnCol()*problema.getnFil()]; \n\t\t\n\t\twhile(!(abierto[n].posX==abierto[padre].posX)&&(abierto[n].posY==abierto[padre].posY)) {\n\t\t\ta�adirIzq();\n\t\t\ta�adirDer();\n\t\t\ta�adirArr();\n\t\t\ta�adirAba();\n\t\t\tpadre++;\n\t\t}\n\t//\tterminar(abierto,finall,padre,fin);\n\t}\n\n\tprivate void terminar(Posicion[] abierto,Posicion[] finall,int padre,int fin) {\n\t\tif(abierto[padre].getPadre()!=null) {\n\t\t\tfinall[fin]=abierto[padre];\n\t\t\tfin++;\n\t\t\tterminar(abierto[padre].getPadre());\n\t\t}\n\t\telse {\n\t\t\tfinall[fin]=abierto[padre];\n\t\t\t\n\t\t\t//invertir array\n\t\t}\n\t} EL TERMINAR NO FURULA\n\n\n\tprivate void a�adirAba() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}\n\n\tprivate void a�adirArr() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}\n\n\tprivate void a�adirIzq() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}\n\n\tprivate void a�adirDer() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}\n\t\n\t*/\n\n}", "public static void main(String[] args) {\n\t\tModel model = new Model();\n\t\tController controller = new Controller(model);\n\t\tView view = new View(model);\n\t\t\n\t\t\n\t\tcontroller.changeModel(11);\n\t\tcontroller.changeModel(22);\n\t\tcontroller.changeModel(33);\n\t}", "public static void main(String[] args) {\n\t\tnew MenuController();\n\n\t}", "public ControllerEnfermaria() {\n }", "public Controller () {\r\n puzzle = null;\r\n words = new ArrayList <String> ();\r\n fileManager = new FileIO ();\r\n }", "public GUIController() {\n\n }", "public GetInRangeAndAimCommand() {\n xController = new PIDController(0.1, 1e-4, 1);\n yController = new PIDController(-0.1, 1e-4, 1);\n xController.setSetpoint(0);\n yController.setSetpoint(0);\n // xController.\n drive = DrivetrainSubsystem.getInstance();\n limelight = Limelight.getInstance();\n // Use addRequirements() here to declare subsystem dependencies.\n addRequirements(drive);\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tDriveCar dCar = SpringFactory.getInstance().getBean(DriveCar.class);\n\t\t\n\t\tdCar.drive();\n\t\t\n\n\t}" ]
[ "0.61802554", "0.615767", "0.61248904", "0.5993431", "0.598166", "0.5904899", "0.5884692", "0.58089495", "0.5726931", "0.57211953", "0.5719448", "0.5688481", "0.5586155", "0.55767566", "0.55752444", "0.55660856", "0.5563384", "0.5539439", "0.55336106", "0.55306894", "0.5520611", "0.5519985", "0.5506599", "0.5503503", "0.5491355", "0.5463443", "0.545956", "0.54442114", "0.54341435", "0.5429604", "0.54221725", "0.54159075", "0.5411575", "0.53963006", "0.5394314", "0.53932065", "0.53898925", "0.53801334", "0.53762126", "0.53731847", "0.5360527", "0.53532404", "0.53395975", "0.53291386", "0.531939", "0.5315224", "0.53079057", "0.5300521", "0.5297964", "0.5289282", "0.5288179", "0.52850765", "0.5278336", "0.52663064", "0.5256585", "0.52259034", "0.5218286", "0.521437", "0.521127", "0.52003396", "0.5184742", "0.51756907", "0.5170836", "0.5164777", "0.51636255", "0.51635474", "0.5157831", "0.5153397", "0.5153042", "0.5149978", "0.51493955", "0.51414365", "0.5139159", "0.51387465", "0.51336193", "0.5133052", "0.51308894", "0.5126007", "0.51230687", "0.51219106", "0.51214856", "0.51195014", "0.5114695", "0.5113796", "0.51092213", "0.5108578", "0.51068354", "0.50971013", "0.5088838", "0.50845873", "0.50834364", "0.5078954", "0.5078751", "0.5076828", "0.5070891", "0.50698036", "0.5065921", "0.5063607", "0.50546324", "0.5051908" ]
0.7194681
0
Public Abstract Methods Block next coordinate in path.
public abstract void blockNext();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic WB_Point nextPoint();", "public abstract Position nextPosition(Position position);", "public abstract void generateNextBlock();", "@Override\n public MFEDirection next()\n {\n if (!this.isPathValid()) {\n String msg = \"Annotated Path\" + this.getStart().getLocation() + \"->\" +\n this.getGoal().getLocation() + \": Cannot get next step \" +\n \"when path is invalid.\";\n logger.severe(msg);\n throw new IllegalStateException(msg);\n }\n final MFEDirection dir = this.path.poll();\n\n if (dir == null) {\n String msg = \"Annotated Path \" + this.getStart().getLocation() + \"->\" +\n this.getGoal().getLocation() + \": No more steps.\";\n logger.severe(msg);\n throw new NoSuchElementException(msg);\n }\n\n return dir;\n }", "public Location getNextLocation() {\n\n\t\treturn this.nextLoc;\n\n\t}", "public Point next() {\n\t\t\tif (x < size) {\n\t\t\t\treturn get(x++, y).clone();\n\t\t\t}\n\t\t\tx = 0;\n\t\t\treturn get(x++, ++y).clone();\n\n\t\t}", "private void findNextBlock(MatrixIndex cursor) {\n while (isFreeBlock(cursor) || !inBounds(cursor)){\n incrementMatrixIndex(cursor);\n }\n }", "@Override\n public void handle(long now) {\n OneIteration();\n if (current.getRow() == ia && current.getCol() == ja) {\n drawPath();\n this.stop();\n }\n }", "@Override\n public Point peekNextPosition() {\n int nextX = (current.x + 1) % 3;\n int nextY = (current.y + 1) % 3;\n// System.out.println(\"Next X: \" + nextX);\n// System.out.println(\"Next Y: \" + nextY);\n boolean wrapsInX = nextX < current.x;\n boolean wrapsInY = nextY < current.y;\n boolean singleWrap = wrapsInX != wrapsInY;\n if (singleWrap) {\n return invalidPosition();\n } else {\n return new Point(nextX, nextY);\n }\n }", "public abstract Tuple getNext();", "private Loc nextPoint(Loc l, String direction) {\n\t\tif (direction.equals(\"down\")) {\n\t\t\t// Is at bottom?\n\t\t\t// System.out.println(\"p.getx= \" + l.row);\n\t\t\tif (l.row >= matrixHeight - 1) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Loc(l.row + 1, l.col);\n\t\t} else if (direction.equals(\"left\")) {\n\t\t\tif (l.col <= 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Loc(l.row, l.col - 1);\n\t\t} else { // right\n\t\t\tif (l.col >= matrixWidth - 1) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Loc(l.row, l.col + 1);\n\t\t}\n\t}", "static Point getNextPoint(Point cur)\n\t{\n\t\tint y = cur.y;\n\t\tint x = cur.x;\n\n\t\t// reached end of column, got to next row\n\t\tif (++x > 8)\n\t\t{\n\t\t\tx = 0;\n\t\t\t++y;\n\t\t}\n\t\t\n\t\tif (y < 9)\n\t\t\treturn new Point(y, x);\n\n\t\treturn null; // reached end of grid\n\t}", "protected void next() {\n\t\t// Next node\n\t\tnode = path.remove(0);\n\t\ttransition(NavigatorState.ROTATE_TO);\n\t}", "public CellCoord nextRow() {\n return new CellCoord(column, row + 1);\n }", "public ShapeNode getNext()\n {\n return next;\n }", "public abstract void goNext();", "public void next(){\n\t\tif(generated)\n\t\t\tcurr++;\n\t}", "public Block createPath(Block currentBlock){\n\n\t\tint indexOfNeighbouringBlock = (int) (Math.random()*RoomGen.neighbouringBlocks.get(currentBlock).size());\n\t\tint size = RoomGen.neighbouringBlocks.get(currentBlock).size();\n\t\t\n\t\tif(!path.contains(currentBlock)){\n\t\t\tpath.add(currentBlock);\n\t\t}\n\t\t\n\t\t//set the next index to make sure that elements of path are distinct\n\t\tSystem.out.println(\"size of neighbours: \" + RoomGen.neighbouringBlocks.get(currentBlock).size());\n\t\tif(path.contains(RoomGen.neighbouringBlocks.get(currentBlock).get(indexOfNeighbouringBlock))){\n\t\t\tif(indexOfNeighbouringBlock != 0 || indexOfNeighbouringBlock == RoomGen.neighbouringBlocks.get(currentBlock).size() - 1){\n\t\t\t\tindexOfNeighbouringBlock = indexOfNeighbouringBlock-1;\n\t\t\t}else{\n\t\t\t\tindexOfNeighbouringBlock = indexOfNeighbouringBlock+1;\n\t\t\t}\n\t\t}else{\t\t\n\t\t}\n\t\tBlock next = new Block(0,0,0,0);\n\t\t\n\t\t//Initialise next block\n\t\tif(unfinishedDoors.contains(RoomGen.neighbouringBlocks.get(currentBlock).get(indexOfNeighbouringBlock))){\n\t\t\tnext = RoomGen.neighbouringBlocks.get(currentBlock).get(indexOfNeighbouringBlock);\n\t\t}else{\n\t\t\tfor(int i = 0; i<RoomGen.neighbouringBlocks.get(currentBlock).size(); i++){\n\t\t\t\tif(unfinishedDoors.contains(RoomGen.neighbouringBlocks.get(currentBlock).get(i))){\n\t\t\t\t\tnext = RoomGen.neighbouringBlocks.get(currentBlock).get(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}else if(i==RoomGen.neighbouringBlocks.get(currentBlock).size()-1){\n\t\t\t\t\treturn currentBlock;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\taddDoor(currentBlock, next);\n\t\t\n\t\tcurrentBlock.addDoor();\n\t\tnext.addDoor();\n\t\t\n\t\t//if current block reaches full door potential when adding door to next,\n\t\t//add it to the list of finished blocks and remove it from the list of unfinished ones\n\t\tif(currentBlock.getPotentialDoorNum() == currentBlock.getCurrentDoorNum()){\n\t\t\tfinishedDoors.add(currentBlock);\n\t\t\tfor(int i = 0; i< unfinishedDoors.size(); i++){\n\t\t\t\tif(unfinishedDoors.get(i).equals(currentBlock)){\n\t\t\t\t\tunfinishedDoors.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//path ends if next reaches full door potential when adding door from b to next\n\t\t//next is put to finished list and removed from unfinished list\n\t\tif(next.getPotentialDoorNum() == next.getCurrentDoorNum()){\n\t\t\tfinishedDoors.add(next);\n\t\t\tpath.add(next);\n\t\t\t\n\t\t\tfor(int i = 0; i< unfinishedDoors.size(); i++){\n\t\t\t\tif(unfinishedDoors.get(i).equals(next)){\n\t\t\t\t\tunfinishedDoors.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn next;\n\t\t}\n\t\t//otherwise the path continues\n\t\telse{\n\t\t\treturn createPath(next);\n\t\t}\n\t\t}", "private Coordinate getPosition(double progressToNextStop) {\n List<PointInPath> coords = routes.get(currRouteIndex).getRoute();\n // get total route length\n double totalDistance = Math2D.getRouteLength(routes.get(currRouteIndex));\n\n if(progressTowardsNextStop > 0.99) {\n return coords.get(coords.size()-1).getCoordinate();\n } else {\n double distanceSum = 0;\n for (int i = 0; i < coords.size() - 1; i++) {\n Coordinate coord1 = coords.get(i).getCoordinate();\n Coordinate coord2 = coords.get(i + 1).getCoordinate();\n\n double pointsDistance = Math2D.getDistanceBetweenPoints(coord1, coord2);\n\n double progressToNextPoint = (distanceSum + pointsDistance) / totalDistance;\n if (progressToNextPoint > progressToNextStop) {\n double progressToLastPoint = (distanceSum / totalDistance);\n double progressFromLastPointToCurrPos = progressToNextStop - progressToLastPoint;\n double progressFromLastPointToNextPoint = progressToNextPoint - progressToLastPoint;\n double biasToCoord2 = progressFromLastPointToCurrPos / progressFromLastPointToNextPoint;\n return Coordinate.CreateCoordinate((int) (coord1.getX() * (1 - biasToCoord2) + coord2.getX() * (biasToCoord2)),\n (int) (coord1.getY() * (1 - biasToCoord2) + coord2.getY() * (biasToCoord2)));\n }\n\n distanceSum += pointsDistance;\n }\n }\n\n return null;\n }", "void moveNext()\n\t{\n\t\tif (cursor != null) \n\t\t{\n\t\t\tif (cursor == back) \n\t\t\t{\n\t\t\t\tcursor = null;\n index = -1; //added cause i was failing the test scripts and forgot to manage the indices \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcursor = cursor.next; //moves cursor toward back of the list\n index++; //added cause i was failing to the test scripts and forgot to manage the indicies\n\t\t\t}\n\t\t}\n\t}", "public String getNextLocation() {\n return nextLocation;\n }", "private void selectNextPath(boolean inc) {\n\t\tif (this.allPathsList.size() < 1)\n\t\t\treturn;\n\t\tList<GraphPath<PathwayVertexRep, DefaultEdge>> paths = this.allPathsList.get(this.allPathsList.size() - 1)\n\t\t\t\t.getFirst();\n\t\tif (paths.size() > 1) {\n\t\t\t// System.out.println(\"allPaths.size() > 1\");\n\n\t\t\tif (inc)\n\t\t\t\tselectedPathID++;\n\t\t\telse\n\t\t\t\tselectedPathID--;\n\n\t\t\tif (selectedPathID < 0)\n\t\t\t\tselectedPathID = paths.size() - 1;\n\t\t\tif (selectedPathID > paths.size() - 1)\n\t\t\t\tselectedPathID = 0;\n\n\t\t\tif (allPaths.size() > 0) {\n\t\t\t\tselectedPath = paths.get(selectedPathID);\n\t\t\t\t// System.out.println(\"selectedPathID\"+selectedPathID);\n\t\t\t\tif (selectedPath.getEdgeList().size() > 0 && !isShiftKeyDown) {\n\t\t\t\t\tPathwayVertexRep startPrevVertex = selectedPath.getStartVertex();\n\t\t\t\t\tPathwayVertexRep endPrevVertex = selectedPath.getEndVertex();\n\t\t\t\t\tList<DefaultEdge> edgePrevList = selectedPath.getEdgeList();\n\t\t\t\t\tpreviousSelectedPath = new GraphPathImpl<PathwayVertexRep, DefaultEdge>(pathway, startPrevVertex,\n\t\t\t\t\t\t\tendPrevVertex, edgePrevList, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tselectedPathID = 0;\n\t\t}\n\n\t\t// System.out.println(\"selectedPathID=\"+selectedPathID);\n\t\tthis.allPathsList.get(this.allPathsList.size() - 1).setSecond(selectedPathID);\n\t\tisBubbleTextureDirty = true;\n\t\tsetDisplayListDirty();\n\t\ttriggerPathUpdate();\n\t}", "public abstract void next();", "public abstract void next ();", "public abstract int getNextBlock(int block) throws IOException;", "public void next() {\n if (highlight.getMatchCount() > 0) {\n Point point = highlight.getNextMatch(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n return;\n }\n Point point = file.getNextModifiedPoint(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n }", "private Location getNextLocation() {\n Location location = new Location(MockLocationEngine.class.getSimpleName());\n location.setLatitude(locations[currentIndex][0]);\n location.setLongitude(locations[currentIndex][1]);\n currentIndex = (currentIndex == locations.length - 1 ? 0 : currentIndex + 1);\n return location;\n }", "public void next() {\n\t\t}", "public Cell getNext()\n { return next; }", "private List<Point> getPath(int index) {\n\t\t \n\t \n\t\t Node fromNode = oEdge.fromNode;\n\t\t Node toNode = oEdge.toNode;\n\t\t float x1 = fromNode.longitude;\n\t\t float x2 = toNode.longitude;\n\t\t float y1 = fromNode.latitude;\n\t\t float y2 = toNode.latitude;\n\t\t double slope, angle;\n\t\t if(x1!=x2) {\n\t\t\t slope = (y2-y1)/(x2-x1);\n\t\t\t \tangle = Math.atan(slope);\n\t\t\t \t} else {\n\t\t\t \t\tangle = Math.PI/2;\n\t\t\t \t}\n\t\t Double L = Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));\n\t\t float offsetPixels=0;\n\t\t if(Math.toDegrees(angle)>Math.toDegrees(90)) {\n\t\t\t if (index==0){\n\t\t\t\t offsetPixels=roadWidth*6/10;\n\t\t\t }\n\t\t\t else if(index==1){\n\t\t\t\t offsetPixels=roadWidth*11/10;\n\t\t\t }\n\t\t\t else if(index==-1){\n\t\t\t\t offsetPixels=roadWidth*1/10;\n\t\t\t }\n\t\t\t \n\t\t } else {\n\t\t\t \n\t\t\t if (index==0){\n\t\t\t\t offsetPixels=-roadWidth*6/10;\n\t\t\t }\n\t\t\t else if(index==1){\n\t\t\t\t offsetPixels=-roadWidth*11/10;\n\t\t\t }\n\t\t\t else if(index==-1){\n\t\t\t\t offsetPixels=-roadWidth*1/10;\n\t\t\t }\n\t\t }\n\t\t \n\t\t // This is the first parallel line\n\t\t float x1p1 = x1 + offsetPixels * (y2-y1) / L.floatValue();\n\t\t float x2p1 = x2 + offsetPixels * (y2-y1) / L.floatValue();\n\t\t float y1p1 = y1 + offsetPixels * (x1-x2) / L.floatValue();\n\t\t float y2p1 = y2 + offsetPixels * (x1-x2) / L.floatValue();\n//\t\t if(oEdge.edgeID==16) {\n//\t\t\t System.out.println(\"testing\");\n//\t\t }\n\t\t \n\t\t Point P1 = new Point(x1p1,y1p1);\n\t\t Point P2 = new Point(x2p1,y2p1);\n\t\t List<Point> gP = GetPoints(P1, P2);\n\t\t return gP;\n\t \n\t}", "@Override\n public int nextIndex()\n {\n return idx+1; \n }", "private void findPath1(List<Coordinate> path) {\n\n // records the start coordinate in a specific sequence.\n ArrayList<Coordinate> starts = new ArrayList<>();\n // records the end coordinate in a specific sequence.\n ArrayList<Coordinate> ends = new ArrayList<>();\n // records the total cost of the path in a specific sequence.\n ArrayList<Integer> cost = new ArrayList<>();\n\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n Graph graph = new Graph(getEdge(map));\n graph.dijkstra(o1);\n graph.printPath(d1);\n starts.add(o1);\n ends.add(d1);\n cost.add(graph.getPathCost(d1));\n }\n }\n int index = getMinIndex(cost);\n\n Graph graph = new Graph(getEdge(map));\n graph.dijkstra(starts.get(index));\n graph.printPath(ends.get(index));\n for (Graph.Node node : graph.getPathReference()) {\n path.add(node.coordinate);\n }\n setSuccess(path);\n }", "public MapElement getNextElement(Direction dir) {\n //System.out.println(\"Le lett kérve a következő palyaelem.\");\n return neighbours[dir.getValue()];\n }", "public void setNextCell(Cell next)\r\n {\r\n this.next = next;\r\n }", "protected void nextDirection()\n {\n if (this.lastKeyDirection == Canvas.LEFT)\n {\n this.lastKeyDirection = keyDirection = Canvas.RIGHT;\n xTotalDistance = 0;\n //yTotalDistance = 0;\n }\n else if (this.lastKeyDirection == Canvas.RIGHT)\n {\n this.lastKeyDirection = keyDirection = Canvas.LEFT;\n xTotalDistance = 0;\n //yTotalDistance = 0;\n }\n }", "@Override\n\tpublic void pathFinderVisited(int x, int y) {\n\t}", "private int getNextLine() {\n return peekToken().location.start.line;\n }", "public Point next()\n\t\t{\n\t\tif (i == N)\n\t\t\tthrow new NoSuchElementException();\n\t\tp.x = side*prng.nextDouble();\n\t\tp.y = side*prng.nextDouble();\n\t\t++ i;\n\t\treturn p;\n\t\t}", "public Coordinate next() {\r\n if( ++col >= MAXCOLS ) {\r\n col = 0;\r\n if( ++row >= MAXROWS ) row = 0;\r\n }\r\n return this;\r\n }", "public int nextOffset(int curr) {\n return curr + 1;\n }", "public int nextIndex() {\n\t\t\treturn cursor;\n\t\t}", "public void setNextLocation(Location loc) {\n\n\t\tthis.nextLoc = loc;\n\n\t}", "private void getNextInSet() throws CancelledException {\n\t\t// find next address that has a valid block;\n\t\tAddress addr = getNextAddress(nextAddr);\n\n\t\t// if the instruction's start address is in our set\n\t\t// then we have our block\n\t\tif (addr != null && addrSet.contains(addr)) {\n\t\t\tnextBlock = model.getCodeBlockAt(addr, monitor);\n\t\t\tif (nextBlock != null) {\n\t\t\t\tnextAddr = nextBlock.getMaxAddress();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// otherwise we're out of our current address range in\n\t\t// our address range set so we find the next address range\n\t\t// with a min address >= the instructions address and\n\t\t// look for a block there\n\t\t//nextAddr = instr.getMaxAddress();\n\t\twhile (rangeIter.hasNext()) {\n\t\t\tAddressRange range = rangeIter.next();\n\n\t\t\tif (nextAddr.compareTo(range.getMinAddress()) >= 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnextBlock = getFirstInRange(range);\n\t\t\t// if we find a block we're done\n\t\t\tif (nextBlock != null) {\n\t\t\t\tnextAddr = nextBlock.getMaxAddress();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// if we find no block then there's no block in the\n\t\t\t// current range and we can move on to the next one\n\t\t}\n\t\tnextBlock = null;\n\t}", "@Override\r\n\tpublic void nextStep() {\n\t\tif (this.oldX == this.coord.x && this.oldY == this.coord.y) { \r\n\t\t\tthis.currentPoint = (int) (Math.random()*this.patrol.size());\r\n\t\t\tthis.targetX = this.patrol.get(currentPoint).x;\r\n\t\t\tthis.targetY = this.patrol.get(currentPoint).y;\r\n\r\n\t\t}\r\n\r\n\t\t// target point reached, make new random target point\r\n\t\tif (this.targetX == this.coord.x && this.targetY == this.coord.y) {\r\n\t\t\tif (this.currentPoint < patrol.size() - 1)\r\n\t\t\t\tthis.currentPoint++;\r\n\t\t\telse\r\n\t\t\t\tthis.currentPoint = 0;\r\n\r\n\t\t\tthis.targetX = this.patrol.get(currentPoint).x;\r\n\t\t\tthis.targetY = this.patrol.get(currentPoint).y;\r\n\t\t}\r\n\t\tint step = (this.speed == Speed.fast ? 8 : 4);\r\n\t\t// int stepX = (int) (1 + Math.random() * step);\r\n\t\t// int stepY = (int) (1 + Math.random() * step);\r\n\t\tint x0 = (int) (this.coord.getX());\r\n\t\tint y0 = (int) (this.coord.getY());\r\n\r\n\t\tint dx = this.targetX - x0;\r\n\t\tint signX = Integer.signum(dx); // get the sign of the dx (1-, 0, or\r\n\t\t\t\t\t\t\t\t\t\t// +1)\r\n\t\tint dy = this.targetY - y0;\r\n\t\tint signY = Integer.signum(dy);\r\n\t\tthis.nextX = x0 + step * signX;\r\n\t\tthis.nextY = y0 + step * signY;\r\n\t\tthis.oldX = this.coord.x;\r\n\t\tthis.oldY = this.coord.y;\r\n\t\t// System.err.println(\"targetX,targetY \"+targetX+\" \"+targetY);\r\n\t}", "@Override\n public IntVec3 next() {\n if(this.hasNext()){\n this.current = this.current.clone();\n } else throw new NoSuchElementException();\n if(this.current.x != this.end.x){\n this.current=this.current.incrX(this.xDir);\n } else if(this.current.y != this.end.y){\n this.current=IntVec3.get(0, this.current.y + this.yDir, this.current.z);\n } else if(this.current.z != this.end.z){\n this.current=IntVec3.get(0, 0, this.current.z + this.zDir);\n } else throw new NoSuchElementException();\n return this.current;\n }", "public void next(){\n\t\tboundIndex = (boundIndex+1)%buttonBounds.length;\n\t\tupdateButtonBounds();\n\t}", "@Override\n public NodoL next() {\n posicionActual = posicionActual.getSiguiente();\n return posicionActual;\n }", "@Override\n\tpublic Lista<Coordenada> getNextMovements() {\n\n\t\tLista<Coordenada> lista = new Lista<Coordenada>();\n\n\t\taddCoordenada(posicion.up(), lista);\n\t\taddCoordenada(posicion.right(), lista);\n\t\taddCoordenada(posicion.down(), lista);\n\t\taddCoordenada(posicion.left(), lista);\n\t\taddCoordenada(posicion.diagonalUpRight(), lista);\n\t\taddCoordenada(posicion.diagonalUpLeft(), lista);\n\t\taddCoordenada(posicion.diagonalDownRight(), lista);\n\t\taddCoordenada(posicion.diagonalDownLeft(), lista);\n\n\t\treturn lista;\n\t}", "public abstract LinkedList<Point> traverse(Grid grid);", "@Override\n protected void moveToNextRow(){\n incrementRow();\n resetXPos();\n if(getRow()%2 == 1){\n incrementYPos(getHeight()+getHeight());\n }\n resetCol();\n setPointDirection();\n }", "public Vertex getNext() {\n\t\treturn next;\n\t}", "public int nextIndex() {\n return curIndex;\n }", "public Square step() {\n // TODO\n \tSquare c = exploreList.getNext();\n \tSquare realSquare = sea.getSea()[c.getRow()][c.getCol()];\n // check for if we are visited, if so return to skip processing current square\n \tif(realSquare.isVisited()) {\n \t\treturn c;\n \t\t\n \t}\n \trealSquare.setVisited();\n \tfor(Square neighs : sea.getAdjacentArea(realSquare)) {\n \t\tif(neighs.getPrevious() ==null) {\n \n \t\tneighs.setPrevious(c);\n \t\texploreList.add(neighs);\n \t\t}\n\t\telse {\n\t\tif(!neighs.isVisited()) {\n \t\t\tSquare n = new Square(neighs.getRow(), neighs.getCol(), neighs.getType());\n \t\t\tn.setPrevious(c);\n \t\t\texploreList.add(n);\n}\n\t\t}\n \t}\n \treturn c;\n\n }", "private MapCell nextCell(MapCell cell) {\r\n\t\t\r\n\t\t//This is an array that holds the possible neighbouring tiles.\r\n\t\tMapCell[] potentialCells = {null,null,null,null};\r\n\t\t\r\n\t\t//This variable is an indicator. If it remains -1, that means no possible neighbouring tiles were found.\r\n\t\tint next = -1; \r\n\t\t\t\r\n\t\t//If the cell is a north road, check that its neighbour to the north is not null or marked. Then, see if it's either\r\n\t\t//an intersection, the destination, or another north road.\r\n\t\tif(cell.getNeighbour(0)!=null && cell.isNorthRoad()) {\r\n\r\n\t\t\tif(!cell.getNeighbour(0).isMarked()) {\r\n\r\n\t\t\t\tif(cell.getNeighbour(0).isIntersection()||cell.getNeighbour(0).isDestination()||cell.getNeighbour(0).isNorthRoad()) {\r\n\r\n\t\t\t\t\t//Add the north neighbour to the array of potential next tiles.\r\n\t\t\t\t\tpotentialCells[0] = cell.getNeighbour(0);\r\n\t\t\t\t\tnext = 0;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t//If the cell is an east road, check that its neighbour to the east is not null or marked. Then, see if it's either\r\n\t\t//an intersection, the destination, or another east road.\r\n\t\t} else if (cell.getNeighbour(1)!=null && cell.isEastRoad()) {\r\n\r\n\t\t\tif(!cell.getNeighbour(1).isMarked()) {\r\n\r\n\t\t\t\tif(cell.getNeighbour(1).isIntersection()||cell.getNeighbour(1).isDestination()||cell.getNeighbour(1).isEastRoad()) {\r\n\r\n\t\t\t\t\t//Add the east neighbour to the potential next tiles.\r\n\t\t\t\t\tpotentialCells[1] = cell.getNeighbour(1);\r\n\t\t\t\t\tnext = 0;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t//If the cell is a south road, check that its neighbour to the south is not null or marked. Then, see if it's either\r\n\t\t//an intersection, the destination, or another south road.\r\n\t\t} else if (cell.getNeighbour(2)!=null && cell.isSouthRoad()) {\r\n\r\n\t\t\tif(!cell.getNeighbour(2).isMarked()) {\r\n\r\n\t\t\t\tif(cell.getNeighbour(2).isIntersection()||cell.getNeighbour(2).isDestination()||cell.getNeighbour(2).isSouthRoad()) {\r\n\r\n\t\t\t\t\t//Add the south neighbour to the potential next tiles.\r\n\t\t\t\t\tpotentialCells[2] = cell.getNeighbour(2);\r\n\t\t\t\t\tnext = 0;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t//If the cell is a west road, check that its neighbour to the west is not null or marked. Then, see if it's either\r\n\t\t//an intersection, the destination, or another west road.\r\n\t\t} else if (cell.getNeighbour(3)!=null && cell.isWestRoad()) {\r\n\r\n\t\t\tif(!cell.getNeighbour(3).isMarked()) {\r\n\r\n\t\t\t\tif(cell.getNeighbour(3).isIntersection()||cell.getNeighbour(3).isDestination()||cell.getNeighbour(3).isWestRoad()) {\r\n\r\n\t\t\t\t\t//Add the west neighbour to the potential next tiles.\r\n\t\t\t\t\tpotentialCells[3] = cell.getNeighbour(3);\r\n\t\t\t\t\tnext = 0;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t//If the current cell is an intersection, go through all 4 of its potential neighbours.\r\n\t\t} else {\r\n\r\n\t\t\tfor(int i = 0; i<4; i++) {\r\n\r\n\t\t\t\t//Check that the neighbour isn't null or marked.\r\n\t\t\t\tif(cell.getNeighbour(i)!=null) {\r\n\r\n\t\t\t\t\tif(!cell.getNeighbour(i).isMarked()) {\r\n\r\n\t\t\t\t\t\t//Check to see if the neighbour is either an intersection, or a one-way road in the proper orientation to\r\n\t\t\t\t\t\t//continue the path.\r\n\t\t\t\t\t\tif(cell.getNeighbour(i).isIntersection()||cell.getNeighbour(i).isDestination()||(i==0\r\n\t\t\t\t\t\t\t\t&&cell.getNeighbour(i).isNorthRoad())||(i==1&&cell.getNeighbour(i).isEastRoad())||(i==2\r\n\t\t\t\t\t\t\t\t&&cell.getNeighbour(i).isSouthRoad())||(i==3&&cell.getNeighbour(i).isWestRoad())) {\r\n\r\n\t\t\t\t\t\t\t//Add the tile to the possible next tiles.\r\n\t\t\t\t\t\t\tpotentialCells[i] = cell.getNeighbour(i);\r\n\t\t\t\t\t\t\tnext = 0;\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\t//If no tiles were found, return null.\r\n\t\tif(next == -1) {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t//Otherwise, select one (or one of) the next possible tiles and return it.\r\n\t\t} else {\r\n\r\n\t\t\tfor(int i = 3; i >= 0; i--) {\r\n\r\n\t\t\t\tif(potentialCells[i]!=null) {\r\n\r\n\t\t\t\t\tnext = i;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn potentialCells[next];\r\n\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n\tpublic Cell getNextCell(Grid g, int x, int y) {\n\t\treturn null;\n\t}", "private XSSFCell getNextCell() {\r\n\r\n if (currColNum - firstcol + 1 == taskconfig.colNum) {\r\n currColNum = firstcol;\r\n currRowNum++;\r\n } else {\r\n currColNum++;\r\n }\r\n\r\n cell = getCell(currRowNum, currColNum);\r\n if (cell.getCellTypeEnum()==CellType.STRING && cell.getStringCellValue().contains(\"-\")) {\r\n getNextCell();\r\n ;\r\n }\r\n \r\n\r\n return cell;\r\n }", "private void findPath(int current){\r\n // remove current from OPEN\r\n int index = insideArray(_openSet,current);\r\n if(index == -1){\r\n System.out.println(\"findPath method returns -1.\");\r\n }\r\n _openSet.remove(index);\r\n\r\n // add current to CLOSED\r\n _closedSet.add(current);\r\n\r\n // if current is the target node\r\n if(current == _endIndex){\r\n return;\r\n }\r\n\r\n int neighborNum = _map.get_grid(current).get_neighborNum();\r\n int[] neighbors = _map.get_grid(current).get_neighbors();\r\n\r\n //for each neighbor of the current node\r\n for(int i=0;i<neighborNum;i++){\r\n Grid neighborGrid = _map.get_grid(neighbors[i]);\r\n // if neighbor is not traversable or neighbor is in CLOSED\r\n // SKIP THIS NEIGHBOR\r\n if(!neighborGrid.get_type().equals(\"|\") && insideArray(_closedSet,neighbors[i]) == -1){\r\n int currentNeighborF = neighborGrid.get_Fnum();\r\n int neighborF = findF(neighbors[i]);\r\n if(neighborF < currentNeighborF || insideArray(_closedSet,neighbors[i]) == -1){\r\n neighborGrid.set_Fnum(neighborF);\r\n neighborGrid.set_parent(current);\r\n if(insideArray(_closedSet,neighbors[i]) == -1){\r\n _openSet.add(neighbors[i]);\r\n }\r\n }\r\n }\r\n }\r\n int currentIndex = smallestF();\r\n // RECURSIVE CALL\r\n findPath(_map.get_grid(_openSet.get(currentIndex)).get_index());\r\n }", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "public Rectangle getNextWaypoint(Vector2 start, Vector2 destinatin, Vector2 offset) {\r\n if(this.grid.contains(start, offset)) {\r\n if(this.grid.contains(destinatin, offset)) {\r\n // Get Start Rectangle with scene offset\r\n Rectangle current = this.grid.getRectAtPosition(start,offset);\r\n Rectangle destination = grid.getRectAtPosition(destinatin, offset);\r\n Rectangle nextRect = null;\r\n int nextDist = 0;\r\n for(Rectangle refRect : this.grid.getRectangles()) {\r\n if(!refRect.isSame(current)) {\r\n int startX = current.getX();\r\n int startY = current.getY();\r\n int refX = refRect.getX() + offset.getX();\r\n int refY = refRect.getY() + offset.getY();\r\n int xA = (refX - startX) / 48;\r\n int yA = (refY - startY) / 48;\r\n\r\n if(xA <= 1 && xA >= -1 && yA <= 1 && yA >= -1) {\r\n int x = Math.abs((destination.getX() - refX) / 48);\r\n int y = Math.abs((destination.getY() - refY) / 48);\r\n int dist = x + y;\r\n\r\n if(nextRect == null) {\r\n nextDist = dist;\r\n nextRect = new Rectangle(refX, refY, refRect.getWidth(), refRect.getHeight());\r\n }\r\n else {\r\n if(dist < nextDist) {\r\n nextDist = nextDist;\r\n nextRect = new Rectangle(refX, refY, refRect.getWidth(), refRect.getHeight());\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if(nextRect!= null) {\r\n return nextRect;\r\n }\r\n }\r\n }\r\n return null;\r\n }", "public void move() {\n\n\tGrid<Actor> gr = getGrid();\n\tif (gr == null) {\n\n\t return;\n\t}\n\n\tLocation loc = getLocation();\n\tif (gr.isValid(next)) {\n\n\t setDirection(loc.getDirectionToward(next));\n\t moveTo(next);\n\n\t int counter = dirCounter.get(getDirection());\n\t dirCounter.put(getDirection(), ++counter);\n\n\t if (!crossLocation.isEmpty()) {\n\t\t\n\t\t//reset the node of previously occupied location\n\t\tArrayList<Location> lastNode = crossLocation.pop();\n\t\tlastNode.add(next);\n\t\tcrossLocation.push(lastNode);\t\n\t\t\n\t\t//push the node of current location\n\t\tArrayList<Location> currentNode = new ArrayList<Location>();\n\t\tcurrentNode.add(getLocation());\n\t\tcurrentNode.add(loc);\n\n\t\tcrossLocation.push(currentNode);\t\n\t }\n\n\t} else {\n\t removeSelfFromGrid();\n\t}\n\n\tFlower flower = new Flower(getColor());\n\tflower.putSelfInGrid(gr, loc);\n\t\n\tlast = loc;\n\t\t\n }", "@Test (expected=AssertionError.class)\n\tpublic final void testCurrentBoundaryNeighbor() {\n\t\tint boundarySize = totalSize/elementsPerDim;\n\t\tBoundaryIterator bdIterator = block.getBoundaryIterator();\n\t\tbdIterator.setBoundaryToIterate(new BoundaryId(0, false));\n\t\t// Step to middle of the boundary\n\t\tfor (int i=0; i< boundarySize/2; i++) {\n\t\t\tbdIterator.next();\n\t\t}\n\t\tbdIterator.currentNeighbor(0, extent + 1);\n\t}", "public void next() {\n\t\titerator.next();\n\t}", "private void nextPosition()\n\t{\n\t\tdouble playerX = Game.player.getX();\n\t\tdouble playerY = Game.player.getY();\n\t\tdouble diffX = playerX - x;\n\t\tdouble diffY = playerY - y;\n\t\tif(Math.abs(diffX) < 64 && Math.abs(diffY) < 64)\n\t\t{\n\t\t\tclose = true;\n\t\t} \n\t\telse\n\t\t{\n\t\t\tclose = false;\n\t\t}\n\t\tif(close)\n\t\t{\n\t\t\tattackPlayer();\n\t\t} \n\t\telse if(alarm.done())\n\t\t{\n\t\t\tdirection = Math.abs(random.nextInt() % 360) + 1;\n\t\t\talarm.setTime(50);\n\t\t}\n\t\thspd = MathMethods.lengthDirX(speed, direction);\n\t\tvspd = MathMethods.lengthDirY(speed, direction);\n\t\tif(hspd > 0 && !flippedRight)\n\t\t{\n\t\t\tflippedRight = true;\n\t\t\tsetEnemy();\n\t\t} \n\t\telse if(hspd < 0 && flippedRight)\n\t\t{\n\t\t\tflippedRight = false;\n\t\t\tsetEnemy();\n\t\t}\n\t\tmove();\n\t\talarm.tick();\n\t\tshootTimer.tick();\n\t}", "private Address getNextAddress(Address addr) {\n\n\t\tInstruction instr = listing.getInstructionAfter(addr);\n\t\tAddress instrAddr = instr != null ? instr.getMinAddress() : null;\n\n\t\treturn instrAddr;\n// ?? ITERATOR HAS BEEN MODIFIED TO ONLY RETURN INSTRUCTION BLOCKS\n\n// Data data = getDefinedDataAfter(addr);\n// Address dataAddr = data != null ? data.getMinAddress() : null;\n// \n// if (instrAddr != null) {\n// \tif (dataAddr != null) {\n// \t\treturn (instrAddr.compareTo(dataAddr) < 0) ? instrAddr : dataAddr;\n// \t}\n// \telse {\n// \t\treturn instrAddr;\n// \t}\n// }\n// return dataAddr;\n\t}", "public Wagon<T> getNext() {\n\t\treturn next;\n\t}", "public Node next(Point p){\n\t\t// int r, Point p, LinkedList<Point> parents\n\t\t// Time? Previous time + distance\n\t\tLinkedList<Point> nextParents = new LinkedList<Point>(parents);\n\t\tnextParents.add(p);\n\t\t\n\t\tdouble nextTime = this.time + (pos.distance(p) * this.speed);\n\t\t\n\t\treturn new Node(nextTime, p, nextParents, this.speed);\n\t}", "void block(Directions dir);", "public void advance( )\r\n {\r\n\t if(isCurrent() != true){// Implemented by student.\r\n\t throw new IllegalStateException(\"no current element\");\r\n\t }\r\n\t else\r\n\t \t precursor = cursor;\r\n\t \t cursor = cursor.getLink(); // Implemented by student.\r\n }", "private static List<Point> possibleNextPos(Point currPos, Point coord1, Point coord2, double buildingSideGrad, Point buildingCentre){\r\n\t\tvar coord1Lat = coord1.latitude();\r\n\t\tvar coord1Lon = coord1.longitude();\r\n\t\tvar coord2Lat = coord2.latitude();\r\n\t\tvar coord2Lon = coord2.longitude();\r\n\t\t\r\n\t\tvar currPosLon = currPos.longitude();\r\n\t\tvar currPosLat = currPos.latitude();\r\n\t\t\r\n\t\tvar buildingLon = buildingCentre.longitude();\r\n\t\tvar buildingLat = buildingCentre.latitude();\r\n\t\t\r\n\t\tvar dir1 = computeDir(coord1, coord2); //in the case that the drone is moving in the direction coord1 to coord2\r\n\t\tvar nextPosTemp1 = nextPos(dir1, currPos); //the temporary next position if the drone moves in dir1\r\n\t\t\r\n\t\tvar dir2 = computeDir(coord2, coord1); //in the case that the drone is moving in the direction coord2 to coord1\r\n\t\tvar nextPosTemp2 = nextPos(dir2, currPos); //the temporary next position if the drone moves in dir2 \r\n\t\t\r\n\t\tvar possibleNextPos = new ArrayList<Point>();\r\n\t\t\r\n\t\tif(Math.abs(buildingSideGrad)>=1) { //in this case, longitudes of building centre and drone current position are compared\r\n\t\t\t//coord1 to coord2 scenario\r\n\t\t\tif((coord1Lat>coord2Lat && buildingLon<currPosLon) || (coord1Lat<coord2Lat && buildingLon>currPosLon)) {\r\n\t\t\t\tdir1 = (dir1+10)%360; //angle increased such that drone doesn't fly over side of building\r\n\t\t\t\tnextPosTemp1 = nextPos(dir1, currPos);\r\n\t\t\t}\r\n\t\t\t//coord2 to coord1 scenario\r\n\t\t\tif((coord1Lat<coord2Lat && buildingLon<currPosLon) || (coord1Lat>coord2Lat && buildingLon>currPosLon)) {\r\n\t\t\t\tdir2 = (dir2+10)%360;\r\n\t\t\t\tnextPosTemp2 = nextPos(dir2, currPos);\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\telse { //in this case, latitudes of building centre and drone current position are compared\r\n\t\t\tif((coord1Lon>coord2Lon && buildingLat>currPosLat) || (coord1Lon<coord2Lon && buildingLat<currPosLat)) {\r\n\t\t\t\tdir1 = (dir1+10)%360; \r\n\t\t\t\tnextPosTemp1 = nextPos(dir1, currPos);\r\n\t\t\t}\r\n\r\n\t\t\tif((coord1Lon<coord2Lon && buildingLat>currPosLat) || (coord1Lon>coord2Lon && buildingLat<currPosLat)) {\r\n\t\t\t\tdir2 = (dir2+10)%360;\r\n\t\t\t\tnextPosTemp2 = nextPos(dir2, currPos);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tpossibleNextPos.add(nextPosTemp1);\r\n\t\tpossibleNextPos.add(nextPosTemp2);\r\n\t\t\r\n\t\treturn possibleNextPos;\r\n\t}", "@Override\n public int nextPosition() {\n if (++p < tuples.size()) {\n lastTuple = tuples.get(p);\n return 0; // position is invalid in this scorer, returns 0\n }\n return NO_MORE_POS;\n }", "public Block findNewPath(int lastBlockIndex){\n\n\tif(path.get(lastBlockIndex).getPotentialDoorNum() == path.get(lastBlockIndex).getCurrentDoorNum()){\n\t\tif(lastBlockIndex <= 0) return path.get((int)(Math.random()*path.size()));\n\t\telse return findNewPath(lastBlockIndex -1);\n\t}else{\n\t\treturn path.get(lastBlockIndex);\n\t}\n}", "public void next()\n\t{\n\t\tif(this.curseur < this.listeTapis.size() - 1)\n\t\t{\n\t\t\tthis.curseur++;\n\t\t}\n\t}", "public void next() {\n Solver<ArrayList<Integer>> mySolver =\n new Solver<ArrayList<Integer>>();\n ArrayList<ArrayList<Integer>> Solution =\n mySolver.SolveBFS(this);\n\n //Reset 'tried' to none\n tried = new HashSet<ArrayList<Integer>>();\n\n //Set up the nextState\n ArrayList<Integer> nextState = new ArrayList<Integer>();\n\n if(Solution.size() == 0) {\n //No Solution\n } else if (Solution.size() == 1) {\n nextState = Solution.get(0);\n curBoard = nextState;\n } else {\n nextState = Solution.get(1);\n curBoard = nextState;\n moveCount++;\n }\n clearStack();\n\n\tsetChanged();\n\tnotifyObservers();\n }", "private StatusEnum stepInternal()\n {\n if (initialStep)\n {\n this.tail = map.getStart();\n this.openSet.push(map.getStart());\n initialStep = false;\n }\n\n if (status != StatusEnum.RUNNING)\n return status;\n\n cursor = openSet.pop(); // Pull the cursor off the open set min-heap\n if (cursor == null)\n {\n // The open set was empty, so although we have not reached the goal, there are no more points to investigate\n return StatusEnum.COMPLETED_NOT_FOUND;\n }\n\n while (closedSet.contains(cursor) || !map.isTraversable(cursor))\n {\n // The cursor is in the closed set (meaning it was already investigated) or the cursor point is non traversable on the map\n cursor = openSet.pop();\n if (cursor == null)\n {\n return StatusEnum.COMPLETED_NOT_FOUND;\n }\n }\n\n // The goal has been reached, the path is complete\n if (cursor.equals(map.getGoal()))\n {\n tail = cursor; // Set the member tail to be used in the reconstruction done in getPath()\n return StatusEnum.COMPLETED_FOUND;\n }\n\n // Add the cursor point to the closed set\n closedSet.add(cursor);\n\n // Get the list of neighboring points\n List<WeightedPoint> neighbors = neighborSelector.getNeighbors(map, cursor, heuristic);\n\n // Link the neighbors to the cursor (for backtracking the path when the goal is reached) and calculate their weight\n for (WeightedPoint wp : neighbors)\n {\n if (map.isTraversable(wp.getRow(), wp.getCol()) && !closedSet.contains(wp))\n {\n wp.setFromCost(cursor.getFromCost() + heuristic.distance(cursor, wp));\n\n if (dijkstra)\n {\n wp.setToCost(0);\n }\n else\n {\n wp.setToCost(heuristic.distance(wp, map.getGoal()));\n }\n wp.setPrev(cursor);\n }\n }\n\n if (shuffle)\n {\n // Shuffle the neighbors to randomize the order of testing nodes with the same cost value\n Collections.shuffle( neighbors );\n }\n Collections.sort( neighbors );\n\n // Put the neighbors on the open set\n for (WeightedPoint wp : neighbors)\n {\n if (!openSet.contains(wp))\n openSet.push(wp);\n }\n\n return StatusEnum.RUNNING;\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 }", "public boolean moveNext(\n )\n {\n // Scanning the current graphics object...\n ContentObject currentObject = getCurrent();\n if(currentObject != null)\n {\n \t\n \tString cmdStr = currentObject.toString();\n \t/*\n \tif(cmdStr.contains(\"f*\") || cmdStr.contains(\"{f }\")) {\n \t\tSystem.out.println(cmdStr);\n \t}\n \t*/\n \tif(!cmdStr.contains(\"{re [36, 270, 540, 720]}, {f }\")) {\n \t\tcurrentObject.scan(state);\n \t}\n }\n\n // Moving to the next object...\n if(index < objects.size())\n {index++; refresh();}\n\n return getCurrent() != null;\n }", "@Override public int getBlockIncrement(int dir)\n{\n BicexEvaluationContext ctx = for_bubble.getExecution().getCurrentContext();\n if (ctx != null) {\n BicexValue bv = ctx.getValues().get(\"*LINE*\");\n List<Integer> times = bv.getTimeChanges();\n long now = for_bubble.getExecution().getCurrentTime();\n long prev = -1;\n long next = -1;\n long cur = -1;\n for (Integer t : times) {\n\t if (t <= now) {\n\t prev = cur;\n\t cur = t;\n\t }\n\t else if (next < 0) {\n\t next = t;\n\t break;\n\t }\n }\n\n if (dir < 0 && prev > 0) {\n\t return (int) (now-prev);\n }\n else if (dir > 0 && next > 0) {\n\t return (int) (next-now);\n }\n }\n\n return super.getBlockIncrement(dir);\n}", "private void update_location() throws Exception {\r\n\t\tif (children.size() == 1) {\r\n\t\t\tCLocation bloc = children.get(0).get_location();\r\n\t\t\tthis.location = bloc.get_source().get_location(bloc.get_bias(), bloc.get_length());\r\n\t\t} else if (children.size() > 1) {\r\n\t\t\tCLocation eloc = children.get(children.size() - 1).get_location();\r\n\t\t\tint beg = this.location.get_bias(), end = eloc.get_bias() + eloc.get_length();\r\n\t\t\tthis.location.set_location(beg, end - beg);\r\n\t\t}\r\n\t}", "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}", "public void nextTile() {\n/* 779 */ this.e.nextTile();\n/* 780 */ this.k = getTileIdx();\n/* */ \n/* */ \n/* 783 */ String str = (String)this.f.f(this.k);\n/* 784 */ if (str.equals(\"none\")) {\n/* 785 */ this.h = 0;\n/* */ }\n/* 787 */ else if (str.equals(\"rct\")) {\n/* 788 */ this.h = 1;\n/* 789 */ c();\n/* */ }\n/* 791 */ else if (str.equals(\"ict\")) {\n/* 792 */ this.h = 2;\n/* 793 */ d();\n/* */ } else {\n/* */ \n/* 796 */ throw new IllegalArgumentException(\"Component transformation not recognized\");\n/* */ } \n/* */ }", "public void step() {\n\t\tint step = rand.nextInt(2);\n\t\t\n\t\tif (step==0) {\n\t\t\t\n\t\t\tPoint moveRight = new Point(++x,y);\n\t\t\t\n\t\t\tif(x<=size-1) {\n\t\t\t\tpath.add(moveRight);\n\t\t\t}\n\t\t\telse --x;\n\t\t}\n\t\telse { \n\t\t\tPoint topStep = new Point(x,--y);\n\t\t\t\n\t\t\tif(y>=0) {\n\t\t\t\tpath.add(topStep);\n\t\t\t}\n\t\t\telse ++y;\n\t\t}\n\t\tif (x==size-1 && y==0) {\n\t\t\tsetDone(true);\n\t\t}\n\t\t\n\t\t\n\t}", "public void next()\n\t{\n\t\tSystem.err.print(\"-\");\n\t\tif(pp.available())\n\t\t{\n\t\t\tSystem.err.print(\"+\");\n\t\t\timg_header=pp.getFrameHeader();\n\t\t\tbi=pp.getFrame();\n\t\t\tip[ip_index].setImage(bi);\n\t\t\tip[ip_index].repaint();\n\t\t\tip_index++;\n\t\t\t//ip_index%=cols*rows;\n\t\t\tip_index%=tiles;\n\t\t\tpp.next();\n\t\t}\n\t\tif(panel_glass.isVisible() || is_paused)\n\t\t{\n\t\t\tupdateInfoPanel();\n\t\t\tpanel_buffer_fill.setValue(pp.getBufferFillLevel());\n\t\t\tpanel_buffer_fill.repaint();\n\t\t\tif(is_paused)\n\t\t\t{\n\t\t\t\ttry{Thread.sleep(10);}catch(Exception e){}\n\t\t\t}\n\t\t}\n\t}", "public void compNextMove(){\r\n int flatNextMove;\r\n\r\n /* transfer the matrix to an array */\r\n Sign[] flatBoard = flattenBoard();\r\n\r\n /* choose best next move according to difficulty */\r\n flatNextMove = CompPlayer.nextMove(flatBoard,moves,playerSign,difficulty);\r\n\r\n /* set the sign in the correct place in the matrix */\r\n for (int i=0;i<3;i++)\r\n for (int j=0;j<3;j++){\r\n flatNextMove--;\r\n if (flatNextMove == 0)\r\n setSign(i,j,compSign);\r\n }\r\n }", "T nextBlock() throws IOException, NoSuchElementException;", "@Override\n\tpublic void next() {\n\t\t\n\t}", "protected Location nextLocation()\n {\n // Get list of neighboring empty locations.\n ArrayList emptyNbrs = emptyNeighbors();\n\n // Remove the location behind, since fish do not move backwards.\n Direction oppositeDir = direction().reverse();\n Location locationBehind = environment().getNeighbor(location(),\n oppositeDir);\n emptyNbrs.remove(locationBehind);\n Debug.print(\"Possible new locations are: \" + emptyNbrs.toString());\n\n // If there are no valid empty neighboring locations, then we're done.\n if ( emptyNbrs.size() == 0 )\n return location();\n\n // Return a randomly chosen neighboring empty location.\n Random randNumGen = RandNumGenerator.getInstance();\n int randNum = randNumGen.nextInt(emptyNbrs.size());\n\t return (Location) emptyNbrs.get(randNum);\n }", "public void setCellToPath(int pos){//how to check for the end???\n\t\t\n\t\tif(pos<0||pos>width*height-1||getCompletePath())\n\t\t\treturn;// the position entered is not valid or the path has already been completed\n\t\t\n\t\telse if(temp.isEmpty()){//no path tile have been defined\n\t\t\tif(currentPos<0){//start hasn't been placed\t\t\n\t\t\t\tcurrentPos=pos;\n\t\t\t\tcurrentPath=new Path(currentPos);\n\t\t\t\tsetEntryPoint(currentPath);\n\t\t\t\tsetGrid(currentPath.getRow(),currentPath.getCol(),currentPath);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tint d = currentPath.getDirection(pos);\n\t\t\t\tif (d<0||d>=4)\n\t\t\t\t\treturn; //the two tiles are not connected\n\t\t\t\tPathType type =Map.createPathTileOfType(d, caseEdge);\n\t\t\t\tPath p =PathFactory.makePath(type, currentPos);\n\t\t\t\t\n\t\t\t\t//fix direction of tile\n\t\t\t\tif(p.getEntry()==pos)\n\t\t\t\t\tp.rotate();\n\t\t\t\t//validate spot (for entry/exit)\n\t\t\t\t\n\t\t\t\t//set as Path entry point \n\t\t\t\tp.setStart();\n\t\t\t\tsetEntryPoint(p);\n\t\t\t\t\n\t\t\t\t//add to grid and list\n\t\t\t\tp.storePathTile();\n\n\t\t\t\t//update current\n\t\t\t\tcurrentPos=pos;\n\t\t\t\tcurrentPath=new Path(currentPos);\t\t\n\t\t\t\tsetGrid(currentPath.getRow(),currentPath.getCol(),currentPath);\n\t\t\t}\t\t\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\tif (getGrid(pos/width, pos%width)!=null)\n\t\t\t\tif(getGrid(pos/width, pos%width).isPath())\n\t\t\t\t\treturn;//causes intersection\n\t\t\t\n\t\t\tint dExit = currentPath.getDirection(pos);\n\t\t\tint lastPos= temp.peekLast().getPos();\n\t\t\tint dEntry= currentPath.getDirection(lastPos);\n\n\t\t\t\n\t\t\tif (dExit<0||dExit>3||dEntry<0||dEntry>3)\n\t\t\t\treturn; //the two tiles are not connected\n\t\t\t\n\t\t\t\n\t\t\tPathType type =Map.createPathTileOfType(dExit,dEntry);\n\t\t\tPath p =PathFactory.makePath(type, currentPos);\n\t\t\t\n\t\t\t//fix direction of tile\n\t\t\tif(p.getEntry()==pos)\n\t\t\t\tp.rotate();\n\t\t\t\n\t\t\tif(!inValidSpot(p))\n\t\t\t\treturn; //\n\t\t\t\n\t\t\t//add to grid and list\n\t\t\tp.storePathTile();\n\t\t\t\n\t\t\t//update current\n\t\t\tcurrentPos=pos;\n\t\t\tcurrentPath=new Path(currentPos);\t\n\t\t\tsetGrid(currentPath.getRow(),currentPath.getCol(),currentPath);\n\t\t}\n\t}", "private void getNext() {\n Node currNode = getScreenplayElem().getChildNodes().item(currPos++);\n while (currNode.getNodeType() != Node.ELEMENT_NODE) {\n currNode = getScreenplayElem().getChildNodes().item(currPos++);\n }\n currElem = (Element) currNode;\n }", "public abstract void nextElement();", "public void Next();", "@Override\r\n\tpublic void next() {\n\n\t}", "public Position next(Direction direction) {\n return new Position(row + direction.getRow(), column + direction.getColumn());\n }", "private Checkpoint FindNextCheckpoint(Tile start, int[] dir)\n {\n Tile next = null;\n Checkpoint check = null;\n \n // Boolean to decide if next checkpoint is found\n boolean found = false;\n int counter = 1;\n \n while(!found)\n {\n if(start.getType() != grid.GetTile(start.getXPlace() + dir[0] * counter,\n start.getYPlace() + dir[1] * counter).getType())\n {\n // Make turn in the tile prior to the one we just checked. Move counter\n // back 1.\n found = true;\n counter -= 1;\n next = grid.GetTile(start.getXPlace() + dir[0] * counter,\n start.getYPlace() + dir[1] * counter);\n }\n counter++;\n } \n check = new Checkpoint(next, dir[0], dir[1]);\n return check;\n }", "public void goNextLine () throws IOException {\n\t\treader.goNextLine();\n\t\tcurrentLine = reader.getCurrentLine();\n\t}", "public void next() {\n\t\tSystem.out.println(al.get(pos));\r\n\t\tpos++;\r\n\t}", "@Override\n\tpublic void next()\n\t{\n\n\t}", "private void buildPath() {\r\n int xNext = 1;\r\n int yNext = map.getStartPos() + 1;\r\n CellLayered before = cells[yNext][xNext];\r\n while(true)\r\n {\r\n Byte[] xy = map.getDirection(xNext-1, yNext-1);\r\n xNext = xNext + xy[0];\r\n yNext = yNext + xy[1];\r\n\r\n CellLayered next = cells[yNext][xNext];\r\n\r\n if(xy[0]==-1)\r\n before.setRight(false);\r\n else\r\n before.setRight(true);\r\n before.setPath(true);\r\n if(next==null)\r\n break;\r\n\r\n before.setNextInPath(next);\r\n before = next;\r\n }\r\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 }", "public void jumpToNextLine() {\n int currentLineNo = getCurrentLineByCursor();\n if (currentLineNo == textBuffer.getMaxLine()-1) {\n textBuffer.setCurToTail();\n return;\n }\n int curX = round(cursor.getX());\n textBuffer.setCurToTargetNo(currentLineNo+1);\n lineJumpHelper(curX);\n }", "public CommitNode getNext(){\r\n\t\treturn next;\r\n\t}" ]
[ "0.73428774", "0.6548357", "0.61975205", "0.60964876", "0.60467434", "0.60164994", "0.6006241", "0.6003047", "0.5981252", "0.5977175", "0.5945387", "0.59180087", "0.58868366", "0.5857372", "0.58252734", "0.57776654", "0.5757208", "0.5748722", "0.5724937", "0.5714258", "0.5693187", "0.5689482", "0.5680164", "0.56783104", "0.567649", "0.5669833", "0.56674445", "0.5664544", "0.5635242", "0.56076634", "0.55921495", "0.5589986", "0.5589018", "0.55516756", "0.5550503", "0.5542045", "0.55414045", "0.55203235", "0.5519794", "0.5512758", "0.5508208", "0.5504977", "0.5504527", "0.54983497", "0.54983103", "0.549569", "0.54936767", "0.54921246", "0.5488695", "0.5487725", "0.5474475", "0.5470855", "0.5443267", "0.54412663", "0.5438859", "0.5436664", "0.5431609", "0.5425546", "0.5424218", "0.5420374", "0.5416922", "0.54042506", "0.5403013", "0.5402062", "0.54006004", "0.5399594", "0.53977287", "0.53914654", "0.53827703", "0.5373068", "0.53686017", "0.5361204", "0.5353953", "0.53535295", "0.535305", "0.5350914", "0.5348822", "0.5344622", "0.5342728", "0.5335464", "0.53348887", "0.5316078", "0.531586", "0.53158164", "0.53084177", "0.530735", "0.5294223", "0.52932596", "0.5287746", "0.5287503", "0.5284327", "0.52829814", "0.5281935", "0.5279411", "0.52743936", "0.52722436", "0.52625155", "0.52595365", "0.52569455", "0.5253713" ]
0.5853199
14
Calculate pathfinding and the states for visited and blocked of the back, front, left, right respectively.
public abstract boolean[] calculate();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t//loc1 is the start location,loc2 is the destination\n\tpublic ArrayList<MapCoordinate> bfsSearch(MapCoordinate loc1, MapCoordinate loc2, Map m) {\n\t\tSystem.out.println(\"come into bfsSearch\");\n\t\tif(m.isAgentHasAxe() && m.isAgentHasKey()){\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\t//Visited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation()); //add to visited every loop\n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0,s.getLocation()); //add to head\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move east\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){ //this is important else if(cTemp!='~'), not barely else,\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move north\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' &&s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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}\n\t\t\treturn null;\n\t\t}else if(m.isAgentHasAxe()){ //only have axe\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\t//Visited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation()); //add visited every loop\n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0,s.getLocation()); //add to head\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move north\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\treturn null;\n\t\t}else if(m.isAgentHasKey()){ //only have key\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\t//Visited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation());\n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0, s.getLocation()); //add to head,in this fashion, return the right order of route\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY()); \n\t\t\t\tif(m.hasCoordinate(temp)){//state move east\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY()); //state that move west\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1); //state move north\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1); //state move south\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\treturn null;\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t * \n\t\t **/\t\t\n\t\telse{ //have no key and axe\n\t\t\tSystem.out.println(\"come into the last elas clause\");\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\tVisited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\t//int i=0;\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\t//i++;\n\t\t\t\t//System.out.println(\"come into while: \"+i);\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation()); //add visited, let program won't stuck in \n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tSystem.out.println(\"return computed route\");\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0, s.getLocation()); //add to head\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\tfor(MapCoordinate mc:route){\n\t\t\t\t\t\t//System.out.println(\"print returned route in bfssearch\");\n\t\t\t\t\t\tSystem.out.print(\"mc:\"+mc.getX()+\" \"+mc.getY()+\"->\");\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\t//System.out.println(\"1 if\");\n\t\t\t\t\tif(s.getPrevState()!=null &&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if\");\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 if\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 if\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 else\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.add(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tSystem.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1);\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*'&&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1);\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}//do not do any action for not enough stones situation\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}//do not do any action for not enough stones situation\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\treturn null;\n\t\t}\n\t}", "public LinkedList<State> getNextAvailableStates() {\n LinkedList<Integer> currentSide = new LinkedList<>();\n LinkedList<Integer> otherSide = new LinkedList<>();\n LinkedList<State> newStates = new LinkedList<>();\n if(isLeft) {\n if(leftSide != null) currentSide = new LinkedList<>(leftSide);\n if(rightSide != null) otherSide = new LinkedList<>(rightSide);\n } else {\n if (rightSide != null) currentSide = new LinkedList<>(rightSide);\n if (leftSide != null) otherSide = new LinkedList<>(leftSide);\n }\n\n // add one people to the other side of the bridge\n for (int index=0; index< currentSide.size(); index++) {\n LinkedList<Integer> newCurrentSide = new LinkedList<>(currentSide);\n LinkedList<Integer> newOtherSide = new LinkedList<>(otherSide);\n int firstPeopleMoved = newCurrentSide.remove(index);\n newOtherSide.add(firstPeopleMoved);\n State state = (isLeft) ? new State(newCurrentSide, newOtherSide, !isLeft,timeTaken+firstPeopleMoved, depth+1, highestSpeed) :\n new State(newOtherSide, newCurrentSide, !isLeft, timeTaken+firstPeopleMoved, depth+1, highestSpeed);\n state.setReward(state.calculateReward(firstPeopleMoved));\n // add this as parent to the child\n state.parents = new LinkedList<>(this.parents);\n state.addParent(this);\n // set the action that get to this state\n String currentAction = \"move \" + firstPeopleMoved;\n currentAction += (isLeft) ? \" across\" : \" back\";\n state.copyActions(this); // copy all the previous actions from the parent\n state.addActions(currentAction); // add new action to state generated by parent\n // add to the new states of list\n newStates.add(state);\n // add two people to the other side of the bridge\n for (int second=0; second < newCurrentSide.size(); second++) {\n LinkedList<Integer> newSecondCurrentSide = new LinkedList<>(newCurrentSide);\n LinkedList<Integer> newSecondOtherSide = new LinkedList<>(newOtherSide);\n int secondPeopleMoved = newSecondCurrentSide.remove(second);\n newSecondOtherSide.add(secondPeopleMoved);\n int slowerSpeed = (firstPeopleMoved > secondPeopleMoved) ? firstPeopleMoved : secondPeopleMoved;\n state = (isLeft) ? new State(newSecondCurrentSide, newSecondOtherSide, !isLeft, timeTaken+slowerSpeed, depth+1, highestSpeed) :\n new State(newSecondOtherSide, newSecondCurrentSide, !isLeft, timeTaken+slowerSpeed, depth+1, highestSpeed);\n state.setReward(state.calculateReward(firstPeopleMoved, secondPeopleMoved));\n // add this as parent to the child\n state.parents = new LinkedList<>(this.parents);\n state.addParent(this);\n // set the action that get to this state\n currentAction = \"move \"+ firstPeopleMoved + \" \" + secondPeopleMoved;\n currentAction += (isLeft) ? \" across\" : \" back\";\n state.copyActions(this);\n state.addActions(currentAction);\n // add to the new states of list\n newStates.add(state);\n }\n\n }\n return newStates;\n }", "public int[] shortestAlternatingPaths(int n, int[][] red_edges, int[][] blue_edges) {\n int[] result = new int[n];\n if (n == 1) {\n result[0] = 0;\n return result;\n }\n Arrays.fill(result, -1); // initialize result array\n // build graph for future access\n boolean[][] redEdgesMatrix = new boolean[n][n];\n for (int i = 0; i < red_edges.length; i++) {\n redEdgesMatrix[red_edges[i][0]][red_edges[i][1]] = true;\n }\n boolean[][] blueEdgesMatrix = new boolean[n][n];\n for (int i = 0; i < blue_edges.length; i++) {\n blueEdgesMatrix[blue_edges[i][0]][blue_edges[i][1]] = true;\n }\n // run bfs\n Deque<Node> queue = new LinkedList<>();\n // enqueue entry point (the node 0 is special, it supports both R and B)\n queue.offer(new Node(0, \"RB\"));\n // set initial result\n result[0] = 0;\n // initialize level\n int level = 1;\n while(!queue.isEmpty()) {\n int nodeAtCurrentLevel = queue.size();\n for (int i = 0; i < nodeAtCurrentLevel; i++) {\n Node node = queue.poll();\n // visit node\n int from = node.value;\n String currentColor = node.color;\n for (int to = 0; to < n; to++) { // all entry points need to enqueue, including itself or some nodes that are already visited\n if ((currentColor.equals(\"R\") || currentColor.equals(\"RB\")) && blueEdgesMatrix[from][to]) {\n // update matrix\n blueEdgesMatrix[from][to] = false;\n // set result\n if (result[to] == -1) {\n result[to] = level;\n } else {\n result[to] = Math.min(result[to], level); \n }\n // enqueue\n queue.offer(new Node(to, \"B\"));\n }\n if ((currentColor.equals(\"B\") || currentColor.equals(\"RB\")) && redEdgesMatrix[from][to]) {\n // update matrix\n redEdgesMatrix[from][to] = false;\n // set result\n if (result[to] == -1) {\n result[to] = level;\n } else {\n result[to] = Math.min(result[to], level); \n }\n // enqueue\n queue.offer(new Node(to, \"R\"));\n }\n }\n }\n level++;\n }\n return result;\n }", "void driveTracker()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tlong time = System.currentTimeMillis();\r\n\t\t\tint last_direction = 0;\r\n\t\t\twhile(System.currentTimeMillis()-time < 20000 && status.equals(\"wait\"))\r\n\t\t\t{\r\n\t\t\t\tint direction = -1;\r\n\t\t\t\tint flow_min = Main.MAX_INT;\r\n\t\t\t\tif((loc.i-1)>=0 && BFS.adj_const[(loc.i-1)*80+loc.j][loc.i*80+loc.j]==1 && Flow.flows[loc.i-1][loc.j][1] < flow_min)\r\n\t\t\t\t{\r\n\t\t\t\t\tdirection = 0;//up\r\n\t\t\t\t\tflow_min = Flow.flows[loc.i-1][loc.j][1];\r\n\t\t\t\t}\r\n\t\t\t\tif((loc.i+1)<80 && BFS.adj_const[(loc.i+1)*80+loc.j][loc.i*80+loc.j]==1 && Flow.flows[loc.i][loc.j][1] < flow_min)\r\n\t\t\t\t{\t\r\n\t\t\t\t\tdirection = 1;//down\r\n\t\t\t\t\tflow_min = Flow.flows[loc.i][loc.j][1];\r\n\t\t\t\t}\r\n\t\t\t\tif((loc.j-1)>=0 && BFS.adj_const[loc.i*80+loc.j][loc.i*80+loc.j-1]==1 && Flow.flows[loc.i][loc.j-1][0] < flow_min)\r\n\t\t\t\t{\t\r\n\t\t\t\t\tdirection = 2;//left\r\n\t\t\t\t\tflow_min = Flow.flows[loc.i][loc.j-1][0];\r\n\t\t\t\t}\r\n\t\t\t\tif((loc.j+1)<80 && BFS.adj_const[loc.i*80+loc.j][loc.i*80+loc.j+1]==1 && Flow.flows[loc.i][loc.j][0] < flow_min)\r\n\t\t\t\t{\r\n\t\t\t\t\tdirection = 3;//right\r\n\t\t\t\t\tflow_min = Flow.flows[loc.i][loc.j][0];\r\n\t\t\t\t}\r\n\t\t\t\tLight light = Traffic.findLight(loc.i,loc.j);\r\n\t\t\t\tif(light!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\twhile(!leaveLight(light,last_direction,direction))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmeet_light = true;\r\n\t\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmeet_light = false;\r\n\t\t\t\t}\r\n\t\t\t\tswitch(direction)\r\n\t\t\t\t{\r\n\t\t\t\tcase 0 ://up\r\n\t\t\t\t\tif(BFS.adj_matrix[(loc.i-1)*80+loc.j][loc.i*80+loc.j] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[loc.i-1][loc.j][1]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tloc.i -= 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1 ://down\r\n\t\t\t\t\tif(BFS.adj_matrix[(loc.i+1)*80+loc.j][loc.i*80+loc.j] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[loc.i][loc.j][1]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tloc.i += 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2 ://left\r\n\t\t\t\t\tif(BFS.adj_matrix[loc.i*80+loc.j][loc.i*80+loc.j-1] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[loc.i][loc.j-1][0]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tloc.j -= 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3 ://right\r\n\t\t\t\t\tif(BFS.adj_matrix[loc.i*80+loc.j][loc.i*80+loc.j+1] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[loc.i][loc.j][0]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tloc.j += 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tThread.sleep(100);\r\n\t\t\t\tlast_direction = direction;\r\n\t\t\t}\r\n\t\t\tif(status.equals(\"wait\"))\r\n\t\t\t{\r\n\t\t\t\tstatus = \"stop\";\r\n\t\t\t\tThread.sleep(1000);//stop\r\n\t\t\t\tstatus = \"wait\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttransStatus();\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(\"Sorry to catch Exception!\");\r\n\t\t}\r\n\t}", "private void checkPaths(){\r\n\t\tif(noBeepersPresent()){\r\n\t\t\tif(leftIsClear()){\r\n\t\t\t\tif(frontIsBlocked()&&rightIsBlocked()&&cornerColorIs(RED)){\r\n\t\t\t\t\tturnLeft(); \r\n\t\t\t\t\tmakeMove();\r\n\t\t\t\t\tpaintCorner(RED);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tturnLeft(); \r\n\t\t\t\t\tcheckColors();\r\n\t\t\t\t}\r\n\t\t\t\tfollowPath();\r\n\t\t\t}\r\n\t\t\tif(frontIsClear()){\r\n\t\t\t\tcheckColors();\r\n\t\t\t\tfollowPath();\r\n\t\t\t}\r\n\t\t\tif(rightIsClear()){\r\n\t\t\t\tif(frontIsBlocked()&&leftIsBlocked()&&cornerColorIs(RED)){\r\n\t\t\t\t\tturnRight();\r\n\t\t\t\t\tmakeMove();\r\n\t\t\t\t\tpaintCorner(RED);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tturnRight();\r\n\t\t\t\t\tcheckColors();\r\n\t\t\t\t}\r\n\t\t\t\tfollowPath();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static int runBFS(int[][]map, coordinate src1, coordinate src2){\n\t \n boolean visited[][] = new boolean[dim][dim]; //visited boolean 2d array that is the same size as 2d map\n coordinate visit1[][]=new coordinate[dim][dim]; // this is the one used to hold previous location\n coordinate visit2[][]=new coordinate[dim][dim]; // this is the one used to hold previous location\n\t \n\t visit1[0][0]=new coordinate(0,0); //same as BFS\n \n\t visit2[dim-1][dim-1] = new coordinate(dim-1,dim-1);\n\t //marked both the 0,0 and dim-1, dim-1 srcs as visited\n\t \n\t Queue<QueueNode> queue1 = new LinkedList<>(); //queue for src1\n\t Queue<QueueNode> queue2 = new LinkedList<>(); //queue for src2\n\t \n\t QueueNode sn1 = new QueueNode(src1, 0, src1); //src node 1 queue node\n\t QueueNode sn2 = new QueueNode(src2, 0, src2);\n\t \n\t ArrayList<coordinate> pathHold1 = new ArrayList<>(); //for first path\n\t ArrayList<coordinate> pathHold2 = new ArrayList<>(); //for second path \n\t \n\t visited[src1.x][src1.y] = true; //mark the start node as visited inside of the visited boolean 2d array for first src\n\t visited[src2.x][src2.y] = true; //mark the start node as visited inside of the visited boolean 2d array for second src\n\t \n\t System.out.println();\n\t \n\t queue1.add(sn1);\n\t queue2.add(sn2);\n\t //added the start nodes\n\t \n\t QueueNode current1 = null;\n\t QueueNode current2 = null;\n\t //to be used later to hold current node being looked at\n\t coordinate c1 = null;\n\t coordinate c2 = null;\n\t\t//coordinates to be examined\n\t \n\t while(!queue1.isEmpty()&&!queue2.isEmpty()){\n\t //keep iterating so long as queues have items -- but if one becomes empty, check at each iteration\n\t\t\t//to avoid null pointer so we are not dequeuing from empty queue\n int maxFringe = 0;\n\t\t//use this to check max fringe at each time we add to either queue\n if(queue1.size()>maxFringe || queue2.size()>0) {\n \t if(queue1.size()>maxFringe) {\n \t\t maxFringe=queue1.size();\n \t }else {\n \t\t maxFringe=queue2.size();\n \t }\n }\n\t \n\t \tif(!queue1.isEmpty()) { \n\t\t\t\t//while first queue is not empty, pop\n\t \t\t current1 = queue1.peek(); // this is n\n\t c1 = current1.point;\n\t \t\t visited[c1.x][c1.y]=true; //mark this node as visited, will check neighbors later\n\t boolean inFringe = false;\n\t inFringe = compareFringe(c1, queue2); //see if intersect or not\n\t \n\t \n\t // compare current point to the queue2 fringe. If not in fringe\n\t if(inFringe) {\n\t \t //we have found the duplicate \n\t \t System.out.println(\"duplicate\");\n\t \t intersect = c1;\n\t\t System.out.println(\"Intersect is :\"+c1.x+\",\"+c1.y);\n\t\t visit1[c1.x][c1.y]=current1.prev; //set prev node or where we came from\n\t\t \n\t\t System.out.println(\"We have reached our goal!\");\n\t\t \n\t\t if(current2 != null) {\n\t\t\t\t\t //so long as paths have values, add length and return\n\t\t return current1.pathTotal+current2.pathTotal;\n\t\t }else {\n\t\t\t\t\t //else return only one path \n\t\t \t return current1.pathTotal;\n\t\t }\n\t }\n\t\t\t\t//this is getting the neighbors, same as BFS\n\t \n\t int row1 = 0;\n\t int col1 = 0;\n\t \n\t for (int i = 0; i < 4; i++) { \n\t row1= c1.x + rowNum1[i]; \n\t col1 = c1.y + colNum1[i]; \n\t //grab neighbor of current\n\t if (cellValid(row1, col1) && map[row1][col1] == 1 && !visited[row1][col1]){ \n\t \t \n\t // mark cell as visited and enqueue it \n\t visited[row1][col1] = true; //we visited the node so mark it\n\t visit1[row1][col1] = new coordinate(c1.x, c1.y); //set prev as current coord\n\n\t QueueNode Adjcell = new QueueNode(new coordinate(row1, col1), current1.pathTotal + 1, new coordinate(row1-rowNum1[i], col1-colNum1[i])); \n\t queue1.add(Adjcell); //make it a queueNode to add to q1 for first path\n\t }else if(cellValid(row1, col1) && map[row1][col1] == 1 && (visited[row1][col1]&&visit2[row1][col1]!=null)){\n\t \t // System.out.println(\"already visited\"+row1+\",\"+col1); \n\t\t\t\t //check if already visited and valid (not off grid) and = 1 so we can take path -- \n\t\t\t\t //if so, this means we found intersect\n\t\t\t\t //make sure node has been visited in other path to guarantee it is intersect\n\t \t intersect=new coordinate(row1,col1); //set intersect\n\t \t visit1[intersect.x][intersect.y]=new coordinate(c1.x, c1.y); //set where we came from\n\t \t //current1.pathTotal++;\n\t \t printfin(visit1, visit2); //used to print final path -- set map\n \n int nodesExplored1 = 0;\n int nodesExplored2 = 0;\n for(coordinate coor : pathHold1){\n nodesExplored1++;\n }\n for(coordinate coor : pathHold2){\n nodesExplored2++;\n }\n\t\t\t\t \n\t\t\t\t //get number of nodes expanded in each path, add together\n\n int fin = nodesExplored1+nodesExplored2; //this is final explored nodes in each path\n System.out.println(\"Nodes explored: \" + fin);\n \n\t \t return pathsize; //return total pathsize\n\t \t //break;\n\t }\n\t \n\t \n\t } \n\t //once all of the neighbors have been visited, dequeue from queue 1 in path 1\n\t queue1.remove(); \n\t pathHold1.add(c1); //add to explored\n\t \n\t }\n\t \t//now to the same in path2 from (dim-1, dim-1) as src2\n\t \tif(!queue2.isEmpty()) {\n\t \t\t\n\t \t\t current2 = queue2.peek(); // this is n\n\t c2 = current2.point;\n\t \t\t visited[c2.x][c2.y]=true;\n\t boolean inFringe = false;\n\t inFringe = compareFringe(c2, queue1);\n\t \n\t // compare current point to the queue2 fringe. If not in fringe\n\t if(inFringe) {\n\t \t //we have found the duplicate \n\t \t System.out.println(\"duplicate\");\n\t \t intersect = c2;\n\t\t // System.out.println(\"Intersect is :\"+c2.x+\",\"+c2.y);\n\t\t visit2[c2.x][c2.y]=current2.prev;\n\t\t \n\t\t System.out.println(\"We have reached our goal!\");\n\t\t \n\t\t \n\t\t if(current1 != null) {\n\t\t\t return current1.pathTotal+current2.pathTotal;\n\t\t\t }else {\n\t\t\t \t return current2.pathTotal;\n\t\t\t }\n\t }\n\t \n\t \t// get neighbors\n\t int row2 = 0;\n\t int col2 = 0;\n\t \n\t for (int i = 0; i < 4; i++) { \n\t row2= c2.x + rowNum2[i]; \n\t col2 = c2.y + colNum2[i]; \n\t \n\t \n\t if (cellValid(row2, col2) && map[row2][col2] == 1 && !visited[row2][col2]){ \n\t \t \n\t // mark cell as visited and enqueue it \n\t visited[row2][col2] = true; \n\t visit2[row2][col2] = new coordinate(c2.x, c2.y);\n\n\t QueueNode Adjcell2 = new QueueNode(new coordinate(row2, col2), current2.pathTotal + 1, new coordinate(row2-rowNum2[i], col2-colNum2[i])); \n\t queue2.add(Adjcell2);\n\t }else if(cellValid(row2, col2) && map[row2][col2] == 1 && (visited[row2][col2]&&visit1[row2][col2]!=null)){\n\t \t \n\t \t intersect=new coordinate(row2,col2);\n\t \t \n\t \t visit2[intersect.x][intersect.y]=new coordinate(c2.x, c2.y);\n\t \n\t \n\t printfin(visit1, visit2);\n\t int nodesExplored1 = 0;\n int nodesExplored2 = 0;\n for(coordinate coor : pathHold1){\n nodesExplored1++;\n }\n for(coordinate coor : pathHold2){\n nodesExplored2++;\n }\n\n int fin = nodesExplored1+nodesExplored2;\n System.out.println(\"Nodes explored: \" + fin);\n\t \t return pathsize;\n\t \t \n\t }\n\t \n\t } \n\t //once all of the neighbors have been visited, dequeue \n\t queue2.remove(); \n\t pathHold2.add(c2);\n\t \t\t\n\t \t}\n\n\t }\n \n int nodesExplored1 = 0;\n int nodesExplored2 = 0;\n for(coordinate coor : pathHold1){\n nodesExplored1++;\n }\n for(coordinate coor : pathHold2){\n nodesExplored2++;\n }\n\n int fin = nodesExplored1+nodesExplored2;\n System.out.println(\"Nodes explored: \" + fin);\n\t //if here, means no path was found\n\t return -1;\n\t \n\t }", "private void computePath(){\n LinkedStack<T> reversePath = new LinkedStack<T>();\n // adding end vertex to reversePath\n T current = end; // first node is the end one\n while (!current.equals(start)){\n reversePath.push(current); // adding current to path\n current = closestPredecessor[vertexIndex(current)]; // changing to closest predecessor to current\n }\n reversePath.push(current); // adding the start vertex\n \n while (!reversePath.isEmpty()){\n path.enqueue(reversePath.pop());\n }\n }", "private final void computeAllEdgeLevelsFast() {\n int[] currentLevelEdgeNodes = new int[nEdges*2];\n int[] currentLevelEdgeIndexes = new int[nEdges*2];\n int currEdge = 0;\n int nextLevelEnd = 0;\n\n /**\n * \\ neighbours are behind the current edge.\n * '. \\\n * '. \\ nNeighbours[vi][ei] = 2\n * '.\\\n * O-----------> [next]\n * vi ei\n */\n\n\n int[][] nNeighbours = new int[nNodes][];\n for (int vi=0; vi<nNodes; ++vi) {\n int currX = xPositions[vi];\n int currY = yPositions[vi];\n\n int nOutgoingEdges = nOutgoingEdgess[vi];\n int[] outgoingEdges = outgoingEdgess[vi];\n \n int[] currNodeNNeighbours = new int[nOutgoingEdges];\n for (int ei=0; ei<nOutgoingEdges; ++ei) {\n // For each directed edge\n int ni = outgoingEdges[ei];\n int nextX = xPositions[ni];\n int nextY = yPositions[ni];\n\n // Count taut outgoing edges\n int count = 0;\n\n int nNextOutgoingEdges = nOutgoingEdgess[vi];\n int[] nextOutgoingEdges = outgoingEdgess[vi];\n for (int j=0; j<nNextOutgoingEdges; ++j) {\n int di = nextOutgoingEdges[j];\n if (graph.isTaut(nextX, nextY, currX, currY, xPositions[di], yPositions[di])) {\n ++count;\n }\n }\n\n currNodeNNeighbours[ei] = count;\n if (count == 0) {\n currentLevelEdgeNodes[nextLevelEnd] = vi;\n currentLevelEdgeIndexes[nextLevelEnd] = ei;\n ++nextLevelEnd;\n }\n }\n nNeighbours[vi] = currNodeNNeighbours;\n }\n\n \n int currLevel = 1;\n while (currEdge < nextLevelEnd && currLevel < levelLimit) {\n\n int currentLevelEnd = nextLevelEnd;\n for (; currEdge < currentLevelEnd; ++currEdge) {\n int currNode = currentLevelEdgeNodes[currEdge];\n int currEdgeIndex = currentLevelEdgeIndexes[currEdge];\n\n if (edgeLevels[outgoingEdgeIndexess[currNode][currEdgeIndex]] != LEVEL_W) continue;\n // Set edge level\n edgeLevels[outgoingEdgeIndexess[currNode][currEdgeIndex]] = currLevel;\n\n /**\n * Curr side must have no neighbours.\n * Opp side (next node) may have neighbours.\n * So remove neighbours from opposite side.\n * __\n * /| __\n * / .-'|\n * (no neighbours) / .-'\n * /.-'\n * O-----------> [n]\n * vi ei\n */\n // No need to remove neighbours from opposite edge. They are ignored automatically.\n\n\n int nextNode = outgoingEdgess[currNode][currEdgeIndex];\n\n int currX = xPositions[currNode];\n int currY = yPositions[currNode];\n int nextX = xPositions[nextNode];\n int nextY = yPositions[nextNode];\n\n int[] outgoingEdges = outgoingEdgess[nextNode];\n int nOutgoingEdges = nOutgoingEdgess[nextNode];\n\n int[] outgoingEdgeIndexes = outgoingEdgeIndexess[nextNode];\n\n int[] nextNodeNNeighbours = nNeighbours[nextNode];\n for (int j=0; j<nOutgoingEdges; ++j) {\n if (edgeLevels[outgoingEdgeIndexes[j]] != LEVEL_W) continue;\n int nextnextNode = outgoingEdges[j];\n int nextnextX = xPositions[nextnextNode];\n int nextnextY = yPositions[nextnextNode];\n if (!graph.isTaut(currX, currY, nextX, nextY, nextnextX, nextnextY)) continue;\n\n --nextNodeNNeighbours[j];\n if (nextNodeNNeighbours[j] == 0) {\n // push into next level's list.\n currentLevelEdgeNodes[nextLevelEnd] = nextNode;\n currentLevelEdgeIndexes[nextLevelEnd] = j;\n ++nextLevelEnd;\n }\n\n if (nextNodeNNeighbours[j] < 0) System.out.println(\"ERROR\");\n }\n }\n\n ++currLevel;\n }\n }", "public void dfs() {\n int currentVertexIndex = 0;\r\n dfsStack.push(0);\r\n vertexList[0].wasVisited = true;\r\n System.out.println(vertexList[dfsStack.peek()]);\r\n while (dfsStack.top != -1) {\r\n\r\n\r\n currentVertexIndex = this.getAdjUnvisitedVert(dfsStack.peek());\r\n if (currentVertexIndex != -1) {\r\n dfsStack.push(currentVertexIndex);\r\n vertexList[currentVertexIndex].wasVisited = true;\r\n System.out.println(vertexList[dfsStack.peek()]);\r\n\r\n\r\n } else {\r\n currentVertexIndex = dfsStack.pop();\r\n\r\n }\r\n }\r\n// reset wasVisted\r\n for (Vertex x : vertexList) {\r\n x.wasVisited = false;\r\n }\r\n }", "public static int bfs() {\r\n check = new int[N][N]; // check 변수 초기화\r\n q = new LinkedList<Point>();\t\t\t\t\t//bfs 할때 필요한 그 stack. first in first out\r\n q.offer(new Point(shark.x, shark.y));\t\t\t//q.offer == 해당 큐의 맨 뒤에 전달된 요소를 삽입함. list에서 list.add와 같은 말임.\r\n check[shark.x][shark.y] = 1;\r\n\r\n int FishCheck = 0;\t\t\t\t\t\t\t\t//the number of the fish in the sea map\r\n Shark fish = new Shark(N, N);\t\t\t\t\t//new shark initiation\r\n loop: while (!q.isEmpty()) {\r\n int r = q.peek().x;\t\t\t\t\t\t\t//q.peek == 해당 큐의 맨 앞에 있는(제일 먼저 저장된) 요소를 반환함\r\n int c = q.poll().y;\t\t\t\t\t\t\t//q.poll == 해당 큐의 맨 앞에 있는(제일 먼저 저장된) 요소를 반환하고, 해당 요소를 큐에서 제거함. 만약 큐가 비어있으면 null을 반환함.\r\n\r\n for (int d = 0; d < dr.length; d++) {\r\n int nr = r + dr[d];\t\t\t\t\t\t//북(0),남(1),동(2),서(3) 순으로. nr == new row\r\n int nc = c + dc[d];\t\t\t\t\t\t//북(0),남(1),동(2),서(3) 순으로. nc == new column\r\n\r\n // 지나갈 수 있는 곳: 자신보다 큰 물고기가 없는 곳\r\n if (isIn(nr, nc) && check[nr][nc] == 0 && sea[nr][nc] <= shark.lv) {\r\n check[nr][nc] = check[r][c] + 1;\r\n q.offer(new Point(nr, nc));\r\n\r\n // 위치가 더 커질 경우, 더이상 확인할 필요 X\r\n if (FishCheck != 0 && FishCheck < check[nr][nc]) {\r\n break loop;\r\n }\r\n \r\n // 처음 먹을 수 있는 자기보다 물고기가 발견 되었을 때\r\n if (0 < sea[nr][nc] && sea[nr][nc] < shark.lv && FishCheck == 0) {\r\n FishCheck = check[nr][nc];\r\n fish.x = nr;\r\n fish.y = nc;\r\n fish.lv = sea[nr][nc];\r\n }\r\n // 같은 위치에 여러 마리 있을 경우, 가장 위의 가장 왼쪽 물고기부터 먹음\r\n else if (FishCheck == check[nr][nc] && 0 < sea[nr][nc] && sea[nr][nc] < shark.lv) {\r\n if (nr < fish.x) { // 가장 위에 있는 거 우선권\r\n fish.x = nr;\r\n fish.y = nc;\r\n fish.lv = sea[nr][nc];\r\n } else if (nr == fish.x && nc < fish.y) { // 다 가장 위일 경우, 가장 왼쪽 우선권\r\n fish.x = nr;\r\n fish.y = nc;\r\n fish.lv = sea[nr][nc];\r\n }\r\n\r\n }\r\n\r\n }else if(isIn(nr, nc) && check[nr][nc] == 0) {\r\n check[nr][nc] = -1;\r\n }\r\n }\r\n }\r\n // idx 초과 안날 경우\r\n if (fish.x != N && fish.y != N) {\r\n eatFish(fish);\r\n }\r\n \r\n return (FishCheck - 1);\r\n }", "static void bridge()\n {\n // Mark all the vertices as not visited\n boolean visited[] = new boolean[V];\n int disc[] = new int[V];\n int low[] = new int[V];\n int parent[] = new int[V];\n \n \n // Initialize parent and visited, and ap(articulation point)\n // arrays\n for (int i = 0; i < V; i++)\n {\n parent[i] = NIL;\n }\n \n // Call the recursive helper function to find Bridges\n // in DFS tree rooted with vertex 'i'\n for (int i = 0; i < V; i++)\n if (!visited[i])\n bridgeUtil(i, visited, disc, low, parent);\n }", "public static Vector<int []> BFS(int[] startPosition,int[] unexploreNode, mapNode[][] nodes){\n\t\t\r\n\t\tVector<int []> shortestPath;\r\n\t\t\r\n\t\t//initial all nodes' status to UN-visited\r\n\t\tfor(int i = 0; i < nodes.length; i++)\r\n\t\t{\r\n\t\t\tfor(int j = 0; j < nodes[i].length;j++)\r\n\t\t\t{\r\n\t\t\t\tnodes[i][j].setTotDistance(999999999);//set the initial distance to INF\r\n\t\t\t\tnodes[i][j].gridPosition[0] = i;//save current node x position\r\n\t\t\t\tnodes[i][j].gridPosition[1] = j;//save current node y position\r\n\t\t\t\tnodes[i][j].setNodeVistied(false);//set all nodes are not visited yet\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//create start node and add it into the execution queue\r\n\t\tmapNode tempNode = new mapNode();\r\n\t\ttempNode = nodes[startPosition[0]][startPosition[1]];\r\n\t\tVector<mapNode> tempQueue = new Vector<mapNode>();\r\n\t\ttempQueue.add(tempNode);\r\n\t\t//main loop: check all nodes on the map\r\n\t\twhile(tempQueue.size() != 0)\r\n\t\t{\r\n\t\t\t//create four nearby nodes\r\n\t\t\tmapNode tempTopNode = new mapNode();\r\n\t\t\tmapNode tempBottomNode = new mapNode();\r\n\t\t\tmapNode tempLeftNode = new mapNode();\r\n\t\t\tmapNode tempRightNode = new mapNode();\r\n\t\t\t\t\r\n\t\t\t//update Top node information from original nodes matrix\r\n\t\t\tif(tempQueue.get(0).topNode != null)\r\n\t\t\t{\r\n\t\t\t\ttempTopNode = nodes[tempQueue.get(0).topNode.gridPosition[0]][tempQueue.get(0).topNode.gridPosition[1]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttempTopNode = null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//update Bottom node information from original nodes matrix\r\n\t\t\tif(tempQueue.get(0).bottomNode != null)\r\n\t\t\t{\r\n\t\t\t\ttempBottomNode = nodes[tempQueue.get(0).bottomNode.gridPosition[0]][tempQueue.get(0).bottomNode.gridPosition[1]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttempBottomNode = null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//update Left node information from original nodes matrix\r\n\t\t\tif(tempQueue.get(0).leftNode != null)\r\n\t\t\t{\r\n\t\t\t\ttempLeftNode = nodes[tempQueue.get(0).leftNode.gridPosition[0]][tempQueue.get(0).leftNode.gridPosition[1]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttempLeftNode = null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//update Right node information from original nodes matrix\r\n\t\t\tif(tempQueue.get(0).rightNode != null)\r\n\t\t\t{\r\n\t\t\t\ttempRightNode = nodes[tempQueue.get(0).rightNode.gridPosition[0]][tempQueue.get(0).rightNode.gridPosition[1]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttempRightNode = null;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t//start re-calculate distance of each node\r\n\t\t\t//check the top node and update new distance\r\n\t\t\tif(tempTopNode != null)\r\n\t\t\t{\r\n\t\t\t\tif(tempTopNode.getNodeVisited() == false && tempTopNode.getOwnElevation() != 999999999 && tempTopNode.getStatus() != Status.EXPLORED )\r\n\t\t\t\t{\r\n\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t//record the path\r\n\t\t\t\t\tfor(int m = 0; m < tempQueue.get(0).getTotPath().size(); m++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\ttempXY = tempQueue.get(0).getTotPath().get(m);\r\n\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//check new node to see if exists in path\r\n\t\t\t\t\tif(checkPositionInPath(tempPath, tempQueue.get(0).gridPosition[0], tempQueue.get(0).gridPosition[1]) == false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\ttempXY2 = tempQueue.get(0).gridPosition;\r\n\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\ttempTopNode.setTotPath(tempPath);\r\n\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\ttempTopNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\tnodes[tempTopNode.gridPosition[0]][tempTopNode.gridPosition[1]] = tempTopNode;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(tempTopNode.gridPosition[0] == unexploreNode[0] && tempTopNode.gridPosition[1] == unexploreNode[1]){\r\n\t\t\t\t\t//print out the end node\r\n\t\t\t\t\t//print out the total distance between two points\r\n\t\t\t\t\t//print out the total number node of path\r\n\t\t\t\t\t//System.out.println(\"End Point: \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[0]+1)+\" \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[1]+1));\r\n\t\t\t\t\t//System.out.println(\"Total Distance: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotDistance());\r\n\t\t\t\t\t//System.out.println(\"Total number of nodes: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotPath().size());\r\n\t\t\t\t\tshortestPath = nodes[unexploreNode[0]][unexploreNode[1]].getTotPath();\r\n\t\t\t\t\tshortestPath.add(unexploreNode);\r\n\t\t\t\t\treturn shortestPath;\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(nodes[tempTopNode.gridPosition[0]][tempTopNode.gridPosition[1]].getNodeVisited()== false && checkNodeInQueue(tempQueue, tempTopNode.gridPosition[0], tempTopNode.gridPosition[1]) == false && tempTopNode.getOwnElevation() != 999999999)\r\n\t\t\t\t{\r\n\t\t\t\t\t//check un-visited nodes and add new node into execution queue\r\n\t\t\t\t\ttempQueue.add(tempTopNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//check the bottom node and update new distance\r\n\t\t\tif(tempBottomNode != null)\r\n\t\t\t{\r\n\t\t\t\tif(tempBottomNode.getNodeVisited() == false && tempBottomNode.getOwnElevation() != 999999999 && tempBottomNode.getStatus() != Status.EXPLORED)\r\n\t\t\t\t{\r\n\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t//record the path\r\n\t\t\t\t\tfor(int m = 0; m < tempQueue.get(0).getTotPath().size(); m++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\ttempXY = tempQueue.get(0).getTotPath().get(m);\r\n\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//check new node to see if it exists in path\r\n\t\t\t\t\tif(checkPositionInPath(tempPath, tempQueue.get(0).gridPosition[0], tempQueue.get(0).gridPosition[1]) == false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\ttempXY2 = tempQueue.get(0).gridPosition;\r\n\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\ttempBottomNode.setTotPath(tempPath);\r\n\t\t\t\t\ttempBottomNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\tnodes[tempQueue.get(0).bottomNode.gridPosition[0]][tempQueue.get(0).bottomNode.gridPosition[1]] = tempBottomNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(tempBottomNode.gridPosition[0] == unexploreNode[0] && tempBottomNode.gridPosition[1] == unexploreNode[1]){\r\n\t\t\t\t\t//System.out.println(\"End Point: \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[0]+1)+\" \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[1]+1));\r\n\t\t\t\t\t//System.out.println(\"Total Distance: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotDistance());\r\n\t\t\t\t\t//System.out.println(\"Total number of nodes: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotPath().size());\r\n\t\t\t\t\tshortestPath = nodes[unexploreNode[0]][unexploreNode[1]].getTotPath();\r\n\t\t\t\t\tshortestPath.add(unexploreNode);\r\n\t\t\t\t\treturn shortestPath;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(nodes[tempBottomNode.gridPosition[0]][tempBottomNode.gridPosition[1]].getNodeVisited()== false && checkNodeInQueue(tempQueue, tempBottomNode.gridPosition[0], tempBottomNode.gridPosition[1]) == false && tempBottomNode.getOwnElevation() != 999999999)\r\n\t\t\t\t{\r\n\t\t\t\t\t//check un-visited nodes and add new node into execution queue\r\n\t\t\t\t\ttempQueue.add(tempBottomNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//check the left node and update new distance\r\n\t\t\tif(tempLeftNode != null)\r\n\t\t\t{\r\n\t\t\t\tif(tempLeftNode.getNodeVisited() == false && tempLeftNode.getOwnElevation() != 999999999 && tempLeftNode.getStatus() != Status.EXPLORED)\r\n\t\t\t\t{\r\n\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t//record the path\r\n\t\t\t\t\tfor(int m = 0; m < tempQueue.get(0).getTotPath().size(); m++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\ttempXY = tempQueue.get(0).getTotPath().get(m);\r\n\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//check new node to see if it exists in path\r\n\t\t\t\t\tif(checkPositionInPath(tempPath, tempQueue.get(0).gridPosition[0], tempQueue.get(0).gridPosition[1]) == false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\ttempXY2 = tempQueue.get(0).gridPosition;\r\n\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\ttempLeftNode.setTotPath(tempPath);\r\n\t\t\t\t\ttempLeftNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\tnodes[tempQueue.get(0).leftNode.gridPosition[0]][tempQueue.get(0).leftNode.gridPosition[1]] = tempLeftNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(tempLeftNode.gridPosition[0] == unexploreNode[0] && tempLeftNode.gridPosition[1] == unexploreNode[1]){\r\n\t\t\t\t\t//System.out.println(\"End Point: \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[0]+1)+\" \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[1]+1));\r\n\t\t\t\t\t//System.out.println(\"Total Distance: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotDistance());\r\n\t\t\t\t\t//System.out.println(\"Total number of nodes: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotPath().size());\r\n\t\t\t\t\tshortestPath = nodes[unexploreNode[0]][unexploreNode[1]].getTotPath();\r\n\t\t\t\t\tshortestPath.add(unexploreNode);\r\n\t\t\t\t\treturn shortestPath;\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(nodes[tempLeftNode.gridPosition[0]][tempLeftNode.gridPosition[1]].getNodeVisited()== false && checkNodeInQueue(tempQueue, tempLeftNode.gridPosition[0], tempLeftNode.gridPosition[1]) == false && tempLeftNode.getOwnElevation() != 999999999)\r\n\t\t\t\t{\r\n\t\t\t\t\t//check un-visited nodes and add new node into execution queue\r\n\t\t\t\t\ttempQueue.add(tempLeftNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//check the right node and update new distance\r\n\t\t\tif(tempRightNode != null)\r\n\t\t\t{\r\n\t\t\t\tif(tempRightNode.getNodeVisited() == false && tempRightNode.getOwnElevation() != 999999999 && tempRightNode.getStatus() != Status.EXPLORED)\r\n\t\t\t\t{\r\n\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t//record the path\r\n\t\t\t\t\tfor(int m = 0; m < tempQueue.get(0).getTotPath().size(); m++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\ttempXY = tempQueue.get(0).getTotPath().get(m);\r\n\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//check to see if new node existed in path\r\n\t\t\t\t\tif(checkPositionInPath(tempPath, tempQueue.get(0).gridPosition[0], tempQueue.get(0).gridPosition[1]) == false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\ttempXY2 = tempQueue.get(0).gridPosition;\r\n\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\ttempRightNode.setTotPath(tempPath);\r\n\t\t\t\t\ttempRightNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\tnodes[tempQueue.get(0).rightNode.gridPosition[0]][tempQueue.get(0).rightNode.gridPosition[1]] = tempRightNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(tempRightNode.gridPosition[0] == unexploreNode[0] && tempRightNode.gridPosition[1] == unexploreNode[1]){\r\n\t\t\t\t\t//System.out.println(\"End Point: \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[0]+1)+\" \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[1]+1));\r\n\t\t\t\t\t//System.out.println(\"Total Distance: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotDistance());\r\n\t\t\t\t\t//System.out.println(\"Total number of nodes: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotPath().size());\r\n\t\t\t\t\tshortestPath = nodes[unexploreNode[0]][unexploreNode[1]].getTotPath();\r\n\t\t\t\t\tshortestPath.add(unexploreNode);\r\n\t\t\t\t\treturn shortestPath;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(nodes[tempRightNode.gridPosition[0]][tempRightNode.gridPosition[1]].getNodeVisited()== false && checkNodeInQueue(tempQueue, tempRightNode.gridPosition[0], tempRightNode.gridPosition[1]) == false && tempRightNode.getOwnElevation() != 999999999)\r\n\t\t\t\t{\r\n\t\t\t\t\t//check un-visited nodes and add new node into execution queue\r\n\t\t\t\t\ttempQueue.add(tempRightNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//set current node to visited node and\r\n\t\t\t//remove current node from execution queue\r\n\t\t\ttempQueue.get(0).setNodeVistied(true);\r\n\t\t\tnodes[tempQueue.get(0).gridPosition[0]][tempQueue.get(0).gridPosition[1]].setNodeVistied(true);\r\n\t\t\ttempQueue.remove(0);\t\r\n\t\t}\r\n\t\t//print out the end node\r\n\t\t//print out the total distance between two points\r\n\t\t//print out the total number node of path\r\n\t\tSystem.out.println(\"End 5 Point: \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[0]+1)+\" \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[1]+1));\r\n\t\tSystem.out.println(\"Total Distance: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotDistance());\r\n\t\tSystem.out.println(\"Total number of nodes: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotPath().size());\r\n\t\tshortestPath = nodes[unexploreNode[0]][unexploreNode[1]].getTotPath();\r\n\t\tshortestPath.add(unexploreNode);\r\n\t\treturn shortestPath;\t\t\r\n\t}", "private void breadthFirst(PathBetweenNodes graph, LinkedList<String> visited) {\r\n\r\n LinkedList<String> nodes = graph.adjacentNodes(visited.getLast());\r\n for (String node : nodes)\r\n {\r\n if (visited.contains(node))\r\n {\r\n continue;\r\n }\r\n if (node.equals(END))\r\n {\r\n \tif (mode1 && mode){\r\n visited.add(node);\r\n printPath(visited); \r\n graph.flag=false;\r\n mode=false;\r\n visited.removeLast();\r\n \t} else if(mode2){\r\n visited.add(node);\r\n printPath(visited); \r\n flag=mode2; \r\n visited.removeLast();\r\n \t} \r\n } \r\n }\r\n\r\n for (String node : nodes) { // implementing a for loop to call each node in the array nodes\r\n if (visited.contains(node) || node.equals(END)) { // if statement to see if node is already visited or it is the end node\r\n continue;\r\n }\r\n flag=true;\r\n visited.addLast(node); //adding the last node to visited array\r\n breadthFirst(graph, visited); // implementing the breath first search\r\n visited.removeLast(); // removing the last node from array visited\r\n }\r\n if (flag == false) {\r\n System.out.println(\"No path Exists between \" + START + \" and \" + END);\r\n flag = true;\r\n }\r\n }", "private static void bfs(State curr) {\n curr.buildStack(curr.getSuccessors(curr));\r\n \r\n if(curr.isGoalState()) \r\n System.out.println(curr.getOrderedPair()+\" Goal\");//initial is goal state\r\n else\r\n System.out.println(curr.getOrderedPair());//initial\r\n \r\n curr.close.add(curr);\r\n while(!curr.open.isEmpty()&&!curr.isGoalState()) {\r\n curr.buildStack(curr.getSuccessors(curr));\r\n curr.printHelp(curr, 3);\r\n curr = curr.open.get(0);\r\n curr.close.add(curr.open.remove(0));\r\n }\r\n \r\n if(curr.isGoalState()) {\r\n System.out.println(curr.getOrderedPair() + \" Goal\");\r\n curr.printPath(curr);\r\n }\r\n }", "static int[] bfs(int n, int m, int[][] edges, int s) {\r\n \r\n HashSet<Integer> aList[] = new HashSet[n];\r\n // Array of the nodes of the tree\r\n\r\n Queue<Integer> bfsQueue = new LinkedList();\r\n\r\n boolean visited[] = new boolean[n];\r\n // check if a node is visited or not\r\n\r\n\r\n int cost[] = new int[n];\r\n // cost to travel from one node to other\r\n\r\n for (int i = 0; i < n; i++) {\r\n // intialising the values\r\n visited[i] = false;\r\n cost[i] = -1;\r\n\r\n aList[i] = new HashSet<Integer>();\r\n // Each element of aList is a Set\r\n // To store the neighbouring nodes of a particular node\r\n }\r\n\r\n for (int i = 0; i < m; i++) {\r\n // let node[i] <--> node[j]\r\n\r\n // adding node[j] to neighbours list of node[i]\r\n aList[edges[i][0] - 1].add(edges[i][1] - 1);\r\n\r\n // adding node[i] to neighbours list of node[j]\r\n aList[edges[i][1] - 1].add(edges[i][0] - 1);\r\n }\r\n\r\n //\r\n s = s - 1;\r\n bfsQueue.add(s);\r\n visited[s] = true;\r\n cost[s] = 0;\r\n //\r\n \r\n \r\n while (!bfsQueue.isEmpty()) {\r\n \r\n int curr = bfsQueue.poll();\r\n // takes the last element of the queue\r\n \r\n for (int neigh : aList[curr]) { // iterating the neighbours of node 'curr'\r\n if (!visited[neigh]) { // checking if node neigh id already visited during the search\r\n visited[neigh ] = true;\r\n bfsQueue.add(neigh); //add the node neigh to bfsqueue\r\n cost[neigh] = cost[curr] + 6; \r\n }\r\n }\r\n }\r\n\r\n int result[] = new int[n-1];\r\n\r\n for (int i=0, j=0; i<n && j<n-1; i++, j++) {\r\n if (i == s){\r\n i++;\r\n }\r\n result[j] = cost[i];\r\n }\r\n \r\n return result;\r\n }", "private void computeAllPaths()\n {\n for (Station src : this.graph.stations)\n {\n List<Station> visited = new ArrayList<Station>();\n computePathsForNode(src, null, null, visited);\n }\n Print.printTripList(this.tripList);\n }", "void BFS(int s, int d) \r\n { \r\n int source = s;\r\n int destination = d;\r\n boolean visited[] = new boolean[V];\r\n int parent[] = new int[V];\r\n \r\n // Create a queue for BFS \r\n LinkedList<Integer> queue = new LinkedList<Integer>(); \r\n \r\n // Mark the current node as visited and enqueue it \r\n \r\n visited[s]=true; \r\n queue.add(s); \r\n System.out.println(\"Search Nodes: \");\r\n while (queue.size() != 0) \r\n { \r\n int index = 0;\r\n \r\n // Dequeue a vertex from queue and print it \r\n \r\n s = queue.poll();\r\n \r\n System.out.print(convert2(s)); \r\n \r\n if(s == destination)\r\n {\r\n break;\r\n }\r\n \r\n System.out.print(\" -> \");\r\n while(index < adj[s].size()) \r\n { \r\n \r\n \r\n int n = adj[s].get(index); \r\n if (!visited[n]) \r\n { \r\n visited[n] = true;\r\n parent[n] = s;\r\n queue.add(n); \r\n }\r\n index = index+ 2;\r\n \r\n \r\n }\r\n \r\n \r\n \r\n }\r\n int check = destination;\r\n int cost = 0, first, second = 0;\r\n String string = \"\" + convert2(check);\r\n while(check!=source)\r\n {\r\n \r\n first = parent[check];\r\n string = convert2(first) + \" -> \" + string;\r\n while(adj[first].get(second) != check)\r\n {\r\n second++;\r\n }\r\n cost = cost + adj[first].get(second +1);\r\n check = first;\r\n second = 0;\r\n \r\n }\r\n \r\n System.out.println(\"\\n\\nPathway: \");\r\n \r\n System.out.println(string);\r\n \r\n \r\n System.out.println(\"\\nTotal cost: \" + cost);\r\n }", "public Stack<Integer> dfs(Maze tmp) {\n \n int tmpx = tmp.positionX();\n int tmpy = tmp.positionY();\n Stack<Integer> s = new Stack<Integer>();\n while (!tmp.gameOver()) {\n choosedirection(s, tmp);\n while (!s.isEmpty() && !tmp.gameOver()) {\n if (s.peek() == 0) {\n if (tmp.right()) {\n s.push(1);\n } else if (tmp.up()) {\n s.push(0);\n } else if (tmp.left()) {\n s.push(3);\n } else {\n this.stackpop(s, tmp);\n }\n } else if (s.peek() == 1) {\n if (tmp.down()) {\n s.push(2);\n } else if (tmp.right()) {\n s.push(1);\n } else if (tmp.up()) {\n s.push(0);\n } else {\n this.stackpop(s, tmp);\n }\n } else if (s.peek() == 2) {\n if (tmp.left()) {\n s.push(3);\n } else if (tmp.down()) {\n s.push(2);\n } else if (tmp.right()) {\n s.push(1);\n } else {\n this.stackpop(s, tmp);\n }\n } else if (s.peek() == 3) {\n if (tmp.up()) {\n s.push(0);\n } else if (tmp.left()) {\n s.push(3);\n } else if (tmp.down()) {\n s.push(2);\n } else {\n this.stackpop(s, tmp);\n }\n\n }\n\n }\n }\n\n Stack<Integer> stack = new Stack<Integer>();\n while (!s.isEmpty()) {\n stack.push(s.pop());\n }\n\n tmp.setLocation(tmpx, tmpy);\n return stack;\n\n }", "public static void main(String[] args) throws FileNotFoundException, IOException {\r\n\r\n //Creating an instance object of the class PathBetweenNodes\r\n PathBetweenNodes x = new PathBetweenNodes();\r\n x.graph = new PathBetweenNodes();\r\n x.readMaze(); // reading the maze from the file\r\n LinkedList<String> visited = new LinkedList<String>(); // creating an array called visited to store visited nodes\r\n System.out.println(\"Enter the source node:\");//asking user to enter the start node\r\n Scanner sc = new Scanner(System.in); // Scanner to input the start node into the system\r\n START = sc.next();\r\n System.out.println(\"Enter the destination node:\");// asking user to input the destination node\r\n END = sc.next(); //scan the destination node into the system\r\n mode(option);\r\n startTimer = System.nanoTime();\r\n visited.add(START);// adding the start node to array visited\r\n new PathBetweenNodes().breadthFirst(x.graph, visited); // implementing the breath first search for graph x and array visited\r\n sc.close(); // scanner must be closed\r\n if (x.graph.flag) {\r\n System.out.println(\"There is existing path between \" + START + \" and \" + END + \" as above.\");\r\n }\r\n if (!x.graph.flag) {\r\n System.out.println(\"No path was found between \" + START + \" and \" + END + \".\");\r\n }\r\n endTimer = System.nanoTime();\r\n long TimeElapsed = endTimer - startTimer;\r\n System.out.println(\"Time taken to solve the maze = \" + TimeElapsed + \" Nano seconds.\");\r\n }", "private void bfs(Dungeon d, Site s) {\n\t\t\n\t\t// use a queue to do BFS, and initialize instance variables\n\t\tQueue<Site> q = new LinkedList<Site>();\n\t\tfor (int x = 0; x < d.size(); x++)\n\t\t\tfor (int y = 0; y < d.size(); y++)\n\t\t\t\tdistTo[x][y] = INFINITY; \n\t\tdistTo[s.getX()][s.getY()] = 0;\n\t\tmarked[s.getX()][s.getY()] = true;\n\t\t\n\t\t// pop site from queue until it's empty\n\t\tq.offer(s);\n\t\twhile (!q.isEmpty()) {\n\t\t\t\n\t\t\t// pop the next site in the queue\n\t\t\tSite v = q.poll(); \t \n\t\t\tint x = v.getX();\n\t\t\tint y = v.getY();\n\n\t\t\t// 4 adjacent sites\n\t\t\tSite east = new Site(x + 1, y);\n\t\t\tSite west = new Site(x - 1, y);\n\t\t\tSite north = new Site(x, y - 1);\n\t\t\tSite south = new Site(x, y + 1);\n\n\t\t\t// BFS the rest of the dungeon\n\t\t\tif (d.isLegalMove(v, east) && !marked[east.getX()][east.getY()]) {\n\t\t\t\tedgeTo[east.getX()][east.getY()] = v;\n\t\t\t\tdistTo[east.getX()][east.getY()] = distTo[x][y] + 1;\n\t\t\t\tmarked[east.getX()][east.getY()] = true;\n\t\t\t\tq.offer(east);\n\t\t\t}\n\t\t\tif (d.isLegalMove(v, west) && !marked[west.getX()][west.getY()]) {\n\t\t\t\tedgeTo[west.getX()][west.getY()] = v;\n\t\t\t\tdistTo[west.getX()][west.getY()] = distTo[x][y] + 1;\n\t\t\t\tmarked[west.getX()][west.getY()] = true;\n\t\t\t\tq.offer(west);\n\t\t\t}\n\t\t\tif (d.isLegalMove(v, north) && !marked[north.getX()][north.getY()]) {\n\t\t\t\tedgeTo[north.getX()][north.getY()] = v;\n\t\t\t\tdistTo[north.getX()][north.getY()] = distTo[x][y] + 1;\n\t\t\t\tmarked[north.getX()][north.getY()] = true;\n\t\t\t\tq.offer(north);\n\t\t\t}\n\t\t\tif (d.isLegalMove(v, south) && !marked[south.getX()][south.getY()]) {\n\t\t\t\tedgeTo[south.getX()][south.getY()] = v;\n\t\t\t\tdistTo[south.getX()][south.getY()] = distTo[x][y] + 1;\n\t\t\t\tmarked[south.getX()][south.getY()] = true;\n\t\t\t\tq.offer(south);\n\t\t\t}\n\n\t\t}\n\n\t}", "public void BFS() {\n visitedCells = 1;\n\n // Initialize the vertices\n for (int j = 0; j < maze.getGrid().length; j++) {\n for (int k = 0; k < maze.getGrid().length; k++) {\n Cell cell = maze.getGrid()[j][k];\n cell.setColor(\"WHITE\");\n cell.setDistance(0);\n cell.setParent(null);\n }\n }\n\n Cell sourceCell = maze.getGrid()[0][0];\n Cell neighbor = null;\n Cell currentCell;\n int distance = 0;\n\n // Initialize the source node\n sourceCell.setColor(\"GREY\");\n sourceCell.setDistance(0);\n sourceCell.setParent(null);\n\n queue.add(sourceCell);\n\n // Visits each cell until the queue is empty\n while (!queue.isEmpty()) {\n currentCell = queue.remove();\n\n for (int i = 0; i < currentCell.mazeNeighbors.size(); i++) {\n neighbor = currentCell.mazeNeighbors.get(i);\n\n // Stop the search if you reach the final cell\n if (neighbor.x == r - 1 && neighbor.y == r - 1) {\n distance++;\n if (distance == 10)\n distance = 0;\n neighbor.setDistance(distance);\n neighbor.setParent(currentCell);\n neighbor.visited = true;\n visitedCells++;\n break;\n }\n\n // Checks each neighbor and adds it to the queue if its color is white\n if (neighbor.getColor().equalsIgnoreCase(\"WHITE\")) {\n distance++;\n if (distance == 10)\n distance = 0;\n neighbor.setColor(\"GREY\");\n neighbor.setDistance(distance);\n neighbor.setParent(currentCell);\n neighbor.visited = true;\n queue.add(neighbor);\n visitedCells++;\n }\n }\n // Stop the search if you reach the final cell\n if (neighbor.x == r - 1 && neighbor.y == r - 1)\n break;\n\n currentCell.setColor(\"BLACK\");\n }\n }", "public void seekWalls() {\n\t\t for (int j=0; j<visited[0].length; j++){\n\t\t\tfor (int i=visited.length-1; i>=0; i--) {\t\t\t\n\t\t\t\tif (i!=0 && j!= visited[0].length-1) {//general position\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;//not break!!!!! return to exit !\n\t\t\t\t\t}\n\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (i==0 && j!= visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse if (i!=0 && j== visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse {//if (i==0 && j== visited[0].length-1) {\n\t\t\t\t\t//no solution\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void updateNeighbours(int i) {\n if (currentState[i] != 0) {\n int ix0 = (i - STEPX) & MASKX;\n int iy0 = (i - STEPY) & MASKY;\n int iz0 = (i - STEPZ) & MASKZ;\n\n int ix1 = (i) & MASKX;\n int iy1 = (i) & MASKY;\n int iz1 = (i) & MASKZ;\n\n int ix2 = (i + STEPX) & MASKX;\n int iy2 = (i + STEPY) & MASKY;\n int iz2 = (i + STEPZ) & MASKZ;\n\n ++nextState[ix0 | iy0 | iz0];\n ++nextState[ix0 | iy0 | iz1];\n ++nextState[ix0 | iy0 | iz2];\n ++nextState[ix0 | iy1 | iz0];\n ++nextState[ix0 | iy1 | iz1];\n ++nextState[ix0 | iy1 | iz2];\n ++nextState[ix0 | iy2 | iz0];\n ++nextState[ix0 | iy2 | iz1];\n ++nextState[ix0 | iy2 | iz2];\n\n ++nextState[ix1 | iy0 | iz0];\n ++nextState[ix1 | iy0 | iz1];\n ++nextState[ix1 | iy0 | iz2];\n ++nextState[ix1 | iy1 | iz0];\n\n //!\t\t++nextState[ix1|iy1|iz1];\n ++nextState[ix1 | iy1 | iz2];\n ++nextState[ix1 | iy2 | iz0];\n ++nextState[ix1 | iy2 | iz1];\n ++nextState[ix1 | iy2 | iz2];\n\n ++nextState[ix2 | iy0 | iz0];\n ++nextState[ix2 | iy0 | iz1];\n ++nextState[ix2 | iy0 | iz2];\n ++nextState[ix2 | iy1 | iz0];\n ++nextState[ix2 | iy1 | iz1];\n ++nextState[ix2 | iy1 | iz2];\n ++nextState[ix2 | iy2 | iz0];\n ++nextState[ix2 | iy2 | iz1];\n ++nextState[ix2 | iy2 | iz2];\n }\n }", "private int BFS() {\n adjList.cleanNodeFields();\n\n //Queue for storing current shortest path\n Queue<Node<Integer, Integer>> q = new LinkedList<>();\n\n //Set source node value to 0\n q.add(adjList.getNode(startNode));\n q.peek().key = 0;\n q.peek().d = 0;\n q.peek().visited = true;\n\n //Helper variables\n LinkedList<Pair<Node<Integer, Integer>, Integer>> neighbors;//Array of pairs <neighborKey, edgeWeight>\n Node<Integer, Integer> neighbor, u;\n long speed = (long) (cellSideLength * 1.20);\n\n while (!isCancelled() && q.size() != 0) {\n u = q.poll();\n\n //Marks node as checked\n checkedNodesGC.fillRect((u.value >> 16) * cellSideLength + 0.5f,\n (u.value & 0x0000FFFF) * cellSideLength + 0.5f,\n (int) cellSideLength - 1, (int) cellSideLength - 1);\n\n //endNode found\n if (u.value == endNode) {\n //Draws shortest path\n Node<Integer, Integer> current = u, prev = u;\n\n while ((current = current.prev) != null) {\n shortestPathGC.strokeLine((prev.value >> 16) * cellSideLength + cellSideLength / 2,\n (prev.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2,\n (current.value >> 16) * cellSideLength + cellSideLength / 2,\n (current.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2);\n prev = current;\n }\n return u.d;\n }\n\n //Wait after checking node\n try {\n Thread.sleep(speed);\n } catch (InterruptedException interrupted) {\n if (isCancelled())\n break;\n }\n\n //Checking Neighbors\n neighbors = adjList.getNeighbors(u.value);\n for (Pair<Node<Integer, Integer>, Integer> neighborKeyValuePair : neighbors) {\n neighbor = neighborKeyValuePair.getKey();\n //Relaxation step\n //Checks if neighbor hasn't been checked, if so the assign the shortest path\n if (!neighbor.visited) {\n //Adds checked neighbor to queue\n neighbor.key = u.d + 1;\n neighbor.d = u.d + 1; //Assign shorter path found to neighbor\n neighbor.prev = u;\n neighbor.visited = true;\n q.add(neighbor);\n }\n }\n }\n return Integer.MAX_VALUE;\n }", "private void calculate() {\n\t\tList<Edge> path = new ArrayList<>();\n\t\tPriorityQueue<Vert> qv = new PriorityQueue<>();\n\t\tverts[s].dist = 0;\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tif (e.w==0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist < L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t} else if (verts[t].dist == L) {\n\t\t\tok = true;\n\t\t\tfor (int i=0; i<m; i++) {\n\t\t\t\tif (edges[i].w == 0) {\n\t\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// replace 0 with 1, adding to za list\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (edges[i].w == 0) {\n\t\t\t\tza[i] = true;\n\t\t\t\tedges[i].w = 1;\n\t\t\t} else {\n\t\t\t\tza[i] = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// looking for shortest path from s to t with 0\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tif (i != s) {\n\t\t\t\tverts[i].dist = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tqv.clear();\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist > L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t}\n\t\tVert v = verts[t];\n\t\twhile (v.dist > 0) {\n\t\t\tlong minDist = MAX_DIST;\n\t\t\tVert vMin = null;\n\t\t\tEdge eMin = null;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(v.idx)];\n\t\t\t\tif (vo.dist+e.w < minDist) {\n\t\t\t\t\tvMin = vo;\n\t\t\t\t\teMin = e;\n\t\t\t\t\tminDist = vMin.dist+e.w;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tv = vMin;\t\n\t\t\tpath.add(eMin);\n\t\t}\n\t\tCollections.reverse(path);\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (za[i]) {\n\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tlong totLen=0;\n\t\tboolean wFixed = false;\n\t\tfor (Edge e : path) {\n\t\t\ttotLen += (za[e.idx] ? 1 : e.w);\n\t\t}\n\t\tfor (Edge e : path) {\n\t\t\tif (za[e.idx]) {\n\t\t\t\tif (!wFixed) {\n\t\t\t\t\te.w = L - totLen + 1;\n\t\t\t\t\twFixed = true;\n\t\t\t\t} else {\n\t\t\t\t\te.w = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tok = true;\n\t}", "private static void dfs(State curr) {\n curr.buildStack(curr.getSuccessors(curr));\r\n \r\n if(curr.isGoalState()) \r\n System.out.println(curr.getOrderedPair()+\" Goal\");//initial is goal state\r\n else\r\n System.out.println(curr.getOrderedPair());//initial\r\n \r\n curr.close.add(curr);\r\n while(!curr.open.isEmpty()&&!curr.isGoalState()) {\r\n curr.buildStack(curr.getSuccessors(curr));\r\n curr.printHelp(curr, 4);\r\n curr = curr.open.get(curr.open.size()-1);\r\n curr.close.add(curr.open.remove(curr.open.size()-1));\r\n }\r\n \r\n if(curr.isGoalState()) {\r\n System.out.println(curr.getOrderedPair() + \" Goal\");\r\n curr.printPath(curr);\r\n }\r\n }", "public void depthFirstSearch(Node vertex){\n vertex.visited = true;\n if(vertex.row == row_size-1 && vertex.col == col_size-1){\n while(!dfs_stack.isEmpty()){\n exitPath +=dfs_stack.peek(); \n dfs_stack.pop();\n } \n }\n if(vertex.north!=null && vertex.north.visited==false){\n dfs_stack.push(\"N\");\n vertex.depthFirstSearch(vertex.north);\n }\n if(vertex.south!=null && vertex.south.visited==false){\n dfs_stack.push(\"S\");\n vertex.depthFirstSearch(vertex.south);\n }\n if(vertex.west !=null && vertex.west.visited ==false){\n dfs_stack.push(\"W\");\n vertex.depthFirstSearch(vertex.west);\n }\n if(vertex.east !=null && vertex.east.visited==false){\n dfs_stack.push(\"E\");\n vertex.depthFirstSearch(vertex.east);\n }\n if (!dfs_stack.isEmpty()){\n dfs_stack.pop();\n }\n return;\n }", "private static boolean updateHoleStates(int holeID, HoleState newState, HoleState state[], boolean rowMatrix[][], boolean colMatrix[][], boolean rowColMatrix[][], HashSet<Integer> visitedRows, HashSet<Integer> visitedCols)\r\n {\n \r\n int ids[];\r\n state[holeID-1]=newState;\r\n if(isHoleInRow(holeID))\r\n {\r\n ids = getHolesInRow(getRowIDFromHoleID(holeID));\r\n } else {\r\n ids = getHolesInColumn(getColumnIDFromHoleID(holeID));\r\n }\r\n \r\n for(int i=0; i<ids.length; i++)\r\n {\r\n state[ids[i]-1]=newState;\r\n }\r\n \r\n if(isHoleInRow(holeID))\r\n {\r\n int rid = getRowIDFromHoleID(holeID);\r\n visitedRows.add(rid);\r\n \r\n //Utility.alert(\"ROWID=\"+rid);\r\n \r\n // scan row-connections\r\n for(int i=0; i<rowMatrix[rid-1].length; i++)\r\n {\r\n if(i==rid-1) continue;\r\n if(rowMatrix[rid-1][i])\r\n {\r\n // has connection to (i+1)-th row \r\n if(!visitedRows.contains(i+1))\r\n {\r\n int frid = getFirstHoleIDInRow(i+1);\r\n updateHoleStates(frid, newState, state, rowMatrix, colMatrix, rowColMatrix, visitedRows, visitedCols);\r\n }\r\n }\r\n }\r\n \r\n // scan row-col connections\r\n for(int i=0; i<rowColMatrix[rid-1].length; i++)\r\n {\r\n if(rowColMatrix[rid-1][i])\r\n {\r\n //Utility.alert(\"ROW has connection to \"+(i+1)+\" col\");\r\n // has connection to (i+1)-th col\r\n if(!visitedCols.contains(i+1))\r\n {\r\n //Utility.alert(\"NOT VISITED\");\r\n \r\n visitedCols.add(i+1);\r\n int fcid = getFirstHoleIDInColumn(i+1);\r\n updateHoleStates(fcid, newState, state, rowMatrix, colMatrix, rowColMatrix, visitedRows, visitedCols);\r\n }\r\n }\r\n }\r\n } else {\r\n int cid = getColumnIDFromHoleID(holeID);\r\n visitedCols.add(cid);\r\n \r\n for(int i=0; i<colMatrix[cid-1].length; i++)\r\n {\r\n if(i==cid-1) continue;\r\n if(colMatrix[cid-1][i])\r\n {\r\n // has connection to (i+1)-th column \r\n if(!visitedCols.contains(i+1))\r\n {\r\n int fcid = getFirstHoleIDInColumn(i+1);\r\n updateHoleStates(fcid, newState, state, rowMatrix, colMatrix, rowColMatrix, visitedRows, visitedCols);\r\n }\r\n }\r\n }\r\n \r\n // scan row-col connections\r\n for(int i=0; i<rowColMatrix.length; i++)\r\n {\r\n if(rowColMatrix[i][cid-1])\r\n {\r\n // has connection to (i+1)-th row \r\n if(!visitedRows.contains(i+1))\r\n {\r\n visitedRows.add(i+1);\r\n int frid = getFirstHoleIDInRow(i+1);\r\n updateHoleStates(frid, newState, state, rowMatrix, colMatrix, rowColMatrix, visitedRows, visitedCols);\r\n }\r\n }\r\n }\r\n }\r\n \r\n return true;\r\n }", "public static void main(String[] args) {\n Graph graph = new Graph();\n graph.addEdge(0, 1);\n graph.addEdge(0, 4);\n\n graph.addEdge(1,0);\n graph.addEdge(1,5);\n graph.addEdge(1,2);\n graph.addEdge(2,1);\n graph.addEdge(2,6);\n graph.addEdge(2,3);\n\n graph.addEdge(3,2);\n graph.addEdge(3,7);\n\n graph.addEdge(7,3);\n graph.addEdge(7,6);\n graph.addEdge(7,11);\n\n graph.addEdge(5,1);\n graph.addEdge(5,9);\n graph.addEdge(5,6);\n graph.addEdge(5,4);\n\n graph.addEdge(9,8);\n graph.addEdge(9,5);\n graph.addEdge(9,13);\n graph.addEdge(9,10);\n\n graph.addEdge(13,17);\n graph.addEdge(13,14);\n graph.addEdge(13,9);\n graph.addEdge(13,12);\n\n graph.addEdge(4,0);\n graph.addEdge(4,5);\n graph.addEdge(4,8);\n graph.addEdge(8,4);\n graph.addEdge(8,12);\n graph.addEdge(8,9);\n graph.addEdge(12,8);\n graph.addEdge(12,16);\n graph.addEdge(12,13);\n graph.addEdge(16,12);\n graph.addEdge(16,17);\n graph.addEdge(17,13);\n graph.addEdge(17,16);\n graph.addEdge(17,18);\n\n graph.addEdge(18,17);\n graph.addEdge(18,14);\n graph.addEdge(18,19);\n\n graph.addEdge(19,18);\n graph.addEdge(19,15);\n LinkedList<Integer> visited = new LinkedList();\n List<ArrayList<Integer>> paths = new ArrayList<ArrayList<Integer>>();\n int currentNode = START;\n visited.add(START);\n new searchEasy().findAllPaths(graph, visited, paths, currentNode);\n for(ArrayList<Integer> path : paths){\n for (Integer node : path) {\n System.out.print(node);\n System.out.print(\" \");\n }\n System.out.println();\n }\n }", "public static void main(String[] args) {\n\n /*\n * Given below directed graph, show the DFS and BFS traversal and print the paths\n * it took throughout the traversal of the graph\n *\n * (D)--(F)\n * /\n * (B)--(E)\n * /\n * (A)\n * \\\n * (C)--(G)\n *\n * Do Breadth First Search and Depth First Search, conclude on the trade offs\n * between the two traversal\n */\n\n // Initialize the graph here and its edges\n Graphs graph = new Graphs();\n graph.addNode('A', new Node('A'));\n graph.addNode('B', new Node('B'));\n graph.addNode('C', new Node('C'));\n graph.addNode('D', new Node('D'));\n graph.addNode('E', new Node('E'));\n graph.addNode('F', new Node('F'));\n graph.addNode('G', new Node('G'));\n\n graph.addEdge('A','B');\n graph.addEdge('B','D');\n graph.addEdge('D','F');\n graph.addEdge('B','E');\n graph.addEdge('A','C');\n graph.addEdge('C','G');\n\n // Initialize the list of paths\n ArrayList<String> traversedNodes;\n // Do a DFS on the graph\n traversedNodes = graph.depthFirstSearch('A','G');\n System.out.println(\"Traversal in DFS:\");\n // Print all of the paths\n for(String path : traversedNodes) {\n System.out.println(path);\n }\n\n // Do a BFS on the graph\n traversedNodes = graph.breadthFirstSearch('A','G');\n System.out.println(\"\\nTraversal in BFS:\");\n // Print all of the paths\n for(String path : traversedNodes) {\n System.out.println(path);\n }\n\n }", "public static void main(String args[]) {\n int V = 4;\n Graph g = new Graph(V);\n g.addEdge(0, 1);\n g.addEdge(0, 2);\n g.addEdge(1, 2);\n g.addEdge(2, 0);\n g.addEdge(2, 3);\n g.addEdge(3, 3);\n\n int src = 1;\n int dest = 3;\n boolean[] visited = new boolean[V];\n\n // To store the complete path between source and destination\n Stack<Integer> path1 = new Stack<>();\n\n if (hasPathDFS(g, src, dest, visited, path1)) {\n System.out.println(\"There is a path from \" + src + \" to \" + dest);\n System.out.println(\"The complete path is \" + path1);\n } else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n src = 3;\n dest = 1;\n // To store the complete path between source and destination\n Stack<Integer> path2 = new Stack<>();\n\n if (hasPathDFS(g, src, dest, visited, path2)) System.out.println(\"There is a path from \" + src + \" to \" + dest);\n else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n // total number of nodes in the graph (labeled from 0 to 7)\n int n = 8;\n\n // List of graph edges as per the above diagram\n Graph g2 = new Graph(n);\n /**\n * There is a path from 1 to 3\n * The complete path is [1, 2, 3]\n * There is no path from 3 to 1\n * There is a path from 0 to 7\n * The complete path is [0, 3, 4, 6, 7]\n */\n\n g2.addEdge(0, 3);\n g2.addEdge(1, 0);\n g2.addEdge(1, 2);\n g2.addEdge(1, 4);\n g2.addEdge(2, 7);\n g2.addEdge(3, 4);\n g2.addEdge(3, 5);\n g2.addEdge(4, 3);\n g2.addEdge(4, 6);\n g2.addEdge(5, 6);\n g2.addEdge(6, 7);\n\n // source and destination vertex\n src = 0;\n dest = 7;\n\n // To store the complete path between source and destination\n Stack<Integer> path = new Stack<>();\n boolean[] visited2 = new boolean[n];\n\n if (hasPathDFS(g2, src, dest, visited2, path)) {\n System.out.println(\"There is a path from \" + src + \" to \" + dest);\n System.out.println(\"The complete path is \" + path);\n } else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n\n }", "private Map<Long, Boolean> searchPaths(Context context, Long initialStateId,\n Long destinationStateId, Map<Long, Boolean> visitedStateIds,\n Map<Long, String> stateOutputEvents) {\n\n Queue<LinkedList<Long>> queueOfPaths = new LinkedList<>();\n LinkedList<Long> currentPath = new LinkedList<>();\n\n currentPath.add(initialStateId);\n queueOfPaths.add(currentPath);\n\n Set<Long> nextDependentStateIds;\n\n while (queueOfPaths.size() != 0) {\n currentPath = queueOfPaths.poll();\n Long lastStateId = currentPath.getLast();\n\n if(lastStateId.equals(destinationStateId)) {\n for (Long stateId : currentPath) {\n visitedStateIds.put(stateId, Boolean.TRUE);\n }\n continue;\n }\n\n nextDependentStateIds = context.getDependentStateIds(stateOutputEvents.get(lastStateId));\n for (Long dependentStateId : nextDependentStateIds) {\n if(!currentPath.contains(dependentStateId)) {\n LinkedList<Long> newPath = new LinkedList<>();\n newPath.addAll(currentPath);\n newPath.add(dependentStateId);\n queueOfPaths.add(newPath);\n }\n }\n }\n return visitedStateIds;\n }", "private void bfs(int[][] board){\n int[][] original = {{1,2,3},{4,5,0}};\n LinkedList<Cell> queue = new LinkedList<>();\n HashMap<Cell,int[][]> states = new HashMap<Cell,int[][]>();\n Set<String> seen = new HashSet<>();\n queue.offer(new Cell(1,2));\n states.put(queue.peekFirst(),original);\n int step = 0;\n while(step <= maxStep){\n int sz = queue.size();\n while(sz-- > 0){\n Cell cur = queue.pollFirst();\n int[][] curBoard = states.get(cur);\n if(seen.contains(this.toStr(curBoard))){\n continue;\n }\n seen.add(this.toStr(curBoard));\n \n if (isSame(curBoard,board)){\n this.res = step;\n return;\n }\n // move around\n for(int i = 0; i < 4; ++i){\n int r = cur.row + dr[i];\n int c = cur.col + dc[i];\n if(r < 0 || c < 0 || r > 1 || c > 2) continue; \n Cell next = new Cell(r, c);\n queue.offer(next);\n int[][] nextboard = this.clone(curBoard);\n nextboard[cur.row][cur.col] = nextboard[r][c];\n nextboard[r][c] = 0;\n states.put(next,nextboard);\n }\n }\n ++step;\n }\n return;\n }", "@Override\n\tpublic direction[] Solve(nPuzzle aPuzzle) {\n\t\taddToFrontier(aPuzzle.StartState);\n\t\t\n\t\t// While the open list is not empty:\n\t\twhile(Frontier.size() > 0) {\n\t\t\t// Find the frontier with the lowest F value.\n\t\t\tPuzzleState q = popFrontier();\n\t\t\t\n\t\t\tArrayList<PuzzleState> newStates = q.explore();\n\t\t\t\n\t\t\tfor(PuzzleState n : newStates) {\n\t\t\t\t// If goal state return path to state.\n\t\t\t\tif(n.equals(aPuzzle.GoalState))\n\t\t\t\t\treturn n.GetPathToState();\n\t\t\t\t// Else add state to open list.\n\t\t\t\telse {\n\t\t\t\t\tn.HeuristicValue = HeuristicValue(n, aPuzzle.GoalState);\n\t\t\t\t\tn.setEvaluationFunction(n.HeuristicValue + n.Cost);\n\t\t\t\t\taddToFrontier(n);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public void dfs() {\n\t\tfor (Vertice v : vertices) {\n\t\t\tv.setVisited(false);\n\t\t}\n\t\tfor (Vertice v : vertices) {\n\t\t\tif (!v.getVisited()) {\n\t\t\t\tVisitar(v, -1);\n\t\t\t}\n\t\t}\n\t}", "static void bfs(int[][] G){\n\t\tQueue<Integer> q = new LinkedList<Integer>();\t\t\n\t\tfor (int ver_start = 0; ver_start < N; ver_start ++){\n\t\t\tif (visited[ver_start]) continue;\n\t\t\tq.add(ver_start);\n\t\t\tvisited[ver_start] = true;\n\n\t\t\twhile(!q.isEmpty()){\n\t\t\t\tint vertex = q.remove();\n\t\t\t\tSystem.out.print((vertex+1) + \" \");\n\t\t\t\tfor (int i=0; i<N; i++){\n\t\t\t\t\tif (G[vertex][i] == 1 && !visited[i]){\n\t\t\t\t\t\t// find neigbor of current vertex and not visited\n\t\t\t\t\t\t// add into the queue\n\t\t\t\t\t\tq.add(i);\n\t\t\t\t\t\tvisited[i] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"--\");\t\t\t\n\t\t}\n\t}", "public void getPath()\n {\n if(bruteForceJRadioButton.isSelected())//brute force method\n {\n methodJLabel.setText(\"Brute Force\");\n startTime = System.nanoTime();//times should be in class where brute force is found\n pathList = graph.getBruteForcePath();\n stopTime = System.nanoTime();\n timePassed = stopTime - startTime;\n }\n else if(nearestJRadioButton.isSelected())//nearest neighbor method\n {\n methodJLabel.setText(\"Nearest Neighbor\");\n startTime = System.nanoTime();\n pathList = graph.getNearestNeighbourPath();\n stopTime = System.nanoTime();\n timePassed = stopTime - startTime;\n }\n else //sorted edges method\n {\n methodJLabel.setText(\"Sorted Edges\");\n startTime = System.nanoTime();\n pathList = graph.getSortedEdgePath();\n stopTime = System.nanoTime();\n timePassed = stopTime - startTime;\n }\n displayStats();\n }", "public static void bfs(int a, int b) {\n\t\t\r\n\t\tQueue<Node> q = new LinkedList<>();\r\n\t\t\r\n\t\tq.add(new Node(a,b));\r\n\t\t\r\n\t\twhile(!q.isEmpty()) {\r\n\t\t\t\r\n\t\t\tNode n = q.remove();\r\n\t\t\t\r\n\t\t\tint x = n.x;\r\n\t\t\tint y = n.y;\r\n\t\t\t\r\n\t\t\tif(x+1 <= N && map[x+1][y] > map[x][y]) {\r\n\t\t\t\tif(visited[x+1][y] != 1) {\r\n\t\t\t\t\tq.add(new Node(x+1,y));\r\n\t\t\t\t\tvisited[x+1][y] = cnt;\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\tif(x-1 > 0 && map[x-1][y] > map[x][y]) {\r\n\t\t\t\tif(visited[x-1][y] != 1) {\r\n\t\t\t\t\tq.add(new Node(x-1,y));\r\n\t\t\t\t\tvisited[x-1][y] = cnt;\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\tif(y-1 > 0 && map[x][y-1] > map[x][y]) {\r\n\t\t\t\tif(visited[x][y-1] != 1) {\r\n\t\t\t\t\tq.add(new Node(x,y-1));\r\n\t\t\t\t\tvisited[x][y-1] = cnt;\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\tif(y+1 <=N && map[x][y+1] > map[x][y]) {\r\n\t\t\t\tif(visited[x][y+1] != 1) {\r\n\t\t\t\t\tq.add(new Node(x,y+1));\r\n\t\t\t\t\tvisited[x][y+1] = cnt;\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\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "void dfs(){\n // start from the index 0\n for (int vertex=0; vertex<v; vertex++){\n // check visited or not\n if (visited[vertex]==false){\n Explore(vertex);\n }\n }\n }", "private void breadthFirstSearch (int start, int[] visited, int[] parent){\r\n Queue< Integer > theQueue = new LinkedList< Integer >();\r\n boolean[] identified = new boolean[getNumV()];\r\n identified[start] = true;\r\n theQueue.offer(start);\r\n while (!theQueue.isEmpty()) {\r\n int current = theQueue.remove();\r\n visited[current] = 1; //ziyaret edilmis vertexler queuedan cikarilan vertexlerdir\r\n Iterator < Edge > itr = edgeIterator(current);\r\n while (itr.hasNext()) {\r\n Edge edge = itr.next();\r\n int neighbor = edge.getDest();\r\n if (!identified[neighbor]) {\r\n identified[neighbor] = true;\r\n theQueue.offer(neighbor);\r\n parent[neighbor] = current;\r\n }\r\n }\r\n }\r\n }", "private void matchOnlyCurrentGraphState(TaskMonitor monitor) {\r\n\t\t// make a new list of the matched nodes, to avoid concurrent\r\n\t\t// modification problems\r\n\t\tList matchedNodes = getMatchedNodesOrdered();\r\n\r\n\t\tint total = matchedNodes.size();\r\n\t\tint count = 0;\r\n\r\n\t\tfor (Iterator nodeIt = matchedNodes.iterator(); nodeIt.hasNext();) {\r\n\t\t\tcount++;\r\n\t\t\tmonitor.report(count, total, \"Paths tested\");\r\n\t\t\tif (monitor.isCancelRequested())\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tRoadNode subNode = (RoadNode) nodeIt.next();\r\n\t\t\tif (subNode.isMatched()) {\r\n\t\t\t\tRoadNode matchNode = subNode.getMatch();\r\n\t\t\t\tNodeMatching matching = subNode.getMatching();\r\n\t\t\t\tmatchPathsFromNodes(matching);\r\n\t\t\t}\r\n\t\t}\r\n\t\tDebugFeature.saveFeatures(MATCH,\r\n\t\t\t\t\"Y:\\\\jcs\\\\testUnit\\\\roads\\\\pathMatches.jml\");\r\n\t\tDebugFeature.saveFeatures(SPLIT,\r\n\t\t\t\t\"Y:\\\\jcs\\\\testUnit\\\\roads\\\\pathSplits.jml\");\r\n\t\tDebug.println(\"paths matched = \" + pathMatchCount);\r\n\t\tDebug.println(\"splits matched = \" + splitMatchCount);\r\n\t}", "public void findNeighbours(ArrayList<int[]> visited , Grid curMap) {\r\n\t\tArrayList<int[]> visitd = visited;\r\n\r\n\t\t//System.out.println(\"FROM FIND NEIGHBOURS cur pos:\" +Arrays.toString(nodePos));\r\n\t\t//for(int j=0; j<visitd.size();j++) {\r\n\t\t\t//System.out.println(\"FROM FIND NEIGHBOURS\" +Arrays.toString(visited.get(j)));\r\n\t\t\t//System.out.println(\"FROM FIND NEIGHBOURS getvstd\" +Arrays.toString(visited.get(j)));\r\n\t\t//}\r\n\t\t//System.out.println(\"FROM FIND NEIGHBOURS\" +visited);\r\n\t\tCell left=curMap.getCell(0, 0);\r\n\t\tCell right=curMap.getCell(0, 0);\r\n\t\tCell upper=curMap.getCell(0, 0);\r\n\t\tCell down=curMap.getCell(0, 0);\r\n\t\t//the getStart() method returns x,y coordinates representing the point in x,y axes\r\n\t\t//so if either of [0] or [1] coordinate is zero then we have one less neighbor\r\n\t\tif (nodePos[1]> 0) {\r\n\t\t\tupper=curMap.getCell(nodePos[0], nodePos[1]-1) ; \r\n\t\t}\r\n\t\tif (nodePos[1] < M-1) {\r\n\t\t\tdown=curMap.getCell(nodePos[0], nodePos[1]+1);\r\n\t\t}\r\n\t\tif (nodePos[0] > 0) {\r\n\t\t\tleft=curMap.getCell(nodePos[0] - 1, nodePos[1]);\r\n\t\t}\r\n\t\tif (nodePos[0] < N-1) {\r\n\t\t\tright=curMap.getCell(nodePos[0]+1, nodePos[1]);\r\n\t\t}\r\n\t\t//for(int i=0;i<visitd.size();i++) {\r\n\t\t\t//System.out.println(Arrays.toString(visitd.get(i)));\t\r\n\t\t//}\r\n\t\t\r\n\t\t//check if the neighbor is wall,if its not add to the list\r\n\t\tif(nodePos[1]>0 && !upper.isWall() && (!exists(visitd,new int[] {nodePos[0], nodePos[1] - 1}))) {\r\n\t\t\t//Node e=new Node(this , this.N , this.M , new int[] {nodePos[0], nodePos[1] - 1},curMap);\r\n\t\t\t//if(e.getVisited()!=true) {\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0], nodePos[1] - 1}, curMap)); // father of the new nodes is this node\r\n\t\t\t//}\r\n\t\t}\r\n\t\tif(nodePos[1]<M-1 &&!down.isWall() && (!exists(visitd,new int[] {nodePos[0], nodePos[1] + 1}))){\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0], nodePos[1] + 1}, curMap));\r\n\t\t}\r\n\t\tif(nodePos[0]>0 && !left.isWall() && (!exists(visitd,new int[] {nodePos[0] - 1, nodePos[1]}))) {\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0] - 1, nodePos[1]}, curMap));\r\n\t\t}\r\n\t\tif(nodePos[0]<N-1 && !right.isWall() && (!exists(visitd,new int[] {nodePos[0] + 1, nodePos[1]}))) {\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0] + 1, nodePos[1]}, curMap));\r\n\t\t}\r\n\t\t//for(int i=0; i<NodeChildren.size();i++) {\r\n\t\t\t//System.out.println(\"Paidia sth find:\" + Arrays.toString(NodeChildren.get(i).getNodePos()));\r\n\t\t//}\r\n\t\t\t\t\t\t\r\n\t}", "NBLK(int[][] origMap) {\r\n\r\n\t\t\r\n\t\t// suppose it's a matrix for numberlink\r\n\t\tn_row = origMap.length;\r\n\t\tn_col = origMap[0].length;\r\n\t\tlength = n_row * n_col;\r\n\t\tadjaMatrix=new int[length][length];\r\n\t\tStartPoint=new HashMap<Integer, Node>();\r\n\t\tEndPoint=new HashMap<Integer, Node>();\r\n\t\tnowMap= new HashMap<Integer,LinkedList<Integer>>();\r\n\t\t\r\n\t\tpaths=new HashMap<Integer, Stack<Node>>();\r\n\t\tallNodes= new HashMap<Integer,Node>();\r\n\t\t\r\n\t\t\r\n\t\tlastPath=0;\r\n\t\t\r\n\t\tcount=0;\r\n\t\tfor (int i = 0; i < n_row; i++) {\r\n\t\t\tfor (int j = 0; j < n_col; j++) {\r\n\t\t\t\tif (origMap[i][j] > -1) {\r\n\t\t\t\t\t//we can use that point to represent a blocked point (i,j) as matrix[i][j]=-1\r\n\t\t\t\t\tint index = i * n_col + j;\r\n\t\t\t\t\tNode n = new Node(i, j, index, origMap[i][j]);\r\n\t\t\t\t\tallNodes.put(index, n);\r\n\t\t\t\t\tLinkedList<Integer> neibors = new LinkedList<Integer>();\r\n\r\n\t\t\t\t\tif (i > 0 && origMap[i-1][j] > -1) {\r\n\t\t\t\t\t\t//left\r\n\t\t\t\t\t\tadjaMatrix[index][(i - 1) * n_col + j] = 1;\r\n\t\t\t\t\t\tadjaMatrix[(i - 1) * n_col + j][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast((i - 1) * n_col + j);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (i < n_row - 1 && origMap[i+1][j] > -1) {\r\n\t\t\t\t\t\t//right\r\n\t\t\t\t\t\tadjaMatrix[index][(i + 1) * n_col + j] = 1;\r\n\t\t\t\t\t\tadjaMatrix[(i + 1) * n_col + j][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast((i + 1) * n_col + j);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (j > 0 && origMap[i][j-1] > -1) {\r\n\t\t\t\t\t\t//top\r\n\t\t\t\t\t\tadjaMatrix[index][i * n_col + j - 1] = 1;\r\n\t\t\t\t\t\tadjaMatrix[i * n_col + j - 1][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast(i * n_col + j - 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (j < n_col - 1 && origMap[i][j+1] > -1) {\r\n\t\t\t\t\t\t//bottom\r\n\t\t\t\t\t\tadjaMatrix[index][i * n_col + j + 1] = 1;\r\n\t\t\t\t\t\tadjaMatrix[i * n_col + j + 1][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast(i * n_col + j + 1);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnowMap.put(index, neibors);\r\n\t\t\t\t\tif (origMap[i][j] > 0) {\r\n\r\n\t\t\t\t\t\tif (!StartPoint.containsKey(origMap[i][j])) {\r\n\t\t\t\t\t\t\tStartPoint.put(origMap[i][j], n);\r\n\t\t\t\t\t\t\tStack<Node> tp = new Stack<Node>();\r\n\t\t\t\t\t\t\ttp.push(n);\r\n\t\t\t\t\t\t\tpaths.put(origMap[i][j], tp);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tEndPoint.put(origMap[i][j], n);\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\t\t\t}\r\n\t\t}\r\n\r\n\t}", "private final void constructGraph() {\n losScanner = new LineOfSightScannerDouble(graph);\n queue = new int[11];\n\n queueSize = 0;\n\n // STEP 1: Construct SVG (Strict Visibility Graph)\n \n // Initialise SVG Vertices\n xPositions = new int[11];\n yPositions = new int[11];\n nNodes = 0;\n addNodes();\n \n // Now xPositions and yPositions should be correctly initialised.\n // We then initialise the rest of the node data.\n originalSize = nNodes;\n maxSize = nNodes + 2;\n xPositions = Arrays.copyOf(xPositions, maxSize);\n yPositions = Arrays.copyOf(yPositions, maxSize);\n hasEdgeToGoal = new boolean[maxSize];\n nOutgoingEdgess = new int[maxSize];\n outgoingEdgess = new int[maxSize][];\n outgoingEdgeIndexess = new int[maxSize][];\n outgoingEdgeOppositeIndexess = new int[maxSize][];\n outgoingEdgeIsMarkeds = new boolean[maxSize][];\n for (int i=0;i<maxSize;++i) {\n nOutgoingEdgess[i] = 0;\n outgoingEdgess[i] = new int[11];\n outgoingEdgeIndexess[i] = new int[11];\n outgoingEdgeOppositeIndexess[i] = new int[11];\n outgoingEdgeIsMarkeds[i] = new boolean[11];\n }\n\n // Initialise SVG Edges + edgeWeights\n edgeWeights = new float[11];\n nEdges = 0;\n addAllEdges();\n\n \n // Now all the edges, indexes and weights should be correctly initialise.\n // Now we initialise the rest of the edge data.\n originalNEdges = nEdges;\n int maxPossibleNEdges = nEdges + nNodes*2;\n edgeWeights = Arrays.copyOf(edgeWeights, maxPossibleNEdges);\n edgeLevels = new int[maxPossibleNEdges];\n Arrays.fill(edgeLevels, LEVEL_W);\n isMarked = new boolean[maxPossibleNEdges];\n //Arrays.fill(isMarked, false); // default initialises to false anyway.\n \n \n // Reserve space in level w edge and marked edge arrays.\n nLevelWNeighbourss = new int[maxSize];\n levelWEdgeOutgoingIndexess = new int[maxSize][];\n nMarkedEdgess = new int[maxSize];\n outgoingMarkedEdgeIndexess = new int[maxSize][];\n for (int i=0;i<nNodes;++i) {\n levelWEdgeOutgoingIndexess[i] = new int[nOutgoingEdgess[i]];\n outgoingMarkedEdgeIndexess[i] = new int[nOutgoingEdgess[i]];\n }\n for (int i=nNodes;i<maxSize;++i) {\n levelWEdgeOutgoingIndexess[i] = new int[11];\n outgoingMarkedEdgeIndexess[i] = new int[11];\n }\n\n \n // STEP 2: Label edge levels in SVG.\n computeAllEdgeLevelsFast();\n addLevelWEdgesToLevelWEdgesArray();\n\n nSkipEdgess = new int[maxSize];\n outgoingSkipEdgess = new int[maxSize][];\n outgoingSkipEdgeNextNodess = new int[maxSize][];\n outgoingSkipEdgeNextNodeEdgeIndexess = new int[maxSize][];\n outgoingSkipEdgeWeightss = new float[maxSize][]; \n\n // STEP 3: Initialise the skip-edges & Group together Level-W edges using isMarkedIndex.\n setupSkipEdges();\n \n pruneParallelSkipEdges();\n }", "public void breadthFirstTraverse() {\n\t\t// track whether vertex was visited\n\t\tHashMap<Integer, Boolean> visited = buildVisited();\n\t\t// store neighbors\n\t\tQueue<Integer> queue = new LinkedList<Integer>();\n\n\t\t// arbitrarily add first element\n\t\tInteger current = (Integer) edges.keySet().toArray()[0];\n\t\tqueue.add(current);\n\n\t\twhile (queue.peek() != null) {\n\n\t\t\tcurrent = queue.remove();\n\t\t\tSystem.out.println(\"current: \" + current);\n\t\t\tvisited.put(current, true);\n\n\t\t\tfor (Integer neighbor: edges.get(current)) {\n\t\t\t\tif (!visited.get(neighbor)) {\n\t\t\t\t\tqueue.add(neighbor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tint[][] edges = {{0,1},{1,2},{1,3},{4,5}};\n\t\tGraph graph = createAdjacencyList(edges, true);\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) unDirected : \"+getNumberOfConnectedComponents(graph));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) Directed: \"+getNumberOfConnectedComponents(createAdjacencyList(edges, false)));\n\t\t\n\t\t//Shortest Distance & path\n\t\tint[][] edgesW = {{0,1,1},{1,2,4},{2,3,1},{0,3,3},{0,4,1},{4,3,1}};\n\t\tgraph = createAdjacencyList(edgesW, true);\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(graph, 0, 3));\n\t\t\n\t\t//Graph represented in Adjacency Matrix\n\t\tint[][] adjacencyMatrix = {{0,1,0,0,1,0},{1,0,1,1,0,0},{0,1,0,1,0,0},{0,1,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}};\n\t\t\n\t\t// Connected components or Friends circle\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Recursive: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Iterative: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(adjacencyMatrix, 0, 3));\n\t\t\n\t\t// Number of Islands\n\t\tint[][] islandGrid = {{1,1,0,1},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Recursive: \"+ getNumberOfIslands(islandGrid));\n\t\t// re-initialize\n\t\tint[][] islandGridIterative = {{1,1,0,0},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Iterative: \"+ getNumberOfIslandsIterative(islandGridIterative));\n\n\n\t}", "public static Set<ARGState> getOnePathToARGStateForSimpleProperty(ARGState source, ARGState destination) {\n Set<Integer> seenElements = new HashSet<Integer>();\n ARGState currentARGState = source;\n seenElements.add(source.getStateId());\n List<ARGState> path = new ArrayList<ARGState>();\n path.add(currentARGState);\n // Set<ARGState> result = new HashSet<ARGState>();\n while (currentARGState.getStateId() != destination.getStateId()) {\n boolean end = true;\n if (!currentARGState.getChildren().isEmpty()) {\n Iterator<ARGState> children = currentARGState.getChildren().iterator();\n ARGState childrenElement ;\n do {\n childrenElement = children.next();\n if (!seenElements.contains(childrenElement.getStateId())) {\n path.add(childrenElement);\n currentARGState=childrenElement;\n seenElements.add(childrenElement.getStateId());\n end = false;\n break;\n }\n } while(children.hasNext());\n if(end){\n path.remove(path.size()-1);\n if(path.size()!=0){\n currentARGState=path.get(path.size()-1);\n seenElements.add(currentARGState.getStateId());\n }\n else\n break;\n }\n\n }\n else{\n path.remove(path.size()-1);\n if(path.size()!=0){\n currentARGState=path.get(path.size()-1);\n seenElements.add(currentARGState.getStateId());\n }\n else\n break;\n }\n }\n if(currentARGState.getStateId() != destination.getStateId())\n return null;\n if(!destination.getChildren().contains(source))\n return null;\n System.out.println(\"path.size=\"+path.size());\n Iterator<ARGState> it=path.iterator();\n for(int i=0;i<path.size()-1;i++){\n ARGState pre=path.get(i);\n ARGState suc=path.get(i+1);\n CFAEdge edge=pre.getEdgeToChild(suc);\n if(edge.getRawStatement().equals(\"BLANKEDGE\")){\n pre.getChildren().remove(suc);\n suc.getParents().remove(pre);\n AbstractStates.extractLocation(pre).getLeavingEdge().remove(edge);\n AbstractStates.extractLocation(suc).getEnteringEdges().remove(edge);\n }\n }\n return new HashSet<ARGState>(path);\n }", "public static int largestIslandChain(Scanner sc) {\n int islands=sc.nextInt();\r\n boolean graph[][] = new boolean[islands][islands];\r\n\r\n //System.out.print(\"How many ziplines? \");\r\n int ziplines=sc.nextInt();\r\n\r\n for (int edge=0; edge<ziplines; edge++) {\r\n int from=sc.nextInt();\r\n int to=sc.nextInt();\r\n graph[from][to]=true;\r\n }\r\n\r\n\r\n /* Find the SCCs... */\r\n\r\n //Utility Data Structures\r\n Stack<Integer> stack = new Stack<Integer>(); \r\n\r\n\r\n //First DFS\r\n boolean[] visited01 = new boolean[islands];\r\n int exitTimeTicker=0;\r\n int[] exitTimes = new int[islands];\r\n int[] exitPoints = new int[islands];\r\n for (int island=0; island<islands; island++) {\r\n int source;\r\n if (!visited01[island])\r\n {\r\n visited01[island]=true;\r\n stack.push(island);\r\n source=island;\r\n\r\n int destination=0;\r\n while (!stack.isEmpty())\r\n {\r\n source=stack.peek();\r\n destination=0;\r\n while (destination<islands)\r\n {\r\n if (graph[source][destination] && !visited01[destination])\r\n {\r\n stack.push(destination);\r\n visited01[destination]=true;\r\n source=destination;\r\n destination=0;\r\n }\r\n else {\r\n destination++;\r\n }\r\n }\r\n exitTimes[stack.peek()]=exitTimeTicker;\r\n exitPoints[exitTimeTicker]=stack.peek();\r\n stack.pop();\r\n exitTimeTicker++;\r\n }\r\n }\r\n }\r\n\r\n\r\n boolean graphTransposeUsingExits[][] = new boolean[islands][islands];\r\n for (int i=0; i<islands; i++)\r\n {\r\n for (int j=0; j<islands; j++)\r\n {\r\n if (graph[i][j])\r\n graphTransposeUsingExits[exitTimes[j]][exitTimes[i]]=true;\r\n }\r\n }\r\n\r\n\r\n //Second DFS\r\n boolean[] visited02 = new boolean[islands];\r\n int[] numberOfSCC = new int[islands];\r\n int currSCCnum=0;\r\n for (int exitTime=islands-1; exitTime>=0; exitTime--)\r\n {\r\n if (!visited02[exitTime])\r\n {\r\n //entryPointToScc=exitTime;\r\n visited02[exitTime]=true;\r\n numberOfSCC[exitPoints[exitTime]]=++currSCCnum;\r\n stack.push(exitTime);\r\n int source=exitTime;\r\n while (!stack.isEmpty())\r\n {\r\n source=stack.peek();\r\n int destination=0;\r\n while (destination<islands)\r\n {\r\n if (graphTransposeUsingExits[source][destination] && !visited02[destination])\r\n {\r\n if (numberOfSCC[exitPoints[destination]]==0) {\r\n numberOfSCC[exitPoints[destination]]=currSCCnum;\r\n }\r\n stack.push(destination);\r\n visited02[destination]=true;\r\n source=destination;\r\n destination=0;\r\n }\r\n else {\r\n destination++;\r\n } \r\n }\r\n stack.pop();\r\n } \r\n }\r\n }\r\n\r\n\r\n int[] sizeOfSCCs = new int[currSCCnum];\r\n for (int i=0; i<islands; i++) {\r\n sizeOfSCCs[numberOfSCC[i]-1]++;\r\n }\r\n \r\n int sccsMax = Integer.MIN_VALUE;\r\n for(int i=0; i<sizeOfSCCs.length; ++i) {\r\n \tif(sizeOfSCCs[i] > sccsMax) {\r\n \t\tsccsMax = sizeOfSCCs[i];\r\n \t}\r\n }\r\n return sccsMax;\r\n \r\n // Java 8\r\n //return Arrays.stream(sizeOfSCCs).summaryStatistics().getMax();\r\n }", "void calc_closure(){\r\n\t\tint [] queue = new int[maxn];\r\n\t\tint head,tail,i,j,k;\r\n\t\tfor (i=0; i<state; ++i){\r\n\t\t\tfor (j=0; j<state; ++j)\r\n\t\t\t\tclosure[i][j]=false;\r\n\t\t\t\r\n\t\t\t//Breadth First Search\r\n\t\t\thead=-1;\r\n\t\t\ttail=0;\r\n\t\t\tqueue[0]=i;\r\n\t\t\tclosure[i][i]=true;\r\n\t\t\twhile (head<tail){\r\n\t\t\t\tj=queue[++head];\r\n\t\t\t\t//search along epsilon edge\r\n\t\t\t\tfor (k=0; k<state; ++k)\r\n\t\t\t\t\tif ((!closure[i][k])&&(g[j][symbol][k]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tqueue[++tail]=k;\r\n\t\t\t\t\t\tclosure[i][k]=true;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void makeNeighboursOrientationConsistent(ScalarOperator sop,\n\t\t\tFlagMap flags) {\n\t\tStack<Object[]> upcoming = new Stack<Object[]>();\n\t\tTriangleElt3D current = this;\n\t\tdo {\n\t\t\t// set visited status\n\t\t\tflags.add(current);\n\n\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\tTriangleElt3D nb = current.getNeighbour(i);\n\t\t\t\tif (nb != null && (!flags.check(nb))) {\n\t\t\t\t\tupcoming.push(new Object[] { i, nb, current });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tObject[] nbObj = null;\n\t\t\ttry {\n\t\t\t\tnbObj = upcoming.pop();\n\t\t\t} catch (EmptyStackException ese) {\n\t\t\t\t// do nothing\n\t\t\t}\n\t\t\tint index = -1;\n\t\t\tTriangleElt3D nb = null;\n\t\t\tTriangleElt3D current2 = null;\n\t\t\tif (nbObj != null) {\n\t\t\t\tindex = (Integer) nbObj[0];\n\t\t\t\tnb = (TriangleElt3D) nbObj[1];\n\t\t\t\tcurrent2 = (TriangleElt3D) nbObj[2];\n\t\t\t}\n\n\t\t\tif ((nb != null) && (!flags.check(nb))) {\n\t\t\t\t// if not already visited\n\n\t\t\t\t// point indices of common edge (common edge has (in this)\n\t\t\t\t// direction p1->p2)\n\t\t\t\tint p1 = (index + 1) % 3;\n\t\t\t\tint p2 = (index + 2) % 3;\n\n\t\t\t\tint j = 0;\n\n\t\t\t\t// find nb's index j for opposite point of common edge\n\t\t\t\tfor (j = 0; j < 3; j++)\n\t\t\t\t\tif (!(current2.getPoint(p1).isEqual(nb.getPoint(j), sop) || current2\n\t\t\t\t\t\t\t.getPoint(p2).isEqual(nb.getPoint(j), sop)))\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t// nb's index for first point of common edge\n\t\t\t\tj = (j + 1) % 3;\n\n\t\t\t\tif (current2.getPoint(p1).isEqual(nb.getPoint(j), sop))\n\t\t\t\t\tnb.invertOrientation();\n\n\t\t\t\t// orientNeighbours for nb\n\t\t\t}\n\t\t\tcurrent = nb;\n\n\t\t} while (upcoming.size() != 0 || current != null);\n\n\t}", "private List<BPPath> restoreState(FileProcess bkFile) {\n\t\tEnvironment env = new Environment();\n\t\tAbsoluteAddress location = getContinuosPoint(bkFile);\n\t\tgetEnvironment(env, bkFile);\t\t\n\t\tInstruction inst = Program.getProgram().getInstruction(location, env);\n\t\tList<BPPath> pathList = new ArrayList<BPPath>();\n\t\t// BPVertex startNode = null;\n\t\t// BPState curState = null;\n\t\t// BPPath path = null;\n\t\t// startNode = new BPVertex(location, inst);\n\t\t// startNode.setType(0);\n\t\t// cfg.insertVertex(startNode);\n\t\tBPState curState = new BPState(env, location, inst);\n\t\tBPPath path = new BPPath(curState, new PathList(), new Formulas());\n\t\tpath.setCurrentState(curState);\n\n\t\tBPCFG cfg = Program.getProgram().getBPCFG();\n\t\tBPVertex startNode = null;\n\t\tstartNode = new BPVertex(location, inst);\n\t\tstartNode.setType(0);\n\t\tcfg.removeVertex(0);\n\t\tcfg.insertVertex(startNode);\n\t\tpathList.add(path);\n\n\t\treturn pathList;\n\t}", "public static void main(String[] args) {\n Graph graph = new Graph(16);\n graph.addEdge(0,1);\n graph.addEdge(1,2);\n graph.addEdge(2,3);\n graph.addEdge(3,4);\n graph.addEdge(4,5);\n graph.addEdge(5,6);\n graph.addEdge(6,7);\n graph.addEdge(8,9);\n graph.addEdge(9,10);\n graph.addEdge(10,11);\n graph.addEdge(11,12);\n graph.addEdge(13,14);\n graph.addEdge(14,15);\n graph.addEdge(15,0);\n graph.addEdge(0,8);\n graph.addEdge(1,10);\n graph.addEdge(2,9);\n graph.addEdge(3,11);\n graph.addEdge(3,14);\n graph.addEdge(4,7);\n graph.addEdge(4,13);\n graph.addEdge(5,8);\n graph.addEdge(5,15);\n graph.printGraph();\n System.out.println(\"DFS Traversal\");\n graph.DFS(3);\n System.out.println();\n System.out.println(\"BFS Traversal\");\n graph.BFS(3);\n// System.out.println();\n// for (int i=0; i<graph.vertices; i++)\n// {\n// if(graph.visited[i]!=true)\n// {\n// graph.DFS(i);\n// }\n// }\n\n }", "@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }", "public void retrace(){\n\t\t//look at the sPath stack\n\t\tPoint temp = sPath.peek();\n\t\t// find neighbor with lowest score\n\t\tPoint lNeighbor = backtrack(temp);\n\t\t// coordinates of lNeighbor\n\t\tint x = (int) lNeighbor.getX();\n\t\tint y = (int) lNeighbor.getY();\n\t\t// score of neighbor\n\t\tint score = topology[x][y];\n\t\t// if there is no more neighbor then lNeighbor = temp\n\t\t// then we reach the Start then\n\t\twhile(score!=0){\n\t\t\t// push that neighbor on the stack\n\t\t\tsPath.push(lNeighbor);\n\t\t\t// update temp and lNeighbor\n\t\t\ttemp = sPath.peek();\n\t\t\tlNeighbor = backtrack(temp);\n\t\t\t// coordinates of lNeighbor\n\t\t\tx = (int) lNeighbor.getX();\n\t\t\ty = (int) lNeighbor.getY();\n\t\t\t// score of neighbor\n\t\t\tscore = topology[x][y];\n\t\t}\n\t\t// we have to do that until we see the start with score 0\n\t\t// the last lNeighbor is the S with score = 0, push it to the stack\n\t\tsPath.push(lNeighbor);\n\t\twhile(!sPath.isEmpty()){\n\t\t\tPoint track = sPath.pop();\n\t\t\tSystem.out.println(\"(\"+(int)track.getX()+\",\"+(int)track.getY()+\")\");\n\t\t}\n\t}", "private List<GeographicPoint> backTrack(HashMap<GeographicPoint, List<GeographicPoint>> prev, GeographicPoint goal) {\n\t\tList<GeographicPoint> ans = new ArrayList<GeographicPoint>();\n\t\tList<GeographicPoint> temp = prev.get(goal);\n\t\tif (temp.size() != 0) {\n\t\t\tans.add(goal);\n\t\t\twhile (temp.size() != 0) {\n//\t\t\t\tSystem.out.print(\"Neighbours: \");\n\t\t\t\t// lastNeighbour will be the neighbour node we visited right before moving to the current node\n\t\t\t\tGeographicPoint lastNeighbour = temp.get(temp.size() - 1);\n\t\t\t\tans.add(lastNeighbour);\n\t\t\t\ttemp = prev.get(lastNeighbour);\n\t\t\t}\n\t\t\tCollections.reverse(ans);\n\t\t}\n\t\tif (ans.isEmpty())\n\t\t\treturn null;\n\t\treturn ans;\n\t}", "public void solveGame3() {\n\t\tlosingStates = new HashSet<S>();\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tint[] uncontrollableCount = new int[game.getStates().size()+1];\n\t\tint[] uncontrollableLosingCount = new int[game.getStates().size()+1];\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> uncontrollableSuccesors;\n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\t uncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\n\t\t\t uncontrollableCount[indexCount] = uncontrollableSuccesors.size();\n\t\t\t uncontrollableLosingCount[indexCount] = 0;\n\t\t\t isUncontrollable[indexCount] = game.isUncontrollable(state);\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableLosingCount[i]++;\n\t\t\t\t\tif (uncontrollableLosingCount[i] == uncontrollableCount[i])\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public Vector<PuzzleState> aStarSearch() {\r\n System.out.println(\"Starting A*\");\r\n long startTime = (new Date()).getTime();\r\n Vector<PuzzleState> solution = new Vector<PuzzleState>();\r\n HashSet<PuzzleState> closedList = new HashSet<PuzzleState>();\r\n PriorityQueue<PuzzleState> openList = new PriorityQueue<PuzzleState>();\r\n \r\n PuzzleState searchState = state.copy();\r\n searchState.prevState = null;\r\n searchState.depth = 0;\r\n openList.add(searchState);\r\n\r\n while (!openList.isEmpty() && !isGoal(searchState)) {\r\n searchState = openList.poll();\r\n if (!closedList.contains(searchState)) {\r\n closedList.add(searchState);\r\n Vector<PuzzleState> nextStates = possibleNextStates(searchState);\r\n for (PuzzleState s : nextStates)\r\n s.depth = searchState.depth + 1;\r\n openList.addAll(nextStates);\r\n }\r\n }\r\n \r\n // If the goal has been reached, construct the solution\r\n if (isGoal(searchState)) {\r\n for (PuzzleState s = searchState; s.prevState != null; s = s.prevState) {\r\n solution.add(s);\r\n }\r\n Collections.reverse(solution);\r\n }\r\n \r\n long endTime = (new Date()).getTime();\r\n System.out.println(\"A* search ended after \" + (endTime - startTime) + \" ms\");\r\n //for (PuzzleState s : solution)\r\n // System.out.println(s);\r\n return solution;\r\n }", "public static String findPath(Maze maze) {\n \tint m = maze.getNumRows();\n \tint n = maze.getNumCols();\n\n \t//define a visited matrix\n \tboolean[][] visited = new boolean[m][n];\n \tsetvisited(false, visited);\n\n \t//define a direction matrix\n \tint[][] dir_mtr = new int[m][n];\n \tinit_dir(-1,dir_mtr);\n\n\n\n \t//define a stack\n \tStack<MazeLocation> s;\n \ts = new StackRefBased<MazeLocation>();\n\n \tMazeLocation entry = maze.getEntry();\n \tMazeLocation exit = maze.getExit();\n \t// System.out.println(entry.toString());\n \ts.push(entry);\n\n\t\tMazeLocation temp; \n\t\tString result = \"\"; \t\n\n\t\ttry{\n\t\t\tint x,y;\n\n\n\t\t\twhile(!s.isEmpty()){\n\n \t\ttemp = s.peek();\n \t\tx = temp.getRow();\n \t\ty = temp.getCol();\n \t\tdir_mtr[x][y]+=1;\n\n \t\tif(temp.toString().equals(exit.toString())){\n \t\t\tSystem.out.println(\"find the path\");\n \t\t\tbreak;\n\n \t\t}\n\n \t\tif(dir_mtr[x][y]==0){ \n \t\t\t//checking the up direction\n \t\t\tif(x-1>=0 && !maze.isWall(x-1,y) && !visited[x-1][y]){\n \t\t\t\tMazeLocation testnode = new MazeLocation(x-1,y,maze.isWall(x-1,y));\n \t\t\t\tvisited[x-1][y] = true;\n \t\t\t\ts.push(testnode);\n\n \t\t\t}\n\n \t\t}else if(dir_mtr[x][y]==1){\n \t\t\t//checking the left direction\n \t\t\tif(y-1>=0 && !maze.isWall(x,y-1) && !visited[x][y-1]){\n \t\t\t\tMazeLocation testnode = new MazeLocation(x,y-1,maze.isWall(x,y-1));\n \t\t\t\tvisited[x][y-1] = true;\n \t\t\t\ts.push(testnode);\n\n \t\t\t}\n\n \t\t}else if(dir_mtr[x][y]==2){\n \t\t\t//checking the down direction\n \t\t\tif(x+1<m && !maze.isWall(x+1,y) && !visited[x+1][y]){\n \t\t\t\tMazeLocation testnode = new MazeLocation(x+1,y,maze.isWall(x+1,y));\n \t\t\t\tvisited[x+1][y] = true;\n \t\t\t\ts.push(testnode);\n\n \t\t\t}\n \t\t\t\n \t\t}else if(dir_mtr[x][y]==3){\n \t\t\t//checking the right direction\n \t\t\tif(y+1<n && !maze.isWall(x,y+1) && !visited[x][y+1]){\n \t\t\t\tMazeLocation testnode = new MazeLocation(x,y+1,maze.isWall(x,y+1));\n \t\t\t\tvisited[x][y+1] = true;\n \t\t\t\ts.push(testnode);\n\n \t\t\t}\n \t\t\t\n \t\t}else{\n \t\t\tvisited[x][y] = false;\n \t\t\ts.pop();\n \t\t}\n\n\n\n \t\t\n \t}\n\n \t//reverse the stack\n \tStack<MazeLocation> reverse;\n \treverse = new StackRefBased<MazeLocation>();\n \twhile(!s.isEmpty()){\n\t\t\t reverse.push(s.pop()); \t//push the node to the reverse stack\n\t\t\t }\n\n\n \t//if the stack is not empty, then we find the path\n\t\tif(!reverse.isEmpty()){\n\t\t\tresult = reverse.toString();\n\n\t\t}\n\n \t\n \n\n\t\t}\n\t\tcatch (StackEmptyException see) {\n \n }\n\n\n \treturn result;\n\n\n }", "private void compute() {\n InputReader sc = null;\n try {\n sc = new InputReader(new FileInputStream(new File(\"./resources/worldtour\")));\n } catch (FileNotFoundException ex) {\n throw new IllegalArgumentException(ex);\n }\n\n //Build Graph\n Graph G = new Graph(sc);\n adj = new int[G.totalVertices + 1][G.totalVertices + 1];\n\n //Run BFS from each vertex and fill adjacency matrix\n for (int v = 1; v <= G.totalVertices; v++) {\n Bfs bfs = new Bfs(G, v, adj);\n }\n\n //printAdjMatrix();\n // Find the farthest 3 cities to each city\n City[][] threeFurthestTo = new City[G.totalVertices + 1][4];\n // Find the farthest 3 cities from each city\n City[][] threeFurthestFrom = new City[G.totalVertices + 1][4];\n\n for (int i = 1; i <= G.totalVertices; i++) {\n City[] source = new City[G.totalVertices + 1];\n int sourceIdx = 1;\n City[] dest = new City[G.totalVertices + 1];\n int destIdx = 1;\n for (int j = 1; j <= G.totalVertices; j++) {\n if (adj[j][i] > 0) {\n source[sourceIdx] = new City(j, adj[j][i]);\n sourceIdx++;\n }\n if (adj[i][j] > 0) {\n dest[destIdx] = new City(j, adj[i][j]);\n destIdx++;\n }\n }\n Arrays.sort(source, 1, sourceIdx);\n threeFurthestTo[i][1] = source[1];\n threeFurthestTo[i][2] = source[2];\n threeFurthestTo[i][3] = source[3];\n Arrays.sort(dest, 1, destIdx);\n threeFurthestFrom[i][1] = dest[1];\n threeFurthestFrom[i][2] = dest[2];\n threeFurthestFrom[i][3] = dest[3];\n }\n\n //printMax3To(threeFurthestTo);\n //printMax3From(threeFurthestFrom);\n //For every path a -> x -> y -> b find the largest path\n int max = 0;\n int[] result = new int[4];\n for (int x = 1; x <= G.totalVertices; x++) {\n for (int y = 1; y <= G.totalVertices; y++) {\n if (adj[x][y] > 0) {\n for (int a = 1; a < 4; a++) {\n City start = threeFurthestTo[x][a];\n if (start != null) {\n for (int b = 1; b < 4; b++) {\n City end = threeFurthestFrom[y][b];\n if (end != null) {\n int startCityId = start.cityId;\n int endCityId = end.cityId;\n if (isDistinctCity(startCityId, x, y, endCityId)) {\n int sum = adj[startCityId][x] + adj[x][y] + adj[y][endCityId];\n if (sum > max) {\n result[0] = startCityId;\n result[1] = x;\n result[2] = y;\n result[3] = endCityId;\n max = sum;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n for (int x : result) {\n System.out.print(x + \" \");\n }\n }", "public void bfs(Queue<Integer> queue, int visited[]) {\n if (queue.isEmpty()) {\n return;\n }\n\n int root = queue.poll();\n\n if (visited[root] == 1) {\n bfs(queue, visited);\n return;//alreadu into consideration\n }\n\n\n System.out.printf(\"Exploring of node %d has started\\n\", root);\n visited[root] = 1;\n\n\n for (int i = 0; i < adjMatrix[root].size(); i++) {\n if (visited[adjMatrix[root].get(i)] == 1 || visited[adjMatrix[root].get(i)] == 2) {\n continue;\n }\n queue.add(adjMatrix[root].get(i));\n }\n bfs(queue, visited);\n System.out.printf(\"Exploring of node %d has end\\n\", root);\n visited[root] = 2;\n }", "int BFS(int source,int sink) \n {\n\tint first=0, last=0; \n int[] queue=new int[V]; \n int[] mark = new int[V]; \n \n for (int i = 0; i < V; i++) {\n mark[i] = 0; // Mark all vertices as not visited \n minFlow[i] = 10000000;\n }\n\n queue[last++] = source; //enqueue source vertex\n mark[source] = 1; //mark source vertex as visited\n //BFS Loop\n while (first != last) { // While queue is not empty.\n int v = queue[first++];\n for (int u = 0; u < V; u++){\n if (mark[u] == 0 && resCap[v][u] > 0) {\n minFlow[u] = Math.min(minFlow[v],resCap[v][u]);\n parent[u] = v;\n mark[u] = 1;\n if (u == sink) //If we reach sink starting from source, then return 1\n return 1;\n queue[last++] = u;\n }\n }\n }\n return 0; //else return 0\n }", "static void dfs(int[][] G){\n\t\tStack<Integer> s = new Stack<Integer>();\n\t\tfor (int ver_start=0; ver_start<N; ver_start++){\n\t\t\tif (visited[ver_start]) continue;\n\t\t\ts.push(ver_start);\n\t\t\tvisited[ver_start] = true;\n\n\t\t\twhile(!s.isEmpty()){\n\t\t\t\tint vertex = s.pop();\n\t\t\t\tSystem.out.print((vertex+1) + \" \");\n\t\t\t\tfor (int i=0; i<N; i++){\n\t\t\t\t\tif (G[vertex][i] == 1 && !visited[i]){\n\t\t\t\t\t\t// find neigbor of current vertex and not visited\n\t\t\t\t\t\t// add into the stack\n\t\t\t\t\t\ts.push(i);\n\t\t\t\t\t\tvisited[i] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private static int breadthFirstSearch(Vertex start) throws Queue.UnderflowException, Queue.EmptyException {\n boolean visited[] = new boolean[48];\n //Keep a queue of vertecies and a queue of the depth of the verticies - they will be added to and poped from identically\n ListQueue<Vertex> queue = new ListQueue<Vertex>();\n ListQueue<Integer> numQueue = new ListQueue<Integer>();\n //Set the starting node as visited\n visited[start.index()] = true;\n queue.enqueue(start);\n numQueue.enqueue(new Integer(1));\n\n //Keep last\n int last = -1;\n //While the queue isnt empty\n while (!queue.isEmpty()) {\n //Pop off the top from both queues and mark as visited\n start = queue.dequeue();\n int current = numQueue.dequeue();\n visited[start.index] = true;\n //For all neigbors\n for (Vertex v : start.neighbors) {\n //If we havent visited it make sure to visit it\n if (visited[v.index()] == false) {\n //As we keep adding new nodes to visit keep track of the depth\n queue.enqueue(v);\n numQueue.enqueue(current + 1);\n }\n }\n //Keep track of the most recent depth before we pop it off (queue will be empty when we exit)\n last = current;\n }\n //Return the max of the depth\n return last;\n }", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public void mst() {\n int currentVertexIndex = 0;\r\n dfsStack.push(0);\r\n vertexList[0].wasVisited = true;\r\n// System.out.println(vertexList[dfsStack.peek()]);\r\n while (dfsStack.top != -1) {\r\n\r\n\r\n currentVertexIndex = this.getAdjUnvisitedVert(dfsStack.peek());\r\n if (currentVertexIndex != -1) {\r\n System.out.print(vertexList[dfsStack.peek()]);\r\n dfsStack.push(currentVertexIndex);\r\n vertexList[currentVertexIndex].wasVisited = true;\r\n System.out.print(vertexList[dfsStack.peek()]);\r\n System.out.print(\", \");\r\n\r\n\r\n } else {\r\n currentVertexIndex = dfsStack.pop();\r\n\r\n }\r\n }\r\n for (Vertex x : vertexList) {\r\n x.wasVisited = false;\r\n }\r\n }", "private String[][] pathFinder(int currentX, int currentY, Level level) {\n\t\tint[] dr = {-1,1,0,0};\n\t\tint[] dc = {0,0,1,-1};\n\t\tQueue<int[]> bfs = new LinkedList<int[]>();\n\t\tbfs.add(new int[] {currentX,currentY});\n\t\tboolean[][] passed = new boolean[level.getWidth()+2][level.getHeight()+2];\n\t\tfor (int x = 0; x < level.getHeight(); x++) {\n\t\t\tfor (int y = 0; y < level.getWidth(); y++) {\n\t\t\t\tpassed[y][x] = false;\n\t\t\t}\n\t\t} passed[currentX][currentY] = true;\n\t\tString[][] prev = new String[level.getWidth()][level.getHeight()];\n\t\tfor (int x = 0; x < level.getHeight(); x++) {\n\t\t\tfor (int y = 0; y < level.getWidth(); y++) {\n\t\t\t\tprev[y][x] = null;\n\t\t\t}\n\t\t}while (!bfs.isEmpty()) {\n\t\t\tint[] node = bfs.remove();\n\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\tint rr = node[0] + dr[i];\n\t\t\t\tint cc = node[1] + dc[i];\n\t\t\t\tif (level.getTiles()[rr][cc] instanceof Water && !passed[rr][cc]) {\n\t\t\t\t\tbfs.add(new int[] {rr,cc});\n\t\t\t\t\tpassed[rr][cc] = true;\n\t\t\t\t\tprev[rr][cc] = (Integer.toString(node[0]).concat(\",\").concat(Integer.toString(node[1])));\n\t\t\t\t}\n\t\t\t}\n\t\t} return prev;\n\t}", "@Test\n public void directedRouting() {\n EdgeIteratorState rightNorth, rightSouth, leftSouth, leftNorth;\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(3).set(speedEnc, 10, 10);\n rightNorth = graph.edge(4, 10).setDistance(1).set(speedEnc, 10, 10);\n rightSouth = graph.edge(10, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(2).set(speedEnc, 10, 10);\n graph.edge(6, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 7).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(7, 8).setDistance(9).set(speedEnc, 10, 10);\n leftSouth = graph.edge(8, 9).setDistance(1).set(speedEnc, 10, 10);\n leftNorth = graph.edge(9, 0).setDistance(1).set(speedEnc, 10, 10);\n\n // make paths fully deterministic by applying some turn costs at junction node 2\n setTurnCost(7, 2, 3, 1);\n setTurnCost(7, 2, 6, 3);\n setTurnCost(1, 2, 3, 5);\n setTurnCost(1, 2, 6, 7);\n setTurnCost(1, 2, 7, 9);\n\n final double unitEdgeWeight = 0.1;\n assertPath(calcPath(9, 9, leftNorth.getEdge(), leftSouth.getEdge()),\n 23 * unitEdgeWeight + 5, 23, (long) ((23 * unitEdgeWeight + 5) * 1000),\n nodes(9, 0, 1, 2, 3, 4, 10, 5, 6, 2, 7, 8, 9));\n assertPath(calcPath(9, 9, leftSouth.getEdge(), leftNorth.getEdge()),\n 14 * unitEdgeWeight, 14, (long) ((14 * unitEdgeWeight) * 1000),\n nodes(9, 8, 7, 2, 1, 0, 9));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightSouth.getEdge()),\n 15 * unitEdgeWeight + 3, 15, (long) ((15 * unitEdgeWeight + 3) * 1000),\n nodes(9, 8, 7, 2, 6, 5, 10));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightNorth.getEdge()),\n 16 * unitEdgeWeight + 1, 16, (long) ((16 * unitEdgeWeight + 1) * 1000),\n nodes(9, 8, 7, 2, 3, 4, 10));\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tStack<Integer> st = new Stack<Integer>();\n\t\tQueue<Integer> que = new LinkedList<Integer>();\n\t\tArrayList<Integer> path = new ArrayList<>();\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint v = sc.nextInt();\n\t\tint [][] arr= new int [n+1][n+1];\n\t\tboolean [] visit = new boolean[n+1];\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tarr[a][b] = 1;\n\t\t\tarr[b][a] = 1;\n\t\t}\n\t\tst.push(v);\n\t\twhile(!st.isEmpty()) {\n\t\t\tint temp = st.pop();\n\t\t\tif(visit[temp]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tpath.add(temp);\n\t\t\tvisit[temp] = true;\n\t\t\tfor(int i=n;i>0;i--) {\n\t\t\t\tif(arr[temp][i]==1 && !visit[i]) {\n\t\t\t\t\tst.push(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<path.size();i++) {\n\t\t\tSystem.out.print(path.get(i)+\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tArrays.fill(visit, false);\n\t\tpath = new ArrayList<>();\n\t\tque.add(v);\n\t\twhile(!que.isEmpty()) {\n\t\t\tint temp = que.poll();\n\t\t\tif(visit[temp]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tpath.add(temp);\n\t\t\tvisit[temp] = true;\n\t\t\tfor(int i=1;i<=n;i++) {\n\t\t\t\tif(arr[temp][i]==1 && !visit[i]) {\n\t\t\t\t\tque.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<path.size();i++) {\n\t\t\tSystem.out.print(path.get(i)+\" \");\n\t\t}\n\t}", "public ArrayList<Integer> path(int startVertex, int stopVertex) {\n// you supply the body of this method\n int start = startVertex;\n int stop = stopVertex;\n int previous;\n ArrayList<Integer> list = new ArrayList<>();\n HashMap<Integer, Integer> route = new HashMap<>();\n Stack<Integer> visited = new Stack<>();\n Stack<Integer> reverse = new Stack<>();\n int parent;\n if(!pathExists(startVertex,stopVertex)){\n return new ArrayList<Integer>();\n }\n else if(startVertex == stopVertex){\n list.add(startVertex);\n return list;\n }\n else{\n while(!neighbors(start).contains(stopVertex)){\n List neighbor = neighbors(start);\n for (Object a: neighbor) {\n if(!pathExists((int)a,stopVertex)){\n continue;\n }\n if(visited.contains(a)){\n continue;\n }\n else {\n route.put((int) a, start);\n visited.push(start);\n start = (int) a;\n break;\n }\n }\n }\n route.put(stopVertex,start);\n list.add(stopVertex);\n previous = route.get(stopVertex);\n list.add(previous);\n while(previous!=startVertex){\n int temp = route.get(previous);\n list.add(temp);\n previous = temp;\n }\n for(int i=0; i<list.size(); i++){\n reverse.push(list.get(i));\n }\n int i=0;\n while(!reverse.empty()){\n int temp = reverse.pop();\n list.set(i,temp);\n i++;\n }\n//list.add(startVertex);\n return list;\n }\n }", "public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint V = sc.nextInt();\n\t\tint E = sc.nextInt();\n\n\t\tList<Integer>[]adjList = new ArrayList[10010];\n\t\tList<Integer>[]reverseAdjList = new ArrayList[10010];\n\n\t\tList<List<Integer>>scc = new ArrayList<List<Integer>>();\n\t\tint visited[] = new int[10010];\n\n\t\tfor(int i = 1 ; i <= V ; i++){\n\t\t\tadjList[i] = new ArrayList<Integer>();\n\t\t\treverseAdjList[i] = new ArrayList<Integer>();\n\t\t}\n\n\t\tfor(int i = 1 ; i <= E ; i++){\n\n\t\t\tint start = sc.nextInt();\n\t\t\tint end = sc.nextInt();\n\t\t\tadjList[start].add(end);\n\t\t\treverseAdjList[end].add(start);\n\t\t}\n\n\n\t\t//선작업 DFS 스택에 담음.\n\t\tStack <Integer>stack = new Stack<Integer>();\n\t\tfor(int i = 1 ; i <= V ; i++){\n\t\t\tif(visited[i] == 0){\n\t\t\t\tdfs(i,visited,stack,adjList);\n\t\t\t}\n\t\t}\n\n\n\t\t//후작업 역 DFS\n\t\tvisited = new int[10010];\n\n\t\tint r = 0;\n\t\twhile(!stack.isEmpty()){\n\n\t\t\tint here = stack.peek();\n\t\t\tstack.pop();\n\t\t\tif(visited[here] == 1){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tscc.add(new ArrayList<Integer>());\n\t\t\t++r;\n\t\t\treverseDFS(here, r-1, visited, scc, reverseAdjList);\n\n\t\t}\n\n\t\tSystem.out.println(r);\n\t\tfor(int i = 0 ; i < r ; i++){\n\t\t\tList <Integer>temp = scc.get(i);\n\t\t\tCollections.sort(temp);\n\t\t}\n\n\t\tscc.sort(new Comparator<List<Integer>>() {\n\t\t\t@Override\n\t\t\tpublic int compare(List<Integer> o1, List<Integer> o2) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif(o1.get(0)< o2.get(0)){\n\t\t\t\t\treturn -1;\n\t\t\t\t}else if(o1.get(0) > o2.get(0)){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\n\t\t\tfor(List <Integer>list : scc){\n\t\t\t\tfor(int i = 0 ; i < list.size() ; i++){\n\t\t\t\t\tSystem.out.print(list.get(i) + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}\n\n\t}", "private static void backtrackHelper(TreeNode current, int targetSum, List<TreeNode> path, List<List<Integer>> allPaths){\n if(current.left == null && current.right == null){\n if(targetSum == current.val){\n List<Integer> tempResultList = new ArrayList<>();\n // for(TreeNode node: path){\n // tempResultList.add(node.val);\n // }\n tempResultList.addAll(path.stream().mapToInt(o -> o.val).boxed().collect(Collectors.toList()));\n tempResultList.add(current.val);\n\n allPaths.add(tempResultList); // avoid reference puzzle\n }\n return;\n }\n\n // loop-recursion (Here only 2 choices, so we donot need loop)\n if(current.left != null){\n path.add(current);\n backtrackHelper(current.left, targetSum - current.val, path, allPaths);\n path.remove(current);\n }\n\n if(current.right != null){\n path.add(current);\n backtrackHelper(current.right, targetSum - current.val, path, allPaths);\n path.remove(current);\n }\n }", "public 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 }", "public Solution(){\r\n\r\n this.path_solution =new ArrayList<AState>();\r\n this.sol_for_debbage =new ArrayList<MazeState>();\r\n }", "void Graph::BFS(int s)\n{\n bool *visited = new bool[V];\n for(int i = 0; i < V; i++)\n visited[i] = false;\n \n // Create a queue for BFS\n list<int> queue;\n \n // Mark the current node as visited and enqueue it\n visited[s] = true;\n queue.push_back(s);\n \n // 'i' will be used to get all adjacent vertices of a vertex\n list<int>::iterator i;\n \n while(!queue.empty())\n {\n // Dequeue a vertex from queue and print it\n s = queue.front();\n cout << s << \" \";\n queue.pop_front();\n \n // Get all adjacent vertices of the dequeued vertex s\n // If a adjacent has not been visited, then mark it visited\n // and enqueue it\n for(i = adj[s].begin(); i != adj[s].end(); ++i)\n {\n if(!visited[*i])\n {\n visited[*i] = true;\n queue.push_back(*i);\n }\n }\n }", "public ArrayList<Vertex> findPath() {\n \n //if we've already been through findPath, then just return it\n if (solutionCalculated) {\n return solution;\n }\n \n //instantiate path\n solution = new ArrayList<Vertex>();\n \n //create boolean array of visited nodes (default: false)\n boolean[] visited = new boolean[arrayOfVertices.length];\n \n //(for testing)\n NavigateMaze.drawMaze(getVertices());\n \n //call dfs\n dfs(visited, arrayOfVertices[0], \n arrayOfVertices[arrayOfVertices.length - 1]);\n \n //update solutionCalculated to true\n solutionCalculated = true;\n \n //return solution\n return solution;\n \n }", "private final void checkSccs(final ITool tool) throws IOException, InterruptedException, ExecutionException {\r\n\t\t// Initialize this.dg:\r\n\t\tthis.dg.makeNodePtrTbl();\r\n\t\t\r\n\t\t// Initialize nodeQueue with initial states. The initial states stored \r\n\t\t// separately in the DiskGraph are resolved to their pointer location\r\n\t\t// in the on-disk part of the DiskGraph.\r\n\t\t// The pointer location generally is obviously used to:\r\n\t\t// * Speed up disk lookups in the RandomAccessFile(s) backing up the DiskGraph\r\n\t\t// * Is replaced by the SCC link number the moment the node's successors\r\n\t\t// are explored during DFS search. At this point the ptr location isn't\r\n\t\t// needed anymore. The successors have been resolved.\r\n\t\t// \r\n\t\t// From each node in nodeQueue the SCC search is started down below,\r\n\t\t// which can subsequently add additional nodes into nodeQueue.\r\n\t\t// \r\n\t\t// Contrary to plain Tarjan, not all vertices are added to the\r\n\t\t// nodeQueue of unexplored states, but only the initial states. Since we\r\n\t\t// know that all non-initial states are reachable from the set of\r\n\t\t// initial states, this is sufficient to start with.\r\n\t\tfinal LongVec initNodes = this.dg.getInitNodes();\r\n\t\tfinal int numOfInits = initNodes.size();\r\n\t\t// Allocate space for all initial states, assuming the majority of\r\n\t\t// initial nodes will be done. Multiplied by 5 because of\r\n\t\t// <<long, int, long>> per \"record.\r\n\t\tfinal MemIntQueue nodeQueue = new MemIntQueue(liveCheck.getMetaDir(), \"root\", (numOfInits / 2) * 5);\r\n\t\tfor (int j = 0; j < numOfInits; j += 2) {\r\n\t\t\tfinal long state = initNodes.elementAt(j);\r\n\t\t\tfinal int tidx = (int) initNodes.elementAt(j + 1);\r\n\t\t\tfinal long ptr = this.dg.getLink(state, tidx);\r\n\t\t\t// Check if the node <<state, tidx>> s is done. A node s is undone\r\n\t\t\t// if it is an initial state which hasn't been explored yet. This is\r\n\t\t\t// the case if s has been added via LiveChecker#addInitState but not\r\n\t\t\t// yet via LiveChecker#addNextState. LiveChecker#addNextState fully\r\n\t\t\t// explores the given init state s because it has access to s'\r\n\t\t\t// successors.\r\n\t\t\tif (ptr >= 0) {\r\n\t\t\t\t// Make sure none of the init states has already been assigned a\r\n\t\t\t\t// link number. That would indicate a bug in makeNodePtrTbl\r\n\t\t\t\t// which is supposed to reset all link numbers to file ptrs.\r\n\t\t\t\tassert DiskGraph.isFilePointer(ptr);\r\n\t\t\t\tnodeQueue.enqueueLong(state);\r\n\t\t\t\tnodeQueue.enqueueInt(tidx);\r\n\t\t\t\tnodeQueue.enqueueLong(ptr);\r\n\t\t\t} else {\r\n\t\t\t\t// If this is the final check on the complete graph, no node is\r\n\t\t\t\t// allowed to be undone. If it's not the final check, ptr has to\r\n\t\t\t\t// be UNDONE (a non-UNDONE negative pointer is probably a bug).\r\n\t\t\t\t// isFinalCheck => ptr # UNDONE\r\n\t\t\t\tassert !isFinalCheck || ptr != TableauNodePtrTable.UNDONE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfinal int[] eaaction = this.pem.EAAction;\r\n\t\tfinal int slen = this.oos.getCheckState().length;\r\n\t\tfinal int alen = this.oos.getCheckAction().length;\r\n\t\t\r\n\t\t\r\n\t\t// Synchronize all LiveWorker instances to consistently read free\r\n\t\t// memory. This method is only called during initialization of SCC\r\n\t\t// search, thus synchronization should not cause significant thread\r\n\t\t// contention. We want a single LW to successfully allocate both\r\n\t\t// dfsStack *and* comStack.\r\n\t\tfinal IntStack dfsStack;\r\n\t\tfinal IntStack comStack;\r\n\t\tsynchronized (LiveWorker.class) {\r\n\t\t\t// Tarjan's stack\r\n\t\t\t// Append thread id to name for unique disk files during concurrent SCC search\r\n\t\t\tdfsStack = getStack(liveCheck.getMetaDir(), \"dfs\" + this.id);\r\n\t\t\t\r\n\t\t\t// comStack is only being added to during the deep first search. It is passed\r\n\t\t\t// to the checkComponent method while in DFS though. Note that the nodes pushed\r\n\t\t\t// onto comStack don't necessarily form a strongly connected component (see\r\n\t\t\t// comment above this.checkComponent(...) below for more details).\r\n\t\t\t//\r\n\t\t\t// See tlc2.tool.liveness.LiveWorker.DetailedFormatter.toString(MemIntStack)\r\n\t\t\t// which is useful during debugging.\r\n\t\t\tcomStack = getStack(liveCheck.getMetaDir(), \"com\" + this.id);\r\n\t\t}\r\n\r\n\t\t// Generate the SCCs and check if they contain a \"bad\" cycle.\r\n\t\twhile (nodeQueue.size() > 0) {\r\n\t\t\t// Pick one of the unexplored nodes as root and start searching the\r\n\t\t\t// reachable SCCs from it.\r\n\t\t\tfinal long state = nodeQueue.dequeueLong();\r\n\t\t\tfinal int tidx = nodeQueue.dequeueInt();\r\n\t\t\tfinal long loc = nodeQueue.dequeueLong();\r\n\r\n\t\t\t// Reset (remove all elements) the stack. Logically a new SCC search\r\n\t\t\t// is being started unrelated to the previous one.\r\n\t\t\tdfsStack.reset();\r\n\r\n\t\t\t// Push the first node onto the DFS stack which makes it the node\r\n\t\t\t// from which the depth-first-search is being started.\r\n\t\t\tdfsStack.pushLong(state);\r\n\t\t\tdfsStack.pushInt(tidx);\r\n\t\t\tdfsStack.pushLong(loc);\r\n\t\t\t// Push the smallest possible link number (confusingly called\r\n\t\t\t// MAX_PTR here but only because file pointers are < MAX_PTR) as the\r\n\t\t\t// first link number.\r\n\t\t\t// [0, MAX_PTR) for file pointers\r\n\t\t\t// [MAX_PTR, MAX_LINK] for links\r\n\t\t\tdfsStack.pushLong(DiskGraph.MAX_PTR);\r\n\t\t\tlong newLink = DiskGraph.MAX_PTR;\r\n\r\n\t\t\twhile (dfsStack.size() >= 7) {\r\n\t\t\t\tfinal long lowLink = dfsStack.popLong();\r\n\t\t\t\tfinal long curLoc = dfsStack.popLong();\r\n\t\t\t\tfinal int curTidx = dfsStack.popInt();\r\n\t\t\t\tfinal long curState = dfsStack.popLong();\r\n\t\t\t\t\r\n\t\t\t\t// At this point curLoc is still a file pointer (small MAX_PTR)\r\n\t\t\t\t// and not yet replaced by a link (MAX_PTR < curLoc < MAX_LINK).\r\n\t\t\t\tassert DiskGraph.isFilePointer(curLoc);\r\n\t\t\t\t\r\n\t\t\t\t// The current node is explored iff curLoc < 0. If it is indeed fully explored,\r\n\t\t\t\t// it means it has potentially found an SCC. Thus, check if this is the case\r\n\t\t\t\t// for the current GraphNode.\r\n\t\t\t\t// A node is fully explored if the nested loop over its\r\n\t\t\t\t// successors down below in the else branch has not revealed any\r\n\t\t\t\t// unexplored successors.\r\n\t\t\t\tif (curLoc == SCC_MARKER) {\r\n\t\t\t\t\t// Check if the current node's link is lowLink which\r\n\t\t\t\t\t// indicates that the nodes on comStack up to <<curState,\r\n\t\t\t\t\t// curTidx>> form an SCC.\r\n\t\t\t\t\t// If curLink # lowLink, continue by pop'ing the next node\r\n\t\t\t\t\t// from dfsStack. It can either be:\r\n\t\t\t\t\t// - unexplored in which case the else branch is taken and\r\n\t\t\t\t\t// DFS continues.\r\n\t\t\t\t\t// - be an intermediate node of the SCC and thus curLink #\r\n\t\t\t\t\t// lowLink for it too.\r\n\t\t\t\t\t// - can be the start of the SCC (curLink = lowLink).\r\n\t\t\t\t\tfinal long curLink = this.dg.getLink(curState, curTidx);\r\n\t\t\t\t\tassert curLink < AbstractDiskGraph.MAX_LINK;\r\n\t\t\t\t\tif (curLink == lowLink) {\r\n\t\t\t\t\t\t// The states on the comStack from \"top\" to <<curState,\r\n\t\t\t\t\t\t// curTidx>> form an SCC, thus check for \"bad\" cycle.\r\n\t\t\t\t\t\t//\r\n\t\t\t\t\t\t// The cycle does not necessarily include all states in\r\n\t\t\t\t\t\t// comStack. \"top\" might very well be curState in which\r\n\t\t\t\t\t\t// case only a single state is checked by\r\n\t\t\t\t\t\t// checkComponent.\r\n\t\t\t\t\t\t//\r\n\t\t\t\t\t\t// The aforementioned case happens regularly when the\r\n\t\t\t\t\t\t// behaviors to check don't have cycles at all (leaving\r\n\t\t\t\t\t\t// single node cycles aside for the moment). The DFS\r\n\t\t\t\t\t\t// followed each behavior from its initial state (see\r\n\t\t\t\t\t\t// nodeQueue) all the way to the behavior's end state at\r\n\t\t\t\t\t\t// which point DFS halts. Since DFS cannot continue\r\n\t\t\t\t\t\t// (there are no successors) it calls checkComponent now\r\n\t\t\t\t\t\t// with the current comStack and the end state as\r\n\t\t\t\t\t\t// <<curState, curTidx>> effectively checking the\r\n\t\t\t\t\t\t// topmost element of comStack. Unless this single state\r\n\t\t\t\t\t\t// violates any liveness properties, it gets removed\r\n\t\t\t\t\t\t// from comStack and DFS continues. Iff DFS still cannot\r\n\t\t\t\t\t\t// continue because the predecessor to endstate\r\n\t\t\t\t\t\t// (endstate - 1) has no more successors to explore\r\n\t\t\t\t\t\t// either, it again calls checkComponent for the single\r\n\t\t\t\t\t\t// element (endstate - 1). This goes on until either the\r\n\t\t\t\t\t\t// initial state is reached or an intermediate state has\r\n\t\t\t\t\t\t// unexplored successors with DFS.\r\n\t\t\t\t\t\tfinal boolean isOK = this.checkComponent(tool, curState, curTidx, comStack);\r\n\t\t\t\t\t\tif (!isOK) {\r\n\t\t\t\t\t\t\t// Found a \"bad\" cycle of one to comStack.size()\r\n\t\t\t\t\t\t\t// nodes, no point in searching for more SCCs as we\r\n\t\t\t\t\t\t\t// are only interested in one counter-example at a\r\n\t\t\t\t\t\t\t// time.\r\n\t\t\t\t\t\t\t// checkComponent will have printed the\r\n\t\t\t\t\t\t\t// counter-example by now.\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Replace previous lowLink (plowLink) with the minimum of\r\n\t\t\t\t\t// the current lowLink and plowLink on the stack.\r\n\t\t\t\t\tfinal long plowLink = dfsStack.popLong();\r\n\t\t\t\t\tdfsStack.pushLong(Math.min(plowLink, lowLink));\r\n\t\t\t\t\t\r\n\t\t\t\t// No SCC found yet\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Assign newLink to curState:\r\n\t\t\t\t\tfinal long link = this.dg.putLink(curState, curTidx, newLink);\r\n\t\t\t\t\t// link is -1 if newLink has been assigned to pair\r\n\t\t\t\t\t// <<curState, curTidx>>. If the pair had been assigned a\r\n\t\t\t\t\t// link before, the previous link in range [MAX_PTR,\r\n\t\t\t\t\t// MAX_LINK] is returned. If the link is not -1, it means\r\n\t\t\t\t\t// the node has been explored by this DFS search before.\r\n\t\t\t\t\tif (link == -1) {\r\n\t\t\t\t\t\t// Push curState back onto dfsStack, but make curState\r\n\t\t\t\t\t\t// explored:\r\n\t\t\t\t\t\tdfsStack.pushLong(lowLink);\r\n\t\t\t\t\t\tdfsStack.pushLong(curState);\r\n\t\t\t\t\t\tdfsStack.pushInt(curTidx);\r\n\t\t\t\t\t\t// Push a marker onto the stack that, if pop'ed as\r\n\t\t\t\t\t\t// curLoc above causes branching to enter the true case\r\n\t\t\t\t\t\t// of the if block.\r\n\t\t\t\t\t\tdfsStack.pushLong(SCC_MARKER);\r\n\r\n\t\t\t\t\t\t// Add the tuple <<curState, curTidx, curLoc>> to comStack:\r\n\t\t\t\t\t\tcomStack.pushLong(curLoc);\r\n\t\t\t\t\t\tcomStack.pushInt(curTidx);\r\n\t\t\t\t\t\tcomStack.pushLong(curState);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Look at all the successors of curState:\r\n\t\t\t\t\t\tfinal GraphNode gnode = this.dg.getNode(curState, curTidx, curLoc);\r\n\t\t\t\t\t\tfinal int succCnt = gnode.succSize();\r\n\t\t\t\t\t\tlong nextLowLink = newLink;\r\n\t\t\t\t\t\t// DFS moved on to a new node, thus increment the newLink\r\n\t\t\t\t\t\t// number by 1 for subsequent exploration.\r\n\t\t\t\t\t\tnewLink = newLink + 1;\r\n\t\t\t\t\t\tfor (int i = 0; i < succCnt; i++) {\r\n\t\t\t\t\t\t\tfinal long nextState = gnode.getStateFP(i);\r\n\t\t\t\t\t\t\tfinal int nextTidx = gnode.getTidx(i);\r\n\t\t\t\t\t\t\tfinal long nextLink = this.dg.getLink(nextState, nextTidx);\r\n\t\t\t\t\t\t\t// If <<nextState, nextTidx>> node's link is < 0 it\r\n\t\t\t\t\t\t\t// means the node isn't \"done\" yet (see\r\n\t\t\t\t\t\t\t// tlc2.tool.liveness.TableauNodePtrTable.UNDONE).\r\n\t\t\t\t\t\t\t// A successor node t of gnode is undone if it is:\r\n\t\t\t\t\t\t\t// - An initial state which hasn't been explored yet\r\n\t\t\t\t\t\t\t// - t has not been added to the liveness disk graph\r\n\t\t\t\t\t\t\t// itself (only as the successor (transition) of\r\n\t\t\t\t\t\t\t// gnode).\r\n\t\t\t\t\t\t\t//\r\n\t\t\t\t\t\t\t// If it is >= 0, it either is a:\r\n\t\t\t\t\t\t\t// - file pointer location\r\n\t\t\t\t\t\t\t// - a previously assigned link (>= MAX_PTR)\r\n\t\t\t\t\t\t\t//\r\n\t\t\t\t\t\t\t// Iff nextLink == MAX_PTR, it means that the\r\n\t\t\t\t\t\t\t// <<nextState, nextTidx>> successor node has been\r\n\t\t\t\t\t\t\t// processed by checkComponent. The checks below\r\n\t\t\t\t\t\t\t// will result in the successor node being skipped.\r\n\t\t\t\t\t\t\t//\r\n\t\t\t\t\t\t\t// It is possible that <<nextState, nextTidx>> =\r\n\t\t\t\t\t\t\t// <<curState, curTid>> due to self loops. This is\r\n\t\t\t\t\t\t\t// intended, as checkAction has to be evaluated for\r\n\t\t\t\t\t\t\t// self loops too.\r\n\t\t\t\t\t\t\tif (nextLink >= 0) {\r\n\t\t\t\t\t\t\t\t// Check if the arc/transition from <<curState,\r\n\t\t\t\t\t\t\t\t// curTidx>> to <<nextState, nextTidx>>\r\n\t\t\t\t\t\t\t\t// satisfies (\"P-satisfiable\" MP page 422ff)\r\n\t\t\t\t\t\t\t\t// its PEM's EAAction. If it does, 1/3 of the\r\n\t\t\t\t\t\t\t\t// conditions for P-satisfiability are\r\n\t\t\t\t\t\t\t\t// satisfied. Thus it makes sense to check the\r\n\t\t\t\t\t\t\t\t// other 2/3 in checkComponent (AEAction &\r\n\t\t\t\t\t\t\t\t// Fulfilling promises). If the EAAction does\r\n\t\t\t\t\t\t\t\t// not hold, there is no point in checking the\r\n\t\t\t\t\t\t\t\t// other 2/3. All must hold for\r\n\t\t\t\t\t\t\t\t// P-satisfiability.\r\n\t\t\t\t\t\t\t\t//\r\n\t\t\t\t\t\t\t\t// This check is related to the fairness spec.\r\n\t\t\t\t\t\t\t\t// Skip to check the other conjuncts of the PossibleErrorModel (PEM) if the\r\n\t\t\t\t\t\t\t\t// action check is false (thus does not satisfy the PEM).\r\n\t\t\t\t\t\t\t\tif (gnode.getCheckAction(slen, alen, i, eaaction)) {\r\n\t\t\t\t\t\t\t\t\t// If the node's nextLink still points to\r\n\t\t\t\t\t\t\t\t\t// disk, it means it has no link assigned\r\n\t\t\t\t\t\t\t\t\t// yet which is the case if this node gets\r\n\t\t\t\t\t\t\t\t\t// explored during DFS search the first\r\n\t\t\t\t\t\t\t\t\t// time. Since it is new, add it to dfsStack\r\n\t\t\t\t\t\t\t\t\t// to have it explored subsequently by DFS.\r\n\t\t\t\t\t\t\t\t\tif (DiskGraph.isFilePointer(nextLink)) {\r\n\t\t\t\t\t\t\t\t\t\tdfsStack.pushLong(nextState);\r\n\t\t\t\t\t\t\t\t\t\tdfsStack.pushInt(nextTidx);\r\n\t\t\t\t\t\t\t\t\t\tdfsStack.pushLong(nextLink); // nextLink is logically a ptr/loc here\r\n\t\t\t\t\t\t\t\t\t\t// One would expect a (logical) lowLink\r\n\t\t\t\t\t\t\t\t\t\t// being pushed (additionally to the\r\n\t\t\t\t\t\t\t\t\t\t// ptr/loc in previous line) onto the\r\n\t\t\t\t\t\t\t\t\t\t// stack here. However, it is pushed\r\n\t\t\t\t\t\t\t\t\t\t// down below after all successors are\r\n\t\t\t\t\t\t\t\t\t\t// on the stack and valid for the\r\n\t\t\t\t\t\t\t\t\t\t// topmost successor. For the other\r\n\t\t\t\t\t\t\t\t\t\t// successors below the topmost, a link\r\n\t\t\t\t\t\t\t\t\t\t// number will be assigned subsequently.\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t// The node has been processed\r\n\t\t\t\t\t\t\t\t\t\t// already, thus use the minimum of its link\r\n\t\t\t\t\t\t\t\t\t\t// (nextLink) and nextLowLink.\r\n\t\t\t\t\t\t\t\t\t\tnextLowLink = Math.min(nextLowLink, nextLink);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// The transition from <<curState, curTidx>>\r\n\t\t\t\t\t\t\t\t\t// to <<nextState, nextTidx>> is not\r\n\t\t\t\t\t\t\t\t\t// P-satisfiable and thus does not need to\r\n\t\t\t\t\t\t\t\t\t// be checkComponent'ed. However, since we\r\n\t\t\t\t\t\t\t\t\t// only added initial but no intermediate\r\n\t\t\t\t\t\t\t\t\t// states to nodeQueue above, we have to add\r\n\t\t\t\t\t\t\t\t\t// <<nextState, nextTidx>> to nodeQueue if\r\n\t\t\t\t\t\t\t\t\t// it's still unprocessed (indicated by its\r\n\t\t\t\t\t\t\t\t\t// on disk state). The current path\r\n\t\t\t\t\t\t\t\t\t// potentially might be the only one by\r\n\t\t\t\t\t\t\t\t\t// which DFS can reach it.\r\n\t\t\t\t\t\t\t\t\tif (DiskGraph.isFilePointer(nextLink)) {\r\n\t\t\t\t\t\t\t\t\tnodeQueue.enqueueLong(nextState);\r\n\t\t\t\t\t\t\t\t\tnodeQueue.enqueueInt(nextTidx);\r\n\t\t\t\t\t\t\t\t\tnodeQueue.enqueueLong(nextLink); // nextLink is logically a ptr/loc here\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// If this is the final check on the complete\r\n\t\t\t\t\t\t\t\t// graph, no node is allowed to be undone. If\r\n\t\t\t\t\t\t\t\t// it's not the final check, nextLink has to be\r\n\t\t\t\t\t\t\t\t// UNDONE (a non-UNDONE negative nextLink is\r\n\t\t\t\t\t\t\t\t// probably a bug).\r\n\t\t\t\t\t\t\t\t// isFinalCheck => nextLink # UNDONE\r\n\t\t\t\t\t\t\t\tassert !isFinalCheck || nextLink != TableauNodePtrTable.UNDONE;\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// Push the next lowLink onto stack on top of all\r\n\t\t\t\t\t\t// successors. It is assigned to the topmost \r\n\t\t\t\t\t\t// successor only though.\r\n\t\t\t\t\t\tdfsStack.pushLong(nextLowLink);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// link above wasn't \"-1\", thus it has to be a valid\r\n\t\t\t\t\t\t// link in the known interval.\r\n\t\t\t\t\t\tassert AbstractDiskGraph.MAX_PTR <= link && link <= AbstractDiskGraph.MAX_LINK; \r\n\t\t\t\t\t\t// Push the minimum of the two links onto the stack. If\r\n\t\t\t\t\t\t// link == DiskGraph.MAX_PTR lowLink will always be the\r\n\t\t\t\t\t\t// minimum (unless this graph has a gigantic amount of\r\n\t\t\t\t\t\t// SCCs exceeding (MAX_LINK - MAX_PTR).\r\n\t\t\t\t\t\tdfsStack.pushLong(Math.min(lowLink, link));\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// Make sure all nodes on comStack have been checkComponent()'ed\r\n\t\tassert comStack.size() == 0;\r\n\t}", "@Override\n\tpublic boolean findPath(PathfindingNode start, PathfindingNode end, ArrayList<PathfindingNode> path) \n\t{\n\t\tpath.clear();\n\t\t\n\t\t_visited.clear();\n\t\t_toVisit.clear();\n\t\t_parents.clear();\n\t\t_costsFromStart.clear();\n\t\t_totalCosts.clear();\n\n\t\t_costsFromStart.put(start, 0);\n\t\t_toVisit.add(start);\n\t\t_parents.put(start, null);\n\t\t\n\t\twhile (!_toVisit.isEmpty() && !_toVisit.contains(end))\n\t\t{\n\t\t\tPathfindingNode m = _toVisit.remove();\n\t\t\t\n\t\t\tint mCost = _costsFromStart.get(m);\n\t\t\t\n\t\t\tfor (int i = 0; i < m.getNeighbors().size(); ++i)\n\t\t\t{\n\t\t\t\tPathfindingNodeEdge n = m.getNeighbors().get(i);\n\t\t\t\tif (n.getNeighbor() != null && !_visited.contains(n.getNeighbor()))\n\t\t\t\t{\n\t\t\t\t\tint costFromSource = mCost + n.getCost();\n\t\t\t\t\tint totalCost = costFromSource + _estimator.estimate(n.getNeighbor(), end);\n\t\t\t\t\tif (!_toVisit.contains(n.getNeighbor()) || totalCost < _totalCosts.get(n.getNeighbor()))\n\t\t\t\t\t{\n\t\t\t\t\t\t_parents.put(n.getNeighbor(), m);\n\t\t\t\t\t\t_costsFromStart.put(n.getNeighbor(), costFromSource);\n\t\t\t\t\t\t_totalCosts.put(n.getNeighbor(), totalCost);\n\t\t\t\t\t\tif (_toVisit.contains(n.getNeighbor()))\n\t\t\t\t\t\t\t_toVisit.remove(n.getNeighbor());\n\t\t\t\t\t\t_toVisit.add(n.getNeighbor());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t_visited.add(m);\n\t\t}\n\t\t\n\t\tif (_toVisit.contains(end))\n\t\t{\n\t\t\t_reversePath.clear();\n\t\t\t\n\t\t\tPathfindingNode current = end;\n\t\t\twhile (current != null)\n\t\t\t{\n\t\t\t\t_reversePath.push(current);\n\t\t\t\tcurrent = _parents.get(current);\n\t\t\t}\n\t\t\t\n\t\t\twhile (!_reversePath.isEmpty())\n\t\t\t\tpath.add(_reversePath.pop());\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpath.add(start);\n\t\t\treturn false;\n\t\t}\n\t}", "public void BFS() {\r\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\r\n\r\n\t\t// Create a queue for BFS\r\n\t\tQueue<Vertex> queue = new LinkedList<Vertex>();\r\n\r\n\t\tBFS(this.vertices[3], visited, queue); // BFS starting with 40\r\n\r\n\t\t// Call the helper function to print BFS traversal\r\n\t\t// starting from all vertices one by one\r\n\t\tfor (int i = 0; i < N; ++i)\r\n\t\t\tif (!visited.contains(this.vertices[i]))\r\n\t\t\t\tBFS(this.vertices[i], visited, queue);\r\n\t}", "int bfs(Vertex start, Vertex goal) {\n // Create queue for holding upcoming vertices to check.\n Queue<Vertex> queue = new LinkedList<>();\n // Create list of vertices that have been checked.\n ArrayList<Vertex> visited = new ArrayList<>(verticesAndTheirEdges.size());\n\n // Create map for storing distance from start to each vertex.\n // Defaults to -1 (since we want to return -1 if no path can be found)\n HashMap<Vertex, Integer> distance = new HashMap<>();\n for (Map.Entry<Vertex, LinkedList<Vertex>> vertex : verticesAndTheirEdges.entrySet()) {\n distance.put(vertex.getKey(), -1);\n }\n distance.put(start, 0);\n\n // Add start vertex to queue to initiate search,\n // then add it to the 'visited' list so that we don't check it again.\n queue.add(start);\n visited.add(start);\n while (!queue.isEmpty()) {\n // Take the first vertex from the queue.\n Vertex v = queue.remove();\n // Get all the vertexes edges.\n List<Vertex> neighbours = verticesAndTheirEdges.get(v);\n for (Vertex n : neighbours) {\n // If we haven't visited the neighboring vertex:\n if (n != null && !visited.contains(n)) {\n // Save the neighbors distance as the previous vertex distance +1.\n distance.put(n, distance.get(v) + 1);\n // Add the vertex to the queue of upcoming vertices to check.\n queue.add(n);\n // Mark vertex as visited.\n visited.add(n);\n }\n }\n }\n // Return the distance between start and goal vertices in the graph.\n return distance.get(goal);\n }", "public static void pathMethod (int x, int y, int rows, int columns, int startPointX, int startPointY, int endPointX, int endPointY, String [][]copyArray, String [][]realArray, int decider) throws Exception{ \r\n \r\n String up = copyArray[y-1][x];\r\n String down = copyArray[y+1][x];\r\n String right = copyArray[y][x+1]; //moves the coordinate up one, down one, right one, left one and stores it into up down left right; \r\n String left = copyArray[y][x-1];\r\n \r\n if(up.equals(\"X\")||down.equals(\"X\")||right.equals(\"X\")||left.equals(\"X\")){ //if up right left or down is equal to the endpoint, the maze is solvable, and we can now print the final array\r\n System.out.println(\"\\nThe maze is solvable!\");\r\n// printFinalArray(realArray, counter, xvalues, yvalues); //solution is found already - sends back to another method to print final solution\r\n regenerate(decider); //then sends to regenerate method where it asks if user would like to create another maze\r\n }\r\n \r\n else if(copyArray[startPointY+1][startPointX].equals(\"B\")&&copyArray[startPointY-1][startPointX].equals(\"B\")&&copyArray[startPointY][startPointX+1].equals(\"B\")&&copyArray[startPointY][startPointX-1].equals(\"B\")){\r\n \r\n System.out.println(\"\\nSorry, your maze is unsolvable.\\n\\n\"); //if at the start point we cannot go up down left or right - no possible moves - not solvable - end of maze \r\n regenerate(decider); //call the method that gives users the option to recreate the maze if it was unsolvable \r\n } \r\n \r\n else if(up.equals(\"O\")){ //if the coordinate in the up direction is O\r\n counter=counter+1; //incrementing counter so we can input it the coordinate arrays\r\n copyArray[y][x] = \"V\"; //changing the values to 'V' so we can know that we already visited it\r\n y=y-1; //moving coordinate up one \r\n xvalues[counter]=x; //storing this coordinate into the arrays with the counter\r\n yvalues[counter]=y;\r\n pathMethod(x, y, rows, columns, startPointX, startPointY, endPointX, endPointY, copyArray, realArray, decider); //recalling method\r\n }\r\n \r\n else if(down.equals(\"O\")){ //if down = O\r\n copyArray[y][x] = \"V\";\r\n counter=counter+1;\r\n y=y+1; \r\n xvalues[counter]=x;\r\n yvalues[counter]=y;\r\n pathMethod(x, y, rows, columns, startPointX, startPointY, endPointX, endPointY, copyArray, realArray, decider);\r\n }\r\n \r\n else if(right.equals(\"O\")){ //if right equals O\r\n copyArray[y][x] = \"V\";\r\n counter=counter+1;\r\n x=x+1;\r\n xvalues[counter]=x;\r\n yvalues[counter]=y;\r\n pathMethod(x, y, rows, columns, startPointX, startPointY, endPointX, endPointY, copyArray, realArray, decider);\r\n }\r\n \r\n else if(left.equals(\"O\")){ //if left equals O\r\n copyArray[y][x] = \"V\";\r\n counter=counter+1;\r\n x=x-1;\r\n xvalues[counter]=x;\r\n yvalues[counter]=y;\r\n pathMethod(x, y, rows, columns, startPointX, startPointY, endPointX, endPointY, copyArray, realArray, decider);\r\n }\r\n \r\n else { //if neither up down left or right work\r\n for(int i = 0; i<rows; i++){ //makes all the 'V's go back to O\r\n for(int j = 0; j<columns; j++){\r\n if(copyArray[i][j].equals(\"V\")){\r\n copyArray[i][j] = \"O\";\r\n }\r\n }\r\n }\r\n copyArray[y][x] = \"B\"; //make the coordinate that you cant make a move with B, so it shortens the possible path options\r\n for(int i = 0 ; i<counter; i++){\r\n xvalues[i] = 0; //resets the coordinate arrays back to 0\r\n yvalues[i] = 0;\r\n }\r\n counter=0; //resets counter back to 0;\r\n pathMethod(startPointX, startPointY, rows, columns, startPointX, startPointY, endPointX, endPointY, copyArray, realArray, decider); //resends the startpoints instead of x and y; only thing different is that one coordinate is now marked \"B\"\r\n } \r\n }", "public List<Integer> getNeighborStates(Grid theGrid) {\n ArrayList<Integer> neighborStates = new ArrayList();\n int[] neighborColIndexForMyRow = getNeighborColIndex();\n\n for (int i = 0; i < neighborColIndexForMyRow.length; i++) {\n if (theGrid.isValidIndex(myRow + neighborRowIndex[i], myCol + neighborColIndexForMyRow[i])) {\n neighborStates.add(\n theGrid.getCell((myRow + neighborRowIndex[i]), (myCol + neighborColIndexForMyRow[i]))\n .getCurrentState());\n } else if (toroidal) {\n int[] newIndexes = getTorodialIndex(theGrid, i);\n if (theGrid.isValidIndex(newIndexes[0], newIndexes[1])) {\n neighborStates.add(\n theGrid.getCell(newIndexes[0], newIndexes[1]).getCurrentState());\n }\n }\n\n }\n return neighborStates;\n }", "@SuppressWarnings(\"Duplicates\")\n public HashMap<Node, PathValue> findPath(Node startNode, Node endNode, boolean isHandicap, HashMap<String, Node> nodesList, HashMap<String, LinkedList<Edge>> adjacencyList) {\n int count = 0;\n\n HashMap<Node, PathValue> pathValues = new HashMap<>();\n pathValues.put(startNode, new PathValue(startNode));\n\n Stack<PathValue> stack = new Stack<>();\n stack.push(pathValues.get(startNode));\n\n while (!stack.isEmpty()) {\n PathValue currentPathValue = stack.pop();\n Node currentNode = currentPathValue.getNode();\n\n if (!currentPathValue.visited()) { // makes sure the current node has not be\n currentPathValue.setVisited(true);\n count++;\n\n //System.out.println(currentNode);\n\n if (currentNode.equals(endNode)) { //path has been found\n\n System.out.println(\"Number of nodes visited by dfs: \" + count);\n return pathValues;\n }\n\n //obtain the edges connected to the node\n LinkedList<Edge> adjacentEdges = adjacencyList.get(currentNode.getID());\n LinkedList<Node> adjacentNodes = new LinkedList<>();\n\n //add the nodes connected by the edges to the current node to adjacentNodes\n for (Edge e : adjacentEdges) {\n String nodeID = e.findOtherNode(currentNode.getID());\n adjacentNodes.add(nodesList.get(nodeID));\n }\n\n for (Node n : adjacentNodes) { //add the nodes to the priority queue, if necessary\n if (!pathValues.containsKey(n)) {\n pathValues.put(n, new PathValue(n, currentNode));\n }\n PathValue path = pathValues.get(n);\n //prevents any stairs from being searched for\n if(isHandicap &&\n currentNode.getNodeType().equals(\"STAI\") &&\n n.getNodeType().equals(\"STAI\") &&\n n != startNode &&\n n != endNode){\n path.setVisited(true);\n }\n if (!path.visited()) { //we do not need to add nodes that have already been visited\n stack.push(path);\n }\n }\n }\n }\n return null;\n }", "void DFS() {\n \t\n \t// Mark all the vertices as not visited(set as false by default in java) \n \tboolean visited[] = new boolean[V];\n \t\n \t// Call the recursive helper function to print DFS traversal \n // starting from all vertices one by one \n \tfor (int i=0; i<V; i++) { \n \t\t if (visited[i] == false)\n \t\t\t DFSUtil(i, visited);\n \t}\n }", "private Set<Integer> getStatesFromWichReachableAccepting(LabelledTransitionSystem ret) {\n\t\tMap<Integer, Set<Integer>> reversedReachable = this.computeInverseTransitionRelation(ret);\n\n\t\tSet<Integer> reachable = new HashSet<>();\n\n\t\tlogger.debug(\"Accepting states: \" + ret.getAccepting());\n\t\tSet<Integer> current = ret.getAccepting();\n\n\t\tboolean[] visited = new boolean[ret.getStates().length];\n\n\t\twhile (!current.isEmpty()) {\n\t\t\tInteger evaluated = current.iterator().next();\n\t\t\tcurrent.remove(evaluated);\n\t\t\tif (!visited[evaluated]) {\n\t\t\t\tvisited[evaluated] = true;\n\t\t\t\treachable.add(evaluated);\n\t\t\t\tSet<Integer> prev = new HashSet<>(reversedReachable.get(evaluated));\n\t\t\t\tcurrent.addAll(prev);\n\t\t\t}\n\t\t}\n\n\t\treturn reachable;\n\t}", "private LinkedStack<short []> getSwaps() {\n LinkedStack<short []> result = new LinkedStack<short []>();\n // scan 4 directions, add to result if not edge\n if (blank_r > 0) result.push(new short[] {(short) (blank_r - 1), blank_c}); // above\n if (blank_c < N - 1) result.push(new short[] {blank_r, (short) (blank_c + 1)}); // right\n if (blank_r < N - 1) result.push(new short[] {(short) (blank_r + 1), blank_c}); // below\n if (blank_c > 0) result.push(new short[] {blank_r, (short) (blank_c - 1)}); // left\n return result;\n }", "public int getState()\r\n {\r\n if(left.get() && middle.get() && right.get())\r\n lineStatus = STATE_ALL;\r\n else if(!left.get() && !middle.get() && !right.get())\r\n lineStatus = STATE_NONE;\r\n else if(left.get() && !middle.get() && right.get())\r\n lineStatus = STATE_SPLIT;\r\n else if(middle.get())\r\n lineStatus = STATE_MIDDLE;\r\n else if(left.get())\r\n lineStatus = STATE_LEFT;\r\n else if(right.get())\r\n lineStatus = STATE_RIGHT;\r\n \r\n return lineStatus;\r\n }", "public int smell() {\n\t\tsynchronized (this) {\n\t\t\tNode[][] AllHexNode = new Node[world.worldArray.length][world.worldArray[0].length];\n\t\t\tint HexAmount = 0;\n\t\t\tfor (int i = 0; i < world.worldArray.length; i++)\n\t\t\t\tfor (int j = 0; j < world.worldArray[0].length; j++) {\n\t\t\t\t\tif (world.isValidHex(i, j)) {\n\t\t\t\t\t\tAllHexNode[i][j] = new Node(i, j, Integer.MAX_VALUE, -1, -1);\n\t\t\t\t\t\tHexAmount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tPriorityQueue<Node> frontier = new PriorityQueue<Node>(HexAmount, new Node(c, r, 0, 0, 0));\n\t\t\t// Place the six hex around it first\n\t\t\tif (world.isValidHex(c, r + 1))\n\t\t\t\tif (world.worldArray[c][r + 1] instanceof EmptySpace || world.worldArray[c][r + 1] instanceof Food) {\n\t\t\t\t\tif (direction == 0) {\n\t\t\t\t\t\tAllHexNode[c][r + 1].setddd(0, 0, 0);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c][r + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 1) {\n\t\t\t\t\t\tAllHexNode[c][r + 1].setddd(1, 0, 5);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c][r + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 2) {\n\t\t\t\t\t\tAllHexNode[c][r + 1].setddd(2, 0, 4);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c][r + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 3) {\n\t\t\t\t\t\tAllHexNode[c][r + 1].setddd(3, 0, 3);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c][r + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 4) {\n\t\t\t\t\t\tAllHexNode[c][r + 1].setddd(2, 0, 2);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c][r + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 5) {\n\t\t\t\t\t\tAllHexNode[c][r + 1].setddd(1, 0, 1);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c][r + 1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (world.isValidHex(c + 1, r + 1))\n\t\t\t\tif (world.worldArray[c + 1][r + 1] instanceof EmptySpace\n\t\t\t\t\t\t|| world.worldArray[c + 1][r + 1] instanceof Food) {\n\t\t\t\t\tif (direction == 0) {\n\t\t\t\t\t\tAllHexNode[c + 1][r + 1].setddd(1, 1, 1);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c + 1][r + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 1) {\n\t\t\t\t\t\tAllHexNode[c + 1][r + 1].setddd(0, 1, 0);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c + 1][r + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 2) {\n\t\t\t\t\t\tAllHexNode[c + 1][r + 1].setddd(1, 1, 5);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c + 1][r + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 3) {\n\t\t\t\t\t\tAllHexNode[c + 1][r + 1].setddd(2, 1, 4);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c + 1][r + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 4) {\n\t\t\t\t\t\tAllHexNode[c + 1][r + 1].setddd(3, 1, 3);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c + 1][r + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 5) {\n\t\t\t\t\t\tAllHexNode[c + 1][r + 1].setddd(2, 1, 2);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c + 1][r + 1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (world.isValidHex(c + 1, r))\n\t\t\t\tif (world.worldArray[c + 1][r] instanceof EmptySpace || world.worldArray[c + 1][r] instanceof Food) {\n\t\t\t\t\tif (direction == 0) {\n\t\t\t\t\t\tAllHexNode[c + 1][r].setddd(2, 2, 2);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c + 1][r]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 1) {\n\t\t\t\t\t\tAllHexNode[c + 1][r].setddd(1, 2, 1);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c + 1][r]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 2) {\n\t\t\t\t\t\tAllHexNode[c + 1][r].setddd(0, 2, 0);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c + 1][r]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 3) {\n\t\t\t\t\t\tAllHexNode[c + 1][r].setddd(1, 2, 5);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c + 1][r]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 4) {\n\t\t\t\t\t\tAllHexNode[c + 1][r].setddd(2, 2, 4);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c + 1][r]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 5) {\n\t\t\t\t\t\tAllHexNode[c + 1][r].setddd(3, 2, 3);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c + 1][r]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (world.isValidHex(c, r - 1))\n\t\t\t\tif (world.worldArray[c][r - 1] instanceof EmptySpace || world.worldArray[c][r - 1] instanceof Food) {\n\t\t\t\t\tif (direction == 0) {\n\t\t\t\t\t\tAllHexNode[c][r - 1].setddd(3, 3, 3);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c][r - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 1) {\n\t\t\t\t\t\tAllHexNode[c][r - 1].setddd(2, 3, 2);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c][r - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 2) {\n\t\t\t\t\t\tAllHexNode[c][r - 1].setddd(1, 3, 1);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c][r - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 3) {\n\t\t\t\t\t\tAllHexNode[c][r - 1].setddd(0, 3, 0);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c][r - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 4) {\n\t\t\t\t\t\tAllHexNode[c][r - 1].setddd(1, 3, 5);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c][r - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 5) {\n\t\t\t\t\t\tAllHexNode[c][r - 1].setddd(2, 3, 4);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c][r - 1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (world.isValidHex(c - 1, r - 1))\n\t\t\t\tif (world.worldArray[c - 1][r - 1] instanceof EmptySpace\n\t\t\t\t\t\t|| world.worldArray[c - 1][r - 1] instanceof Food) {\n\t\t\t\t\tif (direction == 0) {\n\t\t\t\t\t\tAllHexNode[c - 1][r - 1].setddd(2, 4, 4);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c - 1][r - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 1) {\n\t\t\t\t\t\tAllHexNode[c - 1][r - 1].setddd(3, 4, 3);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c - 1][r - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 2) {\n\t\t\t\t\t\tAllHexNode[c - 1][r - 1].setddd(2, 4, 2);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c - 1][r - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 3) {\n\t\t\t\t\t\tAllHexNode[c - 1][r - 1].setddd(1, 4, 1);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c - 1][r - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 4) {\n\t\t\t\t\t\tAllHexNode[c - 1][r - 1].setddd(0, 4, 0);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c - 1][r - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 5) {\n\t\t\t\t\t\tAllHexNode[c - 1][r - 1].setddd(1, 4, 5);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c - 1][r - 1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (world.isValidHex(c - 1, r))\n\t\t\t\tif (world.worldArray[c - 1][r] instanceof EmptySpace || world.worldArray[c - 1][r] instanceof Food) {\n\t\t\t\t\tif (direction == 0) {\n\t\t\t\t\t\tAllHexNode[c - 1][r].setddd(1, 5, 5);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c - 1][r]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 1) {\n\t\t\t\t\t\tAllHexNode[c - 1][r].setddd(2, 5, 4);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c - 1][r]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 2) {\n\t\t\t\t\t\tAllHexNode[c - 1][r].setddd(3, 5, 3);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c - 1][r]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 3) {\n\t\t\t\t\t\tAllHexNode[c - 1][r].setddd(2, 5, 2);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c - 1][r]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 4) {\n\t\t\t\t\t\tAllHexNode[c - 1][r].setddd(1, 5, 1);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c - 1][r]);\n\t\t\t\t\t}\n\t\t\t\t\tif (direction == 5) {\n\t\t\t\t\t\tAllHexNode[c - 1][r].setddd(0, 5, 0);\n\t\t\t\t\t\tfrontier.add(AllHexNode[c - 1][r]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\twhile (!frontier.isEmpty()) {\n\t\t\t\tNode v = frontier.poll(); // extracts element with smallest\n\t\t\t\t\t\t\t\t\t\t\t// v.dist on the queue\n\t\t\t\tif (world.worldArray[v.col][v.row] instanceof Food) {\n\t\t\t\t\treturn v.distance * 1000 + v.directionResult;\n\t\t\t\t}\n\t\t\t\tif (world.isValidHex(v.col, v.row + 1))\n\t\t\t\t\tif (world.worldArray[v.col][v.row + 1] instanceof EmptySpace\n\t\t\t\t\t\t\t|| world.worldArray[v.col][v.row + 1] instanceof Food) {\n\t\t\t\t\t\tif (v.direction == 0)\n\t\t\t\t\t\t\tif (AllHexNode[v.col][v.row + 1].distance > v.distance + 1 && v.distance + 1 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col][v.row + 1].setddd(v.distance + 1, 0, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col][v.row + 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v.direction == 1)\n\t\t\t\t\t\t\tif (AllHexNode[v.col][v.row + 1].distance > v.distance + 2 && v.distance + 2 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col][v.row + 1].setddd(v.distance + 2, 0, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col][v.row + 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v.direction == 5)\n\t\t\t\t\t\t\tif (AllHexNode[v.col][v.row + 1].distance > v.distance + 2 && v.distance + 2 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col][v.row + 1].setddd(v.distance + 2, 0, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col][v.row + 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tif (world.isValidHex(v.col + 1, v.row + 1))\n\t\t\t\t\tif (world.worldArray[v.col + 1][v.row + 1] instanceof EmptySpace\n\t\t\t\t\t\t\t|| world.worldArray[v.col + 1][v.row + 1] instanceof Food) {\n\t\t\t\t\t\tif (v.direction == 0)\n\t\t\t\t\t\t\tif (AllHexNode[v.col + 1][v.row + 1].distance > v.distance + 2 && v.distance + 2 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col + 1][v.row + 1].setddd(v.distance + 2, 1, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col + 1][v.row + 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v.direction == 1)\n\t\t\t\t\t\t\tif (AllHexNode[v.col + 1][v.row + 1].distance > v.distance + 1 && v.distance + 1 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col + 1][v.row + 1].setddd(v.distance + 1, 1, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col + 1][v.row + 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v.direction == 2)\n\t\t\t\t\t\t\tif (AllHexNode[v.col + 1][v.row + 1].distance > v.distance + 2 && v.distance + 2 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col + 1][v.row + 1].setddd(v.distance + 2, 1, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col + 1][v.row + 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tif (world.isValidHex(v.col + 1, v.row))\n\t\t\t\t\tif (world.worldArray[v.col + 1][v.row] instanceof EmptySpace\n\t\t\t\t\t\t\t|| world.worldArray[v.col + 1][v.row] instanceof Food) {\n\t\t\t\t\t\tif (v.direction == 1)\n\t\t\t\t\t\t\tif (AllHexNode[v.col + 1][v.row].distance > v.distance + 2 && v.distance + 2 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col + 1][v.row].setddd(v.distance + 2, 2, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col + 1][v.row]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v.direction == 2)\n\t\t\t\t\t\t\tif (AllHexNode[v.col + 1][v.row].distance > v.distance + 1 && v.distance + 1 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col + 1][v.row].setddd(v.distance + 1, 2, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col + 1][v.row]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v.direction == 3)\n\t\t\t\t\t\t\tif (AllHexNode[v.col + 1][v.row].distance > v.distance + 2 && v.distance + 2 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col + 1][v.row].setddd(v.distance + 2, 2, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col + 1][v.row]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tif (world.isValidHex(v.col, v.row - 1))\n\t\t\t\t\tif (world.worldArray[v.col][v.row - 1] instanceof EmptySpace\n\t\t\t\t\t\t\t|| world.worldArray[v.col][v.row - 1] instanceof Food) {\n\t\t\t\t\t\tif (v.direction == 2)\n\t\t\t\t\t\t\tif (AllHexNode[v.col][v.row - 1].distance > v.distance + 2 && v.distance + 2 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col][v.row - 1].setddd(v.distance + 2, 3, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col][v.row - 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v.direction == 3)\n\t\t\t\t\t\t\tif (AllHexNode[v.col][v.row - 1].distance > v.distance + 1 && v.distance + 1 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col][v.row - 1].setddd(v.distance + 1, 3, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col][v.row - 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v.direction == 4)\n\t\t\t\t\t\t\tif (AllHexNode[v.col][v.row - 1].distance > v.distance + 2 && v.distance + 2 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col][v.row - 1].setddd(v.distance + 2, 3, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col][v.row - 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tif (world.isValidHex(v.col - 1, v.row - 1))\n\t\t\t\t\tif (world.worldArray[v.col - 1][v.row - 1] instanceof EmptySpace\n\t\t\t\t\t\t\t|| world.worldArray[v.col - 1][v.row - 1] instanceof Food) {\n\t\t\t\t\t\tif (v.direction == 3)\n\t\t\t\t\t\t\tif (AllHexNode[v.col - 1][v.row - 1].distance > v.distance + 2 && v.distance + 2 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col - 1][v.row - 1].setddd(v.distance + 2, 4, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col - 1][v.row - 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v.direction == 4)\n\t\t\t\t\t\t\tif (AllHexNode[v.col - 1][v.row - 1].distance > v.distance + 1 && v.distance + 1 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col - 1][v.row - 1].setddd(v.distance + 1, 4, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col - 1][v.row - 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v.direction == 5)\n\t\t\t\t\t\t\tif (AllHexNode[v.col - 1][v.row - 1].distance > v.distance + 2 && v.distance + 2 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col - 1][v.row - 1].setddd(v.distance + 2, 4, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col - 1][v.row - 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tif (world.isValidHex(v.col - 1, v.row))\n\t\t\t\t\tif (world.worldArray[v.col - 1][v.row] instanceof EmptySpace\n\t\t\t\t\t\t\t|| world.worldArray[v.col - 1][v.row] instanceof Food) {\n\t\t\t\t\t\tif (v.direction == 0)\n\t\t\t\t\t\t\tif (AllHexNode[v.col - 1][v.row].distance > v.distance + 2 && v.distance + 2 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col - 1][v.row].setddd(v.distance + 2, 5, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col - 1][v.row]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v.direction == 4)\n\t\t\t\t\t\t\tif (AllHexNode[v.col - 1][v.row].distance > v.distance + 2 && v.distance + 2 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col - 1][v.row].setddd(v.distance + 2, 5, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col - 1][v.row]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v.direction == 5)\n\t\t\t\t\t\t\tif (AllHexNode[v.col - 1][v.row].distance > v.distance + 1 && v.distance + 1 <= 10) {\n\t\t\t\t\t\t\t\tAllHexNode[v.col - 1][v.row].setddd(v.distance + 1, 5, v.directionResult);\n\t\t\t\t\t\t\t\tfrontier.add(AllHexNode[v.col - 1][v.row]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn 1000000;\n\t\t}\n\t}", "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 ArrayList<SearchNode> search(Problem p) {\n\tfrontier = new NodeQueue();\t// The frontier is a queue of expanded SearchNodes not processed yet\n\texplored = new HashSet<SearchNode>();\t/// The explored set is a set of nodes that have been processed \n\tGridPos startState = (GridPos) p.getInitialState();\t// The start state is given\n\tfrontier.addNodeToFront(new SearchNode(startState));\t// Initialize the frontier with the start state \n\n\t\n\tpath = new ArrayList<SearchNode>();\t// Path will be empty until we find the goal\n\t\t\n\n\n\twhile(!frontier.isEmpty()){\n\n\t SearchNode s = frontier.removeFirst(); \n\t GridPos g = s.getState(); \n\n\t if ( p.isGoalState(g) ) {\n\t\tpath = s.getPathFromRoot();\t\n\t\tbreak; \n\t }\n\t \n\t explored.add(s); \t \n\t ArrayList<GridPos> childStates = p.getReachableStatesFrom(g);\n\n\t while(!childStates.isEmpty()){\n\n\t\tSearchNode child = new SearchNode(childStates.get(0), s); \n\n\t\tif(!explored.contains(child) && !frontier.contains(child)){\n\n\t\t if ( p.isGoalState(child.getState()) ) {\n\t\t\n\t\t\tpath = child.getPathFromRoot();\t\n\t\t\treturn path; \n\t\t }\n\n\t\t if(insertFront) \n\t\t\tfrontier.addNodeToFront(child); \t\t \t\t\n\t\t else\t\n\t\t\tfrontier.addNodeToBack(child); \t \n\n\n\n\t\t}\n\n\t\tchildStates.remove(0);\n\t }\t \n\t}\n\n\n\treturn path;\n\n }", "private Node<K, V> balance() {\n if (this.isBlack()) {\n // PATTERN 1 & 2\n if (!this.getLeft().isEmpty()\n && !this.getLeft().isBlack()) {\n BinarySearchTree<K, V> l = this.getLeft();\n //////////////////////////////\n // PATTERN 1 : Left -> Left //\n //////////////////////////////\n if (!l.getLeft().isEmpty() \n && !l.getLeft().isBlack()) {\n return new Node<K, V>(l.getKey(), \n l.getValue(), \n this.c, // was l.c \n l.getLeft().makeBlack(),\n new Node<K, V>(this.key, \n this.value,\n this.c,\n l.getRight(),\n this.getRight(),\n true),\n false);\n }\n //////////////////////////////\n // PATTERN 2: Left -> Right //\n //////////////////////////////\n else if (!l.getRight().isEmpty() \n && !l.getRight().isBlack()) {\n BinarySearchTree<K, V> lr = l.getRight();\n \n return new Node<K, V>(lr.getKey(),\n lr.getValue(),\n this.c, // was lr.c\n new Node<K, V>(l.getKey(),\n l.getValue(),\n this.c, // was l.c\n l.getLeft(),\n lr.getLeft(),\n true),\n new Node<K, V>(this.key,\n this.value,\n this.c,\n lr.getRight(),\n this.getRight(),\n true),\n false);\n }\n }\n // PATTERN 3 & 4\n else if (!this.getRight().isEmpty()\n && !this.getRight().isBlack()) {\n BinarySearchTree<K, V> r = this.getRight();\n ///////////////////////////////\n // PATTERN 3: Right -> Right //\n ///////////////////////////////\n if (!r.getRight().isEmpty() \n && !r.getRight().isBlack()) {\n return new Node<K, V>(r.getKey(),\n r.getValue(),\n this.c, // was r.c\n new Node<K, V>(this.key,\n this.value,\n this.c,\n this.getLeft(),\n r.getLeft(),\n true),\n r.getRight().makeBlack(),\n false);\n }\n //////////////////////////////\n // PATTERN 4: Right -> Left //\n //////////////////////////////\n else if (!r.getLeft().isEmpty() \n && !r.getLeft().isBlack()) {\n BinarySearchTree<K, V> rl = r.getLeft();\n \n return new Node<K, V>(rl.getKey(),\n rl.getValue(),\n this.c, // was rl.c\n new Node<K, V>(this.key,\n this.value,\n this.c,\n this.getLeft(),\n rl.getLeft(),\n true),\n new Node<K, V>(r.getKey(),\n r.getValue(),\n this.c, // was r.c\n rl.getRight(),\n r.getRight(),\n true),\n false);\n }\n }\n }\n return this;\n }", "private static void BFS(int[][] adjacencyMatrix) {\n\t\tint n = adjacencyMatrix.length;\n\t\tboolean visited[] = new boolean[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tif(!visited[i]) {\n\t\t\tprintBFS(adjacencyMatrix,i,visited);\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t\n\t}", "static int[] getState(Node root){\n if(root==null)\n return new int[]{Integer.MAX_VALUE, Integer.MIN_VALUE,0,0};\n\n int[] leftAns = getState(root.left);\n int[] rightAns = getState(root.right);\n\n if(root.val<leftAns[1] || root.val> rightAns[0]){\n //failed\n return new int[]{Integer.MAX_VALUE, Integer.MIN_VALUE,-1, Math.max(leftAns[3], rightAns[3])};\n }\n else {//(root.val>leftAns[1] && root.val<rightAns[0]){\n\n return new int[] { Math.min(leftAns[0], root.val), Math.max(rightAns[1], root.val) , leftAns[2]+rightAns[2]+1, Math.max(leftAns[2]+rightAns[2]+1,\n Math.max(leftAns[3], rightAns[3])) };\n\n }\n\n\n }", "private boolean dfs(StateObservation so) {\n ArrayList<Types.ACTIONS> subActions = so.getAvailableActions();\n states.add(so);\n boolean way = false;\n\n for (int i = 0; i < subActions.size(); i++) {\n StateObservation stCopy = so.copy();\n stCopy.advance(subActions.get(i));\n if (success) {\n way = true;\n break;\n }\n\n if (stCopy.getGameWinner() == Types.WINNER.PLAYER_WINS) {\n actions.add(subActions.get(i));\n success = true;\n way = true;\n break;\n }\n else if (stCopy.getGameWinner() == Types.WINNER.PLAYER_LOSES) {\n continue;\n }\n\n int j;\n for (j = 0; j < states.size(); j++) {\n if (stCopy.equalPosition(states.get(j)))\n break;\n }\n if (j < states.size()) continue;\n\n actions.add(subActions.get(i));\n way = dfs(stCopy);\n if(!way) {\n actions.remove(actions.size() - 1);\n }\n else break;\n }\n\n if(!way) {\n states.remove(states.size() - 1);\n }\n return way;\n }", "@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }", "public static void main(String[] args) {\r\n \r\n Graph X=new Graph();\r\n \r\n X.GenerateGraph();\r\n \r\n \r\n X.DisplayGraph();\r\n // System.out.println(\"Printing Stack\");\r\n // X.DFS();\r\n \r\n // System.out.println(X.AdjList.get(3).neighbours);\r\n \r\n // ArrayList<Vertex> A=new ArrayList();\r\n \r\n X.BFS();\r\n \r\n X.TraceBack();\r\n }", "@Test\n public void blockArea() {\n EdgeIteratorState edge1 = graph.edge(0, 1).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(10).set(speedEnc, 10, 10);\n EdgeIteratorState edge2 = graph.edge(2, 3).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(0, 4).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(4, 5).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(6, 3).setDistance(100).set(speedEnc, 10, 10);\n\n // usually we would take the direct route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE), 3, 30, 3000, nodes(0, 1, 2, 3));\n\n // with forced edges we might have to go around\n assertPath(calcPath(0, 3, 3, ANY_EDGE), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, 6), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // with avoided edges we also have to take a longer route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge1)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge2)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // enforcing forbidden start/target edges still does not allow using them\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n\n // .. even when the nodes are just next to each other\n assertNotFound(calcPath(0, 1, edge1.getEdge(), ANY_EDGE, createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 1, ANY_EDGE, edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n }", "public void dfs (int start) {\n vertexList[start].wasVisited = true; // mark it\n print(start); stack.push(start);\n while (!stack.isEmpty()) {\n int b = getNextUnvisitedNeighbor(stack.peek());\n if (b==-1) stack.pop(); // no unvisited neighbor;\n else {\n vertexList[b].wasVisited = true;\n print(b); stack.push(b);\n }\n }\n // clear wasVisited marks\n }", "public boolean reducible() {\n if (dfsTree.back.isEmpty()) {\n return true;\n }\n int size = controlFlow.transitions.length;\n boolean[] loopEnters = dfsTree.loopEnters;\n TIntHashSet[] cycleIncomings = new TIntHashSet[size];\n // really this may be array, since dfs already ensures no duplicates\n TIntArrayList[] nonCycleIncomings = new TIntArrayList[size];\n int[] collapsedTo = new int[size];\n int[] queue = new int[size];\n int top;\n for (int i = 0; i < size; i++) {\n if (loopEnters[i]) {\n cycleIncomings[i] = new TIntHashSet();\n }\n nonCycleIncomings[i] = new TIntArrayList();\n collapsedTo[i] = i;\n }\n\n // from whom back connections\n for (Edge edge : dfsTree.back) {\n cycleIncomings[edge.to].add(edge.from);\n }\n // from whom ordinary connections\n for (Edge edge : dfsTree.nonBack) {\n nonCycleIncomings[edge.to].add(edge.from);\n }\n\n for (int w = size - 1; w >= 0 ; w--) {\n top = 0;\n // NB - it is modified later!\n TIntHashSet p = cycleIncomings[w];\n if (p == null) {\n continue;\n }\n TIntIterator iter = p.iterator();\n while (iter.hasNext()) {\n queue[top++] = iter.next();\n }\n\n while (top > 0) {\n int x = queue[--top];\n TIntArrayList incoming = nonCycleIncomings[x];\n for (int i = 0; i < incoming.size(); i++) {\n int y1 = collapsedTo[incoming.getQuick(i)];\n if (!dfsTree.isDescendant(y1, w)) {\n return false;\n }\n if (y1 != w && p.add(y1)) {\n queue[top++] = y1;\n }\n }\n }\n\n iter = p.iterator();\n while (iter.hasNext()) {\n collapsedTo[iter.next()] = w;\n }\n }\n\n return true;\n }", "public void findPaths(LinkedList<Node> path,Node caller){\n pathsToBaseStation.add(path);\n LinkedList<Node> nextPath = new LinkedList<>(path);\n nextPath.addFirst(this);\n for(Node node: neighbors){\n if(!path.contains(node)){\n node.findPaths(nextPath,this);\n }\n }\n }", "@Override\r\n public List<T> breadthFirstPath(T start, T end) {\r\n\r\n Vertex<T> startV = vertices.get(start);\r\n Vertex<T> endV = vertices.get(end);\r\n\r\n LinkedList<Vertex<T>> vertexList = new LinkedList<>();\r\n //Set<Vertex<T>> visited = new HashSet<>();\r\n ArrayList<Vertex<T>> visited = new ArrayList<>();\r\n\r\n LinkedList<Vertex<T>> pred = new LinkedList<>();\r\n int currIndex = 0;\r\n\r\n pred.add(null);\r\n\r\n vertexList.add(startV);\r\n visited.add(startV);\r\n\r\n LinkedList<T> path = new LinkedList<>();\r\n\r\n if (breadthFirstSearch(start, end) == false) {\r\n path = new LinkedList<>();\r\n return path;\r\n } else {\r\n while (vertexList.size() > 0) {\r\n Vertex<T> next = vertexList.poll();\r\n if(next == null){\r\n continue;\r\n }\r\n if (next == endV) {\r\n path.add(endV.getValue());\r\n break;\r\n }\r\n for (Vertex<T> neighbor : next.getNeighbors()) {\r\n if (!visited.contains(neighbor)) {\r\n pred.add(next);\r\n visited.add(neighbor);\r\n vertexList.add(neighbor);\r\n }\r\n }\r\n currIndex++;\r\n //path.add(next.getValue());\r\n\r\n }\r\n while (currIndex != 0) {\r\n Vertex<T> parent = pred.get(currIndex);\r\n path.add(parent.getValue());\r\n currIndex = visited.indexOf(parent);\r\n }\r\n }\r\n Collections.reverse(path);\r\n return path;\r\n }" ]
[ "0.6203519", "0.56833506", "0.5655961", "0.5615959", "0.555798", "0.54889995", "0.54880685", "0.5485794", "0.5483931", "0.54804593", "0.5433591", "0.54026353", "0.5385143", "0.53783584", "0.5365151", "0.5362995", "0.53472143", "0.5341669", "0.53340113", "0.5319409", "0.53155106", "0.53125733", "0.5309096", "0.53073716", "0.5306831", "0.5300335", "0.52960116", "0.52741283", "0.52602583", "0.525594", "0.5247729", "0.5243887", "0.5230049", "0.5219489", "0.5211691", "0.52006686", "0.51968604", "0.51951057", "0.51887494", "0.5175396", "0.51677483", "0.51669353", "0.51643485", "0.51640886", "0.5159058", "0.5155144", "0.5153256", "0.5152801", "0.5127319", "0.51245093", "0.5123306", "0.51183444", "0.51178634", "0.5117585", "0.5115933", "0.5115368", "0.5112138", "0.5108586", "0.5097073", "0.5088767", "0.5084816", "0.50806326", "0.5077639", "0.507553", "0.5073379", "0.5066281", "0.50661886", "0.5058039", "0.5054374", "0.5052841", "0.50517213", "0.5049567", "0.50426704", "0.5041637", "0.5032549", "0.50230944", "0.5018687", "0.5013057", "0.50114584", "0.5005671", "0.5002441", "0.4999877", "0.49998167", "0.49979353", "0.49925795", "0.49920142", "0.49902418", "0.4989033", "0.49864295", "0.4983465", "0.49756074", "0.49751616", "0.4970406", "0.49537146", "0.4952743", "0.49517265", "0.49462396", "0.49412927", "0.493733", "0.49331722", "0.49313122" ]
0.0
-1
Go to next coordinate in path.
public abstract void goNext();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void next() {\n\t\t// Next node\n\t\tnode = path.remove(0);\n\t\ttransition(NavigatorState.ROTATE_TO);\n\t}", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "private void selectNextPath(boolean inc) {\n\t\tif (this.allPathsList.size() < 1)\n\t\t\treturn;\n\t\tList<GraphPath<PathwayVertexRep, DefaultEdge>> paths = this.allPathsList.get(this.allPathsList.size() - 1)\n\t\t\t\t.getFirst();\n\t\tif (paths.size() > 1) {\n\t\t\t// System.out.println(\"allPaths.size() > 1\");\n\n\t\t\tif (inc)\n\t\t\t\tselectedPathID++;\n\t\t\telse\n\t\t\t\tselectedPathID--;\n\n\t\t\tif (selectedPathID < 0)\n\t\t\t\tselectedPathID = paths.size() - 1;\n\t\t\tif (selectedPathID > paths.size() - 1)\n\t\t\t\tselectedPathID = 0;\n\n\t\t\tif (allPaths.size() > 0) {\n\t\t\t\tselectedPath = paths.get(selectedPathID);\n\t\t\t\t// System.out.println(\"selectedPathID\"+selectedPathID);\n\t\t\t\tif (selectedPath.getEdgeList().size() > 0 && !isShiftKeyDown) {\n\t\t\t\t\tPathwayVertexRep startPrevVertex = selectedPath.getStartVertex();\n\t\t\t\t\tPathwayVertexRep endPrevVertex = selectedPath.getEndVertex();\n\t\t\t\t\tList<DefaultEdge> edgePrevList = selectedPath.getEdgeList();\n\t\t\t\t\tpreviousSelectedPath = new GraphPathImpl<PathwayVertexRep, DefaultEdge>(pathway, startPrevVertex,\n\t\t\t\t\t\t\tendPrevVertex, edgePrevList, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tselectedPathID = 0;\n\t\t}\n\n\t\t// System.out.println(\"selectedPathID=\"+selectedPathID);\n\t\tthis.allPathsList.get(this.allPathsList.size() - 1).setSecond(selectedPathID);\n\t\tisBubbleTextureDirty = true;\n\t\tsetDisplayListDirty();\n\t\ttriggerPathUpdate();\n\t}", "@Override\n public MFEDirection next()\n {\n if (!this.isPathValid()) {\n String msg = \"Annotated Path\" + this.getStart().getLocation() + \"->\" +\n this.getGoal().getLocation() + \": Cannot get next step \" +\n \"when path is invalid.\";\n logger.severe(msg);\n throw new IllegalStateException(msg);\n }\n final MFEDirection dir = this.path.poll();\n\n if (dir == null) {\n String msg = \"Annotated Path \" + this.getStart().getLocation() + \"->\" +\n this.getGoal().getLocation() + \": No more steps.\";\n logger.severe(msg);\n throw new NoSuchElementException(msg);\n }\n\n return dir;\n }", "@Override\n\tpublic WB_Point nextPoint();", "public abstract Position nextPosition(Position position);", "void moveNext()\n\t{\n\t\tif (cursor != null) \n\t\t{\n\t\t\tif (cursor == back) \n\t\t\t{\n\t\t\t\tcursor = null;\n index = -1; //added cause i was failing the test scripts and forgot to manage the indices \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcursor = cursor.next; //moves cursor toward back of the list\n index++; //added cause i was failing to the test scripts and forgot to manage the indicies\n\t\t\t}\n\t\t}\n\t}", "public boolean moveNext(\n )\n {\n // Scanning the current graphics object...\n ContentObject currentObject = getCurrent();\n if(currentObject != null)\n {\n \t\n \tString cmdStr = currentObject.toString();\n \t/*\n \tif(cmdStr.contains(\"f*\") || cmdStr.contains(\"{f }\")) {\n \t\tSystem.out.println(cmdStr);\n \t}\n \t*/\n \tif(!cmdStr.contains(\"{re [36, 270, 540, 720]}, {f }\")) {\n \t\tcurrentObject.scan(state);\n \t}\n }\n\n // Moving to the next object...\n if(index < objects.size())\n {index++; refresh();}\n\n return getCurrent() != null;\n }", "public void goToNext() {\r\n\t\tif (curr == null)\r\n\t\t\treturn;\r\n\t\tprev = curr;\r\n\t\tcurr = curr.link;\r\n\t}", "private void nextStep(){\n if(vMaze == null)\n mainMessage.setText(\"You must load a maze first!\");\n else try{\n vMaze.step();\n tileBox.getChildren().clear();\n tileBox.getChildren().add(vMaze.getTiles());\n\n mainMessage.setText(\"You took one step.\");\n if(vMaze.getRouteFinder().isFinished())\n mainMessage.setText(\"You reached the end!\");\n } catch (NoRouteFoundException e){\n mainMessage.setText(e.getMessage());\n }\n }", "public void jumpToNextLine() {\n int currentLineNo = getCurrentLineByCursor();\n if (currentLineNo == textBuffer.getMaxLine()-1) {\n textBuffer.setCurToTail();\n return;\n }\n int curX = round(cursor.getX());\n textBuffer.setCurToTargetNo(currentLineNo+1);\n lineJumpHelper(curX);\n }", "public void move() {\n if (this.nextMove.equals(\"a\")) { // move down\n this.row = row + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"b\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"b\")) { // move right\n this.col = col + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"c\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"c\")) { // move up\n this.row = row - 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"a\";\n progress = 0;\n }\n }\n }", "private Loc nextPoint(Loc l, String direction) {\n\t\tif (direction.equals(\"down\")) {\n\t\t\t// Is at bottom?\n\t\t\t// System.out.println(\"p.getx= \" + l.row);\n\t\t\tif (l.row >= matrixHeight - 1) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Loc(l.row + 1, l.col);\n\t\t} else if (direction.equals(\"left\")) {\n\t\t\tif (l.col <= 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Loc(l.row, l.col - 1);\n\t\t} else { // right\n\t\t\tif (l.col >= matrixWidth - 1) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Loc(l.row, l.col + 1);\n\t\t}\n\t}", "public void moveNext() {\n\t\tcurrentElement++;\n\t}", "public void move() {\n\n\tGrid<Actor> gr = getGrid();\n\tif (gr == null) {\n\n\t return;\n\t}\n\n\tLocation loc = getLocation();\n\tif (gr.isValid(next)) {\n\n\t setDirection(loc.getDirectionToward(next));\n\t moveTo(next);\n\n\t int counter = dirCounter.get(getDirection());\n\t dirCounter.put(getDirection(), ++counter);\n\n\t if (!crossLocation.isEmpty()) {\n\t\t\n\t\t//reset the node of previously occupied location\n\t\tArrayList<Location> lastNode = crossLocation.pop();\n\t\tlastNode.add(next);\n\t\tcrossLocation.push(lastNode);\t\n\t\t\n\t\t//push the node of current location\n\t\tArrayList<Location> currentNode = new ArrayList<Location>();\n\t\tcurrentNode.add(getLocation());\n\t\tcurrentNode.add(loc);\n\n\t\tcrossLocation.push(currentNode);\t\n\t }\n\n\t} else {\n\t removeSelfFromGrid();\n\t}\n\n\tFlower flower = new Flower(getColor());\n\tflower.putSelfInGrid(gr, loc);\n\t\n\tlast = loc;\n\t\t\n }", "void transitionToNextEdge(double residualMove) {\n\n\t\t// update the counter for where the index on the path is\n\t\tindexOnPath += pathDirection;\n\n\t\t// check to make sure the Agent has not reached the end of the path already\n\t\t// depends on where you're going!\n\t\tif ((pathDirection > 0 && indexOnPath >= path.size()) || (pathDirection < 0 && indexOnPath < 0)) {\n\t\t\treachedDestination = true;\n\t\t\tindexOnPath -= pathDirection; // make sure index is correct\n\t\t\treturn;\n\t\t}\n\n\t\t// move to the next edge in the path\n\t\tEdgeGraph edge = (EdgeGraph) path.get(indexOnPath).getEdge();\n\t\tsetupEdge(edge);\n\t\tspeed = progress(residualMove);\n\t\tcurrentIndex += speed;\n\n\t\t// check to see if the progress has taken the current index beyond its goal\n\t\t// given the direction of movement. If so, proceed to the next edge\n\t\tif (linkDirection == 1 && currentIndex > endIndex) transitionToNextEdge(currentIndex - endIndex);\n\t\telse if (linkDirection == -1 && currentIndex < startIndex) transitionToNextEdge(startIndex - currentIndex);\n\t}", "protected void nextDirection()\n {\n if (this.lastKeyDirection == Canvas.LEFT)\n {\n this.lastKeyDirection = keyDirection = Canvas.RIGHT;\n xTotalDistance = 0;\n //yTotalDistance = 0;\n }\n else if (this.lastKeyDirection == Canvas.RIGHT)\n {\n this.lastKeyDirection = keyDirection = Canvas.LEFT;\n xTotalDistance = 0;\n //yTotalDistance = 0;\n }\n }", "public void doNextMove(Player player) {\r\n int newX = xCoord;\r\n int newY = yCoord;\r\n switch (currentDirection) {\r\n case 1:\r\n newX = xCoord + 1;\r\n break;\r\n case 2:\r\n newY = yCoord + 1;\r\n break;\r\n case -1:\r\n newX = xCoord - 1;\r\n break;\r\n case -2:\r\n newY = yCoord - 1;\r\n break;\r\n }\r\n if (checkValidMove(newX, newY)) {\r\n // System.out.println(xCoord + \" \" + yCoord);\r\n // System.out.println(newX + \" \" + newY);\r\n moveTo(newX, newY);\r\n // System.out.println(xCoord + \" \" + yCoord);\r\n\r\n } else {\r\n turnAround();\r\n doNextMove(player);\r\n }\r\n }", "public void nextMove(Field field) {\n for (int i = 1; i <= 9; i++) {\n if (field.setMarker(i, marker)) {\n break;\n }\n }\n }", "public void next() {\n if (highlight.getMatchCount() > 0) {\n Point point = highlight.getNextMatch(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n return;\n }\n Point point = file.getNextModifiedPoint(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n }", "public void step() {\n\t\tint step = rand.nextInt(2);\n\t\t\n\t\tif (step==0) {\n\t\t\t\n\t\t\tPoint moveRight = new Point(++x,y);\n\t\t\t\n\t\t\tif(x<=size-1) {\n\t\t\t\tpath.add(moveRight);\n\t\t\t}\n\t\t\telse --x;\n\t\t}\n\t\telse { \n\t\t\tPoint topStep = new Point(x,--y);\n\t\t\t\n\t\t\tif(y>=0) {\n\t\t\t\tpath.add(topStep);\n\t\t\t}\n\t\t\telse ++y;\n\t\t}\n\t\tif (x==size-1 && y==0) {\n\t\t\tsetDone(true);\n\t\t}\n\t\t\n\t\t\n\t}", "private void moveNext(PositionTracker tracker) {\n\t\t \n\t\t //initiate if-else statement\n\t\t if(tracker.getExactColumn() == (tracker.getMaxColumns() - 1)) {\n\t\t\t \n\t\t\t //invoke the setExactRow method\n\t\t\t tracker.setExactRow(tracker.getExactRow() + 1);\n\t\t\t \n\t\t\t //invoke the setExactColumn method\n\t\t\t tracker.setExactColumn(0);\n\t\t\t \n\t\t }else {\n\t\t\t \n\t\t\t //invoke the setExactColumn method\n\t\t\t tracker.setExactColumn(tracker.getExactColumn() + 1);\n\t\t }//end if-else\n\t }", "public void advance( )\r\n {\r\n\t if(isCurrent() != true){// Implemented by student.\r\n\t throw new IllegalStateException(\"no current element\");\r\n\t }\r\n\t else\r\n\t \t precursor = cursor;\r\n\t \t cursor = cursor.getLink(); // Implemented by student.\r\n }", "public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\t\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (gr.isValid(next2)) {\n\t\t\tmoveTo(next2);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t}", "public void goToPointer() throws EndTaskException {\n\t\twhile (notNextToABeeper()) {\n\t\t\tmove();\n\t\t}\n\t}", "@Override\r\n\tpublic void nextStep() {\n\t\tif (this.oldX == this.coord.x && this.oldY == this.coord.y) { \r\n\t\t\tthis.currentPoint = (int) (Math.random()*this.patrol.size());\r\n\t\t\tthis.targetX = this.patrol.get(currentPoint).x;\r\n\t\t\tthis.targetY = this.patrol.get(currentPoint).y;\r\n\r\n\t\t}\r\n\r\n\t\t// target point reached, make new random target point\r\n\t\tif (this.targetX == this.coord.x && this.targetY == this.coord.y) {\r\n\t\t\tif (this.currentPoint < patrol.size() - 1)\r\n\t\t\t\tthis.currentPoint++;\r\n\t\t\telse\r\n\t\t\t\tthis.currentPoint = 0;\r\n\r\n\t\t\tthis.targetX = this.patrol.get(currentPoint).x;\r\n\t\t\tthis.targetY = this.patrol.get(currentPoint).y;\r\n\t\t}\r\n\t\tint step = (this.speed == Speed.fast ? 8 : 4);\r\n\t\t// int stepX = (int) (1 + Math.random() * step);\r\n\t\t// int stepY = (int) (1 + Math.random() * step);\r\n\t\tint x0 = (int) (this.coord.getX());\r\n\t\tint y0 = (int) (this.coord.getY());\r\n\r\n\t\tint dx = this.targetX - x0;\r\n\t\tint signX = Integer.signum(dx); // get the sign of the dx (1-, 0, or\r\n\t\t\t\t\t\t\t\t\t\t// +1)\r\n\t\tint dy = this.targetY - y0;\r\n\t\tint signY = Integer.signum(dy);\r\n\t\tthis.nextX = x0 + step * signX;\r\n\t\tthis.nextY = y0 + step * signY;\r\n\t\tthis.oldX = this.coord.x;\r\n\t\tthis.oldY = this.coord.y;\r\n\t\t// System.err.println(\"targetX,targetY \"+targetX+\" \"+targetY);\r\n\t}", "public void setNextLocation(Location loc) {\n\n\t\tthis.nextLoc = loc;\n\n\t}", "public void goToNext()\n {\n if (current != null)\n {\n previous = current;\n current = current.nLink;\n } // end if\n else if (head != null)\n {\n System.out.println(\"Iteration reached end of line.\");\n System.exit(0);\n } // else if\n else\n {\n System.out.println(\"You can't iterate an empty list.\");\n System.exit(0);\n }\n }", "public void gotoNext(){\r\n if(curr == null){\r\n return;\r\n }\r\n prev = curr;\r\n curr = curr.link;\r\n }", "@Override\n protected void moveToNextRow(){\n incrementRow();\n resetXPos();\n if(getRow()%2 == 1){\n incrementYPos(getHeight()+getHeight());\n }\n resetCol();\n setPointDirection();\n }", "public void nextTurn(){\n\t\tthis.setCurrentElement(this.getCurrentElement().getNext());\n\t}", "@Override\n public void handle(long now) {\n OneIteration();\n if (current.getRow() == ia && current.getCol() == ja) {\n drawPath();\n this.stop();\n }\n }", "public boolean advance(int tickID) {\n if (tickID == ltid) {\n return false;\n }\n \n Cell at = park.graph.getCell(intendedPath.get(index));\n \n int nextIndex = index + 1;\n if (nextIndex >= intendedPath.size()) {\n at.setPerson(null); /* exit the park */\n return true;\n }\n\n Cell tryGo = park.graph.getCell(intendedPath.get(nextIndex));\n if (tryGo.getPerson() != null) {\n return false;\n } else {\n tryGo.setPerson(this);\n at.setPerson(null);\n this.index = nextIndex;\n return true;\n }\n }", "public String getNextLocation() {\n return nextLocation;\n }", "public Location getNextLocation() {\n\n\t\treturn this.nextLoc;\n\n\t}", "public void setNextCell(Cell next)\r\n {\r\n this.next = next;\r\n }", "public void goNextLine () throws IOException {\n\t\treader.goNextLine();\n\t\tcurrentLine = reader.getCurrentLine();\n\t}", "public void moveTo(double x, double y)\n {\n\t_closedPath = false;\n\tPoint2D pos = transformedPoint(x,y);\n\t_startx = pos.getX();\n\t_starty = pos.getY();\n\t_currentx = pos.getX();\n\t_currenty = pos.getY();\n\t_currentPath.clear();\n }", "public void next() {\n Solver<ArrayList<Integer>> mySolver =\n new Solver<ArrayList<Integer>>();\n ArrayList<ArrayList<Integer>> Solution =\n mySolver.SolveBFS(this);\n\n //Reset 'tried' to none\n tried = new HashSet<ArrayList<Integer>>();\n\n //Set up the nextState\n ArrayList<Integer> nextState = new ArrayList<Integer>();\n\n if(Solution.size() == 0) {\n //No Solution\n } else if (Solution.size() == 1) {\n nextState = Solution.get(0);\n curBoard = nextState;\n } else {\n nextState = Solution.get(1);\n curBoard = nextState;\n moveCount++;\n }\n clearStack();\n\n\tsetChanged();\n\tnotifyObservers();\n }", "private void next() {\n Timeline currentTimeline = simpleExoPlayerView.getPlayer().getCurrentTimeline();\n if (currentTimeline.isEmpty()) {\n return;\n }\n int currentWindowIndex = simpleExoPlayerView.getPlayer().getCurrentWindowIndex();\n if (currentWindowIndex < currentTimeline.getWindowCount() - 1) {\n player.seekTo(currentWindowIndex + 1, C.TIME_UNSET);\n } else if (currentTimeline.getWindow(currentWindowIndex, new Timeline.Window(), false).isDynamic) {\n player.seekTo(currentWindowIndex, C.TIME_UNSET);\n }\n }", "public void walkToPoint(Point destination) {\n\n\t\tACTION attemptedMove;\n\n\t\tif (coordX != destination.x && coordY != destination.y) {\n\t\t\tSystem.out.println(\"X- \" + coordX + \" Y- \" + coordY);\n\t\t\tSystem.out.println(\"pX- \" + destination.x + \" pY- \" + destination.y);\n\t\t\tthrow new IllegalArgumentException(\"Illegal coordinate. Only move in one direction at a time\");\n\t\t}\n\t\tif (coordX < destination.x) {\n\t\t\tattemptedMove = ACTION.RIGHT;\n\t\t} else if (coordX > destination.x) {\n\t\t\tattemptedMove = ACTION.LEFT;\n\t\t} else if (coordY < destination.y) {\n\t\t\tattemptedMove = ACTION.DOWN;\n\t\t} else if (coordY > destination.y) {\n\t\t\tattemptedMove = ACTION.UP;\n\t\t} else {\n\t\t\treturn; //In case someone issues a move to nowhere\n\t\t}\n\t\tchangeFacing(attemptedMove);\n\t\taction = attemptedMove;\n\t\tpointWalking = true;\n\t\tendPoint = destination;\n\n\t\tif (validMoveEh(action)) {\n\t\t\tmoving = true;\n\t\t\tremainingSteps = STEP_SIZE;\n\t\t\tthis.updateCoordinate(action, true);\n\t\t\tcurrentImage = startAnimation(attemptedMove);\n\t\t}\n\t}", "public void doGoToLocation(Structure structure)\n\t{\n\t\tif(vehicle.currentLocation != null)\n\t\t{\n\t\t\tx = (int)vehicle.currentLocation.getParkingLocation().getX();\n\t\t\ty = (int)vehicle.currentLocation.getParkingLocation().getY();\n\t\t}\n\t\tdestination = structure;\n\t\tdestX = (int)destination.getParkingLocation().getX();\n\t\tdestY = (int)destination.getParkingLocation().getY();\n\t\tfired = false;\n\t\tpresent = true;\n\n\t\tcurrent = new Point(x/CityPanel.GRID_SIZE,y/CityPanel.GRID_SIZE);\n\t\tnext = current;\n\t\t\t\t\n\t\tfindPath();\n\t}", "Pos nextPos(Pos pos) {\n // Get my track from display\n return cd.nextPos(no, pos);\n }", "private Coordinate getPosition(double progressToNextStop) {\n List<PointInPath> coords = routes.get(currRouteIndex).getRoute();\n // get total route length\n double totalDistance = Math2D.getRouteLength(routes.get(currRouteIndex));\n\n if(progressTowardsNextStop > 0.99) {\n return coords.get(coords.size()-1).getCoordinate();\n } else {\n double distanceSum = 0;\n for (int i = 0; i < coords.size() - 1; i++) {\n Coordinate coord1 = coords.get(i).getCoordinate();\n Coordinate coord2 = coords.get(i + 1).getCoordinate();\n\n double pointsDistance = Math2D.getDistanceBetweenPoints(coord1, coord2);\n\n double progressToNextPoint = (distanceSum + pointsDistance) / totalDistance;\n if (progressToNextPoint > progressToNextStop) {\n double progressToLastPoint = (distanceSum / totalDistance);\n double progressFromLastPointToCurrPos = progressToNextStop - progressToLastPoint;\n double progressFromLastPointToNextPoint = progressToNextPoint - progressToLastPoint;\n double biasToCoord2 = progressFromLastPointToCurrPos / progressFromLastPointToNextPoint;\n return Coordinate.CreateCoordinate((int) (coord1.getX() * (1 - biasToCoord2) + coord2.getX() * (biasToCoord2)),\n (int) (coord1.getY() * (1 - biasToCoord2) + coord2.getY() * (biasToCoord2)));\n }\n\n distanceSum += pointsDistance;\n }\n }\n\n return null;\n }", "public void stepForward() {\n\t\tposition = forwardPosition();\n\t}", "public void nextLevelTogo() {\n if (this.myClearedLines % 2 == 0) {\n myLinesToGo = 2;\n } else {\n myLinesToGo = 1;\n }\n }", "public void middleJourney(String path){\n System.out.print(\"You walk towards your direction\");\n while(test) {\n if (three!=0){\n System.out.println(\"Now lets try this again\");\n System.out.println(\"F/L/B/R?\");\n three=0;\n }\n path = sc.nextLine();\n if(path.toLowerCase().equals(\"f\")){\n System.out.println(\"Straight it is\");\n laterJourney(path);\n break;\n }\n else if (path.toLowerCase().equals(\"l\")){\n System.out.println(\"Left, let's go\");\n laterJourney(path);\n break;\n }\n\n else if (path.toLowerCase().equals(\"b\")){\n System.out.println(\"Backwards the way\");\n three++;\n }\n else if (path.toLowerCase().equals(\"r\")){\n System.out.println(\"Right Right Right. Alrighty then\");\n laterJourney(path);\n break;\n }\n else{\n System.out.println(\"Come on now, choose from the list\");\n }\n }\n }", "private void findPath1(List<Coordinate> path) {\n\n // records the start coordinate in a specific sequence.\n ArrayList<Coordinate> starts = new ArrayList<>();\n // records the end coordinate in a specific sequence.\n ArrayList<Coordinate> ends = new ArrayList<>();\n // records the total cost of the path in a specific sequence.\n ArrayList<Integer> cost = new ArrayList<>();\n\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n Graph graph = new Graph(getEdge(map));\n graph.dijkstra(o1);\n graph.printPath(d1);\n starts.add(o1);\n ends.add(d1);\n cost.add(graph.getPathCost(d1));\n }\n }\n int index = getMinIndex(cost);\n\n Graph graph = new Graph(getEdge(map));\n graph.dijkstra(starts.get(index));\n graph.printPath(ends.get(index));\n for (Graph.Node node : graph.getPathReference()) {\n path.add(node.coordinate);\n }\n setSuccess(path);\n }", "private Location getNextLocation() {\n Location location = new Location(MockLocationEngine.class.getSimpleName());\n location.setLatitude(locations[currentIndex][0]);\n location.setLongitude(locations[currentIndex][1]);\n currentIndex = (currentIndex == locations.length - 1 ? 0 : currentIndex + 1);\n return location;\n }", "private void nextPosition()\n\t{\n\t\tdouble playerX = Game.player.getX();\n\t\tdouble playerY = Game.player.getY();\n\t\tdouble diffX = playerX - x;\n\t\tdouble diffY = playerY - y;\n\t\tif(Math.abs(diffX) < 64 && Math.abs(diffY) < 64)\n\t\t{\n\t\t\tclose = true;\n\t\t} \n\t\telse\n\t\t{\n\t\t\tclose = false;\n\t\t}\n\t\tif(close)\n\t\t{\n\t\t\tattackPlayer();\n\t\t} \n\t\telse if(alarm.done())\n\t\t{\n\t\t\tdirection = Math.abs(random.nextInt() % 360) + 1;\n\t\t\talarm.setTime(50);\n\t\t}\n\t\thspd = MathMethods.lengthDirX(speed, direction);\n\t\tvspd = MathMethods.lengthDirY(speed, direction);\n\t\tif(hspd > 0 && !flippedRight)\n\t\t{\n\t\t\tflippedRight = true;\n\t\t\tsetEnemy();\n\t\t} \n\t\telse if(hspd < 0 && flippedRight)\n\t\t{\n\t\t\tflippedRight = false;\n\t\t\tsetEnemy();\n\t\t}\n\t\tmove();\n\t\talarm.tick();\n\t\tshootTimer.tick();\n\t}", "@Override\n\tpublic void pathFinderVisited(int x, int y) {\n\t}", "static Point getNextPoint(Point cur)\n\t{\n\t\tint y = cur.y;\n\t\tint x = cur.x;\n\n\t\t// reached end of column, got to next row\n\t\tif (++x > 8)\n\t\t{\n\t\t\tx = 0;\n\t\t\t++y;\n\t\t}\n\t\t\n\t\tif (y < 9)\n\t\t\treturn new Point(y, x);\n\n\t\treturn null; // reached end of grid\n\t}", "public void compNextMove(){\r\n int flatNextMove;\r\n\r\n /* transfer the matrix to an array */\r\n Sign[] flatBoard = flattenBoard();\r\n\r\n /* choose best next move according to difficulty */\r\n flatNextMove = CompPlayer.nextMove(flatBoard,moves,playerSign,difficulty);\r\n\r\n /* set the sign in the correct place in the matrix */\r\n for (int i=0;i<3;i++)\r\n for (int j=0;j<3;j++){\r\n flatNextMove--;\r\n if (flatNextMove == 0)\r\n setSign(i,j,compSign);\r\n }\r\n }", "private Action doNextMove(Action move){\n\t\t// update east or north\n\t\tif (move == Action.East){\n\t\t\teast++;\n\t\t} else if (move == Action.West){\n\t\t\teast--;\n\t\t} else if (move == Action.North){\n\t\t\tnorth++;\n\t\t} else if (move == Action.South){\n\t\t\tnorth--;\n\t\t}\n\t\treturn move;\n\t}", "@Override\n public void advance() {\n if (isCurrent()) {\n prev = cursor;\n cursor = cursor.getNext();\n } else {\n throw new IllegalStateException(\"There is no current element.\");\n }\n }", "public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tif (gr.isValid(next)) {\n\t\t\tsetDirection(getLocation().getDirectionToward(next));\n\t\t\tmoveTo(next);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t\tFlower flower = new Flower(getColor());\n\t\tflower.putSelfInGrid(gr, loc);\n\t}", "public void DoGoToLine(int spot) {\n\t\tint col = spot % 10;\n\t\txDestination = 175 + (col * 25);\n\t\tyDestination = yEnterBus;\n\t\tcommand = Command.GetInLine;\n\t}", "@Override\n\tprotected Location nextMove(Game g) {\n\t\twhile (!clicked)\n\t\t\tdelay();\t\n\t\tclicked = false;\n\t\treturn clickedSquareLocation;\n\t}", "public void RotateStarpathToNextPos(){\n starpathPosition++;\n\n //if next pos is 6, reset back to 0\n if(starpathPosition == 6){\n StarpathToIntake();\n }\n //if next pos is 3, go to the shooter\n else if(starpathPosition == 3) StarPathToShooter();\n //else, add with the interval\n else if(starpathPosition < 3) StarpathAddIntervalIntake();\n else if(starpathPosition > 3) StarpathAddIntervalShooter();\n }", "public String nextStep();", "public void moveToOrigin() {\n for(Waypoint waypoint : path)\n waypoint.setCoordinates(waypoint.getX() - path.get(0).getX(),\n waypoint.getY() - path.get(0).getY());\n }", "public void advance() {\n if( mMatches.hasNext() ) {\n setCurrent( mMatches.next() );\n }\n }", "public void act() {\n\t\tboolean willMove = canMove();\n\t\tif (isEnd) {\n\t\t//to show step count when reach the goal\n\t\t\tif (!hasShown) {\n\t\t\t\tString msg = stepCount.toString() + \" steps\";\n\t\t\t\tJOptionPane.showMessageDialog(null, msg);\n\t\t\t\thasShown = true;\n\t\t\t}\n\t\t} else if (willMove) {\n\t\t\t//visit the next node\n\t\t\tisVisited[next.getRow()][next.getCol()] = true;\n\t\t\tmove();\n\t\t\tstepCount++;\n\t\t} else {\n\t\t\t// back to the cross location\n\t\t\tback();\n\t\t\tstepCount++;\n\t\t}\n\t}", "public boolean step() {\n Tile nextTile;\n Direction d;\n int directionCount = 0;\n try {\n if (finished == true) {\n return true;\n }\n if (route.empty()) {\n route.push(maze.getEntrance());\n return false;\n } else {\n while (true) {\n if (directionCount == 0) {\n d = Direction.NORTH;\n } else if (directionCount == 1) {\n d = Direction.EAST;\n } else if (directionCount == 2) {\n d = Direction.SOUTH;\n } else if (directionCount == 3) {\n d = Direction.WEST;\n } else {\n if (!popped.isEmpty()) {\n if (popped.peek().getType() == Type.ENTRANCE) {\n throw new NoRouteFoundException();\n }\n }\n popped.push(route.pop());\n break;\n }\n nextTile = maze.getAdjacentTile(route.peek(), d);\n if (nextTile.isNavigable() && !route.contains(nextTile) && !popped.contains(nextTile)) {\n route.push(maze.getAdjacentTile(route.peek(), d));\n break;\n } else {\n directionCount += 1;\n continue;\n }\n }\n\n if (!route.isEmpty()) {\n if (route.peek().getType() == Type.EXIT) {\n finished = true;\n return true;\n }\n }\n return false;\n\n }\n } catch (NoRouteFoundException e) {\n System.out.println(e);\n throw e;\n }\n }", "public void next(){\n\t\tboundIndex = (boundIndex+1)%buttonBounds.length;\n\t\tupdateButtonBounds();\n\t}", "@Override\n\tpublic void doTick(long time) {\n\n\t\tPoint2D.Float nextDest = getNextDestination();\n\t\tif(nextDest == null)\n\t\t\treturn;\n\t\tPoint endLocation = gMap.toGridLocation(nextDest);\n\t\tPoint plLoc = gMap.toGridLocation(thePlayer.getLocation());\n\n\t\tif (plLoc.equals(endLocation))\n\t\t\treturn; // We are done here o.o\n\n\t\tPathStep nextStep = null;\n\t\tif (path != null && !path.getLastStepLocation().equals(plLoc))\n\t\t\tnextStep = path.getNextStep(plLoc.x, plLoc.y);\n\t\tif (path == null || nextStep == null\n\t\t\t\t|| time - lastRecalculate > MINIMUM_RECALCULATE_DELAY\n\t\t\t\t&& !endLocation.equals(path.getLastStepLocation())) {\n\t\t\t\n\t\t\trevalueSteps();\n\t\t\tpath = ((AStarGameMap) gMap).findBestPath(plLoc.x, plLoc.y,\n\t\t\t\t\tendLocation.x, endLocation.y);\n\t\t\tif(path != null)\n\t\t\t\tnextStep = path.getNextStep(plLoc.x, plLoc.y);\n\t\t\t\n//\t\t\tSystem.out.println(\"Next step is \" + nextStep);\n\t\t\tlastRecalculate = time;\n\t\t\tindex++;\n\t\t}\n\t\t\n\t\tif (nextStep != null && !path.getLastStepLocation().equals(plLoc))\n\t\t\tmoveTowards(plLoc, nextStep);\n\t}", "public Point next() {\n\t\t\tif (x < size) {\n\t\t\t\treturn get(x++, y).clone();\n\t\t\t}\n\t\t\tx = 0;\n\t\t\treturn get(x++, ++y).clone();\n\n\t\t}", "public void move() {\n Grid<Actor> gr = getGrid();\n if (gr == null) {\n return;\n }\n Location loc = getLocation();\n if (gr.isValid(next)) {\n setDirection(getLocation().getDirectionToward(next));\n moveTo(next);\n } else {\n removeSelfFromGrid();\n }\n Flower flower = new Flower(getColor());\n flower.putSelfInGrid(gr, loc);\n }", "@Override\n public Point peekNextPosition() {\n int nextX = (current.x + 1) % 3;\n int nextY = (current.y + 1) % 3;\n// System.out.println(\"Next X: \" + nextX);\n// System.out.println(\"Next Y: \" + nextY);\n boolean wrapsInX = nextX < current.x;\n boolean wrapsInY = nextY < current.y;\n boolean singleWrap = wrapsInX != wrapsInY;\n if (singleWrap) {\n return invalidPosition();\n } else {\n return new Point(nextX, nextY);\n }\n }", "public void setNextLocation(String s) {\n if (s == null) nextLocation = \"\";\n else nextLocation = s;\n }", "java.lang.String getNextStep();", "private void getNext() {\n Node currNode = getScreenplayElem().getChildNodes().item(currPos++);\n while (currNode.getNodeType() != Node.ELEMENT_NODE) {\n currNode = getScreenplayElem().getChildNodes().item(currPos++);\n }\n currElem = (Element) currNode;\n }", "public void move() {\n\n if (_currentFloor == Floor.FIRST) {\n _directionOfTravel = DirectionOfTravel.UP;\n }\n if (_currentFloor == Floor.SEVENTH) {\n _directionOfTravel = DirectionOfTravel.DOWN;\n }\n\n\n if (_directionOfTravel == DirectionOfTravel.UP) {\n _currentFloor = _currentFloor.nextFloorUp();\n } else if (_directionOfTravel == DirectionOfTravel.DOWN) {\n _currentFloor = _currentFloor.nextFloorDown();\n }\n\n if(_currentFloor.hasDestinationRequests()){\n stop();\n } \n\n }", "private void driveToNextNode(){\n updateAngles();\n computeDriveMechanics();\n\n //Set Speeds and drive\n double[] speedValues = getSpeedValues();\n setRobotSpeed(speedValues[0], speedValues[1]);\n //long end2 = System.nanoTime();\n\n //Update Metrics\n this.nodeCount = currentTree.size();\n this.nodeExploredCount = bestTree.size();\n //this.nodeGenTime += end1 - start1;\n //this.nodeDriveTime += end2 - start2;\n\n System.out.println(\"currenenenen:: \"+ currentNode.getPosition());\n System.out.println(\"currenenenen:: \"+ nextNode.getPosition());\n\n this.cumulativeEuclidean += getDistanceBetween(\n currentNode.getPosition(), nextNode.getPosition());\n\n //updateMetrics();\n\n //set current node as next node\n currentNode = nextNode;\n\n this.cumulativeTurnAngle += this.bearingAngle;\n }", "private void getNextPosition() {\n if (falling) {\n dy += fallSpeed;\n }\n }", "@Override\r\n public void act() {\r\n boolean willMove = canMove();\r\n if (isEnd) {\r\n // to show step count when reach the goal\r\n if (!hasShown) {\r\n String msg = stepCount.toString() + \" steps\";\r\n JOptionPane.showMessageDialog(null, msg);\r\n hasShown = true;\r\n }\r\n } else if (willMove) {\r\n move();\r\n // increase step count when move\r\n stepCount++;\r\n // 把当前走过的位置加入栈顶的arrayList\r\n crossLocation.peek().add(getLocation());\r\n // 当前方向的概率+1\r\n probablyDir[getDirection() / 90]++;\r\n } else if (!willMove) {\r\n // 这时候必须一步一步返回栈顶arrayList的开头\r\n ArrayList<Location> curCrossed = crossLocation.peek();\r\n curCrossed.remove(curCrossed.size() - 1);\r\n next = curCrossed.get(curCrossed.size() - 1);\r\n move();\r\n stepCount++;\r\n // 当前方向反向的概率-1\r\n probablyDir[((getDirection() + Location.HALF_CIRCLE)\r\n % Location.FULL_CIRCLE) / Location.RIGHT]--;\r\n if (curCrossed.size() == 1) {\r\n // 返回之后pop\r\n crossLocation.pop();\r\n }\r\n }\r\n }", "public void goToLoopCounter() throws EndTaskException {\n\t\tgoToOrigin();\n\t\tturnAround();\n\t\tmove();//lane 2\n\t\tmove();\n\t}", "@Override\n\tpublic Lista<Coordenada> getNextMovements() {\n\n\t\tLista<Coordenada> lista = new Lista<Coordenada>();\n\n\t\taddCoordenada(posicion.up(), lista);\n\t\taddCoordenada(posicion.right(), lista);\n\t\taddCoordenada(posicion.down(), lista);\n\t\taddCoordenada(posicion.left(), lista);\n\t\taddCoordenada(posicion.diagonalUpRight(), lista);\n\t\taddCoordenada(posicion.diagonalUpLeft(), lista);\n\t\taddCoordenada(posicion.diagonalDownRight(), lista);\n\t\taddCoordenada(posicion.diagonalDownLeft(), lista);\n\n\t\treturn lista;\n\t}", "public void setCellToPath(int pos){//how to check for the end???\n\t\t\n\t\tif(pos<0||pos>width*height-1||getCompletePath())\n\t\t\treturn;// the position entered is not valid or the path has already been completed\n\t\t\n\t\telse if(temp.isEmpty()){//no path tile have been defined\n\t\t\tif(currentPos<0){//start hasn't been placed\t\t\n\t\t\t\tcurrentPos=pos;\n\t\t\t\tcurrentPath=new Path(currentPos);\n\t\t\t\tsetEntryPoint(currentPath);\n\t\t\t\tsetGrid(currentPath.getRow(),currentPath.getCol(),currentPath);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tint d = currentPath.getDirection(pos);\n\t\t\t\tif (d<0||d>=4)\n\t\t\t\t\treturn; //the two tiles are not connected\n\t\t\t\tPathType type =Map.createPathTileOfType(d, caseEdge);\n\t\t\t\tPath p =PathFactory.makePath(type, currentPos);\n\t\t\t\t\n\t\t\t\t//fix direction of tile\n\t\t\t\tif(p.getEntry()==pos)\n\t\t\t\t\tp.rotate();\n\t\t\t\t//validate spot (for entry/exit)\n\t\t\t\t\n\t\t\t\t//set as Path entry point \n\t\t\t\tp.setStart();\n\t\t\t\tsetEntryPoint(p);\n\t\t\t\t\n\t\t\t\t//add to grid and list\n\t\t\t\tp.storePathTile();\n\n\t\t\t\t//update current\n\t\t\t\tcurrentPos=pos;\n\t\t\t\tcurrentPath=new Path(currentPos);\t\t\n\t\t\t\tsetGrid(currentPath.getRow(),currentPath.getCol(),currentPath);\n\t\t\t}\t\t\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\tif (getGrid(pos/width, pos%width)!=null)\n\t\t\t\tif(getGrid(pos/width, pos%width).isPath())\n\t\t\t\t\treturn;//causes intersection\n\t\t\t\n\t\t\tint dExit = currentPath.getDirection(pos);\n\t\t\tint lastPos= temp.peekLast().getPos();\n\t\t\tint dEntry= currentPath.getDirection(lastPos);\n\n\t\t\t\n\t\t\tif (dExit<0||dExit>3||dEntry<0||dEntry>3)\n\t\t\t\treturn; //the two tiles are not connected\n\t\t\t\n\t\t\t\n\t\t\tPathType type =Map.createPathTileOfType(dExit,dEntry);\n\t\t\tPath p =PathFactory.makePath(type, currentPos);\n\t\t\t\n\t\t\t//fix direction of tile\n\t\t\tif(p.getEntry()==pos)\n\t\t\t\tp.rotate();\n\t\t\t\n\t\t\tif(!inValidSpot(p))\n\t\t\t\treturn; //\n\t\t\t\n\t\t\t//add to grid and list\n\t\t\tp.storePathTile();\n\t\t\t\n\t\t\t//update current\n\t\t\tcurrentPos=pos;\n\t\t\tcurrentPath=new Path(currentPos);\t\n\t\t\tsetGrid(currentPath.getRow(),currentPath.getCol(),currentPath);\n\t\t}\n\t}", "protected final void moveToNextIndex() {\n\t\t\t// doing the assignment && < 0 in one line shaves\n\t\t\t// 3 opcodes...\n\t\t\tif ( (_index = nextIndex()) < 0 ) { throw new NoSuchElementException(); }\n\t\t}", "private void findPath(int current){\r\n // remove current from OPEN\r\n int index = insideArray(_openSet,current);\r\n if(index == -1){\r\n System.out.println(\"findPath method returns -1.\");\r\n }\r\n _openSet.remove(index);\r\n\r\n // add current to CLOSED\r\n _closedSet.add(current);\r\n\r\n // if current is the target node\r\n if(current == _endIndex){\r\n return;\r\n }\r\n\r\n int neighborNum = _map.get_grid(current).get_neighborNum();\r\n int[] neighbors = _map.get_grid(current).get_neighbors();\r\n\r\n //for each neighbor of the current node\r\n for(int i=0;i<neighborNum;i++){\r\n Grid neighborGrid = _map.get_grid(neighbors[i]);\r\n // if neighbor is not traversable or neighbor is in CLOSED\r\n // SKIP THIS NEIGHBOR\r\n if(!neighborGrid.get_type().equals(\"|\") && insideArray(_closedSet,neighbors[i]) == -1){\r\n int currentNeighborF = neighborGrid.get_Fnum();\r\n int neighborF = findF(neighbors[i]);\r\n if(neighborF < currentNeighborF || insideArray(_closedSet,neighbors[i]) == -1){\r\n neighborGrid.set_Fnum(neighborF);\r\n neighborGrid.set_parent(current);\r\n if(insideArray(_closedSet,neighbors[i]) == -1){\r\n _openSet.add(neighbors[i]);\r\n }\r\n }\r\n }\r\n }\r\n int currentIndex = smallestF();\r\n // RECURSIVE CALL\r\n findPath(_map.get_grid(_openSet.get(currentIndex)).get_index());\r\n }", "private IPoint2D updateGoalPoint(IPoint2D loc, ArenaMap map, double lookAhead) {\n\t\tIPoint2D tmp = map.lastPointInRange(loc, lookAhead, true);\n\t\tRobot.managedPrinter.println(getClass(), \"next goal point: \" + tmp);\n\t\tif (tmp != null) {\n\t\t\ttmp.toDashboard(\"Goal point\");\n\t\t\tNetworkTable.getTable(\"motion\").putNumber(\"pointIdx\", ((IndexedPoint2D) tmp).getIndex());\n\t\t}\n\t\treturn tmp;\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}", "private void nextPiece() {\n if (_c == M && _r <= M) {\n _c = 1;\n _r++;\n } else if (_r > M) {\n _move = null;\n } else {\n _c++;\n }\n }", "public void goToLocation (Locator checkpoint) { //Patrolling Guard and Stationary Guard\r\n\t\tVector2i start = new Vector2i((int)(creature.getXlocation()/Tile.TILEWIDTH), (int)(creature.getYlocation()/Tile.TILEHEIGHT));\r\n\t\tint destx = (int)(checkpoint.getX()/Tile.TILEWIDTH);\r\n\t\tint desty = (int)(checkpoint.getY()/Tile.TILEHEIGHT);\r\n\t\tif (!checkCollision(destx, desty)) {\r\n\t\tVector2i destination = new Vector2i(destx, desty);\r\n\t\tpath = pf.findPath(start, destination);\r\n\t\tfollowPath(path);\r\n\t\t}\r\n\t\tarrive();\r\n\t}", "@Override\n\tpublic void navigateToNext(String phoneNum) {\n\t\t\n\t}", "public Position next(Direction direction) {\n return new Position(row + direction.getRow(), column + direction.getColumn());\n }", "public void next()\n\t{\n\t\tif(this.curseur < this.listeTapis.size() - 1)\n\t\t{\n\t\t\tthis.curseur++;\n\t\t}\n\t}", "void guiMoveFromCurrentPostionTo(Position to){\n\n\tPosition nextPos;\n\tSystem.out.println(\"Calculating path from \" + currentPosition + \" to \" + to);\n\t\n\tNode solution = null;\n\tsolution = aStar.generalSearch(currentPosition, to);\n\tif (solution != null) {\n\n\t\tSystem.out.println(name + \": Found a path.\");\n\t\tSystem.out.print(name + \": Path = \");\n\t\tsolution.printNode();\n\t\tSystem.out.println();\n\n\t\tAStarNode aStarSolution = (AStarNode)solution;\n\n\t\tList<Position> path = aStarSolution.getPath();\n\t\tListIterator iter = path.listIterator();\n\t\tnextPos = (Position)iter.next();\n\n\t\twhile(!currentPosition.equals(to)) {\n\t\t\n\t\t\tnextPos = (Position)iter.next();\n\t\t\tSystem.out.println(name + \": Attempting to move into \" + nextPos);\n\t\t\tif(nextPos.moveInto(aStar.getGrid())) {\n\t\t\t\n\t\t\t\twaiter.move(nextPos.getX(), nextPos.getY());\n\t\t\t\tcurrentPosition.release(aStar.getGrid());\t\n\t\t\t\tcurrentPosition = nextPos;\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tSystem.out.println(name + \": \" + nextPos + \" is locked. Recalculating path...\");\n\t\t\t\tsolution = aStar.generalSearch(currentPosition, to);\n\t\t\t\tif (solution != null) {\n\n\t\t\t\t\tSystem.out.println(name + \": Found a path.\");\n\t\t\t\t\tSystem.out.print(name + \": Path = \");\n\t\t\t\t\tsolution.printNode();\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t\taStarSolution = (AStarNode)solution;\n\t\t\t\t\tpath = aStarSolution.getPath();\n\t\t\t\t\titer = path.listIterator();\n\t\t\t\t\tnextPos = (Position)iter.next();\n\t\t\t\t}\t\n\t\t\t\telse {\n\n\t\t\t\t\tSystem.out.println(\"No path from \" + currentPosition + \" to \" + to);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tSystem.out.println(\"No path from \" + currentPosition + \" to \" + to);\n\t}\t\n }", "public MapElement getNextElement(Direction dir) {\n //System.out.println(\"Le lett kérve a következő palyaelem.\");\n return neighbours[dir.getValue()];\n }", "public abstract void nextAnimationStep();", "public void moveTo (Coordinate c) throws Exception\n\t{\n\t\tcurrentLocation = c;\n\t\tgrid[c.x][c.y] = GridChar.VISITED;\n\t}", "public Location next(boolean leftPressed, boolean rightPressed, boolean upPressed, boolean downPressed){\n\n\t\t// first, find out where we are now, and if we're making a footstep noise.\n\t\t// (footstep noises happen when the avatar moves from one nearest grid reference to a another)\n\t\tGridRef nearestGR = getNearestSpace();\n\t\tif (nearestGR.equals(previousGR)){\n\t\t\tfootstep = false;\n\t\t} else {\n\t\t\tfootstep = true;\n\t\t}\n\t\t// update 'previousGR' value.\n\t\tpreviousGR = nearestGR;\n\n\t\tint targetX = currentLoc.x;\n\t\tint targetY = currentLoc.y;\n\t\t\n\t\tif (leftPressed){\n\t\t\ttargetX -= topSpeed;\n\t\t\tcurrentDir = Direction.LEFT;\n\t\t}\n\t\tif (rightPressed){\n\t\t\ttargetX += topSpeed;\n\t\t\tcurrentDir = Direction.RIGHT;\n\t\t}\n\t\tif (upPressed){\n\t\t\ttargetY -= topSpeed;\n\t\t\tcurrentDir = Direction.UP;\n\t\t}\n\t\tif (downPressed){\n\t\t\ttargetY += topSpeed;\n\t\t\tcurrentDir = Direction.DOWN;\n\t\t}\n\n\t\ttargetLoc = new Location(targetX, targetY);\n\n\t\treturn targetLoc;\n\t}", "public abstract void moveTo(double x, double y);", "private void followPath(){\r\n\t\tif(noBeepersPresent()){\r\n\t\t\twhile(frontIsClear() && leftIsBlocked() && rightIsBlocked() && noBeepersPresent()){\r\n\t\t\t\tmakeMove();\r\n\t\t\t}\r\n\t\t\tif(frontIsBlocked() && leftIsBlocked() && rightIsBlocked() && noBeepersPresent()){\r\n\t\t\t\tturnAround();\r\n\t\t\t\tpaintCorner(RED);\r\n\t\t\t\tfollowPath();\r\n\t\t\t}else{\r\n\t\t\t\tcheckPaths();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void advanceFloor(){\n //TODO: write method to move onto next floor\n }", "public void nextPiece() {\n\t\tif (currentPiece != null) {\n\t\t\tfor (Loc l : currentPiece.getLocation()) {\n\t\t\t\tif (!l.isOnBoard()) {\n\t\t\t\t\tendGame();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tcurrentPiece = piecePlacer.nextPiece();\n\n\t\tdropPiece();\n\t\tnextPiecePanel.setNextPiece();\n\t}", "public void moveToLastAcceptableLocation(){\n\t\tthis.x=this.xTemp;\n\t\tthis.y=this.yTemp;\n\t}", "public boolean checkWalkStep(int lastX, int lastY, int nextX, int nextY) {\n return true;\n }", "private void doNextRow(){\n\t\tmove();\n\t\twhile (frontIsClear()){\n\t\t\talternateBeeper();\n\t\t}\n\t\tcheckPreviousSquare();\t\n\t}" ]
[ "0.6664689", "0.6590251", "0.6557098", "0.64133203", "0.6392218", "0.63555557", "0.6275799", "0.6262765", "0.6262157", "0.6183421", "0.61599463", "0.61282355", "0.6119658", "0.6117189", "0.6105142", "0.6099276", "0.60984427", "0.6082127", "0.607735", "0.6072925", "0.6041818", "0.6030108", "0.5879403", "0.5869173", "0.5868286", "0.585717", "0.5831719", "0.5824927", "0.5817047", "0.57973045", "0.57956403", "0.5775906", "0.57401514", "0.57278514", "0.5716991", "0.57093143", "0.5698967", "0.56873804", "0.5673977", "0.5671077", "0.5666444", "0.5665387", "0.56580174", "0.5654228", "0.56522155", "0.5629242", "0.5624262", "0.5621897", "0.561874", "0.56084436", "0.5596088", "0.55647975", "0.55629134", "0.55616087", "0.55517447", "0.5545784", "0.55417633", "0.5530025", "0.5517707", "0.551383", "0.55115634", "0.5495827", "0.5468757", "0.5461584", "0.5459449", "0.54587126", "0.54586166", "0.54535294", "0.54500425", "0.5441573", "0.54361767", "0.5432456", "0.54309404", "0.5429086", "0.54274654", "0.54271597", "0.54268897", "0.5420669", "0.54175276", "0.5414405", "0.54139143", "0.5413819", "0.54064375", "0.5403862", "0.5394573", "0.539416", "0.5391934", "0.53854525", "0.53747386", "0.53734994", "0.53686047", "0.53679144", "0.5361973", "0.5361574", "0.5361444", "0.5359181", "0.53570294", "0.53537655", "0.53511417", "0.53476435" ]
0.58863443
22
Checks if next coordinate in path is blocked.
public abstract boolean isNextBlocked();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkIfBlocked(){\n\t\tsetNextXY();\n\t\t/*if(Physics.hitWall(this, game.wi)){\n\t\t\tblocked=true;\n\t\t}\n\t\telse{\n\t\t\tblocked=false;\n\t\t}\n\t\t*/\n\t\t\n\t\ttry{\n\t\t\tif(game.getController().wallArray[lastX][lastY]||game.getController().wallArray[nextX][nextY]){\n\t\t\t\treturn true;\n\t\t\t}\t\n\t\t}catch(IndexOutOfBoundsException x){\n\t\t\t\n\t\t\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public boolean checkIfBlocked(int lastX,int lastY,int nextX, int nextY){\n\t\ttry{\n\t\t\tif(game.getController().wallArray[lastX][lastY]||game.getController().wallArray[nextX][nextY]){\n\t\t\t\treturn true;\n\t\t\t}\t\n\t\t\tif(game.getController().bombArray[lastX][lastY]||game.getController().bombArray[nextX][nextY]){\n\t\t\t\treturn true;\n\t\t\t}\t\n\t\t}catch(IndexOutOfBoundsException x){\n\t\t\t\n\t\t\n\t\t}\n\t\treturn false;\n\t}", "private boolean shouldReplanPath(State.StateView state, History.HistoryView history, Stack<MapLocation> currentPath)\n {\n \t\t/* TODO: Write this method\n \t\t * Check if the path is blocked every step or check if the next spot is blocked?\n \t\t * Does enemy attack if you get too close?\n \t\t */\n \t\n \t\n \t\t//checking if the next step is blocked\n \t\t//setting up local fields\n \t\tUnitView enemy = state.getUnit(enemyFootmanID);\n \t\tMapLocation next;\n \t\tif (!path.isEmpty()) {\n \t\t\tnext = path.peek();\n \t\t\n \t\t\tif(next.x == enemy.getXPosition() && next.y == enemy.getYPosition()) \n \t\t\t\treturn true;\n \t\t\t\n \t\t}\n \t\t\n return false;\n }", "@Override\n /**\n * Check whether a certain tile is blocked for a particular Mover.\n */\n public boolean blocked(Mover mover, int x, int y) {\n if(mPathTiles == null) {\n return true;\n }\n \n // Check bounds\n if( x < 0 || y < 0 || x >= getActualWidthInTiles() || y >= getActualHeightInTiles()) {\n return true;\n }\n \n // Check whether this tile blocks the unit\n return mPathTiles[ (y * getActualWidthInTiles()) + x].isBlocking(mover);\n \n }", "private boolean nextIsWall()\n {\n return this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].isHasWall();\n }", "public boolean checkBlockX()\n {\n if (mBlockedTime == 0)\n {\n return false;\n }\n\n double tBlockDelay = mBlockedTime - time();\n mBlockedTime = 0;\n if (tBlockDelay <= 0)\n {\n return false;\n }\n mBlockedMessage.add(mName + \" GC blocked from \" + time() + \" + until \" + (time() + tBlockDelay));\n hold(tBlockDelay);\n out();\n return true;\n }", "public boolean hasBlockAdjacent(int x, int y) {\n\t\treturn \tgetBlock(x, y + 1).canBePlaced(Direction.DOWN, 0, x, y + 1, this) || \n\t\t\tgetBlock(x, y - 1).canBePlaced(Direction.UP, 0, x, y - 1, this) || \n\t\t\tgetBlock(x + 1, y).canBePlaced(Direction.LEFT, 0, x + 1, y, this) || \n\t\t\tgetBlock(x - 1, y).canBePlaced(Direction.RIGHT, 0, x - 1, y, this);\n\t}", "public boolean tileBlocked(float xTile, float yTile)\r\n/* 117: */ {\r\n/* 118:131 */ return (!tileInBounds(xTile, yTile)) || (this.blocked[((int)xTile)][((int)yTile)] != 0);\r\n/* 119: */ }", "private boolean isBlocked() {\n return block_state <= 1;\n }", "private static boolean isMoveValid( int x, int y ){\n int path[] = new int[8];\n for( int distance = 1; distance < 8; distance ++ ){\n checkPath( path, 0, x + distance, y, distance );\n checkPath( path, 1, x + distance, y + distance, distance );\n checkPath( path, 2, x, y + distance, distance );\n checkPath( path, 3, x - distance, y, distance );\n checkPath( path, 4, x - distance, y - distance, distance );\n checkPath( path, 5, x, y - distance, distance );\n checkPath( path, 6, x + distance, y - distance, distance );\n checkPath( path, 7, x - distance, y + distance, distance );\n }\n for( int i = 0; i < 8; i++ ){\n if( path[ i ] > 1 ){\n return true;\n }\n }\n return false;\n }", "public boolean isGoal() {\r\n\t\tint n = this.dimension();\r\n\t\tint k = 1;\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\tfor (int j = 0; j < n; j++) {\r\n\t\t\t\tif (this.blocks[i][j] != k) {\r\n\t\t\t\t\tif (!(i == n - 1 && j == n - 1 && this.blocks[i][j] == 0)) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tk++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean canWalkTo(Point point) {\n\t\t// this way if some new block types will be implemented it will be safer to\n\t\t// extend\n\t\tif (maze[point.x][point.y] == Block.EMPTY) return true;\n\t\tif (maze[point.x][point.y] == Block.START) return true;\n\t\tif (maze[point.x][point.y] == Block.FINISH) return true;\n\t\treturn false;\n\t}", "public Boolean boundaryCheck(int addr) {\r\n\t\t// Make sure address is less than LIMIT and SP, and greater than base\r\n\t\tif (addr < getLIM() && addr < getSP() && addr >= getBASE()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tm_TH.interruptIllegalMemoryAccess(addr);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public Boolean tryWalk(int nextX, int nextY) {\n List<Entity> obstacles = this.dungeon.getEntities().stream()\n .filter(o -> o != null && o.getX() == nextX && o.getY() == nextY)\n .collect(Collectors.toList());\n if (dungeon.isWall(nextX, nextY)) {\n if(dungeon.isBroken(nextX, nextY)) {\n return true;\n } else {\n return false;\n }\n }\n \n if (!obstacles.isEmpty()) {\n if ((obstacles.get(0) instanceof Switch)) {\n return true;\n } else {\n return false;\n } \n }\n return true;\n }", "private boolean tryFindPath() {\n\t\t\tfor (Node neighbour : neighbours) {\n\t\t\t\tif (neighbour.x == n || neighbour.y == 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (!neighbour.isReachable()) {\n\t\t\t\t\tneighbour.setReachable();\n\t\t\t\t\tif (neighbour.tryFindPath()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "private void findNextBlock(MatrixIndex cursor) {\n while (isFreeBlock(cursor) || !inBounds(cursor)){\n incrementMatrixIndex(cursor);\n }\n }", "public boolean checkWalkStep(int lastX, int lastY, int nextX, int nextY) {\n return true;\n }", "private boolean valid (int row, int column) {\n\n boolean result = false;\n \n // check if cell is in the bounds of the matrix\n if (row >= 0 && row < grid.length &&\n column >= 0 && column < grid[0].length)\n\n // check if cell is not blocked and not previously tried\n if (grid[row][column] == 1)\n result = true;\n\n return result;\n\n }", "@Override\n public boolean isFinished() \n {\n int curCount = mPath.kNumPoints - mCount;\n if(curCount<1)\n {\n System.out.println(mPath.kNumPoints);\n }\n \n return curCount<1;\n }", "private boolean checkM(){\n if(currentLocation.x == previousLocation.x && currentLocation.y == previousLocation.y) {\n return false;\n }\n // Is outside the border\n if(currentLocation.x < size || currentLocation.y < size || currentLocation.x > map.numRows - size || currentLocation.y > map.numCols - size) {\n return false;\n }\n // Is on the land\n double angle2 = 0;\n while (angle2 < 6.3) {\n if (map.getTerrainGrid()[currentLocation.x + (int) (size/2 * cos(angle2))][currentLocation.y + (int) (size/2 * sin(angle2))] == Colors.OCEAN) {\n return false;\n }\n angle2 += 0.3;\n }\n return true;\n }", "public static boolean getPath(int x, int y, ArrayList<Point> path) {\n\t\tif (x > size-1 || y > size-1 || !isFree(x, y)) { // !isFree -> [x][y] = 0\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tboolean isAtFinal = (x == size-1) && (y == size-1); //destination: 5, 5\n\t\t\n\t\t//if there is a path from my current to end, add it\n\t\tif(isAtFinal || getPath(x, y+1, path) || getPath(x+1, y, path)){\n\t\t\tPoint p = new Point(x,y);\n\t\t\tpath.add(p);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private void getNextInSet() throws CancelledException {\n\t\t// find next address that has a valid block;\n\t\tAddress addr = getNextAddress(nextAddr);\n\n\t\t// if the instruction's start address is in our set\n\t\t// then we have our block\n\t\tif (addr != null && addrSet.contains(addr)) {\n\t\t\tnextBlock = model.getCodeBlockAt(addr, monitor);\n\t\t\tif (nextBlock != null) {\n\t\t\t\tnextAddr = nextBlock.getMaxAddress();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// otherwise we're out of our current address range in\n\t\t// our address range set so we find the next address range\n\t\t// with a min address >= the instructions address and\n\t\t// look for a block there\n\t\t//nextAddr = instr.getMaxAddress();\n\t\twhile (rangeIter.hasNext()) {\n\t\t\tAddressRange range = rangeIter.next();\n\n\t\t\tif (nextAddr.compareTo(range.getMinAddress()) >= 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnextBlock = getFirstInRange(range);\n\t\t\t// if we find a block we're done\n\t\t\tif (nextBlock != null) {\n\t\t\t\tnextAddr = nextBlock.getMaxAddress();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// if we find no block then there's no block in the\n\t\t\t// current range and we can move on to the next one\n\t\t}\n\t\tnextBlock = null;\n\t}", "public boolean isReachable(int x, int y){\n return (x >= 0 && x < maze.length && y >= 0 && y < maze[0].length && maze[x][y] != \"#\" );\n\n }", "public boolean isGoal() {\n \tfor (int row = 0; row < this.dimension(); row++) {\n \t\tfor (int column = 0; column < this.dimension(); column++) {\n \t\t\tif (blocks[row][column] != getGoalValueForBlock(row, column)) {\n \t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t}\n \t\n \treturn true;\n }", "protected boolean validCoord(int row, int col) {\n\t\treturn (row >= 0 && row < b.size() && col >= 0 && col < b.size());\n\t}", "private boolean findNumSafeLandHelper(int[][] array, int[][] visited, int row, int col) {\n\t\tif (array[row][col] == 0 || visited[row][col] == 1) {\n\t\t\treturn false;\n\t\t}\n\t\t// if the currnet square is at the border and its not visited and its\n\t\t// not sea then it means this is a safe land\n\t\tif (row == 0 || (row == array.length - 1) || col == 0 || (col == array.length - 1)) {\n\t\t\treturn true;\n\t\t}\n\t\t// backtrack to all four directions and find is there any safe land path\n\t\t// present\n\t\tboolean isPathPresent = false;\n\t\tvisited[row][col] = 1;\n\t\t// check all four direction from the currnet square\n\t\tisPathPresent = (row > 0 ? findNumSafeLandHelper(array, visited, row - 1, col) : false)\n\t\t\t\t|| (row < (array.length - 1) ? findNumSafeLandHelper(array, visited, row + 1, col) : false)\n\t\t\t\t|| (col > 0 ? findNumSafeLandHelper(array, visited, row, col - 1) : false)\n\t\t\t\t|| (col < (array.length - 1) ? findNumSafeLandHelper(array, visited, row, col + 1) : false);\n\t\tvisited[row][col] = 0;\n\t\treturn isPathPresent;\n\t}", "public boolean hasValidPath(int[][] grid) {\n int m = grid.length;\n int n = grid[0].length;\n boolean[][] visited = new boolean[m][n];\n\n Queue<int[]> queue = new LinkedList<>();\n queue.add(new int[] {0, 0});\n visited[0][0] = true;\n\n while (!queue.isEmpty()) {\n int[] current = queue.poll();\n int x = current[0];\n int y = current[1];\n int num = grid[x][y] - 1;\n for (int[] dir : dirs[num]) {\n int nx = x + dir[0], ny = y + dir[1];\n if (nx < 0 || nx >= m || ny < 0 || ny >= n || visited[nx][ny]) continue;\n // go to the next cell and come back to origin to see if port directions are same\n // if not visited and can be connected, add to queue\n for (int[] backDir : dirs[grid[nx][ny] - 1]) {\n if (nx + backDir[0] == x && ny + backDir[1] == y) {\n visited[nx][ny] = true;\n queue.add(new int[] {nx, ny});\n }\n }\n }\n }\n\n return visited[m - 1][n - 1];\n }", "boolean isCellBelowNeighbor() {\r\n return this.neighbors.contains(new Cell(this.x, this.y + 1));\r\n }", "private boolean atLeastOneNonWallLocation() {\n\t\tfor (int x = 0; x < this.map.getMapWidth(); x++) {\n\t\t\tfor (int y = 0; y < this.map.getMapHeight(); y++) {\n\n\t\t\t\tif (this.map.getMapCell(new Location(x, y)).isWalkable()) {\n\t\t\t\t\t// If it's not a wall then we can put them there\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean hasPath(int[][] maze, int[] start, int[] destination) {\n if (isWall(maze, start[0], start[1])) {\n return false;\n }\n\n boolean[][] visited = new boolean[maze.length][maze[0].length];\n\n Queue<int[]> queue = new LinkedList<>();\n queue.add(start);\n\n int[] currentPosition = null;\n visited[start[0]][start[1]] = true;\n while ((currentPosition = queue.poll()) != null) {\n int row = currentPosition[0];\n int col = currentPosition[1];\n\n // whether is destination\n if (reachDest(destination, row, col)) {\n return true;\n }\n\n // for all the 4 neighbours of current position\n for (int i = 0; i < 4; i++) {\n int nRow = row + neighbourDir[i][0]; // neighbour row\n int nCol = col + neighbourDir[i][1]; // neighbour col\n\n // keep going when there is no wall\n while (!isWall(maze, nRow, nCol)) {\n nRow += neighbourDir[i][0];\n nCol += neighbourDir[i][1];\n }\n\n // To get here, means current position is a wall, so the coordinate should be adjusted\n int lastRow = nRow - neighbourDir[i][0];\n int lastCol = nCol - neighbourDir[i][1];\n\n if (!isWall(maze, lastRow, lastCol) && !visited[lastRow][lastCol]) {\n // not visited\n visited[lastRow][lastCol] = true;\n queue.add(new int[]{lastRow, lastCol});\n }\n }\n\n }\n\n return false;\n }", "@Test (expected=AssertionError.class)\n\tpublic final void testCurrentBoundaryNeighbor() {\n\t\tint boundarySize = totalSize/elementsPerDim;\n\t\tBoundaryIterator bdIterator = block.getBoundaryIterator();\n\t\tbdIterator.setBoundaryToIterate(new BoundaryId(0, false));\n\t\t// Step to middle of the boundary\n\t\tfor (int i=0; i< boundarySize/2; i++) {\n\t\t\tbdIterator.next();\n\t\t}\n\t\tbdIterator.currentNeighbor(0, extent + 1);\n\t}", "private boolean canCaptureSomewhere(int x, int y){\n\t\tfor (int i = -2; i <= 2; i=i+4){\n\t\t\tfor (int j = -2; j <= 2; j=j+4){\n\t\t\t\tif (!(x+i < 0 || x+i > N\t\t\n\t\t\t\t|| y+j < 0 || y+j > N)){\t\t//don't give validMove impossible final coordinates\n\t\t\t\t\tif (validMove(x, y, x+i, y+j)) return true;\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean foundGoal() \r\n\t{\r\n\t\t// Write the method that determines if the walker has found a way out of the maze.\r\n\t\treturn ( currentCol < 0 || currentRow < 0 || \r\n\t\t\t\t currentCol >= size || currentRow >= size );\r\n\t}", "public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "private boolean checkSurroundingOfPoint(Point p) {\n\t\tPoint check = new Point();\n\t\tcheck.x\t\t= p.x;\n\t\tcheck.y \t= p.y;\n\t\t\n\t\tfor(int y = -1; y <= 1; y++) {\n\t\t\tcheck.y += y;\n\t\t\tfor(int x = -1; x <= 1; x++) {\n\t\t\t\tcheck.x += x;\n\t\t\t\tif(occupiedPositions.contains(check)) return false;\n\t\t\t\t//restore values\n\t\t\t\tcheck.x\t= p.x;\n\t\t\t}\n\t\t\t//restore values\n\t\t\tcheck.y = p.y;\n\t\t}\n\t\treturn true;\n\t}", "public boolean inValidSpot(Path p1){\n\t\t// Checks to see it the path piece placed expects an entrance or exit piece out of bounds\n\t\t\n\t\tint largestRow = (height*width-1)/width;\n\t\t\n\t\t// if entrance or exit pos expected is negative, know it is expecting a path outside the top bound\n\t\tif(p1.getEntry()<0 || p1.getExit()<0){\n\t\t\treturn false;\n\t\t}\n\t\t// if entrance or exit's row greater than the maximum row, know it is expecting a path outside bottom bound\n\t\tif(p1.getEntryRow()>largestRow || p1.getExitRow()>largestRow){\n\t\t\treturn false;\n\t\t}\n\t\tint currentRow = p1.getRow();\n\t\tint nextRow=0;\n\t\tif(Math.abs(p1.getPos()-p1.getEntry())==1){\n\t\t\t// If the absolute value of the difference between the current position and its entrance is 1 ...\n\t\t\t// Checking to see if the entrance is expected to be outside of the left or right edges of Map\n\t\t\tnextRow = p1.getEntryRow();\n\t\t\tif(currentRow!=nextRow){\n\t\t\t\t// This means that the entrance expected is not to the left or to the right\n\t\t\t\t// In other words, the entrance is expected in another row\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(Math.abs(p1.getPos()-p1.getExit())==1){\n\t\t\t// If the absolute value of the difference between the current position and its exit is 1 ...\n\t\t\t// Checking to see if the exit is expected to be outside of the left or right edges of Map\n\t\t\tnextRow = p1.getExitRow();\n\t\t\tif(currentRow!=nextRow){\n\t\t\t\t// This means that the exit expected is not to the left or to the right\n\t\t\t\t// In other words, the exit is expected in another row\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\tif(Math.abs(p1.getPos()-p1.getEntry())==width){\n\t\t\tnextRow = p1.getEntryRow();\n\t\t\tif(p1.getEntry()<0 || nextRow>(height-1/width)){//it used to be calculaterow(height*width-1\n\t\t\t\t//Less than zero would make it on top of the top edge\n\t\t\t\t//First term calculated in this manner because any negative entrance between -1 and \n\t\t\t\t// -width+1 will have an integer rounded to zero. The double casting will give an \n\t\t\t\t// accurate number without losing the sign\n\t\t\t\t\n\t\t\t\t//Greater than height*width-1 would make in lower than the bottom edge\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(Math.abs(p1.getPos()-p1.getExit())==width){\n\t\t\tnextRow = p1.getExitRow();\n\t\t\tif(p1.getEntry()<0 || nextRow>(height-1/width)){//it used to be calculaterow(height*width-1\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\treturn true;\n\t\t\n\t}", "@Override\r\n public boolean isPointEnclosed(Point P) {\r\n boolean isEnclosed=false;\r\n if(P.getXCoordinate()>=origin.getXCoordinate() && P.getXCoordinate()<=(origin.getXCoordinate()+length)\r\n && P.getYCoordinate()>=origin.getYCoordinate() && P.getYCoordinate()<=(origin.getYCoordinate()+breadth))\r\n {\r\n isEnclosed=true;\r\n }\r\n return isEnclosed;\r\n }", "public boolean canMove() {\n\t\tArrayList<Location> loc = getValid(getLocation());\n\t\tif (loc.isEmpty()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tpath.add(getLocation());\n\t\t\tif (loc.size() >= 2) {\n\t\t\t\tcrossLocation.push(path);\n\t\t\t\tpath = new ArrayList<Location>();\n\t\t\t\tnext = betterDir(loc);\n\t\t\t}\n\t\t\tnext = loc.get(0);\n\t\t}\n\t\treturn true;\n\t}", "protected boolean findDrinkableBlock(Location loc) {\n return findDrinkableSquare(loc) ||\n findDrinkableSquare(loc.clone().add(0, -1, 0)) ||\n findDrinkableSquare(loc.clone().add(0, +1, 0));\n }", "public boolean validStopCheck(){\n return points.validPolygon();\n }", "private boolean isStepBlocked(Step step){\n return step.getOverlays().stream().anyMatch( o -> o instanceof Blockable );\n }", "public boolean passedBy(Line2D path) {\n\t\tfor (int i = 0; i < coordinates.size() - 1; i++) {\n\t\t\tvar p1 = coordinates.get(i);\n\t\t\tvar p2 = coordinates.get(i + 1);\n\t\t\tLine2D buildingEdge = new Line2D.Double(p1.getLng(), p1.getLat(), p2.getLng(), p2.getLat()); // x1, y1, x2, y2 \n\t\t\tif (buildingEdge.intersectsLine(path)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean checkCrash (Location next)\n {\n if (next == null) {\n return true;\n }\n\n Location last = playerLocations.get(playerLocations.size()-1);\n\n LocationType type = next.getType();\n //println(getLocation(next).getType()+\" : \"+next);\n if (type == LocationType.POWERUP) {\n PowerUp p = getPowerUp(next);\n\n if (p != null) { // Basically a workaround for the NPE\n // if (ENABLE_SOUND) {\n // sfx.gainedPowerUp();\n // }\n addSpeed(1);\n speedTimer += (int) frameRate * 2;\n removePowerUp(p);\n }\n\n return false;\n }\n\n if ((type == LocationType.PLAYER || type == LocationType.WALL) ||\n (next.getY() != last.getY() && (direction == LEFTKEY || direction == RIGHTKEY)) ||\n (next.getX() != last.getX() && (direction == UPKEY || direction == DOWNKEY))) { // This is to prevent bike from wrapping around edge of grid, because grid is a 1d array\n //sfx.lostALife(); //Commented out because you hear a shrill sound at the end for some reason\n return true;\n }\n\n return false;\n }", "protected boolean isCheckBlockable(Piece.PieceColorOptions playerColor) {\n Coordinate[] coordinatesToBlock;\n Coordinate kingCoordinate, oppCoordinate, allyCoordinate;\n int blockCounter, diffX, diffY, spacesToVerify, xIncrement, yIncrement;\n\n coordinatesToBlock = new Coordinate[VERTICAL_BOARD_LENGTH];\n kingCoordinate = getKingCoordinate(playerColor);\n oppCoordinate = null;\n blockCounter = 0;\n\n outerloop:\n for (int i = 0; i < VERTICAL_BOARD_LENGTH; i++) {\n for (int j = 0; j < HORIZONTAL_BOARD_LENGTH; j++) {\n oppCoordinate = new Coordinate(j, i);\n if (isValidEndpoints(oppCoordinate, kingCoordinate, oppositeColor(playerColor))) {\n if (isValidPath(oppCoordinate, kingCoordinate, oppositeColor(playerColor), false)) {\n coordinatesToBlock[blockCounter] = oppCoordinate;\n blockCounter++;\n // if there is more than one piece checking the King\n // the check is not blockable\n break outerloop;\n }\n }\n }\n }\n\n diffX = subtractXCoordinates(oppCoordinate, kingCoordinate);\n diffY = subtractYCoordinates(oppCoordinate, kingCoordinate);\n xIncrement = calculateIncrement(diffX);\n yIncrement = calculateIncrement(diffY);\n spacesToVerify = Math.max(Math.abs(diffX), Math.abs(diffY)) - 1;\n\n // moving a piece to oppCoordinate capture's the opposing piece\n // only opposing Bishops, Rooks, and Queens can be blocked\n if (isValidDiagonalPath(oppCoordinate, kingCoordinate) || isValidStraightPath(oppCoordinate, kingCoordinate)) {\n for (int i = 0; i < spacesToVerify; i++) {\n Coordinate betweenCoordinate = new Coordinate(oppCoordinate);\n betweenCoordinate.addVals(xIncrement, yIncrement);\n coordinatesToBlock[blockCounter] = betweenCoordinate;\n blockCounter++;\n }\n }\n\n // loop through all Coordinates in coordinatesToBlock and see if any can block the check\n for (int i = 0; i < blockCounter; i++) {\n oppCoordinate = coordinatesToBlock[i];\n for (int j = 0; j < VERTICAL_BOARD_LENGTH; j++) {\n for (int k = 0; k < HORIZONTAL_BOARD_LENGTH; k++) {\n allyCoordinate = new Coordinate(k, j);\n if (isValidEndpoints(allyCoordinate, oppCoordinate, playerColor)) {\n if (isValidPath(allyCoordinate, oppCoordinate, playerColor, false)) {\n if (isMovePossibleWithoutCheck(allyCoordinate, oppCoordinate, playerColor, false)) {\n return true;\n }\n }\n }\n }\n }\n }\n return false;\n }", "public boolean finished() {\r\n\t\tboolean allOccupied = true;\r\n\t\tfor (Node n : allNodes.values()) {\r\n\t\t\tif (n.path == 0) {\r\n\t\t\t\tallOccupied = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (allOccupied) {\r\n\r\n\t\t\tfor (Integer path : paths.keySet()) {\r\n\t\t\t\tStack<Node> sn=paths.get(path);\r\n\t\t\t\tNode n = sn.peek();\r\n\t\t\t\tif (!EndPoint.containsValue(n)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (sn.size() > 1) {\r\n\t\t\t\t\tStack<Node> snBK = (Stack<Node>) sn.clone();\r\n\t\t\t\t\t\r\n\t\t\t\t\tNode n1 = snBK.pop();\r\n\t\t\t\t\twhile (!snBK.isEmpty()) {\r\n\t\t\t\t\t\tif(n1.path!=path)\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\tNode n2= snBK.pop();\r\n\t\t\t\t\t\tif(adjaMatrix[n1.index][n2.index]==0)\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tn1=n2;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t\treturn false;\r\n\t}", "public boolean checkNotDone() {\n boolean notDone = false;\n blocksPut = 0;\n \n for(int y = 0; y < buildHeight+1; y++) {\n for(int z = 0; z < buildSize; z++) {\n for(int x = 0; x < buildSize; x++) {\n if(myIal.lookBlock(x, y, z).equals(\"air\")) {\n notDone = true;\n } else {\n blocksPut++;\n }\n }\n }\n }\n\n return notDone;\n }", "public boolean isMine(int x, int y);", "boolean isDone(){\n\t\t\n\t\treturn (x0==x1 && y0==y1);\n\t}", "protected boolean solve(int currentRow, int currentColumn) {\n \tint currentBlock = m.maze[currentRow][currentColumn];\t\t\t\t\t\t\t// get the current block that we are on\r\n \t\r\n if (m.isBlockEmpty(currentBlock)) {\t\t\t\t\t\t\t\t\t\t\t\t// make sure current block is empty\r\n \tm.maze[currentRow][currentColumn] = 2; \t\t\t\t\t\t\t\t// add this block to the path as a potential solution\r\n repaint();\r\n \r\n m.blocksTraversed++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// keep track of how many blocks were traversed over\r\n \r\n if (currentRow == m.rows-2 && currentColumn == m.columns-2) {\t\t\t\t// current block is bottom right, path has been found\r\n \tGUI.ta.append(m.blocksTraversed + \" blocks were traversed while solving the maze.\\n\");\r\n \tdouble percentage = (((double) m.blocksTraversed / (m.rows * m.columns))*100) * 2;\r\n DecimalFormat f = new DecimalFormat(\"##.00\");\r\n \tGUI.ta.append(\"This results in \" + f.format(percentage) + \"% of the maze being traveled.\\n\");\r\n \treturn true;\r\n }\r\n \r\n try { Thread.sleep(1); }\r\n catch (InterruptedException e) { }\r\n \r\n int topBlock = currentRow - 1;\t\t\t\t\t\t\t\t\t\t\t\t// block directly above the current block\r\n int leftBlock = currentColumn - 1;\t\t\t\t\t\t\t\t\t\t\t// block directly left of the current block\r\n int bottomBlock = currentRow + 1;\t\t\t\t\t\t\t\t\t\t\t// block directly below the current block\r\n int rightBlock = currentColumn + 1;\t\t\t\t\t\t\t\t\t\t\t// block directly right of the current block\r\n \r\n if (solve(topBlock, currentColumn) || solve(currentRow, leftBlock) ||\t\t// a solution was found\r\n \tsolve(bottomBlock, currentColumn) || solve(currentRow, rightBlock))\r\n \treturn true;\r\n \r\n m.maze[currentRow][currentColumn] = 4; \t\t\t\t\t\t\t\t\t// no solution from current block so make the block visited instead\r\n repaint();\r\n \r\n synchronized(this) {\r\n try { wait(1); }\r\n catch (InterruptedException e) { }\r\n }\r\n }\r\n return false;\r\n }", "public boolean hasFinished(int neighbour){\n\t//System.out.println(\"ATTENTION\");\n\treturn false;\n }", "private static Boolean canStillReachEveryCrates(Cells[][] wallBoard, int column, int row)\n\t{\n\t\tif(playerPos.isEmpty())\n\t\t\treturn true;\n\n\t\tBoolean ret = true;\n\n\t\t_PF = new AStarPathFinder(wallBoard);\n\n\t\tfor(Point pos : playerPos)\n\t\t{\n\t\t\tret = (true && _PF.canFindAWay(pcolumn, prow, (int)pos.getX(), (int)pos.getY()));\n\t\t}\n\n\t\treturn ret;\n\t}", "public boolean isGoal() {\n if (posX != N-1 || posY != N-1) return false;\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (matrix[i][j] == 0) continue;\n if (i*N+j+1 != matrix[i][j]) return false;\n }\n }\n return true;\n }", "private boolean legalMove() {\n\n\t\t// empty landing spot\n\t\tif (tilePath.size() == 0) {\n\t\t\tdebug(\"illegal, empty landing spot\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!mBoard.tileIsEmpty(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, tile not empty\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// start doesn't equal end\n\t\tif (tilePath.get(0).equals(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, start doesn't equal end\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public boolean percolates() throws Exception {\n if (SIZE != 1 && ufVirtual.connected(0, SIZE - 1))\n return true;\n else if (SIZE == 1 && isOpen(1, 1))\n return true;\n return false;\n }", "public boolean isValidMove(ArrayList<Cell> path) {\t\t\t\t\r\n\t\treturn value != -1 && !inPath(path);\r\n\t}", "private boolean isBlocking(float _x, float _y, float xa, float ya) {\n int x = (int) (_x / 16);\n int y = (int) (_y / 16);\n\n if (x == (int) (this.x / 16) && y == (int) (this.y / 16)) {\n return false;\n }\n\n boolean blocking = world.level.isBlocking(x, y, xa, ya);\n\n byte block = world.level.getBlock(x, y);\n\n if (((Level.TILE_BEHAVIORS[block & 0xff]) & Level.BIT_PICKUPABLE) > 0) {\n //Picked up coin\n //System.out.println(\"Picked up coin\");\n\n //Write event to statisics file\n if (world.recorder != null) {\n world.recorder.recordCoin();\n }\n\n Mario.getCoin();\n world.sound.play(Art.samples[Art.SAMPLE_GET_COIN], new FixedSoundSource(x * 16 + 8, y * 16 + 8), 1, 1, 1);\n world.level.setBlock(x, y, (byte) 0);\n for (int xx = 0; xx < 2; xx++) {\n for (int yy = 0; yy < 2; yy++) {\n world.addSprite(new Sparkle(x * 16 + xx * 8 + (int) (Math.random() * 8), y * 16 + yy * 8 + (int) (Math.random() * 8), 0, 0, 0, 2, 5));\n }\n }\n }\n\n if (blocking && ya < 0) {\n world.bump(x, y, large);\n }\n\n return blocking;\n }", "public boolean blocked(Move move) {\n String t = move.replacedPiece().abbrev();\n String s = move.movedPiece().abbrev();\n if (s.equals(\"-\")) {\n throw new IllegalArgumentException(\"can't move empty piece\");\n }\n if (s.equals(t)) {\n return true;\n }\n int c0 = move.getCol0();\n int c1 = move.getCol1();\n int r0 = move.getRow0();\n int r1 = move.getRow1();\n int dCol = c1 - c0;\n int dRow = r1 - r0;\n int i, j;\n for (Direction d : Direction.values()) {\n for (i = 1; i <= 7; i++) {\n if (dCol == d.dc * i && dRow == d.dr * i) {\n for (j = 1; j < i; j++) {\n String u = get(c0 + d.dc * j, r0 + d.dr * j).abbrev();\n if (s.equals(\"w\") && u.equals(\"b\")) {\n return true;\n }\n if (s.equals(\"b\") && u.equals(\"w\")) {\n return true;\n }\n }\n return false;\n }\n }\n }\n throw new IllegalArgumentException(\"not a valid direction\");\n }", "public boolean blockedGame() {\r\n int pointsperplayer = 0;\r\n if (playedDominoes.size() > 9) {\r\n if (end[0] == end[1]) {\r\n List<Domino> aux = new ArrayList();\r\n for (Domino d : playedDominoes) {\r\n if (d.getBothNumbers().contains(end[0])) {\r\n System.out.println(\"Adding domino\" + d.toString());\r\n aux.add(d);\r\n }\r\n }\r\n return aux.size() == 7;\r\n }\r\n }\r\n return false;\r\n }", "private void scanForBlockFarAway() {\r\n\t\tList<MapLocation> locations = gameMap.senseNearbyBlocks();\r\n\t\tlocations.removeAll(stairs);\r\n\t\tif (locations.size() == 0) {\r\n\t\t\tblockLoc = null;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t/* remove blocks that can be sensed */\r\n\t\tIterator<MapLocation> iter = locations.iterator();\r\n\t\twhile(iter.hasNext()) {\r\n\t\t\tMapLocation loc = iter.next();\r\n\t\t\tif (myRC.canSenseSquare(loc))\r\n\t\t\t\titer.remove();\r\n\t\t} \r\n\t\t\r\n\t\tlocations = navigation.sortLocationsByDistance(locations);\r\n\t\t//Collections.reverse(locations);\r\n\t\tfor (MapLocation block : locations) {\r\n\t\t\tif (gameMap.get(block).robotAtLocation == null){\r\n\t\t\t\t/* this location is unoccupied */\r\n\t\t\t\tblockLoc = block;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tblockLoc = null;\r\n\t}", "public boolean check(Node n, int path) {\r\n\r\n\t\t// Basic case check.\r\n\t\tif (EndPoint.get(path).equals(n))\r\n\t\t\treturn true;\r\n\r\n\t\t// Basic case check\r\n\t\tboolean okForPath = false;\r\n\t\tfor (Integer neiborIndex : nowMap.get(n.index)) {\r\n\t\t\tNode neibor = allNodes.get(neiborIndex);\r\n\r\n\t\t\tif (neibor.path == 0 || EndPoint.get(path).equals(neibor))\r\n\t\t\t\tokForPath = true;\r\n\t\t}\r\n\r\n\t\t\r\n\t\t// Dead end check\r\n\r\n\t\tfor (Integer neiborIndex : nowMap.get(n.index)) {\r\n\t\t\tif (allNodes.get(neiborIndex).path == 0) {\r\n\t\t\t\tint num = 0;\r\n\t\t\t\r\n\t\t\t\t\t// BEGIN check for dead ends\r\n\r\n\t\t\t\t\t// except the node we are testing, all the other neighbor nodes from other paths\r\n\t\t\t\t\t// of the neighbor node of the node we are testing are occupied and then a dead\r\n\t\t\t\t\t// end is created.\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(Integer neighborOfNeighborIndex:nowMap.get(neiborIndex)) {\r\n\t\t\t\t\t\tif(neighborOfNeighborIndex!=n.index) {\r\n\t\t\t\t\t\t\tif(allNodes.get(neighborOfNeighborIndex).path==0)\r\n\t\t\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tfor(Integer pathIndex:StartPoint.keySet()) {\r\n\t\t\t\t\t\t\t\t\tif(!paths.get(pathIndex).peek().equals(EndPoint.get(pathIndex))){\r\n\t\t\t\t\t\t\t\t\t\tif(neighborOfNeighborIndex==paths.get(pathIndex).peek().index || neighborOfNeighborIndex==EndPoint.get(pathIndex).index)\r\n\t\t\t\t\t\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(num<=1)\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t// END check for dead ends\r\n\t\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\tLinkedList<Integer> topPathsIndex=new LinkedList<Integer>();\r\n\t\t\r\n\t\tfor(Integer p:paths.keySet())\r\n\t\t\ttopPathsIndex.add(paths.get(p).peek().index);\r\n\t\tboolean deadEnd=true;\r\n\t\tfor(Integer nodeIndex:allNodes.keySet()) {\r\n\t\t\tNode theNode=allNodes.get(nodeIndex);\r\n\t\t\tif(theNode.path==0) {\r\n\t\t\t\tfor(Integer itsNeighborIndex:nowMap.get(nodeIndex)) {\r\n\t\t\t\t\tif(allNodes.get(itsNeighborIndex).path==0) {\r\n\t\t\t\t\t\tdeadEnd=false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(deadEnd) {\r\n\t\t\t\t\tfor(Integer itsNeighborIndex:nowMap.get(nodeIndex)) {\r\n\t\t\t\t\t\tif(topPathsIndex.contains(itsNeighborIndex)) {\r\n\t\t\t\t\t\t\tint p0=allNodes.get(itsNeighborIndex).path;\r\n\t\t\t\t\t\t\tint itsEndIndex=EndPoint.get(p0).index;\r\n\t\t\t\t\t\t\tif(nowMap.get(nodeIndex).contains(itsEndIndex))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tdeadEnd=false;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else\r\n\t\t\t{\r\n\t\t\t\tfor(Integer itsNeighborIndex:nowMap.get(nodeIndex)) {\r\n\t\t\t\t\tif(allNodes.get(itsNeighborIndex).path==0 ||allNodes.get(itsNeighborIndex).path==theNode.path) {\r\n\t\t\t\t\t\tdeadEnd=false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif(deadEnd)\r\n\t\t\treturn !deadEnd;\r\n\t\t\r\n\t\tHashMap<Integer,Integer> rmap=new HashMap<Integer,Integer>();\r\n\t\tint rcount=state_build_regions(rmap);\r\n\t\tif(state_regions_stranded(rcount,rmap,paths.size()+1,1)>0)\r\n\t\t\treturn false;\r\n\r\n\t\treturn okForPath;\r\n\t}", "protected final boolean computeHasNext() {\n return this.getEnds().getGraph().getSuccessorEdges(this.getNext()).isEmpty();\n }", "private void blockedPathNoBeepers() {\n\t\twhile (frontIsBlocked() && noBeepersPresent()) {\n\t\t\tturnLeft();\n\t\t\tturnLeft();\n\t\t} \n\t\tmove();\n\t\tturnRight();\n\t}", "public boolean blocks(Cell source, Cell destination) {\n\t\tif (source.getColumn() == destination.getColumn() && column == source.getColumn()) {\n\t\t\tint minRow = Math.min(source.getRow(), destination.getRow());\n\t\t\tint maxRow = Math.max(source.getRow(), destination.getRow());\n\t\t\treturn minRow < row && row < maxRow;\n\t\t} else if (source.getRow() == destination.getRow() && row == source.getRow()) {\n\t\t\tint minColumn = Math.min(source.getColumn(), destination.getColumn());\n\t\t\tint maxColumn = Math.max(source.getColumn(), destination.getColumn());\n\t\t\treturn minColumn < column && column < maxColumn;\n\t\t}\n\t\treturn false;\n\t}", "public boolean pathExists(int startVertex, int stopVertex) {\n// your code here\n ArrayList<Integer> fetch_result = visitAll(startVertex);\n if(fetch_result.contains(stopVertex)){\n return true;\n }\n return false;\n }", "@Override\r\n protected boolean isGoal(Point node) {\r\n return (node.equals(finish));\r\n }", "public boolean isGoal() {\n boolean result = false; \n for (int i = 0; i < this.N; i++) {\n for (int j = 0; j < this.N; j++) {\n int idx = (i * this.N) + (j + 1);\n if (idx != N * N - 1 && tiles[i][j] != idx) {\n return false;\n } \n if (idx == N * N - 1) {\n if (tiles[N - 1][N - 1] == 0) return true;\n return false;\n }\n }\n }\n return result;\n }", "public Block createPath(Block currentBlock){\n\n\t\tint indexOfNeighbouringBlock = (int) (Math.random()*RoomGen.neighbouringBlocks.get(currentBlock).size());\n\t\tint size = RoomGen.neighbouringBlocks.get(currentBlock).size();\n\t\t\n\t\tif(!path.contains(currentBlock)){\n\t\t\tpath.add(currentBlock);\n\t\t}\n\t\t\n\t\t//set the next index to make sure that elements of path are distinct\n\t\tSystem.out.println(\"size of neighbours: \" + RoomGen.neighbouringBlocks.get(currentBlock).size());\n\t\tif(path.contains(RoomGen.neighbouringBlocks.get(currentBlock).get(indexOfNeighbouringBlock))){\n\t\t\tif(indexOfNeighbouringBlock != 0 || indexOfNeighbouringBlock == RoomGen.neighbouringBlocks.get(currentBlock).size() - 1){\n\t\t\t\tindexOfNeighbouringBlock = indexOfNeighbouringBlock-1;\n\t\t\t}else{\n\t\t\t\tindexOfNeighbouringBlock = indexOfNeighbouringBlock+1;\n\t\t\t}\n\t\t}else{\t\t\n\t\t}\n\t\tBlock next = new Block(0,0,0,0);\n\t\t\n\t\t//Initialise next block\n\t\tif(unfinishedDoors.contains(RoomGen.neighbouringBlocks.get(currentBlock).get(indexOfNeighbouringBlock))){\n\t\t\tnext = RoomGen.neighbouringBlocks.get(currentBlock).get(indexOfNeighbouringBlock);\n\t\t}else{\n\t\t\tfor(int i = 0; i<RoomGen.neighbouringBlocks.get(currentBlock).size(); i++){\n\t\t\t\tif(unfinishedDoors.contains(RoomGen.neighbouringBlocks.get(currentBlock).get(i))){\n\t\t\t\t\tnext = RoomGen.neighbouringBlocks.get(currentBlock).get(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}else if(i==RoomGen.neighbouringBlocks.get(currentBlock).size()-1){\n\t\t\t\t\treturn currentBlock;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\taddDoor(currentBlock, next);\n\t\t\n\t\tcurrentBlock.addDoor();\n\t\tnext.addDoor();\n\t\t\n\t\t//if current block reaches full door potential when adding door to next,\n\t\t//add it to the list of finished blocks and remove it from the list of unfinished ones\n\t\tif(currentBlock.getPotentialDoorNum() == currentBlock.getCurrentDoorNum()){\n\t\t\tfinishedDoors.add(currentBlock);\n\t\t\tfor(int i = 0; i< unfinishedDoors.size(); i++){\n\t\t\t\tif(unfinishedDoors.get(i).equals(currentBlock)){\n\t\t\t\t\tunfinishedDoors.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//path ends if next reaches full door potential when adding door from b to next\n\t\t//next is put to finished list and removed from unfinished list\n\t\tif(next.getPotentialDoorNum() == next.getCurrentDoorNum()){\n\t\t\tfinishedDoors.add(next);\n\t\t\tpath.add(next);\n\t\t\t\n\t\t\tfor(int i = 0; i< unfinishedDoors.size(); i++){\n\t\t\t\tif(unfinishedDoors.get(i).equals(next)){\n\t\t\t\t\tunfinishedDoors.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn next;\n\t\t}\n\t\t//otherwise the path continues\n\t\telse{\n\t\t\treturn createPath(next);\n\t\t}\n\t\t}", "boolean hasPathTo(int v)\n\t{\n\t\treturn edgeTo[v].weight()!=Double.POSITIVE_INFINITY;\n\t}", "private boolean isNextBoxUsed(Box box, int directionNextBox) {\n if (directionNextBox < 0 || directionNextBox > 3)\n throw new IllegalArgumentException(\"The only allowed values are between 0 and 3.\");\n if (box == null)\n throw new IllegalArgumentException(\"Error. Null pointer in isNextBoxUsed().\");\n // [row,column] - coordinates of the box in the maze\n int[] boxPosition = box.getPosition();\n int row = boxPosition[0];\n int column = boxPosition[1];\n if (directionNextBox == 0) {\n if (row == 0)\n return true;\n return this.grid[row - 1][column].isUsed();\n }\n if (directionNextBox == 1) {\n if (column == this.grid[column].length - 1)\n return true;\n return this.grid[row][column + 1].isUsed();\n }\n if (directionNextBox == 2) {\n if (row == this.grid.length - 1)\n return true;\n return this.grid[row + 1][column].isUsed();\n }\n if (directionNextBox == 3) {\n if (column == 0)\n return true;\n return this.grid[row][column - 1].isUsed();\n }\n return false;\n }", "public boolean walkReturns(){\n int count = 1;\n move();\n \n while((x!=0)||(y!=0)){\n move();\n count++;\n if(count>=safeguard){\n return false;\n }\n }\n return true;\n }", "public boolean step() {\n Tile nextTile;\n Direction d;\n int directionCount = 0;\n try {\n if (finished == true) {\n return true;\n }\n if (route.empty()) {\n route.push(maze.getEntrance());\n return false;\n } else {\n while (true) {\n if (directionCount == 0) {\n d = Direction.NORTH;\n } else if (directionCount == 1) {\n d = Direction.EAST;\n } else if (directionCount == 2) {\n d = Direction.SOUTH;\n } else if (directionCount == 3) {\n d = Direction.WEST;\n } else {\n if (!popped.isEmpty()) {\n if (popped.peek().getType() == Type.ENTRANCE) {\n throw new NoRouteFoundException();\n }\n }\n popped.push(route.pop());\n break;\n }\n nextTile = maze.getAdjacentTile(route.peek(), d);\n if (nextTile.isNavigable() && !route.contains(nextTile) && !popped.contains(nextTile)) {\n route.push(maze.getAdjacentTile(route.peek(), d));\n break;\n } else {\n directionCount += 1;\n continue;\n }\n }\n\n if (!route.isEmpty()) {\n if (route.peek().getType() == Type.EXIT) {\n finished = true;\n return true;\n }\n }\n return false;\n\n }\n } catch (NoRouteFoundException e) {\n System.out.println(e);\n throw e;\n }\n }", "public boolean endOfBlock () {\n if (index >= blockIn.length()) {\n blockEnded = true;\n }\n return blockEnded;\n }", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "private boolean thereispath(Move m, Tile tile, Integer integer, Graph g, Board B) {\n\n boolean result = true;\n boolean result1 = true;\n\n int start_dest_C = tile.COLUMN;\n int start_dest_R = tile.ROW;\n\n int move_column = m.getX();\n int move_row = m.getY();\n\n int TEMP = 0;\n int TEMP_ID = 0;\n int TEMP_ID_F = tile.id;\n int TEMP_ID_FIRST = tile.id;\n\n int final_dest_R = (integer / B.width);\n int final_dest_C = (integer % B.width);\n\n //System.out.println(\"* \" + tile.toString() + \" \" + integer + \" \" + m.toString());\n\n // Y ROW - X COLUMN\n\n for (int i = 0; i != 2; i++) {\n\n TEMP_ID_FIRST = tile.id;\n\n // possibility 1\n if (i == 0) {\n\n\n // first move columns\n for (int c = 0; c != Math.abs(move_column) && result != false; c++) {\n\n if (c == 0) {\n TEMP_ID_FIRST = tile.id;\n\n } else {\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n }\n\n TEMP = move_column / Math.abs(move_column);\n\n //System.out.println(\"1C:\" + TEMP);\n\n //System.out.println(\" \" + TEMP_ID_FIRST + \" - > \" + (start_dest_C + TEMP));\n\n start_dest_C += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n //System.out.println(TEMP_ID_FIRST + \" = \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n // System.out.println(\"OK\");\n\n } else {\n\n result = false;\n\n // System.out.println(\"NOPE\");\n\n\n }\n }\n\n for (int r = 0; r != Math.abs(move_row) && result != false; r++) {\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_row / Math.abs(move_row);\n\n //System.out.println(\"1R:\" + TEMP);\n\n //System.out.println(start_dest_R + \" - > \" + (start_dest_R + TEMP));\n\n start_dest_R += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n // System.out.println(TEMP_ID_FIRST + \" and \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n\n } else {\n\n result = false;\n\n //System.out.println(\"NOPE\");\n\n\n }\n }\n\n if (result == true) {\n return true;\n }\n\n\n }\n\n TEMP_ID = 0;\n\n if (i == 1) {\n\n result = true;\n\n start_dest_C = tile.COLUMN;\n start_dest_R = tile.ROW;\n // first move row\n for (int r = 0; r != Math.abs(move_row) && result1 != false; r++) {\n\n if (r == 0) {\n TEMP_ID_FIRST = tile.id;\n\n } else {\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n }\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_row / Math.abs(move_row);\n\n //System.out.println(\"1R:\" + TEMP);\n\n //System.out.println(start_dest_R + \" - > \" + (start_dest_R + TEMP));\n\n start_dest_R += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n\n //System.out.println(TEMP_ID_FIRST + \" = \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n } else {\n\n //System.out.println(\"NOPE\");\n\n result = false;\n\n }\n\n\n }\n\n // first move columns\n for (int c = 0; c != Math.abs(move_column) && result1 != false; c++) {\n\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_column / Math.abs(move_column);\n\n //System.out.println(\"1C:\" + TEMP);\n\n //System.out.println(\" \" + TEMP_ID_FIRST + \" - > \" + (start_dest_C + TEMP));\n\n start_dest_C += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n //System.out.println(TEMP_ID_FIRST + \" and \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n } else {\n result = false;\n\n //System.out.println(\"NOPE\");\n\n\n }\n }\n\n if (result == false) {\n return false;\n\n }\n\n\n }\n\n\n }\n\n\n return true;\n }", "@Override\n public boolean isFinished() {\n return !(System.currentTimeMillis() - currentMs < timeMs) &&\n // Then check to see if the lift is in the correct position and for the minimum number of ticks\n Math.abs(Robot.lift.getPID().getSetpoint() - Robot.lift.getEncoderHeight()) < error\n && ++currentCycles >= minDoneCycles;\n }", "private boolean isBlockAvailable(BlockShape shape) {\n boolean result = false;\n\n for (BlockColor color : map_color_to_id.keySet()) {\n if (objBlockFactory.IsBlocktypeAvailable(shape, color)){\n result = true;\n break;\n }\n }\n return result;\n }", "public boolean continueExecuting()\n {\n double var1 = this.theEntity.getDistanceSq((double)this.entityPosX, (double)this.entityPosY, (double)this.entityPosZ);\n return this.breakingTime <= 240 && !this.field_151504_e.func_150015_f(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ) && var1 < 4.0D;\n }", "private boolean isPathH(Board B, Move M, Graph G, int row, int column, Tile tile) {\n\n Tile t = tile;\n\n boolean result = true;\n boolean tempa = true;\n\n int sourceid = 0;\n\n\n int c = M.getX(), r = M.getY();\n\n if (r <= 0 && c <= 0) {\n\n\n } else if (r <= 0 && c >= 0) {\n\n\n } else if (r >= 0 && c >= 0) {\n\n for (int y = 0; y != 2; y++) {\n\n sourceid = (row * B.width) + column;\n\n // System.out.println(\"source id: \" + sourceid);\n\n if (y == 0) {\n\n\n //aab\n for (int i = 0; i != r; i++) {\n\n System.out.println(G.adj(sourceid).toString());\n\n if (G.adj.get(sourceid).contains(sourceid + B.width)) {\n\n // System.out.println(\"row artı\");\n\n } else {\n\n result = false;\n\n }\n\n sourceid += B.width;\n\n }\n\n for (int i = 0; i != c; i++) {\n\n\n if (G.adj.get(sourceid).contains(sourceid + 1)) {\n\n // System.out.println(\"okk\");\n\n } else {\n\n //return false;\n\n }\n\n sourceid += 1;\n\n System.out.println(\"b\");\n\n }\n } else {\n\n sourceid = row * B.width + column;\n\n for (int i = 0; i != c; i++) {\n // System.out.println(\"a\");\n\n }\n for (int i = 0; i != r; i++) {\n // System.out.println(\"b\");\n\n }\n }\n\n\n }\n\n\n }\n\n\n return result;\n }", "public boolean isLegalStep(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\tint[] toCheckPos = new int[2];\n\t\tint[] existingPos = new int[2];\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\ttoCheckPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t} else {\n\t\t\ttoCheckPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t}\n\t\t//0 = column, 1 = row\n\t\tif(dir == MoveDirection.North) {\n\t\t\tif(toCheckPos[1] == 1) return false;\n\t\t\tif(toCheckPos[1] - 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), -1, 0);\n\t\t} else if(dir == MoveDirection.South) {\n\t\t\tif(toCheckPos[1] == 9) return false;\n\t\t\tif(toCheckPos[1] + 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 1, 0);\n\t\t} else if(dir == MoveDirection.East) {\n\t\t\tif(toCheckPos[0] == 9) return false;\n\t\t\tif(toCheckPos[0] + 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, 1);\n\t\t} else if(dir == MoveDirection.West) {\n\t\t\tif(toCheckPos[0] == 1) return false;\n\t\t\tif(toCheckPos[0] - 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, -1);\n\t\t}\n\t\t\n\t\treturn false;\r\n }", "public boolean continueExecuting()\n\t{\n\t\treturn this.entity.posX != this.xPosition && this.yPosition != this.entity.posY && this.entity.posZ != this.zPosition;\n\t}", "public boolean work() {\n // get the next block so the cart knows where to mine\n Vec3 next = getNextblock();\n // save thee coordinates for easy access\n int x = (int) next.xCoord;\n int y = (int) next.yCoord;\n int z = (int) next.zCoord;\n\n // loop through the blocks in the \"hole\" in front of the cart\n\n for (int i = -getRange(); i <= getRange(); i++) {\n for (int j = -getRange(); j <= getRange(); j++) {\n // calculate the coordinates of this \"hole\"\n int coordX = x + i;\n int coordY = y - 1;\n int coordZ = z + j;\n\n if (farm(coordX, coordY, coordZ)) {\n return true;\n } else if (till(coordX, coordY, coordZ)) {\n return true;\n } else if (plant(coordX, coordY, coordZ)) {\n return true;\n }\n }\n }\n\n return false;\n }", "public boolean isLastLinkOfRouteInvalidLinkForParking() {\r\n\t\tLeg leg = (LegImpl) getPerson().getSelectedPlan().getPlanElements().get(getPlanElementIndex());\r\n\t\tLinkNetworkRouteImpl route = (LinkNetworkRouteImpl) leg.getRoute();\r\n\r\n\t\tboolean isInvalidLink = false;\r\n\t\tint nextCarLegIndex = duringCarLeg_getPlanElementIndexOfNextCarLeg();\r\n\t\tif (nextCarLegIndex != -1) {\r\n\t\t\tisInvalidLink = route.getEndLinkId().toString().equalsIgnoreCase(getInvalidLinkForParking().toString());\r\n\t\t}\r\n\t\treturn isInvalidLink;\r\n\t}", "public boolean hasPathTo(int v){\n\t\tvalidateVertex(v);\n\t\treturn distTo[v]<Double.POSITIVE_INFINITY;\n\t}", "private boolean hasReachedBottom() {\n\t\tfor (Segment s:this.getHorizontalProjection().getShapeSegments()){\n\t\t\t\n\t\t\tHeightProfile hs = this.grid.heightAt(s);\n\t\t\t\n\t\t\tfor (int h : hs){\n\t\t\t\t\n\t\t\t\tif (this.bottomLeft.getY() <= h){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isGoal() {\n if (blocks[dimension()-1][dimension()-1] != 0) return false;\n return hamming() == 0;\n }", "@Override\n public boolean isPointInPath(double x, double y) {\n return graphicsEnvironmentImpl.isPointInPath(canvas, x, y);\n }", "private boolean allAdjacentUsed(Box box) {\n if (box == null)\n throw new IllegalArgumentException(\"Error. null pointer in allAdjacentUsed(box).\");\n return isNextBoxUsed(box, 0) && isNextBoxUsed(box, 1) && isNextBoxUsed(box, 2) && isNextBoxUsed(box, 3);\n }", "private Cell nextNotVisitedCell(Cell current) {\n if (current.isValidDirection(LEFT) && !cells[current.col - 1][current.row].visited)\n return cells[current.col - 1][current.row];\n\n // Check whether the right cell is visited, if there is one.\n if (current.isValidDirection(RIGHT) && !cells[current.col + 1][current.row].visited)\n return cells[current.col + 1][current.row];\n\n // Check whether the cell above is visited, if there is one.\n if (current.isValidDirection(UPWARD) && !cells[current.col][current.row - 1].visited)\n return cells[current.col][current.row - 1];\n\n // Check whether the cell below is visited, if there is one.\n if (current.isValidDirection(DOWNWARD) && !cells[current.col][current.row + 1].visited)\n return cells[current.col][current.row + 1];\n\n return null;\n }", "public boolean isBlocked(java.util.List<Ball> myObjects)\n {\n boolean _isBlocked = false;\n for(Ball that : myObjects)\n {\n // beruehrt eines der Objekte das OutputHole\n if(this.touches(that))\n {\n // WENN ja DANN ist OutPutHole blockiert\n _isBlocked = _isBlocked || true;\n }\n }\n\n return _isBlocked;\n }", "protected boolean inSomeBlock() {\n return !enclosingBlocks.isEmpty();\n }", "public boolean isBlocking ( ) {\n\t\treturn extract ( handle -> handle.isBlocking ( ) );\n\t}", "private static boolean isObstacleBetweenSteps(Point3DReadOnly pawPosition, Point3DReadOnly previousPawPosition, List<PlanarRegion> planarRegions,\n double groundClearance)\n {\n if (pawPosition.distance(previousPawPosition) < PawNode.gridSizeXY)\n return false;\n\n PlanarRegion bodyPath = createBodyCollisionRegionFromTwoFeet(pawPosition, previousPawPosition, groundClearance, 2.0);\n\n for (PlanarRegion region : planarRegions)\n {\n if (!region.intersect(bodyPath).isEmpty())\n return true;\n }\n\n return false;\n }", "public boolean percolates() {\n if (this.n == 1) return isOpen(1, 1);\n return this.uf.connected(0, this.n * this.n + 1);\n }", "public boolean isPathCrossing(String path) {\n // keep track of x and y position \n int x = 0;\n int y = 0;\n // Hashset to hold cordinates \n HashSet<String> known = new HashSet<String>();\n // add original\n known.add(\"0,0\");\n // go through each char in the string\n for(int i = 0; i < path.length(); ++i){\n if(path.charAt(i) == 'N') ++x;\n \n else if(path.charAt(i) == 'S') --x;\n \n else if(path.charAt(i) == 'W') --y;\n \n else if(path.charAt(i) == 'E') ++y;\n \n String loc = x + \",\" + y;\n // if it is already there, return true\n if(known.contains(loc)) return true;\n // otherwise add and keep going\n known.add(loc);\n }\n // no known cordinates were found so return false\n return false;\n }", "@Override\n public boolean hasNext()\n {\n if (!this.isPathValid()) {\n String msg = \"Annotated Path\" + this.getStart().getLocation() + \"->\" +\n this.getGoal().getLocation() + \": Cannot tell if path has \" +\n \"next step when it is invalid.\";\n logger.severe(msg);\n throw new IllegalStateException(msg);\n }\n return !this.path.isEmpty();\n }", "boolean isLegal(Move move) {\n int count = pieceCountAlong(move);\n int c0 = move.getCol0();\n int r0 = move.getRow0();\n int c1 = move.getCol1();\n int r1 = move.getRow1();\n int count2 = Math.max(Math.abs(c1 - c0), Math.abs(r1 - r0));\n return ((count == count2) && !blocked(move));\n }", "public boolean solve()\n\t{\n Position[] pos=path.getLastStep().neighbors();\n if (grid.isOnBoundary(path.getLastStep())&&grid.isOpen(path.getLastStep()))\n\t\treturn true;\n if (path.getLastStep()==start)\n return false;\n for (int i=0;i<4;i++)\n {\n if (pos[i]!=path.getLastStep() && grid.isOpen(pos[i]))\n path.extend(pos[i]);\n }\n if (grid.isBlocked(path.getLastStep())||grid.isRejected(path.getLastStep()))\n {\n path.backUp();\n solve();\n }\n return false;\n \n\t}", "private static Boolean checkForContinuousConnectivity()\n\t{\n\t\tint row=0;\n\t\tint column=0;\n\t\tBoolean floorFound=false;\n\n\t\tfor(int i=0; i<board.length; i++)\n\t\t{\n\t\t\tfor(int j=0; j<board[i].length; j++)\n\t\t\t{\n\t\t\t\tif(board[i][j]==Cells.FLOOR)\n\t\t\t\t{\n\t\t\t\t\trow=i;\n\t\t\t\t\tcolumn=j;\n\t\t\t\t\tfloorFound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (floorFound)\n\t\t\t\tbreak;\n\t\t}\n\n\t\tfor(int i=0; i<board.length; i++)\n\t\t{\n\t\t\tfor(int j=0; j<board[i].length; j++)\n\t\t\t{\n\t\t\t\tif(board[i][j]==Cells.FLOOR && !(_PF.canFindAWay(column, row, j, i)))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "private boolean isInBlock(int number, int row, int col) {\n\t\trow = row - (row % 3);\n\t\tcol = col - (col % 3);\n\n\t\tfor (int i = row; i < row + 3; i++) {\n\t\t\tfor (int j = col; j < col + 3; j++) {\n\t\t\t\tif (getNumber(i, j) == number) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean percolates(){\n \tif(this.gridLength == 1){\n \t\treturn isOpen(1,1);\n \t}\n \treturn (this.bottom[unionTest.find(0)]);\n }" ]
[ "0.69033813", "0.66249", "0.64961123", "0.6278562", "0.62648964", "0.5988071", "0.59687364", "0.59593856", "0.5851925", "0.58217597", "0.5778345", "0.57479066", "0.5718844", "0.571003", "0.56869113", "0.5674364", "0.56648433", "0.5662675", "0.56505704", "0.5623092", "0.5605754", "0.55969995", "0.55959964", "0.55823493", "0.5573654", "0.55717474", "0.55478036", "0.5543254", "0.55346256", "0.5503812", "0.54900897", "0.5489794", "0.5478551", "0.54683524", "0.5468247", "0.5451265", "0.5443126", "0.5441631", "0.5440494", "0.5433636", "0.5433622", "0.5429127", "0.5427208", "0.5419652", "0.5409528", "0.53988117", "0.5398688", "0.53952515", "0.5394735", "0.53927547", "0.5388948", "0.53661394", "0.53540087", "0.53251433", "0.5312843", "0.53086126", "0.53069603", "0.5304993", "0.53006274", "0.5300607", "0.52987415", "0.52803403", "0.52784187", "0.5270114", "0.5269296", "0.52632755", "0.5261893", "0.52609575", "0.5258249", "0.5258086", "0.52510875", "0.52480614", "0.5245802", "0.5245322", "0.52443314", "0.5242903", "0.523495", "0.5231298", "0.5231007", "0.5229867", "0.52258116", "0.5223352", "0.5218", "0.5211196", "0.52097094", "0.5207543", "0.5204509", "0.5199258", "0.5189787", "0.51819754", "0.51807874", "0.51792717", "0.5174553", "0.51738715", "0.5173075", "0.51723826", "0.51654136", "0.5154239", "0.5151545", "0.5146512" ]
0.6389076
3
Checks if next coordinate in path is visited.
public abstract boolean isNextVisited();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isVisited () {\n if (this.equals(SquareType.VISITED))\n return true;\n else\n return false;\n }", "public boolean hasBeenVisited() {\n\t\treturn visited; // Replace with your code\n\t}", "public boolean isVisited(){\n return visited;\n }", "private boolean isCellVisited(Cell cell) {\n\t\tboolean result;\n\t\t// Return true to skip it if cell is null\n\t\tif (!isIn(cell))\n\t\t\treturn true;\n\n\t\tint r = cell.r;\n\t\tint c = cell.c;\n\t\tif (maze.type == HEX) {\n\t\t\tc = c - (r + 1) / 2;\n\t\t}\n\t\ttry {\n\t\t\tresult = visited[r][c];\n\t\t} catch (Exception e) {\n\t\t\tresult = true;\n\t\t}\n\n\t\treturn result;\n\t}", "public boolean isVisited()\n\t{\n\t\treturn visited;\n\t}", "public boolean isVisited() {\n return visited;\n }", "public boolean hasValidPath(int[][] grid) {\n int m = grid.length;\n int n = grid[0].length;\n boolean[][] visited = new boolean[m][n];\n\n Queue<int[]> queue = new LinkedList<>();\n queue.add(new int[] {0, 0});\n visited[0][0] = true;\n\n while (!queue.isEmpty()) {\n int[] current = queue.poll();\n int x = current[0];\n int y = current[1];\n int num = grid[x][y] - 1;\n for (int[] dir : dirs[num]) {\n int nx = x + dir[0], ny = y + dir[1];\n if (nx < 0 || nx >= m || ny < 0 || ny >= n || visited[nx][ny]) continue;\n // go to the next cell and come back to origin to see if port directions are same\n // if not visited and can be connected, add to queue\n for (int[] backDir : dirs[grid[nx][ny] - 1]) {\n if (nx + backDir[0] == x && ny + backDir[1] == y) {\n visited[nx][ny] = true;\n queue.add(new int[] {nx, ny});\n }\n }\n }\n }\n\n return visited[m - 1][n - 1];\n }", "public boolean isVisited() {\n\t\treturn visited;\n\t}", "public boolean isVisited() {\n return visited;\n }", "boolean isVisited();", "boolean isVisited();", "public boolean checkWalkStep(int lastX, int lastY, int nextX, int nextY) {\n return true;\n }", "public boolean visited(int i) {\r\n return visited[i] == visitedToken;\r\n }", "private boolean shouldReplanPath(State.StateView state, History.HistoryView history, Stack<MapLocation> currentPath)\n {\n \t\t/* TODO: Write this method\n \t\t * Check if the path is blocked every step or check if the next spot is blocked?\n \t\t * Does enemy attack if you get too close?\n \t\t */\n \t\n \t\n \t\t//checking if the next step is blocked\n \t\t//setting up local fields\n \t\tUnitView enemy = state.getUnit(enemyFootmanID);\n \t\tMapLocation next;\n \t\tif (!path.isEmpty()) {\n \t\t\tnext = path.peek();\n \t\t\n \t\t\tif(next.x == enemy.getXPosition() && next.y == enemy.getYPosition()) \n \t\t\t\treturn true;\n \t\t\t\n \t\t}\n \t\t\n return false;\n }", "public boolean WasVisited() { return _visited; }", "public boolean isVisited() {\n\t\treturn _visited;\n\t}", "public boolean hasPathTo(int v) {\n return visited[v];\n }", "@Override\n public boolean hasNext()\n {\n if (!this.isPathValid()) {\n String msg = \"Annotated Path\" + this.getStart().getLocation() + \"->\" +\n this.getGoal().getLocation() + \": Cannot tell if path has \" +\n \"next step when it is invalid.\";\n logger.severe(msg);\n throw new IllegalStateException(msg);\n }\n return !this.path.isEmpty();\n }", "public boolean isVisited() {\r\n\t\t\treturn this.visited;\r\n\t\t}", "public boolean hasPath(int[][] maze, int[] start, int[] destination) {\n if (isWall(maze, start[0], start[1])) {\n return false;\n }\n\n boolean[][] visited = new boolean[maze.length][maze[0].length];\n\n Queue<int[]> queue = new LinkedList<>();\n queue.add(start);\n\n int[] currentPosition = null;\n visited[start[0]][start[1]] = true;\n while ((currentPosition = queue.poll()) != null) {\n int row = currentPosition[0];\n int col = currentPosition[1];\n\n // whether is destination\n if (reachDest(destination, row, col)) {\n return true;\n }\n\n // for all the 4 neighbours of current position\n for (int i = 0; i < 4; i++) {\n int nRow = row + neighbourDir[i][0]; // neighbour row\n int nCol = col + neighbourDir[i][1]; // neighbour col\n\n // keep going when there is no wall\n while (!isWall(maze, nRow, nCol)) {\n nRow += neighbourDir[i][0];\n nCol += neighbourDir[i][1];\n }\n\n // To get here, means current position is a wall, so the coordinate should be adjusted\n int lastRow = nRow - neighbourDir[i][0];\n int lastCol = nCol - neighbourDir[i][1];\n\n if (!isWall(maze, lastRow, lastCol) && !visited[lastRow][lastCol]) {\n // not visited\n visited[lastRow][lastCol] = true;\n queue.add(new int[]{lastRow, lastCol});\n }\n }\n\n }\n\n return false;\n }", "@Override\r\n\tpublic boolean isVisited() {\n\t\treturn false;\r\n\t}", "public boolean isVisited() {\n return isVisited;\n }", "public boolean isPathCrossing(String path) {\n // keep track of x and y position \n int x = 0;\n int y = 0;\n // Hashset to hold cordinates \n HashSet<String> known = new HashSet<String>();\n // add original\n known.add(\"0,0\");\n // go through each char in the string\n for(int i = 0; i < path.length(); ++i){\n if(path.charAt(i) == 'N') ++x;\n \n else if(path.charAt(i) == 'S') --x;\n \n else if(path.charAt(i) == 'W') --y;\n \n else if(path.charAt(i) == 'E') ++y;\n \n String loc = x + \",\" + y;\n // if it is already there, return true\n if(known.contains(loc)) return true;\n // otherwise add and keep going\n known.add(loc);\n }\n // no known cordinates were found so return false\n return false;\n }", "private boolean DFSUtil(State state, ArrayList<String> visited, int currentDepth) {\n // Mark the current node as visited and print it\n visited.add(state.joinValues());\n\n this.path.push(state);\n\n if (this.problem.goalTest(state)) {\n return true;\n }\n\n // Recur for all the vertices adjacent to this vertex\n // extend the current node\n ListIterator<State> iterator = this.extend(state).listIterator();\n this.incrementExtendedNumber();\n while (iterator.hasNext()) {\n State state1 = iterator.next();\n if (this.limit > currentDepth) {\n if (this.graphSearch && !visited.contains(state1.joinValues())) {\n this.incrementVisitedNumber();\n if (DFSUtil(state1, visited, currentDepth + 1))\n return true;\n else\n this.path.pop();\n } else if (!this.graphSearch) {\n this.incrementVisitedNumber();\n if (DFSUtil(state1, visited, currentDepth + 1))\n return true;\n else\n this.path.pop();\n }\n }\n\n\n this.setMaxMemory(this.path.size());\n }\n return false;\n }", "public boolean getVisited()\n {\n return visited;\n }", "@Override\n public boolean isFinished() \n {\n int curCount = mPath.kNumPoints - mCount;\n if(curCount<1)\n {\n System.out.println(mPath.kNumPoints);\n }\n \n return curCount<1;\n }", "public boolean getVisited() {\n return visited;\n }", "public boolean hasPath(Graph graph) {\n\t\tif (!isNonZeroDegreeVerticesConnected(graph)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// (2) number of odd vertices has to be between zero to two\n\t\tint vertices = graph.countVertices();\n\t\tint odd = 0;\n\t\tfor (int i = 0; i < vertices; i++) {\n\t\t\t// counting number of odd vertices\n\t\t\tif (((graph.getNeighbours(i).length & 1) == 1)) {\n\t\t\t\todd++;\n\t\t\t}\n\t\t}\n\n\t\tif (odd <= 2) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private boolean wasVisited(int city){\n\t\treturn this.getGraph().wasVisited(city);\n\t}", "public boolean passedBy(Line2D path) {\n\t\tfor (int i = 0; i < coordinates.size() - 1; i++) {\n\t\t\tvar p1 = coordinates.get(i);\n\t\t\tvar p2 = coordinates.get(i + 1);\n\t\t\tLine2D buildingEdge = new Line2D.Double(p1.getLng(), p1.getLat(), p2.getLng(), p2.getLat()); // x1, y1, x2, y2 \n\t\t\tif (buildingEdge.intersectsLine(path)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private static boolean isMoveValid( int x, int y ){\n int path[] = new int[8];\n for( int distance = 1; distance < 8; distance ++ ){\n checkPath( path, 0, x + distance, y, distance );\n checkPath( path, 1, x + distance, y + distance, distance );\n checkPath( path, 2, x, y + distance, distance );\n checkPath( path, 3, x - distance, y, distance );\n checkPath( path, 4, x - distance, y - distance, distance );\n checkPath( path, 5, x, y - distance, distance );\n checkPath( path, 6, x + distance, y - distance, distance );\n checkPath( path, 7, x - distance, y + distance, distance );\n }\n for( int i = 0; i < 8; i++ ){\n if( path[ i ] > 1 ){\n return true;\n }\n }\n return false;\n }", "private boolean dfs(int[][] maze, boolean[][] visited, int[] start, int[] destination) {\n\t\tif(Arrays.equals(start, destination)) return true;\n\t\tint i = start[0];\n\t\tint j = start[1];\n\t\tif(visited[i][j])\n\t\t\treturn false;\n\t\tvisited[i][j] = true;\n\t\tBiPredicate<Integer, Integer> roll = (rowInc, colInc) -> {\n\t\t\tint ii = i, jj = j;\n\t\t\twhile(ii >= 0 && ii <= maze.length - 1 && jj >= 0 && jj <= maze[0].length - 1 && maze[ii][jj] != 1) {\n\t\t\t\tii += rowInc;\n\t\t\t\tjj += colInc;\n\t\t\t}\n\t\t\treturn dfs(maze, visited, new int[] {ii - rowInc, jj - colInc}, destination)\n\t\t};\n\t\tif(roll.test(1, 0)) return true;\n\t\tif(roll.test(-1, 0)) return true;\n\t\tif(roll.test(0, 1)) return true;\n\t\tif(roll.test(0, -1)) return true;\n\t\t\n\t\treturn false;\n\t}", "private boolean tryFindPath() {\n\t\t\tfor (Node neighbour : neighbours) {\n\t\t\t\tif (neighbour.x == n || neighbour.y == 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (!neighbour.isReachable()) {\n\t\t\t\t\tneighbour.setReachable();\n\t\t\t\t\tif (neighbour.tryFindPath()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "private static boolean findHamiltonianPath(SequenceGraph graph,\n\t SequenceGraph.Node current,\n\t Set<SequenceGraph.Node> visited,\n\t LinkedList<SequenceGraph.Node> path) {\n\t\tif (visited.contains(current)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Mark current Node\n\t\tpath.add(current);\n\t\tvisited.add(current);\n\n\t\t// Check path-terminating state\n\t\tif (current.getChildren().size() == 0) {\n\t\t\tif (path.size() == graph.size()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tpath.removeLast();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Recurse on children\n\t\tfor (SequenceGraph.Node child : current.getChildren()) {\n\t\t\tif (findHamiltonianPath(graph, child, visited, path)) {\n\t\t\t\t// Path found through child\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// No path through current node given current path\n\t\tpath.removeLast();\n\t\tvisited.remove(current);\n\n\t\treturn false;\n\t}", "public boolean foundGoal() \r\n\t{\r\n\t\t// Write the method that determines if the walker has found a way out of the maze.\r\n\t\treturn ( currentCol < 0 || currentRow < 0 || \r\n\t\t\t\t currentCol >= size || currentRow >= size );\r\n\t}", "public boolean pathWasFound(int goal) {\n if (path[goal] < 0 ) {\n return false;\n }\n return true;\n }", "public boolean pathExists(int startVertex, int stopVertex) {\n// your code here\n ArrayList<Integer> fetch_result = visitAll(startVertex);\n if(fetch_result.contains(stopVertex)){\n return true;\n }\n return false;\n }", "public static boolean hasPathDFS(Graph g, int src, int dest, boolean[] visited, Stack<Integer> path) {\n visited[src] = true;\n // include the current node in the path\n path.add(src);\n\n if (src == dest) return true;\n\n for (int u : g.adjacencyList.get(src)) {\n if (!visited[u]) {\n if (hasPathDFS(g, u, dest, visited, path)) return true;\n }\n }\n\n // backtrack: remove the current node from the path\n // If the current folder is not part of the path to the destination, remove it\n path.pop();\n return false;\n }", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "private boolean findNumSafeLandHelper(int[][] array, int[][] visited, int row, int col) {\n\t\tif (array[row][col] == 0 || visited[row][col] == 1) {\n\t\t\treturn false;\n\t\t}\n\t\t// if the currnet square is at the border and its not visited and its\n\t\t// not sea then it means this is a safe land\n\t\tif (row == 0 || (row == array.length - 1) || col == 0 || (col == array.length - 1)) {\n\t\t\treturn true;\n\t\t}\n\t\t// backtrack to all four directions and find is there any safe land path\n\t\t// present\n\t\tboolean isPathPresent = false;\n\t\tvisited[row][col] = 1;\n\t\t// check all four direction from the currnet square\n\t\tisPathPresent = (row > 0 ? findNumSafeLandHelper(array, visited, row - 1, col) : false)\n\t\t\t\t|| (row < (array.length - 1) ? findNumSafeLandHelper(array, visited, row + 1, col) : false)\n\t\t\t\t|| (col > 0 ? findNumSafeLandHelper(array, visited, row, col - 1) : false)\n\t\t\t\t|| (col < (array.length - 1) ? findNumSafeLandHelper(array, visited, row, col + 1) : false);\n\t\tvisited[row][col] = 0;\n\t\treturn isPathPresent;\n\t}", "public boolean step() {\n Tile nextTile;\n Direction d;\n int directionCount = 0;\n try {\n if (finished == true) {\n return true;\n }\n if (route.empty()) {\n route.push(maze.getEntrance());\n return false;\n } else {\n while (true) {\n if (directionCount == 0) {\n d = Direction.NORTH;\n } else if (directionCount == 1) {\n d = Direction.EAST;\n } else if (directionCount == 2) {\n d = Direction.SOUTH;\n } else if (directionCount == 3) {\n d = Direction.WEST;\n } else {\n if (!popped.isEmpty()) {\n if (popped.peek().getType() == Type.ENTRANCE) {\n throw new NoRouteFoundException();\n }\n }\n popped.push(route.pop());\n break;\n }\n nextTile = maze.getAdjacentTile(route.peek(), d);\n if (nextTile.isNavigable() && !route.contains(nextTile) && !popped.contains(nextTile)) {\n route.push(maze.getAdjacentTile(route.peek(), d));\n break;\n } else {\n directionCount += 1;\n continue;\n }\n }\n\n if (!route.isEmpty()) {\n if (route.peek().getType() == Type.EXIT) {\n finished = true;\n return true;\n }\n }\n return false;\n\n }\n } catch (NoRouteFoundException e) {\n System.out.println(e);\n throw e;\n }\n }", "@Override\r\n protected boolean isGoal(Point node) {\r\n return (node.equals(finish));\r\n }", "private static boolean AllCellsVisited()\n {\n for (Cell arr[] : cells){\n for (Cell c : arr)\n {\n if (!c.Visited)\n {\n return false;\n }\n }\n }\n return true;\n }", "public boolean hasNextHop()\n {\n return getHopCount() < route.size()-1;\n }", "public static boolean getPath(int x, int y, ArrayList<Point> path) {\n\t\tif (x > size-1 || y > size-1 || !isFree(x, y)) { // !isFree -> [x][y] = 0\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tboolean isAtFinal = (x == size-1) && (y == size-1); //destination: 5, 5\n\t\t\n\t\t//if there is a path from my current to end, add it\n\t\tif(isAtFinal || getPath(x, y+1, path) || getPath(x+1, y, path)){\n\t\t\tPoint p = new Point(x,y);\n\t\t\tpath.add(p);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean finished() {\r\n\t\tboolean allOccupied = true;\r\n\t\tfor (Node n : allNodes.values()) {\r\n\t\t\tif (n.path == 0) {\r\n\t\t\t\tallOccupied = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (allOccupied) {\r\n\r\n\t\t\tfor (Integer path : paths.keySet()) {\r\n\t\t\t\tStack<Node> sn=paths.get(path);\r\n\t\t\t\tNode n = sn.peek();\r\n\t\t\t\tif (!EndPoint.containsValue(n)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (sn.size() > 1) {\r\n\t\t\t\t\tStack<Node> snBK = (Stack<Node>) sn.clone();\r\n\t\t\t\t\t\r\n\t\t\t\t\tNode n1 = snBK.pop();\r\n\t\t\t\t\twhile (!snBK.isEmpty()) {\r\n\t\t\t\t\t\tif(n1.path!=path)\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\tNode n2= snBK.pop();\r\n\t\t\t\t\t\tif(adjaMatrix[n1.index][n2.index]==0)\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tn1=n2;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t\treturn false;\r\n\t}", "@Override\n public boolean hasNext() {\n // If there is a valid next, return true\n if (this.next != null){\n return true;\n } else {\n // If next is not calculated, compute the next valid\n Node<S> next = popNextUnvisitedNode();\n this.next = next;\n return next != null;\n }\n }", "private boolean isReachable(String current, String destination) {\n if (current.equals(destination)) {\n return true;\n } else if (visited.contains(current) || graph.get(current) == null) {\n return false;\n }\n\n // similar to dfs\n visited.add(current);\n for (Object vertex : graph.get(current)) {\n if (isReachable((String) vertex, destination))\n return true;\n }\n\n return false;\n }", "public boolean hasPathTo(int v){\n\t\tvalidateVertex(v);\n\t\treturn distTo[v]<Double.POSITIVE_INFINITY;\n\t}", "public boolean hasCycle() {\r\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\r\n\t\tSet<Vertex> path = new HashSet<Vertex>();\r\n\r\n\t\t// Call the helper function to detect cycle for all vertices one by one\r\n\t\tfor (int i = 0; i < N; ++i)\r\n\t\t\tif (detectCycle(this.vertices[i], visited, path))\r\n\t\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}", "public boolean isSquareVisited(int row, int col) {\n return playingBoard[row][col].isVisited();\n }", "public boolean checkLastNodeStatus()\r\n {\r\n return visitedNodes.isEmpty();\r\n }", "public boolean validNextMove(int row, int col, Cell[][] maze) {\n int[][] dirs = {{0, -1}, {0, 1}, {-1, 0}, {1, 0}};\n int count = 0;\n for (int[] dir : dirs) {\n int newRow = row + dir[0];\n int newCol = col + dir[1];\n if (maze[newRow][newCol].getValue() == 1) {\n count++;\n }\n }\n if (count >= 3) {\n return false;\n } else {\n return true;\n }\n }", "@Override\r\n\tpublic boolean isConnected(GraphStructure graph) {\r\n\t\tgetDepthFirstSearchTraversal(graph);\r\n\t\tif(pathList.size()==graph.getNumberOfVertices()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean canMove() {\n\t\tArrayList<Location> loc = getValid(getLocation());\n\t\tif (loc.isEmpty()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tpath.add(getLocation());\n\t\t\tif (loc.size() >= 2) {\n\t\t\t\tcrossLocation.push(path);\n\t\t\t\tpath = new ArrayList<Location>();\n\t\t\t\tnext = betterDir(loc);\n\t\t\t}\n\t\t\tnext = loc.get(0);\n\t\t}\n\t\treturn true;\n\t}", "private boolean visited(int hashCode){\n \t\t//.add returns true if hashCode was added (meaning hashCode haven't been added before)\n \t\tif(visited.add(hashCode))\n \t\t\treturn false;\n \t\telse\n \t\t\treturn true;\n \t}", "protected final boolean computeHasNext() {\n return this.getEnds().getGraph().getSuccessorEdges(this.getNext()).isEmpty();\n }", "@Override\n\tpublic void pathFinderVisited(int x, int y) {\n\t}", "public static boolean checkPositionInPath(Vector<int[]> path, int x, int y){\n\t\tboolean positionChecker = false;\r\n\t\tfor(int i = 0; i < path.size(); i++)\r\n\t\t{\r\n\t\t\tif(path.get(i)[0] == x && path.get(i)[1] == y)\r\n\t\t\t{\r\n\t\t\t\tpositionChecker = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn positionChecker;\r\n\t}", "public final boolean visited(Node n)\n {\n return colors[n.nodeId()] != Color.white;\n }", "private boolean hasPath(GraphNode origin, GraphNode destination) {\n if (origin.node.getName().equals(outputNode.getName()) || destination.node.getName().equals(inputNode.getName()))\n return false;\n\n Queue<GraphNode> queue = new LinkedList<GraphNode>();\n queue.offer(origin);\n\n while(!queue.isEmpty()) {\n GraphNode current = queue.poll();\n if (current == destination) {\n return true;\n }\n else {\n for (GraphEdge e : current.to) {\n queue.offer(e.to);\n }\n }\n }\n return false;\n }", "public boolean isGoal() {\n if (posX != N-1 || posY != N-1) return false;\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (matrix[i][j] == 0) continue;\n if (i*N+j+1 != matrix[i][j]) return false;\n }\n }\n return true;\n }", "public void setVisited()\n {\n visited = true;\n }", "public boolean pathExists(int startVertex, int stopVertex) {\r\n if (startVertex == stopVertex) {\r\n \treturn true;\r\n } else {\r\n \tif (visitAll(startVertex).contains(stopVertex)) {\r\n \t\treturn true;\r\n \t}\r\n }\r\n return false;\r\n }", "public boolean destinationReached() {\n boolean xCheck = cDestination.getX() <= cPosition.getX() + cFishSizeX\n && cDestination.getX() >= cPosition.getX();\n\n boolean yCheck = cDestination.getY() <= cPosition.getY() + cFishSizeY\n && cDestination.getY() >= cPosition.getY();\n return xCheck && yCheck;\n }", "public boolean validPath(int curRow, int curCol, int movRow, int movCol) {\n\n if(movCol > curCol && curRow == movRow || movCol < curCol && curRow == movRow){\n return true;\n }\n\n if(curRow + 1 == movRow && movCol == curCol || curRow - 1 == movRow && movCol == curCol){\n return true;\n }\n\n return false;\n }", "public boolean hasPathTo(Site s) {\n\t\treturn marked[s.getX()][s.getY()];\n\t}", "public boolean pathExists(int start, int end) {\n boolean[] visited = new boolean[nodeCount];\n // find a path with a greedy search\n PairHeap q = new PairHeap();\n visited[start] = true;\n int next = start;\n try {\n while (next != end) {\n // check every neighbour of next - add if necessary\n for (int j = 0; j < nodeCount; j++) {\n if (roads[next][j] > 0 && !visited[j]) { // connected\n visited[j] = true;\n int x = xs[j] - xs[end];\n int y = ys[j] - ys[end];\n int d = (int) Math.sqrt(x * x + y * y);\n q.insert(j, d);\n }\n }\n next = q.deleteMin();\n }\n return true;\n } catch (NullPointerException e) {\n return false;\n }\n }", "public boolean hasPath()\n\t{\n\t\tPathFinder as = new PathFinder(getGrid(), 625);\n \treturn (as.findPath(this, getGrid().getUser().getLocation().getRow(), getGrid().getUser().getLocation().getCol(),false).getLength() != 0);\n\n\t}", "boolean hasPathTo(int v)\n\t{\n\t\treturn edgeTo[v].weight()!=Double.POSITIVE_INFINITY;\n\t}", "public boolean getVisited(){return this.visited;}", "public boolean validPath(int curRow, int curCol, int movRow, int movCol) {\n if (curRow + 2 == movRow || curRow - 2 == movRow){\n if (curCol + 2 == movCol || curCol - 2 == movCol){\n return true;\n }\n }\n return false;\n }", "@Override\n public boolean isPointInPath(double x, double y) {\n return graphicsEnvironmentImpl.isPointInPath(canvas, x, y);\n }", "public boolean canReachDFS(Dot startNode, Dot finishNode ) {\n Set< Dot > visited = new HashSet<>();\n visited.add( startNode );\n\n visitDFS( startNode, visited );\n return visited.contains( finishNode );\n }", "boolean dfs(int node, Map<Integer, List<Integer>> graph, boolean[] visited, Set<Integer> dfsPath) {\n if(dfsPath.contains(node))\n return false;\n\n // If this node is already visited via some other source node then avoid checking further again\n if(visited[node])\n return true;\n\n dfsPath.add(node);\n visited[node] = true;\n\n for(int adjVertex : graph.get(node)) {\n if(!dfs(adjVertex, graph, visited, dfsPath)) {\n return false;\n }\n }\n\n dfsPath.remove(node);\n return true;\n }", "public synchronized boolean ifShouldVisitMarkVisited(String URL) {\n\t\tString key = getKey(URL);\n\t\tif (alreadyVisited(key)) {\n\t\t\treturn false;\n\t\t}\n\t\t/*\n\t\t * Mark the current URL as 'visited' by storing it in the BloomFilter\n\t\t * so that no other thread continues further than this\n\t\t */\n\t\tmarkVisited(key);\n\t\treturn true;\n\t}", "boolean isDone(){\n\t\t\n\t\treturn (x0==x1 && y0==y1);\n\t}", "public boolean check(Node n, int path) {\r\n\r\n\t\t// Basic case check.\r\n\t\tif (EndPoint.get(path).equals(n))\r\n\t\t\treturn true;\r\n\r\n\t\t// Basic case check\r\n\t\tboolean okForPath = false;\r\n\t\tfor (Integer neiborIndex : nowMap.get(n.index)) {\r\n\t\t\tNode neibor = allNodes.get(neiborIndex);\r\n\r\n\t\t\tif (neibor.path == 0 || EndPoint.get(path).equals(neibor))\r\n\t\t\t\tokForPath = true;\r\n\t\t}\r\n\r\n\t\t\r\n\t\t// Dead end check\r\n\r\n\t\tfor (Integer neiborIndex : nowMap.get(n.index)) {\r\n\t\t\tif (allNodes.get(neiborIndex).path == 0) {\r\n\t\t\t\tint num = 0;\r\n\t\t\t\r\n\t\t\t\t\t// BEGIN check for dead ends\r\n\r\n\t\t\t\t\t// except the node we are testing, all the other neighbor nodes from other paths\r\n\t\t\t\t\t// of the neighbor node of the node we are testing are occupied and then a dead\r\n\t\t\t\t\t// end is created.\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(Integer neighborOfNeighborIndex:nowMap.get(neiborIndex)) {\r\n\t\t\t\t\t\tif(neighborOfNeighborIndex!=n.index) {\r\n\t\t\t\t\t\t\tif(allNodes.get(neighborOfNeighborIndex).path==0)\r\n\t\t\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tfor(Integer pathIndex:StartPoint.keySet()) {\r\n\t\t\t\t\t\t\t\t\tif(!paths.get(pathIndex).peek().equals(EndPoint.get(pathIndex))){\r\n\t\t\t\t\t\t\t\t\t\tif(neighborOfNeighborIndex==paths.get(pathIndex).peek().index || neighborOfNeighborIndex==EndPoint.get(pathIndex).index)\r\n\t\t\t\t\t\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(num<=1)\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t// END check for dead ends\r\n\t\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\tLinkedList<Integer> topPathsIndex=new LinkedList<Integer>();\r\n\t\t\r\n\t\tfor(Integer p:paths.keySet())\r\n\t\t\ttopPathsIndex.add(paths.get(p).peek().index);\r\n\t\tboolean deadEnd=true;\r\n\t\tfor(Integer nodeIndex:allNodes.keySet()) {\r\n\t\t\tNode theNode=allNodes.get(nodeIndex);\r\n\t\t\tif(theNode.path==0) {\r\n\t\t\t\tfor(Integer itsNeighborIndex:nowMap.get(nodeIndex)) {\r\n\t\t\t\t\tif(allNodes.get(itsNeighborIndex).path==0) {\r\n\t\t\t\t\t\tdeadEnd=false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(deadEnd) {\r\n\t\t\t\t\tfor(Integer itsNeighborIndex:nowMap.get(nodeIndex)) {\r\n\t\t\t\t\t\tif(topPathsIndex.contains(itsNeighborIndex)) {\r\n\t\t\t\t\t\t\tint p0=allNodes.get(itsNeighborIndex).path;\r\n\t\t\t\t\t\t\tint itsEndIndex=EndPoint.get(p0).index;\r\n\t\t\t\t\t\t\tif(nowMap.get(nodeIndex).contains(itsEndIndex))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tdeadEnd=false;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else\r\n\t\t\t{\r\n\t\t\t\tfor(Integer itsNeighborIndex:nowMap.get(nodeIndex)) {\r\n\t\t\t\t\tif(allNodes.get(itsNeighborIndex).path==0 ||allNodes.get(itsNeighborIndex).path==theNode.path) {\r\n\t\t\t\t\t\tdeadEnd=false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif(deadEnd)\r\n\t\t\treturn !deadEnd;\r\n\t\t\r\n\t\tHashMap<Integer,Integer> rmap=new HashMap<Integer,Integer>();\r\n\t\tint rcount=state_build_regions(rmap);\r\n\t\tif(state_regions_stranded(rcount,rmap,paths.size()+1,1)>0)\r\n\t\t\treturn false;\r\n\r\n\t\treturn okForPath;\r\n\t}", "public boolean isClearPathDiagonally(Location move) {\n\t\tint xdist = currentLoc.distanceToX(move);\n\t\tint ydist = currentLoc.distanceToY(move);\n\t\tint signx = 1, signy = 1;\n\t\tif (xdist < 0) signx = -1;\n\t\tif (ydist < 0) signy = -1;\n\t\tSystem.out.println(currentLoc + \" ==\" + move);\n\t\tLocation start = move.copy();\n\t\tstart.setX(start.getX() - signx);\n\t\tstart.setY(start.getY() - signy);\n\t\tfor (Location next = start; !next.equals(currentLoc); next.setX(next.getX() - signx), next.setY(next.getY() - signy)) {\n\t\t\tSystem.out.println(\"Checking Location \" + next.toString());\n\t\t\tPiece piece = board.getPieceAt(next);\n\t\t\tif (piece != null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean Visited(int depth, int row, int col ,boolean[][][] VisitedCells){\n if (VisitedCells[depth][row][col] == true)\n return true;\n return false;\n }", "private void tracePath(Node lastVisitedNode)\r\n {\r\n Node pathPtr = lastVisitedNode;\r\n while (pathPtr != Start)\r\n {\r\n pathPtr.isVisited = true;\r\n pathPtr = pathPtr.parent;\r\n }\r\n }", "public boolean isValidMove(ArrayList<Cell> path) {\t\t\t\t\r\n\t\treturn value != -1 && !inPath(path);\r\n\t}", "public int checkPathCo(Position pos) {\n\t\tint check = 0;\n\t\tint x = pos.getX();\n\t\tint y = pos.getY();\n\t\t\n\t\ttry {\n\t\t\tif (y == 0 || x == 0)\n\t\t\t\tcheck = 1;\n\t\t\telse\n\t\t\t\tcheck = pathCo[x][y];\n\t\t}\n\t\tcatch (ArrayIndexOutOfBoundsException e) {\n\t\t\tLog.e(\"checking coordinates\", \"Out of bounds!\");\n\t\t}\n\t\t\n\t\treturn check;\n\t}", "public static boolean getOnePathToARGState1(ARGState pLastElement, ARGState destination) {\n Set<ARGState> seenElements = new HashSet<ARGState>();\n\n // each element of the path consists of the abstract state and the outgoing\n // edge to its successor\n\n ARGState currentARGState = pLastElement;\n // add the error node and its -first- outgoing edge\n // that edge is not important so we pick the first even\n // if there are more outgoing edges\n\n\n\n seenElements.add(currentARGState);\n\n while (!currentARGState.getParents().isEmpty() && currentARGState.getStateId() != destination.getStateId()) {\n Iterator<ARGState> parents = currentARGState.getParents().iterator();\n\n ARGState parentElement = parents.next();\n //System.out.println(currentARGState.getStateId()+\":\"+parentElement);\n while (!seenElements.add(parentElement) && parents.hasNext()) {\n // while seenElements already contained parentElement, try next parent\n parentElement = parents.next();\n // System.out.println(currentARGState.getStateId()+\":\"+parentElement);\n }\n\n currentARGState = parentElement;\n }\n if (currentARGState.getStateId() != destination.getStateId())\n return false;\n // System.out.println(\"跳出getOnePathTo\");\n return true;\n }", "public boolean hasVisited(SimpleMethod method) {\n return simpleMethodNameSet.contains(method.getLocationAndName());\n }", "public static boolean hasPath(int[][] array, int vertices, int src, int dest) {\n var graph = new Graph(array, vertices);\n var visited = new boolean[vertices];\n return hasPath(graph, src, dest, visited);\n }", "public boolean hasFinished(int neighbour){\n\t//System.out.println(\"ATTENTION\");\n\treturn false;\n }", "private void printPath(LinkedList<String> visited) {\r\n\r\n if (flag == false) {\r\n System.out.println(\"Yes there exists a path between \" + START + \" and \" + END);\r\n }\r\n for (String node : visited) { //creating for loop to print the nodes stored in visited array \r\n System.out.print(node);\r\n System.out.print(\" \");\r\n }\r\n System.out.println();\r\n }", "public boolean isConnected() {\n if (this.isEmpty()) return true;\n\n if (this.directed) {\n Deque<Node> toVisit = new LinkedList<>();\n for (Node s : this.nodes.values()) {\n Node current;\n toVisit.addLast(s);\n while (!toVisit.isEmpty()) {\n current = toVisit.removeLast();\n current.setFlag(\"_visited\");\n for (Edge edge : current.getNeighbours()) {\n Node n = edge.getEnd();\n if (!n.getFlag(\"_visited\")) toVisit.addLast(n);\n }\n }\n\n //Check if all nodes have been visited and remove flags\n boolean allVisited = true;\n for (Node n : nodes.values()) {\n allVisited = allVisited && n.getFlag(\"_visited\");\n n.unsetFlag(\"_visited\");\n }\n if (!allVisited) return false;\n }\n return true;\n }\n else {\n //Perform a DFS from a random start node marking nodes as visited\n Node current;\n Deque<Node> toVisit = new LinkedList<>();\n toVisit.addLast(this.nodes.values().iterator().next());\n while (!toVisit.isEmpty()) {\n current = toVisit.removeLast();\n current.setFlag(\"_visited\");\n for (Edge edge : current.getNeighbours()) {\n Node n = edge.getEnd();\n if (!n.getFlag(\"_visited\")) toVisit.addLast(n);\n }\n }\n\n //Check if all nodes have been visited and remove flags\n boolean allVisited = true;\n for (Node n : nodes.values()) {\n allVisited = allVisited && n.getFlag(\"_visited\");\n n.unsetFlag(\"_visited\");\n }\n\n return allVisited;\n }\n }", "public static boolean isVisited(UserLocation c) {\n if (VisitList.contains(c)) {\n return true;\n } else {\n return false;\n }\n }", "public void visit() {\n visited = true;\n }", "private boolean checkCrash (Location next)\n {\n if (next == null) {\n return true;\n }\n\n Location last = playerLocations.get(playerLocations.size()-1);\n\n LocationType type = next.getType();\n //println(getLocation(next).getType()+\" : \"+next);\n if (type == LocationType.POWERUP) {\n PowerUp p = getPowerUp(next);\n\n if (p != null) { // Basically a workaround for the NPE\n // if (ENABLE_SOUND) {\n // sfx.gainedPowerUp();\n // }\n addSpeed(1);\n speedTimer += (int) frameRate * 2;\n removePowerUp(p);\n }\n\n return false;\n }\n\n if ((type == LocationType.PLAYER || type == LocationType.WALL) ||\n (next.getY() != last.getY() && (direction == LEFTKEY || direction == RIGHTKEY)) ||\n (next.getX() != last.getX() && (direction == UPKEY || direction == DOWNKEY))) { // This is to prevent bike from wrapping around edge of grid, because grid is a 1d array\n //sfx.lostALife(); //Commented out because you hear a shrill sound at the end for some reason\n return true;\n }\n\n return false;\n }", "private boolean checkNext(){\n boolean ret = this.hasNext;\n if ((this.allStatesIterator.hasNext()) || (this.allSubsetsIterator.hasNext()) || (this.allTransitionsIterator.hasNext())){\n hasNext = true;\n return hasNext;\n }\n hasNext = false;\n return ret;\n }", "public synchronized boolean isPathFinished() {\n if (pathFollower.getFinished()) {\n lastAngle = pathFollower.getEndHeading();\n RobotState.mDriveControlState = DriveControlState.OPEN_LOOP;\n pathFollower = null;\n leftStatus = TrajectoryStatus.NEUTRAL;\n rightStatus = TrajectoryStatus.NEUTRAL;\n return true;\n }\n return false;\n }", "@Override\n public boolean hasPossibleCapture(final Coordinate destination) {\n\n Coordinate coordinate = this.getCoordinate();\n int row = coordinate.getRow();\n int col = coordinate.getCol();\n\n //\n //\n ////\n int tempRow1 = row - 2;\n int tempCol1 = col - 1;\n Coordinate tempCoordinate1 = new Coordinate(tempRow1, tempCol1);\n if (destination.equals(tempCoordinate1)) {\n return true;\n }\n\n ////\n //\n //\n int tempRow2 = row + 2;\n int tempCol2 = col - 1;\n Coordinate tempCoordinate2 = new Coordinate(tempRow2, tempCol2);\n if (destination.equals(tempCoordinate2)) {\n return true;\n }\n\n //////\n //\n int tempRow3 = row - 1;\n int tempCol3 = col - 2;\n Coordinate tempCoordinate3 = new Coordinate(tempRow3, tempCol3);\n if (destination.equals(tempCoordinate3)) {\n return true;\n }\n\n ///////\n //\n int tempRow4 = row - 1;\n int tempCol4 = col + 2;\n Coordinate tempCoordinate4 = new Coordinate(tempRow4, tempCol4);\n if (destination.equals(tempCoordinate4)) {\n return true;\n }\n\n ////\n //\n //\n int tempRow5 = row + 2;\n int tempCol5 = col + 1;\n Coordinate tempCoordinate5 = new Coordinate(tempRow5, tempCol5);\n if (destination.equals(tempCoordinate5)) {\n return true;\n }\n\n //\n //\n ////\n int tempRow6 = row - 2;\n int tempCol6 = col + 1;\n Coordinate tempCoordinate6 = new Coordinate(tempRow6, tempCol6);\n if (destination.equals(tempCoordinate6)) {\n return true;\n }\n\n //\n //////\n int tempRow7 = row + 1;\n int tempCol7 = col - 2;\n Coordinate tempCoordinate7 = new Coordinate(tempRow7, tempCol7);\n if (destination.equals(tempCoordinate7)) {\n return true;\n }\n\n //\n //////\n int tempRow8 = row + 1;\n int tempCol8 = col + 2;\n Coordinate tempCoordinate8 = new Coordinate(tempRow8, tempCol8);\n return destination.equals(tempCoordinate8);\n }", "private Cell nextNotVisitedCell(Cell current) {\n if (current.isValidDirection(LEFT) && !cells[current.col - 1][current.row].visited)\n return cells[current.col - 1][current.row];\n\n // Check whether the right cell is visited, if there is one.\n if (current.isValidDirection(RIGHT) && !cells[current.col + 1][current.row].visited)\n return cells[current.col + 1][current.row];\n\n // Check whether the cell above is visited, if there is one.\n if (current.isValidDirection(UPWARD) && !cells[current.col][current.row - 1].visited)\n return cells[current.col][current.row - 1];\n\n // Check whether the cell below is visited, if there is one.\n if (current.isValidDirection(DOWNWARD) && !cells[current.col][current.row + 1].visited)\n return cells[current.col][current.row + 1];\n\n return null;\n }", "protected final boolean computeHasNext() {\n return this.getEnds().getGraph().getPredecessorEdges(this.getNext()).isEmpty();\n }", "public boolean isPathToCheese(Maze maze, List<Direction> path);", "public boolean inValidSpot(Path p1){\n\t\t// Checks to see it the path piece placed expects an entrance or exit piece out of bounds\n\t\t\n\t\tint largestRow = (height*width-1)/width;\n\t\t\n\t\t// if entrance or exit pos expected is negative, know it is expecting a path outside the top bound\n\t\tif(p1.getEntry()<0 || p1.getExit()<0){\n\t\t\treturn false;\n\t\t}\n\t\t// if entrance or exit's row greater than the maximum row, know it is expecting a path outside bottom bound\n\t\tif(p1.getEntryRow()>largestRow || p1.getExitRow()>largestRow){\n\t\t\treturn false;\n\t\t}\n\t\tint currentRow = p1.getRow();\n\t\tint nextRow=0;\n\t\tif(Math.abs(p1.getPos()-p1.getEntry())==1){\n\t\t\t// If the absolute value of the difference between the current position and its entrance is 1 ...\n\t\t\t// Checking to see if the entrance is expected to be outside of the left or right edges of Map\n\t\t\tnextRow = p1.getEntryRow();\n\t\t\tif(currentRow!=nextRow){\n\t\t\t\t// This means that the entrance expected is not to the left or to the right\n\t\t\t\t// In other words, the entrance is expected in another row\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(Math.abs(p1.getPos()-p1.getExit())==1){\n\t\t\t// If the absolute value of the difference between the current position and its exit is 1 ...\n\t\t\t// Checking to see if the exit is expected to be outside of the left or right edges of Map\n\t\t\tnextRow = p1.getExitRow();\n\t\t\tif(currentRow!=nextRow){\n\t\t\t\t// This means that the exit expected is not to the left or to the right\n\t\t\t\t// In other words, the exit is expected in another row\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\tif(Math.abs(p1.getPos()-p1.getEntry())==width){\n\t\t\tnextRow = p1.getEntryRow();\n\t\t\tif(p1.getEntry()<0 || nextRow>(height-1/width)){//it used to be calculaterow(height*width-1\n\t\t\t\t//Less than zero would make it on top of the top edge\n\t\t\t\t//First term calculated in this manner because any negative entrance between -1 and \n\t\t\t\t// -width+1 will have an integer rounded to zero. The double casting will give an \n\t\t\t\t// accurate number without losing the sign\n\t\t\t\t\n\t\t\t\t//Greater than height*width-1 would make in lower than the bottom edge\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(Math.abs(p1.getPos()-p1.getExit())==width){\n\t\t\tnextRow = p1.getExitRow();\n\t\t\tif(p1.getEntry()<0 || nextRow>(height-1/width)){//it used to be calculaterow(height*width-1\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\treturn true;\n\t\t\n\t}", "public boolean augmentedPath(){\n QueueMaxHeap<GraphNode> queue = new QueueMaxHeap<>();\n graphNode[0].visited = true;//this is so nodes are not chosen again\n queue.add(graphNode[0]);\n boolean check = false;\n while(!queue.isEmpty()){//goes through and grabs each node and visits that nodes successors, will stop when reaches T or no flow left in system from S to T\n GraphNode node = queue.get();\n for(int i = 0; i < node.succ.size(); i++){//this will get all the nodes successors\n GraphNode.EdgeInfo info = node.succ.get(i);\n int id = info.to;\n if(!graphNode[id].visited && graph.flow[info.from][info.to][1] != 0){//this part just make sure it hasn't been visited and that it still has flow\n graphNode[id].visited = true;\n graphNode[id].parent = info.from;\n queue.add(graphNode[id]);\n if(id == t){//breaks here because it has found the last node\n check = true;\n setNodesToUnvisited();\n break;\n }\n }\n }\n if(check){\n break;\n }\n }\n return queue.isEmpty();\n }" ]
[ "0.6888977", "0.6869118", "0.6742793", "0.67343986", "0.6651703", "0.66029805", "0.65818113", "0.65628797", "0.6548747", "0.63869715", "0.63869715", "0.6349254", "0.63422656", "0.6336295", "0.62800354", "0.6255498", "0.62434685", "0.62073314", "0.61757445", "0.61729264", "0.61508155", "0.6150781", "0.6094492", "0.60742295", "0.60623926", "0.6055936", "0.60332817", "0.59638137", "0.59535295", "0.5944797", "0.59386843", "0.59357744", "0.592168", "0.59204", "0.590792", "0.5907531", "0.5902016", "0.5881466", "0.58737427", "0.5867306", "0.58214605", "0.58197874", "0.5814698", "0.57878214", "0.57830375", "0.5763287", "0.57507896", "0.5739834", "0.57365906", "0.5731957", "0.5729709", "0.5724564", "0.57200617", "0.5667618", "0.564983", "0.56434435", "0.5641053", "0.5626536", "0.5623601", "0.5619652", "0.56059605", "0.5598659", "0.55712116", "0.55622274", "0.5559896", "0.5554998", "0.55534446", "0.55516255", "0.55496436", "0.55477816", "0.5546402", "0.5536638", "0.5524227", "0.55119467", "0.55100954", "0.55099326", "0.5496271", "0.54831874", "0.54797524", "0.54767776", "0.54665667", "0.5465169", "0.54523736", "0.5443448", "0.5441992", "0.54411286", "0.54321265", "0.5417629", "0.5416887", "0.5416546", "0.54152906", "0.54106385", "0.54065347", "0.5389724", "0.5389584", "0.53881943", "0.53869146", "0.53846014", "0.5379876", "0.53777236" ]
0.66075784
5
String representation of the raw graph.
public abstract String rawGraphToString();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String toString() {\n String str = \"graph [\\n\";\n\n Iterator<Node<E>> it = iterator();\n\n //Node display\n while(it.hasNext()){\n Node n = it.next();\n\n str += \"\\n\\tnode [\";\n str += \"\\n\\t\\tid \" + n;\n str += \"\\n\\t]\";\n }\n\n //Edge display\n it = iterator();\n\n while(it.hasNext()){\n Node n = it.next();\n\n Iterator<Node<E>> succsIt = n.succsOf();\n while(succsIt.hasNext()){\n Node succN = succsIt.next();\n\n str += \"\\n\\tedge [\";\n str += \"\\n\\t\\tsource \" + n;\n str += \"\\n\\t\\ttarget \" + succN;\n str += \"\\n\\t\\tlabel \\\"Edge from node \" + n + \" to node \" + succN + \" \\\"\";\n str += \"\\n\\t]\";\n }\n }\n\n str += \"\\n]\";\n\n return str;\n }", "@Override\n\tpublic String toString() {\n StringBuffer buf = new StringBuffer();\n\n// for (int i = 0; i < units.size(); i++) {\n// buf.append(\"\\nUnit \" + i + \": \" + units.get(i));\n// }\n\n buf.append(\"Connected components: \" );\n List<List<Node>> components = GraphUtils.connectedComponents(graph);\n\n for (int i = 0; i < components.size(); i++) {\n buf.append(\"\\n\" + i + \": \");\n buf.append(components.get(i));\n }\n\n buf.append(\"\\nGraph = \" );\n buf.append(graph);\n\n return buf.toString();\n }", "@Override\r\n\tpublic String toString() {\r\n\t\tStringBuilder out = new StringBuilder();\r\n\t\tMap<Integer,Integer> tmp;\r\n\t\tout.append(\"{\");\r\n\t\tfor(int i = 0; i < edges.length; i++) {\r\n\t\t\ttmp = edges[i];\r\n\t\t\tif (tmp == null) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tfor(Map.Entry entry : tmp.entrySet()) {\r\n\t\t\t\t\tif ((int)entry.getValue() == -1) {\r\n\t\t\t\t\tout.append(\"(\" + i + \",\" + entry.getKey() + \")\" + \",\");\r\n\t\t\t\t} else{\r\n\t\t\t\t\tout.append(\"(\" + i + \",\" + entry.getKey() + \",\" + entry.getValue() + \")\" + \",\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (out.length() > 2) {\r\n\t\tout.setLength(out.length() - 2);\r\n\t\tout.append(\")\");\r\n\t\t}\r\n\r\n\t\tout.append(\"}\");\r\n\t\treturn out.toString();\r\n\t}", "public String toString()\r\n\t{\r\n\t\tString str = \"\";\r\n\t\t\r\n\t\tSortedSet<String> sortedVertices = new TreeSet<String>(this.getVertices());\r\n\t\t\r\n\t\tstr += \"Vertices: \" + sortedVertices.toString() + \"\\nEdges:\\n\";\r\n\t\t\r\n\t\tfor(String vertex : sortedVertices)\r\n\t\t{\r\n\t\t\tif(this.dataMap.containsKey(vertex))\r\n\t\t\t{\r\n\t\t\t\tHashMap<String,Integer> adjMap = this.adjacencyMap.get(vertex);\r\n\t\t\t\t\r\n\t\t\t\tSortedSet<String> sortedKeys = new TreeSet<String>(adjMap.keySet());\r\n\t\t\t\t\r\n\t\t\t\tstr += \"Vertex(\" + vertex + \")--->{\";\r\n\t\t\t\tfor(String adj : sortedKeys)\r\n\t\t\t\t{\r\n\t\t\t\t\tstr += adj +\"=\"+ adjMap.get(adj) +\", \";\r\n\t\t\t\t}\r\n\t\t\t\tstr = str.trim();\r\n\t\t\t\t\r\n\t\t\t\tif(!sortedKeys.isEmpty())\r\n\t\t\t\t{\r\n\t\t\t\t\tStringBuilder s = new StringBuilder(str);\r\n\t\t\t\t\ts.deleteCharAt(str.length()-1);\r\n\t\t\t\t\tstr = s.toString();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tstr+=\"}\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn str;\r\n\t}", "@Override\n public String toString()\n {\n String builder = new String();\n \tfor (V vertex : graph.keySet()){\n \t\tString strVertex = vertex.toString();\n \t\tbuilder = builder + strVertex + \": \";\n \t\tArrayList <V> edges = graph.get(vertex);\n \t\tint degree = edges.size();\n \t\tint i = 0;\n \t\tif (degree > 0){\n \t\t\twhile (i < degree -1){\n \t\t\t\tString strEdge = edges.get(i).toString();\n \t\t\t\tbuilder = builder + strEdge + \", \";\n \t\t\t\ti++;\n \t\t\t}\n \t\tString strEdge = edges.get(i).toString();\n \t\tbuilder = builder + strEdge + \"\\n\";\n\n \t\t}\n \t\telse{\n \t\t\tstrVertex = vertex.toString();\n \t\t\tbuilder = builder + strVertex + \": \\n\";\n \t\t}\n\n \t}\n \treturn builder;\n }", "@Override\n public final String toString() {\n final StringBuilder nodes = new StringBuilder();\n nodes.append(this.sizeNodes()).append(\" Nodes: {\");\n final StringBuilder edges = new StringBuilder();\n edges.append(this.sizeEdges()).append(\" Edges: {\");\n for (final Node<N> node : this.getNodes()) {\n nodes.append(node.toString()).append(',');\n }\n for (final Edge<N, E> edge : this.getEdges()) {\n edges.append(edge.toString()).append(',');\n }\n final String newLine = System.getProperty(\"line.separator\");\n nodes.append('}').append(newLine).append(edges).append('}').append(newLine);\n return nodes.toString();\n }", "public String toString() {\n\t\tString s = \"\";\n\t\t// Loop through all the vertices and add their neighbors to a string\n\t\tfor (int i = 0; i < this.vertices.size(); i++) {\n\t\t\ts += this.vertices.get(i).toString() + \": \" + this.vertices.get(i).getNeighbors() + \"\\n\\n\";\n\t\t}\n\t\ts += \"Number of Total Edges: \" + this.actualTotalEdges;\n\t\treturn s;\n\t}", "public String toString() {\r\n\t\tStringBuilder buffer = new StringBuilder();\r\n\t\t\r\n\t\tbuffer.append(\"<\" + xmltag + \" subgraph=\\\"\" + subgraph + \"\\\">\" + newline);\r\n\t\t\r\n\t\tfor (Variable currentVariable : variables) {\r\n\t\t\tbuffer.append(\"\\t\\t\\t\\t\\t\" + currentVariable);\r\n\t\t}\r\n\t\t\r\n\t\tbuffer.append(\"\\t\\t\\t\\t</\" + xmltag + \">\" + newline);\r\n\t\t\r\n\t\treturn buffer.toString();\r\n\t}", "public String stringify(GraphSprite graph) {\n String result = \"\";\n \n boolean isDirected = !(graph.getGraph() instanceof UndirectedGraph);\n \n if(isDirected) {\n result += \"digraph \";\n }\n else {\n result += \"graph \";\n }\n result += \"cazgraph {\\n\";\n \n \n Set<String> usedUndirectedEdges = new HashSet<>();\n \n for(String id : graph.getVertexIDs()) {\n \n result += \"\\\"\" + id + \"\\\";\\n\";\n \n for(String edgeID : graph.getEdges(id)) {\n if(isDirected) {\n result += \"\\\"\" + id + \"\\\"\" + \" -> \" + \"\\\"\" + edgeID + \"\\\";\\n\";\n }\n else {\n String edge1 = \"\\\"\" + id + \"\\\"\" + \" -> \" + \"\\\"\" + edgeID + \"\\\";\\n\";\n String edge2 = \"\\\"\" + edgeID + \"\\\"\" + \" -- \" + \"\\\"\" + id + \"\\\";\\n\";\n \n if(!usedUndirectedEdges.contains(edge1) && !usedUndirectedEdges.contains(edge2)) {\n usedUndirectedEdges.add(edge1);\n usedUndirectedEdges.add(edge2);\n \n result += edge1;\n }\n }\n }\n }\n \n \n result += \"}\";\n return result;\n }", "public String toString(){\n String string = \"\" + nrVertices;\n for(DEdge edge : edges){\n string += \"\\n\" + (edge.getVertex1()) + \" \" + (edge.getVertex2());\n }\n return string;\n }", "public String toString() {\n StringBuilder s = new StringBuilder();\n s.append(ver + \" vertices, \" + edg + \" edges \" + NEWLINE);\n for (int v = 0; v < ver; v++) {\n s.append(String.format(\"%d: \", v));\n for (int w : adj[v]) {\n s.append(String.format(\"%d \", w));\n }\n s.append(NEWLINE);\n }\n return s.toString();\n }", "@Override\n\tpublic String toString() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"node:\\n\").append(nodeJo);\n\t\tsb.append(\"\\nedges:\\n\").append(edgesJa);\n\t\treturn sb.toString();\n\t}", "public String toString() {\n \tStringBuilder s = new StringBuilder();\n \ts.append(V + \" vertices, \" + E + \" edges \" + NEWLINE);\n \tfor(int v = 0; v < V; v++) {\n \t\ts.append(v + \": \");\n \t\tfor(int w : adj[v]) {\n \t\t\ts.append(w + \" \");\n \t\t}\n \t\ts.append(NEWLINE);\n \t}\n \t\n \treturn s.toString();\n }", "public String toString(){\n\t\treturn vertex.toString();\n\t}", "@Override\n public String toString()\n {\n StringBuilder sb = new StringBuilder();\n\n for(Vertex vertex: vertices)\n {\n sb.append(\"V: \" + vertex.toString() + '\\n');\n\n for(Edge edge: connections.get(vertex))\n {\n sb.append(\" -> \" + edge.other(vertex).toString() + \" (\" + edge.getWeight() + \")\\n\");\n }\n }\n\n return sb.toString();\n }", "public String toString() {\n String s = \"\";\n for (Vertex v : mVertices.values()) {\n s += v + \": \";\n for (Vertex w : mAdjList.get(v)) {\n s += w + \" \";\n }\n s += \"\\n\";\n }\n return s;\n }", "public String toString() \n\t{\n\t\tString toReturn = \"\";\n\t\t\n\t\t\n\t\tfor(Vertex v : vertices) \n\t\t{\n\t\t\tHashMap<Vertex, Integer> E = getEdges(v);\n\t\t\t\n\t\t\tif(!E.isEmpty())\n\t\t\t{\n\t\t\t\ttoReturn = toReturn + v + \"(\";\n\t\t\t\tfor(Vertex edge : E.keySet()) \n\t\t\t\t{\n\t\t\t\t\ttoReturn = toReturn + edge.getName() + \", \";\n\t\t\t\t}\n\t\t\t\ttoReturn = toReturn.trim().substring(0, toReturn.length() - 2);\n\t\t\t\ttoReturn = toReturn + \")\\n\";\n\t\t\t}\n\t\t\telse {toReturn = toReturn + v + \"[]\\n\";}\n\t\t}\n\t\treturn toReturn;\n\t}", "public String toString () {\n StringBuffer s = new StringBuffer();\n for (V v: dag.keySet()) s.append(\"\\n \" + v + \" -> \" + dag.get(v));\n return s.toString(); \n }", "public String toString(){\n String s = \"\";\n s += \"\\t\";\n \n for (int i = 0; i < n; i++){\n // adding vertices for columns\n s += vertices[i] + \"\\t\";\n }\n \n s += \"\\n\";\n \n for (int i = 0; i < n; i++){\n s += vertices[i] + \"\\t\"; // vertex for row\n for (int j = 0; j < n; j++){\n s += edges[j][i] + \"\\t\"; // adding edges across row\n }\n s += \"\\n\";\n }\n \n return s;\n }", "public String toString() {\n \tString printStatements = \"\";\n \t\n \tfor (Vertex vertex : this) {\n \t\tprintStatements += vertex + \" \";\n \t}\n \treturn printStatements;\n }", "public String graphToString(PlainGraph graph) {\n String result = graph.edgeSet().toString();\n for (Map.Entry<String, PlainNode> v : graphNodeMap.get(graph).entrySet()) {\n result = result.replace(v.getValue().toString(), v.getKey());\n }\n return result;\n }", "public String toString() {\n\t\tStringBuilder temp = new StringBuilder();\n\n\t\tfor (int index = 0; index < verticesNum; index++) {\n\t\t\tif(list[index] == null)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttemp.append(\"node:\");\n\t\t\ttemp.append(index);\n\t\t\ttemp.append(\": \");\n\t\t\ttemp.append(list[index].toString());\n\t\t\ttemp.append(\"\\n\");\n\t\t}\n\n\t\treturn temp.toString();\n\t}", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder(\"WeightedGraph: \");\n for (int i = 0; i < getSize(); i++) {\n sb.append(getVertex(i) + \"[\" + i + \"]:{\");\n for (Edge e : neighbors.get(i)) {\n sb.append(\"{\" + e.getVert1() + \",\" + e.getVert2() + \",\" + ((WeightedEdge) e).getWeight() + \"}\");\n }\n sb.append(\"\\n\");\n }\n return sb.toString();\n }", "public String toString(){\r\n String result = \"[ \";\r\n result = result + vertex + \" ]\";\r\n return result;\r\n }", "public String toString() \n {\n String NEWLINE = System.getProperty(\"line.separator\");\n StringBuilder s = new StringBuilder();\n for (int v = 0; v < V; v++) \n {\n s.append(v + \": \");\n for (DirectedEdge e : adj[v]) \n {\n \tif(e.online)\n \t{\n \t\ts.append(e + \" \");\n \t}\n }\n s.append(NEWLINE);\n }\n return s.toString();\n }", "public String toString() {\n StringBuilder s = new StringBuilder();\n String NEWLINE = System.getProperty(\"line.separator\");\n s.append(vertices + \" \" + NEWLINE);\n for (int v = 0; v < vertices; v++) {\n s.append(String.format(\"%d: \", v));\n for (Map.Entry<Integer, Integer> e : adjacent(v).entrySet()) {\n s.append(String.format(\"%d (%d) \", e.getKey(), e.getValue()));\n }\n s.append(NEWLINE);\n }\n return s.toString();\n }", "public String toString()\n\t{\n\t \n\t\tString str = vertexName + \": \" ;\n\t\tfor(int i = 0 ; i < adjacencyList.size(); i++)\n\t\t\tstr = str + adjacencyList.get(i).vertexName + \" \";\n\t\treturn str ;\n\t\t\n\t}", "public String toString()\r\n/* 112: */ {\r\n/* 113:199 */ String s = \"\";\r\n/* 114:200 */ for (N node : getNodes())\r\n/* 115: */ {\r\n/* 116:201 */ s = s + \"\\n{ \" + node + \" \";\r\n/* 117:202 */ for (N suc : getSuccessors(node)) {\r\n/* 118:203 */ s = s + \"\\n ( \" + getEdge(node, suc) + \" \" + suc + \" )\";\r\n/* 119: */ }\r\n/* 120:205 */ s = s + \"\\n} \";\r\n/* 121: */ }\r\n/* 122:207 */ return s;\r\n/* 123: */ }", "public String toString()\n\t{\n\t\tNode current = head.getNext();\n\t\tString output = \"\";\n\t\t\n\t\twhile(current != null){\n\t\t\toutput += \"[\" + current.getData().toString() + \"]\\n\";\n\t\t\tcurrent = current.getNext();\n\t\t}\n\t\t\n\t\treturn output;\n\t}", "public String toString()\n {\n String ret = \"\";\n String s = adjMaps.toString();\n String[] parts = s.split(\"},\");\n for(int i=0; i< parts.length; i++){\n ret += parts[i] + \"}\\n\";\n }\n return ret;\n }", "@Override\n public String toString() {\n return InternalNodeSerializer.toString(this);\n }", "@Override\n public String toString() {\n // TODO: Using Serializer\n return Serializer.toByteArray(this).toString();\n }", "public String toMathString(){\n String string = \"{\\n\" + nrVertices + \",\\n{\\n\";\n boolean firstElem = true;\n for(DEdge edge : edges){\n if(!firstElem){\n string += \",\";\n }\n else{\n firstElem = false;\n }\n string += \"{\" + (edge.getVertex1()+1) + \",\" + (edge.getVertex2()+1) + \"},\" + (edge.getWeight());\n }\n string += \"\\n}\\n}\\n\";\n return string;\n }", "public String toString() {\r\n\t\tString cad = \"\";\r\n\t\tfor (int i = 0; i < nodes_.size(); i++) {\r\n\t\t\tcad += nodes_.get(i).getVal() + \" - \";\r\n\t\t}\r\n\t\treturn cad;\r\n\t}", "public String getGVString() {\n StringBuilder gvString = new StringBuilder();\n\n for (Room room : connections) {\n if (room != null) {\n gvString.append(getGVNodeName()).append(\" -- \").append(room.getGVNodeName()).append(\";\\n\");\n }\n }\n\n return gvString.toString();\n }", "@Override\r\n public String dumpOf ()\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n\r\n if (evaluation != null) {\r\n sb.append(String.format(\" evaluation=%s%n\", evaluation));\r\n }\r\n\r\n Shape physical = (getShape() != null) ? getShape().getPhysicalShape() : null;\r\n if (physical != null) {\r\n sb.append(String.format(\" physical=%s%n\", physical));\r\n }\r\n\r\n if (forbiddenShapes != null) {\r\n sb.append(String.format(\" forbiddenShapes=%s%n\", forbiddenShapes));\r\n }\r\n\r\n if (timeRational != null) {\r\n sb.append(String.format(\" rational=%s%n\", timeRational));\r\n }\r\n\r\n return sb.toString();\r\n }", "public String toString() {\n\t\treturn this.toJSON().toString();\n\t}", "public String toString() {\n\t\treturn this.toJSON().toString();\n\t}", "public String toString() {\n\n StringBuilder sb = new StringBuilder();\n sb.append(\"\\nApplication Graph for \" + this.getClass().getCanonicalName() + \"\\n\");\n Map<PEMaker, Collection<StreamMaker>> pe2streamMap = pe2stream.asMap();\n for (Map.Entry<PEMaker, Collection<StreamMaker>> entry : pe2streamMap.entrySet()) {\n sb.append(toString(entry.getKey()) + \"=> \");\n for (StreamMaker sm : entry.getValue()) {\n sb.append(toString(sm));\n }\n sb.append(\"\\n\");\n }\n\n Map<StreamMaker, Collection<PEMaker>> stream2peMap = stream2pe.asMap();\n for (Map.Entry<StreamMaker, Collection<PEMaker>> entry : stream2peMap.entrySet()) {\n sb.append(toString(entry.getKey()) + \"=> \");\n for (PEMaker pm : entry.getValue()) {\n sb.append(toString(pm));\n }\n sb.append(\"\\n\");\n }\n\n return sb.toString();\n\n }", "public String apGraph() {\n if(root != null){\n root.nameAvl();\n return doBigGraph();\n }else{\n return \"\";\n }\n }", "public String doBigGraph(){\n NodoAvl tmp = root;\n StringBuilder sb = new StringBuilder();\n sb.append(\"subgraph {\");\n sb.append(\"node [shape = record];\\n\");\n sb.append(getLabelNodeAvl());\n sb.append(\"}\");\n Log.logger.info(sb.toString());\n return sb.toString();\n }", "public String toString() { return stringify(this, true); }", "public String toString()\n\t{\n\t\tStringBuilder matrix = new StringBuilder();\n\t\t\n\t\tfor(int i = 0; i < numberOfVertices; i++)\n\t\t{\n\t\t\tmatrix.append(i + \": \");\n\t\t\tfor(boolean j : adjacencyMatrix[i])\n\t\t\t{\n\t\t\t\tmatrix.append((j? 1: 0) + \" \");\n\t\t\t}\n\t\t\tmatrix.append(\"\\n\");\n\t\t}\n\t\t\n\t\treturn matrix.toString();\n\t}", "public String toString() {\n\t\tString str = \"\";\n\t\tNode current = head;\n\t\tstr += \"[ \";\n\t\twhile (current != null) {\n\t\t\tstr += current.value;\n\t\t\tif (current.next != null) {\n\t\t\t\tstr += \", \";\n\t\t\t}\n\n\t\t\tcurrent = current.next;\n\t\t}\n\t\tstr += \" ]\";\n\n\t\treturn str;\n\t}", "public String getGraphSignature(){\n \t this.generateGraphSignature();\n \t return this.graphSignature;\n \t}", "public String toString() {\n\t\tString pathString = \"\";\n\t\tfor(Point point : path) {\n\t\t\tpathString = pathString + \"[ \" + point.getX() + \", \" + point.getY() + \" ]\";\n\t\t}\n\t\treturn pathString;\n\t}", "public String toString() {\n\t\tString result = \"\";\n\t\tNode current = head;\n\n\t\twhile(current != null) {\n\t\t\tif (current.getCar() instanceof GasCar) {\n\t\t\t\tresult += ((GasCar)current.getCar()).getData() + \"\\n\";\n\t\t\t} else if (current.getCar() instanceof GreenCar) {\n\t\t\t\tresult += ((GreenCar)current.getCar()).getData() + \"\\n\";\n\t\t\t}\n\t\t\tcurrent = current.getNext();\n\t\t}\n\t\treturn result;\n\t}", "@Override\n\tpublic String toString()\n\t{\n\t\t/* output looks like this\n\t\t * \n\t\t * 20 - 10, 30 20 has edges with 10 and 30\n\t\t * 40 - 10, 30 \t\t40 has edges with 10 and 30\n\t\t * 10 - 20, 40 \t\t\t10 has edges with 20 and 40\n\t\t * 30 - 20, 40 \t\t\t30 has edges with 20 and 40\n\t\t */\n\t\tString str = new String();\n\t\tfor(Map.Entry<Object, SinglyLinkedList> vertex : map.entrySet())\n\t\t\tstr += vertex.getKey() + \" - \" + vertex.getValue() + '\\n';\t\t\t\t\n\t\treturn str;\n\t}", "public String toString(){\n String string = new String();\n for(int i = 0; i < axis.length; i++){\n string += axis[i];\n if(i != (axis.length - 1)){\n string += \" / \";\n }\n }\n return string;\n }", "public String toString() {\r\n\t\tNode<E> current = head;\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\twhile (current != null) {\r\n\t\t\tsb.append(\",\" + current.data);\r\n\t\t\tcurrent = current.next;\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "public String toString()\n {\n\treturn adjLists.toString();\n }", "public String toString() {\n StringBuffer aBuffer = new StringBuffer(super.toString());\n aBuffer.append(\"[id=\").append(_theId).\n append(\" parent=\").append(_theParent).\n append(\" paths=\").append(_thePaths).\n append(\"]\");\n\n return aBuffer.toString();\n }", "public String toString() {\n return gate;\n }", "@Override\n public String toString() {\n return gson.toJson(this);\n }", "@Override\n\tpublic String toString() {\n\t\tif (repr == null)\n\t\t\trepr = toString(null);\n\n\t\treturn repr;\n\t}", "public String toString() {\n \t\t\tString string = \"\";\n \t\t\tfor (Node n : neighbors) {\n \t\t\t\tstring += n.shortName()+\" \";\n \t\t\t}\n \t\t\treturn \"Neighbours: \"+string;\n \t\t}", "public String toString()\n {\n return \"Label: \" + label + \", Value: \" + value + \", List: \"+linkString()\n + \", Edges: \" + edgeString() + \", Visited: \" + visited + \", Previous: \"\n + previous.getLabel() + \", Distance From Source: \" + distanceFromSource;\n }", "public String toString() {\n return toString(overallRoot, 0.0, weightedNodeHeight(overallRoot));\n }", "@Override\n public String toString() {\n return new GsonBuilder().serializeNulls().create().toJson(this).toString();\n }", "@Override\n\tpublic String toString()\n\t{\n\t\tStringBuilder buffer = new StringBuilder(128);\n\t\tIterator<Map.Entry<String, AbstractNode>> it = pairs.entrySet().iterator();\n\t\twhile (it.hasNext())\n\t\t{\n\t\t\tMap.Entry<String, AbstractNode> pair = it.next();\n\t\t\tbuffer.append(keyToString(pair.getKey()));\n\t\t\tbuffer.append(KEY_VALUE_SEPARATOR_CHAR);\n\t\t\tbuffer.append(' ');\n\t\t\tbuffer.append(pair.getValue());\n\t\t\tif (it.hasNext())\n\t\t\t{\n\t\t\t\tbuffer.append(PAIR_SEPARATOR_CHAR);\n\t\t\t\tbuffer.append(' ');\n\t\t\t}\n\t\t}\n\t\treturn buffer.toString();\n\t}", "public String toString() {\n\t\t\n\t\tString temp = new String();\n\t\tfor(int i=0; i<grad.length; i++) {\n\t\t\ttemp += grad[i] + \" \";\n\t\t}\n\t\t\n\t\treturn temp;\n\t}", "public String getOutput() {\n TopologicalOrderIterator<String, DefaultEdge> iterator =\n new TopologicalOrderIterator<>(steps, Comparator.comparing((String x) -> x));\n\n // Traverse the DAG and store each vertex to a StringBuilder\n // to output once traversal is completed\n StringBuilder sb = new StringBuilder();\n while (iterator.hasNext()) {\n sb.append(iterator.next());\n }\n\n return sb.toString();\n }", "public String toString() {\n\t\tString result = \"[\";\n\t\tif (head == null) {\n\t\t\treturn result + \"]\";\n\t\t}\n\t\tresult = result + head.getData();\n\t\tListNode temp = head.getNext();\n\t\twhile (temp != null) {\n\t\t\tresult = result + \",\" + temp.getData();\n\t\t\ttemp = temp.getNext();\n\t\t}\n\t\treturn result + \"]\";\n\t}", "public String toString() {\n\t\tString result = \"[\";\n\t\tif (head == null) {\n\t\t\treturn result + \"]\";\n\t\t}\n\t\tresult = result + head.getData();\n\t\tListNode temp = head.getNext();\n\t\twhile (temp != null) {\n\t\t\tresult = result + \",\" + temp.getData();\n\t\t\ttemp = temp.getNext();\n\t\t}\n\t\treturn result + \"]\";\n\t}", "@Override\n public String toString() {\n return new Gson().toJson(this);\n }", "public String serialize() {\n Gson gson = new Gson();\n return gson.toJson(this);\n }", "public String serialize() {\n Gson gson = new Gson();\n return gson.toJson(this);\n }", "public String getStringRepresentation() {\n String result = \"\";\n result += \"GAIndividual: (\";\n result += \"Fitness {\";\n for (int i = 0; i < this.m_Fitness.length; i++) result += this.m_Fitness[i] + \";\";\n result += \"}/SelProb{\";\n for (int i = 0; i < this.m_SelectionProbability.length; i++) result += this.m_SelectionProbability[i] + \";\";\n result += \"})\\n Value: \";\n result += \"{\";\n for (int i = 0; i < this.m_GenotypeLength; i++) {\n if (i%8==0) result+=\"|\";\n if (this.m_Genotype.get(i)) result += \"1\";\n else result += \"0\";\n }\n result += \"}\";\n result += \"\\n Mutation (\"+this.m_MutationProbability+\"):\" + this.m_MutationOperator.getStringRepresentation();\n return result;\n }", "public String toString() {\n StringBuilder s = new StringBuilder(\"{\");\n\n Node<T> next;\n if (start != null) {\n next = start;\n s.append(next);\n next = next.next;\n while (next != null) {\n s.append(\", \" + next);\n next = next.next;\n }\n }\n s.append(\"}\");\n return s.toString();\n }", "@Override\n\tpublic String toString() {\n\t\tString out = new String();\n\t\tfor (int i = 0; i < this.maxNumVertices; i++) {\n\t\t\tfor (int j = 0; j < this.maxNumVertices; j++) {\n\t\t\t\tout = out + this.reachabilityMatrix[i][j] + \" \";\n\t\t\t}\n\t\t\tout = out + \"\\n\";\n\t\t}\n\t\treturn out;\n\t}", "public String toCanonicalVertexString() {\n \t StringBuffer canonicalVertexStringBuffer = new StringBuffer();\n \t this.canonize(1, canonicalVertexStringBuffer);\n \t return canonicalVertexStringBuffer.toString();\n \t}", "public String toRaw() {\n\t\treturn new StringBuilder(world).append(\",\").append(lowPoint.getBlockX()).append(\",\").append(lowPoint.getBlockY()).append(\",\").append(lowPoint.getBlockZ()).append(\",\").append(highPoint.getBlockX()).append(\",\").append(highPoint.getBlockY()).append(\",\").append(highPoint.getBlockZ()).toString();\n\t}", "private String edgeString()\n {\n Iterator<DSAGraphEdge<E>> iter = edgeList.iterator();\n String outputString = \"\";\n DSAGraphEdge<E> edge = null;\n while (iter.hasNext())\n {\n edge = iter.next();\n outputString = (outputString + edge.getLabel() + \", \");\n }\n return outputString;\n }", "public String toString() {\n\n // **** ****\n StringBuilder sb = new StringBuilder();\n\n sb.append(\"\\n n: \" + this.n);\n sb.append(\"\\nparents: \" + Arrays.toString(this.parents));\n\n // **** ****\n return sb.toString();\n }", "public String toString() {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tthis.createSpecSection(buffer);\n\t\tthis.createOperatorSection(buffer);\n\t\treturn buffer.toString();\n\t}", "public String toString() {\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tint n = dimension();\r\n\t\tsb = sb.append(n + \"\\n\");\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\tfor (int j = 0; j < n; j++) {\r\n\t\t\t\tsb = sb.append(\" \" + this.blocks[i][j]);\r\n\t\t\t}\r\n\t\t\tif (i != n) {\r\n\t\t\t\tsb = sb.append(\"\\n\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "public String toString() {\n StringBuilder s = new StringBuilder();\n Node current = head;\n for(int i=0; i < size; i++) {\n s.append(\"[\");\n s.append(current.item);\n s.append(\"], \");\n current = current.next;\n }\n\n return s.toString();\n }", "@Override\n public String toString(){\n Node<E> headPtr = headNode;\n StringBuffer buff= new StringBuffer();\n buff.append(\"[\");\n while(headPtr!=null){\n buff.append(headPtr.data);\n headPtr=headPtr.next;\n if(headPtr!=null)\n buff.append(\",\");\n }\n buff.append(\"]\");\n return buff.toString();\n }", "@Test\n\tpublic void testToString() {\n\t\tGraph<String> graph = emptyInstance();\n \tgraph.add(\"a\");\n \tgraph.add(\"b\");\n \tgraph.add(\"c\");\n \tgraph.add(\"d\");\n \tgraph.add(\"e\");\n \tassertEquals(\"Vertices: [a, b, c, d, e]\\n\" + \n \t\t\t\"Edges: []\", graph.toString());\n\t}", "public String toString() {\n\t\tString output = \"[\";\n\t\t\n\t\tfor (T nodeValue: this) {\n\t\t\tif (output.length() > 1)\t// doesn't add a \", \" at the beginning\n\t\t\t\toutput += \", \";\n\t\t\t\n\t\t\toutput += nodeValue;\n\t\t}\n\t\t\n\t\treturn output += \"]\";\n\t}", "public String toString() {\n String s = \"\";\n try {\n s += get_nodeid()+\"\\t\";\n //s += \" [nodeid=0x\"+Long.toHexString(get_nodeid())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += get_counter()+\"\\t\";\n //s += \" [counter=0x\"+Long.toHexString(get_counter())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \"\"+get_p_sendts()+\"\\t\";\n //s += \" [p_sendts=0x\"+Long.toHexString(get_p_sendts())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \"\"+get_receivets()+\"\\t\";\n //s += \" [receivets=0x\"+Long.toHexString(get_receivets())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \"\"+Float.toString(get_virtual_clk())+\"\\t\";\n //s += \" [virtual_clk=\"+Float.toString(get_virtual_clk())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \"\"+Float.toString(get_skew_cmp())+\"\\t\";\n //s += \" [skew_cmp=\"+Float.toString(get_skew_cmp())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \"\"+Float.toString(get_offset_cmp())+\"\";\n //s += \" [offset_cmp=\"+Float.toString(get_offset_cmp())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n return s;\n }", "public String toString() {\n\t\treturn \"[\" + this.type + \n\t\t\t\t\" | rate:\" + this.rate + \n\t\t\t\t\" | err:\" + this.error + \n\t\t\t\t\" | loc:\" + this.localisation.x + \",\" + this.localisation.y + \"]\" + \n\t\t\t\t\" | range:\" + this.range + \"\\n\";\n\t}", "public String toString() {\n\t\t\treturn shape;\n\t\t}", "public java.lang.String getGraphId() {\n java.lang.Object ref = graphId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n graphId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String toString() {\n\t\treturn data.toString();\n\t}", "public String toString() {\n\t\treturn data.toString();\n\t}", "@Override\n public final String toString() {\n return asString(0, 4);\n }", "public String toString() {\n\t\tStringBuilder sb = new StringBuilder(\"BNNode \" + name + \":\\n\");\n\t\tif (isEvidence)\n\t\t\tsb.append(\" EVIDENCE\\n\");\n\t\tsb.append(\" value: \" + value + \"\\n\");\n\t\tsb.append(\" parents:\");\n\t\tif (parents.length == 0)\n\t\t\tsb.append(\" (none)\");\n\t\telse\n\t\t\tfor (BNNode parent : parents) \n\t\t\t\tsb.append(\" \" + parent.name);\n\t\tsb.append(\"\\n children:\");\n\t\tif (children.length == 0)\n\t\t\tsb.append(\" (none)\");\n\t\telse\n\t\t\tfor (BNNode child : children) \n\t\t\t\tsb.append(\" \" + child.name);\n\t\tsb.append(\"\\n CPT:\");\n\t\tfor (double cp : cpt)\n\t\t\tsb.append(\" \" + cp);\n\t\treturn sb.toString();\n\t}", "public String toString() {\r\n return \"[\" + geomKML + \", \" + attributes.toString() + \"]\";\r\n }", "public String toString() {\r\n return name + \" \" + height + \" \" + width + \" \" + depth + \" \" + weight;\r\n }", "public String toString()\n\t{\n\t\treturn Printer.stringify(this, false);\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn toJSON().toString();\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn this.r.toString();\n\t}", "public String toString() {\n\t\tif(this.start != null && this.end != null){\n\t\t\tString s1 = (\"\\n\\nEdge: \" + this.edgeId + \"\\nReliable: \" + this.isReliable\n\t\t\t\t+ \"\\nMessage Flow Type: \" + this.msgFlowType\n\t\t\t\t+ \"\\nDelay type: \"\n\t\t\t\t+ this.delayType + \"\\nNode 1: \" + this.start.getNodeId()\n\t\t\t\t+ \"\\nNode 2: \" + this.end.getNodeId());\n\t\t\treturn s1;\n\t\t\t\n\t\t}else{\t\t\n\t\t\tString s2 = (\"\\n\\nEdge: \" + this.edgeId + \"\\nReliable: \" + this.isReliable\n\t\t\t\t+ \"\\nMessage Flow Type: \" + this.msgFlowType\n\t\t\t\t+ \"\\nNum Message Entered: \" + \"\\nDelay type: \"\n\t\t\t\t+ this.delayType);\n\t\t\treturn s2;\n\t\t}\t\t\n\t}", "public String toString(){\n return \"Neo[\"+getName()+\"]: CRS:\"+getCRS()+\" Bounds:\"+getBounds();\n }", "public String toString() {\n\t\tString tester = \"\";\n\t\tfor(String node : nodes.keySet())\n\t\t{\n\t\t\ttester += \" \" + nodes.get(node) + \" \\n\";\n\t\t}\n\t\treturn tester;\n\t}", "public String toString()\n\t{\n\t\tString result = \"\";\n\t\tresult += this.data;\n\t\treturn result;\n\t}", "public String toString() {\n return tree.toString();\n }", "public String toString(MapStringToInt map){\n\t\tStringBuffer s = new StringBuffer(\"digraph G_T {\\n\");\n\t\tfor ( int i = 0; i< this.graph.size(); i++){\n\t\t\tString original = map.getString(i);\n\t\t\tString modified = avoidErrorChar( original );\n\t\t\ts.append(String.format(\"%d [label=\\\"%s\\\"];\\n\", i, modified));\n\t\t}\n\t\tfor ( int m = 0; m< this.graph.size(); m++){\n\t\t\tfor ( int n = 0; n< this.graph.elementAt(m).size(); n++){\n\t\t\t\ts.append(String.format(\"%d -> %d;\\n\", m, this.graph.elementAt(m).elementAt(n) ));\n\t\t\t}\n\t\t}\n\t\ts.append(\"}\");\n\t\treturn s.toString();\n\t}", "public String toString() {\n return \"\" + data;\n }" ]
[ "0.74436057", "0.73367345", "0.73274195", "0.7305982", "0.7291808", "0.72912437", "0.71736556", "0.7165268", "0.71153706", "0.71059513", "0.7100664", "0.709213", "0.70729816", "0.70647806", "0.7030608", "0.70291704", "0.70191497", "0.69783676", "0.69725883", "0.69329613", "0.6932753", "0.69118994", "0.68153894", "0.68062454", "0.6798222", "0.6752443", "0.6749929", "0.67248285", "0.66885954", "0.6666244", "0.6658717", "0.6654366", "0.6627691", "0.658183", "0.6538631", "0.6538077", "0.65045846", "0.65045846", "0.65034294", "0.64816135", "0.6446385", "0.6435588", "0.6412835", "0.6407081", "0.6400484", "0.6398957", "0.6395777", "0.6384783", "0.6361114", "0.63582563", "0.6356942", "0.6356615", "0.6334278", "0.632028", "0.63155836", "0.6310671", "0.63025755", "0.6297003", "0.629531", "0.6286073", "0.6285495", "0.6282808", "0.62786025", "0.62786025", "0.6269469", "0.6267437", "0.6267437", "0.6265379", "0.62592655", "0.6255708", "0.623897", "0.6238524", "0.6238007", "0.6237557", "0.6235689", "0.6227253", "0.6224731", "0.62245697", "0.62241447", "0.6215209", "0.6213248", "0.62105066", "0.6208183", "0.6204409", "0.6203745", "0.6203745", "0.62007624", "0.6199483", "0.61944205", "0.6192649", "0.61923295", "0.61917514", "0.61794317", "0.6176156", "0.6173289", "0.6173109", "0.6169337", "0.616396", "0.6155307", "0.6151039" ]
0.8715176
0
Rotate to the left coordinate in path.
public abstract void rotateLeft();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void rotateLeft() {\n\t\tthis.direction = this.direction.rotateLeft();\n\t}", "@Override\r\n\tpublic void rotateLeft() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir - THETA);\r\n\t\t\r\n\t}", "private void rotateLeft() {\n robot.leftBack.setPower(-TURN_POWER);\n robot.leftFront.setPower(-TURN_POWER);\n robot.rightBack.setPower(TURN_POWER);\n robot.rightFront.setPower(TURN_POWER);\n }", "public void rotateLeft() {\n\t\tif (rotLeft == null) {\n\t\t\tQuaternion quat = new Quaternion();\n\t\t\tquat.fromAngles(0f, (float) Math.toRadians(90), 0f);\n\t\t\trotLeft = quat.toRotationMatrix();\n\t\t}\n\n\t\tgetNode().getLocalRotation().apply(rotLeft);\n\t}", "@Override\r\n\tpublic void rotateLeft() {\n\t\tsetDirection((this.getDirection() + 3) % 4);\r\n\t}", "void leftRotate(Node<K, V> x) {\n\t\tassert IsNotNil(x.getRight());\n\t\tNode<K, V> y = x.getRight();\n\n\t\t// B in position\n\t\tx.setRight(y.getLeft());\n\n\t\t// Y to root\n\t\tif (x == root) {\n\t\t\troot = y;\n\t\t} else if (x.isLeftChild()) {\n\t\t\tx.getParent().setLeft(y);\n\t\t} else if (x.isRightChild()) {\n\t\t\tx.getParent().setRight(y);\n\t\t}\n\n\t\t// x in position\n\t\ty.setLeft(x);\n\t}", "public Shape rotateLeft() \n\t{\n\t\tif (detailShape == Tetromino.SQUARE)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tvar result = new Shape();\n\t\tresult.detailShape = detailShape;\n\t\t\n\t\tfor (int i=0; i<4; i++)\n\t\t{\n\t\t\tresult.setX(i, y(i));\n\t\t\tresult.setY(i, -x(i));\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "private Node rotateLeft() {\n Node right = this.rightChild;\n this.rightChild = right.leftChild;\n right.leftChild = this;\n\n this.updateHeight();\n right.updateHeight();\n\n return right;\n }", "@Override\n\tpublic void rotateLeft(int degrees) {\n\t\t\n\t}", "public void rotateLeft(int time) {\n\t\tdouble step = 3;\r\n\t\t\r\n\t\tif( rotation - step < 0 )\r\n\t\t\trotation = rotation - step + 360;\r\n\t\telse\r\n\t\t\trotation -= step;\r\n\t\t\t\r\n\t}", "public void leftRotate(SplayNode x) {\n\t\t\t SplayNode y = x.right;\n\t\t x.right = y.left;\n\t\t if(y.left != null) {\n\t\t y.left.parent = x;\n\t\t }\n\t\t y.parent = x.parent;\n\t\t if(x.parent == null) { //x is root\n\t\t this.root = y;\n\t\t }\n\t\t else if(x == x.parent.left) { //x is left child\n\t\t x.parent.left = y;\n\t\t }\n\t\t else { //x is right child\n\t\t x.parent.right = y;\n\t\t }\n\t\t y.left = x;\n\t\t x.parent = y;\n\t\t }", "public MutableImage rotateLeft() {\n return rotate(-90);\n }", "public void rotLeft()\n\t{\n\t\t//only rotate if a PlayerShip is currently spawned\n\t\tif(gameObj[1].size() > 0)\n\t\t{\n\t\t\t((PlayerShip)gameObj[1].get(0)).moveLeft();\n\t\t\tSystem.out.println(\"Heading +10 degrees\");\n\t\t}else {\n\t\t\tSystem.out.println(\"there is not currently a player ship spawned\");\n\t\t}\n\t}", "public void rotateLeft() {\n // I fucked up? Rotations are reversed, just gonna switch em\n// tileLogic = getRotateLeft();\n tileLogic = getRotateRight();\n// rotateLeftTex();\n rotateRightTex();\n }", "public void rotateLeft(Node node){\n\t\tNode ptrRight = node.right;\n\t\tnode.right = ptrRight.left;\n\t\t\n\t\tif(ptrRight.left != nil){\n\t\t\tptrRight.left.parent = node;\n\t\t}\n\t\tptrRight.parent = node.parent;\n\t\t\n\t\tif(node.parent==nil){\n\t\t\troot = ptrRight;\n\t\t}else if( node == node.parent.left){\n\t\t\tnode.parent.left = ptrRight;\n\t\t}else{\n\t\t\tnode.parent.right = ptrRight;\n\t\t}\n\t\t\n\t\tptrRight.left = node;\n\t\tnode.parent = ptrRight;\n\t}", "public static void turnleftBy(double angle) {\n leftMotor.rotate(-convertAngle(angle), true);\n rightMotor.rotate(convertAngle(angle), false);\n }", "private void leftRotate(RedBlackNode<T> x){\n leftRotateFixup(x);\n\n RedBlackNode<T> y;\n y = x.right;\n x.right = y.left;\n\n // czy istnieje y.left i zamiana referencji\n if (!isNil(y.left))\n y.left.parent = x;\n y.parent = x.parent;\n\n // x.parent jest nil\n if (isNil(x.parent))\n root = y;\n\n // x jest lewym dzieckiem swojego rodzica\n else if (x.parent.left == x)\n x.parent.left = y;\n\n //x jest prawym dzieckiem swojego rodzica\n else\n x.parent.right = y;\n\n y.left = x;\n x.parent = y;\n }", "public Node rotateleft(Node x) {\n Node y = x.right;\n Node z = y.left;\n\n // Perform rotation\n y.left = x;\n x.right = z;\n\n // Update heights\n x.height = max(height(x.left), height(x.right)) + 1;\n y.height = max(height(y.left), height(y.right)) + 1;\n\n return y;\n }", "public Node<T> leftRotate(Node<T> node){\n\n Node<T> temp = node.right;//a temporary pointer set to the node's right child\n node.right = temp.left;// the node right child set to the left child\n temp.left = node;//temporary pointer left child set to the node who is rotating\n return temp;\n }", "public void leftRotate(Node<E> x){\n \n \t/*\n If x is the root of the tree to rotate with left child subtree T1 and right child y, \n where T2 and T3 are the left and right children of y:\n x becomes left child of y and T3 as its right child of y\n T1 becomes left child of x and T2 becomes right child of x\n */\n\t\tNode<E> y = x.getRightChild(); //set y\n\t\tx.setRightChild(y.getLeftChild()); //turn y's subtree into x's right subtree\n\t\ty.getLeftChild().setParent(x);\n\t\ty.setParent(x.getParent());\n\t\tif (x.getParent() == sentinel || x.getParent() == null) {\n\t\t\troot = y;\n\t\t} else if (x == x.getParent().getLeftChild()) { //link x's parent to y\n\t\t\tx.getParent().setLeftChild(y);\n\t\t} else {\n\t\t\tx.getParent().setRightChild(y);\n\t\t}\n\t\ty.setLeftChild(x); //put x on y's left\n\t\tx.setParent(y);\n\t\n }", "Node leftRotate(Node x) {\n Node y = x.right;\n Node T2 = y.left;\n\n // Perform rotation\n y.left = x;\n x.right = T2;\n\n // Update heights\n x.height = max(height(x.left), height(x.right)) + 1;\n y.height = max(height(y.left), height(y.right)) + 1;\n\n // Return new root\n return y;\n }", "Node leftRotate(Node x) \n { \n Node y = x.right; \n Node T2 = y.left; \n\n // Perform rotation \n y.left = x; \n x.right = T2; \n\n // Update heights \n x.height = Math.max(height(x.left), height(x.right)) + 1; \n y.height = Math.max(height(y.left), height(y.right)) + 1; \n\n // Return new root \n return y; \n }", "Node leftRotate(Node x)\n\t\t{\n\t\t\tNode y=x.right;\n\t\t\tNode T2=y.left;\n\t\t\t\n\t\t\t//rotate\n\t\t\t\n\t\t\ty.left=x;\n\t\t\tx.right=T2;\n\t\t\t\n\t\t\t//update heights\n\t\t\ty.height=max(height(y.left),height(y.left) +1 ) ;\n\t\t\tx.height=max(height(x.left),height(x.left) +1 ) ;\n\t\t\t\n\t\t\t// new root\n\t\t\treturn y;\n\t\t}", "private void leftRotate(WAVLNode y) {\n\t WAVLNode x=y.parent;\r\n\t WAVLNode a=x.left;\r\n\t WAVLNode b=y.left;\r\n\t WAVLNode c = y.right;\r\n\t y.left=x;\r\n\t x.right=b;\r\n\t \r\n\t if (x.parent!=null) {\r\n\t\t WAVLNode d=x.parent;\r\n\t\t String side=parentside(d,x);\r\n\r\n\t\t if (side.equals(\"right\")) {\r\n\t\t\t d.right=y;\r\n\t\t\t y.parent=d;\r\n\t\t }\r\n\t\t else {\r\n\t\t\t d.left=y;\r\n\t\t\t y.parent=d;\r\n\t\t }\r\n\t }\r\n\t else {\r\n\t\t y.parent=null;\r\n\t\t this.root=y;\r\n\t }\r\n\t x.parent=y;\r\n\t b.parent=x;\r\n\t x.rank=x.rank-1;\r\n\t x.sizen=a.sizen+b.sizen+1;\r\n\t y.sizen=x.sizen+c.sizen+1;\r\n\t \r\n }", "Node leftRotate(Node x) \n { \n Node y = x.right; \n Node T2 = y.left; \n \n // Perform rotation \n y.left = x; \n x.right = T2; \n \n // Update heights \n x.height = max(height(x.left), height(x.right)) + 1; \n y.height = max(height(y.left), height(y.right)) + 1; \n \n // Return new root \n return y; \n }", "private AVLNode<T> rotateLeft(AVLNode<T> node) {\n AVLNode<T> substitute = node.right;\n // donde ponemos los hijos a la izquierda del substituto\n node.right = substitute.left;\n substitute.left = node;\n\n return substitute;\n }", "public AVLNode rotateLeft(AVLNode x) {\n AVLNode y = x.getRight();\n AVLNode T2 = y.getLeft();\n \n //rotation\n y.setLeft(x);\n x.setRight(T2);\n \n //update heights\n x.setHeight(Math.max(getHeight(x.getLeft()), getHeight(x.getRight())) + 1);\n y.setHeight(Math.max(getHeight(y.getLeft()), getHeight(y.getRight())) + 1);\n \n return y;\n }", "public void rotLeft()\n\t{\n\t\t//only rotate if a PlayerShip is currently spawned\n\t\tIIterator iter = gameObj.getIterator();\n\t\twhile(iter.hasNext ())\n\t\t{\n\t\t\tGameObject current = (GameObject)iter.getNext();\n\t\t\tif(current instanceof PlayerShip)\n\t\t\t{\n\t\t\t\t((PlayerShip)current).moveLeft();\n\t\t\t\tSystem.out.println(\"Heading -20\");\n\t\t\t\tnotifyObservers();\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\t\tSystem.out.println(\"There is no playerShip spawned\");\n\t}", "public static TreapNode leftRotate(TreapNode x)\n {\n TreapNode y = x.right, T2 = y.left;\n\n // Perform rotation\n y.left = x;\n x.right = T2;\n\n // Return new root\n return y;\n }", "public Node<T> rightLeftRotate(Node<T> node){\n\n node.right = rightRotate(node.right);//rotate the parent to the right\n return leftRotate(node);// rotate the grandparent to the left\n }", "public void rotateLeft (View view){ //onClick for LEFT Button\n\n if (toyRobotIsActive) {\n\n robot.animate().rotationBy(-90f).setDuration(50); //turn toy robot LEFT\n\n rotateLeft--; //counter to determine orientation\n System.out.println(\"rotateLeft \" + rotateLeft);\n System.out.println(\"rotateLeft + rotateRight = \"\n + orientation(rotateLeft, rotateRight)); //chk params in Logs\n\n } else errorMessage(\"Please place toy robot\");\n }", "public Direction toLeft()\n {\n return new Direction(dirInDegrees - (FULL_CIRCLE / 4));\n }", "private NodeRB<K, V> rotateLeft(NodeRB<K, V> x) {\n\t\tNodeRB<K, V> xParent = x.parent;\n\n\t\tNodeRB<K, V> y = x.right;\n\t\tx.right = y.left;\n\t\ty.left = x;\n\n\t\t// Parents relations fix\n\t\tif (xParent != null) {\n\t\t\tif (x.isLeftChild()) {\n\t\t\t\txParent.left = y;\n\t\t\t} else {\n\t\t\t\txParent.right = y;\n\t\t\t}\n\t\t}\n\n\t\tx.parent = y;\n\t\ty.parent = xParent;\n\t\tif (x.right != null) {\n\t\t\tx.right.parent = x;\n\t\t}\n\n\t\tx.height = 1 + Math.max(height(x.left), height(x.right));\n\t\ty.height = 1 + Math.max(height(y.left), height(y.right));\n\t\treturn y;\n\t}", "private void singleRotateLeft(Node n) {\n Node r = n.mRight, rl = r.mLeft, p = n.mParent;\n n.mRight = rl;\n rl.mParent = n;\n r.mLeft = n;\n if (n == mRoot) {\n mRoot = r;\n r.mParent = null;\n }\n else if (p.mRight == n) {\n p.mRight = r;\n r.mParent = p;\n }\n else {\n p.mLeft = r;\n r.mParent = p;\n }\n n.mParent = r;\n }", "private SplayNode rotateWhenXisRightChildOfLeftChild(SplayNode X)\n\t{\n\t\tX = rotateWhenRightOfRoot(X);\n\t\t//G.setLeft(X);\n\t\tX = rotateWhenLeftOfRoot(X);\n\t\treturn X;\n\t}", "public Node<T> leftRightRotate(Node<T> node){\n\n node.left = leftRotate(node.left);//rotate the parent to the left\n return leftRotate(node);// rotate the grandparent to the right\n }", "public void leftRotate(Website root, Website x) {\r\n\t\tWebsite y = x.getRight(); \t//set y\r\n\t\tx.setRight(y.getLeft());\t//turn y's left subtree into x's right subtree\r\n\t\tif (y.getLeft() != null) {\t//if y.left exists,\r\n\t\t\ty.getLeft().setParent(x);\t//y.left's parent becomes x\r\n\t\t}\r\n\t\ty.setParent(x.getParent());\t//link x's parent to y\r\n\t\tif (x.getParent() == null) //if x is the root\r\n\t\t\tsetRoot(y);\t\t\t\t//y is now the root\r\n\t\telse if (x == x.getParent().getLeft())\t//if x is the left child\r\n\t\t\tx.getParent().setLeft(y);\t//x's parent sets its left as y\r\n\t\telse {\r\n\t\t\tx.getParent().setRight(y);\t\t//if it is not the left child, it is the right child and x's parent sets its right as y\r\n\t\t}\r\n\t\ty.setLeft(x); \t//x on y's left\r\n\t\tx.setParent(y);\t// link x to y\r\n\t}", "private void leftRotate(RBNode<T> x) {\r\n // node x must have rightChild\r\n RBNode<T> y = x.right;\r\n\r\n //1. deal with y's leftChild, move it to x's rightChild:\r\n // update x's rightChild as y's leftChild\r\n x.right = y.left;\r\n\r\n // update y.left.parent as x (only y.left is not null)\r\n if(y.left != null)\r\n y.left.parent = x;\r\n\r\n //2. deal with parent of x, move y to x's position\r\n // update y's parent as x's parent\r\n y.parent = x.parent;\r\n // if x.parent = null, set root = y\r\n if(x.parent == null) {\r\n this.root = y;\r\n } else {\r\n //if x is leftChild of parent, assign y as parent's leftChild\r\n if(x == x.parent.left)\r\n x.parent.left = y;\r\n else//if x is rightChild of parent, assign y as parent's rightChild\r\n x.parent.right = y;\r\n }\r\n\r\n //3. update y.left as x, update x.parent as y\r\n y.left = x;\r\n x.parent = y;\r\n }", "public void leftRotate(Node n) {\r\n\t\tNode y = n.right;\r\n\t\tn.right = y.left;\r\n\t\tif(!y.left.isNil)\r\n\t\t\ty.left.parent = n;\r\n\t\ty.parent = n.parent;\r\n\t\tif(n.parent.isNil)\r\n\t\t\troot = y;\r\n\t\telse if(n == n.parent.left)\r\n\t\t\tn.parent.left = y;\r\n\t\telse\r\n\t\t\tn.parent.right = y;\r\n\t\ty.left = n;\r\n\t\tn.parent = y;\r\n\t}", "private void leftRotate(AVLNode<T> parent, AVLNode<T> node) {\n AVLNode<T> oldLeft = parent.getLeft();\n AVLNode<T> parDat = new AVLNode<>(parent.getData());\n parent.setLeft(parDat);\n if (oldLeft != null) {\n parent.getLeft().setLeft(oldLeft);\n calcDeterminants(parent.getLeft().getLeft());\n }\n if (node.getLeft() != null) {\n parent.getLeft().setRight(node.getLeft());\n calcDeterminants(parent.getLeft().getRight());\n }\n parent.setData(node.getData());\n if (node.getRight() != null) {\n parent.setRight(node.getRight());\n calcDeterminants(parent.getRight());\n } else {\n parent.setRight(null);\n calcDeterminants(parent.getLeft());\n }\n }", "private void rotateLeft(RedBlackNode x){\n\t RedBlackNode xParent = x.parent;\n\t RedBlackNode y = x.right;\n\t RedBlackNode BSubTree = y.left;\n\t y.left = x;\n\t x.parent = y;\n\t x.right = BSubTree;\n\t //analyse whether need to have Nil check in this code\n\t BSubTree.parent = x;\n\t if(xParent == this.Nil){\n\t\t this.root = y;\n\t\t y.parent = this.Nil;\n\t }else if(xParent.left == x){\n\t\t xParent.left = y;\n\t\t y.parent = xParent;\n\t }else{\n\t\t xParent.right = y;\n\t\t y.parent = xParent;\n\t }\n\t \n }", "public void leftRotate(RBNode<T, E> node) {\r\n\t\t// Keep Track of the root and the pivot and roots parent\r\n\t\tRBNode<T, E> root = node;\r\n\t\tRBNode<T, E> pivot = node.rightChild;\r\n\t\tRBNode<T, E> rParent = root.parent;\r\n\t\t// If pivot is not null, then proceed to rotate\r\n\t\tif (pivot != nillLeaf) {\r\n\t\t\t// do this if root has a parent\r\n\t\t\tif (rParent != nillLeaf) {\r\n\t\t\t\t// if root is going left to the root's parent, then set pivot to\r\n\t\t\t\t// left of the root.\r\n\t\t\t\tif (root.uniqueKey.compareTo(rParent.uniqueKey) < 0) {\r\n\t\t\t\t\t// root must be on the left of parent\r\n\t\t\t\t\troot.rightChild = pivot.leftChild;\r\n\t\t\t\t\tpivot.leftChild.parent = root;\r\n\t\t\t\t\tpivot.leftChild = root;\r\n\t\t\t\t\trParent.leftChild = pivot;\r\n\t\t\t\t\troot.parent = pivot;\r\n\t\t\t\t\tpivot.parent = rParent;\r\n\t\t\t\t\tthis.root = searchRoot(rParent);\r\n\r\n\t\t\t\t}\r\n\t\t\t\t// if root is going right of root's parent, then set pivot to\r\n\t\t\t\t// right of the root.\r\n\t\t\t\telse if (root.uniqueKey.compareTo(rParent.uniqueKey) > 0) {\r\n\t\t\t\t\t// root must be on the right of the parent.\r\n\t\t\t\t\troot.rightChild = pivot.leftChild;\r\n\t\t\t\t\tpivot.leftChild.parent = root;\r\n\t\t\t\t\tpivot.leftChild = root;\r\n\t\t\t\t\trParent.rightChild = pivot;\r\n\t\t\t\t\troot.parent = pivot;\r\n\t\t\t\t\tpivot.parent = rParent;\r\n\t\t\t\t\tthis.root = searchRoot(rParent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// else if root has no parent, then rotate with no parent.\r\n\t\t\telse {\r\n\t\t\t\troot.rightChild = pivot.leftChild;\r\n\t\t\t\tpivot.leftChild.parent = root;\r\n\t\t\t\tpivot.leftChild = root;\r\n\t\t\t\troot.parent = pivot;\r\n\t\t\t\tthis.root = pivot;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public FallingPiece rotateLeft(){\r\n return new FallingPiece(coord, innerPiece.rotateLeft());\r\n }", "public void rotatePieceLeft(){\r\n if (hasFalling()){\r\n FallingPiece test = falling.rotateLeft();\r\n if (!moveIfNoConflict(test, falling))\r\n Kick(test, falling);\r\n if(isGhostActivated())\r\n \t\t\tgenerateGhost();\r\n }\r\n }", "public AVLNode rotateLeft(AVLNode pt) {\n\t\tAVLNode node = pt.getRight();\n\t\t\n\t\tpt.setRight(node.getLeft());\n\t\tnode.setLeft(pt);\n\t\t\n\t\treturn node;\n\t}", "public void turnLeft() {\r\n setDirection( modulo( myDirection-1, 4 ) );\r\n }", "private BTNode<T> rotateLeft(BTNode<T> p){\n BTNode<T> q = p.getRight();\n p.setRight(q.getLeft());\n q.setLeft(p);\n fixHeight(q);\n fixHeight(p);\n return q;\n }", "public static int rotateLeft(int dir) {\n return (dir + 1) & 3;\n }", "protected Node<E> rotateLeft(Node<E> root) {\r\n\t\tNode<E> temp = root.right;\r\n\t\troot.right = temp.left;\r\n\t\ttemp.left = root;\r\n\t\treturn temp;\t\r\n\t}", "Node leftRotate(Node x) { \n Node y = x.right; \n Node T2 = y.left; \n \n // Perform rotation \n y.left = x; \n x.right = T2; \n \n // Update heights \n x.height = maxInt(heightBST(x.left), heightBST(x.right)) + 1; \n y.height = maxInt(heightBST(y.left), heightBST(y.right)) + 1; \n \n // Return new root \n return y; \n }", "private Node rotateLeft(Node h){\n\n\t\tNode x = h.right;\n\t\th.right = x.left;\n\t\tx.left = h;\n\t\tx.color = h.color;\n\t\th.color = RED;\n\t\treturn x;\n\t}", "private Node rotateLeft(Node h) {\n Node x = h.right;\n h.right = x.left;\n x.left = h;\n x.color = x.left.color;\n x.left.color = RED;\n x.size = h.size;\n h.size = size(h.left) + size(h.right) + 1;\n return x;\n }", "protected RedBlackNode<T> rotateLeft(RedBlackNode<T> node) {\n RedBlackNode<T> rightNode = node.getRightChild();\n RedBlackNode<T> parent = node.getParent();\n rightNode._parent = node.getParent();\n node._rightChild = rightNode.getLeftChild();\n if (node._rightChild != null ) {\n node._rightChild._parent = node;\n } \n rightNode._leftChild = node; \n node._parent = rightNode;\n // node had parent.\n if(parent != null) {\n // node was left child\n if(parent._leftChild == node) {\n parent._leftChild = rightNode;\n } else {\n // node was right child\n parent._rightChild = rightNode;\n }\n } else {\n // node was head\n _head = rightNode;\n }\n return rightNode;\n }", "public Vertex moveLeft() {\n for (Edge e : current.outEdges) {\n move(e.to.x == current.x - 1, e);\n }\n return current;\n }", "private SplayNode rotateWhenLeftOfRoot(SplayNode X)\n\t{\n\t\tSplayNode B = X.getRight();\n\t\tSplayNode P = X.getParent();\n\t\t//SplayNode C = P.getRight();\n\n\t\tif(P!=null)\n\t\t{\n\t\t\tP.setLeft(B);\n\t\t}\n\t\tif(B!=null)\n\t\t{\n\t\t\tB.setParent(P);\n\t\t}\n\n\t\tif(P!=null && X != null)\n\t\t{\n\t\t\tX.setParent(P.getParent());\n\t\t\tif(P.getParent() != null)\n\t\t\t{\n\t\t\t\tif(P.getParent().getLeft()!=null && P.getParent().getLeft().equals(P))\n\t\t\t\t{\n\t\t\t\t\tP.getParent().setLeft(X);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(P.getParent().getRight()!=null && P.getParent().getRight().equals(P))\n\t\t\t\t\t{\n\t\t\t\t\t\tP.getParent().setRight(X);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tP.setParent(X);\n\t\t\tX.setRight(P);\n\t\t}\n\t\treturn X;\n\t}", "public void moveLeft() {\n Coordinate leftCoord = new Coordinate(getX() - 1, getY());\n handleMove(leftCoord, InteractionHandler.LEFT);\n }", "@Override\n public void turnLeft(Double angle) {\n angle = Math.toRadians(angle);\n double temp = vector.x;\n vector.x = vector.x * Math.cos(angle) - vector.y * Math.sin(angle);\n vector.y = temp * Math.sin(angle) + vector.y * Math.cos(angle);\n }", "private void leftLeftCase(NodeRB<K, V> x) {\n\t\t// Swap colors of g and p\n\t\tboolean aux = x.parent.color;\n\t\tx.parent.color = x.getGrandParent().color;\n\t\tx.getGrandParent().color = aux;\n\n\t\t// Right Rotate g\n\t\tNodeRB<K, V> g = x.getGrandParent();\n\t\tif (g.parent == null) {\n\t\t\troot = rotateRight(g);\n\t\t} else {\n\t\t\trotateRight(g);\n\t\t}\n\t}", "void moveLeft() {\n\t\tsetX(x-1);\r\n\t\tdx=-1;\r\n\t\tdy=0;\r\n\t}", "public void moveLeft(int speed)\n {\n if(getRotation()==0)\n {\n turn(180);\n move(speed);\n }\n else if(getRotation()==90)\n {\n turn(90);\n move(speed);\n }\n else if(getRotation()==180)\n {\n move(speed);\n }\n else if(getRotation()==270)\n {\n turn(-90);\n move(speed);\n }\n }", "private AvlNode<E> rotateWithLeftChild(AvlNode<E> k1){\n AvlNode<E> k2 = k1.left;\n k1.left = k2.right;\n k2.right = k1;\n k1.height = max(height(k1.left), height(k2.right)) + 1;\n k2.height = max(height(k2.left), k1.height) + 1;\n return k2;\n }", "protected void left() {\n move(positionX - 1, positionY);\n orientation = BattleGrid.RIGHT_ANGLE * 2;\n }", "private Node leftRotate(Node a) {\n Node b = a.getRightChild();\n Node n2 = b.getLeftChild();\n b.setLeftChild(a);\n a.setRightChild(n2);\n setHeights(a, b);\n return b;\n }", "private void turnLeft() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n switch (direction) {\n case EAST:\n direction = Position.Direction.NORTH;\n break;\n case WEST:\n direction = Position.Direction.SOUTH;\n break;\n case NORTH:\n direction = Position.Direction.WEST;\n break;\n case SOUTH:\n direction = Position.Direction.EAST;\n break;\n }\n\n currentPosition.setDirection(direction);\n }", "private void doubleRotateleft(WAVLNode x) {\n\t WAVLNode z=x.right;\r\n\t leftRotate(z);\r\n\t z.rank+=1;\r\n\t rightRotate(z);\r\n }", "public void spinLeft(double speed) {\r\n \tspeed = Math.abs(speed);\r\n \tleftTopMotor.set(-1 * speed);\r\n \tleftBottomMotor.set(-1 * speed);\r\n \trightTopMotor.set(-1 * speed);\r\n \trightBottomMotor.set(-1 * speed);\r\n }", "private long leftRotate(long n) throws IOException {\n Node current = new Node(n);\r\n long currentRight = current.right;\r\n Node tempN = new Node(current.right);\r\n current.right = tempN.left;\r\n tempN.left = n;\r\n current.height = getHeight(current);\r\n current.writeNode(n);\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(currentRight);\r\n return currentRight;\r\n }", "protected Node<E> rotateLeft( Node<E> root ) {\n\n if( root == null || root.right == null) {\n return null;\n }\n\n Node<E> tempNode = root.right;\n root.right = tempNode.left;\n tempNode.left = root;\n return tempNode;\n\n }", "public Dir moveLeft() {\n\t\t\tint newDir = (this.ordinal() + SIZE - 1) % SIZE;\n\t\t\treturn dirArray[newDir];\n\t\t}", "private SplayNode rotateWhenXisLeftChildOfRightChild(SplayNode X)\n\t{\n\t\tX = rotateWhenLeftOfRoot(X);\n\t\t//G.setRight(X);\n\t\tX = rotateWhenRightOfRoot(X);\t\t\n\t\treturn X;\n\t}", "private NodeTreeBinary<T> rotateLeft(NodeTreeBinary<T> h) {\n\t\tNodeTreeBinary<T> x = h.getRight();\n\n\t\th.setRight(x.getLeft());\n\t\tx.setLeft(h);\n\t\tsetColor(x, getColor(x.getLeft()));\n\t\tsetColor(x.getLeft(), NodeTreeRB.RED);\n\n\t\tsetSize(x, getSize(h));\n\t\tsetSize(h, getSize(h.getLeft()) + getSize(h.getRight()) + 1);\n\n\t\treturn x;\n\t}", "public void left(){\n\t\tmoveX=-1;\n\t\tmoveY=0;\n\t}", "public Direction moveLeft() {\n switch(this){\n case EAST :\n return NORTH;\n case SOUTH :\n return EAST;\n case WEST :\n return SOUTH;\n case NORTH :\n return WEST;\n }\n return this;\n }", "public void rightRotate(SplayNode x) {\n\t\t\t SplayNode y = x.left;\n\t\t x.left = y.right;\n\t\t if(y.right != null) {\n\t\t y.right.parent = x;\n\t\t }\n\t\t y.parent = x.parent;\n\t\t if(x.parent == null) { //x is root\n\t\t this.root = y;\n\t\t }\n\t\t else if(x == x.parent.right) { //x is left child\n\t\t x.parent.right = y;\n\t\t }\n\t\t else { //x is right child\n\t\t x.parent.left = y;\n\t\t }\n\t\t y.right = x;\n\t\t x.parent = y;\n\t\t }", "public void moveLeft(){\n\t\tif(GameSystem.TWO_PLAYER_MODE){\n\t\t\tif(Game.getPlayer2().dying){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(animation==ANIMATION.DAMAGED||Game.getPlayer().dying||channelling||charging) return;\n\t\tmoving=true;\n\t\tbuttonReleased=false;\n\t\torientation=ORIENTATION.LEFT;\n\t\tif(animation!=ANIMATION.MOVELEFT) {\n\t\t\tanimation=ANIMATION.MOVELEFT;\n\t\t\tif(run!=null) sequence.startSequence(run);\n\t\t}\n\t\tfacing=FACING.LEFT;\n\t\tdirection=\"left\";\n\t\tsetNextXY();\n\t\tsetDestination(nextX,nextY);\n\t\tvelX=-1*spd/2;\n\t\tvelY=0;\n\t}", "private AVLTreeNode<E> smallRotateLeft(AVLTreeNode<E> node) {\n AVLTreeNode<E> p = node.getRight();\n node.setRight(p.getLeft());\n p.setLeft(node);\n node.fixHeight();\n p.fixHeight();\n return p;\n }", "public Node rotateLeft(Node n)\r\n\t{\r\n\t\tNode target = n.right;//rotate target to node\r\n\t\tNode subTree = target.left;//get its subtree\r\n\t\t\r\n\t\ttarget.left = n;//set targets old sub tree to nodes sub tree\r\n\t\tn.right = subTree;// set old sub tree to nodes subtree\r\n\t\t\r\n\t\t//increment the height of the tree\r\n\t\tn.height = maxHeight(height(n.left),height(n.right))+1;\r\n\t\ttarget.height = maxHeight(height(target.left),height(target.right))+1;\r\n\t\t\r\n\t\treturn target;\r\n\t}", "public void moveLeft() {\n\t\tsetPosX(getPosX() - steps);\n\t}", "private void moveLeft(){\n \n setGlobalLocation(getGlobalX() - speed, getGlobalY());\n animationSpeedLeft();\n }", "public void turnLeft()\r\n\t{\r\n\t\t\r\n\t\theading -= 2; //JW\r\n\t\t//Following the camera:\r\n\t\t\t//heading -= Math.sin(Math.toRadians(15))*distance; \r\n\t\t\t//heading -= Math.cos(Math.toRadians(15))*distance;\r\n\t}", "private RedBlackNode rotationWithLeftChild(RedBlackNode node2) \n { \n RedBlackNode node1 = node2.leftChild; \n node2.leftChild = node1.rightChild; \n node1.rightChild = node2; \n return node1; \n }", "public void moveLeft() {\n locX = locX - 1;\n }", "public void turnLeft() {\n\t\tthis.setSteeringDirection(getSteeringDirection()-5);\n\t\t}", "@Override\n \t\t\t\tpublic void doRotateX() {\n \n \t\t\t\t}", "public static void setLeftMotorPosition(double rotations){\n leftFrontMotor.getPIDController().setReference(rotations, ControlType.kPosition);\n }", "private void rotateLeft(Node curr, boolean colorChangeNeeded) {\n\t\tNode parent = curr.parent;\n\t\tcurr.parent = parent.parent;\n if(parent.parent != null) {\n if(parent.parent.right == parent) {\n \tparent.parent.right = curr;\n } else {\n \tparent.parent.left = curr;\n }\n }\n Node left = curr.left;\n curr.left = parent;\n parent.parent = curr;\n parent.right = left;\n if(left != null) {\n left.parent = parent;\n }\n if(colorChangeNeeded) {\n curr.color = Color.BLACK;\n parent.color = Color.RED;\n }\n\t}", "private void leftRotate(Entry<T> child, Entry<T> p) {\n\t\tif(p.parent != null) {\n\t\t\tif(p == p.parent.left)\n\t\t\t\tp.parent.left = child;\n\t\t\telse\n\t\t\t\tp.parent.right = child;\n\t\t}\n\t\tif(child.left != null)\n\t\t\tgetSplay(child.left).parent = p;\n\t\t\n\t\tchild.parent = p.parent;\n\t\tp.parent = child;\n\t\tp.right = child.left;\n\t\tchild.left = p;\n\t}", "public static int rotate_left (int d) {\n\t\treturn d == 0 ? 3 : d - 1;\n\t}", "public void moveLeft()\n {\n if (xPos == 0)\n {\n movementY = 0;\n movementX = 0;\n }\n\n // Set the movement factor - negative X because we are moving LEFT! \n movementX = -0.5;\n movementY = 0;\n }", "public void left () {\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return;\n Location loc = getLocation();\n Location next = loc.getAdjacentLocation(Location.WEST);\n if (canMove(next)) {\n moveTo(next);\n }\n }", "public void moveLeft(){\n myRectangle.setX(myRectangle.getX() - PADDLE_SPEED);\n }", "private void rightRotate(WAVLNode x) {\n\t WAVLNode a=x.left;\r\n\t WAVLNode b=x.right;\r\n\t WAVLNode y=x.parent;\r\n\t WAVLNode c=y.right;\r\n\t x.right=y;\r\n\t y.left=b;\r\n\t if (y.parent!=null) {\r\n\t\t WAVLNode d=y.parent;\r\n\t\t String side=parentside(d,y);\r\n\r\n\t\t if (side.equals(\"right\")) {\r\n\t\t\t d.right=x;\r\n\t\t\t x.parent=d;\r\n\t\t }\r\n\t\t else {\r\n\t\t\t d.left=x;\r\n\t\t\t x.parent=d;\r\n\t\t }\r\n\t }\r\n\t else {\r\n\t\t x.parent=null;\r\n\t\t this.root=x;\r\n\t }\r\n\t y.parent=x;\r\n\t b.parent=y;\r\n\t y.rank=y.rank-1;\r\n\t \r\n\t y.sizen=b.sizen+c.sizen+1;\r\n\t x.sizen=a.sizen+y.sizen+1;\r\n\t \r\n }", "public void moveLeft() {\r\n\t\tif (x > 0) x--; \r\n\t}", "private AVLNode<T, U> rotateLeft(AVLNode<T, U> oldRoot) {\n\t\tAVLNode<T, U> newRoot = oldRoot.getRight();\n\t\t\n\t\tnewRoot.setParent(oldRoot.getParent());\n\t\toldRoot.setRight(newRoot.getLeft());\n\t\t\t \n\t\tif(oldRoot.getRight() != null) {\n\t\t\toldRoot.getRight().setParent(oldRoot);\n\t\t}\n\t\t\n\t\tnewRoot.setLeft(oldRoot);\n\t\toldRoot.setParent(newRoot);\n\t\t\n\t\tif(newRoot.getParent() != null){\n\t\t\tif(newRoot.getParent().getRight() == oldRoot){\n\t\t\t\tnewRoot.getParent().setRight(newRoot);\n\t\t\t}else if(newRoot.getParent().getLeft() == oldRoot){\n\t\t\t\tnewRoot.getParent().setLeft(newRoot);\n\t\t\t}\n\t\t}\n\t\t\n\t\tcomputeHeightsToRoot(oldRoot);\n\t\treturn newRoot;\n\t}", "public void moveLeft() {\n \tif(!move.moveLeft()) {\n \t\tif(physinteractor(getX()-1,getY())) {\n \t\t\tmove.moveLeft();\n \t\t\tnonphysinteractor(getX(),getY());\n \t\t\tupdatemove();\n \t\t}\n }else {\n \tupdatemove();\n \tnonphysinteractor(getX(),getY());\n }\n }", "public void moveLeft() {\n if (!this.state.equals(\"onLeftWall\")) {\n this.dir = -1;\n this.xTargetSpeed = this.X_MAX_SPEED;\n }\n }", "public void moveLeft()\n\t{\n\t\tx = x - STEP_SIZE;\n\t}", "private void leftRotateFixup(RedBlackNode x){\n\n // Przypadek 1: tylko x, x.right i x.right.right są nil.\n if (isNil(x.left) && isNil(x.right.left)){\n x.numLeft = 0;\n x.numRight = 0;\n x.right.numLeft = 1;\n }\n\n // Przypadek 2: x.right.left istnieje w dodatku do przypadku 1\n else if (isNil(x.left) && !isNil(x.right.left)){\n x.numLeft = 0;\n x.numRight = 1 + x.right.left.numLeft +\n x.right.left.numRight;\n x.right.numLeft = 2 + x.right.left.numLeft +\n x.right.left.numRight;\n }\n\n // Przypadek 3: x.left także istnieje w dodatku do przypadku 1\n else if (!isNil(x.left) && isNil(x.right.left)){\n x.numRight = 0;\n x.right.numLeft = 2 + x.left.numLeft + x.left.numRight;\n\n }\n\n // Przypadek 4: x.left i x.right.left istnieją w dodatku do przypadku 1\n else{\n x.numRight = 1 + x.right.left.numLeft +\n x.right.left.numRight;\n x.right.numLeft = 3 + x.left.numLeft + x.left.numRight +\n x.right.left.numLeft + x.right.left.numRight;\n }\n }", "public AVLNode rotateDoubleLeft(AVLNode pt) {\n\t\t\n\t\tAVLNode node = rotateRight(pt.getRight());\n\t\t\n\t\tpt.setRight(node);\n\t\tpt = rotateLeft(pt);\n\t\t\n\t\treturn pt;\n\t}", "public void rotLauncherLeft()\n\t{\n\t\t//only rotate if a PlayerShip, and therefore a MissileLauncher is spawned\n\t\tIIterator iter = gameObj.getIterator();\n\t\twhile(iter.hasNext())\n\t\t{\n\t\t\tGameObject current = (GameObject)iter.getNext();\n\t\t\tif(current instanceof PlayerShip)\n\t\t\t{\n\t\t\t\t((PlayerShip)current).moveLauncherLeft();\n\t\t\t\tSystem.out.println(\"launcher heading +20\");\n\t\t\t\tnotifyObservers();\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\t\tSystem.out.println(\"There is no playerShip spawned\");\n\t}" ]
[ "0.8270631", "0.8044815", "0.79010713", "0.77828014", "0.7711977", "0.74015343", "0.7380543", "0.7357978", "0.7311242", "0.7305097", "0.72757506", "0.72505283", "0.7233195", "0.72205144", "0.72164285", "0.7180057", "0.7130579", "0.71121097", "0.71000904", "0.70905715", "0.7051064", "0.7030702", "0.70248985", "0.70112723", "0.69525415", "0.6942788", "0.6932571", "0.691467", "0.6882143", "0.68770564", "0.6871639", "0.6862501", "0.6861096", "0.6859078", "0.68311036", "0.6824035", "0.6822454", "0.6786477", "0.67785007", "0.67748904", "0.6752776", "0.67440647", "0.67387944", "0.67038924", "0.66823214", "0.6668597", "0.6650072", "0.6649446", "0.6645872", "0.66227055", "0.6613734", "0.659291", "0.656706", "0.65436774", "0.65400356", "0.65133476", "0.6494783", "0.6492491", "0.6488577", "0.64639384", "0.6461767", "0.64581597", "0.6456067", "0.64439726", "0.6439535", "0.6434152", "0.6427722", "0.63769174", "0.636092", "0.6347547", "0.6331663", "0.6327921", "0.63197154", "0.63159424", "0.6310549", "0.62829244", "0.6281224", "0.6275496", "0.6269969", "0.6269163", "0.62639827", "0.6247032", "0.6234647", "0.62254417", "0.62235296", "0.62209314", "0.6209741", "0.6202041", "0.61964715", "0.6189351", "0.6178067", "0.61615485", "0.6158375", "0.6144299", "0.61271805", "0.61140525", "0.6113296", "0.61123735", "0.611008", "0.6094935" ]
0.75325763
5
Rotate to the right coordinate in path.
public abstract void rotateRight();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void rotateRight() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir + THETA);\r\n\t\t\r\n\t}", "public void rotateRight() {\n\t\tthis.direction = this.direction.rotateRight();\n\t}", "private void rotateRight() {\r\n\t switch(direction){\r\n\t case Constants.DIRECTION_NORTH:\r\n\t direction = Constants.DIRECTION_EAST;\r\n\t break;\r\n\t case Constants.DIRECTION_EAST:\r\n\t direction = Constants.DIRECTION_SOUTH;\r\n\t break;\r\n\t case Constants.DIRECTION_SOUTH:\r\n\t direction = Constants.DIRECTION_WEST;\r\n\t break;\r\n\t case Constants.DIRECTION_WEST:\r\n\t direction = Constants.DIRECTION_NORTH;\r\n\t break;\r\n\t }\r\n\t }", "@Override\r\n\tpublic void rotateRight() {\n\t\tsetDirection((this.getDirection() + 1) % 4);\r\n\t}", "private void rotateRight() {\n robot.leftBack.setPower(TURN_POWER);\n robot.leftFront.setPower(TURN_POWER);\n robot.rightBack.setPower(-TURN_POWER);\n robot.rightFront.setPower(-TURN_POWER);\n }", "public Shape rotateRight()\n\t{\n\t\tif (detailShape == Tetromino.SQUARE)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tvar result = new Shape();\n\t\tresult.detailShape = detailShape;\n\t\t\n\t\tfor (int i=0; i<4; i++)\n\t\t{\n\t\t\tresult.setX(i, -y(i));\n\t\t\tresult.setY(i, x(i));\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public void rotateRight(int time) {\n\t\tdouble step = 3;\r\n\t\t\r\n\t\tif( rotation + step > 360 )\r\n\t\t\trotation = rotation + step - 360;\r\n\t\telse\r\n\t\t\trotation += step;\r\n\t}", "void rightRotate(Node<K, V> y) {\n\t\tassert IsNotNil(y.getLeft());\n\t\tNode<K, V> x = y.getLeft();\n\n\t\t// B in postion\n\t\ty.setLeft(x.getRight());\n\n\t\t// X to root\n\t\tif (y == root) {\n\t\t\troot = x;\n\t\t} else if (y.isRightChild()) {\n\t\t\ty.getParent().setRight(x);\n\t\t} else if (y.isLeftChild()) {\n\t\t\ty.getParent().setLeft(x);\n\t\t}\n\n\t\t// y in position\n\t\tx.setRight(y);\n\t}", "void rotate();", "public void rightRotate(SplayNode x) {\n\t\t\t SplayNode y = x.left;\n\t\t x.left = y.right;\n\t\t if(y.right != null) {\n\t\t y.right.parent = x;\n\t\t }\n\t\t y.parent = x.parent;\n\t\t if(x.parent == null) { //x is root\n\t\t this.root = y;\n\t\t }\n\t\t else if(x == x.parent.right) { //x is left child\n\t\t x.parent.right = y;\n\t\t }\n\t\t else { //x is right child\n\t\t x.parent.left = y;\n\t\t }\n\t\t y.right = x;\n\t\t x.parent = y;\n\t\t }", "private void rotate() {\n byte tmp = topEdge;\n topEdge = leftEdge;\n leftEdge = botEdge;\n botEdge = rightEdge;\n rightEdge = tmp;\n tmp = reversedTopEdge;\n reversedTopEdge = reversedLeftEdge;\n reversedLeftEdge = reversedBotEdge;\n reversedBotEdge = reversedRightEdge;\n reversedRightEdge = tmp;\n tmp = ltCorner;\n ltCorner = lbCorner;\n lbCorner = rbCorner;\n rbCorner = rtCorner;\n rtCorner = tmp;\n\n }", "Node rightRotate(Node y) \n { \n Node x = y.left; \n Node T2 = x.right; \n \n // Perform rotation \n x.right = y; \n y.left = T2; \n \n // Update heights \n y.height = max(height(y.left), height(y.right)) + 1; \n x.height = max(height(x.left), height(x.right)) + 1; \n \n // Return new root \n return x; \n }", "public abstract void rotate();", "public void rotRight()\n\t{\n\t\t//only rotate if a PlayerShip is currently spawned\n\t\tif(gameObj[1].size() > 0)\n\t\t{\n\t\t\t((PlayerShip)gameObj[1].get(0)).moveRight();\n\t\t\tSystem.out.println(\"Heading -10 degrees\");\n\t\t}else {\n\t\t\tSystem.out.println(\"there is not currently a player ship spawned\");\n\t\t}\n\t}", "private void rotate(int direction){\n\t\t//Gdx.app.debug(TAG, \"rotating, this.x: \" + this.x + \", this.y: \" + this.y);\n\t\tif (direction == 1 || direction == -1){\n\t\t\tthis.orientation = (this.orientation + (direction*-1) + 4) % 4;\n\t\t\t//this.orientation = (this.orientation + direction) % 4;\n\t\t} else{\n\t\t\tthrow new RuntimeException(\"Tile invalid direction\");\n\t\t}\n\t}", "Node rightRotate(Node x)\n\t{\n\t\tNode y=x.left;\n\t\tNode T2=y.right;\n\t\t\n\t\t//rotate\n\t\t\n\t\ty.right=x;\n\t\tx.left=T2;\n\t\t\n\t\t//update heights\n\t\ty.height=max(height(y.left),height(y.left) +1 ) ;\n\t\tx.height=max(height(x.left),height(x.left) +1 ) ;\n\t\t\n\t\t// new root\n\t\treturn y;\n\t}", "public void rotateRight (View view){\n\n if (toyRobotIsActive) {\n\n robot.animate().rotationBy(90f).setDuration(50); //turn toy robot LEFT\n\n rotateRight++; //counter to determine orientation\n System.out.println(\"rotateRight \" + rotateRight);\n System.out.println(\"rotateLeft + rotateRight = \"\n + orientation(rotateLeft, rotateRight));\n\n } else errorMessage(\"Please place toy robot\");\n }", "Node rightRotate(Node y) \n { \n Node x = y.left; \n Node T2 = x.right; \n\n // rotation \n x.right = y; \n y.left = T2; \n\n // heights \n y.height = Math.max(height(y.left), height(y.right)) + 1; \n x.height = Math.max(height(x.left), height(x.right)) + 1; \n\n // Return new root \n return x; \n }", "public void rotateRight() {\n\t\tif (rotRight == null) {\n\t\t\tQuaternion quat = new Quaternion();\n\t\t\tquat.fromAngles(0f, (float) Math.toRadians(-90), 0f);\n\t\t\trotRight = quat.toRotationMatrix();\n\t\t}\n\n\t\tgetNode().getLocalRotation().apply(rotRight);\n\t}", "public Node<T> rightRotate(Node<T> node){\n\n Node<T> temp = node.left;//pointer set to the nodes left child\n node.left = temp.right;//node.left set to the right child\n temp.right = node;//temp.right equal to the node that is rotating\n return temp;\n }", "private void rightRotate(WAVLNode x) {\n\t WAVLNode a=x.left;\r\n\t WAVLNode b=x.right;\r\n\t WAVLNode y=x.parent;\r\n\t WAVLNode c=y.right;\r\n\t x.right=y;\r\n\t y.left=b;\r\n\t if (y.parent!=null) {\r\n\t\t WAVLNode d=y.parent;\r\n\t\t String side=parentside(d,y);\r\n\r\n\t\t if (side.equals(\"right\")) {\r\n\t\t\t d.right=x;\r\n\t\t\t x.parent=d;\r\n\t\t }\r\n\t\t else {\r\n\t\t\t d.left=x;\r\n\t\t\t x.parent=d;\r\n\t\t }\r\n\t }\r\n\t else {\r\n\t\t x.parent=null;\r\n\t\t this.root=x;\r\n\t }\r\n\t y.parent=x;\r\n\t b.parent=y;\r\n\t y.rank=y.rank-1;\r\n\t \r\n\t y.sizen=b.sizen+c.sizen+1;\r\n\t x.sizen=a.sizen+y.sizen+1;\r\n\t \r\n }", "public void rotate() {\n // amoeba rotate\n // Here i will use my rotation_x and rotation_y\n }", "public NodeRB rotateRight(NodeRB y) {\n NodeRB x = y.left;\r\n //System.out.println(\"[...] Left of the pivot: \" + x.value);\r\n NodeRB c = x.right;\r\n NodeRB p = fetchParentOf(y.value);\r\n //System.out.println(y.value + \" is now the right of \" + x.value);\r\n if (y == this.root){\r\n this.root = x;\r\n }\r\n x.right = y;\r\n y.left = c;\r\n if (p != null){\r\n //System.out.print(\"[....] The pivot has a parent \" + p.value + \". Setting \" + x.value + \" to its \");\r\n if (p.getRight() == y){\r\n //System.out.println(\"right.\");\r\n p.right = (x);\r\n }\r\n else{\r\n //System.out.println(\"left.\");\r\n p.left = (x);\r\n }\r\n }\r\n return x;\r\n }", "Node rightRotate(Node y) {\n Node x = y.left;\n Node T2 = x.right;\n\n // Perform rotation\n x.right = y;\n y.left = T2;\n\n // Update heights\n y.height = max(height(y.left), height(y.right)) + 1;\n x.height = max(height(x.left), height(x.right)) + 1;\n\n // Return new root\n return x;\n }", "private void rotateRight(Node tree) {\n assert tree != null;\n assert tree.left != null;\n\n Node temp = tree.left;\n tree.left = temp.right;\n if(temp.right != null) { //no null pointers\n temp.right.parent = tree;\n }\n temp.parent = tree.parent;\n if(temp.parent != null) { //am i at the root?\n if(temp.parent.left == tree) {\n temp.parent.left = temp;\n } else if (temp.parent.right == tree) {\n temp.parent.right = temp;\n }\n }\n tree.parent = temp;\n temp.right = tree;\n if(tree == root) { root = temp; } //rewrite the root\n rotations += 1;\n }", "@Override\n\tpublic void rotateRight(int degrees) {\n\t\t\n\t}", "private NodeRB<K, V> rotateRight(NodeRB<K, V> x) {\n\t\tNodeRB<K, V> xParent = x.parent;\n\n\t\tNodeRB<K, V> y = x.left;\n\t\tx.left = y.right;\n\t\ty.right = x;\n\n\t\t// Parents relations fix\n\t\tif (xParent != null) {\n\t\t\tif (x.isLeftChild()) {\n\t\t\t\txParent.left = y;\n\t\t\t} else {\n\t\t\t\txParent.right = y;\n\t\t\t}\n\t\t}\n\t\tx.parent = y;\n\t\ty.parent = xParent;\n\t\tif (x.left != null) {\n\t\t\tx.left.parent = x;\n\t\t}\n\n\t\tx.height = 1 + Math.max(height(x.left), height(x.right));\n\t\ty.height = 1 + Math.max(height(y.left), height(y.right));\n\t\treturn y;\n\t}", "private void rightRotate(RedBlackNode<T> y){\n rightRotateFixup(y);\n\n RedBlackNode<T> x = y.left;\n y.left = x.right;\n\n // Czy istnieje x.right\n if (!isNil(x.right))\n x.right.parent = y;\n x.parent = y.parent;\n\n // y.parent jest nil\n if (isNil(y.parent))\n root = x;\n\n // y jest prawym dzieckiem swojego rodzica\n else if (y.parent.right == y)\n y.parent.right = x;\n\n // y jest lewym dzieckiem swojego rodzica\n else\n y.parent.left = x;\n x.right = y;\n\n y.parent = x;\n\n }", "void rotateTurtle(int turtleIndex, double degrees);", "public void rightRotate(Node<E> y){\n \t\n /*\n If y is the root of the tree to rotate with right child subtree T3 and left child x, \n where T1 and T2 are the left and right children of x:\n y becomes right child of x and T1 as its left child of x\n T2 becomes left child of y and T3 becomes right child of y\n */\n \tNode<E> x = y.getLeftChild(); //set x \n\t\ty.setLeftChild(x.getRightChild()); //turn x's right subtree into y's left subtree\n\t\tx.getRightChild().setParent(y);\n\t\tx.setParent(y.getParent()); ////link y's parent to x\n\t\tif (y.getParent() == sentinel || y.getParent() == null) {\n\t\t\troot = x;\n\t\t} else if (y == y.getParent().getLeftChild()) { \n\t\t\ty.getParent().setLeftChild(x);\n\t\t} else {\n\t\t\ty.getParent().setRightChild(x);\n\t\t}\n\t\tx.setRightChild(y); //put x on y's left\n\t\ty.setParent(x);\n }", "private Node rotateRight() {\n Node left = this.leftChild;\n this.leftChild = left.rightChild;\n left.rightChild = this;\n\n this.updateHeight();\n left.updateHeight();\n\n return left;\n }", "private void rotatePath(GeneralPath basePath, double angle)\n {\n AffineTransform af = new AffineTransform();\n af.rotate(angle);\n basePath.transform(af);\n }", "Point rotate (double angle, Point result);", "public static TreapNode rightRotate(TreapNode y)\n {\n TreapNode x = y.left, T2 = x.right;\n\n // Perform rotation\n x.right = y;\n y.left = T2;\n\n // Return new root\n return x;\n }", "private RedBlackNode rotateRight(RedBlackNode x){\n\t RedBlackNode xParent = x.parent;\n\t RedBlackNode BSubTree = x.left.right;\n\t RedBlackNode y = x.left;\n\t y.right = x;\n\t x.parent = y;\n\t x.left = BSubTree;\n\t //Need to anlayse whether Nil check need to have or Not\n\t BSubTree.parent = x;\n\t if( xParent == this.Nil){\n\t\t this.root = y;\n\t }else if(xParent.left == x){\n\t\t xParent.left = y;\n\t }else{\n\t\t xParent.right = y;\n\t }\n\t y.parent = xParent;\n\t return y;\n }", "private Node rotateright(Node y) {\n Node x = y.left;\n Node z = x.right;\n\n // Perform rotation\n x.right = y;\n y.left = z;\n\n // updating the heights for y and x\n y.height = max(height(y.left), height(y.right)) + 1;\n x.height = max(height(x.left), height(x.right)) + 1;\n\n return x;\n }", "public void rotRight()\n\t{\n\t\t//only rotate if a PlayerShip is currently spawned\n\t\tIIterator iter = gameObj.getIterator();\n\t\twhile(iter.hasNext())\n\t\t{\n\t\t\tGameObject current = (GameObject)iter.getNext();\n\t\t\tif(current instanceof PlayerShip)\n\t\t\t{\n\t\t\t\t((PlayerShip)current).moveRight();\n\t\t\t\tSystem.out.println(\"Heading +20\");\n\t\t\t\tnotifyObservers();\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\t\tSystem.out.println(\"There is no playerShip spawned\");\n\t}", "Point rotate (double angle);", "private void rightRotate(RBNode<T> y) {\r\n\r\n //node y must have leftChild\r\n RBNode<T> x = y.left;\r\n //1. deal with x's rightChild, move it to y's leftChild:\r\n // update y's leftChild as x's rightChild,\r\n y.left = x.right;\r\n\r\n //update x.right.parent as y (only x.right is not null)\r\n if(x.right != null)\r\n x.right.parent = y;\r\n\r\n //2. deal with parent of y, move x to y's position\r\n // update x's parent as y's parent\r\n x.parent = y.parent;\r\n // if y.parent = null, set root = x\r\n if(y.parent == null) {\r\n this.root = x;\r\n } else {\r\n //if y is rightChild of parent, update x as parent's rightChild\r\n if(y == y.parent.right)\r\n y.parent.right = x;\r\n else//if y is leftChild of parent, update x as parent's leftChild\r\n y.parent.left = x;\r\n }\r\n\r\n //3. update x.right as y, update y.parent as x\r\n x.right = y;\r\n y.parent = x;\r\n }", "public abstract void rotateLeft();", "public MutableImage rotateRight() {\n return rotate(90);\n }", "public void rightRotate(Website root, Website x) {\r\n\t\tWebsite y = x.getLeft();\t//set y\r\n\t\tx.setLeft(y.getRight());\t//turn y's right subtree into x's right subtree\r\n\t\tif (y.getRight() != null) { //if y.right exists,\r\n\t\t\ty.getRight().setParent(x);\t//y.right's parent becomes x\r\n\t\t}\r\n\t\ty.setParent(x.getParent()); //link x's parent to y\r\n\t\tif (x.getParent() == null) { \t//if x is the root\r\n\t\t\tsetRoot(y);\t\t\t\t\t//update the root\r\n\t\t} \r\n\t\telse if (x == x.getParent().getRight())\t//if x is the right child\r\n\t\t\tx.getParent().setRight(y);\t\t\t//x parent sets its right as y\r\n\t\telse {\r\n\t\t\tx.getParent().setLeft(y);\t//if it is not the right child, then it is the left child, and x's parent sets its left as y\r\n\t\t}\t\r\n\t\ty.setRight(x);\t//x on y's right\r\n\t\tx.setParent(y); //link x to y\r\n\t}", "public void rotate(Point P, int rotation) {\n\n\n }", "public void rotate180 (View view){\n\n if (toyRobotIsActive) {\n\n robot.animate().rotationBy(180f).setDuration(50); //turn toy robot AROUND (180')\n\n rotateRight += 2; //counter to determine orientation\n System.out.println(\"rotateRight \" + rotateRight);\n System.out.println(\"rotateLeft + rotateRight = \"\n + orientation(rotateLeft, rotateRight));\n\n } else errorMessage(\"Please place toy robot\");\n }", "private void RLRotation(IAVLNode node)\r\n\t{\r\n\t\tLLRotation(node.getRight());\r\n\t\tRRRotation(node);\r\n\t}", "public void rotateShip(){\n if (this.orientation == false){\n this.orientation = true;\n }else\n orientation = false;\n \n return;\n }", "public void rightRotate(RBNode<T, E> node) {\r\n\t\t// Keep Track of the root and the pivot and roots parent\r\n\t\tRBNode<T, E> root = node;\r\n\t\tRBNode<T, E> pivot = node.leftChild;\r\n\t\tRBNode<T, E> rParent = root.parent;\r\n\t\t// if the pivot is not null, then proceed to rotate\r\n\t\tif (pivot != nillLeaf) {\r\n\t\t\tif (rParent != nillLeaf) {\r\n\t\t\t\tif (root.uniqueKey.compareTo(rParent.uniqueKey) < 0) {\r\n\t\t\t\t\t// root must be to the left of the root's parent\r\n\t\t\t\t\troot.leftChild = pivot.rightChild;\r\n\t\t\t\t\tpivot.rightChild.parent = root;\r\n\t\t\t\t\tpivot.rightChild = root;\r\n\t\t\t\t\trParent.leftChild = pivot;\r\n\t\t\t\t\troot.parent = pivot;\r\n\t\t\t\t\tpivot.parent = rParent;\r\n\t\t\t\t\tthis.root = searchRoot(rParent);\r\n\r\n\t\t\t\t} else if (root.uniqueKey.compareTo(rParent.uniqueKey) > 0) {\r\n\t\t\t\t\t// root must be to the right of the root's parent\r\n\t\t\t\t\troot.leftChild = pivot.rightChild;\r\n\t\t\t\t\tpivot.rightChild.parent = root;\r\n\t\t\t\t\tpivot.rightChild = root;\r\n\t\t\t\t\trParent.rightChild = pivot;\r\n\t\t\t\t\troot.parent = pivot;\r\n\t\t\t\t\tpivot.parent = rParent;\r\n\t\t\t\t\tthis.root = searchRoot(rParent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// else if root has no parent, then rotate with no parent\r\n\t\t\telse {\r\n\t\t\t\troot.leftChild = pivot.rightChild;\r\n\t\t\t\tpivot.rightChild.parent = root;\r\n\t\t\t\tpivot.leftChild = root;\r\n\t\t\t\troot.parent = pivot;\r\n\t\t\t\tthis.root = pivot;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void rotateAround() {\n if (camPathAngle < Constants.FULL_ROTATION) {\n camPathAngle++;\n } else {\n swapCount++;\n camPathAngle = 0;\n }\n mPerspectiveCamera.position.set(xPosition, yPosition, zPosition);\n if (swapCount % 2 == 0) {\n mPerspectiveCamera.rotate(Vector3.Y, camPathAngle);\n } else {\n mPerspectiveCamera.rotate(Vector3.X, camPathAngle);\n }\n mPerspectiveCamera.lookAt(new Vector3(0, 0, 0));\n mPerspectiveCamera.update();\n }", "public void rotateRight() {\n// tileLogic = getRotateRight();\n tileLogic = getRotateLeft();\n// rotateRightTex();\n rotateLeftTex();\n }", "private void rightRotate(AVLNode<T> parent, AVLNode<T> node) {\n AVLNode<T> oldRight = parent.getRight();\n AVLNode<T> parDat = new AVLNode<>(parent.getData());\n parent.setRight(parDat);\n if (oldRight != null) {\n parent.getRight().setRight(oldRight);\n calcDeterminants(parent.getRight().getRight());\n }\n if (node.getRight() != null) {\n parent.getRight().setLeft(node.getRight());\n calcDeterminants(parent.getRight().getLeft());\n }\n parent.setData(node.getData());\n if (node.getLeft() != null) {\n parent.setLeft(node.getLeft());\n calcDeterminants(parent.getLeft());\n } else {\n parent.setLeft(null);\n calcDeterminants(parent.getRight());\n }\n }", "public void rotateRight(Node node){\n\t\tNode ptrLeft = node.left;\n\t\tnode.left = ptrLeft.right;\n\t\t\n\t\tif(ptrLeft.right != nil){\n\t\t\tptrLeft.right.parent = node;\n\t\t}\n\t\t\n\t\tptrLeft.parent = node.parent;\n\t\t\n\t\tif(ptrLeft.parent==nil){\n\t\t\troot = ptrLeft;\n\t\t}else if(node == node.parent.left){\n\t\t\tnode.parent.left = ptrLeft;\n\t\t}else{\n\t\t\tnode.parent.right = ptrLeft;\n\t\t}\n\t\t\n\t\tptrLeft.right = node;\n\t\tnode.parent = ptrLeft;\n\t}", "private void right() {\n lastMovementOp = Op.RIGHT;\n rotate(TURNING_ANGLE);\n }", "public static void turnrightBy(double angle) {\n leftMotor.rotate(convertAngle(angle), true);\n rightMotor.rotate(-convertAngle(angle), false);\n }", "public void xRotate() {\n\t\t\n\t}", "private AVLNode<T> rotateRight(AVLNode<T> node) {\n AVLNode<T> substiute = node.left;\n node.left = substiute.right;\n substiute.right = node;\n\n // node = substitute;\n\n return substiute;\n }", "public AVLNode rotateRight(AVLNode y) {\n AVLNode x = y.getLeft();\n AVLNode T2 = x.getRight();\n \n //rotation\n x.setRight(y);\n y.setLeft(T2);\n \n //update heights\n x.setHeight(Math.max(getHeight(x.getLeft()), getHeight(x.getRight())) + 1);\n y.setHeight(Math.max(getHeight(y.getLeft()), getHeight(y.getRight())) + 1);\n \n return x;\n }", "@Override\n \t\t\t\tpublic void doRotateY() {\n \n \t\t\t\t}", "private RedBlackNode rotationWithRightChild(RedBlackNode node1) \n { \n RedBlackNode node2 = node1.rightChild; \n node1.rightChild = node2.leftChild; \n node2.leftChild = node1.leftChild; \n return node2; \n }", "private void singleRotateRight(Node n) {\n Node l = n.mLeft, lr = l.mRight, p = n.mParent;\n n.mLeft = lr;\n lr.mParent = n;\n l.mRight = n;\n if (n == mRoot) {\n mRoot = l;\n l.mParent = null;\n }\n else if (p.mLeft == n) {\n p.mLeft = l;\n l.mParent = p;\n }\n else {\n p.mRight = l;\n l.mParent = p;\n }\n n.mParent = l;\n }", "@Override\n public void reAngle() {\n }", "@Test\n public void rotateCommand() {\n ICommand cmd = Commands.getComand(\"rotate\");\n Robot robot = new Robot(0, 0);\n Vector2Di dir = robot.getDir();\n int rot_amount = 90;\n double orig_angle = dir.angle();\n cmd.exec(rot_amount, robot, null);\n assertEquals(orig_angle + rot_amount, dir.angle(), 0.1);\n }", "public void rightRotate(Node n) {\r\n\t\tNode y = n.left;\r\n\t\tn.left = y.right;\r\n\t\tif(!y.right.isNil)\r\n\t\t\ty.right.parent = n;\r\n\t\ty.parent = n.parent;\r\n\t\tif(n.parent.isNil)\r\n\t\t\troot = y;\r\n\t\telse if(n == n.parent.right)\r\n\t\t\tn.parent.right = y;\r\n\t\telse\r\n\t\t\tn.parent.left = y;\r\n\t\ty.right = n;\r\n\t\tn.parent = y;\r\n\t}", "@Override\n \t\t\t\tpublic void doRotateX() {\n \n \t\t\t\t}", "public void rotatePieceRight(){\r\n if (hasFalling()){\r\n FallingPiece test =falling.rotateRight();\r\n if (!moveIfNoConflict(test, falling))\r\n Kick(test, falling);\r\n if(isGhostActivated())\r\n \t\t\tgenerateGhost();\r\n }\r\n }", "private Node rightRotate(Node a) {\n Node b = a.getLeftChild();\n Node n3 = b.getRightChild();\n b.setRightChild(a);\n a.setLeftChild(n3);\n setHeights(a, b);\n return b;\n }", "public Node<T> rightLeftRotate(Node<T> node){\n\n node.right = rightRotate(node.right);//rotate the parent to the right\n return leftRotate(node);// rotate the grandparent to the left\n }", "private void LRRotation(IAVLNode node)\r\n\t{\r\n\r\n\t\tRRRotation(node.getLeft());\r\n\t\tLLRotation(node);\r\n\t}", "public void alignPath() {\n Waypoint first = path.get(0);\n Waypoint second = path.get(1);\n\n double m = (first.getY() - second.getY()) / (first.getX() - second.getX());\n double angle = Math.atan(m);\n\n Paths.rotate((Math.PI / 2) - angle, path);\n\n if(second.getY() < first.getY())\n Paths.rotate(Math.PI, path);\n }", "private Node rotateRight(Node h){\n\t\tNode x = h.left;\n\t\th.left = x.right;\n\t\tx.right = h;\n\t\tx.color = h.color;\n\t\th.color = RED;\n\t\treturn x;\n\t}", "@Override\r\n\tpublic void rotate() {\n\t\t\r\n\t}", "private void RRRotation(IAVLNode node)\r\n\t{\r\n\t\tIAVLNode parent = node.getParent(); \r\n\t\tIAVLNode rightChild = node.getRight() ; \r\n\t\tIAVLNode leftGrandChild = node.getRight().getLeft(); \r\n\t\t\r\n\t\tif(node != root) \r\n\t\t{\r\n\t\t\tif(node == parent.getLeft())\r\n\t\t\t\tparent.setLeft(rightChild);\r\n\t\t\telse \r\n\t\t\t\tparent.setRight(rightChild);\r\n\t\t}\r\n\t\t\r\n\t\tnode.setRight(leftGrandChild); //leftGrandChild is now node's right child\r\n\t\tleftGrandChild.setParent(node); //node is now leftGrandChild's parent\r\n\t\trightChild.setLeft(node); // node is now rightChild's left child\r\n\t\tnode.setParent(rightChild); // node's parent is now leftChild\r\n\t\trightChild.setParent(parent); // leftChild's parent is now node's old parent\r\n\t\t\r\n\t\t//updating sizes and heights\r\n\t\tnode.setSize(sizeCalc(node)); // updating node's size\r\n\t\trightChild.setSize(sizeCalc(rightChild)); //updating rightChild's size\r\n\t\trightChild.setHeight(HeightCalc(rightChild)); // updating rightChild's height\r\n\t\tnode.setHeight(HeightCalc(node)); // updating node's height\r\n\t\t\r\n\t\tif (node == root) \r\n\t\t\tthis.root = rightChild;\r\n\t}", "public FallingPiece rotateRight(){\r\n return new FallingPiece(coord, innerPiece.rotateRight());\r\n }", "public double getRotation();", "private void turn(String rotate) {\n if(Objects.nonNull(this.position)) {\n int currentIntDirection = this.directionConversionMap.get(this.position.getDirection());\n int newIntDirection = this.rotateRobotMap.get(rotate).apply(currentIntDirection,directionConversionMap);\n Optional<Direction> direction = findDirection(newIntDirection);\n this.position = new Position(this.position.getX(), this.position.getY(), direction.get());\n }\n }", "public static double rotation()\r\n\t{\r\n\t\treturn -(mxp.getAngle()/45);\r\n\t}", "void rotatePiece() {\n boolean temp = this.left;\n boolean temp2 = this.up;\n boolean temp3 = this.right;\n boolean temp4 = this.down;\n this.left = temp4;\n this.up = temp;\n this.right = temp2;\n this.down = temp3;\n }", "private Node rotateRight(Node h) {\n Node x = h.left;\n h.left = x.right;\n x.right = h;\n x.color = x.right.color;\n x.right.color = RED;\n x.size = h.size;\n h.size = size(h.left) + size(h.right) + 1;\n return x;\n }", "private long rightRotate(long n) throws IOException {\n Node current = new Node(n);\r\n long currentLeft = current.left;\r\n Node tempN = new Node(current.left);\r\n current.left = tempN.right;\r\n tempN.right = n;\r\n current.height = getHeight(current);\r\n current.writeNode(n);\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(currentLeft);\r\n return currentLeft;\r\n }", "public Node<T> leftRightRotate(Node<T> node){\n\n node.left = leftRotate(node.left);//rotate the parent to the left\n return leftRotate(node);// rotate the grandparent to the right\n }", "public void RotateStarpathToNextPos(){\n starpathPosition++;\n\n //if next pos is 6, reset back to 0\n if(starpathPosition == 6){\n StarpathToIntake();\n }\n //if next pos is 3, go to the shooter\n else if(starpathPosition == 3) StarPathToShooter();\n //else, add with the interval\n else if(starpathPosition < 3) StarpathAddIntervalIntake();\n else if(starpathPosition > 3) StarpathAddIntervalShooter();\n }", "public void turnRight()\r\n\t{\r\n\t\theading += 2; //JW\r\n\t\t//Following the camera\r\n\t\t//heading += Math.sin(Math.toRadians(15)); \r\n\t\t//heading += Math.cos(Math.toRadians(15));\r\n\t}", "public void rotate(float angle);", "@Override\n public void turnRight(Double angle) {\n turnLeft(angle * -1);\n }", "private BTNode<T> rotateRight(BTNode<T> p){\n\t\tBTNode<T> q = p.getLeft();\n\t\tp.setLeft(q.getRight());\n\t\tq.setRight(p);\n\t\tfixHeight(p);\n\t\tfixHeight(q);\n\t\treturn q;\n\t}", "@Override\r\n\tpublic void rotateLeft() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir - THETA);\r\n\t\t\r\n\t}", "public void RotateActionPerformed(java.awt.event.ActionEvent evt) { \r\n degree = degree + 90;\r\n drawingPanel.setDegree(degree); \r\n }", "@Override\r\n\tpublic void rotateLeft() {\n\t\tsetDirection((this.getDirection() + 3) % 4);\r\n\t}", "public void rotateStep(GearedObject other){}", "private void rightRotate(Entry<T> child, Entry<T> p) {\n\t\tif(p.parent != null) {\n\t\t\tif(p == p.parent.left)\n\t\t\t\tp.parent.left = child;\n\t\t\telse\n\t\t\t\tp.parent.right = child;\n\t\t}\n\t\tif(child.right != null)\n\t\t\tgetSplay(child.right).parent = p;\n\t\t\n\t\tchild.parent = p.parent;\n\t\tp.parent = child;\n\t\tp.left = child.right;\n\t\tchild.right = p;\n\t\t\t\t\n\t}", "protected void right() {\n move(positionX + 1, positionY);\n orientation = 0;\n }", "public void rotateLeft() {\n\t\tthis.direction = this.direction.rotateLeft();\n\t}", "private void rightRotateFixup(RedBlackNode y){\n\n // Przypadek 1: tylko y, y.left i y.left.left są nil.\n if (isNil(y.right) && isNil(y.left.right)){\n y.numRight = 0;\n y.numLeft = 0;\n y.left.numRight = 1;\n }\n\n // Przypadek 2: y.left.right istnieje w dodatku do przypadku 1\n else if (isNil(y.right) && !isNil(y.left.right)){\n y.numRight = 0;\n y.numLeft = 1 + y.left.right.numRight +\n y.left.right.numLeft;\n y.left.numRight = 2 + y.left.right.numRight +\n y.left.right.numLeft;\n }\n\n // Przypadek 3: y.right istnieje w dodatku do przypadku 1\n else if (!isNil(y.right) && isNil(y.left.right)){\n y.numLeft = 0;\n y.left.numRight = 2 + y.right.numRight +y.right.numLeft;\n\n }\n\n // Przypadek 4: y.right i y.left.right istnieją w dodatku do przypadku 1\n else{\n y.numLeft = 1 + y.left.right.numRight +\n y.left.right.numLeft;\n y.left.numRight = 3 + y.right.numRight +\n y.right.numLeft +\n y.left.right.numRight + y.left.right.numLeft;\n }\n\n }", "Node leftRotate(Node x) \n { \n Node y = x.right; \n Node T2 = y.left; \n \n // Perform rotation \n y.left = x; \n x.right = T2; \n \n // Update heights \n x.height = max(height(x.left), height(x.right)) + 1; \n y.height = max(height(y.left), height(y.right)) + 1; \n \n // Return new root \n return y; \n }", "public void turnRight() {\r\n setDirection( modulo( myDirection+1, 4 ) );\r\n }", "@Override\n\tpublic void rotate() {\n\t}", "public void changeDirOnGear(IRobot robot) {\n String objectName = getObjectNameOnPos(tiledMap, robot.getPos());\n if (\"Counter_Clockwise\".equals(objectName)) {\n robot.rotateCounterClockwise();\n } else if (\"Clockwise\".equals(objectName)) {\n robot.rotateClockwise();\n }\n }", "public Direction toRight()\n {\n return new Direction(dirInDegrees + (FULL_CIRCLE / 4));\n }", "private void rotate(Node<T> child, Node<T> parent) throws IllegalArgumentException {\n //right child, perform left rotation\n if(parent.rightChild != null && parent.rightChild.data.compareTo(child.data) == 0) {\n parent.rightChild = child.leftChild;\n \n if(child.leftChild != null) {\n child.leftChild.parent = parent;\n }\n child.parent = parent.parent;\n \n //checking if parent is left or right child\n if(parent.parent == null) {\n root = child;\n }\n else if(parent.parent.leftChild.data.compareTo(parent.data) == 0) {\n parent.parent.leftChild = child;\n }\n else {\n parent.parent.rightChild = child;\n }\n \n //uddate references pointing to parent and child\n child.leftChild = parent;\n parent.parent = child;\n }\n \n //left child, perform right rotation\n else if(child.isLeftChild()) {\n parent.leftChild = child.rightChild;\n \n if(child.rightChild != null) {\n child.rightChild.parent = parent;\n }\n child.parent = parent.parent;\n \n //checking if parent is left or right child\n if(parent.parent == null) {\n root = child;\n }\n else if(parent.parent.leftChild.data.compareTo(parent.data) == 0) {\n parent.parent.leftChild = child;\n }\n else {\n parent.parent.rightChild = child;\n }\n \n //update references pointing to parent and child\n child.rightChild = parent;\n parent.parent = child;\n }\n \n else {\n throw new IllegalArgumentException(\"child neither left nor right child of parent\");\n }\n }", "public void rotate (int row) {\n\t\tif ( row < n / 2)\n\t\t\trotate(row + 1);\n\t\telse\n\t\t\treturn;\n\t\t//rotate the outter most row and col\n\t\trotateRow(row);\n\t}", "void leftRotate(Node<K, V> x) {\n\t\tassert IsNotNil(x.getRight());\n\t\tNode<K, V> y = x.getRight();\n\n\t\t// B in position\n\t\tx.setRight(y.getLeft());\n\n\t\t// Y to root\n\t\tif (x == root) {\n\t\t\troot = y;\n\t\t} else if (x.isLeftChild()) {\n\t\t\tx.getParent().setLeft(y);\n\t\t} else if (x.isRightChild()) {\n\t\t\tx.getParent().setRight(y);\n\t\t}\n\n\t\t// x in position\n\t\ty.setLeft(x);\n\t}" ]
[ "0.7058934", "0.7029405", "0.69685054", "0.6918276", "0.6880178", "0.66904444", "0.66798425", "0.66564864", "0.66462076", "0.66432273", "0.66164774", "0.66015166", "0.65576994", "0.6548145", "0.65339375", "0.6516413", "0.65077615", "0.647493", "0.64617395", "0.645718", "0.64528257", "0.6445301", "0.6443649", "0.64168984", "0.63943547", "0.63859844", "0.6383101", "0.63799286", "0.6376365", "0.6365526", "0.63604", "0.6318044", "0.6308026", "0.63010395", "0.62988466", "0.6283621", "0.6266724", "0.62588376", "0.6252475", "0.6249558", "0.6240982", "0.6231479", "0.6222742", "0.6220771", "0.6207935", "0.6201751", "0.61919063", "0.6176146", "0.6173236", "0.6173036", "0.61677784", "0.61657876", "0.6137128", "0.6132502", "0.6132415", "0.6130793", "0.60888475", "0.6088494", "0.60749173", "0.60580784", "0.60572416", "0.60554653", "0.6055078", "0.60386795", "0.6035523", "0.6018192", "0.60062444", "0.6004768", "0.5993047", "0.59891975", "0.5980023", "0.59779733", "0.5971312", "0.5956642", "0.5937889", "0.5930533", "0.5919849", "0.5919837", "0.5912017", "0.5906975", "0.5900186", "0.5897845", "0.5896504", "0.58921033", "0.58755326", "0.5859535", "0.58592385", "0.58527786", "0.5846044", "0.5838632", "0.58377117", "0.583309", "0.5817057", "0.58163637", "0.5808739", "0.5808657", "0.58055633", "0.57871103", "0.5768261", "0.57632244" ]
0.71053755
0
Unblock next coordinate in path.
public abstract void unblockNext();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void unlockLastEdge();", "public void unpin();", "public void unpin();", "private void unlockCell(int x, int y) {\n data[x][y] = false;\n\t}", "@Override\n\tprotected void unLockNbr() {\n\t\t\n\t}", "public synchronized void unblock() {\n\t\tsetBlocked(false);\n\t}", "public void unlock() {\n islandLocked = false;\n }", "@Override\n\tpublic void unLock() {\n\t\t\n\t}", "private void unblock(int node)\n {\n this.blocked[node] = false;\n Vector Bnode = this.B[node];\n while (Bnode.size() > 0) {\n Integer w = (Integer) Bnode.get(0);\n Bnode.remove(0);\n if (this.blocked[w.intValue()]) {\n this.unblock(w.intValue());\n }\n }\n }", "public void ungeneratePath() {\n path = oldPaths.pop();\n }", "public void onUnblock();", "private void clear(int a_x, int a_y)\n {\n int index = clickOnWaypoint(a_x,a_y);\n if(index != -1)\n {\n Vector2d v = m_waypoints.get(index);\n m_grid[(int)v.x][(int)v.y] = Map.NIL;\n m_waypoints.remove(index);\n frame.updateNumWaypoints(m_waypoints.size());\n }\n else\n {\n setBrush(a_x,a_y,Map.NIL);\n }\n }", "public void undo(){\n if(!isFreeDraw) { //in waypoint mode delete the last point\n int size = mMapInterface.getPathFrame().size();\n if (size >= 1) {\n isPathReady=false;\n mMapInterface.getPathFrame().remove(size - 1);\n pointsCounter--;\n googleMap.clear();\n drawLine();\n }\n }\n else{ //in continu mode delete all path\n deletePath();\n drawFree();\n }\n }", "public void unlinkLR()\n {\n this.L.R = this.R;\n this.R.L = this.L;\n }", "public void unblock() {\n // Execute the runnable on the event dispatcher,\n SwingUtilities.invokeLater(new Runnable() {\n public void run() {\n if (block_state == 1) {\n block_state = 2;\n }\n }\n });\n }", "public void back() {\n\t\tif (path.isEmpty()) {\n\t\t\tpath = crossLocation.pop();\n\t\t\tLocation loc = path.get(path.size() - 1);\n\t\t\tint dir = getLocation().getDirectionToward(loc);\n\t\t\tif (dir == Location.HALF_CIRCLE) {\n\t\t\t\tdirsCount[0]--;\n\t\t\t} else if (dir == Location.AHEAD) {\n\t\t\t\tdirsCount[1]--;\n\t\t\t} else if (dir == Location.RIGHT) {\n\t\t\t\tdirsCount[2]--;\n\t\t\t} else {\n\t\t\t\tdirsCount[3]--;\n\t\t\t}\n\t\t}\n\t\tnext = path.remove(path.size() - 1);\n\t\tmove();\n\t}", "public void clearGotoFloor();", "private void dec_x()\n {\n synchronized(mLock_IndexX) { set_x(get_x() - 1); }\n }", "private void discardSegment() {\n synchronized (lastSegment) {\n lastSegment.clear();\n lastSegmentTimes.clear();\n lastSegmentCurve.clear();\n }\n }", "public void unlockBack()\n {\n m_bBackLock = false;\n }", "public void unfreeze(){\n isFrozen = false;\n }", "public void stop() {\n this.setCurrentCell(0);\n this.setPicX(0);\n slowDownX();\n slowDownY();\n setMoving(false);\n if (moveDown) {\n this.setPicY(0);\n } else if (moveUp) {\n this.setPicY(211);\n } else if (moveLeft) {\n this.setPicY(141);\n } else if (moveRight) {\n this.setPicY(74);\n }\n }", "public void remove() { \n if (lastAccessed == null) throw new IllegalStateException();\n Node x = lastAccessed.previous;\n Node y = lastAccessed.next;\n x.next = y;\n y.previous = x;\n size--;\n if (current == lastAccessed) current = y;\n else index--;\n lastAccessed = null;\n }", "public void closepath() \n {\n\tLine line = new Line(_currentx, _currenty, _startx, _starty);\n\t_currentPath.add(line);\n\t_currentx = _startx;\n\t_currenty = _starty;\n\t_closedPath = true;\n }", "protected void next() {\n\t\t// Next node\n\t\tnode = path.remove(0);\n\t\ttransition(NavigatorState.ROTATE_TO);\n\t}", "void unsetBeginPosition();", "public void retract(){\n\t\tsolenoid1.set(false);\n\t\tsolenoid2.set(false);\n\t}", "public void CLOSE ()\r\n\t{\r\n\t\tif (Path.size()!=0){\r\n\t\tActualNode=Path.get(Path.size()-1);\r\n\t\tPath.remove(Path.size()-1);\r\n\t\t}\r\n\t}", "public void stopRinging();", "void unsetDirection();", "public void remove(){\n if(!isAfterNext)//flag false so next has not been called\n {\n throw new IllegalStateException();\n \n }\n if(position == first){\n removeFirst();//calls LL method because we re an inner class\n \n }\n else{\n previous.next = position.next;// move ref of previou to node after me \n }\n position = previous; \n isAfterNext= false;\n //first call to remove the current position reverts to the predecessor \n //of remove element thus predecessor is no longer known \n }", "@Override\n public void unDraw() {\n index--;\n }", "public void unfreeze() {\n\t\tthis.__freezed = false;\n\t}", "public void unset(){\n\t\tcurrentInst = -1;\n\t}", "public void stop() {\n elevator1.set(0);\n elevator2.set(0); \n \n }", "public void abandon() {\n lock.lock();\n try {\n eligibleSyncs.clear();\n abandoned = true;\n } finally {\n lock.unlock();\n }\n }", "private void undoLastPoint() {\n \t\tif ( this.markers.isEmpty() ) {\n \t\t\treturn;\n \t\t}\n \n \t\tthis.markers.remove( this.markers.size() - 1 ).remove();\n \t\tthis.commitPolygon();\n \n \t\tif ( this.markers.size() > 1 ) {\n \t\t\tthis.moveCameraToPolygon( true );\n \t\t}\n \n \t\tthis.disableIfDissatisfied();\n \t}", "private void stopDragging() {\n setDragging(false);\n mouseX = mouseY = prevX = prevY = 0;\n }", "public void unsetIntersectingRoadwayRef()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(INTERSECTINGROADWAYREF$20);\r\n }\r\n }", "void unsetStraight();", "void unsetBegin();", "public void unsetIntersectRoadwayPI()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(INTERSECTROADWAYPI$22);\r\n }\r\n }", "public void flip() {\r\n\t\tObject[] bak = path.toArray(new Direction[path.size()]);\r\n\t\tpath.clear();\r\n\t\tfor (int i = bak.length-1; i >= 0; i--) {\r\n\t\t\tpath.push((Direction) bak[i]);\r\n\t\t}\r\n\t}", "@Override\n public void unlock(int myId) {\n Y = -1; \n flag[myId] = false;\n \n }", "void unsetEndPosition();", "public void unfreeze() {\n this.frozen = false;\n }", "public void back() {\n\n\tGrid<Actor> gr = getGrid();\n\tif (gr == null)\n\t return;\n\n\tif (!crossLocation.isEmpty()) {\n\t\t\n\t crossLocation.pop();\n\n\t //back\n\t ArrayList<Location> lastNode = crossLocation.peek();\n\t next = lastNode.get(0);\n\t}\n\n\tLocation loc = getLocation();\n\t\n\tif (gr.isValid(next)) {\n\n\t setDirection(loc.getDirectionToward(next));\n\t moveTo(next);\n\n\t} else {\n\t removeSelfFromGrid();\n\t}\n\t\n\tint counter = dirCounter.get(getDirection());\n\tdirCounter.put(getDirection(), --counter);\n\n\tFlower flower = new Flower(getColor());\n\tflower.putSelfInGrid(gr, loc);\n\t\n\tlast = loc;\n }", "public void releasePingLock() {\r\n\t\tbeingPinged.set(false);\r\n\t}", "public void unfreeze() {\n frozen = false;\n }", "public void unlockFront()\n {\n m_bFrontLock = false;\n }", "private void blockedPathNoBeepers() {\n\t\twhile (frontIsBlocked() && noBeepersPresent()) {\n\t\t\tturnLeft();\n\t\t\tturnLeft();\n\t\t} \n\t\tmove();\n\t\tturnRight();\n\t}", "public void turnOff(int x, int y);", "private void performUnloadPathRecheck() {\r\n\t\trecheckUnloadPath = false;\r\n\t\tTile oldTile = gameMap.get(myRC.getLocation());\r\n\t\tTile actTile;\r\n\t\t\r\n\t\t/* cut where path is not accessible */\r\n\t\tfor (MapLocation loc : path) {\r\n\t\t\tactTile = gameMap.get(loc);\r\n\t\t\tif (actTile.totalHeight - oldTile.totalHeight > WORKER_MAX_HEIGHT_DELTA) {\r\n\t\t\t\tpath = path.subList(0, path.indexOf(loc));\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\toldTile = actTile;\r\n\t\t}\r\n\t\t\r\n\t\t/* cut where we can unload */\r\n\t\tpath.add(0, myRC.getLocation());\r\n\t\tif (path.size() >= 2)\r\n\t\t\tif (gameMap.get(path.get(path.size() - 1)).totalHeight - \r\n\t\t\t\tgameMap.get(path.get(path.size() - 2)).totalHeight >= WORKER_MAX_HEIGHT_DELTA) {\r\n\t\t\t\t/* we can't unload at the end of the path. get to the end and drop it */\r\n\t\t\t\tpath.add(path.get(path.size() - 2));\r\n\t\t\t}\r\n\t\tpath.remove(0);\r\n//\t\tpath.add(0, myRC.getLocation());\r\n//\t\tint size = path.size();\r\n//\t\toldTile = gameMap.get(path.get(size - 1));\r\n//\t\twhile(size >= 2){\r\n//\t\t\tactTile = gameMap.get(path.get(size - 2));\r\n//\t\t\tif (gameMap.get(path.get(path.size() - 1)).totalHeight - gameMap.get(path.get(path.size() - 2)).totalHeight >= WORKER_MAX_HEIGHT_DELTA) {\r\n//\t\t\t\tpath.remove(size - 1);\r\n//\t\t\t\tsize--;\r\n//\t\t\t} else\r\n//\t\t\t\tbreak;\r\n//\t\t\toldTile = actTile;\r\n//\t\t}\r\n//\t\tpath.remove(0);\r\n\t}", "void removeEdge(int x, int y);", "public void deselect(){\n\t\tPIN.reset();\n\t}", "public void deleteBarrier() {\n if(stater == 3) return;\n stater = 3;\n }", "public void deleteLastPathTile(){\n\t\tif(temp.isEmpty()){\n\t\t\tif(currentPos!=-1){\n\t\t\t\tcurrentPos=-1;\n\t\t\t\tsetEntryPoint(null);//start has been deleted\n\t\t\t\tgrid[currentPath.getRow()][currentPath.getCol()]= null;\n\t\t\t\tcurrentPath=null;\n\t\t\t}\n\t\t\treturn;//the list is empty\n\t\t}\n\t\telse {//\n\t\t\tif(getCompletePath()){\n\t\t\t\t\tsetCompletePath(false);\n\t\t\t\t\tsetExitPoint(null);\n\t\t\t\t\tremoveScenery();\n\t\t\t\t\t\n\t\t\t}//since the last node was removed\n\t\t\telse//if the path wasn't complete (should it be scenery?)\n\t\t\t\tgrid[currentPath.getRow()][currentPath.getCol()]= null;\n\t\t\t\tcurrentPath=null;\n\t\t\t\n\t\t\tPath removedPath=temp.removeLast();\n\t\t\tcurrentPos=removedPath.getPos();\n\t\t\tcurrentPath=new Path(currentPos);\n\t\t}\n\t}", "public void removeTile(){\n\t\toccupied = false;\n\t\tcurrentTile = null;\n\t}", "private void unsetValidMoves() {\n\t\tcurrentPos.setFill(Paint.valueOf(\"Dodgerblue\"));\n\n\t\tif(l.upValid) {\n\t\t\ttmp=layout_Circle[l.y-1][l.x];\n\t\t\ttmp.setFill(Paint.valueOf(\"Dodgerblue\"));\n\t\t}\n\n\t\tif(l.leftValid) {\n\t\t\ttmp=layout_Circle[l.y][l.x-1];\n\t\t\ttmp.setFill(Paint.valueOf(\"Dodgerblue\"));\n\t\t}\n\n\t\tif(l.rightValid) {\n\t\t\ttmp=layout_Circle[l.y][l.x+1];\n\t\t\ttmp.setFill(Paint.valueOf(\"Dodgerblue\"));}\n\t}", "@Override\n public void unmarkCell() {\n MNKCell last = MC.getLast();\n super.unmarkCell();\n key = nextZobrist(last.i, last.j);\n value = previousValues.pop();\n }", "public void removeCurrent( )\r\n {\r\n if(isCurrent() != true){\r\n \t throw new IllegalStateException (\"no current element\");// Implemented by student.\r\n }\r\n else{ \r\n if(precursor != null){\r\n \t precursor.removeNodeAfter();\r\n if(cursor.getLink() == null){\r\n \t\r\n \t cursor = null;\r\n \t tail = precursor;\r\n }\r\n else{\r\n \tprecursor = cursor; \r\n cursor = cursor.getLink();\r\n }\r\n \t \r\n }\r\n else{\r\n \thead = head.getLink();\r\n cursor = head;\r\n }\r\n manyNodes--; \r\n }\r\n \t\r\n }", "private void releaseShape(int x, int y) {\n if (holding == null) return;\n\n double newX = holding.getMinX();\n double newY = holding.getMinY();\n\n holding.moveTo(oldX, oldY);\n model.execute(new MoveShape(model.getWhiteBoard(), holding, x - diffX, y - diffY));\n\n holding = null;\n }", "public void stopDrawing() {\n LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this);\n isDrawing = false;\n currentDrawing.endLine();\n }", "public void moveForwardOneBlock() {\n\t\tBlockInterface nextBlock = this.currentBlock.goesto(previousBlock);\n\t\tthis.previousBlock = this.currentBlock;\n\t\tthis.currentBlock = nextBlock;\n\t\tif(nextBlock instanceof BlockStation){\n\t\t\tString nbname = ((BlockStation)nextBlock).getStationName();\n\t\t\tif(schedule.containsKey(nbname)){\n\t\t\t\tschedule.remove(nbname);\n\t\t\t\t((SchedulePane)c.schedulepane).reloadSchedual();\n\t\t\t}\n\t\t}\n\t}", "private void removeTwoStepForwardFromPositionCache(Key currentKey) {\n\n\t\t// Create a two square forward position\n\t\tKey newKey =createTwoStepForwardFromCurrentKey(currentKey);\n\n\t\t// Gets current values stored with key and adds the extra position\n\t\tSet<Key> currentKeyMapping = positionCache.get(currentKey);\n\n\t\t// Remove key if it exists\n\t\tif (currentKeyMapping.contains(newKey)) {\n\t\t\tcurrentKeyMapping.remove(newKey);\n\t\t}\n\n\t\tpositionCache.put(currentKey, currentKeyMapping);\n\t}", "public void unlock() {\n setLock.unlock(this);\n }", "@Override\n public void handle(long now) {\n OneIteration();\n if (current.getRow() == ia && current.getCol() == ja) {\n drawPath();\n this.stop();\n }\n }", "void removeNextSeamVert() {\n SeamInfo toRemove = this.curLowest;\n\n toRemove.removeSeamVert();\n\n if (toRemove.containsPixel(this.curPixel)) {\n\n this.curPixel = this.curPixel.right;\n }\n\n this.removedSeams.add(toRemove);\n\n this.draw();\n }", "@Override\r\n\tpublic boolean unlockIt() {\n\t\treturn false;\r\n\t}", "@Override\r\n public void unfreeze(IAssignmentState state) {\n }", "private void removeOldestPoint() {\n PathPoint p = points.get(points.size() - length - 1);\n // if points has 5 points (0-4), length=3, then remove points(5-3-1)=points(1) leaving 2-4 which is correct\n float t = p.t - firstTimestamp;\n st -= t;\n sx -= p.x;\n sy -= p.y;\n stt -= t * t;\n sxt -= p.x * t;\n syt -= p.y * t;\n }", "public void stopSweeper()\r\n\t{\r\n\t\tsynchronized (lock) {\r\n\t\t\tcache = null;\r\n\t\t\tlock.notify();\r\n\t\t}\r\n\t}", "private void unhilitNode()\n {\n\tif (hilited==null) return;\n\tGraphics g = getGraphics();\n\tsetRenderColor(g,Color.black);\n\trenderCircle(g,hilited.x,hilited.y,hilited.diameter+4);\n\thilited = null;\n }", "protected void deselectControlPoint(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\tselectedPoints.remove(j--);\n\t}", "@Override\n\tpublic void action() {\n\t if (firingBall.getY() + firingBall.getRadius() < this.y) { \n\t //deactivate absorber locally and in GameBoard\n\t firingBall = null;\n\t gb.removeFromActiveList(this);\n\t }\n\t}", "protected void removeLine(int row) {\n\t\t// clear out the true values from row/filled blocks\n\t\tfor(int j = 0; j < blockMatrix[row].length; j++) { \n\t\t\tblockMatrix[row][j] = false; \n\t\t}\n\t}", "public void disable()\n {\n openGate = null;\n }", "public void removeWall(Vertex current, Vertex next) {\r\n\r\n\t\tif (current.label + mazeSize == next.label) {\r\n\t\t\t\r\n\t\t\tcurrent.hasDownWall = false;\r\n\t\t\tnext.hasUpWall = false;\r\n\t\t} else if (current.label + 1 == next.label) {\r\n\t\t\t\r\n\t\t\tcurrent.hasRightWall = false;\r\n\t\t\tnext.hasLeftWall = false;\r\n\t\t} else if (current.label - 1 == next.label) {\r\n\t\t\t\r\n\t\t\tcurrent.hasLeftWall = false;\r\n\t\t\tnext.hasRightWall = false;\r\n\t\t} else if (current.label - mazeSize == next.label) {\r\n\t\t\t\r\n\t\t\tcurrent.hasUpWall = false;\r\n\t\t\tnext.hasDownWall = false;\r\n\t\t}\r\n\r\n\t\tcurrent.neighbors.remove(next);\r\n\t\tnext.neighbors.remove(current);\r\n\t}", "protected void reversePath() {\n\t\t\n\t\tif(_reverse) {\n\t\t\t\n\t\t\tif(_nextMove + 1 > movingPattern.size() - 1)\n\t\t\t\t_nextMove = 0;\n\t\t\telse\n\t\t\t\t_nextMove++;\n\t\t\t\n\t\t\t_reverse = false;\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\tif(_nextMove - 1 < 0)\n\t\t\t\t_nextMove = movingPattern.size() - 1;\n\t\t\telse\n\t\t\t\t_nextMove--;\n\t\t\t\n\t\t\t_reverse = true;\n\t\t}\n\t}", "public void unsetOrigin()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(ORIGIN$16, 0);\n }\n }", "public void stopSpinning()\n {\n scheduler.shutdown();\n startupLock.lock();\n spinning = false;\n }", "private void removePosition(Point p) {\n\t\tfor(Point point : occupiedPositions) {\n\t\t\tif(p.x == point.x && p.y == point.y) {\n\t\t\t\toccupiedPositions.remove(point);\n\t\t\t}\n\t\t}\n\t}", "boolean isUnblockedMove(Square from, Square to) {\r\n int dir = from.direction(to);\r\n SqList rook = ROOK_SQUARES[from.index()][dir];\r\n int indexTo = rook.indexOf(to);\r\n for (int i = indexTo; i >= 0; i--) {\r\n if (map.get(rook.get(i)) != EMPTY) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "@Override\n public void stop() {\n animatorThread = null;\n\n //Get rid of the objects necessary for double buffering.\n offGraphics = null;\n offImage = null;\n }", "@Override\n\tpublic boolean unlockIt() {\n\t\treturn false;\n\t}", "public void dissociateShape() {\n\t\tif(currentShape != null && (groupedShapes.contains(currentShape))) {\n\t\t\tgroupedShapes.remove(currentShape);\n\t\t\tnotifyObservers();\n\t\t}\n\t}", "public boolean isUnblockable();", "public void down(){\n\t\tmoveX=0;\n\t\tmoveY=1;\n\t}", "public void deselect() {\n\n // reset the pin value\n pin.reset();\n\n }", "public void runAway(int x, int y) {\n\t\tif(getX() >= x) {\n\t\t\tif(getY() < y) {\n\t\t\t\tgo2position(x+20, y-20);\n\t\t\t}else {\n\t\t\t\tgo2position(x+20, y+20);\n\t\t\t}\n\t\t}\n\t\tif(getX() < x) {\n\t\t\tif(getY() < y) {\n\t\t\t\tgo2position(x-20, y-20);\n\t\t\t}else {\n\t\t\t\tgo2position(x-20, y+20);\n\t\t\t}\n\t\t}\n\t}", "public void unlockDoor(nodePositions side) {\n lockedDoors[side.getNumVal()] = false;\n }", "public void deactivate()\n\t{\n\t\t_active = false;\n\t\t_leader.setObjectHandler(null);\n\t}", "void unlockLastInode();", "@Override\n public void unlock() {\n }", "public abstract void removeEdge(Point p, Direction dir);", "public void clearPathData()\r\n {\r\n // Clear out all paths\r\n for(String key: network_topology.keyset())\r\n {\r\n //System.out.println(\"Clearing : \"+ key);\r\n network_topology.get(key).previous=null;\r\n network_topology.get(key).minDistance = Double.POSITIVE_INFINITY;\r\n }\r\n }", "public void removeObstacle(Coord obstacleCoord);", "private void discardPlayer(Player p)\n {\n locations.remove(p);\n plugin.getAM().arenaMap.remove(p);\n clearPlayer(p);\n }", "public void discard() {\r\n\t\tif(this.markedStack.isEmpty()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.markedStack.removeLast();\r\n\t}", "public void resetReversePoison() {\n\n Set<AS> prevAdvedTo = this.adjOutRib.get(this.asn * -1);\n\n if (prevAdvedTo != null) {\n for (AS pAS : prevAdvedTo) {\n pAS.withdrawPath(this, this.asn * -1);\n }\n }\n\n this.adjOutRib.remove(this.asn * -1);\n\n this.botSet = new HashSet<>();\n }" ]
[ "0.63573325", "0.5966508", "0.5966508", "0.5866534", "0.58207303", "0.5819432", "0.5796809", "0.5791927", "0.5735546", "0.5725819", "0.5636787", "0.55642486", "0.5508358", "0.5505973", "0.5504169", "0.5473695", "0.537356", "0.5347686", "0.5332664", "0.5309363", "0.5270257", "0.52640235", "0.5263085", "0.5262432", "0.52501076", "0.52383786", "0.52367014", "0.5233589", "0.52243835", "0.52230656", "0.52062684", "0.52058095", "0.52001303", "0.51824886", "0.51810277", "0.51779336", "0.516685", "0.516484", "0.5161128", "0.5160967", "0.5151926", "0.51426446", "0.5142384", "0.513712", "0.5136843", "0.51236516", "0.51186985", "0.51126504", "0.5110279", "0.51067007", "0.50988805", "0.5098174", "0.50835156", "0.5078129", "0.50757897", "0.5063639", "0.5049316", "0.5046774", "0.50398624", "0.5033828", "0.50336206", "0.50329083", "0.50318277", "0.501856", "0.5018322", "0.50177705", "0.5013639", "0.50121063", "0.50090235", "0.50079113", "0.50043046", "0.50002205", "0.49980655", "0.4988066", "0.49864635", "0.49843347", "0.49723312", "0.49707747", "0.49702168", "0.49694055", "0.49470407", "0.49412352", "0.49371114", "0.4931803", "0.4916694", "0.49133575", "0.49105522", "0.49029925", "0.4894561", "0.4890572", "0.48875222", "0.48856178", "0.48855177", "0.4882543", "0.48824438", "0.48756677", "0.48738384", "0.4873796", "0.4873185", "0.48715448" ]
0.6850675
0
Visit current coordinate in path.
public abstract void visit();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void pathFinderVisited(int x, int y) {\n\t}", "@Override\n public void handle(long now) {\n OneIteration();\n if (current.getRow() == ia && current.getCol() == ja) {\n drawPath();\n this.stop();\n }\n }", "public void visitPath(Path path) {\n\t\t\n\t}", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "public void visit() {\n visited = true;\n }", "public void visit() {\n\t\tvisited = true;\n\t}", "void didVisitNode(PathFindingNode node);", "private void tracePath(Node lastVisitedNode)\r\n {\r\n Node pathPtr = lastVisitedNode;\r\n while (pathPtr != Start)\r\n {\r\n pathPtr.isVisited = true;\r\n pathPtr = pathPtr.parent;\r\n }\r\n }", "protected void visitCurrentNode() {\n\t\ttraverseVector.add(tree.getCurrentNode());\n\t}", "public void draw(WorldLocation coord){\n \n }", "public synchronized void visitorPositionChanged (CityMap sender) {\n cityMap.getVisitorXY (tmpXY);\n visitorX = tmpXY[CityMap.X];\n visitorY = tmpXY[CityMap.Y];\n repaint ();\n }", "public abstract int visit(SpatialVisitor visitor);", "public void setPathOrigin(int x, int y);", "public void printPath(){\n\t\tListIterator<Path> listIterator =temp.listIterator();\n\t\twhile(listIterator.hasNext()){\n\t\t\tSystem.out.print(listIterator.next().getPos()+\" \");\n\t\t}\n\t}", "public void goToLocation (Locator checkpoint) { //Patrolling Guard and Stationary Guard\r\n\t\tVector2i start = new Vector2i((int)(creature.getXlocation()/Tile.TILEWIDTH), (int)(creature.getYlocation()/Tile.TILEHEIGHT));\r\n\t\tint destx = (int)(checkpoint.getX()/Tile.TILEWIDTH);\r\n\t\tint desty = (int)(checkpoint.getY()/Tile.TILEHEIGHT);\r\n\t\tif (!checkCollision(destx, desty)) {\r\n\t\tVector2i destination = new Vector2i(destx, desty);\r\n\t\tpath = pf.findPath(start, destination);\r\n\t\tfollowPath(path);\r\n\t\t}\r\n\t\tarrive();\r\n\t}", "private void findPath(int current){\r\n // remove current from OPEN\r\n int index = insideArray(_openSet,current);\r\n if(index == -1){\r\n System.out.println(\"findPath method returns -1.\");\r\n }\r\n _openSet.remove(index);\r\n\r\n // add current to CLOSED\r\n _closedSet.add(current);\r\n\r\n // if current is the target node\r\n if(current == _endIndex){\r\n return;\r\n }\r\n\r\n int neighborNum = _map.get_grid(current).get_neighborNum();\r\n int[] neighbors = _map.get_grid(current).get_neighbors();\r\n\r\n //for each neighbor of the current node\r\n for(int i=0;i<neighborNum;i++){\r\n Grid neighborGrid = _map.get_grid(neighbors[i]);\r\n // if neighbor is not traversable or neighbor is in CLOSED\r\n // SKIP THIS NEIGHBOR\r\n if(!neighborGrid.get_type().equals(\"|\") && insideArray(_closedSet,neighbors[i]) == -1){\r\n int currentNeighborF = neighborGrid.get_Fnum();\r\n int neighborF = findF(neighbors[i]);\r\n if(neighborF < currentNeighborF || insideArray(_closedSet,neighbors[i]) == -1){\r\n neighborGrid.set_Fnum(neighborF);\r\n neighborGrid.set_parent(current);\r\n if(insideArray(_closedSet,neighbors[i]) == -1){\r\n _openSet.add(neighbors[i]);\r\n }\r\n }\r\n }\r\n }\r\n int currentIndex = smallestF();\r\n // RECURSIVE CALL\r\n findPath(_map.get_grid(_openSet.get(currentIndex)).get_index());\r\n }", "@Override\n public void visit(P_Link pathNode) {\n Iterator<Node> nodes = engine.doOne(node, pathNode.getNode()) ;\n fill(nodes) ;\n }", "public void startDraw(Vector2 point){\n path.add(point);\n }", "public <T extends PathVertexVisitor> Result<T> walkPath() {\n List<Result<T>> results = walkPaths();\n\n MatcherAssert.assertThat(\"Expected a single path\", results, hasSize(equalTo(1)));\n\n return results.get(0);\n }", "public void setVisited()\n {\n visited = true;\n }", "public ImPoint getCurrentLoc() {\n\treturn curPoint; // REMOVE this line -- dummy code to get it to compile\n }", "public void markAsVisited (Coordinate c)\n\t{\n\t\tgrid[c.x][c.y] = GridChar.VISITED;\n\t\t//TODO: Implement this\n\t}", "public void draw(Point location) {\n\t}", "public abstract void visit(Line line);", "void pathFound(Node node);", "void visit(Line line);", "private void path(Node s, Node d, HashSet<Node> visited, List<Node> currentPath, List<List<Node>> paths) {\n\t\tvisited.add(s);\n\t\tcurrentPath.add(s);\n\t\t\n\t\tif(s.value == d.value) {\n\t\t\tpaths.add(currentPath);\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t* A list of nodes accessible from the current node, both parents and children\n\t\t* */\n\t\tList<Node> proximity = new ArrayList<>();\n\t\t\n\t\tif(s.children != null)\n\t\t\tfor(Node child : s.children) {\n\t\t\t\tif(!visited.contains(child))\n\t\t\t\t\tproximity.add(child);\n\t\t\t}\n\t\t\n\t\tif(s.parents != null)\n\t\t\tfor(Node parent : s.parents) {\n\t\t\t\tif(!visited.contains(parent)) \n\t\t\t\t\tproximity.add(parent);\n\t\t\t}\n\n /*\n * Explore each possible path\n * */\n\t\tfor(Node neighbour : proximity) {\n\t\t\tArrayList<Node> newPath = new ArrayList<>(currentPath);\n\t\t\tpath(neighbour, d, visited, newPath, paths);\n\t\t}\n\t}", "public void currView(String currViewingNode)\n {\n if (nodeChoice.equals(currViewingNode))\n passData = true;\n else\n passData = false;\n }", "public abstract boolean visit(PathVertexVisitor visitor, SymbolProvider symbols);", "Path getLocation();", "public boolean isVisited () {\n if (this.equals(SquareType.VISITED))\n return true;\n else\n return false;\n }", "public void moveTo(double x, double y)\n {\n\t_closedPath = false;\n\tPoint2D pos = transformedPoint(x,y);\n\t_startx = pos.getX();\n\t_starty = pos.getY();\n\t_currentx = pos.getX();\n\t_currenty = pos.getY();\n\t_currentPath.clear();\n }", "public void updateXLoc();", "public Point getLocation() { return loc; }", "@Override\n public boolean isPointInPath(double x, double y) {\n return graphicsEnvironmentImpl.isPointInPath(canvas, x, y);\n }", "public Coordinate getCurrent( )\n\t{\n\t\treturn currentLocation;\n\t}", "@Override\n\tpublic void run() {\n\t\tMap<Integer, Location> possibleStartLocations = possibleStartLocations();\n\n\t\tfor(Entry<Integer, Location> startLocation : possibleStartLocations.entrySet()) {\n\t\t\t// Add startLocation to visited locations\n\t\t\tMap<Integer, Location> visitedLocations = new HashMap<Integer, Location>();\n\t\t\tvisitedLocations.put(startLocation.getKey(), startLocation.getValue());\n\t\t\t\n\t\t\t// Add startLocation to visited order\n\t\t\tList<Location> visitedOrder = new LinkedList<Location>();\n\t\t\tvisitedOrder.add(startLocation.getValue());\n\t\t\t\n\t\t\t// Start the recursion for the following start node\n\t\t\tfindSolution(startLocation, startLocation, visitedLocations, visitedOrder, 0);\n\t\t}\n\t}", "private Object magicVisit(ParseTree ctx, Node<TokenAttributes> CST_node) {\n current_node = CST_node;\n Object result = visit(ctx);\n current_node = CST_node;\n return result;\n }", "private void printPath(int currentVertex, int[] parents) {\n // Base case : Source node has been processed \n if (currentVertex == NO_PARENT) {\n return;\n }\n printPath(parents[currentVertex], parents);\n System.out.print(currentVertex + \" \");\n }", "public Coordinate getLocation();", "public IRLocation getLocation(IRNode node);", "public void doGoToLocation(Structure structure)\n\t{\n\t\tif(vehicle.currentLocation != null)\n\t\t{\n\t\t\tx = (int)vehicle.currentLocation.getParkingLocation().getX();\n\t\t\ty = (int)vehicle.currentLocation.getParkingLocation().getY();\n\t\t}\n\t\tdestination = structure;\n\t\tdestX = (int)destination.getParkingLocation().getX();\n\t\tdestY = (int)destination.getParkingLocation().getY();\n\t\tfired = false;\n\t\tpresent = true;\n\n\t\tcurrent = new Point(x/CityPanel.GRID_SIZE,y/CityPanel.GRID_SIZE);\n\t\tnext = current;\n\t\t\t\t\n\t\tfindPath();\n\t}", "void visit(Circle circle);", "private void touchStarted(float x, float y, int lineID){\n Path path;\n Point point;\n\n // if there is already a path of lineID\n if( pathMap.containsKey(lineID) ){\n path = pathMap.get(lineID); // get the Path\n path.reset(); // reset Path because new touch has started\n point = previousPointMap.get(lineID); // get Path's last point\n } else {\n path = new Path();\n pathMap.put(lineID, path); // add the Path to Map\n point = new Point(); // create a new Point\n previousPointMap.put(lineID, point); // add the Point\n }\n\n // move to coordinates of the touch\n path.moveTo(x, y);\n point.x = (int) x;\n point.y = (int) y;\n }", "public Point2D getLocation();", "@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\tif(gui.getMapPointSelectMode() == MapPointSelectMode.START){\n\t\t\t\t\t\tSPath path = SPath.getCurrentPath();\n\t\t\t\t\t\tif(path != null){\n\t\t\t\t\t\t\t//Set the start point.\n\t\t\t\t\t\t\tpath.setStartPoint(e.getPoint(), width, height);\n\t\t\t\t\t\t\t//Reset select mode.\n\t\t\t\t\t\t\tgui.resetSelectMode();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//If current mode is finish.\n\t\t\t\t\telse if(gui.getMapPointSelectMode() == MapPointSelectMode.FINISH){\n\t\t\t\t\t\tSPath path = SPath.getCurrentPath();\n\t\t\t\t\t\tif(path != null){\n\t\t\t\t\t\t\t//Set the finish point.\n\t\t\t\t\t\t\tpath.setFinishPoint(e.getPoint(), width, height);\n\t\t\t\t\t\t\t//Reset select mode.\n\t\t\t\t\t\t\tgui.resetSelectMode();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "private void paintPath(Graphics graphics) { \n graphics.setColor(Color.blue);\n //si no se encuentra un camino, mostrar error\n if(Path == null){\n JOptionPane.showMessageDialog(null, \"No se encontro camino.\");\n }\n else\n for (Node n : Path) {\n if (!this.Graph.getGoals().contains(n) && n != this.Graph.getInitial()) {\n int x = n.getX(); int y = n.getY();\n paintRectangle(graphics, x, y); \n }\n }\n }", "public void pathTo(int x, int y);", "void touch_move_draw(float event_x, float event_y) {\n path.lineTo(event_x,event_y);\n cur_x = event_x;\n cur_y = event_y;\n\n // Add point to list\n addPoint();\n }", "private void printPath(LinkedList<String> visited) {\r\n\r\n if (flag == false) {\r\n System.out.println(\"Yes there exists a path between \" + START + \" and \" + END);\r\n }\r\n for (String node : visited) { //creating for loop to print the nodes stored in visited array \r\n System.out.print(node);\r\n System.out.print(\" \");\r\n }\r\n System.out.println();\r\n }", "final public void updatePath(EventPacket<?> in) {\n if (!pathsEnabled) {\n return;\n }\n path.add(new PathPoint(location.x, location.y, in.getLastTimestamp(), numEvents - previousNumEvents));\n previousNumEvents = numEvents;\n if (path.size() > getPathLength()) {\n path.remove(path.get(0));\n }\n updateVelocity();\n }", "public Point getLocation();", "public Point getLocation() {\n return currentLocation;\n }", "public void walkToPoint(Point destination) {\n\n\t\tACTION attemptedMove;\n\n\t\tif (coordX != destination.x && coordY != destination.y) {\n\t\t\tSystem.out.println(\"X- \" + coordX + \" Y- \" + coordY);\n\t\t\tSystem.out.println(\"pX- \" + destination.x + \" pY- \" + destination.y);\n\t\t\tthrow new IllegalArgumentException(\"Illegal coordinate. Only move in one direction at a time\");\n\t\t}\n\t\tif (coordX < destination.x) {\n\t\t\tattemptedMove = ACTION.RIGHT;\n\t\t} else if (coordX > destination.x) {\n\t\t\tattemptedMove = ACTION.LEFT;\n\t\t} else if (coordY < destination.y) {\n\t\t\tattemptedMove = ACTION.DOWN;\n\t\t} else if (coordY > destination.y) {\n\t\t\tattemptedMove = ACTION.UP;\n\t\t} else {\n\t\t\treturn; //In case someone issues a move to nowhere\n\t\t}\n\t\tchangeFacing(attemptedMove);\n\t\taction = attemptedMove;\n\t\tpointWalking = true;\n\t\tendPoint = destination;\n\n\t\tif (validMoveEh(action)) {\n\t\t\tmoving = true;\n\t\t\tremainingSteps = STEP_SIZE;\n\t\t\tthis.updateCoordinate(action, true);\n\t\t\tcurrentImage = startAnimation(attemptedMove);\n\t\t}\n\t}", "private void findPath()\n\t{\n\t\tpathfinding = true;\n\n\t\tmoves = Pathfinder.calcOneWayMove(city.getDrivingMap(), x, y, destX, destY);\n\t\tpathfinding = false;\n\t}", "public void printPath() {\n System.out.print(\"Path: \");\n for (int i = 0; i < parents.size(); i++) {\n Cell cell = parents.get(i);\n System.out.print(\" (\" + cell.x + \",\" + cell.y + \") \");\n }\n System.out.println(\"\\nVisited cells: \" + visitedCells);\n System.out.println(\"Length of Path: \" + parents.size());\n }", "@Override\n\tpublic Object visit(ASTXQuerySlash node, Object data) {\n\t\tnode.jjtGetChild(0).jjtAccept(this, data);\n\t\tSystem.out.print(\"/\");\n\t\tnode.jjtGetChild(1).jjtAccept(this, data);\n\t\treturn null;\n\t}", "void printPath(Coordinate endName) {\n if (!graph.containsKey(endName)) {\n // test use, display point\n // System.err.printf(\"Graph doesn't contain end vertex \\\"%s\\\"\\n\", endName);\n return;\n }\n graph.get(endName).printPath();\n }", "private void update_location() throws Exception {\r\n\t\tif (children.size() == 1) {\r\n\t\t\tCLocation bloc = children.get(0).get_location();\r\n\t\t\tthis.location = bloc.get_source().get_location(bloc.get_bias(), bloc.get_length());\r\n\t\t} else if (children.size() > 1) {\r\n\t\t\tCLocation eloc = children.get(children.size() - 1).get_location();\r\n\t\t\tint beg = this.location.get_bias(), end = eloc.get_bias() + eloc.get_length();\r\n\t\t\tthis.location.set_location(beg, end - beg);\r\n\t\t}\r\n\t}", "public void closepath() \n {\n\tLine line = new Line(_currentx, _currenty, _startx, _starty);\n\t_currentPath.add(line);\n\t_currentx = _startx;\n\t_currenty = _starty;\n\t_closedPath = true;\n }", "public void addWalkablePath(Point point) {\n\t\tmaze[point.x][point.y] = Block.EMPTY;\n\t}", "public void moveTo (Coordinate c) throws Exception\n\t{\n\t\tcurrentLocation = c;\n\t\tgrid[c.x][c.y] = GridChar.VISITED;\n\t}", "public ImPoint getCurrentLoc() {\n \treturn this.startLoc;\n }", "public boolean visit( Vertex vertexToVisit ) {\n VisualVertex visualVertex;\n Arc2D arc;\n double annulusWedgeDegree;\n double positionDegree;\n double startAtDegree;\n int depth;\n VertexDegrees degrees = new VertexDegrees();\n VertexDegrees parentDegrees;\n\n this.logCategory.debug( \"Visiting \" + vertexToVisit );\n\n try {\n visualVertex = this.vGraph.getVisualVertex( vertexToVisit );\n depth = this.tree.getDepth( vertexToVisit );\n this.logCategory.debug( \"Depth: \" + depth );\n\n if( this.tree.getRoot() == vertexToVisit ) {\n // For the root of the tree, set the annulus wedge to 360 degrees\n annulusWedgeDegree = 360;\n center = new Point2D.Double( this.tree.getHeight() * this.radius / 2, this.tree.getHeight() * this.radius / 2 );\n this.logCategory.debug( \"Setting center \" + center );\n visualVertex.setLocation( center.getX(), center.getY() );\n degrees.annulusWedgeDegree = annulusWedgeDegree;\n degrees.positionDegree = 0;\n this.annulusWedgeMap.put( vertexToVisit, degrees );\n this.previousParent = vertexToVisit;\n }\n else {\n // For non-root, set the annulus wedge to:\n // ( leaves of current node / leaves of parent node ) * annulus wedge of parent\n Vertex parent = this.tree.getParent( vertexToVisit );\n parentDegrees = (VertexDegrees) this.annulusWedgeMap.get( parent );\n double parentAnnulusWedge = parentDegrees.annulusWedgeDegree;\n Tree parentSubTree = this.tree.getSubTree( parent );\n Tree subTree = this.tree.getSubTree( vertexToVisit );\n\n // Note that 120 degrees here is valid only if the concentric circles\n // are doubling in radius for every depth.\n // 120 degrees is taken from cos(A)=radius/(radius/2)=0.5\n annulusWedgeDegree =\n Math.min(\n ( (double) subTree.getLeaves().size() / (double) parentSubTree.getLeaves().size() ) * parentAnnulusWedge,\n Math.toDegrees( Math.acos( (this.radius * ( depth - 1 ) ) / (this.radius * depth) ) ) * 2 );\n\n this.logCategory.debug( \"Annulus Wedge: \" + annulusWedgeDegree );\n\n\n if( this.previousDepth != this.tree.getDepth( vertexToVisit ))\n this.depthStartAtDegrees = parentDegrees.positionDegree - ( parentDegrees.annulusWedgeDegree / 2 );\n if( this.previousParent != parent )\n this.depthStartAtDegrees = parentDegrees.positionDegree - ( parentDegrees.annulusWedgeDegree / 2 );\n\n positionDegree = this.depthStartAtDegrees + annulusWedgeDegree / 2;\n\n this.logCategory.debug( \"Start At:\" + this.depthStartAtDegrees );\n this.logCategory.debug( \"Position:\" + positionDegree );\n\n arc = new Arc2D.Double(\n center.getX() - ( this.radius / 2 ) * ( depth - 1 ),\n center.getY() - ( this.radius / 2 ) * ( depth - 1 ),\n (double) ( this.radius * ( depth - 1 )),\n (double) ( this.radius * ( depth - 1 )),\n positionDegree, 1,\n Arc2D.OPEN );\n\n visualVertex.setLocation( arc.getEndPoint().getX(), arc.getEndPoint().getY() );\n\n degrees.annulusWedgeDegree = annulusWedgeDegree;\n degrees.positionDegree = positionDegree;\n this.annulusWedgeMap.put( vertexToVisit, degrees );\n\n this.depthStartAtDegrees += annulusWedgeDegree;\n this.previousDepth = this.tree.getDepth( vertexToVisit );\n this.previousParent = parent;\n }\n }\n catch( Exception ex ) {\n ex.printStackTrace();\n }\n\n return true;\n }", "public void start(Point p);", "public void setCellToPath(int pos){//how to check for the end???\n\t\t\n\t\tif(pos<0||pos>width*height-1||getCompletePath())\n\t\t\treturn;// the position entered is not valid or the path has already been completed\n\t\t\n\t\telse if(temp.isEmpty()){//no path tile have been defined\n\t\t\tif(currentPos<0){//start hasn't been placed\t\t\n\t\t\t\tcurrentPos=pos;\n\t\t\t\tcurrentPath=new Path(currentPos);\n\t\t\t\tsetEntryPoint(currentPath);\n\t\t\t\tsetGrid(currentPath.getRow(),currentPath.getCol(),currentPath);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tint d = currentPath.getDirection(pos);\n\t\t\t\tif (d<0||d>=4)\n\t\t\t\t\treturn; //the two tiles are not connected\n\t\t\t\tPathType type =Map.createPathTileOfType(d, caseEdge);\n\t\t\t\tPath p =PathFactory.makePath(type, currentPos);\n\t\t\t\t\n\t\t\t\t//fix direction of tile\n\t\t\t\tif(p.getEntry()==pos)\n\t\t\t\t\tp.rotate();\n\t\t\t\t//validate spot (for entry/exit)\n\t\t\t\t\n\t\t\t\t//set as Path entry point \n\t\t\t\tp.setStart();\n\t\t\t\tsetEntryPoint(p);\n\t\t\t\t\n\t\t\t\t//add to grid and list\n\t\t\t\tp.storePathTile();\n\n\t\t\t\t//update current\n\t\t\t\tcurrentPos=pos;\n\t\t\t\tcurrentPath=new Path(currentPos);\t\t\n\t\t\t\tsetGrid(currentPath.getRow(),currentPath.getCol(),currentPath);\n\t\t\t}\t\t\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\tif (getGrid(pos/width, pos%width)!=null)\n\t\t\t\tif(getGrid(pos/width, pos%width).isPath())\n\t\t\t\t\treturn;//causes intersection\n\t\t\t\n\t\t\tint dExit = currentPath.getDirection(pos);\n\t\t\tint lastPos= temp.peekLast().getPos();\n\t\t\tint dEntry= currentPath.getDirection(lastPos);\n\n\t\t\t\n\t\t\tif (dExit<0||dExit>3||dEntry<0||dEntry>3)\n\t\t\t\treturn; //the two tiles are not connected\n\t\t\t\n\t\t\t\n\t\t\tPathType type =Map.createPathTileOfType(dExit,dEntry);\n\t\t\tPath p =PathFactory.makePath(type, currentPos);\n\t\t\t\n\t\t\t//fix direction of tile\n\t\t\tif(p.getEntry()==pos)\n\t\t\t\tp.rotate();\n\t\t\t\n\t\t\tif(!inValidSpot(p))\n\t\t\t\treturn; //\n\t\t\t\n\t\t\t//add to grid and list\n\t\t\tp.storePathTile();\n\t\t\t\n\t\t\t//update current\n\t\t\tcurrentPos=pos;\n\t\t\tcurrentPath=new Path(currentPos);\t\n\t\t\tsetGrid(currentPath.getRow(),currentPath.getCol(),currentPath);\n\t\t}\n\t}", "public void visit(QuadNode node) {\n\t\tSystem.out.println(\"Visiting (x,y)=(\" + node.getX() + \",\" + node.getY()\n\t\t\t\t+ \") length=\" + node.getSideLength() + \" level=\"\n\t\t\t\t+ node.getLevel());\n\t}", "private void findPath1(List<Coordinate> path) {\n\n // records the start coordinate in a specific sequence.\n ArrayList<Coordinate> starts = new ArrayList<>();\n // records the end coordinate in a specific sequence.\n ArrayList<Coordinate> ends = new ArrayList<>();\n // records the total cost of the path in a specific sequence.\n ArrayList<Integer> cost = new ArrayList<>();\n\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n Graph graph = new Graph(getEdge(map));\n graph.dijkstra(o1);\n graph.printPath(d1);\n starts.add(o1);\n ends.add(d1);\n cost.add(graph.getPathCost(d1));\n }\n }\n int index = getMinIndex(cost);\n\n Graph graph = new Graph(getEdge(map));\n graph.dijkstra(starts.get(index));\n graph.printPath(ends.get(index));\n for (Graph.Node node : graph.getPathReference()) {\n path.add(node.coordinate);\n }\n setSuccess(path);\n }", "public boolean passedBy(Line2D path) {\n\t\tfor (int i = 0; i < coordinates.size() - 1; i++) {\n\t\t\tvar p1 = coordinates.get(i);\n\t\t\tvar p2 = coordinates.get(i + 1);\n\t\t\tLine2D buildingEdge = new Line2D.Double(p1.getLng(), p1.getLat(), p2.getLng(), p2.getLat()); // x1, y1, x2, y2 \n\t\t\tif (buildingEdge.intersectsLine(path)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean hasPathTo(int v) {\n return visited[v];\n }", "IntPoint getLocation();", "public abstract LinkedList<Point> traverse(Grid grid);", "@Override public void onLocationChanged(Location location) {\n if (mCurrentLocation == null) {\n map.getController().animateTo(new GeoPoint(location));\n }\n\n mCurrentLocation = location;\n\n long currentTime = System.currentTimeMillis();\n\n if (networkLocationIgnorer.shouldIgnore(location.getProvider(), currentTime))\n return;\n\n double dT = currentTime - mLastTime;\n if (dT < 200.0){\n return;\n };\n\n mLastTime = currentTime;\n\n if (!currentLocationOverlay.isEnabled()){\n currentLocationOverlay.setEnabled(true);\n }\n\n currentLocationOverlay.setLocation(new GeoPoint(location));\n currentLocationOverlay.setBearing(location.getBearing());\n currentLocationOverlay.setAccuracy((int) location.getAccuracy());\n\n // Navigation mode\n if (mNavigationMode) {\n if(!mNavigationRunning) {\n // Location for the first time -> get road\n mNavigationRunning = true;\n\n ArrayList<GeoPoint> wayPoints = new ArrayList<GeoPoint>();\n // Start location\n wayPoints.add(new GeoPoint(location));\n // Destination location\n wayPoints.add(getLocationFromAddress(destinationAddress));\n\n new RoadTask().execute(wayPoints);\n }\n else if (mNextNode != null) {\n GeoPoint currentGeoPoint = new GeoPoint(mCurrentLocation);\n int distance = currentGeoPoint.distanceTo(mNextNode.mLocation);\n boolean readInstructions = false;\n\n // TODO: Test which distance is good for marking node as reached\n // TODO: Preveri kako zaznati ali je šel čez node\n // TODO: Povej navodila tik preden zavije\n if ( distance < 4 ) {\n map.getController().animateTo(new GeoPoint(location));\n\n // Node reached, increase node index\n mNodeIndex++;\n\n if (mNodeIndex >= mRoad.mNodes.size()) {\n // Last node reached - turn navigation off\n mNavigationMode = false;\n mNavigationRunning = false;\n mNextNode = null;\n mCurrentNode = null;\n mNodeIndex = 0;\n\n Button button = (Button)findViewById(R.id.current_instruction_button);\n button.setVisibility(View.GONE);\n\n Button buttonFavPaths = (Button)findViewById(R.id.favourite_paths_button);\n buttonFavPaths.setVisibility(View.VISIBLE);\n }\n else {\n // Get next node\n mCurrentNode = mNextNode;\n mNextNode = mRoad.mNodes.get(mNodeIndex);\n\n readInstructions = true;\n }\n }\n else if (distance < 6) {\n readInstructions = true;\n }\n\n // Set new instruction\n setInstruction(readInstructions);\n }\n }\n\n map.invalidate();\n }", "@Override\n public void onLocationChange(Location loc) {\n user.setRelativePosition(loc.getX(), loc.getY());\n map.addStep(new PointF(loc.getX(), loc.getY()));\n //messageHandler.sendEmptyMessage(MESSAGE_REFRESH);\n }", "public void pathFinding(GridCoordinate playerCoordinates)\r\n\t{\n\t\tplayerCoordinates = getCoordinates();\r\n\t\t\r\n\t\t//float playerX = PlayerCharacter.getOffsetX();\r\n\t\t\r\n\t}", "private void touchUp(){\n path.lineTo(pointX,pointY);\n }", "@Override\n\tpublic Point getLocation() {\n\t\treturn new Point(x,y);\n\t}", "public void mouseClicked(MouseEvent e){\r\n\t\tif (e.getButton() == MouseEvent.BUTTON1){\r\n\t\t\tboolean b = myGraph.isAdjacent(roboSpot,(Spot)e.getSource()); \r\n\t\t\tSystem.out.print(e.getSource()+\" Clicked and it is\");\r\n\t\t\tif(!b) System.out.print(\" not\");\r\n\t\t\tSystem.out.println(\" adjacent\");\r\n\t\t} else { //a different button was clicked...\r\n\t\t\tArrayList<Spot> sequence = myGraph.getShortestPath(roboSpot,goalSpot);\r\n\t\t\t\r\n\t\t\tfor(int i=0; i<sequence.size(); i++){\r\n\t\t\t\tsequence.get(i).setSeqInd(i+1);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.revalidate();\r\n\t\tthis.repaint();\r\n\t}", "void buildCity(VertexLocation vert);", "public boolean pathExists(int startVertex, int stopVertex) {\n// your code here\n ArrayList<Integer> fetch_result = visitAll(startVertex);\n if(fetch_result.contains(stopVertex)){\n return true;\n }\n return false;\n }", "@Override\n\tpublic Object visit(ASTAbsSlash node, Object data) {\n\t\tnode.jjtGetChild(0).jjtAccept(this, data);\n\t\tSystem.out.print(\"/\");\n\t\tnode.jjtGetChild(1).jjtAccept(this, data);\n\t\treturn null;\n\t}", "abstract void walk();", "MazePoint getActivePlayerCoordinates();", "private void exploreUnseenMap(Coordinate currPos) {\n\t\tif (control.currentPath == null) {\n\t\t\t//loop through unseen coords, finding best path there\n\t\t\tArrayList<Coordinate> path = null;\n\t\t\tArrayList<Coordinate> bestPath = null;\n\t\t\tfor (Coordinate coord: control.unseenCoords) {\n\t\t\t\tSet<Coordinate> tempHazards = new HashSet<>(control.hazardsMap.keySet());\n\t\t\t\tpath = control.findPath(currPos, coord, tempHazards);\n\t\t\t\tif (path.size() > 0) {\n\t\t\t\t\tif (bestPath == null || path.size() < bestPath.size()) {\n\t\t\t\t\t\tbestPath = path;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (bestPath == null || bestPath.size() == 0) {\n\t\t\t\tfor (Coordinate coord: control.unseenCoords) {\n\t\t\t\t\tSet<Coordinate> tempHazards = new HashSet<>(control.hazardsMap.keySet());\n\t\t\t\t\tpath = control.findPath(currPos, coord, tempHazards);\n\t\t\t\t\tfor (Coordinate hazard : control.hazardsMap.keySet()) {\n\t\t\t\t\t\ttempHazards.remove(hazard);\n\t\t\t\t\t\tpath = control.findPath(currPos, coord, tempHazards);\n\t\t\t\t\t\tif (path.size() > 0) {\n\t\t\t\t\t\t\tif (bestPath == null || path.size() < bestPath.size()) {\n\t\t\t\t\t\t\t\tbestPath = path;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tcontrol.setPath(bestPath);\n\t\t}\n\t}", "public int getX() { return loc.x; }", "public void pushCurPath()\n\t {\n\t \t this.currentpath.simpleAppend((SoNode)( null), -1);\n\t \t}", "public static void main(String[] args) {\n\t\tArrayList<Points> pointsPath = new ArrayList<>();\r\n\t\tPoints p = new Points();\r\n\t\tpointsPath.add(new Points(p));\r\n\t\tp.move(4, 4);\r\n\t\tpointsPath.add(new Points(p));\r\n\t\tp.move(10, 10);\r\n\t\tpointsPath.add(new Points(p));\r\n\t\tIterator<Points> it = pointsPath.iterator();\r\n\t\twhile(it.hasNext()){\r\n\t\t\tSystem.out.println(\r\n\t\t\t\t\t it.next());\r\n\t\t}\r\n\t\t\r\n\t}", "private void startTouch(float x, float y) {\n /* mPath.moveTo(x, y);\n mX = x;\n mY = y;*/\n }", "public static void printPosition(double[][] path, double[][] trajectory) {\n\t\tSystem.out.println(\"X: \\t Y:\");\n\t\tfor(double[] u: path)\n\t\t\tSystem.out.println((u[0]- trajectory[0][0]) + \"\\t\" + (u[1]-trajectory[0][1]));\n\t}", "@Override\r\n\tpublic boolean isVisited() {\n\t\treturn false;\r\n\t}", "protected void report() {\n\t\tif (pathCompleted()) {\n\t\t\t// Finished\n\t\t\tfinish();\n\t\t\treturn;\n\t\t}\n\n\t\t// Report\n\t\treportAtWaypoint();\n\n\t\ttransition(NavigatorState.NEXT);\n\t}", "public void followPath(List<Node> path) {\r\n\t\tfloat xlocation = creature.getXlocation();\r\n\t\tfloat ylocation = creature.getYlocation();\r\n\t\t//Path check timer\r\n\t\t/*-------------------------------------------------------------*/\r\n\t\tpathCheck += System.currentTimeMillis() - lastPathCheck;\r\n\t\tlastPathCheck = System.currentTimeMillis();\r\n\t\tif(pathCheck >= pathCheckCooldown) {\r\n\t\t/*-------------------------------------------------------------*/\r\n\t\t\tcreature.xMove = 0;\r\n\t\t\tcreature.yMove = 0;\r\n\t\t\tcreature.path = path;\r\n\t\t\tif (creature.path != null) {\r\n\t\t\t\tif (creature.path.size() > 0) {\r\n\t\t\t\t\tVector2i vec = creature.path.get(creature.path.size() - 1).tile;\r\n\t\t\t\t\tif (xlocation / Tile.TILEWIDTH < vec.getX() + .5) creature.xMove = creature.speed;\t\t//Right\r\n\t\t\t\t\telse if (xlocation / Tile.TILEWIDTH > vec.getX() + .5) creature.xMove = -creature.speed;\t//Left\t\t/\r\n\t\t\t\t\tif (ylocation / Tile.TILEHEIGHT < vec.getY() + .5) creature.yMove = creature.speed;\t\t//Down\r\n\t\t\t\t\telse if (ylocation / Tile.TILEHEIGHT > vec.getY() + .5) creature.yMove = -creature.speed;\t//Up\t\t/\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tPoint p = moveToCenter(2, creature);\r\n\t\t\t\t\tif(p.getX() == 0 && p.getY() == 0) {\r\n\t\t\t\t\t\tcreature.travelling = false;\r\n\t\t\t\t\t} else {\t\t\t\t\r\n\t\t\t\t\tcreature.xMove = creature.speed * p.getX();\r\n\t\t\t\t\tcreature.yMove = creature.speed * p.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\t}", "public abstract void visit(Circle circle);", "public Vector getLocation();", "void onNewCoords(Coords coords);", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "void changeVisited(){\n\t \t\tthis.isVisited = true;}", "public PathCode getCurPathCode() { return /*appliedTo.curPathCode*/currentpathcode;}", "public void path(int element) {\n if(!empty()) pathNodes(element, root);\n System.out.println();\n }", "@Override\n\tpublic WB_Point nextPoint();" ]
[ "0.7132528", "0.6177438", "0.6176725", "0.59226507", "0.5830692", "0.5783204", "0.5617541", "0.5611527", "0.5534996", "0.54300153", "0.54232126", "0.5404648", "0.53834176", "0.5365828", "0.5349658", "0.5330497", "0.53292054", "0.5286489", "0.52811354", "0.52319634", "0.52281225", "0.51967984", "0.5163342", "0.5160772", "0.515447", "0.51515085", "0.5151501", "0.51489675", "0.51291615", "0.51097196", "0.51043373", "0.5088898", "0.5085787", "0.50855184", "0.5069189", "0.50668687", "0.50597507", "0.5056023", "0.505502", "0.5050168", "0.5046998", "0.5045441", "0.50404394", "0.5037217", "0.49982822", "0.49861655", "0.49768478", "0.49746695", "0.49669275", "0.49632037", "0.49626356", "0.49589825", "0.4946818", "0.49403974", "0.49383634", "0.49289376", "0.49206048", "0.49192482", "0.49171135", "0.4914639", "0.49109626", "0.49092484", "0.4892627", "0.48776057", "0.48734757", "0.48732242", "0.48693588", "0.48661324", "0.48645508", "0.48632252", "0.48608863", "0.4836454", "0.48347682", "0.48293403", "0.48238587", "0.4820917", "0.48166853", "0.4816015", "0.48104578", "0.48039615", "0.48039374", "0.4802444", "0.47967407", "0.47944143", "0.4788055", "0.4787283", "0.47870776", "0.47868133", "0.4771267", "0.4768995", "0.47669208", "0.47664097", "0.47663522", "0.47653595", "0.47448328", "0.4741757", "0.47360253", "0.47301745", "0.472806", "0.4720478" ]
0.4810835
78
returns char matches between word1 and word2
private int getNumMatches(String word1, String word2) { int count = 0; for (int i = 0; i < word1.length(); i++) { if (word1.charAt(i) == word2.charAt(i)) { count++; } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean wordHasAllExceptFirstInCommon(String word1, String word2) {\n int charsInCommon = 0;\n\n char[] w1 = word1.toCharArray();\n char[] w2 = word2.toCharArray();\n\n for (int i = 1; i < w1.length; i++) {\n for (int j = 0; j < w2.length; j++) {\n if (w1[i] == w2[j]) {\n charsInCommon++;\n w2[j] = '\\0'; // w2[j] som nullchar (använd)\n break;\n }\n }\n }\n return (charsInCommon == w1.length - 1);\n }", "private static boolean letterDifferByOne(String word1, String word2) {\n if (word1.length() != word2.length()) {\n return false;\n }\n\n int differenceCount = 0;\n for (int i = 0; i < word1.length(); i++) {\n if (word1.charAt(i) != word2.charAt(i)) {\n differenceCount++;\n }\n }\n return (differenceCount == 1);\n }", "public static boolean matchExact(String word1, String word2) {\n return word1.equals(word2);\n }", "String getWordIn(String schar, String echar);", "private static boolean anagramWord(String first, String second) {\n\t\tif(first.length()!=second.length())return false;\n\t\tint matches = 0;\n\t\tchar[] a = first.toLowerCase().toCharArray();\n\t\tchar[] b = second.toLowerCase().toCharArray();\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\tfor(int j=0; j<b.length; j++){\n\t\t\t\tif(a[i]==b[j])matches++;\n\t\t\t}\n\t\t}\n\t\tif( matches==a.length && matches==b.length )return true;\n\t\treturn false;\n\t}", "public int stringMatch(String a, String b) {\n int result = 0;\n int end = (a.length()<=b.length()? a.length():b.length());\n for (int i = 0; i <end-1 ; i++){\n if (a.substring(i, i + 2).equals(b.substring(i, i + 2))) {\n result++;\n }\n }\n return result;\n }", "public void findCharacters(String firstWord, String secondWord, int wordsLength) {\n foundedCharacter = new ArrayList<>(wordsLength);\n for (int position = 0; position < firstWord.length(); position++) {\n if (secondWord.contains(String.valueOf(firstWord.charAt(position)))) {\n foundedCharacter.add(firstWord.charAt(position));\n }\n }\n }", "public int match(String s1, String s2) {\n\t\tchar ch1;\n\t\t\n\t\tif (s1.length() == 0 && s2.length() == 0) // s1,s2がともにからであれば0を返す\n\t\t\treturn 0;\n\t\tfor (int i1 = 0; i1 < s1.length(); i1++) {\n\t\t\tch1 = s1.charAt(i1);\n\n\t\t\tif (s2.length() > 0) {\n\t\t\t\tif (s2.charAt(0) == ch1) {\n\t\t\t\t\tif (matchChar(s1, s2, i1)) {\n\t\t\t\t\t\treturn i1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (s2.length() == 0) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}", "private boolean myContains(String str2, String search2) {\n if (search2.length() == 0) {\n return true;\n }\n int k = 0;\n int f = 0;\n String str = str2.toLowerCase();\n String search = search2.toLowerCase();\n for (int i = 0; i < str.length(); i++) {\n if (str.charAt(i) == search.charAt(k)) {\n k += 1;\n f += 1;\n if (f == search.length()) {\n return true;\n }\n } else {\n k = 0;\n f = 0;\n }\n }\n return false;\n }", "public boolean compareWords(String word1, String word2) {\n for (int i = 1; i < 5; i++) {\n if (word2.indexOf(word1.charAt(i)) >= 0) {\n word2.replace(word1.charAt(i), ' ');\n } else\n return false;\n }\n\n return true;\n }", "public String findFirstWord(String a, String b) {\n\t\tchar[] aArray = a.toCharArray();\n\t\tchar[] bArray = b.toCharArray();\n\n\t\t//loop through letters of each\n\t\tfor (int i = 0; i < aArray.length; i++) {\n\n\t\t\t// if letter in a comes before b, then return a\n\t\t\tif (aArray[i] < bArray[i]) {\n\t\t\t\treturn a;\n\t\t\t}\n\n\t\t\t// check if letter in b comes before a\n\t\t\tif (aArray[i] > bArray[i]) {\n\t\t\t\treturn b;\n\t\t\t}\n\n\t\t\t// otherwise they are equal and you can move to the next letter\n\t\t}\n\n\t\t// you need this line in case the above loop doesn't return anything.\n\t\t// this is for the compiler.\n\t\treturn a;\n\t}", "public static void main(String[] args) {\n char[][] grid1 = {\n {'c', 'c', 'c', 't', 'i', 'b'},\n {'c', 'c', 'a', 't', 'n', 'i'},\n {'a', 'c', 'n', 'n', 't', 't'},\n {'t', 'c', 's', 'i', 'p', 't'},\n {'a', 'o', 'o', 'o', 'a', 'a'},\n {'o', 'a', 'a', 'a', 'o', 'o'},\n {'k', 'a', 'i', 'c', 'k', 'i'}\n };\n String word1 = \"catnip\";\n String word2 = \"cccc\";\n String word3 = \"s\";\n String word4 = \"bit\";\n String word5 = \"aoi\";\n String word6 = \"ki\";\n String word7 = \"aaa\";\n String word8 = \"ooo\";\n\n char[][] grid2 = {{'a'}};\n String word9 = \"a\";\n System.out.println(find_word_location(grid1, word1));\n System.out.println(find_word_location(grid1, word2));\n System.out.println(find_word_location(grid1, word3));\n System.out.println(find_word_location(grid1, word4));\n System.out.println(find_word_location(grid1, word5));\n System.out.println(find_word_location(grid1, word6));\n System.out.println(find_word_location(grid1, word7));\n System.out.println(find_word_location(grid1, word8));\n System.out.println(find_word_location(grid2, word9));\n }", "private boolean oneCharOff( String word1, String word2 )\n {\n if( word1.length( ) != word2.length( ) )\n return false;\n int diffs = 0;\n for( int i = 0; i < word1.length( ); i++ )\n if( word1.charAt( i ) != word2.charAt( i ) )\n if( ++diffs > 1 )\n return false;\n return diffs == 1;\n }", "public static int minDistance(String word1, String word2){\n int m = word1.length(), n = word2.length();\n int[][] dp = new int[m+1][n+1];\n\n for (int i = 0; i <= m; i++){\n dp[i][0] = i;\n }\n for (int i = 0; i <= n; i++){\n dp[0][i] = i;\n }\n\n for (int i = 1; i <= m; i++){\n for (int j = 1; j <= n; j++){\n if (word1.charAt(i-1) == word2.charAt(j-1)){\n dp[i][j] = dp[i-1][j-1];\n }else{\n dp[i][j] = Math.min(dp[i-1][j-1], Math.min(dp[i][j-1], dp[i-1][j])) + 1;\n }\n }\n }\n\n return dp[m][n];\n }", "private String buildWordMatch(Matcher matcher, String word){\n return \"(\" + matcher.replaceAll(\"% \"+word+\" %\")\n + \" or \" + matcher.replaceAll(word+\" %\")\n + \" or \" + matcher.replaceAll(word)\n + \" or \" + matcher.replaceAll(\"% \"+word) + \")\" ;\n }", "public static boolean is_rotation_of_another_string(String word1, String word2) {\n\n String s3 = word1 + word1;\n\n if (s3.contains(word2))\n return true;\n else\n return false;\n }", "public static boolean isAnagram (String word1, String word2){\n boolean check = false;\n String one = \"\";\n String two = \"\";\n int counter =0;\n int counter1 =0;\n for(int i=0; i<word1.length(); i++){\n counter=0;\n for(int k=0; k<word2.length(); k++){\n if(word1.charAt(i) == word2.charAt(k) ){\n counter++;\n }\n }\n if(counter ==1){\n counter1++;\n }\n }\n if (counter1 == word1.length() && counter1 == word2.length() ){\n check = true;\n }\n return check;\n }", "public boolean isOneLetterOff(String word1, String word2){\n \tif(word1.equals(word2)){ //all letters same\n \t\treturn false;\n \t}\n \tif(word1.substring(1).equals(word2.substring(1))){\t//all letters same except 1st\n\t\t\treturn true;\n\t\t}\n\t\tif(word1.substring(0,1).equals(word2.substring(0, 1)) && word1.substring(2).equals(word2.substring(2))){ //all letters same except 2nd\n\t\t\treturn true;\n\t\t}\n\t\tif(word1.substring(0,2).equals(word2.substring(0,2)) && word1.substring(3).equals(word2.substring(3))){\t//all letters same except 3rd\n\t\t\treturn true;\n\t\t}\n\t\tif(word1.substring(0,3).equals(word2.substring(0,3)) && word1.substring(4).equals(word2.substring(4))){\t//all letters same except 4th\n\t\t\treturn true;\n\t\t}\n\t\tif(word1.substring(0,4).equals(word2.substring(0,4))){\t//all letters same except 5th\n\t\t\treturn true;\n\t\t}\n \treturn false;\n }", "public int minDistance(String word1, String word2) {\n int N=word1.length(), M=word2.length();\n int[][] dp = new int[N+1][M+1];\n for (int i=0; i<=N; i++) dp[i][0]=i;\n for (int j=0; j<=M; j++) dp[0][j]=j;\n for (int i=1; i<=N; i++) {\n for (int j=1; j<=M; j++) {\n if (word1.charAt(i-1)==word2.charAt(j-1)) {\n dp[i][j]=dp[i-1][j-1];\n } else {\n dp[i][j]=Math.min(dp[i-1][j], dp[i][j-1]) + 1;\n }\n }\n }\n return dp[N][M];\n }", "static String twoStrings(String s1, String s2){\n // Complete this function\n String letters = \"abcdefghijklmnopqrstuvwxyz\";\n for(int i=0;i<letters.length();i++){\n char lettersChar = letters.charAt(i); \n if(s1.indexOf(lettersChar) > -1 && s2.indexOf(lettersChar) > -1){\n return \"YES\";\n }\n }\n \n return \"NO\";\n }", "public boolean isMatch(String str1, String str2) {\n \r\n if( str1 == null || str2 == null)\r\n return false;\r\n \r\n int i = 0;\r\n int j = 0;\r\n char preChar = ' ';\r\n \r\n while( i < str1.length() && j < str2.length() ){\r\n char c1 = str1.charAt(i);\r\n char c2 = str2.charAt(j);\r\n \r\n if( c1 == c2 || c2 == '.' ){\r\n i++;\r\n \r\n preChar = c2;\r\n j++;\r\n }\r\n else{\r\n if( c2 == '*' ){\r\n if( c1 == preChar || preChar == '.' ){\r\n i++;\r\n }\r\n else if( j+1 < str2.length() ){\r\n if( c1 == str2.charAt(j+1) || str2.charAt(j+1) == '.' ){\r\n i++;\r\n \r\n preChar = str2.charAt(j+1);\r\n j = j+2;\r\n }\r\n else\r\n return false;\r\n }\r\n else\r\n return false;\r\n }\r\n else{\r\n if( j+1 < str2.length() && str2.charAt(j+1) == '*' ){\r\n i++;\r\n \r\n preChar = c2;\r\n j = j+2;\r\n } \r\n else\r\n return false;\r\n }\r\n }\r\n }\r\n \r\n if( i == str1.length() ){\r\n if( j == str2.length() )\r\n return true;\r\n else if( str2.charAt(j)=='*' ){\r\n \r\n int countStr1 = 0;\r\n for(int k = str1.length()-1; k >= 0; k--){\r\n if( str1.charAt(k) == preChar )\r\n countStr1++;\r\n else\r\n break;\r\n }\r\n \r\n int countStr2 = 0;\r\n int countStarInStr2 = 0;\r\n for(int k = str2.length()-1; k >= 0; k--){\r\n if( str2.charAt(k) == preChar || str2.charAt(k) == '.' )\r\n countStr2++;\r\n else if( str2.charAt(k) == '*' )\r\n countStarInStr2++;\r\n else\r\n break;\r\n } \r\n \r\n if( countStr2 - countStarInStr2 <= countStr1 )\r\n return true;\r\n else\r\n return false;\r\n }\r\n else\r\n }\r\n else \r\n return false;\r\n }", "public static String findCommonChars(String s1, String s2) {\n s1 = s1.trim().toLowerCase();\n s2 = s2.trim().toLowerCase();\n String fin = \"\";\n if (s1.equals(s2)) {\n return \"\";\n } else {\n for (int i = 0; i < s2.length(); i++) {\n if (s1.contains(s2.charAt(i) + \"\")) {\n s1 = s1.replace(s2.charAt(i) + \"\", \"\");\n s2 = s2.replace(s2.charAt(i) + \"\", \"\");\n }\n }\n\n //fin = s1 + s2;\n return s1+s2;\n\n\n }\n }", "public static boolean matchExactIgnoreCase(String word1, String word2) {\n return word1.equalsIgnoreCase(word2);\n }", "public boolean match(String string1, String string2) {\n\t\tMap<Character, Character>hash_map = new HashMap<Character, Character>();\n\n\t\t//If string length is not same, then it will return false\n\t\tif(string1.length()>string2.length() || string1.length()<string2.length()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tfor(int i=0; i<string1.length(); i++) {\t\n\t\t\tif(!hash_map.containsKey(string1.charAt(i))) {\n\t\t\t\thash_map.put(string1.charAt(i), string2.charAt(i));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(!hash_map.get(string1.charAt(i)).equals(string2.charAt(i))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public int minDistance(String word1, String word2) {\n\n rows = word1.length() + 1;\n cols = word2.length() + 1;\n dp = new int[rows][cols];\n for (int i = 0; i < rows; i++) {\n dp[i][0] = i;\n }\n for (int i = 0; i < cols; i++) {\n dp[0][i] = i;\n }\n\n for (int i = 1; i < rows; i++) {\n for (int j = 1; j < cols; j++) {\n if (word1.charAt(i - 1) == word2.charAt(j - 1)) {\n dp[i][j] = dp[i - 1][j - 1];\n } else {\n dp[i][j] = 1 + Math.min(dp[i - 1][j - 1], Math.min(dp[i][j - 1], dp[i - 1][j]));\n }\n }\n }\n findPath(dp);\n printPath(dp);\n return dp[rows - 1][cols - 1];\n }", "private static int indexOfFirstDifferentChar(@NotNull CharSequence s1, int start1, @NotNull String s2, int start2) {\n boolean ignoreCase = !SystemInfo.isFileSystemCaseSensitive;\n int len1 = s1.length();\n int len2 = s2.length();\n while (start1 < len1 && start2 < len2) {\n char c1 = s1.charAt(start1);\n char c2 = s2.charAt(start2);\n if (!StringUtil.charsMatch(c1, c2, ignoreCase)) {\n return start1;\n }\n start1++;\n start2++;\n }\n return start1;\n }", "public static void main(String[] args) {\n//\n// String pattern = \"abba\";\n// String s = \"dog cat cat fish\";\n\n\n// String pattern = \"aaaa\";\n// String s = \"dog cat cat dog\";\n\n String pattern = \"abba\";\n String s = \"dog dog dog dog\";\n\n// String pattern = \"e\";\n// String s = \"eukera\";\n\n boolean flag = wordPattern(pattern, s);\n\n System.out.println(flag);\n }", "public double getCount(String word1, String word2) {\n double count = 0;\n // YOUR CODE HERE\n if (KnownWord(word1) && KnownWord(word2)) {\n count = bi_grams[NDTokens.indexOf(word1)][NDTokens.indexOf(word2)];\n } else {\n count = smooth ? 1 : 0;\n }\n return count;\n }", "public static int findIndex(String string1, String string2) {\n char c;\n char d;\n int index = -1;\n boolean match = true;\n int count = 1;\n int counter = 0;\n boolean matchFound = false;\n for (int i = 0; i < string2.length(); i++) {\n c = string2.charAt(i);\n if (string2.length() > string1.length()) {\n match = false;\n break;\n }\n // Checks if the characters after the first of string 2 match in string 1\n if (matchFound == true) {\n for (int j = count + counter; j < string1.length(); j++) {\n d = string1.charAt(j);\n if (d != c) {\n \n match = false;\n } else {\n counter++;\n index = j -1;\n matchFound = true;\n break;\n }\n }\n } \n // Checks for the first character in string2 in string1\n if (matchFound == false) {\n for (int k = 0; k < string1.length(); k++) {\n d = string1.charAt(k); \n if (d != c) {\n count ++;\n \n matchFound = false;\n } else {\n index = k;\n matchFound = true;\n break;\n } \n match = true;\n } \n } \n }\n // returns the index number\n return index;\n \n \n }", "public int minDistance_LCS(String word1, String word2) {\n int N=word1.length(), M=word2.length();\n int[][] dp = new int[N+1][M+1];\n for (int i=1; i<=N; i++) {\n for (int j=1; j<=M; j++) {\n if (word1.charAt(i-1)==word2.charAt(j-1)) {\n dp[i][j]=dp[i-1][j-1]+1;\n } else {\n dp[i][j]=Math.max(dp[i-1][j], dp[i][j-1]);\n }\n }\n }\n return N+M-2*dp[N][M];\n }", "public int selectWordTokens (String [] list1, int count1, String [] list2){\n \n int count = 0;\n \n //Runs through each value of list1 grabs the values that align with \"[A-Za-z]+\" and assigns them to list2\n for (int i = 0; i < count1 ; i++){\n if (list1[i].matches(\"[A-Za-z]+\")){\n String Str = list1[i]; \n list2[count]= Str; \n count++;\n }//End if statement\n }//End for loop\n \n return count;\n \n }", "private int scoreTitleMatch(int tag1, int tag2)\n {\n // If they're exactly equal, great.\n if (tag1 == tag2)\n return 100;\n \n // Don't do prefix scanning on short titles.\n String str1 = data.tags.getString(tag1);\n String str2 = data.tags.getString(tag2);\n if (str1.length() < 5 || str2.length() < 5)\n return 0;\n \n // If either is a prefix of the other, we have a match.\n if (str1.startsWith(str2) || str2.startsWith(str1))\n return 100;\n \n // All other cases: fail for now at least.\n return 0;\n }", "private static int matchValue(TrieNode existing, TrieNode toAdd, String[] allWords){\n\t\tSystem.out.println(allWords[existing.substr.wordIndex]);\n\t\tSystem.out.println(allWords[toAdd.substr.wordIndex]);\n\n\t\tString first=allWords[existing.substr.wordIndex].substring(existing.substr.startIndex,existing.substr.endIndex+1);\n\t\tString second=allWords[toAdd.substr.wordIndex].substring(toAdd.substr.startIndex,toAdd.substr.endIndex+1);\n\t\tSystem.out.println(\"Compare: \"+first+ \"\\twith\" +\"\\t\"+ second);\n\t\t\n\t\tint count=1;\n\t\tint matchValue=0;\n\t/*\tif(first.charAt(0)!=second.charAt(0)){\n\t\t\treturn 0;\n\t\t}*/\n\t\t\n\t\t//System.out.println(\"From: \"+ existing.substr.startIndex+\" To: \"+existing.substr.endIndex);\n\t\tif(first.length()<=second.length()){\n\t\t\tint imax=(short)(existing.substr.endIndex-existing.substr.startIndex+1);\n\t\tfor(int i=0;i<imax;i++){\n\t\t\t\n\t\t\t//System.out.println(\"UM WE RUN COUNT: \" );\n\t\t\tif(first.charAt(i)==second.charAt(i)){\n\t\t\t\tmatchValue++;\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(first.charAt(i)!=second.charAt(i)){\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t}\n\t\telse{\n\t\t\tint imax=(short)(toAdd.substr.endIndex-toAdd.substr.startIndex+1);\n\t\t\tfor(int i=0;i<imax;i++){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(first.charAt(i)==second.charAt(i)){\n\t\t\t\t\tmatchValue++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(first.charAt(i)!=second.charAt(i)){\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t}\t\n\t\t}\n\t\treturn matchValue;\n\t}", "public boolean wordPattern2(String pattern, String str) {\n\t\tString[] stra = str.split(\" \");\n if (pattern.length() != stra.length){\n return false;\n }\n HashMap<Character, String> map = new HashMap<Character, String>();\n \n for (int i = 0; i < stra.length; i++){\n Character c = pattern.charAt(i);\n String temp = stra[i];\n if (map.containsKey(c)){\n if (!temp.equals(map.get(c))){\n return false;\n }\n }\n else{\n if (map.containsValue(temp)){\n return false;\n }\n map.put(c, temp);\n }\n }\n return true;\n\t\t\n\t}", "public boolean isMatch2(){\r\n if(str==null ||pattern==null) return false; \r\n boolean[][] match=new boolean[lens+1][lenp+1];\r\n match[0][0]=true; \r\n for (int i = 0; i <lenp; i++) {\r\n if (pattern.charAt(i) == '*' && match[0][i-1]) \r\n match[0][i+1] = true; \r\n }\r\n for (int i = 0 ; i < lens; i++) {\r\n for (int j = 0; j < lenp; j++) {\r\n if (pattern.charAt(j) == '.') {\r\n match[i+1][j+1] = match[i][j];\r\n }\r\n if (pattern.charAt(j) == str.charAt(i)) {\r\n match[i+1][j+1] = match[i][j];\r\n }\r\n if (pattern.charAt(j) == '*') {\r\n if (pattern.charAt(j-1) != str.charAt(i) && pattern.charAt(j-1) != '.') {\r\n match[i+1][j+1] = match[i+1][j-1];\r\n } else {\r\n match[i+1][j+1] = (match[i+1][j] || match[i][j+1] || match[i+1][j-1]);\r\n }\r\n }\r\n }\r\n }\r\n return match[lens][lenp];\r\n }", "public static int minDistanceIteration(String word1, String word2) {\n\n int m = word1.length();\n int n = word2.length();\n\n //op[i][j] 代表word1[0...i-1]与word2[0...j-1]的编辑距离\n int[][] op = new int[m + 1][n + 1];\n\n for (int i = 0; i <= m; i++) {\n op[i][0] = i;\n }\n\n for (int i = 0; i <=n; i++) {\n op[0][i] = i;\n }\n\n for (int i = 1; i <=m; i++) {\n for (int j = 1; j <=n; j++) {\n if (word1.charAt(i-1) == word2.charAt(j-1)) {\n op[i][j] = op[i-1][j-1];\n } else {\n op[i][j] = Math.min(Math.min(op[i-1][j-1], op[i-1][j]), op[i][j-1]) + 1;\n }\n }\n }\n\n return op[m][n];\n }", "public static int numberOfOccurences(String str1,String str2) {\n\tint count=0;\n\tfor (int i=0; i<=str1.length()-str2.length(); i++) {//(int i=0; i<str1.length()-str2.length()+1; i++)\n\t\tString currentString=str1.substring(i,i+str2.length());\n\t //char charChar=str1.charAt(i);//2.solution\n\tif (currentString.equals(str2)) {\n\t\tcount++;\n\t }\n }\n\t\t\n\treturn count;\n}", "public static String findMultipleOccorancesOfGivenWord(String sentence,String word)\n {\n if(sentence == null || word == null || sentence == \"\" || word == \"\"){\n return \"Please enter valid sentence and word.It should not be empty and null\";\n }\n String result = \"\";\n Pattern pattern = Pattern.compile(word);\n Matcher matcher = pattern.matcher(sentence);\n while(matcher.find()) {\n\n result = result + \"Found at:\"+ matcher.start() + \" - \" + matcher.end() + \" \";\n }\n\n return result.trim();\n\n }", "public int minDistance(String word1, String word2) {\n char[] cs1 = word1.toCharArray();\n char[] cs2 = word2.toCharArray();\n int len1 = cs1.length;\n int len2 = cs2.length;\n // if (len1 * len2 == 0) {\n // return Math.max(len1, len2);\n // }\n int[][] min = new int[len1][len2];\n int m = Integer.MAX_VALUE;\n for (int i = 0; i < len1; i++) {\n for (int j = 0; j < len2; j++) {\n m = Integer.MAX_VALUE;\n m = Math.min(getMinDis(min, i, j - 1) + 1, m);\n m = Math.min(getMinDis(min, i - 1, j) + 1, m);\n m = Math.min(getMinDis(min, i - 1, j - 1)\n + (cs1[i] == cs2[j] ? 0 : 1), m);\n min[i][j] = m;\n }\n }\n return getMinDis(min, len1 - 1, len2 - 1);\n }", "public static double getMatchScore(String obj1, String obj2) {\n\tint distance = getLevenshteinDistance(obj1, obj2);\n\tSystem.out.println(\"distance = \" + distance);\n\tdouble match = 1.0 - ((double)distance / (double)(Math.max(obj1.length(), obj2.length())));\n\t\n\tSystem.out.println(\"match is \" + match);\n\treturn match;\n }", "public int minDistance(String word1, String word2) {\n if (word1==null && word2==null)\n return 0;\n if (word1==null)\n return word2.length();\n if (word2==null)\n return word1.length();\n\n int len1 = word1.length()+1;\n int len2 = word2.length()+1;\n int[][] dp = new int[len1][len2];\n for (int i=0; i<len1; i++) {\n dp[i][0] = i;\n }\n for (int j=1; j<len2; j++) {\n dp[0][j] = j;\n }\n for (int i=1; i<len1; i++) {\n char ch1 = word1.charAt(i-1);\n for (int j=1; j<len2; j++) {\n char ch2 = word2.charAt(j-1);\n if (ch1 == ch2) {\n dp[i][j] = dp[i-1][j-1];\n } else {\n int change = dp[i-1][j-1]+1;\n int delete = dp[i-1][j]+1;\n int add = dp[i][j-1]+1;\n int best = change > delete ? delete : change;\n best = best > add ? add : best;\n dp[i][j] = best;\n }\n }\n }\n return dp[len1-1][len2-1];\n }", "public double getcommonPercent(String word1, String word2){\n\t\t// Numerator = letters in common\n\t\t// Denominator = all the letters\n\t\t// Common percent = Numerator/Denominator\n\t\tint Numerator = 0;\n\t\tdouble Denominator = 0.0;\n\t\tdouble commonPercent = 0.0;\n\n\t\tArrayList<Character> myNset = new ArrayList<Character>();\n\t\tmyNset = getNumeratorset(word1, word2);\n\t\tNumerator = myNset.size();\n\n\t\tArrayList<Character> myDset = new ArrayList<Character>();\n\t\tmyDset = getDenominatorset(word1, word2);\n\t\tDenominator = myDset.size();\n\n\t\t// calculate Numerator and Denominator\n\t\tcommonPercent = Numerator/Denominator;\n\n\t\treturn commonPercent;\n\t}", "@Test\n public void wordPatternTest() {\n String pattern = \"aaa\", str = \"aa aa aa aa\";\n boolean ans = instance.wordPattern(pattern, str);\n System.out.println(ans);\n }", "private ArrayList<String> matchingWords(String word){\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tfor(int i=0; i<words.size();i++){\n\t\t\tif(oneCharOff(word,words.get(i))){\n\t\t\t\tlist.add(words.get(i));\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Enter your first word: \");\n String word1 = scan.next();\n System.out.println(\"Enter your second word: \");\n String word2 = scan.next();\n\n char lastLetter = word1.charAt(word1.length()-1);\n char firstLetter = word2.charAt(0);\n if (lastLetter == firstLetter) {\n System.out.println(word1+word2.substring(1));\n }else {\n System.out.println(word1 + word2);\n\n }\n\n\n }", "public static void main(String[] args) {\n String word = \"Computer\";\r\n System.out.println(word.length());\r\nSystem.out.println(word.charAt(0));\r\nSystem.out.println(word.charAt(1));\r\nSystem.out.println(word.charAt(2));\r\nSystem.out.println(word.charAt(3));\r\nSystem.out.println(word.charAt(4));\r\nSystem.out.println(word.charAt(5));\r\nSystem.out.println(word.charAt(6));\r\nSystem.out.println(word.charAt(7));\r\n\r\n//\r\n\r\nString word2 = \"Java\";\r\n if(word2.charAt(0) == 'J');{\r\nSystem.out.println(\"J is first character\");\r\n} \r\n \r\n String word3 = \"civic\";\r\n char first = word3.charAt(0); // index always zero\r\n char last = word.charAt(4); \r\n\r\nif (first == last) {\r\n\tSystem.out.println(\"FIrst and last match\");\r\n} else {\r\n\tSystem.out.println(\" not match\");\r\n}\r\n// always print the last character no matter the length\r\n\r\nString word4 = \"abcdefghijklmnopqrstuvwxyz\";\r\n\r\nchar lastChar = word4.charAt(word4.length()-1);\r\n\r\nSystem.out.println(\"last character of the word \" + word4 + \" is \" + lastChar);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t}", "private int scoreAuthorMatch(int tag1, int tag2)\n {\n // If they're exactly equal, great.\n if (tag1 == tag2)\n return 100;\n \n // Don't do prefix scanning on short titles.\n String str1 = data.tags.getString(tag1);\n String str2 = data.tags.getString(tag2);\n if (str1.length() < 5 || str2.length() < 5)\n return 0;\n \n // If either is a prefix of the other, we have a match.\n if (str1.startsWith(str2) || str2.startsWith(str1))\n return 100;\n \n // All other cases: fail for now at least.\n return 0;\n }", "public static boolean matchFuzzy(String word1, String word2, int threshold) {\n return levenshteinDistance(word1, word1.length(), word2, word2.length()) <= threshold;\n }", "private static boolean matchSearchWord(String word, String matchWord) {\n // The regex is to match words even though they contain special characters.\n // If this wasn't done the function would not match e.g. Java to \"Java\"\n return word.toLowerCase().replaceAll(\"[^a-zA-Z0-9]\", \"\").equals(matchWord.toLowerCase());\n }", "public int minDistance(String word1, String word2) {\n if(word1==null||word1.length()==0){\n return word2==null?0:word2.length();\n }else if(word2==null||word2.length()==0){\n return word1.length();\n }else if(word1.equals(word2)){\n return 0;\n }\n char[] str1 = word1.toCharArray();\n char[] str2 = word2.toCharArray();\n int[] oldl = new int[str2.length+1];\n int[] newl = new int[str2.length+1];\n for(int i=0;i<=str2.length;i++){\n oldl[i]=i;\n }\n for(int i=1;i<=str1.length;i++){\n newl[0]=i;\n for(int j=1;j<=str2.length;j++){\n newl[j]=Math.min(oldl[j]+1,newl[j-1]+1);\n if(str1[i-1]!=str2[j-1]){\n newl[j]=Math.min(oldl[j-1]+1,newl[j]);\n }else{\n newl[j]=Math.min(oldl[j-1],newl[j]);\n }\n }\n for(int k=0;k<=str2.length;k++){\n oldl[k]=newl[k];\n }\n }\n return newl[str2.length];\n }", "public static String contains(String input1, String input2){\n\t\tif((input1 == null && input2 ==null)){\n\t\t\treturn \"yes\";\n\t\t}else if (input1 == null || input2 == null){\n\t\t\treturn \"no\";\n\t\t}\n\t\tchar []input1Arr = input1.toCharArray();\n\t\tchar []input2Arr = input2.toCharArray();\n\t\tint []charMap = new int [256];\n\t\tfor (char ch:input1Arr){\n\t\t\tcharMap[ch] ++;\n\t\t}\n\t\tfor (char ch:input2Arr){\n\t\t\tif(charMap[ch]>=1){\n\t\t\t\tcharMap[ch]--;\n\t\t\t}else {\n\t\t\t\treturn \"no\";\n\t\t\t}\n\t\t}\n\t\treturn \"yes\";\n\t}", "public boolean findPattern(String s1, String s2) {\n\tchar[] chars1 = new char[26];\n\tchar[] chars2 = new char[26];\n\tint[] map = new int[26];\n\tfor (int i = 0; i < s1.length(); i++) {\n\t\tchars1[s1.charAt(i) - 'A']++;\n\t}\n\tfor (int i = 0; i < s2.length(); i++) {\n\t\tchars2[s2.charAt(i) - 'A']++;\n\t\tif (map[] == 0) map[s2.charAt(i) - 'A'] = i;\n\t}\n\tfor (int i = 0; i < 26; i++) {\n\t\tif (chars1[i] > 0 && chars2[i] == 0) return false;\n\t}\n\treturn true;\n}", "public boolean find(T word);", "public boolean match(String word)\n {\n int flags = 0;\n if (ignoreCase)\n {\n flags = flags | Pattern.CASE_INSENSITIVE;\n }\n return Pattern.compile(pattern, flags).matcher(word).find();\n }", "public static int eWordsFirst2Helper(String s1, String s2) {\n\t\tif (s1.charAt(0) == 'e') {\n\t\t\tif (s2.charAt(0) == 'e') {\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else {\n\t\t\tif (s2.charAt(0) == 'e') {\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}", "boolean checkChar(String s1, String s2);", "public boolean search(String word) {\n // 1. 遍历 每个 字母 去掉 从list 里去出来结果 比较list 每个结果\n for (int i = 0; i < word.length(); i++) {\n String key = word.substring(0, i) + word.substring(i+1);\n List<int[]> indexAndCharList = dictonary.getOrDefault(key, new ArrayList<>());\n for (int[] indexAndChar : indexAndCharList) {\n if (indexAndChar[0] == i && indexAndChar[1] != (word.charAt(i) - 'a')) {\n return true;\n }\n }\n }\n return false;\n }", "public static boolean searchWordInTemplateString(TemplateString tStr, String word) {\n\t\tString text = tStr.string;\r\n\t\tint currentIndex = 0;\r\n\t\tfor(int j = 0; j < text.length() && currentIndex < word.length(); j++) {\r\n\t\t\tchar c = text.charAt(j);\r\n\t\t\t// Check uppercase\r\n\t\t\tif(c >= 'A' && c <= 'Z') c = (char) (c + 'a' - 'A');\r\n\t\t\t// Check if equal to current word char\r\n\t\t\tif(c == word.charAt(currentIndex)) {\r\n\t\t\t\t// If last index then the word exists in template\r\n\t\t\t\tif(currentIndex == word.length() - 1) return true;\r\n\t\t\t\t// Otherwise add one to index\r\n\t\t\t\tcurrentIndex++;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif(currentIndex > 0 && ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'))) {\r\n\t\t\t\t// If the char was alphanumerical but unequal, the word train was broken..\r\n\t\t\t\tcurrentIndex = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private static boolean findCharInWord(String word, char charToFind) {\n boolean found=false;\n\n for (char c : word.toCharArray()) {\n if (c == charToFind) {\n found = true;\n break;\n }\n }\n return found;\n }", "public int searchWord(File filePath, String s1) throws IOException, NullPointerException\r\n\t{\r\n\t\tint counter = 0;\r\n\t\tString data = \"\";\r\n\t\tBufferedReader bufferReader = new BufferedReader(new FileReader(filePath));\r\n\t\tString line = null;\r\n\t\twhile ((line = bufferReader.readLine()) != null)\r\n\t\t{\r\n\t\t\tdata = data + line;\r\n\t\t}\r\n\t\tbufferReader.close();\r\n\t\tString txt = data;\r\n\t\tBoyerMoore bm = new BoyerMoore(s1);\r\n\t\tint offset = 0;\r\n\t\tfor (int loc = 0; loc <= txt.length(); loc += offset + s1.length())\r\n\t\t{\r\n\t\t\t offset = bm.search(s1, txt.substring(loc));\r\n\t\t\t if ((offset + loc) < txt.length())\r\n\t\t\t { \r\n\t\t\t\t counter++; \r\n\t\t\t\t System.out.printf(\"The word '\"+s1 +\"' is present at the position \" + (offset + loc)+\"\\n\"); //printing position of word \r\n\t\t\t } \r\n\t\t}\r\n\t\tif(counter!=0)\r\n\t\t{ \r\n\t\t\t System.out.println(\" In the FILE: \"+filePath.getName()+\"\\n\");\r\n\t\t}\r\n\t\treturn counter; \r\n\t}", "public boolean wordPattern(String pattern, String str) {\n Map<Character, String> c2s = new HashMap<Character, String>();\n Map<String, Character> s2c = new HashMap<String, Character>();\n String [] sArr = str.split(\" \");\n if(pattern.length() != sArr.length) return false;\n int len = pattern.length();\n for(int i = 0; i <= len - 1; i ++){\n char c = pattern.charAt(i);\n String s = sArr[i];\n // For a given (c, s) pair, we need result to contain two mappings (c->s and s->c), check if \n // mapping from c, s exist and map to different targets (which violates one-one mapping)\n if((c2s.containsKey(c) && !c2s.get(c).equals(s)) || (s2c.containsKey(s) && s2c.get(s) != c))\n return false;\n if(!c2s.containsKey(c)){\n c2s.put(c, s);\n s2c.put(s, c);\n }\n }\n \n return true;\n }", "static int countOccurrences(String str, String word) \r\n\t\t{\n\t\t String a[] = str.split(\" \");\r\n\t\t \r\n\t\t // search for pattern in a\r\n\t\t int count = 0;\r\n\t\t for (int i = 0; i < a.length; i++) \r\n\t\t {\r\n\t\t // if match found increase count\r\n\t\t if (word.equals(a[i]))\r\n\t\t count++;\r\n\t\t }\r\n\t\t \r\n\t\t return count;\r\n\t\t}", "static String abbreviation(String a, String b) {\r\n \r\n HashSet<Character> aSet = new HashSet<>();\r\n\r\n for(int i = 0 ; i< a.length() ; i++){\r\n aSet.add(a.charAt(i));\r\n }\r\n \r\n for(int i = 0 ; i < b.length() ; i++){\r\n \r\n if(aSet.contains(b.charAt(i)) ){\r\n aSet.remove(b.charAt(i));\r\n }\r\n else if(aSet.contains(Character.toLowerCase(b.charAt(i)))){\r\n aSet.remove(Character.toLowerCase(b.charAt(i)));\r\n }\r\n else{\r\n return \"NO\";\r\n }\r\n \r\n\r\n }\r\n\r\n Iterator<Character> it = aSet.iterator();\r\n while(it.hasNext()){\r\n\r\n if(!isLowerCase(it.next())){\r\n return \"NO\";\r\n }\r\n }\r\n return \"YES\";\r\n \r\n /*\r\n String regex = \"\";\r\n for(int i = 0 ; i < b.length() ; i++){\r\n regex += \"[a-z]*\" + \"[\" + b.charAt(i) + \"|\" + Character.toLowerCase(b.charAt(i)) + \"]\";\r\n }\r\n regex += \"[a-z]*\";\r\n Pattern ptrn = Pattern.compile(regex);\r\n Matcher matcher = ptrn.matcher(a);\r\n\r\n return matcher.matches() ? \"YES\" : \"NO\";\r\n*/\r\n \r\n /*\r\n int aPtr = 0;\r\n\r\n //b e F g H\r\n // E F H\r\n for(int i = 0 ; i < b.length() ; i++){\r\n\r\n if(aPtr + 1 >= a.length())\r\n return \"NO\";\r\n //if(aPtr + 1 == a.length() && i + 1 == b.length())\r\n // return \"YES\";\r\n\r\n System.out.println(b.charAt(i) + \" \" + a.charAt(aPtr));\r\n if(b.charAt(i) == a.charAt(aPtr)){\r\n aPtr++;\r\n }else if(b.charAt(i) == Character.toUpperCase(a.charAt(aPtr)) && isLowerCase(a.charAt(aPtr))){\r\n aPtr++;\r\n\r\n } else if(b.charAt(i) != a.charAt(aPtr) && !isLowerCase(a.charAt(aPtr))){\r\n return \"NO\";\r\n }else if(b.charAt(i) != a.charAt(aPtr) && isLowerCase(a.charAt(aPtr))){\r\n aPtr++;\r\n i--;\r\n }\r\n\r\n\r\n\r\n }\r\n for(int i = aPtr ; i < a.length() ; i++){\r\n if(!isLowerCase(a.charAt(i)))\r\n return \"NO\";\r\n }\r\n\r\n return \"YES\";\r\n */\r\n\r\n }", "static String doit(final String string1, final String string2) {\n String shorterString; // a\n String longerString; // b\n if (string1.length() > string2.length()) {\n shorterString = string2;\n longerString = string1;\n } else {\n longerString = string2;\n shorterString = string1;\n }\n String r = \"\";\n\n for (int i = 0; i < shorterString.length(); i++) {\n for (int j = shorterString.length() - i; j > 0; j--) {\n for (int k = 0; k < longerString.length() - j; k++) {\n if (shorterString.regionMatches(i, longerString, k, j) && j > r.length()) {\n r = shorterString.substring(i, i + j);\n }\n }\n } // Ah yeah\n }\n return r;\n\n }", "static boolean isMatchingPair(char character1, char character2) \n { \n if (character1 == '(' && character2 == ')') \n return true; \n else if (character1 == '{' && character2 == '}') \n return true; \n else if (character1 == '[' && character2 == ']') \n return true; \n else\n return false; \n }", "private int parseWord(Token token, char[] buffer, int offset, int type){\nfromStart:\n for(int i=offset; i<buffer.length; ++i){\n for(int x=0; x < characters[type].length; ++x){\n if(buffer[i] == characters[type][x]){\n token.identifier += buffer[i];\n continue fromStart;\n }\n }\n // If it gets here, the character currently parsed isn't of the same type \n return i;\n }\n // Found end of file\n return offset+buffer.length;\n }", "int partDist(String w1, String w2, int w1len, int w2len) {\n // To remember previous state\n int [][] matrix = new int [w1len + 1][w2len +1];\n for(int i = 0; i <= w1len; i++){\n for(int j = 0; j <= w2len; j++){\n // If word 1 is empty\n if(i == 0)\n matrix[i][j] = j;\n // If word 2 is empty\n else if(j == 0)\n matrix[i][j] = i;\n\n // if the previous letter are the same\n else if(w1.charAt(i-1) == w2.charAt(j-1))\n matrix[i][j] = matrix[i-1][j-1];\n /*\n remove one letter matrix[i][j-1]\n add one letter matrix[i-1][j]\n change letter matrix[i-1][j-1]\n */\n else\n matrix[i][j] = 1 + min(matrix[i][j-1], matrix[i-1][j], matrix[i-1][j-1]);\n }\n }\n\n return matrix[w1len][w2len];\n }", "private int getUseOfLetter(String word) {\n int result = 0;\n for (int i = 0; i < word.length(); i++) {\n result |= tables[word.charAt(i)];\n }\n return result;\n }", "static int isSubstring(String s1, String s2) {\n int m = s1.length();\n int n = s2.length();\n\n // A loop to slide pat[] one by one\n for (int i = 0; i <= n - m; i++) {\n int j;\n\n // For current index i, check for pattern match\n for (j = 0; j < m; j++) {\n if (s2.charAt(i + j) != s1.charAt(j)) {\n break;\n }\n }\n\n if (j == m) {\n return i;\n }\n }\n return -1;\n }", "private int commonLength( int i0, int i1 )\n {\n \tint n = 0;\n \twhile( (text[i0] == text[i1]) && (text[i0] != STOP) ){\n \t i0++;\n \t i1++;\n \t n++;\n \t}\n \treturn n;\n }", "public boolean isMatch(String inpWord, String targetWord){\n if (targetWord.contains(\"*\")){\n //do regexp compare of strings\n //String escapeMask=targetWord.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\");\n String regexString=targetWord.replace(\"*\", \".*\");\n boolean test=inpWord.matches(\"(?i:\"+regexString+\")\");\n if (test){\n Log.i(\"ABTest\",\"wildcard match inp is \"+inpWord +\" and tgt word is \"+targetWord);\n }\n return test;\n } else {\n if (inpWord.equalsIgnoreCase(targetWord)){\n Log.i(\"ABTest\",\"exact match inp is \"+inpWord +\" and tgt word is \"+targetWord);\n return true;\n } else {\n return false;\n }\n }\n }", "private String keywordFound(){\r\n\t\tString rtn = \"\";\r\n\t\tString tmp = \"\";\r\n\t\tint carr_pos = getCaretPosition();\r\n\t\t//estract part of text for keyword search\r\n\t\ttry { \r\n\t\tif(carr_pos>50)\r\n\t\t\ttmp = doc.getText(carr_pos-50,50);\r\n\t\telse\r\n\t\t\ttmp = doc.getText(0,carr_pos);\r\n\t\t}catch(BadLocationException a){\r\n\t\t\tSystem.out.println(\"exception\");\r\n\t\t\treturn rtn;\r\n\t\t};\r\n\t\t//Start check\r\n\t\tint i = 0;\r\n\t\tif(tmp.length() >= 2)i = tmp.length()-2;\t\r\n\t\twhile(checkOperator(tmp.charAt(i)) && i > 0){\r\n\t\t\trtn += tmp.charAt(i);\r\n\t\t\ti--;\r\n\t\t}\r\n\t\tif(i == 0)rtn += tmp.charAt(i);\t\t\r\n\t\treturn mirrorString(rtn);\r\n\t}", "private boolean translateWith2ExchangedChars(String input1, String input2) {\n if (StringUtils.isBlank(input1) || StringUtils.isBlank(input2) || input1.length() != input2.length()) {\n return false;\n }\n if (input1.equals(input2)) {\n for (int i = 0; i < input1.length(); i++) {\n char current = input1.charAt(i);\n if (input1.lastIndexOf(current) != i) {\n return true;\n }\n }\n return false;\n } else {\n int first = -1, second = -1;\n for (int i = 0; i < input1.length(); i++) {\n if (input1.charAt(i) != input2.charAt(i)) {\n if (first == -1) {\n first = i;\n } else if (second == -1) {\n second = i;\n } else {\n return false;\n }\n }\n }\n return input1.charAt(first) == input2.charAt(second)\n && input1.charAt(second) == input2.charAt(first);\n }\n }", "public double getSimilarityMetric(String word1, String word2) {\n\t\t// given two words, this function computes two measures of similarity\n\t\t// and returns the average\n\t\tint l1 = word1.length();\n\t\tint l2 = word2.length();\n\t\tint lmin = Math.min(l1, l2);\n\t\tint leftSimilarity = 0;\n\t\tint rightSimilarity = 0;\n\n\t\t// calculate leftSimilarity\n\t\tfor(int i = 0; i < lmin; i++) {\n\t\t\tif(word1.charAt(i) == word2.charAt(i)) {\n\t\t\t\tleftSimilarity += 1;\n\t\t\t}\n\t\t}\n\n\t\t// calculate rightSimilarity\n\t\tfor(int j = 0; j < lmin; j++) {\n\t\t\tif(word1.charAt(l1-j-1) == word2.charAt(l2-j-1)) {\n\t\t\t\trightSimilarity += 1;\n\t\t\t}\n\t\t}\n\t\treturn (leftSimilarity + rightSimilarity)/2.0;\n\t}", "public boolean closeString(String word1, String word2) {\n\n \n }", "public int shortest(String word1, String word2) {\n List<Integer> first = map.get(word1);\n List<Integer> second = map.get(word2);\n int result = Integer.MAX_VALUE ;\n for(int i = 0, j = 0 ; i < first.size() && j < second.size();)\n result = first.get(i) < second.get(j) ? Math.min(result,second.get(j) - first.get(i++)) : Math.min(result,first.get(i) - second.get(j++)) ;\n return result;\n }", "private static void abs(String word2) {\n\n\t}", "private String searchString(String inWord)\n {\n String line = null;\n StringBuffer rtn = new StringBuffer();\n int len = inWord.length();\n boolean found = false;\n\n if(len == 1)\n {\n if(Character.isDigit(inWord.charAt(0)))\n {\n rtn.append(inWord).append(\"I\");\n found = true;\n } // fi\n\n else if(Character.isLetter(inWord.charAt(0)))\n {\n rtn.append(inWord.toLowerCase()).append(\"S\");\n found = true;\n } // else fi\n } // fi\n\n if(!found)\n {\n int\tnum_A = 0; // Upper case\n int\tnum_L = 0; // Lower case\n int\tnum_N = 0; // Numbers\n int\tnum_P = 0; // Punctuation (numeric)\n int\tnum_Q = 0; // Quotes\n int\tnum_O = 0; // Other\n char last_ch = ' ';\n\n for(int i = 0; i < len; i++)\n {\n if((i == 0) && (inWord.charAt(i) == '-'))\n num_L++;\n\n else if(Character.isLowerCase(inWord.charAt(i)))\n num_L++;\n\n else if(Character.isUpperCase(inWord.charAt(i)))\n num_A++;\n\n else if(Character.isDigit(inWord.charAt(i)))\n num_N++;\n\n else if((inWord.charAt(i) == '=')||(inWord.charAt(i) == ':') ||\n (inWord.charAt(i) == '+')||(inWord.charAt(i) == '.') ||\n (inWord.charAt(i) == ','))\n num_P++;\n\n else if((inWord.charAt(i) == '\\'') ||\n (inWord.charAt(i) == '`') || (inWord.charAt(i) == '\"'))\n num_Q++;\n\n else\n num_O++;\n\n last_ch = inWord.charAt(i);\n } // for\n\n int pos = 0;\n if((len - ntail) > 0)\n pos = len - ntail;\n\n rtn.append(inWord.substring(pos).toLowerCase());\n\n if((num_L + num_Q) == len)\n rtn.append(\"\");\n\n else if((num_A + num_Q) == len)\n rtn.append(\"A\");\n\n else if((num_N + num_P + num_Q) == len)\n rtn.append(\"N\");\n\n else if((num_L + num_A + num_Q) == len)\n rtn.append(\"B\");\n\n else if((num_A + num_N + num_P + num_Q) == len)\n rtn.append(\"C\");\n\n else if((num_L + num_N + num_P + num_Q) == len)\n rtn.append(\"E\");\n\n else if((num_A + num_L + num_N + num_P + num_Q) == len)\n rtn.append(\"D\");\n\n else if((num_O == 0) && (last_ch == '+'))\n rtn.append(\"F\");\n\n else\n rtn.append(\"O\");\n } // else\n\n rtn.append(\"_\");\n\n return(rtn.toString());\n }", "public int minDistance(String word1, String word2) {\n return word1.length() + word2.length() - 2 * lcs(word1, word2);\n }", "private int lcs(String word1, String word2) {\n int m = word1.length();\n int n = word2.length();\n int[][] dp = new int[m + 1][n + 1];\n //mem[i][j] means the LCS length formed by A[:i] and B[:j]\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n if (word1.charAt(i) == word2.charAt(j)) {\n dp[i + 1][j + 1] = dp[i][j] + 1;\n } else {\n dp[i + 1][j + 1] = Math.max(dp[i + 1][j], dp[i][j + 1]);\n }\n }\n }\n return dp[m][n];\n }", "public int minDistance(String word1, String word2) {\n int[][] mem = new int[word1.length() + 1][word2.length() + 1];\n for (int[] row : mem) Arrays.fill(row, -1);\n mem[word1.length()][word2.length()] = 0;\n return minDist(word1, 0, word2, 0, mem);\n }", "private void findMatch()\n {\n if (this.matchLen > 0) \n {\n this.matchLen += ((this.matchLen - MAX_LENGTH) >>> 31);\n this.matchPos++;\n } \n else \n {\n // Retrieve match position\n this.matchPos = this.hashes[this.hash];\n\n // Detect match\n if ((this.matchPos != 0) && (this.pos - this.matchPos <= MASK2))\n {\n int r = this.matchLen + 1;\n\n while ((r <= MAX_LENGTH) && (this.buffer[(this.pos-r) & MASK2] == this.buffer[(this.matchPos-r) & MASK2])) \n r++;\n\n this.matchLen = r - 1;\n }\n } \n }", "public boolean search(String word) {\n char [] words=word.toCharArray();\n CharTree t=root;\n for (char c : words) {\n t=t.next[c-97];\n if(t==null)return false;\n }\n if (!t.isend)return false;\n return true;\n }", "public boolean search(String word) {\n TrieTree point = root;\n for(int i = 0; i < word.length(); i++){\n char ch = word.charAt(i);\n if(point.getChild(ch - 'a') == null) return false;\n point = point.getChild(ch - 'a');\n }\n return point.getIsWord();\n }", "private String findFrom(String from) {\n\t\tPattern UNIT = Pattern.compile(\"^\\\\w+.\\\\w+(?=\\\\ )\"); // Match two words\n\t\tMatcher m = UNIT.matcher(from);\n\t\twhile (m.find()) {\n\t\t\tfrom = m.group(0);\n\t\t}\n\t\treturn from;\n\t}", "List<Integer> wordFinder(String text, String word) {\n\n List<Integer> indexes = new ArrayList<Integer>();\n String wordProper = \" \" + word + \" \";\n\n int index = 0;\n\n while (index != -1) {\n\n index = text.indexOf(wordProper, index);\n\n if (index != -1) {\n indexes.add(index);\n index++;\n }\n }\n\n return indexes;\n }", "public static void main(String[] args) {\nString a=new String(\"now is\");\r\nString b=new String(\"the time\");\r\nString c=new String(\"the\");\r\n\r\n//find the length of first string\r\n\r\nSystem.out.println(a.length());\r\n\r\n//find the character in index 4 of first String\r\n\r\nSystem.out.println(a.charAt(4));\r\n\r\n//find the characters from index 2 to 5\r\n\r\nSystem.out.println(a.substring(2, 5));\r\n\r\n//check second String Start with \"the\" (true/false)\r\n\r\nSystem.out.println(b.startsWith(\"the\"));\r\n\r\n//get the Starting index of \"is\" from the first String\r\n\r\nSystem.out.println(a.indexOf(\"is\"));\r\n\r\n//concat 2 Strings\r\n\r\nSystem.out.println(a.concat(\" \"+c));\r\n\r\n//Replace the letter in the String\r\n\r\nSystem.out.println(b.replace(\"t\",\"T\"));\r\n\r\n//Split the words into Array.And print them\r\n\r\nString word[]=a.split(\" \");\r\nfor(int i=0;i<word.length;i++)\r\n{\r\n\tSystem.out.print(\"{\"+word[i]+\"}\");\r\n}\r\n\r\n//check both Strings are equal (true/false)\r\n\r\nSystem.out.println(\"\\n\"+b.equals(c));\r\n\r\n\t}", "public static void main(String[] args) {\n String name = \"I love Java I Love Java Java Java\";\n System.out.println(\"starting from 0 \" +name.indexOf(\"Java\"));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 7));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 8));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 9));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 19));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 20));\n // ilk java gosterecek yani location of// simdi ise ikinci javayi ariyor +1 ile! (ava I Love )\n //or you can start here + 4 nereden biliyorum +4 cunku\n //java 4 character!!!!!!!!!!! yada ilk aradigin kelimeyi\n // bitiri bitirmez +1 koyarsin eger bilmiyorsam +word.lenght();\n\n int firstJavaLocation = name.indexOf(\"Java\");\n int startingPointToSearchSecondJava = firstJavaLocation+1;\n int secondJavaLocation = name.indexOf(\"Java\",startingPointToSearchSecondJava);\n System.out.println(\"secondJavaLocation = \" + secondJavaLocation);\n //eger cumlede nekadar kelime oldugunu bilmiyorsam I only know there are 3+ words\n // ve sadece ikinci kelimeyi biliyorsam;\n //the word in between first space and second space is second word\n int firstSpaceLocation = name.indexOf(\" \");\n int secondSpace = name.indexOf(\" \", firstJavaLocation + 1);\n System.out.println(\"second word in this sentence is \"\n +name.substring(firstJavaLocation + 1, secondSpace));\n\n\n\n\n }", "public static int levenshtein(String a, String b) {\n a = a.toLowerCase();\n b = b.toLowerCase();\n\n if (a.equals(b)) {\n return 0;\n }\n\n return lev(a, b, a.length(), b.length());\n }", "private Boolean solution(String s1, String s2){\n\t\t\n\t\tint k = s1.length();\n\t\tchar[] input1 = s1.toCharArray();\n\t\t\n\t\tint m =0 ,count=0;\n\t\t\n\t\twhile(m < s2.length()-1){\n\t\t\t\n\t\tchar[] temp1 = s2.substring(m, m+k).toCharArray();\n\t\t\t\n\t\t\tfor(int i=0; i<s1.length(); i++){\n\t\t\t\tfor(int j=0; j<s1.length(); j++){\n\t\t\t\t\tif(input1[i] == temp1[j] ){\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tif(count == s1.length())\n\t\t\t\treturn true;\n\t\tcount =0;\n\t\tm++;\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "java.lang.String getWord();", "public int shortestWordDistance(String[] words, String word1, String word2) {\n int indexWord1 = -1;\n int indexWord2 = -1;\n boolean flag = word1.equals(word2);\n \n int distance = Integer.MAX_VALUE;\n for (int i = 0; i < words.length; i++) {\n if (words[i].equals(word1)) {\n if(flag){ // 如果两个词相同 则只更新一个index 因为index2之后还会更新一次 相当于排除了之后那个word2的判断\n indexWord1 = indexWord2;\n indexWord2 = i;\n } else {\n indexWord1 = i;\n }\n }\n \n if (words[i].equals(word2)) {\n indexWord2 = i;\n }\n if (indexWord1 >= 0 && indexWord2 >= 0) {\n distance = Math.min(distance, Math.abs(indexWord2 - indexWord1));\n }\n }\n return distance;\n }", "public int compare(String wordA, String wordB) \n\t\t{\n\t\t\t//if the first word length is greater than the\n\t\t\t//second word length\n\t\t\tif (wordA.length() > wordB.length())\n\t\t\t{\n\t\t\t\t//return -1\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\t\n\t\t\t//if word a is less than word b\n\t\t\telse if (wordA.length() < wordB.length())\n\t\t\t{\n\t\t\t\t//return 1\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t\n\t\t\t//otherwise\n\t\t\telse\n\t\t\t{\n\t\t\t\t//compare the word and return\n\t\t\t\treturn wordB.compareTo(wordA);\n\t\t\t}\n\t\t}", "public int DeleteOperationforTwoStrings(String word1, String word2)\n\t{\n\t\tint n1 = word1.length();\n int n2 = word2.length();\n int[][] dp = new int[n1 + 1][n2 + 1];\n for(int i = 1; i <= n1; i ++)\n {\n for(int j = 1; j <= n2; j ++)\n {\n dp[i][j] = word1.charAt(i - 1) == word2.charAt(j - 1) ? \n dp[i - 1][j - 1] + 1 : Math.max(dp[i - 1][j], dp[i][j - 1]);\n }\n }\n return n1 + n2 - 2 * dp[n1][n2];\n\t}", "@Test \r\n public void shouldFindOneWordAtTheEnd() {\r\n \r\n String inputWord = \"bxxxxxxxe\";\r\n String[] dictionary =\r\n new String[] {\"able\", \"be\", \"ale\", \"apple\", \"bale\", \"kangaroo\"};\r\n \r\n assertEquals(\"be\", wordSeeker.lookFor(inputWord, dictionary));\r\n }", "public static void main(String args[]) {\n Scanner in=new Scanner(System.in);\n String str1=in.nextLine();\n String str2=in.nextLine();\n int slen1=str1.length();\n \n int slen2=str2.length();\n int count=0;\n for(int i=0;i<(slen1-slen2+1);i++)\n {\n int num=1;\n for(int j=0;j<slen2;j++)\n {\n if(str1.charAt(i+j)!=(str2.charAt(j)))\n {\n num=0;\n }\n \n } \n if(num==1)\n {\n count++;\n }\n \n }\n System.out.println(count); \n }", "public void strComp() {\n\t\tSystem.out.printf(\"total word: %d\", userstring.size());\n\t\tint i = 0, j = 0, k = 0;\n\t\twhile (i < userstring.size() ) {\n\t\t\tif (userstring.get(i++).equalsIgnoreCase(masterString.get(j++))) {\n\t\t\t\t// user said correct word. update the array and total number of\n\t\t\t\t// matches\n\t\t\t\tmatchValues[k] = true;\n\t\t\t\ttotalCorrectMatches++;\n\t\t\t} \n\t\t\tk++;\n\t\t}\n\n\t}", "private static int coutSubst(char c1, char c2)\n {\n if (c1 == c2) return 0;\n return 1;\n }", "public int minDistance(String word1, String word2) {\n int m=word1.length();\n int n=word2.length();\n \n int dp[][]=new int[m+1][n+1];\n \n for(int i=0;i<m+1;i++){\n for(int j=0;j<n+1;j++){\n //if first string is empty then only option is add all chars from second\n if(i==0)\n dp[i][j]=j;\n \n //if second string is empty then only option is remove all chars from 1st\n else if(j==0)\n dp[i][j]=i;\n //do nothing and copy from diagonal ie. ignore \n else if(word1.charAt(i-1)==word2.charAt(j-1))\n dp[i][j]=dp[i-1][j-1];\n else\n {\n //insert , //remove // replace\n dp[i][j]=1+Math.min(dp[i][j-1], Math.min(dp[i-1][j], dp[i-1][j-1]));\n }\n }\n }\n return dp[m][n];\n }", "boolean hasWord();" ]
[ "0.63043916", "0.6295992", "0.6241409", "0.620911", "0.61718917", "0.613919", "0.6131333", "0.61027753", "0.609594", "0.60806817", "0.60584277", "0.5946861", "0.5929324", "0.5905111", "0.5898448", "0.58534324", "0.5852299", "0.5846741", "0.5837431", "0.5831951", "0.5829448", "0.5803528", "0.58001846", "0.5789839", "0.57819676", "0.5774048", "0.5732501", "0.5728738", "0.5728618", "0.571764", "0.57168293", "0.57116866", "0.57103765", "0.5697393", "0.56968284", "0.5686742", "0.56864965", "0.567673", "0.5647292", "0.5616789", "0.56162256", "0.55808175", "0.5550649", "0.5550469", "0.5549103", "0.5544224", "0.5533998", "0.55317783", "0.5517936", "0.5517502", "0.55171746", "0.5515913", "0.5510946", "0.5500019", "0.5483543", "0.54791915", "0.5477304", "0.5477104", "0.54769003", "0.5474182", "0.5467541", "0.5460798", "0.5454161", "0.5432625", "0.54325396", "0.54303217", "0.54278207", "0.54265916", "0.54199433", "0.5419923", "0.5418306", "0.54181564", "0.541631", "0.5395698", "0.5392694", "0.5380799", "0.5378969", "0.5376271", "0.5361521", "0.5355644", "0.5345715", "0.5342739", "0.5342154", "0.5341413", "0.53406346", "0.53382754", "0.53370625", "0.5328652", "0.53250444", "0.5316666", "0.5312613", "0.5309395", "0.5304179", "0.5300479", "0.5296397", "0.52909535", "0.5289699", "0.52868223", "0.52799314", "0.52669346" ]
0.7121681
0
registration of the requested service
void start() { m_e.step(); // 1, 3 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void registerService(String serviceName, Object service);", "public void onServiceRegistered() {\r\n \t// Nothing to do here\r\n }", "public void registerService(Registrant r) {\n namingService.registerService(r);\n }", "private void registerService() {\r\n DFAgentDescription desc = new DFAgentDescription();\r\n desc.setName(getAID());\r\n ServiceDescription sd = new ServiceDescription();\r\n sd.setType(SERVICE_TYPE);\r\n sd.setName(SERVICE_NAME);\r\n desc.addServices(sd);\r\n try {\r\n DFService.register(this, desc);\r\n } catch (FIPAException e) {\r\n e.printStackTrace(System.err);\r\n }\r\n }", "protected final void registerService(Object service){\n ModuleManager.getInstance().regService(this.moduleName,service);\n }", "public void register(){\n }", "public void registerServer() {\n log.info(\"Registering service {}\", serviceName);\n cancelDiscovery = discoveryService.register(\n ResolvingDiscoverable.of(new Discoverable(serviceName, httpService.getBindAddress())));\n }", "ServiceRegistry() {\n mRegistrations = new TreeMap<String, ServiceFactory>();\n }", "public abstract void register();", "public void registerService(String serviceName){\n jmc.registerService(serviceName);\n }", "protected abstract ServiceRegistry getNewServiceRegistry();", "@Override\r\n\tpublic void register() {\n\t\t\r\n\t}", "private void register() {\n Intent registrationIntent = new Intent(REQUEST_REGISTRATION_INTENT);\n registrationIntent.setPackage(GSF_PACKAGE);\n registrationIntent.putExtra(\n EXTRA_APPLICATION_PENDING_INTENT, PendingIntent.getBroadcast(context, 0, new Intent(), 0));\n registrationIntent.putExtra(EXTRA_SENDER, senderId);\n context.startService(registrationIntent);\n }", "@Override\r\n public <T> void registerService(Class<T> clazz, Object implementation) {\r\n synchronized (serviceRegistrations) {\r\n serviceRegistrations.add(bundleContext.registerService(clazz.getName(), implementation, null));\r\n }\r\n }", "public void register(RegistrationData d) {}", "@Override\n public void register() {\n }", "private void registerWithService() {\n\n try {\n\n Message msg = Message.obtain(null, TallyDeviceService.MSG_REGISTER_MESSAGE_ACTIVITY);\n if (msg == null) { return; }\n msg.obj = this;\n msg.replyTo = messenger;\n service.send(msg);\n\n } catch (Exception e) {\n Log.e(LOG_TAG, \"Line 306 :: \" + e.getMessage());\n service = null;\n }\n\n }", "void register( ServiceDescription sd) {\r\n DFAgentDescription dfd = new DFAgentDescription();\r\n dfd.setName(getAID());\r\n\r\n try {\r\n DFAgentDescription list[] = DFService.search( this, dfd );\r\n if ( list.length>0 )\r\n DFService.deregister(this);\r\n\r\n dfd.addServices(sd);\r\n DFService.register(this,dfd);\r\n }\r\n catch (FIPAException fe) { fe.printStackTrace(); }\r\n }", "public void registerWithServer();", "static void register() {\n }", "void register();", "public void service() {\n\t}", "@Override\n\tpublic void loadService() {\n\t\t\n\t}", "private void registerWithNotificationHubs() {\n Intent intent = new Intent(this, RegistrationIntentService.class);\n startService(intent);\n }", "public boolean registersService() {\n return this.sr.registersService(this.m_oService);\n }", "public interface RegisterService {\n String registJudge(String userName,String password);\n\n}", "@Autowired\n\tpublic void setRegistratorService (RegistratorService registratorService) {\n\t\tthis.registratorService = registratorService;\n\t}", "void addService(ServiceInfo serviceInfo);", "public interface ServiceRegistry {\n\n /**\n * Add a service into the registry.\n *\n * @param serviceInfo\n */\n void addService(ServiceInfo serviceInfo);\n\n /**\n * Gets the interval in second of heartbeats.\n *\n * @return\n */\n int getHeartbeatInterval();\n\n /**\n * Sets the interval in second of heartbeats.\n *\n * @param interval\n */\n void setHeartbeatInterval(int interval);\n\n void run();\n\n void stop();\n}", "public interface RegisterService {\n\n /**\n * 获取验证码\n * @param para\n * @return\n */\n RegisterResult getPictureCode(RegisterEnter para);\n /**\n * 注册用户\n * @param para\n * @return\n */\n RegisterResult registerUser(RegisterEnter para);\n\n\n /**\n * 个人用户注册设置密码\n * @param para\n * @return\n */\n @Role\n RegisterResult register_person(RegisterEnter para);\n\n /**\n * 插入注册推荐人公司信息\n * @param dept\n */\n void insertReferrerDept(String dept,String mobileNo);\n}", "private void initService() {\r\n\t}", "@Override\n public RouterRegistry getService(Bundle bundle,\n ServiceRegistration<RouterRegistry> registration) {\n logger.debug(\"getService RouterRegistryService {}\", bundle);\n return new RouterRegistryServiceImpl(bundle, this);\n }", "public abstract T addService(ServerServiceDefinition service);", "private static interface Service {}", "public interface IResteasyService {\r\n\t\r\n\t/**\r\n\t * Service name inside OSGi namespace service registration.\r\n\t */\r\n\tpublic static final String SERVICE_NAME = ResteasyService.class.getName();\r\n\r\n\t/**\r\n\t * Add a SingletonResource.\r\n\t * @param resource\r\n\t */\r\n\tpublic void addSingletonResource(Object resource);\r\n\t\r\n\t/**\r\n\t * Remove a SingletonResource.\r\n\t * @param clazz\r\n\t */\r\n\tpublic void removeSingletonResource(Class<?> clazz);\r\n\r\n}", "public void register(IObserver obj);", "public BusinessService register(BusinessService service) {\n\t\treturn register(service, this.getUDDINode().getApiNode());\n\t}", "boolean addServiceSubscriber(Service service, Subscriber subscriber);", "public Object register(HttpServletRequest req);", "Service newService();", "private void registerGCM()\n {\n Intent intent = new Intent(this, GcmIntentService.class);\n intent.putExtra(\"key\", \"register\");\n startService(intent);\n }", "<T> void registerService(\n T service,\n Class<T> serviceKlass,\n @Nullable Map<String, Function<Object, Object>> resultProcessor\n );", "public interface RegistrationService {\n\n\t/**\n\t * Return the stored registration information.\n\t *\n\t * @return RegistrationInfo\n\t */\n\tpublic RegistrationInfo getRegistrationInfo();\n\t\n\t/**\n\t * Stores the registration information. <b>Note:</b> At least one course and an employment status must be chosen.\n\t * This validation is done prior to calling this method. It is done in the RegistrationServlet.doPost() method.\n\t *\n\t * @param name - name of the registrant\n\t * @param email - email of the registrant\n\t * @param courses - courses selected, at least one course is required\n\t * @param employmentStatus - employment status, this is required\n\t * @param hotel - hotel accommodation\n\t * @param parking - parking permit\n\t */\n\tpublic void setRegistrationInfo(String name,\n\t\t\t\t\t\t\t\t\tString email,\n\t\t\t\t\t\t\t\t\tList<String> courses,\n\t\t\t\t\t\t\t\t\tString employmentStatus,\n\t\t\t\t\t\t\t\t\tString hotel,\n\t\t\t\t\t\t\t\t\tString parking);\n\t/**\n\t * Returned the stored cost information.\n\t *\n\t * @return CostInfo\n\t */\n\tpublic CostInfo getCostInfo();\n\t\n\t/**\n\t * Removes a selected course.\n\t *\n\t * @param course - name of the course to remove\n\t */\n\tpublic void removeCourse(String course);\n\t\n\t/**\n\t * Return the courses as a String array.\n\t *\n\t * @return String[]\n\t */\n\tpublic String[] getCourses();\n}", "@Override\n protected void reconfigureService() {\n }", "private void registerService(Context context) {\r\n Intent intent = new Intent(context, CustomIntentService.class);\r\n\r\n /*\r\n * Step 2: We pass the handler via the intent to the intent service\r\n * */\r\n handler = new CustomHandler(new AppReceiver() {\r\n @Override\r\n public void onReceiveResult(Message message) {\r\n /*\r\n * Step 3: Handle the results from the intent service here!\r\n * */\r\n switch (message.what) {\r\n //TODO\r\n }\r\n }\r\n });\r\n intent.putExtra(\"handler\", new Messenger(handler));\r\n context.startService(intent);\r\n }", "@Override\n\tpublic void registrarLlegada() {\n\t}", "@Override\n protected void register(ExtendedHttpService service, FilterProxy<? extends Filter> filter)\n throws ServletException, NamespaceException {\n service.registerFilter(\"/\", filter, null, null);\n }", "@Override\n\tpublic void registrarLlegada() {\n\t\t\n\t}", "public interface RegisterGuJingboService {\n /**\n * @param intentionDate 意向就诊时间\n * @param patientName 姓名\n * @param patientSex 性别\n * @param patientAge 性别\n * @param patientPhone 手机号\n * @param patientIntro 介绍人\n * @param firstFlag 初诊or复诊\n * @return\n */\n Map<String, Object> register4GuJingbo(String intentionDate, String patientName, String patientSex, String patientAge, String patientPhone, String patientIntro, String firstFlag);\n\n /**\n * 获取意向就诊日期(只获取1-9条)\n *\n * @return\n */\n Map<String, Object> getIntentionDateAndWeek();\n\n /**\n * 获取某日的挂号详情\n *\n * @param intentionDate\n * @return\n */\n Map<String, Object> getRegisterDetail(String intentionDate);\n\n /**\n * 大夫登录\n *\n * @param account\n * @param password\n * @return\n */\n Map<String, Object> registerSignIn(String account, String password);\n}", "public interface RegistryReplicationService extends RegistryService {\n\n GetServicesResponse getServices(GetServicesRequest request);\n\n}", "private static void registerFromPackage(String packageName, String packageURL, FileFilter fileFilter) {\n File dir = new File(packageURL);\n if (!dir.exists() || !dir.isDirectory()) return;\n File[] dirFiles = dir.listFiles(fileFilter);\n for (File file : dirFiles)\n if (file.isDirectory()) {\n registerFromPackage(packageName + \".\" + file.getName(), file.getAbsolutePath(), fileFilter);\n } else {\n String className = file.getName().substring(0, file.getName().indexOf(\".\"));\n try {\n Class<?> aClass = Class.forName(packageName + \".\" + className);\n Annotation[] annotations = aClass.getAnnotations();\n //TODO 并不一定是按照顺序的,而且未来有可能不只是2个注解\n\n // 扫描注册 controller requestMapping\n if (annotations.length > 1 && annotations[0].annotationType().equals(Controller.class) && annotations[1].annotationType().equals(RequestMapping.class)) {\n String preUrl = aClass.getAnnotation(RequestMapping.class).value();\n Method[] methods = aClass.getMethods();\n for (Method method : methods) {\n Annotation requestMapping = method.getAnnotation(RequestMapping.class);\n if (requestMapping != null) {\n String pixUrl = ((RequestMapping) requestMapping).value();\n register(preUrl + pixUrl, new Service(aClass.asSubclass(ServiceInterface.class).getConstructor().newInstance(), method));\n System.out.println(((RequestMapping) requestMapping).value());\n }\n }\n\n }\n\n //放弃以下早期的扫描服务代码\n // 实现了注解,并且实现了接口\n// if (annotation != null && ServiceInterface.class.isAssignableFrom(aClass)) {\n//\n//// register(annotation.urlPattern(),aClass.asSubclass(ServiceInterface.class).getDeclaredConstructor().newInstance());\n//// System.out.println(\"成功注册服务: \" + annotation.urlPattern() + \" \" + className);\n// }\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n\tpublic void serviceResolved(ServiceEvent arg0) {\n\n\t}", "void addHasMicroService(MService newHasMicroService);", "public void beginRegister() {}", "public void serviceAdded(ServiceDescription service) {\n System.out.println(\"service added\");\n current = service;\n //set up channel to communicate with server\n //multiple beds -> multiple channels\n channel = ManagedChannelBuilder.forAddress(service.getAddress(), service.getPort())\n .usePlaintext(true)\n .build();\n\n //To call service methods, we first need to create a stub, \n //a blocking/synchronous stub: this means that the RPC call waits for the server to respond, \n //and will either return a response or raise an exception.\n blockingStub = ProjectorGrpc.newBlockingStub(channel);\n\n activateProjector();\n //listInputs();\n\n }", "private void metricRegistered (ServiceReference srefMetric) {\n // Retrieve the service ID\n Long serviceId =\n (Long) srefMetric.getProperty(Constants.SERVICE_ID);\n logInfo(\"A metric service was registered with ID \" + serviceId);\n \n // Dispose from the list of available metric any old metric, that\n // uses the same ID. Should not be required, as long as metric\n // services got properly unregistered.\n if (registeredMetrics.containsKey(serviceId)) {\n registeredMetrics.remove(serviceId);\n }\n \n // Retrieve information about this metric and add this metric to the\n // list of registered/available metrics\n MetricInfo metricInfo = getMetricInfo(srefMetric);\n registeredMetrics.put(serviceId, metricInfo);\n \n // Search for an applicable configuration set and apply it\n Iterator<String> configSets =\n metricConfigurations.keySet().iterator();\n while (configSets.hasNext()) {\n // Match is performed against the metric's class name(s)\n String className = configSets.next();\n // TODO: It could happen that a service get registered with more\n // than one class. In this case a situation can arise where\n // two or more matching configuration sets exists.\n if (metricInfo.usesClassName(className)) {\n // Apply the current configuration set to this metric\n logInfo(\n \"A configuration set was found for metric with\"\n + \" object class name \" + className\n + \" and service ID \" + serviceId);\n MetricConfig configSet =\n metricConfigurations.get(className);\n \n // Execute the necessary post-registration actions\n if (configSet != null) {\n // Checks if this metric has to be automatically\n // installed upon registration\n if ((configSet.containsKey(MetricConfig.KEY_AUTOINSTALL)\n && (configSet.getString(MetricConfig.KEY_AUTOINSTALL)\n .equalsIgnoreCase(\"true\")))) {\n if (installMetric(serviceId)) {\n logInfo (\n \"The install method of metric with\"\n + \" service ID \" + serviceId\n + \" was successfully executed.\");\n }\n else {\n logError (\n \"The install method of metric with\"\n + \" service ID \" + serviceId\n + \" failed.\");\n }\n }\n }\n }\n }\n }", "@Override\n\tpublic void registerService(String service, AgentIdentifier agent) {\n\t\tassert((service!=null)&&(!\"\".equals(service))); //$NON-NLS-1$\n\t\tassert(agent!=null);\n\t\tsuper.registerService(service,agent);\n\t\t// Informs the other kernels about this registration\n\t\tKernel<?,?,?,?> kernel = Kernel.getSingleton();\n\t\tif (!kernel.isOnThisKernel(agent)) {\n\t\t\tgetMTS(NetworkMessageTransportService.class).broadcast(new KernelMessage(YellowPages.class,KernelMessage.Type.YELLOW_PAGE_REGISTERING,service,agent));\n\t\t}\n\t}", "protected void __register()\n {\n }", "protected void __register()\n {\n }", "@Override\n\tpublic void serviceAdded(ServiceEvent arg0) {\n\t\tServiceInfo serviceInfo = mJmDNS.getServiceInfo(arg0.getType(),\n\t\t\t\targ0.getName());\n\t\tif (onFoundListener != null) {\n\t\t\tonFoundListener.onFound(serviceInfo);\n\t\t}\n\t}", "public synchronized void bindService(BehaviourInferenceAlgorithmRegistry registry) {\n \tthis.registry = registry;\n logger.info(\"BehaviourInferenceAlgorithmRegistry service connected.\");\n }", "@Mixins( OSGiEnabledService.OSGiEnabledServiceMixin.class )\n@Activators( OSGiEnabledService.Activator.class )\npublic interface OSGiEnabledService extends ServiceComposite\n{\n\n void registerServices()\n throws Exception;\n\n void unregisterServices()\n throws Exception;\n\n class Activator\n extends ActivatorAdapter<ServiceReference<OSGiEnabledService>>\n {\n\n @Override\n public void afterActivation( ServiceReference<OSGiEnabledService> activated )\n throws Exception\n {\n activated.get().registerServices();\n }\n\n @Override\n public void beforePassivation( ServiceReference<OSGiEnabledService> passivating )\n throws Exception\n {\n passivating.get().unregisterServices();\n }\n\n }\n\n\n public abstract class OSGiEnabledServiceMixin\n implements OSGiEnabledService\n {\n @Uses\n ServiceDescriptor descriptor;\n\n @Structure\n private Module module;\n\n private ServiceRegistration registration;\n\n @Override\n public void registerServices()\n throws Exception\n {\n BundleContext context = descriptor.metaInfo( BundleContext.class );\n if( context == null )\n {\n return;\n }\n for( ServiceReference ref : module.findServices( first( descriptor.types() ) ) )\n {\n if( ref.identity().equals( identity().get() ) )\n {\n Iterable<Type> classesSet = cast(descriptor.types());\n Dictionary properties = descriptor.metaInfo( Dictionary.class );\n String[] clazzes = fetchInterfacesImplemented( classesSet );\n registration = context.registerService( clazzes, ref.get(), properties );\n }\n }\n }\n\n private String[] fetchInterfacesImplemented( Iterable<Type> classesSet )\n {\n return toArray( String.class, map( toClassName(), typesOf( classesSet ) ) );\n }\n\n @Override\n public void unregisterServices()\n throws Exception\n {\n if( registration != null )\n {\n registration.unregister();\n registration = null;\n }\n }\n }\n}", "@Override\n\tpublic void subTypeForServiceTypeAdded(ServiceEvent arg0) {\n\n\t}", "public void InitService() {\n\t\ttry {\r\n\t\t\tgetCommManager().register(this); \r\n\t\t} catch (CommunicationException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void start(BundleContext context) throws Exception {\n\t\tfinal Dictionary<String, String> properties = new Hashtable<String, String>();\n\t\tproperties.put(Constants.SERVICE_DESCRIPTION, \"A bundle activator service\");\n\t\tcontext.registerService(LoginService.class, new LoginServiceImpl(), properties);\n\t\t//how to access the registered service\n\n\t}", "public AddFavouriteService() {\n super(\"AddFavouriteService\");\n }", "public void register() {\r\n\t\tHandlerSet hs = HandlerSet.getHandlerSet();\r\n\t\ths.addHandler(this);\r\n\t}", "public void register(T t);", "public interface MineService {\n}", "@Override\n\tpublic void registerWithService(UserDao userDao) {\n\t\t\n\t}", "public void register(T o);", "public void service_INIT(){\n }", "public RegistrationIntentService() {\n super(TAG);\n }", "@Bean\n @Profile(PROFILE_REGISTRY_ADAPTER)\n public RegistrationService registrationService(AbstractDeviceAdapterStore store) {\n return new RegistrationServiceImpl(store);\n }", "public void serviceAdded(ServiceEvent event) {\n\t\t\tLog.e(\"z\", \"added serivce: \" + event);\n\t\t}", "public void service(ServiceManager manager) throws ServiceException {\n super.service(manager);\n\n iClient = (IndexClient) manager.lookup(IndexClient.ROLE);\n broker = (EventBroker) manager.lookup(EventBroker.ROLE);\n try {\n broker.registerEvent(UrlResolvedEvent.ID);\n } catch (EventAlreadyRegisteredException e) {\n // event was already registered, so we have nothing more to do here\n }\n\n // the repository is lazily initialized to avoid circular dependency\n // between SourceResolver and JackrabbitRepository that leads to a\n // StackOverflowError at initialization time\n }", "public ServiceRegistration<WeavingHook> register(BundleContext ctx) {\n\t\t\treturn register(ctx, 0);\n\t\t}", "public interface Service {\n // Service-specific methods go here\n }", "public interface Service {\n\n}", "public interface Service {\n\n}", "public void serviceChanged(ServiceEvent event)\n {\n Object service = SystrayActivator.bundleContext\n .getService( event.getServiceReference());\n \n if (! (service instanceof ProtocolProviderService))\n return;\n \n ProtocolProviderService provider = (ProtocolProviderService)service;\n \n if (event.getType() == ServiceEvent.REGISTERED)\n addAccount(provider);\n \n if (event.getType() == ServiceEvent.UNREGISTERING)\n removeAccount(provider);\n }", "public void onServiceConnected(ComponentName className, IBinder service) {\n \tmServiceMessenger = new Messenger(service);\r\n // We want to monitor the service for as long as we are\r\n // connected to it.\r\n try {\r\n Message message = Message.obtain(null, WATCHiTServiceInterface.REGISTER_CLIENT);\r\n message.replyTo = mMessenger;\r\n mServiceMessenger.send(message);\r\n } catch (RemoteException e) {\r\n // In this case the service has crashed before we could even\r\n // do anything with it; we can count on soon being\r\n // disconnected (and then reconnected if it can be restarted)\r\n // so there is no need to do anything here.\r\n }\r\n // Toast.makeText(MainActivity.this, R.string.remote_service_bound, Toast.LENGTH_SHORT).show();\r\n }", "public void addService(Class<? extends IFloodlightService> clazz, \n\t IFloodlightService service) {\n\t\tserviceMap.put(clazz, service);\n\t}", "@Override\n public void register(Object subscriber) {\n }", "@Override\n protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.service(req, resp);\n logger.log(Level.INFO, \"service(req, resp) Invoked\");\n }", "private void registerLocalService() {\n WifiP2pDnsSdServiceInfo serviceInfo =\n WifiP2pDnsSdServiceInfo.newInstance(WifiDirectUtilities.SERVICE_NAME,\n \"_\" + WifiDirectUtilities.SERVICE_TYPE + \"._\" + WifiDirectUtilities.SERVICE_PROTOCOL,\n WifiDirectUtilities.SERVICE_RECORD);\n\n // Add the local service, sending the service info, network channel,\n // and listener that will be used to indicate success or failure of\n // the request.\n mManager.addLocalService(mChannel, serviceInfo, new WifiP2pManager.ActionListener() {\n @Override\n public void onSuccess() {\n // Command successful! Code isn't necessarily needed here,\n // Unless you want to update the UI or add logging statements.\n }\n\n @Override\n public void onFailure(int arg0) {\n // Command failed. Check for P2P_UNSUPPORTED, ERROR, or BUSY\n }\n });\n WifiDirectDnsSdListener listener = new WifiDirectDnsSdListener(this);\n mManager.setDnsSdResponseListeners(mChannel, listener, listener);\n }", "public interface PrefixRegistrationRequestManagementService {\n /**\n * This method starts the prefix registration process for the given prefix registration request.\n *\n * In the current iteration of this microservice it uses the prefix registration request model from the API straight\n * away, which is ok, but it may be refactored later, including some model transformation code.\n * @param request the prefix registration requests to use for starting the process\n * @param actor the actor that has triggered this action\n * @param additionalInformation possible additional information related to this action\n * @return the prefix registration event registered as a consequence of executing this action\n * @throws PrefixRegistrationRequestManagementServiceException\n */\n PrefixRegistrationSessionEventStart startRequest(PrefixRegistrationRequest request,\n String actor,\n String additionalInformation) throws PrefixRegistrationRequestManagementServiceException;\n\n /**\n * Amend the prefix registration request being processed in the given prefix registration session.\n *\n * @param prefixRegistrationSession opened prefix registration session where the request is being amended\n * @param amendedRequest amended prefix registration request, which is a copy of the latest version of the prefix\n * registration request, with some changes applied to it.\n * @param actor the actor that has triggered this action\n * @param additionalInformation possible additional information related to this action\n * @return the prefix registration event registered as a consequence of executing this action\n * @throws PrefixRegistrationRequestManagementServiceException\n */\n PrefixRegistrationSessionEventAmend amendRequest(PrefixRegistrationSession prefixRegistrationSession,\n PrefixRegistrationRequest amendedRequest,\n String actor,\n String additionalInformation) throws PrefixRegistrationRequestManagementServiceException;\n\n /**\n * Log a comment on the given prefix registration session.\n *\n * @param prefixRegistrationSession opened prefix registration session where this action is being triggered\n * @param comment the comment to be logged for this resource registration session\n * @param actor the actor that has triggered this action\n * @param additionalInformation possible additional information related to this action\n * @return the prefix registration event registered as a consequence of executing this action\n * @throws PrefixRegistrationRequestManagementServiceException\n */\n PrefixRegistrationSessionEventComment commentRequest(PrefixRegistrationSession prefixRegistrationSession,\n String comment,\n String actor,\n String additionalInformation) throws PrefixRegistrationRequestManagementServiceException;\n\n /**\n * Close a prefix registration session, by rejecting its prefix registration request.\n *\n * @param prefixRegistrationSession opened prefix registration session where this action is being triggered\n * @param rejectionReason the reason why the prefix registration request was rejected\n * @param actor the actor that has triggered this action\n * @param additionalInformation possible additional information related to this action\n * @return the prefix registration event registered as a consequence of executing this action\n * @throws PrefixRegistrationRequestManagementServiceException\n */\n PrefixRegistrationSessionEventReject rejectRequest(PrefixRegistrationSession prefixRegistrationSession,\n String rejectionReason,\n String actor,\n String additionalInformation) throws PrefixRegistrationRequestManagementServiceException;\n\n /**\n * Close a prefix registration session, by accepting its prefix registration request.\n *\n * @param prefixRegistrationSession opened prefix registration session where this action is being triggered\n * @param acceptanceReason the reason why the prefix registration request was accepted\n * @param actor the actor that has triggered this action\n * @param additionalInformation possible additional information related to this action\n * @return the prefix registration event registered as a consequence of executing this action\n * @throws PrefixRegistrationRequestManagementServiceException\n */\n PrefixRegistrationSessionEventAccept acceptRequest(PrefixRegistrationSession prefixRegistrationSession,\n String acceptanceReason,\n String actor,\n String additionalInformation) throws PrefixRegistrationRequestManagementServiceException;\n}", "public void setService (String service) {\n\t this.service = service;\n\t}", "private ServiceLocator(){}", "@Override\n public void register(Asciidoctor asciidoctor) {\n }", "private void setService(Service service) {\n this.service = service;\n }", "private AuthService() {\n configureAccessTokens();\n configure();\n ConfigurationWatcher.registerListener(this, JOSSO_GATEWAY_CONFIGURATION.getAbsolutePath());\n ConfigurationWatcher.registerListener(this, FOUNDATION_CONFIGURATION.getAbsolutePath());\n log.debug(\"AuthService listening for changes to \" + JOSSO_GATEWAY_CONFIGURATION + \" and \" + FOUNDATION_CONFIGURATION);\n }", "@Override\n\tprotected void customizeRegistration(Dynamic registration) {\n\tsuper.customizeRegistration(registration);\n\t}", "@Service\npublic interface RegisterService extends ICommService {\n boolean registerByEmail(String register_account,String register_password) throws ServiceException;\n boolean registerByPhone(String register_account,String register_password) throws ServiceException;\n}", "@Bean\n @Primary\n public IUserServiceBean registerServices() {\n return new UserServiceBean();\n }", "private void AddMetaRegistrationInformation(Registration reg) {\n }", "@Override\n public void serviceResolved(ServiceEvent serviceEvent) {\n // Test service info is resolved.\n String[] serviceUrls = serviceEvent.getInfo().getURLs();\n\n logger.info(\"Found kinect service \" + serviceEvent.getInfo().getURLs()[0].toString());\n\n if (serviceUrls.length > 0) {\n logger.info(\"Connecting to kinect service 2\");\n\n try {\n final URL url = new URL(serviceUrls[0]);\n logger.info(\"Connecting to kinect service \" + url.getHost() + \":\" + url.getPort());\n final KinectConnector connector = new KinectConnector(url.getHost(), url.getPort());\n connector.setDeviceListCallback(new DeviceCallback() {\n @Override\n public void onItemsChanged(List<KinectItem> devices) {\n logger.info(\"Found kinect objects\");\n for (KinectItem item : devices) {\n createDevice(url.getHost(), url.getPort(), item.getName().replace(\" \", \"\"));\n }\n connector.stop();\n }\n });\n connector.start();\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n\n }\n }", "public InitService() {\n super(\"InitService\");\n }", "public interface RegistService {\n /**\n * 是否已有用户\n * @return\n */\n User findUserByEmail(String userEmail);\n /**\n * 插入用户\n * @return\n */\n void insertUser(User user);\n /**\n * 更新用户信息\n * @return\n */\n void updateUser(User user1);\n}", "@Override\n protected void onRegister() {\n Core.register(this);\n }", "@Override\r\n\t\tpublic void onServiceConnected(ComponentName className, IBinder service) {\n\t\t\ttry {\r\n\t\t\t\tmSpiderX = SpiderX.Stub.asInterface(service);\r\n\t\t\t\tif(mSpiderX != null && spiderCallback != null){\r\n\t\t\t\t\tmSpiderX.setSpiderCallBack(spiderCallback);\r\n\t\t\t\t}\r\n\t\t\t\tfor(EventBus handler:mEventBus){\r\n\t\t\t\t\thandler.onEvent(TYPE_SERVICEBINDER_SUCESS,\"\",\"\");\r\n\t\t\t\t}\r\n\t\t\t} catch (RemoteException e) {\r\n\t\t\t\tLog.d(TAG, \" \"+e);\r\n\t\t\t}\r\n\t\t}" ]
[ "0.7484848", "0.74102646", "0.7392708", "0.7301543", "0.717688", "0.70655483", "0.68799114", "0.6862838", "0.685867", "0.68450266", "0.67973995", "0.67493445", "0.66751087", "0.6638571", "0.6587356", "0.6574753", "0.65714306", "0.65667945", "0.6561715", "0.6555818", "0.6501341", "0.6498996", "0.649731", "0.63830656", "0.6350566", "0.634578", "0.6338194", "0.63214326", "0.63148355", "0.63073266", "0.6305801", "0.62895566", "0.6280564", "0.62625265", "0.625834", "0.6245932", "0.624442", "0.6229758", "0.62236243", "0.62061507", "0.61969435", "0.61768895", "0.61739534", "0.6173898", "0.6168196", "0.61667836", "0.6140522", "0.61308944", "0.61299634", "0.6121837", "0.6107138", "0.61010903", "0.6086107", "0.60855347", "0.60702914", "0.6070188", "0.6063347", "0.60619795", "0.60619795", "0.60542727", "0.6053456", "0.60512716", "0.60459816", "0.6036324", "0.6032429", "0.60292506", "0.6020349", "0.6013682", "0.60086", "0.6005089", "0.600495", "0.6003673", "0.6000738", "0.5984093", "0.5983253", "0.59816", "0.597927", "0.5968616", "0.59318984", "0.59318984", "0.59174657", "0.59011066", "0.5891696", "0.58751434", "0.5874882", "0.5874662", "0.5871714", "0.5867707", "0.5863205", "0.58619404", "0.5832783", "0.5828317", "0.5822327", "0.5819661", "0.581702", "0.5815066", "0.581484", "0.5811175", "0.5808686", "0.5806722", "0.57970876" ]
0.0
-1
Test of getUniqueInt method, of class UniqueRandomGenerator.
@Test public void testGetUniqueInt() { UniqueRandomGenerator instance = new UniqueRandomGenerator(); List<Integer> extracted = new ArrayList<>(); for (int i = 0; i < 1000; i++) { int extr = instance.getUniqueInt(0, 1000); if (extracted.contains(extr)) fail(); else extracted.add(extr); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "private int randomHelper() {\n\t\tRandom rand = new Random();\n\t\tint randomNum = rand.nextInt((10000 - 1) + 1) + 1;\n\t\treturn randomNum;\n\t}", "private int getUniqueSecretKey () {\n\n int minInt = 100000;\n int maxInt = 999999;\n int candidateNumber = -1;\n Set<Integer> listOfCurrentSecretKeys =\n hashMapOfSecretKeys.keySet();\n boolean numberIsUnique = false;\n while ( !numberIsUnique ) {\n\n candidateNumber = rng.nextInt(maxInt+1);\n // assume unique for a moment\n numberIsUnique = true;\n // verify uniqueness assumption\n for ( int theNum : listOfCurrentSecretKeys) {\n if (candidateNumber == theNum) {\n numberIsUnique = false;\n break;\n }\n } // end for() loop\n\n } // end while() loop\n\n return candidateNumber;\n }", "public static int randomGet() { return 0; }", "private int getUniqueAccountNumber () {\n\n int minInt = 100000;\n int maxInt = 999999;\n int candidateNumber = -1;\n Set<Integer> listOfCurrentAccountNumbers =\n hashMapOfAllAccts.keySet();\n boolean numberIsUnique = false;\n while ( !numberIsUnique ) {\n\n candidateNumber = rng.nextInt(maxInt+1);\n // assume unique for a moment\n numberIsUnique = true;\n // verify uniqueness assumption\n for ( int acctNum : listOfCurrentAccountNumbers) {\n if (candidateNumber == acctNum) {\n numberIsUnique = false;\n break;\n }\n } // end for() loop\n\n } // end while() loop\n\n return candidateNumber;\n }", "private static int getSecretNum(int arg1) {\n Random rand = new Random();\n return rand.nextInt(UPPERBOUND)+1; //make range 1-100\n }", "private int aleatorizarNaipe() {\n\t\tint aux;\n\t\taux = r.getIntRand(4);\n\t\treturn aux;\n\t}", "private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}", "public static int randomNext() { return 0; }", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "@Test\r\n\tpublic void testPositiveGenerateInteger_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tcollector.checkThat(roc.generateIntegers(10, 0, 10, false, 16), notNullValue());\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public int generateUniqueID(){\n\n int uniqueID = 100; \n int maxID =getMaxId() ;\n \n uniqueID = uniqueID + maxID;\n\n return uniqueID;\n }", "private int randomGen(int upperBound) {\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(upperBound);\n\t}", "int getUniqueNumbersCount();", "private int _randomCode () {\n Random random = new Random();\n code = random.nextInt(999999);\n return code;\n }", "public int getRandom() {\n Random rand = new Random();\n int idx = rand.nextInt(validLength);\n return set.get(idx);\n }", "@Test\n public void testGenerateIdExpectedValue() {\n Monkey monkey = new Monkey();\n int id = monkey.generateIdRefactored(100);\n assertEquals(id,223592);\n }", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "@Test\n public void testUniqueRandomRuids() {\n\n ServiceWriteRequestBuilder<Void> builder = ServiceWriteRequestBuilder.newPostRequest(ServiceName.CONTACT, \"/contact\", null, Void.class);\n\n String ruid1 = builder.build().getRuid();\n String ruid2 = builder.build().getRuid();\n\n assertThat(ruid1, is(notNullValue()));\n assertThat(ruid2, is(notNullValue()));\n assertThat(ruid1, is(not(ruid2)));\n\n\n }", "public static int RandomNum(){\n\n Random random = new Random();\n int ItemPicker = random.nextInt(16);\n return(ItemPicker);\n }", "public int randomNum()\r\n {\r\n Random rand = new Random();\r\n int n = rand.nextInt(52)+1;\r\n return n;\r\n }", "int getUniquesNumber() throws SQLException;", "private int IdRandom() {\n\t\tRandom random = new Random();\n\t\tint id = random.nextInt(899999) + 100000;\n\t\treturn id;\n\t}", "@Test\n public void createRandomNumber() throws IOException {\n Assert.assertNotNull(Utils.createRandomNumber());\n }", "@Test\n\tpublic void test() {\n\t\tlong firstID = UIDGen.getInstance().getNextId();\n\t\tint n = 100;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tUIDGen.getInstance().getNextId();\n\t\t}\n\t\tlong currentID = UIDGen.getInstance().getNextId();\n\t\tassertEquals(currentID, firstID + n + 1);\n\n\t\t// expect a IDInvalidException exception for using and\n\t\t// external id that has already been used\n\t\tlong exteranlId = currentID;\n\t\tThrowable caught = null;\n\t\ttry {\n\t\t\tUIDGen.getInstance().considerExternalId(exteranlId);\n\t\t} catch (Throwable t) {\n\t\t\tcaught = t;\n\t\t}\n\t\tassertNotNull(caught);\n\t\tassertSame(IDInvalidException.class, caught.getClass());\n\n\t\t// push an external id that is not used and expect no exception\n\t\texteranlId = currentID + 2;\n\t\ttry {\n\t\t\tUIDGen.getInstance().considerExternalId(exteranlId);\n\t\t} catch (Throwable t) {\n\t\t\tfail();\n\t\t}\n\n\t\t// expect an exception as we put the same id again\n\t\texteranlId = currentID;\n\t\tcaught = null;\n\t\ttry {\n\t\t\tUIDGen.getInstance().considerExternalId(exteranlId);\n\t\t} catch (Throwable t) {\n\t\t\tcaught = t;\n\t\t}\n\t\tassertNotNull(caught);\n\t\tassertSame(IDInvalidException.class, caught.getClass());\n\n\t\t// must skip currentID + 2 as it was defined as an external id\n\t\tassertEquals(UIDGen.getInstance().getNextId(), currentID + 1);\n\t\tassertEquals(UIDGen.getInstance().getNextId(), currentID + 3);\n\t}", "@Test\r\n\tpublic void testPositiveGenerateInteger_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tcollector.checkThat(roc.generateIntegers(10, 0, 10, false), notNullValue());\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public int getRandom() {\n int n = set.size();\n if (n == 0) return 0;\n Object[] res = set.toArray();\n Random rand = new Random();\n int result = rand.nextInt(n);\n return (Integer)res[result];\n }", "private int randomInteger(int n) {\n return (int) (randGen.random() * (n - 1));\n }", "int randInt(int n) {\r\n return _randomSource.nextInt(n);\r\n }", "private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }", "@Test\r\n\tpublic void testPositiveGenerateInteger_4() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tint[] response = roc.generateIntegers(10, 0, 10, false, identifier);\r\n\t\t\t\tcollector.checkThat(response, notNullValue());\r\n\t\t\t\t\r\n\t\t\t\tint[] response2 = roc.generateIntegers(10, 0, 10, false, identifier);\r\n\t\t\t\tcollector.checkThat(response, equalTo(response2));\r\n\t\t\t\t\r\n\t\t\t\tresponse = roc.generateIntegers(10, 0, 10, false, date);\r\n\t\t\t\tcollector.checkThat(response, notNullValue());\r\n\t\t\t\t\r\n\t\t\t\tresponse2 = roc.generateIntegers(10, 0, 10, false, date);\r\n\t\t\t\tcollector.checkThat(response, equalTo(response2));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void testGetNum() throws Exception {\n CountNumbersWithUniqueDigits countNumbersWithUniqueDigits = new CountNumbersWithUniqueDigits();\n assertEquals(81, countNumbersWithUniqueDigits.getNum(10, 2));\n assertEquals(9, countNumbersWithUniqueDigits.getNum(10, 1));\n }", "@Test\r\n\tpublic void testPositiveGenerateInteger_5() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString[] response = roc.generateIntegers(10, 0, 10, false, 16, identifier);\r\n\t\t\t\tcollector.checkThat(response, notNullValue());\r\n\t\t\t\t\r\n\t\t\t\tString[] response2 = roc.generateIntegers(10, 0, 10, false, 16, identifier);\r\n\t\t\t\tcollector.checkThat(response, equalTo(response2));\r\n\t\t\t\t\r\n\t\t\t\tresponse = roc.generateIntegers(10, 0, 10, false, 16, date);\r\n\t\t\t\tcollector.checkThat(response, notNullValue());\r\n\t\t\t\t\r\n\t\t\t\tresponse2 = roc.generateIntegers(10, 0, 10, false, 16, date);\r\n\t\t\t\tcollector.checkThat(response, equalTo(response2));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "String getUnique();", "public static int getRandomInt()\n {\n return ThreadLocalRandom.current().nextInt(1000000000, 2147483647);\n }", "private int randomInt(int lower, int upper) {\n\t\treturn (int) ((upper - lower + 1) * Math.random()) + lower;\n\t}", "public static int genID(){\n Random rand = new Random();\n\n int theID = rand.nextInt(999)+1;\n\n return theID;\n\n }", "public int getRandomPositiveInt(){\r\n long gen = (a*seed+c)%m;\r\n seed = gen;\r\n return (int)gen;\r\n }", "private static Integer generateID() {\n Integer uniqueID = -1;\n while (setOfIDs.contains(uniqueID) || !Employee.isPositive(uniqueID)) {\n uniqueID += 1;\n }\n return uniqueID;\n }", "protected String generateUserID() {\n Random r = new Random();\n String userID;\n do {\n int randomIDnum = r.nextInt(999999999) + 1;\n userID = String.valueOf(randomIDnum);\n } while (this.userMap.containsKey(userID));\n return userID;\n }", "int randInt(int n) {\n return _randomSource.nextInt(n);\n }", "public int getRandomNumber() {\n int Random;\n Random randomize = new Random();\n Random = randomize.nextInt(3);\n return new Integer(Random);\n }", "public static int generateRandomNumber()\n\t{\n\t\tRandom r = new Random();\n\t\treturn r.nextInt();\n\t}", "@Override\n public int getInt(String key) {\n return random.nextInt(RANDOM_INT_BOUND);\n }", "private static int randInt(int lower, int upper) {\n\t\tRandom random = new Random();\n\t\treturn random.nextInt((upper - lower) + 1) + lower;\n\t}", "public int getUniqueTrackingNumber(){\n boolean is_used = false;\n int number;\n do {\n number = (int)(Math.random() * 999999 + 100000);\n for (int i = 0; i < trackingNumbers.size() ; i++) {\n if (trackingNumbers.get(i) == number){\n is_used=true;\n }\n }\n }while (is_used);\n trackingNumbers.add(number);\n return number;\n\n }", "public void testGetUniqueID_fixture16_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture16();\n\n\t\tAbstractUniqueID result = fixture.getUniqueID();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.getId());\n\t}", "private synchronized int generateUserID(){\r\n\t\tint i;\r\n\t\tfor(i = 1; users.containsKey(i);i++);\r\n\t\treturn i;\r\n\t}", "public int generateRandom() {\n\t\tint random = (int)(Math.random()*((6-1)+1))+1;\n\t\treturn random;\n\t}", "@Test\n public void randomSeedNumTest()\n {\n int x = _city.getRandomNum(5);\n int y = _city.getRandomNum(5);\n assertEquals(x, y);\n }", "private int generateSecret() {\n int secret = secretGenerator.nextInt();\n while (secretToNumber.containsKey(secret)) {\n secret = secretGenerator.nextInt();\n }\n return secret;\n }", "private int getNextUnique() {\r\n\t\ttry {\r\n\t\t\tint nextUnique = 0;\r\n\t\t\tStatement statement = connection.createStatement();\r\n\t\t\tResultSet rs = statement.executeQuery(\"SELECT MAX(userID) userID FROM users\");\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tnextUnique = rs.getInt(\"userID\") + 1;\r\n\t\t\t}\r\n\t\t\treturn nextUnique;\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public int idGenerator() {\n Random random = new Random();\n int id;\n return id = random.nextInt(10000);\n }", "public int getRandomInt(int upper) {\n int retVal = myRandom.nextInt() % upper;\n if (retVal < 0) {\n retVal += upper;\n }\n return (retVal);\n }", "private IUnit getRandomCacheUnit(){\n\t\tcache = new UnitCache();\n\t\treturn cache.getUnit(rnd.nextInt(cache.getSize()));\n\t}", "public int randomInt() {\n\t\t\t\t // NOTE: Usually this should be a field rather than a method\n\t\t\t\t // variable so that it is not re-seeded every call.\n\t\t\t\t Random rand = new Random();\n\t\t\t\t // nextInt is normally exclusive of the top value,\n\t\t\t\t // so add 1 to make it inclusive\n\t\t\t\t int randomNum = rand.nextInt();\n\t\t\t\t return randomNum;\n\t\t\t\t}", "public static int nextInt() {\n\treturn 0;\r\n}", "public static int getRndInt(int upperBound){\n\t\tRandom randomNumber; \n\t\trandomNumber = new Random(); \n\t\tint z = randomNumber.nextInt(upperBound);\n\t\treturn z;\n\t}", "long nextUniqueKey() throws IOException;", "public int getRandomsNumber(){\n Random random = new Random();\n int number = random.nextInt(12) + 1;\n return number;\n }", "public int getRandom() {\n int idx;\n Random rand;\n \n rand = new Random();\n idx = rand.nextInt(set.size());\n return set.get(idx);\n }", "public void testGetUniqueID_fixture17_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture17();\n\n\t\tAbstractUniqueID result = fixture.getUniqueID();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.getId());\n\t}", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "@Override\r\n\tpublic int generateAccountId() {\n\t\tint AccountId = (int) (Math.random()*10000);\r\n\t\treturn 0;\r\n\t}", "private int nextValidID() {\n return nextId++;\n }", "private int getRandomNumber() {\n int randomInt = 0;\n Random randomGenerator = new Random();\n randomInt = randomGenerator.nextInt(NUM_LIST.length());\n if (randomInt - 1 == -1) {\n return randomInt;\n } else {\n return randomInt - 1;\n }\n }", "@Test\n public void getId() {\n UUID id = UUID.randomUUID();\n User u = new User(id.toString(), name, mail, pass, address, gender);\n Assert.assertEquals(u.getId(), id);\n }", "private String getRandomUniqueId() {\r\n return \"WEBSOCKET.\" + new Random().nextInt(100);\r\n }", "private static int randomInteger(int a, int b) {\n return (int) (Math.random() * (b - a) + a);\n }", "public static int randomInt() {\n return randomInt(Integer.MIN_VALUE, Integer.MAX_VALUE);\n }", "private int grabANewNumberForTest() {\n clockPanel.updateTestClock(testNumbersList);\n if (testNumbersList.size() == 0) {\n testOver();\n }\n return testNumbersList.remove((int)(Math.random()*testNumbersList.size()));\n }", "int RandomGeneratorZeroToThree (){\n\t\t int randomInt = 0;\n\t\t Random randomGenerator = new Random();\n\t\t for (int idx = 1; idx <= 10; ++idx) {\n\t\t\t randomInt = randomGenerator.nextInt(4);\n\n\t\t }\n\t\t return randomInt;\n\t }", "public int next() {\r\n\t\t// Get a random value\r\n\t\tint index = random.nextInt(values.length);\r\n\t\tint byteValue = values[index] + 128; // For an unsigned value\r\n\t\tint value = byteValue * 3;\r\n\t\t// If byteValue = 255 (max), then choose between 765000 and 799993\r\n\t\tif (byteValue == 255) {\r\n\t\t\tvalue += random.nextInt(800-765+1);\r\n\t\t}\r\n\t\t// Otherwise, choose between value and value + 2 (inc)\r\n\t\telse {\r\n\t\t\tvalue += random.nextInt(3);\r\n\t\t}\r\n\t\treturn value;\r\n\t}", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "protected int getUniqueID() {\n\t\treturn uniqueID;\n\t}", "public int getRandom() {\n return data.get(random.nextInt(data.size()));\n }", "public static int getRandomNumber(){\n int random = 0; // set variable to 0\r\n random = (int)(Math.random()*10) + 1; //generate random number between 1 and 10\r\n return random; //return random number\r\n }", "public int getRandom() {\n return arr.get(r.nextInt(arr.size()))[0];\n }", "public static int getRandomNum() {\n\t\tRandom rand = new Random();\n\t\tint num = rand.nextInt(3)+1;\n\t\treturn num;\n\t}", "private static int generateViewId() {\n for (;;) {\n final int result = sNextGeneratedId.get();\n // aapt-generated IDs have the high byte nonzero; clamp to the range under that.\n int newValue = result + 1;\n if (newValue > 0x00FFFFFF) newValue = 1; // Roll over to 1, not 0.\n if (sNextGeneratedId.compareAndSet(result, newValue)) {\n return result;\n }\n }\n }", "private int rand(int lower, int upper) {\n return lower + (int)(Math.random() * ((upper - lower) + 1));\n }", "public static int randomFastInt() {\n return ThreadLocalRandom.current().nextInt();\n }", "public int getRandom() {\r\n var list = new ArrayList<>(set);\r\n return list.get(new Random().nextInt(set.size()));\r\n }", "private static int myRandom(int low, int high) {\n return (int) (Math.random() * (high + 1 - low) + low);\n }", "int getRandom(int max);", "public int geraNumeroUnico()\r\n {\r\n Random numero = new Random();\r\n numUnico = numero.nextInt(99999);\r\n numUnico = numUnico + 1000;\r\n \r\n if(conjNumeros.contains(numUnico) == true)\r\n isUnico = false;\r\n else \r\n isUnico = true;\r\n \r\n while(isUnico == false)\r\n { \r\n numUnico = numero.nextInt(99999);\r\n numUnico = numUnico + 1000;\r\n \r\n if(conjNumeros.contains(numUnico) == true)\r\n isUnico = false;\r\n else\r\n isUnico = true;\r\n } \r\n conjNumeros.add(numUnico);\r\n \r\n return numUnico;\r\n }", "public void testGetUniqueID_fixture20_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture20();\n\n\t\tAbstractUniqueID result = fixture.getUniqueID();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.getId());\n\t}", "long getUID() throws UidGenerateException;", "@Test\n public void uuidCountTest() {\n // TODO: test uuidCount\n }", "public void testGetUniqueID_fixture15_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture15();\n\n\t\tAbstractUniqueID result = fixture.getUniqueID();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.getId());\n\t}", "private UniqueIdGenerator() {\n\n }", "public void testGetUniqueID_fixture18_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture18();\n\n\t\tAbstractUniqueID result = fixture.getUniqueID();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.getId());\n\t}", "UUID generateRandomUuid();", "public static String getTestId() {\n\t\t\trandomTestId+=1;\n\t\t\treturn Integer.toString(randomTestId);\n\t\t}", "public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}", "public int getRandom() {\n return data.get(random.nextInt(data.size()));\n }", "public int getRandom() {\n Set<Integer> keys = map.keySet();\n Object[] objects = keys.toArray();\n Random rand = new Random();\n int key = rand.nextInt(keys.size());\n return map.get(objects[key]);\n }", "public static int superFastRandomInt(){\n\t\tint x = (randByte << 1);\n\t\tint y = (randByte >>> 1);\n\t\treturn (randByte = x ^ ~y) & 0xFF;\n\t}", "private UniqueIdentifier(){\n\t\t\n\t}" ]
[ "0.6761224", "0.6704006", "0.6590306", "0.6545996", "0.63984656", "0.6353616", "0.6348174", "0.6325074", "0.6298858", "0.62794244", "0.6268022", "0.6226637", "0.6211235", "0.6201041", "0.62", "0.61972696", "0.61835986", "0.61819714", "0.61771786", "0.6171318", "0.61710703", "0.6167349", "0.61611706", "0.6129878", "0.6122752", "0.6112242", "0.61113185", "0.61089075", "0.60944164", "0.60939807", "0.60856396", "0.6083989", "0.6069646", "0.606453", "0.6063769", "0.60584795", "0.60472494", "0.60397434", "0.6033179", "0.6022604", "0.60122645", "0.6011436", "0.59914416", "0.59758794", "0.5966459", "0.5966002", "0.59289575", "0.592885", "0.5924052", "0.59220934", "0.59170055", "0.5913447", "0.59001404", "0.5891737", "0.5882118", "0.58810556", "0.58810025", "0.5878975", "0.5873234", "0.58653545", "0.58618164", "0.5854118", "0.5835253", "0.5833339", "0.581112", "0.5807769", "0.5791732", "0.57885206", "0.57869476", "0.57777244", "0.5776697", "0.57742023", "0.5773261", "0.57676286", "0.5760656", "0.5760653", "0.57515126", "0.5745383", "0.57383966", "0.5737656", "0.5735122", "0.57231253", "0.5720411", "0.57203317", "0.5720288", "0.5717586", "0.5701759", "0.5701708", "0.57010275", "0.5696885", "0.5693978", "0.56917626", "0.5686702", "0.5683981", "0.5683649", "0.5674336", "0.56730795", "0.56729174", "0.56700903", "0.56698763" ]
0.8392744
0
Setea la id del usuario
public void setId( Long id );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setIdUsuario(int value) {\n this.idUsuario = value;\n }", "public void setIdUser(int value) {\n this.idUser = value;\n }", "public void setId_usuario(String usuario) {\n this.id_usuario = usuario;\n }", "public void setIdUsuario(Integer idUsuario) {\n this.idUsuario = idUsuario;\n }", "public void setIduser(int aIduser) {\n iduser = aIduser;\n }", "public void setIdUser(Integer idUser) {\r\n\t\tthis.idUser = idUser;\r\n\t}", "public void setId_user(int id_user) {\r\n this.id_user = id_user;\r\n }", "public void setId_user(int id_user) {\n this.id_user = id_user;\n }", "public void setIdUsuario(Integer idUsuario) {\n\t\tthis.idUsuario = idUsuario;\n\t}", "public void setIdUsuario(String idUsuario) {\n\t\tthis.idUsuario = idUsuario;\n\t}", "public void setIdUser(String idUser) {\n\t\tthis.idUser = idUser;\n\t}", "public void setUsua_id(java.lang.Long newUsua_id);", "@Override\n\tvoid setId(final UserId userId);", "public void setUsuarioID(int usuarioID) {\r\n this.usuarioID = usuarioID;\r\n }", "public void ponerUsuarioInactivo(String idUsuario);", "UserInfo setId(long id);", "public void setIdGrupoUsuario(Long idGrupoUsuario) {\n this.idGrupoUsuario = idGrupoUsuario;\n }", "public int getId_usuario() {\n\treturn id_usuario;\n }", "public int getIduser() {\n return iduser;\n }", "public int getIdUser() {\n return idUser;\n }", "public int getIdUser() {\n return idUser;\n }", "void setUser(User user, int id) {\n this.user = user;\n this.id = id;\n }", "public void setId(int idNuevo)\n { \n this.id = idNuevo;\n }", "public void setUserid(java.lang.String value) {\n this.userid = value;\n }", "private void setUserId(int value) {\n \n userId_ = value;\n }", "@Override\n public void setId(UserDetailsPk id) {\n this.id = id;\n }", "public int getIdUsuario() {\n return idUsuario;\n }", "public void setUserId(long userId);", "public void setUserId(long userId);", "public void setUserId(long userId);", "public void setUserId(long userId);", "public long getIdUsuario() {\n\t\treturn idUsuario;\n\t}", "void setUserId(int newId) {\r\n\t\t\tuserId = newId;\r\n\t\t}", "void setUserId(Long userId);", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public Integer getIdUsuario() {\n\t\treturn idUsuario;\n\t}", "public String getId_usuario() {\n return id_usuario;\n }", "public void setUserid(Long userid) {\r\n this.userid = userid;\r\n }", "public void setUser1X_ID (int User1X_ID);", "public Integer getIdUsuario() {\n return idUsuario;\n }", "public void modificarUsuario(Long id, String nombre);", "public void setUserid(Integer userid) {\r\n\t\tthis.userid = userid;\r\n\t}", "public void setIdCliente(Integer id_cliente){\n this.id_cliente=id_cliente;\n }", "@Override\n public void setUserId(long userId) {\n _partido.setUserId(userId);\n }", "public String getIdUsuario() {\n\t\treturn idUsuario;\n\t}", "public String getIdUsuario() {\n\t\treturn idUsuario;\n\t}", "private void setUserId(long value) {\n \n userId_ = value;\n }", "public void setUserId(int value) {\n this.userId = value;\n }", "@Test\r\n public void testSetIdUsuario() {\r\n System.out.println(\"setIdUsuario\");\r\n Integer idUsuario = null;\r\n Usuario instance = new Usuario();\r\n instance.setIdUsuario(idUsuario);\r\n // TODO review the generated test code and remove the default call to fail.\r\n }", "public Integer getIdUser() {\r\n\t\treturn idUser;\r\n\t}", "private void setUserId(long value) {\n\n userId_ = value;\n }", "public int getId()\r\n\t{\r\n\t\treturn this.userId;\r\n\t}", "public java.lang.Long getUsua_id();", "public void setIdCliente(int value) {\n this.idCliente = value;\n }", "@Override\n\tpublic Usuario updateUsuario(Long id, Usuario usr) {\n\t\treturn null;\n\t}", "public void setIdUsuarioModificacion(String idUsuarioModificacion1) {\n\t\tthis.idUsuarioModificacion = idUsuarioModificacion1;\n\n\t\tif (idUsuarioModificacion != null\n\t\t\t\t&& idUsuarioModificacion.length() > 32) {\n\t\t\tidUsuarioModificacion = idUsuarioModificacion.substring(0, 32);\n\t\t}\n\n\t}", "public void setId(long id);", "public void setId(long id);", "public void setId(long id);", "public void setId(long id);", "public void setIdcliente(java.lang.String idcliente) {\n this.idcliente = idcliente;\n }", "public void setIdUsuarioRegistro(String idUsuarioRegistro1) {\n\t\tthis.idUsuarioRegistro = idUsuarioRegistro1;\n\n\t\tif (idUsuarioRegistro != null && idUsuarioRegistro.length() > 32) {\n\t\t\tidUsuarioRegistro = idUsuarioRegistro.substring(0, 32);\n\t\t}\n\n\t}", "void setId(Long id);", "public void setIdAutenticacao(int idAutenticacao) {\n\t\tthis.idAutenticacao = idAutenticacao;\n\t}", "public void setId_tecnico(java.lang.Long newId_tecnico);", "@Test\r\n public void testSetID() {\r\n user = userFactory.getUser(\"C\");\r\n user.setID(233);\r\n assertEquals(233, user.getID());\r\n }", "public Usuario(int idUsuario, String nome, String email, String telefone, int motorista){\n\t\tthis.idUsuario = idUsuario;\n\t\tthis.nome = nome;\n\t\tthis.email = email;\n\t\tthis.telefone = telefone;\n\t\tthis.motorista = motorista;\n\t}", "@Override\n\tpublic void setUserId(long userId);", "@Override\n\tpublic void setUserId(long userId);", "public void setUser1_ID (int User1_ID);", "public void setUser1_ID (int User1_ID);", "private void setId(int ida2) {\n\t\tthis.id=ida;\r\n\t}", "public String getIduser() {\n\t\treturn iduser;\n\t}", "private void setId(Integer id) { this.id = id; }", "public void setUserid(java.lang.String userid) {\n this.userid = userid;\n }", "void setId(Integer id);", "private void setId(int value) {\n \n id_ = value;\n }", "public String getIdUser() {\n\t\treturn idUser;\n\t }", "public void setIdInstituicao(Integer idInstituicao) {\n\t\tthis.idInstituicao = idInstituicao;\n\t}", "public void setId(int id){\r\n this.id = id;\r\n }", "@ApiModelProperty(value = \"Unique identifier representing a specific user\")\n public Long getId() {\n return id;\n }", "public UserWithNickAlreadyLogged(int id){\n this.id = id;\n }", "public void setIdAutenticacao(String idAutenticacao) {\n\t\tthis.idAutenticacao = idAutenticacao;\n\t}", "public void setUserId(long value) {\r\n this.userId = value;\r\n }", "public void setId(int id){ this.id = id; }", "public Usuario(String nombre, int edad, long id) {\n this.rvNombreUsuario = nombre;\n this.rvEdadUsuario = edad;\n this.id = id;\n }", "Long getUserId();", "@Test\n public void testSetUsuarioId() {\n System.out.println(\"setUsuarioId\");\n long usuarioId = 0L;\n Reserva instance = new Reserva();\n instance.setUsuarioId(usuarioId);\n \n }", "public void setId(Long id) {this.id = id;}" ]
[ "0.8157944", "0.8127355", "0.7967824", "0.7914445", "0.7814982", "0.77944434", "0.77603114", "0.7710908", "0.77005726", "0.76461565", "0.7599547", "0.7561055", "0.7372793", "0.7368909", "0.73365974", "0.7314588", "0.72931516", "0.71184653", "0.7090812", "0.7059531", "0.7059531", "0.70549077", "0.7054875", "0.7037759", "0.7009396", "0.7008526", "0.70013666", "0.6979263", "0.6979263", "0.6979263", "0.6979263", "0.69700176", "0.69171757", "0.690329", "0.6891543", "0.6891543", "0.6891543", "0.6891543", "0.6891543", "0.6891543", "0.6891543", "0.6891543", "0.6891543", "0.6891543", "0.6891543", "0.6891543", "0.6889005", "0.6877024", "0.6827257", "0.682457", "0.6824037", "0.6811778", "0.68112373", "0.6806807", "0.67777", "0.6774574", "0.6774574", "0.67730826", "0.6765722", "0.67393774", "0.67164415", "0.6696437", "0.6694976", "0.6689131", "0.6678569", "0.66739094", "0.6659425", "0.6655376", "0.6655376", "0.6655376", "0.6655376", "0.6648278", "0.6630184", "0.6613971", "0.6592732", "0.6589085", "0.65864396", "0.6560166", "0.6556689", "0.6556689", "0.65564483", "0.65564483", "0.65285295", "0.652408", "0.65166956", "0.651456", "0.65138996", "0.6513443", "0.6513291", "0.6512718", "0.6503273", "0.650227", "0.6500196", "0.6499556", "0.6494941", "0.6492766", "0.648895", "0.64869493", "0.6485385", "0.6479286" ]
0.66093016
74
Setea la id del perfil de usuario
public void setPerfilId( Long id );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setIdPerfil(Integer idPerfil) {\n this.idPerfil = idPerfil;\n }", "public void setIdperfil(int pIdperfil){\n this.idperfil = pIdperfil;\n }", "public void setIdUsuario(int value) {\n this.idUsuario = value;\n }", "public void setIdUsuario(Integer idUsuario) {\n this.idUsuario = idUsuario;\n }", "public void setIdUser(int value) {\n this.idUser = value;\n }", "public void setId_usuario(String usuario) {\n this.id_usuario = usuario;\n }", "public void setIdUsuario(Integer idUsuario) {\n\t\tthis.idUsuario = idUsuario;\n\t}", "public void setId_user(int id_user) {\r\n this.id_user = id_user;\r\n }", "public void setIdUsuario(String idUsuario) {\n\t\tthis.idUsuario = idUsuario;\n\t}", "public void setId_user(int id_user) {\n this.id_user = id_user;\n }", "public void setIduser(int aIduser) {\n iduser = aIduser;\n }", "public void setIdUser(Integer idUser) {\r\n\t\tthis.idUser = idUser;\r\n\t}", "public void setIdGrupoUsuario(Long idGrupoUsuario) {\n this.idGrupoUsuario = idGrupoUsuario;\n }", "@Override\n public void setId(UserDetailsPk id) {\n this.id = id;\n }", "UserInfo setId(long id);", "public void setUsuarioID(int usuarioID) {\r\n this.usuarioID = usuarioID;\r\n }", "public void ponerUsuarioInactivo(String idUsuario);", "public void setIdUser(String idUser) {\n\t\tthis.idUser = idUser;\n\t}", "@Override\n public void setUserId(long userId) {\n _partido.setUserId(userId);\n }", "public void setUsua_id(java.lang.Long newUsua_id);", "@Override\n\tvoid setId(final UserId userId);", "public Integer getIdPerfil() {\n return idPerfil;\n }", "public void setPerfil(int perfil){\n this.perfil = perfil;\n }", "public void setId(int idNuevo)\n { \n this.id = idNuevo;\n }", "void setUser(User user, int id) {\n this.user = user;\n this.id = id;\n }", "public void modificarUsuario(Long id, String nombre);", "private void setUserId(int value) {\n \n userId_ = value;\n }", "public int getIdUsuario() {\n return idUsuario;\n }", "Perfil findByIdPerfil(Long idPerfil);", "public void setUserId(long userId);", "public void setUserId(long userId);", "public void setUserId(long userId);", "public void setUserId(long userId);", "public void setIdacesso(int pIdacesso){\n this.idacesso = pIdacesso;\n }", "public int getId_usuario() {\n\treturn id_usuario;\n }", "public void setIdPermisos(int idPermisos)\r\n\t{\r\n\t\tthis.idPermisos = idPermisos;\r\n\t}", "public void setIdfilial(int idfilial){\r\n this.idfilial = idfilial;\r\n }", "void setUserId(Long userId);", "public void setIdUsuarioModificacion(String idUsuarioModificacion1) {\n\t\tthis.idUsuarioModificacion = idUsuarioModificacion1;\n\n\t\tif (idUsuarioModificacion != null\n\t\t\t\t&& idUsuarioModificacion.length() > 32) {\n\t\t\tidUsuarioModificacion = idUsuarioModificacion.substring(0, 32);\n\t\t}\n\n\t}", "void setUserId(int newId) {\r\n\t\t\tuserId = newId;\r\n\t\t}", "public void setPersonaId(long value) {\n this.personaId = value;\n }", "public void setIdProfilo(Integer idProfilo) {\n\t\tthis.idProfilo = idProfilo;\n\t}", "@Override\n public long getUserId() {\n return _partido.getUserId();\n }", "public void setUserId(int value) {\n this.userId = value;\n }", "public int getIduser() {\n return iduser;\n }", "public int getIdUser() {\n return idUser;\n }", "public int getIdUser() {\n return idUser;\n }", "@Override\n public void definirId(Endereco objeto, int id) {\n objeto.setId(id);\n }", "public void setIdproducto(int idproducto) {\r\n\t\tthis.idproducto = idproducto;\r\n\t}", "@Override\n\tpublic Usuario updateUsuario(Long id, Usuario usr) {\n\t\treturn null;\n\t}", "public long getIdUsuario() {\n\t\treturn idUsuario;\n\t}", "public void setUserid(java.lang.String value) {\n this.userid = value;\n }", "public String getId_usuario() {\n return id_usuario;\n }", "public Integer getIdUsuario() {\n return idUsuario;\n }", "public void setFotoPerfil(Part foto){\n if(foto == null){\n throw new IllegalArgumentException(\"Foto de perfil de usuario igual a null\");\n }\n fotoPerfil = foto;\n }", "public void setId(int id){\r\n this.id = id;\r\n }", "public void setUser1X_ID (int User1X_ID);", "public Integer getIdUsuario() {\n\t\treturn idUsuario;\n\t}", "public void setIdGrupoDocumento(int value) {\n this.idGrupoDocumento = value;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "public void setUserid(Integer userid) {\n this.userid = userid;\n }", "private void setUserId(long value) {\n \n userId_ = value;\n }", "public void setId( Long id );", "public void setId(long id);", "public void setId(long id);", "public void setId(long id);", "public void setId(long id);", "public void setIdGrupo(String idGrupo) {\n\t\tthis.idGrupo = idGrupo;\n\t}", "void setId(Long id);", "public void setIdInstituicao(Integer idInstituicao) {\n\t\tthis.idInstituicao = idInstituicao;\n\t}", "public TipoUsuario(int id_tipousuario) {\n this.id_tipousuario = id_tipousuario;\n }", "public void setId(Long id) {this.id = id;}", "public void setId(Long id) {this.id = id;}", "public void setId(int id){ this.id = id; }", "public void setId(String uid){\n this.uid = uid;\n }", "public void setUserid(Long userid) {\r\n this.userid = userid;\r\n }", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "public void setIdCliente(Integer id_cliente){\n this.id_cliente=id_cliente;\n }", "private void setUserId(long value) {\n\n userId_ = value;\n }", "private void setId(Integer id) { this.id = id; }", "public String getIdUsuarioModificacion() {\n\t\treturn this.idUsuarioModificacion;\n\t}", "public Usuario(int idUsuario, String nome, String email, String telefone, int motorista){\n\t\tthis.idUsuario = idUsuario;\n\t\tthis.nome = nome;\n\t\tthis.email = email;\n\t\tthis.telefone = telefone;\n\t\tthis.motorista = motorista;\n\t}", "private void setId(int ida2) {\n\t\tthis.id=ida;\r\n\t}", "public void setId(long id) { this.id = id; }", "public void setId(long id) { this.id = id; }", "void setId(Integer id);", "public String getIdUsuario() {\n\t\treturn idUsuario;\n\t}", "public String getIdUsuario() {\n\t\treturn idUsuario;\n\t}", "public void setId(long id){\n this.id = id;\n }" ]
[ "0.75922984", "0.73556226", "0.7332325", "0.715578", "0.7144387", "0.70895046", "0.69118243", "0.68894017", "0.68552804", "0.6854307", "0.6794076", "0.6768845", "0.6659275", "0.6590081", "0.65819764", "0.6580273", "0.65754765", "0.6572943", "0.6535588", "0.64734906", "0.64685297", "0.6433533", "0.64263827", "0.64212155", "0.6247071", "0.62150854", "0.6203173", "0.6185178", "0.6165719", "0.6164661", "0.6164661", "0.6164661", "0.6164661", "0.6138271", "0.6136118", "0.6110889", "0.6110477", "0.61059827", "0.61034834", "0.6095603", "0.606791", "0.60655594", "0.606383", "0.60636264", "0.60565937", "0.6031093", "0.6031093", "0.60296875", "0.6025224", "0.6015647", "0.5989019", "0.5983088", "0.595301", "0.5947464", "0.59295636", "0.5927703", "0.59237623", "0.59200996", "0.5918674", "0.5912905", "0.5912905", "0.5912905", "0.5912905", "0.5912905", "0.5912905", "0.5912905", "0.5912905", "0.5912905", "0.5912905", "0.5912905", "0.5912905", "0.59126806", "0.590873", "0.5905662", "0.5905662", "0.5905662", "0.5905662", "0.590095", "0.5892769", "0.58915895", "0.5890862", "0.58881813", "0.58881813", "0.58853436", "0.5868932", "0.58681726", "0.58445436", "0.58445436", "0.5842231", "0.58392584", "0.5834548", "0.5834501", "0.58338326", "0.582714", "0.58121943", "0.58121943", "0.5804976", "0.5796936", "0.5796936", "0.57953614" ]
0.76084405
0
Agrega un nuevo acceso permitido al usuario
public void addAccess(String accessId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void AsignarPermiso(Permiso p){\n\t\tPermisoRol pr = new PermisoRol(p,this);\n\t\tpermisos.add(pr);\n\t}", "private void metodoSalvarUsuarioFirebase(final Usuarios variavelClasseUsuarios) {\n\n refAutenticacaofb = ConfiguracaoFirebase.metodoAutenticacaoFirebase();\n refAutenticacaofb.createUserWithEmailAndPassword(variavelClasseUsuarios.getEmail(),\n variavelClasseUsuarios.getSenha()).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if(task.isSuccessful()){\n\n idUsuario = task.getResult().getUser().getUid();\n variavelClasseUsuarios.setId(idUsuario);\n variavelClasseUsuarios.salvarUsuario();\n\n if(pegarTipoUsuarioSwitch() == \"Cliente\"){\n\n startActivity(new Intent(CadastroUsuario.this, Home.class));\n finish();\n Toast.makeText(CadastroUsuario.this, \"Usuário salvo com sucesso\", Toast.LENGTH_LONG).show();\n }else{\n\n startActivity(new Intent(CadastroUsuario.this, PainelEmpresa.class));\n finish();\n Toast.makeText(CadastroUsuario.this, \"Empresa inserida com sucesso!\", Toast.LENGTH_LONG).show();\n }\n\n\n }\n\n\n\n }\n });\n\n }", "private void btnAgregarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {\n String v_nombre=\" \";\n\n if(txtNombreAU.getText().length()==0){\n Utilidades.mensajeInformacion(\"Digite un nombre, por favor\", \"Informacion\");\n return;\n }\n v_nombre=txtNombreAU.getText(); \n //Valido la contrasenia\n if(txtContraseniaAU.getText().length()==0){\n Utilidades.mensajeInformacion(\"Es obligatorio ingresar una contraseña\", \"Informacion\");\n return;\n }\n if(!validarContraseniaUsuario(txtContraseniaAU.getText())){\n return;\n }\n String v_contrasenia=txtContraseniaAU.getText();\n //Valido nombre completo\n if(txtNombreCompletoAU.getText().length()==0){\n Utilidades.mensajeInformacion(\"Es obligatorio ingresar el nombre completo\", \"Informacion\");\n return;\n }\n String v_nombreCompleto=txtNombreCompletoAU.getText();\n \n //Valido que se escogio un valor para el cargo\n int v_cargo=0;\n //10 = Administrador, 20=Funcionario\n if(rbtnAdministradorAU.isSelected()){\n v_cargo=10;\n }else if(rbtnFuncionarioAU.isSelected()){\n v_cargo=20;\n }else{\n Utilidades.mensajeInformacion(\"Escoga un cargo\", \"Informacion\");\n return;\n }\n \n //Creo y agreggo un usuario dependiendo del cargo escogido (Administrador o funcionario)\n try{\n boolean agregado=false;\n if(v_cargo==10){\n Administrador nuevoUsuario=new Administrador(v_nombre, v_contrasenia, v_nombreCompleto, null);\n agregado = administrador.agregarUsuario(nuevoUsuario);\n\n } \n if(v_cargo==20){\n Funcionario nuevoUsuario=new Funcionario(v_nombre, v_contrasenia, v_nombreCompleto, null);\n agregado = administrador.agregarUsuario(nuevoUsuario);\n }\n\n\n if(agregado){\n Utilidades.mensajeExito(\"Se agrego el Usuario\", \"Agregacion Exitosa\");\n limpiarCamposAgregarUsuario();\n }else{\n Utilidades.mensajeError(\"El Usuario a agregar ya existe\", \"Error\");\n }\n\n }catch (IOException ex) {\n Logger.getLogger(Funcionario.class.getName()).log(Level.SEVERE, null, ex);\n Utilidades.mensajeAdvertencia(\"Se ha interrumpido la conexion con el servidor\", \"Error\");\n }\n \n }", "void add(User user) throws AccessControlException;", "protected void accionUsuario() {\n\t\t\r\n\t}", "public void addAmigo() {\n\t\tusuarioidentificado.enviar_solicitud(Parametros.getIdUsuario(), amigo.getIdUsuario());\n\t}", "public void grantAdministrate(User user) throws ServiceException{\n }", "public UsuarioRegistrado(String nombre, String contrasena, Date fechanac) {\n\t\tsuper(nombre, contrasena);\n\t\tthis.fechanac = fechanac;\n\n\t\tbloqueado = false;\n\t\tpremium = false;\n\t\treproducciones = 0;\n\t\tcanciones = new ArrayList<>();\n\t\talbumes = new ArrayList<>();\n\t\tlistas = new ArrayList<>();\n\t\tseguidos = new ArrayList<>();\n\t}", "@Override\n\tpublic void registrarAtencion(TramiteUsuario tramite) {\n\t\ttramite.setSecUsuario1( Usuario.getUsuarioBean() );\n\t\ttramite.setSecUsuario2( Usuario.getUsuarioBean() );\n\t\ttramite.setEstado(1);\n\t\ttramite.setEstadoTramiteFinal( ParametroUtil.EstadoTramite.ATENDIDO.value );\n\t\ttramite.setFechaRegistro( new Date() );\n\t\ttramiteDAO.registrarMovimiento( tramite );\n\t\t\n\t\ttramite.getTramite().setEstado( ParametroUtil.EstadoTramite.ATENDIDO.value );\n\t\ttramiteDAO.registrar( tramite.getTramite() );\n\t\t\n\t}", "private void RealizarAccion() {\n if (ValidarCampos()) {\n\n persona.setPrimerNombre(txtPrimerNombre.getText());\n persona.setSegundoNombre(txtSegundoNombre.getText());\n persona.setPrimerApellido(txtPrimerApellido.getText());\n persona.setSegundoApellido(txtSegundoApellido.getText());\n persona.setTelefono(txtTelefono.getText());\n persona.setCedula(txtCedula.getText());\n persona.setCorreo(txtCorreo.getText());\n persona.setDireccion(txtDireccion.getText());\n\n empleado.setFechaInicio(dcFechaInicio.getDate());\n empleado.setSalario(Double.parseDouble(txtSalario.getText()));\n empleado.setCargo(txtCargo.getText());\n empleado.setUsuarioByUserModificacion(SessionHelper.usuario);\n empleado.setFechaModificacion(new Date());\n empleado.setRegAnulado(false);\n\n switch (btnAction.getText()) {\n case \"Guardar\":\n int maxid = personaBean.MaxId() + 1;\n persona.setIdPersona(maxid);\n\n Dbcontext.guardar(persona);\n\n empleado.setIdEmpleado(maxid);\n empleado.setPersona(persona);\n empleado.setUsuarioByUserCreacion(SessionHelper.usuario);\n empleado.setFechaCreacion(new Date());\n\n Dbcontext.guardar(empleado);\n break;\n\n case \"Actualizar\":\n\n Dbcontext.actualizar(persona);\n\n Dbcontext.actualizar(empleado);\n break;\n }\n if (ifrRegistroEmpleados.isActive) {\n ifrRegistroEmpleados.CargarTabla();\n }\n\n Mensajes.OperacionExitosa(this);\n dispose();\n } else {\n Mensajes.InformacionIncompleta(this);\n }\n }", "public void cadastrarUsuario(final Usuario usuario){\n mAuth = ConfiguracaoFirebase.getFirebaseAuth();\n mAuth.createUserWithEmailAndPassword(\n usuario.getEmail(),usuario.getSenha()\n ).addOnCompleteListener(\n this, new OnCompleteListener<AuthResult>() {\n //Verifica exceções e se o usuário se cadastrou\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n Toast.makeText(getApplicationContext(),\"Usuário cadastrado com sucesso!\",Toast.LENGTH_SHORT).show();\n finish();\n //Convertendo email em base 64 para ser usado como uidPessoa\n try {\n String identificadorUsuario = Base64Custom.codificarBase64(FirebaseAuth.getInstance().getCurrentUser().getEmail());\n usuario.setUidPessoa(identificadorUsuario);\n usuario.setNome(FirebaseAuth.getInstance().getCurrentUser().getDisplayName());\n usuario.setEmail(FirebaseAuth.getInstance().getCurrentUser().getEmail());\n usuario.setPontos(1);\n usuario.salvar();\n cadastrarUsuario(usuario);\n logarUsuario(usuario);\n abrirTelaPrincipal();\n }catch (Exception e){\n e.printStackTrace();\n }\n }else {String excecao = \"\";\n try{\n throw task.getException();\n\n }catch (FirebaseAuthWeakPasswordException e){\n excecao = \"Digite uma senha forte!\";\n }catch (FirebaseAuthInvalidCredentialsException e){\n excecao = \"Por favor, digite um e-mail válido\";\n }catch (FirebaseAuthUserCollisionException e){\n excecao = \"esta conta já está cadastrada\";\n }catch (Exception e){\n excecao = \"Erro ao cadastrar usuário\" + e.getMessage();\n e.printStackTrace();\n }\n Toast.makeText(getApplicationContext(),excecao,Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "public void registrar() {\n try {\r\n do {\r\n //totalUsuarios = this.registraUnUsuario(totalUsuarios);\r\n this.registraUnUsuario();\r\n } while (!this.salir());\r\n } catch (IOException e) {\r\n flujoSalida.println(\"Error de entrada/salida, finalizará la aplicación.\");\r\n }\r\n flujoSalida.println(\"Total usuarios registrados: \"+totalUsuarios);\r\n }", "public void registrarAdministrador() throws IOException {\n\n //asignamos al usuario la imagen de perfil default\n usuarioView.setUsuarioFotoRuta(getPathDefaultUsuario());\n usuarioView.setUsuarioFotoNombre(getNameDefaultUsuario());\n\n //Se genera un login y un pass aleatorio que se le envia al proveedor\n MD5 md = new MD5();\n GenerarPassword pass = new GenerarPassword();\n SendEmail email = new SendEmail();\n\n password = pass.generarPass(6);//Generamos pass aleatorio\n\n //Encriptamos las contraseñas\n usuarioView.setUsuarioPassword(md.getMD5(password));//Se encripta la contreseña\n usuarioView.setUsuarioRememberToken(md.getMD5(password));\n\n //el metodo recibe los atributos, agrega al atributo ciudad del objeto usuario un objeto correspondiente, \n //de la misma forma comprueba el rol y lo asocia, por ultimo persiste el usuario en la base de datos\n usuarioView.setSmsCiudad(ciudadDao.consultarCiudad(usuarioView.getSmsCiudad()));//Asociamos una ciudad a un usuario\n usuarioView.setSmsRol(rolDao.consultarRol(usuarioView.getSmsRol()));//Asociamos un rol a un usuario\n usuarioView.setUsuarioEstadoUsuario(1);//Asignamos un estado de cuenta\n usuarioView.setSmsNacionalidad(nacionalidadDao.consultarNacionalidad(usuarioView.getSmsNacionalidad()));\n\n //registramos el usuario y recargamos la lista de clientes\n usuarioDao.registrarUsuario(usuarioView);\n usuariosListView = adminDao.consultarUsuariosAdministradores();\n\n //Enviar correo\n email.sendEmailAdministradorBienvenida(usuarioView, password);\n\n //limpiamos objetos\n usuarioView = new SmsUsuario();\n password = \"\";\n }", "public void ponerUsuarioInactivo(String idUsuario);", "public void grantModerate(User user) throws ServiceException{\n }", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,TarjetaCredito tarjetacredito,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(TarjetaCreditoConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(tarjetacredito.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,TarjetaCreditoDataAccess.TABLENAME, tarjetacredito.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(TarjetaCreditoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////TarjetaCreditoLogic.registrarAuditoriaDetallesTarjetaCredito(connexion,tarjetacredito,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(tarjetacredito.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!tarjetacredito.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,TarjetaCreditoDataAccess.TABLENAME, tarjetacredito.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////TarjetaCreditoLogic.registrarAuditoriaDetallesTarjetaCredito(connexion,tarjetacredito,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,TarjetaCreditoDataAccess.TABLENAME, tarjetacredito.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(tarjetacredito.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,TarjetaCreditoDataAccess.TABLENAME, tarjetacredito.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(TarjetaCreditoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////TarjetaCreditoLogic.registrarAuditoriaDetallesTarjetaCredito(connexion,tarjetacredito,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "private void NuevoUsuario(String IDFacebook, Usuarios nuevo)\n {\n final String szIDFacebook = IDFacebook;\n\n // Guardamos los datos del nombre del usuario\n Helpers.setNombre(getActivity(), nuevo.NOMBRE);\n\n // Datos de la solicitud\n cliente.post(getActivity(), Helpers.URLApi(\"nuevousuario\"), Usuarios.ToStringEntity(nuevo), \"application/json\", new AsyncHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\n super.onSuccess(statusCode, headers, responseBody);\n\n try\n {\n // Obtenemos el objeto JSON\n JSONObject objeto = Helpers.ResponseBodyToJSON(responseBody);\n\n // Si está OK\n if (objeto.isNull(\"Error\"))\n {\n // Guardamos el token del usuario\n Helpers.setTokenAcceso(getActivity(), objeto.getJSONObject(\"usuario\").getString(\"token\"));\n\n // Guardamos el nombre del usuario\n Helpers.setNombre(getActivity(), objeto.getJSONObject(\"usuario\").getString(\"nombre\"));\n\n // Subimos la foto del usuario\n GetPictureFacebook(szIDFacebook, objeto.getJSONObject(\"usuario\").getString(\"imagen\"));\n }\n else\n {\n // Mostramos la ventana de error\n Helpers.MostrarError(getActivity(), objeto.getString(\"Error\"));\n }\n } catch (JSONException ex) {\n // Mostramos la ventana de error\n Helpers.MostrarError(getActivity(), getString(R.string.notcreateuser));\n }\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {\n // Mostramos la ventana de error\n Helpers.MostrarError(getActivity(), getString(R.string.notcreateuser));\n }\n });\n }", "public void aceitarPedido(Usuario novoAmigo, Usuario logado) {\n logado.getAmigos().put(novoAmigo.getLogin(), novoAmigo);\n logado.getPedidosAmizade().removeKey(novoAmigo.getLogin());\n novoAmigo.getAmigos().put(logado.getLogin(), logado);\n }", "@Override\r\n public void modificarUsuario(User u) {\r\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\r\n }", "public String registrarExtra(){\n\t\tFacesContext context = FacesContext.getCurrentInstance();\n\t\tActividad actividad = context.getApplication().evaluateExpressionGet(context, \"#{actividad}\", Actividad.class);\n\t\tEncargado encargado = context.getApplication().evaluateExpressionGet(context, \"#{encargado}\", Encargado.class);\n\t\t\n\t\ttry {\n\t\t\tactividad.registrarActividad_Encargado(encargado.getCedula());\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\t\n\t\t\t\t\t\n\t\t// put the user object into the POST request \n\t\tFacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"actividad\", actividad);\n\t\t\n\t\treturn \"principalAdministrador.xhtml\";\n\t}", "@Override\n public void onClick(View v) {\n trasferisci_utente();\n\n // controlla se tutti i dati sono inseriti\n if (checkInput())\n {\n creaUser();\n NOME = username.getText().toString();\n CHIAVE = password.getText().toString();\n\n // controlla se l'utente USER con i dati inseriti negli edit_text è gia presente\n if (checkUser(persone, NOME, CHIAVE)) {\n\n errore_utente.setVisibility(View.GONE);\n\n // impedisce a due utenti di avere lo stesso username\n if(checkUsername(persone, NOME)) {\n\n errore_duplicato_username.setVisibility(View.GONE);\n\n persone.add(user);\n\n Intent showResult = new Intent(Registration.this, MainActivity.class);\n showResult.putExtra(PERSONA_PATH, persone);\n //showResult.putExtra(UTENTE_PATH, user);\n startActivity(showResult);\n } else {\n errore_duplicato_username.setVisibility(View.VISIBLE);\n }\n } else {\n errore_utente.setVisibility(View.VISIBLE);\n }\n }\n }", "public void ajouterRole(RoleUtilisateur ru);", "public String registrarActividad(){\n\t\tFacesContext context = FacesContext.getCurrentInstance();\n\t\tBloque bloque = context.getApplication().evaluateExpressionGet(context, \"#{bloque}\", Bloque.class);\n\t\tActividad actividad = context.getApplication().evaluateExpressionGet(context, \"#{actividad}\", Actividad.class);\n\t\tEncargado encargado = context.getApplication().evaluateExpressionGet(context, \"#{encargado}\", Encargado.class);\n\t\t\n\t\ttry {\n\t\t\tactividad.registrarActividad();\n\t\t\tactividad.registrarActividad_Bloque(bloque.getTematica());\n\t\t\tactividad.registrarActividad_Encargado(encargado.getCedula());\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\t\n\t\t\t\t\t\n\t\t// put the user object into the POST request \n\t\tFacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"actividad\", actividad);\n\t\t\n\t\treturn \"principalAdministrador.xhtml\";\n\t}", "com.soa.SolicitarCreditoDocument.SolicitarCredito addNewSolicitarCredito();", "Boolean registerNewUser(User user);", "public void agregarNuevoUsuarioAdmin(){\n //recupero objeto rol administrador\n usuario.setRol(new ListadoRoles().getListaRoles().get(0));\n usuarioBean.setUsuario(usuario);\n usuarioBean.agregarUsuario();\n FacesContext context = FacesContext.getCurrentInstance(); \n context.addMessage(null, new FacesMessage(\"Éxito\", \"Se agregó un Usuario Administrador correctamente.\" ));\n RequestContext.getCurrentInstance().execute(\"PF('dlgAltaUsuario').hide();\");\n }", "public boolean insertAcceso(String username, int id){\n boolean retorno = false;\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"USERNAME\",username);\n contentValues.put(\"ID\",id);\n long resul = db.insert(\"ACCESO\",null,contentValues);\n db.close();\n if (resul ==-1){\n retorno=false;\n }else{\n retorno=true;\n }\n return retorno;\n }", "private void commitApuesta() {\n\t\tif(tipo != -1){\n\t\t\tmodelo.setDestLogin(ModeloApuestas.DEST_APOSTUBERRI);\n\t\t\tmodelo.setApuestaInProgress(apostado.get(), tipo);\n\t\t\tif(!myController.isScreenLoaded(\"login\")){\n\t\t\t\tmyController.loadScreen(ScreensFramework.Login, ScreensFramework.Login_FXML);\n\t\t\t}\n\t\t\tmyController.setScreenOverlay(\"login\");\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\r\n public void registrarUsuario(User u) {\r\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\r\n }", "public void grantPermissionPending(String objectId, String objectType, User user, List<String> actions) throws UserManagementException;", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,PresuTipoProyecto presutipoproyecto,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(PresuTipoProyectoConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(presutipoproyecto.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PresuTipoProyectoDataAccess.TABLENAME, presutipoproyecto.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(PresuTipoProyectoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////PresuTipoProyectoLogic.registrarAuditoriaDetallesPresuTipoProyecto(connexion,presutipoproyecto,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(presutipoproyecto.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!presutipoproyecto.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,PresuTipoProyectoDataAccess.TABLENAME, presutipoproyecto.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////PresuTipoProyectoLogic.registrarAuditoriaDetallesPresuTipoProyecto(connexion,presutipoproyecto,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PresuTipoProyectoDataAccess.TABLENAME, presutipoproyecto.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(presutipoproyecto.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PresuTipoProyectoDataAccess.TABLENAME, presutipoproyecto.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(PresuTipoProyectoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////PresuTipoProyectoLogic.registrarAuditoriaDetallesPresuTipoProyecto(connexion,presutipoproyecto,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "public void InsertarProceso(Proceso nuevo) {\n\t\tif (raiz.sig == raiz) {\n\t\t\traiz.sig = nuevo;\n\t\t\tthis.cabeza = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\tnuevo.padre = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t} else {\n\t\t\tProceso aux = raiz.padre;\n\t\t\taux.sig = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t\tnuevo.padre = aux;\n\t\t}\n\t\tthis.numProcesos++;\n\t}", "@Test(groups = \"user\", priority = 1)\n public void testUserAdd() throws ExecutionException, InterruptedException {\n this.authDisabledAuthClient.userAdd(root, rootPass).get();\n this.authDisabledAuthClient.userAdd(user, userPass).get();\n }", "@Override\n\tpublic void crearUsuario(UsuarioEntity Usuario) {\n\t\treposUsuarios.save(Usuario);\n\t}", "protected void agregarUbicacion(){\n\n\n\n }", "@PostMapping(\"/guardarPerfil\")\n public String guardarPerfil(Usuario usuario) {\n repoUsuario.save(usuario);\n\n return \"redirect:/gestion/perfil\";\n }", "@Override\n public void onClick(View v) {\n\n String Id = FCMdatabase.push().getKey();\n residentUser user = new residentUser(Id.toString(), txtusername.getText().toString(), txtpassword.getText().toString(), \"\");\n FCMdatabase.child(Id).setValue(user);\n Toast.makeText(getContext(), \"user added successfully\", Toast.LENGTH_SHORT).show();\n }", "private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }", "private void registrarDatosBD(String nombre, String apellido, String usuario, String clave, String fnacim) {\n\t\tUsuario u = new Usuario(0, nombre, apellido, usuario, clave, fnacim, 0, 0);\n\t\t// 02. Registrar el obj usando la clase de gestion y guardando\n\t\tint ok = new GestionUsuarios().registrar(u);\n\n\t\t// salidas\n\t\tif (ok == 0) {\n\t\t\tJOptionPane.showMessageDialog(this, \"Error al registrar\");\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(this, \"Registro OK\");\n\t\t}\n\t}", "private void charge_up() throws GB_Exception {\n try{\n if(PersonalDataController.getInstance().existRegistry(username)){\n putPersonalInformation();\n }else{\n putDefaultInformation();\n }\n } catch (SQLException | IOException ex) {\n LOG.error(ex);\n throw new GB_Exception(\"Error al carga informacion de usuario. Comuniquese con su administrador.\");\n }\n }", "private void newUser(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\ttry {\n\t\t\tPrintWriter out = res.getWriter();\n\t\t\tString name = req.getParameter(Constants.NAME_USER);\n\t\t\tUserDB.introduceUser(name);\n\t\t\tlong id = UserDB.getUserId(name);\n\t\t\tUsuario u = new Usuario(name, Long.toString(id));\n\t\t\tout.print(gson.toJson(u));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tres.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n\t\t}\n\t}", "private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }", "public void requestAccountCreation(Secretary sec) {\n \n System.out.println(this.iD + \": Requesting account creation from secretary \" + sec.iD);\n sec.addToWaitingListForApproval(this);\n }", "void registerUser(User newUser);", "@Override\n\tpublic int addAccount(AccountUser au) {\n\t\tau.setName(au.getUsername());\n\t\tau.setStatus(1);\n\t\tau.setPwd(\"666666\");\n\t\tau.setSalt(CommTool.getSalt());\n\t\tau.setPwd(PasswordUtil.generate(au.getPwd(), au.getSalt()));\n\t\treturn auMapper.addAccount(au);\n\t}", "public SecUserrole getNewSecUserrole();", "@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n\n FirebaseUser usuarioActual = FirebaseAuth.getInstance().getCurrentUser();\n UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()\n .setDisplayName(name.getText().toString() + \" \" + lastname.getText().toString()).build();\n usuarioActual.updateProfile(profileUpdates);\n\n ref.child(projectnameNew.getText().toString());\n\n Intent i = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(i);\n }\n if (!task.isSuccessful()) {\n Toast.makeText(RegisterActivity.this, \"Algo está mal :C\",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }", "@Override\n\tpublic void emprestimo(Livros livro, Usuarios usuario) {\n\t\t\n\t}", "@Override\r\n\tpublic boolean createUser(Utilisateur u) {\n\t\treturn false;\r\n\t}", "private void addPrivilegedUser(ActionEvent actionEvent) {\n if (addUserMenu.getSelectionModel().getSelectedItem() != null) {\n for (User user : server.getUser()) {\n if (user.getName().equals(addUserMenu.getSelectionModel().getSelectedItem())) {\n selectedAddUser = user;\n }\n }\n // set selected user to channel as privileged\n channel.withPrivilegedUsers(selectedAddUser);\n // update addMenu\n addUserMenu.getItems().clear();\n for (User user : server.getUser()) {\n if (!user.getPrivileged().contains(channel)) {\n addUserMenu.getItems().add(user.getName());\n }\n }\n // update removeMenu\n removeUserMenu.getItems().clear();\n for (User user : server.getUser()) {\n if (user.getPrivileged().contains(channel)) {\n removeUserMenu.getItems().add(user.getName());\n }\n }\n channelPrivilegedUserUpdate();\n }\n }", "private void actualitzaPasswd(String nou){\n user.setPasswd(nou);\n try{\n helperU.actualitzar(user, false);\n \n info(\"Contrasenya actualitzada!\");\n }catch(Exception ex){\n avis(\"Error al actualitzar la contrasenya!\");\n }\n }", "@Override\r\n\tpublic Utilisateur addUser() {\n\t\treturn null;\r\n\t}", "public int createAccount(User user) throws ExistingUserException,\n UnsetPasswordException;", "public void createAccount(){\n System.out.println(\"vi skal starte \");\n }", "@Secured(\"ROLE_ADMIN\")\n\t@PostMapping(value= \"/usuario\")\n public ResponseEntity<Profesional> createUsuario(@RequestBody Registro registro,BindingResult bindingResult){\n \tRole rol = roleService.findOne((long) 3);\n \tProfesional profesional = registro.getProfesional();\n try {\n \tprofesional.setEstado_profesional(estadoProfService.findOne((long) 1));// se le da el estado habilitado\n \tprofesionalService.save(profesional);\n \tregistro.getUsuario().setPassword(passwordEncoder.encode(registro.getUsuario().getPassword()));\n \tregistro.getUsuario().setEnable(true);\n \tusuarioService.save(registro.getUsuario());\n \t usuarioService.saveUsuario_Roles(registro.getUsuario().getId_Usuario(),rol.getId_Role() );\n }catch(DataAccessException e) {\n return new ResponseEntity<Profesional>(HttpStatus.INTERNAL_SERVER_ERROR);\n }\n return new ResponseEntity<Profesional>(profesional,HttpStatus.CREATED);\n }", "public static void sair() throws AcessoException {\r\n //Impede de mais de um administrador\r\n if(usuario == null) {\r\n throw new AcessoException(\"O administrador não está logado.\");\r\n }\r\n //Saída\r\n usuario = null;\r\n //Define data e hora de saída\r\n dataHoraSai = new java.util.Date();\r\n }", "public void newUser(User user);", "public Proceso atender() {\n\t\tProceso proceso = raiz.sig;\n\t\tif (proceso == this.raiz) {\n\t\t\tSystem.out.println(\"Cola Vacia\");\n\t\t\treturn null;\n\t\t}\n\t\tProceso sig = proceso.sig;\n\t\tProceso padre = raiz;\n\t\tpadre.sig = sig;\n\t\tsig.padre = padre;\n\t\tcabeza = sig;\n\t\tthis.numProcesos--;\n\t\tthis.calcularTiemposProcesos();\n\t\treturn proceso;\n\t}", "public void adicionaUsuario(Usuario usuario) {\n\t\tusuarios.put(usuario.getLogin(), usuario);\n\t}", "private void controladorUser(Controlador controlador){\n this.contUserCrearProyecto = controlador.getUserCrearProyecto();\n inicioUser.setControlCrearProyecto(contUserCrearProyecto);\n \n this.contUserCrearColectivo = controlador.getUserCrearColectivo();\n inicioUser.setControlCrearColectivo(contUserCrearColectivo);\n\n this.contInformes = controlador.getInformes();\n inicioUser.setControlSolicitarInformes(contInformes); \n \n this.contFiltrar = controlador.getFiltrar();\n inicioUser.setControlFiltrar(contFiltrar);\n\n this.contLimpiar = controlador.getLimpiarFiltro();\n inicioUser.setControlLimpiarFiltro(contLimpiar);\n }", "@PutMapping(\"/anuncios/crear/{idAutor}\")\n public void createAnuncio(@PathVariable Long idAutor, @RequestBody Anuncio nuevoAnuncio) throws DataConsistencyException {\n anuncioService.crearAnuncio(idAutor, nuevoAnuncio);\n }", "public void registro(View v) {\n\t\tsubeUsuario();\n\t\tif (userId == -1) { // si es nuevo\n\t\t\tfinish(); // hay que dejar que el server devuelva el id y leerlo\n\t\t}\n\t}", "public void addUsuario(Usuario usuario) {\n\t\t\n\t}", "private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}", "@Override\n\tpublic Usuario modificar() {\n\t\tLOG.info(\"Se modifico el usuario de la bd\");\n\t\treturn usuario;\n\t}", "public void registrarUsuario(String cedula, String nombre, String apellido, String correo, String contrasena) {\n\n usuario = new Usuario(cedula, nombre, apellido, correo, contrasena);\n usuarioDAO.create(usuario);\n\n }", "@Override\r\n\tpublic void guardar(Usuario usuario) {\n\t\tString pw = usuario.getPassword();\r\n\t\tBCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder(4);\r\n\t\tusuario.setPassword(bCryptPasswordEncoder.encode(pw));\r\n\t\tiUsuario.save(usuario);\r\n\t}", "public synchronized void grantAdminPrivilege(UserEntity userEntity) {\n final PrivilegeEntity adminPrivilege = new PrivilegeEntity();\n adminPrivilege.setPermission(permissionDAO.findAmbariAdminPermission());\n adminPrivilege.setPrincipal(userEntity.getPrincipal());\n adminPrivilege.setResource(resourceDAO.findAmbariResource());\n if (!userEntity.getPrincipal().getPrivileges().contains(adminPrivilege)) {\n privilegeDAO.create(adminPrivilege);\n userEntity.getPrincipal().getPrivileges().add(adminPrivilege);\n principalDAO.merge(userEntity.getPrincipal()); //explicit merge for Derby support\n userDAO.merge(userEntity);\n }\n }", "@POST\n\t@Path(\"/accesos\")\n\t@Consumes(MediaType.APPLICATION_FORM_URLENCODED)\n\t@Produces(MediaType.APPLICATION_JSON)\n\t@Secured\n\tpublic RespuestaDTO accesos(@FormParam(value = \"usuario\") String usuario) {\n\t\tList<Rol> roles = accesoRolEJB.listarRoles(usuario);\n\t\tList<Acceso> accesos = accesoRolEJB.listarAccesos();\n\t\tif (!roles.isEmpty()) {\n\t\t\tAccesoRolDTO obj = new AccesoRolDTO(accesos, roles, usuario);\n\t\t\treturn new RespuestaDTO(obj);\n\t\t} else {\n\t\t\treturn new RespuestaDTO(null, \"Usted no cuenta con accesos asignados\", \"-1\");\n\t\t}\n\t}", "public void createUserAccount(UserAccount account);", "private void checkUserAuthorities() {\n\t\tAuthority auth = authorityRepository.findTop1ByName(AuthorityType.ROLE_ADMIN);\n\t\tif (null == auth) {\n\t\t\tauth = Authority.createAdmin();\n\t\t\tauthorityRepository.save(auth);\n\t\t}\n\t\tAuthority authUser = authorityRepository.findTop1ByName(AuthorityType.ROLE_USER);\n\t\tif (null == authUser) {\n\t\t\tauthUser = Authority.createUser();\n\t\t\tauthorityRepository.save(authUser);\n\t\t}\n\t}", "public void createAgendamento() {\n\n if (tbagendamento.getTmdataagendamento().after(TimeControl.getDateIni())) {\n if (agendamentoLogic.createTbagendamento(tbagendamento)) {\n AbstractFacesContextUtils.redirectPage(PagesUrl.URL_AGENDAMENTO_LIST);\n AbstractFacesContextUtils.addMessageInfo(\"Agendamento cadastrado com sucesso.\");\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"Falhar ao realizado cadastro do agendamento.\");\n }\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"verifique se a data de agendamento esta correta.\");\n }\n }", "private Future<Void> migratePermsAssignUser(PermissionUser permUser, Conn connection, Context vertxContext, String tenantId) {\n return PermsCache.expandPerms(permUser.getPermissions(), vertxContext, tenantId)\n .compose(expandedPerms -> {\n JsonArray originalList = new JsonArray(permUser.getPermissions());\n JsonArray newList = new JsonArray(permUser.getPermissions());\n List<String> permissionsToBeAdded = Collections.emptyList();\n if (originalList.contains(PermissionUtils.PERMS_OKAPI_ALL)) {\n permissionsToBeAdded = List.of(PermissionUtils.PERMS_USERS_ASSIGN_OKAPI,\n PermissionUtils.PERMS_USERS_ASSIGN_IMMUTABLE,\n PermissionUtils.PERMS_USERS_ASSIGN_MUTABLE);\n }\n boolean added = false;\n for (String perm : permissionsToBeAdded) {\n if (!originalList.contains(perm)) {\n newList.add(perm);\n added = true;\n }\n }\n if (!added) {\n return Future.succeededFuture();\n }\n permUser.setPermissions(newList.getList());\n return connection.update(PermsAPI.TABLE_NAME_PERMSUSERS, permUser, permUser.getId())\n .compose(x -> updateUserPermissions(connection, permUser.getId(), originalList, newList,\n null, null, null));\n });\n }", "boolean registrarUsuario(Usuario usuario) throws Exception;", "@PostMapping(\"/nuevo\")\n public ResponseEntity<?> nuevo(@Valid @RequestBody NewUser nuevoUsuario, BindingResult bindingResult){\n \t\n \n if(bindingResult.hasErrors())\n return new ResponseEntity(new Mensaje(\"campos vacíos o email inválido\"), HttpStatus.BAD_REQUEST);\n \n if(iRepoUser.existsByEmail(nuevoUsuario.getEmail()))\n return new ResponseEntity(new Mensaje(\"ese email ya existe\"), HttpStatus.BAD_REQUEST);\n Usuario usuario =\n new Usuario(nuevoUsuario.getEmail(),nuevoUsuario.getRol(),\n passwordEncoder.encode(nuevoUsuario.getPassword()));\n Set<String> rolesStr = nuevoUsuario.getRoles();\n Set<Rol> roles = new HashSet<>();\n \n for (String rol : rolesStr) {\n switch (rol) {\n case \"ADMINISTRADOR\":\n Rol rolAdmin = iRepoRol.findByRolNombre(RolNombre.ADMINISTRADOR).get();\n roles.add(rolAdmin);\n break;\n case \"RECEPCIONISTA\":\n Rol rolAdmin2 = iRepoRol.findByRolNombre(RolNombre.RECEPCIONISTA).get();\n roles.add(rolAdmin2);\n break;\n case \"DOMICILIARIO\":\n Rol rolAdmin3 = iRepoRol.findByRolNombre(RolNombre.DOMICILIARIO).get();\n roles.add(rolAdmin3);\n break;\n case \"LOGISTICO\":\n Rol rolAdmin4 = iRepoRol.findByRolNombre(RolNombre.LOGISTICO).get();\n roles.add(rolAdmin4);\n break;\n case \"USUARIO_FINAL\":\n Rol rolAdmin5 = iRepoRol.findByRolNombre(RolNombre.USUARIO_FINAL).get();\n roles.add(rolAdmin5);\n break;\n \n default:\n Rol rolUser = iRepoRol.findByRolNombre(RolNombre.USUARIO_FINAL).get();\n roles.add(rolUser);\n }\n }\n usuario.setRoles(roles);\n iRepoUser.save(usuario);\n return new ResponseEntity(new Mensaje(\"usuario guardado\"), HttpStatus.CREATED);\n }", "protected void botonAceptarPulsado() {\n\t\tString pass = this.vista.getClave();\n\t\tchar[] arrayC = campoClave.getPassword();\n\t\tString clave = new String(arrayC);\n\t\tclave = Vista.md5(clave);\n\t\t\n\t\tif (pass.equals(clave)) {\n\t\t\tarrayC = campoClaveNueva.getPassword();\n\t\t\tString pass1 = new String(arrayC);\n\t\t\t\n\t\t\tarrayC = campoClaveRepita.getPassword();\n\t\t\tString pass2 = new String(arrayC);\n\t\t\t\n\t\t\tif (pass1.equals(pass2)) {\n\t\t\t\tif (this.vista.cambiarClave(pass1)) {\n\t\t\t\t\tthis.vista.msg(this, \"Contraseña maestra cambiada con éxito\");\n\t\t\t\t\tthis.setVisible(false);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.vista.error(this, \"Error al cambiar la contraseña maestra\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.vista.error(this, \"Las contraseñas no coinciden\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis.vista.error(this, \"Contraseña incorrecta\");\n\t\t}\n\t}", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,GrupoBodega grupobodega,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(GrupoBodegaConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(grupobodega.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,GrupoBodegaDataAccess.TABLENAME, grupobodega.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(GrupoBodegaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////GrupoBodegaLogic.registrarAuditoriaDetallesGrupoBodega(connexion,grupobodega,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(grupobodega.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!grupobodega.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,GrupoBodegaDataAccess.TABLENAME, grupobodega.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////GrupoBodegaLogic.registrarAuditoriaDetallesGrupoBodega(connexion,grupobodega,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,GrupoBodegaDataAccess.TABLENAME, grupobodega.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(grupobodega.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,GrupoBodegaDataAccess.TABLENAME, grupobodega.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(GrupoBodegaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////GrupoBodegaLogic.registrarAuditoriaDetallesGrupoBodega(connexion,grupobodega,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "public boolean upadte(User user);", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,Caja caja,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(CajaConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(caja.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,CajaDataAccess.TABLENAME, caja.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(CajaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////CajaLogic.registrarAuditoriaDetallesCaja(connexion,caja,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(caja.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!caja.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,CajaDataAccess.TABLENAME, caja.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////CajaLogic.registrarAuditoriaDetallesCaja(connexion,caja,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,CajaDataAccess.TABLENAME, caja.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(caja.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,CajaDataAccess.TABLENAME, caja.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(CajaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////CajaLogic.registrarAuditoriaDetallesCaja(connexion,caja,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "public static void requestNewAccount(String uid){\n accountManager.requestNewAccount(uid);\n }", "@_esCocinero\n public Result crearPaso() {\n Form<Paso> frm = frmFactory.form(Paso.class).bindFromRequest();\n\n // Comprobación de errores\n if (frm.hasErrors()) {\n return status(409, frm.errorsAsJson());\n }\n\n Paso nuevoPaso = frm.get();\n\n // Comprobar autor\n String key = request().getQueryString(\"apikey\");\n if (!SeguridadFunctions.esAutorReceta(nuevoPaso.p_receta.getId(), key))\n return Results.badRequest();\n\n // Checkeamos y guardamos\n if (nuevoPaso.checkAndCreate()) {\n Cachefunctions.vaciarCacheListas(\"pasos\", Paso.numPasos(), cache);\n Cachefunctions.vaciarCacheListas(\"recetas\", Receta.numRecetas(), cache);\n return Results.created();\n } else {\n return Results.badRequest();\n }\n\n }", "private void inserirUsuario(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tString nome = request.getParameter(\"nome\");\n\t\tString email = request.getParameter(\"email\");\n\t\tint telefone = Integer.parseInt (request.getParameter(\"telefone\"));\n\t\tString nacionalidade = request.getParameter(\"nacionalidade\");\n\t\tUsuario novoUsuario = new Usuario(nome, email, telefone, nacionalidade);\n\t\tdao.inserirUsuario(novoUsuario);\n\t\tresponse.sendRedirect(\"lista\");\n\t}", "public void modifica(DTOAcreditacionGafetes acreGafete) throws Exception ;", "public void grantPermission(String objectId, String objectType, User user, List<String> actions) throws UserManagementException;", "public void altaUsuario();", "@Override\r\n\tprotected void verificaUtentePrivilegiato() {\n\r\n\t}", "public void grantAdminOnIndividualToSystemUser(Individual i, SystemUser user);", "public void confirmPermission(String objectId, User user) throws UserManagementException;", "private void registerUser(){\n mAuth.createUserWithEmailAndPassword(correo, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //mapa de valores\n Map<String, Object> map = new HashMap<>();\n map.put(\"name\",name);\n map.put(\"email\",correo);\n map.put(\"password\",password);\n map.put(\"birthday\",cumple);\n map.put(\"genre\",genre);\n map.put(\"size\",size);\n //obtenemos el id asignado por la firebase\n String id= mAuth.getCurrentUser().getUid();\n //pasamos el mapa de valores\n mDatabase.child(\"Users\").child(id).setValue(map).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task2) {\n //validams que la tarea sea exitosa\n if(task2.isSuccessful()){\n startActivity(new Intent(DatosIniciales.this, MainActivity.class));\n //evitamos que vuelva a la pantalla con finsh cuando ya se ha registrado\n finish();\n }else{\n Toast.makeText(DatosIniciales.this, \"Algo fallo ups!!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }else{\n Toast.makeText(DatosIniciales.this, \"No pudimos completar su registro\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "@Ignore(\"Test is not done yet\")\n @Test\n public void testChangingUsernameToExisting() {\n final UserRequest request = new UserRequest();\n // We're currently logged in as Austria, so we're trying to change the\n // username to Germany.\n request.setNewUsername(\"[email protected]\");\n final Response response = administration.controlUserAccount(token, request);\n assertThat(response.getError(), is(IWSErrors.FATAL));\n }", "public String createUserAction()throws Exception{\n\t\tString response=\"\";\n\t\tresponse=getService().getUserMgmtService().createNewUser(\n\t\t\t\tgetAuthBean().getUserName(),\n\t\t\t\tgetAuthBean().getFirstName(),\n\t\t\t\tgetAuthBean().getLastName(),\n\t\t\t\tgetAuthBean().getEmailId(),\n\t\t\t\tgetAuthBean().getRole()\n\t\t);\n\t\tgetAuthBean().setResponse(response);\n\t\tinputStream = new StringBufferInputStream(response);\n\t\tinputStream.close();\n\t\treturn SUCCESS;\n\t}", "public void comprobarEficaciaAccion() throws IOException{\n if((fVerif.SetVerificacionEficaciaAccion(FechaComprobacionEficacia, ObservacionesEficacia, ComprobacionSeleccionadaEficacia, AccionSeleccionada.getId()))== -1){\n FacesContext.getCurrentInstance().addMessage(\"form_seguimiento_accion:btn_comprobar_eficacia\", new FacesMessage(SEVERITY_FATAL, \"No se pudo comprobar eficacia\", \"No se pudo comprobar eficacia\" ));\n FacesContext.getCurrentInstance().renderResponse();\n }else{\n // regresar a la pagina listar acciones\n String url = FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();\n FacesContext.getCurrentInstance().getExternalContext().redirect(url+\"/Views/Acciones/General/SeguimientoAccion.xhtml?id=\"+AccionSeleccionada.getId());\n }\n }", "public void createUser(User user) {\n\n\t}", "public void addUser() {\n\t\tUser user = dataManager.findCurrentUser();\r\n\t\tif (user != null) {\r\n\t\t\tframeManager.addUser(user);\r\n\t\t\tpesquisar();\r\n\t\t} else {\r\n\t\t\tAlertUtils.alertSemPrivelegio();\r\n\t\t}\r\n\t}", "@Override\n\tpublic int upAccount(AccountUser au) {\n\t\tau.setName(au.getUsername());\n\t\tau.setStatus(1);\n\t\tau.setSalt(CommTool.getSalt());\n\t\tau.setPwd(\"666666\");\n\t\tau.setPwd(PasswordUtil.generate(au.getPwd(), au.getSalt()));\n\t\treturn auMapper.upAccount(au);\n\t}", "@Given(\"^El usuario quiere acceder al sistema$\")\n\tpublic void El_usuario_quiere_acceder_al_sistema() throws Throwable {\n\t\tdao = new DAOPersona();\n\t p=new Persona(\"Carlos\", \"Delgado\", \"carlitos93\", \"[email protected]\", \"a1Zs7s2DM\", \"Calle Jane Doe\", \"0\", \"photo\", false, null, null, null);\n\t assert(true);\n\t}", "@Override\n\tpublic void guardar() {\n\t\tLOG.info(\"El usuario fue guardado \"+ usuario.getApellido()+\", \"+ usuario.getNombre());\n\t}", "private void createAccount(User user) throws IOException {\n File accounts = new File(\"accounts.txt\");\n if (!accounts.exists()) {\n accounts.createNewFile();\n }\n\n FileOutputStream fileOutputStream = new FileOutputStream(accounts, true);\n BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream));\n\n bufferedWriter.write(user.getUserName() + \":\" + user.getUserPass());\n bufferedWriter.newLine();\n bufferedWriter.flush();\n }", "private static void privilegio(int tipo) {\n String nome;\r\n Scanner sc = new Scanner(System.in);\r\n if (tipo == 1)\r\n System.out.println(\"Qual o utilizador a quem quer dar privilégios de editor?\");\r\n else\r\n System.out.println(\"Qual o utilizador a quem quer dar privilégios de editor?\");\r\n nome = sc.nextLine();\r\n PreparedStatement stmt;\r\n if (verificaUser(nome)) {\r\n try {\r\n c.setAutoCommit(false);\r\n if (tipo == 1)\r\n stmt = c.prepareStatement(\"UPDATE utilizador SET utilizador_tipo = true WHERE nome=?\");\r\n else\r\n stmt = c.prepareStatement(\"UPDATE utilizador SET utilizador_tipo = false WHERE nome=?\");\r\n stmt.setString(1, nome);\r\n stmt.executeUpdate();\r\n\r\n stmt.close();\r\n c.commit();\r\n } catch (SQLException e) {\r\n System.out.println(e);\r\n }\r\n System.out.println(\"Privilégios atualizados\");\r\n } else {\r\n System.out.println(\"Utilizador não encontrado\");\r\n }\r\n }", "public void crearActividad (Actividad a) {\r\n String query = \"INSERT INTO actividad (identificacion_navegate, numero_matricula, fecha, hora, destino, eliminar) VALUES (\\\"\" \r\n + a.getIdentificacionNavegante()+ \"\\\", \" \r\n + a.getNumeroMatricula() + \", \\\"\" \r\n + a.getFecha() + \"\\\", \\\"\" \r\n + a.getHora() + \"\\\", \\\"\" \r\n + a.getDestino()+ \"\\\" ,false)\";\r\n try {\r\n Statement st = con.createStatement();\r\n st.executeUpdate(query);\r\n st.close();\r\n JOptionPane.showMessageDialog(null, \"Actividad creada\", \"Operación exitosa\", JOptionPane.INFORMATION_MESSAGE);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(PActividad.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "public void registrarUsuarioFinal(){\r\n Usuario nuevoUsuario= new Usuario();\r\n nuevoUsuario.setNombreUsuario(nuevoNombreUsuario);\r\n nuevoUsuario.setPassword(nuevoPasswordUsuario);\r\n nuevoUsuario.setTipoUsuario(\"final\");\r\n \r\n IUsuarioDAO iusuarioDAO = new UsuarioDAOImp();\r\n iusuarioDAO.agregarUsuario(nuevoUsuario);\r\n FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Usuario registrado\", \"Usuario registrado exitosamente\");\r\n FacesContext.getCurrentInstance().addMessage(null, facesMessage);\r\n\r\n }" ]
[ "0.6091176", "0.60559285", "0.6014667", "0.5977959", "0.57502836", "0.57421017", "0.5698767", "0.5648691", "0.5622944", "0.5618639", "0.55864906", "0.5575313", "0.5520407", "0.54944783", "0.54567564", "0.54433227", "0.5429165", "0.5419878", "0.5418877", "0.5412988", "0.5401751", "0.5397063", "0.53860617", "0.5370191", "0.5366183", "0.5359471", "0.53582925", "0.5356764", "0.5355041", "0.5350708", "0.5329994", "0.5324895", "0.5306669", "0.52966243", "0.52834594", "0.527826", "0.52716565", "0.5271011", "0.5255192", "0.52542293", "0.52523327", "0.52505773", "0.5246236", "0.52339464", "0.5233149", "0.5231526", "0.52287304", "0.522405", "0.5221939", "0.5217877", "0.5212619", "0.52121145", "0.521204", "0.52074194", "0.5204411", "0.52039915", "0.52014756", "0.52004963", "0.5195881", "0.51886654", "0.5181284", "0.5179957", "0.5179419", "0.51782405", "0.5177438", "0.5176656", "0.51750576", "0.5170663", "0.51680386", "0.516379", "0.51634985", "0.5163468", "0.5162826", "0.51603097", "0.515394", "0.5153636", "0.5146657", "0.51448184", "0.514333", "0.51425475", "0.51401436", "0.512759", "0.51196367", "0.5114463", "0.51108086", "0.5101281", "0.5096139", "0.5091298", "0.5086969", "0.50869536", "0.50854355", "0.5083457", "0.5079639", "0.5076941", "0.5076673", "0.50705665", "0.5070095", "0.50675523", "0.505934", "0.5048398", "0.50462073" ]
0.0
-1
Informa si el usuario puede utilizar o no un acceso determinado
public boolean hasAccess(String accessId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean correctUser() {\n // TODO mirar si l'usuari es unic a la base de dades\n return true;\n }", "public boolean hasUser(){\n return numUser < MAX_USER;\n }", "public boolean getUsuarioSuscrito(){\n return !(suscribirClientBean.getUsuarioSuscrito(idOferta).length == 0);\r\n }", "boolean hasCustomerUserAccess();", "public boolean verificarUsuario(){\n boolean estado = false;\n try{\n this.usuarioBean = (Dr_siseg_usuarioBean) this.manejoFacesContext.obtenerObjetoSession(\"usuario\");\n if(this.usuarioBean != null){\n estado = true;\n if (this.usuarioBean.getRoll().equals(\"GRP_SERVAGTMII_ADMIN\")){\n modoAdministrador=true;\n// this.usuarioRoll=\"ADMIN\";\n// this.disableBotonFinalizar=\"false\";\n// this.visibleImprimirComprobanteEncargado=\"true\";\n// this.visibleImprimirComprobanteEstudiante=\"true\";\n \n\n }else{\n if (this.usuarioBean.getRoll().equals(\"GRP_SERVAGTMII_PF1\")){\n modoAdministrador=true;\n// this.usuarioRoll=\"PF1\";\n// this.disableBotonFinalizar=\"true\";\n// this.visibleImprimirComprobanteEncargado=\"false\";\n// this.visibleImprimirComprobanteEstudiante=\"true\";\n \n }\n }\n\n }else{\n this.manejoFacesContext.redireccionarFlujoWeb(\"/WebAppSLATE/LogoutServlet\" );\n }\n }catch(Exception ex){\n this.manejoFacesContext.redireccionarFlujoWeb(\"/WebAppSLATE/LogoutServlet\" );\n // this.manejoFacesContext.redireccionarFlujoWeb(\"/WebAppMADEB/cr.ac.una.reg.info.contenido/moduloFuncionario/estudiante/e_editarDireccion.jspx\");\n }//\n return estado;\n }", "protected void accionUsuario() {\n\t\t\r\n\t}", "public boolean abilitaNuovoAccertamento(){\n\t\t\n\t\tif(isAzioneAbilitata(CodiciOperazioni.OP_ENT_insAcc)){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "private boolean comprobarUsuario(String nombre, String contrasenia, String grupo) {\n\n return true;\n }", "private void checkUser() {\n\t\tlog.info(\"___________checkUser\");\n\t\tList<User> adminUser = userRepository.getByAuthority(AuthorityType.ROLE_ADMIN.toString());\n\t\tif (adminUser == null || adminUser.isEmpty()) {\n\t\t\tgenerateDefaultAdmin();\n\t\t}\n\t}", "private void checkUser() {\n\t\tloginUser = mySessionInfo.getCurrentUser();\n\t}", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "@XmlTransient\n\tpublic boolean isCanActivateUser() {\n\t\treturn (isSecurityAdministrator() && isSelfRegistrationEnabled());\n\t}", "public void verificarRol() throws IOException {\n\t\tif (FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(\"email\") != null) {\n\t\t\tObject rol = FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(\"rol\");\n\n\t\t\tif ((Integer) rol != 1) {\n\t\t\t\tFacesContext.getCurrentInstance().getExternalContext().redirect(\"home.xhtml\");\n\t\t\t} else {\n\t\t\t\t// System.out.println(\"sin permisos\");\n\t\t\t}\n\t\t}\n\t}", "private static boolean verificaUser(String username) {\n String user = null;\r\n try {\r\n PreparedStatement stmt = c.prepareStatement(\"SELECT * FROM utilizador where nome=?;\");\r\n stmt.setString(1, username);\r\n ResultSet rs = stmt.executeQuery();\r\n rs.next();\r\n user = rs.getString(\"nome\");\r\n if (user.equals(username)) {\r\n return true;\r\n }\r\n } catch (SQLException e) {\r\n System.out.println(e);\r\n }\r\n return false;\r\n }", "public boolean verificarSesion(){\n boolean sesionValida = false;\r\n if(FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(\"usuarioValidado\")!=null){\r\n sesionValida=true;\r\n }\r\n return sesionValida;\r\n }", "public boolean isUsuarioActivo(String nombreUsuario){\n\t\t\n \tUsuario u = this.buscarUsuarioPorNombre(nombreUsuario);\n \tif (u!=null){\n \t\treturn u.getEstado().toString().equals(\"A\");\n \t}\n \treturn false;\n }", "private void verificaTipoUsuario(Usuario usuario) {\n \n if( usuario.getTipoUsuario() == 3 ){ //Usuário apenas visualização\n adicionarInvAnimaisBT.setEnabled(false);\n adicionarInvBenfeitoriasBT.setEnabled(false);\n adicionarInvMaquinasBT.setEnabled(false);\n adicionarInvTerrasBT.setEnabled(false);\n \n editarInvAnimaisBT.setEnabled(false);\n editarInvBenfeitoriasBT.setEnabled(false);\n editarInvMaquinasBT.setEnabled(false);\n editarInvTerrasBT.setEnabled(false);\n \n removerInvAnimaisBT.setEnabled(false);\n removerInvBenfeitoriasBT.setEnabled(false);\n removerInvMaquinasBT.setEnabled(false);\n removerInvTerrasBT.setEnabled(false);\n \n atividadeLeiteBT.setEnabled(false);\n custoOportBT.setEnabled(false);\n salarioMinimoBT.setEnabled(false);\n \n valorGastoAnimaisBT.setEnabled(false);\n vidaUtilReprodBT.setEnabled(false);\n vidaUtilServBT.setEnabled(false);\n }\n \n }", "public boolean isUser()\n\t{\n\t\treturn (id != -1);\n\t}", "public boolean hasUser() {\n return user_ != null;\n }", "public boolean hasUser() {\n return user_ != null;\n }", "public static boolean isUsers() {\n try {\n Engine.getUsers();\n return true;\n } catch (IOException e) {\n MessagePrint.println(MessagePrint.Stream.ERR, e.getMessage());\n return false;\n }\n }", "protected void assertUtilisateurActif() {\n\t\t assertTrue( ((DoliUserPage)_currentPage).isUtilisateurActif());\n\t\t}", "boolean hasObjUser();", "boolean hasUserName();", "private boolean userIDExists( String idCedulaNit, Connection con ) \n {\n ClassConnection cc = new ClassConnection();\n \n //System.out.println( idCedulaNit );\n //System.out.print( idCedulaNit );\n Boolean presente = (Boolean) cc.execute( \"SELECT idcedulanit FROM usuario WHERE idcedulanit = \" + Long.parseLong( idCedulaNit ) , 2, con);\n \n return presente;\n }", "public boolean hasUser() {\n return user_ != null;\n }", "boolean hasSelectedUser();", "@Override\r\n\tprotected void verificaUtentePrivilegiato() {\n\r\n\t}", "public boolean hasObjUser() {\n return objUser_ != null;\n }", "public boolean hasUser() {\n return instance.hasUser();\n }", "public String verUsuarios() {\n\t\tString stringIdRol = session.getAttribute(\"rol\").toString();\n\t\tInteger idRol = Integer.parseInt(stringIdRol);\n\n\t\tif (idRol == 1) {\n\t\t\treturn \"TodosLosUsuarios\";\n\t\t}\n\n\t\treturn \"home\";\n\t}", "private boolean isLoggedInUser(){\n return true;\n }", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "@Then(\"^o usuario se loga no aplicativo cetelem$\")\n\tpublic void verificaSeUsuarioLogadoComSucesso() throws Throwable {\n\t\tAssert.assertTrue(login.validaSeLoginSucesso());\n\n\t}", "public boolean usuarioExistente(String apelido) {\r\n\t\tConexao con = (Conexao) conexoes.get(apelido);\r\n\t\t\r\n\t\treturn (con != null);\r\n\t}", "public boolean gotUserName(){return gotUserName;}", "@Override\n\tpublic boolean isOnline(String userId) throws Exception {\n\t\treturn false;\n\t}", "boolean isLoginAvailable();", "boolean hasUserManaged();", "private boolean cekUser(String user){\n return user.equals(Preferences.getRegisteredUser(getBaseContext()));\n }", "public void isAllowed(String user) {\n \r\n }", "private boolean isLoginUnique(int currentUserId){\n\t\tUser user = Main.getMMUser().getUserForLogin(userLoginField.getText());\n\t\tif (user == null) return true;\n\t\telse {\n\t\t\tif (user.getId() == currentUserId) return true;\n\t\t}\t\n\t\tlackUserLoginLabel.setText(\"taki login istnieje w bazie\");\n\t\tlackUserLoginLabel.setVisible(true);\n\t\treturn false;\n\t}", "@Override\n public boolean check() {\n return GlobalParams.isLogin();\n }", "public boolean isSetUser() {\n return this.user != null;\n }", "public boolean isSetUser() {\n return this.user != null;\n }", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean checkAvailable(String userName);", "public boolean hasRegisteredUser() {\n return registeredUser_ != null;\n }", "private void checkAction(HttpServletRequest req, HttpServletResponse resp) throws SQLException, IOException {\n\t\tString account = req.getParameter(\"account\");\r\n\t\tString password = req.getParameter(\"password\");\r\n\t\tManage manage = this.service.checkLogin(account, password);\r\n\r\n\t\t// 如果User不是空,证明账号密码正确\r\n\t\tif (manage != null) {\r\n\t\t\tsession.setAttribute(\"MANAGEINSESSION\", manage);\r\n//\t\t\tresp.sendRedirect(path + \"/jsps/manage/index.jsp\");\r\n\t\t\tpw.print(true);\r\n\t\t} else {\r\n\t\t\tpw.print(false);\r\n//\t\t\tresp.sendRedirect(path + \"/jsps/manage/login.jsp\");\r\n\t\t}\r\n\t\treturn;\r\n\t}", "public boolean isUserAuthorized(String userName) throws Exception {\n HDFSNameNodeComponentManager componentManager = HDFSNameNodeComponentManager.getInstance();\n boolean isUserexist = componentManager.getRealmForCurrentTenant().getUserStoreManager().isExistingUser(userName);\n List<String> userRoles = Arrays.asList(componentManager.getRealmForCurrentTenant().getUserStoreManager().getRoleListOfUser(userName));\n //get protocol list\n //authorize user to protocol\n if (isUserexist) {\n return true;\n }\n return false;\n\n }", "private boolean isUserExists() {\n\t\treturn KliqDataStore.isUserExists(this.mobileNumber, null);\r\n\t}", "@Then(\"^o sistema deve permitir a autenticao do usuario no sistema SmartLink Deca$\")\n\tpublic void o_sistema_deve_permitir_a_autenticao_do_usuario_no_sistema_SmartLink_Deca() throws Throwable {\n\t\t\n\t\tPageObject_Login.CheckLoginSucess();\n\t\t\n\t\t// Encerrar o Browser\n\t\tCloseBrowser();\n\t\t\n\t\t/** Report Extent **/\n\t\tStopReport();\n\t\t/** Report Extent **/\t\t\n\t\t\n\t}", "@Given(\"^El usuario quiere acceder al sistema$\")\n\tpublic void El_usuario_quiere_acceder_al_sistema() throws Throwable {\n\t\tdao = new DAOPersona();\n\t p=new Persona(\"Carlos\", \"Delgado\", \"carlitos93\", \"[email protected]\", \"a1Zs7s2DM\", \"Calle Jane Doe\", \"0\", \"photo\", false, null, null, null);\n\t assert(true);\n\t}", "boolean hasLogin();", "boolean hasLogin();", "private boolean isUserExplicitlyLoggedIn() {\n // User is explicitly logged in, if his securityStatus is more than or equal to security status login.\n String securityStatusPropertyName = getStorePropertyManager().getSecurityStatusPropertyName();\n int securityStatus = ((Integer) getProfile().getPropertyValue(securityStatusPropertyName)).intValue();\n return securityStatus >= getStorePropertyManager().getSecurityStatusLogin();\n }", "private boolean isUserActivated(DUsers user) {\n return isUserWithMoreHits(user, 30);\n }", "boolean hasUserId();", "boolean hasUserId();", "boolean hasUserId();", "protected boolean isValid(AccessUser obj)\n {\n return obj != null && obj.username != null && !getMembers().contains(obj);\n }", "@Override\n public boolean isUser() {\n return false;\n }", "Boolean accountIsActivated(Integer userId);", "boolean isAccountNonExpired();", "boolean isAccountNonExpired();", "private boolean isAuthorized() {\n return true;\n }", "private void checkRol(HttpSession session){\n UserDetails user = (UserDetails) session.getAttribute(\"user\");\n if(!user.getRol().equals(\"Company\")){\n System.out.println(\"El usuario no puede acceder a esta pagina con este rol\");\n throw new MajorsACasaException(\"No tens permisos per accedir a aquesta pàgina. \" +\n \"Has d'haver iniciat sessió com a Company per a poder accedir-hi.\",\"AccesDenied\",\"../\"+user.getMainPage());\n }\n }", "public static void tener_Usuario_activo() {\n\t\t\t\tdesktop.<DomTextField>find(\"//BrowserApplication//BrowserWindow//input[@id='username']\").typeKeys(\"ocastro\");\n\t\t\t\tdesktop.<DomTextField>find(\"//BrowserApplication//BrowserWindow//input[@id='password']\").setText(\"bogota2016\");\n\t\t\t\tdesktop.<DomButton>find(\"//BrowserApplication//BrowserWindow//input[@id='loginbtn']\").click();\n\t\t\t\t//end recording\n\t\t\t\tSerenity.takeScreenshot();\n\t}", "public boolean hasObjUser() {\n return instance.hasObjUser();\n }", "public Boolean isAuthorized(String userId);", "private void verifyActiveUser(){\r\n\t\tif(request.getUserPrincipal() == null)\r\n\t\t{\t\t\r\n\t\t\trequest.getSession().removeAttribute(\"isActive\");\r\n\t\t\trequest.getSession().invalidate();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tresponse.sendRedirect(\"login.jsp\");\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "private void checkUserAuthorities() {\n\t\tAuthority auth = authorityRepository.findTop1ByName(AuthorityType.ROLE_ADMIN);\n\t\tif (null == auth) {\n\t\t\tauth = Authority.createAdmin();\n\t\t\tauthorityRepository.save(auth);\n\t\t}\n\t\tAuthority authUser = authorityRepository.findTop1ByName(AuthorityType.ROLE_USER);\n\t\tif (null == authUser) {\n\t\t\tauthUser = Authority.createUser();\n\t\t\tauthorityRepository.save(authUser);\n\t\t}\n\t}", "private static boolean doesUserExist () {\n String sqlRetrieveAisId = \"SELECT ais_id FROM users WHERE user_id=?\";\n \n boolean valid = false;\n try (Connection conn = Database.getConnection();\n PreparedStatement pstmt = conn.prepareStatement(sqlRetrieveAisId)) {\n \n pstmt.setInt(1, userId);\n \n ResultSet rs = pstmt.executeQuery();\n \n valid = rs.next() != false;\n } catch (SQLException se) {\n JOptionPane.showMessageDialog(MainLayout.getJPanel(), Messages.getError(1), Messages.getHeaders(0), JOptionPane.ERROR_MESSAGE);\n } catch (IOException ioe) {\n JOptionPane.showMessageDialog(MainLayout.getJPanel(), Messages.getError(0), Messages.getHeaders(0), JOptionPane.ERROR_MESSAGE);\n } catch (Exception e) {\n JOptionPane.showMessageDialog(MainLayout.getJPanel(), Messages.getError(0), Messages.getHeaders(0), JOptionPane.ERROR_MESSAGE);\n }\n \n return valid;\n }" ]
[ "0.6399298", "0.6393366", "0.62713474", "0.62128556", "0.61941963", "0.61764187", "0.6162408", "0.6119337", "0.61132073", "0.6092264", "0.6059342", "0.6059342", "0.6059342", "0.6059342", "0.6059342", "0.6059342", "0.6059342", "0.6055948", "0.60348576", "0.597772", "0.5952071", "0.5940961", "0.59374076", "0.5901299", "0.5884666", "0.5884666", "0.5865085", "0.5844596", "0.58261937", "0.58159226", "0.5813143", "0.5809566", "0.5802682", "0.5802056", "0.5797448", "0.5767488", "0.57610667", "0.5756584", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5743282", "0.5740402", "0.57396346", "0.5728814", "0.5718458", "0.5709717", "0.5708847", "0.5692442", "0.5686828", "0.5680589", "0.56761515", "0.5672784", "0.5672784", "0.56678134", "0.56678134", "0.56678134", "0.56678134", "0.56678134", "0.56678134", "0.5666595", "0.5659037", "0.5646834", "0.56437147", "0.5633405", "0.5629769", "0.5628869", "0.5616225", "0.5616225", "0.5611898", "0.56050426", "0.55941087", "0.55941087", "0.55941087", "0.5590185", "0.5584702", "0.5578052", "0.5575717", "0.5575717", "0.55668896", "0.55626774", "0.55438596", "0.55432403", "0.5541288", "0.55405295", "0.553662", "0.55360705" ]
0.0
-1
Setea el nodo al cual pertenece el usuario
public void setNodo(Long nodo);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setUsuario(Element element) {\r\n\t\tUsuario user = (Usuario)Contexts.getSessionContext().get(\"user\");\r\n\t\t\r\n\t\tElement usuario = new Element(\"N_UsuarioAlta\");\r\n\t\tElement uniqueKey = new Element(\"uniqueKey\");\r\n\t\tuniqueKey.setAttribute(\"login_name\", user.getUsername());\r\n\t\tuniqueKey.setAttribute(\"campoCQ\", \"login_name\");\r\n\t\tuniqueKey.setAttribute(\"entidadCQ\", \"users\");\r\n\t\tusuario.addContent(uniqueKey);\r\n\t\telement.addContent(usuario);\r\n\t}", "public void setUsuario(java.lang.String newUsuario);", "public void setUsuarioID(int usuarioID) {\r\n this.usuarioID = usuarioID;\r\n }", "public abstract Setusuario buscarUsuario(String nomUsuario);", "public void setNodoDerecho(Nodo nodo){\n der = nodo;\n }", "public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n \r\n }", "public void setLoggedUser(PersAdministrativo usuario){\n this.usuario = usuario;\n }", "public void setUsuarioModificacion(String p) { this.usuarioModificacion = p; }", "public void setUsuarioModificacion(String p) { this.usuarioModificacion = p; }", "public void setIdUser(int value) {\n this.idUser = value;\n }", "public void asignar_Nodo(Nodo e) {\n\t\tthis.elem = e;\n\t}", "public void setIdUsuario(int value) {\n this.idUsuario = value;\n }", "protected void setUsuario(String usuario) {\n this.usuario = usuario;\n }", "public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n }", "public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n }", "public void setOwner(User owner) {\n this.owner = owner;\n }", "public void setNickUsuario(String nickUsuario) {\r\n this.nickUsuario = nickUsuario;\r\n }", "public void setUser(UserDTO user)\r\n {\r\n if (!edit)\r\n {\r\n this.user = user;\r\n\r\n if (user != null)\r\n {\r\n textUser.setText(user.getUsername());\r\n\r\n }\r\n }\r\n else\r\n {\r\n JOptionPane.showMessageDialog(this, \"Cannot select another person while you are adding or edditing the tree.\");\r\n }\r\n }", "@Override\n\tpublic Usuario edit(Usuario obj) {\n\t\treturn null;\n\t}", "public void setUsua_id(java.lang.Long newUsua_id);", "public TipoUsuario(int id_tipousuario, String usuario) {\n this.id_tipousuario = id_tipousuario;\n this.usuario = usuario;\n }", "public Usuario(int idUsuario, String nome, String email, String telefone, int motorista){\n\t\tthis.idUsuario = idUsuario;\n\t\tthis.nome = nome;\n\t\tthis.email = email;\n\t\tthis.telefone = telefone;\n\t\tthis.motorista = motorista;\n\t}", "public void setUsuario(Usuario usuario) {\n this.usuario = usuario;\n }", "public void setUsuario(Usuario usuario) {\n this.usuario = usuario;\n }", "public abstract void setUsuario(\n\t\tco.com.telefonica.atiempo.ejb.eb.UsuarioLocal anUsuario);", "public void ponerUsuarioInactivo(String idUsuario);", "public void setId_usuario(String usuario) {\n this.id_usuario = usuario;\n }", "protected void accionUsuario() {\n\t\t\r\n\t}", "public void setEditUser(User editUser)\r\n/* */ {\r\n/* 179 */ this.editUser = editUser;\r\n/* */ }", "@Override\n public void nick_name(String nick){\n ///Pregunta el nombres y el usuario le asigna\n nickName= nick;\n nombre=nickName;\n }", "public void setUsuario(Usuario usuario) {\r\n\t\tthis.usuario = usuario;\r\n\t}", "@FXML private void setToNewUser(){\n\t\tshowPassword();\n\t\tclearFields();\n\t\thideLackMessages();\n\t\tchangeCancelButton.setText(\"Anuluj\");\n\t\tnewUser = true;\n\t}", "public void setOwner(UserModel param) {\n localOwnerTracker = true;\n\n this.localOwner = param;\n }", "public void setNulo(boolean nulo) {\n if (autoIncrement && nulo) {\n try {\n throw new ExcepcionPersonalizada(\n \"El campo esta definido como autoincrement y no puede ser nulo.\",\n this,\n \"isNulo\");\n } catch (ExcepcionPersonalizada ex) {\n Logger.getLogger(ParametrosDeCampo.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n \n this.nulo = nulo;\n }", "public void setUsuarioInsercion(String p) { this.usuarioInsercion = p; }", "public void setUsuarioInsercion(String p) { this.usuarioInsercion = p; }", "public void changeOwner(String o){\n owner = o;\r\n }", "@Override\r\n\tpublic void update(Usuario t) {\n\t\t\r\n\t}", "public void borrarUsuario(String ident){\r\n listaPlantilla.get(obtenerPosicionUsuario(ident)).setControl(\"borrar\");\r\n }", "public void setUsuario(Usuario usuario) {\n\t\tthis.usuario = usuario;\n\t}", "public void setNombreUsuario(String nombreUsuario) {\r\n this.nombreUsuario = nombreUsuario;\r\n }", "public void effacerUtilisateur() {\r\n this.modele.effacerUtilisateur(this.modele);\r\n this.modele = new Utilisateurs();\r\n }", "public void insertToCarrito(String user, int cant, Producto prod) {\n NodoAvl tmp = root;\n while (tmp != null && !tmp.username.equals(user)) {\n if (user.compareTo(tmp.username) < 0) {\n tmp = tmp.izq;\n } else {\n tmp = tmp.der;\n }\n }\n if (tmp != null && user.equals(tmp.username)) {\n if(tmp.carrito != null)\n tmp.carrito.insertTail(user, cant, prod);\n else{\n Lista ls = new Lista();\n ls.insertTail(user, cant, prod);\n tmp.carrito = ls;\n }\n Log.logger.info(\" Agregado a usuario :\" + user);\n } else {\n Log.logger.warn(\"Usuario no encontrado \" + user);\n }\n \n }", "private void controladorUser(Controlador controlador){\n this.contUserCrearProyecto = controlador.getUserCrearProyecto();\n inicioUser.setControlCrearProyecto(contUserCrearProyecto);\n \n this.contUserCrearColectivo = controlador.getUserCrearColectivo();\n inicioUser.setControlCrearColectivo(contUserCrearColectivo);\n\n this.contInformes = controlador.getInformes();\n inicioUser.setControlSolicitarInformes(contInformes); \n \n this.contFiltrar = controlador.getFiltrar();\n inicioUser.setControlFiltrar(contFiltrar);\n\n this.contLimpiar = controlador.getLimpiarFiltro();\n inicioUser.setControlLimpiarFiltro(contLimpiar);\n }", "public void setNombreUsuario(String nombreUsuario){\n if(nombreUsuario == null){\n throw new IllegalArgumentException(\"Nick de usuario igual a null\");\n }\n this.nombreUsuario = nombreUsuario;\n }", "public void agregarNodo(Nodo nuevo){\n agregarNodoRec(root, nuevo);//la primera vez inicia en la raiz \n }", "public void setUsuario(java.lang.String usuario) {\n this.usuario = usuario;\n }", "public String getNickName(){\n return nombreUsuario;\n }", "private void setObjUser(People value) {\n if (value == null) {\n throw new NullPointerException();\n }\n objUser_ = value;\n \n }", "void setOwner(String owner);", "public void subeUsuario() {\n\t\tEditText nicknameText = (EditText) findViewById(R.id.nicknameEditText);\n\t\tstrNickname = nicknameText.getText().toString().trim();\n\t\t\n\t\tif (strNickname.equals(\"\")) {\n\t\t\tToast.makeText(this, \"Nickname no puede estar vacío\",Toast.LENGTH_LONG).show();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tguardarPreferences();\n\t\t\n\t\t//lanzamos un uploadService\n\t\tIntent uploadService = new Intent(getApplicationContext(),UploadUserService.class);\n\t\t\n\t\tuploadService.putExtra(\"id\", userId);\n\t\tuploadService.putExtra(\"nickname\", strNickname);\n\t\tuploadService.putExtra(\"mail\", strEmail);\n\t\tuploadService.putExtra(\"dob\", dayOfBirth);\n\t\tuploadService.putExtra(\"pass\", strPassword);\n\t\tuploadService.putExtra(\"genero\", gender);\n\t\tuploadService.putExtra(\"avatar\", strAvatar);\n\t\t\n\t\tstartService(uploadService);\n\t}", "public void agregarAlInicio(String valor){\r\n // Define un nuevo nodo.\r\n Nodo nuevo = new Nodo();\r\n // Agrega al valor al nodo.\r\n nuevo.setValor(valor);\r\n // Consulta si la lista esta vacia.\r\n if (esVacia()) {\r\n // Inicializa la lista agregando como inicio al nuevo nodo.\r\n inicio = nuevo;\r\n // Caso contrario va agregando los nodos al inicio de la lista.\r\n } else{\r\n // Une el nuevo nodo con la lista existente.\r\n nuevo.setSiguiente(inicio);\r\n // Renombra al nuevo nodo como el inicio de la lista.\r\n inicio = nuevo;\r\n }\r\n // Incrementa el contador de tamaño de la lista.\r\n tamanio++;\r\n }", "public void updateUsuario(Usuario usuario) {\n\t\t\n\t}", "public void setUtente(Utente aUtente) {\n utente = aUtente;\n }", "public void actualizarLabelUsuario(Ventana vis,String nombre) {\n\t\tvis.panelSaludo.lblUsuario.setText(nombre);\n\t\tvis.panelLineas1.lblUsuario.setText(nombre);\n\t\tvis.panelLineas2.lblUsuario.setText(nombre);\n\t\tvis.panelPago.lblUsuario.setText(nombre);\n\t\tvis.panelResumen.lblUsuario.setText(nombre);\n\t}", "public void Nodo(){\r\n this.valor = \"\";\r\n this.siguiente = null;\r\n }", "public void modificarUsuario(Long id, String nombre);", "public void setIduser(int aIduser) {\n iduser = aIduser;\n }", "public HTMLElement getElementUsuarioModificacionEd() { return this.$element_UsuarioModificacionEd; }", "public TipoUsuario(int id_tipousuario) {\n this.id_tipousuario = id_tipousuario;\n }", "public void updateName() {\n try {\n userFound = clientefacadelocal.find(this.idcliente);\n if (userFound != null) {\n userFound.setNombre(objcliente.getNombre());\n clientefacadelocal.edit(userFound);\n objcliente = new Cliente();\n mensaje = \"sia\";\n } else {\n mensaje = \"noa\";\n System.out.println(\"Usuario No Encontrado\");\n }\n } catch (Exception e) {\n mensaje = \"noa\";\n System.out.println(\"El error al actualizar el nombre es \" + e);\n }\n }", "public Nodo (String d, Nodo n){\n\t\tdato = d;\n\t\tsiguiente=n;\n\t}", "public String getNickUsuario() {\r\n return nickUsuario;\r\n }", "public void setIzquierdo(Nodo<T> izquierdo) {\n\t\tthis.izquierdo = izquierdo;\n\t}", "public void adicionaDinheiro(Usuario usuario, int dinheiro) throws Exception {\n\t\ttry {\n\t\t\tif (usuarios.containsKey(usuario.getLogin())) {\n\t\t\t\tusuario.setDinheiro(dinheiro);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Dinheiro nao pode ser menor que zero\");\n\t\t}\n\t}", "public void setUsuario(String usuario) {\n\t\tthis.usuario = usuario;\n\t}", "@Override\n\tpublic void updateUsuario(Usuario p) {\n\t\t\n\t}", "public void setIdUser(Integer idUser) {\r\n\t\tthis.idUser = idUser;\r\n\t}", "public void setCreateUser(User createUser)\r\n/* */ {\r\n/* 151 */ this.createUser = createUser;\r\n/* */ }", "public Administrador(String nome, String endereco, String email, String telefone, String id_usuario, String senha_usuario) {\n super(nome, endereco, email, telefone, id_usuario, senha_usuario);\n }", "public void setOwner(int owner) { this.owner = owner; }", "public Nodo (String d){\n\t\tthis.dato = d;\n\t\tthis.siguiente = null; //para que apunte el nodo creado a nulo\n\t}", "public Nodo() {\r\n this.dato = null;\r\n this.siguiente = null;\r\n }", "public void setId_user(int id_user) {\r\n this.id_user = id_user;\r\n }", "public void setIdUser(String idUser) {\n\t\tthis.idUser = idUser;\n\t}", "@Override\n\tpublic void update(User entity) {\n\t\tif (userlist.get(String.valueOf(entity.getDni())) != null) {\n\t\t\tuserlist.put(String.valueOf(entity.getDni()), entity);\n\t\t} else {\n\t\t\tEnviromentVariables.UPDATEUSERERRORNOEXISTE = \"El usuario no existe\";\n\t\t}\n\t}", "public void InsertarNodo(int nodo) {\r\n Nodo nuevo_nodo = new Nodo(nodo);\r\n nuevo_nodo.siguiente = UltimoValorIngresado;\r\n UltimoValorIngresado = nuevo_nodo;\r\n tamaño++;\r\n }", "@Override\n\tpublic void emprestimo(Livros livro, Usuarios usuario) {\n\t\t\n\t}", "public void setIdUsuario(String idUsuario) {\n\t\tthis.idUsuario = idUsuario;\n\t}", "public void inserisci(NodoAlbero dove, String contenuto, String tipo){\n if (n_nodi == 0){\n root = new NodoAlbero(contenuto, null, tipo);\n n_nodi++;\n return;\n }\n //se il nodo padre non ha un figlio, lo creiamo\n if (dove.getFiglio() == null)\n dove.setFiglio(new NodoAlbero(contenuto, dove, tipo));\n //se ce ne ha già almeno uno, lo accodiamo agli altri figli\n else {\n NodoAlbero temp = dove.getFiglio();\n while (temp.getFratello() != null)\n temp = temp.getFratello();\n temp.setFratello(new NodoAlbero(contenuto, temp.getPadre(), tipo));\n }\n n_nodi++;\n }", "void setName( String username, String name ) throws UserNotFoundException;", "public void addSeguidor(Usuario usuario){\n seguidores.add(usuario.getNombre());\n }", "public void setDni(String dni){\n if(dni == null){\n throw new IllegalArgumentException(\"DNI de usuario igual a null\");\n }\n this.dni = dni;\n }", "public String getIdUsuarioModificacion() {\n\t\treturn this.idUsuarioModificacion;\n\t}", "@Override\r\n\tpublic void modifierPrenom(int idUtilisateur, String nouveauPrenom) {\n\r\n\t}", "public void resetNodo()\r\n {\r\n this.nodo = null;\r\n }", "@Override\n public void setUserId(long userId) {\n _partido.setUserId(userId);\n }", "@Override\n\tpublic void emprestimo(Livros livro, Aluno usuario) {\n\t\t\n\t}", "public void setCreateUser(String newVal) {\n if ((newVal != null && this.createUser != null && (newVal.compareTo(this.createUser) == 0)) || \n (newVal == null && this.createUser == null && createUser_is_initialized)) {\n return; \n } \n this.createUser = newVal; \n\n createUser_is_modified = true; \n createUser_is_initialized = true; \n }", "public void actualizarUsuario(Long idUsr,String nick,String nombres,String pass){\n\t\t\t\t\t //buscamos el objeto que debe ser actualizado:\n\t\t\t\t\t Usuario u = findbyIdUsuario(idUsr);\n\t\t\t\t\t em.getTransaction().begin();\n\t\t\t\t\t // no se actualiza la clave primaria, en este caso solo la descripcion\n\t\t\t\t\t u.setNick(nick);\n\t\t\t\t\t u.setNombres(nombres);\n\t\t\t\t\t u.setPass(pass);\n\t\t\t\t\t em.merge(u);\n\t\t\t\t\t em.getTransaction().commit();\n\t\t\t\t }", "public void setUser1X_ID (int User1X_ID);", "public void setCreator(User creator) {\n this.creator = creator;\n }", "private static void addNodo(Alumno alumno, Nodo raiz) {\n Nodo izq = null;\n Nodo der = null;\n if (raiz == null) {\n raiz.setAlumno(alumno);\n } else if (0 <= ((raiz.getAlumno().getApellidoPaterno()).compareTo(alumno.getApellidoPaterno()))) {\n addNodo(alumno, der);\n } else {\n addNodo(alumno, izq);\n }\n\n }", "public long create_node(Node node)\r\n\t\t{ \r\n\t\t long id = 0; //id de la tabla user (único) \r\n\r\n\t\t try \r\n\t\t { \r\n\t\t iniciaOperacion(); \r\n\t\t id = (Long)sesion.save(node); //metodo para guardar cliente (del objeto hibernate.sesion) \r\n\t\t tx.commit(); \r\n\t\t }catch(HibernateException he) \r\n\t\t { \r\n\t\t manejaExcepcion(he);\r\n\t\t throw he; \r\n\t\t }finally \r\n\t\t { \r\n\t\t sesion.close(); \r\n\t\t } \r\n\t\t return id; \r\n\t\t}", "public void setOwner( String owner ){\r\n \ttry{\r\n \t\t_lockObject.lock();\r\n \t_owner = owner;\r\n \t_itDepartment.setDirector(_owner);\r\n \t}finally{\r\n \t\t_lockObject.unlock();\r\n \t}\r\n }", "public void setIdUsuario(Integer idUsuario) {\n this.idUsuario = idUsuario;\n }", "void suplantarIdUsuer(String nombre) throws Exception {\n\t\tLibro[] librosPres = new Libro[Const.MAXLIBROSPRES];\n\t\tint bpn = busquedaPrimerNulo();\n\t\tUsuario[] vu = ArrayObject.listadoUsuarios();\n\n\t\tMiObjectInputStream oi = null;\n\n\t\ttry { // comprueba que el archivo FUSUARIOS existe antes de leerlo\n\t\t\toi = new MiObjectInputStream(new FileInputStream(Const.FUSUARIOS));\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Archivo no encontrado - suplantarIdUsuer - \" + e.toString());\n\t\t}\n\n\t\t// busca donde se encuentra el primer usuario null del archivo para crear un\n\t\t// usuario nuevo en ese mismo lugar para obtener un id ordenado. Del mismo modo\n\t\t// la primera vez que esto se ustiliza llena el archivode usuarios de nulos pero\n\t\t// no elimna los usuarios que se encuentran por debajo\n\t\tUsuario u = (Usuario) oi.readObject();\n\t\tu = new Usuario(bpn, nombre, librosPres);\n\t\tvu[bpn] = u;\n\n\t\ttry {\n\t\t\tFileOutputStream fo = new FileOutputStream(Const.FUSUARIOSAUX, true);\n\t\t\tMiObjectOutputStream oo = new MiObjectOutputStream(fo);\n\t\t\tint i = 0;\n\t\t\twhile (i < vu.length) {\n\t\t\t\tu = vu[i];\n\t\t\t\too.writeObject(u);\n\t\t\t\ti++;\n\t\t\t} // finaliza el while para la lectura\n\t\t\too.close();\n\n\t\t} catch (Exception e) { // encaso de encontrar el archivos pero no puede leerlo\n\t\t\tSystem.out.println(\"Problemas al leer el archivo - suplantarIdUsuer - \" + e.toString());\n\t\t}\n\t\toi.close();\n\t}", "public void setId_user(int id_user) {\n this.id_user = id_user;\n }", "public void setIdUsuario(Integer idUsuario) {\n\t\tthis.idUsuario = idUsuario;\n\t}", "public Usuario(String idUsuario, String contrasena) {\n\t\tsuper();\n\t\tthis.idUsuario = idUsuario;\n\t\tthis.contrasena = contrasena;\n\t}" ]
[ "0.6474247", "0.63257015", "0.62246156", "0.6202744", "0.6189759", "0.61682147", "0.6156927", "0.61433756", "0.61433756", "0.6086389", "0.60762304", "0.60632485", "0.6049889", "0.6036822", "0.6036822", "0.6031605", "0.60117626", "0.6011194", "0.59940517", "0.59603846", "0.5957437", "0.59499145", "0.5945134", "0.5945134", "0.5944641", "0.5939417", "0.5933309", "0.59227765", "0.59227246", "0.59035164", "0.5896282", "0.58880293", "0.58700234", "0.5867485", "0.58649004", "0.58649004", "0.58631885", "0.5856941", "0.5845227", "0.5818779", "0.58151424", "0.58122975", "0.5790259", "0.5785045", "0.5784411", "0.57842517", "0.57824033", "0.578109", "0.5777595", "0.5774072", "0.57729286", "0.5767669", "0.5767275", "0.5767206", "0.57665324", "0.5761488", "0.5749818", "0.5744916", "0.57436764", "0.57412726", "0.5734431", "0.5731927", "0.5730394", "0.5726134", "0.57192427", "0.5716657", "0.5705307", "0.5703209", "0.5694533", "0.5694004", "0.5691591", "0.5674244", "0.5673385", "0.5657765", "0.56531966", "0.56522065", "0.5652159", "0.5648978", "0.56442744", "0.5643257", "0.5642181", "0.56420374", "0.5638147", "0.563775", "0.56348145", "0.5632714", "0.5628516", "0.56255627", "0.5625371", "0.5608514", "0.5607434", "0.56073207", "0.5603281", "0.5600586", "0.5592558", "0.55852336", "0.5582965", "0.55767494", "0.5569621", "0.5568994" ]
0.6668736
0
metodos usuados para el menu Setea la descripcion de la categoria del usuario
public void setCategoriaDescripcion(String descripcion);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void menuListados() {\n\t\tSystem.out.println(\"MENU LISTADOS\");\n\t\tSystem.out.println(\"1. Personas con la misma actividad\");\n\t\tSystem.out.println(\"2. Cantidad de personas con la misma actividad\");\n\t\tSystem.out.println(\"0. Salir\");\n\t}", "public void showMemberCategoryMenu() {\n System.out.println(\"Visa lista med: \");\n System.out.println(\"\\t1. Barnmedlemmar\");\n System.out.println(\"\\t2. Ungdomsmedlemmar\");\n System.out.println(\"\\t3. Vuxenmedlemmar\");\n System.out.println(\"\\t4. Seniormedlemmar\");\n System.out.println(\"\\t5. VIP-medlemmar\");\n System.out.print(\"Ange val: \");\n }", "private void listarUsuarios() {\r\n \t\r\n \tfor(String usuario : ConfigureSetup.getUsers()) {\r\n \t\tif(!usuario.equals(ConfigureSetup.getUserName()))\r\n \t\t\tlista_usuarios.getItems().add(usuario);\r\n \t}\r\n \t\r\n \t//lista_usuarios.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\t\r\n }", "List<Menu> listarMenuPorUsuario(String nombre);", "public String getCategoriaDescripcion();", "private void makeUtilitiesMenu() {\r\n\t\tJMenu utilitiesMnu = new JMenu(\"Utilidades\");\r\n\t\tboolean isAccesible = false;\r\n\r\n\t\tif (StoreCore.getAccess(\"Reportes\")) {\r\n\t\t\tisAccesible = true;\r\n\t\t\tJMenuItem menuItem = new JMenuItem(\"Reportes\",\r\n\t\t\t\t\timageLoader.getImage(\"reports.png\"));\r\n\t\t\tsetMenuItemSpecialFeatures(menuItem, 'r',\r\n\t\t\t\t\t\"Ver los reportes del sistema\", null,\r\n\t\t\t\t\tReports.class);\r\n\t\t\tutilitiesMnu.add(menuItem);\r\n\t\t}\r\n\t\tif (StoreCore.getAccess(\"ConsultarPrecios\")) {\r\n\t\t\tisAccesible = true;\r\n\t\t\tJMenuItem menuItem = new JMenuItem(\"Consultar Precios\",\r\n\t\t\t\t\timageLoader.getImage(\"money.gif\"));\r\n\t\t\tsetMenuItemSpecialFeatures(menuItem, 'p',\r\n\t\t\t\t\t\"Consultar los precios de los productos\", null,\r\n\t\t\t\t\tPriceRead.class);\r\n\t\t\tutilitiesMnu.add(menuItem);\r\n\t\t}\r\n\t\tif (StoreCore.getAccess(\"Calculadora\")) {\r\n\t\t\tisAccesible = true;\r\n\t\t\tJMenuItem menuItem = new JMenuItem(\"Calculadora Impuesto\",\r\n\t\t\t\t\timageLoader.getImage(\"pc.gif\"));\r\n\t\t\tsetMenuItemSpecialFeatures(menuItem, 'c',\r\n\t\t\t\t\t\"Calculadora de impuesto\", null, Calculator.class);\r\n\t\t\tutilitiesMnu.add(menuItem);\r\n\t\t}\r\n\t\tutilitiesMnu.addSeparator();\r\n\t\tif (StoreCore.getAccess(\"Categorias\")) {\r\n\t\t\tisAccesible = true;\r\n\t\t\tJMenuItem menuItem = new JMenuItem(\"Categorias Inventario\",\r\n\t\t\t\t\timageLoader.getImage(\"group.gif\"));\r\n\t\t\tsetMenuItemSpecialFeatures(menuItem, 'i',\r\n\t\t\t\t\t\"Manejar las categorias del inventario\", null, Groups.class);\r\n\t\t\tutilitiesMnu.add(menuItem);\r\n\t\t}\r\n\t\tif (StoreCore.getAccess(\"Impuestos\")) {\r\n\t\t\tisAccesible = true;\r\n\t\t\tJMenuItem menuItem = new JMenuItem(\"Impuestos\");\r\n\t\t\tsetMenuItemSpecialFeatures(menuItem, 't',\r\n\t\t\t\t\t\"Manejar el listado de impuestos\", null, Tax.class);\r\n\t\t\tutilitiesMnu.add(menuItem);\r\n\t\t}\r\n\t\tif (StoreCore.getAccess(\"Ciudades\")) {\r\n\t\t\tisAccesible = true;\r\n\t\t\tJMenuItem menuItem = new JMenuItem(\"Ciudades\");\r\n\t\t\tsetMenuItemSpecialFeatures(menuItem, 'u',\r\n\t\t\t\t\t\"Manejar el listado de ciudades\", null, City.class);\r\n\t\t\tutilitiesMnu.add(menuItem);\r\n\t\t}\r\n\t\tif (isAccesible) {\r\n\t\t\tutilitiesMnu.setMnemonic('u');\r\n\t\t\tadd(utilitiesMnu);\r\n\t\t}\r\n\t}", "private static void displayUserMenu() {\n\t\tSystem.out.println(\"\\t User Menu Help \\n\" \n\t\t\t\t+ \"====================================\\n\"\n\t\t\t\t+ \"ar <reponame> : To add a new repo \\n\"\n\t\t\t\t+ \"dr <reponame> : To delete a repo \\n\"\n\t\t\t\t+ \"or <reponame> : To open repo \\n\"\n\t\t\t\t+ \"lr : To list repo \\n\"\n\t\t\t\t+ \"lo : To logout \\n\"\n\t\t\t\t+ \"====================================\\n\");\n\t}", "public void showMenuforUser(String path, Storage s) {\n\t\tint cnt;\n\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb=new StringBuilder();\n\t\t\n\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------------------------\");\n\t\tsb.append(\"**********Trenutna lokacija:\" + path+\"**********\\n\");\n\t\tif(privileges.contains(\"add_user\")) {\n\t\t\tcnt=1;\n\t\t\t\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za dodavanje novog korisnika\");\n\t\t\t\n\t\t}\n\t\tif(privileges.contains(\"add_directory\")) {\n\t\t\tcnt=2;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za dodavanje novog foldera\");\n\t\t}\n\t\tif(privileges.contains(\"add_file\")) {\n\t\t\tcnt=3;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za dodavanje novog fajla\");\n\t\t}\n\t\tif(privileges.contains(\"download\")) {\n\t\t\tcnt=4;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za preuzimanje fajla\");\n\t\t}\n\t\tif(privileges.contains(\"upload\")) {\n\t\t\tcnt=5;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+ \" za upload fajla\");\n\t\t}\n\t\tif(privileges.contains(\"search_repository\")) {\n\t\t\tcnt=6;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za pretragu repozitorijuma\");\n\t\t}\n\t\tif(privileges.contains(\"delete_file\")) {\n\t\t\tcnt=7;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za brisanje fajla\");\n\t\t}\n\t\tif(privileges.contains(\"add_user\")) {\n\t\t\tcnt=8;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za dodavanje zabranjenih ekstenzija\");\n\t\t}\n\t\tif(privileges.contains(\"download\") && s.getType().equals(\"local\")) {\n\t\t\tcnt=9;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za zipovnje fajlova\");\n\t\t}\n\t\tif(privileges.contains(\"upload\") && s.getType().equals(\"local\")) {\n\t\t\tcnt=10;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za anzipovanje fajlova\");\n\t\t}\n\t\t\n\t\tsb.append(\"\\n\");\n\t\tsb.append(\"Izaberite 'ls' za prikaz sadrzine trenutnog foldera\");\n\t\tsb.append(\"\\n\");\n\t\tsb.append(\"Izaberite 'cd' <folder name> ili <..> za kretanje po fajlu\");\n\t\t//sb.append(\"\\n\"+path+\" >\");\n\t\tSystem.out.print(sb.toString());\n\t\t\n\t}", "public String toString(){\n\t\tif(categoria == 1)\n\t\t\treturn \"Profesor Ayudante\\n\" + super.toString() + \"\\n\" + \"Horario = \" + tutoria;\n\t\telse if(categoria == 2)\n\t\t\treturn \"Profesor Titular de Universidad\\n\" + super.toString() + \"\\n\" + \"Horario = \" + tutoria;\n\t\telse\n\t\t\treturn \"Profesor Catedrático de Universidad\\n\" + super.toString() + \"\\n\" + \"Horario = \" + tutoria;\n\t}", "public String getMenuname() {\r\n return menuname;\r\n }", "private void setearPermisosMenu()\r\n\t{\r\n\t\t/*Permisos del usuario para los mantenimientos*/\r\n\t\tthis.setearOpcionesMenuMantenimientos();\r\n\t\tthis.setearOpcionesMenuFacturacion();\r\n\t\tthis.setearOpcionesMenuCobros();\r\n\t\tthis.setearOpcionesMenuProcesos();\r\n\t\tthis.setearOpcionesReportes();\r\n\t\tthis.setearOpcionesMenuAdministracion();\r\n\t}", "private static void menuCategoria() throws Exception {//Inicio menuCategoria\r\n byte opcao;\r\n boolean encerrarPrograma = false;\r\n Integer[] listaC = null;\r\n do {\r\n System.out.println(\r\n \"\\n\\t*** MENU DE CATEGORIAS ***\\n\"\r\n + \"0 - Adicionar categoria\\n\"\r\n + \"1 - Remover categoria\\n\"\r\n + \"2 - Listar categorias cadastradas\\n\"\r\n + \"3 - Listar produtos cadastrados em uma categoria\\n\"\r\n + \"4 - Sair\"\r\n );\r\n System.out.print(\"Digite a opção: \");\r\n opcao = read.nextByte();\r\n System.out.println();\r\n switch (opcao) {\r\n case 0:\r\n adicionarCategoria();\r\n break;\r\n case 1:\r\n removerCategoria();\r\n break;\r\n case 2:\r\n listaC = listaCategoriasCadastradas();\r\n if (listaC == null) {\r\n System.out.println(\"Não ha categorias cadastradas!\");\r\n }\r\n break;\r\n case 3:\r\n consultaCategoria();\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 } while (!encerrarPrograma);\r\n }", "public controladorCategorias() {\r\n }", "private void displayMenu() {\r\n\t\tif (this.user instanceof Administrator) {\r\n\t\t\tnew AdminMenu(this.database, (Administrator) this.user);\r\n\t\t} else {\r\n\t\t\tnew BorrowerMenu(this.database);\r\n\t\t}\r\n\t}", "public AdministrarUsuarios() {\n initComponents();\n modelo = (DefaultTableModel) tablaUsuarios.getModel();\n tablaUsuarios.getTableHeader().setReorderingAllowed(false);\n tablaUsuarios.getTableHeader().setDefaultRenderer(new Facturar.HeaderColor());\n \n manejador.CargarUsuarios();\n listaTotalUsuarios = manejador.ObtenerListaUsuarios();\n cargarUsuariosEnTabla(listaTotalUsuarios);\n ocultarColumnaID();\n }", "private void setcategoriaPrincipal(String categoriaPrincipal2) {\n\t\t\n\t}", "public void setNomNiveles (String IdNivel, String Contador, String IdCategoria){\n nivelesId = getNivelId( IdNivel );\n if ( nivelesId.moveToFirst() ){//Muestra los valores encontrados en la consulta\n labelNivel.setText( nivelesId.getString(1) + \" - Preguntas : \" + Contador + \" / \" + getPreguntasTotal(IdCategoria, IdNivel ) );\n }\n\n }", "static void listerMenu() {\n System.out.println(\n \"-------------------------------------\\n\" +\n \"Saisir une option :\\n\" +\n \"1 : Liste des hôtes\\n\" +\n \"2 : Liste des logements\\n\" +\n \"3 : Liste des voyageurs\\n\" +\n \"4 : Liste des réservations\\n\" +\n \"5 : Fermer le programme\"\n );\n switch (Menu.choix(5)) {\n case 1:\n GestionHotes.listerHotes();\n break;\n case 2:\n GestionLogements.listerLogements();\n break;\n case 3:\n GestionVoyageurs.listerVoyageurs();\n break;\n case 4:\n GestionReservations.listerReservations();\n break;\n case 5:\n System.exit(0);\n break;\n }\n }", "@Override\n public String[] getMenuOptions() {\n String[] options = {\"Change your username\", \"Change your password\", \"Change your email\"};\n return options;\n }", "private void CargarUsuarios(){\n administradores.clear();\n usuariosList.clear();\n for (String i: BienvenidaActivity.UsuariosRegistrados.keySet()) {\n if(EsAdmin(i)){\n administradores.add(BienvenidaActivity.UsuariosRegistrados.get(i));\n }else{\n usuariosList.add(BienvenidaActivity.UsuariosRegistrados.get(i));\n }\n }\n String admins_string = \"\";\n for(Usuario admin : administradores){\n admins_string += admin.getUsername() + \" -> \" + admin.getNombre() + \" \" + admin.getApellido() + \"\\n\";\n }\n\n String users_string = \"\";\n for(Usuario userss : usuariosList){\n users_string += userss.getUsername() + \" -> \" + userss.getNombre() + \" \" + userss.getApellido() + \"\\n\";\n }\n\n // Finalmente se coloca en la actividad\n\n txtvw_contadmin.setText(String.valueOf(administradores.size()));\n txtvw_contusers.setText(String.valueOf(usuariosList.size()));\n txtvw_admins.setText(admins_string);\n txtvw_users.setText(users_string);\n }", "private void completeTodoMenu(User u) {\n\t\t\n\t}", "public static void afficherMenu() {\r\n System.out.println(\"\\n## Menu de l'application ##\\n\" +\r\n \" Actions Membres :\\n\"+\r\n \" [ 1] : Inscription d'un Membre\\n\" +\r\n \" [ 2] : Désinscription d'un Membre\\n\" +\r\n \" ( 3) : Afficher liste des Membres\\n\" +\r\n \" [ 4] : Payer Cotisation\\n\" +\r\n \" Actions vote Arbres d'un Membre :\\n\" +\r\n \" ( 5) : Voter pour un Arbre\\n\" +\r\n \" ( 6) : Afficher liste des votes\\n\" +\r\n \" ( 7) : Retirer un vote\\n\" +\r\n \" ( 8) : Supprimer les votes d'un Membre.\\n\" +\r\n \" ( 9) : Remplacer un vote\\n\" +\r\n \" Actions Arbres :\\n\" +\r\n \" (10) : Afficher la liste des Arbres\\n\" +\r\n // ...\r\n \" Actions Administration :\\n\" +\r\n \" (11) : Nommer nouveau Président\\n\" +\r\n // ...\r\n \"\\n ( 0) : Quitter l'application\\n\" +\r\n \" - Veuillez saisir une action. -\");\r\n }", "public static void affichageDuMenuPrincipal() {\n\t\tSystem.out.println(\"\\n\\nMENU PRINCIPAL\");\n\t\tSystem.out.println(\"==============\");\n\t\tSystem.out.println(\"Choix 1 : Affichez les noms et prénoms de tous les apprenant(e)s.\");\n\t\tSystem.out.println(\"Choix 2 : Affichez la liste des apprenants pour chaque région.\");\n\t\tSystem.out.println(\n\t\t\t\t\"Choix 3 : Recherchez un apprenant(e) (par son nom) et afficher la liste des activités qu’il ou qu’elle pratique.\");\n\t\tSystem.out.println(\n\t\t\t\t\"Choix 4 : Recherchez les apprenants qui pratiquent une activité passée en paramètre d’une méthode.\");\n\t\tSystem.out.println(\"Choix 5 : Ajoutez un(e) nouvel(le) apprenant(e) à la base de données.\");\n\t\tSystem.out.println(\"Choix 6 : Affectez une activité à un(e) apprenant(e)\");\n\t\tSystem.out.println(\"Choix 7 : Affichez la liste des activités que personne ne fait.\");\n\t\tSystem.out.println(\"Choix 8 : Modifiez le nom d’un(e) apprenant(e).\");\n\t\tSystem.out.println(\"Choix 9 : Supprimez un(e) apprenant(e).\");\n\t\tSystem.out.println(\"Choix 10 : Quitter\");\n\t\tSystem.out.println(\n\t\t\t\t\"================================================================================================================\");\n\t}", "public List<Categoria> getMenuPrincipal(){\n this.menuPrincipal = categoriaService.findAllMenu();\n System.out.println(\" ssss *********\"+menuPrincipal.toString());\n return menuPrincipal;\n }", "private void personalizarInterfaz(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_personalizarInterfaz\n\n jMenu1.setText(\"Mi cuenta: \" + nombreUsuario + \" : \" + idUsuario);\n }", "public void mostrarMenuLectura(TomarLectura tomarLectura, Lectura lecturaActual);", "@Override\n public String getMenuTitle() {\n return personManager.getCurrentUsername(currentUserId) + \"'s account settings\";\n }", "@Override\n public String menuDescription(Actor actor) {\n return actor + \" visits store\";\n }", "private void makeToolsMenu() {\r\n\t\tJMenu toolsMnu = new JMenu(\"Herramientas\");\r\n\t\tboolean isAccesible = false;\r\n\r\n\t\tif (StoreCore.getAccess(\"Usuarios\")) {\r\n\t\t\tisAccesible = true;\r\n\t\t\tJMenuItem menuItem = new JMenuItem(\"Manejo de Usuarios\",\r\n\t\t\t\t\timageLoader.getImage(\"users.png\"));\r\n\r\n\t\t\tsetMenuItemSpecialFeatures(menuItem, 'm',\r\n\t\t\t\t\t\"Manejar los usuarios del sistema\", KeyStroke.getKeyStroke(\r\n\t\t\t\t\t\t\tKeyEvent.VK_F7, 0), Users.class);\r\n\r\n\t\t\ttoolsMnu.add(menuItem);\r\n\t\t}\r\n\t\tif (StoreCore.getAccess(\"FacturacionManual\")) {\r\n\t\t\tisAccesible = true;\r\n\t\t\tJMenuItem menuItem = new JMenuItem(\"Facturacion Manual\",\r\n\t\t\t\t\timageLoader.getImage(\"kwrite.png\"));\r\n\r\n\t\t\tsetMenuItemSpecialFeatures(menuItem, 'f',\r\n\t\t\t\t\t\"Manejar la Facturacion Manual\", KeyStroke.getKeyStroke(\r\n\t\t\t\t\t\t\tKeyEvent.VK_F3, 0), ManualInvoice.class);\r\n\r\n\t\t\ttoolsMnu.add(menuItem);\r\n\t\t}\r\n\t\tif (isAccesible) {\r\n\t\t\ttoolsMnu.setMnemonic('h');\r\n\t\t\tadd(toolsMnu);\r\n\t\t}\r\n\t}", "public TelaCadastrarUsuarios() {\n initComponents();\n carregarTabela();\n carregarComboBoxFuncionarios();\n carregarImagens();\n }", "private void setearOpcionesMenuAdministracion()\r\n\t{\r\n\t\tArrayList<FormularioVO> lstFormsMenuAdmin = new ArrayList<FormularioVO>();\r\n\t\t\r\n\t\t/*Buscamos los Formulairos correspondientes a este TAB*/\r\n\t\tfor (FormularioVO formularioVO : this.permisos.getLstPermisos().values()) {\r\n\t\t\t\r\n\t\t\tif(formularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_USUARIO)\r\n\t\t\t\t|| formularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_GRUPO))\r\n\t\t\t{\r\n\t\t\t\tlstFormsMenuAdmin.add(formularioVO);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t/*Si hay formularios para el tab*/\r\n\t\tif(lstFormsMenuAdmin.size()> 0)\r\n\t\t{\r\n\t\t\t//TODO\r\n\t\t\t//this.tabAdministracion = new VerticalLayout();\r\n\t\t\t//this.tabAdministracion.setMargin(true);\r\n\t\t\t\r\n\t\t\tthis.lbAdministracion.setVisible(true);\r\n\t\t\tthis.layoutMenu.addComponent(this.lbAdministracion);\r\n\t\t\t\r\n\t\t\tfor (FormularioVO formularioVO : lstFormsMenuAdmin) {\r\n\t\t\t\t\r\n\t\t\t\tswitch(formularioVO.getCodigo())\r\n\t\t\t\t{\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_USUARIO : \r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_USUARIO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarUserButton();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.userButton);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_GRUPO :\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_GRUPO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarGrupoButton();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.gruposButton);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//TODO\r\n\t\t\t//this.acordion.addTab(tabAdministracion, \"Administración\", null);\r\n\t\t\t\r\n\t\t}\r\n\t\t//TODO\r\n\t\t//acordion.setHeight(\"75%\"); /*Seteamos alto del accordion*/\r\n\t}", "@Override\n protected String elaboraFooterCategorie() {\n String text = CostBio.VUOTO;\n\n text += A_CAPO;\n text += LibWiki.setRigaCat(\"Liste di persone per cognome| \");\n text += LibWiki.setRigaCat(\"Progetto Antroponimi|Cognomi\");\n\n return text;\n }", "abstract void menu(User theUser);", "private void addTodoMenu(User u,Scanner sc) {\n\t\t\n\t\tSystem.out.println(\"Title:\");\n\t\tString title = sc.nextLine();\n\t\t\n\t\tSystem.out.println(\"Description: \");\n\t\tString description = sc.nextLine();\n\t\t\n\t\t\n\t\tTodo todo = new Todo();\n\t\ttodo.setTitle(title);\n\t\ttodo.setDescription(description);\n\t\ttodo.setComplete(false);\n\t\t\n\t\tboolean success = todoService.insertTodo(todo);\n\t\t\n\t\tUser u = auth.getUser(u.getUsername());\n\t\t\n\t\t\n\t}", "public String getUserSubMenuRole() {\n return sessionData.getUserSubMenuRole();\n }", "public static void imprimirMenuAdmin() {\r\n\tSystem.out.println(\"---------------------------menu---------------------------\");\r\n\tSystem.out.println(\"opciones: (ingrese la letra)\");\r\n\tSystem.out.println(\"A: despliega la opción taquilla\");\r\n System.out.println(\"B: despliega la opción informacion cliente\");\r\n\tSystem.out.println(\"C: Salir\");\r\n\tSystem.out.println(\"----------------------------------------------------------\");\r\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n Log.v(\"OPTIONSMENUCALLED\",\"OPTIONS COMPOSE\");\n inflater.inflate(R.menu.compose_screen_action,menu);\n name= FirebaseAuth.getInstance().getCurrentUser().getDisplayName();\n }", "static void afficherMenu() {\n\t\tSystem.out.println(\"\\n\\n\\n\\t\\tMENU PRINCIPAL\\n\");\n\t\tSystem.out.println(\"\\t1. Additionner deux nombres\\n\");\n\t\tSystem.out.println(\"\\t2. Soustraire deux nombres\\n\");\n\t\tSystem.out.println(\"\\t3. Multiplier deux nombres\\n\");\n\t\tSystem.out.println(\"\\t4. Deviser deux nombres\\n\");\n\t\tSystem.out.println(\"\\t0. Quitter\\n\");\n\t\tSystem.out.print(\"\\tFaites votre choix : \");\n\t}", "public adminUsuarios() {\n initComponents();\n showUsuarios();\n }", "private void createMenu(){\n\n JMenuBar mbar = new JMenuBar();\n setJMenuBar(mbar);\n JMenu Opcje = new JMenu(\"Opcje\");\n mbar.add(Opcje);\n JMenuItem Ustawienia = new JMenuItem(\"Ustawienia\");\n /** Obsluga zdarzen wcisniecia przycisku ustawien w menu */\n Ustawienia.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n if(Justawienia==null)\n Justawienia =new JUstawienia();\n Justawienia.setVisible(true);\n if (controller.timer!=null)\n controller.timer.stop();\n }\n });\n Opcje.add(Ustawienia);\n Opcje.addSeparator();\n JMenuItem Info = new JMenuItem(\"Info\");\n /** Obsluga zdarzen wcisniecia przycisku info w menu */\n Info.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n controller.WyswietlInfo();\n }\n });\n Opcje.add(Info);\n }", "protected void accionUsuario() {\n\t\t\r\n\t}", "static void montaMenu() {\n System.out.println(\"\");\r\n System.out.println(\"1 - Novo cliente\");\r\n System.out.println(\"2 - Lista clientes\");\r\n System.out.println(\"3 - Apagar cliente\");\r\n System.out.println(\"0 - Finalizar\");\r\n System.out.println(\"Digite a opcao desejada: \");\r\n System.out.println(\"\");\r\n }", "public Produit(String type, String titre, String categorie, String description, String loginUser) {\n this.type = type;\n this.titre = titre;\n this.categorie = categorie;\n this.description = description;\n this.loginUser = loginUser;\n }", "@Override\n public void mostrarUsuarios(List<UserModel> usuarios) {\n }", "@Override\r\n\tpublic void cargarSubMenuPersona() {\n\t\t\r\n\t}", "@Override\n public String IDTipoHabitacion() {\n // TODO Auto-generated method stub\n return \"Habitacion Privada\";\n }", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n \tmenu.findItem(R.id.menu_principla_4).setTitle(\"Notificacion\");\n \treturn true;\n }", "protected abstract List<OpcionMenu> inicializarOpcionesMenu();", "private static void catList() {\n\t\tSystem.out.println(\"List of preset Categories\");\n\t\tSystem.out.println(\"=========================\");\n\t\tSystem.out.println(\n\t\t\t\t\"Family\\nTeen\\nThriller\\nAnimated\\nSupernatural\\nComedy\\nDrama\\nQuirky\\nAction\\nComing of age\\nHorror\\nRomantic Comedy\\n\\n\");\n\t}", "public String getMenuno() {\r\n return menuno;\r\n }", "public String choosenMenu() {\n String value = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(\"menu_id\");\n menu_id = Integer.parseInt(value);\n String user = FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();\n if (user == null) {\n return \"choosenMenu\";\n } else {\n return \"chooseMenuUser\";\n }\n }", "private void addPrivilegedUser(ActionEvent actionEvent) {\n if (addUserMenu.getSelectionModel().getSelectedItem() != null) {\n for (User user : server.getUser()) {\n if (user.getName().equals(addUserMenu.getSelectionModel().getSelectedItem())) {\n selectedAddUser = user;\n }\n }\n // set selected user to channel as privileged\n channel.withPrivilegedUsers(selectedAddUser);\n // update addMenu\n addUserMenu.getItems().clear();\n for (User user : server.getUser()) {\n if (!user.getPrivileged().contains(channel)) {\n addUserMenu.getItems().add(user.getName());\n }\n }\n // update removeMenu\n removeUserMenu.getItems().clear();\n for (User user : server.getUser()) {\n if (user.getPrivileged().contains(channel)) {\n removeUserMenu.getItems().add(user.getName());\n }\n }\n channelPrivilegedUserUpdate();\n }\n }", "private static void listStaffByCategory(){\n\t\t\n\t\tshowMessage(\"Choose one category to list:\\n\");\n\t\tshowMessage(\"1 - Surgeon\");\n showMessage(\"2 - Nurse\");\n showMessage(\"3 - Vet\");\n showMessage(\"4 - Accountant\");\n showMessage(\"5 - ItSupport\");\n showMessage(\"6 - Secretary\");\n showMessage(\"7 - Back to previous menu.\");\n \n int option = getUserStaffByCategory();\n /** switch case option start below */\n switch (option){\n \tcase 1 : ToScreen.listEmployee(employee.getSurgeonList(), true); listStaffByCategory();\n break;\n case 2 : ToScreen.listEmployee(employee.getNurseList(), true); listStaffByCategory();\n break;\n case 3 : ToScreen.listEmployee(employee.getVetList(), true); listStaffByCategory();\n \tbreak;\n case 4 : ToScreen.listEmployee(employee.getAccountantList(), true); listStaffByCategory();\n \tbreak;\n case 5 : ToScreen.listEmployee(employee.getItSupportList(), true); listStaffByCategory();\n \tbreak;\n case 6 : ToScreen.listEmployee(employee.getSecretaryList(), true); listStaffByCategory();\n \tbreak;\n case 7 : main();\n break;\n \n default: listStaffByCategory();\n \n }\n\n\t}", "public void barraprincipal(){\n setJMenuBar(barra);\n //Menu archivo\n archivo.add(\"Salir del Programa\").addActionListener(this);\n barra.add(archivo);\n //Menu tareas\n tareas.add(\"Registros Diarios\").addActionListener(this);\n tareas.addSeparator();\n tareas.add(\"Ver Catalogo de Cuentas\").addActionListener(this);\n tareas.addSeparator();\n tareas.add(\"Empleados\").addActionListener(this);\n tareas.addSeparator();\n tareas.add(\"Productos\").addActionListener(this);\n tareas.addSeparator();\n tareas.add(\"Generacion de Estados Financieros\").addActionListener(this);\n barra.add(tareas);\n //Menu Ayuda\n ayuda.add(\"Acerca de...\").addActionListener(this);\n ayuda.addSeparator();\n barra.add(ayuda);\n //Para ventana interna\n acciones.addItem(\"Registros Diarios\");\n acciones.addItem(\"Ver Catalogo de Cuentas\");\n acciones.addItem(\"Empleados\");\n acciones.addItem(\"Productos\");\n acciones.addItem(\"Generacion de Estados Financieros\");\n aceptar.addActionListener(this);\n salir.addActionListener(this);\n }", "public MenuUsuario(ControladorUsuario1 controladorUsuario) {\n initComponents();\n controladorU=controladorUsuario;\n }", "@Override\n\tpublic void mostrarinfo(String nombreclase) {\n\t\tsuper.mostrarinfo(nombreclase);\n\t\tSystem.out.println(\"Corte : \" + corte);\n\t\tSystem.out.println(\"Sexo :\" + sexo);\n\t}", "@Override\r\n\tpublic void analizarUsuario(String tipo) {\n\t\t\r\n\t\tswitch (tipo){\r\n\t\t\tcase \"Administrativo\":\r\n\t\t\t\tfor(IAsesoria ia : usuarios) {\r\n\t\t\t\t\tif(ia.getClass().getSimpleName().equals(tipo)) {\r\n\t\t\t\t\t\tia.analizarUsuario();\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\t\r\n\t\t\t\tbreak;\t\r\n\t\t\tcase \"Profesional\":\r\n\t\t\t\tfor(IAsesoria ia : usuarios) {\r\n\t\t\t\t\tif(ia.getClass().getSimpleName().equals(tipo)) {\r\n\t\t\t\t\t\tia.analizarUsuario();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"Cliente\":\r\n\t\t\t\tfor(IAsesoria ia : usuarios) {\r\n\t\t\t\t\tif(ia.getClass().getSimpleName().equals(tipo)) {\r\n\t\t\t\t\t\tia.analizarUsuario();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t}\r\n\r\n\r\n\t}", "private void listadoCategorias() {\r\n sessionProyecto.getCategorias().clear();\r\n sessionProyecto.setCategorias(itemService.buscarPorCatalogo(CatalogoEnum.CATALOGOPROYECTO.getTipo()));\r\n }", "private void showUser() {\n\t\tCommonADO ado=CommonADO.getCommonADO();\r\n\t\tString sql=\"select * from Users\";\r\n\t\tResultSet rs=ado.executeSelect(sql);\r\n\t\tString str=\"\";\r\n\t\ttry {\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tString user=rs.getString(\"UserName\");\r\n\t\t\t\tString pass=rs.getString(\"Password\");\r\n\t\t\t\tString type=rs.getString(\"UserType\");\r\n\t\t\t\tif(type.equals(\"管理员\"))\r\n\t\t\t\t\tpass=\"******\";\r\n\t\t\t\tif(user.length()<12){\r\n\t\t\t\t\tfor(int i=user.length();i<=12;i++)\r\n\t\t\t\t\t\tuser+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tif(pass.length()<12){\r\n\t\t\t\t\tfor(int i=pass.length();i<=12;i++)\r\n\t\t\t\t\t\tpass+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tif(type.length()<12){\r\n\t\t\t\t\tfor(int i=type.length();i<=12;i++)\r\n\t\t\t\t\t\ttype+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tstr+=\"用户名:\"+user;\r\n\t\t\t\tstr+=\" 密码:\"+pass;\r\n\t\t\t\tstr+=\" 用户类型:\"+type+\"\\n\";\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\ttextAreaUser.setText(str);\r\n\t}", "String getCategoria();", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_info_user,menu);\n return super.onCreateOptionsMenu(menu);\n }", "public static String[] generarOpcionesMenu() {\n\t\tString[] opcionesMenu = new String[VALUES.length + 1];\n\t\tint i = 0;\n\t\tfor (Modelo modelo : VALUES) {\n\t\t\topcionesMenu[i++] = modelo.name();\n\t\t}\n\t\topcionesMenu[i] = \"Salir\";\n\t\treturn opcionesMenu;\n\t}", "@Override\r\n\tpublic String getCategoria() {\n\t\treturn this.categoria;\r\n\t}", "private void deleteTodoMenu(User u) {\n\t\t\n\t}", "public void setlogUserIn() {\n\t\tmenu1.setOnAction(event -> {\n\t\t\topenUserSettings();\n\t\t});\n\t\tmenu2.setOnAction(event -> {\n\t\t\tsetlogUserOut();\n\t\t});\n\t\tuserMenuButton.setText(controller.loggedIn());\n\t\tuserMenuButton.setStyle(\"-fx-font-size: 10pt; -fx-text-fill:black;\"); // MUOTOILU CSSSSSÄÄÄÄN\n\t\tuserMenuButton.getItems().addAll(menu1, menu2);\n\t\tloggedinuser.setVisible(true);\n\t\tloggedinuser.setText(bundle.getString(\"mVloggedin\"));\n\t\tloggedinuser.setGraphic(userMenuButton);\n\t\tloggedinuser.setContentDisplay(ContentDisplay.RIGHT);\n\t\tuserSettings.setVisible(true);\n\t\tloginoption.setVisible(false);\n\t}", "public FrmChooseCategoryExam(User user, Session session) {\n this.user=user;\n this.session=session;\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(FrmChooseCategoryExam.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n Logger.getLogger(FrmChooseCategoryExam.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n Logger.getLogger(FrmChooseCategoryExam.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedLookAndFeelException ex) {\n Logger.getLogger(FrmChooseCategoryExam.class.getName()).log(Level.SEVERE, null, ex);\n }\n initComponents();\n this.category=\"Antonym\";\n }", "public static String[] generarOpcionesMenu() {\r\n\t\tString[] opcionesMenu = new String[getValues().length + 1];\r\n\t\tint i = 0;\r\n\t\tfor (Color color : getValues()) {\r\n\t\t\topcionesMenu[i++] = color.name();\r\n\t\t}\r\n\t\topcionesMenu[i] = \"Salir\";\r\n\t\treturn opcionesMenu;\r\n\t}", "public void setNomCategoria (String IdCategoria){\n categoriaId = getCategoriaId( IdCategoria );\n if ( categoriaId.moveToFirst() ){//Muestra los valores encontrados en la consulta\n labelCategoria.setText( categoriaId.getString(1) );\n }\n }", "private static void consultaCategoria() throws Exception {\r\n boolean erro;\r\n int idCategoria;\r\n String nomeCategoria;\r\n ArrayList<Produto> lista;\r\n System.out.println(\"\\t** Listar produtos de uma categoria **\\n\");\r\n do {\r\n erro = false;\r\n System.out.print(\"ID da categoria a ser consultada: \");\r\n idCategoria = read.nextInt();\r\n if (idCategoria <= 0) {\r\n erro = true;\r\n System.out.println(\"ID Inválida! \");\r\n }\r\n System.out.println();\r\n } while (erro);\r\n lista = listProdutosPorCategoria(idCategoria);\r\n if (lista != null && !lista.isEmpty()) {\r\n nomeCategoria = getNomeCategoria(idCategoria - 1);\r\n System.out.println(\"Produtos pertencentes a '\" + nomeCategoria + \"'\");\r\n for (Produto p : lista) {\r\n System.out.println(\r\n \"Id: \" + p.getID()\r\n + \"\\nNome: \" + p.nomeProduto\r\n + \"\\nDescricao: \" + p.descricao\r\n + \"\\nPreco: \" + tf.format(p.preco)\r\n + \"\\nMarca: \" + p.marca\r\n + \"\\nOrigem: \" + p.origem\r\n + \"\\nCategoria: \" + nomeCategoria\r\n );\r\n }\r\n } else {\r\n System.out.println(\"Não ha produtos nessa categoria, ou ela não existe!\");\r\n }\r\n }", "public List<String> displayuser() {\n\t\t// TODO Auto-generated method stub\n\t\tList<String> list = new ArrayList<>();\n\t\tlist = crud1.displayUsers();\n\t\treturn list;\n\t}", "public void generateMenu () \n {\n mCoffeeList = mbdb.getCoffeeMenu();\n for(int i =0;i<mCoffeeList.size();i++){\n coffeeTypeCombo.addItem(mCoffeeList.get(i).toString());\n }\n mWaffleList = mbdb.getWaffleMenu();\n for(int j =0;j<mWaffleList.size();j++){\n waffleTypeCombo.addItem(mWaffleList.get(j).toString());\n }\n }", "public void menuTipoActividad() {\n\t\tSystem.out.println(\"MENU TIPOS ACTIVIDAD\");\n\t\tSystem.out.println(\"1. LOW\");\n\t\tSystem.out.println(\"2. MEDIUM\");\n\t\tSystem.out.println(\"3. HIGH\");\n\t}", "public String getManageCategories( HttpServletRequest request )\r\n {\r\n setPageTitleProperty( PAGE_TITLE_MANAGE_CATEGORY );\r\n\r\n CategoryFilter filter = getCategoryFilter( request );\r\n List<String> orderList = new ArrayList<String>( );\r\n orderList.add( BilletterieConstants.NAME );\r\n filter.setOrders( orderList );\r\n filter.setOrderAsc( true );\r\n\r\n // Fill the model\r\n Map<String, Object> model = new HashMap<String, Object>( );\r\n\r\n // Obtention des objets sauvegardés en session\r\n DataTableManager<ShowCategoryDTO> dataTableToUse = getDataTable( request, filter );\r\n model.put( MARK_DATA_TABLE_CATEGORY, dataTableToUse );\r\n\r\n model.put( TicketsConstants.MARK_NB_ITEMS_PER_PAGE, String.valueOf( _nItemsPerPage ) );\r\n model.put( TicketsConstants.MARK_FILTER, filter );\r\n\r\n HtmlTemplate template = AppTemplateService.getTemplate( TEMPLATE_MANAGE_CATEGORIES, getLocale( ), model );\r\n\r\n // opération nécessaire pour eviter les fuites de mémoires\r\n dataTableToUse.clearItems( );\r\n\r\n return getAdminPage( template.getHtml( ) );\r\n }", "public void LlenarC(){\n for(int i=0;i< new GestionCategorias().getListCategoria().size();i++){\n catBox.addItem(new GestionCategorias().getListCategoria().get(i).getCat_nombre());\n \n }\n }", "public GUIGestionUsuarios(Administrador administrador, VentanaDisponible myUnicaVentana ) {\n this.administrador=administrador;\n initComponents();\n //setIconImage(new ImageIcon(getClass().getResource(\"/recursos/clothing.png\")).getImage());\n btnGroupCargoAU.add(rbtnAdministradorAU);\n btnGroupCargoAU.add(rbtnFuncionarioAU);\n \n btnGroupCargoUU.add(rbtnAdministradorUU);\n btnGroupCargoUU.add(rbtnFuncionarioUU);\n this.myUnicaVentana = myUnicaVentana;\n }", "public void setLoggedUser(PersAdministrativo usuario){\n this.usuario = usuario;\n }", "private void setDescription(String UserDescription){\n Description = UserDescription;\n }", "public void displayUsers(){\n //go through the userName arraylist and add them to the listView\n for(String val:this.userNames){\n this.userListView.getItems().add(val);\n }\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);\n\n cadastro = menu.findItem(R.id.action_cadastrar);\n vinte = menu.findItem(R.id.action_vinte_mais);\n mDataUser = FirebaseDatabase.getInstance().getReference().child(\"usuario\");\n\n if (mAuth.getCurrentUser() != null) {\n\n mDataUser.child(user.getUid()).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n String codi = dataSnapshot.getKey();\n String NomeMenu = dataSnapshot.child(\"nome\").getValue().toString();\n String EmailMenu = dataSnapshot.child(\"email\").getValue().toString();\n String imgMenu = dataSnapshot.child(\"imagem\").getValue().toString();\n String func = dataSnapshot.child(\"funcao\").getValue().toString();\n\n txtNome.setText(NomeMenu);\n if (func.toString().equals(\"vendedor\")){\n Intent intent = new Intent(MainActivity.this, TelaInicial.class);\n intent.putExtra(\"idForne\", NomeMenu);\n intent.putExtra(\"user_id\", codi);\n startActivity(intent);\n finish();\n //carregar(NomeMenu);\n //carregarDialog(NomeMenu);\n }\n\n if (func.toString().equals(\"admin\")){\n cadastro.setVisible(true);\n vinte.setVisible(true);\n carregarUsuarios();\n\n }else {\n cadastro.setVisible(false);\n vinte.setVisible(false);\n }\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n\n }\n\n return true;\n }", "private void controladorPerfil(Controlador controlador){\n this.contUserDisplayCollective = controlador.getUserDisplayCollective();\n perfil.setControlCollective((ListSelectionListener)contUserDisplayCollective);\n inicioUser.setControlCollective((ListSelectionListener)contUserDisplayCollective);\n\n this.contUserDisplayProject = controlador.getUserDisplayProject();\n perfil.setControlProject((ListSelectionListener)contUserDisplayProject);\n inicioUser.setControlProject((ListSelectionListener)contUserDisplayProject);\n inicioAdmin.setControlProject((ListSelectionListener)contUserDisplayProject);\n \n }", "public void seleccionarCategoria(String name);", "public void setMenu(){\n opciones='.';\n }", "public static void imprimirMenuCliente() {\r\n\tSystem.out.println(\"---------------------------menu---------------------------\");\r\n\tSystem.out.println(\"opciones: (ingrese la letra)\");\r\n\tSystem.out.println(\"A: despliega la opción comprar entrada\");\r\n System.out.println(\"B: despliega la opción informacion usuario\");\r\n System.out.println(\"C: despliega la opción devolucion entrada\");\r\n System.out.println(\"D: despliega la opción cartelera\");\r\n\tSystem.out.println(\"E: Salir\");\r\n\tSystem.out.println(\"----------------------------------------------------------\");\r\n \r\n }", "@Override\n\tpublic void input() {\n\t\tUser u =new User();\n\t\tif(list.size() <= MAX_USER) {\n\t\tSystem.out.print(\"이름 입력 : \");\n\t\tu.setName(sc.next());\n\t\tSystem.out.print(\"나이 입력 : \");\n\t\tu.setAge(sc.nextInt());\n\t\tSystem.out.print(\"주소 입력 : \");\n\t\tu.setAddr(sc.next());\n\t\tlist.add(u);\n\t\t\n\t\t}else if(list.size() > MAX_USER) {\n\t\t\tSystem.out.println(\"최대 등록 인원은 10명입니다.\");\n\t\t}\n\t}", "public ArrayList<String> select(boolean byUser, String user) {\n ArrayList<String> categories = new ArrayList<>();\n String SQL_TMP = byUser ? SQL_SELECT_USER_CATEGORIES : SQL_SELECT_CATEGORIES;\n // connect DB\n try ( PreparedStatement ps = DBConnection.getConnection().prepareStatement(SQL_TMP)) {\n if (byUser) {\n ps.setString(1, user);\n }\n ResultSet rs = ps.executeQuery();\n while (rs.next()) {\n if (byUser) {\n categories.add(rs.getString(\"category\"));\n } else {\n categories.add(rs.getString(\"name\"));\n }\n }\n } catch (SQLException e) {\n System.out.println(\"Error trying to get tags at [DB.DAOs.Magazines..[TagsDAO] \" + e.getMessage());\n }\n return categories;\n }", "public SigalPeticion getUsuarios() throws Exception {\n SigalPeticion msgEnvio = SigalPeticion.getInstance( 2 );\n\n msgEnvio.addParametro( 0, new Parametro( \"FUNCION\", \"CL\" ) ); \n msgEnvio.addParametro( 1, \n /**\n * Somente usuarios ATIVOS\n * N = Ativos\n * S = Ativos e Inativos\n */\n new Parametro( \"USUBAJAC\", \"N\" ) \n );\n\n msgEnvio.setTipoOperacion( \"view\" );\n msgEnvio.setTransaccion( \"SGCLUSU\" );\n\n return msgEnvio;\n }", "@Override\n\tpublic java.lang.String getDescription() {\n\t\treturn _lineaGastoCategoria.getDescription();\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_main, menu);\n if(names==null ||names==\"\" ){\n menu.findItem(R.id.login).setTitle(\"登入\");\n }\n else{\n menu.findItem(R.id.login).setTitle(\"歡迎\"+names);\n }\n this.menu = menu;\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_main, menu);\n if(names==null ||names==\"\" ){\n menu.findItem(R.id.login).setTitle(\"登入\");\n }\n else{\n menu.findItem(R.id.login).setTitle(\"歡迎\"+names);\n }\n this.menu = menu;\n return true;\n }", "public void setRolesDescripcion(String newValue) throws DataStoreException {\r\n setString(ROLES_DESCRIPCION, newValue);\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);\n textUserName = findViewById(R.id.textUserName);\n textUserEmail = findViewById(R.id.textUserEmail);\n userProfilePic = findViewById(R.id.imageViewUserPic);\n try {\n textUserName.setText(FirebaseAuth.getInstance().getCurrentUser().getDisplayName());\n textUserEmail.setText(FirebaseAuth.getInstance().getCurrentUser().getEmail());\n } catch (NullPointerException e) {\n Log.d(\"d\", e.getMessage());\n }\n return true;\n }", "private void ajoutAffichage(int choix) {\n switch(choix) {\n case AFFICHE_SPOOL :\n ecranSpool.createContents();\n afficheChoix = AFFICHE_SPOOL;\n mntmSpoolUsage.setEnabled(false);\n mntmUser.setEnabled(true);\n mntmConfig.setEnabled(true);\n shell.layout();\n break;\n case AFFICHE_USER :\n ecranUser.createContents();\n afficheChoix = AFFICHE_USER;\n mntmSpoolUsage.setEnabled(true);\n mntmUser.setEnabled(false);\n mntmConfig.setEnabled(true);\n shell.layout();\n break;\n case AFFICHE_CONFIG :\n ecranConfig.createContents();\n afficheChoix = AFFICHE_CONFIG;\n mntmSpoolUsage.setEnabled(true);\n mntmUser.setEnabled(true);\n mntmConfig.setEnabled(false);\n shell.layout();\n break;\n default: break;\n }\n }", "public TelaFuncionario_TelaMenu_GerenciarHistorico() {\n initComponents();\n try {\n listaUsuario = fc.listarTodos();\n } catch (SQLException ex) {\n Logger.getLogger(TelaFuncionario_TelaMenu_GerenciarCliente.class.getName()).log(Level.SEVERE, null, ex);\n }\n btSelecionar.setEnabled(false);\n btHabilitar.setEnabled(false);\n }", "public ListaUsuario() {\n initComponents();\n\n exibir();\n }", "private void controladorUser(Controlador controlador){\n this.contUserCrearProyecto = controlador.getUserCrearProyecto();\n inicioUser.setControlCrearProyecto(contUserCrearProyecto);\n \n this.contUserCrearColectivo = controlador.getUserCrearColectivo();\n inicioUser.setControlCrearColectivo(contUserCrearColectivo);\n\n this.contInformes = controlador.getInformes();\n inicioUser.setControlSolicitarInformes(contInformes); \n \n this.contFiltrar = controlador.getFiltrar();\n inicioUser.setControlFiltrar(contFiltrar);\n\n this.contLimpiar = controlador.getLimpiarFiltro();\n inicioUser.setControlLimpiarFiltro(contLimpiar);\n }", "public String verUsuarios() {\n\t\tString stringIdRol = session.getAttribute(\"rol\").toString();\n\t\tInteger idRol = Integer.parseInt(stringIdRol);\n\n\t\tif (idRol == 1) {\n\t\t\treturn \"TodosLosUsuarios\";\n\t\t}\n\n\t\treturn \"home\";\n\t}", "private void printUserMiniMenu() throws IOException{\n\t\tprintMiniMenu(\"2.Search Again\");\n\t\t//if we passed the printMiniMenu() call, we know the user chose to search again rather than going back to the login menu\n\t\tsearchUsers();\n\t}", "public Edt(Utilisateur user) {\n super(\"Votre emploi du temps - \" + user.getNom().toUpperCase() + \" \" + user.getPrenom().toUpperCase());\n String droit=\" \";\n switch(user.getDroit())\n {\n case 1:\n droit+=\"ADMIN\";\n break;\n case 2:\n droit+=\"REFERENT\";\n break;\n case 3:\n droit+=\"ENSEIGNANT\";\n break;\n case 4:\n droit+=\"ETUDIANT\";\n break;\n }\n this.setTitle(\"Votre emploi du temps - \" + user.getNom().toUpperCase() + \" \" + user.getPrenom().toUpperCase()+droit);\n\n this.setSize(1415, 805); //Taille\n this.setLocationRelativeTo(null); //Centre\n this.setResizable(false);\n this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); //Stop run quand la dernière fenetre est fermé\n infoBase();\n this.logout.addActionListener(this);\n\n }", "@Override\n\tpublic String describirActividades() {\n\t\treturn (\"Soy el secretario, recibo documentos, atiendo llamadas telefónicas y atiendo visitas\");\n\t}", "@Override\n\tpublic String describirActividades() {\n\t\treturn (\"Soy el secretario, recibo documentos, atiendo llamadas telefónicas y atiendo visitas\");\n\t}" ]
[ "0.6475232", "0.6471223", "0.6000086", "0.59987086", "0.5960742", "0.5927745", "0.59123915", "0.5886853", "0.58729035", "0.58331966", "0.58253884", "0.5786102", "0.5781283", "0.57561046", "0.5751526", "0.5732985", "0.5728431", "0.57053065", "0.5686255", "0.56724197", "0.5672309", "0.5657366", "0.5655981", "0.56558704", "0.5642647", "0.5642159", "0.5631703", "0.5603733", "0.56035644", "0.55858517", "0.5572508", "0.5551585", "0.55372167", "0.5534325", "0.5526211", "0.5523045", "0.55181843", "0.55029744", "0.5475895", "0.54626834", "0.54556644", "0.5454702", "0.5435326", "0.5434641", "0.5422216", "0.5418147", "0.54157937", "0.54068875", "0.53934556", "0.53925484", "0.53833586", "0.5381399", "0.53701925", "0.5369176", "0.5368754", "0.5363179", "0.535465", "0.53530675", "0.53464717", "0.53324664", "0.5330537", "0.5322154", "0.5307245", "0.53027374", "0.5297035", "0.52895343", "0.5289086", "0.52890134", "0.528806", "0.5286819", "0.5283301", "0.528091", "0.5275184", "0.5274698", "0.52613246", "0.5253865", "0.52479637", "0.5238704", "0.52374613", "0.5235946", "0.5233679", "0.5228462", "0.5228285", "0.5225237", "0.5221033", "0.5217608", "0.52091676", "0.5208386", "0.5208386", "0.5206987", "0.5205717", "0.5204164", "0.5200442", "0.51997983", "0.51988596", "0.5197719", "0.5196346", "0.51960087", "0.5193272", "0.5193272" ]
0.6055602
2
Setea la descripcion del perfil del usuario
public void setPerfilDescripcion(String descripcion);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getPerfilDescripcion();", "public void setDescripcion(String p) { this.descripcion = p; }", "private void setDescription(String UserDescription){\n Description = UserDescription;\n }", "public void setDescripcion(String descripcion){\r\n this.descripcion = descripcion;\r\n }", "public void setUserDetails(){\n name = firebaseUser.getDisplayName();\n username.setText(name);\n\n Glide.with(this).load(firebaseUser.getPhotoUrl()).into(profileIcon);\n }", "public void setDescripcion(String s) { this.descripcion = s; }", "public void setProfileDescription( String desc )\n\t{\n\t\tmProfileDesc = desc;\n\t if( mProfilePage != null )\n\t mProfilePage.setProfileDescription( mProfileDesc );\n\t}", "public void setDescripcion(String descripcion) {\r\n this.descripcion = descripcion;\r\n }", "public void setDescripcion(String descripcion) {\r\n this.descripcion = descripcion;\r\n }", "public void setDescripcion(String descripcion)\r\n/* 168: */ {\r\n/* 169:309 */ this.descripcion = descripcion;\r\n/* 170: */ }", "public void setDescripcion(java.lang.String descripcion) {\n this.descripcion = descripcion;\n }", "public void setDescripcion(String descripcion) {\n this.descripcion = descripcion;\n }", "private void setUser(){\n try{\n if (!mainUser.getUsername().equals(\"\")){\n this.userName.setText(mainUser.getUsername());\n }else{\n this.userName.setText(\"User\");\n }\n\n\n File file = new File(mainUser.getProfileImage());\n if (!file.exists()){\n file = new File(getClass().getResource(\"../images/eren.png\").getFile());\n }\n Image img = new Image(file.toURI().toString());\n profileImage.setImage(img);\n\n setEventLabel(\"Welcome \"+mainUser.getFname()+\" \"+mainUser.getLname()+\".\");\n }catch (NullPointerException e){\n AlertBox.alert(AlertType.ERROR, stackRoot, anchorRoot, \"There was an error while updating UserInfo\");\n }\n }", "public void setFotoPerfil(Part foto){\n if(foto == null){\n throw new IllegalArgumentException(\"Foto de perfil de usuario igual a null\");\n }\n fotoPerfil = foto;\n }", "public void setDescripcion(String descripcion) {\n this.descripcion.set(descripcion);\n }", "@Override\n public String descripcion() {\n return \"Viaje incentivo que te envia la empresa \" + empresa;\n }", "private void populateUserInfo() {\n User user = Session.getInstance().getUser();\n labelDisplayFirstname.setText(user.getFirstname());\n labelDisplayLastname.setText(user.getLastname());\n lblEmail.setText(user.getEmail());\n lblUsername.setText(user.getUsername());\n }", "public static String getBiblioImagenUsuario() {\n\t\treturn \"imagenUsuario\";\n\t}", "public void setDescrizione (String descrizione) {\r\n\t\tthis.descrizione=descrizione;\r\n\t}", "public void setDescripcion(String descripcion) {\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tlogger.debug(\"setDescripcion(String) - start\");\n\t\t}\n\n\t\tthis.descripcion = descripcion;\n\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tlogger.debug(\"setDescripcion(String) - end\");\n\t\t}\n\t}", "private void putPersonalInformation() throws SQLException, FileNotFoundException, IOException {\n AdUserPersonalData personal;\n try {\n personal = PersonalDataController.getInstance().getPersonalData(username);\n staff_name = personal.getGbStaffName();\n staff_surname = personal.getGbStaffSurname();\n id_type = \"\"+personal.getGbIdType();\n id_number = personal.getGbIdNumber();\n putProfPic(personal.getGbPhoto());\n phone_number = personal.getGbPhoneNumber();\n mobile_number = personal.getGbMobileNumber();\n email = personal.getGbEmail();\n birthdate = personal.getGbBirthdate();\n gender = \"\"+personal.getGbGender();\n } catch (GB_Exception ex) {\n LOG.error(ex);\n GBMessage.putException(ex);\n }\n }", "public void setUserSurname(String surname) {\n profile.setSurname(currentUser, surname);\n }", "public void setUsuario(java.lang.String newUsuario);", "public void setDescripcion(@NotNull String descripcion) {\n this.descripcion = descripcion;\n }", "public String getDescripcion() \n\t{\n\t\treturn descripcion;\n\t}", "public String getDescripcion() {\r\n return descripcion;\r\n }", "public String getDescripcion() {\r\n return descripcion;\r\n }", "public String getDescripcion() {\r\n return Descripcion;\r\n }", "public void editTheirProfile() {\n\t\t\n\t}", "@Override\n public String getDescription() {\n return \"Account information\";\n }", "@Override\n\tpublic String getDescripcion() {\n\t\treturn descripcion;\n\t}", "public void setFoto(java.lang.String foto) {\n this.foto = foto;\n }", "public String getDescripcion() {\n return descripcion;\n }", "public void setPerfilSesion(Perfil perfilSesion){\n this.perfilSesion = perfilSesion;\n\n }", "public void setDescrizione(java.lang.String descrizione) {\r\n this.descrizione = descrizione;\r\n }", "private void putDefaultInformation() throws FileNotFoundException, SQLException, IOException {\n staff_name = \"Sin informacion\";\n staff_surname = \"Sin informacion\";\n id_type = \"Sin informacion\";\n id_number = \"Sin informacion\";\n putProfPic(null);\n phone_number = \"Sin informacion\";\n mobile_number = \"Sin informacion\";\n email = \"Sin informacion\";\n birthdate = GBEnvironment.getInstance().serverDate();\n gender = \"Seleccione sexo\";\n }", "public String getDescripcion() {\r\n\t\treturn descripcion;\r\n\t}", "public void setUsuarioModificacion(String p) { this.usuarioModificacion = p; }", "public void setUsuarioModificacion(String p) { this.usuarioModificacion = p; }", "public void setDescrizione(String descrizione) {\r\n\t\tthis.descrizione = descrizione;\r\n\t}", "public String getDescripcion() {\n return descripcion;\n }", "public void setUser_name(String user_name);", "public String getDescripcion(){\n return descripcion;\n }", "@Override\n public void buildPersonalidad() {\n this.personaje.setPersonalidad(\"Pacientes y estrategas.\");\n }", "public void setApellidoPaterno(String apellidoPaterno);", "public String getDescripcion() {\n\t\treturn descripcion;\n\t}", "public String getDescripcion() {\n\t\treturn descripcion;\n\t}", "public void setDescrizione(String descrizione) {\n\t\tthis.descrizione = descrizione;\n\t}", "public void setInfo(String nombre, String apellidos, String telefono,\n String direccion) {\n _nombre = nombre;\n _apellidos = apellidos;\n _telefono = telefono;\n _direccion = direccion;\n }", "public void setDescription(String desc) {\n this.desc = desc;\n }", "public void setupUserInfo(Bundle upUserInfo) {\n // Getting Info\n String name = upUserInfo.getString(\"userName\");\n String email = upUserInfo.getString(\"userEmail\");\n\n\n // Setting local Variables\n this.tutorName = name;\n this.tutorEmail = email;\n\n TextView nameField = (TextView) findViewById(R.id.UserNameField);\n nameField.setText(name);\n\n\n }", "public void setDescription(String description){this.description=description;}", "public void setNombre(String nombre){\n if(nombre == null){\n throw new IllegalArgumentException(\"Nombre de usuario igual a null\");\n }\n this.nombre = nombre;\n }", "void setDesc(java.lang.String desc);", "public void setDescripcion(java.lang.String newDescripcion) {\n\t\tif (instanceExtension.needValuesOnMarkDirty())\n\t\t\tinstanceExtension.markDirty(3,getDescripcion(),newDescripcion);\n\t\telse\n\t\t\tinstanceExtension.markDirty(3);\n\t\tdataCacheEntry.setDescripcion(newDescripcion);\n\t}", "public void displayDetails() {\r\n\t\tSystem.out.println(\"*******************Profile Details*********************\");\r\n\t\tSystem.out.println(\"\\tUsername :\\t\" + uName);\r\n\t\tSystem.out.println(\"\\tFull Name :\\t\" + fullName);\r\n\t\tSystem.out.println(\"\\tPhone :\\t\" + phone);\r\n\t\tSystem.out.println(\"\\tE-Mail :\\t\" + email);\r\n\t}", "public String getDescripcion()\n {\n return descripcion;\n }", "public void setNombreUsuario(String nombreUsuario) {\r\n this.nombreUsuario = nombreUsuario;\r\n }", "public void setDescription(String desc)\r\n {\r\n\tthis.desc = desc;\r\n }", "public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n \r\n }", "public void setPerfil(int perfil){\n this.perfil = perfil;\n }", "private void readInfoUser() {\n\n final DatabaseReference reference = FirebaseDatabase.getInstance().getReference().child(\"Users\")\n .child(mAuth.getCurrentUser().getUid());\n reference.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n String txtName = Objects.requireNonNull(snapshot.child(\"name\").getValue()).toString();\n String txtEmail = Objects.requireNonNull(snapshot.child(\"email\").getValue()).toString();\n String imgProfile = Objects.requireNonNull(snapshot.child(\"imageurlProfile\").getValue().toString());\n String txtBio = Objects.requireNonNull(snapshot.child(\"bio\").getValue().toString());\n\n userNameProfile.setText(txtName);\n userEmailProfile.setText(txtEmail);\n userBioProfile.setText(txtBio);\n\n if (!imgProfile.equals(\"default\")) {\n Picasso.get()\n .load(imgProfile)\n .placeholder(R.drawable.profile)\n .error(R.drawable.profile)\n .into(proImage);\n\n }else {\n proImage.setImageResource(R.drawable.profile);\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n });\n }", "public void setDescripcion(String descripcion) {\n this.descripcion = descripcion;\n \n switch (descripcion) {\n case \"REFORMA\": {\n this.id = 1;\n break;\n }\n case \"CASA\": {\n this.id = 2;\n break;\n }\n case \"EDIFICIO\": {\n this.id = 3;\n break;\n }\n case \"VIAL\": {\n this.id = 4;\n break;\n }\n default : this.id = 0;\n }\n }", "private void fillYourInfo(){\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n if (user != null) {\n // Name, email address, and profile photo Url\n String user_name = user.getDisplayName();\n String email = user.getEmail();\n Uri photoUrl = user.getPhotoUrl();\n\n // Check if user's email is verified\n boolean emailVerified = user.isEmailVerified();\n\n // The user's ID, unique to the Firebase project. Do NOT use this value to\n // authenticate with your backend server, if you have one. Use\n // FirebaseUser.getToken() instead.\n TextView UserName = findViewById(R.id.playername1);\n ImageView ProfilePic = findViewById(R.id.playerimg1);\n UserName.setText(user_name);\n if (photoUrl != null) {\n Picasso.with(this).load(photoUrl).into(ProfilePic);\n }\n }\n if (user == null){\n TextView UserName = findViewById(R.id.playername1);\n ImageView ProfilePic = findViewById(R.id.playerimg1);\n UserName.setText(getText(R.string.def_user));\n ProfilePic.setImageResource(R.drawable.def_icon);\n }\n }", "public String changePwordTitle() {\n return \"Changing password\";\n }", "public void displayPatientProfile(Resident res){\n \t\n \t// Change the patient profile picture\n \t//ImageView iv = (ImageView) findViewById(R.id.patientPicture);\n \t//iv.setImageBitmap(bitmap);\n \tLog.d(UI_MODE_SERVICE, \"Entered displayPatientProfile\");\n \t \t\n \tupdateTextView(res.getName(), \"txtPatientName\");\n \tif (res.isGender()){\n \t\tupdateTextView(\"Female\", \"txtPatientGender\");\n \t}\n \telse{\n \t\tupdateTextView(\"Male\", \"txtPatientGender\");\n \t}\n \tupdateTextView(Integer.toString(res.getRoomNumber()), \"txtPatientRoom\");\n \tupdateTextView(res.getDiagnosis(), \"txtPatientDiagnosis\");\n \t// What is \"Other Diagnosis considered as?\"\n \tupdateTextView(Integer.toString(res.getAge()), \"txtPatientAge\");\n \t// Add weight to the database!\n \t//updateTextView(Integer.toString(res.getWeight()), \"txtPatientWeight\");\n \tupdateTextView(res.getRecentActions(), \"txtPatientRecentActions\");\n \tupdateTextView(res.getNotes(), \"txtPatientNotes\");\n \t\n \t\n \t// Check if any of these need to be put somewhere?\n \tLog.d(UI_MODE_SERVICE, \"Primary Diagnosis?: \"+ res.getPrimaryDiagnosis());\n \tLog.d(UI_MODE_SERVICE, \"Other Diagnosis: \"+ res.getOtherDiagnoses());\n \tLog.d(UI_MODE_SERVICE, \"Allergies: \"+ res.getAllergies());\n \tLog.d(UI_MODE_SERVICE, \"Picture Path: \"+ res.getPicturePath());\n \tLog.d(UI_MODE_SERVICE, \"Preferences: \"+ res.getPrefs());\n \t\n }", "public void setDescripcionGrupo(String descripcionGrupo) {\n\t\tthis.descripcionGrupo = descripcionGrupo;\n\t}", "String getDescripcion();", "String getDescripcion();", "public void setDescription(String desc);", "private void populateProfile() {\n mPassword_input_layout.getEditText().setText(mSharedPreferences.getPassWord());\n mEmail_input_layout.getEditText().setText(mSharedPreferences.getEmail());\n mEdit_name_layout.getEditText().setText(mSharedPreferences.getName());\n ((RadioButton) mRadioGender.getChildAt(mSharedPreferences.getGender())).setChecked(true);\n mPhone_input_layout.getEditText().setText(mSharedPreferences.getPhone());\n mMajor_input_layout.getEditText().setText(mSharedPreferences.getMajor());\n mClass_input_layout.getEditText().setText(mSharedPreferences.getYearGroup());\n\n // Load profile photo from internal storage\n try {\n FileInputStream fis = openFileInput(getString(R.string.profile_photo_file_name));\n Bitmap bmap = BitmapFactory.decodeStream(fis);\n mImageView.setImageBitmap(bmap);\n fis.close();\n } catch (IOException e) {\n // Default profile\n }\n }", "public void setDescription(String description) {\n\t\tLOGGER.debug(\"SecurityObject#setDescription [description=\" + description + \"]\");\n\n\t\tthis.description = description;\n\t}", "private void loadUserInformation() {\n FirebaseUser user = mAuth.getCurrentUser();\n\n if (user != null) {\n if (user.getPhotoUrl() != null) {\n Glide.with(this).load(user.getPhotoUrl().toString()).into(profilePic);\n }\n if (user.getDisplayName() != null) {\n name.setText(user.getDisplayName());\n }\n\n }\n\n }", "public void setDescription(String description){\n this.description = description;\n }", "public void setDescricao(java.lang.String descricao) {\r\n this.descricao = descricao;\r\n }", "public void setDescription(String desc) {\n description = desc;\n }", "public void setDescription(String desc) {\n sdesc = desc;\n }", "public static void setLastName(String name){\n setUserProperty(Constants.ZeTarget_keyForUserPropertyLName,name);\n }", "public void setProfileImg() {\n }", "public String dameDescripcion(){\n return \"Este empleado tiene un id = \"+getId()+\" con un sueldo de \"+getSueldo();\n }", "public void setDescription(String value) {\r\n this.description = value;\r\n }", "public void setDescription(String description) {\n this.description = description;\n }", "public void setDescription(String description) {\n this.description = description;\n }", "public String getDescripcion() { return this.descripcion; }", "@Override\n\tpublic void setDescripcion(String descripcion) {\n\t\tmodel.setDescripcion(descripcion);\n\t}", "public void setCategoriaDescripcion(String descripcion);", "public void setDescription(String description) { this.description = description; }", "protected void setUsuario(String usuario) {\n this.usuario = usuario;\n }", "public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n }", "public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n }", "public void setUsuario(java.lang.String usuario) {\n this.usuario = usuario;\n }", "public java.lang.String getDescripcion() {\n return descripcion;\n }", "private void loadUserInformation(){\n FirebaseUser user = mAuth.getCurrentUser();\n\n String displayEmail = user.getEmail();\n email.setText(\"Velkommenn \" + displayEmail+\"!\");\n }", "public void setDescription(String des){\n description = des;\n }", "public void creaRutaImgPerfil(){\n servletContext=(ServletContext) contexto.getExternalContext().getContext();\n String ruta=\"\";\n //Ruta real hasta la carpeta de uploads\n ruta=servletContext.getRealPath(\"/upload/\");\n \n //Concatenamiento de directorios internos\n ruta+=File.separatorChar+\"img\"+File.separatorChar+\"users\"+File.separatorChar;\n \n //Asignacion de la ruta creada\n this.rutaImgPerfil=ruta;\n }", "public void editProfile() {\n\n\t\tAccount account = getInputOfUsersAccount();\n\t\tSystem.out.println(account.getUser().toString());\n\n\t\taccount = userBo.handleProfileOption(account);\n\n\t\tif (userDAO.editProfile(account))\n\t\t\tSystem.out.println(\"User edited!\");\n\n\t\telse\n\t\t\tSystem.out.println(\"Something went wrong!\");\n\n\t\tAdminMenu.getAdminMenu();\n\t}", "private void modificarProfesor(){\n \n System.out.println(\"-->> MODIFICAR PROFESOR\");\n int opcion;\n String nif=IO_ES.leerCadena(\"Inserte el nif del profesor\");\n if(ValidarCadenas.validarNIF(nif)){\n Profesor profesor=(Profesor) getPersona(LProfesorado, nif);\n if(profesor!=null){\n do{\n System.out.println(profesor);\n System.out.println(\"\\n1. Nombre\");\n System.out.println(\"2. Dirección\");\n System.out.println(\"3. Código Postal\");\n System.out.println(\"4. Teléfono\");\n System.out.println(\"5. Módulo\");\n System.out.println(\"0. Volver\");\n opcion=IO_ES.leerInteger(\"Inserte una opción: \", 0, 5);\n \n \n switch(opcion){\n \n case 1:\n actualizarNombre(profesor);\n break;\n case 2:\n actualizarDireccion(profesor);\n break;\n case 3:\n actualizarCodigoPostal(profesor);\n break;\n case 4:\n actualizarTelefono(profesor);\n break;\n case 5:\n actualizarModulo(profesor);\n break;\n \n \n }\n \n }while(opcion!=0);\n }\n else{\n System.out.println(\"El profesor no existe\");\n }\n \n }\n else {\n System.out.println(\"El nif no es válido\");\n }\n \n }", "public void setDescription(String value) {\n this.description = value;\n }", "private void setNomeProfessor(String novoNome)\n\t{\n\t\tthis.nomeProfessor = novoNome;\n\t}", "@Override\n\tpublic String getUserPicture() {\n\t\treturn super.getUserPicture();\n\t}" ]
[ "0.74579257", "0.64136195", "0.6327683", "0.6273705", "0.61404926", "0.6120866", "0.6087494", "0.6056833", "0.6056833", "0.6035325", "0.6000681", "0.5991243", "0.598959", "0.59510994", "0.5927752", "0.59241766", "0.58318985", "0.5809983", "0.57895416", "0.5768559", "0.5715844", "0.57114345", "0.56235003", "0.561817", "0.5600893", "0.55985034", "0.55985034", "0.55958444", "0.55947465", "0.5594535", "0.5593956", "0.55899316", "0.5565507", "0.5560464", "0.55509317", "0.5536725", "0.55344665", "0.5527036", "0.5527036", "0.55240595", "0.55239534", "0.5520339", "0.5514132", "0.550107", "0.54944164", "0.54936624", "0.54936624", "0.5487994", "0.5471538", "0.5467255", "0.5466375", "0.5466061", "0.5450586", "0.54472804", "0.5438932", "0.5437197", "0.5432972", "0.54284906", "0.54257405", "0.5422141", "0.5408263", "0.5404589", "0.54017293", "0.53974247", "0.5397051", "0.53835946", "0.5377697", "0.5372826", "0.5372826", "0.53671813", "0.5365512", "0.53585297", "0.5354416", "0.53543514", "0.5353352", "0.5344118", "0.5342396", "0.5335309", "0.5329668", "0.53286326", "0.5324834", "0.53247803", "0.53247803", "0.53234917", "0.5318438", "0.53181976", "0.53135985", "0.5304854", "0.52956855", "0.52956855", "0.52951086", "0.5290302", "0.52849096", "0.5284405", "0.52805924", "0.5278441", "0.526975", "0.5269352", "0.5269167", "0.52662796" ]
0.8415525
0
Obtiene la descripcion de la categoria del usuario
public String getCategoriaDescripcion();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setCategoriaDescripcion(String descripcion);", "@Override\n\tpublic java.lang.String getDescription() {\n\t\treturn _lineaGastoCategoria.getDescription();\n\t}", "public String toString(){\n\t\tif(categoria == 1)\n\t\t\treturn \"Profesor Ayudante\\n\" + super.toString() + \"\\n\" + \"Horario = \" + tutoria;\n\t\telse if(categoria == 2)\n\t\t\treturn \"Profesor Titular de Universidad\\n\" + super.toString() + \"\\n\" + \"Horario = \" + tutoria;\n\t\telse\n\t\t\treturn \"Profesor Catedrático de Universidad\\n\" + super.toString() + \"\\n\" + \"Horario = \" + tutoria;\n\t}", "public String categoryDesc() { //to show the description of the category\n String desc = \"\";\n if (category.equals(\"H\")) {\n desc = \"Trump category: Hardness\";\n } else if (category.equals(\"S\")) {\n desc = \"Trump category: Specific Gravity\";\n } else if (category.equals(\"C\")) {\n desc = \"Trump category: Cleavage\";\n } else if (category.equals(\"CA\")) {\n desc = \"Trump category: Crustal Abundance\";\n } else if (category.equals(\"EV\")) {\n desc = \"Trump category: Economic Value\";\n }\n return desc;\n }", "String getCategoria();", "public String descriere(){\r\n\t\treturn \"Flori\";\r\n\t}", "public String getCategoryDescription() {\n return categoryDesc;\n }", "@Override\r\n\tpublic String getCategoria() {\n\t\treturn this.categoria;\r\n\t}", "public String getName(){\n return category;\n }", "String getCategory();", "String getCategory();", "public String getCategoryDescription() {\r\n return categoryDescription;\r\n }", "public String getCategory();", "String category();", "@Override\n public String getDescription() {\n return \"Account information\";\n }", "public String toString() {\n\t\treturn tipo + \" : \" + descripcion;\n\t}", "java.lang.String getDesc();", "@Override\n\tpublic Categoria crearCategoria(String nombreCategoria, String descripcionCategoria) {\n\t\treturn null;\n\t}", "public String getRolesDescripcion() throws DataStoreException {\r\n return getString(ROLES_DESCRIPCION);\r\n }", "String getDesc();", "public String getCategory_name(){return category_name;}", "@Override\n\tpublic java.lang.String getName() {\n\t\treturn _lineaGastoCategoria.getName();\n\t}", "public String getCategory(){\r\n\t\treturn this.category;\r\n\t}", "public String getPerfilDescripcion();", "@Override\n protected String elaboraFooterCategorie() {\n String text = CostBio.VUOTO;\n\n text += A_CAPO;\n text += LibWiki.setRigaCat(\"Liste di persone per cognome| \");\n text += LibWiki.setRigaCat(\"Progetto Antroponimi|Cognomi\");\n\n return text;\n }", "public String getUserCate() {\n\t\treturn restClient.getSuggestedUsersCat();\n\t}", "public String getDescrizione() {\r\n\t\treturn descrizione;\r\n\t}", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "public String toString() {\n\t\treturn category;\n\t}", "public String getCategory() {\n return \"论文\";\r\n }", "@Override\n\tpublic String describirActividades() {\n\t\treturn (\"Soy el secretario, recibo documentos, atiendo llamadas telefónicas y atiendo visitas\");\n\t}", "@Override\n\tpublic String describirActividades() {\n\t\treturn (\"Soy el secretario, recibo documentos, atiendo llamadas telefónicas y atiendo visitas\");\n\t}", "@Override\n public String getCategoryLabel() {\n return categoryLabel;\n }", "String getAccountDescription();", "String getAccountDescription();", "public abstract String getCategory();", "public abstract String getCategory();", "public String category() {\n return this.category;\n }", "public String category() {\n return this.category;\n }", "public controladorCategorias() {\r\n }", "public String description () {\n\t\t\tSystem.out.println(treinador.getTreinador() + \" fugiu da batalha!!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t\treturn treinador.getTreinador() + \" fugiu da batalha!!\";\r\n\t\t}", "public String getDescrizione() {\n\t\treturn descrizione;\n\t}", "@Override\r\n public String toString() {\n return this.descripcion;\r\n }", "private void setcategoriaPrincipal(String categoriaPrincipal2) {\n\t\t\n\t}", "public void setPerfilDescripcion(String descripcion);", "public void showMemberCategoryMenu() {\n System.out.println(\"Visa lista med: \");\n System.out.println(\"\\t1. Barnmedlemmar\");\n System.out.println(\"\\t2. Ungdomsmedlemmar\");\n System.out.println(\"\\t3. Vuxenmedlemmar\");\n System.out.println(\"\\t4. Seniormedlemmar\");\n System.out.println(\"\\t5. VIP-medlemmar\");\n System.out.print(\"Ange val: \");\n }", "String getDescripcion();", "String getDescripcion();", "public String getHumanReadableDescription();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String getDisplay_description();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();" ]
[ "0.701649", "0.6797557", "0.6492468", "0.6391811", "0.6258511", "0.62401235", "0.622539", "0.62181765", "0.6111266", "0.60251975", "0.60251975", "0.599058", "0.59308904", "0.5897695", "0.58752143", "0.586871", "0.5868641", "0.5856054", "0.5847764", "0.5763984", "0.5761871", "0.57425755", "0.5738073", "0.573357", "0.5701736", "0.56978583", "0.5696624", "0.56960833", "0.56960833", "0.56960833", "0.56960833", "0.56960833", "0.56960833", "0.56960833", "0.56960833", "0.56960833", "0.5680414", "0.5670722", "0.5666491", "0.5666491", "0.5666378", "0.566286", "0.566286", "0.5648996", "0.5648996", "0.5643387", "0.5643387", "0.5636731", "0.5635299", "0.5633633", "0.56327", "0.5621486", "0.5616011", "0.56077266", "0.5604873", "0.5604873", "0.5599428", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55700064", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421" ]
0.74513376
0
Obtiene la descripcion de la categoria del usuario
public String getPerfilDescripcion();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getCategoriaDescripcion();", "public void setCategoriaDescripcion(String descripcion);", "@Override\n\tpublic java.lang.String getDescription() {\n\t\treturn _lineaGastoCategoria.getDescription();\n\t}", "public String toString(){\n\t\tif(categoria == 1)\n\t\t\treturn \"Profesor Ayudante\\n\" + super.toString() + \"\\n\" + \"Horario = \" + tutoria;\n\t\telse if(categoria == 2)\n\t\t\treturn \"Profesor Titular de Universidad\\n\" + super.toString() + \"\\n\" + \"Horario = \" + tutoria;\n\t\telse\n\t\t\treturn \"Profesor Catedrático de Universidad\\n\" + super.toString() + \"\\n\" + \"Horario = \" + tutoria;\n\t}", "public String categoryDesc() { //to show the description of the category\n String desc = \"\";\n if (category.equals(\"H\")) {\n desc = \"Trump category: Hardness\";\n } else if (category.equals(\"S\")) {\n desc = \"Trump category: Specific Gravity\";\n } else if (category.equals(\"C\")) {\n desc = \"Trump category: Cleavage\";\n } else if (category.equals(\"CA\")) {\n desc = \"Trump category: Crustal Abundance\";\n } else if (category.equals(\"EV\")) {\n desc = \"Trump category: Economic Value\";\n }\n return desc;\n }", "String getCategoria();", "public String descriere(){\r\n\t\treturn \"Flori\";\r\n\t}", "public String getCategoryDescription() {\n return categoryDesc;\n }", "@Override\r\n\tpublic String getCategoria() {\n\t\treturn this.categoria;\r\n\t}", "public String getName(){\n return category;\n }", "String getCategory();", "String getCategory();", "public String getCategoryDescription() {\r\n return categoryDescription;\r\n }", "public String getCategory();", "String category();", "@Override\n public String getDescription() {\n return \"Account information\";\n }", "public String toString() {\n\t\treturn tipo + \" : \" + descripcion;\n\t}", "java.lang.String getDesc();", "@Override\n\tpublic Categoria crearCategoria(String nombreCategoria, String descripcionCategoria) {\n\t\treturn null;\n\t}", "public String getRolesDescripcion() throws DataStoreException {\r\n return getString(ROLES_DESCRIPCION);\r\n }", "String getDesc();", "public String getCategory_name(){return category_name;}", "@Override\n\tpublic java.lang.String getName() {\n\t\treturn _lineaGastoCategoria.getName();\n\t}", "public String getCategory(){\r\n\t\treturn this.category;\r\n\t}", "@Override\n protected String elaboraFooterCategorie() {\n String text = CostBio.VUOTO;\n\n text += A_CAPO;\n text += LibWiki.setRigaCat(\"Liste di persone per cognome| \");\n text += LibWiki.setRigaCat(\"Progetto Antroponimi|Cognomi\");\n\n return text;\n }", "public String getUserCate() {\n\t\treturn restClient.getSuggestedUsersCat();\n\t}", "public String getDescrizione() {\r\n\t\treturn descrizione;\r\n\t}", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "public String toString() {\n\t\treturn category;\n\t}", "public String getCategory() {\n return \"论文\";\r\n }", "@Override\n\tpublic String describirActividades() {\n\t\treturn (\"Soy el secretario, recibo documentos, atiendo llamadas telefónicas y atiendo visitas\");\n\t}", "@Override\n\tpublic String describirActividades() {\n\t\treturn (\"Soy el secretario, recibo documentos, atiendo llamadas telefónicas y atiendo visitas\");\n\t}", "@Override\n public String getCategoryLabel() {\n return categoryLabel;\n }", "String getAccountDescription();", "String getAccountDescription();", "public abstract String getCategory();", "public abstract String getCategory();", "public String category() {\n return this.category;\n }", "public String category() {\n return this.category;\n }", "public controladorCategorias() {\r\n }", "public String description () {\n\t\t\tSystem.out.println(treinador.getTreinador() + \" fugiu da batalha!!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t\treturn treinador.getTreinador() + \" fugiu da batalha!!\";\r\n\t\t}", "public String getDescrizione() {\n\t\treturn descrizione;\n\t}", "@Override\r\n public String toString() {\n return this.descripcion;\r\n }", "private void setcategoriaPrincipal(String categoriaPrincipal2) {\n\t\t\n\t}", "public void setPerfilDescripcion(String descripcion);", "public void showMemberCategoryMenu() {\n System.out.println(\"Visa lista med: \");\n System.out.println(\"\\t1. Barnmedlemmar\");\n System.out.println(\"\\t2. Ungdomsmedlemmar\");\n System.out.println(\"\\t3. Vuxenmedlemmar\");\n System.out.println(\"\\t4. Seniormedlemmar\");\n System.out.println(\"\\t5. VIP-medlemmar\");\n System.out.print(\"Ange val: \");\n }", "String getDescripcion();", "String getDescripcion();", "public String getHumanReadableDescription();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String getDisplay_description();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();" ]
[ "0.74513376", "0.701649", "0.6797557", "0.6492468", "0.6391811", "0.6258511", "0.62401235", "0.622539", "0.62181765", "0.6111266", "0.60251975", "0.60251975", "0.599058", "0.59308904", "0.5897695", "0.58752143", "0.586871", "0.5868641", "0.5856054", "0.5847764", "0.5763984", "0.5761871", "0.57425755", "0.5738073", "0.5701736", "0.56978583", "0.5696624", "0.56960833", "0.56960833", "0.56960833", "0.56960833", "0.56960833", "0.56960833", "0.56960833", "0.56960833", "0.56960833", "0.5680414", "0.5670722", "0.5666491", "0.5666491", "0.5666378", "0.566286", "0.566286", "0.5648996", "0.5648996", "0.5643387", "0.5643387", "0.5636731", "0.5635299", "0.5633633", "0.56327", "0.5621486", "0.5616011", "0.56077266", "0.5604873", "0.5604873", "0.5599428", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55927616", "0.55700064", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421", "0.5564421" ]
0.573357
24
Setea el nombre completo del usuario
public void setNombreCompleto(String nombreCompleto);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setName(String name){\r\n gotUserName = true;\r\n this.name = name;\r\n }", "@Override\n public void nick_name(String nick){\n ///Pregunta el nombres y el usuario le asigna\n nickName= nick;\n nombre=nickName;\n }", "public void setNombreUsuario(String nombreUsuario){\n if(nombreUsuario == null){\n throw new IllegalArgumentException(\"Nick de usuario igual a null\");\n }\n this.nombreUsuario = nombreUsuario;\n }", "public void setUser_name(String user_name);", "void setUserName(String newName) {\r\n\t\t\tusername = newName;\r\n\t\t}", "public void updateName() {\n try {\n userFound = clientefacadelocal.find(this.idcliente);\n if (userFound != null) {\n userFound.setNombre(objcliente.getNombre());\n clientefacadelocal.edit(userFound);\n objcliente = new Cliente();\n mensaje = \"sia\";\n } else {\n mensaje = \"noa\";\n System.out.println(\"Usuario No Encontrado\");\n }\n } catch (Exception e) {\n mensaje = \"noa\";\n System.out.println(\"El error al actualizar el nombre es \" + e);\n }\n }", "public void setNombreUsuario(String nombreUsuario) {\r\n this.nombreUsuario = nombreUsuario;\r\n }", "void setName( String username, String name ) throws UserNotFoundException;", "public void setName ( String name ) throws InvalidUserIDException {\r\n if(name == \"\") throw new InvalidUserIDException();\r\n _name= name;\r\n }", "public String getNickName(){\n return nombreUsuario;\n }", "public void setUserName( String value )\n {\n m_UserName = value;\n }", "public void setUsuario(java.lang.String newUsuario);", "@Override\n public java.lang.String getUserName() {\n return _partido.getUserName();\n }", "public void setUsername(String name)\r\n {\r\n int index = -1;\r\n //Check if the new username is not already taken before setting the new username\r\n if(usernamesTaken.indexOf(name) == -1)\r\n {\r\n index = usernamesTaken.indexOf(this.username);\r\n usernamesTaken.set(index, name);\r\n this.username = name;\r\n }\r\n else\r\n {\r\n //Outouts a warning message\r\n System.out.println(\"WARNING: This username is already taken\");\r\n }//end if \r\n }", "@Override\n public void setUserName(java.lang.String userName) {\n _partido.setUserName(userName);\n }", "private void updateUserName() {\n\t\t// if the customer has a first and last name update their username to be\n\t\t// the concatenation of their first and last name (in lower case)\n\t\t// else, make their username their first name\n\t\tif (!this.lastName.equals(Customer.EMPTY_LAST_NAME)) {\n\t\t\tthis.userName = (this.firstName + this.lastName).toLowerCase();\n\t\t} else {\n\t\t\tthis.userName = this.firstName.toLowerCase();\n\t\t}\n\t}", "java.lang.String getUserName();", "java.lang.String getUserName();", "java.lang.String getUserName();", "@Override\r\n\t\t\tpublic String getUsername() {\n\t\t\t\treturn \"User1\";\r\n\t\t\t}", "public String getName(){\n return username;\n\t}", "public void setUserName(String text) {\n txtUserName().setText(text);\n }", "public void setUserName(String pUser)\n\t{\n \t tbUserName.clear();\n\t tbUserName.sendKeys(pUser);\n\t\t\n\t}", "@Override\n public String getUserName() {\n return name;\n }", "public void setUserName(String value) {\n setAttributeInternal(USERNAME, value);\n }", "public void setNombre(String nombre){\n if(nombre == null){\n throw new IllegalArgumentException(\"Nombre de usuario igual a null\");\n }\n this.nombre = nombre;\n }", "@Override\n\tpublic void setUserName(String userName);", "@Override\n\tpublic void setUserName(String userName);", "public void setUserName(String name) {\r\n\t\tthis.userName = name;\r\n\t}", "public Builder setUserName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n userName_ = value;\n onChanged();\n return this;\n }", "public void setName(String name) {\n\t\tSharedPreferences settings = parentContext.getSharedPreferences(PREFERENCE_FILE, 0);\n\t\tSharedPreferences.Editor editor = settings.edit();\n\t\teditor.putString(USERNAME_KEY, name);\n\t\teditor.commit();\n\t}", "public void setUsernameFieldName(final String value) {\n setProperty(USERNAME_FIELD_NAME_KEY, value);\n }", "public void setUsername(java.lang.CharSequence value) {\n this.username = value;\n }", "public void setName(String username) {\n setObject(\"username\", (username != null) ? username : \"\");\n }", "public Builder setUserName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n userName_ = value;\n onChanged();\n return this;\n }", "public Builder setUserName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n userName_ = value;\n onChanged();\n return this;\n }", "public Builder setUserName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n userName_ = value;\n onChanged();\n return this;\n }", "public void setNameofRenter(String usrName) throws Exception{\n\n\t\t/*\n\t\t * Input is invalid if an empty String is passed in.\n\t\t */\n\t\tif(usrName.length() == 0){\n\t\t\tthrow new Exception();\n\t\t}\n\t\tnameofRenter = usrName;\n\t}", "void setUserUsername(String username);", "public void setUserName(java.lang.String value) {\n\t\tsetValue(org.jooq.examples.oracle.sys.packages.dbms_xplan.DiffPlanOutline.USER_NAME, value);\n\t}", "public final void setUsername(final String value) {\n username = value;\n }", "String getUserName();", "String getUserName();", "public void setUserName(String UserName){\n\t\tObjLogInPage.getUserName().sendKeys(UserName);\n\t}", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "@AutoEscape\n\t@Override\n\tpublic String getUserName();", "@AutoEscape\n\t@Override\n\tpublic String getUserName();", "private Component getUserName() {\n\t\tif (userName == null) {\r\n\t\t\tuserName = new JTextField();\r\n\t\t\tuserName.setText(\"user1\");\r\n\t\t}\r\n\t\treturn userName;\r\n\t}", "public static void setLastName(String name){\n setUserProperty(Constants.ZeTarget_keyForUserPropertyLName,name);\n }", "private void actualizarNombre(Persona persona){\n \n String nombre=IO_ES.leerCadena(\"Inserte el nombre\");\n persona.setNombre(nombre);\n }", "public void setUserName(String userName){\r\n this.userName = userName;\r\n }", "public static String getUserName (String name) {\r\n\r\n char intial = name.charAt (0);\r\n String intialString = \"\";\r\n intialString = intialString.valueOf (intial);\r\n name = intialString.toUpperCase () + name;\r\n\r\n return name;\r\n }", "public static void setString(String usrname) {\n\t\tUserPanel.usrname = usrname;\r\n\t}", "void setUsername(String username);", "public void setUserName(String username){\n this.userName = username;\n }", "@AutoEscape\n\tpublic String getUser_name();", "@Override\n\tpublic void setUserName(String userName) {\n\n\t}", "public String changeUsernameTitle() {\n return \"Changing username\";\n }", "public com.politrons.avro.AvroPerson.Builder setUsername(java.lang.CharSequence value) {\n validate(fields()[1], value);\n this.username = value;\n fieldSetFlags()[1] = true;\n return this; \n }", "public static void setFirstName(String name){\n setUserProperty(Constants.ZeTarget_keyForUserPropertyFName, name);\n }", "public String getName() {\r\n\t\treturn username;\r\n\t}", "public void setUserName(String userName){\n this.userName = userName;\n }", "public String getUserName() {\n\t\t\treturn name;\n\t\t}", "public void setNickUsuario(String nickUsuario) {\r\n this.nickUsuario = nickUsuario;\r\n }", "public void SetUserName(User u) {\n\t\tthis.lblUserName.setBounds(525, 28, 46, 14);\n\t\tthis.lblUserName.setText(u.getNickname());\n\t\tthis.contentPane.add(this.lblUserName);\n\t}", "@Override\n\tpublic String getUserName() {\n\t\treturn super.getUserName();\n\t}", "@Override\n\tpublic String getUserName() {\n\t\treturn super.getUserName();\n\t}", "public String getUserName() {\n return userName;\n }", "public void setUser_name(String user_name) {\n this.user_name = user_name;\n }", "public String getUserName();", "public String getUserName() {\n\t \t return userName; \n\t}", "public String getUserName() {\r\n return userName;\r\n }", "public String getUserName() {\r\n return userName;\r\n }", "public String getUserName() {\r\n return userName;\r\n }", "public String getUserName() {\r\n return userName;\r\n }", "public void setUserName(String userName) {\n infoElements.put(new Integer(InfoElement.USERNAME), userName.getBytes());\n }", "public final void setUsername(final String usernameNew) {\n this.username = usernameNew;\n }", "public String getNombreUsuario() {\r\n return nombreUsuario;\r\n }", "@Override\r\n\tpublic String getUserName() {\n\t\treturn null;\r\n\t}", "public String setUserName2(UserManager uManager){\n boolean exists = true;\n String userName = \"\";\n while(exists) {\n userName = setUserName();\n exists = setUserNameAndValidate.apply(userName, uManager);\n userNameErrorMessage(exists, userName);\n }\n return userName;\n }", "public void setUsername(String un)\n {\n this.username = un;\n }", "public String getNickUsuario() {\r\n return nickUsuario;\r\n }", "@Ignore(\"Test is not done yet\")\n @Test\n public void testChangingUsernameToExisting() {\n final UserRequest request = new UserRequest();\n // We're currently logged in as Austria, so we're trying to change the\n // username to Germany.\n request.setNewUsername(\"[email protected]\");\n final Response response = administration.controlUserAccount(token, request);\n assertThat(response.getError(), is(IWSErrors.FATAL));\n }", "public void fillUsername(String value) {\n setFieldValue(\"username\", value);\n }", "public Usuario(String nickUsuario, String nombreUsuario, String correoUsuario) {\r\n this.nickUsuario = nickUsuario;\r\n this.nombreUsuario = nombreUsuario;\r\n this.correoUsuario = correoUsuario;\r\n }", "public String getName() {\n\t\treturn this.username;\n\t}", "public void setUserName(String userName) {\r\n this.userName = userName;\r\n }", "public void setUserName(String userName) {\n this.userName = userName;\n }", "public Builder setUsername(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n username_ = value;\n onChanged();\n return this;\n }", "String getUserName() {\r\n\t\t\treturn username;\r\n\t\t}", "@Override\n\tpublic String getUserName() {\n\t\treturn model.getUserName();\n\t}", "@Override\n\tpublic String getUserName() {\n\t\treturn model.getUserName();\n\t}" ]
[ "0.7128196", "0.7070681", "0.7030617", "0.69576365", "0.69329137", "0.6917079", "0.68931985", "0.6892032", "0.6890565", "0.6884185", "0.6882588", "0.67909545", "0.6760172", "0.6740804", "0.67231643", "0.6715506", "0.6715177", "0.6715177", "0.6715177", "0.6675434", "0.6666397", "0.6665438", "0.6661993", "0.66579396", "0.6657807", "0.6622221", "0.66035986", "0.66035986", "0.65982884", "0.6596292", "0.65791214", "0.6566524", "0.656279", "0.65516555", "0.65487397", "0.65487397", "0.6540388", "0.6535419", "0.653361", "0.6517975", "0.6505538", "0.64869106", "0.64869106", "0.6475444", "0.64622986", "0.64622986", "0.64622986", "0.64622986", "0.64622986", "0.64622986", "0.64622986", "0.64622986", "0.64622986", "0.64571697", "0.64571697", "0.64367557", "0.6432565", "0.6426471", "0.64263386", "0.6426338", "0.6424876", "0.6423538", "0.6416516", "0.63855696", "0.63844305", "0.6367358", "0.6366514", "0.6361338", "0.6358366", "0.6353011", "0.6343047", "0.633676", "0.6334728", "0.6326968", "0.6326968", "0.6313767", "0.63109994", "0.6305871", "0.6302869", "0.6302716", "0.6302716", "0.6302716", "0.6302716", "0.6291273", "0.62890786", "0.6287356", "0.62836355", "0.6278745", "0.62782747", "0.62770814", "0.6268857", "0.6263924", "0.6262324", "0.62603295", "0.6256393", "0.62517273", "0.62455326", "0.6238513", "0.6237702", "0.6237702" ]
0.6291564
83
Obtiene el nombre completo del usuario
public String getNombreCompleto();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getUserName();", "java.lang.String getUserName();", "java.lang.String getUserName();", "String getUserName();", "String getUserName();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "public String getUserName(int userId);", "@Override\n public java.lang.String getUserName() {\n return _partido.getUserName();\n }", "public String getName(){\n return username;\n\t}", "public String getNickName(){\n return nombreUsuario;\n }", "public static String getUserName(long requestorId)\n\t {\n\t String fullName = StringPool.BLANK;\n\t try\n\t {\n\t User user = UserLocalServiceUtil.getUserById(requestorId);\n\t fullName = user.getFirstName() + StringPool.SPACE + user.getLastName();\n\t } catch (PortalException e)\n\t {\n\t LOGGER.error(\"Failed to find user details...\" + e.getMessage());\n\t } catch (SystemException e)\n\t {\n\t LOGGER.error(\"User not exist....\" + e.getMessage());\n\t }\n\t return fullName;\n\t }", "String getUserName(String userId);", "public String getUserName();", "String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "String getUserUsername();", "public String usuarioconectado() {\n\t\tString nome;\n\t\tObject principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n\n\t\tif (principal instanceof UserDetails) {\n\t\t\tnome = ((UserDetails) principal).getUsername();\n\t\t} else {\n\t\t\tnome = principal.toString();\n\t\t}\n\t\t// System.out.println(nome);\n\t\treturn nome;\n\t}", "public String getName() {\r\n\t\treturn username;\r\n\t}", "public String getName() {\n return user.getName();\n }", "public String getName() {\n return (String) getObject(\"username\");\n }", "public String getName() {\n\t\treturn this.username;\n\t}", "@Override\r\n\t\t\tpublic String getUsername() {\n\t\t\t\treturn \"User1\";\r\n\t\t\t}", "public String returnUserName() {\n\t\treturn this.registration_username.getAttribute(\"value\");\r\n\t}", "@AutoEscape\n\tpublic String getUser_name();", "public String getUsernameFieldName() {\n return getStringProperty(USERNAME_FIELD_NAME_KEY);\n }", "public static String getUserDisplayName() {\r\n return getUsername();\r\n }", "@AutoEscape\n\t@Override\n\tpublic String getUserName();", "@AutoEscape\n\t@Override\n\tpublic String getUserName();", "public java.lang.String getUsuario();", "@Override\n public String getUserName() {\n return name;\n }", "public String getUserName() {\n\t\treturn phoneText.getText().toString();\n\t}", "public String getNickUsuario() {\r\n return nickUsuario;\r\n }", "public String getCurrentUserUsername(){\n Subject subject = org.apache.shiro.SecurityUtils.getSubject();\n if(subject!=null){\n return subject.getPrincipal().toString();\n }else{\n return \"User\";\n }\n }", "public String getNick() {\n return this.session.sessionPersona().getUserName();\n }", "public String getUserName() {\n return txtUserName().getText();\n }", "public String getName() {\r\n\t\treturn this.userName;\r\n\t}", "public String getUsername() throws SQLException {\n\t\tloadFromDB();\n\t\treturn rev_user_text;\n\t}", "public String getNombreUsuario() {\r\n return nombreUsuario;\r\n }", "public String getUserName() {\n\t\t\treturn name;\n\t\t}", "@Override\n\tpublic String getUserName() {\n\t\treturn model.getUserName();\n\t}", "@Override\n\tpublic String getUserName() {\n\t\treturn model.getUserName();\n\t}", "public String getNombre_usuario() {\n return nombre_usuario;\n }", "public static String getUserName() {\n\t\treturn readTestData.getkeyData(\"SignUpDetails\", \"Key\", \"Value\", \"userName\");\n\t}", "String getUserCnName(String userName);", "public static String getUserName (String name) {\r\n\r\n char intial = name.charAt (0);\r\n String intialString = \"\";\r\n intialString = intialString.valueOf (intial);\r\n name = intialString.toUpperCase () + name;\r\n\r\n return name;\r\n }", "public String getUsername() {\n return username.get();\n }", "@Override\n\tpublic String getUsername() {\n\t\treturn user.getUserName();\n\t}", "public static String getCurrentUserFullName() {\n DirectoryManager directoryManager = (DirectoryManager) appContext.getBean(\"directoryManager\");\n String username = getCurrentUsername();\n User user = directoryManager.getUserByUsername(username);\n if (user != null && user.getFirstName() != null && user.getFirstName().trim().length() > 0) {\n return user.getFirstName() + \" \" + user.getLastName();\n } else {\n return username;\n }\n }", "public String getUserRealName() {\r\n return userRealName;\r\n }", "@Override\r\n\tpublic String getFullname(String userId) {\n\t\tif (conn == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tString name = null;\r\n\t\ttry {\r\n\t\t\tString sql = \"SELECT username FROM users WHERE user_id = ? \";\r\n\t\t\tPreparedStatement statement = conn.prepareStatement(sql);\r\n\t\t\tstatement.setString(1, userId);\r\n\t\t\tResultSet rs = statement.executeQuery();\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\tname = rs.getString(\"username\");\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn name;\r\n\t}", "private String getUserName() {\n EditText nameEditText = (EditText) findViewById(R.id.name_edit_text);\n return nameEditText.getText().toString().trim();\n }", "public String getLastUsername() {\n\t\treturn lastUsername;\n\t}", "public static String getUserName() {\r\n\t\tHttpSession session = (HttpSession) FacesContext.getCurrentInstance()\r\n\t\t\t\t.getExternalContext().getSession(false);\r\n\t\treturn session.getAttribute(\"username\").toString();\r\n\t}", "public static String getUserName() {\r\n\t\tHttpSession session = (HttpSession) FacesContext.getCurrentInstance()\r\n\t\t\t\t.getExternalContext().getSession(false);\r\n\t\treturn session.getAttribute(\"username\").toString();\r\n\t}", "String getUltimoNome();", "public String getName() {\n\t\t\n\t\tString name = \"\";\n\t\t\n\t\tif (securityContext != null) {\n\t\t\tname = securityContext.getIdToken().getPreferredUsername();\n\t\t}\n\t\t\n\t\treturn name;\n\t}", "String usernameLabel();", "public String getUserNickname()\n {\n if (nickName == null)\n nickName =\n provider.getInfoRetreiver().getNickName(\n provider.getAccountID().getUserID());\n\n return nickName;\n }", "String getUserName() {\r\n\t\t\treturn username;\r\n\t\t}", "public String userNameIndex(int index){\n index = index-1;\n String userName1 = \"\";\n userName1 = user[index].getUserName();\n return userName1;\n }", "private Component getUserName() {\n\t\tif (userName == null) {\r\n\t\t\tuserName = new JTextField();\r\n\t\t\tuserName.setText(\"user1\");\r\n\t\t}\r\n\t\treturn userName;\r\n\t}", "public String getName(int id) {\n\t\tOptional<Contacto> contact = currentUser.getContacts().stream().filter(c -> c.getUserId() == id).findFirst();\n\t\tif (contact.isPresent())\n\t\t\treturn contact.get().getName();\n\t\treturn userCatalog.getUser(id).getName();\n\t}", "public String getName() {\n\t\tSharedPreferences settings = parentContext.getSharedPreferences(PREFERENCE_FILE,\n\t\t\t\tContext.MODE_PRIVATE);\n\t\treturn settings.getString(USERNAME_KEY, null);\n\t}", "public String getUser_name() {\n return user_name;\n }", "@Override\n public String getUserName() throws ResourceException {\n return session.getUserID();\n }", "public String getUserName() {\r\n return userName;\r\n }", "public String getUserName() {\r\n return userName;\r\n }", "public String getUserName() {\r\n return userName;\r\n }", "public String getUserName() {\r\n return userName;\r\n }", "@Override\n\tpublic String getUserName() {\n\t\t\n\t\ttry {\n\t\t\treturn UserLocalServiceUtil.getUser(_dataset.getUserId()).getScreenName();\n\t\t} catch (PortalException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (SystemException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\treturn \"ERROR\";\n\t\t}\n\t}", "public String getNombreUsuarioValidado(){\n Usuario usuario = (Usuario)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(\"usuarioValidado\");\r\n return usuario.getNombreUsuario();\r\n }", "public String getUserNameExample()\n {\n return null;\n }", "public String getUserName(){\n return mSharedPreferences.getString(SharedPrefContract.PREF_USER_NAME, null);\n }", "public String getUserName()\n {\n return userName;\n }", "@Override\r\n\tpublic String getUserName() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String getCurrentUserName() {\r\n\t\tString currentUserName = SecurityContextHolder.getContext().getAuthentication().getName();\r\n\t\treturn currentUserName;\r\n\t}", "public String getUserName() {\n return userName;\n }", "public String getUserName() {\n\t \t return userName; \n\t}", "public String getUserName() {\n return sessionData.getUserName();\n }", "public UTF8String getUserName() {\n return this.userName;\n }", "public String getUserName() {\n return userName;\n }", "public String getUserName() {\n return userName;\n }", "public String getUserName() {\n return userName;\n }", "public String getUserName() {\n return userName;\n }", "public String getUserName() {\n return userName;\n }", "public String getUserName() {\n return userName;\n }", "public String getUserName() {\n return userName;\n }", "public String getUserName() {\n return userName;\n }", "public String getUserName() {\n return userName;\n }" ]
[ "0.7397393", "0.7397393", "0.7397393", "0.72094345", "0.72094345", "0.717563", "0.717563", "0.717563", "0.717563", "0.717563", "0.717563", "0.717563", "0.717563", "0.717563", "0.70519245", "0.70379806", "0.7016989", "0.6984701", "0.69762564", "0.69039255", "0.6901427", "0.68634546", "0.68634546", "0.68634546", "0.68634546", "0.68634546", "0.68634546", "0.68304646", "0.68238634", "0.6817371", "0.680677", "0.6790216", "0.6754191", "0.6727405", "0.672293", "0.6713596", "0.6659718", "0.6643695", "0.6631442", "0.6631442", "0.6617082", "0.66162646", "0.6614656", "0.66092366", "0.66001797", "0.65993124", "0.6596927", "0.6576277", "0.65693074", "0.6569012", "0.65670836", "0.6546502", "0.6546502", "0.6528902", "0.65283966", "0.65126127", "0.64870495", "0.64812887", "0.6480694", "0.6478517", "0.64779216", "0.64719087", "0.6462949", "0.6460917", "0.64601946", "0.64601946", "0.6458049", "0.6457259", "0.64572364", "0.6455321", "0.64502233", "0.6445985", "0.6441204", "0.6440878", "0.6434955", "0.64344406", "0.6425423", "0.642443", "0.642443", "0.642443", "0.642443", "0.64235175", "0.64146096", "0.6410046", "0.6409053", "0.64089054", "0.64056563", "0.63962305", "0.63927937", "0.63919485", "0.63885224", "0.6386554", "0.63797444", "0.637248", "0.637248", "0.637248", "0.637248", "0.637248", "0.637248", "0.637248", "0.637248" ]
0.0
-1
setea el id de la categoria
public void setCategoriaId(Long id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setId(Category category) {\n\t\r\n}", "public void setIdTipoCategoria( Integer idTipoCategoria ) {\n this.idTipoCategoria = idTipoCategoria ;\n }", "public Long getCategoriaId();", "Category selectCategory(long id);", "public void setNomCategoria (String IdCategoria){\n categoriaId = getCategoriaId( IdCategoria );\n if ( categoriaId.moveToFirst() ){//Muestra los valores encontrados en la consulta\n labelCategoria.setText( categoriaId.getString(1) );\n }\n }", "@Override\n\tpublic long getCategoriaId() {\n\t\treturn _lineaGastoCategoria.getCategoriaId();\n\t}", "public void setCatId(int value) {\n this.catId = value;\n }", "public Categorias() {\n this.id = 0;\n this.categoria = \"\";\n }", "@Override\n\tpublic void setCategoriaId(long categoriaId) {\n\t\t_lineaGastoCategoria.setCategoriaId(categoriaId);\n\t}", "public Categorie getCategorieById(long id);", "void setId(int val);", "public void setCatId(long value) {\n this.catId = value;\n }", "@ApiModelProperty(required = true, value = \"Auto-incremented ID of an category.\")\n\n public Long getId() {\n return id;\n }", "public int getCategory_id() {\n return category_id;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "public String getCategoryid() {\r\n return categoryid;\r\n }", "public void setId(int idNuevo)\n { \n this.id = idNuevo;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "Category(int colorId) {\n this.colorId = colorId;\n }", "public void setCategoryId(long categoryId);", "Categorie findOne(Long id);", "public int getCatId() {\n return catId;\n }", "public void setIdCurso(Integer idCurso) {\r\n this.idCurso = idCurso;\r\n }", "private void setId(Integer id) { this.id = id; }", "public void setId(int id){ this.id = id; }", "public abstract void setId(int id);", "public abstract void setTica_id(java.lang.String newTica_id);", "public void setId(int i) { id = i; }", "public void setR_Category_ID (int R_Category_ID);", "public void setId(int value) {\r\n this.id = value;\r\n }", "@Override\n public void setAsText(String id) {\n CategoryEntity categoryEntity = categoryService.getCategoryById(Integer.parseInt(id));\n this.setValue(categoryEntity);\n }", "public void setIdLocacion(Integer idLocacion);", "public void setId (String id);", "public void setId(int id){\r\n this.id = id;\r\n }", "void setId(String id);", "void setId(String id);", "void setId(String id);", "public void selectCategory() {\n\t\t\r\n\t}", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "@Override\n\tpublic void setId(int id) {\n\n\t}", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "public void setIdSucursal(int idSucursal)\r\n/* 105: */ {\r\n/* 106:134 */ this.idSucursal = idSucursal;\r\n/* 107: */ }", "private void setId(int ida2) {\n\t\tthis.id=ida;\r\n\t}", "public void setId(java.lang.String value) {\n this.id = value;\n }", "public void setId(java.lang.String value) {\n this.id = value;\n }", "public void setId(java.lang.String value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "void setId(int id) {\n this.id = id;\n }", "public void setId(int value) {\n this.id = value;\n }", "void setId(int id);", "@java.lang.Override\n public int getCategoryId() {\n return categoryId_;\n }", "public Integer getCatId() {\n return catId;\n }", "protected void setId(short id) {\n this.id = id;\n }", "void setId(java.lang.String id);", "public void setId(String id) {\n }", "int getCategoryId();", "@Override\r\n\tpublic void setId(String id) {\n\t\t\r\n\t}", "public void setId(int id)\n {\n this.id=id;\n }", "public void setIdSucursal(int idSucursal)\r\n/* 109: */ {\r\n/* 110:179 */ this.idSucursal = idSucursal;\r\n/* 111: */ }", "@Override\n\tpublic void setId(Integer arg0) {\n\n\t}", "public void setId_anneeScolaire(int id_anneeScolaire) {this.id_anneeScolaire = id_anneeScolaire;}", "@Override\n\tpublic long getPrimaryKey() {\n\t\treturn _lineaGastoCategoria.getPrimaryKey();\n\t}", "public void setIdSucursal(int idSucursal)\r\n/* 98: */ {\r\n/* 99:176 */ this.idSucursal = idSucursal;\r\n/* 100: */ }", "public void setId( Integer id )\n {\n this.id = id ;\n }", "public void setId(String id);", "public void setId(String id);", "public void setId(String id) {\n this.id = id;\n }", "public void setID(int id);", "public void setID(int id){\n this.id=id;\n }", "public int getR_Category_ID();", "public void setId(short value) {\n this.id = value;\n }", "public Cursor getCategoriaId(String idCategoria){\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, nom_categoria, desp_categoria FROM t_categoria WHERE activo = 1 AND id =\" + idCategoria, null);\n // consultaId.close();\n // BasesDeDatos.close();\n return consultaId;\n }", "public static Categorias obtenerCategoria(int id){\n Categorias categoria = new Categorias();\n \n Categorias c = new Categorias();\n \n c.conectar();\n \n c.crearQuery(\"select * from categoria_libro where id = ?\");\n \n c.agregarParametro(1, id);\n \n ResultSet informacion = c.getResultSet();\n \n try {\n if (informacion.next())\n categoria = new Categorias(informacion);\n } catch (Exception error) {}\n \n c.desconectar();\n \n return categoria;\n }", "void setId(Integer id);", "@Override\n\t@Transactional\n\n\tpublic void initCategorie() {\n\t\tStream.of(\"Action\",\"Drame\",\"Guerre\",\"Fantastique\",\"Science-fiction\",\"Thriller\").forEach(cat->{\n\t\t\tCategorie categorie=new Categorie();\n\t\t\tcategorie.setName(cat);\n\t\t\tcategorieRepository.save(categorie);\n\t\t});\n\t}", "public void setIdProducto(int value) {\n this.idProducto = value;\n }", "public void setId( Integer id ) {\n this.id = id ;\n }", "public void setId( Integer id ) {\n this.id = id ;\n }", "public void setId( Integer id ) {\n this.id = id ;\n }", "public void setId( Integer id ) {\n this.id = id ;\n }", "public void setId( Integer id ) {\n this.id = id ;\n }", "public void setId( Integer id ) {\n this.id = id ;\n }", "public void setId( Integer id ) {\n this.id = id ;\n }", "public void setId(int id);", "public void setId(int id);" ]
[ "0.77756697", "0.747872", "0.7222699", "0.70525426", "0.700245", "0.69826794", "0.6937435", "0.6924072", "0.67559713", "0.66469616", "0.6573387", "0.6536244", "0.65125006", "0.6470933", "0.6469063", "0.64431286", "0.64206636", "0.638333", "0.63428223", "0.63416994", "0.6323075", "0.6315093", "0.6310163", "0.6300036", "0.6286249", "0.6273259", "0.6264638", "0.6262052", "0.62601525", "0.6250141", "0.62474704", "0.6231801", "0.6222342", "0.62205905", "0.61968774", "0.61968774", "0.61968774", "0.6196591", "0.61889", "0.61889", "0.6187007", "0.61838824", "0.61838824", "0.61838824", "0.61838824", "0.61838824", "0.61838824", "0.61838824", "0.6171002", "0.6166464", "0.6161425", "0.6161425", "0.6161425", "0.6156236", "0.6156236", "0.6156236", "0.6156236", "0.6156236", "0.6156236", "0.6156236", "0.6156236", "0.6156236", "0.61556154", "0.61550444", "0.61481524", "0.6135473", "0.61354595", "0.61343074", "0.6134108", "0.6119425", "0.6116687", "0.61143166", "0.6101818", "0.6101094", "0.6098693", "0.6096501", "0.60907394", "0.6077701", "0.6077444", "0.6073624", "0.6073624", "0.60663104", "0.60638493", "0.60636", "0.60635686", "0.60613513", "0.60529304", "0.60522985", "0.604988", "0.6048374", "0.604618", "0.6035585", "0.6035585", "0.6035585", "0.6035585", "0.6035585", "0.6035585", "0.6035585", "0.60329276", "0.60329276" ]
0.77424
1
Obtiene el valor de la categoria
public Long getCategoriaId();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getCategoryValue();", "String getCategoria();", "private Object getAnomizedCategory() {\r\n\tString categorie = (String) record.get(\"categorie\");\r\n\tif (categorie != null) {\r\n\t switch (categorie) {\r\n\t case \"AD\":\r\n\t case \"CO\":\r\n\t case \"FI\":\r\n\t case \"IBL\":\r\n\t case \"KI\":\r\n\t case \"KL\":\r\n\t case \"VO\":\r\n\t\tbreak;\r\n\t default:\r\n\t\tcategorie = null;\r\n\t\tbreak;\r\n\t }\r\n\t}\r\n\r\n\treturn categorie;\r\n }", "public int getCategoryValue() {\n return category_;\n }", "public int getCategoryValue() {\n return category_;\n }", "@java.lang.Override public int getCategoryValue() {\n return category_;\n }", "@java.lang.Override public int getCategoryValue() {\n return category_;\n }", "@Override\r\n\tpublic String getCategoria() {\n\t\treturn this.categoria;\r\n\t}", "String getCategory();", "String getCategory();", "public int getCategory(){\n\t\treturn this.cat;\n\t}", "public Integer getCategory() {\n return category;\n }", "public String getCategory();", "String category();", "public int getCategory() {\r\n\t\treturn category;\r\n\t}", "public String getCategory()\r\n {\r\n return (m_category);\r\n }", "public abstract String getCategory();", "public abstract String getCategory();", "public String getCategoriaDescripcion();", "private Category classify() {\n Category category = null;\n if (name != null) {\n if (name.contains(\"potato\") || name.contains(\"apple\")) {\n category = Category.FOOD;\n } else if (name.contains(\"cloths\") || name.contains(\"pants\") || name.contains(\"shirt\")) {\n category = Category.CLOTHING;\n }\n }\n return category;\n }", "public String getCategory(){\r\n\t\treturn this.category;\r\n\t}", "public String getCategory()\n {\n return category;\n }", "public Byte getCategoryType() {\n return categoryType;\n }", "public String category() {\n return this.category;\n }", "public String category() {\n return this.category;\n }", "public String getCategory() {\r\n return category;\r\n }", "public String getCategory() {\t//TODO - change to array list of categories\n\t\treturn category;\n\t}", "@Override\n public CategoricalTypeConstants getCategoricalTypeConstant() {\n return CategoricalTypeConstants.SPECIFIC;\n }", "public String getCategory() {\n return this.category;\n }", "@Override\n\tpublic java.lang.String getCategoryCode() {\n\t\treturn _lineaGastoCategoria.getCategoryCode();\n\t}", "public String getCategory() {\n return this.category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public String getIntAttributeCategory() {\n return (String) getAttributeInternal(INTATTRIBUTECATEGORY);\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "private Category getCategory()\n\t{\n\t\tSystem.out.println(\"------------------------------------------------------------\");\n\t\tSystem.out.println(\"Choose category:\");\n\t\tint i = 1;\n\t\tfor(Category category : Category.values())\n\t\t{\n\t\t\tSystem.out.println(i + \": \"+category.getCategoryDescription());\n\t\t\ti++;\n\t\t}\n\t\tSystem.out.println(\"------------------------------------------------------------\");\n\t\tString userChoiceStr = scanner.nextLine();\n\t\tint userChoice;\n\t\ttry\n\t\t{\n\t\t\tuserChoice = Integer.parseInt(userChoiceStr);\n\t\t}\n\t\tcatch(NumberFormatException e)\n\t\t{\n\t\t\tSystem.out.println(\"Invalid input\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tif(userChoice<1 || userChoice>25)\n\t\t{\n//\t\t\tSystem.out.println(\"Invalid category code\");\n\t\t\treturn null;\n\t\t}\n\t\tCategory category;\n\t\tswitch (userChoice) \n\t\t{\n\t\t\tcase 1: category = Category.ARTS; break;\n\t\t\tcase 2: category = Category.AUTOMOTIVE; break;\n\t\t\tcase 3: category = Category.BABY; break;\n\t\t\tcase 4: category = Category.BEAUTY; break;\n\t\t\tcase 5: category = Category.BOOKS; break;\n\t\t\tcase 6: category = Category.COMPUTERS; break;\n\t\t\tcase 7: category = Category.CLOTHING;break;\n\t\t\tcase 8: category = Category.ELECTRONICS; break;\n\t\t\tcase 9: category = Category.FASHION; break;\n\t\t\tcase 10: category = Category.FINANCE; break;\n\t\t\tcase 11: category = Category.FOOD; break;\n\t\t\tcase 12: category = Category.HEALTH; break;\n\t\t\tcase 13: category = Category.HOME; break;\n\t\t\tcase 14: category = Category.LIFESTYLE; break;\n\t\t\tcase 15: category = Category.MOVIES; break;\n\t\t\tcase 16: category = Category.MUSIC; break;\n\t\t\tcase 17: category = Category.OUTDOORS; break;\n\t\t\tcase 18: category = Category.PETS; break;\n\t\t\tcase 19: category = Category.RESTAURANTS; break;\n\t\t\tcase 20: category = Category.SHOES; break;\n\t\t\tcase 21: category = Category.SOFTWARE; break;\n\t\t\tcase 22: category = Category.SPORTS; break;\n\t\t\tcase 23: category = Category.TOOLS; break;\n\t\t\tcase 24: category = Category.TRAVEL; break;\n\t\t\tcase 25: category = Category.VIDEOGAMES; break;\n\t\t\tdefault: category = null;System.out.println(\"No such category\"); break;\n\t\t}\n\t\treturn category;\n\t}", "public long getCategory() {\r\n\t\treturn this.category;\r\n\t}", "@Override\n\tpublic long getCategoriaId() {\n\t\treturn _lineaGastoCategoria.getCategoriaId();\n\t}", "public String toString() {\n\t\treturn category;\n\t}", "@java.lang.Override public google.maps.fleetengine.v1.Vehicle.VehicleType.Category getCategory() {\n @SuppressWarnings(\"deprecation\")\n google.maps.fleetengine.v1.Vehicle.VehicleType.Category result = google.maps.fleetengine.v1.Vehicle.VehicleType.Category.valueOf(category_);\n return result == null ? google.maps.fleetengine.v1.Vehicle.VehicleType.Category.UNRECOGNIZED : result;\n }", "@java.lang.Override\n public google.maps.fleetengine.v1.Vehicle.VehicleType.Category getCategory() {\n @SuppressWarnings(\"deprecation\")\n google.maps.fleetengine.v1.Vehicle.VehicleType.Category result = google.maps.fleetengine.v1.Vehicle.VehicleType.Category.valueOf(category_);\n return result == null ? google.maps.fleetengine.v1.Vehicle.VehicleType.Category.UNRECOGNIZED : result;\n }", "public String getCategory()\n\t{\n\t\treturn category;\n\t}", "public String getCategory()\n {\n return (String) getProperty(PropertyIDMap.PID_CATEGORY);\n }", "public String getCategory1() {\n return category1;\n }", "public CategorySelDTO getCategory() {\r\n\t\ttype(ConfigurationItemType.CATEGORY);\r\n\t\treturn categoryValue;\r\n\t}", "private String siguienteCategoria(String nombreActual) {\n\t\tswitch (nombreActual) {\n\t\tcase \"NOVATO\":\n\t\t\treturn \"CALIFICADO\";\n\t\tcase \"CALIFICADO\":\n\t\t\treturn \"EXPERTO\";\n\t\tcase \"EXPERTO\":\n\t\t\treturn \"MASTER\";\n\t\tdefault:\n\t\t\treturn \"MASTER\";\n\t\t}\n\t}", "@Override\n public String getCategory() {\n return category;\n }", "public String getCategoryKey() {\n return getCategory().getWordVal();\n }", "CodeType getCategory();", "public String getCategoryString(){\r\n\t\tMarketplaceConfig.Category c = MarketplaceConfig.Category.get(this.category);\r\n\t\tif(c == null || c.name() == null || \"\".equals(c.name())) return \"NONE\";\r\n\t\treturn c.name();\r\n\t}", "int getCategoryId();", "public java.lang.String getCategory() {\n return category;\n }", "public String getPrmCategCode() {\n return (String)getAttributeInternal(PRMCATEGCODE);\n }", "public String getName(){\n return category;\n }", "public String getCodigoImovelSubCategoria() {\r\n return codigoImovelSubCategoria;\r\n }", "io.dstore.values.IntegerValue getForumCategoryId();", "public String getCategory() {\n return mCategory;\n }", "Category(int num) {\n this.num = num;\n }", "public String getCat() {\n\t\treturn this.cat;\n\t}", "public String getCategCode() {\n return (String) getAttributeInternal(CATEGCODE);\n }", "public Category getCategory();", "public Set<String> getCategory(){return category;}", "public String getCategory() {\n\t\treturn category;\n\t}", "public String getCategory() {\n\t\treturn category;\n\t}", "google.maps.fleetengine.v1.Vehicle.VehicleType.Category getCategory();", "@Override\n\t\t\t\tpublic String getKey() {\n\t\t\t\t\treturn \"category\";\n\t\t\t\t}", "public Categorie getCategorieById(long id);", "public String getCategory() {\n\t\treturn null;\r\n\t}", "public int getCatLevel() {\n return catLevel;\n }", "@Override\n\tpublic ArrayList<Categoria> getCategorie() {\n\t\tDB db = getDB();\n\t\tArrayList<Categoria> categorie = new ArrayList<Categoria>();\n\t\tMap<Long, Categoria> list = db.getTreeMap(\"categorie\");\n\t\tfor(Map.Entry<Long, Categoria> categoria : list.entrySet())\n\t\t\tif(categoria.getValue() instanceof Categoria)\n\t\t\t\tcategorie.add((Categoria)categoria.getValue());\n\t\treturn categorie;\n\t}", "@Override\n public String getCategoryLabel() {\n return categoryLabel;\n }", "public void setCategory (String mode) { category = mode; }", "public Integer getClassify() {\n return classify;\n }", "@Override\n\tpublic java.lang.String getName() {\n\t\treturn _lineaGastoCategoria.getName();\n\t}", "Category selectCategory(String name);", "public java.lang.Integer getAdditionalCategoryCat() {\r\n return additionalCategoryCat;\r\n }", "io.dstore.values.IntegerValue getPageCategoryId();", "public String getAttributeCategory()\n {\n return (String)getAttributeInternal(ATTRIBUTECATEGORY);\n }", "public String getCategory() {\n\t\treturn null;\n\t}", "public String getCategory() {\n\t\treturn null;\n\t}", "public abstract Object getDecisionValue();", "public void setCategoria(String categoria) {\n\t\tthis.categoria = categoria;\n\t}", "CloudCategory(String value) {\n this.value = value;\n }", "public proto.SocialMetricCategoryEnum getCategory() {\n proto.SocialMetricCategoryEnum result = proto.SocialMetricCategoryEnum.valueOf(category_);\n return result == null ? proto.SocialMetricCategoryEnum.UNRECOGNIZED : result;\n }", "public Category getCategory() {\r\n return category;\r\n }", "public static Category getCategoryStringFromInt(int num) {\n for (Category item : Category.values ()) {\n if (item.num == num) {\n return item;\n }\n }\n return null;\n }", "int getProblemCategory();", "public String getCategoryid() {\r\n return categoryid;\r\n }", "public String getCategory_name(){return category_name;}", "private boolean tieneCategorias(){\n String valor = \"\";\n try {\n ResultSet resultado = buscador.getResultSet(\"select conCategorias from JERARQUIA where correlativo = '\" + IDJerarquia + \"'\");\n if (resultado.next()) {\n valor += resultado.getObject(\"conCategorias\").toString(); //IDRaiz\n }\n } catch (SQLException e) {\n System.out.println(\"*SQL Exception: *\" + e.toString());\n }\n if(valor.equalsIgnoreCase(\"true\")) //Si utiliza categorias\n return true;\n return false;\n }", "public java.lang.Object get(int field$) {\n switch (field$) {\n case 0: return kGSuperPopCategory;\n case 1: return kGPopCategory;\n case 2: return chiSquare;\n default: throw new org.apache.avro.AvroRuntimeException(\"Bad index\");\n }\n }", "public long getCategoryId();", "public String getVehicleTypeCategory() {\r\n return vehicleType.getCategory();\r\n }" ]
[ "0.8007472", "0.75626993", "0.75069386", "0.7472721", "0.7364347", "0.7277173", "0.7215342", "0.71509737", "0.70136285", "0.70136285", "0.6978735", "0.6896483", "0.6819106", "0.6700132", "0.6606834", "0.6574013", "0.6535525", "0.6535525", "0.6501587", "0.64792293", "0.64746475", "0.641098", "0.6410653", "0.63799816", "0.63799816", "0.63694817", "0.63634825", "0.63447946", "0.63303393", "0.63198173", "0.6306011", "0.630263", "0.6286945", "0.6286945", "0.6286945", "0.6286945", "0.6286945", "0.6286945", "0.6286945", "0.6285916", "0.62568414", "0.62568414", "0.62520003", "0.6244318", "0.62424743", "0.6242348", "0.62367934", "0.623559", "0.6215048", "0.6184292", "0.61729014", "0.615896", "0.6153688", "0.6140652", "0.61386293", "0.61263627", "0.61185926", "0.61167395", "0.61062574", "0.6097753", "0.60911745", "0.60829335", "0.6082638", "0.6082389", "0.6074464", "0.6067944", "0.605411", "0.60263675", "0.60092586", "0.5972462", "0.5972462", "0.5965269", "0.59606904", "0.59567845", "0.59485567", "0.59368426", "0.5920416", "0.5912529", "0.5907564", "0.59056413", "0.59037316", "0.5889093", "0.5888266", "0.58861375", "0.5877225", "0.5876361", "0.5876361", "0.5863552", "0.5861311", "0.5860744", "0.58600396", "0.5846704", "0.5837759", "0.58358437", "0.58355385", "0.5826908", "0.5825317", "0.58183306", "0.5805805", "0.5803665" ]
0.6449761
21
setea el valor del password
public void setPassword(String pass);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setPassword(String password);", "void setPassword(String password);", "void setPassword(String password);", "public void setPassword(java.lang.String newPassword);", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "public void setPassword(String p)\n\t{\n\t\tpassword = p;\n\t}", "private void setPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n }", "private void setPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n }", "public void setPassword(String password)\r\n/* 26: */ {\r\n/* 27:42 */ this.password = password;\r\n/* 28: */ }", "void setPassword(String ps) {\n this.password = ps;\n }", "public void setPassword(String p) {\n\t\tpassword = p;\n\t}", "public void set_pass(String password)\n {\n pass=password;\n }", "public java.lang.String getPassword();", "public void setPassword(String pw)\n {\n this.password = pw;\n }", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "public String getPassword();", "public String getPassword();", "public void setPassword2(String password2);", "public void setPasswordValue(String value) {\r\n\t\ttxtPassword.setValue(value);\r\n\t}", "private void setNewPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n newPassword_ = value;\n }", "public void setPassword(String password)\n {\n _password = password;\n }", "public void setPassword(String pw) {\n password = pw.toCharArray();\n cleared = false;\n }", "public String getPassword(){\n \treturn password;\n }", "public String getPassword(){\n return password;\n\t}", "public String getPassword() {return password;}", "void setErrorPassword();", "public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n password_ = value;\n onChanged();\n return this;\n }", "public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n password_ = value;\n onChanged();\n return this;\n }", "@Override\n\tpublic void setPassword(String password) {\n\n\t}", "public int getPassword(){\n\t\treturn password;\n\t}", "void setPassword(Password newPassword, String plainPassword) throws NoUserSelectedException;", "public String getPassword(){\r\n\t\treturn password;\r\n\t}", "public void setPassword(String password)\n {\n String passwordRegex = \"^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,}$\";\n Pattern passwordPattern = Pattern.compile(passwordRegex);\n Matcher passwordMatcher = passwordPattern.matcher(password);\n if(passwordMatcher.matches())\n {\n this.password=password;\n }\n else\n {\n this.password=\"\";\n }\n }", "public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n onChanged();\n return this;\n }", "public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n onChanged();\n return this;\n }", "public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n onChanged();\n return this;\n }", "public void setPassword(int password) {\n this.password = password;\n }", "public int getPassword(){\n return password;\r\n }", "public void setPassword(String password){\r\n this.password = password;\r\n }", "public void setPassword(String text) {\n txtPassword().setText(text);\n }", "public void setPassword(java.lang.String param) {\r\n localPasswordTracker = param != null;\r\n\r\n this.localPassword = param;\r\n }", "public Builder setPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n password_ = value;\n onChanged();\n return this;\n }", "public int getPassword() {\n return password;\n }", "String getUserPassword();", "public String getPassword()\r\n {\r\n return password;\r\n }", "@Override public String getPassword()\r\n {\r\n return password;\r\n }", "String getNewPassword();", "public void setPassword(String password)\n {\n _password = password;\n }", "public String getPassword() {\n return password;\r\n }", "public void setPw(char[] password) {\n\t\t\r\n\t}", "public void setPassword(String paramPasswd) {\n\tstrPasswd = paramPasswd;\n }", "public String getPassword() {\r\n return password;\r\n }", "@Override\n public String getPassword() {\n return password;\n }", "public void setPassword(final String password){\n mPassword = password;\n }", "@Override\n\tpublic String getPassword() {\n\t\treturn senha;\n\t}", "public String getPassword()\r\n {\r\n return password;\r\n }", "public void setPassword(java.lang.String param) {\n localPasswordTracker = true;\n\n this.localPassword = param;\n }", "@Override\n public String getPassword() {\n return password;\n }", "public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n password_ = value;\n onChanged();\n return this;\n }", "@Override\n\tpublic void setPlainPassword(String arg0) {\n\t\t\n\t}", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public void setPassword(String password) {\n this.password = password;\r\n }", "public String getPasswordValue() {\r\n\t\treturn txtPassword.getValue();\r\n\t}", "public String getPassword()\r\n {\r\n return password;\r\n }", "Password getPsw();", "public String getPassword(){\n return this.password;\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword()\n {\n return password;\n }", "@Override\n\tpublic String getPass() {\n\t\treturn password;\n\t}", "public String getPassword(){\n\t\treturn this.password;\n\t}", "public String getPassword()\n \t{\n \t\treturn password;\n \t}", "@Override\n\tpublic String getPassword() {\n\t\treturn \"ajay\";\n\t}", "public String getaPassword() {\n return aPassword;\n }", "public String getPassword() {\n\treturn password;\n}", "public void setPassword(String password) {\n setObject(\"password\", (password != null) ? password : \"\");\n }", "public void setPassword(String password) {\r\n this.password = password;\r\n }" ]
[ "0.8306343", "0.8306343", "0.8306343", "0.8108337", "0.8092896", "0.8092896", "0.8092896", "0.8092896", "0.8092896", "0.8092896", "0.8092896", "0.8044999", "0.7989989", "0.7989989", "0.796355", "0.79451936", "0.7927119", "0.7892885", "0.78880346", "0.78597766", "0.78444046", "0.78444046", "0.78444046", "0.78444046", "0.78444046", "0.78444046", "0.78444046", "0.78444046", "0.78444046", "0.77414757", "0.77414757", "0.77373374", "0.7736069", "0.77352566", "0.7713675", "0.7680326", "0.7651559", "0.7646822", "0.7644387", "0.762775", "0.76084685", "0.76084685", "0.75979537", "0.75868434", "0.75789165", "0.7578233", "0.75780207", "0.75662047", "0.75662047", "0.75662047", "0.75641245", "0.75593126", "0.7540327", "0.7539188", "0.751231", "0.74933404", "0.7491078", "0.7490335", "0.747953", "0.7477418", "0.74744177", "0.7471093", "0.7452366", "0.7439317", "0.7433259", "0.7431521", "0.74310315", "0.7430189", "0.7420716", "0.7418897", "0.74157256", "0.74139076", "0.74097043", "0.740676", "0.7399014", "0.7399014", "0.7399014", "0.7399014", "0.7399014", "0.7399014", "0.7399014", "0.7399014", "0.7399014", "0.7399014", "0.7399014", "0.73938006", "0.7390608", "0.7383834", "0.73820883", "0.7377182", "0.7377003", "0.7377003", "0.73684436", "0.73664665", "0.7363118", "0.73619527", "0.7360643", "0.7357102", "0.73548543", "0.7354485" ]
0.8318259
0
Obtiene el valor del password
public String getPassword();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "public java.lang.String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "public String getPasswordValue() {\r\n\t\treturn txtPassword.getValue();\r\n\t}", "String getUserPassword();", "public int getPassword(){\n return password;\r\n }", "public int getPassword() {\n return password;\n }", "public int getPassword(){\n\t\treturn password;\n\t}", "public String getPassword(){\n \treturn password;\n }", "public String getPassword() {\r\n \t\treturn properties.getProperty(KEY_PASSWORD);\r\n \t}", "public String getPassword(){\n return password;\n\t}", "public String getPassword() {return password;}", "public String getPassword(){\r\n\t\treturn password;\r\n\t}", "public String getPassword()\r\n {\r\n return password;\r\n }", "public String getPassword() {\n return txtPassword().getText();\n }", "public String getPassword() {\n return password;\r\n }", "String password();", "public String getPassword()\n \t{\n \t\treturn password;\n \t}", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword()\r\n {\r\n return password;\r\n }", "public String getPassword() {\n return (String) getObject(\"password\");\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword()\r\n {\r\n return password;\r\n }", "public String getPassword() {\n \t\treturn password;\n \t}", "public String getaPassword() {\n return aPassword;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword(){\n\t\treturn this.password;\n\t}", "public final String getPassword() {\n return properties.get(PASSWORD_PROPERTY);\n }", "public String get_password()\r\n\t{\r\n\t\treturn this.password;\r\n\t}", "public String getPassword(){\n return this.password;\n }", "public String getPassword() {\n\t\treturn String.valueOf(password.getPassword());\n\t}", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }" ]
[ "0.87286025", "0.87286025", "0.87286025", "0.87286025", "0.87286025", "0.87286025", "0.87286025", "0.85307103", "0.850902", "0.850902", "0.850902", "0.850902", "0.850902", "0.850902", "0.850902", "0.850902", "0.850902", "0.8243606", "0.8161515", "0.8159791", "0.81556016", "0.8142582", "0.81219524", "0.8092091", "0.80823755", "0.8050825", "0.80346954", "0.80238456", "0.8019139", "0.7996013", "0.79632014", "0.79590315", "0.79558885", "0.7949837", "0.7941355", "0.7931764", "0.7931764", "0.7921569", "0.7921569", "0.7921569", "0.7921569", "0.7921569", "0.7921569", "0.7921569", "0.7921569", "0.7921569", "0.7921569", "0.7921569", "0.791866", "0.791866", "0.7918282", "0.78995", "0.7897601", "0.78942245", "0.78942245", "0.7892926", "0.7882185", "0.78561306", "0.78540117", "0.7853265", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699", "0.7845699" ]
0.8309666
18
Borrar los permisos de acceso del usuario
public void clearAccess();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void revokePermission(String objectId, User user, List<String> actions) throws UserManagementException;", "public void borrarPiezasAmenazadoras(){\n this.piezasAmenazadoras.clear();\n }", "public synchronized static void borrarProduccion(String usuario){\n if(!produccion.isEmpty())\n for(Construcciones construccion : produccion){\n if(construccion.usuario.equalsIgnoreCase(usuario))\n produccion.remove(construccion);\n }\n}", "private void permisos(HttpPresentationComms comms) throws HttpPresentationException, KeywordValueException {\n/* 289 */ int miGrupo = Integer.parseInt((String)comms.session.getSessionData().get(\"miGrupo\"));\n/* */ \n/* 291 */ Varios oVarios = new Varios();\n/* 292 */ boolean oPermisoAct = oVarios.tienePermiso(miGrupo, \"admPrcRecursoAct\");\n/* 293 */ boolean oPermisoDel = oVarios.tienePermiso(miGrupo, \"admPrcRecursoDel\");\n/* 294 */ if (!oPermisoAct) {\n/* 295 */ HTMLElement elem = this.pagHTML.getElementBtnCrear();\n/* 296 */ elem.getParentNode().removeChild(elem);\n/* 297 */ elem = this.pagHTML.getElementBtnGrabar();\n/* 298 */ elem.getParentNode().removeChild(elem);\n/* 299 */ elem = this.pagHTML.getElementBtnModificar();\n/* 300 */ elem.getParentNode().removeChild(elem);\n/* */ } \n/* 302 */ if (!oPermisoDel) {\n/* 303 */ HTMLElement elem = this.pagHTML.getElementBtnEliminar();\n/* 304 */ elem.getParentNode().removeChild(elem);\n/* */ } \n/* */ }", "public void eliminar() throws SQLException {\r\n\t\tConexion conexion = new Conexion();\r\n\t\tConnection cn = conexion.conectar();\r\n\t\tStatement stm = cn.createStatement();\r\n\t\t//Delete en users del usuariop con el que iniciaste sesion para borrar el usuario\r\n\t\tString query=\"delete from users where USR=\"+InicioUsuario.correo;\r\n\t\tstm.executeUpdate(query);\r\n\t\t\r\n\t}", "public void resetearReintentos(long idUsuario) throws AbadiaException {\r\n String sSQL = \"update usuario set REINTENTOS = 0 where usuarioid = \" + idUsuario;\r\n adUtils utils = new adUtils(con);\r\n utils.execSQL(sSQL);\r\n }", "@Override\n public void deleteAllPrivies() {\n }", "public void revokePermissionsFor(String userName, String fileName) throws InterruptedException {\n Log.i(\"revokePermissionsFor\",\n \"About to revoke permissions for \" + userName + \" on file \" + fileName);\n String userPublicKey = getUserKeyFromUserName(userName);\n Log.i(\"revokePermissionsFor\", \"About to revoke permissions for \" + userPublicKey);\n database.delete(\"FileKeys\", \"UserPublicKey = ? AND File = ?\", new String[]{\n userPublicKey, fileName\n });\n AsyncTask.execute(new Runnable() {\n @Override\n public void run() {\n updateDatabaseFile();\n Log.i(\"AsyncTask\", \"database file updated\");\n finished = true;\n }\n });\n customWait();\n }", "@Override\n public void clearPermissions() {\n permissions.clear();\n }", "public void setPermisos(int permisos) {\n\t\tthis.permisos = permisos;\r\n\t}", "public Integer DeletarTodos(){\n\n //REMOVENDO OS REGISTROS CADASTRADOS\n return databaseUtil.GetConexaoDataBase().delete(\"tb_log\",\"log_ID = log_ID\",null);\n\n }", "public boolean deleteAllOfUser(Integer idu);", "public void removerCreditoRealizado(Conta conta)\n\t\t\tthrows ErroRepositorioException;", "public void resetUsuariosAsociados()\r\n {\r\n this.usuariosAsociados = null;\r\n }", "public static void deleteUser() {\n REGISTRATIONS.clear();\n ALL_EVENTS.clear();\n MainActivity.getPreferences().edit()\n .putString(FACEBOOK_ID.get(), null)\n .putString(USERNAME.get(), null)\n .putString(LAST_NAME.get(), null)\n .putString(FIRST_NAME.get(), null)\n .putString(GENDER.get(), null)\n .putString(BIRTHDAY.get(), null)\n .putString(EMAIL.get(), null)\n .putStringSet(LOCATIONS_INTEREST.get(), null)\n .apply();\n }", "public int deleteAllPermissions() throws DAOException;", "public void deletar() {\n if(Sessao.isConfirm()){\n Usuario use = new Usuario();\n use.setId(Sessao.getId());\n Delete_Banco del = new Delete_Banco();\n del.Excluir_Usuario(use);\n this.setVisible(false);\n Sessao.setId(0);\n tela_Principal prin = Sessao.getPrin();\n prin.atualizar_Tela();\n }\n }", "public void declinePermission(String objectId, User user) throws UserManagementException;", "void deleteAllAccesses(Role role) {\n for (AccessTypeInjector accessType : getAccessTypeOrderByPriority(true)) {\n List<? extends InheritedAccessEnabled> roleAccessList = accessType.getAccessList(role);\n List<InheritedAccessEnabled> iaeToDelete = new ArrayList<InheritedAccessEnabled>();\n for (InheritedAccessEnabled iae : roleAccessList) {\n // Not inherited accesses should not be deleted\n if (iae.getInheritedFrom() != null) {\n iaeToDelete.add(iae);\n }\n }\n for (InheritedAccessEnabled iae : iaeToDelete) {\n accessType.clearInheritFromFieldInChilds(iae, true);\n iae.setInheritedFrom(null);\n roleAccessList.remove(iae);\n OBDal.getInstance().remove(iae);\n }\n }\n OBDal.getInstance().commitAndClose();\n }", "@Override\r\n\tpublic int deleteUser(Integer[] ids, String userName) {\n\t\treturn 0;\r\n\t}", "public void borrarTodo()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\tStatement st = conexion.createStatement();\r\n\t\tst.execute(\"DROP TABLE usuarios\");\r\n\t\tst.execute(\"DROP TABLE prestamos\");\r\n\t\tst.execute(\"DROP TABLE libros\");\r\n\t\t}\r\n\t\tcatch (SQLException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void borrarSesionesAnteriores()\r\n\t{\r\n\t\tint numerosesiones = 0;//numero de convocatorias en la BD\r\n\t\tList sesiones = null;\r\n\t\ttry\r\n {\r\n Conector conector = new Conector();\r\n conector.iniciarConexionBaseDatos();\r\n sesiones= SesionBD.listar(conector);\r\n conector.terminarConexionBaseDatos();\r\n }\r\n catch (Exception e)\r\n\t\t{\r\n \tJOptionPane.showMessageDialog(this,\"Error al conectar con la Base de Datos.\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n\t\t}\r\n if(sesiones != null)\r\n {\r\n \tnumerosesiones = sesiones.size();\r\n }\r\n for (int i = 0; i < numerosesiones; i++)\r\n\t\t{\r\n \tSesion sesionaux = (Sesion)sesiones.get(i);\r\n\t\t\tint idsesion = sesionaux.getIdsesion();\r\n\t\t\tString fechasesion = sesionaux.getFechasesion();\r\n\t\t\tboolean esanterior = fechaSesionAnterior(fechasesion);\r\n\t\t\tif(esanterior == true)\r\n\t\t\t{\r\n\t\t\t\ttry \r\n\t \t\t{\r\n\t \t\t\tConector conector = new Conector();\r\n\t \t\t\tconector.iniciarConexionBaseDatos();\r\n\t \t\t\tSesionBD.eliminar(idsesion, conector);\r\n\t \t\t\tconector.terminarConexionBaseDatos();\r\n\t \t\t}\r\n\t \t\tcatch (Exception e)\r\n\t \t\t{\r\n\t \t\t\tJOptionPane.showMessageDialog(this,\"Error al conectar con la Base de Datos.\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n\t \t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void remove(User user) throws AccessControlException;", "public static void deleteUserData(final Context context) {\n log.info(\"Usuario Eliminado\");\n inicializaPreferencias(context);\n sharedPreferencesEdit.remove(Constantes.USER);\n sharedPreferencesEdit.commit();\n }", "public void borrarUsuario(String ident){\r\n listaPlantilla.get(obtenerPosicionUsuario(ident)).setControl(\"borrar\");\r\n }", "public void removeMotorista() {\n\t\tConector con = new Conector();\r\n\t\tString params[] = new String[2];\r\n\r\n\t\tparams[0] = \"op=8\";\r\n\t\tparams[1] = \"email=\" + usuario;\r\n\r\n\t\tcon.sendHTTP(params);\r\n\t}", "@Override\r\n\tpublic int deleteUser(Users user) {\n\t\treturn 0;\r\n\t}", "@DefaultMessage(\"This action will remove all the permissions for this user and make it inactive. The user itself will not be removed.\")\n @Key(\"systemUser.deleteUserMessage\")\n String systemUser_deleteUserMessage();", "private void enviarRequisicaoRemover() {\n servidor.removerPalito(nomeJogador);\n atualizarPalitos();\n }", "private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(EscolhaProjeto.this, LoginActivity.class);\n startActivity(intent);\n finish();\n }", "@Override\r\n\tpublic int delete(User user) {\n\t\treturn 0;\r\n\t}", "public void revoke();", "public void supprimerInaccessibles(){\n grammaireCleaner.nettoyNonAccGramm();\n setChanged();\n notifyObservers(\"3\");\n }", "public void delete(User usuario);", "public static void deleteAllUsers(Context context) {\r\n\t\tUri contentUri = Uri.withAppendedPath(EquestProvider.CONTENT_URI,\r\n\t\t\t\tEquestDbHelper.USER_TABLE);\r\n\t\tcontext.getContentResolver().delete(contentUri, null, null);\r\n\t}", "public void deleteUsuario(Usuario usuario) {\n\t\t\n\t}", "public void revoke() {\n WebsitePreferenceBridge.nativeRevokeUsbPermission(mOrigin, mEmbedder, mObject);\n }", "public void cerrar_seccion_correo(){\n Auth.signOut();\n My_aplicacion my_aplicacion=(My_aplicacion) activity.getApplication();\n my_aplicacion.setPlantas(null);\n ir_login();\n }", "public void deleteUsers() {\n SQLiteDatabase db = this.getWritableDatabase();\n // Eleminar la base de datos\n db.delete(TABLE_USER, null, null);\n db.close();\n\n Log.d(TAG, \"Se ha eliminado todo de SQLite\");\n }", "@Action( value=\"borrarUsuarioAction\", results= {\n @Result(name=SUCCESS, type=\"dispatcher\", location=\"/jsp/welcome.jsp\"), \n @Result(name=ERROR, type=\"dispatcher\", location=\"/jsp/borrarUsuario.jsp\") } ) \n public String borrarUsuario() \n {\n \t ActionContext contexto = ActionContext.getContext();\n \t ResultSet result1=null;\n PreparedStatement ps=null;\n PreparedStatement ps1=null;\n ResultSet result3=null;\n PreparedStatement ps3=null;\n \t\n try \n {\n \t\tgetConection();\n \n \t\tString consulta = (\"DELETE FROM USUARIO WHERE nick= '\"+ getNick()+\"'\");\n \t\tps = con.prepareStatement(consulta);\n \t\t\t \n \t\tps.executeUpdate();\n \t\t \n \t\tString consulta1 = (\"SELECT * FROM peliculas;\");\n \t\tps1 = con.prepareStatement(consulta1);\n \t\tresult1=ps1.executeQuery();\n \t\t \n \t\twhile(result1.next())\n \t\t{\n \t\t peli = new Peliculas(result1.getInt(\"id_peli\"),result1.getString(\"titulo\"),result1.getString(\"genero\"),result1.getString(\"director\"),result1.getString(\"actor1\"),result1.getString(\"actor2\"),result1.getString(\"anio\"),result1.getString(\"fotopeli\"),result1.getFloat(\"valoracion\"));\n \t\t listaPelis.add(peli);\n \t\t}\n \t\t if ((String) contexto.getSession().get(\"loginId\")!=null)\n \t {\n String consulta3 =(\"SELECT * FROM USUARIO WHERE nick= '\"+ (String) contexto.getSession().get(\"loginId\")+\"';\");\n ps3 = con.prepareStatement(consulta3);\n result3=ps3.executeQuery();\n \n while(result3.next())\n {\n \t rol=result3.getString(\"tipo\");\n }\n } \t \n \t\t} catch (Exception e) \n \t\t{\n \t\t System.err.println(\"Error\"+e); \n \t\t} finally\n \t\t\t{ try\n \t\t\t{\n \t\t if(con != null) con.close();\n \t\t if(ps != null) ps.close();\n \t\t if(ps1 != null) ps1.close();\n \t\t if(result1 !=null) result1.close();\n \t\t } catch (Exception e) \n \t\t {\n \t\t System.err.println(\"Error\"+e); \n \t\t }\n \t\t}\n \t\treturn SUCCESS;\n\t\t}", "public void Logout(){\n preferences.edit().remove(userRef).apply();\n }", "@Override\r\n\tpublic void deleteRolePermissions(int[] ids) {\n\t\tfor(int i=0;i<ids.length;i++){\r\n\t\t\trolePermissionMapper.deleteByPrimaryKey(ids[i]);\r\n\t\t}\r\n\t}", "@RequestMapping(\"admin/rmuser\")\n\tpublic String removerUser(HttpServletRequest request, @RequestParam(\"id\") int id){\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tuDAO.excluir(id);\n\t\t\t\tlogger.info(\"Usuario removido : \" + id);\n\t\t\t\trequest.getSession().setAttribute(\"erroRmUser\", \"false\");\n\n\t\t\t} catch (SQLException e) {\n\t\t\t\tlogger.error(\"Erro excluir usuario : \" + e.getMessage());\n\t\t\t\trequest.getSession().setAttribute(\"erroRmUser\", \"true\");\n\t\t\t}\n\t\t\n\t\treturn ADMIN_INDEX_REDIR;\n\t}", "@Override\n\tpublic int deleteUserReimbRecord(int reimbid) {\n\t\treturn 0;\n\t}", "public void cancelar() {\n controlGrabar = false;\n validaVacios = true;\n segUsuPerfil = null; \n existe = false;\n usuario = \"\";\n perfil = \"\";\n }", "private void deletarUsuario(HttpServletRequest request, HttpServletResponse response) throws SQLException, IOException {\n\t\tint id = Integer.parseInt(request.getParameter(\"id\"));\n\t\tdao.deletarUsuario(id);\n\t\tresponse.sendRedirect(\"lista\");\n\t}", "public void borrarTodo(){\n diccionario.clear();\n }", "private void borrarAeropuertoMenuActionPerformed(ActionEvent evt) {\n if (tblAeropuertos.getSelectedRow() != -1) {\n\n int eleccion = JOptionPane.showConfirmDialog(this, \"Quieres borrar el aeropuerto?\", \"Confirmacion\", JOptionPane.YES_NO_OPTION);\n\n if (eleccion == JOptionPane.YES_OPTION) {\n int fila = tblAeropuertos.getSelectedRow(); //GUARDA QUE FILA FUE SELECCIONADA\n\n int id = (int) tblAeropuertos.getValueAt(fila, 0); //EVALUA LA FILA Y LA COLUMNA, Y COMO LA FILA ME LA DA LA LINEA ANTERIOR, Y LA COLUMNA ES 0, YA QUE ESTAMOS EVALUANDO EL ID\n Aeropuerto aeropuerto = buscarAeropuerto(id);\n\n VariablesGlobales.aeropuertos.remove(aeropuerto);\n\n try {\n MetodosSueltos.actualizarFichero();\n\n } catch (IOException ex) {\n Logger.getLogger(Principal.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n if (rdbPrivado.isSelected()) {\n cargarDatos(PRIVADO, txtFiltroNombre.getText());\n\n } else {\n cargarDatos(PUBLICO, txtFiltroNombre.getText());\n }\n }\n\n } else {\n JOptionPane.showMessageDialog(this, \"No hay filas seleccionadas\", \"error\", JOptionPane.ERROR_MESSAGE);\n }\n }", "private void deleteLeftOversFromDB(String uid, String message){\n Toast.makeText(RegistrationActivity.this, message, Toast.LENGTH_LONG).show();\n database.getReference(\"ids\").child(uid).removeValue(); //remove the id from ids if user wasn't created eventually\n mAuth.getCurrentUser().delete(); // remove the user from the authentication db if user not created\n }", "public void deleteUser(User userToDelete) throws Exception;", "private void removeUser(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\ttry {\n\t\t\tPrintWriter out = res.getWriter();\n\t\t\tPreferenceDB.removePreferencesUser(Long.parseLong(req.getParameter(Constants.USER_IDENTIFIER)));\n\t\t\tif (UserDB.getnameOfUser(Long.parseLong(req.getParameter(Constants.USER_IDENTIFIER))) == null)\n\t\t\t\tout.print(\"ok\");\n\t\t\tUserDB.removeUser(Long.parseLong(req.getParameter(Constants.USER_IDENTIFIER)));\n\t\t\tout.print(\"ok\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tres.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n\t\t}\n\t}", "private void eliminaAccount(HttpServletRequest request, HttpServletResponse response) {\r\n HttpSession session = request.getSession();\r\n Medico medico = (Medico) session.getAttribute(\"utente\");\r\n if (medico != null) {\r\n\r\n if (PazienteModel.getPazientiSeguiti(medico.getCodiceFiscale()).size() != 0) {\r\n // non è possibile effettuare l'eliminazione, notificare al medico che non può\r\n // proseguire con l'opeazione fino a che\r\n // segue dei pazienti.\r\n } else {\r\n MedicoModel.removeMedico(medico.getCodiceFiscale());\r\n request.setAttribute(\"notifica\", \"Account eliminato con successo\");\r\n session.removeAttribute(\"utente\");\r\n session.setAttribute(\"accessDone\", false);\r\n }\r\n\r\n }\r\n\r\n }", "public void deletarResumoFaturamentoSimulacaoDetalheCredito(Integer idFaturamentoGrupo,\n\t\t\tInteger anoMesReferencia, Integer idRota)\n\t\t\tthrows ErroRepositorioException;", "public void desactivarRecursos() {\n\r\n\t}", "public void deleteUserPrivilegesByUserID(User user) {\r\n try {\r\n List<UserPrivileges> userPrivileges = this.findUserPrivilegesByUser(user);\r\n\r\n for (int i = 0; i < userPrivileges.size(); i++) {\r\n\r\n delete(userPrivileges.get(i));\r\n }\r\n\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "@Override\n\tpublic void deleteUser() {\n\t\tLog.d(\"HFModuleManager\", \"deleteUser\");\n\t}", "@Override\n\tpublic void deleteAllUsers() {\n\t\t\n\t}", "@Override\n\tpublic void revoke(User subject, Permission permission)\n\t{\n\t\t//TODO figure out how to implement since we're using role based permissions\n\t}", "public void revokeAllPrivilegesForSubject(GrouperSession grouperSession, Subject subject);", "@Override\n\tpublic String deleteUser(Map<String, Object> reqs) {\n\t\tString result = \"success\";\n\t\tString sql = \"delete from tp_users where userId=:userId\";\n\t\n\t\ttry {\n\t\t\tjoaSimpleDao.executeUpdate(sql, reqs);\n\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t\tresult = \"failed\";\n\t\t}\n\t\treturn result;\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t List<User> userList = selectAllUser();\n\t\t for (User user : userList) {\n\t\t\tuserMapper.deleteUser(user.getId());\n\t\t}\n\t}", "public synchronized void revokeAdminPrivilege(UserEntity userEntity) {\n for (PrivilegeEntity privilege : userEntity.getPrincipal().getPrivileges()) {\n if (privilege.getPermission().getPermissionName().equals(PermissionEntity.AMBARI_ADMINISTRATOR_PERMISSION_NAME)) {\n userEntity.getPrincipal().getPrivileges().remove(privilege);\n principalDAO.merge(userEntity.getPrincipal()); //explicit merge for Derby support\n userDAO.merge(userEntity);\n privilegeDAO.remove(privilege);\n break;\n }\n }\n }", "public void removePermissions(IPermission[] permissions) throws AuthorizationException;", "@Override\n\tpublic void clearDBUsers() {\n\t\tDB db = getDB();\n\t\tMap<Long, Risposta> risposte = db.getTreeMap(\"users\");\n\t\trisposte.clear();\n\t\tdb.commit();\n\t}", "@Override\n\tpublic void eliminarUsuaris(String name) {\n\t\treposUsuarios.deleteById(name);\n\t}", "@PostMapping(\"/administrador/borrar\")\r\n\tpublic String borrar(@RequestParam(value=\"id\", defaultValue=\"\")Long id,@RequestParam(value=\"passwordactualhash\",defaultValue=\"\")String passwordactual,HttpSession session,ModelMap m) {//TODO probar mejorable obteniedo primero eladmin a borrar en borrarotro pasar el admin entero (se ahorra una consulta en la bd\r\n\t\tif(permisos(session)&&((Usuario)session.getAttribute(\"user\")).getPassword().equals(passwordactual)){\r\n\t\t\tif(id==null) id=((Administrador)session.getAttribute(\"user\")).getId();\r\n\t\t\tAdministrador admin=RAdministrador.findOne(id);\r\n\t\t\tif(admin==null&&((Administrador)session.getAttribute(\"user\")).getId().equals(id)) LoginController.logoutStatic(session);\r\n\t\t\tif(admin!=null&&(permisosBorrar(id,session)||permisosBorrarOtros(id,session))){\r\n\t\t\t\tRAdministrador.delete(id);\r\n\t\t\t\tif(session.getAttribute(\"user\")!=null&&((Administrador)session.getAttribute(\"user\")).getId().equals(id)) LoginController.logoutStatic(session);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"redirect:/administrador/listar\";\r\n\t}", "void clearPrivileges() {\n\n roles.clear();\n rightsMap.clear();\n\n isAdministrator = false;\n }", "public void deleteUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk deleteUser\");\r\n\t}", "public void deleteUsers() {\n SQLiteDatabase db = this.getWritableDatabase();\n // Delete All Rows\n db.delete(TABLE_USER, null, null);\n db.close();\n\n Log.d(TAG, \"Deleted all user info from sqlite\");\n }", "public void deleteUsers() {\n SQLiteDatabase db = this.getWritableDatabase();\n // Delete All Rows\n db.delete(TABLE_USER, null, null);\n db.close();\n\n Log.d(TAG, \"Deleted all user info from sqlite\");\n }", "@Override\n public void clearPermissions(Class<? extends AeroCommandBase<?>> command) {\n permissions.remove(command);\n }", "@Override\n\tpublic void eliminar() {\n\t\tLOG.info(\"Se elimino el usuario de la bd\");\n\t}", "@Override\n\tpublic List<Resident> deleteResident(int user_id) {\n\t\tQuery query = getSession().createQuery(\"delete from RESIDENT_HMS resident where user_id=:user_id\");\n\t\tquery.setParameter(\"user_id\",user_id);\n\t\tint noofrows=query.executeUpdate();\n\t\tif(noofrows>0)\n\t\t{\n\t\t\tSystem.out.println(\"Deleted successfully\");\n\t\t}\n\t\t\n\t\treturn getResidentList();\n\t}", "@Override\n\tpublic String userDelete(Map<String, Object> reqs, Map<String, Object> conds) {\n\t\treturn null;\n\t}", "public void logOut() {\r\n\t\tthis.modoAdmin = false;\r\n\t\tthis.usuarioConectado = null;\r\n\t}", "public void deleteUsers() {\n SQLiteDatabase db = this.getWritableDatabase();\n // Delete All Rows\n db.delete(TABLE_USER, null, null);\n // db.close();\n Log.d(TAG, \"Deleted all user info from sqlite\");\n }", "public void desestimarAccion() throws IOException{\n if(fVerif.DesestimarAccion(ObservacionesDesestimada, AccionSeleccionada.getId())== -1){\n FacesContext.getCurrentInstance().addMessage(\"form_seguimiento_accion:btn_desestimar_accion\", new FacesMessage(SEVERITY_FATAL, \"No se pudo desestimar la accion\", \"No se pudo desestimar la accion\" ));\n FacesContext.getCurrentInstance().renderResponse();\n }else{\n // regresar a la pagina listar acciones\n String url = FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();\n FacesContext.getCurrentInstance().getExternalContext().redirect(url+\"/Views/Acciones/General/ListarAcciones.xhtml?tipo=\"+tipoDeAccion);\n }\n }", "@Override\r\n\tpublic boolean deleteAllUser() {\n\t\treturn false;\r\n\t}", "void revoke(Object dbobject, int rights) {\n\n if (rights == 0) {\n return;\n }\n\n int n = rightsMap.get(dbobject, 0);\n\n if (n == 0) {\n return;\n }\n\n rights = n & (GranteeManager.ALL - rights);\n\n if (rights == 0) {\n rightsMap.remove(dbobject);\n } else {\n rightsMap.put(dbobject, rights);\n }\n }", "public void clearAllAuthInfo();", "public void borrar() {\n\t\tmiPintor.borrar();\n\t\tlienzo.refrescar();\n\t\t\n\t}", "@Headers({\"Content-Type: application/json\", \"Cache-Control: no-cache\"})\n @DELETE(\"/userpreference/delete\")\n Call<Void> deleteAllUserPreference();", "public void deleteUserJoinsbyTid(Integer tid);", "private void removerPontos(final String matricula, final int pontos) {\n firebase.child(\"Alunos/\" + matricula + \"/pontuacao\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n long qtdAtual = (long) dataSnapshot.getValue();\n if (qtdAtual >= pontos) {\n firebase.child(\"Alunos/\" + matricula + \"/pontuacao\").setValue(qtdAtual - pontos);\n Toast.makeText(getContext(), \"Pontuação removida com sucesso.\", Toast.LENGTH_SHORT).show();\n quantidade.setText(\"\");\n\n if (alunoEncontrado == null) {\n Log log = new Log(matricula, pontos);\n log.pontos(\"Remover\");\n } else {\n Log log = new Log(alunoEncontrado, pontos);\n log.pontos(\"Remover\");\n }\n } else {\n Toast.makeText(getContext(), \"Aluno com menor quantidade de pontos que o solicitado.\", Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }", "private void revokeGooglePlusAccess() {\n if (mGoogleApiClient.isConnected()) {\n Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);\n Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient)\n .setResultCallback(new ResultCallback<Status>() {\n @Override\n public void onResult(Status arg0) {\n Log.e(TAG, \"User access revoked!\");\n mGoogleApiClient.connect();\n }\n\n });\n }\n }", "private void deleteUser() throws SQLException {\n System.out.println(\"Are you sure you want to delete your user? Y/N\");\n if (input.next().equalsIgnoreCase(\"n\")) return;\n\n List<Integer> websiteIds = new ArrayList<>();\n try (PreparedStatement stmt = connection.prepareStatement(\"SELECT * FROM passwords \" +\n \"WHERE user_id like (?)\")) {\n stmt.setInt(1, user.getId());\n ResultSet rs = stmt.executeQuery();\n while (rs.next()) {\n websiteIds.add(rs.getInt(\"website_data_id\"));\n }\n }\n\n try (PreparedStatement stmt = connection.prepareStatement(\"DELETE FROM passwords \" +\n \"WHERE user_id like (?)\")) {\n stmt.setInt(1, user.getId());\n stmt.executeUpdate();\n }\n\n for (int website : websiteIds) {\n try (PreparedStatement stmt = connection.prepareStatement(\"DELETE FROM website_data \" +\n \"WHERE website_data_id like (?)\")) {\n stmt.setInt(1, website);\n stmt.executeUpdate();\n }\n }\n\n try (PreparedStatement stmt = connection.prepareStatement(\"DELETE FROM users \" +\n \"WHERE id like (?)\")) {\n stmt.setInt(1, user.getId());\n stmt.executeUpdate();\n }\n\n System.out.println(\"User \" + user.getUsername() + \" deleted.\");\n System.exit(0);\n }", "void DeleteCompteUser(int id);", "public static void eliminarRegistros(){\n int idEliminar = Integer.parseInt(JOptionPane.showInputDialog(\"Igrese el ID a Eliminar\"));\n pd.eliminaraPersonas(idEliminar);\n }", "@Override\n public void delete(Usuario usuario) {\n }", "private void setearPermisosMenu()\r\n\t{\r\n\t\t/*Permisos del usuario para los mantenimientos*/\r\n\t\tthis.setearOpcionesMenuMantenimientos();\r\n\t\tthis.setearOpcionesMenuFacturacion();\r\n\t\tthis.setearOpcionesMenuCobros();\r\n\t\tthis.setearOpcionesMenuProcesos();\r\n\t\tthis.setearOpcionesReportes();\r\n\t\tthis.setearOpcionesMenuAdministracion();\r\n\t}", "@Override\r\n\tpublic boolean delUsuario(int uid) {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic void delete(Usuario t) {\n\t\t\r\n\t}", "private void revokeGplusAccess() {\n if (mGoogleApiClient.isConnected()) {\n Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);\n Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient)\n .setResultCallback(new ResultCallback<Status>() {\n @Override\n public void onResult(Status arg0) {\n Log.e(TAG, \"User access revoked!\");\n mGoogleApiClient.connect();\n updateUI(false);\n }\n });\n }\n }", "public void logoutUser() {\n editor.remove(Is_Login).commit();\n editor.remove(Key_Name).commit();\n editor.remove(Key_Email).commit();\n editor.remove(KEY_CUSTOMERGROUP_ID).commit();\n // editor.clear();\n // editor.commit();\n // After logout redirect user to Loing Activity\n\n }", "public void deleteUserCredentials(String login) throws SQLException;", "private void clearUser() { user_ = null;\n \n }", "private void revokeUserLoginAndUpdateNotes(long studentID) throws Exception {\n int fee = getPendingFee(studentID);\n fee += 25;\n\n String url = MASTER_URL + MEMBERS + studentID + \".api\";\n\n URL obj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n con.setDoOutput(true);\n // request method\n con.setRequestMethod(\"PUT\");\n\n // request headers\n con.setRequestProperty(\"token\", USER_TOKEN);\n con.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n String data = \"user[description]=Owes $\" + fee;\n\n OutputStreamWriter writer = new OutputStreamWriter(con.getOutputStream());\n\n writer.write(data);\n writer.close();\n\n con.getResponseCode();\n\n revokeLogin(studentID);\n\n }", "void eliminarPedidosUsuario(String idUsuario);", "public void deleteAccount() {\n final FirebaseUser currUser = FirebaseAuth.getInstance().getCurrentUser();\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n DatabaseReference ref = database.getReference();\n ref.addListenerForSingleValueEvent( new ValueEventListener() {\n public void onDataChange(DataSnapshot dataSnapshot) {\n for (DataSnapshot userSnapshot : dataSnapshot.child(\"User\").getChildren()) {\n if (userSnapshot.child(\"userId\").getValue().toString().equals(currUser.getUid())) {\n //if the userId is that of the current user, check mod status\n System.out.println(\"Attempting delete calls\");\n //dataSnapshot.getRef().child(\"User\").orderByChild(\"userId\").equalTo(currUser.getUid());\n userSnapshot.getRef().removeValue();\n currUser.delete();\n //take user back to starting page\n Intent intent = new Intent(SettingsActivity.this, MainActivity.class);\n startActivity(intent);\n }\n }\n }\n public void onCancelled(DatabaseError databaseError) {\n System.out.println(\"The read failed: \" + databaseError.getCode());\n }\n });\n signOut();\n }", "private void remover() {\n int confirma = JOptionPane.showConfirmDialog(null, \"Tem certeza que deseja remover este cliente\", \"Atenção\", JOptionPane.YES_NO_OPTION);\n if (confirma == JOptionPane.YES_OPTION) {\n String sql = \"delete from empresa where id=?\";\n try {\n pst = conexao.prepareStatement(sql);\n pst.setString(1, txtEmpId.getText());\n int apagado = pst.executeUpdate();\n if (apagado > 0) {\n JOptionPane.showMessageDialog(null, \"Empresa removida com sucesso!\");\n txtEmpId.setText(null);\n txtEmpNome.setText(null);\n txtEmpTel.setText(null);\n txtEmpEmail.setText(null);\n txtEmpCNPJ.setText(null);\n }\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e);\n }\n }\n }" ]
[ "0.6096517", "0.60937077", "0.59446806", "0.5922157", "0.5902744", "0.5899348", "0.5894497", "0.57709885", "0.57410026", "0.5739242", "0.57272524", "0.56708616", "0.565448", "0.56393176", "0.5632349", "0.5620863", "0.55920124", "0.5584546", "0.55828637", "0.55777454", "0.5568368", "0.5554937", "0.5552979", "0.5520786", "0.55159557", "0.55108935", "0.5506263", "0.55058813", "0.5505809", "0.5448207", "0.5418568", "0.5416641", "0.5407362", "0.54073435", "0.5404162", "0.5398921", "0.5385263", "0.5384731", "0.53821", "0.5377073", "0.537564", "0.53746516", "0.5369692", "0.53680104", "0.5364907", "0.53636533", "0.53623813", "0.53560334", "0.53557503", "0.5346796", "0.5345853", "0.5345501", "0.5332571", "0.532424", "0.53165156", "0.5313208", "0.5308947", "0.53062516", "0.5300611", "0.52979904", "0.529453", "0.52871597", "0.5283694", "0.5279019", "0.52741206", "0.5273188", "0.5271604", "0.5266599", "0.52656305", "0.52656305", "0.5262854", "0.5262036", "0.5254897", "0.5253542", "0.5253315", "0.524501", "0.5244215", "0.5242985", "0.52306104", "0.5228508", "0.5227129", "0.52199537", "0.5212462", "0.5211995", "0.52118605", "0.520175", "0.51929045", "0.51917577", "0.51862943", "0.5178444", "0.5170853", "0.51690376", "0.51617485", "0.51553357", "0.51520944", "0.5142636", "0.5137089", "0.512636", "0.51259565", "0.5119639" ]
0.5235735
78
length of the previous longest prefix suffix
static void computeLPSArray(String pat, int M, int lps[]) { int len = 0; int i = 1; lps[0] = 0; // lps[0] is always 0 // the loop calculates lps[i] for i = 1 to M-1 while (i < M) { if (pat.charAt(i) == pat.charAt(len)) { len++; lps[i] = len; i++; } else // (pat[i] != pat[len]) { // This is tricky. Consider the example. // AAACAAAA and i = 7. The idea is similar // to search step. if (len != 0) { len = lps[len - 1]; // Also, note that we do not increment // i here } else // if (len == 0) { lps[i] = len; i++; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int longestCanonicalPrefixLength()\n\t{\n\t\tAffix currLong; //= this.longestCanonicalPrefix();\n\n\t\tint length;\n\n\t\tif( prefixes.size() < 1 ) {\n\t\t\tlength = 0;\n\t\t} else {\n\t\t\tcurrLong = this.longestCanonicalPrefix();\n\t\t\tlength = currLong.getAffix().length();\n\t\t}\n\n\t\treturn length;\n\t}", "private Affix longestCanonicalPrefix()\n\t{\n\t\tAffix currLong \t\t= this.prefixes.get(0); // longest found affix\n\t\tint currLongLength = currLong.getAffix().length();\n\n\t\tfor( int i = 1; i < prefixes.size(); i++ )\n\t\t{\n\t\t\tAffix temp = this.prefixes.get(i);\n\t\t\tint prefixLength\t= temp.getAffix().length();\n\n\t\t\tif( currLongLength < prefixLength )\n\t\t\t{\n\t\t\t\tcurrLong = temp;\n\t\t\t}\n\t\t}\n\n\t\treturn currLong;\n\t}", "private String longestPrefix(String[] inputs){\n\t\tif(inputs == null || inputs.length == 0)\n\t\t\treturn \"\";\n\t\tif(inputs.length == 1)\n\t\t\treturn inputs[0];\n\t\tString prefix = inputs[0];\n\t\t\n\t\tfor(int i=0; i< inputs.length; i++){\n\t\t\twhile(inputs[i].indexOf(prefix) != 0){\n\t\t\t\tprefix = prefix.substring(0, prefix.length()-1);\n\t\t\t\tif(prefix.isEmpty())\n\t\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\t\t\n\t\treturn prefix;\n\t}", "public int getLongestRepeatedSubstringLength()\r\n {\r\n return maxLength;\r\n }", "public int lengthOfLongestWord(){\n int n=0;\n for(int i=0;i<size();i++)\n if(get(i).length()>n)n=get(i).length();\n return n;\n }", "public int lengthOfLongestSubstring(String s) {\n return sol2a(s); \n //return sol3_WRONG(s); //NO! D & C (unlike LC53)\n }", "public int longestRod ();", "private void adjustMaxPrefixCharacterLenghtAfterRemoval(){\n int prefixFullNameMaxLength = !getAllPrefixFullNames().isEmpty() ? Collections.max(getAllPrefixFullNames(), stringCharacterLengthComparator).length() : 0;\n int prefixAbbreviationMaxLength = !getAllPrefixAbbreviations().isEmpty() ? Collections.max(getAllPrefixAbbreviations(), stringCharacterLengthComparator).length() : 0;\n\n maxPrefixCharacterLength = Math.max(prefixAbbreviationMaxLength, prefixFullNameMaxLength);\n }", "public abstract String getLongestRepeatedSubstring();", "public static int longestRepeatingSubstringUsingSuffixArray(String s) {\n\t\tint n = s.length();\n\t\tSuffixArray sa = new SuffixArray(s);\n\t\tint ans = 0;\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\tint len = sa.lcp(i);\n\t\t\tans = Math.max(ans, len);\n\t\t}\n\t\treturn ans;\n\t}", "public static int lengthOfLongestSubstring(String s) {\n int[] dp=new int[256];\n for(int i=0;i<dp.length;i++){\n dp[i]=-1;\n }\n int start=0,result=0;\n for(int i=0;i<s.length();i++){\n start=Math.max(dp[s.charAt(i)]+1,start);\n dp[s.charAt(i)]=i;\n result=Math.max(result,i-start+1);\n }\n return result;\n }", "public int lengthOfLongestSubstring(String s) {\n int[] chars = new int[128];\n\n int left = 0;\n int right = 0;\n\n int res = 0;\n while (right < s.length()) {\n char r = s.charAt(right);\n chars[r]++;\n\n while (chars[r] > 1) {\n char l = s.charAt(left);\n chars[l]--;\n left++;\n }\n\n res = Math.max(res, right - left + 1);\n\n right++;\n }\n return res;\n }", "public int lengthOfLongestSubstring(String s) {\n if(s.length()<=1) return s.length();\n HashMap<Character,Integer> h=new HashMap<Character,Integer>();\n int curmax=0,max=0;\n for(int i=0;i<s.length();i++) {\n char c=s.charAt(i);\n if(h.containsKey(c)) { \n if(i-h.get(c)<curmax) { // previous is in the middle of curmax, then restart from the previous next char\n curmax=1; // otherwise previous is the start of curmax, then simply replace current with previous\n i=h.get(c)+1; \n c=s.charAt(i);\n h.clear();\n }\n }\n else {\n curmax++;\n }\n h.put(c,i);\n max=curmax>max?curmax:max;\n }\n return max;\n }", "public int lengthOfLongestSubstring(String s) {\n if(s.length() == 0) return 0;\r\n \r\n int windowEnd = 0;\r\n int windowStart = 0;\r\n int maxLen = 0;\r\n \r\n \r\n HashMap<Character, Integer> hm = new HashMap<>();\r\n \r\n for(windowEnd = 0;windowEnd < s.length(); windowEnd++){\r\n \r\n char ch = s.charAt(windowEnd);\r\n \r\n if(hm.containsKey(ch)){\r\n windowStart = Math.max(windowStart , hm.get(ch)+1);\r\n }\r\n \r\n hm.put(ch,windowEnd);\r\n maxLen = Math.max(maxLen, windowEnd-windowStart+1);\r\n }\r\n \r\n return maxLen; \r\n }", "public int longestPalindromeSubseq(String s) {\n return lps(s, 0, s.length() - 1);\n }", "private static int suffixLength(char[] needle, int p) {\n int len = 0;\n for (int i = p, j = needle.length - 1;\n i >= 0 && needle[i] == needle[j]; --i, --j) {\n len += 1;\n }\n return len;\n }", "private static int lengthOfLongestSubstring2(String s) {\n int maxLength = 0;\n int currentlength = 0;\n int startIndex = -1;\n Map<Character, Integer> charMap = new HashMap<>();\n \n for(int index = 0; index < s.length(); index++){\n Character c = s.charAt(index);\n Integer currentIndex = charMap.get(c);\n if(currentIndex != null){\n \tcurrentlength = index - startIndex -1 ;\n if(maxLength < currentlength){\n maxLength = currentlength;\n }\n if(currentIndex > startIndex) {\n startIndex = currentIndex;\n }\n }\n charMap.put(c, index);\n }\n currentlength = s.length() - startIndex -1 ;\n if(maxLength < currentlength){\n maxLength = currentlength;\n }\n return maxLength;\n }", "public int get_length();", "public int maxSuffixLength() {\r\n return mMaxSuffixLength;\r\n }", "public static void main(String[] args) {\n String str = \"pwwkew\";\n// System.out.println(str.length());\n System.out.println(lengthOfLongestSubstring(str));\n\n\n }", "public int suffixArrayLength() {\r\n return mText.length();\r\n }", "public int lengthOfLongestSubstring(String s) {\n if (s == null) {\n return 0;\n }\n return helper(s, 0);\n }", "public static int lengthOfLongestSubstring(String s) \r\n {\r\n \tif (s.length()==0) \r\n \t\treturn 0;\r\n \t\r\n HashMap<Character, Integer> map = new HashMap<Character, Integer>();\r\n int length = 0;\r\n int start = 0;\r\n \r\n for (int end=0; end < s.length(); end++)\r\n {\r\n \t// When we have reached a repeated character, then the currently held string is potentially the largest string.\r\n \t// If the character is there in the map, start needs to be changed. \r\n \t// If it is not there, start remains the same so that it can increase the count\r\n if (map.containsKey(s.charAt(end)))\r\n {\r\n \t// Consider input as abba. For b[2], start < map.get(s.charAt(end)) + 1 \r\n \t// For b[3], start > map.get(s.charAt(end)) + 1. It means, if the character has occured towards the beginning, we dont want the start to be modified.\r\n \tstart = Math.max(start, map.get(s.charAt(end)) + 1);\r\n } \r\n \r\n map.put(s.charAt(end), end);\r\n \r\n // Why +1? Lets say start=2, end=5. Then the length will be 5-2=3. And, 3+1 = 4.\r\n length = Math.max(length, end-start+1);\r\n \r\n }\r\n return length;\r\n }", "public int lengthOfLongestSubstring(String s) {\n\t\tint max=0;\n\t\tif (s == null )\n\t\t\treturn max;\n\n\t\tchar[] aChars = s.toCharArray();\n\t\tSet<Character> set=new HashSet<Character>();\n\t\tString slidingWindow =\"\";\n\t\tfor (int i = 0; i < aChars.length; i++) {\n\t\t\tset.add(aChars[i]);\n\t\t\tfor(int j=i+1;j<=aChars.length;j++) {\n\t\t\t\tslidingWindow = s.substring(i,j);\n\t\t\t\tif(j==aChars.length || set.contains(aChars[j])) {\n\t\t\t\t\tmax = max>slidingWindow.length()?max:slidingWindow.length();\n\t\t\t\t\tset.clear();\n\t\t\t\t\tbreak;\n\t\t\t\t}else {\n\t\t\t\t\tset.add(aChars[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn max;\n\n\t}", "public int lengthOfLongestSubstring(String s) {\n\t\tif (s == null || s.length() == 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tint slow = 0, fast = 0;\n\t\tHashMap<Character, Integer> map = new HashMap<Character, Integer>();\n\t\tint maxLen = 0;\n\t\tint start = 0, end = 0;\n\t\twhile (fast < s.length()) {\n\t\t\tchar cur = s.charAt(fast);\n\t\t\tif (!map.containsKey(cur)) {\n\t\t\t\tmap.put(cur, 1);\n\t\t\t} else {\n\t\t\t\tmap.put(cur, map.get(cur) + 1);\n\t\t\t}\n\n\t\t\twhile (map.get(cur) > 1 && slow <= fast) {\n\t\t\t\tchar slow_char = s.charAt(slow);\n\t\t\t\tmap.put(slow_char, map.get(slow_char) - 1);\n\t\t\t\tslow++;\n\t\t\t}\n\t\t\tif (maxLen < fast - slow + 1) {\n\t\t\t\tmaxLen = fast - slow + 1;\n\t\t\t\tstart = slow;\n\t\t\t\tend = fast;\n\t\t\t}\n\t\t\tfast++;\n\t\t}\n\n\t\t// System.out.println(\"maxLen = \" + maxLen);\n\t\t// System.out.println(s.substring(start, end + 1));\n\t\treturn maxLen;\n\t}", "public static int lengthOfLongestSubstring(String s) {\n if(s.length()==1)\n return 1;\n\n int sum=0;\n int left = 0, right = 0;\n boolean[] used = new boolean[128];\n\n while(right < s.length()){\n if(used[s.charAt(right)] == false){\n used[s.charAt(right)] = true;\n right++;\n }else{\n sum = Math.max(sum, right-left);\n while(left<right && s.charAt(right) != s.charAt(left)){\n used[s.charAt(left)] = false;\n left++;\n }\n left++;\n right++;\n }\n }\n sum = Math.max(sum, right - left);\n\n return sum;\n }", "public int lengthOfLongestSubstring(String s) {\n if(s == null || s.length() == 0){\n return 0;\n }\n int runner = 0;\n int walker = 0;\n int max = 0;\n HashSet<Character> set = new HashSet<Character>();\n while(runner < s.length()){\n if(set.contains(s.charAt(runner))){\n if(max < runner - walker){\n max = runner - walker;\n }\n while(s.charAt(walker) != s.charAt(runner)){\n set.remove(s.charAt(walker));\n walker++;\n }\n walker++;\n }else{\n set.add(s.charAt(runner));\n }\n runner++;\n }\n max = Math.max(max, runner - walker);\n return max;\n }", "public int lengthOfLongestSubstring(String s)\n {\n\tif (s.length() < 2)\n\t return s.length();\n\n\tint max = 0, i = 0, j = 1;\n\n\tboolean[] cache = new boolean[128];\n\tcache[s.charAt(i) - ' '] = true;\n\n\twhile (i < s.length() && j < s.length())\n\t{\n\t while (cache[s.charAt(j)-' '])\n\t\t cache[s.charAt(i++)-' '] = false; \n\t cache[s.charAt(j++)-' '] = true;;\n\t max = Math.max(max, j - i);\n\t}\n\treturn max;\n }", "public int lengthOfLongestSubstring2(String s) {\n int n = s.length(), ans = 0;\n int[] index = new int[128]; // current index of character\n // try to extend the range [i, j]\n for (int j = 0, i = 0; j < n; j++) {\n i = Math.max(index[s.charAt(j)], i);\n ans = Math.max(ans, j - i + 1);\n index[s.charAt(j)] = j + 1;\n }\n return ans;\n }", "public int lengthOfLongestSubstring(String s) {\n\t\tint n = s.length();\n\t\tint ans = 0;\n\t\tMap<Character, Integer> map = new HashMap<Character, Integer>();\n\t\tfor (int i = 0, j = 0; j < n; j++) {\n\t\t\tif (map.containsKey(s.charAt(j))) {\n\t\t\t\ti = Math.max(map.get(s.charAt(j)), i);\n\t\t\t}\n\t\t\tans = Math.max(ans, j - i + 1);\n\t\t\tmap.put(s.charAt(j), j + 1);\n\t\t}\n\t\treturn ans;\n\n\t}", "public int lengthOfLongestSubstring(String s) {\r\n\r\n int answer = 0;\r\n int index = 0;\r\n while (index < s.length()) {\r\n String tmp = \"\";\r\n for (int i = index; i < s.length(); i++) {\r\n if (tmp.contains(String.valueOf(s.charAt(i)))) {\r\n break;\r\n } else {\r\n tmp += String.valueOf(s.charAt(i));\r\n }\r\n }\r\n if (tmp.length() > answer) {\r\n answer = tmp.length();\r\n }\r\n index++;\r\n }\r\n\r\n return answer;\r\n }", "public int normalizedLength(List<String> sequence);", "public int findLUSlength(String[] strs) { //O(n^2) time. O(1) space.\r\n\t\tif (strs.length == 0)\r\n\t\t\treturn 0;\r\n\t\tint max = -1;\r\n\t\tint i = 0;\r\n\t\t// Arrays.sort(strs, (a,b) -> b.length() - a.length());\r\n\t\tfor (int j = 0; j < strs.length; j++) {\r\n\t\t\tfor (i = 0; i < strs.length; i++) {\r\n\t\t\t\tif (j == i || !isSubsequence(strs[j], strs[i]))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\telse\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (i == strs.length)\r\n\t\t\t\tmax = Math.max(strs[j].length(), max);\r\n\t\t}\r\n\t\treturn max;\r\n\t}", "public int lengthOfLongestSubstring(String s) {\n int l=s.length(),len=0,r=0;\n HashMap<Character,Integer> h=new HashMap<Character,Integer>();\n for(int i=0;i<l;) {\n char c=s.charAt(i);\n if(h.containsKey(c)) {\n i=h.get(c)+1; // we should restart and clear the hash map before the repeated c\n h.clear();\n len=0;\n }\n else {\n h.put(c,i);\n len++;\n r=Math.max(len,r);\n i++;\n }\n }\n return r;\n }", "public static int longerThanOriginalOne(String s){\n\n\t\tint count = 1;\n\t\tchar c = s.charAt(0);\n\n\t\tint total = 0;\n\n\t\tfor (int i = 1; i < s.length(); i++){\n\t\t\tif (s.charAt(i) == c){\n\t\t\t\tcount += 1;\n\t\t\t}else{\n\t\t\t\ttotal += 1 + Integer.toString(count).length();\n\t\t\t\tc = s.charAt(i);\n\t\t\t\tcount = 1;\n\n\t\t\t}\n\t\t}\n\t\ttotal += 1 + Integer.toString(count).length();\n\t return total;\n\n\n\t}", "public int lengthOfLongestSubstring(String s) {\n int len = s.length();\n HashMap map = new HashMap();\n int i = 0;\n for(; i<len; i++) {\n char c = s.charAt(i);\n // System.out.println(c);\n if (map.containsKey(c)) {\n return Math.max(i, lengthOfLongestSubstring(s.substring((int)map.get(c)+1, len)));\n }\n else {\n map.put(c, i);\n }\n }\n return i;\n }", "private static int longestPalindromicSubsequence(String str1) {\n\t\tStringBuilder str2 = new StringBuilder(str1);\n\t\tstr2.reverse().toString();\n\t\tString strtemp = str2.toString(); \n\t\treturn LCSDP(str1,strtemp,str1.length(),str1.length());\n\t}", "public static String longestRepeatedSubstring(String s){\r\n int N = s.length();\r\n String[] suffixes = new String[N];\r\n \r\n for (int i = 0; i < N; i++)\r\n suffixes[i] = s.substring(i, N);\r\n \r\n /* bring subffixes with common prefix together. */\r\n Arrays.sort(suffixes);\r\n \r\n /* compare the adjacent suffixes. */\r\n String longest = \"\";\r\n for (int i = 0; i < suffixes.length - 1; i++){\r\n String common = longestCommonPrefix(suffixes[i], suffixes[i+1]);\r\n if (common.length() > longest.length())\r\n longest = common;\r\n }\r\n \r\n return longest;\r\n }", "static int size_of_lhld(String passed){\n\t\treturn 3;\n\t}", "public int lengthOfLongestSubstring2(String s) {\n if (s == null || s.length() == 0) {\n return 0;\n }\n\n int start=0;\n int max = 0;\n int[] map = new int[256];\n\n for (int i = 0; i < s.length(); i++) {\n int c = (int)s.charAt(i);\n start = Math.max(map[c], start);\n map[c] = i + 1;\n max = Math.max(max, i + 1 - start);\n }\n\n return max;\n }", "public static void main(String[] args) {\n String a = \"agbcba\";\n StringBuilder rev = new StringBuilder(a);\n System.out.println(a.length() - findLCS(a, rev.reverse().toString(), a.length(), a.length()));\n }", "public static void main(String[] args) {\n\t\tString A = \"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\";\r\n\t\tLongestSubString longestSubString = new LongestSubString();\r\n\t\tint lengthOfLongestSubstring = longestSubString.lengthOfLongestSubstring(A);\r\n\t\tSystem.out.println(lengthOfLongestSubstring);\r\n\r\n\t}", "int getStrLngth(String name){\r\n int l= name.length();\r\n return l;}", "public String longestPalindrome(String s) {\n String ans = \"\";\n int maxLen = 0;\n for (int i = 0; i < s.length(); i++) {\n int[] pair = expand(s, i, i);\n if (pair[1] - pair[0] + 1 > maxLen) {\n maxLen = pair[1] - pair[0] + 1;\n ans = s.substring(pair[0], pair[1] + 1);\n }\n pair = expand(s, i, i + 1);\n if (pair[1] - pair[0] + 1 > maxLen) {\n maxLen = pair[1] - pair[0] + 1;\n ans = s.substring(pair[0], pair[1] + 1);\n }\n }\n return ans;\n }", "public static int calculateLengthOfLongestWord(final List<String> lines)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}", "public int lengthOfLSS(String s){\n HashMap<Character, Integer> m = new HashMap<>();\n int ans = 0;\n \n for(int i=0, j=0; j<s.length(); j++){\n if(m.containsKey(s.charAt(j))){\n i = Math.max(m.get(s.charAt(j)),i);\n }\n ans = Math.max(j-i+1,ans);\n m.put(s.charAt(j),j+1);\n }\n\n return ans;\n }", "private String longestCommonPrefixHS(String[] strs){\n\t\tif (strs.length == 0) return \"\";\n\t\tString prefix = strs[0];\n\t\tfor (int i = 1; i < strs.length; i++){\n\t\t\twhile (strs[i].indexOf(prefix) != 0) {\n\t\t\t\tprefix = prefix.substring(0, prefix.length() - 1);\n\t\t\t\tif (prefix.isEmpty()) return \"\";\n\t\t\t}\n\t\t}\n\t\treturn prefix;\n\t}", "public static int lengthOfLongestSubstring(String s) {\n\t\tchar[] chars = s.toCharArray();\n\t\tint x = 0;\n\t\tint head = 0;\n\t\tHashMap<Character, Integer> map = new HashMap<Character, Integer>();\n\t\tfor (int i = 0; i < chars.length; i++) {\n\t\t\tif (!map.containsKey(chars[i])) {\n\t\t\t\tmap.put(chars[i], i);\n\t\t\t\tif (map.size() > x) {\n\t\t\t\t\tx = map.size();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (map.size() > x) {\n\t\t\t\t\tx = map.size();\n\t\t\t\t}\n\t\t\t\tint temp = map.get(chars[i]);\n\n\t\t\t\tfor (int j = head; j <= temp; j++) {\n\t\t\t\t\tmap.remove(chars[j]);\n\t\t\t\t}\n\t\t\t\thead = temp + 1;\n\t\t\t\tmap.put(chars[i], i);\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}", "int len();", "public int lengthOfLongestSubstring(String s) {\n HashMap<Character, Integer> charsVisit = new HashMap();\n int result = 0;\n int longest = 0;\n\n for (int i = 0; i < s.length(); i++) {\n\n if (charsVisit.containsKey(s.charAt(i))) {\n\n /* Start at repeat character to see if that is where the longest substring starts */\n i = charsVisit.get(s.charAt(i));\n\n charsVisit.clear(); // Clear hash map.\n result = 0;\n\n } else {\n result++;\n\n /* KEY/VALUE = char/index */\n charsVisit.put(s.charAt(i), i);\n }\n\n if (longest < result)\n longest = result;\n }\n return longest;\n }", "public int my_length();", "static int noOfAppends(String s) \n{ \n\tif (isPalindrome(s.toCharArray())) \n\t\treturn 0; \n\n\t// Removing first character of string by \n\t// incrementing base address pointer. \n\ts=s.substring(1); \n\n\treturn 1 + noOfAppends(s); \n}", "public int lengthOfLongestSubstring2(String s) {\n\n int res = 0;\n int len = s.length();\n Map<Character, Integer> map = new HashMap<Character, Integer>();\n\n for (int i = 0, j = 0; j < len; j++) {\n if (map.containsKey(s.charAt(j))) {\n i = Math.max(map.get(s.charAt(j)), i);// use Max mesas never looking back\n }\n res = Math.max(res, j - i + 1); // j not plus yet, need add 1 to get a real length ( indicate j itself)\n map.put(s.charAt(j), j + 1); // (j+1) means skip duplicate\n System.out.println(map.toString()); // will update the value of key ( union key)\n }\n\n\n return res;\n }", "public int getMaxLength();", "public abstract void createLongestRepeatedSubstring();", "public int lengthOfLongestSubstring(String s){\n\t\tif(s == null || s.length() == 0){\n\t\t\treturn 0;\n\t\t}\n\n\t\tchar[] ch = s.toCharArray();\n\t\tint[] map = new int[128];\n\t\tint start = 0, end = 0, count = 0, maxLen = 0;\n\n\t\twhile(end < s.length()){\n\t\t\t// If map[ch[end]] > 0, it means ch[end] is duplicated now.\n\t\t\tif(map[ch[end]] > 0){\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tmap[ch[end]]++;\n\t\t\tend++;\n\n\t\t\t// deal with the duplicated cases\n\t\t\twhile(count > 0){\n\t\t\t\tif(map[ch[start]] > 1){\n\t\t\t\t\tcount--;\n\t\t\t\t}\n\t\t\t\tmap[ch[start]]--;\n\t\t\t\tstart++;\n\t\t\t}\n\n\t\t\tmaxLen = Math.max(maxLen, end - start);\n\t\t}\n\t\treturn maxLen;\n\t}", "public int lengthOfLongestSubstring(String s) {\n HashMap<Character, Integer> hm = new HashMap<Character, Integer>();\n int counter = 0;\n int max = 0;\n char[] charArray = s.toCharArray();\n for (int i = 0; i < charArray.length; i++) {\n if (!hm.containsKey(charArray[i])) {\n hm.put(charArray[i], i);\n counter++;\n } else {\n max = (max > counter) ? max : counter;\n int index = hm.get(charArray[i]);\n for (int j = 0; j <= index; j++)\n hm.remove(charArray[j]);\n hm.put(charArray[i], i);\n counter = hm.size();\n }\n }\n max = (max > counter) ? max : counter;\n return max;\n }", "public int lengthOfLongestSubstring(String s) {\n if (s == null || s.length() == 0) {\n return 0;\n }\n int res = 0;\n boolean[] used = new boolean[128];//ASCII 表共能表示 256 个字符,但是由于键盘只能表示 128 个字符,所以用 128 也行\n int left = 0, right = 0; //维持[i, j) 滑动窗口\n while (right < s.length()) {\n if (!used[s.charAt(right)]) {\n used[s.charAt(right ++)] = true;\n } else {\n res = Math.max(res, right - left);\n while ( left < right && s.charAt(left) != s.charAt(right)) {\n used[s.charAt(left ++)] = false;\n }\n left ++;\n right ++;\n }\n }\n res = Math.max(res, right - left);\n return res;\n }", "public short computeLength() {\n \tshort len = (short)(CORE_LENGTH + super.computeLength());\n \treturn len;\n }", "public static int longestCommonSubsequenceLength(String s1, String s2)\n {\n return longestCommonSubsequenceLength(s1.toCharArray(), s2.toCharArray(), s1.length(), s2.length());\n }", "public int lengthOfLongestSubstring(String s) {\n int longest = 0;\n Set<Character> set = new HashSet<>();\n int i = 0, j = 0;\n while (j < s.length()) {\n if (set.contains(s.charAt(j))) {\n longest = getMax(set.size(), longest);\n set.remove(s.charAt(i));\n i++;\n } else {\n set.add(s.charAt(j));\n j++;\n }\n }\n return getMax(longest, set.size());\n }", "public static void main(String[] args) {\n int length = lengthOfLongestSubstring(\"\");\n\n System.out.println(length);\n }", "public short lengthDiff() {\n \tshort total = computeLength();\n \treturn (short)(total - (short)MINIMUM_LENGTH + alignment(total, 0));\n }", "public long getLength();", "public long getLength();", "public int lengthOfLongestSubstring(String s) {\n // Sanitization\n // Create a hashmap to save the character and the index\n // fast pointer - Move until it didn't find the duplicate\n // slow pointer - If the fast pointer pointed the duplicate, get that index and\n // place it next to it.\n\n if (s == null || s.length() == 0)\n return 0;\n int slowPointer = 0;\n int fastPointer = 0;\n int result = 0;\n HashMap<Character, Integer> map = new HashMap();\n while (fastPointer < s.length()) {\n char currentChar = s.charAt(fastPointer);\n if (map.containsKey(currentChar)) {\n int currentIndedx = map.get(currentChar);\n if (slowPointer <= currentIndedx) {\n slowPointer = currentIndedx + 1;\n }\n }\n int difference = fastPointer - slowPointer;\n result = Math.max(result, difference + 1);\n map.put(currentChar, fastPointer);\n fastPointer++;\n }\n return result;\n }", "public int lengthOfLongestSubstring(String s) {\n\n int res = 0;\n int len = s.length();\n int i = 0, j = 0;\n Set<Character> set = new HashSet<>();\n while (i < len && j < len) {\n if (!set.contains(s.charAt(j))) {\n set.add(s.charAt(j++)); // here s.set an ele then j already plus\n res = Math.max(res, j - i); // so use j-i\n } else {\n set.remove(s.charAt(i++));\n }\n }\n\n return res;\n }", "public int getLagLength() {\r\n\t\treturn Integer.parseInt(properties.getProperty(KEY_LAG_LENGTH)) * 1000;\r\n \t}", "protected abstract int findMax(final String prefix);", "public int maxLen(final int ind) {\n return (ind <= 0 || ind > alts.length) ? 0 : Math.max(referenceAlleleLength, alts[ind - 1].length());\n }", "boolean truncateSuffix(final long lastIndexKept);", "public abstract int getMaxLength();", "public int get_pre_len() {\n return pre_len;\n }", "private static int longestString(List<String> arr) {\n\t\tList<String> ll=new ArrayList();\r\n\t\tlongestString(arr,0,\"\",ll);\r\n\t\tint max=0;\r\n\t\tfor(String a:ll) {\r\n\t\t\tint len=a.length();\r\n\t\t\tif(len>max) {\r\n\t\t\t\tmax=len;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn max;\r\n\t}", "public int findLongestWordLength() {\n int longestWordLength = wordsArray[0].length();\n\n for (int i = 1; i < wordsArray.length; i++) {\n if (wordsArray[i].length() > wordsArray[i - 1].length()) {\n longestWordLength = wordsArray[i].length();\n }\n }\n if (summationWord.length() > longestWordLength) {\n longestWordLength = summationWord.length();\n }\n return longestWordLength;\n }", "public int lengthOfLongestSubstring1(String s) {\n\t\tint i = 0, j = 0, max = 0;\n\t\tSet<Character> set = new HashSet<>();\n\n\t\twhile (j < s.length()) {\n\t\t\tif (!set.contains(s.charAt(j))) {\n\t\t\t\tset.add(s.charAt(j++));\n\t\t\t\tmax = Math.max(max, set.size());\n\t\t\t} else {\n\t\t\t\tset.remove(s.charAt(i++));\n\t\t\t}\n\t\t}\n\n\t\treturn max;\n\t}", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "public int length();", "public int length();", "public int length();", "public int length();", "public int length();", "public int lengthOfLongestSubstringE(String s)\n {\n\tif (s.length() < 2)\n\t return s.length();\n\n\tint max = 0, i = 0, j = 1;\n\n\tSet<Character> cache = new HashSet<Character>();\n\tcache.add(s.charAt(i));\n\n\twhile (i < s.length() && j < s.length())\n\t{\n\t while (cache.contains(s.charAt(j)))\n\t\tcache.remove(s.charAt(i++));\n\t cache.add(s.charAt(j++));\n\t max = Math.max(max, j - i);\n\t}\n\treturn max;\n }", "public abstract long getLength();", "public abstract long getLength();", "int prefixLength() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.icu.impl.coll.CollationDataBuilder.ConditionalCE32.prefixLength():int, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.icu.impl.coll.CollationDataBuilder.ConditionalCE32.prefixLength():int\");\n }", "public int commonPrefixLength(String s1, String s2)\r\n {\r\n\r\n int length = 0;\r\n if (s1.isEmpty() || s2.isEmpty())\r\n {\r\n return 0;\r\n }\r\n while (s1.charAt(length) == s2.charAt(length))\r\n {\r\n length++;\r\n //if (k >= s1.length() || k >= s2.length() || k >= system.getLookupTableSize() - 1)\r\n if (length >= s1.length() || length >= s2.length())\r\n {\r\n break;\r\n }\r\n }\r\n\r\n return length;\r\n\r\n }", "public int getLength(){\n return sequence.length(); \n\t}", "public int lengthOfLastWord(String s) {\n String[] words = s.split(\" \");\n return words.length==0?0:words[words.length-1].length();\n }", "private static String longestCommonPrefix(String[] strs) {\n\t\tif (strs == null || strs.length == 0) {\n\t\t\treturn \"\";\n\t\t}\n\t\tint minLen = Integer.MAX_VALUE;\n\t\tfor (String str : strs) {\n\t\t\tif (minLen > str.length()) {\n\t\t\t\tminLen = str.length();\n\t\t\t}\n\t\t}\n\t\tif (minLen == 0) {\n\t\t\treturn \"\";\n\t\t}\n\t\tfor (int j = 0; j < minLen; j++) {\n\t\t\tchar prev = '0';\n\t\t\tfor (int i = 0; i < strs.length; i++) {\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tprev = strs[i].charAt(j);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (prev != strs[i].charAt(j)) {\n\t\t\t\t\treturn strs[i].substring(0, j);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn strs[0].substring(0, minLen);\n\t}", "public String longestPalindrome(String s) {\n int start = 0;\n int end = 0;\n for (int i = 0; i < s.length(); i++) {\n int len1 = expand(s, i, i);\n int len2 = expand(s, i, i + 1);\n int len = Math.max(len1, len2);\n if (len > end - start) {\n start = i - (len - 1) / 2;\n end = i + len / 2;\n }\n }\n return s.substring(start, end + 1);\n }", "public static int unsignedLongestCommonPrefix(long z1, long z2) {\n\treturn Long.numberOfLeadingZeros(z1 ^ z2);\n }" ]
[ "0.7703375", "0.72682285", "0.67134684", "0.6607823", "0.65152556", "0.651105", "0.65066975", "0.6502674", "0.6473382", "0.63949466", "0.6384248", "0.6374964", "0.6371315", "0.6346853", "0.6315991", "0.6304227", "0.62960315", "0.62715805", "0.6255631", "0.6245429", "0.620675", "0.6205017", "0.6181922", "0.61660075", "0.6156047", "0.6148069", "0.61422026", "0.61346716", "0.61254257", "0.61224055", "0.6119028", "0.6116025", "0.6105328", "0.61037284", "0.609868", "0.60945785", "0.60936254", "0.6083195", "0.6073208", "0.6066158", "0.6059733", "0.60594606", "0.6036908", "0.60334086", "0.60267615", "0.6019045", "0.6018677", "0.6008866", "0.60033125", "0.5999922", "0.5975481", "0.5971514", "0.59703636", "0.5966776", "0.59632856", "0.59516245", "0.59489477", "0.59465384", "0.59414154", "0.5931241", "0.59287286", "0.5928396", "0.5923693", "0.58958364", "0.58958364", "0.5894865", "0.5884864", "0.58848536", "0.5875804", "0.5875249", "0.58676285", "0.58346003", "0.58275974", "0.5825419", "0.5824039", "0.5821217", "0.581844", "0.581844", "0.581844", "0.581844", "0.581844", "0.581844", "0.581844", "0.581844", "0.581844", "0.581844", "0.5815033", "0.5815033", "0.5815033", "0.5815033", "0.5815033", "0.5797528", "0.5794111", "0.5794111", "0.5793949", "0.578937", "0.5783494", "0.57731175", "0.5770933", "0.5767499", "0.57637674" ]
0.0
-1
Converts a date into a Java Calendar object using the system time zone. Only used by debug display consider removing after development
public static Calendar dateToCalendar(Date date) { Calendar cal = Calendar.getInstance(); cal.clear(); cal.setTimeInMillis(date.getTime()); return cal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Calendar forDate(Date date) {\r\n\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.setTime(date);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public Date getUTCDate(String timeZone, Calendar cal);", "public static Calendar dateToCalendar(Date dteStart, TimeZone tz) {\r\n Calendar cal = Calendar.getInstance(tz);\r\n cal.clear();\r\n int year = dteStart.getYear() + 1900;\r\n int month = dteStart.getMonth();\r\n DateFormat formatter = new SimpleDateFormat(\"dd\");\r\n String strDay = formatter.format(dteStart);\r\n int day = Integer.parseInt(strDay);\r\n int hrs = dteStart.getHours();\r\n int min = dteStart.getMinutes();\r\n int secs = dteStart.getSeconds();\r\n cal.set(Calendar.YEAR, year);\r\n cal.set(Calendar.MONTH, month);\r\n cal.set(Calendar.DAY_OF_MONTH, day);\r\n cal.set(Calendar.HOUR_OF_DAY, hrs);\r\n cal.set(Calendar.MINUTE, min);\r\n cal.set(Calendar.SECOND, secs);\r\n return cal;\r\n }", "private static Calendar toUTCCalendarWithoutTime(final Date date) {\n final Calendar calendar = Calendar.getInstance();\n calendar.clear();\n calendar.setTime(date);\n calendar.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar;\n }", "public static Calendar dateToCalendar(Date date){ \r\n Calendar cal = Calendar.getInstance();\r\n cal.setTime(date);\r\n return cal;\r\n }", "private Calendar convertDateToCalendar(Date date) {\n Calendar calendar = GregorianCalendar.getInstance();\n calendar.setTime(date);\n return calendar;\n }", "public static Calendar getCalendar(Date date) {\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tif (date != null) {\r\n\t\t\tcal.setTime(date);\r\n\t\t} else {\r\n\t\t\tcal.setTime(new Date());\r\n\t\t}\r\n\t\treturn cal;\r\n\t}", "public static Calendar toCalendar(final Date date) {\n\t\tfinal Calendar cal = Calendar.getInstance();\n\t\tcal.setTime(date);\n\n\t\treturn cal;\n\t}", "Calendar toCalendar();", "Calendar toCalendar();", "public static Calendar getCalendar(Date date) {\n Calendar cal = Calendar.getInstance();\n cal.setTime(date);\n return cal;\n }", "public Calendar calendario(Date date) {\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(date);\r\n return calendar;\r\n }", "Calendar getCalendar();", "private static Calendar getCalendar(final Long timeInMilliseconds, final TimeZone timeZone) {\n\n final Calendar calendar = Calendar.getInstance(timeZone);\n calendar.setTimeInMillis(timeInMilliseconds);\n\n return calendar;\n }", "abstract GregorianCalendar getThreadLocalCalendar();", "public static Calendar parseISODate(String dateAsString, String timezone) throws ParseException {\n\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT, Locale.US);\n simpleDateFormat.setTimeZone(TimeZone.getTimeZone(SERVER_TIME_ZONE));\n try {\n\n Calendar date = Calendar.getInstance();\n\n if (dateAsString != null && !(dateAsString.equalsIgnoreCase(\"\"))) {\n\n date.setTime(simpleDateFormat.parse(dateAsString));\n date.setTimeZone(TimeZone.getTimeZone(timezone));\n\n }\n\n return date;\n\n } catch (ParseException e) {\n\n Log.d(TAG, \"Failed to parse date: \" + dateAsString + \" to iso format: \" + DATE_FORMAT);\n throw e;\n\n }\n\n }", "public void testCalendar() {\n Calendar cal = rootBlog.getCalendar();\n assertEquals(rootBlog.getTimeZone(), cal.getTimeZone());\n }", "public static Calendar convertToLondonCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar gmtCal = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/London\"));\r\n gmtCal.clear();\r\n gmtCal.setTimeInMillis(timeInMillis);\r\n return gmtCal;\r\n }", "public static DateUtil today(TimeZone timeZone)\n {\n // 86,400,000 = 1000 * 60 * 60 * 24 = milliseconds per day\n long currentUTCDateTime = System.currentTimeMillis();\n DateUtil d = new DateUtil((int)(currentUTCDateTime / 86400000L));\n\n /*\n * Gets the time zone offset, for current date, modified in case of\n * daylight savings. This is the offset to add *to* UTC to get local time.\n * Places east of Greenwich have a positive offset.\n * :era the era of the given date, AD = 1 BC = 0\n * :year the year in the given date.\n * Docs are unclear if 1900=0 or 1900. Does not use year in calcs anyway.\n * :month the month in the given date.\n * Month is 0-based. e.g., 0 for January.\n * :day the day-in-month of the given date.\n * :dayOfWeek the day-of-week of the given date. 1=Calendar.SUNDAY\n * :milliseconds the millis in day in <em>standard</em> local time.\n * :return the offset in millis to add *to* GMT to get local time.\n */\n int offsetInMillis = timeZone.getOffset(d.getOrdinal() >= Jan_01_0001 ? 1:0,\n d.getYYYY(),\n d.getMM()-1,\n d.getDD(),\n d.getCalendarDayOfWeek(),\n (int)(currentUTCDateTime % 86400000L)\n /* wrong. Should be local standard time. How to get it?? */\n );\n d.setOrdinal((int)((currentUTCDateTime + offsetInMillis) / 86400000L));\n return d;\n }", "public static Calendar deepCopyCalendar(Calendar cal) {\r\n Calendar result = null;\r\n if (null != cal) {\r\n Calendar newCal = Calendar.getInstance(cal.getTimeZone());\r\n newCal.clear();\r\n newCal.set(Calendar.YEAR, cal.get(Calendar.YEAR));\r\n newCal.set(Calendar.MONTH, cal.get(Calendar.MONTH));\r\n newCal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH));\r\n newCal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY));\r\n newCal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE));\r\n newCal.set(Calendar.SECOND, cal.get(Calendar.SECOND));\r\n newCal.set(Calendar.MILLISECOND, cal.get(Calendar.MILLISECOND));\r\n result = newCal;\r\n }\r\n return result;\r\n }", "public String getUTCTime(String timeZone, Calendar cal);", "public java.util.TimeZone getTimeZone() { return ((JDateType)getType()).getTimeZone(); }", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "public static Date parseTimeZoneDateTime(String date)\n\t{\n\t\treturn parseFormatDate(date, getTimeZoneDateTimeFormat());\n\t}", "public static Calendar getCalender(Date date) {\n\n Calendar calendar = Calendar.getInstance();\n\n if (date != null) {\n long millis = date.getTime();\n calendar.setTimeInMillis(millis);\n }\n\n return calendar;\n }", "public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "Calendar getArrivalDateAndTime();", "public Calendar toCalendar() {\n\t\treturn (Calendar) _cal.clone();\n\t}", "public String convertToLocalTime(Calendar eventDate, String timezone) throws ParseException;", "public Calendar startOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE));\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public CalendarUtils(Calendar baseCalendar) {\r\n\t\tthis(baseCalendar.getTime(), baseCalendar.getTimeZone());\r\n\t}", "public static Date getLocalUTCTime(){\r\n\t\tfinal Calendar cal=Calendar.getInstance();\r\n\t\tfinal int zoneOffset=cal.get(Calendar.ZONE_OFFSET);\r\n\t\tfinal int dstOffset=cal.get(Calendar.DST_OFFSET);\r\n\t\tcal.add(Calendar.MILLISECOND, -(zoneOffset+dstOffset));\r\n\t\treturn cal.getTime();\r\n\t}", "public static Calendar ahoraCalendar() {\n return Calendar.getInstance(TimeZone.getTimeZone(\"America/Guayaquil\"));\n }", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "private Date getSamoaNow() {\n\t\t// Get the current datetime in UTC\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(new Date());\n\t\t\n\t\t// Get the datetime minus 11 hours (Samoa is UTC-11)\n\t\tcalendar.add(Calendar.HOUR_OF_DAY, -11);\n\t\t\n\t\treturn calendar.getTime();\n\t}", "public static Calendar getCurrentTime(String argGMT) {\r\n\t\treturn DateToCalendar(getTime(argGMT));\r\n\t}", "public static Date getDateNowSingl(){\n\t\tconfigDefaultsTimeZoneAndLocale();\r\n\t\t\r\n\t\t// o time millis é sempre GMT 0, a transformação fica por conta do Date\r\n\t\treturn new Date(System.currentTimeMillis()+getPropDefaultForAll(TIME_CORRECTION));\r\n\t}", "public static String getTimeZoneDateTime(Date date)\n\t{\n\t\treturn getFormatString(date, getTimeZoneDateTimeFormat());\n\t}", "private Date calendarToDate(Calendar calendar) {\n return (Date) calendar.getTime();\n }", "public void convertDateTimeFromUTCtoPlaceTimeZone(BookingDto bookingDto) {\n\t\tPlaceDto portOfLoad = bookingDto.getPortOfLoad();\r\n\t\tif (portOfLoad != null && portOfLoad.getCity() != null) {\r\n\t\t\tString timeZonePortOfLoad = portOfLoad.getCity().getTimeZone();\r\n\t\t\tif (timeZonePortOfLoad != null && !timeZonePortOfLoad.isEmpty()) {\r\n\t\t\t\tbookingDto.setPortCutOffDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getPortCutOffDate(), timeZonePortOfLoad));\r\n\t\t\t\tbookingDto.setDocsCutOffDateTime(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getDocsCutOffDateTime(), timeZonePortOfLoad));\r\n\t\t\t\tbookingDto.setSailDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getSailDate(), timeZonePortOfLoad));\r\n\t\t\t\tbookingDto.setDocsReceivedDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getDocsReceivedDate(), timeZonePortOfLoad));\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlaceDto portOfDischarge = bookingDto.getPortOfDischarge();\r\n\t\tif (portOfDischarge != null && portOfDischarge.getCity() != null) {\r\n\t\t\tString tzPortOfDischarge = portOfDischarge.getCity().getTimeZone();\r\n\t\t\tif (tzPortOfDischarge != null && !tzPortOfDischarge.isEmpty()) {\r\n\t\t\t\tbookingDto.setEta(dateUtil.convertDateToSpecificTimeZone(bookingDto.getEta(), tzPortOfDischarge));\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlaceDto emptyPickupDepot = bookingDto.getEmptyContainerPickup();\r\n\t\tif (emptyPickupDepot != null && emptyPickupDepot.getCity() != null) {\r\n\t\t\tString tzEmptyPickupDepot = emptyPickupDepot.getCity().getTimeZone();\r\n\t\t\tif (tzEmptyPickupDepot != null && !tzEmptyPickupDepot.isEmpty()) {\r\n\t\t\t\tbookingDto.setEmptyPickupDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getEmptyPickupDate(), tzEmptyPickupDepot));\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlaceDto ingateTerminal = bookingDto.getIngateAtTerminal();\r\n\t\tif (ingateTerminal != null && ingateTerminal.getCity() != null) {\r\n\t\t\tString tzIngateTerminal = ingateTerminal.getCity().getTimeZone();\r\n\t\t\tif (tzIngateTerminal != null && !tzIngateTerminal.isEmpty()) {\r\n\t\t\t\tbookingDto.setEarlyReceivingDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getEarlyReceivingDate(), tzIngateTerminal));\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlaceDto placeOfReceipt = bookingDto.getPlaceOfReceipt();\r\n\t\tif (placeOfReceipt != null && placeOfReceipt.getCity() != null) {\r\n\t\t\tString tzPlaceOfReceipt = placeOfReceipt.getCity().getTimeZone();\r\n\t\t\tif (tzPlaceOfReceipt != null && !tzPlaceOfReceipt.isEmpty()) {\r\n\t\t\t\tbookingDto.setCargoMovingDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getCargoMovingDate(), tzPlaceOfReceipt));\r\n\t\t\t\tbookingDto.setRailCutOffDateTime(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getRailCutOffDateTime(), tzPlaceOfReceipt));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public String getDateTime(Calendar cal, int GMT_OFFSET_SECONDS, String DATE_TIME_FORMAT) throws Exception {\n\n String sRetVal = \"\";\n String DefaultFormat = \"yyyyMMddHHmmss\";\n int GMT_OFFSET_DIFF = 0;\n try {\n\n //check for valid Calender values\n if (cal == null) {\n cal = Calendar.getInstance();\n }\n\n //check for valid FORMAT values\n if (DATE_TIME_FORMAT == null) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n if (DATE_TIME_FORMAT.trim().toUpperCase().equalsIgnoreCase(\"\")) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n\n //check GMT RAW OFF SET difference\n int CURR_GMT_OFFSET = TimeZone.getDefault().getRawOffset() / 1000;\n //in case Current GMT is GREATER THAN provided GMT\n if (CURR_GMT_OFFSET > GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n\n //in case Current GMT is SMALLER THAN provided GMT\n } else if (CURR_GMT_OFFSET < GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n }\n\n if (CURR_GMT_OFFSET == GMT_OFFSET_SECONDS) {\n GMT_OFFSET_DIFF = 0;\n }\n\n //setting calender datetime as per GMT\n cal.add(Calendar.SECOND, GMT_OFFSET_DIFF);\n\n //using SimpleDateFormat class\n sRetVal = new SimpleDateFormat(DATE_TIME_FORMAT).format(cal.getTime());\n return sRetVal;\n\n } catch (Exception e) {\n println(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n throw new Exception(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n } finally {\n }\n\n }", "public native final Calendar timeZone(String val) /*-{\n\t\tthis[\"timeZone\"] = val;\n\t\treturn this;\n\t}-*/;", "public static Calendar convertToExchCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar exchCal = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n exchCal.clear();\r\n exchCal.setTimeInMillis(timeInMillis);\r\n return exchCal;\r\n }", "public Day(TimeZone tz, Date date)\n\t{\n\t\tCalendar cal = Calendar.getInstance(tz, Locale.US);\n\t\tcal.setTime(date);\n\t\tthis.year = cal.get(Calendar.YEAR);\n\t\tthis.month = cal.get(Calendar.MONTH)+1;\n\t\tthis.day = cal.get(Calendar.DAY_OF_MONTH);\n\t}", "public static Date toDate(Object obj, TimeZone timeZone) {\n return toDate(obj, (String) null, timeZone);\n }", "XMLGregorianCalendar getSystemEntryDate();", "public TimeZone() { throw new RuntimeException(\"Stub!\"); }", "java.lang.String getTimeZone();", "public static Date GetUTCdatetimeAsDate()\n {\n return StringDateToDate(GetUTCdatetimeAsString());\n }", "public static final Calendar getCalendar(int date, int month, int year) {\r\n\t\tCalendar cal = Calendar.getInstance(); // locale-specific\r\n\t\t// cal.setTime(dateObject);\r\n\t\tcal.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcal.set(Calendar.MINUTE, 0);\r\n\t\tcal.set(Calendar.SECOND, 0);\r\n\t\tcal.set(Calendar.MILLISECOND, 0);\r\n\r\n\t\tcal.set(Calendar.DATE, date);\r\n\t\tcal.set(Calendar.MONTH, month);\r\n\t\tcal.set(Calendar.YEAR, year);\r\n\t\treturn cal;\r\n\t}", "public java.util.Date toDate() {\n return toCalendar().getTime();\n }", "protected Calendar getCurrentCalendar() {\n Calendar current = new Calendar();\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n SimpleDateFormat dateFormatHour = new SimpleDateFormat(\"H\");\n SimpleDateFormat dateFormatWeekDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat dateFormatMonth = new SimpleDateFormat(\"MMM\");\n\n current.setHour(dateFormatHour.format(calendar.getTime()).toString());\n current.setWeekday(dateFormatWeekDay.format(calendar.getTime()));\n current.setMonth(dateFormatMonth.format(calendar.getTime()));\n\n return current;\n }", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "public static Date getDateGMT(Date date) {\n Date dateGMT = new Date();\n if (date != null) {\n TimeZone timeZone = TimeZone.getTimeZone(\"ICT\");\n GregorianCalendar gregorianCalendar = new GregorianCalendar(timeZone);\n gregorianCalendar.setTime(date);\n gregorianCalendar.set(GregorianCalendar.HOUR, -8);\n dateGMT = gregorianCalendar.getTime();\n }\n return dateGMT;\n }", "public Date getDate() {\n Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n calendar.set(Calendar.YEAR, year);\n calendar.set(Calendar.MONTH, month - 1); // MONTH is zero based\n calendar.set(Calendar.DAY_OF_MONTH, day);\n calendar.set(Calendar.HOUR_OF_DAY, hour);\n calendar.set(Calendar.MINUTE, minute);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar.getTime();\n }", "Calendar getTimeStamp();", "static TS valueOf(final Date date) {\n\t\treturn valueOf(date.getTime(), 0); // Does not preserve the Date's zimezone\n\t}", "public static Date toDate(XMLGregorianCalendar cal) {\r\n if (cal == null) {\r\n return null;\r\n }\r\n return cal.toGregorianCalendar().getTime();\r\n }", "public String getDateFormated(Calendar objCalendar, String sDateFormat) throws Exception {\n SimpleDateFormat formatter = null;\n String sDate = \"\";\n String sDefaultDateFormat = \"yyyy:MM:dd HH:mm:ss\";\n try {\n if (sDateFormat == null) {\n sDateFormat = \"\";\n }\n sDateFormat = sDateFormat.trim();\n if (!sDateFormat.trim().equalsIgnoreCase(\"\")) {\n sDefaultDateFormat = sDateFormat;\n }\n\n formatter = new SimpleDateFormat(sDefaultDateFormat);\n sDate = formatter.format(objCalendar.getTime());\n sDate.trim();\n return sDate;\n } catch (Exception exp) {\n println(\"getCurrentDateTime : \" + exp.toString());\n throw exp;\n }\n }", "private String getTimeZone(TimeZone standardTimeZone, Date dateTime) {\n\t\treturn standardTimeZone.inDaylightTime(dateTime) ? this.dateTimeDaylightSavingTimeZone : standardTimeZone.getID();\n\t}", "public Calendar getCalendar() {\n Calendar c = Calendar.getInstance();\n c.setTime(cal.getTime());\n return c;\n }", "public static String displayTimeDate(Calendar cal)\n\t{\n\t\tString out = \"\";\n\t\tint year = cal.get(Calendar.YEAR);\n\t\tint month = cal.get(Calendar.MONTH) + 1;\n\t\tint day = cal.get(Calendar.DAY_OF_MONTH);\n\t\tint hour = cal.get(Calendar.HOUR_OF_DAY);\n\t\tint minute = cal.get(Calendar.MINUTE);\n\t\tint second = cal.get(Calendar.SECOND);\n\t\tint zone = cal.get(Calendar.ZONE_OFFSET) / (60 * 60 * 1000) * 4;\n\t\t\n\t\tString year_str = String.valueOf(year);\n\t\tString month_str = String.valueOf(month);\n\t\tString day_str = String.valueOf(day);\n\t\tString hour_str = String.valueOf(hour);\n\t\tString minute_str = String.valueOf(minute);\n\t\tString second_str = String.valueOf(second);\n\t\tString zone_str = String.valueOf(zone);\n\t\t\n\t\tif (year_str.length() < 2) year_str = \"0\" + year_str;\n\t\tif (month_str.length() < 2) month_str = \"0\" + month_str;\n\t\tif (day_str.length() < 2) day_str = \"0\" + day_str;\n\t\tif (hour_str.length() < 2) hour_str = \"0\" + hour_str;\n\t\tif (minute_str.length() < 2) minute_str = \"0\" + minute_str;\n\t\tif (second_str.length() < 2) second_str = \"0\" + second_str;\n\t\t\n\t\tout = hour_str + \":\" + minute_str + \":\" + second_str + \" \";\n\t\tout = out + day_str + \"-\" + month_str + \"-\" + year_str; //+\" GMT\"+zone_str ;\n\t\treturn out;\n\t}", "public void setupCalendar() { \n\t\tcal = whenIsIt();\n\t\tLocale here = Locale.US;\n\t\tthisMonth = cal.getDisplayName(2, Calendar.LONG_STANDALONE, here);\n\t\tdate = cal.get(5); //lesson learned: if it's a number do this\n\t\t//ADD CODE FOR ORDINALS HERE\n\t\tyear = cal.get(1);\n\t\tthisHour = cal.get(10);\n\t\tthisMinute = cal.get(12);\n\t\tthisSecond = cal.get(13);\n\t\tamPm = cal.getDisplayName(9, Calendar.SHORT, here);\n\t\tthisDay = thisMonth +\" \"+ addOrdinal(date) + \", \" + year;\n\t\tcurrentTime = fix.format(thisHour) + \":\" + fix.format(thisMinute) + \":\" + fix.format(thisSecond) + \" \" + amPm;\n\t}", "public static TimeZone getDefault();", "public static Calendar DateToCalendar(Date argDate) {\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tcal.setTime(argDate);\r\n\t\treturn cal;\r\n\t}", "public Calendar getCurrentMonthCalendarObj() throws Throwable{\r\n\r\n\t\tString dateInput = \"01/\"+month+\"/\"+year;\t\t\t\r\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MMMM/yyyy\");\r\n\t\tDate startDate = df.parse(dateInput);\r\n\t\tCalendar c = Calendar.getInstance(); // this takes current date\r\n\t c.setTime(startDate); // set date to specified in arguement\r\n\t\treturn c;\r\n\t}", "public final java.util.Date getDate(TimeZone timeZone)\n {\n return ordinal == NULL_ORDINAL ? null : new java.util.Date(getTimeStamp(timeZone));\n }", "public TimeZone getTimeZone(){\r\n return TimeZone.getDefault();\r\n }", "int getUserTimeZoneCode();", "@PostConstruct\n\tpublic void init() {\n\t\tTimeZone.setDefault(TimeZone.getTimeZone(\"UTC\"));\n\t}", "public static CalendarDate getCalendarDate(long utc) {\n\tlong days;\n\tint millis;\n\n\tdays = utc / ONE_DAY;\n\tmillis = (int)(utc % ONE_DAY);\n\tif (millis < 0) {\n\t millis += ONE_DAY;\n\t days--;\n\t}\n\tdays += EPOCH_DATE;\n\tCalendarDate cdate = getCalendarDateFromFixedDate(days);\n\tcdate.setTimeOfDay(millis);\n\treturn cdate;\n }", "public Date getDateNow(){\n\t\tconfigDefaults(getProp(LOCALE), getProp(TIME_ZONE), null);\r\n\t\t\r\n\t\t// o time millis é sempre GMT 0, a transformação fica por conta do Date\r\n\t\treturn new Date(System.currentTimeMillis()+getProp(TIME_CORRECTION));\r\n\t}", "public String getDateTime(Calendar calendar, String GMT) throws Exception {\n return getDateTime(calendar, GMT, \"\");\n }", "public TimeZone getTimeZone() { return this.timeZone; }", "static String getCurrentDateTimeInUTC() {\n TimeZone utcTimeZone = TimeZone.getTimeZone(\"UTC\");\n Date now = Calendar.getInstance(utcTimeZone).getTime();\n DateFormat formatter = new SimpleDateFormat(\"yyyy-MM-DD HH:mm:ss z\");\n formatter.setTimeZone(utcTimeZone);\n return formatter.format(now);\n }", "public String getSystemTime() {\n\t\tSimpleDateFormat dateTimeInGMT = new SimpleDateFormat(\"dd-MMM-yyyy hh\");\n\t\t// Setting the time zoneS\n\t\tdateTimeInGMT.setTimeZone(TimeZone.getTimeZone(\"America/New_York\"));\n\t\tString timeZone = dateTimeInGMT.format(new Date());\n\t\treturn timeZone;\n\n\t}", "Calendar registeredAt();", "public static String convertDate(String inputdate, String fromtimezone, String totimezone)\n\n {\n String sDateinto = \"\";\n try {\n SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT);\n\n String dateInString = inputdate.substring(0, 22) ;\n\n formatter.setTimeZone(TimeZone.getTimeZone(fromtimezone));\n Date date = formatter.parse(dateInString);\n Log.i(\"FromDate String : \", formatter.format(date));\n\n\n SimpleDateFormat totime = new SimpleDateFormat(DATE_FORMAT);\n //TimeZone tzlocaltime = TimeZone.getDefault();\n totime.setTimeZone(TimeZone.getTimeZone(totimezone));\n\n sDateinto = totime.format(date); // Convert to String first\n Date dateInTo = formatter.parse(sDateinto); // Create a new Date object\n\n // Log.i(\"ToDate String: \", sDateinto);\n Log.i(\"ToDate Object: \", formatter.format(dateInTo));\n return sDateinto ;\n }\n catch (ParseException e)\n {\n Log.i(\"Date Conversion\" ,\"Error in parsing\" );\n return \"Date parsing error\" ;\n }\n\n }", "public java.sql.Date getSystemDate(EntityManager em) throws FacadeException {\n Calendar cal = Calendar.getInstance();\n cal.setTime(new java.util.Date());\n cal.set(Calendar.HOUR, 0);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n return new java.sql.Date(cal.getTime().getTime());\n }", "public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) {\r\n Calendar usaCal = Calendar.getInstance(tz);\r\n usaCal.clear();\r\n usaCal.set(year, month, day, hrs, min, secs);\r\n return usaCal;\r\n }", "public static Calendar dateToCalendar(Date fecha, String formato)\n throws Exception {\n if (nullToBlank(fecha).equals(\"\")) {\n return null;\n }\n SimpleDateFormat df = new SimpleDateFormat(formato);\n String text = df.format(fecha);\n return stringToCalendar(text, formato);\n }", "private Date parseDate(Map m) {\n Result res = Result.fromContent(m);\n Calendar cal = Calendar.getInstance(client.getServerTimeZone());\n cal.set(Calendar.YEAR, res.getAsInteger(\"year\"));\n cal.set(Calendar.MONTH, res.getAsInteger(\"month\"));\n cal.set(Calendar.DAY_OF_MONTH, res.getAsInteger(\"day\"));\n cal.set(Calendar.HOUR_OF_DAY, res.getAsInteger(\"hours\"));\n cal.set(Calendar.MINUTE, res.getAsInteger(\"minutes\"));\n cal.set(Calendar.SECOND, res.getAsInteger(\"seconds\"));\n return cal.getTime();\n }", "public static void main(String argv[])\n {\n Calendar cal = Calendar.getInstance();\n\n //Sets TimeZone variable time to our default time zone (America/New_York)\n TimeZone time = TimeZone.getDefault();\n\n //Sets table format for output\n System.out.println(\"Time zone: City: Time:\");\n System.out.println();\n\n //Sets a time format for the output\n SimpleDateFormat sdf = new SimpleDateFormat(\"hh:mm:ss\");\n \n //Prints out the time and timezone in Washington DC\n \n //If cal.get(Calendar.AM_PM returns a value of 0 than AM is printed, \n //otherwise PM is printed\n if (cal.get(Calendar.AM_PM) == 0)\n System.out.println(time.getID() + \" \" + \"Washington DC \" + sdf.format(cal.getTime()) + \" AM\");\n else\n System.out.println(time.getID() + \" \" + \"Washington DC \" + sdf.format(cal.getTime()) + \" PM\");\n\n //Prints out the time in Los Angeles\n time = TimeZone.getTimeZone(\"America/Los_Angeles\");\n \n //Sets the SimpleDateFormat variable to the time zone given by the time variable\n //to display the time\n sdf.setTimeZone(time);\n \n //Sets the calendar to the time zone given by the time variable to display AM/PM\n cal.setTimeZone(time);\n\n if (cal.get(Calendar.AM_PM) == 0)\n System.out.println(time.getID() + \" \" + \"Los Angeles \" + sdf.format(cal.getTime()) + \" AM\");\n else\n System.out.println(time.getID() + \" \" + \"Los Angeles \" + sdf.format(cal.getTime()) + \" PM\");\n\n //Prints out the time in Amsterdam\n time = TimeZone.getTimeZone(\"Europe/Amsterdam\");\n sdf.setTimeZone(time);\n cal.setTimeZone(time);\n\n if (cal.get(Calendar.AM_PM) == 0)\n System.out.println(time.getID() + \" \" + \" Amsterdam \" + sdf.format(cal.getTime()) + \" AM\");\n else\n System.out.println(time.getID() + \" \" + \" Amsterdam \" + sdf.format(cal.getTime()) + \" PM\");\n\n //Prints out the time in Jerusalem\n time = TimeZone.getTimeZone(\"Asia/Jerusalem\");\n sdf.setTimeZone(time);\n cal.setTimeZone(time);\n\n if (cal.get(Calendar.AM_PM) == 0)\n System.out.println(time.getID() + \" \" + \" Jerusalem \" + sdf.format(cal.getTime()) + \" AM\");\n else\n System.out.println(time.getID() + \" \" + \" Jerusalem \" + sdf.format(cal.getTime()) + \" PM\");\n\n //Prints out the time in Hong Kong\n time = TimeZone.getTimeZone(\"Asia/Hong_Kong\");\n sdf.setTimeZone(time);\n cal.setTimeZone(time);\n\n if (cal.get(Calendar.AM_PM) == 0)\n System.out.println(time.getID() + \" \" + \" Hong Kong \" + sdf.format(cal.getTime()) + \" AM\");\n else\n System.out.println(time.getID() + \" \" + \" Hong Kong \" + sdf.format(cal.getTime()) + \" PM\");\n\n }", "public Calendar getDate(){\n return date;\n }", "public static String asString (Date date, TimeZone timezone) {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE, MM MMM yyyy HH:mm:ss z\");\n \n StringBuffer buffer = new StringBuffer();\n \n formatter.format( date, buffer, new FieldPosition( DateFormat.TIMEZONE_FIELD ) );\n \n return buffer.toString();\n }", "public void get_fecha(){\n //Obtenemos la fecha\n Calendar c1 = Calendar.getInstance();\n fecha.setCalendar(c1);\n }", "public TimeZone getTimeZone()\n {\n return timeZone;\n }", "private static Calendar createCalendar(int year, int month, int date) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setLenient(false);\r\n\t\tcalendar.set(Calendar.YEAR, year);\r\n\t\tcalendar.set(Calendar.MONTH, month - 1);\r\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, date);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\treturn calendar;\r\n\t}", "Calendar getDepartureDateAndTime();", "@Override\n public Date getDate(Calendar cal) throws SQLException {\n if (isNull()) return null;\n return getDatatypeCoder().decodeDate(getDate(), cal);\n }", "public static Calendar parseCalendar(DateFormat format, String dateStr) throws ParseException {\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(parseDate(format, dateStr));\n\t\treturn calendar;\n\t}", "RollingCalendar(TimeZone tz, Locale locale)\r\n\t{\r\n\t\tsuper(tz, locale);\r\n\t}", "public static String getUTCDate(){\n \t SimpleDateFormat sdf = new SimpleDateFormat(\"MM-dd-yyyy hh:mm\");\n \t Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n \t return sdf.format(cal.getTime());\n }", "@Override\n public void setLocalTimeZone(DateFormat df) {\n \n }", "public static GregorianCalendar getCalendar(String dateTime)\n\t{\n\t\tGregorianCalendar gc = new GregorianCalendar();\n\t\tDate date = parseDateTime(dateTime);\n\t\tgc.setTime(date);\n\t\t\n\t\treturn gc;\n\t}", "public Calendar getCalendar() {\n return cal;\n }", "public Entry(Calendar date){\n this.date = date; \n }", "private void setDefaultTimezone() {\n TimeZone tz = Calendar.getInstance().getTimeZone();\n this.setTimezone(tz.getID());\n }", "public Calendar() {\n }" ]
[ "0.6684127", "0.6420251", "0.6374774", "0.60953987", "0.60452425", "0.5982437", "0.5885074", "0.5813464", "0.57847387", "0.57847387", "0.5739061", "0.5716253", "0.5672282", "0.5666848", "0.56650406", "0.55940735", "0.559121", "0.5567544", "0.5548541", "0.5539272", "0.55381054", "0.5509766", "0.54962623", "0.5459308", "0.54446363", "0.54380804", "0.54101545", "0.5402435", "0.5369425", "0.52739716", "0.5258515", "0.5244381", "0.5240021", "0.52169526", "0.51958203", "0.51921093", "0.5185314", "0.5158302", "0.5150131", "0.5149211", "0.51403147", "0.513883", "0.51368755", "0.5104395", "0.5096027", "0.5084944", "0.5054163", "0.5033059", "0.5030336", "0.50284344", "0.50178885", "0.5014602", "0.5013914", "0.50130725", "0.5005741", "0.49995312", "0.49781615", "0.49775288", "0.4974119", "0.49711585", "0.49666706", "0.4961535", "0.49614176", "0.4960517", "0.49576432", "0.49503565", "0.49445805", "0.49332634", "0.4930602", "0.4925116", "0.49230918", "0.49176818", "0.4916122", "0.49074653", "0.49034026", "0.48947763", "0.48854026", "0.4883396", "0.4881092", "0.48715964", "0.48529077", "0.48473275", "0.48454025", "0.48413947", "0.48412013", "0.4838622", "0.48341537", "0.48327768", "0.48322856", "0.48297387", "0.48276082", "0.48242924", "0.48232135", "0.4822408", "0.48165363", "0.4813603", "0.48128775", "0.48036906", "0.47961125", "0.4785644" ]
0.5950276
6
Converts a date into a Java Calendar object using the specified time zone.
public static Calendar dateToCalendar(Date dteStart, TimeZone tz) { Calendar cal = Calendar.getInstance(tz); cal.clear(); int year = dteStart.getYear() + 1900; int month = dteStart.getMonth(); DateFormat formatter = new SimpleDateFormat("dd"); String strDay = formatter.format(dteStart); int day = Integer.parseInt(strDay); int hrs = dteStart.getHours(); int min = dteStart.getMinutes(); int secs = dteStart.getSeconds(); cal.set(Calendar.YEAR, year); cal.set(Calendar.MONTH, month); cal.set(Calendar.DAY_OF_MONTH, day); cal.set(Calendar.HOUR_OF_DAY, hrs); cal.set(Calendar.MINUTE, min); cal.set(Calendar.SECOND, secs); return cal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Calendar forDate(Date date) {\r\n\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.setTime(date);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public static Calendar dateToCalendar(Date date){ \r\n Calendar cal = Calendar.getInstance();\r\n cal.setTime(date);\r\n return cal;\r\n }", "public static Calendar toCalendar(final Date date) {\n\t\tfinal Calendar cal = Calendar.getInstance();\n\t\tcal.setTime(date);\n\n\t\treturn cal;\n\t}", "public static Calendar dateToCalendar(Date date) {\r\n Calendar cal = Calendar.getInstance();\r\n cal.clear();\r\n cal.setTimeInMillis(date.getTime());\r\n return cal;\r\n }", "private Calendar convertDateToCalendar(Date date) {\n Calendar calendar = GregorianCalendar.getInstance();\n calendar.setTime(date);\n return calendar;\n }", "public static Calendar getCalendar(Date date) {\n Calendar cal = Calendar.getInstance();\n cal.setTime(date);\n return cal;\n }", "public static Calendar getCalendar(Date date) {\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tif (date != null) {\r\n\t\t\tcal.setTime(date);\r\n\t\t} else {\r\n\t\t\tcal.setTime(new Date());\r\n\t\t}\r\n\t\treturn cal;\r\n\t}", "public Calendar calendario(Date date) {\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(date);\r\n return calendar;\r\n }", "private static Calendar getCalendar(final Long timeInMilliseconds, final TimeZone timeZone) {\n\n final Calendar calendar = Calendar.getInstance(timeZone);\n calendar.setTimeInMillis(timeInMilliseconds);\n\n return calendar;\n }", "public Date getUTCDate(String timeZone, Calendar cal);", "Calendar toCalendar();", "Calendar toCalendar();", "public static Calendar getCalender(Date date) {\n\n Calendar calendar = Calendar.getInstance();\n\n if (date != null) {\n long millis = date.getTime();\n calendar.setTimeInMillis(millis);\n }\n\n return calendar;\n }", "public Day(TimeZone tz, Date date)\n\t{\n\t\tCalendar cal = Calendar.getInstance(tz, Locale.US);\n\t\tcal.setTime(date);\n\t\tthis.year = cal.get(Calendar.YEAR);\n\t\tthis.month = cal.get(Calendar.MONTH)+1;\n\t\tthis.day = cal.get(Calendar.DAY_OF_MONTH);\n\t}", "public static Calendar parseISODate(String dateAsString, String timezone) throws ParseException {\n\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT, Locale.US);\n simpleDateFormat.setTimeZone(TimeZone.getTimeZone(SERVER_TIME_ZONE));\n try {\n\n Calendar date = Calendar.getInstance();\n\n if (dateAsString != null && !(dateAsString.equalsIgnoreCase(\"\"))) {\n\n date.setTime(simpleDateFormat.parse(dateAsString));\n date.setTimeZone(TimeZone.getTimeZone(timezone));\n\n }\n\n return date;\n\n } catch (ParseException e) {\n\n Log.d(TAG, \"Failed to parse date: \" + dateAsString + \" to iso format: \" + DATE_FORMAT);\n throw e;\n\n }\n\n }", "public static Calendar DateToCalendar(Date argDate) {\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tcal.setTime(argDate);\r\n\t\treturn cal;\r\n\t}", "public static Date parseTimeZoneDateTime(String date)\n\t{\n\t\treturn parseFormatDate(date, getTimeZoneDateTimeFormat());\n\t}", "public static Date toDate(Object obj, TimeZone timeZone) {\n return toDate(obj, (String) null, timeZone);\n }", "private static Calendar toUTCCalendarWithoutTime(final Date date) {\n final Calendar calendar = Calendar.getInstance();\n calendar.clear();\n calendar.setTime(date);\n calendar.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar;\n }", "public static Calendar dateToCalendar(Date fecha, String formato)\n throws Exception {\n if (nullToBlank(fecha).equals(\"\")) {\n return null;\n }\n SimpleDateFormat df = new SimpleDateFormat(formato);\n String text = df.format(fecha);\n return stringToCalendar(text, formato);\n }", "public final java.util.Date getDate(TimeZone timeZone)\n {\n return ordinal == NULL_ORDINAL ? null : new java.util.Date(getTimeStamp(timeZone));\n }", "public static Calendar ahoraCalendar() {\n return Calendar.getInstance(TimeZone.getTimeZone(\"America/Guayaquil\"));\n }", "public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) {\r\n Calendar usaCal = Calendar.getInstance(tz);\r\n usaCal.clear();\r\n usaCal.set(year, month, day, hrs, min, secs);\r\n return usaCal;\r\n }", "public static Calendar parseCalendar(DateFormat format, String dateStr) throws ParseException {\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(parseDate(format, dateStr));\n\t\treturn calendar;\n\t}", "public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "Calendar getCalendar();", "public static Date toDate(Object obj, String pattern, TimeZone timeZone) {\n if (obj == null) {\n return null;\n } else if (obj instanceof String) {\n return toDateFromString((String) obj, pattern, timeZone);\n } else if (obj instanceof Date) {\n final Date paramDate = (Date) obj;\n if (Date.class.equals(paramDate.getClass())) { // pure date\n return paramDate;\n } else { // sub class\n // because the Date is not final class.\n final Date date = new Date();\n date.setTime(paramDate.getTime());\n return date;\n }\n } else if (obj instanceof Calendar) {\n return ((Calendar) obj).getTime();\n } else if (obj instanceof byte[]) {\n return toDate(toSerializable((byte[]) obj)); // recursive\n } else if (obj instanceof Long) {\n return new Date((Long) obj);\n } else {\n return toDateFromString(obj.toString(), pattern, timeZone);\n }\n }", "public Calendar toCalendar() {\n\t\treturn (Calendar) _cal.clone();\n\t}", "public static DateUtil today(TimeZone timeZone)\n {\n // 86,400,000 = 1000 * 60 * 60 * 24 = milliseconds per day\n long currentUTCDateTime = System.currentTimeMillis();\n DateUtil d = new DateUtil((int)(currentUTCDateTime / 86400000L));\n\n /*\n * Gets the time zone offset, for current date, modified in case of\n * daylight savings. This is the offset to add *to* UTC to get local time.\n * Places east of Greenwich have a positive offset.\n * :era the era of the given date, AD = 1 BC = 0\n * :year the year in the given date.\n * Docs are unclear if 1900=0 or 1900. Does not use year in calcs anyway.\n * :month the month in the given date.\n * Month is 0-based. e.g., 0 for January.\n * :day the day-in-month of the given date.\n * :dayOfWeek the day-of-week of the given date. 1=Calendar.SUNDAY\n * :milliseconds the millis in day in <em>standard</em> local time.\n * :return the offset in millis to add *to* GMT to get local time.\n */\n int offsetInMillis = timeZone.getOffset(d.getOrdinal() >= Jan_01_0001 ? 1:0,\n d.getYYYY(),\n d.getMM()-1,\n d.getDD(),\n d.getCalendarDayOfWeek(),\n (int)(currentUTCDateTime % 86400000L)\n /* wrong. Should be local standard time. How to get it?? */\n );\n d.setOrdinal((int)((currentUTCDateTime + offsetInMillis) / 86400000L));\n return d;\n }", "static TS valueOf(final Date date) {\n\t\treturn valueOf(date.getTime(), 0); // Does not preserve the Date's zimezone\n\t}", "public static final Calendar getCalendar(int date, int month, int year) {\r\n\t\tCalendar cal = Calendar.getInstance(); // locale-specific\r\n\t\t// cal.setTime(dateObject);\r\n\t\tcal.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcal.set(Calendar.MINUTE, 0);\r\n\t\tcal.set(Calendar.SECOND, 0);\r\n\t\tcal.set(Calendar.MILLISECOND, 0);\r\n\r\n\t\tcal.set(Calendar.DATE, date);\r\n\t\tcal.set(Calendar.MONTH, month);\r\n\t\tcal.set(Calendar.YEAR, year);\r\n\t\treturn cal;\r\n\t}", "public static Calendar convertToLondonCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar gmtCal = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/London\"));\r\n gmtCal.clear();\r\n gmtCal.setTimeInMillis(timeInMillis);\r\n return gmtCal;\r\n }", "public static Calendar deepCopyCalendar(Calendar cal) {\r\n Calendar result = null;\r\n if (null != cal) {\r\n Calendar newCal = Calendar.getInstance(cal.getTimeZone());\r\n newCal.clear();\r\n newCal.set(Calendar.YEAR, cal.get(Calendar.YEAR));\r\n newCal.set(Calendar.MONTH, cal.get(Calendar.MONTH));\r\n newCal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH));\r\n newCal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY));\r\n newCal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE));\r\n newCal.set(Calendar.SECOND, cal.get(Calendar.SECOND));\r\n newCal.set(Calendar.MILLISECOND, cal.get(Calendar.MILLISECOND));\r\n result = newCal;\r\n }\r\n return result;\r\n }", "public Date getDayStart(TimeZone tz)\n\t{\n\t\tCalendar cal = Calendar.getInstance(tz, Locale.US);\n\t\tcal.set(this.year, this.month-1, this.day, 0, 0, 0);\n\t\tcal.set(Calendar.MILLISECOND, 0);\n\t\treturn cal.getTime();\n\t}", "RollingCalendar(TimeZone tz, Locale locale)\r\n\t{\r\n\t\tsuper(tz, locale);\r\n\t}", "public java.util.TimeZone getTimeZone() { return ((JDateType)getType()).getTimeZone(); }", "abstract GregorianCalendar getThreadLocalCalendar();", "public String convertToLocalTime(Calendar eventDate, String timezone) throws ParseException;", "public static GregorianCalendar getCalendar(String dateTime)\n\t{\n\t\tGregorianCalendar gc = new GregorianCalendar();\n\t\tDate date = parseDateTime(dateTime);\n\t\tgc.setTime(date);\n\t\t\n\t\treturn gc;\n\t}", "public static Calendar LocalDateToCalendar(LocalDate localDate) {\r\n Date date = localDateToDate(localDate);\r\n return dateToCalendar(date);\r\n }", "public static final DateTimeZone m68906a(DateTimeZone dateTimeZone) {\n return dateTimeZone == null ? DateTimeZone.a() : dateTimeZone;\n }", "public static Calendar startOfWeek(Date inDate, TimeZone timeZone) {\r\n\r\n\t\tCalendar c1 = Calendar.getInstance(timeZone);\r\n\t\tc1.setTime(inDate);\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(timeZone);\r\n\t\tc2.clear();\r\n\t\t\r\n\t\tint daysBefore = isoDayOfWeek(c1.get(Calendar.DAY_OF_WEEK)) - 1;\r\n\t\t\r\n\t\tc2.set(c1.get(Calendar.YEAR), c1.get(Calendar.MONTH), \r\n\t\t\t\tc1.get(Calendar.DAY_OF_MONTH) - daysBefore);\r\n\t\treturn c2;\t\t\r\n\t}", "public Calendar convertFromString(String stringDate) {\n Calendar dateVacancy = Calendar.getInstance();\n dateVacancy.set(Calendar.MILLISECOND, 0); //remove milliseconds\n if (months.isEmpty()) {\n fillMap();\n }\n if (stringDate.contains(TODAY)) {\n year = Calendar.getInstance().get(Calendar.YEAR);\n month = Calendar.getInstance().get(Calendar.MONTH);\n day = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n dateVacancy.set(year, month, day);\n } else if (stringDate.contains(YESTERDAY)) {\n year = Calendar.getInstance().get(Calendar.YEAR);\n month = Calendar.getInstance().get(Calendar.MONTH);\n day = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n dateVacancy.set(year, month, day - 1);\n } else {\n stringDate = stringDate.substring(0, 9);\n String monthStr = stringDate.substring(stringDate.length() - 7, stringDate.length() - 3).trim();\n this.year = convertToYear(stringDate);\n this.month = months.get(monthStr);\n this.day = convertToDay(stringDate);\n dateVacancy.set(year, month, day);\n }\n return dateVacancy;\n }", "public void setDate(Date date, TimeZone zone) {\n Header header = obtainHeader();\n\n if (date == null) {\n header.removeFields(FieldName.DATE);\n } else {\n header.setField(newDate(date, zone));\n }\n }", "public static Calendar toCalendar(final String iso8601string)\n\t\t\t\tthrows ParseException {\n\t\t\tCalendar calendar = GregorianCalendar.getInstance();\n\n String s = \"\";\n if (iso8601string.contains(\"'Z'\")){\n s = iso8601string.replace(\"Z\", \"+00:00\");\n }\n else if (!iso8601string.contains(\"+\")){\n s = iso8601string + \"+00:00\";\n }\n else{\n s = iso8601string;\n }\n\n\t\t\tDate date = new SimpleDateFormat(dateFormat).parse(s);\n\t\t\tcalendar.setTime(date);\n\t\t\treturn calendar;\n\t\t}", "public static Calendar extractDate(int date){\n Calendar c = Calendar.getInstance();\n String d = date+\"\";\n int year = Integer.parseInt(d.substring(0, 4));\n int month = Integer.parseInt(d.substring(4, 6))-1;\n int day = Integer.parseInt(d.substring(6, 8));\n c.set(year, month, day);\n return c;\n }", "public static Calendar startOfYear(Date referenceDate, TimeZone timeZone) {\r\n\t\tCalendar c1 = Calendar.getInstance(timeZone);\r\n\t\tc1.setTime(referenceDate);\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(timeZone);\r\n\t\tc2.clear();\r\n\t\tc2.set(c1.get(Calendar.YEAR), 0, 1);\r\n\t\treturn c2;\t\t\r\n\t}", "public static CalendarDate getCalendarDate(long utc) {\n\tlong days;\n\tint millis;\n\n\tdays = utc / ONE_DAY;\n\tmillis = (int)(utc % ONE_DAY);\n\tif (millis < 0) {\n\t millis += ONE_DAY;\n\t days--;\n\t}\n\tdays += EPOCH_DATE;\n\tCalendarDate cdate = getCalendarDateFromFixedDate(days);\n\tcdate.setTimeOfDay(millis);\n\treturn cdate;\n }", "private static Calendar createCalendar(int year, int month, int date) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setLenient(false);\r\n\t\tcalendar.set(Calendar.YEAR, year);\r\n\t\tcalendar.set(Calendar.MONTH, month - 1);\r\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, date);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\treturn calendar;\r\n\t}", "Calendar getArrivalDateAndTime();", "public static Date getDateGMT(Date date) {\n Date dateGMT = new Date();\n if (date != null) {\n TimeZone timeZone = TimeZone.getTimeZone(\"ICT\");\n GregorianCalendar gregorianCalendar = new GregorianCalendar(timeZone);\n gregorianCalendar.setTime(date);\n gregorianCalendar.set(GregorianCalendar.HOUR, -8);\n dateGMT = gregorianCalendar.getTime();\n }\n return dateGMT;\n }", "public void testCalendar() {\n Calendar cal = rootBlog.getCalendar();\n assertEquals(rootBlog.getTimeZone(), cal.getTimeZone());\n }", "public Calendar GetCalendar(String sDateTime) throws Exception {\n String YYYY = \"\", MM = \"\", DD = \"\", hh = \"\", mm = \"\", ss = \"\";\n Calendar calendarInstance = null;\n try {\n //considering deafult date format as YYYY-MM-DD hh:mm:ss (e.g 2012-11-21 23:59:30)\n sDateTime = sDateTime.trim();\n if (sDateTime.equalsIgnoreCase(\"\")) {\n throw new Exception(\"Blank datetime value\");\n }\n\n YYYY = sDateTime.substring(0, 4);\n MM = sDateTime.substring(5, 7);\n DD = sDateTime.substring(8, 10);\n hh = sDateTime.substring(11, 13);\n mm = sDateTime.substring(14, 16);\n ss = sDateTime.substring(17, 19);\n MM = \"\" + (Integer.parseInt(MM) - 1);\n if (MM.length() < 2) {\n MM = \"0\" + MM;\n }\n\n calendarInstance = Calendar.getInstance();\n calendarInstance.set(Integer.parseInt(YYYY), Integer.parseInt(MM), Integer.parseInt(DD), Integer.parseInt(hh), Integer.parseInt(mm), Integer.parseInt(ss));\n return calendarInstance;\n } catch (Exception e) {\n throw new Exception(\"SetCalendar : \" + e.toString());\n }\n }", "public static Date changeTimezoneToLocal(Date date, String srcTimezone) {\n return changeTimezone(date, DateTimeZone.forID(srcTimezone), DateTimeZone.getDefault());\n }", "public static String asString (Date date, TimeZone timezone) {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE, MM MMM yyyy HH:mm:ss z\");\n \n StringBuffer buffer = new StringBuffer();\n \n formatter.format( date, buffer, new FieldPosition( DateFormat.TIMEZONE_FIELD ) );\n \n return buffer.toString();\n }", "public static Calendar toCalendar(final String iso8601string) throws ParseException {\n // TODO: move this method to DateUtils\n Calendar calendar = GregorianCalendar.getInstance();\n String s = iso8601string.replace(\"Z\", \"+00:00\");\n try {\n s = s.substring(0, 22) + s.substring(23);\n } catch (IndexOutOfBoundsException e) {\n // throw new org.apache.http.ParseException();\n e.printStackTrace();\n }\n\n Date date = null;\n try {\n date = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ssZ\").parse(s);\n } catch (java.text.ParseException e) {\n e.printStackTrace();\n }\n calendar.setTime(date);\n return calendar;\n }", "public CalendarUtils(Calendar baseCalendar) {\r\n\t\tthis(baseCalendar.getTime(), baseCalendar.getTimeZone());\r\n\t}", "public Calendar startOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE));\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public static CalendarDate getCalendarDateFromFixedDate(long fixedDate) {\n\tint year = getYear(fixedDate);\n\tint pday = (int)(fixedDate - getFixedDate(year, JANUARY, 1));\n\tint corr = 2;\n\tlong mar1 = getFixedDate(year, MARCH, 1);\n\tif (fixedDate < mar1) {\n\t corr = 0;\n\t} else if (fixedDate >= mar1 && isLeapYear(year)) {\n\t corr = 1;\n\t}\n\tint month = floorDivide((12 * (pday + corr) + 373), 367) - 1;\n\tint day = (int)(fixedDate - getFixedDate(year, month, 1) + 1);\n\tint dow = getDayOfWeekFromFixedDate(fixedDate);\n\tCalendarDate cdate = new CalendarDate(year, month, day);\n\tcdate.setDayOfWeek(dow);\n\treturn cdate;\n }", "public native final Calendar timeZone(String val) /*-{\n\t\tthis[\"timeZone\"] = val;\n\t\treturn this;\n\t}-*/;", "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public void setTimeZone(TimeZone timeZone)\n {\n this.timeZone = timeZone;\n }", "public static Calendar getCurrentTime(String argGMT) {\r\n\t\treturn DateToCalendar(getTime(argGMT));\r\n\t}", "private XMLGregorianCalendar convertDateIntoXmlDate(Date date) {\n\n GregorianCalendar cal = new GregorianCalendar();\n cal.setTime(date);\n XMLGregorianCalendar xmlCalendar = null;\n try {\n xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(cal);\n } catch (DatatypeConfigurationException e) {\n e.printStackTrace();\n }\n return xmlCalendar;\n }", "public static Calendar monthOfYear(Date referenceDate, int month, TimeZone timeZone) {\t\t\r\n\t\tCalendar c1 = Calendar.getInstance(timeZone);\r\n\t\tc1.setTime(referenceDate);\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(timeZone);\r\n\t\tc2.clear();\r\n\t\t\r\n\t\t// Adjust for Java 0 based months.\r\n\t\tc2.set(c1.get(Calendar.YEAR), month - 1, 1);\r\n\t\t\r\n\t\treturn c2;\r\n\t}", "public abstract boolean inDaylightTime(java.util.Date date);", "public static String formatDateWithTimezone(Date date, String zone) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss z\");\n sdf.setTimeZone(TimeZone.getTimeZone(zone));\n return sdf.format(date);\n }", "public void setTimeZone(TimeZone zone) {\n/* 438 */ ParamChecks.nullNotPermitted(zone, \"zone\");\n/* 439 */ this.timeZone = zone;\n/* 440 */ setStandardTickUnits(createStandardDateTickUnits(zone, this.locale));\n/* 441 */ fireChangeEvent();\n/* */ }", "public static Date toDate(Object obj) {\n return toDate(obj, (String) null, (TimeZone) null);\n }", "public static java.sql.Date toSqlDate(Object obj, TimeZone timeZone) {\n return toSqlDate(obj, (String) null, timeZone);\n }", "public static XMLGregorianCalendar toXMLGregorianCalendar(Date date){\n GregorianCalendar gCalendar = new GregorianCalendar();\n gCalendar.setTime(date);\n XMLGregorianCalendar xmlCalendar = null;\n try {\n xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gCalendar);\n } catch (DatatypeConfigurationException ex) {\n ex.printStackTrace();\n }\n return xmlCalendar;\n }", "public Entry(Calendar date){\n this.date = date; \n }", "public void setTimeZone(TimeZone tmz)\n {\n this.timeZone = tmz; // may be null\n }", "public static GregorianCalendar stringToCalendar(String fecha,\n String formato){\n GregorianCalendar gc = new GregorianCalendar();\n try {\n fecha = nullToBlank(fecha);\n SimpleDateFormat df = new SimpleDateFormat(formato);\n gc.setTime(df.parse(fecha));\n } catch (Exception e) {\n e.printStackTrace();\n }\n return gc;\n }", "public static TS valueOf(final Date date, final int precision) {\n\t\tif (date == null) {\n\t\t\treturn TSnull.NI;\n\t\t} else {\n\t\t\treturn new TSjuDateAdapter(date.getTime(), precision);\n\t\t}\n\t}", "private Calendar parseCalendar(String dateString,String dateFormat) throws ParseException {\n\t\tif (dateString != null && dateString.length() > 0) {\n SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);\n sdf.set2DigitYearStart((new GregorianCalendar(1950,01,01)).getTime());\n sdf.setLenient(false);\n\t\t GregorianCalendar cal = new GregorianCalendar();\n\t\t cal.setTime(sdf.parse(dateString.trim()));\n return cal;\n\t\t}\n return null;\n\t}", "public static Date setDateHours(Date date, int hours, TimeZone timeZone, Locale locale) {\r\n\t\tCalendar cal = getCalendar(null, locale);\r\n\t\tcal.setTime(date);\r\n\t\tif (timeZone != null)\r\n\t\t\tcal.setTimeZone(timeZone);\r\n\t\tcal.set(Calendar.HOUR_OF_DAY, hours);\r\n\t\treturn cal.getTime();\r\n\t}", "public static Date changeTimezoneFromLocal(Date date, String resultTimezone) {\n return changeTimezone(date, DateTimeZone.getDefault(), DateTimeZone.forID(resultTimezone));\n }", "public TimeZone() { throw new RuntimeException(\"Stub!\"); }", "@Override\n public Clock withZone(ZoneId zone) {\n return new MutableClockStub(instant, zone);\n }", "protected static java.sql.Date getConvertedDate(java.util.Date date) {\n\t\tif (date == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn new java.sql.Date(date.getTime());\n\t\t}\n\t}", "public static java.sql.Date toSqlDate(Object obj, String pattern, TimeZone timeZone) {\n if (obj == null) {\n return null;\n }\n if (obj instanceof java.sql.Date) {\n final java.sql.Date resultDate;\n final java.sql.Date paramSqlDate = (java.sql.Date) obj;\n if (java.sql.Date.class.equals(paramSqlDate.getClass())) { // pure SQL-date\n resultDate = paramSqlDate;\n } else { // sub class\n // because the SQL-date type is not final class.\n resultDate = new java.sql.Date(paramSqlDate.getTime());\n }\n clearDateTimeParts(resultDate);\n return resultDate;\n }\n final Date date;\n try {\n date = toDate(obj, pattern, timeZone);\n } catch (ParseDateNumberFormatException e) {\n String msg = \"Failed to format the time as number:\";\n msg = msg + \" obj=\" + obj + \" pattern=\" + pattern;\n throw new ParseSqlDateNumberFormatException(msg, e);\n } catch (ParseDateOutOfCalendarException e) {\n String msg = \"The SQL-date expression is out of calendar:\";\n msg = msg + \" obj=\" + obj + \" pattern=\" + pattern;\n throw new ParseSqlDateOutOfCalendarException(msg, e);\n } catch (ParseDateException e) {\n String msg = \"Failed to parse the object to SQL-date:\";\n msg = msg + \" obj=\" + obj + \" pattern=\" + pattern;\n throw new ParseSqlDateException(msg, e);\n }\n if (date != null) {\n clearDateTimeParts(date);\n return new java.sql.Date(date.getTime());\n }\n return null;\n }", "public Calendar getCurrentMonthCalendarObj() throws Throwable{\r\n\r\n\t\tString dateInput = \"01/\"+month+\"/\"+year;\t\t\t\r\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MMMM/yyyy\");\r\n\t\tDate startDate = df.parse(dateInput);\r\n\t\tCalendar c = Calendar.getInstance(); // this takes current date\r\n\t c.setTime(startDate); // set date to specified in arguement\r\n\t\treturn c;\r\n\t}", "public Calendar getDataCell(Object cellObject, Class<?> objectType, ISheetSession<?, ?> session) throws SpreadsheetConverterException {\n\t\tHSSFCell cell = (HSSFCell) cellObject;\n\t\tCalendar instance = Calendar.getInstance();\n\t\tinstance.setTime(cell.getDateCellValue());\n\t\treturn instance;\n\t}", "public java.util.Date toDate() {\n return toCalendar().getTime();\n }", "abstract public ZonedDateTime getZonedDateTime(String zoneString);", "public static TS valueOf(String time) {\n\t\tif (time != null) {\n\t\t\ttime = time.trim();\n\t\t}\n\t\tif (time == null || time.equals(\"\")) {\n\t\t\treturn TSnull.NA;\n\t\t}\n\t\t//return new TSjuDateAdapter(parseDate(time).getTime(), time.length());\n\n\t\tfinal Calendar c = Calendar.getInstance();\n\t\tint precision = time.indexOf('+'), field, i = 0, zoneOffset;\n\t\tfinal int realLen = time.length();\n\t\tboolean hasTimezone = false;\n\t\tc.clear();\n\t\tif (precision < 0) {\n\t\t\tprecision = time.indexOf('-');\n\t\t\tif (precision < 0) {\n\t\t\t\tprecision = realLen;\n\t\t\t} else {\n\t\t\t\ti = -1;\n\t\t\t}\n\t\t} else {\n\t\t\ti = 1;\n\t\t}\n\t\tif (i != 0) {\n\t\t\tif ((realLen - precision) % 2 == 0) {\n\t\t\t\tthrow new RuntimeException(\"not a valid date: \" + time);\n\t\t\t}\n\t\t\tzoneOffset = MILLIS_PER_HOUR * parseInt(time, precision + 1, precision + 3);\n\t\t\tif (precision + 3 < realLen) {\n\t\t\t\tzoneOffset += (MILLIS_PER_MINUTE * parseInt(time, precision + 3, precision + 5));\n\t\t\t}\n\t\t\tzoneOffset *= i;\n\t\t\tc.set(Calendar.ZONE_OFFSET, zoneOffset);\n\t\t\thasTimezone = true;\n\t\t}\n\t\tif (precision < 4 || (precision < 14 && precision % 2 == 1)) {\n\t\t\tthrow new RuntimeException(\"not a valid date: \" + time);\n\t\t}\n\t\tc.set(Calendar.YEAR, parseInt(time, 0, 4));\n\t\tif (precision >= 6) {\n\t\t\tc.set(Calendar.MONTH, parseInt(time, 4, 6) - 1);\n\t\t\tif (precision >= 8) {\n\t\t\t\tc.set(Calendar.DAY_OF_MONTH, parseInt(time, 6, 8));\n\t\t\t\tif (precision >= 10) {\n\t\t\t\t\tc.set(Calendar.HOUR_OF_DAY, parseInt(time, 8, 10));\n\t\t\t\t\tif (precision >= 12) {\n\t\t\t\t\t\tc.set(Calendar.MINUTE, parseInt(time, 10, 12));\n\t\t\t\t\t\tif (precision >= 14) {\n\t\t\t\t\t\t\tc.set(Calendar.SECOND, parseInt(time, 12, 14));\n\t\t\t\t\t\t\tif (precision >= 16) {\n\t\t\t\t\t\t\t\tfield = parseInt(time, 15, precision);\n\t\t\t\t\t\t\t\tfor (i = precision; i < 18; i++)\n\t\t\t\t\t\t\t\t{\tfield = field * 10;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfor (i = precision; i > 18; i--)\n\t\t\t\t\t\t\t\t{\tfield = field / 10;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tc.set(Calendar.MILLISECOND, field);\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\tif (time.indexOf('.') >= 0) {\n\t\t\tprecision--;\n\t\t}\n\t\treturn new TSjuDateAdapter(c, precision, hasTimezone);\n\t}", "public static String convertDate(String inputdate, String fromtimezone, String totimezone)\n\n {\n String sDateinto = \"\";\n try {\n SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT);\n\n String dateInString = inputdate.substring(0, 22) ;\n\n formatter.setTimeZone(TimeZone.getTimeZone(fromtimezone));\n Date date = formatter.parse(dateInString);\n Log.i(\"FromDate String : \", formatter.format(date));\n\n\n SimpleDateFormat totime = new SimpleDateFormat(DATE_FORMAT);\n //TimeZone tzlocaltime = TimeZone.getDefault();\n totime.setTimeZone(TimeZone.getTimeZone(totimezone));\n\n sDateinto = totime.format(date); // Convert to String first\n Date dateInTo = formatter.parse(sDateinto); // Create a new Date object\n\n // Log.i(\"ToDate String: \", sDateinto);\n Log.i(\"ToDate Object: \", formatter.format(dateInTo));\n return sDateinto ;\n }\n catch (ParseException e)\n {\n Log.i(\"Date Conversion\" ,\"Error in parsing\" );\n return \"Date parsing error\" ;\n }\n\n }", "public Calendar() {\n }", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "public String getUTCTime(String timeZone, Calendar cal);", "protected static java.util.Date getConvertedDate(java.sql.Date date) {\n\t\tif (date == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn new java.util.Date(date.getTime());\n\t\t}\n\t}", "public static String getTimeZoneDateTime(Date date)\n\t{\n\t\treturn getFormatString(date, getTimeZoneDateTimeFormat());\n\t}", "public void setDate(java.util.Calendar date) {\n this.date = date;\n }", "public void setDate(java.util.Calendar date) {\n this.date = date;\n }", "public DateCalendar(Date date, String title, boolean active) {\n this.date = date;\n this.title = title;\n this.active = active;\n }", "public Calendar getCalendar() {\n Calendar c = Calendar.getInstance();\n c.setTime(cal.getTime());\n return c;\n }", "private Date calendarToDate(Calendar calendar) {\n return (Date) calendar.getTime();\n }", "public Calendar dayOfWeek(\r\n\t\t\tDayOfWeek dayOfWeek) {\r\n\t\t\r\n\t\tint day = dayOfWeek.getDayNumber();\r\n\t\t\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(\r\n\t\t\t\tbaseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH), \r\n\t\t\t\tbaseCalendar.get(Calendar.DAY_OF_MONTH));\r\n\t\t\r\n\t\tint offset = day - isoDayOfWeek(baseCalendar.get(Calendar.DAY_OF_WEEK));\r\n\t\t\r\n\t\tc2.add(Calendar.DATE, offset);\r\n\t\t\r\n\t\treturn c2;\r\n\t}" ]
[ "0.6681059", "0.63693357", "0.62740546", "0.6227283", "0.61687285", "0.5940857", "0.5853451", "0.57477254", "0.5683162", "0.55808973", "0.5513425", "0.5513425", "0.5507418", "0.5491386", "0.54206175", "0.53062457", "0.5289632", "0.5188174", "0.50769156", "0.50287575", "0.501344", "0.49944377", "0.49452513", "0.4921136", "0.49198547", "0.48366463", "0.4835665", "0.48051998", "0.4798464", "0.47528967", "0.4749405", "0.47226402", "0.47033212", "0.4616344", "0.459004", "0.4547437", "0.45247766", "0.44888356", "0.44780144", "0.44749257", "0.4472593", "0.44555628", "0.44499174", "0.4445655", "0.44037294", "0.437019", "0.43673477", "0.43593544", "0.435784", "0.43511096", "0.43355066", "0.43305495", "0.43245342", "0.43149114", "0.43090478", "0.4280837", "0.42749453", "0.42729077", "0.42692178", "0.4265654", "0.42631978", "0.42631876", "0.4259642", "0.42523554", "0.42345685", "0.4215321", "0.41978854", "0.41848388", "0.41551626", "0.41524047", "0.41175988", "0.41119072", "0.4086563", "0.4077409", "0.40648296", "0.40626898", "0.40553516", "0.4054588", "0.40538463", "0.40459195", "0.40414762", "0.40388197", "0.40338817", "0.40226674", "0.40203747", "0.40146843", "0.4008314", "0.40019208", "0.40001628", "0.3991807", "0.39912337", "0.39834788", "0.39826098", "0.39819142", "0.39724538", "0.39724538", "0.3971636", "0.3970263", "0.39689934", "0.3953597" ]
0.6596035
1
Sets the hours, min and seconds of the provided Calendar without changing the day or time zone
public static Calendar setCalendarTime(Calendar cal, int hrs, int min, int sec) { cal.set(Calendar.HOUR_OF_DAY, hrs); cal.set(Calendar.MINUTE, min); cal.set(Calendar.SECOND, sec); cal.set(Calendar.MILLISECOND, 0); return cal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "void setStartTime(java.util.Calendar startTime);", "public void setCal(Calendar cal) {\n\t\tthis.year = (short) cal.get(Calendar.YEAR);\r\n\t\tthis.month = (byte) (cal.get(Calendar.MONTH)+1);\r\n\t\tthis.day = (byte) cal.get(Calendar.DAY_OF_MONTH);\r\n\t\tthis.hh = (byte) cal.get(Calendar.HOUR_OF_DAY);\r\n\t\tthis.mm = (byte) cal.get(Calendar.MINUTE);\r\n\t\tthis.ss = (byte) cal.get(Calendar.SECOND);\r\n\t}", "private int[] setTimePicker(Calendar calendar) {\n int hour = calendar.get(Calendar.HOUR_OF_DAY);\n int minute = calendar.get(Calendar.MINUTE);\n\n timePicker.setHour(hour);\n timePicker.setMinute(minute);\n\n return new int[]{hour, minute};\n }", "public static Calendar removeTime(Calendar calendar){\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar;\n }", "public static void updateCalendar() {\n time = Calendar.getInstance();\n hour = time.get(Calendar.HOUR_OF_DAY);\n minute = time.get(Calendar.MINUTE);\n day = time.get(Calendar.DAY_OF_MONTH);\n month = time.get(Calendar.MONTH) + 1; \n year = time.get(Calendar.YEAR);\n\n }", "public void setFechaSolicitud(java.util.Calendar param){\n \n this.localFechaSolicitud=param;\n \n\n }", "public void setCalendar(VCalendar calendar) {\n this.calendar = calendar;\n }", "public void setStart( Calendar start );", "void setTime(int index, Time value, Calendar cal)\n throws SQLException;", "public void setDateTime(java.util.Calendar param) {\n this.localDateTime = param;\n }", "public CalendarUtils(Calendar baseCalendar) {\r\n\t\tthis(baseCalendar.getTime(), baseCalendar.getTimeZone());\r\n\t}", "public void setDay(Calendar cal) {\n this.cal = (Calendar) cal.clone();\n }", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "public void setupCalendar() { \n\t\tcal = whenIsIt();\n\t\tLocale here = Locale.US;\n\t\tthisMonth = cal.getDisplayName(2, Calendar.LONG_STANDALONE, here);\n\t\tdate = cal.get(5); //lesson learned: if it's a number do this\n\t\t//ADD CODE FOR ORDINALS HERE\n\t\tyear = cal.get(1);\n\t\tthisHour = cal.get(10);\n\t\tthisMinute = cal.get(12);\n\t\tthisSecond = cal.get(13);\n\t\tamPm = cal.getDisplayName(9, Calendar.SHORT, here);\n\t\tthisDay = thisMonth +\" \"+ addOrdinal(date) + \", \" + year;\n\t\tcurrentTime = fix.format(thisHour) + \":\" + fix.format(thisMinute) + \":\" + fix.format(thisSecond) + \" \" + amPm;\n\t}", "public static void setEndOfDay(Calendar calendar) {\r\n\t\tcalendar.add(Calendar.DATE, 1);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\tcalendar.set(Calendar.MILLISECOND, 0);\r\n\t}", "public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) {\r\n Calendar usaCal = Calendar.getInstance(tz);\r\n usaCal.clear();\r\n usaCal.set(year, month, day, hrs, min, secs);\r\n return usaCal;\r\n }", "public PickDateTime(Calendar cal) {\n\t\tjbInit();\n\t}", "public void setCalendar (jkt.hrms.masters.business.MstrCalendar calendar) {\n\t\tthis.calendar = calendar;\n\t}", "public void setFechaFacturado(java.util.Calendar param){\n \n this.localFechaFacturado=param;\n \n\n }", "public void setMeetingCal(final BwCalendar val) {\n meetingCal = val;\n }", "private void set(Calendar mCalendar) {\n\n //get the values from the calendar\n\n int date = mCalendar.get(Calendar.DATE);\n int month = mCalendar.get(Calendar.MONTH);\n int year = mCalendar.get(Calendar.YEAR);\n\n //update the textViews\n mTextDate.setText(date+\"\");\n mTextYear.setText(year+\"\");\n\n //use the formatter to display the month as Jan\n mTextMonth.setText(mFormatter.format(mCalendar.getTime()));\n\n\n }", "public void setProvisionTime(java.util.Calendar param){\n localProvisionTimeTracker = true;\n \n this.localProvisionTime=param;\n \n\n }", "public void setTodayCalendar()\n {\n this.currentCalendar = Calendar.getInstance();\n }", "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public void setDateAndTime(int d,int m,int y,int h,int n,int s);", "public void setStartTime(Calendar startTime) {\r\n\t\tthis.startTime = startTime;\r\n\t}", "public static void setTime(){\n\t\tCalendar cal = Calendar.getInstance();\n\t\tif (!JsonUtils.RUNNING_LOCALLY){\n\t\t\tcal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 4); //account for UTC offset because of lambda\n\t\t}\n\t\tCURRENT_TIME = formatTime(cal.getTime().toString());\n\t}", "public void onSet(Calendar calendarSelected, Date dateSelected, int year,\n String monthFullName, String monthShortName, int monthNumber,\n int date, String weekDayFullName, String weekDayShortName,\n int hour24, int hour12, int min, int sec, String AM_PM) {\n\n }", "public ClockTime(Calendar d) {\n super(Property.CLOCKTIME_PROPERTY);\n calValue = Calendar.getInstance();\n calValue.setTimeInMillis(d.getTimeInMillis());\n normalize();\n }", "void setCalendarId(Long calendarId);", "public DateTime(Calendar c) {\n setCharacteristic(null);\n if (c == null) {\n setCharacteristic(null);\n setYear(YEAR_IS_NOT_KNOWN);\n setMonth(MONTH_IS_NOT_KNOWN);\n setDay(DAY_OF_MONTH_IS_NOT_KNOWN);\n setHours(0);\n setMinutes(0);\n setSeconds(0);\n } else {\n setYear(c.get(Calendar.YEAR));\n setMonth(c.get(Calendar.MONTH) + 1);\n setDay(c.get(Calendar.DAY_OF_MONTH));\n setHours(c.get(Calendar.HOUR_OF_DAY));\n setMinutes(c.get(Calendar.MINUTE));\n setSeconds(c.get(Calendar.SECOND));\n }\n }", "public void setRequestedTime(java.util.Calendar requestedTime)\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(REQUESTEDTIME$2, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(REQUESTEDTIME$2);\n }\n target.setCalendarValue(requestedTime);\n }\n }", "@Override\n public void onTimeSet(TimePicker timePicker, int hourOfDay, int minute) {\n\n Log.d(TAG, calendar.getSelectedDate().getDay() + \"\");\n Log.d(TAG, new CalendarDay().getDay() + \"\");\n\n mCalendar.set(Calendar.YEAR, calendar.getSelectedDate().getYear());\n mCalendar.set(Calendar.MONTH, calendar.getSelectedDate().getMonth());\n mCalendar.set(Calendar.DAY_OF_MONTH, calendar.getSelectedDate().getDay());\n mCalendar.set(Calendar.HOUR_OF_DAY, hourOfDay /*+ (calendar.getSelectedDate().getDay() - new CalendarDay().getDay()) * 24*/);\n mCalendar.set(Calendar.MINUTE, minute);\n mCalendar.set(Calendar.SECOND, 0);\n\n String time = DateFormat.getTimeInstance(DateFormat.SHORT).format(mCalendar.getTime());\n dateReminder.setText(time);\n Log.d(\"MainActivity\", \"Selected time is \" + time);\n timeInMillis = mCalendar.getTimeInMillis();\n }", "public JCalendar() {\r\n init();\r\n resetToDefaults();\r\n }", "public void setTime ( final Calendar time ) {\n this.time = time;\n }", "void setTimestamp(int index, Timestamp value, Calendar cal)\n throws SQLException;", "public void setTime(){\n \tDatabaseManager.getDBM().setLockedTime(cal); \n }", "public native final Calendar timeZone(String val) /*-{\n\t\tthis[\"timeZone\"] = val;\n\t\treturn this;\n\t}-*/;", "Calendar getCalendar();", "private void setShiftValues(YFCElement calenderInEle) throws ParseException {\n\t\tString startTime=timeFormatter(calenderInEle.getAttribute(XMLLiterals.SHIFT_START_TIME));\n\t\tString endTime=timeFormatter(calenderInEle.getAttribute(XMLLiterals.SHIFT_END_TIME));\n\t\tString hashKey=startTime+\"-\"+endTime;\n\t\tif(!map.containsKey(hashKey))\n\t\t{\n\t\t\tmap.put(hashKey, hashKey);\n\t\t}\n\t}", "public void setTime(int mins, int sec){\r\n this.Minutes = mins;\r\n this.Seconds = sec;\r\n }", "public void setActivationTime(java.util.Calendar param){\n localActivationTimeTracker = true;\n \n this.localActivationTime=param;\n \n\n }", "private void resetCalendarToMonth(Calendar calendar) {\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, 1);\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\n\t\tcalendar.set(Calendar.MINUTE, 0);\n\t\tcalendar.set(Calendar.SECOND, 0);\n\t\tcalendar.set(Calendar.MILLISECOND, 0);\n\t}", "public Date getUTCDate(String timeZone, Calendar cal);", "abstract GregorianCalendar getThreadLocalCalendar();", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "public static Calendar deepCopyCalendar(Calendar cal) {\r\n Calendar result = null;\r\n if (null != cal) {\r\n Calendar newCal = Calendar.getInstance(cal.getTimeZone());\r\n newCal.clear();\r\n newCal.set(Calendar.YEAR, cal.get(Calendar.YEAR));\r\n newCal.set(Calendar.MONTH, cal.get(Calendar.MONTH));\r\n newCal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH));\r\n newCal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY));\r\n newCal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE));\r\n newCal.set(Calendar.SECOND, cal.get(Calendar.SECOND));\r\n newCal.set(Calendar.MILLISECOND, cal.get(Calendar.MILLISECOND));\r\n result = newCal;\r\n }\r\n return result;\r\n }", "public Clock()\n {\n hour = 11;\n min = 28;\n sec = 12;\n }", "public void setExpiryTime(java.util.Calendar param){\n localExpiryTimeTracker = true;\n \n this.localExpiryTime=param;\n \n\n }", "private void updateStartTime() {\n Date date = startTimeCalendar.getTime();\n String startTime = new SimpleDateFormat(\"HH:mm\").format(date);\n startHourText.setText(startTime);\n }", "void setEndTime(java.util.Calendar endTime);", "public void setDateTime(@NonNull final Calendar date) {\n onView(viewMatcher).perform(click());\n onView(withClassName(equalTo(DatePicker.class.getName())))\n .perform(PickerActions.setDate(date.get(Calendar.YEAR), date.get(Calendar.MONTH) + 1, date.get(Calendar.DAY_OF_MONTH)));\n new Dialog().confirmDialog();\n onView(withClassName(equalTo(TimePicker.class.getName())))\n .perform(PickerActions.setTime(date.get(Calendar.HOUR_OF_DAY), date.get(Calendar.MINUTE)));\n new Dialog().confirmDialog();\n }", "private Calendar formatCalendar(Calendar calendar){\n calendar.set(\n calendar.get(Calendar.YEAR),\n calendar.get(Calendar.MONTH),\n calendar.get(Calendar.DAY_OF_MONTH),\n 0,\n 0,\n 0\n );\n return calendar;\n }", "private void setCurrentDay() {\n Calendar c = Calendar.getInstance();\n\n year = c.get(Calendar.YEAR);\n month = c.get(Calendar.MONTH);\n day = c.get(Calendar.DAY_OF_MONTH);\n hour = c.get(Calendar.HOUR_OF_DAY);\n minute = c.get(Calendar.MINUTE);\n }", "@Override\n public void sendCalendar(long timeInMillis) {\n this.timeInMillis = timeInMillis;\n if (timeInMillis > 0) {\n String timeText = \"Time set for \" + ConstantUtil.getCurrentDateTime(timeInMillis);\n tvTimeInfo.setText(timeText);\n } else {\n tvTimeInfo.setText(\"\");\n }\n }", "public String getUTCTime(String timeZone, Calendar cal);", "private void getIntialCalender() {\n\n\t\ttry {\n\n\t\t\tc = Calendar.getInstance();\n\t\t\tString[] fields = Global_variable.str_booking_date.split(\"[-]\");\n\n\t\t\tString str_year = fields[0];\n\t\t\tString str_month = fields[1];\n\t\t\tString str_day = fields[2];\n\n\t\t\tSystem.out.println(\"!!!!\" + fields[0]);\n\t\t\tSystem.out.println(\"!!!!\" + fields[1]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields[2]);\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tyear = Integer.parseInt(str_year);\n\t\t\t} else {\n\t\t\t\tyear = c.get(Calendar.YEAR);\n\t\t\t}\n\n\t\t\tif (str_month.length() != 0) {\n\t\t\t\tmonth = Integer.parseInt(str_month) - 1;\n\t\t\t} else {\n\t\t\t\tmonth = c.get(Calendar.MONTH);\n\t\t\t}\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tday = Integer.parseInt(str_day);\n\t\t\t} else {\n\t\t\t\tday = c.get(Calendar.DAY_OF_MONTH);\n\t\t\t}\n\n\t\t\tString[] fields1 = Global_variable.str_booking_time.split(\"[:]\");\n\n\t\t\tString str_hour = fields1[0];\n\t\t\tString str_minutes = fields1[1];\n\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[0]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[1]);\n\n\t\t\tif (str_hour.length() != 0) {\n\t\t\t\thour = Integer.parseInt(str_hour);\n\t\t\t} else {\n\t\t\t\thour = c.get(Calendar.HOUR_OF_DAY);\n\t\t\t}\n\n\t\t\tif (str_minutes.length() != 0) {\n\t\t\t\tminutes = Integer.parseInt(str_minutes);\n\t\t\t} else {\n\t\t\t\tminutes = c.get(Calendar.MINUTE);\n\t\t\t}\n\n\t\t\tcurrDate = new java.sql.Date(System.currentTimeMillis());\n\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\tCalendar c1 = Calendar.getInstance();\n\t\t\tc1.setTime(new Date()); // Now use today date.\n\t\t\tc1.add(Calendar.DATE, 30); // Adding 30 days\n\t\t\toutput = sdf.format(c1.getTime());\n\t\t\tSystem.out.println(\"!!!!!!!!!!!!!!!\" + output);\n\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public abstract void setStartTime(Date startTime);", "public Calendar() {\n\t\tthis(() -> LocalDateTime.now());\n\t}", "public void setTime(DateTime inputTime){\n time = inputTime.getMillis();\n timeZone = inputTime.getZone();\n }", "public void initializeTime() {\n hour = cal.get(Calendar.HOUR);\n min = cal.get(Calendar.MINUTE);\n\n time = (EditText) findViewById(R.id.textSetTime);\n time.setInputType(InputType.TYPE_NULL);\n\n //Set EditText text to be current time\n if(min < 10) {\n time.setText(hour + \":0\" + min);\n } else {\n time.setText(hour + \":\" + min);\n }\n\n time.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n picker = new TimePickerDialog(ControlCenterActivity.this, new TimePickerDialog.OnTimeSetListener() {\n @Override\n public void onTimeSet(TimePicker timePicker, int i, int i1) {\n if(i1 < 10) {\n time.setText(i + \":0\" + i1);\n } else {\n time.setText(i + \":\" + i1);\n }\n }\n }, hour, min, false);\n\n picker.show();\n }\n });\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t7Hour7 = hourOfDay1;\n t7Minute7 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t7Hour7, t7Minute7);\n //set selected time on text view\n\n\n timeS4 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editSTime4.setText(timeS4);\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t6Hour6 = hourOfDay1;\n t6Minute6 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t6Hour6, t6Minute6);\n //set selected time on text view\n\n\n timeE3 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editETime3.setText(timeE3);\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay, int minute) {\n Calendar calendar = Calendar.getInstance();\n calendar.set(Calendar.HOUR_OF_DAY, hourOfDay);\n calendar.set(Calendar.MINUTE, minute - 2);\n calendar.set(Calendar.SECOND, 0);\n\n startAlarm(calendar);\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t11Hour11 = hourOfDay1;\n t11Minute11 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t11Hour11, t11Minute11);\n //set selected time on text view\n\n\n timeS6 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editSTime6.setText(timeS6);\n }", "@Override\n public void onTimeSet(RadialPickerLayout view, int hourOfDay, int minute, int second) {\n String time = Integer.toString(hourOfDay) + \"-\" + Integer.toString(minute);\n txtTime.setText(time);\n\n //TODO why get wrong time?\n calendar.set(Calendar.HOUR, hourOfDay);\n calendar.set(Calendar.MINUTE, minute);\n\n }", "public void applyToSchedule(Schedule sched) {\n String repeat = m_repeatCombo.getSelectedItem().toString();\n for (Schedule.Repeat r : Schedule.Repeat.values()) {\n if (r.toString().equals(repeat)) {\n sched.setRepeatUnit(r);\n break;\n }\n }\n if (m_intervalField.getText() != null\n && m_intervalField.getText().length() > 0) {\n sched.setRepeatValue(Integer.parseInt(m_intervalField.getText()));\n } else if (sched.getRepeatUnit() == Schedule.Repeat.MINUTES\n || sched.getRepeatUnit() == Schedule.Repeat.HOURS\n || sched.getRepeatUnit() == Schedule.Repeat.DAYS) {\n // set a default value of 5\n sched.setRepeatValue(5);\n m_intervalField.setText(\"5\");\n }\n\n java.util.List<Integer> dow = new java.util.ArrayList<Integer>();\n if (m_sunCheck.isSelected()) {\n dow.add(Calendar.SUNDAY);\n }\n if (m_monCheck.isSelected()) {\n dow.add(Calendar.MONDAY);\n }\n if (m_tueCheck.isSelected()) {\n dow.add(Calendar.TUESDAY);\n }\n if (m_wedCheck.isSelected()) {\n dow.add(Calendar.WEDNESDAY);\n }\n if (m_thuCheck.isSelected()) {\n dow.add(Calendar.THURSDAY);\n }\n if (m_friCheck.isSelected()) {\n dow.add(Calendar.FRIDAY);\n }\n if (m_satCheck.isSelected()) {\n dow.add(Calendar.SATURDAY);\n }\n sched.setDayOfTheWeek(dow);\n\n if (sched.getRepeatUnit() == Schedule.Repeat.MONTHLY) {\n if (m_dayYearNumBut.isSelected()) {\n if (m_dayYearNumField.getText() != null\n && m_dayYearNumField.getText().length() > 0) {\n sched.setDayOfTheMonth(Integer.parseInt(m_dayYearNumField.getText()));\n }\n } else {\n for (Schedule.OccurrenceWithinMonth o : Schedule.OccurrenceWithinMonth\n .values()) {\n if (o.equals(m_occurrenceInMonth.getSelectedItem().toString())) {\n sched.setOccurrenceWithinMonth(o);\n break;\n }\n }\n }\n }\n\n if (sched.getRepeatUnit() == Schedule.Repeat.YEARLY) {\n if (m_dayYearNumBut.isSelected()) {\n if (m_dayYearNumField.getText() != null\n && m_dayYearNumField.getText().length() > 0) {\n sched\n .setRepeatValue(Integer.parseInt(m_dayYearNumField.getText()));\n }\n } else {\n for (Schedule.OccurrenceWithinMonth o : Schedule.OccurrenceWithinMonth\n .values()) {\n if (o.equals(m_occurrenceInMonth.getSelectedItem().toString())) {\n sched.setOccurrenceWithinMonth(o);\n break;\n }\n }\n // day of the week is already set\n\n sched.setMonthOfTheYear(m_month.getSelectedIndex());\n }\n }\n }", "public Calendar() {\n }", "public void setDate(java.util.Calendar value) {\r\n\t\tBase.set(this.model, this.getResource(), DATE, value);\r\n\t}", "java.util.Calendar getStartTime();", "void setLastrun(java.util.Calendar lastrun);", "public static Calendar convertToExchCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar exchCal = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n exchCal.clear();\r\n exchCal.setTimeInMillis(timeInMillis);\r\n return exchCal;\r\n }", "public void setCalendarMm(Integer calendarMm) {\r\n this.calendarMm = calendarMm;\r\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t1Hour1 = hourOfDay1;\n t1Minute1 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t1Hour1, t1Minute1);\n //set selected time on text view\n\n\n timeS1 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editSTime1.setText(timeS1);\n }", "protected static boolean isUTC(Calendar calendar) {\n return calendar.getTimeZone().getID().equals(\"UTC\");\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t23Hour23 = hourOfDay1;\n t23Minute23 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t23Hour23, t23Minute23);\n //set selected time on text view\n\n\n timeS12 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editSTime12.setText(timeS12);\n }", "@Override\n\tpublic void setStartTime(int t) {\n\t\t\n\t}", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t15Hour15 = hourOfDay1;\n t15Minute15 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t15Hour15, t15Minute15);\n //set selected time on text view\n\n\n timeS8 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editSTime8.setText(timeS8);\n }", "public void setStartTime(long value) {\r\n this.startTime = value;\r\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t12Hour12 = hourOfDay1;\n t12Minute12 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t12Hour12, t12Minute12);\n //set selected time on text view\n\n\n timeE6 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editETime6.setText(timeE6);\n }", "public void setStartTime(long ts) {\n\t\tthis.startTime = ts;\t\t\n\t}", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t8Hour8 = hourOfDay1;\n t8Minute8 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t8Hour8, t8Minute8);\n //set selected time on text view\n\n\n timeE4 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editETime4.setText(timeE4);\n }", "void setNextrun(java.util.Calendar nextrun);", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t27Hour27 = hourOfDay1;\n t27Minute27 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t27Hour27, t27Minute27);\n //set selected time on text view\n\n\n timeS14 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editSTime14.setText(timeS14);\n }", "private LocalTime getLocalTime(Calendar calendar) {\n return LocalTime.of(calendar.get(Calendar.HOUR_OF_DAY),\n calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND),\n calendar.get(Calendar.MILLISECOND));\n }", "public final void setSchedule(java.util.Date schedule)\n\t{\n\t\tsetSchedule(getContext(), schedule);\n\t}", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t9Hour9 = hourOfDay1;\n t9Minute9 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t9Hour9, t9Minute9);\n //set selected time on text view\n\n\n timeS5 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editSTime5.setText(timeS5);\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t5Hour5 = hourOfDay1;\n t5Minute5 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t5Hour5, t5Minute5);\n //set selected time on text view\n\n\n timeS3 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editSTime3.setText(timeS3);\n }", "public ClockTime(String s, String subtype) {\n super(Property.CLOCKTIME_PROPERTY,subtype);\n\n\n Date value = null;\n\n try {\n StringTokenizer tokens = new StringTokenizer(s, \":\");\n if (tokens.countTokens() == 1) {\n if (s.startsWith(\"24\")) {\n s = \"00\" + s.substring(2);\n }\n if (s.startsWith(\"00\")) {\n s = s.substring(2);\n if (s == null || s.equals(\"\"))\n s = \"00\";\n if (!s.equals(\"00\") && Integer.parseInt(s) >= 60) {\n calValue = null;\n return;\n //throw new Exception(\"Invalid clocktime: \" + s);\n }\n try {\n value = dfMedium.get().parse(\"00:\" + s + \":00\");\n }\n catch (Exception e) {\n calValue = null;\n return;\n }\n calValue = Calendar.getInstance();\n calValue.setTime(value);\n normalize();\n return;\n }\n if (s.length() > 0 && s.charAt(0) == '0')\n s = s.substring(1);\n int h = Integer.parseInt(s);\n if (h >= 0 && h <= 9)\n s = \"0\" + s + \":00:00\";\n else if (h < 24)\n s = s + \":00:00\";\n else if (h >= 100 && h <= 959) {\n int hh = Integer.parseInt(s.substring(0, 1));\n int mm = Integer.parseInt(s.substring(1, 3));\n if (mm >= 60) {\n calValue = null;\n return;\n //throw new Exception(\"Invalid clocktime: \" + s);\n }\n s = \"0\" + hh + \":\" + mm + \":00\";\n }\n else if (h >= 1000 && h <= 2359) {\n int hh = Integer.parseInt(s.substring(0, 2));\n int mm = Integer.parseInt(s.substring(2, 4));\n if (hh >= 24) {\n calValue = null;\n return;\n //throw new Exception(\"Invalid clocktime: \" + s);\n }\n if (mm >= 60) {\n calValue = null;\n return;\n //throw new Exception(\"Invalid clocktime: \" + s);\n }\n s = hh + \":\" + mm + \":00\";\n }\n else {\n calValue = null;\n return;\n //throw new Exception(\"Invalid clocktime: \" + s);\n }\n }\n else\n if (tokens.countTokens() == 2) {\n s += \":00\";\n }\n try {\n value = dfMedium.get().parse(s);\n calValue = Calendar.getInstance();\n calValue.setTime(value);\n normalize();\n if (getSubType(\"showseconds\") != null && getSubType(\"showseconds\").equalsIgnoreCase(\"false\")) {\n \tsetShortFormat(true);\n }\n }\n catch (Exception e) {\n //throw new Exception(e);\n calValue = null;\n }\n } catch (Throwable e1) {\n calValue = null;\n }\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t33Hour33 = hourOfDay1;\n t33Minute33 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t33Hour33, t33Minute33);\n //set selected time on text view\n\n\n timeS17 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editSTime17.setText(timeS17);\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t3Hour3 = hourOfDay1;\n t3Minute3 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t3Hour3, t3Minute3);\n //set selected time on text view\n\n\n timeS2 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editSTime2.setText(timeS2);\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t24Hour24 = hourOfDay1;\n t24Minute24 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t24Hour24, t24Minute24);\n //set selected time on text view\n\n\n timeE12 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editETime12.setText(timeE12);\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t32Hour32 = hourOfDay1;\n t32Minute32 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t32Hour32, t32Minute32);\n //set selected time on text view\n\n\n timeE16 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editETime16.setText(timeE16);\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t45Hour45 = hourOfDay1;\n t45Minute45 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t45Hour45, t45Minute45);\n //set selected time on text view\n\n\n timeS23 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editSTime23.setText(timeS23);\n }", "public static Calendar convertToLondonCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar gmtCal = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/London\"));\r\n gmtCal.clear();\r\n gmtCal.setTimeInMillis(timeInMillis);\r\n return gmtCal;\r\n }", "Calendar getTimeStamp();", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay1, int minute1) {\n\n t29Hour29 = hourOfDay1;\n t29Minute29 = minute1;\n\n Calendar calendar = Calendar.getInstance();\n\n //set hour and minute\n calendar.set(0, 0, 0, t29Hour29, t29Minute29);\n //set selected time on text view\n\n\n timeS15 = String.valueOf((DateFormat.format(\"hh:mm aa\", calendar)));\n editSTime15.setText(timeS15);\n }" ]
[ "0.6650087", "0.6530117", "0.6530117", "0.6348958", "0.63063955", "0.6195569", "0.6173385", "0.60649776", "0.5895946", "0.5872052", "0.58673644", "0.57670313", "0.5740679", "0.5728947", "0.5705342", "0.56926495", "0.5690507", "0.5673012", "0.56614685", "0.5644076", "0.56264186", "0.5621112", "0.5618657", "0.5596963", "0.5578443", "0.54864925", "0.5483971", "0.5475246", "0.54588926", "0.5451471", "0.5444351", "0.5394647", "0.534837", "0.5323663", "0.53069484", "0.5303469", "0.527568", "0.5256129", "0.524471", "0.52378863", "0.52357394", "0.52317625", "0.52305245", "0.522141", "0.52131313", "0.52058357", "0.51804", "0.51526815", "0.51515037", "0.51411647", "0.50982165", "0.5068092", "0.50565666", "0.50282896", "0.50110465", "0.50088394", "0.5007119", "0.500006", "0.49957258", "0.49957064", "0.49744973", "0.49664274", "0.49659142", "0.49585226", "0.4947189", "0.49462643", "0.49448812", "0.49366504", "0.4932482", "0.49271256", "0.4921211", "0.4920254", "0.49200982", "0.4910558", "0.49072972", "0.49018994", "0.4899634", "0.48936152", "0.488812", "0.4885962", "0.4878576", "0.48721355", "0.48714682", "0.48621333", "0.4854886", "0.48518598", "0.4851034", "0.4848903", "0.4846359", "0.48437515", "0.4839692", "0.48383585", "0.48375088", "0.48355004", "0.48354372", "0.483478", "0.4824104", "0.48238403", "0.48209703", "0.48180282" ]
0.6681006
0
Creates a new Calendar object initialised with the values provided
public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) { Calendar usaCal = Calendar.getInstance(tz); usaCal.clear(); usaCal.set(year, month, day, hrs, min, secs); return usaCal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Calendar() {\n }", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "public Calendar() {\n initComponents();\n }", "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public Calendar() {\n\t\tthis(() -> LocalDateTime.now());\n\t}", "public JCalendar() {\r\n init();\r\n resetToDefaults();\r\n }", "Calendar getCalendar();", "private Calendar createNewCalendar(String dateAndTime) {\n // initiate a calendar\n Calendar calendar = Calendar.getInstance();\n // take the given dateandTime string and split it into the different values\n String date = dateAndTime.split(\" \")[0];\n String time = dateAndTime.split(\" \")[1];\n int year = Integer.valueOf(date.split(\"-\")[0]);\n int month = Integer.valueOf(date.split(\"-\")[1]) - 1;\n int day = Integer.valueOf(date.split(\"-\")[2]);\n int hour = Integer.valueOf(time.split(\":\")[0]);\n int min = Integer.valueOf(time.split(\":\")[1]);\n // set the calendar to the wanted values\n calendar.set(year, month, day, hour, min);\n return calendar;\n }", "private static Calendar createCalendar(int year, int month, int date) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setLenient(false);\r\n\t\tcalendar.set(Calendar.YEAR, year);\r\n\t\tcalendar.set(Calendar.MONTH, month - 1);\r\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, date);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\treturn calendar;\r\n\t}", "public void setupCalendar() { \n\t\tcal = whenIsIt();\n\t\tLocale here = Locale.US;\n\t\tthisMonth = cal.getDisplayName(2, Calendar.LONG_STANDALONE, here);\n\t\tdate = cal.get(5); //lesson learned: if it's a number do this\n\t\t//ADD CODE FOR ORDINALS HERE\n\t\tyear = cal.get(1);\n\t\tthisHour = cal.get(10);\n\t\tthisMinute = cal.get(12);\n\t\tthisSecond = cal.get(13);\n\t\tamPm = cal.getDisplayName(9, Calendar.SHORT, here);\n\t\tthisDay = thisMonth +\" \"+ addOrdinal(date) + \", \" + year;\n\t\tcurrentTime = fix.format(thisHour) + \":\" + fix.format(thisMinute) + \":\" + fix.format(thisSecond) + \" \" + amPm;\n\t}", "public Calendar (String name) {\n this.calendarName = name;\n this.events = new ArrayList<>();\n this.alerts = new ArrayList<>();\n }", "public CalendarUtils(Calendar baseCalendar) {\r\n\t\tthis(baseCalendar.getTime(), baseCalendar.getTimeZone());\r\n\t}", "private QaCalendar() {\n }", "Calendar toCalendar();", "Calendar toCalendar();", "public Calendar() throws RemoteException {\n\t\tthis.sentinel = -1;\n\t\tthis.sentinelC = -1;\n\t\tthis.ownerTracker = 0;\n\t\tthis.chatClients = new ArrayList<RemCalendar>();\n\t\tthis.loggedIn = new ArrayList<>();\n\t}", "public Entry(Calendar date){\n this.date = date; \n }", "RollingCalendar()\r\n\t{\r\n\t\tsuper();\r\n\t}", "public static void createArrayOfCalendars()\n {\n GregorianCalendar[] calendars = new GregorianCalendar[12];\n \n /*\n * At this point, every element in the array has a value of\n * null.\n */\n for(GregorianCalendar calendar : calendars)\n {\n System.out.println(calendar);\n }\n \n /*\n * Create a new calendar object and assign to each element\n * in the array.\n */\n for(int i = 0; i < calendars.length; i++)\n {\n calendars[i] = new GregorianCalendar(2018, i + 1, 1); // year, month, day\n }\n \n for(GregorianCalendar calendar : calendars)\n {\n System.out.println(calendar);\n }\n \n /*\n * An enahnced for loop cannot modify the value of the \n * elements in the array (e.g., references to calendars),\n * but we can call mutator methods which modify the\n * properties of the referenced objects (e.g., day\n * of the month).\n */\n for(GregorianCalendar calendar : calendars)\n {\n calendar.add(GregorianCalendar.DAY_OF_MONTH, 2);\n }\n \n for(GregorianCalendar calendar : calendars)\n {\n System.out.println(calendar);\n }\n }", "public CalendarBasi()\n {\n dia = new DisplayDosDigitos(31);\n mes = new DisplayDosDigitos(13);\n anio = new DisplayDosDigitos(100);\n }", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute) {\r\n\t\tCalendar calendar = createCalendar(year, month, date);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, hour);\r\n\t\tcalendar.set(Calendar.MINUTE, minute);\r\n\t\treturn calendar;\r\n\t}", "public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static process.proxies.UU95_CalendarSetting initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject)\r\n\t{\r\n\t\treturn new process.proxies.UU95_CalendarSetting(context, mendixObject);\r\n\t}", "public static void createArrayOfCalendars() {\n\n GregorianCalendar[] calendars = new GregorianCalendar[12];\n\n /*\n\n At this point, every element in the array has a value of null.\n\n */\n\n for (GregorianCalendar calendar : calendars) {\n System.out.println(calendar);\n }\n \n /*\n * Create a new calendar object and assign it to each element in the array. \n * \n */\n \n for (int i = 0; i < calendars.length; i++) {\n calendars[i] = new GregorianCalendar(2021, i + 1, 1);\n }\n \n for (GregorianCalendar calendar : calendars) {\n System.out.println(calendar);\n }\n \n /*\n * An enhanced for loop cannot modify the values of the elements in the array (.g., references to calendars), but we can call \n * mutator methods which midify the properties fo the referenced objects (e.g., day of the month).\n */\n \n for (GregorianCalendar calendar : calendars) {\n calendar.add(GregorianCalendar.DAY_OF_MONTH, 2);\n }\n \n for (GregorianCalendar calendar : calendars) {\n System.out.println(calendar);\n }\n }", "ForwardingCalendar(CalendarImplementation cal) {\n this.cal = cal;\n }", "public Value(int year, int month, int day) {\n\n // Construct the Calendar\n _calendar = Calendar.getInstance();\n _calendar.set(year, month - 1, day);\n }", "@Test\n public void getterCalendar(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n Assert.assertEquals(2018,calendar.getYear());\n Assert.assertEquals(4,calendar.getMonth());\n Assert.assertEquals(25,calendar.getDayOfMonth());\n }", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public Calendar toCalendar() {\n\t\treturn (Calendar) _cal.clone();\n\t}", "public static final Calendar getCalendar(int date, int month, int year) {\r\n\t\tCalendar cal = Calendar.getInstance(); // locale-specific\r\n\t\t// cal.setTime(dateObject);\r\n\t\tcal.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcal.set(Calendar.MINUTE, 0);\r\n\t\tcal.set(Calendar.SECOND, 0);\r\n\t\tcal.set(Calendar.MILLISECOND, 0);\r\n\r\n\t\tcal.set(Calendar.DATE, date);\r\n\t\tcal.set(Calendar.MONTH, month);\r\n\t\tcal.set(Calendar.YEAR, year);\r\n\t\treturn cal;\r\n\t}", "public CourseCalendar(List<Course> courses, String pattern, boolean recurring, boolean rounded) {\n this.mClasses = courses;\n this.mPattern = pattern;\n this.mRecurring = recurring;\n this.mRounded = rounded;\n }", "public MyCalendarModel() {\n\t\tcalendarToEvent = new TreeMap<Calendar, TreeSet<Event>>();\n\t}", "public static Date createDate(int yyyy, int month, int day) {\n/* 75 */ CALENDAR.clear();\n/* 76 */ CALENDAR.set(yyyy, month - 1, day);\n/* 77 */ return CALENDAR.getTime();\n/* */ }", "public DateTime(Calendar c) {\n setCharacteristic(null);\n if (c == null) {\n setCharacteristic(null);\n setYear(YEAR_IS_NOT_KNOWN);\n setMonth(MONTH_IS_NOT_KNOWN);\n setDay(DAY_OF_MONTH_IS_NOT_KNOWN);\n setHours(0);\n setMinutes(0);\n setSeconds(0);\n } else {\n setYear(c.get(Calendar.YEAR));\n setMonth(c.get(Calendar.MONTH) + 1);\n setDay(c.get(Calendar.DAY_OF_MONTH));\n setHours(c.get(Calendar.HOUR_OF_DAY));\n setMinutes(c.get(Calendar.MINUTE));\n setSeconds(c.get(Calendar.SECOND));\n }\n }", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "private CalendarModel() {\n events = new ArrayList<>();\n }", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute, int second) {\r\n\t\tCalendar calendar = createCalendar(year, month, date, hour, minute);\r\n\t\tcalendar.set(Calendar.SECOND, second);\r\n\t\treturn calendar;\r\n\t}", "public static Calendar getCalender(Long val) {\n\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(val);\n\n return calendar;\n }", "public MyDate(int inYear, int inDay, int inMonth)\n {\n year = inYear;\n day = inDay;\n month = inMonth;\n }", "public static Date createDate(int yyyy, int month, int day, int hour, int min) {\n/* 93 */ CALENDAR.clear();\n/* 94 */ CALENDAR.set(yyyy, month - 1, day, hour, min);\n/* 95 */ return CALENDAR.getTime();\n/* */ }", "public CourseCalendar(List<Course> courses) {\n this(courses, \"C-TY\", true, false);\n }", "public void initCalendarFirst() {\n getCurrentDate();\n mCalendar.setOnDateChangedListener(new OnDateSelectedListener() {\n @Override\n public void onDateSelected(@NonNull MaterialCalendarView widget, @NonNull CalendarDay select, boolean selected) {\n mSelectedDate = select.toString();\n String string[] = mSelectedDate.split(\"\\\\{|\\\\}\");\n String s = string[1]; //2017-8-14\n String string1[] = s.split(\"-\");\n int tempMonth = Integer.parseInt(string1[1]);\n String month = Integer.toString(tempMonth + 1);\n mDate1 = string1[0] + \"-\" + month + \"-\" + string1[2];\n }\n });\n }", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public MyCalender() {\n initComponents();\n }", "public void setStart( Calendar start );", "public Appointment()\r\n {\r\n // cView = new CalendarEventView(\"appointmentView\");\r\n }", "public BwCalendar getCalendar() {\n if (calendar == null) {\n calendar = new BwCalendar();\n }\n\n return calendar;\n }", "private static Calendar getService() throws GeneralSecurityException, IOException {\n final NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();\n return new Calendar.Builder(HTTP_TRANSPORT, JSON_FACTORY, getCredentials(HTTP_TRANSPORT))\n .setApplicationName(APPLICATION_NAME).build();\n }", "private void makeLocalCalendar() {\n\t\t// TODO Auto-generated method stub\n\t\tContentValues values = new ContentValues();\n\t\tvalues.put(Calendars.ACCOUNT_NAME, PATIENT_ACCOUNT_NAME);\n\t\tvalues.put(Calendars.ACCOUNT_TYPE, CalendarContract.ACCOUNT_TYPE_LOCAL);\n\t\tvalues.put(Calendars.NAME, PATIENT_NAME);\n\t\tvalues.put(Calendars.CALENDAR_DISPLAY_NAME, PATIENT_NAME);\n\t\tvalues.put(Calendars.CALENDAR_COLOR, Color.BLACK);\n\t\tvalues.put(Calendars.CALENDAR_ACCESS_LEVEL, Calendars.CAL_ACCESS_OWNER);\n\t\tvalues.put(Calendars.OWNER_ACCOUNT, PATIENT_EMAIL);\n\t\tvalues.put(Calendars.CALENDAR_TIME_ZONE, TimeZone.getAvailableIDs()\n\t\t\t\t.toString());\n\t\tvalues.put(Calendars.SYNC_EVENTS, 1);\n\n\t\tUri.Builder builder = CalendarContract.Calendars.CONTENT_URI\n\t\t\t\t.buildUpon();\n\t\tbuilder.appendQueryParameter(Calendars.ACCOUNT_NAME,\n\t\t\t\t\"com.grokkingandroid\");\n\t\tbuilder.appendQueryParameter(Calendars.ACCOUNT_TYPE,\n\t\t\t\tCalendarContract.ACCOUNT_TYPE_LOCAL);\n\t\tbuilder.appendQueryParameter(CalendarContract.CALLER_IS_SYNCADAPTER,\n\t\t\t\t\"true\");\n\n\t\tUri uri = getContentResolver().insert(builder.build(), values);\n\n\t}", "public VCalendar clone() {\n\t\treturn new VCalendar(this.content, this.collectionId, this.resourceId, this.earliestStart, this.latestEnd, null);\n\t}", "public CtrlCalendario(Calendario C) {\r\n\t\tcalendar = C;\r\n\t}", "public static CalendarFragment newInstance(Bundle extras) {\n CalendarFragment f = new CalendarFragment();\n //Arguments can and are accessed within a fragment. See onCreate();\n f.setArguments(extras);\n return f;\n }", "private Calendar setAssignmentDeadlineCalendar() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HHmm\");\n Date date = null;\n try {\n date = sdf.parse(assignmentDeadline);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n Calendar assignmentDeadlineCalendar = Calendar.getInstance();\n assignmentDeadlineCalendar.setTime(date);\n return assignmentDeadlineCalendar;\n }", "public ObjectFactoryModuleCalendar() {\n }", "public void createCalShift() {\n\t\tString yes = \"Y\";\n\t\tString effectiveToDate = getProperty(\"EFFECTIVE_TO_DATE\");\n\t\tString defShiftStartTime = getProperty(\"SHIFT_START_TIME\");\n\t\tString defShiftEndTime = getProperty(\"SHIFT_END_TIME\");\n\t\tYFCElement effectivePeriodsEle = docCreateCalenderInXml.getDocumentElement().getChildElement(XMLLiterals.EFFECTIVE_PERIODS);\n\t\tYFCElement effectivePeriodEle = effectivePeriodsEle.getChildElement(XMLLiterals.EFFECTIVE_PERIOD);\n\t\teffectivePeriodEle.setAttribute(XMLLiterals.EFFECTIVE_TO_DATE, effectiveToDate);\n\t\tYFCElement shiftEle=effectivePeriodEle.createChild(XMLLiterals.SHIFTS).createChild(XMLLiterals.SHIFT);\n\t\tshiftEle.setAttribute(XMLLiterals.WEDNESDAY_VALID,yes);\n\t\tshiftEle.setAttribute(XMLLiterals.TUESDAY_VALID,yes);\n\t\tshiftEle.setAttribute(XMLLiterals.THURSDAY_VALID,yes);\n\t\tshiftEle.setAttribute(XMLLiterals.SUNDAY_VALID,yes);\n\t\tshiftEle.setAttribute(XMLLiterals.SATURDAY_VALID,yes);\n\t\tshiftEle.setAttribute(XMLLiterals.MONDAY_VALID,yes);\n\t\tshiftEle.setAttribute(XMLLiterals.FRIDAY_VALID,yes);\n\t\tshiftEle.setAttribute(XMLLiterals.SHIFT_START_TIME,defShiftStartTime);\n\t\tshiftEle.setAttribute(XMLLiterals.SHIFT_END_TIME,defShiftEndTime);\n\t}", "@POST\n Response createCalendar(Calendar calendar);", "public static Calendar ahoraCalendar() {\n return Calendar.getInstance(TimeZone.getTimeZone(\"America/Guayaquil\"));\n }", "public Calendar GetCalendar(String sDateTime) throws Exception {\n String YYYY = \"\", MM = \"\", DD = \"\", hh = \"\", mm = \"\", ss = \"\";\n Calendar calendarInstance = null;\n try {\n //considering deafult date format as YYYY-MM-DD hh:mm:ss (e.g 2012-11-21 23:59:30)\n sDateTime = sDateTime.trim();\n if (sDateTime.equalsIgnoreCase(\"\")) {\n throw new Exception(\"Blank datetime value\");\n }\n\n YYYY = sDateTime.substring(0, 4);\n MM = sDateTime.substring(5, 7);\n DD = sDateTime.substring(8, 10);\n hh = sDateTime.substring(11, 13);\n mm = sDateTime.substring(14, 16);\n ss = sDateTime.substring(17, 19);\n MM = \"\" + (Integer.parseInt(MM) - 1);\n if (MM.length() < 2) {\n MM = \"0\" + MM;\n }\n\n calendarInstance = Calendar.getInstance();\n calendarInstance.set(Integer.parseInt(YYYY), Integer.parseInt(MM), Integer.parseInt(DD), Integer.parseInt(hh), Integer.parseInt(mm), Integer.parseInt(ss));\n return calendarInstance;\n } catch (Exception e) {\n throw new Exception(\"SetCalendar : \" + e.toString());\n }\n }", "@SuppressWarnings(\"deprecation\")\r\n\tprivate void createCalendarEntry(){\r\n\t\t\r\n\t\tUri calendars = Uri.parse(CALENDAR_URI);\r\n\t\t \r\n\t\tCursor managedCursor = managedQuery(calendars, projection, null, null, null);\r\n\t\tString calName = \"\"; \r\n\t\tString calId = \"\"; \r\n\t\tif (managedCursor.moveToFirst()) {\r\n\t\t\t \r\n\t\t\t int idColumn = managedCursor.getColumnIndex(projection[0]);\r\n\t\t\t int nameColumn = managedCursor.getColumnIndex(projection[1]); \r\n\t\t\t \r\n\t\t\t do {\r\n\t\t\t calName = managedCursor.getString(nameColumn);\r\n\t\t\t calId = managedCursor.getString(idColumn);\r\n\t\t\t if (calName.contains(\"gmail\"))\r\n\t\t\t \tbreak;\r\n\t\t\t } while (managedCursor.moveToNext());\r\n\t }\r\n\t\t\r\n\t\tlong start = System.currentTimeMillis() + 120000;\r\n\t\tlong duration = DURATION + start;\r\n\t\t\r\n\t\tContentValues values = new ContentValues();\r\n\t\tvalues.put(DATE_START, start);\r\n\t\tvalues.put(DATE_END, duration);\r\n\t\tvalues.put(EVENT_TITLE, ocrData.getMedicine().getMedicine());\r\n\t\tvalues.put(EVENT_DESCRIPTION, \"Take \" + ocrData.getPatient2Medicine().getFrequencyOfIntake() \r\n\t\t\t\t+ \" by \" + ocrData.getPatient2Medicine().getMode());\r\n\t\tvalues.put(CALENDAR_ID, calId);\r\n\t\tvalues.put(EVENT_RULE, \"FREQ=\" + ocrData.getPatient2Medicine().getFrequencyOfIntake() + \";\");\r\n\t\tvalues.put(HAS_ALARM, 1);\r\n\t\t\r\n\t\tContentResolver cr = getContentResolver();\r\n\t\tUri event = cr.insert(Uri.parse(EVENT_URI), values);\r\n\t\t\r\n\t\tvalues = new ContentValues();\r\n\t\tvalues.put(\"event_id\", Long.parseLong(event.getLastPathSegment()));\r\n\t\tvalues.put(\"method\", 1);\r\n\t\tvalues.put(\"minutes\", 10 );\r\n\t\tcr.insert(Uri.parse(REMINDER_URI), values);\r\n\t}", "public PickDateTime(Calendar cal) {\n\t\tjbInit();\n\t}", "public void createCalendar() throws Exception, IOException, ServiceException {\n // If true, the calendar already exists\n if (getDestinationCalendarUrl() != null) {\n return;\n }\n\n CalendarEntry calendar = new CalendarEntry();\n calendar.setTitle(new PlainTextConstruct(destinationCalendarName));\n// calendar.setSummary(new PlainTextConstruct(\"Lotus Notes Calendar\"));\n // Get this machine's current time zone when creating the new Google calendar\n TimeZone localTimeZone = TimeZone.getDefault();\n calendar.setTimeZone(new TimeZoneProperty(localTimeZone.getID()));\n \n calendar.setHidden(HiddenProperty.FALSE);\n calendar.setSelected(SelectedProperty.TRUE);\n calendar.setColor(new ColorProperty(COLOR));\n\n CalendarEntry returnedCalendar = service.insert(mainCalendarFeedUrl, calendar);\n returnedCalendar.update();\n\n // Get the feed url reference so that we can add events to the new calendar.\n destinationCalendarFeedUrl = new URL(returnedCalendar.getLink(\"alternate\", \"application/atom+xml\").getHref());\n\n return;\n }", "public MCalendarEventView()\r\n {\r\n }", "Schedule createSchedule();", "public Appointment(int id, Calendar calendar, String startDateTime, String endDateTime, String description, String location, Alarm alarm, User owner) { // TODO temp\n\t\tsuper(id, calendar, startDateTime, endDateTime, description, location, alarm);\n\t\tthis.owner = owner;\n\t}", "public EventsCalendarYear() {\n initYear();\n }", "public Schedule (Employee employee, Date startDate, Date endDate) {\n this.employee = employee;\n this.startDate = startDate;\n this.endDate = endDate;\n }", "public Appliction()\r\n {\r\n date=LocalDate.of(2020,1,1);//just a start point for the calendar\r\n Appliction p=new Appliction(date.getYear(),date.getMonthValue());\r\n }", "public CinemaDate() {\n }", "private static com.google.api.services.calendar.Calendar getCalendarService() throws IOException\n{\n Credential cred = authorize();\n com.google.api.services.calendar.Calendar.Builder bldr =\n new com.google.api.services.calendar.Calendar.Builder(HTTP_TRANSPORT,JSON_FACTORY,cred);\n bldr.setApplicationName(APPLICATION_NAME);\n\n com.google.api.services.calendar.Calendar cal = bldr.build();\n\n return cal;\n}", "public void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\t// Set up the application's user interface (content view)\n\t\tsetContentView(R.layout.main);\n\n\t\t// Make a new calendar\n\t\ttry {\n\t\t\tmakeLocalCalendar();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// determine the existing calendar in use\n\t\t// long calID = getExistingCalendarId();\n\t\t\n\t\t// create a local calendar\n\t\tlong calID = getLocalCalendarId();\n\n\t\tCalendar beginTime = Calendar.getInstance();\n\t\tbeginTime.set(2014, 10, 18, 0, 0); // start on 18th Oct 2014\n\t\tlong startMillis = beginTime.getTimeInMillis();\n\t\tCalendar endTime = Calendar.getInstance();\n\t\tendTime.set(2015, 10, 18, 0, 0); // end in a year\n\t\tlong endMillis = endTime.getTimeInMillis();\n\n\t\tlong eventID = insertRecurringEvent(calID, startMillis, endMillis);\n\n\t\tArrayList<String> recurringEvents = getRecurringEvents(eventID,\n\t\t\t\tstartMillis, endMillis);\n\n\t\tint length = recurringEvents.size();\n\n\t\t// now you can get recurring instances of this event from the event\n\t\t// table\n\t\t// ...\n\t\t\n\t\tsetTemporaryList();\n\n\t}", "public Watch(){ //Watch Constuctor\r\n super(); //Values passed in from the super class\r\n month = 1; //Initialize month to 1\r\n day = 1; //Initialize day to 1\r\n year = 1980; //Initialize year to 1980\r\n}", "public Calendar getCalendar() {\n Calendar c = Calendar.getInstance();\n c.setTime(cal.getTime());\n return c;\n }", "public WeekPanel(CalendarEx calendar) {\n initComponents();\n cal = calendar;\n startEndDay(CalendarEx.getCurrentDay(), CalendarEx.getCurrentMonth(), CalendarEx.getCurrentYear());\n //startDay = new CalendarDate(CalendarEx.getCurrentDay(), CalendarEx.getCurrentMonth(), CalendarEx.getCurrentYear());\n //endDay = new CalendarDate(CalendarEx.getCurrentDay() + 6, CalendarEx.getCurrentMonth(), CalendarEx.getCurrentYear());\n \n ListAppointMents();\n WeekLabel.setText(startDay.toString() + \" - \" + endDay.toString());\n }", "public Calendar calendario(Date date) {\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(date);\r\n return calendar;\r\n }", "public static HolidayCalendar[] calendarArray() {\n return new HolidayCalendar[] {TARGET };\n }", "public Calendar getCurrentMonthCalendarObj() throws Throwable{\r\n\r\n\t\tString dateInput = \"01/\"+month+\"/\"+year;\t\t\t\r\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MMMM/yyyy\");\r\n\t\tDate startDate = df.parse(dateInput);\r\n\t\tCalendar c = Calendar.getInstance(); // this takes current date\r\n\t c.setTime(startDate); // set date to specified in arguement\r\n\t\treturn c;\r\n\t}", "RollingCalendar(TimeZone tz, Locale locale)\r\n\t{\r\n\t\tsuper(tz, locale);\r\n\t}", "protected Calendar getCurrentCalendar() {\n Calendar current = new Calendar();\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n SimpleDateFormat dateFormatHour = new SimpleDateFormat(\"H\");\n SimpleDateFormat dateFormatWeekDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat dateFormatMonth = new SimpleDateFormat(\"MMM\");\n\n current.setHour(dateFormatHour.format(calendar.getTime()).toString());\n current.setWeekday(dateFormatWeekDay.format(calendar.getTime()));\n current.setMonth(dateFormatMonth.format(calendar.getTime()));\n\n return current;\n }", "public CalendarPage() {\n\t\t\n\t\tPageFactory.initElements(driver, this);\n\t}", "public OrgDay() {\n events = new LinkedList<>();\n }", "public Calendar getCalendar() {\n return cal;\n }", "public Appointment() {\r\n\t\t\t\r\n\t\t}", "public void setTodayCalendar()\n {\n this.currentCalendar = Calendar.getInstance();\n }", "public static Calendar deepCopyCalendar(Calendar cal) {\r\n Calendar result = null;\r\n if (null != cal) {\r\n Calendar newCal = Calendar.getInstance(cal.getTimeZone());\r\n newCal.clear();\r\n newCal.set(Calendar.YEAR, cal.get(Calendar.YEAR));\r\n newCal.set(Calendar.MONTH, cal.get(Calendar.MONTH));\r\n newCal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH));\r\n newCal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY));\r\n newCal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE));\r\n newCal.set(Calendar.SECOND, cal.get(Calendar.SECOND));\r\n newCal.set(Calendar.MILLISECOND, cal.get(Calendar.MILLISECOND));\r\n result = newCal;\r\n }\r\n return result;\r\n }", "public static Calendar m13184a() {\n Calendar instance = Calendar.getInstance();\n instance.set(11, 12);\n instance.set(12, C3792d.m14088c());\n instance.set(13, 0);\n return instance;\n }", "public void createCalendar(String calendarName, String description) {\n /*\n https://stackoverflow.com/questions/136419/get-integer-value-of-the-current-year-in-java\n */\n int year = Calendar.getInstance().get(Calendar.YEAR);\n Calendar_ newCalendar = new Calendar_(\n this.userId,\n CalendarTypeEnum.GREGORIAN_CALENDAR,\n year,\n calendarName,\n this.username,\n description\n );\n //add new calendar to the user's list of calendars\n calendarsOwned.add(newCalendar);\n }", "public CalendarioSilvia()\n {\n // initialise instance variables\n dia = new DisplayDosDigitos(31);\n mes = new DisplayDosDigitos(13);\n año = new DisplayDosDigitos(100);\n }", "public ScheduleExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "public YearPanel(CalendarEx calendar) {\n initComponents();\n cal = calendar;\n year = CalendarEx.getCurrentYear();\n \n ListAppointMents();\n }", "public Calendar setReservationDate(){\n\t\t\n\t\t\n\t\tint currentMonth = Calendar.getInstance().get(Calendar.MONTH)+1; //Month starts from zero in Java\n\t\tint currentYear = Calendar.getInstance().get(Calendar.YEAR);\n\t\tint currentDate = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n\t\tint currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);\n\t\tint currentMinute = Calendar.getInstance().get(Calendar.MINUTE);\n\t\t\n\t\t\n\t\tSystem.out.println(\"Current Year \"+ currentYear );\n\t\tSystem.out.println(\"Current Month \"+ currentMonth );\n\t\tSystem.out.println(\"Today's date \"+ currentDate );\n\t\tSystem.out.println(\"Current Hour \"+ currentHour );\n\t\tSystem.out.println(\"Current Minute \"+ currentMinute );\n\t\tSystem.out.println(\"\\t---\\t---\\t---\\t---\\t---\");\n\t\tint inputMonth, inputYear, inputDate, inputHour, inputMinute;\n\t\t\n\t\tCalendar reserveDate = Calendar.getInstance();\n\t\t\n\t\tSystem.out.print(\"Enter the year: \");\n\t\tinputYear = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputYear < currentYear){\n\t\t\tSystem.out.println(\"Old year entry is not allowed !\\n\");\n\t\t\tSystem.out.print(\"Enter the year: \");\n\t\t\tinputYear = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\t\n\t\treserveDate.set(Calendar.YEAR,inputYear); \n\t\n\t\tSystem.out.print(\"Enter the month: \");\n\t\tinputMonth = scan.nextInt();\t\n\t\tscan.nextLine();\n\t\t\n\t\twhile (inputMonth < 1 || inputMonth > 12){\n\t\t\tSystem.out.println(\"Invalid Month entry!\");\n\t\t\tSystem.out.print(\"Enter the month again: \");\n\t\t\tinputMonth = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputMonth < currentMonth) && (inputYear == currentYear)){\n\t\t\t\t\t\n\t\t\tSystem.out.println(\"Old month entry is not allowed !\\n\");\n\t\t\tSystem.out.print(\"Enter the month: \");\n\t\t\tinputMonth = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t\t\n\t\t}\n\t\treserveDate.set(Calendar.MONTH,inputMonth-1);//MONTH is from 0 to 11.\n\t\t\n\t\tSystem.out.print(\"Enter the date for reservation: \");\n\t\tinputDate = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputDate < 1 || inputDate > 31){\n\t\t\tSystem.out.println(\"Invalid date entry!\");\n\t\t\tSystem.out.print(\"Enter the date again: \");\n\t\t\tinputDate = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputDate < currentDate) && (inputMonth == currentMonth)&&(inputYear==currentYear)){\n\t\t\tSystem.out.println(\"Past Day is not allowed!\\n\");\n\t\t\tSystem.out.print(\"Enter the date for reservation: \");\n\t\t\tinputDate = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\treserveDate.set(Calendar.DAY_OF_MONTH,inputDate);\n\t\t\n\t\tSystem.out.print(\"Enter hour (24-hr format): \");\n\t\tinputHour = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputHour < 0 || inputHour > 23){\n\t\t\tSystem.out.println(\"Invalid hour entry!\");\n\t\t\tSystem.out.print(\"Enter the hour again: \");\n\t\t\tinputHour = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile(inputHour < currentHour && inputDate == currentDate&&inputMonth == currentMonth&&inputYear==currentYear){\n\t\t\t\n\t\t\tif (inputHour < 0 && inputHour > 23){\n\t\t\t\tSystem.out.println(\"Invalid Hour entry\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Past hour is not allowed!\\n\");\n\t\t\t\tSystem.out.print(\"Enter hour (24-hr format): \");\n\t\t\t\tinputHour = scan.nextInt();\n\t\t\t\tscan.nextLine();\n\t\t\t}\n\t\t}\n\t\treserveDate.set(Calendar.HOUR_OF_DAY,inputHour); //This uses 24 hour clock\n\t\t\n\t\tSystem.out.print(\"Enter minute: \");\n\t\tinputMinute = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile(inputMinute < 0 || inputMinute > 59){\n\t\t\tSystem.out.println(\"Invalid Minute entry\");\n\t\t\tSystem.out.print(\"Enter minute again: \");\n\t\t\tinputMinute = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputMinute-currentMinute) <= 0 && inputHour == currentHour){\n\t\t\t\n\t\t\t//System.out.println(\"Reservation can only be made 30 minutes earlier or invalid input !\");\n\t\t\tSystem.out.print(\"Invalid minute\");\n\t\t\tSystem.out.print(\"Enter minute again: \");\n\t\t\tinputMinute = scan.nextInt();\t\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\treserveDate.set(Calendar.MINUTE,inputMinute);\n\t\tSystem.out.println(\"Date Reserved!\");\n\t\treturn reserveDate;\n\t}", "public void get_fecha(){\n //Obtenemos la fecha\n Calendar c1 = Calendar.getInstance();\n fecha.setCalendar(c1);\n }", "public Calendario getCalendar(){\r\n\t\treturn calendar;\r\n\t}", "private void getIntialCalender() {\n\n\t\ttry {\n\n\t\t\tc = Calendar.getInstance();\n\t\t\tString[] fields = Global_variable.str_booking_date.split(\"[-]\");\n\n\t\t\tString str_year = fields[0];\n\t\t\tString str_month = fields[1];\n\t\t\tString str_day = fields[2];\n\n\t\t\tSystem.out.println(\"!!!!\" + fields[0]);\n\t\t\tSystem.out.println(\"!!!!\" + fields[1]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields[2]);\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tyear = Integer.parseInt(str_year);\n\t\t\t} else {\n\t\t\t\tyear = c.get(Calendar.YEAR);\n\t\t\t}\n\n\t\t\tif (str_month.length() != 0) {\n\t\t\t\tmonth = Integer.parseInt(str_month) - 1;\n\t\t\t} else {\n\t\t\t\tmonth = c.get(Calendar.MONTH);\n\t\t\t}\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tday = Integer.parseInt(str_day);\n\t\t\t} else {\n\t\t\t\tday = c.get(Calendar.DAY_OF_MONTH);\n\t\t\t}\n\n\t\t\tString[] fields1 = Global_variable.str_booking_time.split(\"[:]\");\n\n\t\t\tString str_hour = fields1[0];\n\t\t\tString str_minutes = fields1[1];\n\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[0]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[1]);\n\n\t\t\tif (str_hour.length() != 0) {\n\t\t\t\thour = Integer.parseInt(str_hour);\n\t\t\t} else {\n\t\t\t\thour = c.get(Calendar.HOUR_OF_DAY);\n\t\t\t}\n\n\t\t\tif (str_minutes.length() != 0) {\n\t\t\t\tminutes = Integer.parseInt(str_minutes);\n\t\t\t} else {\n\t\t\t\tminutes = c.get(Calendar.MINUTE);\n\t\t\t}\n\n\t\t\tcurrDate = new java.sql.Date(System.currentTimeMillis());\n\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\tCalendar c1 = Calendar.getInstance();\n\t\t\tc1.setTime(new Date()); // Now use today date.\n\t\t\tc1.add(Calendar.DATE, 30); // Adding 30 days\n\t\t\toutput = sdf.format(c1.getTime());\n\t\t\tSystem.out.println(\"!!!!!!!!!!!!!!!\" + output);\n\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public Object clone() {\n return new Value(_calendar);\n }", "public DateIn(int day, int month, int year){\n\tthis.day = day;\n\tthis.month = month;\n\tthis.year = year;\n\t}", "Calendar registeredAt();", "private void initList(LocalDate cal) {\n\t\tdays.add(\"Mo\");\n\t\tdays.add(\"Tu\");\n\t\tdays.add(\"We\");\n\t\tdays.add(\"Th\");\n\t\tdays.add(\"Fr\");\n\t\tdays.add(\"Sa\");\n\t\tdays.add(\"Su\");\n\t}", "@Test\n public void createScheduleEntry(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n }" ]
[ "0.7448413", "0.7186852", "0.71412903", "0.687614", "0.6855412", "0.6716634", "0.66925424", "0.6663102", "0.64941", "0.64889073", "0.641011", "0.63245237", "0.62352854", "0.622643", "0.61609566", "0.61609566", "0.6113396", "0.6102826", "0.60478544", "0.60441554", "0.60335", "0.5988075", "0.59761584", "0.5948631", "0.594808", "0.5921567", "0.5901362", "0.58586466", "0.5833588", "0.57934386", "0.57888365", "0.576839", "0.5752801", "0.5750686", "0.5729891", "0.57226014", "0.57189935", "0.5709071", "0.5680828", "0.567938", "0.56766933", "0.5633419", "0.5594946", "0.5593059", "0.5593059", "0.5589988", "0.5572232", "0.5561396", "0.55606806", "0.5531448", "0.55084264", "0.5508234", "0.54989356", "0.5496898", "0.5493465", "0.54730684", "0.54701614", "0.54689866", "0.5451015", "0.54491156", "0.5446112", "0.5440651", "0.5440618", "0.54402995", "0.5438097", "0.54241973", "0.542061", "0.5416535", "0.5407809", "0.5407381", "0.537413", "0.5365615", "0.53430974", "0.5331102", "0.5328893", "0.5311854", "0.5306171", "0.52835953", "0.5274562", "0.52708536", "0.52675956", "0.5263048", "0.5253229", "0.5249202", "0.5238557", "0.5236706", "0.52347684", "0.52013135", "0.51915026", "0.51877344", "0.5174931", "0.515916", "0.5153445", "0.515038", "0.51462966", "0.5142337", "0.5140128", "0.513844", "0.5135581", "0.51238793" ]
0.6448375
10
The Stockbroker requires dates to be provided in a certain format as a string. This function takes in any calendar and converts its date time to the format used by the stockbroker's API. WARNING the stockbrokers API documentation says that all date+time values should be in GMT (Greenwich Mean Time) but THIS IS NOT TRUE. In fact the time value needs to be expressed as London local time (That is Java's "Europe/London" time zone). Despite having to append GMT to the end of the string the actual time value is given for the "Europe/London" which MAY NOT BE GMT during British Summer Time
public static String convertCalToBrokerTime(Calendar cal) { String result = ""; Calendar gmtCal = DTUtil.convertToLondonCal(cal); SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd HH:mm:ss"); String timeFMString = format1.format(gmtCal.getTime()) + " GMT"; result = timeFMString; return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String convertDate(String dateString) {\n String date = null;\n\n try {\n //Parse the string into a date variable\n Date parsedDate = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\").parse(dateString);\n\n //Now reformat it using desired display pattern:\n date = new SimpleDateFormat(DATE_FORMAT).format(parsedDate);\n\n } catch (ParseException e) {\n Log.e(TAG, \"getDate: Error parsing date\", e);\n e.printStackTrace();\n }\n\n return date;\n }", "public static String convertDateToSend(String gotdate){\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(Long.parseLong(gotdate));\n SimpleDateFormat inputFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"dd MMM yyyy\");\n /*Date parsedDate = null;\n try {\n parsedDate = inputFormat.parse(gotdate);\n } catch (ParseException e) {\n e.printStackTrace();\n }*/\n String formattedDate = outputFormat.format(calendar.getTime());\n return formattedDate;\n }", "public static String convertDate(String inputdate, String fromtimezone, String totimezone)\n\n {\n String sDateinto = \"\";\n try {\n SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT);\n\n String dateInString = inputdate.substring(0, 22) ;\n\n formatter.setTimeZone(TimeZone.getTimeZone(fromtimezone));\n Date date = formatter.parse(dateInString);\n Log.i(\"FromDate String : \", formatter.format(date));\n\n\n SimpleDateFormat totime = new SimpleDateFormat(DATE_FORMAT);\n //TimeZone tzlocaltime = TimeZone.getDefault();\n totime.setTimeZone(TimeZone.getTimeZone(totimezone));\n\n sDateinto = totime.format(date); // Convert to String first\n Date dateInTo = formatter.parse(sDateinto); // Create a new Date object\n\n // Log.i(\"ToDate String: \", sDateinto);\n Log.i(\"ToDate Object: \", formatter.format(dateInTo));\n return sDateinto ;\n }\n catch (ParseException e)\n {\n Log.i(\"Date Conversion\" ,\"Error in parsing\" );\n return \"Date parsing error\" ;\n }\n\n }", "public String getDateFormated(Calendar objCalendar, String sDateFormat) throws Exception {\n SimpleDateFormat formatter = null;\n String sDate = \"\";\n String sDefaultDateFormat = \"yyyy:MM:dd HH:mm:ss\";\n try {\n if (sDateFormat == null) {\n sDateFormat = \"\";\n }\n sDateFormat = sDateFormat.trim();\n if (!sDateFormat.trim().equalsIgnoreCase(\"\")) {\n sDefaultDateFormat = sDateFormat;\n }\n\n formatter = new SimpleDateFormat(sDefaultDateFormat);\n sDate = formatter.format(objCalendar.getTime());\n sDate.trim();\n return sDate;\n } catch (Exception exp) {\n println(\"getCurrentDateTime : \" + exp.toString());\n throw exp;\n }\n }", "public static String convertDateToStandardFormat(String inComingDateformat, String date)\r\n\t{\r\n\t\tString cmName = \"DateFormatterManaager.convertDateToStandardFormat(String,String)\";\r\n\t\tString returnDate = \"\";\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif (date != null && !date.trim().equals(\"\"))\r\n\t\t\t{\r\n\t\t\t\tif (inComingDateformat != null && !inComingDateformat.trim().equals(\"\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(inComingDateformat);\r\n\t\t\t\t\tDate parsedDate = sdf.parse(date);\r\n\t\t\t\t\tSimpleDateFormat standardsdf = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\t\t\t\t\treturnDate = standardsdf.format(parsedDate);\r\n\t\t\t\t} else\r\n\t\t\t\t{\r\n\t\t\t\t\treturnDate = date;\r\n\t\t\t\t\tlogger.cterror(\"CTBAS00113\", cmName, date);\r\n\t\t\t\t}\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\tlogger.ctdebug(\"CTBAS00114\", cmName);\r\n\t\t\t}\r\n\t\t} catch (ParseException pe) // just in case any runtime exception occurred just return input datestr as it is\r\n\t\t{\r\n\t\t\treturnDate = date;\r\n\t\t\tlogger.cterror(\"CTBAS00115\", pe, cmName, date, inComingDateformat);\r\n\t\t}\r\n\t\treturn returnDate;\r\n\t}", "public static String formatDate(String strDate, boolean TimeOnly) {\n Date date = new Date();\n String finalDate = \"\";\n try {\n date = SDF_ISO_8601.parse(strDate);\n Calendar c = new GregorianCalendar(Locale.getDefault());\n TimeZone tzGMT = TimeZone.getTimeZone(\"GMT\");\n // c.setTimeZone(tzGMT);\n c.setTimeInMillis(date.getTime());\n\n if (IsDateToday(strDate)) {\n finalDate = String.format(\n \"Today at %02d:%02d %s\",\n c.get(Calendar.HOUR_OF_DAY) > 12 ? c\n .get(Calendar.HOUR_OF_DAY) % 12 : c\n .get(Calendar.HOUR_OF_DAY), c\n .get(Calendar.MINUTE),\n c.get(Calendar.AM_PM) == Calendar.AM ? \"AM\" : \"PM\");\n } else if (IsDateYesterday(strDate)) {\n finalDate = String.format(\n \"Yesterday at %02d:%02d%s\",\n c.get(Calendar.HOUR_OF_DAY) > 12 ? c\n .get(Calendar.HOUR_OF_DAY) % 12 : c\n .get(Calendar.HOUR_OF_DAY), c\n .get(Calendar.MINUTE),\n c.get(Calendar.AM_PM) == Calendar.AM ? \"AM\" : \"PM\");\n } else if (IsDateWithinThisWeek(strDate)) {\n finalDate = String.format(\n \"%s %02d:%02d %s\",\n DaysOfWeek[c.get(Calendar.DAY_OF_WEEK) - 1],\n c.get(Calendar.HOUR_OF_DAY) > 12 ? c\n .get(Calendar.HOUR_OF_DAY) % 12 : c\n .get(Calendar.HOUR_OF_DAY), c\n .get(Calendar.MINUTE),\n c.get(Calendar.AM_PM) == Calendar.AM ? \"AM\" : \"PM\");\n } else {\n finalDate = String.format(\n \"%s %s %s at %02d:%02d %s\",\n Months[c.get(Calendar.MONTH)],\n c.get(Calendar.DATE),\n c.get(Calendar.YEAR),\n c.get(Calendar.HOUR_OF_DAY) > 12 ? c\n .get(Calendar.HOUR_OF_DAY) % 12 : c\n .get(Calendar.HOUR_OF_DAY), c\n .get(Calendar.MINUTE),\n c.get(Calendar.AM_PM) == Calendar.AM ? \"AM\" : \"PM\");\n }\n } catch (ParseException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n return finalDate;\n\n }", "public static String convertDateAndTime(String inputString) {\n String trimmedInputString = inputString.trim();\n\n if (trimmedInputString.length() < 10) {\n return convertTime(inputString);\n } else {\n String dateString = trimmedInputString.substring(0, 10).trim();\n String timeString = trimmedInputString.substring(10).trim();\n try {\n String date = LocalDate.parse(dateString).format(DateTimeFormatter.ofPattern(\"d MMM yyyy\"));\n\n if (timeString.length() == 4) {\n return date + \" \" + convertTime(timeString);\n }\n\n return date + timeString;\n } catch (DateTimeParseException e) {\n return inputString;\n }\n }\n }", "public Date parse (String dateAsString , String dateFormat) throws Exception ;", "public static String getDate(String fromatstr) {\n\t\tString\ttoday=\"\";\n\t\t\n\t\tCalendar Datenow=Calendar.getInstance();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(fromatstr);\n\t today = formatter.format(Datenow.getTime());\n\n\t return today;\n\t}", "public static String dateToStringFormat(Calendar calendar, String format){\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);\n return simpleDateFormat.format(calendar.getTime());\n }", "String dateToCalendarString(TimeConverter converter, AbsoluteDate date);", "public String parseTimeToTimeDate(String time) {\n Date date = null;\n try {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\", Locale.getDefault());\n String todaysDate = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.getDefault()).format(new Date());\n date = simpleDateFormat.parse(todaysDate + \" \" + time);\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm dd,MMM\", Locale.getDefault());\n //sdf.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n return sdf.format(date);\n\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static void main(String[] args) throws ParseException { 2019-05-30T10:15:16.0Z\n // 2019-05-30T10:18:21\n // SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n // String str = \"2019-05-30 18:15:16\";\n // Date date = sdf.parse(str);\n //\n // DateFormat formatter = new SimpleDateFormat(DATE_FORMAT);\n // // Date date = Calendar.getInstance().getTime();\n // TimeZone srcTimeZone = TimeZone.getTimeZone(\"GMT+8\");\n // TimeZone destTimeZone = TimeZone.getTimeZone(\"GMT\");\n // System.out.println(DateTransformer.dateTransformBetweenTimeZone(date, formatter, srcTimeZone, destTimeZone));\n //\n\n }", "public Date createDate(String strDate){\n\n Date date = null;\n\n // Get time\n Calendar cal = Calendar.getInstance();\n Date currentLocalTime = cal.getTime();\n DateFormat dateformat = new SimpleDateFormat(\"HH:mm:ss\");\n String localTime = dateformat.format(currentLocalTime);\n\n // Concat strings\n String tmpDate = strDate + \" \" + localTime;\n //\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\n try {\n date = format.parse(tmpDate);\n\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n return date;\n }", "public static Date StringToDate(String dateString) {\n int y = new Integer(dateString.substring(0, 4));\n int m = new Integer(dateString.substring(4, 6));\n int d = new Integer(dateString.substring(6, 8));\n int h = new Integer(dateString.substring(8, 10));\n int min = new Integer(dateString.substring(10, 12));\n\n try {\n Calendar convCal = Calendar.getInstance();\n convCal.set(y, m - 1, d, h, min);\n Date date = convCal.getTime();\n\n return date;\n } catch (Exception ex) {\n System.out.println(\"BwInfo.convertStringToDate() \" + ex);\n return null;\n }\n\n }", "private String convertToDateFormat(String inputDateString) throws DateTimeParseException {\n\t\treturn inputDateString;\n\t}", "java.lang.String getToDate();", "@org.jetbrains.annotations.NotNull()\n public static final java.lang.String getFormattedDate(@org.jetbrains.annotations.NotNull()\n java.util.Calendar $this$getFormattedDate, @org.jetbrains.annotations.NotNull()\n java.lang.String format) {\n return null;\n }", "public static String fromDate(String s){\n \t\t\n \t\tString[] date = s.split(\"T\");\n \t\tString time = date[1].substring(0,5);\n \t\tString[] dates = date[0].split(\"-\"); \n \t\tString month = dates[1];\n \t\tString day = dates[2];\n \t\t\n \t\treturn day + \"/\" + month + \", kl: \" + time;\n \t}", "public static HISDate valueOf(String date, String format) throws HISDateException {\r\n HISDate ret = null;\r\n String datStr = date;\r\n String formatStr = format;\r\n if (datStr != null) {\r\n // Wir haben ein Datum gegeben...\r\n datStr = format(datStr);\r\n if (datStr.toUpperCase().equals(\"TODAY\") || datStr.toUpperCase().equals(\"NOW\") || datStr.toUpperCase().equals(\"CURRENT\")) {\r\n // Schlüsselwort für aktuelles Datum !!\r\n if (formatStr != null) {\r\n logger.debug(\"Unnötige Format-Angabe für TODAY!\");\r\n }\r\n // Hole aktuelles Datum:\r\n ret = HISDate.getToday();\r\n } else {\r\n // Kein Schlüsselwort für Datum...\r\n try {\r\n // Betrachte Formatangabe:\r\n if (formatStr == null) {\r\n // Kein Format gegeben.\r\n // Muss Format aus Datumswert erraten:\r\n formatStr = HISDate.guessFormat(datStr);\r\n } else {\r\n // Schlüsselworte ersetzen oder Format validieren:\r\n formatStr = HISDate.substKeysCheckFormat(formatStr);\r\n } // endif (Formatangabe nicht null)\r\n\r\n // Wenn wir bis hierhin kommen, haben wir eine\r\n // gültige Formatangabe in Grossschrift...\r\n\r\n // Versuche jetzt, die Werte zu holen:\r\n int y = -1;\r\n int m = -1;\r\n int d = -1;\r\n String sep = formatStr.substring(3);\r\n StringTokenizer datTokenizer = new StringTokenizer(datStr, sep);\r\n for (int i = 0; i < 3; i++) {\r\n char component = formatStr.charAt(i);\r\n if (!datTokenizer.hasMoreTokens()) {\r\n if (component == 'Y') {\r\n y = HISDate.getToday().getYear();\r\n break;\r\n }\r\n }\r\n String val = datTokenizer.nextToken();\r\n switch (component) {\r\n case 'D': {\r\n d = Integer.parseInt(val);\r\n break;\r\n }\r\n case 'M': {\r\n m = ArrayUtils.indexOf(MONTH_SHORT, val);\r\n if (m < 0) {\r\n m = Integer.parseInt(val);\r\n }\r\n break;\r\n }\r\n case 'Y': {\r\n int intVal = Integer.parseInt(val);\r\n if (val.length() == 2) {\r\n // Zweistellige Jahresangaben ergänzen:\r\n if (intVal < 50) {\r\n intVal += 2000; // 2000...2049\r\n } else {\r\n intVal += 1900; // 1950...1999\r\n }\r\n }\r\n y = intVal;\r\n break;\r\n }\r\n // Andere können wegen checkFormat() nicht mehr vorkommen...\r\n } // endswitch (aktuelle Datums-Komponente)\r\n } // endfor (drei Datumskomponenten)\r\n if (datTokenizer.hasMoreTokens()) {\r\n // Fehler, es gibt mehr als zwei Separatoren !!\r\n throw new HISException(datStr + \" ist ungültiger Datumswert. Ein Datum besteht nur aus drei Komponenten!\");\r\n }\r\n\r\n // Datums-Objekt erzeugen:\r\n ret = new HISDate(y, m, d);\r\n } catch (Exception ex) {\r\n throw new HISDateException(\"Fehler beim Erzeugen eines Datums-Objekts aus \" + datStr + \": \", ex);\r\n }\r\n }\r\n }\r\n return ret;\r\n }", "public static Date stringToDate(String date)\r\n/* 29: */ {\r\n/* 30: 39 */ log.debug(\"DateUtil.stringToDate()\");\r\n/* 31: */ try\r\n/* 32: */ {\r\n/* 33: 41 */ return sdfDate.parse(date);\r\n/* 34: */ }\r\n/* 35: */ catch (ParseException e)\r\n/* 36: */ {\r\n/* 37: 43 */ log.fatal(\"DateUtil.stringToDate抛出异常\", e);\r\n/* 38: */ }\r\n/* 39: 44 */ return new Date();\r\n/* 40: */ }", "private String formatDate(String dateStr) {\n try {\n SimpleDateFormat fmt = new SimpleDateFormat(Properties.DATE_FORMAT_ALL);\n Date date = fmt.parse(dateStr);\n SimpleDateFormat fmtOut = new SimpleDateFormat(Properties.DATE_FORMAT);\n return fmtOut.format(date);\n } catch (ParseException e) {\n System.out.println( Properties.K_WARNING + \" \" + e.getMessage());\n }\n return \"\";\n }", "public String getDateTime(Calendar cal, int GMT_OFFSET_SECONDS, String DATE_TIME_FORMAT) throws Exception {\n\n String sRetVal = \"\";\n String DefaultFormat = \"yyyyMMddHHmmss\";\n int GMT_OFFSET_DIFF = 0;\n try {\n\n //check for valid Calender values\n if (cal == null) {\n cal = Calendar.getInstance();\n }\n\n //check for valid FORMAT values\n if (DATE_TIME_FORMAT == null) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n if (DATE_TIME_FORMAT.trim().toUpperCase().equalsIgnoreCase(\"\")) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n\n //check GMT RAW OFF SET difference\n int CURR_GMT_OFFSET = TimeZone.getDefault().getRawOffset() / 1000;\n //in case Current GMT is GREATER THAN provided GMT\n if (CURR_GMT_OFFSET > GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n\n //in case Current GMT is SMALLER THAN provided GMT\n } else if (CURR_GMT_OFFSET < GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n }\n\n if (CURR_GMT_OFFSET == GMT_OFFSET_SECONDS) {\n GMT_OFFSET_DIFF = 0;\n }\n\n //setting calender datetime as per GMT\n cal.add(Calendar.SECOND, GMT_OFFSET_DIFF);\n\n //using SimpleDateFormat class\n sRetVal = new SimpleDateFormat(DATE_TIME_FORMAT).format(cal.getTime());\n return sRetVal;\n\n } catch (Exception e) {\n println(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n throw new Exception(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n } finally {\n }\n\n }", "public static Date stringToDate(String dateString) {\n for(String format: DATE_FORMATS){\n try {\n return new SimpleDateFormat(format).parse(dateString);\n }\n catch (Exception e){}\n }\n throw new IllegalArgumentException(\"Date is not parsable\");\n }", "private String dateFormat(String date) {\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\", Locale.ENGLISH);\n df.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n Date serverDate = null;\n String formattedDate = null;\n try {\n serverDate = df.parse(date);\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"MMM dd yyyy, hh:mm\");\n\n outputFormat.setTimeZone(TimeZone.getDefault());\n\n formattedDate = outputFormat.format(serverDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return formattedDate;\n }", "private static String convertDate(String date) {\n\t\tlong dateL = Long.valueOf(date);\n\t\tDate dateTo = new Date(dateL);\n\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n\t\tString formatted = format.format(dateTo);\n\t\tSystem.out.println(\"Date formatted: \" + formatted);\n\t\treturn formatted;\n\t}", "public static String convertDateFormat (String dateStr, String fromFormatPattern, String toFormatPattern) {\n\t\tDateFormat fromFormat = new SimpleDateFormat(fromFormatPattern);\n\t\tDateFormat toFormat = new SimpleDateFormat(toFormatPattern);\n\t\ttoFormat.setLenient(false);\n\t\tDate date;\n\t\ttry {\n\t\t\tdate = fromFormat.parse(dateStr);\n\t\t\treturn toFormat.format(date);\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.d(\"ERROR\", \"Date formatting Error\");\n\t\t}\n\t\treturn null;\n\t}", "private String formatDate(String dateString) {\n DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"LLL dd, yyyy\");\n LocalDate localDate = LocalDate.parse(dateString.substring(0, 10));\n return dateTimeFormatter.format(localDate);\n }", "public static Date stringToDate(String fecha, String formato){\n if(fecha==null || fecha.equals(\"\")){\n return null;\n } \n GregorianCalendar gc = new GregorianCalendar();\n try {\n fecha = nullToBlank(fecha);\n SimpleDateFormat df = new SimpleDateFormat(formato);\n gc.setTime(df.parse(fecha));\n } catch (Exception e) {\n e.printStackTrace();\n }\n return gc.getTime();\n }", "private String formatCalendar(Calendar c)\r\n\t{\n\t\t\tDate tasktime = c.getTime(); \r\n\t\t\r\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"MMMMM d yyyy\"); \r\n\t \r\n\t\treturn df.format(tasktime); \r\n\t}", "public static String getFormattedDate(String dateStr, String toformat)\r\n\t{\r\n\t\tString mName = \"getFormattedDate()\";\r\n\t\tIDateFormatter dateFormatter = null;\r\n\t\tDateFormatConfig dateFormat = null;\r\n\t\tString formattedDate = null;\r\n\t\tdateFormat = getDateFormat(toformat);\r\n\t\ttry\r\n\t\t{\r\n\t\t\tdateFormatter = (IDateFormatter) ResourceLoaderUtils.createInstance(dateFormat.getFormatterClass(),\r\n\t\t\t\t\t(Object[]) null);\r\n\t\t\tformattedDate = dateFormatter.formatDate(dateStr, dateFormat.getJavaDateFormat());\r\n\t\t} catch (Exception exp)\r\n\t\t{\r\n\t\t\tlogger.cterror(\"CTBAS00112\", exp, mName);\r\n\r\n\t\t}\r\n\t\treturn formattedDate;\r\n\t}", "public static Date convert(String timeString){\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MMM/yyyy:HH:mm:ss ZZZZ\");\n // set default timezone to be runtime independent\n TimeZone.setDefault(TimeZone.getTimeZone(\"UTC\"));\n try {\n return dateFormat.parse(timeString);\n } catch (ParseException e) {\n LOGGER.log(Level.SEVERE, \"Date cannot be parsed: \"+ timeString, e);\n return null;\n }\n }", "protected String getDateTimeString(String input) {\n String result;\n DateTimeFormatter datePattern = DateTimeFormatter.ofPattern(\"MMM dd yyyy\");\n if (dateTime == null) {\n result = input;\n } else {\n String date = getDate().format(datePattern);\n String time = getTime().toString();\n result = date + Constants.SPACE + time;\n }\n return result;\n }", "public static GregorianCalendar stringToCalendar(String fecha,\n String formato){\n GregorianCalendar gc = new GregorianCalendar();\n try {\n fecha = nullToBlank(fecha);\n SimpleDateFormat df = new SimpleDateFormat(formato);\n gc.setTime(df.parse(fecha));\n } catch (Exception e) {\n e.printStackTrace();\n }\n return gc;\n }", "private String getFormattedDate(String date) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(getString(R.string.received_import_date_format));\n SimpleDateFormat desiredDateFormat = new SimpleDateFormat(getString(R.string.desired_import_date_format));\n Date parsedDate;\n try {\n parsedDate = dateFormat.parse(date);\n return desiredDateFormat.format(parsedDate);\n } catch (ParseException e) {\n // Return an empty string in case of issues parsing the date string received.\n e.printStackTrace();\n return \"\";\n }\n }", "public String changeDateTimeFormat(String dateStr) {\n String inputPattern = \"MMM-dd-yyyy hh:mm a\";\n String outputPattern = \"MMMM dd, yyyy hh:mm a\";\n SimpleDateFormat inputFormat = new SimpleDateFormat(inputPattern);\n SimpleDateFormat outputFormat = new SimpleDateFormat(outputPattern);\n\n Date date = null;\n String str = null;\n\n try {\n date = inputFormat.parse(dateStr);\n str = outputFormat.format(date);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return str;\n\n }", "public static String convertUTCToLocalDate(long timeInSeconds, String format) {\n\t\t// get the time in milliseconds\n\t\tlong timeInMillis = timeInSeconds * DateUtils.SECOND_IN_MILLIS;\n\t\t// set the output time format\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault());\n\t\t// set the local time-zone\n\t\tsdf.setTimeZone(TimeZone.getDefault());\n\n\t\tString localDate = null;\n\n\t\tif (timeInMillis < 0)\n\t\t\t// if the input time is invalid, output the current local time\n\t\t\tlocalDate = sdf.format(new Date());\n\t\telse\n\t\t\t// output the formatted local time\n\t\t\tlocalDate = sdf.format(new Date(timeInMillis));\n\n\t\t// print your time stamp\n\t\tLogger.printMessage(\"Current date\", localDate, Logger.DEBUG);\n\n\t\treturn localDate;\n\t}", "private Date convertStringToDate(String dateInString){\n DateFormat format = new SimpleDateFormat(\"d-MM-yyyy HH:mm\", Locale.ENGLISH);\n Date date = null;\n try {\n date = format.parse(dateInString);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return date;\n }", "@SuppressLint(\"SimpleDateFormat\") public static String parse(String date, String format){\r\n\t\ttry {\r\n\t\t\tSimpleDateFormat localFormatter= new SimpleDateFormat(format);\r\n\t\t\tlocalFormatter.setLenient(false);\r\n\t\t\tString formattedDate=localFormatter.parse(date).toString();\r\n\t\t\t\r\n\t\t\t//days, months, years\r\n\t\t\tif(format.equals(formats[0])) return convertDate(formattedDate);\r\n\t\t\t\r\n\t\t\t//hours, minutes, seconds\r\n\t\t\telse if(format.equals(formats[1])) return convertHoursMinsSecs(formattedDate);\t\r\n\t\t\t\r\n\t\t\t//hours, minutes\r\n\t\t\telse if(format.equals(formats[2])) return convertHoursMins(formattedDate);\t\r\n\t\t\t\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\t} catch (ParseException e) {\r\n\t\t\t//e.printStackTrace();\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "public String ConvertDate(){\r\n//\t\tDate date=JavaUtils.getSystemDate();\r\n//\t DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd\");\r\n\t String pattern = \"yyyy-MM-dd\";\r\n\t SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\r\n\r\n\t String date = simpleDateFormat.format(new Date());\r\n//\t System.out.println(date);\r\n\t \r\n//\t String s = df.format(date);\r\n//\t String result = s;\r\n//\t try {\r\n//\t date=df.parse(result);\r\n//\t } catch (ParseException e) {\r\n//\t // TODO Auto-generated catch block\r\n//\t e.printStackTrace();\r\n//\t }\r\n\t return date;\r\n\t }", "public String getDateTime(Calendar calendar, String GMT, String DATE_TIME_FORMAT) throws Exception {\n int GMT_OFFSET_SECONDS = 0;\n try {\n GMT_OFFSET_SECONDS = getGMTOffSetSeconds(GMT);\n return getDateTime(calendar, GMT_OFFSET_SECONDS, DATE_TIME_FORMAT);\n } catch (Exception e) {\n throw new Exception(\"getDateTime : Invalid GMT :\" + GMT + \" : \" + e.toString());\n }\n }", "public String formatDateAndTime(String date){\n\n return dateTimeFormatter.parse(date).toString();\n\n }", "public static String getDateTimeString(Date date, String formatString)\n\t{\n\t\tString dateTimeString = null;\n\t\t\n\t\tif (formatString.equals(DATE_TIME_FORMAT_STRING))\n\t\t{\n\t\t\tdateTimeString = TimeUtil.getDateTime(date);\n\t\t}\n\t\telse if (formatString.equals(MILLISECOND_DATE_TIME_FORMAT_STRING))\n\t\t{\n\t\t\tdateTimeString = TimeUtil.getMillisecondDateTime(date);\n\t\t}\n\t\telse if (formatString.equals(TIME_ZONE_DATE_TIME_FORMAT_STRING))\n\t\t{\n\t\t\tdateTimeString = TimeUtil.getTimeZoneDateTime(date);\n\t\t}\n\t\telse if (formatString.equals(DATE_FORMAT_STRING))\n\t\t{\n\t\t\tdateTimeString = TimeUtil.getDate(date);\n\t\t}\n\t\telse if (formatString.equals(TIME_FORMAT_STRING))\n\t\t{\n\t\t\tdateTimeString = TimeUtil.getTime(date);\n\t\t}\n\t\telse if (formatString.equals(MILLISECOND_TIME_FORMAT_STRING))\n\t\t{\n\t\t\tdateTimeString = TimeUtil.getMillisecondTime(date);\n\t\t}\n\t\t\n\t\tif (dateTimeString == null)\n\t\t{\n\t\t\tdateTimeString = TimeUtil.getDateTime(date);\n\t\t}\n\t\t\n\t\treturn dateTimeString;\n\t}", "private static Date getFormattedDate(String date){\n\t\tString dateStr = null;\n\t\tif(date.length()<11){\n\t\t\tdateStr = date+\" 00:00:00.0\";\n\t\t}else{\n\t\t\tdateStr = date;\n\t\t}\n\t\tDate formattedDate = null;\n\t\ttry {\n\t\t\tformattedDate = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.S\").parse(dateStr);\n\t\t} catch (ParseException e) {\n\t\t\tCommonUtilities.createErrorLogFile(e);\n\t\t}\n\t\treturn formattedDate;\n\n\t}", "String getDateString(Context context) {\n int flags = DateUtils.FORMAT_NO_NOON_MIDNIGHT | DateUtils.FORMAT_SHOW_TIME |\n DateUtils.FORMAT_ABBREV_ALL | DateUtils.FORMAT_SHOW_DATE |\n DateUtils.FORMAT_CAP_AMPM;\n return DateUtils.formatDateTime(context, mDeliveryTime, flags);\n }", "private String formatDateTime(String inputDateTime) throws ParseException {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n simpleDateFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n Date myDate = simpleDateFormat.parse(inputDateTime);\n DateFormat outputFormat = new SimpleDateFormat(\"M/d/yy, h:mm aa\");\n DateFormat todayFormat = new SimpleDateFormat(\"h:mm aa\");\n String outputDateStr = \"\";\n if (isToday(inputDateTime.split(\" \")[0])){\n outputDateStr = \"Today, \" + todayFormat.format(myDate);\n } else {\n outputDateStr = outputFormat.format(myDate);\n }\n return outputDateStr;\n }", "public static Date String2Date(String date){\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\n Date currentDate = null;\n try {\n currentDate = format.parse(date);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return currentDate;\n }", "public static String convertToDateStringWithsdf(String unformateddate, SimpleDateFormat sdf) {\n Date date = null;\n String dateStr = unformateddate;\n try {\n\n date = sdf.parse(unformateddate);\n dateStr = new SimpleDateFormat(\"dd MMM yyyy\").format(date);\n } catch (Exception e) {\n // TODO: handle exception\n e.printStackTrace();\n }\n\n return dateStr;\n }", "public static String getFormattedDateString(Date date, String format) {\n Calendar cal = Calendar.getInstance();\n TimeZone timeZone = cal.getTimeZone();\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(format);\n dateFormat.setTimeZone(timeZone);\n\n return dateFormat.format(date);\n }", "private static List<String> listDateFormats(){\r\n List<String> result = new ArrayList<String>();\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\r\n result.add(\"yyyy-MM-ddZZ\");\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ssz\");\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\");\r\n result.add(\"EEE MMM d hh:mm:ss z yyyy\");\r\n result.add(\"EEE MMM dd HH:mm:ss yyyy\");\r\n result.add(\"EEEE, dd-MMM-yy HH:mm:ss zzz\");\r\n result.add(\"EEE, dd MMM yyyy HH:mm:ss zzz\");\r\n result.add(\"EEE, dd MMM yy HH:mm:ss z\");\r\n result.add(\"EEE, dd MMM yy HH:mm z\");\r\n result.add(\"EEE, dd MMM yyyy HH:mm:ss z\");\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ss\");\r\n result.add(\"EEE, dd MMM yyyy HH:mm:ss Z\");\r\n result.add(\"dd MMM yy HH:mm:ss z\");\r\n result.add(\"dd MMM yy HH:mm z\");\r\n result.add(\"'T'HH:mm:ss\");\r\n result.add(\"'T'HH:mm:ssZZ\");\r\n result.add(\"HH:mm:ss\");\r\n result.add(\"HH:mm:ssZZ\");\r\n result.add(\"yyyy-MM-dd\");\r\n result.add(\"yyyy-MM-dd hh:mm:ss\");\r\n result.add(\"yyyy-MM-dd HH:mm:ss\");\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ssz\");\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ss\");\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ssZZ\");\r\n result.add(\"dd.MM.yyyy\");\r\n result.add(\"dd.MM.yyyy hh:mm:ss\");\r\n result.add(\"dd.MM.yyyy HH:mm:ss\");\r\n result.add(\"dd.MM.yyyy'T'HH:mm:ssz\");\r\n result.add(\"dd.MM.yyyy'T'HH:mm:ss\");\r\n result.add(\"dd.MM.yyyy'T'HH:mm:ssZZ\");\r\n result.add(\"dd.MM.yyyy hh:mm\");\r\n result.add(\"dd.MM.yyyy HH:mm\");\r\n result.add(\"dd/MM/yyyy\");\r\n result.add(\"dd/MM/yy\");\r\n result.add(\"MM/dd/yyyy\");\r\n result.add(\"MM/dd/yy\");\r\n result.add(\"MM/dd/yyyy hh:mm:ss\");\r\n result.add(\"MM/dd/yy hh:mm:ss\");\r\n return result;\r\n }", "public static Calendar parseCxsDateString(String inputCalendarString) {\r\n\t\tif (inputCalendarString == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\tCalendar cal;\r\n\t\tif (inputCalendarString.indexOf('T') > -1) {\r\n\t\t\tcal = parse(inputCalendarString, CAL_DATETIME_FORMAT);\r\n\t\t} else {\r\n\t\t\tcal = parse(inputCalendarString, CAL_DATE_FORMAT);\r\n\t\t\tif (cal == null) {\r\n\t\t\t\tcal = parse(inputCalendarString, ISO_DATE_FORMAT);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn cal;\r\n\t}", "private void checkCorrectDateFormat(String date) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\", Locale.getDefault());\n sdf.setLenient(false);\n try {\n sdf.parse(date);\n } catch (ParseException e) {\n throw new IllegalArgumentException(\n \"Google Calendar Event Date must follow\" + \" the format: \\\"yyyy-MM-dd'T'HH:mm:ss\\\"\");\n }\n }", "public void setDateFormatString(String value) {\n this.dateFormatString = value;\n }", "public static String formatDate(Calendar date, DateFormat format) {\n\n switch (format) {\n case COMPLETE_DATE_FORMAT:\n format = DateFormat.COMPLETE_DATE_FORMAT;\n break;\n case DAY_FORMAT:\n format = DateFormat.DAY_FORMAT;\n break;\n }\n\n SimpleDateFormat dateFormatter = new SimpleDateFormat(format.getFormat(), Locale.US);\n\n return dateFormatter.format(date.getTime());\n }", "private String formatDate(String dateStringUTC) {\n // Parse the dateString into a Date object\n SimpleDateFormat simpleDateFormat =\n new SimpleDateFormat(\"yyyy-MM-dd'T'kk:mm:ss'Z'\");\n Date dateObject = null;\n try {\n dateObject = simpleDateFormat.parse(dateStringUTC);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n // Initialize a SimpleDateFormat instance and configure it to provide a more readable\n // representation according to the given format, but still in UTC\n SimpleDateFormat df = new SimpleDateFormat(\"MMM d, yyyy h:mm a\", Locale.ENGLISH);\n String formattedDateUTC = df.format(dateObject);\n // Convert UTC into Local time\n df.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n Date date = null;\n try {\n date = df.parse(formattedDateUTC);\n df.setTimeZone(TimeZone.getDefault());\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return df.format(date);\n }", "private String createDate(){\n SimpleDateFormat date = new SimpleDateFormat(\"EEE, MMM d, yyyy\");\n String stringDate = date.format(new Date()); \n return stringDate;\n }", "@Override\n\t\tpublic java.sql.Date convert(String s) throws ParseException {\n\t\t\ts = supportHtml5DateTimePattern(s);\n\t\t\t\n\t\t\tif (timeStampWithoutSecPatternLen == s.length()) {\n\t\t\t\ts = s + \":00\";\n\t\t\t}\n\t\t\tif (s.length() > dateLen) {\t// if (x < timeStampLen) 改用 datePattern 转换,更智能\n\t\t\t\t// return new java.sql.Date(java.sql.Timestamp.valueOf(s).getTime());\t// error under jdk 64bit(maybe)\n\t\t\t\treturn new java.sql.Date(getFormat(timeStampPattern).parse(s).getTime());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// return new java.sql.Date(java.sql.Date.valueOf(s).getTime());\t// error under jdk 64bit\n\t\t\t\treturn new java.sql.Date(getFormat(datePattern).parse(s).getTime());\n\t\t\t}\n\t\t}", "private Date parseStringToDate(String date) {\n Date resultDate = null;\n if (date.contains(TODAY) || date.contains(YESTERDAY)) {\n String[] dateStrings = date.split(\",\");\n if (dateStrings[0].equalsIgnoreCase(TODAY)) {\n Calendar today = Calendar.getInstance();\n resultDate = today.getTime();\n } else if (dateStrings[0].equalsIgnoreCase(YESTERDAY)) {\n Calendar yesterday = Calendar.getInstance();\n yesterday.add(Calendar.DATE, MINUS_DAY);\n resultDate = yesterday.getTime();\n }\n } else {\n SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT);\n try {\n resultDate = formatter.parse(date);\n } catch (ParseException e) {\n LOG.error(e.getMessage(), e);\n }\n }\n return resultDate;\n }", "public String convertDateToString(Date date, String format) {\n DateFormat dateFormat = new SimpleDateFormat(format);\n String dateAsString = dateFormat.format(date);\n return dateAsString;\n }", "public static Date convertirStringADateUtil(String s){\n\t\tFORMATO_FECHA.setLenient(false);\n\t\tDate fecha = null;\n\t\ttry {\n\t\t\tfecha = FORMATO_FECHA.parse(s);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn fecha;\n\t}", "public static String fromCalendar(final java.util.Calendar calendar) {\n // TODO: move this method to DateUtils\n Date date = calendar.getTime();\n String formatted = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ssZ\").format(date);\n return formatted.substring(0, 22) + \":\" + formatted.substring(22);\n }", "Calendar stringsToCalendar(String hour, String month, String date) throws ParseException {\n\t\tCalendar cal = Calendar.getInstance();\n\t\tString dateString = hour + \" \" + month + \" \" + date;\n\t\tcal.setTime(formatter.parse(dateString));\n\n\t\treturn cal;\n\t}", "public static Date FormatStringToDate(String dateString) {\r\n SimpleDateFormat dF = new SimpleDateFormat(\"dd/mm/yyyy HH:mm:ss\");\r\n Date date = null;\r\n try {\r\n date = dF.parse(dateString);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n return date;\r\n }", "@Override\n\tpublic Date convert(String source) {\n\t\tif (StringUtils.isValid(source)) {\n\t\t\tDateFormat dateFormat;\n\t\t\tif (source.indexOf(\":\") != -1) {\n\t\t\t\tdateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t} else {\n\t\t\t\tdateFormat = new SimpleDateFormat(\"yyyy-MM-dd\"); \n\t\t\t}\n\t\t\t//日期转换为严格模式\n\t\t dateFormat.setLenient(false); \n\t try {\n\t\t\t\treturn dateFormat.parse(source);\n\t\t\t} catch (ParseException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} \n\t\t}\n\t\treturn null;\n\t}", "public String getDateString(Calendar c){\n\n //get all time data\n String mYear = Integer.toString(c.get(Calendar.YEAR));\n int mMonth = c.get(Calendar.MONTH);\n String mDay = Integer.toString(c.get(Calendar.DAY_OF_MONTH));\n String mMinute = Integer.toString(c.get(Calendar.MINUTE));\n String mHour = Integer.toString(c.get(Calendar.HOUR));\n String mSecond= Integer.toString(c.get(Calendar.SECOND));\n\n //create string for Month in words and get it based off the int\n String mMonthWord= null;\n switch(mMonth){\n case 0:\n mMonthWord= \"Jan\";\n break;\n case 1:\n mMonthWord= \"Feb\";\n break;\n case 2:\n mMonthWord= \"March\";\n break;\n case 3:\n mMonthWord= \"April\";\n break;\n case 4:\n mMonthWord= \"May\";\n break;\n case 5:\n mMonthWord= \"June\";\n break;\n case 6:\n mMonthWord= \"July\";\n break;\n case 7:\n mMonthWord= \"August\";\n break;\n case 8:\n mMonthWord= \"Sept\";\n break;\n case 9:\n mMonthWord= \"Oct\";\n break;\n case 10:\n mMonthWord= \"Nov\";\n break;\n case 11:\n mMonthWord= \"Dec\";\n }\n\n //return the DateTime String for Display\n return mHour+\":\"+mMinute+\":\"+mSecond+\" \"+mMonthWord+ \" \"+mDay+\" \"+mYear;\n\n }", "public static String date_d(String sourceDate,String format) throws ParseException {\n SimpleDateFormat sdf_ = new SimpleDateFormat(\"yyyy-MM-dd\");\n SimpleDateFormat sdfNew_ = new SimpleDateFormat(format);\n return sdfNew_.format(sdf_.parse(sourceDate));\n }", "public static String getTimeString(Calendar calendar, String format) {\n String val = \"\";\n\n SimpleDateFormat dateFormat = getSimpleDateFormat(format);\n Date date = calendar.getTime();\n\n try {\n val = dateFormat.format(date);\n } catch (Exception e) {\n Log.e(\"getTimeString\", \"ex1\" + e+\"==\"+format);\n\n e.printStackTrace();\n }\n\n return val;\n }", "public static String getDateFormatJson(String dateStr)\r\n\t{\r\n\t\tHashMap dateHashMap = new HashMap();\r\n\t\tStringBuffer one = new StringBuffer();\r\n\t\tStringBuffer two = new StringBuffer();\r\n\t\tStringBuffer three = new StringBuffer();\r\n\t\tStringBuffer separators = new StringBuffer();\r\n\t\tint index = 0;\r\n\t\tint count = 0;\r\n\t\tint firstSepIndex = 0;\r\n\t\tfor (int i = 0; i < dateStr.length(); i++)\r\n\t\t{\r\n\t\t\tchar dateChar = dateStr.charAt(i);\r\n\t\t\tindex = dateStr.indexOf(dateChar);\r\n\t\t\tif ((firstSepIndex != index)\r\n\t\t\t\t\t&& ((dateChar >= 'a' && dateChar <= 'z') || (dateChar >= 'A' && dateChar <= 'Z')))\r\n\t\t\t{\r\n\t\t\t\tseparators.append(\"N\");\r\n\t\t\t\tfirstSepIndex = index;\r\n\t\t\t}\r\n\t\t\tif ((dateChar >= 'a' && dateChar <= 'z') || (dateChar >= 'A' && dateChar <= 'Z'))\r\n\t\t\t{\r\n\t\t\t\tif (index == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tone.append(dateChar);\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t} else if (index > 0 && count == index)\r\n\t\t\t\t{\r\n\t\t\t\t\ttwo.append(dateChar);\r\n\t\t\t\t} else\r\n\t\t\t\t{\r\n\t\t\t\t\tthree.append(dateChar);\r\n\t\t\t\t}\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\tif (dateChar == ' ')\r\n\t\t\t\t\tdateChar = 'S';\r\n\t\t\t\tseparators.append(dateChar);\r\n\t\t\t\tcount++;\r\n\t\t\t\tfirstSepIndex = index + 1;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tdateHashMap.put(\"datePositionOne\", one.toString());\r\n\t\tdateHashMap.put(\"datePositionTwo\", two.toString());\r\n\t\tdateHashMap.put(\"datePositionThree\", three.toString());\r\n\r\n\t\tif (separators.length() >= 2)\r\n\t\t{\r\n\t\t\tdateHashMap.put(\"dateSeparatorOne\", separators.substring(0, 1));\r\n\t\t\tdateHashMap.put(\"dateSeparatorTwo\", separators.substring(1, 2));\r\n\t\t} else\r\n\t\t{\r\n\t\t\tdateHashMap.put(\"dateSeparatorOne\", separators.toString());\r\n\t\t}\r\n\t\tString jsonString = HashMapToJSONConverter.convertHashMapToJSONFormat(dateHashMap);\r\n\t\treturn jsonString;\r\n\t}", "public String format (Date date , String dateFormat) ;", "String getSpokenDateString(Context context) {\n int flags = DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE;\n return DateUtils.formatDateTime(context, mDeliveryTime, flags);\n }", "public static Date getDateFromString(String date, String format)\n {\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n ParsePosition pos = new ParsePosition(0);\n\n // Parse the string back into a Time Stamp.\n return formatter.parse(date, pos);\n }", "public static String getDateAndTimeString(String format, Date date)\r\n\t{\r\n\r\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);\r\n\t\tString dateandtime = \"\";\r\n\t\ttry\r\n\t\t{\r\n\t\t\tdateandtime = simpleDateFormat.format(date);\r\n\t\t} catch (Exception e)\r\n\t\t{\r\n\t\t\tlogger.cterror(\"CTBAS00119\", e, format);\r\n\t\t}\r\n\t\treturn dateandtime;\r\n\t}", "public static String convertDateFormat(Date sourceDate, SimpleDateFormat dateForm) {\n return dateForm.format(sourceDate);\n }", "public static Date StringToDate(String strFecha) throws ParseException {\r\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\r\n return simpleDateFormat.parse(strFecha);\r\n }", "public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public Date convertStringToDate(String dateToParse, String format) {\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n Date result = null;\n try {\n result = formatter.parse(dateToParse);\n } catch (Exception exception1) {\n System.err.println(\n String.format(\"ERROR, converting from String %s to date with format %s\", dateToParse, format)\n );\n result = null;\n }\n return result;\n }", "public String convertDateToTime(String date){\n Date test = null;\n if(date !=null) {\n try {\n test = sdf.parse(date);\n } catch (ParseException e) {\n System.out.println(\"Parse not working: \" + e);\n }\n calendar.setTime(test);\n return String.format(\"%02d:%02d\",\n calendar.get(Calendar.HOUR_OF_DAY),\n calendar.get(Calendar.MINUTE)\n );\n }\n return \"n\";\n }", "public String getStringDate(){\n String finalDate = \"\";\n Locale usersLocale = Locale.getDefault();\n DateFormatSymbols dfs = new DateFormatSymbols(usersLocale);\n String weekdays[] = dfs.getWeekdays();\n int day = date.get(Calendar.DAY_OF_WEEK);\n String nameOfDay = weekdays[day];\n\n finalDate += nameOfDay + \" \" + date.get(Calendar.DAY_OF_MONTH) + \", \";\n\n String months[] = dfs.getMonths();\n int month = date.get(Calendar.MONTH);\n String nameOfMonth = months[month];\n\n finalDate += nameOfMonth + \", \" + date.get(Calendar.YEAR);\n\n return finalDate;\n }", "@Test\n public void testDateTimeToText() throws Exception {\n TimeZone timeZone = TimeZone.getTimeZone(\"GMT+05:00\");\n Calendar march17 = new GregorianCalendar(2012, 2, 17, 12, 34, 56);\n march17.setTimeZone(timeZone);\n march17.add(Calendar.MILLISECOND, 789);\n DateConverter.XML_DATETIME.setTimeZone(timeZone);\n String result = DateConverter.XML_DATETIME.toText(mockContext, march17.getTime());\n assertEquals(\"2012-03-17T12:34:56.789+05:00\", result);\n }", "public static String formatDate(String strDate) {\n return formatDate(strDate, false);\n }", "private Date stringToDate(String s) throws ParseException{\r\n\t\tSimpleDateFormat fmt = new SimpleDateFormat(DATE_FORMAT);\r\n\t\treturn fmt.parse(s);\r\n\t}", "public static Date GetDateObjectFromStringUpdate(String dateAsString) {\n\t\tSimpleDateFormat lv_formatter = new SimpleDateFormat(\n\t\t\t\t\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n\t\tlv_formatter.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n\t\tDate tempDate = null;\n\t\ttry {\n\t\t\tif (dateAsString != null && !dateAsString.equalsIgnoreCase(\"null\"))\n\t\t\t\ttempDate = lv_formatter.parse(dateAsString);\n\t\t} catch (Exception e) {\n\t\t\t// do some error reporting here\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn tempDate;\n\t}", "private String formatDate(String dateObject) {\n SimpleDateFormat input = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\"); // format kita \"HARUS SAMA TIDAK BOLEH FORMATNYA BEDA BAHKAN 1 CHAR PUN\n SimpleDateFormat output= new SimpleDateFormat(\"dd-MM-yyyy\");\n Date tanggal = null;\n try {\n tanggal = input.parse(dateObject);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return output.format(tanggal);\n\n }", "public String dateFormatter(String fromDate) {\n\t\tString newDateString=\"\";\n\t\ttry {\n\t\t\tfinal String oldFormat = \"yyyy/MM/dd\";\n\t\t\tfinal String newFormat = \"yyyy-MM-dd\";\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(oldFormat);\n\t\t\tDate d = sdf.parse(fromDate);\n\t\t\tsdf.applyPattern(newFormat);\n\t\t\tnewDateString = sdf.format(d);\n\t\t} catch(Exception exp) {\n\t\t\tthrow ExceptionUtil.getYFSException(ExceptionLiterals.ERRORCODE_INVALID_DATE, exp);\n\t\t}\n\t\treturn newDateString;\n\t}", "public static String convertDateTo(String sDate, String sOldFormat, String sNewFormat)\r\n\t{\r\n\t\tString cmName = \"DateFormatterManager.convertDateTo(String,String,String)\";\r\n\t\tlogger.ctdebug(\"CTBAS00116\", cmName, sDate, sOldFormat, sNewFormat);\r\n\t\tSimpleDateFormat newDateFormat = new SimpleDateFormat(sNewFormat);\r\n\t\tSimpleDateFormat oldDateFormat = new SimpleDateFormat(sOldFormat);\r\n\t\tString sOldDate = sDate;\r\n\t\tDate date = null;\r\n\t\tString sNewDate = null;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tdate = oldDateFormat.parse(sOldDate);\r\n\t\t} catch (ParseException pException)\r\n\t\t{\r\n\t\t\tlogger.cterror(\"CTBAS00117\", pException, cmName, sDate, sOldFormat, sNewFormat);\r\n\t\t}\r\n\t\tsNewDate = newDateFormat.format(date);\r\n\t\tlogger.ctdebug(\"CTBAS00118\", sNewDate);\r\n\t\treturn sNewDate;\r\n\t}", "public static Calendar convertStringDateTimeToCalendar(String strCal)\r\n\t{\r\n\t\t//\"dd/mm/yyyy hh:mm\"\r\n\t\tCalendar c = new GregorianCalendar();\r\n\t\t\r\n\t\tString[] arrSlash = strCal.split(\"/\");\r\n\t\t\r\n\t\t//arrCal is now {DD,MM,YYYY HH:MM}\r\n\t\t\r\n\t\tint day = Integer.parseInt(arrSlash[0]);\r\n\t\tint month = Integer.parseInt(arrSlash[1]);\r\n\t\t\r\n\t\tString[] arrSpace = arrSlash[2].split(\" \");\r\n\t\t\r\n\t\t//arrSpace is now {YYYY,HH:MM}\r\n\t\t\r\n\t\tint year = Integer.parseInt(arrSpace[0]);\r\n\t\t\r\n\t\tString[] arrColon = arrSpace[1].split(\":\");\r\n\t\t\r\n\t\t//arrColon is now {HH,MM}\r\n\t\t\r\n\t\tint hour = Integer.parseInt(arrColon[0]);\r\n\t\tint minute = Integer.parseInt(arrColon[1]);\r\n\t\t\r\n\t\t//set values to object\r\n\t\tc.set(Calendar.DAY_OF_MONTH, day);\r\n\t\tc.set(Calendar.MONTH, month-1);\r\n\t\tc.set(Calendar.YEAR, year);\r\n\t\tc.set(Calendar.HOUR_OF_DAY, hour);\r\n\t\tc.set(Calendar.MINUTE, minute);\r\n\t\t\r\n\t\treturn c;\r\n\t}", "public String convertToLocalTime(Calendar eventDate, String timezone) throws ParseException;", "public String getDateTimeFormated(Context context){\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\"\n , context.getResources().getConfiguration().locale);\n sdf.setTimeZone(TimeZone.getDefault());\n return sdf.format(new Date(mDateTime));\n //setting the dateformat to dd/MM/yyyy HH:mm:ss which is how the date is displayed when a dream is saved\n }", "private static Date ISO_8601toDate(String dateTime) throws ParseException {\n\n //already in UTC\n if (dateTime.endsWith(\"Z\")) {\n return dateTimeFormatZ.parse(dateTime);\n }\n\n int positionT = dateTime.indexOf('T');\n\n int positionZ = dateTime.indexOf('+', positionT);\n if (positionZ == -1) {\n positionZ = dateTime.indexOf('-', positionT);\n }\n\n //no timezone specified, defaults to UTC\n if (positionZ == -1) {\n return dateTimeFormatZ.parse(dateTime + 'Z');\n }\n\n //convert to General time zone to preserve the timezone provided\n return dateTimeFormatGtz.parse(dateTime.substring(0, positionZ)\n + \"GMT\"\n + dateTime.substring(positionZ));\n }", "private void getIntialCalender() {\n\n\t\ttry {\n\n\t\t\tc = Calendar.getInstance();\n\t\t\tString[] fields = Global_variable.str_booking_date.split(\"[-]\");\n\n\t\t\tString str_year = fields[0];\n\t\t\tString str_month = fields[1];\n\t\t\tString str_day = fields[2];\n\n\t\t\tSystem.out.println(\"!!!!\" + fields[0]);\n\t\t\tSystem.out.println(\"!!!!\" + fields[1]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields[2]);\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tyear = Integer.parseInt(str_year);\n\t\t\t} else {\n\t\t\t\tyear = c.get(Calendar.YEAR);\n\t\t\t}\n\n\t\t\tif (str_month.length() != 0) {\n\t\t\t\tmonth = Integer.parseInt(str_month) - 1;\n\t\t\t} else {\n\t\t\t\tmonth = c.get(Calendar.MONTH);\n\t\t\t}\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tday = Integer.parseInt(str_day);\n\t\t\t} else {\n\t\t\t\tday = c.get(Calendar.DAY_OF_MONTH);\n\t\t\t}\n\n\t\t\tString[] fields1 = Global_variable.str_booking_time.split(\"[:]\");\n\n\t\t\tString str_hour = fields1[0];\n\t\t\tString str_minutes = fields1[1];\n\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[0]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[1]);\n\n\t\t\tif (str_hour.length() != 0) {\n\t\t\t\thour = Integer.parseInt(str_hour);\n\t\t\t} else {\n\t\t\t\thour = c.get(Calendar.HOUR_OF_DAY);\n\t\t\t}\n\n\t\t\tif (str_minutes.length() != 0) {\n\t\t\t\tminutes = Integer.parseInt(str_minutes);\n\t\t\t} else {\n\t\t\t\tminutes = c.get(Calendar.MINUTE);\n\t\t\t}\n\n\t\t\tcurrDate = new java.sql.Date(System.currentTimeMillis());\n\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\tCalendar c1 = Calendar.getInstance();\n\t\t\tc1.setTime(new Date()); // Now use today date.\n\t\t\tc1.add(Calendar.DATE, 30); // Adding 30 days\n\t\t\toutput = sdf.format(c1.getTime());\n\t\t\tSystem.out.println(\"!!!!!!!!!!!!!!!\" + output);\n\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void testFormatDateStringFromTimestamp_other() {\n calendar.set(\n /* year = */ 1991,\n /* month = */ Calendar.MONTH,\n /* day = */ 11);\n assertEquals(\"March 11\",\n ContactInteractionUtil.formatDateStringFromTimestamp(calendar.getTimeInMillis(),\n getContext()));\n }", "private String getFormattedDate(Integer format) {\n Date date = new Date(format * 1000L);\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"Etc/UTC\"));\n Log.e(\"time\",dateFormat.format(date));\n return dateFormat.format(date);\n }", "public String getCurrentDateTime(String sDateFormat) throws Exception {\n SimpleDateFormat formatter = null;\n String dateNow = \"\";\n String sDefaultDateFormat = \"yyyy:MM:dd:HH:mm\";\n try {\n if (sDateFormat == null) {\n sDateFormat = \"\";\n }\n if (!sDateFormat.trim().equalsIgnoreCase(\"\")) {\n sDefaultDateFormat = sDateFormat;\n }\n\n Calendar currentDate = Calendar.getInstance();\n formatter = new SimpleDateFormat(sDefaultDateFormat);\n dateNow = formatter.format(currentDate.getTime());\n dateNow.trim();\n return dateNow;\n } catch (Exception exp) {\n println(\"getCurrentDateTime : \" + exp.toString());\n throw exp;\n }\n }", "private Calendar getCalFromString(final String calString) {\n\t\tfinal Calendar ret = new GregorianCalendar(1970, 0, 1, 0, 0, 0);\n\t\tfinal SimpleDateFormat isoDateFormat = new SimpleDateFormat(\n\t\t\t\t\"yyyy-MM-dd HH:mm\", Locale.getDefault());\n\t\ttry {\n\t\t\tret.setTime(isoDateFormat.parse(calString.concat(\" 00:00\")));\n\t\t\tret.setTime(isoDateFormat.parse(calString));\n\t\t} catch (ParseException e) { \n\t\t\t// the code will definitely throw an exception, but we don't care\n\t\t\t// any suggestions how to better handle this?\n\t\t}\n\n\t\treturn ret;\n\t}", "public static Date stringToDate(String dateAsString){\r\n try { \r\n SimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\"); \r\n return df.parse(dateAsString);\r\n } catch (ParseException ex) {\r\n ex.printStackTrace();\r\n return null;\r\n }\r\n }", "public String parseTime(String time) {\n Date date = null;\n try {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\", Locale.getDefault());\n String todaysDate = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.getDefault()).format(new Date());\n date = simpleDateFormat.parse(todaysDate + \" \" + time.split(\" \")[0]);\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.getDefault());\n sdf.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n return sdf.format(date);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }", "private String getDateString(Calendar cal) {\n Calendar current = Calendar.getInstance();\n String date = \"\";\n if (cal.get(Calendar.DAY_OF_YEAR) == current.get(Calendar.DAY_OF_YEAR)) {\n date = getResources().getString(R.string.content_today) + String.format(\" %02d:%02d\", cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));\n } else if ((cal.get(Calendar.DAY_OF_YEAR) - 1) == current.get(Calendar.DAY_OF_YEAR)) {\n date = getResources().getString(R.string.content_yesterday) + String.format(\" %02d:%02d\", cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));\n } else if ((cal.get(Calendar.DAY_OF_YEAR) - 2) == current.get(Calendar.DAY_OF_YEAR)\n && getResources().getConfiguration().locale.equals(new Locale(\"vn\"))) {\n date = getResources().getString(R.string.content_before_yesterday) + String.format(\" %02d:%02d\", cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));\n } else {\n date = String.format(\"%02d-%02d-%02d %02d:%02d\", mCal.get(Calendar.DAY_OF_MONTH), mCal.get(Calendar.MONTH) + 1, mCal.get(Calendar.YEAR), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));\n }\n\n return date;\n }", "public static String CalendarToString(Calendar fecha, String formato)\n throws Exception {\n if (nullToBlank(fecha).equals(\"\")) {\n return \"\";\n }\n SimpleDateFormat df = new SimpleDateFormat(formato);\n return df.format(fecha.getTime());\n }", "public static Calendar parseISODate(String dateAsString, String timezone) throws ParseException {\n\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT, Locale.US);\n simpleDateFormat.setTimeZone(TimeZone.getTimeZone(SERVER_TIME_ZONE));\n try {\n\n Calendar date = Calendar.getInstance();\n\n if (dateAsString != null && !(dateAsString.equalsIgnoreCase(\"\"))) {\n\n date.setTime(simpleDateFormat.parse(dateAsString));\n date.setTimeZone(TimeZone.getTimeZone(timezone));\n\n }\n\n return date;\n\n } catch (ParseException e) {\n\n Log.d(TAG, \"Failed to parse date: \" + dateAsString + \" to iso format: \" + DATE_FORMAT);\n throw e;\n\n }\n\n }", "public static Date changeDateFormat(String date, String format){\n SimpleDateFormat sdf = new SimpleDateFormat(format);\n try {\n return sdf.parse(date);\n } catch (ParseException e) {\n e.printStackTrace();\n return null;\n }\n }" ]
[ "0.6014059", "0.5961387", "0.594265", "0.57533", "0.5687055", "0.5608953", "0.55955523", "0.5554678", "0.552675", "0.5512427", "0.5504538", "0.5501289", "0.5496432", "0.5474487", "0.5472471", "0.54139286", "0.5394716", "0.53922236", "0.53906053", "0.53720754", "0.53592324", "0.53574294", "0.53456634", "0.53405285", "0.5339188", "0.5315402", "0.5304517", "0.52980644", "0.52964354", "0.5292285", "0.5287892", "0.5285427", "0.5285398", "0.5268657", "0.5262904", "0.5261893", "0.5259143", "0.525085", "0.5248993", "0.52381957", "0.5214499", "0.5206891", "0.5201072", "0.52004486", "0.5191046", "0.5189238", "0.5173594", "0.51590914", "0.5158992", "0.5153104", "0.5145271", "0.51411235", "0.5137908", "0.5136472", "0.51339245", "0.51241535", "0.51156306", "0.5105041", "0.5096885", "0.5091598", "0.5073813", "0.5062608", "0.506153", "0.50590914", "0.505572", "0.5054481", "0.50521594", "0.5047697", "0.50463873", "0.50408983", "0.5038567", "0.5037441", "0.5034239", "0.5033581", "0.5030058", "0.502616", "0.5026031", "0.50207025", "0.5005891", "0.50025934", "0.49930635", "0.49854183", "0.4975985", "0.49754786", "0.4967212", "0.4963166", "0.49596515", "0.49557608", "0.49487144", "0.4936113", "0.4935785", "0.49348384", "0.49291536", "0.49288064", "0.4928211", "0.492268", "0.49224073", "0.49209085", "0.49206156", "0.4918928" ]
0.568204
5
Given a Java Calendar object this function returns a new Calendar initialised to the same date in the New York / NASDAQUE Time Zone and with its time component set to the instant the stock market would open (Nominally this is 09:30:00 in the "America/New_York" Time Zone).
public static Calendar getExchOpeningCalendar(Calendar aDate) { Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); if (null != aDate) { result.setTimeInMillis(aDate.getTimeInMillis()); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); result.set(Calendar.MILLISECOND, 0); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public static Calendar convertToLondonCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar gmtCal = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/London\"));\r\n gmtCal.clear();\r\n gmtCal.setTimeInMillis(timeInMillis);\r\n return gmtCal;\r\n }", "Calendar getCalendar();", "Calendar toCalendar();", "Calendar toCalendar();", "public static Calendar deepCopyCalendar(Calendar cal) {\r\n Calendar result = null;\r\n if (null != cal) {\r\n Calendar newCal = Calendar.getInstance(cal.getTimeZone());\r\n newCal.clear();\r\n newCal.set(Calendar.YEAR, cal.get(Calendar.YEAR));\r\n newCal.set(Calendar.MONTH, cal.get(Calendar.MONTH));\r\n newCal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH));\r\n newCal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY));\r\n newCal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE));\r\n newCal.set(Calendar.SECOND, cal.get(Calendar.SECOND));\r\n newCal.set(Calendar.MILLISECOND, cal.get(Calendar.MILLISECOND));\r\n result = newCal;\r\n }\r\n return result;\r\n }", "public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) {\r\n Calendar usaCal = Calendar.getInstance(tz);\r\n usaCal.clear();\r\n usaCal.set(year, month, day, hrs, min, secs);\r\n return usaCal;\r\n }", "private static Calendar getCalendar(final Long timeInMilliseconds, final TimeZone timeZone) {\n\n final Calendar calendar = Calendar.getInstance(timeZone);\n calendar.setTimeInMillis(timeInMilliseconds);\n\n return calendar;\n }", "public CalendarUtils(Calendar baseCalendar) {\r\n\t\tthis(baseCalendar.getTime(), baseCalendar.getTimeZone());\r\n\t}", "abstract GregorianCalendar getThreadLocalCalendar();", "public Calendar startOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE));\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public Calendar toCalendar() {\n\t\treturn (Calendar) _cal.clone();\n\t}", "public static Calendar getDefaultScheduleTime() {\n Calendar scheduled = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/Copenhagen\"));\n scheduled.add(Calendar.HOUR, 1);\n\n scheduled.set(Calendar.MINUTE, 0);\n scheduled.set(Calendar.SECOND, 0);\n scheduled.set(Calendar.MILLISECOND, 0);\n\n return scheduled;\n }", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "public Calendar() {\n\t\tthis(() -> LocalDateTime.now());\n\t}", "public static Calendar dateToCalendar(Date dteStart, TimeZone tz) {\r\n Calendar cal = Calendar.getInstance(tz);\r\n cal.clear();\r\n int year = dteStart.getYear() + 1900;\r\n int month = dteStart.getMonth();\r\n DateFormat formatter = new SimpleDateFormat(\"dd\");\r\n String strDay = formatter.format(dteStart);\r\n int day = Integer.parseInt(strDay);\r\n int hrs = dteStart.getHours();\r\n int min = dteStart.getMinutes();\r\n int secs = dteStart.getSeconds();\r\n cal.set(Calendar.YEAR, year);\r\n cal.set(Calendar.MONTH, month);\r\n cal.set(Calendar.DAY_OF_MONTH, day);\r\n cal.set(Calendar.HOUR_OF_DAY, hrs);\r\n cal.set(Calendar.MINUTE, min);\r\n cal.set(Calendar.SECOND, secs);\r\n return cal;\r\n }", "private Calendar createNewCalendar(String dateAndTime) {\n // initiate a calendar\n Calendar calendar = Calendar.getInstance();\n // take the given dateandTime string and split it into the different values\n String date = dateAndTime.split(\" \")[0];\n String time = dateAndTime.split(\" \")[1];\n int year = Integer.valueOf(date.split(\"-\")[0]);\n int month = Integer.valueOf(date.split(\"-\")[1]) - 1;\n int day = Integer.valueOf(date.split(\"-\")[2]);\n int hour = Integer.valueOf(time.split(\":\")[0]);\n int min = Integer.valueOf(time.split(\":\")[1]);\n // set the calendar to the wanted values\n calendar.set(year, month, day, hour, min);\n return calendar;\n }", "protected Calendar getCurrentCalendar() {\n Calendar current = new Calendar();\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n SimpleDateFormat dateFormatHour = new SimpleDateFormat(\"H\");\n SimpleDateFormat dateFormatWeekDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat dateFormatMonth = new SimpleDateFormat(\"MMM\");\n\n current.setHour(dateFormatHour.format(calendar.getTime()).toString());\n current.setWeekday(dateFormatWeekDay.format(calendar.getTime()));\n current.setMonth(dateFormatMonth.format(calendar.getTime()));\n\n return current;\n }", "public Calendar getCurrentMonthCalendarObj() throws Throwable{\r\n\r\n\t\tString dateInput = \"01/\"+month+\"/\"+year;\t\t\t\r\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MMMM/yyyy\");\r\n\t\tDate startDate = df.parse(dateInput);\r\n\t\tCalendar c = Calendar.getInstance(); // this takes current date\r\n\t c.setTime(startDate); // set date to specified in arguement\r\n\t\treturn c;\r\n\t}", "public Calendar forDate(Date date) {\r\n\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.setTime(date);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public Date getUTCDate(String timeZone, Calendar cal);", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute, int second) {\r\n\t\tCalendar calendar = createCalendar(year, month, date, hour, minute);\r\n\t\tcalendar.set(Calendar.SECOND, second);\r\n\t\treturn calendar;\r\n\t}", "private static Calendar createCalendar(int year, int month, int date) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setLenient(false);\r\n\t\tcalendar.set(Calendar.YEAR, year);\r\n\t\tcalendar.set(Calendar.MONTH, month - 1);\r\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, date);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\treturn calendar;\r\n\t}", "public static final Calendar getCalendar(int date, int month, int year) {\r\n\t\tCalendar cal = Calendar.getInstance(); // locale-specific\r\n\t\t// cal.setTime(dateObject);\r\n\t\tcal.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcal.set(Calendar.MINUTE, 0);\r\n\t\tcal.set(Calendar.SECOND, 0);\r\n\t\tcal.set(Calendar.MILLISECOND, 0);\r\n\r\n\t\tcal.set(Calendar.DATE, date);\r\n\t\tcal.set(Calendar.MONTH, month);\r\n\t\tcal.set(Calendar.YEAR, year);\r\n\t\treturn cal;\r\n\t}", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute) {\r\n\t\tCalendar calendar = createCalendar(year, month, date);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, hour);\r\n\t\tcalendar.set(Calendar.MINUTE, minute);\r\n\t\treturn calendar;\r\n\t}", "private static Calendar toUTCCalendarWithoutTime(final Date date) {\n final Calendar calendar = Calendar.getInstance();\n calendar.clear();\n calendar.setTime(date);\n calendar.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar;\n }", "public StockDate GetCalendar()\r\n\t{\r\n\t\treturn date;\r\n\t}", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "public static Calendar ahoraCalendar() {\n return Calendar.getInstance(TimeZone.getTimeZone(\"America/Guayaquil\"));\n }", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "public JCalendar() {\r\n init();\r\n resetToDefaults();\r\n }", "public Calendar getCalendar() {\n Calendar c = Calendar.getInstance();\n c.setTime(cal.getTime());\n return c;\n }", "Calendar getTimeStamp();", "private DateTime goodLocalDateUse3() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n return ld.toDateTimeAtStartOfDay(DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "public VCalendar clone() {\n\t\treturn new VCalendar(this.content, this.collectionId, this.resourceId, this.earliestStart, this.latestEnd, null);\n\t}", "public Calendar() {\n }", "public DateTime(Calendar c) {\n setCharacteristic(null);\n if (c == null) {\n setCharacteristic(null);\n setYear(YEAR_IS_NOT_KNOWN);\n setMonth(MONTH_IS_NOT_KNOWN);\n setDay(DAY_OF_MONTH_IS_NOT_KNOWN);\n setHours(0);\n setMinutes(0);\n setSeconds(0);\n } else {\n setYear(c.get(Calendar.YEAR));\n setMonth(c.get(Calendar.MONTH) + 1);\n setDay(c.get(Calendar.DAY_OF_MONTH));\n setHours(c.get(Calendar.HOUR_OF_DAY));\n setMinutes(c.get(Calendar.MINUTE));\n setSeconds(c.get(Calendar.SECOND));\n }\n }", "public static Calendar getExchOpeningTime() {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n return result;\r\n }", "public static Date createDate(int yyyy, int month, int day, int hour, int min) {\n/* 93 */ CALENDAR.clear();\n/* 94 */ CALENDAR.set(yyyy, month - 1, day, hour, min);\n/* 95 */ return CALENDAR.getTime();\n/* */ }", "private DateTime goodLocalDateUse() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n LocalTime now = LocalTime.now();\n return new DateTime(ld.getYear(), ld.getMonthOfYear(), ld.getDayOfYear(), now.getHourOfDay(),\n now.getMinuteOfHour(), now.getSecondOfMinute(), now.getMillisOfSecond(),\n DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "public static void updateCalendar() {\n time = Calendar.getInstance();\n hour = time.get(Calendar.HOUR_OF_DAY);\n minute = time.get(Calendar.MINUTE);\n day = time.get(Calendar.DAY_OF_MONTH);\n month = time.get(Calendar.MONTH) + 1; \n year = time.get(Calendar.YEAR);\n\n }", "public void testCalendar() {\n Calendar cal = rootBlog.getCalendar();\n assertEquals(rootBlog.getTimeZone(), cal.getTimeZone());\n }", "public static CalendarDate getCalendarDate(long utc) {\n\tlong days;\n\tint millis;\n\n\tdays = utc / ONE_DAY;\n\tmillis = (int)(utc % ONE_DAY);\n\tif (millis < 0) {\n\t millis += ONE_DAY;\n\t days--;\n\t}\n\tdays += EPOCH_DATE;\n\tCalendarDate cdate = getCalendarDateFromFixedDate(days);\n\tcdate.setTimeOfDay(millis);\n\treturn cdate;\n }", "@Override\npublic final Object clone() {\n return new ClockTime(dateValue());\n }", "public void setTodayCalendar()\n {\n this.currentCalendar = Calendar.getInstance();\n }", "@NonNull public static CalendarDay today() {\n return from(LocalDate.now());\n }", "public Calendar endOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE) + 1);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public static Date createDate(int yyyy, int month, int day) {\n/* 75 */ CALENDAR.clear();\n/* 76 */ CALENDAR.set(yyyy, month - 1, day);\n/* 77 */ return CALENDAR.getTime();\n/* */ }", "private Date getTestListingDateTimeStamp() {\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/London\"));\n\n GregorianCalendar calendar = new GregorianCalendar(2010, 0, 1, 17, 0);\n return new Date(calendar.getTimeInMillis());\n }", "private DateTime goodLocalDateUse2() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n LocalTime now = LocalTime.now();\n return new DateTime(ld.getYear(), ld.getMonthOfYear(), ld.getDayOfYear(), now.getHourOfDay(),\n now.getMinuteOfHour(), now.getSecondOfMinute(), now.getMillisOfSecond(),\n DateTimeZone.getDefault())\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "@Test\n public void testTimezone() {\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/Paris\"));\n\n SunTimes paris = SunTimes.compute()\n .on(2020, 5, 1) // May 1st, 2020, starting midnight\n .latitude(48, 51, 24.0) // Latitude of Paris: 48°51'24\" N\n .longitude(2, 21, 6.0) // Longitude: 2°21'06\" E\n .execute();\n System.out.println(\"Sunrise in Paris: \" + paris.getRise());\n System.out.println(\"Sunset in Paris: \" + paris.getSet());\n\n SunTimes newYork = SunTimes.compute()\n .on(2020, 5, 1) // May 1st, 2020, starting midnight\n .at(40.712778, -74.005833) // Coordinates of New York\n .execute();\n System.out.println(\"Sunrise in New York: \" + newYork.getRise());\n System.out.println(\"Sunset in New York: \" + newYork.getSet());\n\n SunTimes newYorkTz = SunTimes.compute()\n .on(2020, 5, 1) // May 1st, 2020, starting midnight\n .timezone(\"America/New_York\") // ...New York timezone\n .at(40.712778, -74.005833) // Coordinates of New York\n .execute();\n System.out.println(\"Sunrise in New York: \" + newYorkTz.getRise());\n System.out.println(\"Sunset in New York: \" + newYorkTz.getSet());\n }", "Calendar getArrivalDateAndTime();", "public static DateUtil today(TimeZone timeZone)\n {\n // 86,400,000 = 1000 * 60 * 60 * 24 = milliseconds per day\n long currentUTCDateTime = System.currentTimeMillis();\n DateUtil d = new DateUtil((int)(currentUTCDateTime / 86400000L));\n\n /*\n * Gets the time zone offset, for current date, modified in case of\n * daylight savings. This is the offset to add *to* UTC to get local time.\n * Places east of Greenwich have a positive offset.\n * :era the era of the given date, AD = 1 BC = 0\n * :year the year in the given date.\n * Docs are unclear if 1900=0 or 1900. Does not use year in calcs anyway.\n * :month the month in the given date.\n * Month is 0-based. e.g., 0 for January.\n * :day the day-in-month of the given date.\n * :dayOfWeek the day-of-week of the given date. 1=Calendar.SUNDAY\n * :milliseconds the millis in day in <em>standard</em> local time.\n * :return the offset in millis to add *to* GMT to get local time.\n */\n int offsetInMillis = timeZone.getOffset(d.getOrdinal() >= Jan_01_0001 ? 1:0,\n d.getYYYY(),\n d.getMM()-1,\n d.getDD(),\n d.getCalendarDayOfWeek(),\n (int)(currentUTCDateTime % 86400000L)\n /* wrong. Should be local standard time. How to get it?? */\n );\n d.setOrdinal((int)((currentUTCDateTime + offsetInMillis) / 86400000L));\n return d;\n }", "@Test\n public void getterCalendar(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n Assert.assertEquals(2018,calendar.getYear());\n Assert.assertEquals(4,calendar.getMonth());\n Assert.assertEquals(25,calendar.getDayOfMonth());\n }", "Calendar registeredAt();", "public static Calendar getCalendar(Date date) {\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tif (date != null) {\r\n\t\t\tcal.setTime(date);\r\n\t\t} else {\r\n\t\t\tcal.setTime(new Date());\r\n\t\t}\r\n\t\treturn cal;\r\n\t}", "public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private Date getSamoaNow() {\n\t\t// Get the current datetime in UTC\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(new Date());\n\t\t\n\t\t// Get the datetime minus 11 hours (Samoa is UTC-11)\n\t\tcalendar.add(Calendar.HOUR_OF_DAY, -11);\n\t\t\n\t\treturn calendar.getTime();\n\t}", "@Override\n\tpublic Calendar getInitialDate() {\n\t\treturn Calendar.getInstance();\n\t}", "default Clock getFixedClock(int year, int month, int day, int hour, int minute, int second, ZoneOffset zone) {\n return Clock.fixed(getLocalTime(year, month, day, hour, minute, second).toInstant(zone), zone);\n }", "public Object clone() {\n return new Value(_calendar);\n }", "private Date calendarToDate(Calendar calendar) {\n return (Date) calendar.getTime();\n }", "public void setupCalendar() { \n\t\tcal = whenIsIt();\n\t\tLocale here = Locale.US;\n\t\tthisMonth = cal.getDisplayName(2, Calendar.LONG_STANDALONE, here);\n\t\tdate = cal.get(5); //lesson learned: if it's a number do this\n\t\t//ADD CODE FOR ORDINALS HERE\n\t\tyear = cal.get(1);\n\t\tthisHour = cal.get(10);\n\t\tthisMinute = cal.get(12);\n\t\tthisSecond = cal.get(13);\n\t\tamPm = cal.getDisplayName(9, Calendar.SHORT, here);\n\t\tthisDay = thisMonth +\" \"+ addOrdinal(date) + \", \" + year;\n\t\tcurrentTime = fix.format(thisHour) + \":\" + fix.format(thisMinute) + \":\" + fix.format(thisSecond) + \" \" + amPm;\n\t}", "public static Calendar getCalendar(Date date) {\n Calendar cal = Calendar.getInstance();\n cal.setTime(date);\n return cal;\n }", "ForwardingCalendar(CalendarImplementation cal) {\n this.cal = cal;\n }", "private DateTime goodLocalDateTimeUse() {\n LocalDateTime ldt = new LocalDateTime(2020, 6, 2, 8, 0, 0, 0);\n return new DateTime(ldt.getYear(), ldt.getMonthOfYear(), ldt.getDayOfYear(), ldt.getHourOfDay(),\n ldt.getMinuteOfHour(), ldt.getSecondOfMinute(), ldt.getMillisOfSecond(),\n DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n\n }", "public Calendar GetCalendar(String sDateTime) throws Exception {\n String YYYY = \"\", MM = \"\", DD = \"\", hh = \"\", mm = \"\", ss = \"\";\n Calendar calendarInstance = null;\n try {\n //considering deafult date format as YYYY-MM-DD hh:mm:ss (e.g 2012-11-21 23:59:30)\n sDateTime = sDateTime.trim();\n if (sDateTime.equalsIgnoreCase(\"\")) {\n throw new Exception(\"Blank datetime value\");\n }\n\n YYYY = sDateTime.substring(0, 4);\n MM = sDateTime.substring(5, 7);\n DD = sDateTime.substring(8, 10);\n hh = sDateTime.substring(11, 13);\n mm = sDateTime.substring(14, 16);\n ss = sDateTime.substring(17, 19);\n MM = \"\" + (Integer.parseInt(MM) - 1);\n if (MM.length() < 2) {\n MM = \"0\" + MM;\n }\n\n calendarInstance = Calendar.getInstance();\n calendarInstance.set(Integer.parseInt(YYYY), Integer.parseInt(MM), Integer.parseInt(DD), Integer.parseInt(hh), Integer.parseInt(mm), Integer.parseInt(ss));\n return calendarInstance;\n } catch (Exception e) {\n throw new Exception(\"SetCalendar : \" + e.toString());\n }\n }", "public Calendar calendario(Date date) {\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(date);\r\n return calendar;\r\n }", "public static Calendar dateToCalendar(Date date){ \r\n Calendar cal = Calendar.getInstance();\r\n cal.setTime(date);\r\n return cal;\r\n }", "public DateTime(final BusinessObject parent) {\n super(parent);\n if (clock == null) {\n throw new ApplicationException(\"Clock not set up\");\n }\n setValue(new java.util.Date(clock.getTime()));\n isNull = false;\n }", "public static Calendar getExchClosingCalendar(Calendar aDate) {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n if (null != aDate) {\r\n result.setTimeInMillis(aDate.getTimeInMillis());\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n }\r\n return result;\r\n }", "public BwCalendar getCalendar() {\n if (calendar == null) {\n calendar = new BwCalendar();\n }\n\n return calendar;\n }", "private DateTime goodLocalTimeUse() {\n LocalTime lt = new LocalTime(8, 0, 0, 0);\n return new DateTime().toDateTime(DateTimeZone.forID(\"America/New_York\"))\n .withTime(lt)\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "public Calendar getCurrentCalendar()\n {\n return this.currentCalendar;\n }", "private DateTime goodLocalDateTimeUse2() {\n LocalDateTime ldt = new LocalDateTime(2020, 6, 2, 8, 0, 0, 0);\n return new DateTime(ldt.getYear(), ldt.getMonthOfYear(), ldt.getDayOfYear(), ldt.getHourOfDay(),\n ldt.getMinuteOfHour(), ldt.getSecondOfMinute(), ldt.getMillisOfSecond(),\n DateTimeZone.getDefault())\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n\n }", "public Entry(Calendar date){\n this.date = date; \n }", "public String getDateTime(Calendar cal, int GMT_OFFSET_SECONDS, String DATE_TIME_FORMAT) throws Exception {\n\n String sRetVal = \"\";\n String DefaultFormat = \"yyyyMMddHHmmss\";\n int GMT_OFFSET_DIFF = 0;\n try {\n\n //check for valid Calender values\n if (cal == null) {\n cal = Calendar.getInstance();\n }\n\n //check for valid FORMAT values\n if (DATE_TIME_FORMAT == null) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n if (DATE_TIME_FORMAT.trim().toUpperCase().equalsIgnoreCase(\"\")) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n\n //check GMT RAW OFF SET difference\n int CURR_GMT_OFFSET = TimeZone.getDefault().getRawOffset() / 1000;\n //in case Current GMT is GREATER THAN provided GMT\n if (CURR_GMT_OFFSET > GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n\n //in case Current GMT is SMALLER THAN provided GMT\n } else if (CURR_GMT_OFFSET < GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n }\n\n if (CURR_GMT_OFFSET == GMT_OFFSET_SECONDS) {\n GMT_OFFSET_DIFF = 0;\n }\n\n //setting calender datetime as per GMT\n cal.add(Calendar.SECOND, GMT_OFFSET_DIFF);\n\n //using SimpleDateFormat class\n sRetVal = new SimpleDateFormat(DATE_TIME_FORMAT).format(cal.getTime());\n return sRetVal;\n\n } catch (Exception e) {\n println(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n throw new Exception(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n } finally {\n }\n\n }", "java.util.Calendar getLastrun();", "public static Calendar m13184a() {\n Calendar instance = Calendar.getInstance();\n instance.set(11, 12);\n instance.set(12, C3792d.m14088c());\n instance.set(13, 0);\n return instance;\n }", "private void makeLocalCalendar() {\n\t\t// TODO Auto-generated method stub\n\t\tContentValues values = new ContentValues();\n\t\tvalues.put(Calendars.ACCOUNT_NAME, PATIENT_ACCOUNT_NAME);\n\t\tvalues.put(Calendars.ACCOUNT_TYPE, CalendarContract.ACCOUNT_TYPE_LOCAL);\n\t\tvalues.put(Calendars.NAME, PATIENT_NAME);\n\t\tvalues.put(Calendars.CALENDAR_DISPLAY_NAME, PATIENT_NAME);\n\t\tvalues.put(Calendars.CALENDAR_COLOR, Color.BLACK);\n\t\tvalues.put(Calendars.CALENDAR_ACCESS_LEVEL, Calendars.CAL_ACCESS_OWNER);\n\t\tvalues.put(Calendars.OWNER_ACCOUNT, PATIENT_EMAIL);\n\t\tvalues.put(Calendars.CALENDAR_TIME_ZONE, TimeZone.getAvailableIDs()\n\t\t\t\t.toString());\n\t\tvalues.put(Calendars.SYNC_EVENTS, 1);\n\n\t\tUri.Builder builder = CalendarContract.Calendars.CONTENT_URI\n\t\t\t\t.buildUpon();\n\t\tbuilder.appendQueryParameter(Calendars.ACCOUNT_NAME,\n\t\t\t\t\"com.grokkingandroid\");\n\t\tbuilder.appendQueryParameter(Calendars.ACCOUNT_TYPE,\n\t\t\t\tCalendarContract.ACCOUNT_TYPE_LOCAL);\n\t\tbuilder.appendQueryParameter(CalendarContract.CALLER_IS_SYNCADAPTER,\n\t\t\t\t\"true\");\n\n\t\tUri uri = getContentResolver().insert(builder.build(), values);\n\n\t}", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public void setDateTime(java.util.Calendar param) {\n this.localDateTime = param;\n }", "private void resetCalendarToMonth(Calendar calendar) {\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, 1);\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\n\t\tcalendar.set(Calendar.MINUTE, 0);\n\t\tcalendar.set(Calendar.SECOND, 0);\n\t\tcalendar.set(Calendar.MILLISECOND, 0);\n\t}", "public static Calendar getFechaHoy(){\n\n Calendar cal = new GregorianCalendar();\n cal.set(Calendar.HOUR_OF_DAY,0);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public static Calendar toCalendar(final Date date) {\n\t\tfinal Calendar cal = Calendar.getInstance();\n\t\tcal.setTime(date);\n\n\t\treturn cal;\n\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tgetLayouts();\n\n\t\t\t\tCalendar pre = (Calendar) calendar.clone();\n\n\t\t\t\tcurrentMonth--;\n\n\t\t\t\tif (currentMonth == 0) {\n\t\t\t\t\tcurrentMonth = 12;\n\t\t\t\t\tcurrentYear--;\n\t\t\t\t}\n\t\t\t\tpre.set(Calendar.MONTH, currentMonth);\n\t\t\t\tpre.set(Calendar.YEAR, currentYear);\n\t\t\t\tpre.set(Calendar.DATE, 1);\n\n\t\t\t\tpositionPre = pre.getTime().toString().split(\" \");\n\t\t\t\tpreviousDayPosition = ReturnCalendarDetails\n\t\t\t\t\t\t.getPosition(positionPre[0]);\n\n\t\t\t\tgetCalendar(\n\t\t\t\t\t\tReturnCalendarDetails.getCurrentMonth(positionPre[1]),\n\t\t\t\t\t\tReturnCalendarDetails.getPosition(positionPre[0]),\n\t\t\t\t\t\tInteger.parseInt(positionPre[5]));\n\n\t\t\t\tSystem.out.println(\"!!\" + pre.getTime());\n\t\t\t}", "public static Calendar getExchClosingTime() {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n return result;\r\n }", "public PickDateTime(Calendar cal) {\n\t\tjbInit();\n\t}", "public static process.proxies.UU95_CalendarSetting initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject)\r\n\t{\r\n\t\treturn new process.proxies.UU95_CalendarSetting(context, mendixObject);\r\n\t}", "public GregorianCalendar getCalendar() {\r\n return new GregorianCalendar(this.year, this.month - 1, this.day);\r\n }", "public static Calendar dateToCalendar(Date date) {\r\n Calendar cal = Calendar.getInstance();\r\n cal.clear();\r\n cal.setTimeInMillis(date.getTime());\r\n return cal;\r\n }", "public static CalendarDate getCalendarDateFromFixedDate(long fixedDate) {\n\tint year = getYear(fixedDate);\n\tint pday = (int)(fixedDate - getFixedDate(year, JANUARY, 1));\n\tint corr = 2;\n\tlong mar1 = getFixedDate(year, MARCH, 1);\n\tif (fixedDate < mar1) {\n\t corr = 0;\n\t} else if (fixedDate >= mar1 && isLeapYear(year)) {\n\t corr = 1;\n\t}\n\tint month = floorDivide((12 * (pday + corr) + 373), 367) - 1;\n\tint day = (int)(fixedDate - getFixedDate(year, month, 1) + 1);\n\tint dow = getDayOfWeekFromFixedDate(fixedDate);\n\tCalendarDate cdate = new CalendarDate(year, month, day);\n\tcdate.setDayOfWeek(dow);\n\treturn cdate;\n }", "@Override\n public Object clone() {\n return new ShortDate(getTime());\n }", "public Calendar calcEasterDate(){\n a = year% 19;\n b = (int) Math.floor(year/100);\n c = year % 100;\n d = (int) Math.floor(b/4);\n e = b % 4;\n f = (int) Math.floor((b + 8) / 25);\n g = (int) Math.floor((b - f + 1) / 3);\n h = (19*a + b - d - g + 15) % 30;\n i = (int) Math.floor(c/4);\n k = c%4;\n L = (32 + 2*e + 2*i - h - k) % 7;\n m = (int) Math.floor((a + 11*h + 22*L) / 451);\n month = (int) Math.floor((h + L - 7*m + 114) / 31);\n day = (((h + L - (7*m) + 114) % 31) + 1);\n Calendar instance = Calendar.getInstance();\n instance.set(year, month, day);\n return instance;\n }", "RollingCalendar(TimeZone tz, Locale locale)\r\n\t{\r\n\t\tsuper(tz, locale);\r\n\t}", "public Calendar getCalendar() {\n return _calendar;\n }", "public static Date today() // should it be void?\n {\n GregorianCalendar currentDate = new GregorianCalendar();\n int day = currentDate.get(GregorianCalendar.DATE);\n int month = currentDate.get(GregorianCalendar.MONTH) + 1;\n int year = currentDate.get(GregorianCalendar.YEAR);\n int hour = currentDate.get(GregorianCalendar.HOUR_OF_DAY);\n int minute = currentDate.get(GregorianCalendar.MINUTE);\n return new Date(day, month, year, hour, minute);\n }", "private Calendar convertDateToCalendar(Date date) {\n Calendar calendar = GregorianCalendar.getInstance();\n calendar.setTime(date);\n return calendar;\n }", "public Calendar getCalendar() {\n return cal;\n }", "public static Calendar getCurrentTime(String argGMT) {\r\n\t\treturn DateToCalendar(getTime(argGMT));\r\n\t}" ]
[ "0.60738206", "0.59337264", "0.57955754", "0.56341803", "0.56341803", "0.5618543", "0.55970615", "0.55515325", "0.54607946", "0.5441552", "0.53626597", "0.53211135", "0.53177387", "0.5300809", "0.5278537", "0.52379596", "0.5221206", "0.5207286", "0.51975584", "0.5196771", "0.5175311", "0.51686406", "0.5144665", "0.51439065", "0.5143484", "0.51223063", "0.5115705", "0.50731224", "0.5036721", "0.49972567", "0.49797243", "0.49725887", "0.49678254", "0.49553", "0.49546233", "0.49544838", "0.4895474", "0.48891824", "0.48704892", "0.48679104", "0.48613754", "0.48447716", "0.48356336", "0.48337996", "0.48262262", "0.48232394", "0.48224863", "0.48213518", "0.48036653", "0.480001", "0.4797998", "0.4789268", "0.47858408", "0.47746065", "0.47736493", "0.47602656", "0.47552282", "0.47510675", "0.4738908", "0.4737924", "0.47318798", "0.47044152", "0.46963555", "0.4667883", "0.4664572", "0.46543193", "0.4645469", "0.46431267", "0.46307123", "0.46293852", "0.46104944", "0.4605189", "0.4598822", "0.45831847", "0.45821694", "0.4570029", "0.45498255", "0.45448425", "0.45446587", "0.45395353", "0.4530043", "0.45178345", "0.45131925", "0.45107105", "0.4507722", "0.4497855", "0.44927028", "0.44845152", "0.4482617", "0.44815877", "0.4479448", "0.44783905", "0.44631687", "0.44586042", "0.44549757", "0.44533893", "0.44522765", "0.4449918", "0.4443747", "0.44394627" ]
0.50258124
29
Creates a Calendar object representing the time at which the New York stock market closes today
public static Calendar getExchClosingTime() { Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC); result.set(Calendar.MILLISECOND, 0); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NonNull public static CalendarDay today() {\n return from(LocalDate.now());\n }", "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "Calendar getCalendar();", "public StockDate GetCalendar()\r\n\t{\r\n\t\treturn date;\r\n\t}", "String getCloseDate();", "public static Calendar getExchClosingCalendar(Calendar aDate) {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n if (null != aDate) {\r\n result.setTimeInMillis(aDate.getTimeInMillis());\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n }\r\n return result;\r\n }", "public void setTodayCalendar()\n {\n this.currentCalendar = Calendar.getInstance();\n }", "Calendar toCalendar();", "Calendar toCalendar();", "public static Calendar getFechaHoy(){\n\n Calendar cal = new GregorianCalendar();\n cal.set(Calendar.HOUR_OF_DAY,0);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public static Calendar getExchOpeningTime() {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n return result;\r\n }", "public Calendar endOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE) + 1);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public Calendar() {\n }", "public java.sql.Date getClosedate() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((java.sql.Date) __getCache(\"closedate\")));\n }", "public static Calendar getDefaultScheduleTime() {\n Calendar scheduled = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/Copenhagen\"));\n scheduled.add(Calendar.HOUR, 1);\n\n scheduled.set(Calendar.MINUTE, 0);\n scheduled.set(Calendar.SECOND, 0);\n scheduled.set(Calendar.MILLISECOND, 0);\n\n return scheduled;\n }", "Date getEndDay();", "public Calendar() {\n\t\tthis(() -> LocalDateTime.now());\n\t}", "public static Calendar ahoraCalendar() {\n return Calendar.getInstance(TimeZone.getTimeZone(\"America/Guayaquil\"));\n }", "public Date getClosingDate() {\n Date d = null;\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\");\n try {\n d = sdf.parse(closingDate);\n }\n catch (Exception e) {e.printStackTrace();}\n return d;\n }", "public BwCalendar getCalendar() {\n if (calendar == null) {\n calendar = new BwCalendar();\n }\n\n return calendar;\n }", "public static Calendar getExchOpeningCalendar(Calendar aDate) {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n if (null != aDate) {\r\n result.setTimeInMillis(aDate.getTimeInMillis());\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n }\r\n return result;\r\n }", "public static Date createDate(int yyyy, int month, int day) {\n/* 75 */ CALENDAR.clear();\n/* 76 */ CALENDAR.set(yyyy, month - 1, day);\n/* 77 */ return CALENDAR.getTime();\n/* */ }", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "public static Date today() // should it be void?\n {\n GregorianCalendar currentDate = new GregorianCalendar();\n int day = currentDate.get(GregorianCalendar.DATE);\n int month = currentDate.get(GregorianCalendar.MONTH) + 1;\n int year = currentDate.get(GregorianCalendar.YEAR);\n int hour = currentDate.get(GregorianCalendar.HOUR_OF_DAY);\n int minute = currentDate.get(GregorianCalendar.MINUTE);\n return new Date(day, month, year, hour, minute);\n }", "KitCalculatorsFactory<E> unregisterHolidayCalendar(String calendarName);", "public Holidays (){\n name= \"Exotic Beach Holiday of a Lifetime\";\n cost = 5000;\n location = \"Fesdu Island, Maldives\";\n type = \"beach\";\n }", "public Calendar getEndDate() {\n\t\tCalendar cal = Calendar.getInstance();\n \t\tcal.setTimeInMillis(startTime);\n \t\t\n\t\treturn cal;\n\t}", "private Date getSamoaNow() {\n\t\t// Get the current datetime in UTC\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(new Date());\n\t\t\n\t\t// Get the datetime minus 11 hours (Samoa is UTC-11)\n\t\tcalendar.add(Calendar.HOUR_OF_DAY, -11);\n\t\t\n\t\treturn calendar.getTime();\n\t}", "public void Close() {\n\t\tendDate = sdf.format(new Date());\n\t}", "public Calendar getCalendar() {\n Calendar c = Calendar.getInstance();\n c.setTime(cal.getTime());\n return c;\n }", "public static Date createDate(int yyyy, int month, int day, int hour, int min) {\n/* 93 */ CALENDAR.clear();\n/* 94 */ CALENDAR.set(yyyy, month - 1, day, hour, min);\n/* 95 */ return CALENDAR.getTime();\n/* */ }", "public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) {\r\n Calendar usaCal = Calendar.getInstance(tz);\r\n usaCal.clear();\r\n usaCal.set(year, month, day, hrs, min, secs);\r\n return usaCal;\r\n }", "@Override\n\tpublic Calendar getFinishDate() {\n\t\treturn Calendar.getInstance();\n\t}", "public JCalendar() {\r\n init();\r\n resetToDefaults();\r\n }", "KitCalculatorsFactory<E> unregisterAllHolidayCalendars();", "public static Calendar convertToLondonCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar gmtCal = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/London\"));\r\n gmtCal.clear();\r\n gmtCal.setTimeInMillis(timeInMillis);\r\n return gmtCal;\r\n }", "protected Calendar getCurrentCalendar() {\n Calendar current = new Calendar();\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n SimpleDateFormat dateFormatHour = new SimpleDateFormat(\"H\");\n SimpleDateFormat dateFormatWeekDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat dateFormatMonth = new SimpleDateFormat(\"MMM\");\n\n current.setHour(dateFormatHour.format(calendar.getTime()).toString());\n current.setWeekday(dateFormatWeekDay.format(calendar.getTime()));\n current.setMonth(dateFormatMonth.format(calendar.getTime()));\n\n return current;\n }", "public Calendar getReturnDate()\n {\n /*New Calendar for Return Date*/\n Calendar dueDate = Calendar.getInstance();\n\n /*Month is Current Month*/\n dueDate.set(today.MONTH, today.get(today.MONTH));\n /*Year is Current Year*/\n dueDate.set(today.YEAR, today.get(today.YEAR));\n /*Due Date is 21 Days Later*/\n dueDate.set(today.DATE, today.get(today.DATE + 21));\n\n return dueDate;\n }", "public static void setEndOfDay(Calendar calendar) {\r\n\t\tcalendar.add(Calendar.DATE, 1);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\tcalendar.set(Calendar.MILLISECOND, 0);\r\n\t}", "String getPreviousCloseDate();", "private static Calendar createCalendar(int year, int month, int date) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setLenient(false);\r\n\t\tcalendar.set(Calendar.YEAR, year);\r\n\t\tcalendar.set(Calendar.MONTH, month - 1);\r\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, date);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\treturn calendar;\r\n\t}", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "public GregorianCalendar getCalendar() {\r\n return new GregorianCalendar(this.year, this.month - 1, this.day);\r\n }", "public static CalendarDate getCalendarDate(long utc) {\n\tlong days;\n\tint millis;\n\n\tdays = utc / ONE_DAY;\n\tmillis = (int)(utc % ONE_DAY);\n\tif (millis < 0) {\n\t millis += ONE_DAY;\n\t days--;\n\t}\n\tdays += EPOCH_DATE;\n\tCalendarDate cdate = getCalendarDateFromFixedDate(days);\n\tcdate.setTimeOfDay(millis);\n\treturn cdate;\n }", "Calendar registeredAt();", "private DateTime goodLocalDateUse2() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n LocalTime now = LocalTime.now();\n return new DateTime(ld.getYear(), ld.getMonthOfYear(), ld.getDayOfYear(), now.getHourOfDay(),\n now.getMinuteOfHour(), now.getSecondOfMinute(), now.getMillisOfSecond(),\n DateTimeZone.getDefault())\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "public Calendar toCalendar() {\n\t\treturn (Calendar) _cal.clone();\n\t}", "public static int getTodaysDay() {\t\r\n\t\t\r\n\t\tTime time = new Time();\r\n\t\ttime.setToNow();\r\n\t\treturn time.monthDay;\t\r\n\t\t\r\n\t}", "private DateTime goodLocalDateUse() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n LocalTime now = LocalTime.now();\n return new DateTime(ld.getYear(), ld.getMonthOfYear(), ld.getDayOfYear(), now.getHourOfDay(),\n now.getMinuteOfHour(), now.getSecondOfMinute(), now.getMillisOfSecond(),\n DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "@Test\n public void getterCalendar(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n Assert.assertEquals(2018,calendar.getYear());\n Assert.assertEquals(4,calendar.getMonth());\n Assert.assertEquals(25,calendar.getDayOfMonth());\n }", "public String getCloseDate() {\n return closeDate;\n }", "java.util.Calendar getEndTime();", "public static LocalDate generateExpiration() {\n LocalDate today = LocalDate.now(); //gives us the information at the moment the program is running\n int expYear = today.getYear() + 5;\n LocalDate exp = LocalDate.of(expYear, today.getMonth(), today.getDayOfMonth());\n return exp;\n }", "Calendar getDepartureDateAndTime();", "public static HolidayCalendar[] calendarArray() {\n return new HolidayCalendar[] {TARGET };\n }", "Calendar occurredAt();", "private Date getYestoday() {\n\t\tDate dNow = new Date(); // 当前时间\n\t\tDate dBefore = new Date();\n\t\tCalendar calendar = Calendar.getInstance(); // 得到日历\n\t\tcalendar.setTime(dNow);// 把当前时间赋给日历\n\t\tcalendar.add(Calendar.DAY_OF_MONTH, -1); // 设置为前一天\n\t\tdBefore = calendar.getTime(); // 得到前一天的时间\n\t\treturn dBefore;\n\t}", "public CinemaDate() {\n }", "public Forecastday() {\n }", "private Date getTestListingDateTimeStamp() {\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/London\"));\n\n GregorianCalendar calendar = new GregorianCalendar(2010, 0, 1, 17, 0);\n return new Date(calendar.getTimeInMillis());\n }", "public Calendar getExpires() {\n Calendar calendar = null;\n if (this.expires != null) {\n calendar = (Calendar)this.expires.clone();\n }\n return calendar;\n }", "public static Calendar getExchOpeningTimeFromGraph(BaseGraph<AbstractGraphPoint> graph) {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n if (null != graph && 0 < graph.size()) {\r\n AbstractGraphPoint first = graph.first();\r\n result.setTimeInMillis(first.getTimestamp());\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n }\r\n return result;\r\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tgetLayouts();\n\n\t\t\t\tCalendar pre = (Calendar) calendar.clone();\n\n\t\t\t\tcurrentMonth--;\n\n\t\t\t\tif (currentMonth == 0) {\n\t\t\t\t\tcurrentMonth = 12;\n\t\t\t\t\tcurrentYear--;\n\t\t\t\t}\n\t\t\t\tpre.set(Calendar.MONTH, currentMonth);\n\t\t\t\tpre.set(Calendar.YEAR, currentYear);\n\t\t\t\tpre.set(Calendar.DATE, 1);\n\n\t\t\t\tpositionPre = pre.getTime().toString().split(\" \");\n\t\t\t\tpreviousDayPosition = ReturnCalendarDetails\n\t\t\t\t\t\t.getPosition(positionPre[0]);\n\n\t\t\t\tgetCalendar(\n\t\t\t\t\t\tReturnCalendarDetails.getCurrentMonth(positionPre[1]),\n\t\t\t\t\t\tReturnCalendarDetails.getPosition(positionPre[0]),\n\t\t\t\t\t\tInteger.parseInt(positionPre[5]));\n\n\t\t\t\tSystem.out.println(\"!!\" + pre.getTime());\n\t\t\t}", "public Calendar getCalendar() {\n return _iborIndex.getCalendar();\n }", "public static final DateUtil localToday()\n {\n return today(TimeZone.getDefault());\n }", "public Calendar getCalendar() {\n return cal;\n }", "Calendar getTimeStamp();", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "public Calendar getLastUpdate() {\n\t\treturn Calendar.getInstance();\n\t}", "public DateTime(final BusinessObject parent) {\n super(parent);\n if (clock == null) {\n throw new ApplicationException(\"Clock not set up\");\n }\n setValue(new java.util.Date(clock.getTime()));\n isNull = false;\n }", "Integer getEndDay();", "public void clickCalendarCheckOutDate() {\n\t\tcalendarCheckOutButton.click();\n\t}", "public Calendar calcEasterDate(){\n a = year% 19;\n b = (int) Math.floor(year/100);\n c = year % 100;\n d = (int) Math.floor(b/4);\n e = b % 4;\n f = (int) Math.floor((b + 8) / 25);\n g = (int) Math.floor((b - f + 1) / 3);\n h = (19*a + b - d - g + 15) % 30;\n i = (int) Math.floor(c/4);\n k = c%4;\n L = (32 + 2*e + 2*i - h - k) % 7;\n m = (int) Math.floor((a + 11*h + 22*L) / 451);\n month = (int) Math.floor((h + L - 7*m + 114) / 31);\n day = (((h + L - (7*m) + 114) % 31) + 1);\n Calendar instance = Calendar.getInstance();\n instance.set(year, month, day);\n return instance;\n }", "public static void createArrayOfCalendars() {\n\n GregorianCalendar[] calendars = new GregorianCalendar[12];\n\n /*\n\n At this point, every element in the array has a value of null.\n\n */\n\n for (GregorianCalendar calendar : calendars) {\n System.out.println(calendar);\n }\n \n /*\n * Create a new calendar object and assign it to each element in the array. \n * \n */\n \n for (int i = 0; i < calendars.length; i++) {\n calendars[i] = new GregorianCalendar(2021, i + 1, 1);\n }\n \n for (GregorianCalendar calendar : calendars) {\n System.out.println(calendar);\n }\n \n /*\n * An enhanced for loop cannot modify the values of the elements in the array (.g., references to calendars), but we can call \n * mutator methods which midify the properties fo the referenced objects (e.g., day of the month).\n */\n \n for (GregorianCalendar calendar : calendars) {\n calendar.add(GregorianCalendar.DAY_OF_MONTH, 2);\n }\n \n for (GregorianCalendar calendar : calendars) {\n System.out.println(calendar);\n }\n }", "public Calendar getCurrentCalendar()\n {\n return this.currentCalendar;\n }", "public void setFechaFinal(Calendar fechaFinal){\r\n this.fechaFinal = fechaFinal;\r\n }", "public OrgDay() {\n events = new LinkedList<>();\n }", "public Date createDate()\n {\n Timestamp maxDate = new\n Timestamp(2021 - 1900, 11,\n 31, 23, 59, 59, 0);\n Timestamp minDate = new\n Timestamp(2017 - 1900, 0,\n 1, 0, 0, 0, 0);\n long range = maxDate.getTime() - minDate.getTime();\n long randTime = Math.abs(Main.rnd.nextLong()) % range;\n //we use abs because random number might be negative\n return new Date(minDate.getTime() + randTime);\n }", "public Date getDayEnd(TimeZone tz)\n\t{\n\t\tCalendar cal = Calendar.getInstance(tz, Locale.US);\n\t\tcal.set(this.year, this.month-1, this.day, 0, 0, 0);\n\t\tcal.set(Calendar.MILLISECOND, 0);\n\t\tcal.add(Calendar.DATE, 1);\n\t\treturn cal.getTime();\n\t}", "public static void getCalendar(Calendar cal, QuoteShort q) {\n\t\tcal.set(q.getYear(), q.getMonth()-1, q.getDay(), q.getHh(), q.getMm(),q.getSs());\r\n\t}", "java.util.Calendar getLastrun();", "@Test\r\n\tpublic void testCancelAuctionOnAuctionDoesntExistForNonProfit(){\r\n\t\tCalendar c = new Calendar();\t\r\n\t\tassertFalse(c.cancelAuction(myNonProfit, myAuctDateMoreThan2Days, myCurrDate));\t\t\r\n\t}", "private DateTime goodLocalDateUse3() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n return ld.toDateTimeAtStartOfDay(DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "private Date generateExpirationDate(){\n Calendar c = Calendar.getInstance();\n c.setTime(new Date());\n c.add(Calendar.DAY_OF_WEEK, CommonSecurityConfig.EXPIRATION);\n return c.getTime();\n }", "public static void main(String[] args) {\n TimeZone timezone = TimeZone.getTimeZone(\"Asia/Hong_Kong\");\n Calendar cal = Calendar.getInstance(timezone);\n System.out.println(cal.getActualMaximum(Calendar.DAY_OF_MONTH));\n }", "public Calendar getEndTime() {\r\n\t\treturn endTime;\r\n\t}", "@Test\n public void testGetMaxEndDate() {\n ApplicationInfo.info(\n DatabaseHelperTest.class, ApplicationInfo.TEST, ApplicationInfo.UNIT_TEST, \"testBeginsWithEmpty\");\n // Date expResult = null;\n Date result = DatabaseHelper.getMaxEndDate();\n Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"GMT+1\"));\n cal.setTime(result);\n assertEquals(3000, cal.get(Calendar.YEAR));\n assertEquals(Calendar.DECEMBER, cal.get(Calendar.MONTH));\n assertEquals(31, cal.get(Calendar.DATE));\n }", "public int getToday() {\n \treturn 0;\n }", "public static AbsTime factory() throws Time.Ex_TimeNotAvailable\n {\n return new AbsTime();\n }", "public Calendar getCalendar() {\n return _calendar;\n }", "public static DateUtil today(TimeZone timeZone)\n {\n // 86,400,000 = 1000 * 60 * 60 * 24 = milliseconds per day\n long currentUTCDateTime = System.currentTimeMillis();\n DateUtil d = new DateUtil((int)(currentUTCDateTime / 86400000L));\n\n /*\n * Gets the time zone offset, for current date, modified in case of\n * daylight savings. This is the offset to add *to* UTC to get local time.\n * Places east of Greenwich have a positive offset.\n * :era the era of the given date, AD = 1 BC = 0\n * :year the year in the given date.\n * Docs are unclear if 1900=0 or 1900. Does not use year in calcs anyway.\n * :month the month in the given date.\n * Month is 0-based. e.g., 0 for January.\n * :day the day-in-month of the given date.\n * :dayOfWeek the day-of-week of the given date. 1=Calendar.SUNDAY\n * :milliseconds the millis in day in <em>standard</em> local time.\n * :return the offset in millis to add *to* GMT to get local time.\n */\n int offsetInMillis = timeZone.getOffset(d.getOrdinal() >= Jan_01_0001 ? 1:0,\n d.getYYYY(),\n d.getMM()-1,\n d.getDD(),\n d.getCalendarDayOfWeek(),\n (int)(currentUTCDateTime % 86400000L)\n /* wrong. Should be local standard time. How to get it?? */\n );\n d.setOrdinal((int)((currentUTCDateTime + offsetInMillis) / 86400000L));\n return d;\n }", "@Override\n\tpublic Calendar getInitialDate() {\n\t\treturn Calendar.getInstance();\n\t}", "public Date getFechaSistema() {\n\t\tfechaSistema = new Date();\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(fechaSistema);\n\t\tcalendar.add(Calendar.HOUR, (-3));\n\t\tfechaSistema = calendar.getTime();\n\t\treturn fechaSistema;\n\t}", "public Integer getCalendarYy() {\r\n return calendarYy;\r\n }", "abstract GregorianCalendar getThreadLocalCalendar();", "public Holiday<GregorianCalendar> getHoliday() {\n return _holiday;\n }", "private static Calendar toUTCCalendarWithoutTime(final Date date) {\n final Calendar calendar = Calendar.getInstance();\n calendar.clear();\n calendar.setTime(date);\n calendar.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar;\n }", "public void setTodayDate() {\n\t\tfinal Calendar c = Calendar.getInstance();\r\n\t\tmYear = c.get(Calendar.YEAR);\r\n\t\tmMonth = c.get(Calendar.MONTH);\r\n\t\tmDay = c.get(Calendar.DAY_OF_MONTH);\r\n\r\n\t\tmaxYear = mYear - 10;\r\n\t\tmaxMonth = mMonth;\r\n\t\tmaxDay = mDay;\r\n\r\n\t\tminYear = mYear - 110;\r\n\t\tminMonth = mMonth;\r\n\t\tminDay = mDay;\r\n\t\t// display the current date (this method is below)\r\n\t\t// updateDisplay();\r\n\t\t updateDisplay(maxYear, maxMonth, maxDay);\r\n\t}", "public static LocalDate getDayAfterTomorrow() {\n\t\treturn LocalDate.now().plus(Period.ofDays(2));\n\t}", "@Test\r\n\tpublic void testCancelAuctionOnAuctionExsistsForNonProfitPastAuctionDate(){\r\n\t\t\r\n\t\tCalendar c = new Calendar();\t\t\r\n\t\tc.addAuction(new AuctionRequest(d1, t1, myNonProfit.getOrgName()));\t\t\r\n\t\tassertFalse(c.cancelAuction(myNonProfit, myAuctDateAfterAuctionDate, myCurrDate));\r\n\t\t\r\n\t}" ]
[ "0.61461186", "0.5857553", "0.57743686", "0.56050456", "0.5572916", "0.55262", "0.54086435", "0.5358434", "0.5358434", "0.5312917", "0.5289059", "0.5246888", "0.5196287", "0.5095238", "0.5045759", "0.50414884", "0.50372714", "0.5036834", "0.50124466", "0.49988955", "0.49982613", "0.49979785", "0.49962282", "0.49913007", "0.49671453", "0.49588993", "0.49439698", "0.49397323", "0.49306476", "0.49022242", "0.48942235", "0.48875576", "0.4879772", "0.48796228", "0.4859664", "0.4837149", "0.48329931", "0.48282534", "0.48269844", "0.48263898", "0.48244798", "0.48164126", "0.48067856", "0.47947672", "0.47933167", "0.47848454", "0.47837913", "0.4767151", "0.47623077", "0.47599357", "0.47520894", "0.47470278", "0.47363156", "0.47060096", "0.47049132", "0.46956232", "0.4693033", "0.4691168", "0.46846697", "0.468005", "0.46764967", "0.4674745", "0.4674277", "0.46584213", "0.46552426", "0.46543473", "0.4651313", "0.46496224", "0.46388933", "0.46375242", "0.46317232", "0.46314552", "0.46311542", "0.4610719", "0.4610571", "0.4610452", "0.4609864", "0.4607817", "0.4599338", "0.45954964", "0.45819515", "0.45709923", "0.4556615", "0.45532453", "0.45414054", "0.45387435", "0.45306814", "0.45261395", "0.45219877", "0.45164907", "0.45142812", "0.4511672", "0.45111027", "0.45101014", "0.4508671", "0.45074657", "0.44984838", "0.44936842", "0.44903567", "0.4481162" ]
0.5863349
1
Given a Java Calendar object this function returns a new Calendar initialised to the same date in the New York / NASDAQUE Time Zone and with its time component set to the instant the stock market would CLOSE (Nominally this is 16:00:00 in the "America/New_York" Time Zone).
public static Calendar getExchClosingCalendar(Calendar aDate) { Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); if (null != aDate) { result.setTimeInMillis(aDate.getTimeInMillis()); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC); result.set(Calendar.MILLISECOND, 0); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public static Calendar convertToLondonCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar gmtCal = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/London\"));\r\n gmtCal.clear();\r\n gmtCal.setTimeInMillis(timeInMillis);\r\n return gmtCal;\r\n }", "Calendar getCalendar();", "Calendar toCalendar();", "Calendar toCalendar();", "public static Calendar deepCopyCalendar(Calendar cal) {\r\n Calendar result = null;\r\n if (null != cal) {\r\n Calendar newCal = Calendar.getInstance(cal.getTimeZone());\r\n newCal.clear();\r\n newCal.set(Calendar.YEAR, cal.get(Calendar.YEAR));\r\n newCal.set(Calendar.MONTH, cal.get(Calendar.MONTH));\r\n newCal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH));\r\n newCal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY));\r\n newCal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE));\r\n newCal.set(Calendar.SECOND, cal.get(Calendar.SECOND));\r\n newCal.set(Calendar.MILLISECOND, cal.get(Calendar.MILLISECOND));\r\n result = newCal;\r\n }\r\n return result;\r\n }", "public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) {\r\n Calendar usaCal = Calendar.getInstance(tz);\r\n usaCal.clear();\r\n usaCal.set(year, month, day, hrs, min, secs);\r\n return usaCal;\r\n }", "private static Calendar toUTCCalendarWithoutTime(final Date date) {\n final Calendar calendar = Calendar.getInstance();\n calendar.clear();\n calendar.setTime(date);\n calendar.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar;\n }", "public static Calendar getExchClosingTime() {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n return result;\r\n }", "private static Calendar getCalendar(final Long timeInMilliseconds, final TimeZone timeZone) {\n\n final Calendar calendar = Calendar.getInstance(timeZone);\n calendar.setTimeInMillis(timeInMilliseconds);\n\n return calendar;\n }", "public Date getUTCDate(String timeZone, Calendar cal);", "public Calendar toCalendar() {\n\t\treturn (Calendar) _cal.clone();\n\t}", "abstract GregorianCalendar getThreadLocalCalendar();", "public CalendarUtils(Calendar baseCalendar) {\r\n\t\tthis(baseCalendar.getTime(), baseCalendar.getTimeZone());\r\n\t}", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "private static Calendar createCalendar(int year, int month, int date) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setLenient(false);\r\n\t\tcalendar.set(Calendar.YEAR, year);\r\n\t\tcalendar.set(Calendar.MONTH, month - 1);\r\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, date);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\treturn calendar;\r\n\t}", "public static Calendar dateToCalendar(Date dteStart, TimeZone tz) {\r\n Calendar cal = Calendar.getInstance(tz);\r\n cal.clear();\r\n int year = dteStart.getYear() + 1900;\r\n int month = dteStart.getMonth();\r\n DateFormat formatter = new SimpleDateFormat(\"dd\");\r\n String strDay = formatter.format(dteStart);\r\n int day = Integer.parseInt(strDay);\r\n int hrs = dteStart.getHours();\r\n int min = dteStart.getMinutes();\r\n int secs = dteStart.getSeconds();\r\n cal.set(Calendar.YEAR, year);\r\n cal.set(Calendar.MONTH, month);\r\n cal.set(Calendar.DAY_OF_MONTH, day);\r\n cal.set(Calendar.HOUR_OF_DAY, hrs);\r\n cal.set(Calendar.MINUTE, min);\r\n cal.set(Calendar.SECOND, secs);\r\n return cal;\r\n }", "public Calendar endOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE) + 1);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public Calendar() {\n\t\tthis(() -> LocalDateTime.now());\n\t}", "public JCalendar() {\r\n init();\r\n resetToDefaults();\r\n }", "KitCalculatorsFactory<E> unregisterHolidayCalendar(String calendarName);", "public static Calendar getDefaultScheduleTime() {\n Calendar scheduled = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/Copenhagen\"));\n scheduled.add(Calendar.HOUR, 1);\n\n scheduled.set(Calendar.MINUTE, 0);\n scheduled.set(Calendar.SECOND, 0);\n scheduled.set(Calendar.MILLISECOND, 0);\n\n return scheduled;\n }", "public static final Calendar getCalendar(int date, int month, int year) {\r\n\t\tCalendar cal = Calendar.getInstance(); // locale-specific\r\n\t\t// cal.setTime(dateObject);\r\n\t\tcal.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcal.set(Calendar.MINUTE, 0);\r\n\t\tcal.set(Calendar.SECOND, 0);\r\n\t\tcal.set(Calendar.MILLISECOND, 0);\r\n\r\n\t\tcal.set(Calendar.DATE, date);\r\n\t\tcal.set(Calendar.MONTH, month);\r\n\t\tcal.set(Calendar.YEAR, year);\r\n\t\treturn cal;\r\n\t}", "@NonNull public static CalendarDay today() {\n return from(LocalDate.now());\n }", "public StockDate GetCalendar()\r\n\t{\r\n\t\treturn date;\r\n\t}", "public static Calendar getExchOpeningCalendar(Calendar aDate) {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n if (null != aDate) {\r\n result.setTimeInMillis(aDate.getTimeInMillis());\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n }\r\n return result;\r\n }", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute, int second) {\r\n\t\tCalendar calendar = createCalendar(year, month, date, hour, minute);\r\n\t\tcalendar.set(Calendar.SECOND, second);\r\n\t\treturn calendar;\r\n\t}", "public static Calendar ahoraCalendar() {\n return Calendar.getInstance(TimeZone.getTimeZone(\"America/Guayaquil\"));\n }", "public Calendar forDate(Date date) {\r\n\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.setTime(date);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "private Date getSamoaNow() {\n\t\t// Get the current datetime in UTC\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(new Date());\n\t\t\n\t\t// Get the datetime minus 11 hours (Samoa is UTC-11)\n\t\tcalendar.add(Calendar.HOUR_OF_DAY, -11);\n\t\t\n\t\treturn calendar.getTime();\n\t}", "public static Calendar getFechaHoy(){\n\n Calendar cal = new GregorianCalendar();\n cal.set(Calendar.HOUR_OF_DAY,0);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "private DateTime goodLocalDateUse2() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n LocalTime now = LocalTime.now();\n return new DateTime(ld.getYear(), ld.getMonthOfYear(), ld.getDayOfYear(), now.getHourOfDay(),\n now.getMinuteOfHour(), now.getSecondOfMinute(), now.getMillisOfSecond(),\n DateTimeZone.getDefault())\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "public static void setEndOfDay(Calendar calendar) {\r\n\t\tcalendar.add(Calendar.DATE, 1);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\tcalendar.set(Calendar.MILLISECOND, 0);\r\n\t}", "protected Calendar getCurrentCalendar() {\n Calendar current = new Calendar();\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n SimpleDateFormat dateFormatHour = new SimpleDateFormat(\"H\");\n SimpleDateFormat dateFormatWeekDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat dateFormatMonth = new SimpleDateFormat(\"MMM\");\n\n current.setHour(dateFormatHour.format(calendar.getTime()).toString());\n current.setWeekday(dateFormatWeekDay.format(calendar.getTime()));\n current.setMonth(dateFormatMonth.format(calendar.getTime()));\n\n return current;\n }", "public static CalendarDate getCalendarDate(long utc) {\n\tlong days;\n\tint millis;\n\n\tdays = utc / ONE_DAY;\n\tmillis = (int)(utc % ONE_DAY);\n\tif (millis < 0) {\n\t millis += ONE_DAY;\n\t days--;\n\t}\n\tdays += EPOCH_DATE;\n\tCalendarDate cdate = getCalendarDateFromFixedDate(days);\n\tcdate.setTimeOfDay(millis);\n\treturn cdate;\n }", "public Calendar() {\n }", "public Calendar getCurrentMonthCalendarObj() throws Throwable{\r\n\r\n\t\tString dateInput = \"01/\"+month+\"/\"+year;\t\t\t\r\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MMMM/yyyy\");\r\n\t\tDate startDate = df.parse(dateInput);\r\n\t\tCalendar c = Calendar.getInstance(); // this takes current date\r\n\t c.setTime(startDate); // set date to specified in arguement\r\n\t\treturn c;\r\n\t}", "public static Calendar getExchOpeningTime() {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n return result;\r\n }", "public Calendar getCalendar() {\n Calendar c = Calendar.getInstance();\n c.setTime(cal.getTime());\n return c;\n }", "public VCalendar clone() {\n\t\treturn new VCalendar(this.content, this.collectionId, this.resourceId, this.earliestStart, this.latestEnd, null);\n\t}", "private DateTime goodLocalDateUse() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n LocalTime now = LocalTime.now();\n return new DateTime(ld.getYear(), ld.getMonthOfYear(), ld.getDayOfYear(), now.getHourOfDay(),\n now.getMinuteOfHour(), now.getSecondOfMinute(), now.getMillisOfSecond(),\n DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "private DateTime goodLocalDateUse3() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n return ld.toDateTimeAtStartOfDay(DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "public static Date createDate(int yyyy, int month, int day) {\n/* 75 */ CALENDAR.clear();\n/* 76 */ CALENDAR.set(yyyy, month - 1, day);\n/* 77 */ return CALENDAR.getTime();\n/* */ }", "public Object clone() {\n return new Value(_calendar);\n }", "private Calendar createNewCalendar(String dateAndTime) {\n // initiate a calendar\n Calendar calendar = Calendar.getInstance();\n // take the given dateandTime string and split it into the different values\n String date = dateAndTime.split(\" \")[0];\n String time = dateAndTime.split(\" \")[1];\n int year = Integer.valueOf(date.split(\"-\")[0]);\n int month = Integer.valueOf(date.split(\"-\")[1]) - 1;\n int day = Integer.valueOf(date.split(\"-\")[2]);\n int hour = Integer.valueOf(time.split(\":\")[0]);\n int min = Integer.valueOf(time.split(\":\")[1]);\n // set the calendar to the wanted values\n calendar.set(year, month, day, hour, min);\n return calendar;\n }", "public static DateUtil today(TimeZone timeZone)\n {\n // 86,400,000 = 1000 * 60 * 60 * 24 = milliseconds per day\n long currentUTCDateTime = System.currentTimeMillis();\n DateUtil d = new DateUtil((int)(currentUTCDateTime / 86400000L));\n\n /*\n * Gets the time zone offset, for current date, modified in case of\n * daylight savings. This is the offset to add *to* UTC to get local time.\n * Places east of Greenwich have a positive offset.\n * :era the era of the given date, AD = 1 BC = 0\n * :year the year in the given date.\n * Docs are unclear if 1900=0 or 1900. Does not use year in calcs anyway.\n * :month the month in the given date.\n * Month is 0-based. e.g., 0 for January.\n * :day the day-in-month of the given date.\n * :dayOfWeek the day-of-week of the given date. 1=Calendar.SUNDAY\n * :milliseconds the millis in day in <em>standard</em> local time.\n * :return the offset in millis to add *to* GMT to get local time.\n */\n int offsetInMillis = timeZone.getOffset(d.getOrdinal() >= Jan_01_0001 ? 1:0,\n d.getYYYY(),\n d.getMM()-1,\n d.getDD(),\n d.getCalendarDayOfWeek(),\n (int)(currentUTCDateTime % 86400000L)\n /* wrong. Should be local standard time. How to get it?? */\n );\n d.setOrdinal((int)((currentUTCDateTime + offsetInMillis) / 86400000L));\n return d;\n }", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "public static Date createDate(int yyyy, int month, int day, int hour, int min) {\n/* 93 */ CALENDAR.clear();\n/* 94 */ CALENDAR.set(yyyy, month - 1, day, hour, min);\n/* 95 */ return CALENDAR.getTime();\n/* */ }", "public void setTodayCalendar()\n {\n this.currentCalendar = Calendar.getInstance();\n }", "public static Calendar removeTime(Calendar calendar){\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar;\n }", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "public static Calendar convertToExchCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar exchCal = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n exchCal.clear();\r\n exchCal.setTimeInMillis(timeInMillis);\r\n return exchCal;\r\n }", "public Calendar startOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE));\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public DateTime(Calendar c) {\n setCharacteristic(null);\n if (c == null) {\n setCharacteristic(null);\n setYear(YEAR_IS_NOT_KNOWN);\n setMonth(MONTH_IS_NOT_KNOWN);\n setDay(DAY_OF_MONTH_IS_NOT_KNOWN);\n setHours(0);\n setMinutes(0);\n setSeconds(0);\n } else {\n setYear(c.get(Calendar.YEAR));\n setMonth(c.get(Calendar.MONTH) + 1);\n setDay(c.get(Calendar.DAY_OF_MONTH));\n setHours(c.get(Calendar.HOUR_OF_DAY));\n setMinutes(c.get(Calendar.MINUTE));\n setSeconds(c.get(Calendar.SECOND));\n }\n }", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute) {\r\n\t\tCalendar calendar = createCalendar(year, month, date);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, hour);\r\n\t\tcalendar.set(Calendar.MINUTE, minute);\r\n\t\treturn calendar;\r\n\t}", "@Override\npublic final Object clone() {\n return new ClockTime(dateValue());\n }", "public GregorianCalendar getCalendar() {\r\n return new GregorianCalendar(this.year, this.month - 1, this.day);\r\n }", "public static CalendarDate getCalendarDateFromFixedDate(long fixedDate) {\n\tint year = getYear(fixedDate);\n\tint pday = (int)(fixedDate - getFixedDate(year, JANUARY, 1));\n\tint corr = 2;\n\tlong mar1 = getFixedDate(year, MARCH, 1);\n\tif (fixedDate < mar1) {\n\t corr = 0;\n\t} else if (fixedDate >= mar1 && isLeapYear(year)) {\n\t corr = 1;\n\t}\n\tint month = floorDivide((12 * (pday + corr) + 373), 367) - 1;\n\tint day = (int)(fixedDate - getFixedDate(year, month, 1) + 1);\n\tint dow = getDayOfWeekFromFixedDate(fixedDate);\n\tCalendarDate cdate = new CalendarDate(year, month, day);\n\tcdate.setDayOfWeek(dow);\n\treturn cdate;\n }", "public void testCalendar() {\n Calendar cal = rootBlog.getCalendar();\n assertEquals(rootBlog.getTimeZone(), cal.getTimeZone());\n }", "public static void updateCalendar() {\n time = Calendar.getInstance();\n hour = time.get(Calendar.HOUR_OF_DAY);\n minute = time.get(Calendar.MINUTE);\n day = time.get(Calendar.DAY_OF_MONTH);\n month = time.get(Calendar.MONTH) + 1; \n year = time.get(Calendar.YEAR);\n\n }", "default Clock getFixedClock(int year, int month, int day, int hour, int minute, int second, ZoneOffset zone) {\n return Clock.fixed(getLocalTime(year, month, day, hour, minute, second).toInstant(zone), zone);\n }", "public String getDateTime(Calendar cal, int GMT_OFFSET_SECONDS, String DATE_TIME_FORMAT) throws Exception {\n\n String sRetVal = \"\";\n String DefaultFormat = \"yyyyMMddHHmmss\";\n int GMT_OFFSET_DIFF = 0;\n try {\n\n //check for valid Calender values\n if (cal == null) {\n cal = Calendar.getInstance();\n }\n\n //check for valid FORMAT values\n if (DATE_TIME_FORMAT == null) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n if (DATE_TIME_FORMAT.trim().toUpperCase().equalsIgnoreCase(\"\")) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n\n //check GMT RAW OFF SET difference\n int CURR_GMT_OFFSET = TimeZone.getDefault().getRawOffset() / 1000;\n //in case Current GMT is GREATER THAN provided GMT\n if (CURR_GMT_OFFSET > GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n\n //in case Current GMT is SMALLER THAN provided GMT\n } else if (CURR_GMT_OFFSET < GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n }\n\n if (CURR_GMT_OFFSET == GMT_OFFSET_SECONDS) {\n GMT_OFFSET_DIFF = 0;\n }\n\n //setting calender datetime as per GMT\n cal.add(Calendar.SECOND, GMT_OFFSET_DIFF);\n\n //using SimpleDateFormat class\n sRetVal = new SimpleDateFormat(DATE_TIME_FORMAT).format(cal.getTime());\n return sRetVal;\n\n } catch (Exception e) {\n println(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n throw new Exception(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n } finally {\n }\n\n }", "KitCalculatorsFactory<E> unregisterAllHolidayCalendars();", "Calendar getTimeStamp();", "@Test\n public void testTimezone() {\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/Paris\"));\n\n SunTimes paris = SunTimes.compute()\n .on(2020, 5, 1) // May 1st, 2020, starting midnight\n .latitude(48, 51, 24.0) // Latitude of Paris: 48°51'24\" N\n .longitude(2, 21, 6.0) // Longitude: 2°21'06\" E\n .execute();\n System.out.println(\"Sunrise in Paris: \" + paris.getRise());\n System.out.println(\"Sunset in Paris: \" + paris.getSet());\n\n SunTimes newYork = SunTimes.compute()\n .on(2020, 5, 1) // May 1st, 2020, starting midnight\n .at(40.712778, -74.005833) // Coordinates of New York\n .execute();\n System.out.println(\"Sunrise in New York: \" + newYork.getRise());\n System.out.println(\"Sunset in New York: \" + newYork.getSet());\n\n SunTimes newYorkTz = SunTimes.compute()\n .on(2020, 5, 1) // May 1st, 2020, starting midnight\n .timezone(\"America/New_York\") // ...New York timezone\n .at(40.712778, -74.005833) // Coordinates of New York\n .execute();\n System.out.println(\"Sunrise in New York: \" + newYorkTz.getRise());\n System.out.println(\"Sunset in New York: \" + newYorkTz.getSet());\n }", "@Test\n public void getterCalendar(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n Assert.assertEquals(2018,calendar.getYear());\n Assert.assertEquals(4,calendar.getMonth());\n Assert.assertEquals(25,calendar.getDayOfMonth());\n }", "public static Calendar getCalendar(Date date) {\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tif (date != null) {\r\n\t\t\tcal.setTime(date);\r\n\t\t} else {\r\n\t\t\tcal.setTime(new Date());\r\n\t\t}\r\n\t\treturn cal;\r\n\t}", "public org.LNDCDC_NCS_NCSAR.NCSAR_BUSINESS_UNITS.apache.nifi.LNDCDC_NCS_NCSAR_NCSAR_BUSINESS_UNITS.Builder clearSRCCOMMITDTUTC() {\n SRC_COMMIT_DT_UTC = null;\n fieldSetFlags()[17] = false;\n return this;\n }", "public BwCalendar getCalendar() {\n if (calendar == null) {\n calendar = new BwCalendar();\n }\n\n return calendar;\n }", "java.util.Calendar getNextrun();", "public static Calendar dateToCalendar(Date date){ \r\n Calendar cal = Calendar.getInstance();\r\n cal.setTime(date);\r\n return cal;\r\n }", "public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static Calendar dateToCalendar(Date date) {\r\n Calendar cal = Calendar.getInstance();\r\n cal.clear();\r\n cal.setTimeInMillis(date.getTime());\r\n return cal;\r\n }", "public static Calendar getCalendar(Date date) {\n Calendar cal = Calendar.getInstance();\n cal.setTime(date);\n return cal;\n }", "public DateTime(final BusinessObject parent) {\n super(parent);\n if (clock == null) {\n throw new ApplicationException(\"Clock not set up\");\n }\n setValue(new java.util.Date(clock.getTime()));\n isNull = false;\n }", "private void resetCalendarToMonth(Calendar calendar) {\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, 1);\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\n\t\tcalendar.set(Calendar.MINUTE, 0);\n\t\tcalendar.set(Calendar.SECOND, 0);\n\t\tcalendar.set(Calendar.MILLISECOND, 0);\n\t}", "public java.sql.Date getClosedate() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((java.sql.Date) __getCache(\"closedate\")));\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tgetLayouts();\n\n\t\t\t\tCalendar pre = (Calendar) calendar.clone();\n\n\t\t\t\tcurrentMonth--;\n\n\t\t\t\tif (currentMonth == 0) {\n\t\t\t\t\tcurrentMonth = 12;\n\t\t\t\t\tcurrentYear--;\n\t\t\t\t}\n\t\t\t\tpre.set(Calendar.MONTH, currentMonth);\n\t\t\t\tpre.set(Calendar.YEAR, currentYear);\n\t\t\t\tpre.set(Calendar.DATE, 1);\n\n\t\t\t\tpositionPre = pre.getTime().toString().split(\" \");\n\t\t\t\tpreviousDayPosition = ReturnCalendarDetails\n\t\t\t\t\t\t.getPosition(positionPre[0]);\n\n\t\t\t\tgetCalendar(\n\t\t\t\t\t\tReturnCalendarDetails.getCurrentMonth(positionPre[1]),\n\t\t\t\t\t\tReturnCalendarDetails.getPosition(positionPre[0]),\n\t\t\t\t\t\tInteger.parseInt(positionPre[5]));\n\n\t\t\t\tSystem.out.println(\"!!\" + pre.getTime());\n\t\t\t}", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public static DateTime nowUTC() {\n return new DateTime(DateTimeZone.UTC);\n }", "public static void getCalendar(Calendar cal, QuoteShort q) {\n\t\tcal.set(q.getYear(), q.getMonth()-1, q.getDay(), q.getHh(), q.getMm(),q.getSs());\r\n\t}", "public static Calendar toCalendar(final Date date) {\n\t\tfinal Calendar cal = Calendar.getInstance();\n\t\tcal.setTime(date);\n\n\t\treturn cal;\n\t}", "private DateTime goodLocalDateTimeUse2() {\n LocalDateTime ldt = new LocalDateTime(2020, 6, 2, 8, 0, 0, 0);\n return new DateTime(ldt.getYear(), ldt.getMonthOfYear(), ldt.getDayOfYear(), ldt.getHourOfDay(),\n ldt.getMinuteOfHour(), ldt.getSecondOfMinute(), ldt.getMillisOfSecond(),\n DateTimeZone.getDefault())\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n\n }", "private Date calendarToDate(Calendar calendar) {\n return (Date) calendar.getTime();\n }", "ForwardingCalendar(CalendarImplementation cal) {\n this.cal = cal;\n }", "public Calendar calendario(Date date) {\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(date);\r\n return calendar;\r\n }", "public Calendar GetCalendar(String sDateTime) throws Exception {\n String YYYY = \"\", MM = \"\", DD = \"\", hh = \"\", mm = \"\", ss = \"\";\n Calendar calendarInstance = null;\n try {\n //considering deafult date format as YYYY-MM-DD hh:mm:ss (e.g 2012-11-21 23:59:30)\n sDateTime = sDateTime.trim();\n if (sDateTime.equalsIgnoreCase(\"\")) {\n throw new Exception(\"Blank datetime value\");\n }\n\n YYYY = sDateTime.substring(0, 4);\n MM = sDateTime.substring(5, 7);\n DD = sDateTime.substring(8, 10);\n hh = sDateTime.substring(11, 13);\n mm = sDateTime.substring(14, 16);\n ss = sDateTime.substring(17, 19);\n MM = \"\" + (Integer.parseInt(MM) - 1);\n if (MM.length() < 2) {\n MM = \"0\" + MM;\n }\n\n calendarInstance = Calendar.getInstance();\n calendarInstance.set(Integer.parseInt(YYYY), Integer.parseInt(MM), Integer.parseInt(DD), Integer.parseInt(hh), Integer.parseInt(mm), Integer.parseInt(ss));\n return calendarInstance;\n } catch (Exception e) {\n throw new Exception(\"SetCalendar : \" + e.toString());\n }\n }", "@Override\n public Object clone() {\n return new ShortDate(getTime());\n }", "public void setFechaFinal(Calendar fechaFinal){\r\n this.fechaFinal = fechaFinal;\r\n }", "private DateTime goodLocalDateTimeUse() {\n LocalDateTime ldt = new LocalDateTime(2020, 6, 2, 8, 0, 0, 0);\n return new DateTime(ldt.getYear(), ldt.getMonthOfYear(), ldt.getDayOfYear(), ldt.getHourOfDay(),\n ldt.getMinuteOfHour(), ldt.getSecondOfMinute(), ldt.getMillisOfSecond(),\n DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n\n }", "public Calendar getCurrentCalendar()\n {\n return this.currentCalendar;\n }", "Calendar registeredAt();", "public void setClosedate( java.sql.Date newValue ) {\n __setCache(\"closedate\", newValue);\n }", "java.util.Calendar getLastrun();", "private DateTime goodLocalDateUse5() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n return new DateTime().toDateTime(DateTimeZone.getDefault())\n .withDate(ld)\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "String getCloseDate();", "private Calendar convertDateToCalendar(Date date) {\n Calendar calendar = GregorianCalendar.getInstance();\n calendar.setTime(date);\n return calendar;\n }", "public static Calendar m13184a() {\n Calendar instance = Calendar.getInstance();\n instance.set(11, 12);\n instance.set(12, C3792d.m14088c());\n instance.set(13, 0);\n return instance;\n }", "Calendar getDepartureDateAndTime();", "public void setGregorianChange(double newJDCO) {\n\t\tthis.jdCO = newJDCO;\n\t\tthis.calType = (this.jd >= this.jdCO ? SE_GREG_CAL : SE_JUL_CAL);\n\t\tIDate dt = swe_revjul(this.jd, this.calType);\n\t\tthis.year = dt.year;\n\t\tthis.month = dt.month;\n\t\tthis.day = dt.day;\n\t\tthis.hour = dt.hour;\n\t}" ]
[ "0.6071808", "0.58254963", "0.5465888", "0.5459765", "0.5459765", "0.5425151", "0.5299633", "0.5268008", "0.5262563", "0.5250451", "0.52094376", "0.5204616", "0.514388", "0.5041821", "0.5023732", "0.50079966", "0.4992088", "0.49701577", "0.4969823", "0.49686977", "0.49629915", "0.49339187", "0.49121702", "0.49057648", "0.48977205", "0.48856032", "0.48790377", "0.48652396", "0.4826983", "0.4786327", "0.47694784", "0.47468773", "0.47458553", "0.4741756", "0.4740727", "0.47360912", "0.47312707", "0.4730056", "0.47259125", "0.47212142", "0.47184417", "0.46988648", "0.468443", "0.46787205", "0.46636438", "0.46449184", "0.46438295", "0.46391115", "0.46252367", "0.46178094", "0.460015", "0.45757118", "0.45753872", "0.45644385", "0.45505905", "0.45482206", "0.45401067", "0.45347148", "0.45313597", "0.45295388", "0.45292473", "0.4523616", "0.45182192", "0.45097813", "0.4502109", "0.44985467", "0.44951218", "0.4473423", "0.44619372", "0.44597262", "0.4445848", "0.44249836", "0.44242737", "0.44226742", "0.44224688", "0.44185296", "0.44174078", "0.4416954", "0.44145945", "0.44134927", "0.44094503", "0.4381043", "0.43711776", "0.43648997", "0.4349106", "0.43447158", "0.4344628", "0.4342945", "0.4342362", "0.43366626", "0.4327248", "0.43252212", "0.43174767", "0.4316252", "0.43159485", "0.43111092", "0.43001956", "0.43000945", "0.42993882", "0.42907062" ]
0.5429744
5
Given a Java Calendar object this function creates a new Calendar object initalised to the same date and time but in the "Europe/London" time zone. NB API Documentation says stockbroker uses GMT but THIS IS WRONG the server uses local London time.
public static Calendar convertToLondonCal(Calendar cal) { long timeInMillis = cal.getTimeInMillis(); Calendar gmtCal = Calendar.getInstance(TimeZone.getTimeZone("Europe/London")); gmtCal.clear(); gmtCal.setTimeInMillis(timeInMillis); return gmtCal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) {\r\n Calendar usaCal = Calendar.getInstance(tz);\r\n usaCal.clear();\r\n usaCal.set(year, month, day, hrs, min, secs);\r\n return usaCal;\r\n }", "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public CalendarUtils(Calendar baseCalendar) {\r\n\t\tthis(baseCalendar.getTime(), baseCalendar.getTimeZone());\r\n\t}", "private static Calendar getCalendar(final Long timeInMilliseconds, final TimeZone timeZone) {\n\n final Calendar calendar = Calendar.getInstance(timeZone);\n calendar.setTimeInMillis(timeInMilliseconds);\n\n return calendar;\n }", "abstract GregorianCalendar getThreadLocalCalendar();", "public Date getUTCDate(String timeZone, Calendar cal);", "public void testCalendar() {\n Calendar cal = rootBlog.getCalendar();\n assertEquals(rootBlog.getTimeZone(), cal.getTimeZone());\n }", "Calendar getCalendar();", "public static Calendar dateToCalendar(Date dteStart, TimeZone tz) {\r\n Calendar cal = Calendar.getInstance(tz);\r\n cal.clear();\r\n int year = dteStart.getYear() + 1900;\r\n int month = dteStart.getMonth();\r\n DateFormat formatter = new SimpleDateFormat(\"dd\");\r\n String strDay = formatter.format(dteStart);\r\n int day = Integer.parseInt(strDay);\r\n int hrs = dteStart.getHours();\r\n int min = dteStart.getMinutes();\r\n int secs = dteStart.getSeconds();\r\n cal.set(Calendar.YEAR, year);\r\n cal.set(Calendar.MONTH, month);\r\n cal.set(Calendar.DAY_OF_MONTH, day);\r\n cal.set(Calendar.HOUR_OF_DAY, hrs);\r\n cal.set(Calendar.MINUTE, min);\r\n cal.set(Calendar.SECOND, secs);\r\n return cal;\r\n }", "public Calendar() {\n\t\tthis(() -> LocalDateTime.now());\n\t}", "private void makeLocalCalendar() {\n\t\t// TODO Auto-generated method stub\n\t\tContentValues values = new ContentValues();\n\t\tvalues.put(Calendars.ACCOUNT_NAME, PATIENT_ACCOUNT_NAME);\n\t\tvalues.put(Calendars.ACCOUNT_TYPE, CalendarContract.ACCOUNT_TYPE_LOCAL);\n\t\tvalues.put(Calendars.NAME, PATIENT_NAME);\n\t\tvalues.put(Calendars.CALENDAR_DISPLAY_NAME, PATIENT_NAME);\n\t\tvalues.put(Calendars.CALENDAR_COLOR, Color.BLACK);\n\t\tvalues.put(Calendars.CALENDAR_ACCESS_LEVEL, Calendars.CAL_ACCESS_OWNER);\n\t\tvalues.put(Calendars.OWNER_ACCOUNT, PATIENT_EMAIL);\n\t\tvalues.put(Calendars.CALENDAR_TIME_ZONE, TimeZone.getAvailableIDs()\n\t\t\t\t.toString());\n\t\tvalues.put(Calendars.SYNC_EVENTS, 1);\n\n\t\tUri.Builder builder = CalendarContract.Calendars.CONTENT_URI\n\t\t\t\t.buildUpon();\n\t\tbuilder.appendQueryParameter(Calendars.ACCOUNT_NAME,\n\t\t\t\t\"com.grokkingandroid\");\n\t\tbuilder.appendQueryParameter(Calendars.ACCOUNT_TYPE,\n\t\t\t\tCalendarContract.ACCOUNT_TYPE_LOCAL);\n\t\tbuilder.appendQueryParameter(CalendarContract.CALLER_IS_SYNCADAPTER,\n\t\t\t\t\"true\");\n\n\t\tUri uri = getContentResolver().insert(builder.build(), values);\n\n\t}", "public static Calendar deepCopyCalendar(Calendar cal) {\r\n Calendar result = null;\r\n if (null != cal) {\r\n Calendar newCal = Calendar.getInstance(cal.getTimeZone());\r\n newCal.clear();\r\n newCal.set(Calendar.YEAR, cal.get(Calendar.YEAR));\r\n newCal.set(Calendar.MONTH, cal.get(Calendar.MONTH));\r\n newCal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH));\r\n newCal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY));\r\n newCal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE));\r\n newCal.set(Calendar.SECOND, cal.get(Calendar.SECOND));\r\n newCal.set(Calendar.MILLISECOND, cal.get(Calendar.MILLISECOND));\r\n result = newCal;\r\n }\r\n return result;\r\n }", "public static process.proxies.UU95_CalendarSetting initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject)\r\n\t{\r\n\t\treturn new process.proxies.UU95_CalendarSetting(context, mendixObject);\r\n\t}", "Calendar getArrivalDateAndTime();", "Calendar toCalendar();", "Calendar toCalendar();", "public Calendar() {\n }", "public static Calendar getDefaultScheduleTime() {\n Calendar scheduled = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/Copenhagen\"));\n scheduled.add(Calendar.HOUR, 1);\n\n scheduled.set(Calendar.MINUTE, 0);\n scheduled.set(Calendar.SECOND, 0);\n scheduled.set(Calendar.MILLISECOND, 0);\n\n return scheduled;\n }", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "private Calendar createNewCalendar(String dateAndTime) {\n // initiate a calendar\n Calendar calendar = Calendar.getInstance();\n // take the given dateandTime string and split it into the different values\n String date = dateAndTime.split(\" \")[0];\n String time = dateAndTime.split(\" \")[1];\n int year = Integer.valueOf(date.split(\"-\")[0]);\n int month = Integer.valueOf(date.split(\"-\")[1]) - 1;\n int day = Integer.valueOf(date.split(\"-\")[2]);\n int hour = Integer.valueOf(time.split(\":\")[0]);\n int min = Integer.valueOf(time.split(\":\")[1]);\n // set the calendar to the wanted values\n calendar.set(year, month, day, hour, min);\n return calendar;\n }", "public Calendar startOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE));\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "public native final Calendar timeZone(String val) /*-{\n\t\tthis[\"timeZone\"] = val;\n\t\treturn this;\n\t}-*/;", "Calendar registeredAt();", "RollingCalendar(TimeZone tz, Locale locale)\r\n\t{\r\n\t\tsuper(tz, locale);\r\n\t}", "public static Calendar ahoraCalendar() {\n return Calendar.getInstance(TimeZone.getTimeZone(\"America/Guayaquil\"));\n }", "public Calendar forDate(Date date) {\r\n\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.setTime(date);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "@Test\n public void testTimezone() {\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/Paris\"));\n\n SunTimes paris = SunTimes.compute()\n .on(2020, 5, 1) // May 1st, 2020, starting midnight\n .latitude(48, 51, 24.0) // Latitude of Paris: 48°51'24\" N\n .longitude(2, 21, 6.0) // Longitude: 2°21'06\" E\n .execute();\n System.out.println(\"Sunrise in Paris: \" + paris.getRise());\n System.out.println(\"Sunset in Paris: \" + paris.getSet());\n\n SunTimes newYork = SunTimes.compute()\n .on(2020, 5, 1) // May 1st, 2020, starting midnight\n .at(40.712778, -74.005833) // Coordinates of New York\n .execute();\n System.out.println(\"Sunrise in New York: \" + newYork.getRise());\n System.out.println(\"Sunset in New York: \" + newYork.getSet());\n\n SunTimes newYorkTz = SunTimes.compute()\n .on(2020, 5, 1) // May 1st, 2020, starting midnight\n .timezone(\"America/New_York\") // ...New York timezone\n .at(40.712778, -74.005833) // Coordinates of New York\n .execute();\n System.out.println(\"Sunrise in New York: \" + newYorkTz.getRise());\n System.out.println(\"Sunset in New York: \" + newYorkTz.getSet());\n }", "@Test\n public void getterCalendar(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n Assert.assertEquals(2018,calendar.getYear());\n Assert.assertEquals(4,calendar.getMonth());\n Assert.assertEquals(25,calendar.getDayOfMonth());\n }", "public void convertDateTimeFromUTCtoPlaceTimeZone(BookingDto bookingDto) {\n\t\tPlaceDto portOfLoad = bookingDto.getPortOfLoad();\r\n\t\tif (portOfLoad != null && portOfLoad.getCity() != null) {\r\n\t\t\tString timeZonePortOfLoad = portOfLoad.getCity().getTimeZone();\r\n\t\t\tif (timeZonePortOfLoad != null && !timeZonePortOfLoad.isEmpty()) {\r\n\t\t\t\tbookingDto.setPortCutOffDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getPortCutOffDate(), timeZonePortOfLoad));\r\n\t\t\t\tbookingDto.setDocsCutOffDateTime(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getDocsCutOffDateTime(), timeZonePortOfLoad));\r\n\t\t\t\tbookingDto.setSailDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getSailDate(), timeZonePortOfLoad));\r\n\t\t\t\tbookingDto.setDocsReceivedDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getDocsReceivedDate(), timeZonePortOfLoad));\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlaceDto portOfDischarge = bookingDto.getPortOfDischarge();\r\n\t\tif (portOfDischarge != null && portOfDischarge.getCity() != null) {\r\n\t\t\tString tzPortOfDischarge = portOfDischarge.getCity().getTimeZone();\r\n\t\t\tif (tzPortOfDischarge != null && !tzPortOfDischarge.isEmpty()) {\r\n\t\t\t\tbookingDto.setEta(dateUtil.convertDateToSpecificTimeZone(bookingDto.getEta(), tzPortOfDischarge));\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlaceDto emptyPickupDepot = bookingDto.getEmptyContainerPickup();\r\n\t\tif (emptyPickupDepot != null && emptyPickupDepot.getCity() != null) {\r\n\t\t\tString tzEmptyPickupDepot = emptyPickupDepot.getCity().getTimeZone();\r\n\t\t\tif (tzEmptyPickupDepot != null && !tzEmptyPickupDepot.isEmpty()) {\r\n\t\t\t\tbookingDto.setEmptyPickupDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getEmptyPickupDate(), tzEmptyPickupDepot));\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlaceDto ingateTerminal = bookingDto.getIngateAtTerminal();\r\n\t\tif (ingateTerminal != null && ingateTerminal.getCity() != null) {\r\n\t\t\tString tzIngateTerminal = ingateTerminal.getCity().getTimeZone();\r\n\t\t\tif (tzIngateTerminal != null && !tzIngateTerminal.isEmpty()) {\r\n\t\t\t\tbookingDto.setEarlyReceivingDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getEarlyReceivingDate(), tzIngateTerminal));\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlaceDto placeOfReceipt = bookingDto.getPlaceOfReceipt();\r\n\t\tif (placeOfReceipt != null && placeOfReceipt.getCity() != null) {\r\n\t\t\tString tzPlaceOfReceipt = placeOfReceipt.getCity().getTimeZone();\r\n\t\t\tif (tzPlaceOfReceipt != null && !tzPlaceOfReceipt.isEmpty()) {\r\n\t\t\t\tbookingDto.setCargoMovingDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getCargoMovingDate(), tzPlaceOfReceipt));\r\n\t\t\t\tbookingDto.setRailCutOffDateTime(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getRailCutOffDateTime(), tzPlaceOfReceipt));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute) {\r\n\t\tCalendar calendar = createCalendar(year, month, date);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, hour);\r\n\t\tcalendar.set(Calendar.MINUTE, minute);\r\n\t\treturn calendar;\r\n\t}", "public void createCalendar() throws Exception, IOException, ServiceException {\n // If true, the calendar already exists\n if (getDestinationCalendarUrl() != null) {\n return;\n }\n\n CalendarEntry calendar = new CalendarEntry();\n calendar.setTitle(new PlainTextConstruct(destinationCalendarName));\n// calendar.setSummary(new PlainTextConstruct(\"Lotus Notes Calendar\"));\n // Get this machine's current time zone when creating the new Google calendar\n TimeZone localTimeZone = TimeZone.getDefault();\n calendar.setTimeZone(new TimeZoneProperty(localTimeZone.getID()));\n \n calendar.setHidden(HiddenProperty.FALSE);\n calendar.setSelected(SelectedProperty.TRUE);\n calendar.setColor(new ColorProperty(COLOR));\n\n CalendarEntry returnedCalendar = service.insert(mainCalendarFeedUrl, calendar);\n returnedCalendar.update();\n\n // Get the feed url reference so that we can add events to the new calendar.\n destinationCalendarFeedUrl = new URL(returnedCalendar.getLink(\"alternate\", \"application/atom+xml\").getHref());\n\n return;\n }", "public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public TimeZone() { throw new RuntimeException(\"Stub!\"); }", "public JCalendar() {\r\n init();\r\n resetToDefaults();\r\n }", "public void setTimeZone() {\n sydney = TimeZone.getTimeZone(\"Australia/Sydney\");\n tokyo = TimeZone.getTimeZone(\"Asia/Tokyo\");\n auckland = TimeZone.getTimeZone(\"Pacific/Auckland\");\n dubai = TimeZone.getTimeZone(\"Asia/Dubai\");\n newyork = TimeZone.getTimeZone(\"America/New_York\");\n }", "private static Calendar createCalendar(int year, int month, int date) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setLenient(false);\r\n\t\tcalendar.set(Calendar.YEAR, year);\r\n\t\tcalendar.set(Calendar.MONTH, month - 1);\r\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, date);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\treturn calendar;\r\n\t}", "public static CalendarDate getCalendarDate(long utc) {\n\tlong days;\n\tint millis;\n\n\tdays = utc / ONE_DAY;\n\tmillis = (int)(utc % ONE_DAY);\n\tif (millis < 0) {\n\t millis += ONE_DAY;\n\t days--;\n\t}\n\tdays += EPOCH_DATE;\n\tCalendarDate cdate = getCalendarDateFromFixedDate(days);\n\tcdate.setTimeOfDay(millis);\n\treturn cdate;\n }", "public VCalendar clone() {\n\t\treturn new VCalendar(this.content, this.collectionId, this.resourceId, this.earliestStart, this.latestEnd, null);\n\t}", "public void setupCalendar() { \n\t\tcal = whenIsIt();\n\t\tLocale here = Locale.US;\n\t\tthisMonth = cal.getDisplayName(2, Calendar.LONG_STANDALONE, here);\n\t\tdate = cal.get(5); //lesson learned: if it's a number do this\n\t\t//ADD CODE FOR ORDINALS HERE\n\t\tyear = cal.get(1);\n\t\tthisHour = cal.get(10);\n\t\tthisMinute = cal.get(12);\n\t\tthisSecond = cal.get(13);\n\t\tamPm = cal.getDisplayName(9, Calendar.SHORT, here);\n\t\tthisDay = thisMonth +\" \"+ addOrdinal(date) + \", \" + year;\n\t\tcurrentTime = fix.format(thisHour) + \":\" + fix.format(thisMinute) + \":\" + fix.format(thisSecond) + \" \" + amPm;\n\t}", "public Calendar toCalendar() {\n\t\treturn (Calendar) _cal.clone();\n\t}", "public static TimeZone getDefault();", "public static final Calendar getCalendar(int date, int month, int year) {\r\n\t\tCalendar cal = Calendar.getInstance(); // locale-specific\r\n\t\t// cal.setTime(dateObject);\r\n\t\tcal.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcal.set(Calendar.MINUTE, 0);\r\n\t\tcal.set(Calendar.SECOND, 0);\r\n\t\tcal.set(Calendar.MILLISECOND, 0);\r\n\r\n\t\tcal.set(Calendar.DATE, date);\r\n\t\tcal.set(Calendar.MONTH, month);\r\n\t\tcal.set(Calendar.YEAR, year);\r\n\t\treturn cal;\r\n\t}", "public static DateUtil today(TimeZone timeZone)\n {\n // 86,400,000 = 1000 * 60 * 60 * 24 = milliseconds per day\n long currentUTCDateTime = System.currentTimeMillis();\n DateUtil d = new DateUtil((int)(currentUTCDateTime / 86400000L));\n\n /*\n * Gets the time zone offset, for current date, modified in case of\n * daylight savings. This is the offset to add *to* UTC to get local time.\n * Places east of Greenwich have a positive offset.\n * :era the era of the given date, AD = 1 BC = 0\n * :year the year in the given date.\n * Docs are unclear if 1900=0 or 1900. Does not use year in calcs anyway.\n * :month the month in the given date.\n * Month is 0-based. e.g., 0 for January.\n * :day the day-in-month of the given date.\n * :dayOfWeek the day-of-week of the given date. 1=Calendar.SUNDAY\n * :milliseconds the millis in day in <em>standard</em> local time.\n * :return the offset in millis to add *to* GMT to get local time.\n */\n int offsetInMillis = timeZone.getOffset(d.getOrdinal() >= Jan_01_0001 ? 1:0,\n d.getYYYY(),\n d.getMM()-1,\n d.getDD(),\n d.getCalendarDayOfWeek(),\n (int)(currentUTCDateTime % 86400000L)\n /* wrong. Should be local standard time. How to get it?? */\n );\n d.setOrdinal((int)((currentUTCDateTime + offsetInMillis) / 86400000L));\n return d;\n }", "private static Calendar toUTCCalendarWithoutTime(final Date date) {\n final Calendar calendar = Calendar.getInstance();\n calendar.clear();\n calendar.setTime(date);\n calendar.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar;\n }", "@PostConstruct\n\tpublic void init() {\n\t\tTimeZone.setDefault(TimeZone.getTimeZone(\"UTC\"));\n\t}", "public String getDateTime(Calendar cal, int GMT_OFFSET_SECONDS, String DATE_TIME_FORMAT) throws Exception {\n\n String sRetVal = \"\";\n String DefaultFormat = \"yyyyMMddHHmmss\";\n int GMT_OFFSET_DIFF = 0;\n try {\n\n //check for valid Calender values\n if (cal == null) {\n cal = Calendar.getInstance();\n }\n\n //check for valid FORMAT values\n if (DATE_TIME_FORMAT == null) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n if (DATE_TIME_FORMAT.trim().toUpperCase().equalsIgnoreCase(\"\")) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n\n //check GMT RAW OFF SET difference\n int CURR_GMT_OFFSET = TimeZone.getDefault().getRawOffset() / 1000;\n //in case Current GMT is GREATER THAN provided GMT\n if (CURR_GMT_OFFSET > GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n\n //in case Current GMT is SMALLER THAN provided GMT\n } else if (CURR_GMT_OFFSET < GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n }\n\n if (CURR_GMT_OFFSET == GMT_OFFSET_SECONDS) {\n GMT_OFFSET_DIFF = 0;\n }\n\n //setting calender datetime as per GMT\n cal.add(Calendar.SECOND, GMT_OFFSET_DIFF);\n\n //using SimpleDateFormat class\n sRetVal = new SimpleDateFormat(DATE_TIME_FORMAT).format(cal.getTime());\n return sRetVal;\n\n } catch (Exception e) {\n println(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n throw new Exception(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n } finally {\n }\n\n }", "public void setTodayCalendar()\n {\n this.currentCalendar = Calendar.getInstance();\n }", "private void setDefaultTimezone() {\n TimeZone tz = Calendar.getInstance().getTimeZone();\n this.setTimezone(tz.getID());\n }", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "public void setDateTime(java.util.Calendar param) {\n this.localDateTime = param;\n }", "private Date getTestListingDateTimeStamp() {\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/London\"));\n\n GregorianCalendar calendar = new GregorianCalendar(2010, 0, 1, 17, 0);\n return new Date(calendar.getTimeInMillis());\n }", "public DateTime(Calendar c) {\n setCharacteristic(null);\n if (c == null) {\n setCharacteristic(null);\n setYear(YEAR_IS_NOT_KNOWN);\n setMonth(MONTH_IS_NOT_KNOWN);\n setDay(DAY_OF_MONTH_IS_NOT_KNOWN);\n setHours(0);\n setMinutes(0);\n setSeconds(0);\n } else {\n setYear(c.get(Calendar.YEAR));\n setMonth(c.get(Calendar.MONTH) + 1);\n setDay(c.get(Calendar.DAY_OF_MONTH));\n setHours(c.get(Calendar.HOUR_OF_DAY));\n setMinutes(c.get(Calendar.MINUTE));\n setSeconds(c.get(Calendar.SECOND));\n }\n }", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute, int second) {\r\n\t\tCalendar calendar = createCalendar(year, month, date, hour, minute);\r\n\t\tcalendar.set(Calendar.SECOND, second);\r\n\t\treturn calendar;\r\n\t}", "static synchronized BasisGoogleCalendar getCalendar(UpodWorld w)\n{\n if (DATA_STORE_DIR == null) return null;\n if (cal_service == null) {\n try {\n\t cal_service = getCalendarService();\n }\n catch (IOException e) {\n\t BasisLogger.logE(\"GOOGLECAL: Authorization problem with calendar api: \" + e);\n\t DATA_STORE_DIR = null;\n\t HTTP_TRANSPORT = null;\n\t DATA_STORE_FACTORY = null;\n\t return null;\n }\n }\n\n BasisGoogleCalendar rslt = the_calendars.get(w);\n if (rslt == null) {\n rslt = new BasisGoogleCalendar();\n the_calendars.put(w,rslt);\n }\n\n return rslt;\n}", "public String getUTCTime(String timeZone, Calendar cal);", "public Calendar getCurrentMonthCalendarObj() throws Throwable{\r\n\r\n\t\tString dateInput = \"01/\"+month+\"/\"+year;\t\t\t\r\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MMMM/yyyy\");\r\n\t\tDate startDate = df.parse(dateInput);\r\n\t\tCalendar c = Calendar.getInstance(); // this takes current date\r\n\t c.setTime(startDate); // set date to specified in arguement\r\n\t\treturn c;\r\n\t}", "public DateTime(final BusinessObject parent) {\n super(parent);\n if (clock == null) {\n throw new ApplicationException(\"Clock not set up\");\n }\n setValue(new java.util.Date(clock.getTime()));\n isNull = false;\n }", "public static Date createDate(int yyyy, int month, int day, int hour, int min) {\n/* 93 */ CALENDAR.clear();\n/* 94 */ CALENDAR.set(yyyy, month - 1, day, hour, min);\n/* 95 */ return CALENDAR.getTime();\n/* */ }", "public SDate getLocalTimeFromUTC(int iyear, int imonth, int iday, int ihour, int imin, double dsec,\n\t\t\tdouble d_timezone) {\n\t\t// public SDate swe_utc_time_zone(\n\t\t// int iyear, int imonth, int iday,\n\t\t// int ihour, int imin, double dsec,\n\t\t// double d_timezone) {\n\t\tint iyear_out, imonth_out, iday_out, ihour_out, imin_out;\n\t\tdouble dsec_out;\n\t\tdouble tjd, d;\n\t\tboolean have_leapsec = false;\n\t\tdouble dhour;\n\t\tif (dsec >= 60.0) {\n\t\t\thave_leapsec = true;\n\t\t\tdsec -= 1.0;\n\t\t}\n\t\tdhour = ((double) ihour) + ((double) imin) / 60.0 + dsec / 3600.0;\n\t\ttjd = swe_julday(iyear, imonth, iday, 0, SE_GREG_CAL);\n\t\tdhour -= d_timezone;\n\t\tif (dhour < 0.0) {\n\t\t\ttjd -= 1.0;\n\t\t\tdhour += 24.0;\n\t\t}\n\t\tif (dhour >= 24.0) {\n\t\t\ttjd += 1.0;\n\t\t\tdhour -= 24.0;\n\t\t}\n\t\t// swe_revjul(tjd + 0.001, SE_GREG_CAL, iyear_out, imonth_out, iday_out,\n\t\t// &d);\n\t\tIDate dt = swe_revjul(tjd + 0.001, SE_GREG_CAL);\n\t\tiyear_out = dt.year;\n\t\timonth_out = dt.month;\n\t\tiday_out = dt.day;\n\t\tihour_out = (int) dhour;\n\t\td = (dhour - (double) ihour_out) * 60;\n\t\timin_out = (int) d;\n\t\tdsec_out = (d - (double) imin_out) * 60;\n\t\tif (have_leapsec)\n\t\t\tdsec_out += 1.0;\n\t\treturn new SDate(iyear_out, imonth_out, iday_out, ihour_out, imin_out, dsec_out);\n\t}", "protected Calendar getCurrentCalendar() {\n Calendar current = new Calendar();\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n SimpleDateFormat dateFormatHour = new SimpleDateFormat(\"H\");\n SimpleDateFormat dateFormatWeekDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat dateFormatMonth = new SimpleDateFormat(\"MMM\");\n\n current.setHour(dateFormatHour.format(calendar.getTime()).toString());\n current.setWeekday(dateFormatWeekDay.format(calendar.getTime()));\n current.setMonth(dateFormatMonth.format(calendar.getTime()));\n\n return current;\n }", "public Calendar() throws RemoteException {\n\t\tthis.sentinel = -1;\n\t\tthis.sentinelC = -1;\n\t\tthis.ownerTracker = 0;\n\t\tthis.chatClients = new ArrayList<RemCalendar>();\n\t\tthis.loggedIn = new ArrayList<>();\n\t}", "@Test\n public void createScheduleEntry(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n }", "@Override\n public void setLocalTimeZone(DateFormat df) {\n \n }", "DateTime nowUtc();", "public void setTimeZone(TimeZone tmz)\n {\n this.timeZone = tmz; // may be null\n }", "public static Date getLocalUTCTime(){\r\n\t\tfinal Calendar cal=Calendar.getInstance();\r\n\t\tfinal int zoneOffset=cal.get(Calendar.ZONE_OFFSET);\r\n\t\tfinal int dstOffset=cal.get(Calendar.DST_OFFSET);\r\n\t\tcal.add(Calendar.MILLISECOND, -(zoneOffset+dstOffset));\r\n\t\treturn cal.getTime();\r\n\t}", "private XMLGregorianCalendar calendarToXMLGregorianCalendar(Calendar calendar) throws DatatypeConfigurationException {\n\n DatatypeFactory dtf = DatatypeFactory.newInstance();\n XMLGregorianCalendar xgc = dtf.newXMLGregorianCalendar();\n xgc.setYear(calendar.get(Calendar.YEAR));\n xgc.setMonth(calendar.get(Calendar.MONTH) + 1);\n xgc.setDay(calendar.get(Calendar.DAY_OF_MONTH));\n xgc.setHour(calendar.get(Calendar.HOUR_OF_DAY));\n xgc.setMinute(calendar.get(Calendar.MINUTE));\n xgc.setSecond(calendar.get(Calendar.SECOND));\n xgc.setMillisecond(calendar.get(Calendar.MILLISECOND));\n\n // Calendar ZONE_OFFSET and DST_OFFSET fields are in milliseconds.\n int offsetInMinutes = (calendar.get(Calendar.ZONE_OFFSET) + calendar.get(Calendar.DST_OFFSET)) / (60 * 1000);\n xgc.setTimezone(offsetInMinutes);\n return xgc;\n }", "Calendar getTimeStamp();", "public java.time.LocalDateTime convertToCurrentZone(java.time.LocalDateTime time_input){\r\n java.time.LocalDateTime newDateTime = time_input.atZone(ZoneId.of(\"GMT\")).withZoneSameInstant(getTimeZone().toZoneId()).toLocalDateTime();\r\n return newDateTime;\r\n }", "public Calendar GetCalendar(String sDateTime) throws Exception {\n String YYYY = \"\", MM = \"\", DD = \"\", hh = \"\", mm = \"\", ss = \"\";\n Calendar calendarInstance = null;\n try {\n //considering deafult date format as YYYY-MM-DD hh:mm:ss (e.g 2012-11-21 23:59:30)\n sDateTime = sDateTime.trim();\n if (sDateTime.equalsIgnoreCase(\"\")) {\n throw new Exception(\"Blank datetime value\");\n }\n\n YYYY = sDateTime.substring(0, 4);\n MM = sDateTime.substring(5, 7);\n DD = sDateTime.substring(8, 10);\n hh = sDateTime.substring(11, 13);\n mm = sDateTime.substring(14, 16);\n ss = sDateTime.substring(17, 19);\n MM = \"\" + (Integer.parseInt(MM) - 1);\n if (MM.length() < 2) {\n MM = \"0\" + MM;\n }\n\n calendarInstance = Calendar.getInstance();\n calendarInstance.set(Integer.parseInt(YYYY), Integer.parseInt(MM), Integer.parseInt(DD), Integer.parseInt(hh), Integer.parseInt(mm), Integer.parseInt(ss));\n return calendarInstance;\n } catch (Exception e) {\n throw new Exception(\"SetCalendar : \" + e.toString());\n }\n }", "public static Calendar getCurrentTime(String argGMT) {\r\n\t\treturn DateToCalendar(getTime(argGMT));\r\n\t}", "Schedule createSchedule();", "public /* synthetic */ void lambda$onReceive$0$Clock$2(String str) {\n Clock.this.mCalendar = Calendar.getInstance(TimeZone.getTimeZone(str));\n if (Clock.this.mClockFormat != null) {\n Clock.this.mClockFormat.setTimeZone(Clock.this.mCalendar.getTimeZone());\n }\n }", "@PostConstruct\n\tvoid init() {\n\t\tTimeZone.setDefault(TimeZone.getTimeZone(\"Africa/Lagos\"));\n\t}", "public Calendar() {\n initComponents();\n }", "Calendar getDepartureDateAndTime();", "public static void updateCalendar() {\n time = Calendar.getInstance();\n hour = time.get(Calendar.HOUR_OF_DAY);\n minute = time.get(Calendar.MINUTE);\n day = time.get(Calendar.DAY_OF_MONTH);\n month = time.get(Calendar.MONTH) + 1; \n year = time.get(Calendar.YEAR);\n\n }", "@Test\n public void testStartDateTimeZoneChange() throws Exception {\n EventData deltaEvent = prepareDeltaEvent(createdEvent);\n Date date = DateTimeUtil.parseDateTime(createdEvent.getStartDate());\n deltaEvent.setStartDate(DateTimeUtil.getDateTime(\"Europe/Isle_of_Man\", date.getTime()));\n\n updateEventAsOrganizer(deltaEvent);\n\n /*\n * Check that time zone of start date has been updated\n * Note: Due internal handling of a shortened Event, no rescheduling will happen. Thus the participant status is\n * unchanged. For details see com.openexchange.chronos.impl.Utils.coversDifferentTimePeriod(Event, Event) or\n * http://documentation.open-xchange.com/latest/middleware/calendar/implementation_details.html#reset-of-participation-status\n */\n AnalyzeResponse analyzeResponse = receiveUpdateAsAttendee(PartStat.ACCEPTED, CustomConsumers.ACTIONS);\n AnalysisChange change = assertSingleChange(analyzeResponse);\n assertSingleDescription(change, \"The timezone of the appointment's start date was changed.\");\n }", "protected static boolean isUTC(Calendar calendar) {\n return calendar.getTimeZone().getID().equals(\"UTC\");\n }", "@Override\n public Clock withZone(ZoneId zone) {\n return new MutableClockStub(instant, zone);\n }", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public void setDateCreated(java.util.Calendar param) {\n localDateCreatedTracker = param != null;\n\n this.localDateCreated = param;\n }", "public void setTimeZone(TimeZone timeZone)\n {\n this.timeZone = timeZone;\n }", "@Override\n\tpublic Clock withZone(ZoneId arg0) {\n\t\treturn null;\n\t}", "public static String convertCalToBrokerTime(Calendar cal) {\r\n String result = \"\";\r\n Calendar gmtCal = DTUtil.convertToLondonCal(cal);\r\n SimpleDateFormat format1 = new SimpleDateFormat(\"yyyyMMdd HH:mm:ss\");\r\n String timeFMString = format1.format(gmtCal.getTime()) + \" GMT\";\r\n result = timeFMString;\r\n return result;\r\n }", "@Override\n public void onStart(Application app) {\n TimeZone.setDefault(TimeZone.getTimeZone(\"UTC\"));\n }", "public BwCalendar getCalendar() {\n if (calendar == null) {\n calendar = new BwCalendar();\n }\n\n return calendar;\n }", "private LocalTime getLocalTime(Calendar calendar) {\n return LocalTime.of(calendar.get(Calendar.HOUR_OF_DAY),\n calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND),\n calendar.get(Calendar.MILLISECOND));\n }", "public void setDefaultTimeZone(TimeZone defaultTimeZone) {\n this.defaultTimeZone = defaultTimeZone;\n }", "public Calendar getCalendar() {\n Calendar c = Calendar.getInstance();\n c.setTime(cal.getTime());\n return c;\n }", "@NonNull public static CalendarDay today() {\n return from(LocalDate.now());\n }", "public Calendar endOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE) + 1);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "CurrentReservation createCurrentReservation();", "public void setFechaSolicitud(java.util.Calendar param){\n \n this.localFechaSolicitud=param;\n \n\n }", "public static DateTime nowUTC() {\n return new DateTime(DateTimeZone.UTC);\n }", "public static void setTime(){\n\t\tCalendar cal = Calendar.getInstance();\n\t\tif (!JsonUtils.RUNNING_LOCALLY){\n\t\t\tcal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 4); //account for UTC offset because of lambda\n\t\t}\n\t\tCURRENT_TIME = formatTime(cal.getTime().toString());\n\t}", "public static native JsDate create(int year, int month, int dayOfMonth, int hours,\n int minutes, int seconds) /*-{\n return new Date(year, month, dayOfMonth, hours, minutes, seconds);\n }-*/;", "public static Calendar convertToExchCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar exchCal = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n exchCal.clear();\r\n exchCal.setTimeInMillis(timeInMillis);\r\n return exchCal;\r\n }", "public static Calendar parseISODate(String dateAsString, String timezone) throws ParseException {\n\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT, Locale.US);\n simpleDateFormat.setTimeZone(TimeZone.getTimeZone(SERVER_TIME_ZONE));\n try {\n\n Calendar date = Calendar.getInstance();\n\n if (dateAsString != null && !(dateAsString.equalsIgnoreCase(\"\"))) {\n\n date.setTime(simpleDateFormat.parse(dateAsString));\n date.setTimeZone(TimeZone.getTimeZone(timezone));\n\n }\n\n return date;\n\n } catch (ParseException e) {\n\n Log.d(TAG, \"Failed to parse date: \" + dateAsString + \" to iso format: \" + DATE_FORMAT);\n throw e;\n\n }\n\n }" ]
[ "0.5889341", "0.57962066", "0.57884103", "0.5656253", "0.56100106", "0.5586363", "0.55487067", "0.55352426", "0.54143786", "0.53177154", "0.531408", "0.5283836", "0.5279755", "0.52536803", "0.5252478", "0.5252478", "0.52239555", "0.51975405", "0.5185776", "0.5124754", "0.51244146", "0.5100998", "0.50886667", "0.5029468", "0.50249934", "0.5012197", "0.49966753", "0.4953857", "0.492504", "0.4921165", "0.49010468", "0.489099", "0.48869732", "0.48751354", "0.48421818", "0.48171142", "0.48098153", "0.4786024", "0.47830376", "0.47784507", "0.47673", "0.47575724", "0.47499746", "0.4748808", "0.47391927", "0.47227976", "0.47194192", "0.47093493", "0.47016472", "0.46983722", "0.4698369", "0.4691468", "0.4679474", "0.4661993", "0.46488032", "0.46267778", "0.4620916", "0.4616325", "0.45978224", "0.45852053", "0.4568381", "0.45647547", "0.45606494", "0.45526788", "0.45427665", "0.45142174", "0.45059508", "0.45038185", "0.44968653", "0.44688648", "0.44577998", "0.44536036", "0.44427237", "0.4442145", "0.44384322", "0.4434781", "0.44324893", "0.4431351", "0.44204807", "0.44125336", "0.44037825", "0.43995282", "0.43910196", "0.4387398", "0.43838695", "0.43708313", "0.4369676", "0.43692228", "0.43568155", "0.43508995", "0.43411773", "0.4325875", "0.4321616", "0.43200216", "0.43178862", "0.43166634", "0.43033087", "0.4291649", "0.42888105", "0.42843166" ]
0.6865368
0
Given a Java Calendar object this function creates a new Calendar object initalised to the same date and time but in the "America/New_York" time zone.
public static Calendar convertToExchCal(Calendar cal) { long timeInMillis = cal.getTimeInMillis(); Calendar exchCal = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); exchCal.clear(); exchCal.setTimeInMillis(timeInMillis); return exchCal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) {\r\n Calendar usaCal = Calendar.getInstance(tz);\r\n usaCal.clear();\r\n usaCal.set(year, month, day, hrs, min, secs);\r\n return usaCal;\r\n }", "private static Calendar getCalendar(final Long timeInMilliseconds, final TimeZone timeZone) {\n\n final Calendar calendar = Calendar.getInstance(timeZone);\n calendar.setTimeInMillis(timeInMilliseconds);\n\n return calendar;\n }", "public CalendarUtils(Calendar baseCalendar) {\r\n\t\tthis(baseCalendar.getTime(), baseCalendar.getTimeZone());\r\n\t}", "public static Calendar deepCopyCalendar(Calendar cal) {\r\n Calendar result = null;\r\n if (null != cal) {\r\n Calendar newCal = Calendar.getInstance(cal.getTimeZone());\r\n newCal.clear();\r\n newCal.set(Calendar.YEAR, cal.get(Calendar.YEAR));\r\n newCal.set(Calendar.MONTH, cal.get(Calendar.MONTH));\r\n newCal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH));\r\n newCal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY));\r\n newCal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE));\r\n newCal.set(Calendar.SECOND, cal.get(Calendar.SECOND));\r\n newCal.set(Calendar.MILLISECOND, cal.get(Calendar.MILLISECOND));\r\n result = newCal;\r\n }\r\n return result;\r\n }", "public static Calendar convertToLondonCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar gmtCal = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/London\"));\r\n gmtCal.clear();\r\n gmtCal.setTimeInMillis(timeInMillis);\r\n return gmtCal;\r\n }", "private Calendar createNewCalendar(String dateAndTime) {\n // initiate a calendar\n Calendar calendar = Calendar.getInstance();\n // take the given dateandTime string and split it into the different values\n String date = dateAndTime.split(\" \")[0];\n String time = dateAndTime.split(\" \")[1];\n int year = Integer.valueOf(date.split(\"-\")[0]);\n int month = Integer.valueOf(date.split(\"-\")[1]) - 1;\n int day = Integer.valueOf(date.split(\"-\")[2]);\n int hour = Integer.valueOf(time.split(\":\")[0]);\n int min = Integer.valueOf(time.split(\":\")[1]);\n // set the calendar to the wanted values\n calendar.set(year, month, day, hour, min);\n return calendar;\n }", "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public Date getUTCDate(String timeZone, Calendar cal);", "public static Calendar dateToCalendar(Date dteStart, TimeZone tz) {\r\n Calendar cal = Calendar.getInstance(tz);\r\n cal.clear();\r\n int year = dteStart.getYear() + 1900;\r\n int month = dteStart.getMonth();\r\n DateFormat formatter = new SimpleDateFormat(\"dd\");\r\n String strDay = formatter.format(dteStart);\r\n int day = Integer.parseInt(strDay);\r\n int hrs = dteStart.getHours();\r\n int min = dteStart.getMinutes();\r\n int secs = dteStart.getSeconds();\r\n cal.set(Calendar.YEAR, year);\r\n cal.set(Calendar.MONTH, month);\r\n cal.set(Calendar.DAY_OF_MONTH, day);\r\n cal.set(Calendar.HOUR_OF_DAY, hrs);\r\n cal.set(Calendar.MINUTE, min);\r\n cal.set(Calendar.SECOND, secs);\r\n return cal;\r\n }", "@Test\n public void testTimezone() {\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/Paris\"));\n\n SunTimes paris = SunTimes.compute()\n .on(2020, 5, 1) // May 1st, 2020, starting midnight\n .latitude(48, 51, 24.0) // Latitude of Paris: 48°51'24\" N\n .longitude(2, 21, 6.0) // Longitude: 2°21'06\" E\n .execute();\n System.out.println(\"Sunrise in Paris: \" + paris.getRise());\n System.out.println(\"Sunset in Paris: \" + paris.getSet());\n\n SunTimes newYork = SunTimes.compute()\n .on(2020, 5, 1) // May 1st, 2020, starting midnight\n .at(40.712778, -74.005833) // Coordinates of New York\n .execute();\n System.out.println(\"Sunrise in New York: \" + newYork.getRise());\n System.out.println(\"Sunset in New York: \" + newYork.getSet());\n\n SunTimes newYorkTz = SunTimes.compute()\n .on(2020, 5, 1) // May 1st, 2020, starting midnight\n .timezone(\"America/New_York\") // ...New York timezone\n .at(40.712778, -74.005833) // Coordinates of New York\n .execute();\n System.out.println(\"Sunrise in New York: \" + newYorkTz.getRise());\n System.out.println(\"Sunset in New York: \" + newYorkTz.getSet());\n }", "abstract GregorianCalendar getThreadLocalCalendar();", "public native final Calendar timeZone(String val) /*-{\n\t\tthis[\"timeZone\"] = val;\n\t\treturn this;\n\t}-*/;", "Calendar toCalendar();", "Calendar toCalendar();", "Calendar getCalendar();", "public void testCalendar() {\n Calendar cal = rootBlog.getCalendar();\n assertEquals(rootBlog.getTimeZone(), cal.getTimeZone());\n }", "public static DateUtil today(TimeZone timeZone)\n {\n // 86,400,000 = 1000 * 60 * 60 * 24 = milliseconds per day\n long currentUTCDateTime = System.currentTimeMillis();\n DateUtil d = new DateUtil((int)(currentUTCDateTime / 86400000L));\n\n /*\n * Gets the time zone offset, for current date, modified in case of\n * daylight savings. This is the offset to add *to* UTC to get local time.\n * Places east of Greenwich have a positive offset.\n * :era the era of the given date, AD = 1 BC = 0\n * :year the year in the given date.\n * Docs are unclear if 1900=0 or 1900. Does not use year in calcs anyway.\n * :month the month in the given date.\n * Month is 0-based. e.g., 0 for January.\n * :day the day-in-month of the given date.\n * :dayOfWeek the day-of-week of the given date. 1=Calendar.SUNDAY\n * :milliseconds the millis in day in <em>standard</em> local time.\n * :return the offset in millis to add *to* GMT to get local time.\n */\n int offsetInMillis = timeZone.getOffset(d.getOrdinal() >= Jan_01_0001 ? 1:0,\n d.getYYYY(),\n d.getMM()-1,\n d.getDD(),\n d.getCalendarDayOfWeek(),\n (int)(currentUTCDateTime % 86400000L)\n /* wrong. Should be local standard time. How to get it?? */\n );\n d.setOrdinal((int)((currentUTCDateTime + offsetInMillis) / 86400000L));\n return d;\n }", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "public Calendar() {\n }", "public Calendar() {\n\t\tthis(() -> LocalDateTime.now());\n\t}", "public void createCalendar() throws Exception, IOException, ServiceException {\n // If true, the calendar already exists\n if (getDestinationCalendarUrl() != null) {\n return;\n }\n\n CalendarEntry calendar = new CalendarEntry();\n calendar.setTitle(new PlainTextConstruct(destinationCalendarName));\n// calendar.setSummary(new PlainTextConstruct(\"Lotus Notes Calendar\"));\n // Get this machine's current time zone when creating the new Google calendar\n TimeZone localTimeZone = TimeZone.getDefault();\n calendar.setTimeZone(new TimeZoneProperty(localTimeZone.getID()));\n \n calendar.setHidden(HiddenProperty.FALSE);\n calendar.setSelected(SelectedProperty.TRUE);\n calendar.setColor(new ColorProperty(COLOR));\n\n CalendarEntry returnedCalendar = service.insert(mainCalendarFeedUrl, calendar);\n returnedCalendar.update();\n\n // Get the feed url reference so that we can add events to the new calendar.\n destinationCalendarFeedUrl = new URL(returnedCalendar.getLink(\"alternate\", \"application/atom+xml\").getHref());\n\n return;\n }", "public Calendar forDate(Date date) {\r\n\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.setTime(date);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "private void makeLocalCalendar() {\n\t\t// TODO Auto-generated method stub\n\t\tContentValues values = new ContentValues();\n\t\tvalues.put(Calendars.ACCOUNT_NAME, PATIENT_ACCOUNT_NAME);\n\t\tvalues.put(Calendars.ACCOUNT_TYPE, CalendarContract.ACCOUNT_TYPE_LOCAL);\n\t\tvalues.put(Calendars.NAME, PATIENT_NAME);\n\t\tvalues.put(Calendars.CALENDAR_DISPLAY_NAME, PATIENT_NAME);\n\t\tvalues.put(Calendars.CALENDAR_COLOR, Color.BLACK);\n\t\tvalues.put(Calendars.CALENDAR_ACCESS_LEVEL, Calendars.CAL_ACCESS_OWNER);\n\t\tvalues.put(Calendars.OWNER_ACCOUNT, PATIENT_EMAIL);\n\t\tvalues.put(Calendars.CALENDAR_TIME_ZONE, TimeZone.getAvailableIDs()\n\t\t\t\t.toString());\n\t\tvalues.put(Calendars.SYNC_EVENTS, 1);\n\n\t\tUri.Builder builder = CalendarContract.Calendars.CONTENT_URI\n\t\t\t\t.buildUpon();\n\t\tbuilder.appendQueryParameter(Calendars.ACCOUNT_NAME,\n\t\t\t\t\"com.grokkingandroid\");\n\t\tbuilder.appendQueryParameter(Calendars.ACCOUNT_TYPE,\n\t\t\t\tCalendarContract.ACCOUNT_TYPE_LOCAL);\n\t\tbuilder.appendQueryParameter(CalendarContract.CALLER_IS_SYNCADAPTER,\n\t\t\t\t\"true\");\n\n\t\tUri uri = getContentResolver().insert(builder.build(), values);\n\n\t}", "public static Calendar ahoraCalendar() {\n return Calendar.getInstance(TimeZone.getTimeZone(\"America/Guayaquil\"));\n }", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "public void setTimeZone() {\n sydney = TimeZone.getTimeZone(\"Australia/Sydney\");\n tokyo = TimeZone.getTimeZone(\"Asia/Tokyo\");\n auckland = TimeZone.getTimeZone(\"Pacific/Auckland\");\n dubai = TimeZone.getTimeZone(\"Asia/Dubai\");\n newyork = TimeZone.getTimeZone(\"America/New_York\");\n }", "public static void main(String argv[])\n {\n Calendar cal = Calendar.getInstance();\n\n //Sets TimeZone variable time to our default time zone (America/New_York)\n TimeZone time = TimeZone.getDefault();\n\n //Sets table format for output\n System.out.println(\"Time zone: City: Time:\");\n System.out.println();\n\n //Sets a time format for the output\n SimpleDateFormat sdf = new SimpleDateFormat(\"hh:mm:ss\");\n \n //Prints out the time and timezone in Washington DC\n \n //If cal.get(Calendar.AM_PM returns a value of 0 than AM is printed, \n //otherwise PM is printed\n if (cal.get(Calendar.AM_PM) == 0)\n System.out.println(time.getID() + \" \" + \"Washington DC \" + sdf.format(cal.getTime()) + \" AM\");\n else\n System.out.println(time.getID() + \" \" + \"Washington DC \" + sdf.format(cal.getTime()) + \" PM\");\n\n //Prints out the time in Los Angeles\n time = TimeZone.getTimeZone(\"America/Los_Angeles\");\n \n //Sets the SimpleDateFormat variable to the time zone given by the time variable\n //to display the time\n sdf.setTimeZone(time);\n \n //Sets the calendar to the time zone given by the time variable to display AM/PM\n cal.setTimeZone(time);\n\n if (cal.get(Calendar.AM_PM) == 0)\n System.out.println(time.getID() + \" \" + \"Los Angeles \" + sdf.format(cal.getTime()) + \" AM\");\n else\n System.out.println(time.getID() + \" \" + \"Los Angeles \" + sdf.format(cal.getTime()) + \" PM\");\n\n //Prints out the time in Amsterdam\n time = TimeZone.getTimeZone(\"Europe/Amsterdam\");\n sdf.setTimeZone(time);\n cal.setTimeZone(time);\n\n if (cal.get(Calendar.AM_PM) == 0)\n System.out.println(time.getID() + \" \" + \" Amsterdam \" + sdf.format(cal.getTime()) + \" AM\");\n else\n System.out.println(time.getID() + \" \" + \" Amsterdam \" + sdf.format(cal.getTime()) + \" PM\");\n\n //Prints out the time in Jerusalem\n time = TimeZone.getTimeZone(\"Asia/Jerusalem\");\n sdf.setTimeZone(time);\n cal.setTimeZone(time);\n\n if (cal.get(Calendar.AM_PM) == 0)\n System.out.println(time.getID() + \" \" + \" Jerusalem \" + sdf.format(cal.getTime()) + \" AM\");\n else\n System.out.println(time.getID() + \" \" + \" Jerusalem \" + sdf.format(cal.getTime()) + \" PM\");\n\n //Prints out the time in Hong Kong\n time = TimeZone.getTimeZone(\"Asia/Hong_Kong\");\n sdf.setTimeZone(time);\n cal.setTimeZone(time);\n\n if (cal.get(Calendar.AM_PM) == 0)\n System.out.println(time.getID() + \" \" + \" Hong Kong \" + sdf.format(cal.getTime()) + \" AM\");\n else\n System.out.println(time.getID() + \" \" + \" Hong Kong \" + sdf.format(cal.getTime()) + \" PM\");\n\n }", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute, int second) {\r\n\t\tCalendar calendar = createCalendar(year, month, date, hour, minute);\r\n\t\tcalendar.set(Calendar.SECOND, second);\r\n\t\treturn calendar;\r\n\t}", "public Calendar startOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE));\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute) {\r\n\t\tCalendar calendar = createCalendar(year, month, date);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, hour);\r\n\t\tcalendar.set(Calendar.MINUTE, minute);\r\n\t\treturn calendar;\r\n\t}", "private static Calendar createCalendar(int year, int month, int date) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setLenient(false);\r\n\t\tcalendar.set(Calendar.YEAR, year);\r\n\t\tcalendar.set(Calendar.MONTH, month - 1);\r\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, date);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\treturn calendar;\r\n\t}", "Calendar getArrivalDateAndTime();", "public TimeZone() { throw new RuntimeException(\"Stub!\"); }", "public String getUTCTime(String timeZone, Calendar cal);", "public void setupCalendar() { \n\t\tcal = whenIsIt();\n\t\tLocale here = Locale.US;\n\t\tthisMonth = cal.getDisplayName(2, Calendar.LONG_STANDALONE, here);\n\t\tdate = cal.get(5); //lesson learned: if it's a number do this\n\t\t//ADD CODE FOR ORDINALS HERE\n\t\tyear = cal.get(1);\n\t\tthisHour = cal.get(10);\n\t\tthisMinute = cal.get(12);\n\t\tthisSecond = cal.get(13);\n\t\tamPm = cal.getDisplayName(9, Calendar.SHORT, here);\n\t\tthisDay = thisMonth +\" \"+ addOrdinal(date) + \", \" + year;\n\t\tcurrentTime = fix.format(thisHour) + \":\" + fix.format(thisMinute) + \":\" + fix.format(thisSecond) + \" \" + amPm;\n\t}", "Calendar registeredAt();", "private DateTime goodLocalTimeUse() {\n LocalTime lt = new LocalTime(8, 0, 0, 0);\n return new DateTime().toDateTime(DateTimeZone.forID(\"America/New_York\"))\n .withTime(lt)\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "public static final Calendar getCalendar(int date, int month, int year) {\r\n\t\tCalendar cal = Calendar.getInstance(); // locale-specific\r\n\t\t// cal.setTime(dateObject);\r\n\t\tcal.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcal.set(Calendar.MINUTE, 0);\r\n\t\tcal.set(Calendar.SECOND, 0);\r\n\t\tcal.set(Calendar.MILLISECOND, 0);\r\n\r\n\t\tcal.set(Calendar.DATE, date);\r\n\t\tcal.set(Calendar.MONTH, month);\r\n\t\tcal.set(Calendar.YEAR, year);\r\n\t\treturn cal;\r\n\t}", "public Calendar toCalendar() {\n\t\treturn (Calendar) _cal.clone();\n\t}", "public static process.proxies.UU95_CalendarSetting initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject)\r\n\t{\r\n\t\treturn new process.proxies.UU95_CalendarSetting(context, mendixObject);\r\n\t}", "RollingCalendar(TimeZone tz, Locale locale)\r\n\t{\r\n\t\tsuper(tz, locale);\r\n\t}", "public static Date createDate(int yyyy, int month, int day, int hour, int min) {\n/* 93 */ CALENDAR.clear();\n/* 94 */ CALENDAR.set(yyyy, month - 1, day, hour, min);\n/* 95 */ return CALENDAR.getTime();\n/* */ }", "private DateTime goodLocalDateUse3() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n return ld.toDateTimeAtStartOfDay(DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static native JsDate create(int year, int month, int dayOfMonth, int hours,\n int minutes, int seconds) /*-{\n return new Date(year, month, dayOfMonth, hours, minutes, seconds);\n }-*/;", "Calendar getTimeStamp();", "public String getDateTime(Calendar cal, int GMT_OFFSET_SECONDS, String DATE_TIME_FORMAT) throws Exception {\n\n String sRetVal = \"\";\n String DefaultFormat = \"yyyyMMddHHmmss\";\n int GMT_OFFSET_DIFF = 0;\n try {\n\n //check for valid Calender values\n if (cal == null) {\n cal = Calendar.getInstance();\n }\n\n //check for valid FORMAT values\n if (DATE_TIME_FORMAT == null) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n if (DATE_TIME_FORMAT.trim().toUpperCase().equalsIgnoreCase(\"\")) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n\n //check GMT RAW OFF SET difference\n int CURR_GMT_OFFSET = TimeZone.getDefault().getRawOffset() / 1000;\n //in case Current GMT is GREATER THAN provided GMT\n if (CURR_GMT_OFFSET > GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n\n //in case Current GMT is SMALLER THAN provided GMT\n } else if (CURR_GMT_OFFSET < GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n }\n\n if (CURR_GMT_OFFSET == GMT_OFFSET_SECONDS) {\n GMT_OFFSET_DIFF = 0;\n }\n\n //setting calender datetime as per GMT\n cal.add(Calendar.SECOND, GMT_OFFSET_DIFF);\n\n //using SimpleDateFormat class\n sRetVal = new SimpleDateFormat(DATE_TIME_FORMAT).format(cal.getTime());\n return sRetVal;\n\n } catch (Exception e) {\n println(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n throw new Exception(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n } finally {\n }\n\n }", "Coordinate createCoordinate();", "public Calendar GetCalendar(String sDateTime) throws Exception {\n String YYYY = \"\", MM = \"\", DD = \"\", hh = \"\", mm = \"\", ss = \"\";\n Calendar calendarInstance = null;\n try {\n //considering deafult date format as YYYY-MM-DD hh:mm:ss (e.g 2012-11-21 23:59:30)\n sDateTime = sDateTime.trim();\n if (sDateTime.equalsIgnoreCase(\"\")) {\n throw new Exception(\"Blank datetime value\");\n }\n\n YYYY = sDateTime.substring(0, 4);\n MM = sDateTime.substring(5, 7);\n DD = sDateTime.substring(8, 10);\n hh = sDateTime.substring(11, 13);\n mm = sDateTime.substring(14, 16);\n ss = sDateTime.substring(17, 19);\n MM = \"\" + (Integer.parseInt(MM) - 1);\n if (MM.length() < 2) {\n MM = \"0\" + MM;\n }\n\n calendarInstance = Calendar.getInstance();\n calendarInstance.set(Integer.parseInt(YYYY), Integer.parseInt(MM), Integer.parseInt(DD), Integer.parseInt(hh), Integer.parseInt(mm), Integer.parseInt(ss));\n return calendarInstance;\n } catch (Exception e) {\n throw new Exception(\"SetCalendar : \" + e.toString());\n }\n }", "public Calendar getCurrentMonthCalendarObj() throws Throwable{\r\n\r\n\t\tString dateInput = \"01/\"+month+\"/\"+year;\t\t\t\r\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MMMM/yyyy\");\r\n\t\tDate startDate = df.parse(dateInput);\r\n\t\tCalendar c = Calendar.getInstance(); // this takes current date\r\n\t c.setTime(startDate); // set date to specified in arguement\r\n\t\treturn c;\r\n\t}", "@Test\n public void getterCalendar(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n Assert.assertEquals(2018,calendar.getYear());\n Assert.assertEquals(4,calendar.getMonth());\n Assert.assertEquals(25,calendar.getDayOfMonth());\n }", "@Test\n public void createScheduleEntry(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n }", "public static void createAppointment(Appointment TemplateAppointment) {\n String sql = \"INSERT INTO appointments Values(NULL, ?, ?,?,?,?,?,Now(),'',Now(),'',?,?,?)\";\n // (Appointment_ID,Title,Description, Type, Phone, Division_ID) VALUES (5, '', 'test', '', 'test','')\" ;\n\n try {\n PreparedStatement ps = DBConnection.getConnection().prepareStatement(sql);\n ps.setString(1, TemplateAppointment.getTitle());\n ps.setString(2, TemplateAppointment.getDescription());\n ps.setString(3, TemplateAppointment.getLocation());\n ps.setString(4, TemplateAppointment.getType());\n LocalDateTime start = LocalDateTime.of(TemplateAppointment.getDate(), TemplateAppointment.getStartTime());\n start = WashTimeZone(start, ZoneId.systemDefault(), ZoneId.of(\"UTC\"));\n LocalDateTime end = LocalDateTime.of(TemplateAppointment.getDate(), TemplateAppointment.getEndTime());\n end = WashTimeZone(end, ZoneId.systemDefault(), ZoneId.of(\"UTC\"));\n Timestamp Tstart = Timestamp.valueOf(start);\n Timestamp Tend = Timestamp.valueOf(end);\n ps.setTimestamp(5, Tstart);\n ps.setTimestamp(6, Tend);\n//timezone work needs to happen here\n\n ps.setInt(7, TemplateAppointment.getCustomerid());\n ps.setInt(8, TemplateAppointment.getUserid());\n ps.setInt(9, TemplateAppointment.getContactid());\n\n ps.execute();\n\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }", "public static Calendar getDefaultScheduleTime() {\n Calendar scheduled = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/Copenhagen\"));\n scheduled.add(Calendar.HOUR, 1);\n\n scheduled.set(Calendar.MINUTE, 0);\n scheduled.set(Calendar.SECOND, 0);\n scheduled.set(Calendar.MILLISECOND, 0);\n\n return scheduled;\n }", "public static TimeZone getDefault();", "public VCalendar clone() {\n\t\treturn new VCalendar(this.content, this.collectionId, this.resourceId, this.earliestStart, this.latestEnd, null);\n\t}", "public JCalendar() {\r\n init();\r\n resetToDefaults();\r\n }", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "public static Calendar getCurrentTime(String argGMT) {\r\n\t\treturn DateToCalendar(getTime(argGMT));\r\n\t}", "public static Date createDate(int yyyy, int month, int day) {\n/* 75 */ CALENDAR.clear();\n/* 76 */ CALENDAR.set(yyyy, month - 1, day);\n/* 77 */ return CALENDAR.getTime();\n/* */ }", "public LocalDateTime convertToEST(ZonedDateTime time){\n ZoneId estZoneID = ZoneId.of(\"America/New_York\");\n ZonedDateTime estTime = time.withZoneSameInstant(estZoneID);\n return estTime.toLocalDateTime();\n }", "Schedule createSchedule();", "public String convertToLocalTime(Calendar eventDate, String timezone) throws ParseException;", "protected Calendar getCurrentCalendar() {\n Calendar current = new Calendar();\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n SimpleDateFormat dateFormatHour = new SimpleDateFormat(\"H\");\n SimpleDateFormat dateFormatWeekDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat dateFormatMonth = new SimpleDateFormat(\"MMM\");\n\n current.setHour(dateFormatHour.format(calendar.getTime()).toString());\n current.setWeekday(dateFormatWeekDay.format(calendar.getTime()));\n current.setMonth(dateFormatMonth.format(calendar.getTime()));\n\n return current;\n }", "public void convertDateTimeFromUTCtoPlaceTimeZone(BookingDto bookingDto) {\n\t\tPlaceDto portOfLoad = bookingDto.getPortOfLoad();\r\n\t\tif (portOfLoad != null && portOfLoad.getCity() != null) {\r\n\t\t\tString timeZonePortOfLoad = portOfLoad.getCity().getTimeZone();\r\n\t\t\tif (timeZonePortOfLoad != null && !timeZonePortOfLoad.isEmpty()) {\r\n\t\t\t\tbookingDto.setPortCutOffDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getPortCutOffDate(), timeZonePortOfLoad));\r\n\t\t\t\tbookingDto.setDocsCutOffDateTime(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getDocsCutOffDateTime(), timeZonePortOfLoad));\r\n\t\t\t\tbookingDto.setSailDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getSailDate(), timeZonePortOfLoad));\r\n\t\t\t\tbookingDto.setDocsReceivedDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getDocsReceivedDate(), timeZonePortOfLoad));\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlaceDto portOfDischarge = bookingDto.getPortOfDischarge();\r\n\t\tif (portOfDischarge != null && portOfDischarge.getCity() != null) {\r\n\t\t\tString tzPortOfDischarge = portOfDischarge.getCity().getTimeZone();\r\n\t\t\tif (tzPortOfDischarge != null && !tzPortOfDischarge.isEmpty()) {\r\n\t\t\t\tbookingDto.setEta(dateUtil.convertDateToSpecificTimeZone(bookingDto.getEta(), tzPortOfDischarge));\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlaceDto emptyPickupDepot = bookingDto.getEmptyContainerPickup();\r\n\t\tif (emptyPickupDepot != null && emptyPickupDepot.getCity() != null) {\r\n\t\t\tString tzEmptyPickupDepot = emptyPickupDepot.getCity().getTimeZone();\r\n\t\t\tif (tzEmptyPickupDepot != null && !tzEmptyPickupDepot.isEmpty()) {\r\n\t\t\t\tbookingDto.setEmptyPickupDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getEmptyPickupDate(), tzEmptyPickupDepot));\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlaceDto ingateTerminal = bookingDto.getIngateAtTerminal();\r\n\t\tif (ingateTerminal != null && ingateTerminal.getCity() != null) {\r\n\t\t\tString tzIngateTerminal = ingateTerminal.getCity().getTimeZone();\r\n\t\t\tif (tzIngateTerminal != null && !tzIngateTerminal.isEmpty()) {\r\n\t\t\t\tbookingDto.setEarlyReceivingDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getEarlyReceivingDate(), tzIngateTerminal));\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlaceDto placeOfReceipt = bookingDto.getPlaceOfReceipt();\r\n\t\tif (placeOfReceipt != null && placeOfReceipt.getCity() != null) {\r\n\t\t\tString tzPlaceOfReceipt = placeOfReceipt.getCity().getTimeZone();\r\n\t\t\tif (tzPlaceOfReceipt != null && !tzPlaceOfReceipt.isEmpty()) {\r\n\t\t\t\tbookingDto.setCargoMovingDate(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getCargoMovingDate(), tzPlaceOfReceipt));\r\n\t\t\t\tbookingDto.setRailCutOffDateTime(\r\n\t\t\t\t\t\tdateUtil.convertDateToSpecificTimeZone(bookingDto.getRailCutOffDateTime(), tzPlaceOfReceipt));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public DateTime(Calendar c) {\n setCharacteristic(null);\n if (c == null) {\n setCharacteristic(null);\n setYear(YEAR_IS_NOT_KNOWN);\n setMonth(MONTH_IS_NOT_KNOWN);\n setDay(DAY_OF_MONTH_IS_NOT_KNOWN);\n setHours(0);\n setMinutes(0);\n setSeconds(0);\n } else {\n setYear(c.get(Calendar.YEAR));\n setMonth(c.get(Calendar.MONTH) + 1);\n setDay(c.get(Calendar.DAY_OF_MONTH));\n setHours(c.get(Calendar.HOUR_OF_DAY));\n setMinutes(c.get(Calendar.MINUTE));\n setSeconds(c.get(Calendar.SECOND));\n }\n }", "public SDate getLocalTimeFromUTC(int iyear, int imonth, int iday, int ihour, int imin, double dsec,\n\t\t\tdouble d_timezone) {\n\t\t// public SDate swe_utc_time_zone(\n\t\t// int iyear, int imonth, int iday,\n\t\t// int ihour, int imin, double dsec,\n\t\t// double d_timezone) {\n\t\tint iyear_out, imonth_out, iday_out, ihour_out, imin_out;\n\t\tdouble dsec_out;\n\t\tdouble tjd, d;\n\t\tboolean have_leapsec = false;\n\t\tdouble dhour;\n\t\tif (dsec >= 60.0) {\n\t\t\thave_leapsec = true;\n\t\t\tdsec -= 1.0;\n\t\t}\n\t\tdhour = ((double) ihour) + ((double) imin) / 60.0 + dsec / 3600.0;\n\t\ttjd = swe_julday(iyear, imonth, iday, 0, SE_GREG_CAL);\n\t\tdhour -= d_timezone;\n\t\tif (dhour < 0.0) {\n\t\t\ttjd -= 1.0;\n\t\t\tdhour += 24.0;\n\t\t}\n\t\tif (dhour >= 24.0) {\n\t\t\ttjd += 1.0;\n\t\t\tdhour -= 24.0;\n\t\t}\n\t\t// swe_revjul(tjd + 0.001, SE_GREG_CAL, iyear_out, imonth_out, iday_out,\n\t\t// &d);\n\t\tIDate dt = swe_revjul(tjd + 0.001, SE_GREG_CAL);\n\t\tiyear_out = dt.year;\n\t\timonth_out = dt.month;\n\t\tiday_out = dt.day;\n\t\tihour_out = (int) dhour;\n\t\td = (dhour - (double) ihour_out) * 60;\n\t\timin_out = (int) d;\n\t\tdsec_out = (d - (double) imin_out) * 60;\n\t\tif (have_leapsec)\n\t\t\tdsec_out += 1.0;\n\t\treturn new SDate(iyear_out, imonth_out, iday_out, ihour_out, imin_out, dsec_out);\n\t}", "public void setTimeZone(TimeZone timeZone)\n {\n this.timeZone = timeZone;\n }", "public DateTime(final BusinessObject parent) {\n super(parent);\n if (clock == null) {\n throw new ApplicationException(\"Clock not set up\");\n }\n setValue(new java.util.Date(clock.getTime()));\n isNull = false;\n }", "private DateTime goodLocalTimeUse2() {\n LocalTime lt = new LocalTime(8, 0, 0, 0);\n return new DateTime().toDateTime(DateTimeZone.getDefault())\n .withTime(lt)\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "public static Date toDate(Object obj, TimeZone timeZone) {\n return toDate(obj, (String) null, timeZone);\n }", "public void setTimeZone(TimeZone tmz)\n {\n this.timeZone = tmz; // may be null\n }", "public static void main(String[] args) {\n\t\tCalendar calNY = Calendar.getInstance();\n\t\t\n\t\tcalNY.setTimeZone(TimeZone.getTimeZone(\"America/New_York\"));\n\t\t\n\t\tSystem.out.println(\"Time in NY: \" \n\t\t\t\t\t\t\t+ calNY.get(Calendar.HOUR_OF_DAY) \n\t\t\t\t\t\t\t+ \":\" \n\t\t\t\t\t\t\t+ calNY.get(Calendar.MINUTE) \n\t\t\t\t\t\t\t+ \":\" \n\t\t\t\t\t\t\t+ calNY.get(Calendar.SECOND));\n\t}", "private DateTime goodLocalDateTimeUse() {\n LocalDateTime ldt = new LocalDateTime(2020, 6, 2, 8, 0, 0, 0);\n return new DateTime(ldt.getYear(), ldt.getMonthOfYear(), ldt.getDayOfYear(), ldt.getHourOfDay(),\n ldt.getMinuteOfHour(), ldt.getSecondOfMinute(), ldt.getMillisOfSecond(),\n DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n\n }", "private DateTime goodLocalDateTimeUse2() {\n LocalDateTime ldt = new LocalDateTime(2020, 6, 2, 8, 0, 0, 0);\n return new DateTime(ldt.getYear(), ldt.getMonthOfYear(), ldt.getDayOfYear(), ldt.getHourOfDay(),\n ldt.getMinuteOfHour(), ldt.getSecondOfMinute(), ldt.getMillisOfSecond(),\n DateTimeZone.getDefault())\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n\n }", "public static native JsDate create(int year, int month, int dayOfMonth, int hours) /*-{\n return new Date(year, month, dayOfMonth, hours);\n }-*/;", "public void setTodayCalendar()\n {\n this.currentCalendar = Calendar.getInstance();\n }", "private static Calendar toUTCCalendarWithoutTime(final Date date) {\n final Calendar calendar = Calendar.getInstance();\n calendar.clear();\n calendar.setTime(date);\n calendar.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar;\n }", "public java.time.LocalDateTime convertToCurrentZone(java.time.LocalDateTime time_input){\r\n java.time.LocalDateTime newDateTime = time_input.atZone(ZoneId.of(\"GMT\")).withZoneSameInstant(getTimeZone().toZoneId()).toLocalDateTime();\r\n return newDateTime;\r\n }", "private DateTime goodLocalDateUse2() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n LocalTime now = LocalTime.now();\n return new DateTime(ld.getYear(), ld.getMonthOfYear(), ld.getDayOfYear(), now.getHourOfDay(),\n now.getMinuteOfHour(), now.getSecondOfMinute(), now.getMillisOfSecond(),\n DateTimeZone.getDefault())\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "public void testConstructor() throws ParseException {\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n Date date = df.parse(\"2008-08-08 12:34:56.789\");\n Calendar cal = Calendar.getInstance();\n cal.setTime(date);\n \n AbstractTemporalLiteral tl1 = new MockTemporalLiteral(date);\n assertEquals(date, tl1.getValue());\n\n try {\n new MockTemporalLiteral((Date) null);\n fail(\"NullPointerException should have been thrown\");\n } catch (NullPointerException ex) {\n assertTrue(true);\n }\n \n AbstractTemporalLiteral tl2 = new MockTemporalLiteral(cal);\n assertEquals(date, tl2.getValue());\n \n try {\n new MockTemporalLiteral((Calendar) null);\n fail(\"NullPointerException should have been thrown\");\n } catch (NullPointerException ex) {\n assertTrue(true);\n }\n }", "public Schedule create() {\n\n\t\tSchedule result;\n\n\t\tresult = new Schedule();\n\n\t\treturn result;\n\t}", "@Override\npublic final Object clone() {\n return new ClockTime(dateValue());\n }", "public void testCreateInstance() throws ParseException {\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n Date date = df.parse(\"2008-08-08 12:34:56.789\");\n \n AbstractTemporalLiteral d = AbstractTemporalLiteral.createInstance(TemporalType.DATE, date);\n assertTrue(d instanceof DateLiteral);\n d = AbstractTemporalLiteral.createInstance(TemporalType.TIME, date);\n assertTrue(d instanceof TimeLiteral);\n d = AbstractTemporalLiteral.createInstance(TemporalType.TIMESTAMP, date);\n assertTrue(d instanceof TimestampLiteral);\n \n Calendar cal = Calendar.getInstance();\n cal.setTime(date);\n \n d = AbstractTemporalLiteral.createInstance(TemporalType.DATE, cal);\n assertTrue(d instanceof DateLiteral);\n d = AbstractTemporalLiteral.createInstance(TemporalType.TIME, cal);\n assertTrue(d instanceof TimeLiteral);\n d = AbstractTemporalLiteral.createInstance(TemporalType.TIMESTAMP, cal);\n assertTrue(d instanceof TimestampLiteral);\n }", "private void setDefaultTimezone() {\n TimeZone tz = Calendar.getInstance().getTimeZone();\n this.setTimezone(tz.getID());\n }", "public static native JsDate create(int year, int month, int dayOfMonth, int hours,\n int minutes, int seconds, int millis) /*-{\n return new Date(year, month, dayOfMonth, hours, minutes, seconds, millis);\n }-*/;", "public static Date getLocalUTCTime(){\r\n\t\tfinal Calendar cal=Calendar.getInstance();\r\n\t\tfinal int zoneOffset=cal.get(Calendar.ZONE_OFFSET);\r\n\t\tfinal int dstOffset=cal.get(Calendar.DST_OFFSET);\r\n\t\tcal.add(Calendar.MILLISECOND, -(zoneOffset+dstOffset));\r\n\t\treturn cal.getTime();\r\n\t}", "public static native JsDate create(int year, int month, int dayOfMonth, int hours,\n int minutes) /*-{\n return new Date(year, month, dayOfMonth, hours, minutes);\n }-*/;", "public Entry(Calendar date){\n this.date = date; \n }", "static synchronized BasisGoogleCalendar getCalendar(UpodWorld w)\n{\n if (DATA_STORE_DIR == null) return null;\n if (cal_service == null) {\n try {\n\t cal_service = getCalendarService();\n }\n catch (IOException e) {\n\t BasisLogger.logE(\"GOOGLECAL: Authorization problem with calendar api: \" + e);\n\t DATA_STORE_DIR = null;\n\t HTTP_TRANSPORT = null;\n\t DATA_STORE_FACTORY = null;\n\t return null;\n }\n }\n\n BasisGoogleCalendar rslt = the_calendars.get(w);\n if (rslt == null) {\n rslt = new BasisGoogleCalendar();\n the_calendars.put(w,rslt);\n }\n\n return rslt;\n}", "public void createCalendar(String calendarName, String description) {\n /*\n https://stackoverflow.com/questions/136419/get-integer-value-of-the-current-year-in-java\n */\n int year = Calendar.getInstance().get(Calendar.YEAR);\n Calendar_ newCalendar = new Calendar_(\n this.userId,\n CalendarTypeEnum.GREGORIAN_CALENDAR,\n year,\n calendarName,\n this.username,\n description\n );\n //add new calendar to the user's list of calendars\n calendarsOwned.add(newCalendar);\n }", "private Date getSamoaNow() {\n\t\t// Get the current datetime in UTC\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(new Date());\n\t\t\n\t\t// Get the datetime minus 11 hours (Samoa is UTC-11)\n\t\tcalendar.add(Calendar.HOUR_OF_DAY, -11);\n\t\t\n\t\treturn calendar.getTime();\n\t}", "private DateTime goodLocalDateUse() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n LocalTime now = LocalTime.now();\n return new DateTime(ld.getYear(), ld.getMonthOfYear(), ld.getDayOfYear(), now.getHourOfDay(),\n now.getMinuteOfHour(), now.getSecondOfMinute(), now.getMillisOfSecond(),\n DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "private static Calendar getService() throws GeneralSecurityException, IOException {\n final NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();\n return new Calendar.Builder(HTTP_TRANSPORT, JSON_FACTORY, getCredentials(HTTP_TRANSPORT))\n .setApplicationName(APPLICATION_NAME).build();\n }", "private DateTime goodLocalDateUse4() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n return new DateTime().toDateTime(DateTimeZone.forID(\"America/New_York\"))\n .withDate(ld)\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "public Calendar endOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE) + 1);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "@Test\n public void whenTestTwoUsersWithTheSameNameAndBirthdayTheGetTrue() {\n Calendar birthday = Calendar.getInstance();\n birthday.set(1001, 12, 21);\n User john = new User(\"John Snow\", birthday);\n User snow = new User(\"John Snow\", (Calendar) birthday.clone());\n\n assertTrue(john.equals(snow));\n }", "private Date getTestListingDateTimeStamp() {\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/London\"));\n\n GregorianCalendar calendar = new GregorianCalendar(2010, 0, 1, 17, 0);\n return new Date(calendar.getTimeInMillis());\n }", "private ZonedDateTime resolveInstant(LocalDateTime newDateTime) {\n return ofInstant(newDateTime, offset, zone);\n }", "public static Time toTime(Object obj, String pattern, TimeZone timeZone) {\n if (obj == null) {\n return null;\n } else if (obj instanceof String) {\n return toTimeFromString((String) obj, pattern, timeZone);\n } else if (obj instanceof Time) {\n final Time paramTime = (Time) obj;\n if (Time.class.equals(paramTime.getClass())) { // pure time\n return paramTime;\n } else { // sub class\n // because the time type is not final class.\n return new Time(paramTime.getTime());\n }\n } else if (obj instanceof Date) {\n Date date = (Date) obj;\n Calendar cal = Calendar.getInstance();\n cal.setTime(date);\n cal.set(Calendar.YEAR, 1970);\n cal.set(Calendar.MONTH, Calendar.JANUARY);\n cal.set(Calendar.DATE, 1);\n return new Time(cal.getTimeInMillis());\n } else if (obj instanceof Calendar) {\n Calendar cal = (Calendar) obj;\n cal.set(Calendar.YEAR, 1970);\n cal.set(Calendar.MONTH, Calendar.JANUARY);\n cal.set(Calendar.DATE, 1);\n return new Time(cal.getTimeInMillis());\n } else if (obj instanceof byte[]) {\n return toTime(toSerializable((byte[]) obj)); // recursive\n } else if (obj instanceof Long) {\n return toTime(toDate((Long) obj));\n } else {\n return toTimeFromString(obj.toString(), pattern, timeZone);\n }\n }", "@NonNull public static CalendarDay today() {\n return from(LocalDate.now());\n }" ]
[ "0.6013959", "0.5923155", "0.5891367", "0.57034373", "0.5649421", "0.560931", "0.55730593", "0.55624306", "0.5541107", "0.53550166", "0.5294129", "0.5278295", "0.52485436", "0.52485436", "0.52453035", "0.52245003", "0.5154237", "0.51053804", "0.5080292", "0.5071582", "0.50532717", "0.50458837", "0.5019245", "0.49994874", "0.4997947", "0.49659348", "0.49241313", "0.49140376", "0.48641914", "0.48313335", "0.47949725", "0.4794562", "0.47934067", "0.47796658", "0.47138304", "0.46848965", "0.46844035", "0.46765548", "0.46745095", "0.464643", "0.46446896", "0.46269327", "0.46250415", "0.462483", "0.46237916", "0.46233657", "0.46228492", "0.46191084", "0.46038905", "0.4602924", "0.45961818", "0.4592734", "0.45900413", "0.4588061", "0.45822245", "0.45796615", "0.45770782", "0.45749956", "0.4567434", "0.4562069", "0.45488897", "0.45348865", "0.45315823", "0.45293552", "0.45216078", "0.45167172", "0.44965783", "0.44962534", "0.44955626", "0.4479548", "0.4456972", "0.44502378", "0.4425612", "0.44154203", "0.44063327", "0.4399549", "0.43985987", "0.43944442", "0.43651888", "0.43651205", "0.43635577", "0.43610254", "0.43568084", "0.43487912", "0.43416232", "0.43354803", "0.4334963", "0.4327437", "0.4326438", "0.43256843", "0.43221292", "0.43131897", "0.4304649", "0.43014967", "0.4296155", "0.42864743", "0.42797238", "0.42780942", "0.42678666", "0.42428702", "0.42378613" ]
0.0
-1
Calculates the number of days between two timestamps Used by DEPRICATED DataGraphLoader class remove when it is deleted
public static long daysBetween(long start, long end) { long result = 1l; if (end > start) { Long diff = end - start; Double days = diff / DTConstants.MILLSECS_PER_DAY; Integer wholeDays = days.intValue(); if (0 == wholeDays) { wholeDays = 1; } else { if (0 != (days - wholeDays)) { wholeDays++; } } result = wholeDays.longValue(); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getDays() {\n\t\tlong arrival = arrivalDate.toEpochDay();\n\t\tlong departure = departureDate.toEpochDay();\n\t\tint days = (int) Math.abs(arrival - departure);\n\n\t\treturn days;\n\t}", "public long dayDiffCalculator(String a, String b){\n\n long dateDiff = 0;\n\n Date d1 = null;\n Date d2 = null;\n\n try{\n d1 = sdf.parse(a);\n d2 = sdf.parse(b);\n\n long diff = d2.getTime() - d1.getTime();\n\n long diffSeconds = diff / 1000 % 60;\n long diffMinutes = diff / (60 * 1000) % 60;\n long diffHours = diff / (60 * 60 * 1000) % 24;\n long diffDays = diff / (24 * 60 * 60 * 1000);\n\n dateDiff = diffDays;\n\n } catch (Exception e){}\n\n return dateDiff;\n }", "private double getTimeRemainingInUTCDay(){\n\t\tdouble daysLeftInDay;\n\n\t\tInstant origin = Instant.ofEpochMilli (cur_mainshock.getOriginTime());\n\t\tZonedDateTime zdt = ZonedDateTime.ofInstant (origin, ZoneOffset.UTC);\n\t\tZonedDateTime zdt2 = zdt.toLocalDate().atStartOfDay (ZoneOffset.UTC);\n\t\tInstant daybreak = zdt2.toInstant();\n\n//\t\tSimpleDateFormat formatter=new SimpleDateFormat(\"d MMM yyyy, HH:mm:ss\");\n//\t\tformatter.setTimeZone(utc); //utc=TimeZone.getTimeZone(\"UTC\"));\n//\t\tSystem.out.println(formatter.format(Date.from (origin)));\n//\t\tSystem.out.println(formatter.format(Date.from (daybreak)));\n\t\t\n\t\tdaysLeftInDay = 1.0 - ((double)(origin.toEpochMilli() - daybreak.toEpochMilli()))/ComcatOAFAccessor.day_millis;\n\t\tif (daysLeftInDay == 1.0) {\n\t\t\tdaysLeftInDay = 0.0;\n\t\t}\n\t\treturn daysLeftInDay;\n\t}", "public static long msPerTradingDay() {\r\n long result = 0;\r\n Calendar dateStart = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\r\n Calendar dateEnd = DTUtil.deepCopyCalendar(dateStart);\r\n dateStart.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n dateStart.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n dateStart.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n dateEnd.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR);\r\n dateEnd.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN);\r\n dateEnd.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC);\r\n result = dateEnd.getTimeInMillis() - dateStart.getTimeInMillis();\r\n return result;\r\n }", "private long dateDiffInNumberOfDays(LocalDate startDate, LocalDate endDate) {\n\n return ChronoUnit.DAYS.between(startDate, endDate);\n }", "@Override\n\tpublic int getDaysSinceLastLogin() {\n\t\tDate now = sabre.getTimeNow();\n\t\tlong timeDiff = now.getTime() - lastLogin.getTime();\n\t\tlong diffDays = TimeUnit.DAYS.convert(timeDiff, TimeUnit.MILLISECONDS);\n\t\treturn (int)diffDays;\n\t}", "private int getDifferenceDays(Date d1, Date d2) {\n int daysdiff = 0;\n long diff = d2.getTime() - d1.getTime();\n long diffDays = diff / (24 * 60 * 60 * 1000) + 1;\n daysdiff = (int) diffDays;\n return daysdiff;\n }", "public long getDifference(DateTime dt) {\n return (this.date.getTime() - dt.date.getTime()) / 1000;\r\n }", "public long difference() {\n long differenceBetweenDate = ChronoUnit.DAYS.between(startDate.toInstant(), endDate.toInstant());\n\n return differenceBetweenDate;\n\n }", "public long days(Date date2) {\n\t\tlong getDaysDiff =0;\n\t\t DateFormat simpleDateFormat = new SimpleDateFormat(\"dd-MM-yyyy\");\n\n\t\t Date currentDate = new Date();\n\t\t Date date1 = null;\n\t\t Date date3 = null;\n\n\t\t\n\n\t\t try {\n\t\t String startDate = simpleDateFormat.format(date2);\n\t\t String endDate = simpleDateFormat.format(currentDate);\n\n\t\t date1 = simpleDateFormat.parse(startDate);\n\t\t date3 = simpleDateFormat.parse(endDate);\n\n\t\t long getDiff = date3.getTime() - date1.getTime();\n\n\t\t getDaysDiff = getDiff / (24 * 60 * 60 * 1000);\n\t\t \n\t\t \n\t\t \n\t\t } catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t }\n\t\t return getDaysDiff;\n\n}", "public static long getDiffDays(Date date1,Date date2) {\n Calendar calendar1= Calendar.getInstance();\n Calendar calendar2 = Calendar.getInstance();\n\n calendar1.setTime(date1);\n calendar2.setTime(date2);\n\n long msDiff = calendar1.getTimeInMillis()-calendar2.getTimeInMillis();\n long daysDiff = TimeUnit.MILLISECONDS.toDays(msDiff);\n Log.e(\"Amarneh\",\"diffDays>>\"+daysDiff);\n return daysDiff;\n }", "private static long getQtdDias(String dataAniversario){\n DateTimeFormatter data = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\n LocalDateTime now = LocalDateTime.now();\n String dataHoje = data.format(now);\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\", Locale.ENGLISH);\n try {\n Date dtAniversario = sdf.parse(dataAniversario);\n Date hoje = sdf.parse(dataHoje);\n //Date hoje = sdf.parse(\"51515/55454\");\n long diferenca = Math.abs(hoje.getTime() - dtAniversario.getTime());\n long qtdDias = TimeUnit.DAYS.convert(diferenca, TimeUnit.MILLISECONDS);\n return qtdDias;\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return 0;\n }", "private long getDaysBetween(LocalDateTime d1, LocalDateTime d2) {\n return d1.until(d2,DAYS);\n }", "private String getTimestampDifference(){\r\n Log.d(TAG, \"getTimestampDifference: getting timestamp difference.\");\r\n\r\n String difference = \"\";\r\n Calendar c = Calendar.getInstance();\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\", Locale.UK);\r\n sdf.setTimeZone(TimeZone.getTimeZone(\"Asia/Dubai\"));//google 'android list of timezones'\r\n Date today = c.getTime();\r\n sdf.format(today);\r\n Date timestamp;\r\n\r\n final String photoTimestamp = mJobPhoto.getDate_created();\r\n try{\r\n timestamp = sdf.parse(photoTimestamp);\r\n difference = String.valueOf(Math.round(((today.getTime() - timestamp.getTime()) / 1000 / 60 / 60 / 24 )));\r\n }catch (ParseException e){\r\n Log.e(TAG, \"getTimestampDifference: ParseException: \" + e.getMessage() );\r\n difference = \"0\";\r\n }\r\n return difference;\r\n }", "private long getDuration() throws Exception {\n\treturn dtEnd.getTime() - dtStart.getTime();\n }", "@DISPID(52)\r\n\t// = 0x34. The runtime will prefer the VTID if present\r\n\t@VTID(50)\r\n\tint actualCPUTime_Days();", "public long timeDifference(Datum datum) {\n\t\treturn (date.getTime() - datum.getTime()) / 60000;\n }", "public int getLengthDays() {\r\n\t\treturn diffDays(imageList.get(0).cal, getLast().cal);\r\n\t}", "public static int CalcularDiferenciaDiasFechas(Date fecha1, Date fecha2){\n Calendar cal1 = Calendar.getInstance();\r\n Calendar cal2 = Calendar.getInstance();\r\n cal1.setTime(fecha1);\r\n cal2.setTime(fecha2);\r\n // conseguir la representacion de la fecha en milisegundos\r\n long milis1 = cal1.getTimeInMillis();\r\n long milis2 = cal2.getTimeInMillis();\r\n // calcular la diferencia en milisengundos\r\n long diff = milis2 - milis1;\r\n // calcular la diferencia en horas\r\n Long diffHours = diff / (24 * 60 * 60 * 1000);\r\n return diffHours.intValue();\r\n }", "@Override\n public Long getRunningTimeInDays() {\n return null;\n }", "static long getDaysPart(Duration d) {\n long t = d.getSeconds() / 60 / 60 / 24;\n return t;\n }", "public int getDifference(DaysBetween dt1, DaysBetween dt2)\n {\n // COUNT TOTAL NUMBER OF DAYS BEFORE FIRST DATE 'dt1'\n \n // initialize count using years and day\n int n1 = dt1.y * 365 + dt1.d;\n \n // Add days for months in given date\n for (int i = 0; i < dt1.m - 1; i++) \n {\n n1 += monthDays[i];\n }\n \n // Since every leap year is of 366 days,\n // Add a day for every leap year\n n1 += countLeapYears(dt1);\n \n // SIMILARLY, COUNT TOTAL NUMBER OF DAYS BEFORE 'dt2'\n int n2 = dt2.y * 365 + dt2.d;\n for (int i = 0; i < dt2.m - 1; i++)\n {\n n2 += monthDays[i];\n }\n n2 += countLeapYears(dt2);\n \n // return difference between two counts\n return (n2 - n1);\n }", "static int calculateTimeDelta(TimeInterval interval_1, TimeInterval interval_2) {\n TimeInterval earlier;\n TimeInterval later;\n if (interval_1.getStartTime().before(interval_2.getStartTime())) {\n earlier = interval_1;\n later = interval_2;\n } else {\n earlier = interval_2;\n later = interval_1;\n }\n\n return (int) (later.getStartTime().getTime() - earlier.getStopTime().getTime());\n }", "@DISPID(67)\r\n\t// = 0x43. The runtime will prefer the VTID if present\r\n\t@VTID(65)\r\n\tint averageCPUTime_Days();", "public long getDays() {\r\n \treturn days;\r\n }", "public int getKeepLogDays() {\n\t\tInteger ii = (Integer) get_Value(\"KeepLogDays\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public int age(){\r\n\t\t//1000 ms = 1s, 60s = 1 min, 60 min = 1h, 24h = 1 day\r\n\t\t//1 Day = 1000 * 60 * 60 * 24\r\n\t\tlong divide = 1000 * 60 * 60 * 24;\r\n\t\tDate d = new Date();\r\n\t\tlong timeNow = d.getTime();\r\n\t\tlong pubDate = dateOfPublication.getTime();\r\n\t\t\r\n\t\tlong between = timeNow - pubDate;\r\n\t\t\r\n\t\tlong daysSincePub = between / divide;\r\n\t\treturn (int) daysSincePub;\r\n\t}", "int getNumberDays();", "long getTermDays();", "private long getTimeDifference(Time timeValue1, Time timeValue2){\n return (timeValue2.getTime()-timeValue1.getTime())/1000;\n }", "private int normalizeTime() {\n int currentTimeSeconds = (int) (System.currentTimeMillis() / 1000);\n\n // The graphing interval in minutes\n // TODO not hardcoded :3\n int interval = 30;\n\n // calculate the devisor denominator\n int denom = interval * 60;\n\n return (int) Math.round((currentTimeSeconds - (denom / 2d)) / denom) * denom;\n }", "public static int microDateDays(long modified) {\n return (int) ((modified / day) % 262144);\r\n }", "protected double difftime(double t2, double t1) {\n\t\treturn t2 - t1;\n\t}", "double getAgeDays();", "public int getUpDays() {\n return (int)(_uptime / 86400000);\n }", "public int getDaysSinceStartOfEpoch() {\r\n long millis = new GregorianCalendar(year, month - 1, day).getTimeInMillis();\r\n return (int) (millis / MILLIS_PER_DAY);\r\n\r\n }", "public long printDifferenceDay(Date startDate, Date endDate){\n\n //milliseconds\n long different = endDate.getTime() - startDate.getTime();\n\n long secondsInMilli = 1000;\n long minutesInMilli = secondsInMilli * 60;\n long hoursInMilli = minutesInMilli * 60;\n long daysInMilli = hoursInMilli * 24;\n\n double elapsedDays = (double) Math.ceil((different / daysInMilli) + 0.5);\n different = different % daysInMilli;\n\n long elapsedHours = different / hoursInMilli;\n different = different % hoursInMilli;\n\n long elapsedMinutes = different / minutesInMilli;\n different = different % minutesInMilli;\n\n long elapsedSeconds = different / secondsInMilli;\n\n return (long) elapsedDays;\n //System.out.printf(\"%d days, %d hours, %d minutes, %d seconds%n\",elapsedDays,elapsedHours, elapsedMinutes, elapsedSeconds);\n\n }", "@Override\n public final long daysInEffect(final LocalDate comparison) {\n return ChronoUnit.DAYS.between(this.getStartDate(), comparison);\n }", "public static long getDayNumber() {\n return getSecondsSinceEpoch() / SECS_TO_DAYS;\n }", "public static long getDateDiffer(Calendar cal1, Calendar cal2){\n long millis1 = cal1.getTimeInMillis();\n long millis2 = cal2.getTimeInMillis();\n\n // Calculate difference in milliseconds\n long diff = millis2 - millis1;\n\n // Calculate difference in seconds\n long diffSeconds = diff / 1000;\n\n // Calculate difference in minutes\n long diffMinutes = diff / (60 * 1000);\n\n // Calculate difference in hours\n long diffHours = diff / (60 * 60 * 1000);\n\n // Calculate difference in days\n long diffDays = diff / (24 * 60 * 60 * 1000);\n\n System.out.println(\"In milliseconds: \" + diff + \" milliseconds.\");\n System.out.println(\"In seconds: \" + diffSeconds + \" seconds.\");\n System.out.println(\"In minutes: \" + diffMinutes + \" minutes.\");\n System.out.println(\"In hours: \" + diffHours + \" hours.\");\n System.out.println(\"In days: \" + diffDays + \" days.\");\n\n return diffDays;\n }", "public Integer getTotalDays()\r\n/* 68: */ {\r\n/* 69:67 */ return this.totalDays;\r\n/* 70: */ }", "io.dstore.values.TimestampValue getToDay();", "public int calcDays() {\n\t\tint days = day-1;\r\n\t\tdays += ((month-1)*30);\r\n\t\tdays += ((year -2000) * (12*30));\r\n\t\treturn days;\r\n\t}", "protected int getTimestampLength()\n {\n return supportsTimestampNanoseconds() ?\n DRDAConstants.JDBC_TIMESTAMP_LENGTH : DRDAConstants.DRDA_OLD_TIMESTAMP_LENGTH;\n }", "public long daysToDeadline() {\n return DateWrapper.getTimeBetween(Clock.now().getDateWrapper(), getDate(), ChronoUnit.DAYS);\n }", "public long getDifference(Date startDate, Date endDate){\n\n //milliseconds\n long different = endDate.getTime() - startDate.getTime();\n\n System.out.println(\"startDate : \" + startDate);\n System.out.println(\"endDate : \"+ endDate);\n System.out.println(\"different : \" + different);\n\n long secondsInMilli = 1000;\n long minutesInMilli = secondsInMilli * 60;\n long hoursInMilli = minutesInMilli * 60;\n long daysInMilli = hoursInMilli * 24;\n\n long elapsedDays = different / daysInMilli;\n different = different % daysInMilli;\n\n long elapsedHours = different / hoursInMilli;\n different = different % hoursInMilli;\n\n long elapsedMinutes = different / minutesInMilli;\n different = different % minutesInMilli;\n\n long elapsedSeconds = different / secondsInMilli;\n\n System.out.printf(\n \"%d days, %d hours, %d minutes, %d seconds%n\",\n elapsedDays,\n elapsedHours, elapsedMinutes, elapsedSeconds);\n\n return elapsedMinutes;\n }", "@DISPID(62)\r\n\t// = 0x3e. The runtime will prefer the VTID if present\r\n\t@VTID(60)\r\n\tint averageRunTime_Days();", "public double TimeTaken(Date dtStartDate) {\n\t\t\tDate dtEndDate = new Date();\n\t\t\tdouble dtTimeTaken = dtEndDate.getTime() - dtStartDate.getTime();\n\t\t\tdtTimeTaken = dtTimeTaken / 1000;\n\t\t\treturn dtTimeTaken;\n\t\t}", "public int getNumDaysForComponent(Record record);", "@Override\n protected String serializeDaysBetween(ImmutableList<? extends ImmutableTerm> terms,\n Function<ImmutableTerm, String> termConverter, TermFactory termFactory) {\n return String.format(\"DATEDIFF(DAY, %s, %s) - IIF(CAST(%s AS TIME) > CAST(%s AS TIME), 1, 0)\",\n termConverter.apply(terms.get(1)),\n termConverter.apply(terms.get(0)),\n termConverter.apply(terms.get(1)),\n termConverter.apply(terms.get(0)));\n }", "private int calculateDaysLeftOnLicense(Date pNowDate, Date pExpiryDate)\n{\n \n //milliseconds since 1/1/1970, 00:00:00 GMT\n long nowTime = pNowDate.getTime(); \n long expiryTime = pExpiryDate.getTime();\n\n long daysRemaining = expiryTime - nowTime; //time left in milliseconds\n \n daysRemaining /= 1000; //convert to seconds\n daysRemaining /= 60; //convert to minutes\n daysRemaining /= 60; //convert to hours\n daysRemaining /= 24; //convert to days\n \n if (daysRemaining > Integer.MAX_VALUE) {daysRemaining = Integer.MAX_VALUE;}\n if (daysRemaining < Integer.MIN_VALUE) {daysRemaining = Integer.MIN_VALUE;}\n \n return((int)daysRemaining);\n \n}", "@Override\n public long deltaTo(Counter otherCounter)\n {\n return otherCounter.getAsLong() - this.getAsLong();\n }", "private long getTotalDuration() {\n if(mMarkers.size() == 0) {\n return 0;\n }\n long first = mMarkers.get(0).time;\n long last = mMarkers.get(mMarkers.size() - 1).time;\n return last - first;\n }", "public int getDateRmain() throws ParseException {\n String[] dateParts = description.split(\"<br />\");\n\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"E, dd MMMMM yyyy - HH:mm\");\n String start = dateParts[0];\n Date st = sdf.parse(start.split(\": \")[1]);\n String end = dateParts[1];\n Date ed = sdf.parse(end.split(\": \")[1]);\n Date now = Calendar.getInstance().getTime();\n\n //long daysRemain1=(e.getTime()-s.getTime()+1000000)/(3600*24*1000);\n long diffInMillies = Math.abs(ed.getTime() - st.getTime());\n long diff = TimeUnit.DAYS.convert(diffInMillies, TimeUnit.MILLISECONDS);\n\n dateRmain = (int)diff;\n return dateRmain;\n }", "public static long CountDaysBetween(String D1, String D2) {\n\t\tfinal DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy/MM/dd\");\n\t\tfinal LocalDate firstDate = LocalDate.parse(D1, formatter);\n\t\tfinal LocalDate secondDate = LocalDate.parse(D2, formatter);\n\t\tfinal long days = ChronoUnit.DAYS.between(firstDate, secondDate);\n\t\t// System.out.println(\"Days between: \" + days);\n\t\treturn days;\n\t}", "public static long deltaSeconds(Date d1, Date d2) {\n Arguments.Ensure.NotNull(d1, d2);\n long difference = d2.getTime() - d1.getTime();\n return difference / 1000;\n }", "private long daysBetween() throws ParseException {\n Scanner input = new Scanner(System.in);\n System.out.println(\"Enter the date of when you rented the game dd/MM/yyyy:\");\n String dateReturn = input.nextLine();\n Date date = new SimpleDateFormat(\"dd/MM/yyyy\").parse(dateReturn);\n long interval = new Date().getTime() - date.getTime();\n return TimeUnit.DAYS.convert(interval, TimeUnit.MILLISECONDS);\n }", "public int totalTime()\n {\n return departureTime - arrivalTime;\n }", "public int getNumberOfDays() {\n return numberOfDays;\n }", "public BigDecimal getNO_OF_DAYS() {\r\n return NO_OF_DAYS;\r\n }", "public int getTotalTime();", "io.dstore.values.TimestampValue getDay();", "public Timestamp getDeltaTime() {\n\treturn mDelta;\n }", "public long getTimeLength() {\n return itemsets.get(itemsets.size() - 1).getTimestamp() - itemsets.get(0).getTimestamp();\n }", "public int getLBR_ProtestDays();", "public int getDaysSinceDeath() {\n return daysSinceDeath;\n }", "long getTotalDoExamTime();", "@DISPID(57)\r\n\t// = 0x39. The runtime will prefer the VTID if present\r\n\t@VTID(55)\r\n\tint actualRunTime_Days();", "private static long getDateDiff(Date date1, Date date2, TimeUnit timeUnit) {\n long diffInMillies = date2.getTime() - date1.getTime();\n return timeUnit.convert(diffInMillies, TimeUnit.MILLISECONDS);\n }", "public int getDays(){\r\n\t\treturn days;\r\n\t}", "public static int getNumberOfDays() {\n\t\treturn numberOfDays;\n\t}", "@Transient\n \tpublic int getDuration() {\n \t\tint duration = (int) (this.endTime.getTime() - this.startTime.getTime());\n \t\treturn duration / 1000;\n \t}", "public int getUDays() {\n return uDays;\n }", "io.dstore.values.TimestampValueOrBuilder getToDayOrBuilder();", "public static int countDiffDay(Calendar c1, Calendar c2) {\n int returnInt = 0;\n while (!c1.after(c2)) {\n c1.add(Calendar.DAY_OF_MONTH, 1);\n returnInt++;\n }\n\n if (returnInt > 0) {\n returnInt = returnInt - 1;\n }\n\n return (returnInt);\n }", "public double getPer_day(){\n\t\tdouble amount=this.num_of_commits/365;\n\t\treturn amount;\n\t}", "public double getDeltaT() {\n\t\tif (deltatIsValid) {\n\t\t\treturn this.deltaT;\n\t\t}\n\t\tthis.deltaT = calc_deltaT(this.getJulDay());\n\t\tdeltatIsValid = true;\n\t\treturn this.deltaT;\n\t}", "public static double getGraidentBasedOnTradingDays(IGraphLine aLine, TreeSet<AbstractGraphPoint> listOfTradingDays) {\r\n double result = 0;\r\n if (null != aLine && null != listOfTradingDays) {\r\n AbstractGraphPoint myCurrStart = aLine.getCurrentC();\r\n AbstractGraphPoint myCurrEnd = aLine.getCurrentE();\r\n if (myCurrStart.getDateAsNumber() != myCurrEnd.getDateAsNumber()) {\r\n// TreeSet<AbstractGraphPoint> tDay = new TreeSet<AbstractGraphPoint>(AbstractGraphPoint.TimeComparator);\r\n// tDay.addAll(listOfTradingDays);\r\n //Calc P1\r\n //Get Market close time on start day\r\n Calendar endTrading = DTUtil.deepCopyCalendar(myCurrStart.getCalDate());\r\n endTrading.setTimeZone(DTConstants.EXCH_TIME_ZONE);\r\n endTrading.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR);\r\n endTrading.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN);\r\n endTrading.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC);\r\n double p1 = endTrading.getTimeInMillis() - myCurrStart.getCalDate().getTimeInMillis();\r\n //double p1 = endTrading.getTimeInMillis() - (myCurrStart.getCalDate().getTimeInMillis() - DTConstants.MILLSECS_PER_HOUR);\r\n //Now calculate P2\r\n //Get Market open time on end day\r\n Calendar startTrading = DTUtil.deepCopyCalendar(myCurrEnd.getCalDate());\r\n startTrading.setTimeZone(DTConstants.EXCH_TIME_ZONE);\r\n startTrading.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n startTrading.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n startTrading.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n double p2 = (myCurrEnd.getCalDate().getTimeInMillis() - startTrading.getTimeInMillis());\r\n //double p2 = (myCurrEnd.getCalDate().getTimeInMillis() - DTConstants.MILLSECS_PER_HOUR) - startTrading.getTimeInMillis();\r\n //Now calc P3\r\n //Get count of trading days from list\r\n// int currStartDay = myCurrStart.getDateAsNumber();\r\n// int currEndDay = myCurrEnd.getDateAsNumber();\r\n// NavigableSet<AbstractGraphPoint> subSet = new TreeSet<AbstractGraphPoint>();\r\n// for(AbstractGraphPoint currPoint : tDay){\r\n// int currDay = currPoint.getDateAsNumber();\r\n// if(currDay > currStartDay && currDay < currEndDay){\r\n// subSet.add(currPoint);\r\n// }\r\n// }\r\n NavigableSet<AbstractGraphPoint> subSet = listOfTradingDays.subSet(myCurrStart, false, myCurrEnd, false);\r\n ArrayList<AbstractGraphPoint> theSet = new ArrayList<AbstractGraphPoint>();\r\n theSet.addAll(subSet);\r\n for (AbstractGraphPoint currPoint : theSet) {\r\n if (currPoint.getDateAsNumber() == myCurrStart.getDateAsNumber() || currPoint.getDateAsNumber() == myCurrEnd.getDateAsNumber()) {\r\n subSet.remove(currPoint);\r\n }\r\n }\r\n double dayCount = subSet.size();\r\n double p3 = dayCount * DTUtil.msPerTradingDay();\r\n\r\n //Sum all three parts as deltaX\r\n double deltaX = p1 + p2 + p3;\r\n double deltaY = myCurrEnd.getLastPrice() - myCurrStart.getLastPrice();\r\n\r\n //Gradient is deltaY / deltaX\r\n result = deltaY / deltaX;\r\n\r\n System.out.println(\"Delta Y = \" + deltaY);\r\n System.out.println(\"Delta X = \" + deltaX);\r\n System.out.println(aLine.toString());\r\n } else {\r\n result = aLine.getGradient();\r\n System.out.println(aLine.toString());\r\n }\r\n }\r\n return result;\r\n }", "public long getTimeTaken();", "public int computeDuration() {\n return (int) Duration.between(getStart_time(), getEnd_time()).toSeconds();\n }", "public static long daysDifference(String newDate, String oldDate) throws ParseException {\n SimpleDateFormat simpleDateFormat =\n new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\n Date dOld = simpleDateFormat.parse(oldDate);\n Date dNew = simpleDateFormat.parse(newDate);\n long different = dNew.getTime() - dOld.getTime();\n return TimeUnit.DAYS.convert(different, TimeUnit.MILLISECONDS);\n }", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "public static long getDiffInMilliSeconds(Date date1, Date date2){\n return date1.getTime() - date2.getTime();\n }", "public static int diferenciaFechas(Date f1, Date f2){\n \n long difMili = f1.getTime() - f2.getTime();\n long dif = (difMili / (1000*60*60*24));\n return (int) dif;\n }", "long getTsUpdate();", "public Integer get_count_of_days(String Created_date_String, String Expire_date_String) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yy\", Locale.getDefault());\n\n Date Created_convertedDate = null, Expire_CovertedDate = null, todayWithZeroTime = null;\n try {\n Created_convertedDate = dateFormat.parse(Created_date_String);\n Expire_CovertedDate = dateFormat.parse(Expire_date_String);\n\n Date today = new Date();\n\n todayWithZeroTime = dateFormat.parse(dateFormat.format(today));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n Calendar c_cal = Calendar.getInstance();\n c_cal.setTime(todayWithZeroTime);\n int c_year = c_cal.get(Calendar.YEAR);\n int c_month = c_cal.get(Calendar.MONTH);\n int c_day = c_cal.get(Calendar.DAY_OF_MONTH);\n\n\n Calendar e_cal = Calendar.getInstance();\n e_cal.setTime(Expire_CovertedDate);\n int e_year = e_cal.get(Calendar.YEAR);\n int e_month = e_cal.get(Calendar.MONTH);\n int e_day = e_cal.get(Calendar.DAY_OF_MONTH);\n\n Calendar date1 = Calendar.getInstance();\n Calendar date2 = Calendar.getInstance();\n\n date1.clear();\n date1.set(c_year, c_month, c_day);\n date2.clear();\n date2.set(e_year, e_month, e_day);\n\n long diff = date2.getTimeInMillis() - date1.getTimeInMillis();\n\n long dayCount = diff / (24 * 60 * 60 * 1000);\n\n return (int) dayCount;\n }" ]
[ "0.65580827", "0.63052446", "0.6212837", "0.6176545", "0.61577386", "0.613071", "0.6081939", "0.60404813", "0.6033722", "0.6032598", "0.5987855", "0.5935718", "0.59321284", "0.5927781", "0.59094167", "0.589297", "0.58391815", "0.58322424", "0.579318", "0.5786822", "0.5754789", "0.57323444", "0.5722613", "0.5712447", "0.571109", "0.5689345", "0.56541294", "0.56482595", "0.5639298", "0.5616457", "0.5605395", "0.5597967", "0.55797935", "0.55714846", "0.55708605", "0.5556503", "0.5547276", "0.5536883", "0.5535475", "0.55335337", "0.5523996", "0.5523354", "0.55199486", "0.55105054", "0.5489781", "0.5489149", "0.54891306", "0.5465828", "0.5456689", "0.5438399", "0.5436314", "0.5429954", "0.5424667", "0.54191697", "0.54008216", "0.5394424", "0.53934896", "0.53919625", "0.5391703", "0.53880686", "0.53582966", "0.5357536", "0.53489834", "0.5348359", "0.5347822", "0.5343404", "0.5329386", "0.5327819", "0.5325766", "0.532451", "0.53181505", "0.53144246", "0.53049475", "0.52974206", "0.52942926", "0.52775085", "0.5277081", "0.52770066", "0.52699506", "0.5267576", "0.5266994", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5265202", "0.5264034", "0.5259758", "0.5256139", "0.5254822" ]
0.0
-1
This function makes a DEEP COPY of the provided Java Calendar
public static Calendar deepCopyCalendar(Calendar cal) { Calendar result = null; if (null != cal) { Calendar newCal = Calendar.getInstance(cal.getTimeZone()); newCal.clear(); newCal.set(Calendar.YEAR, cal.get(Calendar.YEAR)); newCal.set(Calendar.MONTH, cal.get(Calendar.MONTH)); newCal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH)); newCal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY)); newCal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE)); newCal.set(Calendar.SECOND, cal.get(Calendar.SECOND)); newCal.set(Calendar.MILLISECOND, cal.get(Calendar.MILLISECOND)); result = newCal; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Calendar toCalendar() {\n\t\treturn (Calendar) _cal.clone();\n\t}", "public VCalendar clone() {\n\t\treturn new VCalendar(this.content, this.collectionId, this.resourceId, this.earliestStart, this.latestEnd, null);\n\t}", "public Object clone() {\n return new Value(_calendar);\n }", "Calendar toCalendar();", "Calendar toCalendar();", "public CalendarUtils(Calendar baseCalendar) {\r\n\t\tthis(baseCalendar.getTime(), baseCalendar.getTimeZone());\r\n\t}", "public void copy(SystemPreDay that) {\n\t\tsetId(that.getId());\n\t\tsetDayNum(that.getDayNum());\n\t\tsetSchoolTerm(that.getSchoolTerm());\n\t\tsetUser(that.getUser());\n\t\tsetCreateTime(that.getCreateTime());\n\t\tsetProcess(that.getProcess());\n\t}", "Prototype makeCopy();", "private Date calendarToDate(Calendar calendar) {\n return (Date) calendar.getTime();\n }", "public static Date createDate(int yyyy, int month, int day) {\n/* 75 */ CALENDAR.clear();\n/* 76 */ CALENDAR.set(yyyy, month - 1, day);\n/* 77 */ return CALENDAR.getTime();\n/* */ }", "ForwardingCalendar(CalendarImplementation cal) {\n this.cal = cal;\n }", "@Override\n public Object clone() {\n return new ShortDate(getTime());\n }", "public void setDay(Calendar cal) {\n this.cal = (Calendar) cal.clone();\n }", "@Override\npublic final Object clone() {\n return new ClockTime(dateValue());\n }", "private synchronized IDate swe_revjul(double jd, boolean calType) {\n\t\tIDate dt = new IDate();\n\t\tdouble u0, u1, u2, u3, u4;\n\n\t\tu0 = jd + 32082.5;\n\t\tif (calType == SE_GREG_CAL) {\n\t\t\tu1 = u0 + SMath.floor(u0 / 36525.0) - SMath.floor(u0 / 146100.0) - 38.0;\n\t\t\tif (jd >= 1830691.5) {\n\t\t\t\tu1 += 1;\n\t\t\t}\n\t\t\tu0 = u0 + SMath.floor(u1 / 36525.0) - SMath.floor(u1 / 146100.0) - 38.0;\n\t\t}\n\t\tu2 = SMath.floor(u0 + 123.0);\n\t\tu3 = SMath.floor((u2 - 122.2) / 365.25);\n\t\tu4 = SMath.floor((u2 - SMath.floor(365.25 * u3)) / 30.6001);\n\t\tdt.month = (int) (u4 - 1.0);\n\t\tif (dt.month > 12) {\n\t\t\tdt.month -= 12;\n\t\t}\n\t\tdt.day = (int) (u2 - SMath.floor(365.25 * u3) - SMath.floor(30.6001 * u4));\n\t\tdt.year = (int) (u3 + SMath.floor((u4 - 2.0) / 12.0) - 4800);\n\t\tdt.hour = (jd - SMath.floor(jd + 0.5) + 0.5) * 24.0;\n\t\treturn dt;\n\t}", "int insertSelective(CalendarDate record);", "public java.util.Calendar getJavaCal() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: gov.nist.javax.sip.header.SIPDate.getJavaCal():java.util.Calendar, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: gov.nist.javax.sip.header.SIPDate.getJavaCal():java.util.Calendar\");\n }", "public java.lang.Object clone() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: gov.nist.javax.sip.header.SIPDate.clone():java.lang.Object, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: gov.nist.javax.sip.header.SIPDate.clone():java.lang.Object\");\n }", "Calendar getCalendar();", "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public PickDateTime(Calendar cal) {\n\t\tjbInit();\n\t}", "public void makeValidDate() {\n\t\tdouble jd = swe_julday(this.year, this.month, this.day, this.hour, SE_GREG_CAL);\n\t\tIDate dt = swe_revjul(jd, SE_GREG_CAL);\n\t\tthis.year = dt.year;\n\t\tthis.month = dt.month;\n\t\tthis.day = dt.day;\n\t\tthis.hour = dt.hour;\n\t}", "public Object clone() throws CloneNotSupportedException {\n/* 1976 */ DateAxis clone = (DateAxis)super.clone();\n/* */ \n/* 1978 */ if (this.dateFormatOverride != null) {\n/* 1979 */ clone\n/* 1980 */ .dateFormatOverride = (DateFormat)this.dateFormatOverride.clone();\n/* */ }\n/* */ \n/* 1983 */ return clone;\n/* */ }", "public static void testConvertIntoCopy_copyDisallowed(MaintenanceDocument document, DataDictionaryService dataDictionaryService) throws Exception {\n DataDictionary d = dataDictionaryService.getDataDictionary();\r\n Class documentClass = document.getClass();\r\n boolean originalValue = d.getDocumentEntry(documentClass.getName()).getAllowsCopy();\r\n try {\r\n d.getDocumentEntry(documentClass.getName()).setAllowsCopy(false);\r\n\r\n boolean failedAsExpected = false;\r\n try {\r\n ((Copyable) document).toCopy();\r\n }\r\n catch (IllegalStateException e) {\r\n failedAsExpected = true;\r\n }\r\n\r\n assertTrue(failedAsExpected);\r\n }\r\n finally {\r\n d.getDocumentEntry(documentClass.getName()).setAllowsCopy(originalValue);\r\n }\r\n }", "default FlowEventDumpData deepCopy(FlowEventDumpData source) {\n FlowEventDumpData result = new FlowEventDumpDataImpl();\n copy(source, result);\n return result;\n }", "java.util.Calendar getLastrun();", "public static Calendar convertToExchCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar exchCal = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n exchCal.clear();\r\n exchCal.setTimeInMillis(timeInMillis);\r\n return exchCal;\r\n }", "private void initDateFromJD(double jd, boolean calType) {\n\t\tthis.jd = jd;\n\t\tthis.calType = calType;\n\t\tIDate dt = swe_revjul(jd, calType);\n\t\tthis.year = dt.year;\n\t\tthis.month = dt.month;\n\t\tthis.day = dt.day;\n\t\tthis.hour = dt.hour;\n\t}", "public Object clone() {\r\n return new DateTimeFormat(dateFormat);\r\n }", "java.util.Calendar getNextrun();", "public Calendar dayOfWeek(\r\n\t\t\tDayOfWeek dayOfWeek) {\r\n\t\t\r\n\t\tint day = dayOfWeek.getDayNumber();\r\n\t\t\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(\r\n\t\t\t\tbaseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH), \r\n\t\t\t\tbaseCalendar.get(Calendar.DAY_OF_MONTH));\r\n\t\t\r\n\t\tint offset = day - isoDayOfWeek(baseCalendar.get(Calendar.DAY_OF_WEEK));\r\n\t\t\r\n\t\tc2.add(Calendar.DATE, offset);\r\n\t\t\r\n\t\treturn c2;\r\n\t}", "public SweDate(double jd) {\n\t\tinitDateFromJD(jd, jdCO <= jd ? SE_GREG_CAL : SE_JUL_CAL);\n\t}", "private Calendar formatCalendar(Calendar calendar){\n calendar.set(\n calendar.get(Calendar.YEAR),\n calendar.get(Calendar.MONTH),\n calendar.get(Calendar.DAY_OF_MONTH),\n 0,\n 0,\n 0\n );\n return calendar;\n }", "Course buildCopy(UUID courseUuid, String courseApplicationYear, boolean nameFromOrig);", "public CMObject copyOf();", "static void setCopying(){isCopying=true;}", "@Override\n void adjustStartAndEnd(U vComponentEditedCopy, U vComponentOriginalCopy)\n {\n vComponentEditedCopy.setDateTimeStart(new DateTimeStart(getStartRecurrence()));\n vComponentEditedCopy.setEndOrDuration(getStartRecurrence(), getEndRecurrence());\n }", "private void drawCalendar(Canvas c, Paint p) {\n\n boolean currentDaySaved = false;\n int currentDayIndex = 0;\n\n drawCurrentDayProgress(c, p);\n\n p.setTextSize(RECT_SIZE / 2);\n p.setTextAlign(Paint.Align.CENTER);\n\n int col = 0;\n int row = 0;\n int maxCol = getWidth() / (RECT_SIZE);\n int translateY = 20;\n c.translate(0, translateY);\n List<MyDay> myDaysCopied = (List<MyDay>) ((ArrayList) myDays).clone();\n for (MyDay myDay : myDaysCopied) {\n if (myDay.isCompleted()) {\n if (myDay.day.get(Calendar.DAY_OF_YEAR) == MyDay.now.get(Calendar.DAY_OF_YEAR) &&\n myDay.day.get(Calendar.YEAR) == MyDay.now.get(Calendar.YEAR)) {\n p.setColor(currentDayColor);\n } else {\n p.setColor(completedDayColor);\n }\n } else {\n\n if (!currentDaySaved) {\n currentDayIndex = myDaysCopied.indexOf(myDay);\n currentDaySaved = true;\n }\n p.setColor(notCompletedDayColor);\n\n }\n if (col != 0 && myDay.day.get(Calendar.DAY_OF_MONTH) == 1) {\n col = 0;\n row++;\n c.drawLine(MARGIN, row * (RECT_SIZE) + MARGIN / 2,\n getWidth() - MARGIN, row * (RECT_SIZE) + MARGIN / 2, p);\n\n c.drawText((myDay.day.get(Calendar.MONTH) + 1) + \".\" + myDay.day.get(Calendar.YEAR),\n getWidth() - 40, row * RECT_SIZE, p);\n\n }\n\n c.drawRect(col * RECT_SIZE + MARGIN,\n row * RECT_SIZE + MARGIN, col * RECT_SIZE + RECT_SIZE\n , row * RECT_SIZE + RECT_SIZE, p);\n\n p.setColor(TEXT_COLOR);\n c.drawText(myDay.day.get(Calendar.DAY_OF_MONTH) + \"\", col * RECT_SIZE\n + MARGIN + RECT_SIZE / 2,\n row * RECT_SIZE + MARGIN + (RECT_SIZE / 3) * 2, p\n );\n\n col++;\n if (col == maxCol) {\n col = 0;\n row++;\n }\n }\n p.setColor(completedDayColor);\n c.translate(0, -translateY);\n c.drawLine(MARGIN, RECT_SIZE / 2 + MARGIN / 2,\n getWidth() - MARGIN, RECT_SIZE / 2 + MARGIN / 2, p);\n\n c.drawText((myDaysCopied.get(0).day.get(Calendar.MONTH) + 1) + \".\" + myDaysCopied.get(0).day.get(Calendar.YEAR),\n getWidth() - 40, RECT_SIZE / 2, p);\n\n\n double progressPercent;\n\n long completedMills = MyDay.now.getTimeInMillis() - MyDay.startDate.getTimeInMillis();\n long allMillis = MyDay.endDate.getTimeInMillis() - MyDay.startDate.getTimeInMillis();\n progressPercent = (((double) completedMills) / allMillis) * 100;\n // Log.d(MY_TAG, \"completedMills: \" + completedMills + \" allMillis: \" + allMillis);\n\n int progressPixel = (int) Math.round(((float) getWidth() / 100f) * progressPercent);\n\n p.setColor(notCompletedDayColor);\n p.setStrokeWidth(15);\n\n c.drawLine(0, getHeight() - PROGRESS_LINE_MARGIN_Y, getWidth(),\n getHeight() - PROGRESS_LINE_MARGIN_Y, p);\n int daysCompleted = currentDayIndex - 1;\n int daysEstimated = DAYS_COUNT - daysCompleted;\n c.drawText(daysEstimated + \"\", getWidth() - 40, getHeight() - PROGRESS_LINE_MARGIN_Y - 20, p);\n p.setColor(completedDayColor);\n c.drawLine(0, getHeight() - PROGRESS_LINE_MARGIN_Y, progressPixel,\n getHeight() - PROGRESS_LINE_MARGIN_Y, p);\n c.drawText(daysCompleted + \"\", 40, getHeight() - PROGRESS_LINE_MARGIN_Y - 20, p);\n p.setTextSize(35);\n c.drawText(new DecimalFormat(\"#0.000000\").format(progressPercent) + \"%\", getWidth() / 2, getHeight() - PROGRESS_LINE_MARGIN_Y - 20, p);\n\n\n }", "public void copy() {\n\n\t}", "public static Calendar dateToCalendar(Date dteStart, TimeZone tz) {\r\n Calendar cal = Calendar.getInstance(tz);\r\n cal.clear();\r\n int year = dteStart.getYear() + 1900;\r\n int month = dteStart.getMonth();\r\n DateFormat formatter = new SimpleDateFormat(\"dd\");\r\n String strDay = formatter.format(dteStart);\r\n int day = Integer.parseInt(strDay);\r\n int hrs = dteStart.getHours();\r\n int min = dteStart.getMinutes();\r\n int secs = dteStart.getSeconds();\r\n cal.set(Calendar.YEAR, year);\r\n cal.set(Calendar.MONTH, month);\r\n cal.set(Calendar.DAY_OF_MONTH, day);\r\n cal.set(Calendar.HOUR_OF_DAY, hrs);\r\n cal.set(Calendar.MINUTE, min);\r\n cal.set(Calendar.SECOND, secs);\r\n return cal;\r\n }", "public Entry(Calendar date){\n this.date = date; \n }", "private boolean makeCalendarByDays() {\n if (calendar != null) {\n for (Date date:calendar.keySet()) {\n Date startDay;\n if (date.getTime() > date.getTime() - 3600000 * 2 - date.getTime() % 86400000)\n startDay = new Date(date.getTime() + 3600000 * 22 - date.getTime() % 86400000);\n else startDay = new Date(date.getTime() - 3600000 * 2 - date.getTime() % 86400000);\n calendarByDays.put(startDay, calendar.get(date));\n }\n return true;\n }\n return false;\n }", "public JCalendar() {\r\n init();\r\n resetToDefaults();\r\n }", "protected void copyInto(Schedule other) {\r\n\t\tfor(int i = MIN_WEEKDAY; i <= MAX_WEEKDAY; i++)\r\n\t\t\tfor(int j = MIN_SEGMENT; j <= MAX_SEGMENT; j++)\r\n\t\t\t\tother.schedule[i][j] = schedule[i][j];\t\t\r\n\t}", "public Calendar startOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE));\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tgetLayouts();\n\n\t\t\t\tCalendar pre = (Calendar) calendar.clone();\n\n\t\t\t\tcurrentMonth--;\n\n\t\t\t\tif (currentMonth == 0) {\n\t\t\t\t\tcurrentMonth = 12;\n\t\t\t\t\tcurrentYear--;\n\t\t\t\t}\n\t\t\t\tpre.set(Calendar.MONTH, currentMonth);\n\t\t\t\tpre.set(Calendar.YEAR, currentYear);\n\t\t\t\tpre.set(Calendar.DATE, 1);\n\n\t\t\t\tpositionPre = pre.getTime().toString().split(\" \");\n\t\t\t\tpreviousDayPosition = ReturnCalendarDetails\n\t\t\t\t\t\t.getPosition(positionPre[0]);\n\n\t\t\t\tgetCalendar(\n\t\t\t\t\t\tReturnCalendarDetails.getCurrentMonth(positionPre[1]),\n\t\t\t\t\t\tReturnCalendarDetails.getPosition(positionPre[0]),\n\t\t\t\t\t\tInteger.parseInt(positionPre[5]));\n\n\t\t\t\tSystem.out.println(\"!!\" + pre.getTime());\n\t\t\t}", "public void setCalendarType(boolean newCalType, boolean keepDate) {\n\t\tif (this.calType != newCalType) {\n\t\t\tthis.calType = newCalType;\n\t\t\tdeltatIsValid = false;\n\t\t\tif (keepDate) {\n\t\t\t\tthis.jd = swe_julday(this.year, this.month, this.day, this.hour, this.calType);\n\t\t\t} else {\n\t\t\t\tIDate dt = swe_revjul(this.jd, newCalType);\n\t\t\t\tthis.year = dt.year;\n\t\t\t\tthis.month = dt.month;\n\t\t\t\tthis.day = dt.day;\n\t\t\t\tthis.hour = dt.hour;\n\t\t\t}\n\t\t}\n\t}", "Calendar getTimeStamp();", "int insert(CalendarDate record);", "void setNextrun(java.util.Calendar nextrun);", "public Calendar getArchivalDate();", "public void setDT(java.util.Calendar DT) {\n this.DT = DT;\n }", "public DirectoryChangeEvent copy() {\n\t\treturn DirectoryChangeEvent.fromJSON(toJSON().toString());\n\t}", "@Override\n public void onDateSet(DatePicker view, int year, int monthOfYear,\n int dayOfMonth) {\n Calendar tmp_Calen = Calendar.getInstance();\n tmp_Calen.set(year, monthOfYear, dayOfMonth);\n if(tmp_Calen.compareTo(purCalen) < 0)\n {\n Toast.makeText(FoodInputActivity.this, \"구매일자 이전의 날짜는 선택하실 수 없습니다.\", Toast.LENGTH_SHORT).show();\n }\n else\n {\n shelfCalen.set(year, monthOfYear, dayOfMonth);\n shelDateBtn.setText(year+\"년 \"+(monthOfYear+1)+\"월 \"+ dayOfMonth+\"일\");\n }\n// long diff = TimeUnit.MILLISECONDS.toDays(Math.abs(shelfCalen.getTimeInMillis() - purCalen.getTimeInMillis()));\n// Log.e(\"good\", \"D-Day : \" + diff);\n\n// String msg = String.format(\"%d / %d / %d\", year,monthOfYear+1, dayOfMonth);\n// Toast.makeText(FoodInputActivity.this, msg, Toast.LENGTH_SHORT).show();\n }", "default <S, D> D copy(S src, D dist) {\n BeanUtils.copyProperties(src, dist);\n return dist;\n }", "public static Date createDate(int yyyy, int month, int day, int hour, int min) {\n/* 93 */ CALENDAR.clear();\n/* 94 */ CALENDAR.set(yyyy, month - 1, day, hour, min);\n/* 95 */ return CALENDAR.getTime();\n/* */ }", "static void setNotCopying(){isCopying=false;}", "public JsonFactory copy()\n/* */ {\n/* 324 */ _checkInvalidCopy(JsonFactory.class);\n/* */ \n/* 326 */ return new JsonFactory(this, null);\n/* */ }", "@Test\n\tpublic void testDate2() {\n\t\ttry {\n\t\t\tfinal Date date = ParadoxDate.getDateFromParadoxDate(36160);\n\t\t\tfinal Calendar calendar = Calendar.getInstance();\n\t\t\tcalendar.setTime(date);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.DATE) == 1);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.MONTH) == 0);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.YEAR) == 100);\n\t\t} catch (final Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tAssert.fail();\n\t\t}\n\t}", "public Calendar() {\n }", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "public Calendar getDate() {\r\n return (Calendar) selectedDate;\r\n }", "@Override\n\tprotected Factura clone() throws CloneNotSupportedException {\n\t\t\n\t\t\tFactura copiaFactura = (Factura) super.clone();\n\t\t\tcopiaFactura.data= (Date)data.clone();\n\t\t\treturn copiaFactura;\n\t}", "public static void main(String[] args) {\n\t\tDateTime dt = new DateTime();\r\n\t\tCalendar c1 = Calendar.getInstance();\r\n\t\tc1.setTimeInMillis(dt.getMillis());\r\n\t\tCalendar c2 = dt.toCalendar(Locale.getDefault());\r\n\t\t System.out.println(c1.getTime());\r\n\t\t System.out.println(c2.getTime());\r\n\t}", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "private static Calendar createCalendar(int year, int month, int date) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setLenient(false);\r\n\t\tcalendar.set(Calendar.YEAR, year);\r\n\t\tcalendar.set(Calendar.MONTH, month - 1);\r\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, date);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\treturn calendar;\r\n\t}", "public SoPickedPoint \ncopy() \n//\n////////////////////////////////////////////////////////////////////////\n{\n SoPickedPoint newCopy = new SoPickedPoint(this);\n return newCopy;\n}", "private RootBlock copy(RootBlock sourceRootBlock) {\n\t\tCopier copier = new Copier(true);\n\t\tRootBlock result = (RootBlock) copier.copy(sourceRootBlock);\n\t\tcopier.copyReferences();\n\t\treturn result;\n\t}", "public Punch getShallowCopy(){\n Punch p = new Punch();\n p.id = id;\n p.time = time;\n //p.taskId = punchTask.getID();\n return p;\n }", "abstract GregorianCalendar getThreadLocalCalendar();", "private static Calendar toUTCCalendarWithoutTime(final Date date) {\n final Calendar calendar = Calendar.getInstance();\n calendar.clear();\n calendar.setTime(date);\n calendar.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar;\n }", "public DessertVO clone() {\r\n return (DessertVO) super.clone();\r\n }", "public EventStack<T> deepCopy() {\n final Stack<EventStackEntry<T>> copiedStack = new Stack<>();\n for (final EventStackEntry<T> iterEntry : eventStack) {\n copiedStack.push(iterEntry.deepCopy());\n }\n final EventStack<T> copiedOutput = new EventStack<>(firstEventTime);\n copiedOutput.setStack(copiedStack);\n return copiedOutput;\n }", "public abstract Pattern copy();", "static synchronized BasisGoogleCalendar getCalendar(UpodWorld w)\n{\n if (DATA_STORE_DIR == null) return null;\n if (cal_service == null) {\n try {\n\t cal_service = getCalendarService();\n }\n catch (IOException e) {\n\t BasisLogger.logE(\"GOOGLECAL: Authorization problem with calendar api: \" + e);\n\t DATA_STORE_DIR = null;\n\t HTTP_TRANSPORT = null;\n\t DATA_STORE_FACTORY = null;\n\t return null;\n }\n }\n\n BasisGoogleCalendar rslt = the_calendars.get(w);\n if (rslt == null) {\n rslt = new BasisGoogleCalendar();\n the_calendars.put(w,rslt);\n }\n\n return rslt;\n}", "public void goToDate(@NonNull Calendar date) {\n Calendar modifiedDate = (Calendar) date.clone();\n\n // If a minimum or maximum date is set, don't allow to go beyond them.\n if (config.minDate != null && modifiedDate.before(config.minDate)) {\n modifiedDate = (Calendar) config.minDate.clone();\n } else if (config.maxDate != null && modifiedDate.after(config.maxDate)) {\n modifiedDate = (Calendar) config.maxDate.clone();\n modifiedDate.add(Calendar.DAY_OF_YEAR, 1 - config.numberOfVisibleDays);\n } else if (config.numberOfVisibleDays >= 7 && config.showFirstDayOfWeekFirst) {\n final int diff = config.drawingConfig.computeDifferenceWithFirstDayOfWeek(config, date);\n modifiedDate.add(Calendar.DAY_OF_YEAR, (-1) * diff);\n }\n\n gestureHandler.forceScrollFinished();\n\n if (viewState.areDimensionsInvalid) {\n viewState.setScrollToDay(modifiedDate);\n return;\n }\n\n viewState.setShouldRefreshEvents(true);\n\n int diff = DateUtils.getDaysUntilDate(modifiedDate);\n\n config.drawingConfig.currentOrigin.x = diff * (-1) * config.getTotalDayWidth();\n viewState.requiresPostInvalidateOnAnimation = true;\n invalidate();\n }", "public directed_weighted_graph deepCopy() {\n DWGraph_DS copyGraph = new DWGraph_DS(this); //create a new graph with the original graph data (only primitives)\n HashMap<Integer, node_data> copyNodesMap = new HashMap<>(); //create a new nodes HashMap for the new graph\n for (node_data node : nodes.values()) { //loop through all nodes in the original graph\n copyNodesMap.put(node.getKey(), new NodeData((NodeData) node)); //makes a duplicate of the original HashMap\n }\n copyGraph.nodes = copyNodesMap; //set the new graph nodes to the new HashMap we made.\n return copyGraph;\n }", "public DateUtil (double proplepticJulianDay)\n {\n setOrdinal((int)((long)(proplepticJulianDay\n + 0.5 /* noon adjust, .5 or bigger really part of next day */)\n -2440588L /* i.e. diff in base epochs of calendars */));\n\n }", "public String[] getStarDate2(){\n\t\tstardate = new String[3];\n\t\t\n\t\tCalendar originaldate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\tCalendar instancedate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\t\t\t\n\t\t//originaldate.set(2008, 8, 8, 0, 0, 0);\n\t\toriginaldate.set(2162, 0, 4, 0, 0, 0);\n\t\t\n\t\t/*instancedate.add(Calendar.HOUR, 7);\n\t\tinstancedate.add(Calendar.MINUTE, 33);\n\t\tinstancedate.add(Calendar.YEAR, 156);\n\t\tinstancedate.add(Calendar.HOUR, -6*24);\n\t\tinstancedate.add(Calendar.MONTH, -3);*/\n\t\t\n\t\t\n\t\t// Get the represented date in milliseconds\n\t\tlong milis1 = originaldate.getTimeInMillis();\n\t\tlong milis2 = instancedate.getTimeInMillis();\n\t\t\n\t\t// Calculate difference in milliseconds\n\t\tlong diff = milis2 - milis1;\n\t\t \n\t\t// Calculate difference in seconds\n\t\tlong diffSeconds = diff / 1000;\n\t\t \n\t\t// Calculate difference in minutes\n\t\t//long diffMinutes = diff / (60 * 1000);\n\t\t\n\t\t// Calculate difference in hours\n\t\t//long diffHours = diff / (60 * 60 * 1000);\n\t\t\n\t\t// Calculate difference in days\n\t\t//long diffDays = diff / (24 * 60 * 60 * 1000);\n\t\t\n\t\t//double dec = -280000 - ((double)diffSeconds / 17280.0f);\n\t\tdouble dec = ((double)diffSeconds / 17280.0f);\n\t\t\t\t\n\t\tint mantel = (int)Math.ceil(dec/10000.0f);\n\t\t\t\t\n\t\tdouble kropp = (dec + (-(mantel-1)*10000.0f));\n\t\t\n\t\tif(kropp >= 10000) mantel += 2; //Fixing rounding error\n\t\t\n\t\tdouble mantelkropp = ((mantel-1) * 10000.0f) - kropp;\n\t\t\n\t\t/*Log.v(TAG, \"Diff: \" + Long.toString(diff));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(dec));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Integer.toString(mantel));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(kropp));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(mantelkropp));*/\n\t\t\n\t\tdec = mantelkropp;\n\t\t\n\t\tDecimalFormat maxDigitsFormatter;\n\t\tif(dec < 0)\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"#000000.0000\");\n\t\telse\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"0000000.0000\");\n \n try {\n\t stardate[0] = \"[\" + (maxDigitsFormatter.format(dec)).substring(0, 3) + \"]\";\n\t stardate[1] = \" 0\" + (maxDigitsFormatter.format(dec)).substring(3, 9);\n\t stardate[2] = \"\" + (maxDigitsFormatter.format(dec)).substring(9, 11);\n } catch(StringIndexOutOfBoundsException sbe) {\n \tif(DEBUG) Log.v(TAG, \"Could not format \" + sbe);\n \tif(DEBUG) Log.v(TAG, maxDigitsFormatter.format(dec));\n \tstardate[2] = \"--\"; \t \n }\n \n Log.v(TAG, \"Stardate: \" + stardate[0] + stardate[1] + stardate[2]);\n return stardate;\n\t\t\n\t}", "private static Document createCopiedDocument(Document originalDocument) {\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n DocumentBuilder db;\n Document copiedDocument = null;\n try {\n db = dbf.newDocumentBuilder();\n Node originalRoot = originalDocument.getDocumentElement();\n copiedDocument = db.newDocument();\n Node copiedRoot = copiedDocument.importNode(originalRoot, true);\n copiedDocument.appendChild(copiedRoot);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n return copiedDocument;\n }", "public abstract INodo copy();", "private DateTime goodLocalDateUse2() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n LocalTime now = LocalTime.now();\n return new DateTime(ld.getYear(), ld.getMonthOfYear(), ld.getDayOfYear(), now.getHourOfDay(),\n now.getMinuteOfHour(), now.getSecondOfMinute(), now.getMillisOfSecond(),\n DateTimeZone.getDefault())\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }", "Field getCopy();", "private void resetCalendarToMonth(Calendar calendar) {\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, 1);\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\n\t\tcalendar.set(Calendar.MINUTE, 0);\n\t\tcalendar.set(Calendar.SECOND, 0);\n\t\tcalendar.set(Calendar.MILLISECOND, 0);\n\t}", "Course copy(UUID courseOrigUuid, \n\t\t\tCourse courseNew, \n\t\t\tboolean copyParticipants, \n\t\t\tboolean copyLessons, \n\t\t\tboolean copyTrainers) throws ScbValidationException;", "public java.util.Date toDate() {\n return toCalendar().getTime();\n }", "public static void before1(){\n Calendar class0 = Calendar.getInstance();\n class0.set(2019,1,2,3,4,5);\n Calendar when = Calendar.getInstance();\n when.set(2019,1,2,3,4,5);\n boolean ret0 = class0.before(when);\n assert(class0.get(Calendar.YEAR)==2019);\n assert(class0.get(Calendar.MONTH)==1);\n assert(class0.get(Calendar.DATE)==2);\n assert(class0.get(Calendar.HOUR_OF_DAY)==3);\n assert(class0.get(Calendar.MINUTE)==4);\n assert(class0.get(Calendar.SECOND)==5);\n assert(when.get(Calendar.YEAR)==2019);\n assert(when.get(Calendar.MONTH)==1);\n assert(when.get(Calendar.DATE)==2);\n assert(when.get(Calendar.HOUR_OF_DAY)==3);\n assert(when.get(Calendar.MINUTE)==4);\n assert(when.get(Calendar.SECOND)==5);\n assert(ret0==false);\n System.out.println(ret0);\n }", "public OrgDay(OrgDay another) {\n this.events = new LinkedList<>();\n for (OrgEvent event : another.events) {\n this.events.add(new OrgEvent(event));\n }\n }", "@NoProxy\n public void copyTo(final BwEvent ev) {\n super.copyTo(ev);\n ev.setEntityType(getEntityType());\n ev.setName(getName());\n ev.setClassification(getClassification());\n ev.setDtstart(getDtstart());\n ev.setDtend(getDtend());\n ev.setEndType(getEndType());\n ev.setDuration(getDuration());\n ev.setNoStart(getNoStart());\n\n ev.setLink(getLink());\n ev.setGeo(getGeo());\n ev.setDeleted(getDeleted());\n ev.setStatus(getStatus());\n ev.setCost(getCost());\n\n BwOrganizer org = getOrganizer();\n if (org != null) {\n org = (BwOrganizer)org.clone();\n }\n ev.setOrganizer(org);\n\n ev.setDtstamp(getDtstamp());\n ev.setLastmod(getLastmod());\n ev.setCreated(getCreated());\n ev.setStag(getStag());\n ev.setPriority(getPriority());\n ev.setSequence(getSequence());\n\n ev.setLocation(getLocation());\n\n ev.setUid(getUid());\n ev.setTransparency(getTransparency());\n ev.setPercentComplete(getPercentComplete());\n ev.setCompleted(getCompleted());\n\n ev.setCategories(copyCategories());\n\n ev.setContacts(copyContacts());\n\n ev.setAttendees(cloneAttendees());\n ev.setCtoken(getCtoken());\n\n ev.setRecurrenceId(getRecurrenceId());\n ev.setRecurring(getRecurring());\n if (ev.isRecurringEntity()) {\n ev.setRrules(clone(getRrules()));\n ev.setExrules(clone(getExrules()));\n ev.setRdates(clone(getRdates()));\n ev.setExdates(clone(getExdates()));\n }\n\n ev.setScheduleMethod(getScheduleMethod());\n ev.setOriginator(getOriginator());\n\n /* Don't copy these - we always set them anyway\n if (getNumRecipients() > 0) {\n ev.setRecipients(new TreeSet<String>());\n\n for (String s: getRecipients()) {\n ev.addRecipient(s);\n }\n }*/\n\n if (getNumComments() > 0) {\n ev.setComments(null);\n\n for (final BwString str: getComments()) {\n ev.addComment((BwString)str.clone());\n }\n }\n\n if (getNumSummaries() > 0) {\n ev.setSummaries(null);\n\n for (final BwString str: getSummaries()) {\n ev.addSummary((BwString)str.clone());\n }\n }\n\n if (getNumDescriptions() > 0) {\n ev.setDescriptions(null);\n\n for (final BwLongString str: getDescriptions()) {\n ev.addDescription((BwLongString)str.clone());\n }\n }\n\n if (getNumResources() > 0) {\n ev.setResources(null);\n\n for (final BwString str: getResources()) {\n ev.addResource((BwString)str.clone());\n }\n }\n\n if (getNumXproperties() > 0) {\n ev.setXproperties(null);\n\n for (final BwXproperty x: getXproperties()) {\n ev.addXproperty((BwXproperty)x.clone());\n }\n }\n\n ev.setScheduleState(getScheduleState());\n\n //ev.setRequestStatuses(clone(getRequestStatuses()));\n\n final BwRelatedTo rt = getRelatedTo();\n if (rt != null) {\n ev.setRelatedTo((BwRelatedTo)rt.clone());\n }\n\n /* These are in x-props in 3.10\n ev.setPollMode(getPollMode());\n ev.setPollProperties(getPollProperties());\n ev.setPollAcceptResponse(getPollAcceptResponse());\n\n ev.setPollItemId(getPollItemId());\n if (!Util.isEmpty(getPollItems())) {\n for (final String s: getPollItems()) {\n ev.addPollItem(s);\n }\n }\n */\n\n ev.setPollCandidate(getPollCandidate());\n }", "public static void main(String[] args) {\n\t\tProduct product=new Product(3402,\"Laptop\",\"HP\",45000.00f,new Date(4,10,2019));\n\t\tSystem.out.println(\"Original product: \"+product);\n\t\t\n\t\t\n\t\t//Deep copying\n\t\t\n\t\t\n\t\t//get the clone of container object product\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\tProduct clonedProd=(Product) product.clone();\n\t\t\tSystem.out.println(\"Clone of Product: \"+clonedProd);\n\t\t\n\t\t\tDate originalMfgDate=product.getMfgDate();\n\t\t\t\n\t\t\t//get clone of contained object Mfg date\n\t\t\tDate clonedMfgDate=(Date) originalMfgDate.clone();\n\t\t\t\n\t\t\t//deep copying\n\t\t\tclonedProd.setMfgDate(clonedMfgDate);\n\t\t\t\n\t\t\t//changing dd of Mfg date of cloned product\n\t\t\tclonedProd.getMfgDate().setDd(25);\n\t\t\t\n\t\t\tSystem.out.println(\"Cloned product: \"+clonedProd);\n\t\t\tSystem.out.println(\"Original product: \"+product);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t} catch (CloneNotSupportedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void before2(){\n Calendar class0 = Calendar.getInstance();\n class0.set(2019,1,2,3,4,5);\n Calendar when = Calendar.getInstance();\n when.set(2019,1,2,3,4,4);\n boolean ret0 = class0.before(when);\n assert(class0.get(Calendar.YEAR)==2019);\n assert(class0.get(Calendar.MONTH)==1);\n assert(class0.get(Calendar.DATE)==2);\n assert(class0.get(Calendar.HOUR_OF_DAY)==3);\n assert(class0.get(Calendar.MINUTE)==4);\n assert(class0.get(Calendar.SECOND)==5);\n assert(when.get(Calendar.YEAR)==2019);\n assert(when.get(Calendar.MONTH)==1);\n assert(when.get(Calendar.DATE)==2);\n assert(when.get(Calendar.HOUR_OF_DAY)==3);\n assert(when.get(Calendar.MINUTE)==4);\n assert(when.get(Calendar.SECOND)==4);\n assert(ret0==false);\n System.out.println(ret0);\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tAddEvent.currentDateCalendar=(Calendar) c.clone();\n\t\t\t\tstartActivity(new Intent(\"com.calendar.ADDEVENT\"));\n\t\t\t}", "@Override\n public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {\n Calendar calendar = new GregorianCalendar();\n //calendar.set(Calendar.MILLISECOND, 0);\n calendar.set(year, month, dayOfMonth, 0, 0, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n //Set the milliseconds to 0 because java.util.Date is not accurate on milliseconds\n mDate = calendar.getTime();\n updateDateText();\n updateText();\n }", "@Test\n\tpublic void testDate1() {\n\t\ttry {\n\t\t\tfinal Date date = ParadoxDate.getDateFromParadoxDate(0);\n\t\t\tfinal Calendar calendar = Calendar.getInstance();\n\t\t\tcalendar.setTime(date);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.DATE) == 1);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.MONTH) == 0);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.YEAR) == 1900);\n\t\t} catch (final Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tAssert.fail();\n\t\t}\n\t}", "T copy();", "private Object deepCopy(Object oldObj) throws MareException {\n UtilidadesLog.info(\"MONVariablesVentaBean.deepCopy(Object oldObj):Entrada\");\n ObjectOutputStream oos = null;\n ObjectInputStream ois = null;\n \n try {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n oos = new ObjectOutputStream(bos);\n \n oos.writeObject(oldObj);\n oos.flush();\n ByteArrayInputStream bin = new ByteArrayInputStream(bos.toByteArray());\n ois = new ObjectInputStream(bin);\n UtilidadesLog.info(\"MONVariablesVentaBean.deepCopy(Object oldObj):Salida\");\n return ois.readObject();\n } catch(Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n UtilidadesLog.debug(\"Exception en deepCopy = \" + e);\n throw new MareException(e);\n } finally {\n try {\n oos.close();\n ois.close();\n } catch(Exception ex) {\n UtilidadesLog.error(\"ERROR \", ex);\n UtilidadesLog.debug(\"Exception en deepCopy = \" + ex);\n throw new MareException(ex);\n }\n }\n }", "public void onDateSet(DatePicker view, int selectedYear,\n int selectedMonth, int selectedDay) {\n Calendar calendarNow = (Calendar) endCalendar.clone();\n calendarNow.set(selectedYear, selectedMonth, selectedDay);\n if (calendarNow.getTimeInMillis() < view.getMinDate()) {\n enddaShowDatePickerDialog();\n Toast.makeText(getActivity(), getResources().getString(R.string.createOrder_datePicker_selectPastDate), Toast.LENGTH_SHORT).show();\n view.updateDate(endCalendar.get(Calendar.YEAR), endCalendar.get(Calendar.MONTH), endCalendar.get(Calendar.DAY_OF_MONTH));\n }\n\n endYear = selectedYear;\n endMonth = selectedMonth;\n endDay = selectedDay;\n endCalendar.set(selectedYear, selectedMonth, selectedDay);\n tvEndda.setText(new StringBuilder().append(char2(endDay))\n .append(\".\").append(char2(endMonth + 1)).append(\".\").append(endYear));\n\n if (tvBegda.getText().toString().equals(getResources().getString(R.string.leave_dmy))) {\n begYear = selectedYear;\n begMonth = selectedMonth;\n begDay = selectedDay;\n begCalendar.set(selectedYear, selectedMonth, selectedDay);\n tvBegda.setText(new StringBuilder().append(char2(begDay))\n .append(\".\").append(char2(begMonth + 1)).append(\".\").append(begYear));\n }\n }", "public void copySelection() {\r\n \t\t// Bertoli Marco\r\n \t\tclipboard.copy();\r\n \t}" ]
[ "0.5671384", "0.5646488", "0.55086994", "0.54916954", "0.54916954", "0.5474034", "0.53922176", "0.5384255", "0.53414583", "0.52641594", "0.5101307", "0.50715846", "0.5069169", "0.4987591", "0.49692723", "0.49184543", "0.49179256", "0.4917013", "0.4916165", "0.49106094", "0.48610684", "0.48306155", "0.48285502", "0.48190355", "0.48181373", "0.48121133", "0.47880706", "0.47805664", "0.47299805", "0.47276667", "0.47190636", "0.471726", "0.47146833", "0.471303", "0.46956944", "0.4695298", "0.46650657", "0.46611378", "0.46588692", "0.46159717", "0.4612448", "0.46092623", "0.4604187", "0.45983484", "0.45933476", "0.4570381", "0.4562692", "0.4562586", "0.45625216", "0.4560285", "0.4542519", "0.45254532", "0.45195007", "0.45130458", "0.45126954", "0.4506301", "0.45002094", "0.4494837", "0.4492577", "0.4491051", "0.44891533", "0.4472347", "0.44708297", "0.44574448", "0.44557443", "0.44503653", "0.44503653", "0.44387063", "0.44374564", "0.44320598", "0.4426942", "0.442415", "0.44143897", "0.44046012", "0.43972313", "0.4390038", "0.438405", "0.4383555", "0.43835053", "0.43755797", "0.4375026", "0.43714768", "0.43663788", "0.43612933", "0.43569496", "0.43548176", "0.43543717", "0.43540266", "0.43529803", "0.4339804", "0.4338888", "0.4338281", "0.43246943", "0.4323442", "0.43132567", "0.43108657", "0.43107602", "0.42996046", "0.42937225", "0.42906284" ]
0.6715591
0
This method calculates the gradient of a line across multiple days. The time component does not include days when no trading occurred on the market
public static double getGraidentBasedOnTradingDays(IGraphLine aLine, TreeSet<AbstractGraphPoint> listOfTradingDays) { double result = 0; if (null != aLine && null != listOfTradingDays) { AbstractGraphPoint myCurrStart = aLine.getCurrentC(); AbstractGraphPoint myCurrEnd = aLine.getCurrentE(); if (myCurrStart.getDateAsNumber() != myCurrEnd.getDateAsNumber()) { // TreeSet<AbstractGraphPoint> tDay = new TreeSet<AbstractGraphPoint>(AbstractGraphPoint.TimeComparator); // tDay.addAll(listOfTradingDays); //Calc P1 //Get Market close time on start day Calendar endTrading = DTUtil.deepCopyCalendar(myCurrStart.getCalDate()); endTrading.setTimeZone(DTConstants.EXCH_TIME_ZONE); endTrading.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR); endTrading.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN); endTrading.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC); double p1 = endTrading.getTimeInMillis() - myCurrStart.getCalDate().getTimeInMillis(); //double p1 = endTrading.getTimeInMillis() - (myCurrStart.getCalDate().getTimeInMillis() - DTConstants.MILLSECS_PER_HOUR); //Now calculate P2 //Get Market open time on end day Calendar startTrading = DTUtil.deepCopyCalendar(myCurrEnd.getCalDate()); startTrading.setTimeZone(DTConstants.EXCH_TIME_ZONE); startTrading.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); startTrading.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); startTrading.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); double p2 = (myCurrEnd.getCalDate().getTimeInMillis() - startTrading.getTimeInMillis()); //double p2 = (myCurrEnd.getCalDate().getTimeInMillis() - DTConstants.MILLSECS_PER_HOUR) - startTrading.getTimeInMillis(); //Now calc P3 //Get count of trading days from list // int currStartDay = myCurrStart.getDateAsNumber(); // int currEndDay = myCurrEnd.getDateAsNumber(); // NavigableSet<AbstractGraphPoint> subSet = new TreeSet<AbstractGraphPoint>(); // for(AbstractGraphPoint currPoint : tDay){ // int currDay = currPoint.getDateAsNumber(); // if(currDay > currStartDay && currDay < currEndDay){ // subSet.add(currPoint); // } // } NavigableSet<AbstractGraphPoint> subSet = listOfTradingDays.subSet(myCurrStart, false, myCurrEnd, false); ArrayList<AbstractGraphPoint> theSet = new ArrayList<AbstractGraphPoint>(); theSet.addAll(subSet); for (AbstractGraphPoint currPoint : theSet) { if (currPoint.getDateAsNumber() == myCurrStart.getDateAsNumber() || currPoint.getDateAsNumber() == myCurrEnd.getDateAsNumber()) { subSet.remove(currPoint); } } double dayCount = subSet.size(); double p3 = dayCount * DTUtil.msPerTradingDay(); //Sum all three parts as deltaX double deltaX = p1 + p2 + p3; double deltaY = myCurrEnd.getLastPrice() - myCurrStart.getLastPrice(); //Gradient is deltaY / deltaX result = deltaY / deltaX; System.out.println("Delta Y = " + deltaY); System.out.println("Delta X = " + deltaX); System.out.println(aLine.toString()); } else { result = aLine.getGradient(); System.out.println(aLine.toString()); } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void generateGradient(int startX, int startY, int endX, int endY, int startSat, int endSat, int hueSat, int brightnessSat) {\n colorMode(HSB,360,100,100);\n int dX = Math.abs(endX-startX);\n int dY = Math.abs(endY-startY);\n double changePerPixel = (endSat-startSat)/(double)dY;\n strokeWeight(2);\n int changePerFrameY = endY > startY ? 1 : -1;\n for(int i=0;i<Math.abs(dY);i++){\n stroke((int)(startSat+changePerPixel*i),hueSat,brightnessSat);\n line(startX, i*changePerFrameY+startY, endX, i*changePerFrameY+startY);\n }\n}", "@Override\r\n\t\tpublic double[] gradient(double x, double... parameters) {\n\t\t\tfinal double a = parameters[0];\r\n\t\t\tfinal double b = parameters[1];\r\n\t\t\tfinal double c = parameters[2];\r\n\t\t\tfinal double d = parameters[3];\r\n\t\t\tfinal double e = parameters[4];\r\n\t\t\t\r\n\t\t\tdouble[] gradients = new double[5];\r\n\t\t\t//double den = 1 + Math.pow((x+e)/c, b);\r\n\t\t\t//gradients[0] = 1 / den; // Yes a Derivation \r\n\t\t\t//gradients[1] = -((a - d) * Math.pow(x / c, b) * Math.log(x / c)) / (den * den); // Yes b Derivation \r\n\t\t\t//gradients[2] = (b * Math.pow(x / c, b - 1) * (x / (c * c)) * (a - d)) / (den * den); // Yes c Derivation \r\n\t\t\t//gradients[3] = 1 - (1 / den); // Yes d Derivation \r\n\t\t\t\r\n\t\t\t//Derivation\r\n\t\t\tfinal double c_b = Math.pow(c, b);\r\n\t\t\tfinal double c_b1 = Math.pow(c, b+1.);\r\n\t\t\tfinal double c_2b = Math.pow(c, 2.*b);\r\n\t\t\tfinal double c_2b1 = Math.pow(c, 2.*b+1.);\r\n\t\t\t\r\n\t\t\tfinal double xe_b = Math.pow(x+e, b);\r\n\t\t\tfinal double xe_2b = Math.pow(x+e, 2.*b);\r\n\t\t\tfinal double xe_2b1 = Math.pow(x+e, 2.*b+1.);\r\n\t\t\t\r\n\t\t\tgradients[0] = c_b/(xe_b+c_b);\r\n\t\t\tgradients[1] = ((c_b*d-a*c_b)*xe_b*Math.log(x+e)+(a*c_b*Math.log(c)-c_b*Math.log(c)*d)*xe_b)/(xe_2b+2*c_b*xe_b+c_2b);\r\n\t\t\tgradients[2] = -((b*c_b*d-a*b*c_b)*xe_b)/(c*xe_2b+2*c_b1*xe_b+c_2b1);\r\n\t\t\tgradients[3] = xe_b/(xe_b+c_b);\r\n\t\t\tgradients[4] = ((b*c_b*d-a*b*c_b)*xe_b)/(xe_2b1+xe_b*(2*c_b*x+2*c_b*e)+c_2b*x+c_2b*e);\r\n\t\t\treturn gradients;\r\n\t\t}", "public double lineSlope() {\r\n //The formula to calculate the gradient.\r\n double slope;\r\n double dy = this.start.getY() - this.end.getY();\r\n double dx = this.start.getX() - this.end.getX();\r\n // line is vertical\r\n if (dx == 0 && dy != 0) {\r\n slope = Double.POSITIVE_INFINITY;\r\n return slope;\r\n }\r\n // line is horizontal\r\n if (dy == 0 && dx != 0) {\r\n slope = 0;\r\n return slope;\r\n }\r\n slope = dy / dx;\r\n return slope;\r\n }", "@Override\n public LinearGradient createLinearGradient(double x0, double y0, double x1, double y1, List<Stop> stops) {\n return Style.LinearGradient.create(x0, y0, x1, y1, stops);\n }", "void computeGradient(GradientCalc calc);", "private double[] computeFiniteDifferenceGradient(double[] point, double[] step, int[] batch) {\n double[] fd = new double[point.length];\n\n for (int i = 0; i < point.length; i++) {\n double[] upper = new double[point.length];\n System.arraycopy(point, 0, upper, 0, point.length);\n upper[i] += step[i];\n double[] lower = new double[point.length];\n System.arraycopy(point, 0, lower, 0, point.length);\n lower[i] -= step[i];\n fd[i] = (evaluate(upper, batch) - evaluate(lower, batch)) / 2.0 / step[i];\n }\n\n return fd;\n }", "private void finaliseLinearGradient() {\n\n\t\tif (currentGradient.stopColours.size() > 0) {\n\t\t\tfinal int[] ia = new int[currentGradient.stopColours.size()];\n\n\t\t\tfor (int i = 0; i < ia.length; i++) {\n\t\t\t\tia[i] = currentGradient.stopColours.get(i);\n\t\t\t}\n\n\t\t\tcurrentGradient.shader = new LinearGradient(\n\t\t\t\t\tcurrentGradient.x1,\n\t\t\t\t\tcurrentGradient.y1,\n\t\t\t\t\tcurrentGradient.x2,\n\t\t\t\t\tcurrentGradient.y2,\n\t\t\t\t\tia,\n\t\t\t\t\tnull,\n\t\t\t\t\tShader.TileMode.CLAMP\n\t\t\t\t\t);\n\n\t\t\t// The shader needs to have a matrix even if no transform was specified in the attributes\n\t\t\t// for the gradient. This is because the gradient's Matrix, even if 'empty', is needed\n\t\t\t// to concatenate the current cumulative transform to during evaluation/drawing.\n\t\t\tif (currentGradient.matrix != null) {\n\t\t\t\tcurrentGradient.shader.setLocalMatrix(currentGradient.matrix);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcurrentGradient.shader.setLocalMatrix(new Matrix());\n\t\t\t}\n\n\t\t}\n\n\t\tcurrentGradient.isRadial = false;\n\t\tgradientList.add(currentGradient);\n\t\tcurrentGradient = new Gradient();\n\n\t}", "Gradient gradientAt(Point point);", "public float gradientMethod(Slice slice) \n\t{\n\t\t//\n\t\t// Intialize variables.\n\t\t//\n\t\tint nrows = slice.getNRows();\n\t\tint ncols = slice.getNCols();\n\n\t\tfloat[] v = new float[nrows*ncols]; int v_numset = 0;\n\t\tfloat t = (float)0.0; \n\t\tfloat sig_y = (float)0.0;\n\t\tfloat sig_x = (float)0.0;\n\n\t\t//\n\t\t// Compute the column gradient\n\t\t//\n\t\tfor(int row=0; row<nrows; row++) {\n\t\t\tfor(int col=1; col<ncols-1; col++) {\n\t\t\t\tt = slice.getData(row,col+1) - (float)2.0 * slice.getData(row,col) + slice.getData(row,col-1);\n\n\t\t\t\tif( t != (float)0.0 || slice.getData(row,col) != (float)0.0 ) {\n\t\t\t\t\tv[v_numset] = t; v_numset++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif( v_numset <= 10 ) {\n\t\t\tsig_y = (float)0.0;\n\t\t}\n\t\telse {\n\t\t\tsig_y = vec_stdDevMod(v, v_numset);\n\t\t}\n\n\t\tv_numset = 0;\n\n\t\t//\n\t\t// Compute the row gradient\n\t\t//\n\t\tfor(int col=0; col<ncols; col++) {\n\t\t\tfor(int row=1; row<nrows-1; row++) {\n\t\t\t\tt = slice.getData(row+1,col) - (float)2.0 * slice.getData(row,col) + slice.getData(row-1,col);\n\n\t\t\t\tif( t != (float)0.0 || slice.getData(row,col) != (float)0.0 ) {\n\t\t\t\t\tv[v_numset] = t; v_numset++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif( v_numset <= 10 ) {\n\t\t\tsig_x = (float)0.0;\n\t\t}\n\t\telse {\n\t\t\tsig_x = vec_stdDevMod(v, v_numset);\n\t\t}\n\n\t\treturn (float)Math.sqrt( (double)(sig_x * sig_x + sig_y * sig_y) ) / (float)2.0;\n\t}", "public void graduation()\n{\n stroke(0);\n line(w3, h3, w3, h3+70);//0%\n line(w3+cos(7*TWO_PI/20)*(radiu-5), h3+sin(7*TWO_PI/20)*(radiu-5), w3+cos(7*TWO_PI/20)*radiu, h3+sin(7*TWO_PI/20)*radiu);//10%\n line(w3+cos(9*TWO_PI/20)*(radiu-5), h3+sin(9*TWO_PI/20)*(radiu-5), w3+cos(9*TWO_PI/20)*radiu, h3+sin(9*TWO_PI/20)*radiu);//20%\n line(w3+cos(11*TWO_PI/20)*(radiu-5), h3+sin(11*TWO_PI/20)*(radiu-5), w3+cos(11*TWO_PI/20)*radiu, h3+sin(11*TWO_PI/20)*radiu);//30%\n line(w3+cos(13*TWO_PI/20)*(radiu-5), h3+sin(13*TWO_PI/20)*(radiu-5), w3+cos(13*TWO_PI/20)*radiu, h3+sin(13*TWO_PI/20)*radiu);//40%\n line(w3+cos(15*TWO_PI/20)*(radiu-5), h3+sin(15*TWO_PI/20)*(radiu-5), w3+cos(15*TWO_PI/20)*radiu, h3+sin(15*TWO_PI/20)*radiu);//50%\n line(w3+cos(17*TWO_PI/20)*(radiu-5), h3+sin(17*TWO_PI/20)*(radiu-5), w3+cos(17*TWO_PI/20)*radiu, h3+sin(17*TWO_PI/20)*radiu);//60%\n line(w3+cos(19*TWO_PI/20)*(radiu-5), h3+sin(19*TWO_PI/20)*(radiu-5), w3+cos(19*TWO_PI/20)*radiu, h3+sin(19*TWO_PI/20)*radiu);//60%\n line(w3+cos(21*TWO_PI/20)*(radiu-5), h3+sin(21*TWO_PI/20)*(radiu-5), w3+cos(21*TWO_PI/20)*radiu, h3+sin(21*TWO_PI/20)*radiu);//60%\n line(w3+cos(23*TWO_PI/20)*(radiu-5), h3+sin(23*TWO_PI/20)*(radiu-5), w3+cos(23*TWO_PI/20)*radiu, h3+sin(23*TWO_PI/20)*radiu);//60%\n fill(0);\n textSize(10);\n text(\"0%\", w3-5, h3+radiu+15); \n\n text(\"10%\", w3+cos(7*TWO_PI/20)*(radiu+25), h3+sin(7*TWO_PI/20)*(radiu+15)); \n text(\"20%\", w3+cos(9*TWO_PI/20)*(radiu+25), h3+sin(9*TWO_PI/20)*(radiu+15)); \n text(\"30%\", w3+cos(11*TWO_PI/20)*(radiu+20), h3+sin(11*TWO_PI/20)*(radiu+15)); \n text(\"40%\", w3+cos(13*TWO_PI/20)*(radiu+15), h3+sin(13*TWO_PI/20)*(radiu+10)); \n text(\"50%\", w3+cos(15*TWO_PI/20)*(radiu+15), h3+sin(15*TWO_PI/20)*(radiu+5)); \n text(\"60%\", w3+cos(17*TWO_PI/20)*(radiu+10), h3+sin(17*TWO_PI/20)*(radiu+5)); \n text(\"70%\", w3+cos(19*TWO_PI/20)*(radiu+5), h3+sin(19*TWO_PI/20)*(radiu+15)); \n text(\"80%\", w3+cos(21*TWO_PI/20)*(radiu+5), h3+sin(21*TWO_PI/20)*(radiu+15)); \n text(\"90%\", w3+cos(23*TWO_PI/20)*(radiu+5), h3+sin(23*TWO_PI/20)*(radiu+15)); \n textSize(20);\n text(\"Weekday\", w3+cos(7*TWO_PI/20)*(radiu+100), h3+sin(7*TWO_PI/20)*(radiu+50));\n text(\"Weekend\", w3+cos(24*TWO_PI/20)*(radiu+33), h3+sin(24*TWO_PI/20)*(radiu+33));\n}", "private void drawTimeLineForLine(Graphics2D g2d, RenderContext myrc, Line2D line, \n Composite full, Composite trans,\n int tl_x0, int tl_x1, int tl_w, int tl_y0, int tl_h, \n long ts0, long ts1) {\n g2d.setComposite(full); \n\t// Parametric formula for line\n double dx = line.getX2() - line.getX1(), dy = line.getY2() - line.getY1();\n\tdouble len = Utils.length(dx,dy);\n\tif (len < 0.001) len = 0.001; dx = dx/len; dy = dy/len; double pdx = dy, pdy = -dx;\n\tif (pdy < 0.0) { pdy = -pdy; pdx = -pdx; } // Always point down\n double gather_x = line.getX1() + dx*len/2 + pdx*40, gather_y = line.getY1() + dy*len/2 + pdy*40;\n\n\t// Find the bundles, for this with timestamps, construct the timeline\n\tSet<Bundle> set = myrc.line_to_bundles.get(line);\n\tIterator<Bundle> itb = set.iterator(); double x_sum = 0.0; int x_samples = 0;\n while (itb.hasNext()) {\n\t Bundle bundle = itb.next();\n\t if (bundle.hasTime()) { x_sum += (int) (tl_x0 + (tl_w*(bundle.ts0() - ts0))/(ts1 - ts0)); x_samples++; }\n }\n\tif (x_samples == 0) return;\n\tdouble x_avg = x_sum/x_samples;\n ColorScale timing_marks_cs = RTColorManager.getTemporalColorScale();\n itb = set.iterator();\n\twhile (itb.hasNext()) { \n\t Bundle bundle = itb.next();\n\n\t if (bundle.hasTime()) {\n double ratio = ((double) (bundle.ts0() - ts0))/((double) (ts1 - ts0));\n\t g2d.setColor(timing_marks_cs.at((float) ratio));\n\n\t int xa = (int) (tl_x0 + (tl_w*(bundle.ts0() - ts0))/(ts1 - ts0));\n // g2d.setComposite(full); \n g2d.draw(line);\n\t if (bundle.hasDuration()) {\n int xb = (int) (tl_x0 + (tl_w*(bundle.ts1() - ts0))/(ts1 - ts0)); \n double r = (tl_h-2)/2;\n g2d.fill(new Ellipse2D.Double(xa-r,tl_y0-tl_h/2-r,2*r,2*r));\n g2d.fill(new Ellipse2D.Double(xb-r,tl_y0-tl_h/2-r,2*r,2*r));\n if (xa != xb) g2d.fill(new Rectangle2D.Double(xa, tl_y0-tl_h/2-r, xb-xa, 2*r));\n\t if (xa != xb) { g2d.drawLine(xa,tl_y0-tl_h,xb,tl_y0); g2d.drawLine(xa,tl_y0, xb,tl_y0); }\n\t }\n\t g2d.drawLine(xa,tl_y0-tl_h,xa,tl_y0); // Make it slightly higher at the start\n double x0 = line.getX1() + dx * len * 0.1 + dx * len * 0.8 * ratio,\n\t y0 = line.getY1() + dy * len * 0.1 + dy * len * 0.8 * ratio;\n\t g2d.draw(new CubicCurve2D.Double(x0, y0, \n x0 + pdx*10, y0 + pdy*10,\n gather_x - pdx*10, gather_y - pdy*10,\n gather_x, gather_y));\n g2d.draw(new CubicCurve2D.Double(gather_x, gather_y, \n\t gather_x + pdx*40, gather_y + pdy*40,\n\t\t\t\t\t x_avg, tl_y0 - 10*tl_h, \n\t x_avg, tl_y0 - 8*tl_h));\n g2d.draw(new CubicCurve2D.Double(x_avg, tl_y0 - 8*tl_h,\n (x_avg+xa)/2, tl_y0 - 6*tl_h,\n xa, tl_y0 - 2*tl_h,\n xa, tl_y0 - tl_h/2));\n }\n\t}\n }", "public Vector3D getGradient(int x, int y) {\n\t\tif (x < 1 || x >= mSizeX - 1) {\n\t\t\treturn new Vector3D(0, 0, 0);\n\t\t}\n\n\t\tif (y < 1 || y >= mSizeY - 1) {\n\t\t\treturn new Vector3D(0, 0, 0);\n\t\t}\n\n\t\treturn new Vector3D(mData[x - 1][y] - mData[x + 1][y], mData[x][y - 1] - mData[x][y + 1], 2);\n\t}", "public void getGradient(Surface srf)\r\n {\r\n srf.x1 = firstPoint.x;\r\n srf.y1 = firstPoint.y;\r\n srf.x2 = secondPoint.x;\r\n srf.y2 = secondPoint.y;\r\n srf.gradientColor = secondColor;\r\n srf.cyclic = cyclic;\r\n srf.reversed = reversed;\r\n }", "private void gradientDecent(double[][] X, double[] y){\n double[] h = matrix.sigmoid(matrix.multiply(X,Theta));\n double[] cp = costPrime(X,h,y);\n\n double scp = 0;\n for(double i: cp){\n scp = scp + i;\n }\n System.out.println(+ cost(h,y));\n // Average Cost\n scp = round(scp/h.length,5);\n System.out.println(scp);\n int j = 0;\n\n // while Average Cost is not 0\n while(scp > 0.00001){\n Theta = matrix.subtract(Theta,matrix.multiply(alpha,cp));\n h = matrix.sigmoid(matrix.multiply(X,Theta));\n cp = costPrime(X,h,y);\n double sum = 0;\n for(double i: cp){\n sum = sum + i;\n }\n scp = round(sum/h.length,5);\n System.out.println(scp);\n }\n }", "private Double calculateLGD(Date lgdDate, List<LossGivenDefault> lgds) {\r\n\t\tDouble loss = new Double(0d);\r\n\t\tDate thisDate;\r\n\t\tDouble lastLoss = new Double(0d);\r\n\t\tDate lastDate = asOfDate;\r\n\t\t\r\n\t\tfor (LossGivenDefault lgd: lgds) {\r\n\t\t\tif (lgd.getDate().after(lgdDate)) {\r\n\t\t\t\tloss = lgd.getLoss(); \r\n\t\t\t\tthisDate = lgd.getDate();\r\n\t\t\t\tlong periodDiff = thisDate.getTime() - lastDate.getTime();\r\n\t\t\t\tlong lastDiff = thisDate.getTime() - lgdDate.getTime();\r\n\t\t\t\t\r\n\t\t\t\treturn (((lastDiff/periodDiff) * loss) + (((periodDiff - lastDiff)/periodDiff) * lastLoss));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tlastLoss = lgd.getLoss();\r\n\t\t\tlastDate = lgd.getDate();\r\n\t\t}\r\n\t\t\r\n\t\t// TODO Warn lgdDate beyond end of lgd curve\r\n\t\treturn 0d;\r\n\t}", "int computeGradient(\n int gx, int gy);", "private static Color[] createGradient(Color [] colors, int steps){\n int totalSteps = (colors.length-1) * steps;\r\n \r\n Color [] gradient = new Color [totalSteps];\r\n int gradientIndex = 0;\r\n for (int i = 0; i < colors.length - 1; i++){ // loop through colors in supplied color array (needs index to locate adjacent colors)\r\n for (Color c: createGradient(colors[i], colors[i+1], steps)){ // loop through each color 'step' in gradient formed from each color pair\r\n gradient[gradientIndex++] = c; \r\n } // end gradient loop\r\n } // end colors indexing loop \r\n \r\n return gradient;\r\n }", "void addGradient(Vector gradientVector, double gradient);", "public void linearGradient(int axis, double startConc, double endConc) {\r\n\t\tassert ((axis >= 0) && (axis <= 2)) :\r\n\t\t\t\"Chemical field gradient - axis selection out of range [0,2]\\n\" +\r\n\t\t\t\"Check axis is one of: x-axis = '0', y = '1', or z = '2'\";\r\n\t\t\r\n\t\t\r\n\t\tint[] index = {0,0,0};\r\n\t\t\r\n\t\tdouble grad = (endConc - startConc)/(double)boxes[axis];\r\n \r\n for(index[0] = 0; index[0]<boxes[0]; index[0]++)\r\n\t\t\tfor(index[1] = 0; index[1]<boxes[1]; index[1]++)\r\n\t\t\t\tfor(index[2] = 0; index[2]<boxes[2]; index[2]++)\r\n\t\t\t\t\tsetConc(index[0], index[1], index[2], startConc + index[axis]*grad);\r\n\t}", "private void drawTimeLine(Graphics2D g2d, RenderContext myrc) {\n if (mouseIn()) {\n double mxc = mx, myc = my; // Save the mouse coords so they are static\n\n // Find the closest line segment\n Line2D closest_line = null; double closest_line_d = Double.MAX_VALUE;\n Iterator<Line2D> it = myrc.line_to_bundles.keySet().iterator();\n while (it.hasNext()) {\n Line2D line = it.next();\n\tdouble d = line.ptSegDist(mxc,myc);\n\tif (d < closest_line_d) { closest_line = line; closest_line_d = d; }\n }\n\n // If we found an edge, create the timeline\n if (closest_line != null && closest_line_d < 20.0) {\n\t// Darken background\n Composite orig_comp = g2d.getComposite(); \n\tg2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f));\n\tg2d.setColor(RTColorManager.getColor(\"brush\", \"dim\"));\n\tg2d.fillRect(0,0,myrc.getRCWidth(),myrc.getRCHeight());\n\tg2d.setComposite(orig_comp);\n\n // Create the composites\n\tComposite trans = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f), full = g2d.getComposite();\n\n\t// Determine the timeline geometry\n\tint txt_h = Utils.txtH(g2d, \"0\");\n int tl_x0 = 10, tl_x1 = myrc.w - 10, tl_w = tl_x1 - tl_x0;\n\tint tl_y0 = myrc.h - txt_h - 4, tl_h = 6;\n\n // Get the time bounds\n\tlong ts0 = getRenderBundles().ts0(), ts1 = getRenderBundles().ts1dur();\n\n\t// Give it labels\n\tString str = Utils.humanReadableDate(ts0); Color fg = RTColorManager.getColor(\"label\", \"defaultfg\"), bg = RTColorManager.getColor(\"label\", \"defaultbg\");\n\tg2d.setColor(RTColorManager.getColor(\"axis\",\"default\")); g2d.drawLine(tl_x0, tl_y0+1, tl_x1, tl_y0+1);\n clearStr(g2d, str, tl_x0, tl_y0 + txt_h+2, fg, bg);\n\tstr = Utils.humanReadableDate(ts1);\n clearStr(g2d, str, tl_x1 - Utils.txtW(g2d,str), tl_y0 + txt_h+2, fg, bg);\n\n // Highlight the line itself\n g2d.setColor(RTColorManager.getColor(\"annotate\",\"cursor\"));\n\tdrawTimeLineForLine(g2d, myrc, closest_line, full, trans, tl_x0, tl_x1, tl_w, tl_y0, tl_h, ts0, ts1);\n\n\t// Create a bitvector representing locations in the timeline... use minute resolution... unless unreasonable (like decades...)\n\tlong resolution = 60L*1000L;\n\tint minutes = (int) ((ts1 - ts0)/resolution);\n\tif (minutes > 0 && minutes < 5*365*24*60) {\n\t boolean mask[] = new boolean[minutes+1]; // Give it a little extra...\n\t fillTimeLineMask(myrc,closest_line,mask,ts0,resolution);\n\n // Count matches across the rest of the lines...\n\t List<LineCountSorter> sorter = new ArrayList<LineCountSorter>();\n it = myrc.line_to_bundles.keySet().iterator();\n while (it.hasNext()) {\n Line2D line = it.next();\n\t if (line != closest_line) {\n\t int matches = countTimeLineMatches(myrc, line, mask, ts0, resolution);\n\t if (matches > 0) { sorter.add(new LineCountSorter(line, matches)); }\n\t }\n\t }\n\n\t // If we have matches, sort them\n Collections.sort(sorter);\n\n\t // Display the top twenty or so...\n\t for (int i=0;i<(sorter.size() > 20 ? 20 : sorter.size());i++) {\n\t tl_y0 -= tl_h; g2d.setColor(RTColorManager.getColor(sorter.get(i).getLine().toString()));\n\t drawTimeLineForLine(g2d, myrc, sorter.get(i).getLine(), full, trans, tl_x0, tl_x1, tl_w, tl_y0, tl_h, ts0, ts1);\n\t }\n\n\t if (sorter.size() > 20) { // Let the user know that the display is abridged...\n\t tl_y0 -= tl_h;\n\t fg = RTColorManager.getColor(\"label\", \"errorfg\"); bg = RTColorManager.getColor(\"label\", \"errorbg\");\n\t clearStr(g2d, \"Edges Truncated\", tl_x0, tl_y0, fg, bg);\n\t }\n }\n }\n }\n }", "protected void setGradient(int x, int y, float w, float h, Color c1, Color c2) {\n\t\tp.pushStyle();\n\t\tp.noFill();\n\t for (int i = y; i <= y+h/4; i++) {\n\t \tfloat inter = PApplet.map(i, y, (y+h/4), 1, 0);\n\t\t p.stroke(p.lerpColor(p.color(c1.getRGB()), p.color(c2.getRGB()), inter));\n\t\t p.line(x, i, x+w, i);\n\t }\n\t for (int i = (int) (y+h/4)+1; i <= y+h; i++) {\n\t \tfloat inter = PApplet.map(i, y+h/4, y+h, 0, 1);\n\t\t p.stroke(p.lerpColor(p.color(c1.getRGB()), p.color(c2.getRGB()), inter));\n\t\t p.line(x, i, x+w, i);\n\t }\n\t p.popStyle();\n\t}", "static void compute(){\n XYChart.Series<Number, Number> euler = new XYChart.Series<>();\n XYChart.Series<Number, Number> eulerLocalError = new XYChart.Series<>();\n\n //inserting into series values at 0-th step\n euler.getData().add(new XYChart.Data<>(x0, y0));\n eulerLocalError.getData().add(new XYChart.Data<>(x0, 0.0));\n\n //looping through N steps (N - user inserted value)\n for (int i = 1; i <= N; ++i){\n //retrieving x and y-approximation at previous step\n double prevX = euler.getData().get(i - 1).getXValue().doubleValue();\n double prevY = euler.getData().get(i - 1).getYValue().doubleValue();\n\n //calculating current x, and current y-approximation\n double x = x0 + h * i;\n double y = prevY + h * derivativeAtPoint(prevX, prevY);\n\n //inserting to the approximation series pair of correspondent values\n euler.getData().add(new XYChart.Data<>(x, y));\n\n //calculating previous and current step exact solutions\n double prevExactY = exactSolution.calculate(x - h);\n double curExactY = exactSolution.calculate(x);\n\n //using formula for local error, calculating it and putting it into local error series for Euler's computational method\n double A = derivativeAtPoint(x - h, prevExactY);\n eulerLocalError.getData().add(new XYChart.Data<>(x, Math.abs(curExactY - prevExactY - h * A)));\n }\n //defining the name of the series\n euler.setName(\"Euler method\");\n eulerLocalError.setName(\"Euler method\");\n\n //inserting these series into their correspondent charts\n localErrorsChart.getData().add(eulerLocalError);\n approximationsAndExactSolutionChart.getData().add(euler);\n }", "public void calculateGradients(int dataIndex, double learningRate){\r\n for (int i = 0; i < outputLayer.length; i++) {\r\n for (int j = 0; j < outputLayer[i].weights.length; j++) {\r\n outputLayer[i].dw[j] = -2*((attribute[dataIndex] == i ? 1 : 0) - sigmoid(outputLayer[i].z))*sigmoidDeri(outputLayer[i].z)*outputLayer[i].data[j];\r\n }\r\n outputLayer[i].db = -2*((attribute[dataIndex] == i ? 1 : 0) - sigmoid(outputLayer[i].z))*sigmoidDeri(outputLayer[i].z);\r\n }\r\n\r\n adjust(learningRate, true);\r\n calculateDesireHiddenLayerActivation(dataIndex);\r\n\r\n for (int i = 0; i < hiddenLayer.length; i++) {\r\n for (int j = 0; j < hiddenLayer[i].weights.length; j++) {\r\n hiddenLayer[i].dw[j] = -2*(desireHiddenLayerActivation[i] - hiddenLayer[i].a)*sigmoidDeri(hiddenLayer[i].z)*hiddenLayer[i].data[j];\r\n }\r\n hiddenLayer[i].db = -2*(desireHiddenLayerActivation[i] - hiddenLayer[i].a)*sigmoidDeri(hiddenLayer[i].z);\r\n }\r\n\r\n adjust(learningRate, false);\r\n }", "public double calculateCurvatureGradient(int i){\n Node3D node = mesh.nodes.get(i);\n Set<Node3D> neighbors = getNeighbors(node);\n\n double[] k1 = calculateMeanCurvatureNormal(node, node_to_triangle.get(node));\n double kh = Vector3DOps.normalize(k1)/2;\n double[] k2 = new double[k1.length];\n double kneighbors = 0;\n for(Node3D neighbor: neighbors){\n double[] ki = calculateMeanCurvatureNormal(node, node_to_triangle.get(node));\n\n }\n\n return 0;\n }", "private double innerEnergy(int x, int y)\n {\n Color left = this.picture.get(x-1, y);\n Color right = this.picture.get(x+1, y);\n Color up = this.picture.get(x, y-1);\n Color down = this.picture.get(x, y+1);\n return gradient(left, right) + gradient(up, down);\n }", "static double slope(Line line) {\n return (line.b == 1) ? -line.a : INF;\n }", "public float gradientMethod(Volume vol) \n\t{\n\t\tfloat nes = (float)0.0;\n\n\t\t//\n\t\t// Get the right slice.\n\t\t//\n\t\tfor(int ii=0; ii<vol.getNSlices(); ii++) {\n\t\t\tnes += gradientMethod( vol.getSlice(ii) );\n\t\t}\n\n\t\treturn (nes / (float)vol.getNSlices());\n\t}", "public void difXY() {\n for(int ix=1;ix<cols-1;ix++) {\n for(int iy=1;iy<rows-1;iy++) {\n int ig=iy*cols+ix;\n // compute x difference\n dxr[ig] = par[ig+1]-par[ig-1]; // red\n //dxg[ig] = pag[ig+1]-pag[ig-1]; // green\n //dxb[ig] = pab[ig+1]-pab[ig-1]; // blue\n // compute y difference\n dyr[ig] = par[ig+cols]-par[ig-cols]; // red\n //dyg[ig] = pag[ig+cols]-pag[ig-cols]; // green\n //dyb[ig] = pab[ig+cols]-pab[ig-cols]; // blue\n }\n }\n }", "public Line regress() {\n if(!dirty) return lastResult;\n\n int n = fixedList.getSize();\n if (n == 0) {\n throw new IllegalStateException(\"No sample was added to this calculator\");\n }\n\n double sumx=0, sumy=0, sumxx=0, sumxy=0;\n for (int i = 0; i < n; i++) {\n Point2D cv = fixedList.get(i);\n double x = cv.getX();\n double y = cv.getY();\n sumx += x;\n sumy += y;\n sumxx += x*x;\n sumxy += x*y;\n }\n\n double sxx = sumxx-(sumx*sumx/n);\n double sxy = sumxy-(sumx*sumy/n);\n if(sxx==0) return lastResult;\n\n double b = sxy/sxx;\n double a = (sumy-(b*sumx))/n;\n\n lastResult = new Line(a,b);\n return lastResult;\n }", "private ArrayList<Float> FindRasterCellOnLine(int x1, int y1, int x2, int y2) {\n // delta of exact value and rounded value of the dependant variable\n ArrayList<Float> zvalue = new ArrayList<Float>();\n int d = 0;\n\n int dy = Math.abs(y2 - y1);\n int dx = Math.abs(x2 - x1);\n\n int dy2 = (dy << 1); // slope scaling factors to avoid floating\n int dx2 = (dx << 1); // point\n int ix = x1 < x2 ? 1 : -1; // increment direction\n int iy = y1 < y2 ? 1 : -1;\n\n if (dy <= dx) {\n for (;;) {\n //get a new pair of x1, y1\n float zvaluenow = nctest.GetAttribute(x1, y1);\n if (zvaluenow==-100000000)\n break;\n zvalue.add(zvaluenow);\n \n \n if (x1 >= x2) {\n break;\n }\n x1 += ix;\n d += dy2;\n if (d > dx) {\n y1 += iy;\n d -= dx2;\n }\n }\n } else {\n for (;;) {\n //get a new pair of x1, y1\n float zvaluenow = nctest.GetAttribute(x1, y1);\n if (zvaluenow==-100000000)\n break;\n zvalue.add(zvaluenow);\n if (y1 >= y2) {\n break;\n }\n y1 += iy;\n d += dx2;\n if (d > dy) {\n x1 += ix;\n d -= dy2;\n }\n }\n }\n\n return zvalue;\n }", "public abstract double gradient(double betaForDimension, int dimension);", "private void setDataLineChart() {\n\t\t\n\t\tchartLine.setTitle(\"Evolution du Solde\");\n\t\tchartLine.getData().clear();\n\t\t\n\t\tXYChart.Series series = new XYChart.Series();\n\t\tseries.getData().clear();\n\t\tseries.setName(\"Evolution du solde\");\n\t\t\n\t\tdouble solde = bal.getAmount();\n\t\tint currentYear = Calendar.getInstance().get(Calendar.YEAR);\n\t\tint currentMonth = Calendar.getInstance().get(Calendar.MONTH);\n\t\tint currentDay = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n\t\t\n\t\t\n\t\t// Create a calendar object and set year and month\n\t\tCalendar mycal = new GregorianCalendar(currentYear, currentMonth,\n\t\t\t\tcurrentDay);\n\t\t\n\t\t// Get the number of days in that month\n\t\tint daysInMonth = mycal.getActualMaximum(Calendar.DAY_OF_MONTH);\n\t\t\n\t\tif (!bal.getTransactions().isEmpty()) {\n\t\t\tfor (IOTransactionLogic transaction : bal.getTransactions()\n\t\t\t\t\t.get(currentYear)[currentMonth]) {\n\t\t\t\tsolde -= transaction.getAmount();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < currentDay; ++i) {\n\t\t\tif (!bal.getTransactions().isEmpty()) {\n\t\t\t\tfor (IOTransactionLogic transaction : bal.getTransactions()\n\t\t\t\t\t\t.get(currentYear)[currentMonth]) {\n\t\t\t\t\tjava.sql.Date dat = transaction.getDate();\n\t\t\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\t\t\tcal.setTime(dat);\n\t\t\t\t\tif (cal.get(Calendar.DAY_OF_MONTH) - 1 == i) {\n\t\t\t\t\t\tsolde += transaction.getAmount();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tseries.getData()\n\t\t\t\t\t.add(new XYChart.Data(String.valueOf(i + 1), solde));\n\t\t}\n\t\t\n\t\tchartLine.getData().addAll(series);\n\t\tchartLine.setLegendVisible(false);\n\t}", "@Test\n public void testAccumulateGradients() {\n // TODO: MXNet support for accumulating gradients does not currently work\n TestUtils.requiresNotEngine(\"MXNet\");\n try (NDManager manager = NDManager.newBaseManager(TestUtils.getEngine())) {\n NDArray a = manager.create(0.0f);\n a.setRequiresGradient(true);\n\n Engine engine = Engine.getEngine(TestUtils.getEngine());\n try (GradientCollector gc = engine.newGradientCollector()) {\n for (int i = 1; i <= 3; i++) {\n NDArray b = a.mul(2);\n gc.backward(b);\n Assert.assertEquals(a.getGradient().getFloat(), 2.0f * i);\n }\n }\n }\n }", "public float getGradPoint() { return gradientPoint; }", "private void fill() {\n\t\tseries1.clear();\n\t\tint m = 50;\n\t\tdouble tmpX, tmpZ;\n\n\t\tfor (double x=-m; x <= +m; x++) {\n\t\t\ttmpX = MathUtils.sqr(x/30);\n\t\t\tfor (double z=-m; z <= +m; z++) {\n\t\t\t\ttmpZ = MathUtils.sqr(z/30);\n\t\t\t\ttmpZ = Math.sqrt(tmpX+tmpZ);\n\t\t\t\tseries1.add(x, 4*Math.cos(3*tmpZ)*Math.exp(-0.5*tmpZ), z);\n\t\t\t}\n\t\t}\n\t }", "public RandomVariable getValues(final double evaluationTime, final LIBORMarketModel model) {\n\t\tif(evaluationTime > 0) {\n\t\t\tthrow new RuntimeException(\"Forward start evaluation currently not supported.\");\n\t\t}\n\n\t\t// Fetch the covariance model of the model\n\t\tfinal LIBORCovarianceModel covarianceModel = model.getCovarianceModel();\n\n\t\t// We sum over all forward rates\n\t\tfinal int numberOfComponents = covarianceModel.getLiborPeriodDiscretization().getNumberOfTimeSteps();\n\n\t\t// Accumulator\n\t\tRandomVariable\tintegratedLIBORCurvature\t= new RandomVariableFromDoubleArray(0.0);\n\t\tfor(int componentIndex = 0; componentIndex < numberOfComponents; componentIndex++) {\n\n\t\t\t// Integrate from 0 up to the fixing of the rate\n\t\t\tfinal double timeEnd\t\t= covarianceModel.getLiborPeriodDiscretization().getTime(componentIndex);\n\t\t\tint timeEndIndex\t= covarianceModel.getTimeDiscretization().getTimeIndex(timeEnd);\n\n\t\t\t// If timeEnd is not in the time discretization we get timeEndIndex = -insertionPoint-1. In that case, we use the index prior to the insertionPoint\n\t\t\tif(timeEndIndex < 0) {\n\t\t\t\ttimeEndIndex = -timeEndIndex - 2;\n\t\t\t}\n\n\t\t\t// Sum squared second derivative of the variance for all components at this time step\n\t\t\tRandomVariable integratedLIBORCurvatureCurrentRate = new RandomVariableFromDoubleArray(0.0);\n\t\t\tfor(int timeIndex = 0; timeIndex < timeEndIndex-2; timeIndex++) {\n\t\t\t\tfinal double timeStep1\t= covarianceModel.getTimeDiscretization().getTimeStep(timeIndex);\n\t\t\t\tfinal double timeStep2\t= covarianceModel.getTimeDiscretization().getTimeStep(timeIndex+1);\n\n\t\t\t\tfinal RandomVariable covarianceLeft\t\t= covarianceModel.getCovariance(timeIndex+0, componentIndex, componentIndex, null);\n\t\t\t\tfinal RandomVariable covarianceCenter\t= covarianceModel.getCovariance(timeIndex+1, componentIndex, componentIndex, null);\n\t\t\t\tfinal RandomVariable covarianceRight\t\t= covarianceModel.getCovariance(timeIndex+2, componentIndex, componentIndex, null);\n\n\t\t\t\t// Calculate second derivative\n\t\t\t\tRandomVariable curvatureSquared = covarianceRight.sub(covarianceCenter.mult(2.0)).add(covarianceLeft);\n\t\t\t\tcurvatureSquared = curvatureSquared.div(timeStep1 * timeStep2);\n\n\t\t\t\t// Take square\n\t\t\t\tcurvatureSquared = curvatureSquared.squared();\n\n\t\t\t\t// Integrate over time\n\t\t\t\tintegratedLIBORCurvatureCurrentRate = integratedLIBORCurvatureCurrentRate.add(curvatureSquared.mult(timeStep1));\n\t\t\t}\n\n\t\t\t// Empty interval - skip\n\t\t\tif(timeEnd == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Average over time\n\t\t\tintegratedLIBORCurvatureCurrentRate = integratedLIBORCurvatureCurrentRate.div(timeEnd);\n\n\t\t\t// Take square root\n\t\t\tintegratedLIBORCurvatureCurrentRate = integratedLIBORCurvatureCurrentRate.sqrt();\n\n\t\t\t// Take max over all forward rates\n\t\t\tintegratedLIBORCurvature = integratedLIBORCurvature.add(integratedLIBORCurvatureCurrentRate);\n\t\t}\n\n\t\tintegratedLIBORCurvature = integratedLIBORCurvature.div(numberOfComponents);\n\t\treturn integratedLIBORCurvature.sub(tolerance).floor(0.0);\n\t}", "private void compute() {\r\n int i, j, k;\r\n float gx, gy, gz;\r\n for (int q = 0; q < data.length; q++) {\r\n data[q] = new VoxelGradient();\r\n }\r\n\r\n\r\n // gradient at extremes, 0 and dim-1\r\n i = 0;\r\n j = 0;\r\n k = 0;\r\n gx = (volume.data[(i + 1) + (dimX * (j + (dimY * k)))] - volume.data[i + (dimX * (j + (dimY * k)))]) / 1;\r\n gy = (volume.data[i + (dimX * ((j + 1) + (dimY * k)))] - volume.data[i + (dimX * (j + (dimY * k)))]) / 1;\r\n gz = (volume.data[i + (dimX * (j + (dimY * (k + 1))))] - volume.data[i + (dimX * (j + (dimY * k)))]) / 1;\r\n data[i + dimX * (j + dimY * k)] = new VoxelGradient(gx, gy, gz);\r\n i = dimX - 1;\r\n j = dimY - 1;\r\n k = dimZ - 1;\r\n gx = (volume.data[i + (dimX * (j + (dimY * k)))] - volume.data[(i - 1) + (dimX * (j + (dimY * k)))]) / 1;\r\n gy = (volume.data[i + (dimX * (j + (dimY * k)))] - volume.data[i + (dimX * ((j - 1) + (dimY * k)))]) / 1;\r\n gz = (volume.data[i + (dimX * (j + (dimY * k)))] - volume.data[i + (dimX * (j + (dimY * (k - 1))))]) / 1;\r\n data[i + dimX * (j + dimY * k)] = new VoxelGradient(gx, gy, gz);\r\n\r\n\r\n //gradient in non-extreme points\r\n for (i = 1; i < dimX - 1; i++) {\r\n for (j = 1; j < dimY - 1; j++) {\r\n for (k = 1; k < dimZ - 1; k++) {\r\n\r\n gx = (volume.data[(i + 1) + (dimX * (j + (dimY * k)))] - volume.data[(i - 1) + (dimX * (j + (dimY * k)))]) / 2;\r\n\r\n gy = (volume.data[i + (dimX * ((j + 1) + (dimY * k)))] - volume.data[i + (dimX * ((j - 1) + (dimY * k)))]) / 2;\r\n\r\n gz = (volume.data[i + (dimX * (j + (dimY * (k + 1))))] - volume.data[i + (dimX * (j + (dimY * (k - 1))))]) / 2;\r\n\r\n data[i + dimX * (j + dimY * k)] = new VoxelGradient(gx, gy, gz);\r\n\r\n\r\n }\r\n }\r\n }\r\n }", "private double[] calculateLineEquation(Point p1, Point p2) {\n double m = ((double) p2.y - p1.y) / (p2.x - p1.x);\n double c = p1.y - (m * p1.x);\n return new double[]{m, c};\n }", "private RadialGradient getGradient(Rect bounds) {\n adjustGradientColors();\n int count = colors.size();\n int[] colors = new int[count];\n float[] positions = new float[count];\n for (int i = 0; i < count; i++) {\n colors[i] = this.colors.get(i);\n positions[i] = this.offsets.get(i);\n }\n try {\n float r;\n PointF c;\n if (radius == 0) {\n c = new PointF(bounds.exactCenterX(), bounds.exactCenterY());\n r = Math.min(bounds.width() * 0.5f, bounds.height() * 0.5f);\n } else if (gradientUnits == PXGradientUnits.USER_SPACE) {\n c = new PointF(center.x, center.y);\n r = radius;\n } else {\n // linear-gradient points are based on the shape's bbox, so grab\n // that\n Rect pathBounds = bounds;\n\n // grab the x,y offset which we will apply later\n int left = pathBounds.left;\n int top = pathBounds.top;\n\n // grab the positions within the bbox for each point\n float p1x = pathBounds.width() * center.x;\n float p1y = pathBounds.height() * center.y;\n\n // create final points by offsetting the bbox coordinates by the\n // bbox origin\n c = new PointF(left + p1x, top + p1y);\n\n // TODO: need rx and ry. Using width for both now\n r = pathBounds.width() * radius;\n }\n RadialGradient gradient = new RadialGradient(c.x, c.y, r, colors, positions,\n TileMode.CLAMP);\n return gradient;\n } catch (Exception e) {\n if (PXLog.isLogging()) {\n PXLog.e(TAG, e, \"Error while instantiating a RadialGradient\");\n }\n return null;\n }\n }", "@Override\r\n public void getValueGradient(double[] gradient) {\n double[] llhGrad = new double[N];\r\n for (int n = 0; n < N; n++) {\r\n llhGrad[n] = ZTy[n];\r\n for (int m = 0; m < N; m++) {\r\n llhGrad[n] -= ZTZ[n][m] * parameters[m];\r\n }\r\n llhGrad[n] /= (rhoSquare);\r\n }\r\n\r\n // gradient of the log prior\r\n double[] lprior = new double[N];\r\n for (int n = 0; n < N; n++) {\r\n // uplink\r\n double uplinkPrior = 0.0;\r\n int parentIndex = upwardLink.get(n);\r\n if (parentIndex == -1) {\r\n uplinkPrior += parameters[n] - mu;\r\n } else {\r\n uplinkPrior += parameters[n] - parameters[parentIndex];\r\n }\r\n uplinkPrior /= (-sigmaSquares[n]);\r\n\r\n // downlinks\r\n double downlinkPrior = 0.0;\r\n for (int child : downwardLinks.get(n)) {\r\n downlinkPrior += (parameters[n] - parameters[child]) / (-sigmaSquares[child]);\r\n }\r\n\r\n lprior[n] = uplinkPrior + downlinkPrior;\r\n }\r\n// for(int n=0; n<N; n++)\r\n// lprior[n] = - (parameters[n] - mus[n]) / sigmaSquares[n];\r\n\r\n // combine\r\n for (int n = 0; n < N; n++) {\r\n gradient[n] = llhGrad[n] + lprior[n];\r\n }\r\n }", "public float gradientMethod(MCVolume vol) \n\t{\n\t\tfloat nes = (float)0.0;\n\n\t\t//\n\t\t// Get the right slice.\n\t\t//\n\t\tfor(int ii=0; ii<vol.getNSlices(); ii++) {\n\t\t\tfor(int jj=0; jj<vol.getNChannels(); jj++) {\n\t\t\t\tnes += gradientMethod( vol.getSlice(ii, jj) );\n\t\t\t}\n\t\t}\n\n\t\treturn (nes / ((float)vol.getNSlices()*(float)vol.getNChannels()) );\n\t}", "private void linearFunction(Graphics g, double x0, double y0, double x1, double y1) {\n //abriviaciones para las funciones\n double dx = x1 - x0;\n double dy = y1 - y0;\n\n if (Math.abs(dx) > Math.abs(dy)) {\n double m = dy / dx;\n double b = y0 - m * x0;\n if (dx < 0) {\n dx = -1;\n } else {\n dx = 1;\n }\n\n while (x0 != x1) {\n x0 += dx;\n y0 = Math.round(m * x0 + b);\n g.drawLine((int) coord_x(x0), (int) coord_y(y0), (int) coord_x(x0), (int) coord_y(y0));\n }\n } else {\n if (dy != 0) {\n double m = dx / dy;\n double b = x0 - m * y0;\n if (dy < 0) {\n dy = -1;\n } else {\n dy = 1;\n }\n while (y0 != y1) {\n y0 += dy;\n x0 = Math.round(m * y0 + b);\n g.drawLine((int) coord_x(x0), (int) coord_y(y0), (int) coord_x(x0), (int) coord_y(y0));\n }\n }\n }\n }", "private void gradientMagnitude(float[] img, float[] mag) {\r\n int row, col, cIndex;\r\n float lVal, rVal, tVal, bVal;\r\n for (row = 0; row < yDim; row++) {\r\n cIndex = row * xDim;\r\n for (col = 0, cIndex += col; col < xDim; cIndex++, col++) {\r\n\r\n rVal = getVal(img,col+1,row);\r\n lVal = getVal(img,col-1,row);\r\n tVal = getVal(img,col,row+1);\r\n bVal = getVal(img,col,row-1);\r\n\r\n mag[cIndex] = (float)Math.sqrt((rVal - lVal) * (rVal - lVal) + (tVal - bVal) * (tVal - bVal));\r\n } // for (col = 0; ...)\r\n } // for (row = 0; ...)\r\n }", "private double calcEnergy(int x, int y) {\n if (x == 0 || y == 0 || x == width - 1 || y == height - 1) return BORDER_ENERGY;\n return Math.sqrt(\n Math.pow(getRGBColor(x + 1, y, R) - getRGBColor(x - 1, y, R), 2)\n + Math.pow(getRGBColor(x + 1, y, G) - getRGBColor(x - 1, y, G), 2)\n + Math.pow(getRGBColor(x + 1, y, B) - getRGBColor(x - 1, y, B), 2)\n + Math.pow(getRGBColor(x, y + 1, R) - getRGBColor(x, y - 1, R), 2)\n + Math.pow(getRGBColor(x, y + 1, G) - getRGBColor(x, y - 1, G), 2)\n + Math.pow(getRGBColor(x, y + 1, B) - getRGBColor(x, y - 1, B), 2)\n );\n }", "@Override\n public double dydx(double t) {\n \tt = t / 141;\n \treturn (12 + 324 * t + -360 * Math.pow(t, 2))/ (294 + -930 * t + 873 * Math.pow(t, 2));\n }", "public void recalculate(){\n\t\t\n\t\tLinkedList<Line> primaryLines = lineLists.get(0);\n\t\t\n\t\tfor (int i = 0; i < controlPoints.size()-1; i++){\n\t\t\tControlPoint current = controlPoints.get(i);\n\t\t\tControlPoint next = controlPoints.get(i+1);\n\t\t\t\n\t\t\tLine line = primaryLines.get(i);\n\t\t\t\n\t\t\tline.setStartX(current.getCenterX());\n\t\t\tline.setStartY(current.getCenterY());\n\t\t\tline.setEndX(next.getCenterX());\n\t\t\tline.setEndY(next.getCenterY());\n\t\t}\n\t}", "public DoubleColumn linear() {\n DoubleColumn result = col.asDoubleColumn();\n int last = -1;\n for (int i = 0; i < col.size(); i++) {\n if (!col.isMissing(i)) {\n if (last >= 0 && last != i - 1) {\n for (int j = last + 1; j < i; j++) {\n result.set(\n j,\n col.getDouble(last)\n + (col.getDouble(i) - col.getDouble(last)) * (j - last) / (i - last));\n }\n }\n last = i;\n }\n }\n return result;\n }", "@Override\n public Vector2d gradient(Vector2d p) {\n\n return null;\n }", "public synchronized void calculateGradientDelta(cl_mem clmMatrixPriorDelta, cl_mem clmVectorY, \r\n cl_mem clmMatrixTheta, cl_mem clmMatrixA, cl_mem clmMatrixResultDelta, \r\n int priorDeltaWidth, int resultDeltaWidth, int numOfSamples) {\r\n confirmActiveState();\r\n \r\n clSetKernelArg(kernelCalculateGradientDelta, 0, Sizeof.cl_mem, Pointer.to(clmMatrixPriorDelta));\r\n clSetKernelArg(kernelCalculateGradientDelta, 1, Sizeof.cl_mem, \r\n clmVectorY != null ? Pointer.to(clmVectorY) : Pointer.to(clmNullDummy));\r\n clSetKernelArg(kernelCalculateGradientDelta, 2, Sizeof.cl_mem, Pointer.to(clmMatrixTheta));\r\n clSetKernelArg(kernelCalculateGradientDelta, 3, Sizeof.cl_mem, Pointer.to(clmMatrixA));\r\n clSetKernelArg(kernelCalculateGradientDelta, 4, Sizeof.cl_mem, Pointer.to(clmMatrixResultDelta));\r\n clSetKernelArg(kernelCalculateGradientDelta, 5, Sizeof.cl_int, Pointer.to(new int[] {priorDeltaWidth}));\r\n clSetKernelArg(kernelCalculateGradientDelta, 6, Sizeof.cl_int, \r\n Pointer.to(new int[] {clmVectorY != null ? 1 : 0}));\r\n\r\n long globalThreads[] = new long[] {numOfSamples, resultDeltaWidth};\r\n clEnqueueNDRangeKernel(commandQueue, kernelCalculateGradientDelta, \r\n 2, null, globalThreads, null, 0, null, null);\r\n }", "@Override\r\n\tpublic FloatMat gradient() { return this.gradient; }", "private void plotLineClippedBits(int[] shades1, boolean tScreened1,\n int[] shades2, boolean tScreened2,\n int shadeIndex, int x, int y, int z, int dx,\n int dy, int dz, int run, int rise) {\n int[] zbuf = g3d.zbuf;\n int width = g3d.width;\n int runIndex = 0;\n if (run == 0) {\n rise = Integer.MAX_VALUE;\n run = 1;\n }\n int shadeIndexUp = (shadeIndex < Shader.shadeIndexLast ? shadeIndex + 1\n : shadeIndex);\n int shadeIndexDn = (shadeIndex > 0 ? shadeIndex - 1 : shadeIndex);\n int argb1 = shades1[shadeIndex];\n int argb1Up = shades1[shadeIndexUp];\n int argb1Dn = shades1[shadeIndexDn];\n int argb2 = shades2[shadeIndex];\n int argb2Up = shades2[shadeIndexUp];\n int argb2Dn = shades2[shadeIndexDn];\n boolean tScreened = tScreened1;\n boolean flipflop = (((x ^ y) & 1) != 0);\n int offset = y * width + x;\n int offsetMax = g3d.bufferSize;\n int i0, iMid, i1, i2, iIncrement, xIncrement, yIncrement;\n float zIncrement;\n if (lineTypeX) {\n i0 = x;\n i1 = x1t;\n i2 = x2t;\n iMid = x + dx / 2;\n iIncrement = (dx >= 0 ? 1 : -1);\n xIncrement = iIncrement;\n yIncrement = (dy >= 0 ? width : -width);\n zIncrement = (float)dz/(float)Math.abs(dx);\n } else {\n i0 = y;\n i1 = y1t;\n i2 = y2t;\n iMid = y + dy / 2;\n iIncrement = (dy >= 0 ? 1 : -1);\n xIncrement = (dy >= 0 ? width : -width);\n yIncrement = (dx >= 0 ? 1 : -1);\n zIncrement = (float)dz/(float)Math.abs(dy);\n }\n //System.out.println(lineTypeX+\" dx dy dz \" + dx + \" \" + dy + \" \" + dz);\n float zFloat = z;\n int argb = argb1;\n int argbUp = argb1Up;\n int argbDn = argb1Dn;\n boolean isInWindow = false;\n\n // \"x\" is not necessarily the x-axis.\n \n // x----x1t-----------x2t---x2\n // ------------xMid-----------\n //0-|------------------>-----------w\n\n // or\n \n // x2---x2t-----------x1t----x\n // ------------xMid----------- \n //0-------<-------------------|----w\n \n for (int i = i0, iBits = i0;; i += iIncrement, iBits += iIncrement) {\n if (i == i1)\n isInWindow = true;\n if (i == iMid) {\n argb = argb2;\n if (argb == 0)\n return;\n argbUp = argb2Up;\n argbDn = argb2Dn;\n tScreened = tScreened2;\n if (tScreened && !tScreened1) {\n int yT = offset / width;\n int xT = offset % width;\n flipflop = ((xT ^ yT) & 1) == 0;\n }\n }\n //if(test > 0)System.out.println(isInWindow + \" i1=\"+ i1 + \" i0=\" + i0 + \" i=\" + i + \" offset=\"+offset );\n if (argb != 0 && isInWindow && offset >= 0 && offset < offsetMax \n && runIndex < rise && (!tScreened || (flipflop = !flipflop))) {\n if (zFloat < zbuf[offset]) {\n int rand8 = shader.nextRandom8Bit();\n g3d.addPixel(offset, (int) zFloat, rand8 < 85 ? argbDn : (rand8 > 170 ? argbUp : argb));\n }\n }\n if (i == i2)\n break;\n runIndex = (runIndex + 1) % run;\n offset += xIncrement;\n while (iBits < 0)\n iBits += nBits;\n if (lineBits.get(iBits % nBits))\n offset += yIncrement;\n zFloat += zIncrement;\n //System.out.println(\"x y z \"+offset+\" \"+zFloat+ \" \"+xIncrement+\" \"+yIncrement+\" \"+zIncrement);\n }\n }", "public void Dasherline(long x0, long y0, long x1, long y1, int iWidth, int iColour) {\r\n\t\ttemp1.init(x0,y0);\r\n\t\tDasher2Screen(temp1);\r\n\t\t\r\n\t\ttemp2.init(x1,y1);\r\n\t\tDasher2Screen(temp2);\r\n\t\tScreen().drawLine((int)temp1.x, (int)temp1.y, (int)temp2.x, (int)temp2.y, iWidth, iColour);\r\n\t}", "public void rasterizeLine (int x0, int y0, int x1, int y1)\n {\n \tfloat dX = (x1 - x0);\n \tfloat dY = (y1 - y0);\n \tfloat m = (dY / dX);\t//slope\n \tint x = x0;\n \tfloat y = y0;\n \t\n \twhile(x < x1)\n \t{\n \t\traster.setPixel(x, Math.round(y), new int[]{255, 50, 100});\n \t\tx += 1;\n \t\ty += m;\n \t}\n }", "private void lineColor() {\n\n\t}", "public static void gradientCheck(){\n\t\tList<Integer> context = Arrays.asList(1, 2, 3);\n\t\tInteger nextWord = 5;\n\t\tNetwork network = new Network(4, 20, 30, 40);\n\t\t\n\t\tdouble epsilon = 0.0001;\n\t\tdouble alpha = 0.1;\n\t\t\n\t\tint i = 1, j = 12;\n\t\tdouble originalValue = network.E.get(i).get(j, 0);\n\t\t\n\t\tnetwork.E.get(i).put(j, 0, originalValue + epsilon);\n\t\tnetwork.feedForward(context, nextWord);\n\t\tdouble loss1 = -1.0 * Math.log(network.output.get(nextWord, 0));\n\t\t\n\t\tnetwork.E.get(i).put(j, 0, originalValue - epsilon);\n\t\tnetwork.feedForward(context, nextWord);\n\t\tdouble loss2 = -1.0 * Math.log(network.output.get(nextWord, 0));\n\t\t\n\t\tdouble derivative1 = (loss1 - loss2)/(2.0 * epsilon);\n\t\tSystem.out.println(\"Derivative1: \" + derivative1);\n\t\t\n\t\tnetwork.E.get(i).put(j, 0, originalValue);\n\t\tnetwork.feedForward(context, nextWord);\n\t\tnetwork.backProp(context, nextWord, alpha);\n\t\tdouble derivative2 = (network.E.get(i).get(j, 0) - originalValue) / (-1.0 * alpha);\n\t\tSystem.out.println(\"Derivative2: \" + derivative2);\n\t\t\n\t\tif(Math.abs(derivative1 - derivative2) < 0.00001)\n\t\t\tSystem.out.println(\"Gradient check: PASS\");\n\t\telse\n\t\t\tSystem.out.println(\"Gradient check: FAIL\");\n\t}", "public double slope(){\n double x = getStart().getXco();\n double x1 = end.getXco();\n double y = getStart().getYco();\n double y1 = end.getYco();\n double num = y1 - y;\n double den = x1 -x;\n\n return num/den;\n }", "@Override\n\tpublic double[] getDx() {\n\t double object[] = new double[2];\n\t for(int i = 0; i < x.length; i++){\n\t object[0] += theta[0] + theta[1] * x[i] - y[i];\n\t object[1] += (theta[0] + theta[1] * x[i] - y[i])*x[i];\n\t }\n\t theta[0] -= eta * object[0];\n\t theta[1] -= eta * object[1];\n\n\t return theta;\n }", "private double[] calculateTargetCurvatures(Position[] smoothedPath) {\n double[] curvatureArray = new double[smoothedPath.length];\n\n // sets the curvatures at the first and last point to 0\n curvatureArray[0] = 0;\n curvatureArray[smoothedPath.length - 1] = 0;\n\n // loops through the array to calculate the curvatures\n for (int i = 1; i < (smoothedPath.length - 2); i++) {\n\n // calculates the coordinates of the points directly ahead and behind point i\n double x1 = smoothedPath[i].getX() + 0.0001;\n double y1 = smoothedPath[i].getY();\n\n double x2 = smoothedPath[i - 1].getX();\n double y2 = smoothedPath[i - 1].getY();\n\n double x3 = smoothedPath[i + 1].getX();\n double y3 = smoothedPath[i + 1].getY();\n\n // calculates the curvatures and returns the array\n double k1 = 0.5 * (Math.pow(x1, 2) + Math.pow(y1, 2) - Math.pow(x2, 2) - Math.pow(y2, 2)) / (x1 - x2);\n double k2 = (y1 - y2) / (x1 - x2);\n\n double b = 0.5 * (Math.pow(x2, 2) - 2 * x2 * k1 + Math.pow(y2, 2) - Math.pow(x3, 2) + 2 * x3 * k1 - Math.pow(y3, 2)) / (x3 * k2 - y3 + y2 - x2 * k2);\n double a = k1 - k2 * b;\n\n double r = Math.sqrt(Math.pow(x1 - a, 2) + (Math.pow(y1 - b, 2)));\n double curvature = 0.0;\n if (!Double.isNaN(r)) {\n curvature = 1 / r;\n }\n curvatureArray[i] = curvature;\n }\n return curvatureArray;\n }", "private static synchronized double calc_deltaT(double tjd) {\n\t\tdouble ans = 0;\n\t\tdouble B, Y, Ygreg, dd;\n\t\tint iy;\n\t\tint deltat_model = sw.swed.astro_models[SweConst.SE_MODEL_DELTAT];\n\t\tif (deltat_model == 0)\n\t\t\tdeltat_model = SweConst.SEMOD_DELTAT_DEFAULT;\n\t\t/* read additional values from swedelta.txt */\n\t\t/* AS_BOOL use_espenak_meeus = DELTAT_ESPENAK_MEEUS_2006; */\n\t\tY = 2000.0 + (tjd - SwephData.J2000) / 365.25;\n\t\tYgreg = 2000.0 + (tjd - SwephData.J2000) / 365.2425;\n\t\t/*\n\t\t * Before 1633 AD, if the macro DELTAT_ESPENAK_MEEUS_2006 is TRUE:\n\t\t * Polynomials by Espenak & Meeus 2006, derived from Stephenson &\n\t\t * Morrison 2004. Note, Espenak & Meeus use their formulae only from\n\t\t * 2000 BC on. However, they use the long-term formula of Morrison &\n\t\t * Stephenson, which can be used even for the remoter past.\n\t\t */\n\t\t/* if (use_espenak_meeus && tjd < 2317746.13090277789) { */\n\t\tif (deltat_model == SweConst.SEMOD_DELTAT_ESPENAK_MEEUS_2006 && tjd < 2317746.13090277789) {\n\t\t\treturn deltat_espenak_meeus_1620(tjd);\n\t\t}\n\t\t/*\n\t\t * If the macro DELTAT_ESPENAK_MEEUS_2006 is FALSE: Before 1620, we\n\t\t * follow Stephenson & Morrsion 2004. For the tabulated values 1000 BC\n\t\t * through 1600 AD, we use linear interpolation.\n\t\t */\n\t\tif (Y < TABSTART) {\n\t\t\tif (Y < TAB2_END) {\n\t\t\t\treturn deltat_stephenson_morrison_1600(tjd);\n\t\t\t} else {\n\t\t\t\t/*\n\t\t\t\t * between 1600 and 1620: linear interpolation between end of\n\t\t\t\t * table dt2 and start of table dt\n\t\t\t\t */\n\t\t\t\tif (Y >= TAB2_END) {\n\t\t\t\t\tB = TABSTART - TAB2_END;\n\t\t\t\t\tiy = (TAB2_END - TAB2_START) / TAB2_STEP;\n\t\t\t\t\tdd = (Y - TAB2_END) / B;\n\t\t\t\t\t/* ans = dt2[iy] + dd * (dt[0] / 100.0 - dt2[iy]); */\n\t\t\t\t\tans = dt2[iy] + dd * (dt[0] - dt2[iy]);\n\t\t\t\t\tans = adjust_for_tidacc(ans, Ygreg);\n\t\t\t\t\treturn ans / 86400.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * 1620 - today + a few years (tabend): Besselian interpolation from\n\t\t * tabulated values in table dt. See AA page K11.\n\t\t */\n\t\tif (Y >= TABSTART) {\n\t\t\treturn deltat_aa(tjd);\n\t\t}\n\t\treturn ans / 86400.0;\n\t}", "public void drawLine(double x0, double y0, double x1, double y1, int red, int green, int blue){\n\t\tif( x0 > x1 ) {\n\t\t\tdouble xt = x0 ; x0 = x1 ; x1 = xt ;\n\t\t\tdouble yt = y0 ; y0 = y1 ; y1 = yt ;\n\t\t}\n\t\t\n\t\tdouble a = y1-y0;\n\t\tdouble b = -(x1-x0);\n\t\tdouble c = x1*y0 - x0*y1;\n\n\t\t\tif(y0<y1){ // Octant 1 or 2\n\t\t\t\tif( (y1-y0) <= (x1-x0) ) { //Octant 1\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Calculate initial x and initial y\n\t\t\t\t\tint x = (int)Math.round(x0);\n\t\t\t\t\tint y = (int)Math.round((-a*x-c)/b);\n\t\t\t\t\t\n\t\t\t\t\tdouble d = a*(x+1) + b*(y+0.5) + c;\n\t\t\t\t\t\n\t\t\t\t\t// Do we need to go E or SE\n\t\t\t\t\twhile(x<=Math.round(x1)){\n\t\t\t\t\t\tRenderer.setPixel(x, y, red, green, blue);\n\t\t\t\t\t\tif(d<0){\n\t\t\t\t\t\t\td = d+a;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\td = d+a+b;\n\t\t\t\t\t\t\ty = y+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx = x+1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else { // Octant 2\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Calculate initial x and initial y\n\t\t\t\t\tint y = (int)Math.round(y0);\n\t\t\t\t\tint x = (int)Math.round((-b*y-c)/a);\n\t\t\t\n\t\t\t\t\tdouble d = a*(x+0.5) + b*(y+1) + c;\n\t\t\t\t\t\n\t\t\t\t\t// Do we need to go SE or S\t\t\t\t\t\n\t\t\t\t\twhile(y<=Math.round(y1)){\n\t\t\t\t\t\tRenderer.setPixel(x, y, red, green, blue);\n\t\t\t\t\t\tif(d>0){\n\t\t\t\t\t\t\td = d+b; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\td = d+a+b;\n\t\t\t\t\t\t\tx = x+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ty = y+1;\n\t\t\t\t\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} else { // Octant 7 or 8\n\t\t\t\tif( (y0-y1) <= (x1-x0) ) { // Octant 8\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tint x = (int)Math.round(x0);\n\t\t\t\t\tint y = (int)Math.round((-a*x-c)/b);\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tdouble d = a*(x+1) + b*(y-0.5) + c;\n\t\t\t\t\t\n\t\t\t\t\t// Do we need to go E or NE\t\t\t\t\t\n\t\t\t\t\twhile(x<=Math.round(x1)){\n\t\t\t\t\t\tRenderer.setPixel(x, y, red, green, blue);\n\t\t\t\t\t\tif(d>0){ \n\t\t\t\t\t\t\td = d+a;\n\t\t\t\t\t\t} else { \n\t\t\t\t\t\t\td = d+a-b;\n\t\t\t\t\t\t\ty = y-1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx = x+1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else { //Octant 7\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tint y = (int)Math.round(y0);\n\t\t\t\t\tint x = (int)Math.round((-b*y-c)/a);\n\t\t\t\t\t\n\t\t\t\t\tdouble d = a*(x+0.5) + b*(y-1) + c;\n\t\t\t\t\t\n\t\t\t\t\t// Do we need to go NE or N\n\t\t\t\t\twhile(y>=Math.round(y1)){\n\t\t\t\t\t\tRenderer.setPixel(x, y, red, green, blue);\n\t\t\t\t\t\tif(d<0){\n\t\t\t\t\t\t\td = d-b; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\td = d+a-b;\n\t\t\t\t\t\t\tx = x+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ty = y-1;\n\t\t\t\t\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}", "public LineaAbstract() {\n super();\n this.ColorRelleno=Color.BLACK;\n ColorRelleno=null;\n this.width=1.0F;\n isRelleno=false;\n isContinuo=true;\n isGradiente=false;\n }", "private LineData generateDataLine(int cnt, String name, ArrayList<Double> mainEmotion) {\n\n ArrayList<Entry> values1 = new ArrayList<>();\n\n //int[] val = {(int) happinessr, (int) sadnessr, (int) surpriser, (int) fearr, (int) neutralr, (int) contemptr, (int) angerr, (int) disgustr};\n\n for (int i = 0; i < mainEmotion.size(); i++) {\n values1.add(new Entry(i, mainEmotion.get(i).intValue()));\n }\n\n LineDataSet d1 = new LineDataSet(values1, name);\n d1.setLineWidth(2.5f);\n d1.setCircleRadius(4.5f);\n //Toast.makeText(getContext().getApplicationContext(), name, Toast.LENGTH_LONG).show();\n\n switch (name) {\n case \"Happiness\":\n d1.setColor(Color.rgb(189, 237, 255));\n d1.setCircleColors(Color.rgb(189, 237, 255));\n break;\n case \"Sadness\":\n d1.setColor(Color.rgb(74, 88, 176));\n d1.setCircleColors(Color.rgb(74, 88, 176));\n break;\n case \"Contempt\":\n d1.setColor(Color.rgb(242, 5, 92));\n d1.setCircleColors(Color.rgb(242, 5, 92));\n break;\n case \"Disgust\":\n d1.setColor(Color.rgb(79, 139, 62));\n d1.setCircleColors(Color.rgb(79, 139, 62));\n break;\n case \"Fear\":\n d1.setColor(Color.rgb(89, 72, 122));\n d1.setCircleColors(Color.rgb(89, 72, 122));\n break;\n case \"Surprise\":\n d1.setColor(Color.rgb(205, 185, 39));\n d1.setCircleColors(Color.rgb(205, 185, 39));\n break;\n case \"Anger\":\n d1.setColor(Color.rgb(189, 73, 84));\n d1.setCircleColors(Color.rgb(189, 73, 84));\n break;\n case \"Neutral\":\n d1.setColor(Color.rgb(220, 235, 221));\n d1.setCircleColors(Color.rgb(220, 235, 221));\n break;\n default:\n break;\n\n }\n\n d1.setHighLightColor(Color.rgb(255, 0, 0));\n d1.setDrawValues(false);\n\n ArrayList<Entry> values2 = new ArrayList<>();\n\n for (int i = 0; i < mainEmotion.size(); i++) {\n values2.add(new Entry(i, values1.get(i).getY() - 30));\n }\n\n ArrayList<ILineDataSet> sets = new ArrayList<>();\n sets.add(d1);\n //sets.add(d2);\n\n return new LineData(sets);\n }", "public void gweekday()\n{\n float dat1;\n float dat2;\n float dat3;\n float dat4;\n int ji = floor(runtimes/1200);\n if (ji >= 0 && ji < 24)\n {\n for (int jj = 0; jj < 7; jj++)\n {\n if (ji == 23)\n {\n if (jj == 6)\n {\n dat1 = Float.parseFloat(data2[ji][jj]);\n dat2 = Float.parseFloat(data2[0][jj]);\n dat3 = Float.parseFloat(data2[ji][0]);\n dat4 = Float.parseFloat(data2[0][0]);\n } else\n {\n dat1 = Float.parseFloat(data2[ji][jj]);\n dat2 = Float.parseFloat(data2[0][jj]);\n dat3 = Float.parseFloat(data2[ji][jj+1]);\n dat4 = Float.parseFloat(data2[0][jj+1]);\n }\n } else\n {\n if (jj == 6)\n {\n dat1 = Float.parseFloat(data2[ji][jj]);\n dat2 = Float.parseFloat(data2[ji+1][jj]);\n dat3 = Float.parseFloat(data2[ji][0]);\n dat4 = Float.parseFloat(data2[ji+1][0]);\n } else\n {\n dat1 = Float.parseFloat(data2[ji][jj]);\n dat2 = Float.parseFloat(data2[ji+1][jj]);\n dat3 = Float.parseFloat(data2[ji][jj+1]);\n dat4 = Float.parseFloat(data2[ji+1][jj+1]);\n }\n }\n\n float offset1 = (dat2 - dat1)/(1200/speed); //100 speed\n float offset2 = (dat4 - dat3)/(1200/speed); //100 speed\n int i = (runtimes % 1200)/speed; //100 speed\n triangle(w2, h2, w2+cos((jj+1)*TWO_PI/7)*radiu*((dat1+offset1*i)/67), h2+sin((jj+1)*TWO_PI/7)*radiu*((dat1+offset1*i)/67), w2+cos((jj+2)*TWO_PI/7)*radiu*((dat3+offset2*i)/67), h2+sin((jj+2)*TWO_PI/7)*radiu*((dat3+offset2*i)/67));\n }\n }\n}", "private float getD(int[] yt){\n\t\tfloat temp = 0;\n\t\tfor(int i=0;i<=3;i++){\n\t\t\ttemp += yt[i] - getYmin(yt);\n\t\t}\n\t\treturn (temp/3);\n\t}", "private Double calculateLGD(List<LossGivenDefault> lgds) {\r\n\t\t\r\n\t\tfor (LossGivenDefault lgd: lgds) {\r\n\t\t\treturn lgd.getLoss(); \r\n\t\t}\r\n\t\t\r\n\t\t// TODO Warn lgdDate beyond end of lgd curve\r\n\t\treturn 0d;\r\n\t}", "private ArrayList<Vector2f> drawRasterLine(Graphics g, Vector2f p0, Vector2f p1) {\r\n g.setColor(Color.BLUE);\r\n // Storage for drawn points\r\n ArrayList<Vector2f> vertices = new ArrayList<>();\r\n // Get pixels on the canvas\r\n int x0 = (int) world2Pixel(p0).x;\r\n int y0 = (int) world2Pixel(p0).y;\r\n int x1 = (int) world2Pixel(p1).x;\r\n int y1 = (int) world2Pixel(p1).y;\r\n // Delta x\r\n float dx = Math.abs(x1 - x0);\r\n // Step for x-value\r\n int sx = x0 < x1 ? 1 : -1;\r\n // Delta y\r\n float dy = -Math.abs(y1 - y0);\r\n // Step for y-value\r\n int sy = y0 < y1 ? 1 : -1;\r\n // Error values to determine with step to take\r\n float err = dx + dy, e2;\r\n // Loop until algorithm has finished\r\n while(true) {\r\n // Draw point on current coordinates\r\n g.drawArc(x0, y0, 1, 1, 0, 360);\r\n // Add point to drawn points list\r\n vertices.add(new Vector2f(x0, y0));\r\n // Loop condition\r\n if (x0==x1 && y0==y1) break;\r\n // Check which step to take for next point to draw\r\n e2 = 2 * err;\r\n if (e2 > dy) {\r\n err += dy;\r\n x0 += sx;\r\n }\r\n if (e2 < dx) {\r\n err += dx;\r\n y0 += sy;\r\n }\r\n }\r\n // Return all drawn points\r\n return vertices;\r\n }", "private double getSlope( double time )\n throws IllegalArgumentException\n {\n // TODO: Optimize this search by having data set sorted by time\n \n // Search for previously calculated - and saved - slope value\n String timeVariable = getTimeVariable();\n Iterator<DataPoint> it = slopeValues.iterator();\n while ( it.hasNext() )\n {\n DataPoint dp = it.next();\n double dpTimeValue = dp.getIndependentValue( timeVariable );\n if ( Math.abs(time-dpTimeValue) < TOLERANCE )\n return dp.getDependentValue();\n }\n \n // Saved slope not found, so calculate it\n // (and save it for future reference)\n double previousTime = time - getTimeInterval();\n double slope = 0.0;\n \n // Initial condition for first periods\n if ( previousTime < getMinimumTimeValue()+TOLERANCE )\n slope = getObservedValue(time)-getObservedValue(previousTime);\n else\n slope\n = gamma*(forecast(time)-forecast(previousTime))\n + (1-gamma)*getSlope(previousTime);\n \n DataPoint dp = new Observation( slope );\n dp.setIndependentValue( timeVariable, time );\n slopeValues.add( dp );\n \n return slope;\n }", "public double energy(int x, int y) {\n Color upper = picture.get(x, (y - 1 + this.height()) % this.height());\n Color lower = picture.get(x, (y + 1 + this.height()) % this.height());\n Color left = picture.get((x - 1 + this.width()) % this.width(), y);\n Color right = picture.get((x + 1 + this.width()) % this.width(), y);\n return getGradient(upper, lower) + getGradient(left, right);\n }", "public double energy(int x, int y) {\n if (x >= current.width() || x < 0 || y >= current.height() || y < 0)\n throw new IndexOutOfBoundsException(String.format(\n \"Pixel (%d, %d) out of bounds\", x, y));\n if (x == 0 || y == 0 || x == current.width() - 1\n || y == current.height() - 1)\n return 195075;\n\n Color topPixel = current.get(x - 1, y);\n Color bottomPixel = current.get(x + 1, y);\n Color leftPixel = current.get(x, y - 1);\n Color rightPixel = current.get(x, y + 1);\n\n return dualGradientEnergy(topPixel, bottomPixel)\n + dualGradientEnergy(leftPixel, rightPixel);\n\n }", "public Paint getTransportLineColor()\r\n {\r\n return line_color;\r\n }", "public void initColorGradients(GeneExpressionMatrix expression) {\r\n\r\n\t\tminExpression_ds1 = expression.getMinExpression();\r\n\t\tmaxExpression_ds1 = expression.getMaxExpression();\r\n\t\tclosestToZeroExpression_ds1 = expression.getClosesttoZero();\r\n\t\tminExpression_rownorm_ds1 = expression.getMinExpression(expression.getExpressionMatrix_rowNormalized());\r\n\t\tmaxExpression_rownorm_ds1 = expression.getMaxExpression(expression.getExpressionMatrix_rowNormalized());\r\n\r\n\t\tdouble max = Math.max(Math.abs(minExpression_ds1), maxExpression_ds1);\r\n\r\n\t\tdouble median = 0;\r\n\r\n\t\t//if the minimum expression is above zero make it a one colour heatmap\r\n\t\tif(minExpression_ds1 >= 0) {\r\n\t\t\trange_ds1 = ColorGradientRange.getInstance(0, max / 2, max / 2, max, 0, max / 2, max / 2, max);\r\n\t\t\ttheme_ds1 = ColorGradientTheme.GREEN_ONECOLOR_GRADIENT_THEME;\r\n\t\t} else {\r\n\t\t\trange_ds1 = ColorGradientRange.getInstance(-max, median, median, max, -max, median, median, max);\r\n\t\t\ttheme_ds1 = ColorGradientTheme.GREEN_MAGENTA_GRADIENT_THEME;\r\n\t\t}\r\n\r\n\t}", "public float gradientMethod(Volume vol, int slice_num) \n\t{\n\t\t//\n\t\t// Get the right slice.\n\t\t//\n\t\tSlice slice = vol.getSlice(slice_num);\n\n\t\treturn gradientMethod(slice);\n\t}", "private float[] dynamicAccDiff(float[] acc, float[] gyr,float[] gravity, float[] oldAcc, float[] oldGyr)\n {\n float[] dynAccDiff = new float[]{0.0f, 0.0f, 0.0f};\n float[] accDiff = accDiff(oldAcc, acc);\n float[] gyrDiff = gyrDiff(oldGyr, gyr);\n float[] graDiff = graDiff(gravity, gyrDiff);\n\n for (int i = 0; i < 3; i++)\n {\n dynAccDiff[i] = accDiff[i]-graDiff[i];\n }\n\n return dynAccDiff;\n\n }", "void lineTestPattern2()\n\t{\n\t float theta,d_theta,d_petal,petal,radius,p;\n\t int cx,cy;\n\t int i;\n\t int n_steps =( Nsteps == 18 )?64:4*Nsteps;\n\t Point2D v0 = new Point2D(),v1 = new Point2D();\n\n\t d_theta = (float)(2.0*Math.PI / n_steps);\n\t d_petal = (float)(12.0*Math.PI / n_steps);\n\n\t cx = buff.getWidth()/2;\n\t cy = buff.getHeight()/2;\n\n\t radius = (float) (0.75 * ((cx < cy) ? cx : cy));\n\t p = (float) (radius*0.25);\n\n\t /* draw the outer petals first */\n\n\t v0.x = cx;\n\t v0.y = (int)Math.floor(0.5 + radius + p) + cy;\n\t v0.c.r = 1;\n\t v0.c.g = (float) (128+Math.sin(2*Math.PI)*127.0)/255.0f;\n\t v0.c.b = (float) (128+Math.cos(2*Math.PI)*127.0)/255.0f;\n\n\t for(petal=d_petal,theta=d_theta,i=0;i<=n_steps;++i,theta+=d_theta,petal+=d_petal)\n\t {\n\t v1.x = (int)Math.floor(0.5 + radius*Math.sin(theta) + p*Math.sin(petal)) + cx;\n\t v1.y = (int)Math.floor(0.5 + radius*Math.cos(theta) + p*Math.cos(petal)) + cy;\n\n\t v1.c.r = 1;\n\t v1.c.g = (float) ((128+Math.sin(theta*5)*127.0)/255.0f);\n\t v1.c.b = (float) ((128+Math.cos(theta*5)*127.0)/255.0f);\n\t SketchBase.drawLine(buff,v0,v1);\n\n\t v0.x = v1.x;\n\t v0.y = v1.y;\n\t v0.c = v1.c;\n\t }\n\n\t /* draw circle at center */\n\t radius *= 0.5;\n\t v0.x = cx;\n\t v0.y = (int)Math.floor(0.5 + radius) + cy;\n\n\t /* color = orange */\n\t v1.c.r = v0.c.r = 1;\n\t v1.c.g = v0.c.g = 97.0f/255.0f;\n\t v1.c.b = v0.c.b = 0; \n\n\t for(theta=d_theta,i=0;i<=n_steps;++i,theta+=d_theta)\n\t {\n\t v1.x = (int)Math.floor(0.5 + radius*Math.sin(theta)) + cx;\n\t v1.y = (int)Math.floor(0.5 + radius*Math.cos(theta)) + cy;\n\n\t SketchBase.drawLine(buff,v0,v1);\n\n\t v0.x = v1.x;\n\t v0.y = v1.y;\n\t }\n\t}", "public void createPreviewGradients()\n {\n int i = 0;\n while (i < previews.length && previews[i] != null)\n {\n i++;\n }\n if (i==0)\n i++;\n int step = 255/i+1;\n int intensity = 255;\n\n for (int j = 0; j < i; j++)\n {\n int startIntensity = color(intensity-j*step);\n int endIntensity;\n if(intensity-(j+1)*step > 0)\n endIntensity = color(intensity-(j+1)*step);\n else\n endIntensity = color(0);\n previewGradients[j] = createImage(2, 1, RGB);\n previewGradients[j].pixels[0] = startIntensity;\n previewGradients[j].pixels[1] = endIntensity;\n previewGradients[j].resize(100, 10);\n tiles[j].setStartColor(startIntensity);\n tiles[j].setEndColor(endIntensity);\n }\n }", "private List< PlotData > valueOfDesireAlongLine( final Line line, final int which_one_my_master )\n\t{\n\t\tfinal Img< UnsignedShortType > img = ImagePlusAdapter.wrap( imgPlus );\n\t\tfinal Cursor< UnsignedShortType > cursor = img.cursor();\n\n\t\t// get 'line' as vector based at 0\n\t\tfinal double vec_x = line.x2 - line.x1;\n\t\tfinal double vec_y = line.y2 - line.y1;\n\t\t// direction of 'line' as normalized vecter at 0\n\t\tfinal Vector2D vec_line_direction = new Vector2D( vec_x, vec_y );\n\n\t\tfinal int frames = imgPlus.getDimensions()[ 4 ]; // 4 happens to be the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// time-dimension...\n\t\tfinal List< PlotData > summed_intensities = new ArrayList< PlotData >();\n\t\tfinal List< PlotData > volume = new ArrayList< PlotData >();\n\t\tfinal List< PlotData > concentrations = new ArrayList< PlotData >();\n\n\t\tfor ( int i = 0; i < frames; i++ )\n\t\t{\n\t\t\tsummed_intensities.add( new PlotData( ( int ) Math.floor( line.getLength() ) ) );\n\t\t\tvolume.add( new PlotData( ( int ) Math.floor( line.getLength() ) ) );\n\t\t\tconcentrations.add( new PlotData( ( int ) Math.floor( line.getLength() ) ) );\n\t\t}\n\n\t\tdouble pixel_value;\n\t\tfinal double voxel_depth = this.imgPlus.getCalibration().getZ( 1.0 );\n\t\twhile ( cursor.hasNext() )\n\t\t{\n\t\t\tpixel_value = 0.0;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tpixel_value = cursor.next().get();\n\t\t\t}\n\t\t\tcatch ( final ClassCastException e )\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t\tIJ.error( \"ClassCastException\", \"Please make source image 16bit!\" );\n\t\t\t}\n\t\t\tfinal double xpos = cursor.getIntPosition( 0 ) - line.x1;\n\t\t\tfinal double ypos = cursor.getIntPosition( 1 ) - line.y1;\n\t\t\t// final int zpos = cursor.getIntPosition( 2 );\n\t\t\tfinal int tpos = cursor.getIntPosition( 3 );\n\n\t\t\t// vector to current pixel\n\t\t\tfinal Vector2D vec_pos = new Vector2D( xpos, ypos );\n\n\t\t\t// compute projection onto line-ROI\n\t\t\tfinal Vector2D lineProjection = vec_line_direction.project( vec_pos );\n\t\t\tfinal double fractional_slice_num = lineProjection.getLength();\n\t\t\t// don't do anything in case voxel is below or above line\n\t\t\tif ( lineProjection.dot( vec_line_direction ) < 0 || fractional_slice_num > vec_line_direction.getLength() )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// add the shit\n\t\t\tif ( pixel_value > 0.0 )\n\t\t\t{\n\t\t\t\tsummed_intensities.get( tpos ).addValueToXValue( fractional_slice_num, pixel_value );\n\t\t\t\tvolume.get( tpos ).addValueToXValue( fractional_slice_num, voxel_depth );\n\t\t\t}\n\t\t}\n\n\t\t// compute concentrations (iterate over summed intensities and divide by\n\t\t// volume)\n\t\tfor ( int t = 0; t < summed_intensities.size(); t++ )\n\t\t{\n\t\t\tfor ( int i = 0; i < summed_intensities.get( t ).getXData().length; i++ )\n\t\t\t{\n\t\t\t\tdouble concentration = summed_intensities.get( t ).getYData()[ i ] / volume.get( t ).getYData()[ i ];\n\t\t\t\tif ( Double.isNaN( concentration ) )\n\t\t\t\t\tconcentration = 0.0;\n\t\t\t\tconcentrations.get( t ).addValueToXValue( summed_intensities.get( t ).getXData()[ i ], concentration );\n\t\t\t}\n\t\t}\n\n\t\tif ( which_one_my_master == WISH_CONCENTRATION )\n\t\t{\n\t\t\treturn concentrations;\n\t\t}\n\t\telse if ( which_one_my_master == WISH_SUM_INTENSITIES )\n\t\t{\n\t\t\treturn summed_intensities;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn volume;\n\t\t}\n\t}", "public LineStrip2D(float... values) {\n if (values.length % 2 != 0)\n throw new IllegalArgumentException(\"Odd number of arguments\");\n List<Point2D> points = new ArrayList<Point2D>();\n for (int i = 0; i < values.length / 2; i++) {\n points.add(new Point2D(values[2*i], values[2*i + 1]));\n }\n this.points = points;\n }", "public VoxelGradient getGradient(double[] coord) {\r\n\r\n //if improper coordinates given, return\r\n if (coord[0] < 0 || coord[0] > (dimX - 2) || coord[1] < 0 || coord[1] > (dimY - 2) || coord[2] < 0 || coord[2] > (dimZ - 2)) {\r\n return zero;\r\n }\r\n\r\n /* notice that in this framework we assume that the distance between neighbouring voxels is 1 in all directions*/\r\n float x = (float) coord[0];\r\n float y = (float) coord[1];\r\n float z = (float) coord[2];\r\n\r\n int x0 = (int) Math.floor(coord[0]);\r\n int y0 = (int) Math.floor(coord[1]);\r\n int z0 = (int) Math.floor(coord[2]);\r\n int x1 = (int) Math.ceil(coord[0]);\r\n int y1 = (int) Math.ceil(coord[1]);\r\n int z1 = (int) Math.ceil(coord[2]);\r\n\r\n float xfactor = (x - x0) / (x1 - x0);\r\n float yfactor = (y - y0) / (y1 - y0);\r\n float zfactor = (z - z0) / (z1 - z0);\r\n\r\n //defining 8 voxel gradiant data-points of a voxel\r\n VoxelGradient c000 = new VoxelGradient(x0, y0, z0);\r\n VoxelGradient c001 = new VoxelGradient(x0, y0, z1);\r\n VoxelGradient c010 = new VoxelGradient(x0, y1, z0);\r\n VoxelGradient c011 = new VoxelGradient(x0, y1, z1);\r\n VoxelGradient c100 = new VoxelGradient(x1, y0, z0);\r\n VoxelGradient c101 = new VoxelGradient(x1, y0, z1);\r\n VoxelGradient c110 = new VoxelGradient(x1, y1, z0);\r\n VoxelGradient c111 = new VoxelGradient(x1, y1, z1);\r\n\r\n //7 linear interpolations\r\n //4 in x direction\r\n VoxelGradient c00 = new VoxelGradient();\r\n VoxelGradient c01 = new VoxelGradient();\r\n VoxelGradient c10 = new VoxelGradient();\r\n VoxelGradient c11 = new VoxelGradient();\r\n interpolate(c000, c100, xfactor, c00);\r\n interpolate(c001, c101, xfactor, c01);\r\n interpolate(c010, c110, xfactor, c10);\r\n interpolate(c011, c111, xfactor, c11);\r\n //2 in y direction\r\n VoxelGradient c0 = new VoxelGradient();\r\n VoxelGradient c1 = new VoxelGradient();\r\n interpolate(c00, c10, yfactor, c0);\r\n interpolate(c01, c11, yfactor, c1);\r\n //1 in z direction\r\n VoxelGradient c = new VoxelGradient();\r\n interpolate(c0, c1, zfactor, c);\r\n\r\n return c;\r\n }", "@Override\n\tpublic void computeDerivatives(final double time, final double[] y, final double[] ydot)\n\t\tthrows MaxCountExceededException, DimensionMismatchException {\n\n\t\tassignValue(time, y);\n\n\t\t/*\n\t\t * with variables assigned, calcul new value of expression in function\n\t\t * loop through equations (internal and external) to get singleequation\n\t\t * value\n\t\t */\n\n\t\t// TODO Should be rewritten in a more correct way : scope.execute(s,\n\t\t// agent)...\n\t\tList<SingleEquationStatement> equationValues = new ArrayList(equations.values());\n\t\tfor ( int i = 0, n = getDimension(); i < n; i++ ) {\n\n\t\t\tboolean pushed = false;\n\t\t\tif ( equaAgents.size() > 0 ) {\n\t\t\t\tpushed = currentScope.push(equaAgents.get(i));\n\t\t\t}\n\t\t\ttry {\n\t\t\t\t// AD: Does equationValues.get(i) return the correct equation ? The loop is bounded by getDimension()...\n\t\t\t\tydot[i] = Cast.asFloat(currentScope, equationValues.get(i).executeOn(currentScope));\n\t\t\t} catch (final Exception ex1) {\n\t\t\t\tGuiUtils.debug(ex1);\n\t\t\t} finally {\n\t\t\t\tif ( equaAgents.size() > 0 ) {\n\t\t\t\t\tif ( pushed ) {\n\t\t\t\t\t\tcurrentScope.pop(equaAgents.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "private void finaliseRadialGradient() {\n\n\t\tif (currentGradient.stopColours.size() > 0) {\n\n\t\t\tfinal int[] ia = new int[currentGradient.stopColours.size()];\n\n\t\t\tfor (int i = 0; i < ia.length; i++) {\n\t\t\t\tia[i] = currentGradient.stopColours.get(i);\n\t\t\t}\n\n\t\t\tcurrentGradient.shader = new RadialGradient(\n\t\t\t\t\tcurrentGradient.cx,\n\t\t\t\t\tcurrentGradient.cy,\n\t\t\t\t\tcurrentGradient.radius,\n\t\t\t\t\tia,\n\t\t\t\t\tnull,\n\t\t\t\t\tShader.TileMode.CLAMP\n\t\t\t\t\t);\n\n\t\t\t// The shader needs to have a matrix even if no transform was specified in the attributes\n\t\t\t// for the gradient. This is because the gradient's Matrix, even if 'empty', is needed\n\t\t\t// to concatenate the current cumulative transform to during evaluation/drawing.\n\t\t\tif (currentGradient.matrix != null) {\n\t\t\t\tcurrentGradient.shader.setLocalMatrix(currentGradient.matrix);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcurrentGradient.shader.setLocalMatrix(new Matrix());\n\t\t\t}\n\n\t\t}\n\n\t\tcurrentGradient.isRadial = true;\n\t\tgradientList.add(currentGradient);\n\t\tcurrentGradient = new Gradient();\n\n\t}", "public void setStrokeGradient(Gradient gradient);", "public void paintGradientNormalized(){\n\t\t\n\t\tint min = 99999;\n\t\tint max = 0;\n\t\t\n\t\tfor (int i=0; i < ranges.size(); i++){\n\t\t\tif ((ranges.elementAt(i).getMin()) < min){\n\t\t\t\tmin = ranges.elementAt(i).getMin();\n\t\t\t}\n\t\t\tif ((ranges.elementAt(i).getMax()) > max){\n\t\t\t\tmax = ranges.elementAt(i).getMax();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Once I've got them, the paint is simple, because Positioner.getAssociatedPosition() returns\n\t\t// the exact pixel where the color has to be painted\n\t\t\n\t\tPositioner positions = new Positioner(drawingPanel.getHeight(), min, max);\n\t\t\n\t\tint i = 1;\n\t\tBufferedImage img = new BufferedImage(drawingPanel.getWidth(), drawingPanel.getHeight(), BufferedImage.TYPE_INT_ARGB);\n\t\t\t\t\n\t\twhile (i < ranges.size()){\n\t\t\tpaintBufferedGradient(ranges.elementAt(ranges.size()-i).getColor(), ranges.elementAt(ranges.size()-i-1).getColor(), positions.getAssociatedPosition(ranges.elementAt(ranges.size()-i).getMax()) , positions.getAssociatedPosition(ranges.elementAt(ranges.size()-i).getMin()) , img);\n\t\t\ti++;\n\t\t}\n\t\tpaintBufferedGradient(ranges.elementAt(0).getColor(), ranges.elementAt(0).getColor(), positions.getAssociatedPosition(ranges.elementAt(0).getMax()), positions.getAssociatedPosition(ranges.elementAt(0).getMin()), img);\n\n\t\t\t\n\t\t\n\t\tdrawingPanel.getGraphics().drawImage(img, 0, 0, img.getWidth(), img.getHeight(), null);\n\t\t\n\t\t// Painting the ranges\n\t\t\n\t\trangesPanel.removeAll();\t\t\t// Clears rangePanel\n\t\t\n\t\tJLabel currentRange;\n\t\t\n\t\tcurrentRange = new JLabel(Integer.toString(ranges.elementAt(0).getMin()));\n\t\tcurrentRange.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\tcurrentRange.setBounds(35, rangesPanel.getHeight()-16, 60, 16);\n\t\t\n\t\t\n\t\trangesPanel.add(currentRange);\n\t\tint last = rangesPanel.getHeight()-16;\n\t\tint aux;\n\t\tfor (int j = 0; j < ranges.size(); j++){\n\t\t\taux = positions.getAssociatedPosition(ranges.elementAt(j).getMax());\n\t\t\tcurrentRange = new JLabel(Integer.toString(ranges.elementAt(j).getMax()));\n\t\t\tcurrentRange.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\t\tif (aux+16 < last){\n\t\t\t\tcurrentRange.setBounds(35, aux, 60, 16);\n\t\t\t\tlast = aux;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcurrentRange.setBounds(35, last-16, 60, 16);\n\t\t\t\tlast = last - 16;\n\t\t\t}\n\t\t\t\t\n\t\t\trangesPanel.add(currentRange);\n\t\t}\n\t\t\n\t\trangesPanel.repaint();\n\t}", "private float calculateRoadSlope(Point point1, Point point2) {\n float slopeSum = 0;\n int x1 = point1.getX();\n int y1 = point1.getY();\n int x2 = point2.getX();\n int y2 = point2.getY();\n pastSlopes.remove(0);\n pastSlopes.add((float) (y1 - y2) / (x1 - x2));\n\n // Average the slopes in pastSlopes\n for (Float slope : pastSlopes) {\n slopeSum += slope;\n }\n float slope = slopeSum / pastSlopes.size();\n return slope;\n }", "@Override\n protected void onDraw(Canvas canvas) {\n super.onDraw(canvas);\n\n for (int i = 0; i < value_degree.length; i++) {//values2.length; i++) {\n if (i == 0) {\n paint.setColor(COLORS[i]);\n canvas.drawArc(rectf, 0, value_degree[i], true, paint);\n \n } \n else\n {\n temp += value_degree[i - 1];\n paint.setColor(COLORS[i]);\n canvas.drawArc(rectf, temp, value_degree[i], true, paint);\n Log.i(\"sum\"+(temp+value_degree[i]), temp+\" : \"+value_degree[i]);\n\n }\n }\n }", "private void m217f() {\n RectF rectF = new RectF(-this.f407h, -this.f407h, this.f407h, this.f407h);\n RectF rectF2 = new RectF(rectF);\n rectF2.inset(-this.f411l, -this.f411l);\n if (this.f408i == null) {\n this.f408i = new Path();\n } else {\n this.f408i.reset();\n }\n this.f408i.setFillType(FillType.EVEN_ODD);\n this.f408i.moveTo(-this.f407h, 0.0f);\n this.f408i.rLineTo(-this.f411l, 0.0f);\n this.f408i.arcTo(rectF2, 180.0f, 90.0f, false);\n this.f408i.arcTo(rectF, 270.0f, -90.0f, false);\n this.f408i.close();\n float f = this.f407h / (this.f407h + this.f411l);\n Paint paint = this.f404e;\n RadialGradient radialGradient = new RadialGradient(0.0f, 0.0f, this.f407h + this.f411l, new int[]{this.f414o, this.f414o, this.f415p}, new float[]{0.0f, f, 1.0f}, TileMode.CLAMP);\n paint.setShader(radialGradient);\n Paint paint2 = this.f405f;\n LinearGradient linearGradient = new LinearGradient(0.0f, (-this.f407h) + this.f411l, 0.0f, (-this.f407h) - this.f411l, new int[]{this.f414o, this.f414o, this.f415p}, new float[]{0.0f, 0.5f, 1.0f}, TileMode.CLAMP);\n paint2.setShader(linearGradient);\n this.f405f.setAntiAlias(false);\n }", "public void drawLine(int x, int y, int x2, int y2, int color){\n int dy = y - y2;\n int dx = x - x2;\n int fraction, stepx, stepy;\n\n if(dy < 0){\n dy = -dy;\n stepy = -1;\n }else{\n stepy = 1;\n }\n if(dx < 0){\n dx = -dx;\n stepx = -1;\n }else{\n stepx = 1;\n }\n dy <<= 1;\n dx <<= 1;\n\n set(x, y, color);\n\n if(dx > dy){\n fraction = dy - (dx >> 1);\n while(x != x2){\n if(fraction >= 0){\n y += stepy;\n fraction -= dx;\n }\n x += stepx;\n fraction += dy;\n set(x, y, color);\n }\n }else{\n fraction = dx - (dy >> 1);\n while(y != y2){\n if(fraction >= 0){\n x += stepx;\n fraction -= dy;\n }\n y += stepy;\n fraction += dx;\n set(x, y, color);\n }\n }\n }", "private void completeHrefs() {\n\t\t// Process the gradients\n\t\tfinal Iterator<Gradient> gi = gradientList.iterator();\n\t\tGradient g;\n\t\tint idx;\n\t\twhile (gi.hasNext()) {\n\t\t\tg = gi.next();\n\t\t\tif (g.href != null) {\n\t\t\t\tidx = this.getGradientByIdString(g.href.substring(1));\n\t\t\t\tif (idx != -1) {\n\t\t\t\t\tfinal Gradient xlinkGrad = this.gradientList.get(idx);\n\t\t\t\t\tg.stopColours = xlinkGrad.stopColours;\n\n\t\t\t\t}\n\n\t\t\t\t// TODO: Can't we just insert an object reference to the same shader?\n\n\t\t\t\tfinal int[] ia = new int[g.stopColours.size()];\n\n\t\t\t\tfor (int i = 0; i < ia.length; i++) {\n\t\t\t\t\tia[i] = g.stopColours.get(i);\n\t\t\t\t}\n\n\t\t\t\tif (g.isRadial) {\n\t\t\t\t\tg.shader = new RadialGradient(\n\t\t\t\t\t\t\tg.cx,\n\t\t\t\t\t\t\tg.cy,\n\t\t\t\t\t\t\tg.radius,\n\t\t\t\t\t\t\tia,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tShader.TileMode.CLAMP\n\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse { // linear\n\t\t\t\t\tg.shader = new LinearGradient(\n\t\t\t\t\t\t\tg.x1,\n\t\t\t\t\t\t\tg.y1,\n\t\t\t\t\t\t\tg.x2,\n\t\t\t\t\t\t\tg.y2,\n\t\t\t\t\t\t\tia,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tShader.TileMode.CLAMP\n\t\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// The shader needs to have a matrix even if no transform was specified in the attributes\n\t\t\t\t// for the gradient. This is because the gradient's Matrix, even if 'empty', is needed\n\t\t\t\t// to concatenate the current cumulative transform to during evaluation/drawing.\n\t\t\t\tif (g.matrix != null) {\n\t\t\t\t\tg.shader.setLocalMatrix(g.matrix);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tg.shader.setLocalMatrix(new Matrix());\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public static double lineDelineation() \n {\n int nTries = 0; //the number of tries (landing both inside and outside the circle)\n int inCircle = 0; //the number of points that landed inside the circle\n boolean lineBool = false; //flipped every time a point lands on the circumference\n \n double x, y; //the x and y coordinates (random) of the point chosen\n\n for (int i = 0; i < ITERATIONS; i++) \n {\n // (2*Math.random()-1) returns a random number from -1 to 1\n \n x = 2 * Math.random() - 1; \n y = 2 * Math.random() - 1;\n \n // if the point is clearly within the circle, increment the inCircle counts\n if (x * x + y * y < 1) \n {\n inCircle++;\n }\n \n /*\n * If the point is on the circumference of the circle, check the line\n * boolean value. If the line boolean value is set to true, increment\n * the inCircle count and set the boolean value to false. If the line\n * boolean value is set to false, do not increment the inCircle count, but\n * flip the boolean for the next point that lands on the circumference.\n */\n else if (x * x + y * y == 1) \n {\n if(lineBool) \n {\n inCircle++;\n }\n lineBool = !lineBool;\n }\n \n nTries++;\n }\n\n /*\n * Prints the output if DEBUG is set to true. The output consists of two lines:\n * an estimate of pi to 30 decimal places using th line delineation method \n * as well as an error percentage from the real value (Math.PI).\n */\n if(DEBUG) \n {\n System.out.printf(\"[yes line boolean] pi = %.30f\\n\", 4. * (double) inCircle / (double) nTries);\n System.out.printf(\"[yes line boolean] Error = %.30f\\n\", (((4. * (double) inCircle / (double) nTries) - Math.PI)/Math.PI));\n }\n \n //returns the estimated value of pi\n return 4. * (double) inCircle / (double) nTries;\n }", "@Override\r\n public final void draw(final Line l, final BufferedImage paper) {\n int x1 = l.getxStart();\r\n int x2 = l.getxFinish();\r\n int y1 = l.getyStart();\r\n int y2 = l.getyFinis();\r\n\r\n if (x1 == x2) {\r\n if (y1 < y2) {\r\n for (int i = y1; i <= y2; i++) {\r\n if (checkBorder(x1, i, paper)) {\r\n paper.setRGB(x1, i, l.getColor().getRGB());\r\n }\r\n }\r\n } else {\r\n for (int i = y2; i <= y1; i++) {\r\n if (checkBorder(x1, i, paper)) {\r\n paper.setRGB(x1, i, l.getColor().getRGB());\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n \r\n int deltaX = Math.abs(x2 - x1);\r\n int deltaY = Math.abs(y2 - y1);\r\n int s1 = (int) (Math.signum(x2 - x1) * 1);\r\n int s2 = (int) (Math.signum(y2 - y1) * 1);\r\n\r\n boolean interchanged = false;\r\n if (deltaY > deltaX) {\r\n int aux = deltaX;\r\n deltaX = deltaY;\r\n deltaY = aux;\r\n interchanged = true;\r\n }\r\n\r\n int error = 2 * deltaY - deltaX;\r\n\r\n for (int i = 0; i <= deltaX; i++) {\r\n if (x1 >= 0 && y1 >= 0 && x1 < paper.getWidth() && y1 < paper.getHeight()) {\r\n\r\n paper.setRGB(x1, y1, l.getColor().getRGB());\r\n }\r\n while (error > 0) {\r\n if (interchanged) {\r\n x1 = x1 + s1;\r\n } else {\r\n y1 = y1 + s2;\r\n }\r\n error = error - 2 * deltaX;\r\n }\r\n\r\n if (interchanged) {\r\n y1 = y1 + s2;\r\n } else {\r\n x1 = x1 + s1;\r\n }\r\n\r\n error = error + 2 * deltaY;\r\n }\r\n }", "public static double[] correlateDfe(\n final double[][] data, final int numTimeseries,\n final int sizeTimeseries) {\n final int numOfCorrelations = calcNumCorrelations(numTimeseries);\n double[] correlations = new double[numOfCorrelations];\n\n DecimalFormat timeFormat = new DecimalFormat(\"#0.00000\");\n double startTime = System.nanoTime();\n\n // Make socket\n TTransport transport = new TSocket(\"localhost\", PORT);\n\n // Wrap in a protocol\n TProtocol protocol = new TBinaryProtocol(transport);\n\n // Create a client to use the protocol encoder\n correlationService.Client client = new correlationService.Client(protocol);\n\n double estimatedTime = (System.nanoTime() - startTime)\n / NUM_OF_NANO_SECONDS;\n System.out.println(\"Createing a client:\\t\\t\\t\\t \"\n + timeFormat.format(estimatedTime) + \"s\");\n\n try {\n // Connect!\n startTime = System.nanoTime();\n transport.open();\n estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS;\n System.out.println(\"Opening connection:\\t\\t\\t\\t \"\n + timeFormat.format(estimatedTime) + \"s\");\n\n final int numTimesteps = sizeTimeseries;\n final double windowSize = (double) sizeTimeseries;\n final int numBursts = calcNumBursts(numTimeseries);\n\n // Get loop length\n startTime = System.nanoTime();\n List<Integer> loopLength = new ArrayList<Integer>();\n loopLength.add(client.correlation_get_CorrelationKernel_loopLength());\n estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS;\n System.out.println(\"Geting Correlation Kernel loopLength:\\t \"\n + timeFormat.format(estimatedTime) + \"s\");\n\n // Prepare data for DFE\n startTime = System.nanoTime();\n\n int burstSize = BURST_SIZE;\n List<Integer> inMemLoad = new ArrayList<Integer>();\n for (int i = 0; i < numBursts * burstSize; i++) {\n inMemLoad.add(0);\n }\n\n double[] precalculations = new double[2 * numTimeseries * numTimesteps];\n double[] dataPairs = new double[2 * numTimeseries * numTimesteps];\n prepareDataForDfe(data, sizeTimeseries, numTimeseries,\n precalculations, dataPairs);\n\n List<Double> precalculationsVec = new ArrayList<Double>();\n List<Double> dataPairsVec = new ArrayList<Double>();\n for (int i = 0; i < 2 * numTimeseries * numTimesteps; i++) {\n precalculationsVec.add(precalculations[i]);\n dataPairsVec.add(dataPairs[i]);\n }\n\n estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS;\n System.out.println(\"Data reordering time:\\t\\t\\t \"\n + timeFormat.format(estimatedTime) + \"s\");\n\n // Allocate and send input streams to server\n startTime = System.nanoTime();\n long loopLengthSize = 1;\n final long addressLoopLength = client.malloc_int32_t(loopLengthSize);\n client.send_data_int32_t(addressLoopLength, loopLength);\n double loopLengthTime = (System.nanoTime() - startTime)\n / NUM_OF_NANO_SECONDS;\n System.out.println(\"\\tSending LoopLength:\\t\\t(size = \"\n + loopLengthSize * SIZE_OF_INT + \" bit)\\t\\t\"\n + timeFormat.format(loopLengthTime) + \"s\");\n\n startTime = System.nanoTime();\n final long inMemLoadSize = numBursts * burstSize;\n final long addressInMemLoad = client.malloc_int32_t(inMemLoadSize);\n client.send_data_int32_t(addressInMemLoad, inMemLoad);\n final double inMemLoadTime = (System.nanoTime() - startTime)\n / NUM_OF_NANO_SECONDS;\n System.out.println(\"\\tSending InMemLoad:\\t\\t(size = \"\n + inMemLoadSize * SIZE_OF_INT + \" bit)\\t\"\n + timeFormat.format(inMemLoadTime) + \"s\");\n\n startTime = System.nanoTime();\n final long precalculationsVecSize = 2 * numTimeseries * numTimesteps;\n final long addressPrecalculations = client.malloc_double(\n precalculationsVecSize);\n client.send_data_double(addressPrecalculations, precalculationsVec);\n final double precalculationsVecTime = (System.nanoTime() - startTime)\n / NUM_OF_NANO_SECONDS;\n System.out.println(\"\\tSending Precalculations:\\t(size = \"\n + precalculationsVecSize * SIZE_OF_DOUBLE + \" bit)\\t\"\n + timeFormat.format(precalculationsVecTime) + \"s\");\n\n startTime = System.nanoTime();\n final long dataPairsVecSize = 2 * numTimeseries * numTimesteps;\n final long addressDataPairs = client.malloc_double(dataPairsVecSize);\n client.send_data_double(addressDataPairs, dataPairsVec);\n final double dataPairsVecTime = (System.nanoTime() - startTime)\n / NUM_OF_NANO_SECONDS;\n System.out.println(\"\\tSending DataPairs:\\t\\t(size = \"\n + dataPairsVecSize * SIZE_OF_DOUBLE + \" bit)\\t\"\n + timeFormat.format(dataPairsVecTime) + \"s\");\n\n estimatedTime = loopLengthTime + inMemLoadTime\n + precalculationsVecTime + dataPairsVecTime;\n double speed = (loopLengthSize * SIZE_OF_INT\n + inMemLoadSize * SIZE_OF_INT\n + precalculationsVecSize * SIZE_OF_DOUBLE\n + dataPairsVecSize * SIZE_OF_DOUBLE)\n / estimatedTime / SIZE_OF_MEGABYTE;\n System.out.println(\"Sending input streams to server total time:\\t \"\n + timeFormat.format(estimatedTime)\n + \"s\\t(average speed = \" + timeFormat.format(speed)\n + \"Mb/s)\");\n\n // Allocate memory for output stream on server\n startTime = System.nanoTime();\n final long addressOutCorrelation = client.malloc_double(\n numTimesteps * loopLength.get(0) * CORRELATION_NUM_TOP_SCORES\n * CORRELATION_NUM_PIPES + numBursts * 24);\n final long addressOutIndices = client.malloc_int32_t(\n 2 * numTimesteps * loopLength.get(0)\n * CORRELATION_NUM_TOP_SCORES * CORRELATION_NUM_PIPES);\n estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS;\n System.out.println(\"Allocating memory for output stream on server: \"\n + timeFormat.format(estimatedTime) + \"s\");\n\n\n // Initialize LMem\n startTime = System.nanoTime();\n\n client.correlation_loadLMem(numBursts, addressLoopLength,\n addressInMemLoad);\n\n estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS;\n System.out.println(\"LMem initialization:\\t\\t\\t \"\n + timeFormat.format(estimatedTime) + \"s\");\n\n //Executing correlation action\n startTime = System.nanoTime();\n\n client.correlation(numBursts, // scalar input\n numTimesteps, // scalar input\n numTimeseries, // scalar input\n 1, // scalar input\n windowSize, // scalar input\n addressPrecalculations, // streaming reordered input\n addressDataPairs, // streaming reordered input\n addressOutCorrelation, // streaming unordered output\n addressOutIndices); // streaming unordered output\n\n estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS;\n System.out.println(\"Correlation time:\\t\\t\\t\\t \"\n + timeFormat.format(estimatedTime) + \"s\");\n\n // Get output stream from server\n startTime = System.nanoTime();\n List<Double> outCorrelation = new ArrayList<Double>();\n final long outCorrelationSize =\n numTimesteps * loopLength.get(0) * CORRELATION_NUM_TOP_SCORES\n * CORRELATION_NUM_PIPES + numBursts * 24;\n outCorrelation = client.receive_data_double(addressOutCorrelation,\n outCorrelationSize);\n final double outCorrelationTime = (System.nanoTime() - startTime)\n / NUM_OF_NANO_SECONDS;\n System.out.println(\"\\tGet output stream Correlation:\\t(size = \"\n + outCorrelationSize * SIZE_OF_DOUBLE + \" bit)\\t\"\n + timeFormat.format(outCorrelationTime) + \"s\");\n\n startTime = System.nanoTime();\n List<Integer> outIndices = new ArrayList<Integer>();\n final long outIndicesSize =\n 2 * numTimesteps * loopLength.get(0)\n * CORRELATION_NUM_TOP_SCORES * CORRELATION_NUM_PIPES;\n outIndices = client.receive_data_int32_t(addressOutIndices,\n outIndicesSize);\n final double outIndicesTime = (System.nanoTime() - startTime)\n / NUM_OF_NANO_SECONDS;\n System.out.println(\"\\tGet output stream outIndices:\\t(size = \"\n + outIndicesSize * SIZE_OF_INT + \" bit)\\t\"\n + timeFormat.format(outIndicesTime) + \"s\");\n\n startTime = System.nanoTime();\n loopLengthSize = 1;\n loopLength = client.receive_data_int32_t(addressLoopLength,\n loopLengthSize);\n loopLengthTime = (System.nanoTime() - startTime)\n / NUM_OF_NANO_SECONDS;\n System.out.println(\"\\tGet output stream loopLength:\\t(size = \"\n + loopLengthSize * SIZE_OF_INT + \" bit)\\t\\t\"\n + timeFormat.format(loopLengthTime) + \"s\");\n\n estimatedTime = outCorrelationTime + outIndicesTime + loopLengthTime;\n speed = (outCorrelationSize * SIZE_OF_DOUBLE\n + outIndicesSize * SIZE_OF_INT\n + loopLengthSize * SIZE_OF_INT)\n / estimatedTime / SIZE_OF_MEGABYTE;\n System.out.println(\"Sending input streams to server total time:\\t \"\n + timeFormat.format(estimatedTime)\n + \"s\\t(average speed = \" + timeFormat.format(speed)\n + \"Mb/s)\");\n\n // Free allocated memory for streams on server\n startTime = System.nanoTime();\n client.free(addressLoopLength);\n client.free(addressInMemLoad);\n client.free(addressPrecalculations);\n client.free(addressDataPairs);\n client.free(addressOutCorrelation);\n client.free(addressOutIndices);\n estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS;\n System.out.println(\"Freeing allocated memory for streams on server: \"\n + timeFormat.format(estimatedTime) + \"s\");\n\n // Close!\n startTime = System.nanoTime();\n transport.close();\n estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS;\n System.out.println(\"Closing connection:\\t\\t\\t\\t \"\n + timeFormat.format(estimatedTime) + \"s\");\n\n // Store data\n startTime = System.nanoTime();\n\n final int start = (numTimesteps - 1) * loopLength.get(0)\n * CORRELATION_NUM_TOP_SCORES * CORRELATION_NUM_PIPES;\n\n int position = 0;\n int index = 0;\n\n for (int i = 0; i < numTimeseries; i++) {\n for (int j = 0; j < i; j++) {\n correlations[index + j] = outCorrelation.get(start + position + j);\n }\n index += i;\n position += ((i / CORRELATION_NUM_PIPES) + 1) * CORRELATION_NUM_PIPES;\n }\n\n estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS;\n System.out.println(\"Storing time:\\t\\t\\t\\t \"\n + timeFormat.format(estimatedTime) + \"s\");\n\n\n } catch (TException x) {\n x.printStackTrace();\n System.exit(-1);\n }\n\n return correlations;\n }", "public float gradientMethod(MCVolume vol, int slice_num, int channel_num) \n\t{\n\t\t//\n\t\t// Get the right slice.\n\t\t//\n\t\tSlice slice = vol.getSlice(slice_num, channel_num);\n\n\t\treturn gradientMethod(slice);\n\t}", "public double[] LogSlope(double StartFreq, double StopFreq, double StartLevel, double StopLevel)\r\n {\n \r\n\tdouble levelM1 = 0.0;\r\n double levelB1 = 0.0;\r\n double levelFlag = 0.0;\r\n double[] logSLopeCalcValues = new double[7];\r\n\r\n //calculate M1 value\r\n // M1 = (Y2 - Y1) / (X2- X1)\r\n levelM1 = (Math.log10(StopLevel) - Math.log10(StartLevel)) / (Math.log10(StopFreq) - Math.log10(StartFreq));\r\n\r\n //calculate B1 value\r\n // B1 = Y2 -(M1 * X2)\r\n levelB1 = Math.log10(StopLevel) - (levelM1 * Math.log10(StopFreq));\r\n\r\n // put the values in the array to return it\r\n logSLopeCalcValues[0] = levelM1;\r\n logSLopeCalcValues[1] = levelB1;\r\n logSLopeCalcValues[2] = StartFreq;\r\n logSLopeCalcValues[3] = StopFreq;\r\n logSLopeCalcValues[4] = StartLevel;\r\n logSLopeCalcValues[5] = StopLevel;\r\n logSLopeCalcValues[6] = levelFlag;\r\n //return the array with the M1 and B1 values\r\n return logSLopeCalcValues;\r\n }", "public static StateVector integrate( StateVector state, double dt) {\r\n StateVector dummy = new StateVector();\r\n StateVector derivative_a, derivative_b, derivative_c, derivative_d;\r\n\r\n\r\n derivative_a = evaluate(state, 0.0, dummy, 0 ); // derivative a returns initial velocity and acceleration\r\n derivative_b = evaluate(state, dt*0.5, derivative_a, 1 );\r\n derivative_c = evaluate(state, dt*0.5, derivative_b, 1 );\r\n derivative_d = evaluate(state, dt, derivative_c, 2 );\r\n\r\n double dxdt = 1.0/6.0 * (derivative_a.vx + 2.0f*(derivative_b.vx + derivative_c.vx) + derivative_d.vx);\r\n double dydt = 1.0/6.0 * (derivative_a.vy + 2.0f*(derivative_b.vy + derivative_c.vy) + derivative_d.vy);\r\n double dzdt = 1.0/6.0 * (derivative_a.vz + 2.0f*(derivative_b.vz + derivative_c.vz) + derivative_d.vz);\r\n double dvxdt = 1.0/6.0 * (derivative_a.ax + 2.0f*(derivative_b.ax + derivative_c.ax) + derivative_d.ax);\r\n double dvydt = 1.0/6.0 * (derivative_a.ay + 2.0f*(derivative_b.ay + derivative_c.ay) + derivative_d.ay);\r\n double dvzdt = 1.0/6.0 * (derivative_a.az + 2.0f*(derivative_b.az + derivative_c.az) + derivative_d.az);\r\n\r\n state.x = state.x + dxdt * dt;\r\n state.y = state.y + dydt * dt;\r\n state.z = state.z + dzdt * dt;\r\n state.vx = state.vx + dvxdt * dt;\r\n state.vy = state.vy + dvydt * dt;\r\n state.vz = state.vz + dvzdt * dt;\r\n\r\n return( state );\r\n }", "public double sumXYs() {\n double $ = 0;\n for (int ¢ = 0; ¢ < yVals.size(); ++¢)\n $ += unbox(cantBeNull(xVals.get(¢))) * unbox(cantBeNull(yVals.get(¢)));\n return $;\n }\n\n // calculate the linear regression\n public LinearLine calcLinearRegression() {\n double $;\n final double n = xVals.size();\n final double a = (n * sumXYs() - sumXs() * sumYs()) / (n * sumXXs() - sumXs() * sumXs());\n $ = 1 / n * sumYs() - a / n * sumXs();\n return new LinearLine(a, $);\n }", "private void gradientMagnitude3D(float[] img, float[] mag) {\r\n int slice, row, col, cIndex, sIndex;\r\n float lVal, rVal, tVal, bVal, zLowVal, zHighVal;\r\n int sliceSize = yDim*xDim;\r\n for (slice = 0; slice < zDim; slice++) {\r\n sIndex = slice * sliceSize;\r\n for (row = 0; row < yDim; row++) {\r\n cIndex = sIndex + row * xDim;\r\n for (col = 0, cIndex += col; col < xDim; cIndex++, col++) {\r\n\r\n rVal = getVal(img, col+1, row, slice);\r\n lVal = getVal(img, col-1, row, slice);\r\n tVal = getVal(img, col, row+1, slice);\r\n bVal = getVal(img, col, row-1, slice);\r\n zLowVal = getVal(img, col, row, slice-1);\r\n zHighVal = getVal(img, col, row, slice+1);\r\n\r\n mag[cIndex] = (float)Math.sqrt((rVal - lVal) * (rVal - lVal) +\r\n (tVal - bVal) * (tVal - bVal) +\r\n (zHighVal - zLowVal) * (zHighVal - zLowVal));\r\n } // for (col = 0; ...)\r\n } // for (row = 0; ...)\r\n } // for (slice = 0; ...)\r\n }", "public void computeLine ()\r\n {\r\n line = new BasicLine();\r\n\r\n for (GlyphSection section : glyph.getMembers()) {\r\n StickSection ss = (StickSection) section;\r\n line.includeLine(ss.getLine());\r\n }\r\n\r\n if (logger.isFineEnabled()) {\r\n logger.fine(\r\n line + \" pointNb=\" + line.getNumberOfPoints() +\r\n \" meanDistance=\" + (float) line.getMeanDistance());\r\n }\r\n }", "public void drawGraph() {\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n\n if (y == height / 2) {\n imageRaster.setPixel(x, y, lineColor);\n } else {\n imageRaster.setPixel(x, y, backgroundColor);\n }\n }\n }\n\n // lateral\n for (int x = 0; x < width; ++x) {\n float xUnit = x / (float) width;\n float slipAngle = map(xUnit, 0, 1, 0, maxSlipAngle);\n\n float lat = tireModel.calcLateralTireForce(slipAngle);\n lat = map(lat, -tireModel.getMaxLoad(), tireModel.getMaxLoad(), 0, height);\n int pixelY = (int) FastMath.clamp(lat, 0, height - 1);\n\n imageRaster.setPixel(x, pixelY, lateralColor);\n }\n\n // longitudinal\n for (int x = 0; x < width; ++x) {\n float xUnit = x / (float) width;\n float slipAngle = map(xUnit, 0, 1, 0, maxSlipAngle);\n\n float lng = tireModel.calcLongitudeTireForce(slipAngle);\n lng = map(lng, -tireModel.getMaxLoad(), tireModel.getMaxLoad(), 0, height);\n int pixelY = (int) FastMath.clamp(lng, 0, height - 1);\n\n imageRaster.setPixel(x, pixelY, longitudinalColor);\n }\n\n // align moment\n for (int x = 0; x < width; ++x) {\n float xUnit = x / (float) width;\n float slipAngle = map(xUnit, 0, 1, 0, maxSlipAngle);\n\n float mnt = tireModel.calcAlignMoment(slipAngle);\n mnt = map(mnt, -tireModel.getMaxLoad(), tireModel.getMaxLoad(), 0, height);\n int pixelY = (int) FastMath.clamp(mnt, 0, height - 1);\n\n imageRaster.setPixel(x, pixelY, momentColor);\n }\n }", "protected Double getSlope(Line2D line) {\n\t\tdouble x1, y1, x2, y2;\n\t\tif (line.getX1() < line.getX2()) {\n\t\t\tx1 = line.getX1();\n\t\t\tx2 = line.getX2();\n\t\t\ty1 = line.getY1();\n\t\t\ty2 = line.getY2();\n\t\t} else {\n\t\t\tx1 = line.getX2();\n\t\t\tx2 = line.getX1();\n\t\t\ty1 = line.getY2();\n\t\t\ty2 = line.getY1();\n\t\t}\n\t\tif (x1 == x2)\n\t\t\treturn Double.POSITIVE_INFINITY;\n\t\tif (y1 == y2)\n\t\t\treturn new Double(0);\n\t\telse\n\t\t\treturn (y2 - y1) / (x2 - x1);\n\t}", "@Override\n public void draw(Canvas canvas) {\n mPaint.setColor(mContext.getResources().getColor(android.R.color.holo_orange_light));\n mPaint.setStyle(Style.STROKE);\n mPaint.setStrokeWidth(RateChartConst.sLineWidth);\n mPaint.setAntiAlias(true);\n\n RateChartManager manager = mManager;\n int columns = manager.getColumnNum();\n\n double[] YValues = manager.getYValues();\n if (YValues == null || YValues.length < columns) return;\n\n double[] yValues = new double[YValues.length];\n System.arraycopy(YValues, 0, yValues, 0, yValues.length);\n\n double[] yCoordinates = manager.getYCoordinates();\n double deltaYCoordinateMM = RateDataHelper.getAbsDeltaMaxMin(yCoordinates);\n double maxYCoordinate = RateDataHelper.getMax(yCoordinates);\n\n //draw y coordinate value.\n float[] drawYValue = new float[YValues.length];\n\n for (int m = 0; m < yValues.length; m++) {\n drawYValue[m] =\n (float) (mRegionHeight * (maxYCoordinate - yValues[m]) / deltaYCoordinateMM);\n }\n\n // line path\n mLinePath.reset();\n mLinePath.moveTo(mMarginLeft, mMarginTop + drawYValue[0]);\n mShaderPath.reset();\n mShaderPath.moveTo(mMarginLeft, mMarginTop + drawYValue[0]);\n\n float deltaX = mRegionWidth / (columns - 1);\n\n if (columns < RateChartConst.sColumnNum) {\n deltaX = mRegionWidth / (RateChartConst.sColumnNum - 1);\n }\n for (int i = 1; i < columns; i++) {\n mLinePath.lineTo(mMarginLeft + deltaX * i, drawYValue[i] + mMarginTop);\n mShaderPath.lineTo(mMarginLeft + deltaX * i, drawYValue[i] + mMarginTop);\n }\n\n //draw shader\n mShaderPath.lineTo(mMarginLeft + deltaX * (columns - 1), mRegionHeight + mMarginTop);\n mShaderPath.lineTo(mMarginLeft, mRegionHeight + mMarginTop);\n mShaderPath.lineTo(mMarginLeft, mMarginTop + drawYValue[0]);\n mShaderPath.setFillType(FillType.EVEN_ODD);\n canvas.drawPath(mShaderPath, mShaderPaint);\n\n //draw line\n canvas.drawPath(mLinePath, mPaint);\n\n //draw orange circle\n mPaint.setStrokeWidth(RateChartConst.sCircleWidth);\n canvas.drawCircle(mMarginLeft + deltaX * (columns - 1),\n drawYValue[columns - 1] + mMarginTop, RateChartConst.sCircleOuterRadius, mPaint);\n\n //draw inner circle.\n mPaint.setColor(mContext.getResources().getColor(android.R.color.white));\n mPaint.setStyle(Style.FILL);\n canvas.drawCircle(mMarginLeft + deltaX * (columns - 1),\n drawYValue[columns - 1] + mMarginTop, RateChartConst.sCircleInnerRadius, mPaint);\n\n //draw black pop window.\n float mLatestX = mMarginLeft + deltaX * (columns - 1);\n float mLatestY = mMarginTop + drawYValue[columns - 1];\n showPopText(canvas,\n mDecimalFormat.format(manager.getYValues()[manager.getYValues().length - 1]),\n mLatestX, mLatestY);\n }", "private double calculateYDerivative(double x, double y, double r, double r2, double phi, double deltaPhi)\n\t{\n\t\treturn 2*((-a*b*Math.exp(b*(deltaPhi+phi))*x)/r2 + y/r) * (-a*Math.exp(b*(deltaPhi+phi)) + r);\n\t}" ]
[ "0.6270706", "0.5652772", "0.56369054", "0.5496412", "0.54484797", "0.54474527", "0.5397276", "0.5335478", "0.5307909", "0.52711195", "0.5129194", "0.5120325", "0.509528", "0.5092168", "0.5083971", "0.50790226", "0.50535226", "0.5046796", "0.49982423", "0.49170136", "0.49103197", "0.49102244", "0.48908347", "0.48584408", "0.4844175", "0.48318124", "0.48270893", "0.4805441", "0.47719696", "0.4770315", "0.47690642", "0.4743802", "0.47095302", "0.4704256", "0.46909666", "0.46888202", "0.46703705", "0.46688935", "0.4664278", "0.4664157", "0.46508986", "0.46473607", "0.46391526", "0.4631439", "0.46269405", "0.46229523", "0.4621272", "0.46141744", "0.46141493", "0.46082833", "0.45921475", "0.45816994", "0.45744517", "0.45651597", "0.4564422", "0.45640677", "0.45591515", "0.45579064", "0.45489466", "0.45478082", "0.45473626", "0.45379606", "0.4527294", "0.45138055", "0.45060107", "0.4498372", "0.44886246", "0.44844377", "0.44827113", "0.44826537", "0.44775555", "0.44690564", "0.44618267", "0.44603103", "0.44488248", "0.4447105", "0.44377393", "0.44336936", "0.44309223", "0.44298962", "0.44100514", "0.44040865", "0.44010875", "0.43989196", "0.43911067", "0.43908212", "0.4390371", "0.4390154", "0.43853766", "0.43813103", "0.43787235", "0.43762833", "0.4375551", "0.43738925", "0.4372709", "0.43708518", "0.43610033", "0.43443006", "0.43431598", "0.43346915" ]
0.6086929
1
Calculates the total number of milliseconds in a trading day based on the Exchange opening and Closing constants in DTConstants
public static long msPerTradingDay() { long result = 0; Calendar dateStart = Calendar.getInstance(TimeZone.getTimeZone("GMT")); Calendar dateEnd = DTUtil.deepCopyCalendar(dateStart); dateStart.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); dateStart.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); dateStart.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); dateEnd.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR); dateEnd.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN); dateEnd.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC); result = dateEnd.getTimeInMillis() - dateStart.getTimeInMillis(); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double getTimeRemainingInUTCDay(){\n\t\tdouble daysLeftInDay;\n\n\t\tInstant origin = Instant.ofEpochMilli (cur_mainshock.getOriginTime());\n\t\tZonedDateTime zdt = ZonedDateTime.ofInstant (origin, ZoneOffset.UTC);\n\t\tZonedDateTime zdt2 = zdt.toLocalDate().atStartOfDay (ZoneOffset.UTC);\n\t\tInstant daybreak = zdt2.toInstant();\n\n//\t\tSimpleDateFormat formatter=new SimpleDateFormat(\"d MMM yyyy, HH:mm:ss\");\n//\t\tformatter.setTimeZone(utc); //utc=TimeZone.getTimeZone(\"UTC\"));\n//\t\tSystem.out.println(formatter.format(Date.from (origin)));\n//\t\tSystem.out.println(formatter.format(Date.from (daybreak)));\n\t\t\n\t\tdaysLeftInDay = 1.0 - ((double)(origin.toEpochMilli() - daybreak.toEpochMilli()))/ComcatOAFAccessor.day_millis;\n\t\tif (daysLeftInDay == 1.0) {\n\t\t\tdaysLeftInDay = 0.0;\n\t\t}\n\t\treturn daysLeftInDay;\n\t}", "public double getTimeForClose();", "double getTodaysExpenditureAmount() {\n Long time = new Date().getTime();\n Date date = new Date(time - time % (DAY_DURATION));\n return getExpenditureAmount(date.getTime(), date.getTime() + (DAY_DURATION));\n }", "public double getTimeForOpen();", "private long determineTimestamp(DdfMarketBase m) {\n\n\t\tlong millis = millisCST;\n\n\t\tint type = getSymbolType(m.getSymbol());\n\n\t\tif ((type > 200) && (type < 300)) {\n\t\t\t// Equity, add 1 Hour\n\t\t\tmillis += 60 * 60 * 1000;\n\t\t}\n\n\t\tif (_type == MasterType.Delayed) {\n\t\t\tmillis -= m.getDelay() * 60 * 1000;\n\t\t}\n\n\t\treturn millis;\n\t}", "public double getPer_day(){\n\t\tdouble amount=this.num_of_commits/365;\n\t\treturn amount;\n\t}", "double getTodaysIncomeAmount() {\n Long time = new Date().getTime();\n Date date = new Date(time - time % (DAY_DURATION));\n return getIncomeAmount(date.getTime(), date.getTime() + DAY_DURATION);\n }", "@Test public void shouldGive180MinFor650cent() {\r\n // Three hours: $1.5+2.0+3.0\r\n assertEquals( 3 * 60 /*minutes*/ , rs.calculateTime(650) ); \r\n }", "public static float getDeltaMillis()\r\n {\r\n long t = (long)(getDelta()/DAMPING);\r\n return TimeUnit.MILLISECONDS.convert(t, TimeUnit.NANOSECONDS); \r\n }", "@Test\n public void computeFactor_WinterTimeDay() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-21 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-30 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-10-01 00:00:00\", \"2012-11-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.DAY,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n // then\n assertEquals(10, factor, 0);\n }", "static long getDaysPart(Duration d) {\n long t = d.getSeconds() / 60 / 60 / 24;\n return t;\n }", "private long getDuration() throws Exception {\n\treturn dtEnd.getTime() - dtStart.getTime();\n }", "public double getWorkTime()\n {\n if (cFixedServiceTimed)\n {\n return (mServerConfig.mServiceTime);\n }\n double tBase;\n double tDelta;\n switch (mHoldType)\n {\n case cHoldNormal:\n return (cRandom.normal(mServerConfig.mServiceTime, mServerConfig.mServiceTime * 0.1)); //0.3\n\n case cHoldNegexp:\n tBase = mServerConfig.mServiceTime * 0.75;\n tDelta = 1.0 / (mServerConfig.mServiceTime * 0.50);\n return (tBase + cRandom.negexp(tDelta));\n\n case cHoldPoisson:\n tBase = mServerConfig.mServiceTime * 0.75;\n tDelta = mServerConfig.mServiceTime * 0.50;\n return (tBase + cRandom.poisson(tDelta));\n\n case cHoldUniform:\n return (cRandom.uniform(mServerConfig.mServiceTime * 0.75, mServerConfig.mServiceTime * 1.5));\n }\n return 0.0;\n }", "double getYesterdaysExpenditureAmount() {\n Long time = new Date().getTime();\n Date date = new Date(time - time % (DAY_DURATION));\n return getExpenditureAmount(date.getTime() - DAY_DURATION, date.getTime());\n }", "public double getPer_week(){\n\t\tdouble amount=this.num_of_commits/52;\n\t\treturn amount;\t\t\n\t}", "hr.client.appuser.CouponCenter.TimeRange getExchangeTime();", "public int getTotalTime();", "public int getFullDuration() {\r\n return disc.getDisc().stream()\r\n .mapToInt(Song::getDuration)\r\n .sum();\r\n }", "org.apache.xmlbeans.XmlInt xgetDuration();", "public static final long getTicksPerDay() {\n return p().TICKS_PER_RLDAY;\n }", "public double readClock()\n {\n return (System.currentTimeMillis() - startingTime) / 1000.0;\n }", "private int calcTotalTime() {\n\t\tint time = 0;\n\t\tfor (Taxi taxi : taxis) {\n\t\t\ttime += taxi.calcTotalTime();\n\t\t}\n\t\treturn time;\n\t}", "@Test public void shouldGive120MinFor350cent() {\r\n // Two hours: $1.5+2.0\r\n assertEquals( 2 * 60 /*minutes*/ , rs.calculateTime(350) ); \r\n }", "public static double getGraidentBasedOnTradingDays(IGraphLine aLine, TreeSet<AbstractGraphPoint> listOfTradingDays) {\r\n double result = 0;\r\n if (null != aLine && null != listOfTradingDays) {\r\n AbstractGraphPoint myCurrStart = aLine.getCurrentC();\r\n AbstractGraphPoint myCurrEnd = aLine.getCurrentE();\r\n if (myCurrStart.getDateAsNumber() != myCurrEnd.getDateAsNumber()) {\r\n// TreeSet<AbstractGraphPoint> tDay = new TreeSet<AbstractGraphPoint>(AbstractGraphPoint.TimeComparator);\r\n// tDay.addAll(listOfTradingDays);\r\n //Calc P1\r\n //Get Market close time on start day\r\n Calendar endTrading = DTUtil.deepCopyCalendar(myCurrStart.getCalDate());\r\n endTrading.setTimeZone(DTConstants.EXCH_TIME_ZONE);\r\n endTrading.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR);\r\n endTrading.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN);\r\n endTrading.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC);\r\n double p1 = endTrading.getTimeInMillis() - myCurrStart.getCalDate().getTimeInMillis();\r\n //double p1 = endTrading.getTimeInMillis() - (myCurrStart.getCalDate().getTimeInMillis() - DTConstants.MILLSECS_PER_HOUR);\r\n //Now calculate P2\r\n //Get Market open time on end day\r\n Calendar startTrading = DTUtil.deepCopyCalendar(myCurrEnd.getCalDate());\r\n startTrading.setTimeZone(DTConstants.EXCH_TIME_ZONE);\r\n startTrading.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n startTrading.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n startTrading.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n double p2 = (myCurrEnd.getCalDate().getTimeInMillis() - startTrading.getTimeInMillis());\r\n //double p2 = (myCurrEnd.getCalDate().getTimeInMillis() - DTConstants.MILLSECS_PER_HOUR) - startTrading.getTimeInMillis();\r\n //Now calc P3\r\n //Get count of trading days from list\r\n// int currStartDay = myCurrStart.getDateAsNumber();\r\n// int currEndDay = myCurrEnd.getDateAsNumber();\r\n// NavigableSet<AbstractGraphPoint> subSet = new TreeSet<AbstractGraphPoint>();\r\n// for(AbstractGraphPoint currPoint : tDay){\r\n// int currDay = currPoint.getDateAsNumber();\r\n// if(currDay > currStartDay && currDay < currEndDay){\r\n// subSet.add(currPoint);\r\n// }\r\n// }\r\n NavigableSet<AbstractGraphPoint> subSet = listOfTradingDays.subSet(myCurrStart, false, myCurrEnd, false);\r\n ArrayList<AbstractGraphPoint> theSet = new ArrayList<AbstractGraphPoint>();\r\n theSet.addAll(subSet);\r\n for (AbstractGraphPoint currPoint : theSet) {\r\n if (currPoint.getDateAsNumber() == myCurrStart.getDateAsNumber() || currPoint.getDateAsNumber() == myCurrEnd.getDateAsNumber()) {\r\n subSet.remove(currPoint);\r\n }\r\n }\r\n double dayCount = subSet.size();\r\n double p3 = dayCount * DTUtil.msPerTradingDay();\r\n\r\n //Sum all three parts as deltaX\r\n double deltaX = p1 + p2 + p3;\r\n double deltaY = myCurrEnd.getLastPrice() - myCurrStart.getLastPrice();\r\n\r\n //Gradient is deltaY / deltaX\r\n result = deltaY / deltaX;\r\n\r\n System.out.println(\"Delta Y = \" + deltaY);\r\n System.out.println(\"Delta X = \" + deltaX);\r\n System.out.println(aLine.toString());\r\n } else {\r\n result = aLine.getGradient();\r\n System.out.println(aLine.toString());\r\n }\r\n }\r\n return result;\r\n }", "public int calcDays() {\n\t\tint days = day-1;\r\n\t\tdays += ((month-1)*30);\r\n\t\tdays += ((year -2000) * (12*30));\r\n\t\treturn days;\r\n\t}", "public int getDuration( ) {\nreturn numberOfPayments / MONTHS;\n}", "public java.lang.Integer getTotalOverdueCount24M30D() {\n return totalOverdueCount24M30D;\n }", "@Override\n public double calculatePayDay()\n {\n double perWeekEarned = hourlyRate * hoursPerWeek;\n return (double)Math.round(perWeekEarned * 100) / 100;\n }", "private void Calculation() {\n\t\tint calStd = jetztStunde + schlafStunde;\n\t\tint calMin = jetztMinute + schlafMinute;\n\n\t\ttotalMin = calMin % 60;\n\t\ttotalStunde = calStd % 24 + calMin / 60;\n\n\t}", "public java.lang.Integer getTotalOverdueCount6M30D() {\n return totalOverdueCount6M30D;\n }", "@Test\n public void computeFactor_WinterTimeHour() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-28 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-28 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-10-01 00:00:00\", \"2012-11-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.HOUR,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n if (DateTimeHandling.isDayLightSaving(startTimeUsage, endTimeUsage)) {\n // then day has 25 hours\n assertEquals(25, factor, 0);\n } else {\n // then day has 24 hours\n assertEquals(24, factor, 0);\n }\n }", "public double countDailyBudget() {\n return countBalance() / 30;\n }", "Double getRemainingTime();", "public long timeDifference(Datum datum) {\n\t\treturn (date.getTime() - datum.getTime()) / 60000;\n }", "public static int getTimeSeconds() {\n return Atlantis.getBwapi().getFrameCount() / 30;\n }", "public static double hoursSpent()\r\n {\r\n double howlong = 24.0;\r\n return howlong;\r\n }", "public int getHowManyInPeriod();", "Double getActualDuration();", "long getTotalDoExamTime();", "org.apache.xmlbeans.XmlInt xgetRecurrenceDuration();", "int getTestDuration() {\n return config.big ? TEST_TIME_SECONDS : TEST_TIME_SECONDS / 10;\n }", "int getTtiSeconds();", "public abstract double sensingTime();", "public BigDecimal getNO_OF_DAYS() {\r\n return NO_OF_DAYS;\r\n }", "public long period() throws TimeWindowException {\n return div();\n }", "public final double calculateCarbon() {\n\n if (calories > 2000) {\n allowedCarbonPerYear = 2200 * quantity;\n\n } else {\n allowedCarbonPerYear = 2000 * quantity;\n }\n allowedCarbonPerDay = (double) allowedCarbonPerYear / (double) 365;\n // String strDouble = String.format(\"%.2f\", allowedCarbonPerDay);\n // System.out.println(strDouble);\n return allowedCarbonPerDay;\n\n }", "public long getTotalTime() {\n/* 73 */ return this.totalTime;\n/* */ }", "public double calculateAvgLeadTime() {\n Double totalLeadTime = 0.0;\n LinkedList<Card> completedCards = BoardManager.get().getCurrentBoard().getCardsOf(Role.COMPLETED_WORK);\n for (Card card : completedCards) {\n totalLeadTime += (int) DAYS.between(card.getCreationDate(versions), card.getCompletionDate(versions));\n }\n if (totalLeadTime == 0.0){\n return 0.0;\n }\n return Math.round(totalLeadTime/completedCards.size() * 100D) / 100D;\n }", "public java.lang.Integer getTotalOverdueCount12M30D() {\n return totalOverdueCount12M30D;\n }", "public Integer getTotalDays()\r\n/* 68: */ {\r\n/* 69:67 */ return this.totalDays;\r\n/* 70: */ }", "public Long calculateMilliseconds() {\n\t\tString stringMonth;\n\t\tString stringDay;\n\t\tString stringYear;\n\t\tString[] dateFragments;\n\t\tCalendar cal;\n\t\tint day;\n\t\tint month;\n\t\tint year;\n\t\t\n\t\tdateFragments = this.date.split(\"/\");\n\t\t\n\t\tstringMonth = dateFragments[0];\n\t\tstringDay = dateFragments[1];\n\t\tstringYear = dateFragments[2];\n\t\t\n\t\tmonth = Integer.parseInt(stringMonth) - 1; // (Firebase/Event: Jan == 1)\n\t\tday = Integer.parseInt(stringDay);\n\t\tyear = Integer.parseInt(stringYear);\n\t\t\n\t\tcal = Calendar.getInstance();\n\t\tcal.set(year, month, day); // (Calendar.java: Jan == 0)\n\t\t\n\t\treturn cal.getTimeInMillis();\n\t}", "org.apache.xmlbeans.XmlDuration xgetDuration();", "public int getLBR_ProtestDays();", "private int totalTime()\n\t{\n\t\t//i'm using this varaible enough that I should write a separate method for it\n\t\tint totalTime = 0;\n\t\tfor(int i = 0; i < saveData.size(); i++)//for each index of saveData\n\t\t{\n\t\t\t//get the start time\n\t\t\tString startTime = saveData.get(i).get(\"startTime\");\n\t\t\t//get the end time\n\t\t\tString endTime = saveData.get(i).get(\"endTime\");\n\t\t\t//****CONTINUE\n\t\t\t//total time in minutes\n\t\t}\n\t}", "public long getDifference(DateTime dt) {\n return (this.date.getTime() - dt.date.getTime()) / 1000;\r\n }", "private int normalizeTime() {\n int currentTimeSeconds = (int) (System.currentTimeMillis() / 1000);\n\n // The graphing interval in minutes\n // TODO not hardcoded :3\n int interval = 30;\n\n // calculate the devisor denominator\n int denom = interval * 60;\n\n return (int) Math.round((currentTimeSeconds - (denom / 2d)) / denom) * denom;\n }", "public static final double getTickMillisD() {\n return p().TIME_TICK_DOUBLE;\n }", "double getMinTimerTrig();", "@Override\n public long checkFrequencyMillis()\n {\n return TimeUnit.DAYS.toMillis( 1 );\n }", "@Transient\n \tpublic int getDuration() {\n \t\tint duration = (int) (this.endTime.getTime() - this.startTime.getTime());\n \t\treturn duration / 1000;\n \t}", "static int calcCoolingTime(int temperature, int amount) {\n // the time in melting reipes assumes updating 5 times a second\n // we update 20 times a second, so get roughly a quart of those values\n return IMeltingRecipe.calcTimeForAmount(temperature, amount);\n }", "@Test public void shouldGive240MinFor950cent() {\r\n // Three hours: $1.5+2.0+3.0\r\n assertEquals( 4 * 60 /*minutes*/ , rs.calculateTime(950) ); \r\n }", "public float getTimeBetweenRounds() {\r\n\t\treturn timeBetweenRounds;\r\n\t}", "public double getSystemTimeSec() {\n\treturn getSystemTime() / Math.pow(10, 9);\n}", "public static double getTimeMs(){\n return System.nanoTime()*nanoToMs;\n }", "org.apache.xmlbeans.GDuration getDuration();", "protected double NetworkServiceTime()\r\n\t{\r\n\t\treturn 25.0;\r\n\t}", "@DISPID(52)\r\n\t// = 0x34. The runtime will prefer the VTID if present\r\n\t@VTID(50)\r\n\tint actualCPUTime_Days();", "public int computeCheckPeriod()\r\n\t{\r\n\t\tRollingCalendar rollingCalendar = new RollingCalendar(gmtTimeZone, Locale.ENGLISH);\r\n\t\t// set sate to 1970-01-01 00:00:00 GMT\r\n\t\tDate epoch = new Date(0);\r\n\r\n\t\tif (this.getDatePattern() != null)\r\n\t\t{\r\n\t\t\tSimpleDateFormat simpleDateFormat;\r\n\t\t\tString r0;\r\n\t\t\tString r1;\r\n\t\t\tDate nextDate;\r\n\t\t\tfor (int type = TOP_OF_MINUTE; type <= TOP_OF_MONTH; type++)\r\n\t\t\t{\r\n\t\t\t\tsimpleDateFormat = new SimpleDateFormat(this.getDatePattern());\r\n\t\t\t\tsimpleDateFormat.setTimeZone(gmtTimeZone); // do all date formatting in GMT\r\n\t\t\t\tr0 = simpleDateFormat.format(epoch);\r\n\t\t\t\trollingCalendar.setType(type);\r\n\t\t\t\tnextDate = new Date(rollingCalendar.getNextCheckMillis(epoch));\r\n\t\t\t\tr1 = simpleDateFormat.format(nextDate);\r\n\t\t\t\tif (r0 != null && r1 != null && !r0.equals(r1))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn type;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn TOP_OF_TROUBLE; // Deliberately head for trouble...\r\n\t}", "int getChronicDelayTime();", "private static long getQtdDias(String dataAniversario){\n DateTimeFormatter data = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\n LocalDateTime now = LocalDateTime.now();\n String dataHoje = data.format(now);\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\", Locale.ENGLISH);\n try {\n Date dtAniversario = sdf.parse(dataAniversario);\n Date hoje = sdf.parse(dataHoje);\n //Date hoje = sdf.parse(\"51515/55454\");\n long diferenca = Math.abs(hoje.getTime() - dtAniversario.getTime());\n long qtdDias = TimeUnit.DAYS.convert(diferenca, TimeUnit.MILLISECONDS);\n return qtdDias;\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return 0;\n }", "public double getCBRTime();", "public double getCumTime() {\n return cumTime;\n }", "private long getCurrentTimeInMillionSeconds(){\n Date currentData = new Date();\n return currentData.getTime();\n }", "@Test\n public void computeFactor_SummerTimeHour() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-03-25 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-03-25 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-03-01 00:00:00\", \"2012-04-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.HOUR,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n if (DateTimeHandling.isDayLightSaving(startTimeUsage, endTimeUsage)) {\n // then day has 23 hours\n assertEquals(23, factor, 0);\n } else {\n // then day has 24 hours\n assertEquals(24, factor, 0);\n }\n\n }", "static long getHoursPart(Duration d) {\n long u = (d.getSeconds() / 60 / 60) % 24;\n\n return u;\n }", "@Test\n public void computeFactor_SummerTimeDay() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-03-22 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-03-31 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-03-01 00:00:00\", \"2012-04-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.DAY,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n // then\n assertEquals(10, factor, 0);\n }", "int getBurnDuration();", "public static int microDateDays(long modified) {\n return (int) ((modified / day) % 262144);\r\n }", "long getDuration(TimeUnit timeUnit);", "public double getTime()\n {\n long l = System.currentTimeMillis()-base;\n return l/1000.0;\n }", "public int totalTime(){\n\t\t\n\t\tint time=0;\n\t\t\n\t\n\t\tfor(int i=0; (i<songList.length);i++){\n\t\t\t\n\t\t\tif(songList[i]!=null){\n\t\t\t\n\t\t\ttime+= songList[i].getDuration();\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn time;\n\t\t\n\t}", "public double fineAsToHours(int numOfDays,int h1,int h2,int m1, int m2){\n double fine=0.0;\n int y=0;\n\n //if overdue is minus there is no need to calculate a fine\n if(numOfDays<0){\n fine=0.0;\n }\n\n //if it is 0 if the reader returns book on or before the due hour, again no fine\n //if reader returns book after due hour minutes will be taken in to count\n else if(numOfDays==0){\n if(h2<=h1){\n fine=0.0;\n }\n else{\n //ex:if due=10.30, returnTime=12.20, fine will be charged only for 10.30 to 11.30 period\n //which is returnTime-1-due\n if(m2<m1){\n y=(h2-h1)-1;\n fine=y*0.2;\n }\n //if returnTime=12.45 fine will be charged for 10.30 to 12.45 period\n //which is returnTime-due\n else if(m2>=m1){\n y=h2-h1;\n fine=y*0.2;\n }\n }\n }\n\n //if over due is 3days or less\n else if(numOfDays<=3){\n //ex: due=7th 10.30, returned=9th 9.30\n //finr will be charged for 24h and the extra hours from 8th, and extra hours from 9th\n if(h2<=h1){\n y=((numOfDays-1)*24)+((24-h1)+h2);\n fine=y*0.2;\n }\n else{\n //ex: due=7th 10.30, returned= 9th 12.15\n //total 2*24h will be added. plus, time period frm 9th 10.30 to 11.30\n if(m2<m1){\n y=(numOfDays*24)+((h2-h1)-1);\n fine=y*0.2;\n }\n else if(m2>=m1){\n //returned=9th 12.45\n //total 2*24h, plus 2hours difference from 10.30 to 12.30\n y=(numOfDays*24)+(h2-h1);\n fine=y*0.2;\n }\n }\n\n }\n\n\n //same logic and will multiply the 1st 3 days form 0.2 as to the requirement\n\n else if(numOfDays>3){\n if(h2<=h1){\n y=((numOfDays-4)*24)+((24-h1)+h2);\n fine=(y*0.5)+(24*3*0.2);\n }\n\n else{\n if(m2<m1){\n y=((numOfDays-3)*24)+((h2-h1)-1);\n fine=(y*0.5)+(3*24*0.2);\n }\n\n else if(m2>m1){\n y=((numOfDays-3)*24)+(h2-h1);\n fine=(y*0.5)+(3*24*0.2);\n }\n }\n\n\n }\n\n return fine;\n\n }", "public long getTotalTime() {\n var timeStarted = getStartTime();\n var timeFinished = getEndTime();\n return timeStarted.until(timeFinished, SECONDS);\n }", "private int calTimeScore(SlidingBoardManager slidingBoardManager) {\n double time = slidingBoardManager.getTime();\n\n return (int) Math.round((100 - time / 15));\n\n }", "org.apache.xmlbeans.XmlInt xgetPopupDuration();", "private int calculateDaysLeftOnLicense(Date pNowDate, Date pExpiryDate)\n{\n \n //milliseconds since 1/1/1970, 00:00:00 GMT\n long nowTime = pNowDate.getTime(); \n long expiryTime = pExpiryDate.getTime();\n\n long daysRemaining = expiryTime - nowTime; //time left in milliseconds\n \n daysRemaining /= 1000; //convert to seconds\n daysRemaining /= 60; //convert to minutes\n daysRemaining /= 60; //convert to hours\n daysRemaining /= 24; //convert to days\n \n if (daysRemaining > Integer.MAX_VALUE) {daysRemaining = Integer.MAX_VALUE;}\n if (daysRemaining < Integer.MIN_VALUE) {daysRemaining = Integer.MIN_VALUE;}\n \n return((int)daysRemaining);\n \n}", "public int calcAcknowledgeTime()\n {\n return( TIMEOUT );\n }", "public int calcAcknowledgeTime()\n {\n return( TIMEOUT );\n }", "private int getDays() {\n\t\tlong arrival = arrivalDate.toEpochDay();\n\t\tlong departure = departureDate.toEpochDay();\n\t\tint days = (int) Math.abs(arrival - departure);\n\n\t\treturn days;\n\t}", "private int toTime(int i) {\n int count = 0;\n\n //hours units\n count += toLeds((i / 6000) % 10);\n //hours tens\n count += toLeds(((i / 6000) % 100) / 10);\n\n //minutes units\n count += toLeds((i / 60) % 10);\n //minutes tens\n count += toLeds(((i / 60) % 100) / 10);\n\n //seconds units\n count += toLeds((i % 60) % 10);\n //seconds tens\n count += toLeds(((i % 60) % 100) / 10);\n\n return count;\n }", "private int getDodgeTime() {\n\t\treturn 10 - level;\n\t}", "public static Calendar getExchOpeningTime() {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n return result;\r\n }", "public int totalTime()\n {\n return departureTime - arrivalTime;\n }", "private static synchronized double calc_deltaT(double tjd) {\n\t\tdouble ans = 0;\n\t\tdouble B, Y, Ygreg, dd;\n\t\tint iy;\n\t\tint deltat_model = sw.swed.astro_models[SweConst.SE_MODEL_DELTAT];\n\t\tif (deltat_model == 0)\n\t\t\tdeltat_model = SweConst.SEMOD_DELTAT_DEFAULT;\n\t\t/* read additional values from swedelta.txt */\n\t\t/* AS_BOOL use_espenak_meeus = DELTAT_ESPENAK_MEEUS_2006; */\n\t\tY = 2000.0 + (tjd - SwephData.J2000) / 365.25;\n\t\tYgreg = 2000.0 + (tjd - SwephData.J2000) / 365.2425;\n\t\t/*\n\t\t * Before 1633 AD, if the macro DELTAT_ESPENAK_MEEUS_2006 is TRUE:\n\t\t * Polynomials by Espenak & Meeus 2006, derived from Stephenson &\n\t\t * Morrison 2004. Note, Espenak & Meeus use their formulae only from\n\t\t * 2000 BC on. However, they use the long-term formula of Morrison &\n\t\t * Stephenson, which can be used even for the remoter past.\n\t\t */\n\t\t/* if (use_espenak_meeus && tjd < 2317746.13090277789) { */\n\t\tif (deltat_model == SweConst.SEMOD_DELTAT_ESPENAK_MEEUS_2006 && tjd < 2317746.13090277789) {\n\t\t\treturn deltat_espenak_meeus_1620(tjd);\n\t\t}\n\t\t/*\n\t\t * If the macro DELTAT_ESPENAK_MEEUS_2006 is FALSE: Before 1620, we\n\t\t * follow Stephenson & Morrsion 2004. For the tabulated values 1000 BC\n\t\t * through 1600 AD, we use linear interpolation.\n\t\t */\n\t\tif (Y < TABSTART) {\n\t\t\tif (Y < TAB2_END) {\n\t\t\t\treturn deltat_stephenson_morrison_1600(tjd);\n\t\t\t} else {\n\t\t\t\t/*\n\t\t\t\t * between 1600 and 1620: linear interpolation between end of\n\t\t\t\t * table dt2 and start of table dt\n\t\t\t\t */\n\t\t\t\tif (Y >= TAB2_END) {\n\t\t\t\t\tB = TABSTART - TAB2_END;\n\t\t\t\t\tiy = (TAB2_END - TAB2_START) / TAB2_STEP;\n\t\t\t\t\tdd = (Y - TAB2_END) / B;\n\t\t\t\t\t/* ans = dt2[iy] + dd * (dt[0] / 100.0 - dt2[iy]); */\n\t\t\t\t\tans = dt2[iy] + dd * (dt[0] - dt2[iy]);\n\t\t\t\t\tans = adjust_for_tidacc(ans, Ygreg);\n\t\t\t\t\treturn ans / 86400.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * 1620 - today + a few years (tabend): Besselian interpolation from\n\t\t * tabulated values in table dt. See AA page K11.\n\t\t */\n\t\tif (Y >= TABSTART) {\n\t\t\treturn deltat_aa(tjd);\n\t\t}\n\t\treturn ans / 86400.0;\n\t}", "public double getMon6064() {\r\n\t\treturn mon6064;\r\n\t}", "public int getDurationTotal(){\n int out;\n long tempLong = 0;\n if(flights.size()==0){\n return Integer.MAX_VALUE;\n }\n\n out = flights.get(0).getDuration();\n if(flights.get(0).getDurationSecondLeg()!=null){\n out += flights.get(0).getDurationSecondLeg();\n }\n for(int i=1; i<flights.size(); i++){\n tempLong += (flights.get(i).getDepartureDate().getTime() - flights.get(i-1).getArrivalDate().getTime());\n out += flights.get(i).getDuration();\n if(flights.get(i).getDurationSecondLeg()!=null){\n out += flights.get(i).getDurationSecondLeg();\n }\n }\n out += (int)tempLong/(1000*60);\n return out;\n }", "public int updateDuration(){\n int newSecondsTotal = 0;\n for(int i = 0; i < MAX_SONGS_PLAYLIST; i++){\n if(playSongs[i] != null){\n newSecondsTotal += playSongs[i].songDurationSong();\n }\n }\n return newSecondsTotal;\n }", "@Override\n\tpublic int getCloseTime() {\n\t\treturn 0;\n\t}", "public double getSecs( );" ]
[ "0.63464344", "0.6157951", "0.61567205", "0.60082847", "0.5915011", "0.5870548", "0.5704308", "0.5387799", "0.5373567", "0.5367631", "0.53604513", "0.5343743", "0.5319286", "0.5290029", "0.5274184", "0.5247247", "0.52401394", "0.5233758", "0.52264714", "0.52064824", "0.52053106", "0.52016693", "0.5193553", "0.519295", "0.5187725", "0.5187201", "0.518018", "0.51725596", "0.51681626", "0.51539916", "0.51524204", "0.51475215", "0.5134534", "0.51277643", "0.51059973", "0.5104011", "0.5103036", "0.50921905", "0.50909764", "0.5089692", "0.5088484", "0.50880873", "0.5083583", "0.507862", "0.5075882", "0.5065294", "0.5057682", "0.505554", "0.5041756", "0.503342", "0.50308514", "0.50289494", "0.5028947", "0.5028711", "0.5025524", "0.50151116", "0.5012679", "0.5002492", "0.49983862", "0.4991998", "0.49879122", "0.4986155", "0.497756", "0.49696186", "0.49677", "0.4961965", "0.49542314", "0.4945064", "0.49387732", "0.4932393", "0.4929751", "0.4925844", "0.4924749", "0.49217075", "0.4920554", "0.49191275", "0.49138525", "0.4909239", "0.49050412", "0.49028236", "0.49013978", "0.49009827", "0.48979902", "0.48964775", "0.48946178", "0.48922336", "0.48882067", "0.488639", "0.488639", "0.48725468", "0.48711812", "0.48644817", "0.48609433", "0.48609418", "0.48589048", "0.48486954", "0.4841644", "0.48376387", "0.48367313", "0.48332554" ]
0.79507214
0
Given a data graph this function identifies all 'flats' on the graph. For the definition of a flat see the findAllFlatsOfAtLeastLength(int length, BaseGraph graph) function in this class
public static GraphFlatCollection<IGraphFlat> findAllFlats(BaseGraph<AbstractGraphPoint> graph) { //NB a 'FLAT' must be at least 2 seconds long GraphFlatCollection<IGraphFlat> result = DTUtil.findAllFlatsOfAtLeastLength(2, graph); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static GraphFlatCollection<IGraphFlat> findAllFlatsOfAtLeastLength(int length, BaseGraph<AbstractGraphPoint> graph) {\r\n GraphFlatCollection<IGraphFlat> result = new GraphFlatCollection<IGraphFlat>(graph);\r\n if (0 < length && graph != null) {\r\n if (1 < graph.size()) {\r\n //Get a descending iterator of graph points\r\n Iterator<AbstractGraphPoint> descIter = graph.descendingIterator();\r\n AbstractGraphPoint currPoint = descIter.next();\r\n GraphFlat currFlat = new GraphFlat(currPoint);\r\n while (descIter.hasNext()) {\r\n currPoint = descIter.next();\r\n if (!currFlat.addPoint(currPoint)) {\r\n //Value has changed add currFlat to collection\r\n if (currFlat.isAtLeastXLong(length)) {\r\n result.add(currFlat);\r\n }\r\n //This point is the start of a new flat\r\n currFlat = new GraphFlat(currPoint);\r\n }\r\n }\r\n //If the last flat is at least the required length add it\r\n if (currFlat.isAtLeastXLong(length)) {\r\n result.add(currFlat);\r\n }\r\n }\r\n }\r\n return result;\r\n }", "public void getAllPaths(Graph<Integer> graph) {\n\t\tTopologicalSort obj = new TopologicalSort();\r\n\t\tStack<Vertex<Integer>> result = obj.sort(graph);\r\n\t\t\r\n\t\t// source (one or multiple) must lie at the top\r\n\t\twhile(!result.isEmpty()) {\r\n\t\t\tVertex<Integer> currentVertex = result.pop();\r\n\t\t\t\r\n\t\t\tif(visited.contains(currentVertex.getId())) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tstack = new Stack<Vertex<Integer>>();\r\n\t\t\tSystem.out.println(\"Paths: \");\r\n\t\t\tvisited = new ArrayList<Long>();\r\n\t\t\tdfs(currentVertex);\r\n\t\t\t//System.out.println(stack);\r\n\t\t\t//GraphUtil.print(stack);\t\t\t\r\n\t\t}\r\n\r\n\t}", "public static Set<List<Vertex>> depthFirstSearch(Graph graph) {\n Set<List<Vertex>> arrayListHashSet=new HashSet<>();\n\n for(int i=0;i<graph.getVertices().size();i++){\n ArrayList<Vertex> visitedArrayList=new ArrayList<>();\n for(int j=0;j<graph.getVertices().size();j++){\n if(visitedArrayList.size()==0){\n if(!visitedArrayList.contains(graph.getVertices().get(i))){\n depthFirstSearch(graph.getVertices().get(i),visitedArrayList,graph);\n }\n }\n else{\n if(!visitedArrayList.contains(graph.getVertices().get(j))){\n depthFirstSearch(graph.getVertices().get(j),visitedArrayList,graph);\n }\n }\n }\n arrayListHashSet.add(visitedArrayList);\n }\n return arrayListHashSet; // this should be changed\n }", "public List<List<Integer>> allPathsSourceTarget(int[][] graph) {\n \n boolean[] visited = new boolean[graph.length];\n \n List<Integer> paths = new ArrayList();\n paths.add(0);\n \n List<List<Integer>> allPaths = new ArrayList();\n \n dfs(0,graph.length-1, paths,allPaths,visited,graph);\n \n return allPaths;\n }", "protected abstract Graph filterGraph();", "public static void Kruskals(int graph[][]) {\n\t\tgraph = ArraySort(graph, 1);\n\t\t\n\t\tint[][] sets = PopulateSets(graph);\n\t\tint i1;\n\t\tint i2;\n\t\tint max_node=0;\n\t\tint min_node=0;\n\t\tint count = 0;\n\t\tfor (int[] edge: graph) {\n\t\t\tSystem.out.printf(\"%d: \", ++count);\n\t\t\ti1 = FindEdge(sets, edge[0]);\n\t\t\tSystem.out.printf(\"Find(%d) returns %d\\t\", edge[0], i1);\n\t\t\ti2 = FindEdge(sets, edge[2]);\n\t\t\tSystem.out.printf(\"Find(%d) returns %d\\t\", edge[2], i2);\n\t\t\t\n\t\t\tif (i1 != i2) {\n\t\t\t\tif (i1 > i2){max_node = i1;min_node = i2;}\n\t\t\t\tif (i1 < i2){max_node = i2;min_node = i1;}\n\t\t\t\tsets[max_node] = UnionSets(sets[max_node], sets[min_node]);\n\t\t\t\tSystem.out.printf(\"Union(%d, %d) done\\n\", i1, i2);\n\t\t\t} else {\n\t\t\t\tSystem.out.printf(\"Union(%d, %d) not done. Same set\\n\", i1, i2);\n\t\t\t}\n\t\t\tShowForest(sets);\n\t\t}\n//\t\tsets[0] = UnionSets(sets[0], sets[1]);\n\t}", "public void DFS() {\r\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\r\n\r\n\t\t// Create a stack for DFS\r\n\t\tStack<Vertex> stack = new Stack<Vertex>();\r\n\r\n\t\tDFS(this.vertices[3], visited, stack); // DFS starting with 40\r\n\r\n\t\t// Call the helper function to print DFS traversal\r\n\t\t// starting from all vertices one by one\r\n\t\tfor (int i = 0; i < N; ++i)\r\n\t\t\tif (!visited.contains(this.vertices[i]))\r\n\t\t\t\tDFS(this.vertices[i], visited, stack);\r\n\t}", "static void floodfill() {\r\n\t\tprintThis(\"Flood Fill Demo (the input graph must be UNDIRECTED)\");\r\n\t\tnumComp = 0;\r\n\t\tdfs_num = new int[V];\r\n\t\tArrays.fill(dfs_num, DFS_WHITE);\r\n\t\tfor (int i = 0; i < V; i++)\r\n\t\t\tif (dfs_num[i] == DFS_WHITE)\r\n\t\t\t\tfloodfill(i, ++numComp);\r\n\t\tfor (int i = 0; i < V; i++)\r\n\t\t\tSystem.out.printf(\"Vertex %d has color %d\\n\", i, dfs_num[i]);\r\n\t}", "public static <V> void printAllShortestPaths(Graph<V> graph) {\n double[][] matrizPesos = graph.getGraphStructureAsMatrix();\n double[][] pesos = new double[matrizPesos.length][matrizPesos.length];\n V[] vertices = graph.getValuesAsArray();\n V[][] caminos = (V[][]) new Object[matrizPesos.length][matrizPesos.length];\n for (int x = 0; x < matrizPesos.length; x++) {\n for (int y = 0; y < matrizPesos.length; y++) {\n if (x == y) {\n pesos[x][y] = -1;\n } else {\n if (matrizPesos[x][y] == -1) {\n pesos[x][y] = Integer.MAX_VALUE; //Si no existe arista se pone infinito\n } else {\n pesos[x][y] = matrizPesos[x][y];\n }\n }\n caminos[x][y] = vertices[y];\n }\n }\n for (int x = 0; x < vertices.length; x++) { // Para cada uno de los vertices del grafo\n for (int y = 0; y < vertices.length; y++) { // Recorre la fila correspondiente al vertice\n for (int z = 0; z < vertices.length; z++) { //Recorre la columna correspondiente al vertice\n if (y != x && z != x) {\n double tam2 = pesos[y][x];\n double tam1 = pesos[x][z];\n if (pesos[x][z] != -1 && pesos[y][x] != -1) {\n double suma = pesos[x][z] + pesos[y][x];\n if (suma < pesos[y][z]) {\n pesos[y][z] = suma;\n caminos[y][z] = vertices[x];\n }\n }\n }\n }\n }\n }\n\n //Cuando se termina el algoritmo, se imprimen los caminos\n for (int x = 0; x < vertices.length; x++) {\n for (int y = 0; y < vertices.length; y++) {\n boolean seguir = true;\n int it1 = y;\n String hilera = \"\";\n while (seguir) {\n if (it1 != y) {\n hilera = vertices[it1] + \"-\" + hilera;\n } else {\n hilera += vertices[it1];\n }\n if (caminos[x][it1] != vertices[it1]) {\n int m = 0;\n boolean continuar = true;\n while (continuar) {\n if (vertices[m].equals(caminos[x][it1])) {\n it1 = m;\n continuar = false;\n } else {\n m++;\n }\n }\n } else {\n if (x == y) {\n System.out.println(\"El camino entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera);\n } else {\n hilera = vertices[x] + \"-\" + hilera;\n if (pesos[x][y] == Integer.MAX_VALUE) {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: infinito (no hay camino)\");\n } else {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera + \" con distancia de: \" + (pesos[x][y]));\n }\n }\n seguir = false;\n }\n }\n }\n System.out.println();\n }\n }", "public void flatten();", "public List<Collection<Vertex<Integer>>> detect(UndirectedGraph<Integer,Integer> graph){\n\t\tlong start = System.currentTimeMillis();\n\t\tList<Collection<Vertex<Integer>>> diamonds = find(graph);\n\t\tlong stop = System.currentTimeMillis();\n\t\tp1time = \"\"+(stop-start);\n\t\tfound=diamonds.size();\n\t\treturn diamonds;\n\t}", "public double getFlatness() {\n\treturn flatness;\n }", "public List<Set<SDGNode>> firstPass() {\n Object[] edges = icfg.edgeSet().toArray();\n\n // first, temporarily remove all edges but CF and CALL\n for (int i = 0; i < edges.length; i++) {\n SDGEdge e = (SDGEdge) edges[i];\n if (e.getKind() != SDGEdge.Kind.CONTROL_FLOW\n && e.getKind() != SDGEdge.Kind.CALL) {\n\n buffer.addFirst(e);\n icfg.removeEdge(e);\n }\n }\n\n // then compute SCCs\n StrongConnectivityInspector<SDGNode, SDGEdge> sci = new StrongConnectivityInspector<SDGNode, SDGEdge>(icfg);\n List<Set<SDGNode>> erg = sci.stronglyConnectedSets();\n\n // put return edges back\n for (SDGEdge e : buffer) {\n icfg.addEdge(e);\n }\n buffer.clear();\n\n return erg;\n }", "Set<String> bfsTraversal(Graph graph, String root) {\n Set<String> seen = new LinkedHashSet<String>();\n Queue<String> queue = new LinkedList<String>();\n queue.add(root);\n seen.add(root);\n\n while (!queue.isEmpty()) {\n String node = queue.poll();\n for (Node n : graph.getAdjacentNodes(node)) {\n if (!seen.contains(n.data)) {\n seen.add(n.data);\n queue.add(n.data);\n }\n }\n }\n\n return seen;\n }", "public boolean reducible() {\n if (dfsTree.back.isEmpty()) {\n return true;\n }\n int size = controlFlow.transitions.length;\n boolean[] loopEnters = dfsTree.loopEnters;\n TIntHashSet[] cycleIncomings = new TIntHashSet[size];\n // really this may be array, since dfs already ensures no duplicates\n TIntArrayList[] nonCycleIncomings = new TIntArrayList[size];\n int[] collapsedTo = new int[size];\n int[] queue = new int[size];\n int top;\n for (int i = 0; i < size; i++) {\n if (loopEnters[i]) {\n cycleIncomings[i] = new TIntHashSet();\n }\n nonCycleIncomings[i] = new TIntArrayList();\n collapsedTo[i] = i;\n }\n\n // from whom back connections\n for (Edge edge : dfsTree.back) {\n cycleIncomings[edge.to].add(edge.from);\n }\n // from whom ordinary connections\n for (Edge edge : dfsTree.nonBack) {\n nonCycleIncomings[edge.to].add(edge.from);\n }\n\n for (int w = size - 1; w >= 0 ; w--) {\n top = 0;\n // NB - it is modified later!\n TIntHashSet p = cycleIncomings[w];\n if (p == null) {\n continue;\n }\n TIntIterator iter = p.iterator();\n while (iter.hasNext()) {\n queue[top++] = iter.next();\n }\n\n while (top > 0) {\n int x = queue[--top];\n TIntArrayList incoming = nonCycleIncomings[x];\n for (int i = 0; i < incoming.size(); i++) {\n int y1 = collapsedTo[incoming.getQuick(i)];\n if (!dfsTree.isDescendant(y1, w)) {\n return false;\n }\n if (y1 != w && p.add(y1)) {\n queue[top++] = y1;\n }\n }\n }\n\n iter = p.iterator();\n while (iter.hasNext()) {\n collapsedTo[iter.next()] = w;\n }\n }\n\n return true;\n }", "public static <T> Set<List<T>> findSimpleCycles(Map<T, Set<T>> graph) {\n if (graph == null) {\n return null;\n }\n Set<List<T>> result = new HashSet<>();\n Set<T> vertices = new HashSet<>(graph.keySet());\n while (!graph.isEmpty()) {\n Set<Set<T>> components = findStronglyConnectedComponents(graph);\n Set<T> maxComponent = null;\n for (Set<T> component : components) {\n if (component.size() < 2) {\n if (isSelfCycle(graph, component)) {\n result.add(new ArrayList<>(component));\n }\n vertices.removeAll(component);\n } else if ((maxComponent == null) || (component.size() > maxComponent.size())) {\n maxComponent = component;\n }\n }\n if (maxComponent != null) {\n Map<T, Set<T>> subgraph = project(graph, maxComponent);\n T startVertex = maxComponent.iterator().next();\n result.addAll(findSimpleCycles(subgraph, startVertex));\n vertices.remove(startVertex);\n }\n graph = project(graph, vertices);\n }\n return result;\n }", "public List<Integer> topologicalOrder(int vertices, int[][] edges) {\n\t\tList<Integer> result = new ArrayList<>();\n\n\t\tMap<Integer, List<Integer>> graph = new HashMap<>();\n\t\tMap<Integer, Integer> freqMap = new HashMap<>();\n\n\t\t// Initialize\n\t\tfor (int i = 0; i < vertices; ++i) {\n\t\t\tgraph.put(i, new ArrayList<>());\n\t\t\tfreqMap.put(i, 0);\n\t\t}\n\n\t\tfor (int i = 0; i < edges.length; ++i) {\n\t\t\tgraph.get(edges[i][0]).add(edges[i][1]);\n\t\t\tfreqMap.put(edges[i][1], freqMap.get(edges[i][1]) + 1);\n\t\t}\n\n\t\tList<Integer> sources = freqMap.entrySet().stream().filter(x -> x.getValue() == 0).map(y -> y.getKey())\n\t\t\t\t.collect(Collectors.toList());\n\n\t\tQueue<Integer> sourceQueue = new LinkedList<>(sources);\n\n\t\twhile (!sourceQueue.isEmpty()) {\n\t\t\tint source = sourceQueue.poll();\n\t\t\tresult.add(source);\n\t\t\tfor (int elem : graph.get(source)) {\n\t\t\t\tif (freqMap.get(elem) == 1) {\n\t\t\t\t\tsourceQueue.offer(elem);\n\t\t\t\t\tfreqMap.remove(elem);\n\t\t\t\t} else {\n\t\t\t\t\tfreqMap.put(elem, freqMap.get(elem) - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If length is not same, then there is a cycle\n\t\treturn result.size() == vertices ? result : new ArrayList<>();\n\t}", "static void graphCheck(int u) {\n\t\tdfs_num[u] = DFS_GRAY; // color this as DFS_GRAY (temp)\r\n\t\tfor (int j = 0; j < (int) AdjList[u].size(); j++) {\r\n\t\t\tEdge v = AdjList[u].get(j);\r\n\t\t\tif (dfs_num[v.to] == DFS_WHITE) { // Tree Edge, DFS_GRAY to\r\n\t\t\t\t\t\t\t\t\t\t\t\t// DFS_WHITE\r\n\t\t\t\tdfs_parent[v.to] = u; // parent of this children is me\r\n\t\t\t\tgraphCheck(v.to);\r\n\t\t\t} else if (dfs_num[v.to] == DFS_GRAY) { // DFS_GRAY to DFS_GRAY\r\n\t\t\t\tif (v.to == dfs_parent[u]) // to differentiate these two\r\n\t\t\t\t\t\t\t\t\t\t\t// cases\r\n\t\t\t\t\tSystem.out.printf(\" Bidirectional (%d, %d) - (%d, %d)\\n\",\r\n\t\t\t\t\t\t\tu, v.to, v.to, u);\r\n\t\t\t\telse\r\n\t\t\t\t\t// la mas usada pillar si tiene un ciclo\r\n\t\t\t\t\tSystem.out.printf(\" Back Edge (%d, %d) (Cycle)\\n\", u, v.to);\r\n\t\t\t} else if (dfs_num[v.to] == DFS_BLACK) // DFS_GRAY to DFS_BLACK\r\n\t\t\t\tSystem.out.printf(\" Forward/Cross Edge (%d, %d)\\n\", u, v.to);\r\n\t\t}\r\n\t\tdfs_num[u] = DFS_BLACK; // despues de la recursion DFS_BLACK (DONE)\r\n\t}", "Set<String> dfsTraversal(Graph graph, String root) {\n Set<String> seen = new LinkedHashSet<String>();\n Stack<String> stack = new Stack<String>();\n stack.push(root);\n\n while (!stack.isEmpty()) {\n String node = stack.pop();\n if (!seen.contains(node)) {\n seen.add(node);\n for (Node n : graph.getAdjacentNodes(node)) {\n stack.push(n.data);\n }\n\n }\n }\n\n return seen;\n }", "private int[][] make_minimal_graph() {\n\n int[][] subs = new int[_subtypes.length][];\n for( int i=0; i<subs.length; i++ )\n subs[i] = _subtypes[i].clone();\n \n // For all types\n for( int i=0; i<subs.length; i++ ) {\n int[] subis = subs[i];\n // For all 'i' subtypes\n for( int j=0; j<subis.length && subis[j] != -1; j++ ) {\n int[] subjs = subs[subis[j]];\n // Pull out of subis all things found in subjs. We have a subtype isa\n // path from i->j by design of _subtypes, and the j->k list in subjs.\n // Remove any i->k as being redundant.\n int ix = j+1, ixx = j+1; // Index to read, index to keep non-dups\n int jx = 0; // Index to read the k's\n while( ix<subis.length && jx<subjs.length ) {\n int six = subis[ix];\n int sjx = subjs[jx];\n assert sjx != -1;\n if( six==-1 ) break; // Hit end-of-array sentinel\n if( six==sjx ) { ix++; jx++; } // i->j and j->sjx and i->sjx, skip both forward\n else if( six < sjx ) subis[ixx++] = subis[ix++]; // Keep and advance\n else jx++; // Advance\n }\n while( ixx < ix ) subis[ixx++] = -1; // Sentinel remaining unused elements\n }\n int ix = Util.find(subs[i],-1);\n if( ix != -1 ) subs[i] = Arrays.copyOfRange(subs[i],0,ix); // Compress extra elements\n }\n \n return subs;\n }", "public static ArrayList<Integer[]> compactForwardAlgorithmTriangles(ArrayList<Integer>[] graph) {\n Set<Pair<Integer, ArrayList<Integer>>> pairs = Utils.getSortedArrays(graph);\n Map<Integer, Integer> etas = Utils.getEtasMap(pairs);\n\n // sort adjacency arrays according to eta\n pairs.forEach(p -> p.getSecond().sort(Comparator.comparing(etas::get)));\n\n\n\n int triangleCount = 0;\n ArrayList<Integer[]> triangles = new ArrayList();\n\n\n // main part, in which we actually count triangles\n Iterator<Pair<Integer, ArrayList<Integer>>> iterator = pairs.iterator();\n while (iterator.hasNext()) {\n Pair<Integer, ArrayList<Integer>> pair = iterator.next();\n Integer v = pair.getFirst();\n ArrayList<Integer> v_neighbors = graph[v];\n\n for (int u : v_neighbors) {\n if (etas.get(u) > etas.get(v)) {\n ArrayList<Integer> u_neighbors = graph[u];\n\n Iterator<Integer> uIterator = u_neighbors.iterator(), vIterator = v_neighbors.iterator();\n\n if (uIterator.hasNext() && vIterator.hasNext()) {\n Integer u_ = uIterator.next(), v_ = vIterator.next();\n while (uIterator.hasNext() && vIterator.hasNext() && etas.get(u_) < etas.get(v)\n && etas.get(v_) < etas.get(v)) {\n if (etas.get(u_) < etas.get(v_))\n u_ = uIterator.next();\n else if (etas.get(u_) > etas.get(v_))\n v_ = vIterator.next();\n else {\n Integer[] triangle = new Integer[3];\n\n triangle[0] = u;\n triangle[1] = v;\n triangle[2] = u_;\n triangles.add(triangle);\n\n\n triangleCount++;\n\n u_ = uIterator.next();\n v_ = vIterator.next();\n\n }\n }\n\n }\n }\n }\n }\n return triangles;\n }", "private void computeAllPaths()\n {\n for (Station src : this.graph.stations)\n {\n List<Station> visited = new ArrayList<Station>();\n computePathsForNode(src, null, null, visited);\n }\n Print.printTripList(this.tripList);\n }", "public List<Integer> getDepthFirstSearchTraversal(GraphStructure graph) {\r\n\t\tpathList = new ArrayList<Integer>();\r\n\t\tint numberOfVertices = graph.getNumberOfVertices();\r\n\t\tisVisited = new boolean [graph.getNumberOfVertices()];\r\n\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\ttraverseRecursively(graph,0);\r\n\t\treturn pathList;\r\n\t}", "ArrayList<Node> DFSIter( Graph graph, final Node start, final Node end)\n {\n boolean visited[] = new boolean[graph.numNodes];\n Stack<Node> stack = new Stack<Node>();\n Map< Node,Node> parentPath = new HashMap< Node,Node>(); \n stack.push(start);\n\n while ( !stack.isEmpty() )\n {\n Node currNode = stack.pop();\n // end loop when goal node is found\n if ( currNode == end )\n break;\n // If node has already been visited, skip it\n if ( visited[currNode.id] )\n continue;\n else\n {\n visited[currNode.id] = true;\n int numEdges = currNode.connectedNodes.size();\n\n for ( int i = 0; i < numEdges; i++ )\n {\n Node edgeNode = currNode.connectedNodes.get(i);\n if ( !visited[edgeNode.id] )\n {\n stack.push( edgeNode );\n parentPath.put( edgeNode, currNode);\n }\n }\n \n }\n }\n\n ArrayList<Node> path = new ArrayList<Node>();\n Node currNode = end;\n while ( currNode != null )\n {\n path.add(0, currNode);\n currNode = parentPath.get(currNode);\n }\n\n return path;\n }", "private void DFS() {\n\t\tfor(Node node: nodeList) {\r\n\t\t\tif(!node.isVisited())\r\n\t\t\t\tdfsVisit(node);\r\n\t\t}\r\n\t}", "static void dfs(int[][] G){\n\t\tStack<Integer> s = new Stack<Integer>();\n\t\tfor (int ver_start=0; ver_start<N; ver_start++){\n\t\t\tif (visited[ver_start]) continue;\n\t\t\ts.push(ver_start);\n\t\t\tvisited[ver_start] = true;\n\n\t\t\twhile(!s.isEmpty()){\n\t\t\t\tint vertex = s.pop();\n\t\t\t\tSystem.out.print((vertex+1) + \" \");\n\t\t\t\tfor (int i=0; i<N; i++){\n\t\t\t\t\tif (G[vertex][i] == 1 && !visited[i]){\n\t\t\t\t\t\t// find neigbor of current vertex and not visited\n\t\t\t\t\t\t// add into the stack\n\t\t\t\t\t\ts.push(i);\n\t\t\t\t\t\tvisited[i] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public static Long compactForwardAlgorithm(ArrayList<Integer>[] graph) {\n // define injective function eta - takes O(n log(n)) time\n Set<Pair<Integer, ArrayList<Integer>>> pairs = Utils.getSortedArrays(graph);\n Map<Integer, Integer> etas = Utils.getEtasMap(pairs);\n\n // sort adjacency arrays according to eta\n pairs.forEach(p -> Collections.sort(p.getSecond(), new Comparator<Integer>() {\n @Override\n public int compare(Integer first, Integer second) {\n if (etas.get(first) > etas.get(second))\n return 1;\n else\n return -1;\n }\n }));\n\n int triangleCount = 0;\n\n // main part, in which we actually count triangles\n Iterator<Pair<Integer, ArrayList<Integer>>> iterator = pairs.iterator();\n while (iterator.hasNext()) {\n Pair<Integer, ArrayList<Integer>> pair = iterator.next();\n Integer v = pair.getFirst();\n ArrayList<Integer> v_neighbors = graph[v];\n\n for (int u : v_neighbors) {\n if (etas.get(u) > etas.get(v)) {\n ArrayList<Integer> u_neighbors = graph[u];\n\n Iterator<Integer> uIterator = u_neighbors.iterator(), vIterator = v_neighbors.iterator();\n\n if (uIterator.hasNext() && vIterator.hasNext()) {\n Integer u_ = uIterator.next(), v_ = vIterator.next();\n while (uIterator.hasNext() && vIterator.hasNext() && etas.get(u_) < etas.get(v)\n && etas.get(v_) < etas.get(v)) {\n if (etas.get(u_) < etas.get(v_))\n u_ = uIterator.next();\n else if (etas.get(u_) > etas.get(v_))\n v_ = vIterator.next();\n else {\n triangleCount++;\n u_ = uIterator.next();\n v_ = vIterator.next();\n }\n }\n\n }\n }\n }\n }\n return new Long(triangleCount);\n }", "@Override\n public long[ ][ ] count() {\n // precompute common nodes\n for (int x = 0; x < n; x++) {\n for (int n1 = 0; n1 < deg[x]; n1++) {\n int a = adj[x][n1];\n for (int n2 = n1 + 1; n2 < deg[x]; n2++) {\n int b = adj[x][n2];\n Tuple ab = createTuple(a, b);\n common2.put(ab, common2.getOrDefault(ab, 0) + 1);\n for (int n3 = n2 + 1; n3 < deg[x]; n3++) {\n int c = adj[x][n3];\n boolean st = adjacent(adj[a], b) ? (adjacent(adj[a], c) || adjacent(adj[b], c)) :\n (adjacent(adj[a], c) && adjacent(adj[b], c));\n if (!st) continue;\n Tuple abc = createTuple(a, b, c);\n common3.put(abc, common3.getOrDefault(abc, 0) + 1);\n }\n }\n }\n }\n\n // precompute triangles that span over edges\n int[ ] tri = countTriangles();\n\n // count full graphlets\n long[ ] C5 = new long[n];\n int[ ] neigh = new int[n];\n int[ ] neigh2 = new int[n];\n int nn, nn2;\n for (int x = 0; x < n; x++) {\n for (int nx = 0; nx < deg[x]; nx++) {\n int y = adj[x][nx];\n if (y >= x) break;\n nn = 0;\n for (int ny = 0; ny < deg[y]; ny++) {\n int z = adj[y][ny];\n if (z >= y) break;\n if (adjacent(adj[x], z)) {\n neigh[nn++] = z;\n }\n }\n for (int i = 0; i < nn; i++) {\n int z = neigh[i];\n nn2 = 0;\n for (int j = i + 1; j < nn; j++) {\n int zz = neigh[j];\n if (adjacent(adj[z], zz)) {\n neigh2[nn2++] = zz;\n }\n }\n for (int i2 = 0; i2 < nn2; i2++) {\n int zz = neigh2[i2];\n for (int j2 = i2 + 1; j2 < nn2; j2++) {\n int zzz = neigh2[j2];\n if (adjacent(adj[zz], zzz)) {\n C5[x]++;\n C5[y]++;\n C5[z]++;\n C5[zz]++;\n C5[zzz]++;\n }\n }\n }\n }\n }\n }\n\n int[ ] common_x = new int[n];\n int[ ] common_x_list = new int[n];\n int ncx = 0;\n int[ ] common_a = new int[n];\n int[ ] common_a_list = new int[n];\n int nca = 0;\n\n // set up a system of equations relating orbit counts\n for (int x = 0; x < n; x++) {\n for (int i = 0; i < ncx; i++) common_x[common_x_list[i]] = 0;\n ncx = 0;\n\n // smaller graphlets\n orbit[x][0] = deg[x];\n for (int nx1 = 0; nx1 < deg[x]; nx1++) {\n int a = adj[x][nx1];\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = adj[x][nx2];\n if (adjacent(adj[a], b)) orbit[x][3]++;\n else orbit[x][2]++;\n }\n for (int na = 0; na < deg[a]; na++) {\n int b = adj[a][na];\n if (b != x && !adjacent(adj[x], b)) {\n orbit[x][1]++;\n if (common_x[b] == 0) common_x_list[ncx++] = b;\n common_x[b]++;\n }\n }\n }\n\n long f_71 = 0, f_70 = 0, f_67 = 0, f_66 = 0, f_58 = 0, f_57 = 0; // 14\n long f_69 = 0, f_68 = 0, f_64 = 0, f_61 = 0, f_60 = 0, f_55 = 0, f_48 = 0, f_42 = 0, f_41 = 0; // 13\n long f_65 = 0, f_63 = 0, f_59 = 0, f_54 = 0, f_47 = 0, f_46 = 0, f_40 = 0; // 12\n long f_62 = 0, f_53 = 0, f_51 = 0, f_50 = 0, f_49 = 0, f_38 = 0, f_37 = 0, f_36 = 0; // 8\n long f_44 = 0, f_33 = 0, f_30 = 0, f_26 = 0; // 11\n long f_52 = 0, f_43 = 0, f_32 = 0, f_29 = 0, f_25 = 0; // 10\n long f_56 = 0, f_45 = 0, f_39 = 0, f_31 = 0, f_28 = 0, f_24 = 0; // 9\n long f_35 = 0, f_34 = 0, f_27 = 0, f_18 = 0, f_16 = 0, f_15 = 0; // 4\n long f_17 = 0; // 5\n long f_22 = 0, f_20 = 0, f_19 = 0; // 6\n long f_23 = 0, f_21 = 0; // 7\n\n for (int nx1 = 0; nx1 < deg[x]; nx1++) {\n int a = inc[x][nx1]._1, xa = inc[x][nx1]._2;\n\n for (int i = 0; i < nca; i++) common_a[common_a_list[i]] = 0;\n nca = 0;\n for (int na = 0; na < deg[a]; na++) {\n int b = adj[a][na];\n for (int nb = 0; nb < deg[b]; nb++) {\n int c = adj[b][nb];\n if (c == a || adjacent(adj[a], c)) continue;\n if (common_a[c] == 0) common_a_list[nca++] = c;\n common_a[c]++;\n }\n }\n\n // x = orbit-14 (tetrahedron)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int nx3 = nx2 + 1; nx3 < deg[x]; nx3++) {\n int c = inc[x][nx3]._1, xc = inc[x][nx3]._2;\n if (!adjacent(adj[a], c) || !adjacent(adj[b], c)) continue;\n orbit[x][14]++;\n f_70 += common3.getOrDefault(createTuple(a, b, c), 0) - 1;\n f_71 += (tri[xa] > 2 && tri[xb] > 2) ? (common3.getOrDefault(createTuple(x, a, b), 0) - 1) : 0;\n f_71 += (tri[xa] > 2 && tri[xc] > 2) ? (common3.getOrDefault(createTuple(x, a, c), 0) - 1) : 0;\n f_71 += (tri[xb] > 2 && tri[xc] > 2) ? (common3.getOrDefault(createTuple(x, b, c), 0) - 1) : 0;\n f_67 += tri[xa] - 2 + tri[xb] - 2 + tri[xc] - 2;\n f_66 += common2.getOrDefault(createTuple(a, b), 0) - 2;\n f_66 += common2.getOrDefault(createTuple(a, c), 0) - 2;\n f_66 += common2.getOrDefault(createTuple(b, c), 0) - 2;\n f_58 += deg[x] - 3;\n f_57 += deg[a] - 3 + deg[b] - 3 + deg[c] - 3;\n }\n }\n\n // x = orbit-13 (diamond)\n for (int nx2 = 0; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int nx3 = nx2 + 1; nx3 < deg[x]; nx3++) {\n int c = inc[x][nx3]._1, xc = inc[x][nx3]._2;\n if (!adjacent(adj[a], c) || adjacent(adj[b], c)) continue;\n orbit[x][13]++;\n f_69 += (tri[xb] > 1 && tri[xc] > 1) ? (common3.getOrDefault(createTuple(x, b, c), 0) - 1) : 0;\n f_68 += common3.getOrDefault(createTuple(a, b, c), 0) - 1;\n f_64 += common2.getOrDefault(createTuple(b, c), 0) - 2;\n f_61 += tri[xb] - 1 + tri[xc] - 1;\n f_60 += common2.getOrDefault(createTuple(a, b), 0) - 1;\n f_60 += common2.getOrDefault(createTuple(a, c), 0) - 1;\n f_55 += tri[xa] - 2;\n f_48 += deg[b] - 2 + deg[c] - 2;\n f_42 += deg[x] - 3;\n f_41 += deg[a] - 3;\n }\n }\n\n // x = orbit-12 (diamond)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int na = 0; na < deg[a]; na++) {\n int c = inc[a][na]._1, ac = inc[a][na]._2;\n if (c == x || adjacent(adj[x], c) || !adjacent(adj[b], c)) continue;\n orbit[x][12]++;\n f_65 += (tri[ac] > 1) ? common3.getOrDefault(createTuple(a, b, c), 0) : 0;\n f_63 += common_x[c] - 2;\n f_59 += tri[ac] - 1 + common2.getOrDefault(createTuple(b, c), 0) - 1;\n f_54 += common2.getOrDefault(createTuple(a, b), 0) - 2;\n f_47 += deg[x] - 2;\n f_46 += deg[c] - 2;\n f_40 += deg[a] - 3 + deg[b] - 3;\n }\n }\n\n // x = orbit-8 (cycle)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (adjacent(adj[a], b)) continue;\n for (int na = 0; na < deg[a]; na++) {\n int c = inc[a][na]._1, ac = inc[a][na]._2;\n if (c == x || adjacent(adj[x], c) || !adjacent(adj[b], c)) continue;\n orbit[x][8]++;\n f_62 += (tri[ac] > 0) ? common3.getOrDefault(createTuple(a, b, c), 0) : 0;\n f_53 += tri[xa] + tri[xb];\n f_51 += tri[ac] + common2.getOrDefault(createTuple(c, b), 0);\n f_50 += common_x[c] - 2;\n f_49 += common_a[b] - 2;\n f_38 += deg[x] - 2;\n f_37 += deg[a] - 2 + deg[b] - 2;\n f_36 += deg[c] - 2;\n }\n }\n\n // x = orbit-11 (paw)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int nx3 = 0; nx3 < deg[x]; nx3++) {\n int c = inc[x][nx3]._1, xc = inc[x][nx3]._2;\n if (c == a || c == b || adjacent(adj[a], c) || adjacent(adj[b], c)) continue;\n orbit[x][11]++;\n f_44 += tri[xc];\n f_33 += deg[x] - 3;\n f_30 += deg[c] - 1;\n f_26 += deg[a] - 2 + deg[b] - 2;\n }\n }\n\n // x = orbit-10 (paw)\n for (int nx2 = 0; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int nb = 0; nb < deg[b]; nb++) {\n int c = inc[b][nb]._1, bc = inc[b][nb]._2;\n if (c == x || c == a || adjacent(adj[a], c) || adjacent(adj[x], c)) continue;\n orbit[x][10]++;\n f_52 += common_a[c] - 1;\n f_43 += tri[bc];\n f_32 += deg[b] - 3;\n f_29 += deg[c] - 1;\n f_25 += deg[a] - 2;\n }\n }\n\n // x = orbit-9 (paw)\n for (int na1 = 0; na1 < deg[a]; na1++) {\n int b = inc[a][na1]._1, ab = inc[a][na1]._2;\n if (b == x || adjacent(adj[x], b)) continue;\n for (int na2 = na1 + 1; na2 < deg[a]; na2++) {\n int c = inc[a][na2]._1, ac = inc[a][na2]._2;\n if (c == x || !adjacent(adj[b], c) || adjacent(adj[x], c)) continue;\n orbit[x][9]++;\n f_56 += (tri[ab] > 1 && tri[ac] > 1) ? common3.getOrDefault(createTuple(a, b, c), 0) : 0;\n f_45 += common2.getOrDefault(createTuple(b, c), 0) - 1;\n f_39 += tri[ab] - 1 + tri[ac] - 1;\n f_31 += deg[a] - 3;\n f_28 += deg[x] - 1;\n f_24 += deg[b] - 2 + deg[c] - 2;\n }\n }\n\n // x = orbit-4 (path)\n for (int na = 0; na < deg[a]; na++) {\n int b = inc[a][na]._1, ab = inc[a][na]._2;\n if (b == x || adjacent(adj[x], b)) continue;\n for (int nb = 0; nb < deg[b]; nb++) {\n int c = inc[b][nb]._1, bc = inc[b][nb]._2;\n if (c == a || adjacent(adj[a], c) || adjacent(adj[x], c)) continue;\n orbit[x][4]++;\n f_35 += common_a[c] - 1;\n f_34 += common_x[c];\n f_27 += tri[bc];\n f_18 += deg[b] - 2;\n f_16 += deg[x] - 1;\n f_15 += deg[c] - 1;\n }\n }\n\n // x = orbit-5 (path)\n for (int nx2 = 0; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (b == a || adjacent(adj[a], b)) continue;\n for (int nb = 0; nb < deg[b]; nb++) {\n int c = inc[b][nb]._1, bc = inc[b][nb]._2;\n if (c == x || adjacent(adj[a], c) || adjacent(adj[x], c)) continue;\n orbit[x][5]++;\n f_17 += deg[a] - 1;\n }\n }\n\n // x = orbit-6 (claw)\n for (int na1 = 0; na1 < deg[a]; na1++) {\n int b = inc[a][na1]._1, ab = inc[a][na1]._2;\n if (b == x || adjacent(adj[x], b)) continue;\n for (int na2 = na1 + 1; na2 < deg[a]; na2++) {\n int c = inc[a][na2]._1, ac = inc[a][na2]._2;\n if (c == x || adjacent(adj[x], c) || adjacent(adj[b], c)) continue;\n orbit[x][6]++;\n f_22 += deg[a] - 3;\n f_20 += deg[x] - 1;\n f_19 += deg[b] - 1 + deg[c] - 1;\n }\n }\n\n // x = orbit-7 (claw)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (adjacent(adj[a], b)) continue;\n for (int nx3 = nx2 + 1; nx3 < deg[x]; nx3++) {\n int c = inc[x][nx3]._1, xc = inc[x][nx3]._2;\n if (adjacent(adj[a], c) || adjacent(adj[b], c)) continue;\n orbit[x][7]++;\n f_23 += deg[x] - 3;\n f_21 += deg[a] - 1 + deg[b] - 1 + deg[c] - 1;\n }\n }\n }\n\n // solve equations\n orbit[x][72] = C5[x];\n orbit[x][71] = (f_71 - 12 * orbit[x][72]) / 2;\n orbit[x][70] = (f_70 - 4 * orbit[x][72]);\n orbit[x][69] = (f_69 - 2 * orbit[x][71]) / 4;\n orbit[x][68] = (f_68 - 2 * orbit[x][71]);\n orbit[x][67] = (f_67 - 12 * orbit[x][72] - 4 * orbit[x][71]);\n orbit[x][66] = (f_66 - 12 * orbit[x][72] - 2 * orbit[x][71] - 3 * orbit[x][70]);\n orbit[x][65] = (f_65 - 3 * orbit[x][70]) / 2;\n orbit[x][64] = (f_64 - 2 * orbit[x][71] - 4 * orbit[x][69] - 1 * orbit[x][68]);\n orbit[x][63] = (f_63 - 3 * orbit[x][70] - 2 * orbit[x][68]);\n orbit[x][62] = (f_62 - 1 * orbit[x][68]) / 2;\n orbit[x][61] = (f_61 - 4 * orbit[x][71] - 8 * orbit[x][69] - 2 * orbit[x][67]) / 2;\n orbit[x][60] = (f_60 - 4 * orbit[x][71] - 2 * orbit[x][68] - 2 * orbit[x][67]);\n orbit[x][59] = (f_59 - 6 * orbit[x][70] - 2 * orbit[x][68] - 4 * orbit[x][65]);\n orbit[x][58] = (f_58 - 4 * orbit[x][72] - 2 * orbit[x][71] - 1 * orbit[x][67]);\n orbit[x][57] = (f_57 - 12 * orbit[x][72] - 4 * orbit[x][71] - 3 * orbit[x][70] - 1 * orbit[x][67] - 2 * orbit[x][66]);\n orbit[x][56] = (f_56 - 2 * orbit[x][65]) / 3;\n orbit[x][55] = (f_55 - 2 * orbit[x][71] - 2 * orbit[x][67]) / 3;\n orbit[x][54] = (f_54 - 3 * orbit[x][70] - 1 * orbit[x][66] - 2 * orbit[x][65]) / 2;\n orbit[x][53] = (f_53 - 2 * orbit[x][68] - 2 * orbit[x][64] - 2 * orbit[x][63]);\n orbit[x][52] = (f_52 - 2 * orbit[x][66] - 2 * orbit[x][64] - 1 * orbit[x][59]) / 2;\n orbit[x][51] = (f_51 - 2 * orbit[x][68] - 2 * orbit[x][63] - 4 * orbit[x][62]);\n orbit[x][50] = (f_50 - 1 * orbit[x][68] - 2 * orbit[x][63]) / 3;\n orbit[x][49] = (f_49 - 1 * orbit[x][68] - 1 * orbit[x][64] - 2 * orbit[x][62]) / 2;\n orbit[x][48] = (f_48 - 4 * orbit[x][71] - 8 * orbit[x][69] - 2 * orbit[x][68] - 2 * orbit[x][67] - 2 * orbit[x][64] - 2 * orbit[x][61] - 1 * orbit[x][60]);\n orbit[x][47] = (f_47 - 3 * orbit[x][70] - 2 * orbit[x][68] - 1 * orbit[x][66] - 1 * orbit[x][63] - 1 * orbit[x][60]);\n orbit[x][46] = (f_46 - 3 * orbit[x][70] - 2 * orbit[x][68] - 2 * orbit[x][65] - 1 * orbit[x][63] - 1 * orbit[x][59]);\n orbit[x][45] = (f_45 - 2 * orbit[x][65] - 2 * orbit[x][62] - 3 * orbit[x][56]);\n orbit[x][44] = (f_44 - 1 * orbit[x][67] - 2 * orbit[x][61]) / 4;\n orbit[x][43] = (f_43 - 2 * orbit[x][66] - 1 * orbit[x][60] - 1 * orbit[x][59]) / 2;\n orbit[x][42] = (f_42 - 2 * orbit[x][71] - 4 * orbit[x][69] - 2 * orbit[x][67] - 2 * orbit[x][61] - 3 * orbit[x][55]);\n orbit[x][41] = (f_41 - 2 * orbit[x][71] - 1 * orbit[x][68] - 2 * orbit[x][67] - 1 * orbit[x][60] - 3 * orbit[x][55]);\n orbit[x][40] = (f_40 - 6 * orbit[x][70] - 2 * orbit[x][68] - 2 * orbit[x][66] - 4 * orbit[x][65] - 1 * orbit[x][60] - 1 * orbit[x][59] - 4 * orbit[x][54]);\n orbit[x][39] = (f_39 - 4 * orbit[x][65] - 1 * orbit[x][59] - 6 * orbit[x][56]) / 2;\n orbit[x][38] = (f_38 - 1 * orbit[x][68] - 1 * orbit[x][64] - 2 * orbit[x][63] - 1 * orbit[x][53] - 3 * orbit[x][50]);\n orbit[x][37] = (f_37 - 2 * orbit[x][68] - 2 * orbit[x][64] - 2 * orbit[x][63] - 4 * orbit[x][62] - 1 * orbit[x][53] - 1 * orbit[x][51] - 4 * orbit[x][49]);\n orbit[x][36] = (f_36 - 1 * orbit[x][68] - 2 * orbit[x][63] - 2 * orbit[x][62] - 1 * orbit[x][51] - 3 * orbit[x][50]);\n orbit[x][35] = (f_35 - 1 * orbit[x][59] - 2 * orbit[x][52] - 2 * orbit[x][45]) / 2;\n orbit[x][34] = (f_34 - 1 * orbit[x][59] - 2 * orbit[x][52] - 1 * orbit[x][51]) / 2;\n orbit[x][33] = (f_33 - 1 * orbit[x][67] - 2 * orbit[x][61] - 3 * orbit[x][58] - 4 * orbit[x][44] - 2 * orbit[x][42]) / 2;\n orbit[x][32] = (f_32 - 2 * orbit[x][66] - 1 * orbit[x][60] - 1 * orbit[x][59] - 2 * orbit[x][57] - 2 * orbit[x][43] - 2 * orbit[x][41] - 1 * orbit[x][40]) / 2;\n orbit[x][31] = (f_31 - 2 * orbit[x][65] - 1 * orbit[x][59] - 3 * orbit[x][56] - 1 * orbit[x][43] - 2 * orbit[x][39]);\n orbit[x][30] = (f_30 - 1 * orbit[x][67] - 1 * orbit[x][63] - 2 * orbit[x][61] - 1 * orbit[x][53] - 4 * orbit[x][44]);\n orbit[x][29] = (f_29 - 2 * orbit[x][66] - 2 * orbit[x][64] - 1 * orbit[x][60] - 1 * orbit[x][59] - 1 * orbit[x][53] - 2 * orbit[x][52] - 2 * orbit[x][43]);\n orbit[x][28] = (f_28 - 2 * orbit[x][65] - 2 * orbit[x][62] - 1 * orbit[x][59] - 1 * orbit[x][51] - 1 * orbit[x][43]);\n orbit[x][27] = (f_27 - 1 * orbit[x][59] - 1 * orbit[x][51] - 2 * orbit[x][45]) / 2;\n orbit[x][26] = (f_26 - 2 * orbit[x][67] - 2 * orbit[x][63] - 2 * orbit[x][61] - 6 * orbit[x][58] - 1 * orbit[x][53] - 2 * orbit[x][47] - 2 * orbit[x][42]);\n orbit[x][25] = (f_25 - 2 * orbit[x][66] - 2 * orbit[x][64] - 1 * orbit[x][59] - 2 * orbit[x][57] - 2 * orbit[x][52] - 1 * orbit[x][48] - 1 * orbit[x][40]) / 2;\n orbit[x][24] = (f_24 - 4 * orbit[x][65] - 4 * orbit[x][62] - 1 * orbit[x][59] - 6 * orbit[x][56] - 1 * orbit[x][51] - 2 * orbit[x][45] - 2 * orbit[x][39]);\n orbit[x][23] = (f_23 - 1 * orbit[x][55] - 1 * orbit[x][42] - 2 * orbit[x][33]) / 4;\n orbit[x][22] = (f_22 - 2 * orbit[x][54] - 1 * orbit[x][40] - 1 * orbit[x][39] - 1 * orbit[x][32] - 2 * orbit[x][31]) / 3;\n orbit[x][21] = (f_21 - 3 * orbit[x][55] - 3 * orbit[x][50] - 2 * orbit[x][42] - 2 * orbit[x][38] - 2 * orbit[x][33]);\n orbit[x][20] = (f_20 - 2 * orbit[x][54] - 2 * orbit[x][49] - 1 * orbit[x][40] - 1 * orbit[x][37] - 1 * orbit[x][32]);\n orbit[x][19] = (f_19 - 4 * orbit[x][54] - 4 * orbit[x][49] - 1 * orbit[x][40] - 2 * orbit[x][39] - 1 * orbit[x][37] - 2 * orbit[x][35] - 2 * orbit[x][31]);\n orbit[x][18] = (f_18 - 1 * orbit[x][59] - 1 * orbit[x][51] - 2 * orbit[x][46] - 2 * orbit[x][45] - 2 * orbit[x][36] - 2 * orbit[x][27] - 1 * orbit[x][24]) / 2;\n orbit[x][17] = (f_17 - 1 * orbit[x][60] - 1 * orbit[x][53] - 1 * orbit[x][51] - 1 * orbit[x][48] - 1 * orbit[x][37] - 2 * orbit[x][34] - 2 * orbit[x][30]) / 2;\n orbit[x][16] = (f_16 - 1 * orbit[x][59] - 2 * orbit[x][52] - 1 * orbit[x][51] - 2 * orbit[x][46] - 2 * orbit[x][36] - 2 * orbit[x][34] - 1 * orbit[x][29]);\n orbit[x][15] = (f_15 - 1 * orbit[x][59] - 2 * orbit[x][52] - 1 * orbit[x][51] - 2 * orbit[x][45] - 2 * orbit[x][35] - 2 * orbit[x][34] - 2 * orbit[x][27]);\n }\n\n return orbit;\n }", "public List<Integer> eventualSafeNodes(int[][] graph) {\n int N = graph.length;\n int[] color = new int[N];\n List<Integer> ans = new ArrayList<>();\n\n for (int i = 0; i < N; i++) {\n if (hasNoCycle(i, color, graph))\n ans.add(i);\n }\n\n return ans;\n }", "void DFS() {\n \t\n \t// Mark all the vertices as not visited(set as false by default in java) \n \tboolean visited[] = new boolean[V];\n \t\n \t// Call the recursive helper function to print DFS traversal \n // starting from all vertices one by one \n \tfor (int i=0; i<V; i++) { \n \t\t if (visited[i] == false)\n \t\t\t DFSUtil(i, visited);\n \t}\n }", "public static void main(String args[]) {\n int V = 4;\n Graph g = new Graph(V);\n g.addEdge(0, 1);\n g.addEdge(0, 2);\n g.addEdge(1, 2);\n g.addEdge(2, 0);\n g.addEdge(2, 3);\n g.addEdge(3, 3);\n\n int src = 1;\n int dest = 3;\n boolean[] visited = new boolean[V];\n\n // To store the complete path between source and destination\n Stack<Integer> path1 = new Stack<>();\n\n if (hasPathDFS(g, src, dest, visited, path1)) {\n System.out.println(\"There is a path from \" + src + \" to \" + dest);\n System.out.println(\"The complete path is \" + path1);\n } else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n src = 3;\n dest = 1;\n // To store the complete path between source and destination\n Stack<Integer> path2 = new Stack<>();\n\n if (hasPathDFS(g, src, dest, visited, path2)) System.out.println(\"There is a path from \" + src + \" to \" + dest);\n else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n // total number of nodes in the graph (labeled from 0 to 7)\n int n = 8;\n\n // List of graph edges as per the above diagram\n Graph g2 = new Graph(n);\n /**\n * There is a path from 1 to 3\n * The complete path is [1, 2, 3]\n * There is no path from 3 to 1\n * There is a path from 0 to 7\n * The complete path is [0, 3, 4, 6, 7]\n */\n\n g2.addEdge(0, 3);\n g2.addEdge(1, 0);\n g2.addEdge(1, 2);\n g2.addEdge(1, 4);\n g2.addEdge(2, 7);\n g2.addEdge(3, 4);\n g2.addEdge(3, 5);\n g2.addEdge(4, 3);\n g2.addEdge(4, 6);\n g2.addEdge(5, 6);\n g2.addEdge(6, 7);\n\n // source and destination vertex\n src = 0;\n dest = 7;\n\n // To store the complete path between source and destination\n Stack<Integer> path = new Stack<>();\n boolean[] visited2 = new boolean[n];\n\n if (hasPathDFS(g2, src, dest, visited2, path)) {\n System.out.println(\"There is a path from \" + src + \" to \" + dest);\n System.out.println(\"The complete path is \" + path);\n } else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n\n }", "public List<Long> depthTraverse(){\n return depthTraverseGen(null);\n }", "public NetworkFold(final FlatNetwork flat) {\r\n\t\tthis.weights = EngineArray.arrayCopy(flat.getWeights());\r\n\t\tthis.output = EngineArray.arrayCopy(flat.getLayerOutput());\r\n\t}", "@Override\n\tpublic List<Node<E>> bfs(DirectedGraph<E> graph) {\n\t\tList<Node<E>> returnList = new ArrayList<>(); // O(1)\n\t\tHashSet<Node<E>> visitedList = new HashSet<>(); // O(1)\n\t\tHashSet<Node<E>> hashSet = new HashSet<>(); // O(1)\n\n\t\t// If the graph does contains heads, iterate from the head.\n\t\tif(graph.headCount() > 0) { // O(1)\n\t\t\tIterator<Node<E>> heads = graph.heads(); // O(1)\n\t\t\twhile(heads.hasNext()) { // O(n)\n\t\t\t\tNode<E> node = heads.next(); // O(1)\n\n\t\t\t\tif(!visitedList.contains(node)) { // O(1)\n\t\t\t\t\tnode.num = visitedList.size(); // O(1)\n\t\t\t\t\tvisitedList.add(node); // O(1)\n\t\t\t\t\thashSet.add(node); // O(1)\n\t\t\t\t\treturnList.add(node); // O(1)\n\t\t\t\t\treturnList = bfsRecursive(hashSet, visitedList, returnList); // O(1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Else start from the first node in the graph.\n\t\telse {\n\t\t\thashSet.add(graph.getNodeFor(graph.allItems().get(0))); // O(1)\n\t\t\treturnList = bfsRecursive(hashSet, visitedList, returnList); // O(1)\n\t\t}\n\t\treturn returnList;\n\t}", "public int shortestPathLength(int[][] graph) {\n Queue<MyPath> q = new LinkedList<>();\n Set<String> visited = new HashSet<>();\n\n for (int i = 0; i < graph.length; i++) {\n MyPath path = new MyPath(i, (1 << i));\n visited.add(path.convertToString());\n q.offer(path);\n }\n\n int length = 0;\n while (!q.isEmpty()) {\n int size = q.size();\n while (size-- > 0) {\n MyPath next = q.poll();\n int curr = next.curr;\n int currPath = next.nodes;\n // Assume we have two nodes -> n = 2\n // 1 << 2 -> 100\n // 100 - 1 -> 011 which means both nodes are visited\n if (currPath == (1 << graph.length) - 1) {\n return length;\n }\n for (int neighbors : graph[curr]) {\n MyPath newPath = new MyPath(neighbors, currPath | (1 << neighbors));\n String pathString = newPath.convertToString();\n if (visited.add(pathString)) {\n q.offer(newPath);\n }\n }\n }\n length++;\n }\n\n return -1;\n }", "public void DFS() {\r\n for (int i = 0; i < vertexNum; i++) {\r\n DFS(i);\r\n }\r\n }", "public List<List<Integer>> topologicalSort(int vertices, int[][] edges) {\n List<List<Integer>> result = new LinkedList<>();\n // corner case\n if (vertices == 0 || edges == null || edges.length == 0) {\n return result;\n }\n\n // 0 - define two hashmaps, one stores the vertices and its adjacent nodes;\n // the other stores the vertices and the times that vertex is an adjacent node of others\n Map<Integer, List<Integer>> adjacency = new HashMap<>();\n Map<Integer, Integer> freq = new HashMap<>();\n\n // 1 - initialize two hashMaps\n for (int vertex = 0; vertex < vertices; vertex++) {\n adjacency.put(vertex, new LinkedList<Integer>());\n freq.put(vertex, 0);\n }\n\n // 2 - build two hashmaps using the given input data\n for (int[] edge : edges) {\n // edge[0] - source vertex\n // edge[1] - destination vertex\n adjacency.get(edge[0]).add(edge[1]);\n freq.put(edge[1], freq.get(edge[1]) + 1);\n }\n\n // 3 - find all source vertices (vertices that have no incoming edges and have only outgoing edges)\n Queue<Integer> sources = new LinkedList<>();\n for (int vertex : freq.keySet()) {\n if (freq.get(vertex) == 0) {\n sources.offer(vertex);\n }\n }\n\n // 4 - find the next sources recursively\n findSources(result, new LinkedList<Integer>(), adjacency, freq, sources);\n\n return result;\n }", "public void doDfsIterative(Graph g, int s) {\n boolean[] myVisited = new boolean[8];\n Stack<Integer> stack = new Stack<>();\n stack.push(s);\n myVisited[s] = true;\n while (!stack.isEmpty()) {\n int top = stack.pop();\n System.out.print(\"[\" + top + \"] \");\n for (int e : g.adj[top]) {\n if (!myVisited[e]) {\n stack.push(e);\n myVisited[e] = true;\n }\n }\n }\n\n }", "public void DFS2() {\n boolean[] visited = new boolean[numVertices];\n int[] predecessors = new int[numVertices];\n for (int i = 0; i < numVertices; i++) {\n if (visited[i] == false && hasCycle(0, visited, predecessors)) {\n System.out.println(\"Cycle has found\");\n return;\n }\n }\n System.out.println(\"No cycle found in the graph\");\n }", "public MyArrayList<MyArrayList<Node>> DFS() {\n t = 0;\n for (int i = 0; i < nodes.size(); i++) {\n Node node = nodes.get(i);\n // reset all nodes in the graph to the initial DFS state\n node.setColor(Color.WHITE);\n node.setD(0);\n node.setF(0);\n node.setParent(null);\n }\n MyArrayList<MyArrayList<Node>> components = new MyArrayList<>();\n for (int i = 0; i < nodes.size(); i++) {\n Node node = nodes.get(i);\n if (node.getColor() == Color.WHITE) {\n // each time we start from a vertex here we are starting a new DFS component\n MyArrayList<Node> component = new MyArrayList<>();\n dfsVisit(node, component);\n components.add(component);\n }\n }\n return components;\n }", "public static void botched_dfs2(Graph g, int s) {\n Stack<Integer> stack = new Stack<Integer>();\n boolean visited[] = new boolean[g.vertices()];\n stack.push(s);\n System.out.println(s);\n visited[s] = true;\n while (!stack.empty()) {\n int u = stack.pop();\n for (Edge e : g.next(u))\n if (!visited[e.to]) {\n System.out.println(e.to);\n visited[e.to] = true;\n stack.push(e.to);\n }\n }\n }", "public FlatData flatten() {\n\t\tString data;\n\t\tdouble[] coords = coordinateTools.localToCoordinates(this);\n\t\tdata = this.getClass().getName() + \":\";\n\t\tdata += coords[0] + \"#\" + coords[1];\n\t\treturn new FlatData(data);\n\t}", "public abstract int numOfSameTypeNeighbourToReproduce();", "public static Set<List<Vertex>> breadthFirstSearch(Graph graph) {\n\n Set<List<Vertex>> arrayListHashSet=new HashSet<>();\n\n for(Vertex v : graph.getVertices()){\n ArrayList<Vertex> visitedArrayList=new ArrayList<>();\n Queue<Vertex> vertexQueue=new ArrayDeque<>();\n visitedArrayList.add(v);\n vertexQueue.offer(v);\n while (!vertexQueue.isEmpty()){\n for(Vertex v1:graph.getNeighbors(vertexQueue.poll())){\n if(!visitedArrayList.contains(v1)){\n visitedArrayList.add(v1);\n vertexQueue.offer(v1);\n }\n }\n }\n arrayListHashSet.add(visitedArrayList);\n }\n return arrayListHashSet; // this should be changed\n }", "public static void main(String[] args) {\n Graph graph = new Graph();\n graph.addEdge(0, 1);\n graph.addEdge(0, 4);\n\n graph.addEdge(1,0);\n graph.addEdge(1,5);\n graph.addEdge(1,2);\n graph.addEdge(2,1);\n graph.addEdge(2,6);\n graph.addEdge(2,3);\n\n graph.addEdge(3,2);\n graph.addEdge(3,7);\n\n graph.addEdge(7,3);\n graph.addEdge(7,6);\n graph.addEdge(7,11);\n\n graph.addEdge(5,1);\n graph.addEdge(5,9);\n graph.addEdge(5,6);\n graph.addEdge(5,4);\n\n graph.addEdge(9,8);\n graph.addEdge(9,5);\n graph.addEdge(9,13);\n graph.addEdge(9,10);\n\n graph.addEdge(13,17);\n graph.addEdge(13,14);\n graph.addEdge(13,9);\n graph.addEdge(13,12);\n\n graph.addEdge(4,0);\n graph.addEdge(4,5);\n graph.addEdge(4,8);\n graph.addEdge(8,4);\n graph.addEdge(8,12);\n graph.addEdge(8,9);\n graph.addEdge(12,8);\n graph.addEdge(12,16);\n graph.addEdge(12,13);\n graph.addEdge(16,12);\n graph.addEdge(16,17);\n graph.addEdge(17,13);\n graph.addEdge(17,16);\n graph.addEdge(17,18);\n\n graph.addEdge(18,17);\n graph.addEdge(18,14);\n graph.addEdge(18,19);\n\n graph.addEdge(19,18);\n graph.addEdge(19,15);\n LinkedList<Integer> visited = new LinkedList();\n List<ArrayList<Integer>> paths = new ArrayList<ArrayList<Integer>>();\n int currentNode = START;\n visited.add(START);\n new searchEasy().findAllPaths(graph, visited, paths, currentNode);\n for(ArrayList<Integer> path : paths){\n for (Integer node : path) {\n System.out.print(node);\n System.out.print(\" \");\n }\n System.out.println();\n }\n }", "private static int findConnectedComponents(Map<Integer, Set<Integer>> graph, boolean[] visited) {\n int count = 0;\n for (int u : graph.keySet()) {\n if (!visited[u]) {\n dfs(u, graph, visited);\n count++;\n }\n }\n return count;\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 static int numIslands(char[][] mat) {\r\n \r\n if(mat.length == 0 || mat[0].length == 0)\r\n \treturn 0;\r\n\r\n ROW = mat.length;\r\n\t\tCOL = mat[0].length;\r\n\r\n\t\t// Make a boolean matrix that will keep track whether a cell is visited or not\r\n\t\tboolean[][] visited = new boolean[ROW][COL];\r\n\t\t\r\n\t\t// We start counting the total number of DFS calls.\r\n\t\tint count = 0;\r\n\r\n\t\tfor (int i = 0; i < ROW; i++) \r\n\t\t{\r\n\t\t\tfor (int j = 0; j < COL; j++) \r\n\t\t\t{\r\n\t\t\t\t// If the cell is unvisited and is Land (1) check its neighbors by calling DFS()\r\n\t\t\t\t// This cell will be marked as visited in this process.\r\n\t\t\t\t// This cell will make a recursive call to each of their own 8 neighbors.\t\r\n\t\t\t\t// The base case of that recursion will be when all nodes of the subgraph have been visited\r\n\t\t\t\tif(mat[i][j] == '1' && !visited[i][j])\r\n\t\t\t\t{\r\n\t\t\t\t\tDFS(mat, i, j, visited);\r\n\r\n\t\t\t\t\t// After the above call is finished, a lot more 1s would've been converted into 0s.\r\n\t\t\t\t\t// Now the next time the above condition will be true will be when there is a disconnected 1 found.\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\t\r\n\t\treturn count;\r\n }", "@Override\r\n\tpublic boolean isConnected(GraphStructure graph) {\r\n\t\tgetDepthFirstSearchTraversal(graph);\r\n\t\tif(pathList.size()==graph.getNumberOfVertices()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public FlatData flatten() {\n\t\t\treturn new Text(description).flatten();\n\t\t}", "public MyArrayList<MyArrayList<Node>> DFSRecursive() {\n t = 0;\n for (int i = 0; i < nodes.size(); i++) {\n Node node = nodes.get(i);\n // reset all nodes in the graph to the initial DFS state\n node.setColor(Color.WHITE);\n node.setD(0);\n node.setParent(null);\n }\n MyArrayList<MyArrayList<Node>> components = new MyArrayList<>();\n for (int i = 0; i < nodes.size(); i++) {\n Node node = nodes.get(i);\n if (node.getColor() == Color.WHITE) {\n MyArrayList<Node> component = new MyArrayList<>();\n this.dfsVisitRecursive(node, component);\n components.add(component);\n }\n }\n return components;\n }", "public static void main(String[] args) {\n\t\tint[][] edges = {{0,1},{1,2},{1,3},{4,5}};\n\t\tGraph graph = createAdjacencyList(edges, true);\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) unDirected : \"+getNumberOfConnectedComponents(graph));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) Directed: \"+getNumberOfConnectedComponents(createAdjacencyList(edges, false)));\n\t\t\n\t\t//Shortest Distance & path\n\t\tint[][] edgesW = {{0,1,1},{1,2,4},{2,3,1},{0,3,3},{0,4,1},{4,3,1}};\n\t\tgraph = createAdjacencyList(edgesW, true);\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(graph, 0, 3));\n\t\t\n\t\t//Graph represented in Adjacency Matrix\n\t\tint[][] adjacencyMatrix = {{0,1,0,0,1,0},{1,0,1,1,0,0},{0,1,0,1,0,0},{0,1,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}};\n\t\t\n\t\t// Connected components or Friends circle\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Recursive: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Iterative: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(adjacencyMatrix, 0, 3));\n\t\t\n\t\t// Number of Islands\n\t\tint[][] islandGrid = {{1,1,0,1},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Recursive: \"+ getNumberOfIslands(islandGrid));\n\t\t// re-initialize\n\t\tint[][] islandGridIterative = {{1,1,0,0},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Iterative: \"+ getNumberOfIslandsIterative(islandGridIterative));\n\n\n\t}", "public static void depthFirstSearchRecursive(ArrayList<Node> graph) {\n\t\tSystem.out.println(\"DFS Recursive:\");\n\t\tif(graph.size() == 0) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tGraphUtils.cleanGraph(graph);\n\t\t\n\t\tfor(Node node : graph) {\n\t\t\tdfsRecursive(node);\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tGraphUtils.cleanGraph(graph);\n\t}", "public boolean isBipartite(List<GraphNode> graph) {\n Map<GraphNode, Integer> group = new HashMap<>();\n for (GraphNode node: graph) {\n if (!bfs(group, node)) {\n return false;\n }\n }\n return true;\n }", "public static Long neighborPairsSingle(Set<Integer>[] graph) {\n long triangleCount = 0;\n int degv, degu, degw;\n for (int v = 0; v < graph.length; v++) {\n degv = graph[v].size();\n for (Integer u : graph[v]) {\n degu = graph[u].size();\n if (degu > degv || (degu == degv && v < u)) {\n for (Integer w : graph[v]) {\n if (w <= u)\n continue;\n degw = graph[w].size();\n if (degw > degv || (degw == degv && v < w)) {\n if (graph[u].contains(w))\n triangleCount++;\n }\n }\n }\n }\n }\n return triangleCount;\n }", "public static void main(String[] args) throws IOException {\n\n // read in graph\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt(), m = scanner.nextInt();\n ArrayList<Integer>[] graph = new ArrayList[n];\n for (int i = 0; i < n; i++)\n graph[i] = new ArrayList<>();\n\n for (int i = 0; i < m; i++) {\n scanner.nextLine();\n int u = scanner.nextInt() - 1, v = scanner.nextInt() - 1; // convert to 0 based index\n graph[u].add(v);\n graph[v].add(u);\n }\n\n int[] dist = new int[n];\n Arrays.fill(dist, -1);\n // partition the vertices in each of the components of the graph\n for (int u = 0; u < n; u++) {\n if (dist[u] == -1) {\n // bfs\n Queue<Integer> queue = new LinkedList<>();\n queue.add(u);\n dist[u] = 0;\n while (!queue.isEmpty()) {\n int w = queue.poll();\n for (int v : graph[w]) {\n if (dist[v] == -1) { // unvisited\n dist[v] = (dist[w] + 1) % 2;\n queue.add(v);\n } else if (dist[w] == dist[v]) { // visited and form a odd cycle\n System.out.println(-1);\n return;\n } // otherwise the dist will not change\n }\n }\n }\n\n }\n\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));\n // vertices with the same dist are in the same group\n List<Integer>[] groups = new ArrayList[2];\n groups[0] = new ArrayList<>();\n groups[1] = new ArrayList<>();\n for (int u = 0; u < n; u++) {\n groups[dist[u]].add(u + 1);\n }\n for (List<Integer> g: groups) {\n writer.write(String.valueOf(g.size()));\n writer.newLine();\n for (int u: g) {\n writer.write(String.valueOf(u));\n writer.write(' ');\n }\n writer.newLine();\n }\n\n writer.close();\n\n\n }", "public void flatten()\n\t{\n\t}", "public void dfs() {\n\t\tfor (Vertice v : vertices) {\n\t\t\tv.setVisited(false);\n\t\t}\n\t\tfor (Vertice v : vertices) {\n\t\t\tif (!v.getVisited()) {\n\t\t\t\tVisitar(v, -1);\n\t\t\t}\n\t\t}\n\t}", "default void flatten() {\n\t\tFieldGraph<F> flatGraph = FieldGraph.of(getFields());\n\t\tC flatClone = cloneFlat();\t// have to clone, because pull doesn't change value if pulling from self\n\t\tfor (F field : getFields())\n\t\t\tpull(field, flatClone, flatGraph);\n\t}", "Set<Set<V>> routine3(Graph<V, E> g)\n {\n Set<Set<V>> NuvList = new HashSet<>();\n for (V u : g.vertexSet()) {\n for (V v : g.vertexSet()) {\n if (u == v || !g.containsEdge(u, v))\n continue;\n NuvList.add(N(g, u, v));\n }\n }\n\n Set<Set<V>> tripleList = new HashSet<>();\n for (V a : g.vertexSet()) {\n for (V b : g.vertexSet()) {\n if (a == b || g.containsEdge(a, b))\n continue;\n Set<V> Nab = N(g, a, b);\n for (V c : g.vertexSet()) {\n if (isTripleRelevant(g, a, b, c)) {\n tripleList.add(X(g, Nab, c));\n }\n }\n }\n }\n Set<Set<V>> res = new HashSet<>();\n for (Set<V> Nuv : NuvList) {\n for (Set<V> triple : tripleList) {\n Set<V> temp = new HashSet<>();\n temp.addAll(Nuv);\n temp.addAll(triple);\n res.add(temp);\n }\n }\n return res;\n }", "public static ArrayList<String> connectors2(Graph g) {\n boolean[] visits = new boolean[g.members.length]; \n for (int i=0;i<=g.members.length-1;i++) {\n \tvisits[i]=false;\n }\n int[] dfsnum = new int[g.members.length];\n int[] back = new int[g.members.length];\n ArrayList<String> answer = new ArrayList<String>();\n\n //driver portion\n for (Person person : g.members) {\n //if it hasn't been visited\n if (visits[g.map.get(person.name)]==false){\n //for different islands\n dfsnum = new int[g.members.length];\n dfs(g.map.get(person.name), g.map.get(person.name), g, visits, dfsnum, back, answer);\n }\n }\n \n //check if vertex has one neighbor\n for (int i = 0; i < answer.size(); i++) {\n Friend ptr = g.members[g.map.get(answer.get(i))].first;\n //counts number of neighbors\n int count = 0;\n while (ptr != null) {\n ptr = ptr.next;\n count++;\n }\n if (count == 1) answer.remove(i);\n if (count == 0) answer.remove(i);\n } \n for (Person member : g.members) {\n if (member.first!=null&& member.first.next == null) {\n if (answer.contains(g.members[member.first.fnum].name)==false)\n \t\t answer.add(g.members[member.first.fnum].name);\n }\n }\n answer=modify(answer,g);\n if (answer==null||answer.size()==0) return null;\n return answer;\n }", "int fordFulkerson(int graph[][], int s, int t) {\n int u, v; // Create a residual graph and fill the residual graph with given capacities in the original graph as residual capacities in residual graph\n int rGraph[][] = new int[MaxFlow.graph.getNumOfNode()][MaxFlow.graph.getNumOfNode()]; // Residual graph where rGraph[i][j] indicates residual capacity of edge from i to j (if there is an edge. If rGraph[i][j] is 0, then there is not)\n\n for (u = 0; u < MaxFlow.graph.getNumOfNode(); u++)\n for (v = 0; v < MaxFlow.graph.getNumOfNode(); v++)\n rGraph[u][v] = graph[u][v]; //store the graph capacities\n\n int parent[] = new int[MaxFlow.graph.getNumOfNode()]; // This array is filled by BFS and to store path\n int max_flow = 0; // There is no flow initially\n\n while (bfs(rGraph, s, t, parent)) { // Augment the flow while there is path from source to sink\n int path_flow = Integer.MAX_VALUE; // Find minimum residual capacity of the edges along the path filled by BFS. Or we can say find the maximum flow through the path found.\n for (v = t; v != s; v = parent[v]) { //when v=0 stop the loop\n u = parent[v];\n path_flow = Math.min(path_flow, rGraph[u][v]);\n }\n\n for (v = t; v != s; v = parent[v]) { // update residual capacities of the edges and reverse edges along the path\n u = parent[v];\n rGraph[u][v] -= path_flow; //min the path cap\n rGraph[v][u] += path_flow; //add the path cap\n\n }\n System.out.println(\"Augmenting Path \"+ path_flow);\n max_flow += path_flow; // Add path flow to overall flow\n }\n return max_flow; // Return the overall flow\n }", "public void setFlatness(double flatness) {\n\tthis.flatness = flatness;\n\tsetShape(shape);\n }", "public void dft_r (Vertex[] vertices, Stack<Vertex> s, boolean[] visited, int i) {\n\tVertex v = vertices[i];\n\ts.push(v);\n\n\twhile (!visited[i]) {\n\t\tvisited[i] = true;\n\n\t\tfor (int j : v.neighbors){\n\t\t\tdft_r(vertices, s, visited, j);\n\t\t}\n\t}\n\t\n\ts.pop();\n\t\n\tSystem.out.println(s.toString());\t\n}", "private List<List<Integer>> dfs(int[][] graph, int start, Map<Integer, List<List<Integer>>> memo) {\n if (start == graph.length - 1) {\n return Collections.singletonList(Collections.singletonList(start));\n } else {\n List<List<Integer>> cur = new ArrayList<>();\n for (int dep : graph[start]) {\n List<List<Integer>> next = dfs(graph, dep, memo);\n for (List<Integer> path : next) {\n List<Integer> temp = new ArrayList<>();\n temp.add(start);\n temp.addAll(path);\n cur.add(temp);\n }\n }\n return memo.put(start, cur);\n }\n }", "public void shortestPathsNodes() {\n for (int sourceNode = 0; sourceNode < wordGraph.V(); sourceNode++) {\n BreadthFirstDirectedPaths bfs = new BreadthFirstDirectedPaths(wordGraph, sourceNode);\n\n for (int goalNode = 0; goalNode < wordGraph.V(); goalNode++) {\n Iterable<Integer> shortestPath = bfs.pathTo(goalNode);\n int pathLength = -1;\n if (shortestPath != null) {\n for (int edge : shortestPath) {\n pathLength++;\n }\n }\n if (pathLength != -1) {\n }\n System.out.println(pathLength);\n }\n }\n }", "public void topologicalSort() {\n\t\tboolean[] visited = new boolean[edges.length];\n\n\t\tfor (int i = 0; i < visited.length; i++) {\n\t\t\tif (visited[i] == false) {\n\t\t\t\tdfs(i, visited);\n\t\t\t}\n\t\t}\n\n\t}", "protected void resetGraph() {\n for (List<Edge> path : graph) {\r\n for (Edge e : path) {\r\n e.flow = 0;\r\n }\r\n }\r\n }", "public static int[][] completeGraph(int length) {\r\n\t\tint[][] res= new int[length][length];\r\n\t\tfor(int i=0;i!=length;i++)\r\n\t\t\tfor(int j=0;j!=length;j++) {\r\n\t\t\t\tif(i!=j)\r\n\t\t\t\t\tres[i][j]=1;\r\n\t\t\t}\r\n\t\treturn res;\r\n\t}", "public List<Integer> eventualSafeNodes(int[][] graph) {\n boolean[] visited = new boolean[graph.length];\n boolean[] onStack = new boolean[graph.length];\n boolean[] onCycle = new boolean[graph.length];\n\n for (int i = 0; i < graph.length; i++) {\n if (!visited[i]) {\n if (hasCycle(i, graph, visited, onStack, onCycle)) {\n onCycle[i] = true;\n }\n }\n // System.out.println(i+ \"-->\"+Arrays.toString(onCycle));\n }\n\n List<Integer> res = new ArrayList<>(visited.length);\n for (int i = 0; i < onCycle.length; i++) {\n if (!onCycle[i]) {\n res.add(i);\n }\n }\n return res;\n }", "void dfs(){\n // start from the index 0\n for (int vertex=0; vertex<v; vertex++){\n // check visited or not\n if (visited[vertex]==false){\n Explore(vertex);\n }\n }\n }", "public void doDfsGraphMatrix(char[][] grid) {\n boolean[] myVisited = new boolean[8];\n // row number represents node, so row number will be pushed to stack\n Stack<Integer> stack = new Stack<>();\n stack.push(0);\n myVisited[0] = true;\n // should be same idea, when adj list, loop the row\n while (!stack.isEmpty()) {\n int r = stack.pop();\n System.out.print(\"[\" + r + \"] \");\n for (int c = 0; c < grid[r].length; c++) {\n // when there is a path\n if (grid[r][c] == '1' && !visited[c]) {\n stack.push(c);\n visited[c] = true;\n }\n }\n }\n\n\n }", "public static void depthFirstSearchIterative(ArrayList<Node> graph) {\n\t\tSystem.out.println(\"DFS Iterative:\");\n\t\tif(graph.size() == 0) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tGraphUtils.cleanGraph(graph);\n\n\t\tDeque<Node> stack = new ArrayDeque<Node>();\n\t\tfor(Node node : graph) {\n\t\t\tif(node.state != Node.State.UNDISCOVERED) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnode.state = Node.State.DISCOVERED;\n\t\t\tstack.push(node);\n\t\t\twhile(!stack.isEmpty()) {\n\t\t\t\tnode = stack.pop();\n\t\t\t\t\n\t\t\t\t//process node\n\t\t\t\tSystem.out.print(node.name + \" -> \");\n\t\t\t\t\n\t\t\t\tfor(Edge e : node.edges) {\n\t\t\t\t\t//process edge\n\t\t\t\t\tNode neighbor = e.getNeighbor(node);\n\t\t\t\t\t\n\t\t\t\t\t//first time we see this node it gets added to the stack for later processing\n\t\t\t\t\tif(neighbor.state == Node.State.UNDISCOVERED) {\n\t\t\t\t\t\tneighbor.state = Node.State.DISCOVERED;\n\t\t\t\t\t\tstack.push(neighbor);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//finished with this node\n\t\t\t\tnode.state = Node.State.COMPLETE;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\n\t\tGraphUtils.cleanGraph(graph);\n\t}", "public PathIterator getPathIterator(AffineTransform at, double flatness) {\n return getPathIterator(at);\n }", "public static void main(String[] args) throws IOException {\n BufferedReader f = new BufferedReader(new FileReader(\"fcolor.in\"));\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"fcolor.out\")));\n StringTokenizer st = new StringTokenizer(f.readLine());\n numNode = Integer.parseInt(st.nextToken());\n numEdge = Integer.parseInt(st.nextToken());\n fans = new ArrayList[numNode];\n for (int i = 0; i < numNode; i++) {\n fans[i] = new ArrayList<>();\n }\n for (int i = 0; i < numEdge; i++) {\n st = new StringTokenizer(f.readLine());\n int star = Integer.parseInt(st.nextToken()) - 1;\n int fan = Integer.parseInt(st.nextToken()) - 1;\n fans[star].add(fan);\n }\n visited = new boolean[numNode];\n finder = new int[numNode];\n for (int i = 0; i < finder.length; i++) {\n finder[i] = i;\n }\n headFan = new int[numNode];\n Arrays.fill(headFan, -1);\n for (int i = 0; i < numNode; i++) {\n if (visited[i])\n continue;\n dfs(i);\n }\n\n HashMap<Integer, Integer> group2Col = new HashMap<>();\n int counter = 1;\n for (int i = 0; i < numNode; i++) {\n int father = find(i);\n if (group2Col.containsKey(father)) {\n out.println(group2Col.get(father));\n } else {\n group2Col.put(father, counter);\n out.println(counter);\n counter++;\n }\n }\n out.close();\n }", "public boolean dfs_iterative_util(LinkedList<Integer>[] graph, boolean[] visited, int s){\n Stack<Integer> fringe = new Stack<Integer>();\n Set<Integer> currStack = new HashSet<Integer>();\n \n fringe.push(s);\n currStack.add(s);\n \n while(!fringe.isEmpty()){\n int curr = fringe.pop();\n if(currStack.contains(curr))\n return false;\n visited[curr] = true;\n currStack.add(curr);\n if(graph[curr] != null){\n Iterator<Integer> itr = graph[curr].iterator();\n while(itr.hasNext()){\n int n = itr.next();\n \n if(!visited[n]){\n fringe.push(n);\n }\n }\n currStack.remove(curr);\n }\n \n }\n \n return true;\n }", "public static void botched_dfs3(Graph g, int s) {\n int cpt = 0;\n\n Stack<Integer> stack = new Stack<Integer>();\n boolean visited[] = new boolean[g.vertices()];\n stack.push(s);\n while (!stack.empty()) {\n System.out.println(\"Capacité : \" + stack.capacity());\n int u = stack.pop();\n if (!visited[u]) {\n visited[u] = true;\n System.out.println(u);\n for (Edge e : g.next(u))\n if (!visited[e.to]) {\n stack.push(e.to);\n cpt++;\n }\n }\n }\n }", "public void depthFirstTraverse() {\n\t\tInteger first = (Integer) edges.keySet().toArray()[0];\n\t\t// track whether vertex was visited\n\t\tHashMap<Integer, Boolean> visited = buildVisited();\n\t\tdepthFirstTraverse(first, visited);\n\t}", "@Override\n\tpublic boolean isConnected() {\n\t\tif(this.GA.nodeSize() ==1 || this.GA.nodeSize()==0) return true;\n\t\tgraph copied = this.copy();\n\t\ttagZero(copied);\n\t\tCollection<node_data> s = copied.getV();\n\t\tIterator it = s.iterator();\n\t\tnode_data temp = (node_data) it.next();\n\t\tDFSUtil(copied,temp);\n\t\tfor (node_data node : s) {\n\t\t\tif (node.getTag() == 0) return false;\n\t\t}\n\t\ttransPose(copied);\n\t\ttagZero(copied);\n\t Collection<node_data> s1 = copied.getV();\n\t\tIterator it1 = s1.iterator();\n\t\tnode_data temp1 = (node_data) it1.next();\n\t\tDFSUtil(copied,temp1);\n\t\tfor (node_data node1 : s1) {\n\t\t\tif (node1.getTag() == 0) return false;\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\r\n\tpublic void DFS() {\r\n\t\tvertices.forEach((E e, Vertex<E> u) -> {\r\n\t\t\tu.setColor(Color.WHITE);\r\n\t\t\tu.setPredecessor(null);\r\n\t\t});\r\n\t\tDFStime = 0;\r\n\t\tvertices.forEach((E e, Vertex<E> u) -> {\r\n\t\t\tif(u.getColor() == Color.WHITE) {\r\n\t\t\t\tDFSVisit(u);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public void makeAllCollapse(GraphData data){\r\n// \t\tSystem.out.println(\"Collapsing all..\");\r\n \t\tcollapsingList.clear();\r\n \t\tthis.collapsingList.add(new Integer(0));\r\n \t\tfor (int i=1;i<data.nnodes; i++){\r\n \t\t\tif ((data.nodes[i].inDegree > 1) || (data.nodes[i].outDegree>1))\r\n \t\t\t\t\tthis.collapsingList.add(new Integer(i));\r\n \t\t\t}\r\n \t\tthis.clearCollapseList(data);\r\n\t\tthis.unCollaspeAll(data);\r\n\t\tthis.collapseAll(data);\r\n \t}", "@Override\r\n public Set<List<String>> findAllPaths(int sourceId, int targetId, int reachability) {\r\n //all paths found\r\n Set<List<String>> allPaths = new HashSet<List<String>>();\r\n //collects path in one iteration\r\n Set<List<String>> newPathsCollector = new HashSet<List<String>>();\r\n //same as the solution but with inverted edges\r\n Set<List<String>> tmpPathsToTarget = new HashSet<List<String>>();\r\n //final solution\r\n Set<List<String>> pathsToTarget = new HashSet<List<String>>();\r\n \r\n String[] statementTokens = null; \r\n Set<Integer> allProcessedNodes = new HashSet<Integer>(); //to avoid duplicates\r\n List<String> statementsFound = new ArrayList<String>();\r\n \r\n for (int i = 0; i < reachability; i++) {\r\n if (i == 0) { \r\n Collection<String> inEdges = jungCompleteGraph.getInEdges(sourceId);\r\n for (String inEdge: inEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementTokens = inEdge.split(\"->\");\r\n int inNodeId = Integer.parseInt(statementTokens[0]);\r\n //allProcessedNodes.add(inNodeId); \r\n //Incoming nodes are reversed\r\n statementsFound.add(new StringBuilder(inEdge).reverse().toString());\r\n allPaths.add(statementsFound);\r\n if (inNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n }\r\n \r\n Collection<String> outEdges = jungCompleteGraph.getOutEdges(sourceId);\r\n \r\n for (String outEdge: outEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementTokens = outEdge.split(\"->\");\r\n int outNodeId = Integer.parseInt(statementTokens[2]);\r\n statementsFound.add(outEdge);\r\n allPaths.add(statementsFound);\r\n if (outNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n \r\n }\r\n \r\n } else {\r\n newPathsCollector = new HashSet<List<String>>();\r\n\r\n for (List<String> statements: allPaths) {\r\n allProcessedNodes = new HashSet<Integer>(); //to avoid duplicates\r\n int lastNodeInPath = 0;\r\n \r\n for (String predicate: statements) {\r\n if (predicate.contains(\">-\")) {\r\n statementTokens = predicate.split(\">-\");\r\n allProcessedNodes.add(Integer.parseInt(\r\n new StringBuilder(statementTokens[0]).reverse().toString()));\r\n allProcessedNodes.add(Integer.parseInt(\r\n new StringBuilder(statementTokens[2]).reverse().toString()));\r\n lastNodeInPath = Integer.parseInt(\r\n new StringBuilder(statementTokens[2]).reverse().toString());\r\n } else {\r\n statementTokens = predicate.split(\"->\"); \r\n allProcessedNodes.add(Integer.parseInt(statementTokens[0]));\r\n allProcessedNodes.add(Integer.parseInt(statementTokens[2]));\r\n lastNodeInPath = Integer.parseInt(statementTokens[2]);\r\n }\r\n }\r\n \r\n Collection<String> inEdges = jungCompleteGraph.getInEdges(lastNodeInPath);\r\n for (String inEdge: inEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementsFound.addAll(statements);\r\n statementTokens = inEdge.split(\"->\");\r\n int inNodeId = Integer.parseInt(statementTokens[0]);\r\n if (allProcessedNodes.contains(inNodeId)) continue;\r\n \r\n //Incoming nodes are reversed \r\n statementsFound.add(new StringBuilder(inEdge).reverse().toString());\r\n newPathsCollector.add(statementsFound);\r\n if (inNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n \r\n }\r\n \r\n Collection<String> outEdges = jungCompleteGraph.getOutEdges(lastNodeInPath);\r\n for (String outEdge: outEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementsFound.addAll(statements);\r\n statementTokens = outEdge.split(\"->\");\r\n int outNodeId = Integer.parseInt(statementTokens[2]);\r\n if (allProcessedNodes.contains(outNodeId)) continue;\r\n \r\n //Incoming nodes are reversed \r\n statementsFound.add(outEdge);\r\n newPathsCollector.add(statementsFound);\r\n if (outNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n }\r\n }\r\n allPaths.addAll(newPathsCollector);\r\n }\r\n \r\n //System.out.println(\"*****End of iteration \" + i);\r\n //System.out.println(\"#SIZE OF allPaths: \" + allPaths.size());\r\n int numItems = 0;\r\n for (List<String> currList: allPaths) {\r\n numItems = numItems + currList.size();\r\n }\r\n //System.out.println(\"#NUMBER OF ELEMS OF ALL LISTS: \" + numItems);\r\n //System.out.println(\"#SIZE OF tmpPathsToTarget : \" + tmpPathsToTarget.size());\r\n }\r\n \r\n //We need to reverse back all the predicates\r\n for (List<String> statements: tmpPathsToTarget) { \r\n List<String> fixedStatements = new ArrayList<String>(); \r\n for (int i = 0; i < statements.size(); i++) { \r\n String statement = statements.get(i); \r\n if (statement.contains(\">-\")) {\r\n fixedStatements.add(new StringBuilder(statement).reverse().toString());\r\n } else {\r\n fixedStatements.add(statement);\r\n } \r\n }\r\n pathsToTarget.add(fixedStatements);\r\n }\r\n return pathsToTarget;\r\n }", "private List<Set<V>> findAllComponents(Graph<V, E> g, Set<V> F)\n {\n return new ConnectivityInspector<>(new AsSubgraph<>(g, F)).connectedSets();\n }", "private boolean discrimPaths(Graph graph) {\n List<Node> nodes = graph.getNodes();\n\n for (Node b : nodes) {\n\n //potential A and C candidate pairs are only those\n // that look like this: A<-oBo->C or A<->Bo->C\n List<Node> possAandC = graph.getNodesOutTo(b, Endpoint.ARROW);\n\n //keep arrows and circles\n List<Node> possA = new LinkedList<>(possAandC);\n possA.removeAll(graph.getNodesInTo(b, Endpoint.TAIL));\n\n //keep only circles\n List<Node> possC = new LinkedList<>(possAandC);\n possC.retainAll(graph.getNodesInTo(b, Endpoint.CIRCLE));\n\n for (Node a : possA) {\n for (Node c : possC) {\n if (!graph.isParentOf(a, c)) {\n continue;\n }\n\n LinkedList<Node> reachable = new LinkedList<>();\n reachable.add(a);\n if (reachablePathFindOrient(graph, a, b, c, reachable)) {\n return true;\n }\n }\n }\n }\n return false;\n }", "boolean containsJewel(Graph<V, E> g)\n {\n for (V v2 : g.vertexSet()) {\n for (V v3 : g.vertexSet()) {\n if (v2 == v3 || !g.containsEdge(v2, v3))\n continue;\n for (V v5 : g.vertexSet()) {\n if (v2 == v5 || v3 == v5)\n continue;\n\n Set<V> F = new HashSet<>();\n for (V f : g.vertexSet()) {\n if (f == v2 || f == v3 || f == v5 || g.containsEdge(f, v2)\n || g.containsEdge(f, v3) || g.containsEdge(f, v5))\n continue;\n F.add(f);\n }\n\n List<Set<V>> componentsOfF = findAllComponents(g, F);\n\n Set<V> X1 = new HashSet<>();\n for (V x1 : g.vertexSet()) {\n if (x1 == v2 || x1 == v3 || x1 == v5 || !g.containsEdge(x1, v2)\n || !g.containsEdge(x1, v5) || g.containsEdge(x1, v3))\n continue;\n X1.add(x1);\n }\n Set<V> X2 = new HashSet<>();\n for (V x2 : g.vertexSet()) {\n if (x2 == v2 || x2 == v3 || x2 == v5 || g.containsEdge(x2, v2)\n || !g.containsEdge(x2, v5) || !g.containsEdge(x2, v3))\n continue;\n X2.add(x2);\n }\n\n for (V v1 : X1) {\n if (g.containsEdge(v1, v3))\n continue;\n for (V v4 : X2) {\n if (v1 == v4 || g.containsEdge(v1, v4) || g.containsEdge(v2, v4))\n continue;\n for (Set<V> FPrime : componentsOfF) {\n if (hasANeighbour(g, FPrime, v1) && hasANeighbour(g, FPrime, v4)) {\n if (certify) {\n Set<V> validSet = new HashSet<>();\n validSet.addAll(FPrime);\n validSet.add(v1);\n validSet.add(v4);\n GraphPath<V, E> p = new DijkstraShortestPath<>(\n new AsSubgraph<>(g, validSet)).getPath(v1, v4);\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(p.getEdgeList());\n if (p.getLength() % 2 == 1) {\n edgeList.add(g.getEdge(v4, v5));\n edgeList.add(g.getEdge(v5, v1));\n\n } else {\n edgeList.add(g.getEdge(v4, v3));\n edgeList.add(g.getEdge(v3, v2));\n edgeList.add(g.getEdge(v2, v1));\n\n }\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, v1, v1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n }\n }\n\n return false;\n }", "public boolean isConnected() {\n if (this.isEmpty()) return true;\n\n if (this.directed) {\n Deque<Node> toVisit = new LinkedList<>();\n for (Node s : this.nodes.values()) {\n Node current;\n toVisit.addLast(s);\n while (!toVisit.isEmpty()) {\n current = toVisit.removeLast();\n current.setFlag(\"_visited\");\n for (Edge edge : current.getNeighbours()) {\n Node n = edge.getEnd();\n if (!n.getFlag(\"_visited\")) toVisit.addLast(n);\n }\n }\n\n //Check if all nodes have been visited and remove flags\n boolean allVisited = true;\n for (Node n : nodes.values()) {\n allVisited = allVisited && n.getFlag(\"_visited\");\n n.unsetFlag(\"_visited\");\n }\n if (!allVisited) return false;\n }\n return true;\n }\n else {\n //Perform a DFS from a random start node marking nodes as visited\n Node current;\n Deque<Node> toVisit = new LinkedList<>();\n toVisit.addLast(this.nodes.values().iterator().next());\n while (!toVisit.isEmpty()) {\n current = toVisit.removeLast();\n current.setFlag(\"_visited\");\n for (Edge edge : current.getNeighbours()) {\n Node n = edge.getEnd();\n if (!n.getFlag(\"_visited\")) toVisit.addLast(n);\n }\n }\n\n //Check if all nodes have been visited and remove flags\n boolean allVisited = true;\n for (Node n : nodes.values()) {\n allVisited = allVisited && n.getFlag(\"_visited\");\n n.unsetFlag(\"_visited\");\n }\n\n return allVisited;\n }\n }", "protected Graph filterGraph(final Collection<Object> roots) {\n final Set<Relation> edges = graph.getEdges();\n // crate object->relations mapping\n final Map<cz.cuni.mff.ufal.textan.core.Object, Set<Relation>> objRels = new HashMap<>();\n for (Relation relation : edges) {\n for (Triple<Integer, String, cz.cuni.mff.ufal.textan.core.Object> triple : relation.getObjects()) {\n final cz.cuni.mff.ufal.textan.core.Object obj = triple.getThird();\n if (!ignoredObjectTypes.contains(obj.getType())) {\n Set<Relation> rels = objRels.get(obj);\n if (rels == null) {\n rels = new HashSet<>();\n objRels.put(obj, rels);\n }\n rels.add(new Relation(relation));\n }\n }\n }\n //initilization\n final Map<Long, cz.cuni.mff.ufal.textan.core.Object> newNodes = new HashMap<>();\n final Set<Relation> newEdges = new HashSet<>();\n final Set<Relation> doneRelations = new HashSet<>(); //processed relations\n final Set<cz.cuni.mff.ufal.textan.core.Object> doneObjects = new HashSet<>(); //processed objects\n final Deque<cz.cuni.mff.ufal.textan.core.Object> stack = new ArrayDeque<>(); //objects whose relations need processing\n for (Object root : roots) {\n newNodes.put(root.getId(), root);\n doneObjects.add(root);\n stack.add(root);\n }\n //filtering\n while (!stack.isEmpty()) {\n final cz.cuni.mff.ufal.textan.core.Object obj = stack.pop();\n final Set<Relation> rels = objRels.get(obj);\n if (rels == null) {\n continue;\n }\n for (Relation rel : rels) {\n if (doneRelations.contains(rel)) {\n continue;\n }\n doneRelations.add(rel);\n if (ignoredRelationTypes.contains(rel.getType())) {\n continue;\n }\n final Set<Triple<Integer, String, cz.cuni.mff.ufal.textan.core.Object>> newObjs = new HashSet<>();\n for (Triple<Integer, String, cz.cuni.mff.ufal.textan.core.Object> triple : rel.getObjects()) {\n if (!ignoredObjectTypes.contains(triple.getThird().getType())) {\n newObjs.add(triple);\n if (!doneObjects.contains(triple.getThird())) {\n doneObjects.add(triple.getThird());\n newNodes.put(triple.getThird().getId(), triple.getThird());\n stack.add(triple.getThird());\n }\n }\n }\n //add only if there are more objects connected\n //or if the original relation was unary too\n if (newObjs.size() > 1 || rel.getObjects().size() == 1) {\n newEdges.add(rel);\n rel.getObjects().clear();\n rel.getObjects().addAll(newObjs);\n }\n }\n }\n //use new nodes and edges\n return new Graph(newNodes, newEdges);\n }", "public static ArrayList<String> connectors(Graph g) {\t\n\t\tif (g == null || g.members.length <= 2) \n\t\t\treturn null;\n\t\tArrayList<ArrayList<ArrayList<Integer>>> list = new ArrayList<ArrayList<ArrayList<Integer>>>();\n\t\tArrayList<String> connectors = new ArrayList<String>();\n\t\tArrayList<Integer> counter = new ArrayList<Integer>();\n\t\tcounter.add(1);\n\t\tfor(int i = 0; i < g.members.length; i++) {\n\t\t\tArrayList<ArrayList<Integer>> Input = new ArrayList<ArrayList<Integer>>();\n\t\t\tfor(int j = 0; j < g.members.length; j++) {\n\t\t\t\tInput.add(null);\n\t\t\t}\n\t\t\tInput.add(counter);\n\t\t\tInput = BFS(Input, true, i, g);\n\t\t\tlist.add(Input);\n\t\t}\n\t\tif(list.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\tfor(int i = 0; i < list.size(); i++) {\n\t\t\tArrayList<ArrayList<Integer>> Input = list.get(i);\n\t\t\tfor(int j = g.members.length +1; j < Input.size(); j++) {\n\t\t\t\tif(test(g.members[Input.get(j).get(0)].name, connectors))\n\t\t\t\t\tconnectors.add(g.members[Input.get(j).get(0)].name);\n\t\t\t}\n\t\t}\n\t\tif(connectors.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn connectors;\n\t}", "public void dft() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> stack = new LinkedList<>();\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tstack.addFirst(rootpair);\r\n\t\t\twhile (stack.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = stack.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tstack.addFirst(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "int isCycle( Graph graph){\n int parent[] = new int[graph.V]; \n \n // Initialize all subsets as single element sets \n for (int i=0; i<graph.V; ++i) \n parent[i]=-1; \n \n // Iterate through all edges of graph, find subset of both vertices of every edge, if both subsets are same, then there is cycle in graph. \n for (int i = 0; i < graph.E; ++i){ \n int x = graph.find(parent, graph.edge[i].src); \n int y = graph.find(parent, graph.edge[i].dest); \n \n if (x == y) \n return 1; \n \n graph.Union(parent, x, y); \n } \n return 0; \n }", "public void dfs() {\n int currentVertexIndex = 0;\r\n dfsStack.push(0);\r\n vertexList[0].wasVisited = true;\r\n System.out.println(vertexList[dfsStack.peek()]);\r\n while (dfsStack.top != -1) {\r\n\r\n\r\n currentVertexIndex = this.getAdjUnvisitedVert(dfsStack.peek());\r\n if (currentVertexIndex != -1) {\r\n dfsStack.push(currentVertexIndex);\r\n vertexList[currentVertexIndex].wasVisited = true;\r\n System.out.println(vertexList[dfsStack.peek()]);\r\n\r\n\r\n } else {\r\n currentVertexIndex = dfsStack.pop();\r\n\r\n }\r\n }\r\n// reset wasVisted\r\n for (Vertex x : vertexList) {\r\n x.wasVisited = false;\r\n }\r\n }", "ArrayList<Node> DFSRec(Graph graph, final Node start, final Node end )\n {\n ArrayList<Node> path = new ArrayList<Node>();\n\n if ( start == end )\n {\n return path;\n }\n\n boolean visited[] = new boolean[graph.numNodes];\n visited[start.id] = true;\n\n path.addAll(DFSRec_helper(graph, start, end, visited)); \n\n return path;\n }", "private List<Set<GraphChange>> findChanges(Map<Collection<Node>, List<PossibleDConnectingPath>> paths) {\n List<Set<GraphChange>> pagChanges = new ArrayList<>();\n\n Set<Map.Entry<Collection<Node>, List<PossibleDConnectingPath>>> entries = paths.entrySet();\n /* Loop through each entry, ie each conditioned set of variables. */\n for (Map.Entry<Collection<Node>, List<PossibleDConnectingPath>> entry : entries) {\n Collection<Node> conditions = entry.getKey();\n List<PossibleDConnectingPath> dConnecting = entry.getValue();\n\n /* loop through each path */\n for (PossibleDConnectingPath possible : dConnecting) {\n List<Node> possPath = possible.getPath();\n /* Created with 2*# of undirectedPaths as appoximation. might have to increase size once */\n Set<GraphChange> pathChanges = new HashSet<>(2 * possPath.size());\n\n /* find those conditions which are not along the path (used in colider) */\n List<Node> outsidePath = new ArrayList<>(conditions.size());\n for (Node condition : conditions) {\n if (!possPath.contains(condition))\n outsidePath.add(condition);\n }\n\n /* Walk through path, node by node */\n for (int i = 0; i < possPath.size() - 1; i++) {\n Node current = possPath.get(i);\n Node next = possPath.get(i + 1);\n GraphChange gc;\n\n /* for each pair of nodes, add the operation to remove their edge */\n gc = new GraphChange();\n gc.addRemove(possible.getPag().getEdge(current, next));\n pathChanges.add(gc);\n\n /* for each triple centered on a node which is an element of the conditioning\n * set, add the operation to orient as a nonColider around that node */\n if (conditions.contains(current) && i > 0) {\n gc = new GraphChange();\n Triple nonColider = new Triple(possPath.get(i - 1), current, next);\n gc.addNonCollider(nonColider);\n pathChanges.add(gc);\n }\n\n /* for each node on the path not in the conditioning set, make a colider. It\n * is necessary though to ensure that there are no undirectedPaths implying that a\n * conditioned variable (even outside the path) is a decendant of a colider */\n if ((!conditions.contains(current)) && i > 0) {\n Triple colider = new Triple(possPath.get(i - 1), current, next);\n\n if (possible.getPag().isUnderlineTriple(possPath.get(i - 1), current, next))\n continue;\n\n Edge edge1 = possible.getPag().getEdge(colider.getX(), colider.getY());\n Edge edge2 = possible.getPag().getEdge(colider.getZ(), colider.getY());\n\n if (edge1.getNode1().equals(colider.getY())) {\n if (edge1.getEndpoint1().equals(Endpoint.TAIL)) {\n continue;\n }\n } else if (edge1.getNode2().equals(colider.getY())) {\n if (edge1.getEndpoint2().equals(Endpoint.TAIL)) {\n continue;\n }\n }\n\n if (edge2.getNode1().equals(colider.getY())) {\n if (edge2.getEndpoint1().equals(Endpoint.TAIL)) {\n continue;\n }\n } else if (edge2.getNode2().equals(colider.getY())) {\n if (edge2.getEndpoint2().equals(Endpoint.TAIL)) {\n continue;\n }\n }\n\n /* Simple case, no conditions outside the path, so just add colider */\n if (outsidePath.size() == 0) {\n gc = new GraphChange();\n gc.addCollider(colider);\n pathChanges.add(gc);\n continue;\n }\n\n /* ensure nondecendency in possible path between getModel and each conditioned\n * variable outside the path */\n for (Node outside : outsidePath) {\n\n /* list of possible decendant undirectedPaths */\n\n List<PossibleDConnectingPath> decendantPaths = new ArrayList<>();\n decendantPaths\n = PossibleDConnectingPath.findDConnectingPaths\n (possible.getPag(), current, outside, new ArrayList<Node>());\n\n if (decendantPaths.isEmpty()) {\n gc = new GraphChange();\n gc.addCollider(colider);\n pathChanges.add(gc);\n continue;\n }\n\n /* loop over each possible path which might indicate decendency */\n for (PossibleDConnectingPath decendantPDCPath : decendantPaths) {\n List<Node> decendantPath = decendantPDCPath.getPath();\n\n /* walk down path checking orientation (path may already\n * imply non-decendency) and creating changes if need be*/\n boolean impliesDecendant = true;\n Set<GraphChange> colideChanges = new HashSet<>();\n for (int j = 0; j < decendantPath.size() - 1; j++) {\n Node from = decendantPath.get(j);\n // chaneges from +1\n Node to = decendantPath.get(j + 1);\n Edge currentEdge = possible.getPag().getEdge(from, to);\n\n if (currentEdge.getEndpoint1().equals(Endpoint.ARROW)) {\n impliesDecendant = false;\n break;\n }\n\n gc = new GraphChange();\n gc.addCollider(colider);\n gc.addRemove(currentEdge);\n colideChanges.add(gc);\n\n gc = new GraphChange();\n gc.addCollider(colider);\n gc.addOrient(to, from);\n colideChanges.add(gc);\n }\n if (impliesDecendant)\n pathChanges.addAll(colideChanges);\n }\n }\n }\n }\n\n pagChanges.add(pathChanges);\n }\n }\n return pagChanges;\n }", "List<List<Node>> findUndirectedPaths(Node s, Node d) {\n\t\tList<List<Node>> paths = new ArrayList<>();\n\t\tpath(s, d, new HashSet<>(), new ArrayList<>(), paths);\n System.out.println(\"Computed paths: \" + paths);\n return paths;\n\t}", "public final AstValidator.flatten_clause_return flatten_clause() throws RecognitionException {\n AstValidator.flatten_clause_return retval = new AstValidator.flatten_clause_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree FLATTEN166=null;\n AstValidator.expr_return expr167 =null;\n\n\n CommonTree FLATTEN166_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:377:16: ( ^( FLATTEN expr ) )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:377:18: ^( FLATTEN expr )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n FLATTEN166=(CommonTree)match(input,FLATTEN,FOLLOW_FLATTEN_in_flatten_clause1651); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n FLATTEN166_tree = (CommonTree)adaptor.dupNode(FLATTEN166);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(FLATTEN166_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_expr_in_flatten_clause1653);\n expr167=expr();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, expr167.getTree());\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "private Collection<FlatShelf> flattenAll(Collection<Bookshelf> books) {\n\tSet<FlatShelf> flatShelfs = new HashSet<FlatShelf>();\n\n\tfor (Bookshelf b : books)\n\t flatShelfs.add(new FlatShelf(b));\n\n\treturn flatShelfs;\n }", "public static boolean[][] flow (final boolean[][] open) {\n final int n = open.length;\n final boolean[][] full = new boolean[n][n];\n for (int j = 0; j < n; j++) {\n flow (open, full, 0, j);\n }\n return full;\n }", "public int[] findRedundantConnection(int[][] edges) {\n int[] parent = new int[2*edges.length];\n int[] sz = new int[parent.length];\n // initialize parent array, every element points to itself\n for (int i = 0; i < parent.length; i++) parent[i] = i;\n Arrays.fill(sz, 1);\n\n for (int[] edge : edges) {\n int p = find(parent, edge[0]);\n int q = find(parent, edge[1]);\n if (p==q) return edge;\n union(parent, sz, p, q);\n }\n return new int[2]; // default return, if no such edge found\n }", "private Set<NodePair> nonadjacencies(Graph graph) {\n Set<NodePair> nonadjacencies = new HashSet<>();\n for (Graph inputPag : input) {\n for (NodePair pair : allNodePairs(inputPag.getNodes())) {\n if (!inputPag.isAdjacentTo(pair.getFirst(), pair.getSecond())) {\n nonadjacencies.add(new NodePair(graph.getNode(pair.getFirst().getName()), graph.getNode(pair.getSecond().getName())));\n }\n }\n }\n return nonadjacencies;\n }", "public static int largestIslandChain(Scanner sc) {\n int islands=sc.nextInt();\r\n boolean graph[][] = new boolean[islands][islands];\r\n\r\n //System.out.print(\"How many ziplines? \");\r\n int ziplines=sc.nextInt();\r\n\r\n for (int edge=0; edge<ziplines; edge++) {\r\n int from=sc.nextInt();\r\n int to=sc.nextInt();\r\n graph[from][to]=true;\r\n }\r\n\r\n\r\n /* Find the SCCs... */\r\n\r\n //Utility Data Structures\r\n Stack<Integer> stack = new Stack<Integer>(); \r\n\r\n\r\n //First DFS\r\n boolean[] visited01 = new boolean[islands];\r\n int exitTimeTicker=0;\r\n int[] exitTimes = new int[islands];\r\n int[] exitPoints = new int[islands];\r\n for (int island=0; island<islands; island++) {\r\n int source;\r\n if (!visited01[island])\r\n {\r\n visited01[island]=true;\r\n stack.push(island);\r\n source=island;\r\n\r\n int destination=0;\r\n while (!stack.isEmpty())\r\n {\r\n source=stack.peek();\r\n destination=0;\r\n while (destination<islands)\r\n {\r\n if (graph[source][destination] && !visited01[destination])\r\n {\r\n stack.push(destination);\r\n visited01[destination]=true;\r\n source=destination;\r\n destination=0;\r\n }\r\n else {\r\n destination++;\r\n }\r\n }\r\n exitTimes[stack.peek()]=exitTimeTicker;\r\n exitPoints[exitTimeTicker]=stack.peek();\r\n stack.pop();\r\n exitTimeTicker++;\r\n }\r\n }\r\n }\r\n\r\n\r\n boolean graphTransposeUsingExits[][] = new boolean[islands][islands];\r\n for (int i=0; i<islands; i++)\r\n {\r\n for (int j=0; j<islands; j++)\r\n {\r\n if (graph[i][j])\r\n graphTransposeUsingExits[exitTimes[j]][exitTimes[i]]=true;\r\n }\r\n }\r\n\r\n\r\n //Second DFS\r\n boolean[] visited02 = new boolean[islands];\r\n int[] numberOfSCC = new int[islands];\r\n int currSCCnum=0;\r\n for (int exitTime=islands-1; exitTime>=0; exitTime--)\r\n {\r\n if (!visited02[exitTime])\r\n {\r\n //entryPointToScc=exitTime;\r\n visited02[exitTime]=true;\r\n numberOfSCC[exitPoints[exitTime]]=++currSCCnum;\r\n stack.push(exitTime);\r\n int source=exitTime;\r\n while (!stack.isEmpty())\r\n {\r\n source=stack.peek();\r\n int destination=0;\r\n while (destination<islands)\r\n {\r\n if (graphTransposeUsingExits[source][destination] && !visited02[destination])\r\n {\r\n if (numberOfSCC[exitPoints[destination]]==0) {\r\n numberOfSCC[exitPoints[destination]]=currSCCnum;\r\n }\r\n stack.push(destination);\r\n visited02[destination]=true;\r\n source=destination;\r\n destination=0;\r\n }\r\n else {\r\n destination++;\r\n } \r\n }\r\n stack.pop();\r\n } \r\n }\r\n }\r\n\r\n\r\n int[] sizeOfSCCs = new int[currSCCnum];\r\n for (int i=0; i<islands; i++) {\r\n sizeOfSCCs[numberOfSCC[i]-1]++;\r\n }\r\n \r\n int sccsMax = Integer.MIN_VALUE;\r\n for(int i=0; i<sizeOfSCCs.length; ++i) {\r\n \tif(sizeOfSCCs[i] > sccsMax) {\r\n \t\tsccsMax = sizeOfSCCs[i];\r\n \t}\r\n }\r\n return sccsMax;\r\n \r\n // Java 8\r\n //return Arrays.stream(sizeOfSCCs).summaryStatistics().getMax();\r\n }" ]
[ "0.67457134", "0.5296903", "0.51615965", "0.5139004", "0.5081935", "0.504917", "0.50103647", "0.49941513", "0.4893", "0.4845202", "0.4840811", "0.4833592", "0.4812638", "0.47767997", "0.4770353", "0.47586596", "0.471229", "0.47013852", "0.46810246", "0.46766576", "0.4651932", "0.46280405", "0.46173033", "0.46079203", "0.45961237", "0.45568204", "0.45471352", "0.45439723", "0.4538706", "0.4538654", "0.4526918", "0.45218003", "0.45075607", "0.449592", "0.44865853", "0.4476719", "0.44696623", "0.44500384", "0.44447187", "0.44400948", "0.4435004", "0.4433138", "0.44317323", "0.44310132", "0.44174448", "0.44090694", "0.4407873", "0.44018847", "0.44003877", "0.43946365", "0.43940789", "0.4379292", "0.43785352", "0.43782306", "0.43751875", "0.43732154", "0.4371293", "0.43641445", "0.43638173", "0.43612102", "0.43598542", "0.43573406", "0.43555364", "0.43554255", "0.43552953", "0.43484598", "0.43360704", "0.4332579", "0.43286103", "0.43267503", "0.43224683", "0.43126", "0.4309025", "0.43055302", "0.42994288", "0.42973134", "0.4296379", "0.429286", "0.4292685", "0.42923054", "0.428905", "0.42841202", "0.42828283", "0.4281896", "0.4281356", "0.42688522", "0.42682996", "0.42570114", "0.4252177", "0.42513815", "0.42509946", "0.42509872", "0.4246813", "0.42431936", "0.4238549", "0.423366", "0.42257532", "0.42236292", "0.42163336", "0.42072153" ]
0.751705
0
Given a data graph and a minimum 'length' this function identifies all 'flats' on the graph. A 'Flat' occurs when stocks price has not changed for a specified period of time (in seconds). By default Bryn uses a two second flat and the findAllFlats(BaseGraph graph) function in this class may be used to automatically apply the default; for other length values use this method
public static GraphFlatCollection<IGraphFlat> findAllFlatsOfAtLeastLength(int length, BaseGraph<AbstractGraphPoint> graph) { GraphFlatCollection<IGraphFlat> result = new GraphFlatCollection<IGraphFlat>(graph); if (0 < length && graph != null) { if (1 < graph.size()) { //Get a descending iterator of graph points Iterator<AbstractGraphPoint> descIter = graph.descendingIterator(); AbstractGraphPoint currPoint = descIter.next(); GraphFlat currFlat = new GraphFlat(currPoint); while (descIter.hasNext()) { currPoint = descIter.next(); if (!currFlat.addPoint(currPoint)) { //Value has changed add currFlat to collection if (currFlat.isAtLeastXLong(length)) { result.add(currFlat); } //This point is the start of a new flat currFlat = new GraphFlat(currPoint); } } //If the last flat is at least the required length add it if (currFlat.isAtLeastXLong(length)) { result.add(currFlat); } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static GraphFlatCollection<IGraphFlat> findAllFlats(BaseGraph<AbstractGraphPoint> graph) {\r\n //NB a 'FLAT' must be at least 2 seconds long\r\n GraphFlatCollection<IGraphFlat> result = DTUtil.findAllFlatsOfAtLeastLength(2, graph);\r\n return result;\r\n }", "public static GraphFlatPair getFlatPairAroundTimePoint(long timestamp, BaseGraph<AbstractGraphPoint> graph) {\r\n GraphFlatPair result = null;\r\n if (null != graph && 0 < graph.size()) {\r\n GraphFlatCollection<IGraphFlat> allFlats = DTUtil.findAllFlats(graph);\r\n TreeSet<GraphFlatPair> flatPairs = allFlats.getFlatPairs();\r\n for (GraphFlatPair currPair : flatPairs) {\r\n long startTime = currPair.getFirstFlat().getEarliestPoint().getTimestamp();\r\n long endTime = currPair.getSecondFlat().getLatestPoint().getTimestamp();\r\n if (startTime <= timestamp && endTime >= timestamp) {\r\n result = currPair;\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n }", "public int shortestPathLength(int[][] graph) {\n Queue<MyPath> q = new LinkedList<>();\n Set<String> visited = new HashSet<>();\n\n for (int i = 0; i < graph.length; i++) {\n MyPath path = new MyPath(i, (1 << i));\n visited.add(path.convertToString());\n q.offer(path);\n }\n\n int length = 0;\n while (!q.isEmpty()) {\n int size = q.size();\n while (size-- > 0) {\n MyPath next = q.poll();\n int curr = next.curr;\n int currPath = next.nodes;\n // Assume we have two nodes -> n = 2\n // 1 << 2 -> 100\n // 100 - 1 -> 011 which means both nodes are visited\n if (currPath == (1 << graph.length) - 1) {\n return length;\n }\n for (int neighbors : graph[curr]) {\n MyPath newPath = new MyPath(neighbors, currPath | (1 << neighbors));\n String pathString = newPath.convertToString();\n if (visited.add(pathString)) {\n q.offer(newPath);\n }\n }\n }\n length++;\n }\n\n return -1;\n }", "public void getAllPaths(Graph<Integer> graph) {\n\t\tTopologicalSort obj = new TopologicalSort();\r\n\t\tStack<Vertex<Integer>> result = obj.sort(graph);\r\n\t\t\r\n\t\t// source (one or multiple) must lie at the top\r\n\t\twhile(!result.isEmpty()) {\r\n\t\t\tVertex<Integer> currentVertex = result.pop();\r\n\t\t\t\r\n\t\t\tif(visited.contains(currentVertex.getId())) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tstack = new Stack<Vertex<Integer>>();\r\n\t\t\tSystem.out.println(\"Paths: \");\r\n\t\t\tvisited = new ArrayList<Long>();\r\n\t\t\tdfs(currentVertex);\r\n\t\t\t//System.out.println(stack);\r\n\t\t\t//GraphUtil.print(stack);\t\t\t\r\n\t\t}\r\n\r\n\t}", "public static <V> void printAllShortestPaths(Graph<V> graph) {\n double[][] matrizPesos = graph.getGraphStructureAsMatrix();\n double[][] pesos = new double[matrizPesos.length][matrizPesos.length];\n V[] vertices = graph.getValuesAsArray();\n V[][] caminos = (V[][]) new Object[matrizPesos.length][matrizPesos.length];\n for (int x = 0; x < matrizPesos.length; x++) {\n for (int y = 0; y < matrizPesos.length; y++) {\n if (x == y) {\n pesos[x][y] = -1;\n } else {\n if (matrizPesos[x][y] == -1) {\n pesos[x][y] = Integer.MAX_VALUE; //Si no existe arista se pone infinito\n } else {\n pesos[x][y] = matrizPesos[x][y];\n }\n }\n caminos[x][y] = vertices[y];\n }\n }\n for (int x = 0; x < vertices.length; x++) { // Para cada uno de los vertices del grafo\n for (int y = 0; y < vertices.length; y++) { // Recorre la fila correspondiente al vertice\n for (int z = 0; z < vertices.length; z++) { //Recorre la columna correspondiente al vertice\n if (y != x && z != x) {\n double tam2 = pesos[y][x];\n double tam1 = pesos[x][z];\n if (pesos[x][z] != -1 && pesos[y][x] != -1) {\n double suma = pesos[x][z] + pesos[y][x];\n if (suma < pesos[y][z]) {\n pesos[y][z] = suma;\n caminos[y][z] = vertices[x];\n }\n }\n }\n }\n }\n }\n\n //Cuando se termina el algoritmo, se imprimen los caminos\n for (int x = 0; x < vertices.length; x++) {\n for (int y = 0; y < vertices.length; y++) {\n boolean seguir = true;\n int it1 = y;\n String hilera = \"\";\n while (seguir) {\n if (it1 != y) {\n hilera = vertices[it1] + \"-\" + hilera;\n } else {\n hilera += vertices[it1];\n }\n if (caminos[x][it1] != vertices[it1]) {\n int m = 0;\n boolean continuar = true;\n while (continuar) {\n if (vertices[m].equals(caminos[x][it1])) {\n it1 = m;\n continuar = false;\n } else {\n m++;\n }\n }\n } else {\n if (x == y) {\n System.out.println(\"El camino entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera);\n } else {\n hilera = vertices[x] + \"-\" + hilera;\n if (pesos[x][y] == Integer.MAX_VALUE) {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: infinito (no hay camino)\");\n } else {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera + \" con distancia de: \" + (pesos[x][y]));\n }\n }\n seguir = false;\n }\n }\n }\n System.out.println();\n }\n }", "public static <T> Set<List<T>> findSimpleCycles(Map<T, Set<T>> graph) {\n if (graph == null) {\n return null;\n }\n Set<List<T>> result = new HashSet<>();\n Set<T> vertices = new HashSet<>(graph.keySet());\n while (!graph.isEmpty()) {\n Set<Set<T>> components = findStronglyConnectedComponents(graph);\n Set<T> maxComponent = null;\n for (Set<T> component : components) {\n if (component.size() < 2) {\n if (isSelfCycle(graph, component)) {\n result.add(new ArrayList<>(component));\n }\n vertices.removeAll(component);\n } else if ((maxComponent == null) || (component.size() > maxComponent.size())) {\n maxComponent = component;\n }\n }\n if (maxComponent != null) {\n Map<T, Set<T>> subgraph = project(graph, maxComponent);\n T startVertex = maxComponent.iterator().next();\n result.addAll(findSimpleCycles(subgraph, startVertex));\n vertices.remove(startVertex);\n }\n graph = project(graph, vertices);\n }\n return result;\n }", "@Test\n public void testFlattenLowerLimit() throws Exception {\n PhysicalOperator flatten = new FlattenPOP(null, SchemaPath.getSimplePath(\"c\"));\n mockOpContext(flatten, initReservation, maxAllocation);\n\n List<String> inputJsonBatches = Lists.newArrayList();\n StringBuilder batchString = new StringBuilder();\n StringBuilder flattenElement = new StringBuilder();\n\n // Create list of 10 elements\n flattenElement.append(\"[\");\n for (int i = 0; i < 10; i++) {\n flattenElement.append(i);\n flattenElement.append(\",\");\n }\n flattenElement.append(10);\n flattenElement.append(\"]\");\n\n // create list of wideStrings\n final StringBuilder wideStrings = new StringBuilder();\n wideStrings.append(\"[\");\n for (int i = 0; i < 10; i++) {\n wideStrings.append(\"\\\"\" + wideString + \"\\\",\");\n }\n wideStrings.append(\"\\\"\" + wideString + \"\\\"\");\n wideStrings.append(\"]\");\n\n batchString.append(\"[\");\n batchString.append(\"{\\\"a\\\": \" + wideStrings + \",\" + \"\\\"c\\\":\" + flattenElement);\n batchString.append(\"}]\");\n inputJsonBatches.add(batchString.toString());\n\n // Figure out what will be approximate total output size out of flatten for input above\n // We will use this sizing information to set output batch size so we can produce desired\n // number of batches that can be verified.\n\n // set very low value of batch size for a large record size.\n // This is to test we atleast get one record per batch.\n fragContext.getOptions().setLocalOption(\"drill.exec.memory.operator.output_batch_size\", 1024);\n\n // Here we expect 10 batches because each batch will be bounded by lower limit of at least 1 record.\n // do not check the output batch size as it will be more than configured value of 1024, so we get\n // at least one record out.\n LegacyOperatorTestBuilder opTestBuilder = legacyOpTestBuilder()\n .physicalOperator(flatten)\n .inputDataStreamJson(inputJsonBatches)\n .baselineColumns(\"a\", \"c\")\n .expectedNumBatches(10); // verify number of batches\n\n final JsonStringArrayList<Text> results = new JsonStringArrayList<Text>() {{\n add(new Text(wideString));\n add(new Text(wideString));\n add(new Text(wideString));\n add(new Text(wideString));\n add(new Text(wideString));\n add(new Text(wideString));\n add(new Text(wideString));\n add(new Text(wideString));\n add(new Text(wideString));\n add(new Text(wideString));\n add(new Text(wideString));\n }};\n\n for (long j = 0; j < 11; j++) {\n opTestBuilder.baselineValues(results, j);\n }\n\n opTestBuilder.go();\n }", "int fordFulkerson(int graph[][], int s, int t) {\n int u, v; // Create a residual graph and fill the residual graph with given capacities in the original graph as residual capacities in residual graph\n int rGraph[][] = new int[MaxFlow.graph.getNumOfNode()][MaxFlow.graph.getNumOfNode()]; // Residual graph where rGraph[i][j] indicates residual capacity of edge from i to j (if there is an edge. If rGraph[i][j] is 0, then there is not)\n\n for (u = 0; u < MaxFlow.graph.getNumOfNode(); u++)\n for (v = 0; v < MaxFlow.graph.getNumOfNode(); v++)\n rGraph[u][v] = graph[u][v]; //store the graph capacities\n\n int parent[] = new int[MaxFlow.graph.getNumOfNode()]; // This array is filled by BFS and to store path\n int max_flow = 0; // There is no flow initially\n\n while (bfs(rGraph, s, t, parent)) { // Augment the flow while there is path from source to sink\n int path_flow = Integer.MAX_VALUE; // Find minimum residual capacity of the edges along the path filled by BFS. Or we can say find the maximum flow through the path found.\n for (v = t; v != s; v = parent[v]) { //when v=0 stop the loop\n u = parent[v];\n path_flow = Math.min(path_flow, rGraph[u][v]);\n }\n\n for (v = t; v != s; v = parent[v]) { // update residual capacities of the edges and reverse edges along the path\n u = parent[v];\n rGraph[u][v] -= path_flow; //min the path cap\n rGraph[v][u] += path_flow; //add the path cap\n\n }\n System.out.println(\"Augmenting Path \"+ path_flow);\n max_flow += path_flow; // Add path flow to overall flow\n }\n return max_flow; // Return the overall flow\n }", "public double getFlatness() {\n\treturn flatness;\n }", "@DISPID(25)\n\t// = 0x19. The runtime will prefer the VTID if present\n\t@VTID(36)\n\t@ReturnValue(type = NativeType.Dispatch)\n\tcom4j.Com4jObject buildTrendGraph(\n\t\t\t@Optional @DefaultValue(\"\") java.lang.String groupByField,\n\t\t\t@Optional @DefaultValue(\"\") java.lang.String sumOfField,\n\t\t\t@Optional @DefaultValue(\"0\") int maxCols,\n\t\t\t@Optional @MarshalAs(NativeType.VARIANT) java.lang.Object filter,\n\t\t\t@Optional @MarshalAs(NativeType.VARIANT) java.lang.Object frDate,\n\t\t\t@Optional @DefaultValue(\"0\") boolean forceRefresh,\n\t\t\t@Optional @DefaultValue(\"0\") boolean showFullPath);", "public NetworkFold(final FlatNetwork flat) {\r\n\t\tthis.weights = EngineArray.arrayCopy(flat.getWeights());\r\n\t\tthis.output = EngineArray.arrayCopy(flat.getLayerOutput());\r\n\t}", "public static void main(String[] args) {\n Room roomNr1 = new Room();\n roomNr1.setHeight(3.00);\n roomNr1.setLightOn(false);\n\n Room roomNr2= new Room();\n roomNr2.setHeight(3.10);\n roomNr2.setLightOn(false);\n\n Room roomNr3= new Room();\n roomNr3.setHeight(2.90);\n roomNr3.setLightOn(true);\n\n Room roomNr4 = new Room();\n roomNr4.setHeight(9.00);\n roomNr4.setLightOn(false);\n\n Room roomNr5 = new Room();\n roomNr5.setHeight(9.00);\n roomNr5.setLightOn(true);\n\n Room roomNr6 = new Room();\n roomNr6.setHeight(7.00);\n roomNr6.setLightOn(false);\n\n //Setting up flats\n Flat flatNr1 = new Flat();\n flatNr1.setNr(1);\n flatNr1.setArea(64.14);\n flatNr1.setOwner(\"Kostik\");\n\n List<Room> roomsIn1 = new ArrayList<>();\n roomsIn1.add(roomNr1);\n roomsIn1.add(roomNr2);\n\n flatNr1.setRooms(roomsIn1);\n //--------------------------------------------\n Flat flatNr2 = new Flat();\n flatNr2.setNr(2);\n flatNr2.setArea(34.14);\n flatNr2.setOwner(\"Kostik\");\n\n List<Room> roomsIn2 = new ArrayList<>();\n roomsIn2.add(roomNr3);\n\n flatNr2.setRooms(roomsIn2);\n//--------------------------------------------\n Flat flatNr3 = new Flat();\n flatNr3.setNr(3);\n flatNr3.setArea(64.14);\n flatNr3.setOwner(\"Kostik\");\n\n List<Room> roomsIn3 = new ArrayList<>();\n roomsIn3.add(roomNr4);\n roomsIn3.add(roomNr5);\n\n flatNr3.setRooms(roomsIn3);\n //--------------------------------------------\n Flat flatNr4 = new Flat();\n flatNr4.setNr(4);\n flatNr4.setArea(34.14);\n flatNr4.setOwner(\"Kostik\");\n\n List<Room> roomsIn4 = new ArrayList<>();\n roomsIn4.add(roomNr6);\n\n flatNr4.setRooms(roomsIn4);\n\n\n //Setting up floors\n Floor floorNr1 = new Floor();\n floorNr1.setNr(1);\n List<Flat> flats1 = new ArrayList<>();\n flats1.add(flatNr1);\n flats1.add(flatNr2);\n floorNr1.setFlats(flats1);\n\n\n //Setting up house\n\n House house = new House();\n house.setNr(221);\n house.setStreetName(\"Baker str.\");\n\n List<Floor> floors = new ArrayList<>();\n floors.add(floorNr1);\n floors.add(new Floor());\n house.setFloors(floors);\n System.out.println(house.getFloors().get(0).getFlats().get(0).getRooms().get(0).getHeight());\n\n\n\n\n\n\n//// System.out.println(\"Hello, world!\");\n//\n// SomeFunctions functions = new SomeFunctions();\n//// String text = functions.getWelcomeText(\"Валера\");\n//// System.out.println(text);\n//\n// // System.out.println(functions.getEurFromUsd(150.00, 0.8924));\n// // System.out.println(functions.getCalories(2, 1));\n// // Date test = new Date(120, 5, 28);\n// // System.out.println(functions.getMsFromDate(test));\n// String text =\"Ранее 28 июня сообщалось, что кандидат от Демократической партии США на предстоящих президентских выборах Джо Байден призвал не приглашать Россию присоединиться к G7, если информация, опубликованная The New York Times о предположительном взаимодействии Москвы с афганскими боевиками, правдива. Он также обвинил Трампа в том, что тот несколько месяцев знал об этом опасном для Вашингтона взаимодействии и не ввел никаких санкций за грубейшее нарушение международного права.\";\n//\n// String[] words = text.split(\" \");\n// System.out.println(words.length);\n//// System.out.println(words[4]);\n// for (int i = 0; i < words.length; i++) {\n// System.out.println(\"The word with id \" + i + \" is: \" + words[i]);\n// }\n//\n// for (String word : words) {\n// System.out.println(word);\n// }\n//\n// List<String> names = new ArrayList<>();\n// names.add(\"Валерий\");\n// names.add(\"Константин лучший\");\n// names.add(\"Максим\");\n// names.add(\"Андрей\");\n//\n// System.out.println(names.get(1));\n//\n// for (String word : words) {\n// names.add(word);\n// }\n//\n// System.out.println(names.size());\n// for (String name : names) {\n// System.out.println(name);\n// }\n//\n// HashMap<String, Integer> bookUniqueWords = new HashMap<>();\n//// bookUniqueWords.put(names<0>, 1);\n//// bookUniqueWords.put(names<1>, 1);\n// for (String name : names) {\n//\n// bookUniqueWords.put(name, 1);\n// }\n//\n// for (Map.Entry<String, Integer> entry : bookUniqueWords.entrySet()) {\n// System.out.println(entry.getValue() + \" \" + entry.getKey());\n// }\n// System.out.println(bookUniqueWords.containsKey(\"Байден\"));\n\n\n\n\n }", "public static long fill(int fieldLength, Stack<Integer> path) {\n if (fieldLength < 1) {\n count++;\n if (count % 10_000_000 == 0) {\n System.out.println(path);\n }\n return 0;\n }\n for (int i = 1; i <= 4; i++) {\n if (i <= fieldLength) {\n path.push(i);\n fill(fieldLength - i, path);\n path.pop();\n }\n }\n return 0;\n }", "public void setFlatness(double flatness) {\n\tthis.flatness = flatness;\n\tsetShape(shape);\n }", "protected abstract Graph filterGraph();", "public static void Kruskals(int graph[][]) {\n\t\tgraph = ArraySort(graph, 1);\n\t\t\n\t\tint[][] sets = PopulateSets(graph);\n\t\tint i1;\n\t\tint i2;\n\t\tint max_node=0;\n\t\tint min_node=0;\n\t\tint count = 0;\n\t\tfor (int[] edge: graph) {\n\t\t\tSystem.out.printf(\"%d: \", ++count);\n\t\t\ti1 = FindEdge(sets, edge[0]);\n\t\t\tSystem.out.printf(\"Find(%d) returns %d\\t\", edge[0], i1);\n\t\t\ti2 = FindEdge(sets, edge[2]);\n\t\t\tSystem.out.printf(\"Find(%d) returns %d\\t\", edge[2], i2);\n\t\t\t\n\t\t\tif (i1 != i2) {\n\t\t\t\tif (i1 > i2){max_node = i1;min_node = i2;}\n\t\t\t\tif (i1 < i2){max_node = i2;min_node = i1;}\n\t\t\t\tsets[max_node] = UnionSets(sets[max_node], sets[min_node]);\n\t\t\t\tSystem.out.printf(\"Union(%d, %d) done\\n\", i1, i2);\n\t\t\t} else {\n\t\t\t\tSystem.out.printf(\"Union(%d, %d) not done. Same set\\n\", i1, i2);\n\t\t\t}\n\t\t\tShowForest(sets);\n\t\t}\n//\t\tsets[0] = UnionSets(sets[0], sets[1]);\n\t}", "public static boolean[][] flow (final boolean[][] open) {\n final int n = open.length;\n final boolean[][] full = new boolean[n][n];\n for (int j = 0; j < n; j++) {\n flow (open, full, 0, j);\n }\n return full;\n }", "static void floodfill() {\r\n\t\tprintThis(\"Flood Fill Demo (the input graph must be UNDIRECTED)\");\r\n\t\tnumComp = 0;\r\n\t\tdfs_num = new int[V];\r\n\t\tArrays.fill(dfs_num, DFS_WHITE);\r\n\t\tfor (int i = 0; i < V; i++)\r\n\t\t\tif (dfs_num[i] == DFS_WHITE)\r\n\t\t\t\tfloodfill(i, ++numComp);\r\n\t\tfor (int i = 0; i < V; i++)\r\n\t\t\tSystem.out.printf(\"Vertex %d has color %d\\n\", i, dfs_num[i]);\r\n\t}", "public List<Set<SDGNode>> firstPass() {\n Object[] edges = icfg.edgeSet().toArray();\n\n // first, temporarily remove all edges but CF and CALL\n for (int i = 0; i < edges.length; i++) {\n SDGEdge e = (SDGEdge) edges[i];\n if (e.getKind() != SDGEdge.Kind.CONTROL_FLOW\n && e.getKind() != SDGEdge.Kind.CALL) {\n\n buffer.addFirst(e);\n icfg.removeEdge(e);\n }\n }\n\n // then compute SCCs\n StrongConnectivityInspector<SDGNode, SDGEdge> sci = new StrongConnectivityInspector<SDGNode, SDGEdge>(icfg);\n List<Set<SDGNode>> erg = sci.stronglyConnectedSets();\n\n // put return edges back\n for (SDGEdge e : buffer) {\n icfg.addEdge(e);\n }\n buffer.clear();\n\n return erg;\n }", "public Flat(double width, double length, double height, double weight, double basePrice)\r\n {\r\n this.widthCapacity = width;\r\n this.lengthCapacity = length;\r\n this.heightCapacity = height;\r\n this.weightCapacity = weight;\r\n this.price = basePrice;\r\n\r\n }", "public void shortestPathsNodes() {\n for (int sourceNode = 0; sourceNode < wordGraph.V(); sourceNode++) {\n BreadthFirstDirectedPaths bfs = new BreadthFirstDirectedPaths(wordGraph, sourceNode);\n\n for (int goalNode = 0; goalNode < wordGraph.V(); goalNode++) {\n Iterable<Integer> shortestPath = bfs.pathTo(goalNode);\n int pathLength = -1;\n if (shortestPath != null) {\n for (int edge : shortestPath) {\n pathLength++;\n }\n }\n if (pathLength != -1) {\n }\n System.out.println(pathLength);\n }\n }\n }", "public List<PathResult> findShortestPathsToEveryNode(final String rootNode, final Graph graph) {\n final List<String> vertices = graph.getVertices();\n final List<String> visitedVertices = startingVisitedNodes(rootNode);\n final Map<String, DijkstraEntry> table = createInitialTable(rootNode, vertices);\n\n for (int i = 0; i < visitedVertices.size(); i++) {\n final String currentVertex = visitedVertices.get(i);\n final List<String> unvisitedAdjacentVertices = getUnvisitedAdjacentVertices(\n currentVertex,\n graph,\n visitedVertices);\n\n unvisitedAdjacentVertices.forEach(vertex -> {\n final DijkstraEntry previousNodeEntry = table.get(currentVertex);\n\n final Integer cost =\n graph.getWeight(currentVertex, vertex) + previousNodeEntry\n .getShortestDistance();\n\n final DijkstraEntry entry = table.get(vertex);\n final Integer currentShortestDistance = entry.getShortestDistance();\n\n if (Objects.isNull(currentShortestDistance) || cost < currentShortestDistance) {\n final DijkstraEntry updatedEntry = entry.withDistance(cost)\n .withPreviousVertex(currentVertex);\n table.put(vertex, updatedEntry);\n }\n });\n\n final String unvisitedWithSmallestDistance = unvisitedWithSmallestDistance(\n unvisitedAdjacentVertices, table);\n\n if (unvisitedAdjacentVertices.isEmpty()) {\n break;\n }\n visitedVertices.add(unvisitedWithSmallestDistance);\n }\n\n return createPathResultsFromTable(rootNode, table, vertices);\n }", "public static int[][] completeGraph(int length) {\r\n\t\tint[][] res= new int[length][length];\r\n\t\tfor(int i=0;i!=length;i++)\r\n\t\t\tfor(int j=0;j!=length;j++) {\r\n\t\t\t\tif(i!=j)\r\n\t\t\t\t\tres[i][j]=1;\r\n\t\t\t}\r\n\t\treturn res;\r\n\t}", "public List<Collection<Vertex<Integer>>> detect(UndirectedGraph<Integer,Integer> graph){\n\t\tlong start = System.currentTimeMillis();\n\t\tList<Collection<Vertex<Integer>>> diamonds = find(graph);\n\t\tlong stop = System.currentTimeMillis();\n\t\tp1time = \"\"+(stop-start);\n\t\tfound=diamonds.size();\n\t\treturn diamonds;\n\t}", "int[] bfs(int[][] graph,int source){\n int len=graph.length;\n int shortest_path[]=new int[len];\n int parent[]=new int[len];\n Arrays.fill(shortest_path, Integer.MAX_VALUE/2);\n shortest_path[source]=0;\n Queue<Integer> q=new LinkedList<>();\n q.add(source);\n while (!q.isEmpty()) { \n int u=q.poll();\n for(int v:graph[u]){\n if(shortest_path[v]==Integer.MAX_VALUE/2){\n q.add(v);\n shortest_path[v]=shortest_path[u]+1;\n parent[v]=u;\n }\n }\n }\n return shortest_path;\n }", "public void minCut(){\n QueueMaxHeap<GraphNode> queue = new QueueMaxHeap<>();\n setNodesToUnvisited();\n queue.add(graphNode[0]);\n graphNode[0].visited = true;\n while(!queue.isEmpty()){//if queue is empty it means that we have made all the cuts that need to be cut and we cant get anywhere else\n GraphNode node = queue.get();\n int from = node.nodeID;\n for(int i = 0; i < node.succ.size(); i++){//get the successor of each node and then checks each of the edges between the node and that successor\n GraphNode.EdgeInfo info = node.succ.get(i);\n int to = info.to;\n if(graph.flow[from][to][1] == 0){//if it has no flow then it prints out that line\n System.out.printf(\"Edge (%d, %d) transports %d cases\\n\", from, to, graph.flow[from][to][0]);\n } else {//adds it to the queue if it still has flow to it and if we haven't gone there yet\n if(!graphNode[to].visited){\n graphNode[to].visited = true;\n queue.add(graphNode[to]);\n }\n }\n }\n }\n }", "public static void main(String[] args) {\n Graph graph = new Graph();\n graph.addEdge(0, 1);\n graph.addEdge(0, 4);\n\n graph.addEdge(1,0);\n graph.addEdge(1,5);\n graph.addEdge(1,2);\n graph.addEdge(2,1);\n graph.addEdge(2,6);\n graph.addEdge(2,3);\n\n graph.addEdge(3,2);\n graph.addEdge(3,7);\n\n graph.addEdge(7,3);\n graph.addEdge(7,6);\n graph.addEdge(7,11);\n\n graph.addEdge(5,1);\n graph.addEdge(5,9);\n graph.addEdge(5,6);\n graph.addEdge(5,4);\n\n graph.addEdge(9,8);\n graph.addEdge(9,5);\n graph.addEdge(9,13);\n graph.addEdge(9,10);\n\n graph.addEdge(13,17);\n graph.addEdge(13,14);\n graph.addEdge(13,9);\n graph.addEdge(13,12);\n\n graph.addEdge(4,0);\n graph.addEdge(4,5);\n graph.addEdge(4,8);\n graph.addEdge(8,4);\n graph.addEdge(8,12);\n graph.addEdge(8,9);\n graph.addEdge(12,8);\n graph.addEdge(12,16);\n graph.addEdge(12,13);\n graph.addEdge(16,12);\n graph.addEdge(16,17);\n graph.addEdge(17,13);\n graph.addEdge(17,16);\n graph.addEdge(17,18);\n\n graph.addEdge(18,17);\n graph.addEdge(18,14);\n graph.addEdge(18,19);\n\n graph.addEdge(19,18);\n graph.addEdge(19,15);\n LinkedList<Integer> visited = new LinkedList();\n List<ArrayList<Integer>> paths = new ArrayList<ArrayList<Integer>>();\n int currentNode = START;\n visited.add(START);\n new searchEasy().findAllPaths(graph, visited, paths, currentNode);\n for(ArrayList<Integer> path : paths){\n for (Integer node : path) {\n System.out.print(node);\n System.out.print(\" \");\n }\n System.out.println();\n }\n }", "private void breadthFirst(PathBetweenNodes graph, LinkedList<String> visited) {\r\n\r\n LinkedList<String> nodes = graph.adjacentNodes(visited.getLast());\r\n for (String node : nodes)\r\n {\r\n if (visited.contains(node))\r\n {\r\n continue;\r\n }\r\n if (node.equals(END))\r\n {\r\n \tif (mode1 && mode){\r\n visited.add(node);\r\n printPath(visited); \r\n graph.flag=false;\r\n mode=false;\r\n visited.removeLast();\r\n \t} else if(mode2){\r\n visited.add(node);\r\n printPath(visited); \r\n flag=mode2; \r\n visited.removeLast();\r\n \t} \r\n } \r\n }\r\n\r\n for (String node : nodes) { // implementing a for loop to call each node in the array nodes\r\n if (visited.contains(node) || node.equals(END)) { // if statement to see if node is already visited or it is the end node\r\n continue;\r\n }\r\n flag=true;\r\n visited.addLast(node); //adding the last node to visited array\r\n breadthFirst(graph, visited); // implementing the breath first search\r\n visited.removeLast(); // removing the last node from array visited\r\n }\r\n if (flag == false) {\r\n System.out.println(\"No path Exists between \" + START + \" and \" + END);\r\n flag = true;\r\n }\r\n }", "public List<List<Integer>> allPathsSourceTarget(int[][] graph) {\n \n boolean[] visited = new boolean[graph.length];\n \n List<Integer> paths = new ArrayList();\n paths.add(0);\n \n List<List<Integer>> allPaths = new ArrayList();\n \n dfs(0,graph.length-1, paths,allPaths,visited,graph);\n \n return allPaths;\n }", "public static ArrayList<GraphNode> getPathWithPredicate(GraphNode startNode, Predicate<GraphNode> predicate, int maxLength) {\n ArrayList<GraphNode> path = new ArrayList<>();\n Comparator<GraphNode> nodeComparator = new GraphNodePositionComparator(getPositionOf(startNode));\n HashSet<GraphNode> alreadyFound = new HashSet<>();\n\n Predicate<GraphNode> predicateAndNotAlreadyFound = predicate.and(graphNode -> !alreadyFound.contains(graphNode));\n\n GraphNode currentNode = startNode;\n\n for (int i = 0; i < maxLength; i++) {\n path.add(currentNode);\n alreadyFound.add(currentNode);\n\n GraphNode maxNode = getMaxWithPredicate(\n currentNode.neighbors,\n nodeComparator,\n predicateAndNotAlreadyFound\n );\n\n if (maxNode == null) {\n break;\n }\n currentNode = maxNode;\n }\n\n return path;\n }", "private static int getLongestPath(ArrayList<ArrayList<Integer>> graph, int N) {\n int startNode = 1;\n int edgeVertex = 0;\n\n boolean[] visited = new boolean[N + 1];\n\n LinkedList<Integer> queue = new LinkedList<>();\n\n queue.add(startNode);\n visited[startNode] = true;\n\n while (!queue.isEmpty()) {\n int u = queue.poll();\n\n for (int v : graph.get(u)) {\n if (!visited[v]) {\n queue.add(v);\n visited[v]=true;\n edgeVertex = v;\n }\n }\n }\n\n\n //Doing BFS from one of the edgeVertex\n\n queue.clear();\n Arrays.fill(visited, false);\n\n int length = 0;\n\n queue.add(edgeVertex);\n queue.add(-1);\n visited[edgeVertex] = true;\n\n while (queue.size() > 1) {\n int u = queue.poll();\n\n if (u == -1) {\n queue.add(-1);\n length++;\n\n } else {\n for (int v : graph.get(u)) {\n if (!visited[v]) {\n queue.add(v);\n visited[v] = true;\n }\n }\n }\n }\n\n return length;\n }", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "public void DFS() {\r\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\r\n\r\n\t\t// Create a stack for DFS\r\n\t\tStack<Vertex> stack = new Stack<Vertex>();\r\n\r\n\t\tDFS(this.vertices[3], visited, stack); // DFS starting with 40\r\n\r\n\t\t// Call the helper function to print DFS traversal\r\n\t\t// starting from all vertices one by one\r\n\t\tfor (int i = 0; i < N; ++i)\r\n\t\t\tif (!visited.contains(this.vertices[i]))\r\n\t\t\t\tDFS(this.vertices[i], visited, stack);\r\n\t}", "private void loadCorrespondingFlats(String prop) {\n Firebase flatRef = new Firebase(getResources().getString(R.string.flats_location));\n Query flatsOfPropertyQuery = flatRef.orderByChild(\"addressLine1\").equalTo(prop);\n flatsOfPropertyQuery.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n flatList.clear();\n flatNums.clear();\n for (DataSnapshot childSnapShot : dataSnapshot.getChildren()) {\n Flat flt = childSnapShot.getValue(Flat.class);\n flatList.add(flt);\n flatNums.add(flt.getFlatNum());\n }\n }\n\n @Override\n public void onCancelled(FirebaseError firebaseError) {\n\n }\n });\n }", "private double[] computeShortestPathLengths(Entity pStartNode,\r\n\t\t\tdouble pShortestPathLengthSum, double pMaxPathLength,\r\n\t\t\tSet<Entity> pWasSource)\r\n\t{\r\n\r\n\t\tint pStartNodeMaxPathLength = 0;\r\n\r\n\t\t// a set of nodes that have already been expanded -> algorithm should\r\n\t\t// expand nodes monotonically and not go back\r\n\t\tSet<Entity> alreadyExpanded = new HashSet<Entity>();\r\n\r\n\t\t// a queue holding the newly discovered nodes with their and their\r\n\t\t// distance to the start node\r\n\t\tList<Entity[]> queue = new ArrayList<Entity[]>();\r\n\r\n\t\t// initialize queue with start node\r\n\t\tEntity[] innerList = new Entity[2];\r\n\t\tinnerList[0] = pStartNode; // the node\r\n\t\tinnerList[1] = new Entity(\"0\"); // the distance to the start node\r\n\t\tqueue.add(innerList);\r\n\r\n\t\t// while the queue is not empty\r\n\t\twhile (!queue.isEmpty()) {\r\n\t\t\t// remove first element from queue\r\n\t\t\tEntity[] queueElement = queue.get(0);\r\n\t\t\tEntity currentNode = queueElement[0];\r\n\t\t\tEntity distance = queueElement[1];\r\n\t\t\tqueue.remove(0);\r\n\r\n\t\t\t// if the node was not already expanded\r\n\t\t\tif (!alreadyExpanded.contains(currentNode)) {\r\n\r\n\t\t\t\t// the node gets expanded now\r\n\t\t\t\talreadyExpanded.add(currentNode);\r\n\r\n\t\t\t\t// if the node was a source node in a previous run, we already\r\n\t\t\t\t// have added this path\r\n\t\t\t\tif (!pWasSource.contains(currentNode)) {\r\n\t\t\t\t\t// add the distance of this node to shortestPathLengthSum\r\n\t\t\t\t\t// check if maxPathLength must be updated\r\n\t\t\t\t\tint tmpDistance = new Integer(distance.getFirstLexeme());\r\n\t\t\t\t\tpShortestPathLengthSum += tmpDistance;\r\n\t\t\t\t\tif (tmpDistance > pMaxPathLength) {\r\n\t\t\t\t\t\tpMaxPathLength = tmpDistance;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// even if the node was a source node in a previous run there\r\n\t\t\t\t// can be a path to\r\n\t\t\t\t// other nodes over this node, so go on:\r\n\r\n\t\t\t\t// get the neighbors of the queue element\r\n\t\t\t\tSet<Entity> neighbors = getNeighbors(currentNode);\r\n\r\n\t\t\t\t// iterate over all neighbors\r\n\t\t\t\tfor (Entity neighbor : neighbors) {\r\n\t\t\t\t\t// if the node was not already expanded\r\n\t\t\t\t\tif (!alreadyExpanded.contains(neighbor)) {\r\n\t\t\t\t\t\t// add the node to the queue, increase node distance by\r\n\t\t\t\t\t\t// one\r\n\t\t\t\t\t\tEntity[] tmpList = new Entity[2];\r\n\t\t\t\t\t\ttmpList[0] = neighbor;\r\n\t\t\t\t\t\tInteger tmpDistance = new Integer(\r\n\t\t\t\t\t\t\t\tdistance.getFirstLexeme()) + 1;\r\n\t\t\t\t\t\ttmpList[1] = new Entity(tmpDistance.toString());\r\n\t\t\t\t\t\tqueue.add(tmpList);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tpStartNodeMaxPathLength = new Integer(distance.getFirstLexeme());\r\n\t\t}\r\n\t\teccentricityMap.put(pStartNode, pStartNodeMaxPathLength);\r\n\r\n\t\tdouble returnArray[] = { pShortestPathLengthSum, pMaxPathLength };\r\n\t\treturn returnArray;\r\n\t}", "@Test\n public void cyclicalGraphs2Test() throws Exception {\n // Test history tracking -- the \"last a\" in g1 and g2 below and\n // different kinds of nodes topologically. At k=4 this becomes apparent\n // with kTails, if we start at the first 'a'.\n\n ChainsTraceGraph g1 = new ChainsTraceGraph();\n List<EventNode> g1Nodes = addNodesToGraph(g1, new String[] { \"a\", \"b\",\n \"c\", \"d\" });\n // Create a loop in g1, with 4 nodes\n g1Nodes.get(0).addTransition(g1Nodes.get(1), Event.defTimeRelationStr);\n g1Nodes.get(1).addTransition(g1Nodes.get(2), Event.defTimeRelationStr);\n g1Nodes.get(2).addTransition(g1Nodes.get(3), Event.defTimeRelationStr);\n g1Nodes.get(3).addTransition(g1Nodes.get(0), Event.defTimeRelationStr);\n exportTestGraph(g1, 0);\n\n // g1.a is k-equivalent to g1.a for all k\n for (int k = 1; k < 6; k++) {\n testKEqual(g1Nodes.get(0), g1Nodes.get(0), k);\n }\n\n ChainsTraceGraph g2 = new ChainsTraceGraph();\n List<EventNode> g2Nodes = addNodesToGraph(g2, new String[] { \"a\", \"b\",\n \"c\", \"d\", \"a\" });\n // Create a chain from a to a'.\n g2Nodes.get(0).addTransition(g2Nodes.get(1), Event.defTimeRelationStr);\n g2Nodes.get(1).addTransition(g2Nodes.get(2), Event.defTimeRelationStr);\n g2Nodes.get(2).addTransition(g2Nodes.get(3), Event.defTimeRelationStr);\n g2Nodes.get(3).addTransition(g2Nodes.get(4), Event.defTimeRelationStr);\n exportTestGraph(g2, 1);\n\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 1);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 2);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 3);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 4);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 5);\n\n testNotKEqual(g1Nodes.get(0), g2Nodes.get(0), 6);\n testNotKEqual(g1Nodes.get(0), g2Nodes.get(0), 7);\n }", "@Override\r\n\tpublic void getMinimumSpanningTree(GraphStructure graph) {\r\n\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\tdistanceArray[0]=0;\r\n\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\tList<Edge> list;\r\n\t\twhile(spanningTreeSet.size()!=numberOfVertices) {\r\n\t\t\tfor (int vertex=0; vertex<numberOfVertices;vertex++) {\r\n\t\t\t\tif(! spanningTreeSet.contains(vertex)) {\r\n\t\t\t\t\tspanningTreeSet.add(vertex);\r\n\t\t\t\t\tlist = adjacencyList[vertex];\r\n\t\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[vertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\\nvertex\\tdistance from source\");\r\n\t\tfor (int i=0;i<numberOfVertices;i++) {\r\n\t\t\tSystem.out.println(i+\"\\t\"+distanceArray[i]);\r\n\t\t}\r\n\t}", "void printGraph(Station station, Sensor sensor, MeasurementData data, LocalDateTime since, LocalDateTime until, ParamType paramType, double range);", "public static void botched_dfs3(Graph g, int s) {\n int cpt = 0;\n\n Stack<Integer> stack = new Stack<Integer>();\n boolean visited[] = new boolean[g.vertices()];\n stack.push(s);\n while (!stack.empty()) {\n System.out.println(\"Capacité : \" + stack.capacity());\n int u = stack.pop();\n if (!visited[u]) {\n visited[u] = true;\n System.out.println(u);\n for (Edge e : g.next(u))\n if (!visited[e.to]) {\n stack.push(e.to);\n cpt++;\n }\n }\n }\n }", "@Override\n public LinkedList filterLargerThan(int length) {\n LinkedList newLinkedList = new LinkedList();\n Node currNode = this.head;\n while(currNode.getNextNode() != null){\n if(currNode.getItem().length() <= length){\n newLinkedList.addNode(currNode.getItem());\n }\n currNode = currNode.getNextNode();\n }\n return newLinkedList;\n }", "public static String BFS(Graph grafo, Vertice vertice) {\r\n\t\tArrayList<Integer> busca = new ArrayList<Integer>(); // vertice nivel pai em ordem de descoberta\r\n\t\tArrayList<Vertice> aux1 = new ArrayList<Vertice>(); // fila de nos pais a serem visitados\r\n\t\tArrayList<Vertice> aux2 = new ArrayList<Vertice>(); // fila de nos filhos a serem visitdados\r\n\r\n\t\tint nivel = 0;\r\n\r\n\t\taux1.add(vertice);// adiciona a raiz a aux1 para inicio da iteracao\r\n\t\tvertice.setPai(0);// seta o pai da raiz para zero\r\n\r\n\t\twhile (aux1.size() > 0) {\r\n\t\t\tfor (int i = 0; i < aux1.size(); i++) {\r\n\t\t\t\tif (aux1.get(i).statusVertice() == false) {// verifrifica se o no ja nao foi atingido por outra ramificacao.\r\n\t\t\t\t\tbusca.add(aux1.get(i).getValor());\r\n\t\t\t\t\tbusca.add(nivel);\r\n\t\t\t\t\tbusca.add(aux1.get(i).getPai());\r\n\t\t\t\t\tvertice.alteraStatusVertice(true);\r\n\r\n\t\t\t\t\tfor (int j = 0; i < vertice.getArestas().size(); j++) {\r\n\t\t\t\t\t\tproxVertice(vertice, vertice.getArestas().get(j)).setPai(aux1.get(i).getValor());// associa o no pai\r\n\t\t\t\t\t\taux2.add(proxVertice(vertice, vertice.getArestas().get(j)));// adiciona lista dos proximos nos filhos serem percorridos\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\taux1 = aux2; // todos os nos pai ja foram percoridos, filhos se tornam a lista de nos pai\r\n\t\t\t\t\taux2.clear(); // lista de nos filhos e esvaziada para o proximo ciclo de iteracoes\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tnivel++;\r\n\t\t}\r\n\r\n\t\tresetStatusVertex(grafo);\r\n\r\n\t\treturn criaStringDeSaida(grafo, busca);// formata o resutltado da busca para a string esperada\r\n\t}", "List<OrderFlowerData> getFlowersData(Order order);", "public static void botched_dfs2(Graph g, int s) {\n Stack<Integer> stack = new Stack<Integer>();\n boolean visited[] = new boolean[g.vertices()];\n stack.push(s);\n System.out.println(s);\n visited[s] = true;\n while (!stack.empty()) {\n int u = stack.pop();\n for (Edge e : g.next(u))\n if (!visited[e.to]) {\n System.out.println(e.to);\n visited[e.to] = true;\n stack.push(e.to);\n }\n }\n }", "public List<Long> depthTraverse(){\n return depthTraverseGen(null);\n }", "public static <V> Graph<V> getMinimumSpanningTreeKruskal(Graph<V> graph) {\n class Arista {\n private V origen;\n private V destino;\n private double peso;\n\n private Arista(V pOrigen, double pPeso, V pDestino) {\n origen = pOrigen;\n peso = pPeso;\n destino = pDestino;\n }\n }\n\n V[] array = graph.getValuesAsArray();\n double[][] matrizPesos = graph.getGraphStructureAsMatrix();\n double[][] matrizCopia = new double[array.length][array.length];\n for (int x = 0; x < array.length; x++) {\n for (int y = 0; y < array.length; y++) {\n matrizCopia[x][y] = matrizPesos[x][y];\n }\n }\n\n List<Arista> aristas = new LinkedList<>();\n\n // Se buscan todas las aristas del grafo y se enlistan\n for (int x = 0; x < array.length; x++) {\n for (int y = 0; y < array.length; y++) {\n if (matrizCopia[x][y] != -1) {\n if (!graph.isDirected()) {\n matrizCopia[y][x] = -1;\n }\n Arista ar = new Arista(array[x], matrizCopia[x][y], array[y]);\n aristas.add(ar);\n }\n }\n }\n\n //Se ordenan las listas de menor a mayor, aplicando el ordenamiento de burbuja.\n if (aristas.size() > 1) {\n int i = 0;\n for (int x = 2; x < aristas.size(); x++) {\n for (int y = 1; y < aristas.size() - i; y++) {\n Arista temp = aristas.get(y);\n Arista temp2 = aristas.get(y+1);\n if (temp.peso > temp2.peso) {\n aristas.set(y, temp2);\n aristas.set(y+1, temp);\n }\n }\n i++;\n }\n }\n\n List<Graph<V>> bosque = new LinkedList<>();\n for (int x = 0; x < array.length; x++) {\n Graph<V> temp = new AdjacencyMatrix<>();\n temp.addNode(array[x]);\n bosque.add(temp);\n }\n\n Iterator<Arista> it1 = aristas.iterator();\n while (it1.hasNext()) {\n Arista aux = it1.next();\n int arbolOrigen = buscarArbol(aux.origen, bosque);\n int arbolDestino = buscarArbol(aux.destino, bosque);\n if (arbolDestino < arbolOrigen) {\n int temp = arbolDestino;\n arbolDestino = arbolOrigen;\n arbolOrigen = temp;\n }\n\n if (arbolDestino != arbolOrigen) { // Significa que estan en diferentes arboles.\n Graph<V> grafoDestino = bosque.remove(arbolDestino);\n Graph<V> grafoTemp = unirGrafos(bosque.get(arbolOrigen), grafoDestino);\n grafoTemp.addEdge(aux.origen, aux.destino, aux.peso);\n bosque.set(arbolOrigen, grafoTemp);\n }\n }\n if (bosque.size() != 1) { // Significa que hay vertices aislados.\n for (int x = 2; x <= bosque.size(); x++) {\n Graph<V> grafoTemp = bosque.remove(x);\n Graph<V> grafosUnidos = unirGrafos(bosque.get(1), grafoTemp);\n bosque.set(1, grafosUnidos);\n }\n }\n\n return bosque.get(1);\n }", "public void BFS() {\r\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\r\n\r\n\t\t// Create a queue for BFS\r\n\t\tQueue<Vertex> queue = new LinkedList<Vertex>();\r\n\r\n\t\tBFS(this.vertices[3], visited, queue); // BFS starting with 40\r\n\r\n\t\t// Call the helper function to print BFS traversal\r\n\t\t// starting from all vertices one by one\r\n\t\tfor (int i = 0; i < N; ++i)\r\n\t\t\tif (!visited.contains(this.vertices[i]))\r\n\t\t\t\tBFS(this.vertices[i], visited, queue);\r\n\t}", "private ArrayList findBestShiftGraph (TimeSeries timeSeries)\n {\n ArrayList candidateShiftGraph = new ArrayList (timeSeries.size() / 2);\n ArrayList bestShiftGraph = new ArrayList ();\n\n int matchCount = 0;\n int bestMatchCount = 0;\n int shiftOffset = 0;\n int bestShiftOffset = 0;\n\n // we can stop correlation runs when we get to point where remaining portion is too small\n int lastShiftOffset = timeSeries.size() - this.minPeriodLength;\n\n // successively shift to a starting point further to the right in the time series.\n for (shiftOffset = minPeriodLength; shiftOffset < lastShiftOffset; shiftOffset++)\n {\n matchCount = 0;\n candidateShiftGraph.clear();\n\n // compare the shifted version against as much of a non-shifted version as possible\n //the number of elements to compare decreases by one each time as shifting occurs\n int lastComparisonIndex = timeSeries.size() - shiftOffset;\n for (int j = 0 ; j < lastComparisonIndex; j++)\n {\n Double staticElement = null;\n Double shiftElement = null;\n\n // get the shifted element and the static one and comparet them for equality\n try\n {\n TimeSeriesValue staticVal = timeSeries.getValueAt (j);\n TimeSeriesValue shiftVal = timeSeries.getValueAt (j + shiftOffset);\n\n staticElement = new Double (((Number)staticVal.getValue()).doubleValue());\n shiftElement = new Double (((Number)shiftVal.getValue()).doubleValue());\n }\n catch (Exception e)\n {\n candidateShiftGraph.add (null);\n }\n\n // if elements are equal add that value to the shift graph, otherwise add null\n if (elementsAreEqual (staticElement, shiftElement))\n {\n candidateShiftGraph.add (staticElement);\n matchCount++;\n }\n else\n candidateShiftGraph.add (null);\n\n } // end for (j)\n\n // determine if this shift attempt resulted in more matches that anything previously tried\n // if so make this our 'best' attempt.\n if (matchCount > bestMatchCount)\n {\n bestMatchCount = matchCount;\n bestShiftOffset = shiftOffset;\n\n bestShiftGraph.clear();\n bestShiftGraph.addAll (candidateShiftGraph);\n candidateShiftGraph.clear();\n\n df.addText (\"Found new best shift graph : \" + bestShiftGraph.toString());\n } // end if\n } // end for (shiftOffset)\n\n return bestShiftGraph;\n }", "private void truncateLooseEdges(List<Node> eogSources) {\n for (Node eogSourceNode : eogSources) {\n if (eogSourceNode instanceof FunctionDeclaration) continue;\n List<Node> nextNodes = new ArrayList<>(eogSourceNode.getNextEOG());\n eogSourceNode.getNextEOG().clear();\n nextNodes.forEach(node -> node.getPrevEOG().remove(eogSourceNode));\n truncateLooseEdges(\n nextNodes.stream()\n .filter(node -> node.getPrevEOG().isEmpty() && !node.getNextEOG().isEmpty())\n .collect(Collectors.toList()));\n }\n }", "public void raiseFlatbed(){\n if(getCurrentSpeed() == 0){\n flatbed.raiseFlatbed();\n }\n }", "public int[] findMinimunPathBF(int src, int[][] graph) {\r\n\t\t// The distance from the src to each vertices.\r\n\t\tint[] dist = new int[graph.length];\r\n\t\t// Maximizing the distance of the sre to all the vertices.\r\n\t\tfor (int i = 0; i < dist.length; i++) {\r\n\t\t\tdist[i] = Integer.MAX_VALUE;\r\n\t\t}\r\n\t\tdist[src] = 0;\r\n\r\n\t\t// Loop |v|-1 times, For each edge in the graph.\r\n\t\tfor (int k = 0; k < graph.length - 1; k++) {\r\n\t\t\t// For each edge in the graph. \r\n\t\t\tfor (int i = 0; i < graph.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < graph.length; j++) {\r\n\t\t\t\t\t// Relax edge(i, j).\r\n\t\t\t\t\tif (graph[i][j] != 0) {\r\n\t\t\t\t\t\tif (dist[i] != Integer.MAX_VALUE\r\n\t\t\t\t\t\t\t\t&& dist[j] > dist[i] + graph[i][j]) {\r\n\t\t\t\t\t\t\tdist[j] = dist[i] + graph[i][j];\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\t// Check if there is a negative cycle, loop the edges.\r\n\t\tfor (int i = 0; i < graph.length; i++) {\r\n\t\t\t// For each edge in the graph.\r\n\t\t\tfor (int j = 0; j < graph.length; j++) {\r\n\t\t\t\tif (graph[i][j] != 0) {\r\n\t\t\t\t\t// Still can relax the edges?.\r\n\t\t\t\t\tif (dist[i] != Integer.MAX_VALUE\r\n\t\t\t\t\t\t\t&& dist[j] > dist[i] + graph[i][j]) {\r\n\t\t\t\t\t\t// Put a sign of having a negative cycle.\r\n\t\t\t\t\t\tdist[0] = Integer.MIN_VALUE;\r\n\t\t\t\t\t\treturn dist;\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 dist;\r\n\t}", "public String flatten() {\n return timestamp + \";\"\n + drivingTime + \";\"\n + drivingDistance + \";\"\n + locationData.flatten()\n + speedData.flatten()\n + engineData.flatten()\n + diagnosticData.flatten()\n + fuelData.flatten();\n }", "@Test\n void testShortestPath(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,1);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n LinkedList<node_info> expectedPath = new LinkedList<>(Arrays.asList(g.getNode(1),g.getNode(7),g.getNode(4)));\n assertNull(ga.shortestPath(1,10));\n assertEquals(expectedPath,ga.shortestPath(1,4));\n assertEquals(1,ga.shortestPath(1,1).size());\n }", "ArrayList<Node> DFSIter( Graph graph, final Node start, final Node end)\n {\n boolean visited[] = new boolean[graph.numNodes];\n Stack<Node> stack = new Stack<Node>();\n Map< Node,Node> parentPath = new HashMap< Node,Node>(); \n stack.push(start);\n\n while ( !stack.isEmpty() )\n {\n Node currNode = stack.pop();\n // end loop when goal node is found\n if ( currNode == end )\n break;\n // If node has already been visited, skip it\n if ( visited[currNode.id] )\n continue;\n else\n {\n visited[currNode.id] = true;\n int numEdges = currNode.connectedNodes.size();\n\n for ( int i = 0; i < numEdges; i++ )\n {\n Node edgeNode = currNode.connectedNodes.get(i);\n if ( !visited[edgeNode.id] )\n {\n stack.push( edgeNode );\n parentPath.put( edgeNode, currNode);\n }\n }\n \n }\n }\n\n ArrayList<Node> path = new ArrayList<Node>();\n Node currNode = end;\n while ( currNode != null )\n {\n path.add(0, currNode);\n currNode = parentPath.get(currNode);\n }\n\n return path;\n }", "public static Long compactForwardAlgorithm(ArrayList<Integer>[] graph) {\n // define injective function eta - takes O(n log(n)) time\n Set<Pair<Integer, ArrayList<Integer>>> pairs = Utils.getSortedArrays(graph);\n Map<Integer, Integer> etas = Utils.getEtasMap(pairs);\n\n // sort adjacency arrays according to eta\n pairs.forEach(p -> Collections.sort(p.getSecond(), new Comparator<Integer>() {\n @Override\n public int compare(Integer first, Integer second) {\n if (etas.get(first) > etas.get(second))\n return 1;\n else\n return -1;\n }\n }));\n\n int triangleCount = 0;\n\n // main part, in which we actually count triangles\n Iterator<Pair<Integer, ArrayList<Integer>>> iterator = pairs.iterator();\n while (iterator.hasNext()) {\n Pair<Integer, ArrayList<Integer>> pair = iterator.next();\n Integer v = pair.getFirst();\n ArrayList<Integer> v_neighbors = graph[v];\n\n for (int u : v_neighbors) {\n if (etas.get(u) > etas.get(v)) {\n ArrayList<Integer> u_neighbors = graph[u];\n\n Iterator<Integer> uIterator = u_neighbors.iterator(), vIterator = v_neighbors.iterator();\n\n if (uIterator.hasNext() && vIterator.hasNext()) {\n Integer u_ = uIterator.next(), v_ = vIterator.next();\n while (uIterator.hasNext() && vIterator.hasNext() && etas.get(u_) < etas.get(v)\n && etas.get(v_) < etas.get(v)) {\n if (etas.get(u_) < etas.get(v_))\n u_ = uIterator.next();\n else if (etas.get(u_) > etas.get(v_))\n v_ = vIterator.next();\n else {\n triangleCount++;\n u_ = uIterator.next();\n v_ = vIterator.next();\n }\n }\n\n }\n }\n }\n }\n return new Long(triangleCount);\n }", "@Override\n\tpublic List<Node<E>> bfs(DirectedGraph<E> graph) {\n\t\tList<Node<E>> returnList = new ArrayList<>(); // O(1)\n\t\tHashSet<Node<E>> visitedList = new HashSet<>(); // O(1)\n\t\tHashSet<Node<E>> hashSet = new HashSet<>(); // O(1)\n\n\t\t// If the graph does contains heads, iterate from the head.\n\t\tif(graph.headCount() > 0) { // O(1)\n\t\t\tIterator<Node<E>> heads = graph.heads(); // O(1)\n\t\t\twhile(heads.hasNext()) { // O(n)\n\t\t\t\tNode<E> node = heads.next(); // O(1)\n\n\t\t\t\tif(!visitedList.contains(node)) { // O(1)\n\t\t\t\t\tnode.num = visitedList.size(); // O(1)\n\t\t\t\t\tvisitedList.add(node); // O(1)\n\t\t\t\t\thashSet.add(node); // O(1)\n\t\t\t\t\treturnList.add(node); // O(1)\n\t\t\t\t\treturnList = bfsRecursive(hashSet, visitedList, returnList); // O(1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Else start from the first node in the graph.\n\t\telse {\n\t\t\thashSet.add(graph.getNodeFor(graph.allItems().get(0))); // O(1)\n\t\t\treturnList = bfsRecursive(hashSet, visitedList, returnList); // O(1)\n\t\t}\n\t\treturn returnList;\n\t}", "com.expedia.www.packagefinder.database.exppackage.ExpPackageProtos.transitFlight getTransitFlights(int index);", "private List<List<EdgeType>> buildLongerPaths(List<EdgeType> pathSoFar)\r\n {\r\n\tfinal List<List<EdgeType>> returnList\r\n\t = new ArrayList<List<EdgeType>>();\r\n\tfinal String nextSourceNodeType\r\n\t = pathSoFar.get(pathSoFar.size()-1).getDestType();\r\n\t\r\n\tfor (final EdgeType et : getEdgeTypes(nextSourceNodeType))\r\n\t{\r\n\t final List<EdgeType> listCopy = new ArrayList<EdgeType>(pathSoFar);\r\n\t listCopy.add(et);\r\n\t returnList.add(listCopy);\r\n\t}\r\n\treturn returnList;\r\n }", "public List<TopFillingType> getTopFillingTypeList() {\n\t\treturn topFillingTypeRepository.findAll();\n\t}", "@Override\r\n\tpublic void DFS() {\r\n\t\tvertices.forEach((E e, Vertex<E> u) -> {\r\n\t\t\tu.setColor(Color.WHITE);\r\n\t\t\tu.setPredecessor(null);\r\n\t\t});\r\n\t\tDFStime = 0;\r\n\t\tvertices.forEach((E e, Vertex<E> u) -> {\r\n\t\t\tif(u.getColor() == Color.WHITE) {\r\n\t\t\t\tDFSVisit(u);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void flushData()\n {\n try\n {\n while(state.get().ordinal() < SimulationState.TEARING_DOWN.ordinal() || !flushing.isEmpty())\n {\n ICardinality cardinality = flushing.poll(1, TimeUnit.MILLISECONDS);\n if (cardinality == null)\n continue;\n\n long numToFlush = cardinality.cardinality();\n counters.numFlushed.addAndGet(numToFlush);\n generateSSTables(cardinality, numToFlush, partitioner.getMinimumToken(), partitioner.getMaximumToken(), \"flushing\", true);\n }\n }\n catch (InterruptedException e)\n {\n logger.error(\"Exception happen during flushing\", e);\n }\n }", "public static ArrayList<Integer[]> compactForwardAlgorithmTriangles(ArrayList<Integer>[] graph) {\n Set<Pair<Integer, ArrayList<Integer>>> pairs = Utils.getSortedArrays(graph);\n Map<Integer, Integer> etas = Utils.getEtasMap(pairs);\n\n // sort adjacency arrays according to eta\n pairs.forEach(p -> p.getSecond().sort(Comparator.comparing(etas::get)));\n\n\n\n int triangleCount = 0;\n ArrayList<Integer[]> triangles = new ArrayList();\n\n\n // main part, in which we actually count triangles\n Iterator<Pair<Integer, ArrayList<Integer>>> iterator = pairs.iterator();\n while (iterator.hasNext()) {\n Pair<Integer, ArrayList<Integer>> pair = iterator.next();\n Integer v = pair.getFirst();\n ArrayList<Integer> v_neighbors = graph[v];\n\n for (int u : v_neighbors) {\n if (etas.get(u) > etas.get(v)) {\n ArrayList<Integer> u_neighbors = graph[u];\n\n Iterator<Integer> uIterator = u_neighbors.iterator(), vIterator = v_neighbors.iterator();\n\n if (uIterator.hasNext() && vIterator.hasNext()) {\n Integer u_ = uIterator.next(), v_ = vIterator.next();\n while (uIterator.hasNext() && vIterator.hasNext() && etas.get(u_) < etas.get(v)\n && etas.get(v_) < etas.get(v)) {\n if (etas.get(u_) < etas.get(v_))\n u_ = uIterator.next();\n else if (etas.get(u_) > etas.get(v_))\n v_ = vIterator.next();\n else {\n Integer[] triangle = new Integer[3];\n\n triangle[0] = u;\n triangle[1] = v;\n triangle[2] = u_;\n triangles.add(triangle);\n\n\n triangleCount++;\n\n u_ = uIterator.next();\n v_ = vIterator.next();\n\n }\n }\n\n }\n }\n }\n }\n return triangles;\n }", "@Test\n public void testFlattenUpperLimit() throws Exception {\n PhysicalOperator flatten = new FlattenPOP(null, SchemaPath.getSimplePath(\"c\"));\n mockOpContext(flatten, initReservation, maxAllocation);\n List<String> inputJsonBatches = Lists.newArrayList();\n StringBuilder batchString = new StringBuilder();\n\n StringBuilder flattenElement = new StringBuilder();\n\n // Create list of 1000 elements\n flattenElement.append(\"[\");\n for (int i = 0; i < 1000; i++) {\n flattenElement.append(i);\n flattenElement.append(\",\");\n }\n flattenElement.append(1000);\n flattenElement.append(\"]\");\n\n batchString.append(\"[\");\n\n numRows = 100;\n\n for (int i = 0; i < numRows; i++) {\n batchString.append(\"{\\\"a\\\": 5, \" + \"\\\"c\\\":\" + flattenElement + \"},\");\n }\n batchString.append(\"{\\\"a\\\": 5, \" + \"\\\"c\\\":\" + flattenElement + \"}\");\n batchString.append(\"]\");\n inputJsonBatches.add(batchString.toString());\n\n // Figure out what will be approximate total output size out of flatten for input above\n // We will use this sizing information to set output batch size so we can produce desired\n // number of batches that can be verified.\n List<String> expectedJsonBatches = Lists.newArrayList();\n StringBuilder expectedBatchString = new StringBuilder();\n\n expectedBatchString.append(\"[\");\n for (int i = 0; i < numRows; i++) {\n for (int j = 0; j < 1000; j++) {\n expectedBatchString.append(\"{\\\"a\\\": 5, \" + \"\\\"c\\\" :\");\n expectedBatchString.append(j);\n expectedBatchString.append(\"},\");\n }\n }\n for (int j = 0; j < 999; j++) {\n expectedBatchString.append(\"{\\\"a\\\": 5, \" + \"\\\"c\\\" :\");\n expectedBatchString.append(j);\n expectedBatchString.append(\"},\");\n }\n\n expectedBatchString.append(\"{\\\"a\\\": 5, \" + \"\\\"c\\\" :\");\n expectedBatchString.append(1000);\n expectedBatchString.append(\"}\");\n\n expectedBatchString.append(\"]\");\n expectedJsonBatches.add(expectedBatchString.toString());\n\n long totalSize = getExpectedSize(expectedJsonBatches);\n // set the output batch size to 1/2 of total size expected.\n // We will get 16 batches because of upper bound of 65535 rows.\n fragContext.getOptions().setLocalOption(\"drill.exec.memory.operator.output_batch_size\", totalSize / 2);\n\n // Here we expect 16 batches because each batch will be limited by upper limit of 65535 records.\n LegacyOperatorTestBuilder opTestBuilder = legacyOpTestBuilder()\n .physicalOperator(flatten)\n .inputDataStreamJson(inputJsonBatches)\n .baselineColumns(\"a\", \"c\")\n .expectedNumBatches(2) // verify number of batches\n .expectedBatchSize(totalSize / 2); // verify batch size.\n\n for (long i = 0; i < numRows + 1; i++) {\n for (long j = 0; j < 1001; j++) {\n opTestBuilder.baselineValues(5l, j);\n }\n }\n\n opTestBuilder.go();\n }", "protected void resetGraph() {\n for (List<Edge> path : graph) {\r\n for (Edge e : path) {\r\n e.flow = 0;\r\n }\r\n }\r\n }", "public List<List<T>> allCombinationsOfGivenLength(List<T> elements, int length) {\n if (elements.size() < length)\n return new ArrayList<>();\n\n if (length == 1) {\n //the various combinations of 1 letter possible are those combinations which have one of the elements only\n List<List<T>> combinations = new ArrayList<>();\n for (T element : elements) {\n List<T> combination = new ArrayList<>();\n combination.add(element);\n combinations.add(combination);\n }\n return combinations;\n }\n\n List<List<T>> combinations = new ArrayList<>();\n //remove first element\n List<List<T>> allCombinationsTakingThisElement = allCombinationsOfGivenLength(elements.subList(1, elements.size()), length - 1);\n prependElementToAllLists(allCombinationsTakingThisElement, elements.get(0));\n\n List<List<T>> allCombinationsNotTakingThisElement = allCombinationsOfGivenLength(elements.subList(1, elements.size()), length);\n\n combinations.addAll(allCombinationsNotTakingThisElement);\n combinations.addAll(allCombinationsTakingThisElement);\n return combinations;\n }", "@Override\n protected List<CriticalNode<N>> constructQueues(Collection<N> allNodes, Collection<L> allLinks, Collection<List<N>> allPaths, GraphPathsData<N> graphPathsData) {\n List<Pair<List<N>, PathLength>> pathWithLengthPairs = GraphPathsData.computeLengthsOfPaths(\n lengthComputer, allPaths, allNodes, allLinks, false\n );\n Map<N, Integer> nodeToLengthOfCriticalPathFromBegin = pathWithLengthPairs.stream().collect(Collectors.toMap(\n //Key = first node of path\n pathWithLengthFromBegin -> CollectionUtils.getLastOrNull(pathWithLengthFromBegin.first),\n //Value = length of path in weight\n pathWithLengthFromBegin -> pathWithLengthFromBegin.second.inNumberOfNodes\n ));\n\n return graphPathsData.pathsWithLengths.stream()\n //Map pair {path, pathLength} to pair {{path, pathLength}, coherence}\n .map(pathWithLengthPair -> Pair.create(\n pathWithLengthPair,\n CoherenceComputer.getCoherence(CollectionUtils.getFirstOrNull(pathWithLengthPair.first), allLinks)\n ))\n //Sort paths\n .sorted(\n //Sort by coherence\n Comparator.<Pair<Pair<List<N>, PathLength>, Integer>, Integer>comparing(Pair::getSecond)\n //Max first\n .reversed()\n //If equal coherence - sort by number of nodes left to beginning of graph\n .thenComparing(\n pathWithLengthPairWithCoherencePair ->\n nodeToLengthOfCriticalPathFromBegin.get(\n CollectionUtils.getFirstOrNull(\n pathWithLengthPairWithCoherencePair.first.first\n )\n )\n )\n )\n //pair {{path, lengthOfPath}, coherence} -> CriticalNode(firstNodeOfPath, {coherence, lengthOfPathInNumberOfNodes})\n .map(pathWithLengthPairWithCoherencePair -> new CriticalNode<>(\n CollectionUtils.getFirstOrNull(pathWithLengthPairWithCoherencePair.first.first),\n new Tuple<>(\n pathWithLengthPairWithCoherencePair.second,\n nodeToLengthOfCriticalPathFromBegin.get(\n CollectionUtils.getFirstOrNull(\n pathWithLengthPairWithCoherencePair.first.first\n )\n )\n )\n ))\n .collect(Collectors.toList());\n }", "public boolean reducible() {\n if (dfsTree.back.isEmpty()) {\n return true;\n }\n int size = controlFlow.transitions.length;\n boolean[] loopEnters = dfsTree.loopEnters;\n TIntHashSet[] cycleIncomings = new TIntHashSet[size];\n // really this may be array, since dfs already ensures no duplicates\n TIntArrayList[] nonCycleIncomings = new TIntArrayList[size];\n int[] collapsedTo = new int[size];\n int[] queue = new int[size];\n int top;\n for (int i = 0; i < size; i++) {\n if (loopEnters[i]) {\n cycleIncomings[i] = new TIntHashSet();\n }\n nonCycleIncomings[i] = new TIntArrayList();\n collapsedTo[i] = i;\n }\n\n // from whom back connections\n for (Edge edge : dfsTree.back) {\n cycleIncomings[edge.to].add(edge.from);\n }\n // from whom ordinary connections\n for (Edge edge : dfsTree.nonBack) {\n nonCycleIncomings[edge.to].add(edge.from);\n }\n\n for (int w = size - 1; w >= 0 ; w--) {\n top = 0;\n // NB - it is modified later!\n TIntHashSet p = cycleIncomings[w];\n if (p == null) {\n continue;\n }\n TIntIterator iter = p.iterator();\n while (iter.hasNext()) {\n queue[top++] = iter.next();\n }\n\n while (top > 0) {\n int x = queue[--top];\n TIntArrayList incoming = nonCycleIncomings[x];\n for (int i = 0; i < incoming.size(); i++) {\n int y1 = collapsedTo[incoming.getQuick(i)];\n if (!dfsTree.isDescendant(y1, w)) {\n return false;\n }\n if (y1 != w && p.add(y1)) {\n queue[top++] = y1;\n }\n }\n }\n\n iter = p.iterator();\n while (iter.hasNext()) {\n collapsedTo[iter.next()] = w;\n }\n }\n\n return true;\n }", "private void computeAllPaths()\n {\n for (Station src : this.graph.stations)\n {\n List<Station> visited = new ArrayList<Station>();\n computePathsForNode(src, null, null, visited);\n }\n Print.printTripList(this.tripList);\n }", "public static boolean isStraight(){\n boolean start = false;\n int count = 0;\n for (int i : rankFrequency) {\n if(i == 1){\n if(start){\n count++;\n }else{\n start=true;\n count++;\n }\n }else{\n if(start){\n count = 0;\n start = false;\n }\n }\n }\n\n return (count == 5);\n }", "@Test\r\n\tpublic void test_Big_Graph() {\n\t\tweighted_graph g = new WGraph_DS();\r\n\t\tint size = 1000*1000;\r\n\t\tint ten=1;\r\n\t\tfor (int i = 0; i <size; i++) {\r\n\t\t\tg.addNode(i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i <size; i++) {\r\n\t\t\tint dest=i;\r\n\t\t\tg.connect(size-2, i, 0.23); \r\n\r\n\t\t\tif(i<size-1){\r\n\t\t\t\tg.connect(i,++dest,0.78);\r\n\t\t\t}\r\n\t\t\tif(i%2==0&&i<size-2) {\r\n\t\t\t\tg.connect(i,2+dest,0.94);\r\n\t\t\t}\t\r\n\r\n\t\t\tif(ten==i&&(i%2==0)) {\r\n\t\t\t\tfor (int j =0 ; j <size; j++) {\r\n\t\t\t\t\tg.connect(ten, j,0.56);\r\n\t\t\t\t\tg.connect(ten-2, j, 0.4);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tten=ten*10;\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\r\n\t\tweighted_graph_algorithms algo = new WGraph_Algo();\r\n\t\talgo.init(g);\r\n\t\tassertTrue(algo.isConnected());\r\n\t\tassertEquals(algo.shortestPathDist(0, 999998),0.23);\r\n\t\tassertEquals(algo.shortestPathDist(0, 8),0.46);\r\n\t\tint expected2 []= {6,999998,8};\r\n\t\tint actual2 [] = new int [3];\r\n\t\tint i=0;\r\n\t\tfor(node_info n :algo.shortestPath(6, 8)) {\r\n\t\t\tactual2[i++]=n.getKey();\r\n\t\t}\r\n\t\tassertArrayEquals(expected2,actual2);\r\n\r\n\t}", "public static void main(String[] args) {\n\n Graph myGraph = new Graph();\n myGraph.addNode(\"8\");\n myGraph.addNode(\"1\");\n myGraph.addNode(\"2\");\n myGraph.addNode(\"9\");\n myGraph.addNode(\"7\");\n myGraph.addNode(\"5\");\n myGraph.addEdge(\"8\" , \"1\" , 50);\n myGraph.addEdge(\"5\" , \"1\" , 70);\n myGraph.addEdge(\"7\" , \"5\", 20);\n myGraph.addEdge(\"8\" , \"9\", 100);\n myGraph.addEdge(\"8\" , \"2\", 40);\n String[] trip = {\"8\" , \"1\" , \"5\"};\n String[] trip2 = {\"8\" , \"5\"};\n String[] trip3 = {\"8\" , \"1\" , \"5\" , \"7\" , \"5\" , \"1\" , \"8\" , \"9\"};\n String[] trip4 = {\"8\" , \"9\" , \"5\" };\n String[] trip5 = {\"8\"};\n String[] trip6 = {\"8\" , \"2\"};\n// System.out.println(myGraph);\n// System.out.println(myGraph.getNodes());\n// System.out.println(myGraph.getNeighbors(\"8\"));\n// System.out.println(myGraph.getNeighbors(\"7\"));\n// System.out.println(myGraph.getNeighbors(\"5\"));\n// System.out.println(myGraph.size());\n// System.out.println(myGraph.breadthFirst(\"8\"));\n// System.out.println(myGraph.weightList);\n// System.out.println(myGraph.breadthFirst(\"7\"));\n// System.out.println(myGraph.breadthFirst(\"5\"));\n// System.out.println(myGraph.businessTrip(\"8\",trip));\n// System.out.println(myGraph.businessTrip(\"8\",trip2));\n// System.out.println(myGraph.businessTrip(\"8\",trip3));\n// System.out.println(myGraph.businessTrip(\"8\",trip4));\n// System.out.println(myGraph.businessTrip(\"8\",trip5));\n// System.out.println(myGraph.businessTrip(\"8\",trip6));\n System.out.println(myGraph.depthFirst(\"8\"));\n }", "public MyArrayList<MyArrayList<Node>> findStronglyConnectedComponents(boolean recursive, boolean timing) {\n long startTime = System.currentTimeMillis();\n //(1) Run DFS on the graph G\n if (recursive) {\n this.DFSRecursive();\n } else {\n this.DFS();\n }\n if (timing) {\n System.out.println(\"Finished first DFS: \" + (System.currentTimeMillis() - startTime));\n }\n //(2) Construct G^t - graph with reversed edges\n Graph Gt = this.constructReversedGraph();\n if (timing) {\n System.out.println(\"Finished constructing Gt: \" + (System.currentTimeMillis() - startTime));\n }\n //(3) Sort the nodes in G^t by finishing times in the first DFS\n if (recursive) {\n SortingUtils.mergeSortRecursive(Gt.nodes);\n } else {\n SortingUtils.mergeSort(Gt.nodes);\n }\n if (timing) {\n System.out.println(\"Finished merge sort: \" + (System.currentTimeMillis() - startTime));\n }\n //(4) Run DFS on graph G^t taking vertices in descending order of finishing times (since we just sorted them)\n if (recursive) {\n return Gt.DFSRecursive();\n } else {\n return Gt.DFS();\n }\n }", "@objid (\"c8de396e-ab02-483d-b196-1ed35eed0fa2\")\n <T extends Transition> List<T> getSends(java.lang.Class<T> filterClass);", "public List<Integer> topologicalOrder(int vertices, int[][] edges) {\n\t\tList<Integer> result = new ArrayList<>();\n\n\t\tMap<Integer, List<Integer>> graph = new HashMap<>();\n\t\tMap<Integer, Integer> freqMap = new HashMap<>();\n\n\t\t// Initialize\n\t\tfor (int i = 0; i < vertices; ++i) {\n\t\t\tgraph.put(i, new ArrayList<>());\n\t\t\tfreqMap.put(i, 0);\n\t\t}\n\n\t\tfor (int i = 0; i < edges.length; ++i) {\n\t\t\tgraph.get(edges[i][0]).add(edges[i][1]);\n\t\t\tfreqMap.put(edges[i][1], freqMap.get(edges[i][1]) + 1);\n\t\t}\n\n\t\tList<Integer> sources = freqMap.entrySet().stream().filter(x -> x.getValue() == 0).map(y -> y.getKey())\n\t\t\t\t.collect(Collectors.toList());\n\n\t\tQueue<Integer> sourceQueue = new LinkedList<>(sources);\n\n\t\twhile (!sourceQueue.isEmpty()) {\n\t\t\tint source = sourceQueue.poll();\n\t\t\tresult.add(source);\n\t\t\tfor (int elem : graph.get(source)) {\n\t\t\t\tif (freqMap.get(elem) == 1) {\n\t\t\t\t\tsourceQueue.offer(elem);\n\t\t\t\t\tfreqMap.remove(elem);\n\t\t\t\t} else {\n\t\t\t\t\tfreqMap.put(elem, freqMap.get(elem) - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If length is not same, then there is a cycle\n\t\treturn result.size() == vertices ? result : new ArrayList<>();\n\t}", "public static Long forwardAlgorithm(ArrayList<Integer>[] graph) {\n // define injective function eta - takes O(n log(n)) time\n Set<Pair<Integer, ArrayList<Integer>>> pairs = Utils.getSortedArrays(graph);\n Map<Integer, Integer> etas = Utils.getEtasMap(pairs);\n\n // initialize arraylists\n //ArrayList<Integer>[] A = (ArrayList<Integer>[]) new ArrayList[graph.length];\n ArrayList<Integer>[] A = new ArrayList[graph.length];\n for (int i = 0; i < graph.length; i++) {\n A[i] = new ArrayList<>(0);\n //A[i].ensureCapacity(graph.length / 50);\n }\n\n int triangleCount = 0;\n // main part, in which we actually count triangles\n Iterator<Pair<Integer, ArrayList<Integer>>> iterator = pairs.iterator();\n while (iterator.hasNext()) {\n Pair<Integer, ArrayList<Integer>> pair = iterator.next();\n int v = pair.getFirst();\n for (int u : pair.getSecond()) {\n if (etas.get(u) > etas.get(v)) {\n triangleCount += Utils.arrayIntersection(A[u], A[v]);\n A[u].add(etas.get(v));\n }\n }\n }\n return new Long(triangleCount);\n }", "java.util.List<com.expedia.www.packagefinder.database.exppackage.ExpPackageProtos.transitFlight> \n getTransitFlightsList();", "public PathIterator getPathIterator(AffineTransform at, double flatness) {\n return getPathIterator(at);\n }", "public String canWalkExactly(int N, int[] from, int[] to) {\n isVisited = new boolean[N];\n steps = new int[N];\n minSteps = new int[N];\n path = new Stack<>();\n adj = new ArrayList<>(N);\n allSCC = new ArrayList<>();\n for (int i = 0; i < N; i++)\n adj.add(new ArrayList<>());\n\n // populate adj based on from, to\n for (int i = 0; i < from.length; i++) {\n adj.get(from[i]).add(to[i]);\n }\n\n totalSteps = 0;\n Arrays.fill(isVisited, false);\n Arrays.fill(steps, UNVISITED);\n Arrays.fill(minSteps, UNVISITED);\n tarjanSCC(0);\n\n // check if 0 and 1 are in the same scc\n System.out.println(\"CHECKING\");\n boolean found = false;\n for (List<Integer> scc : allSCC) {\n if (scc.contains(0) && scc.contains(1)) {\n found = true;\n break;\n }\n }\n if (!found) return NO;\n// if(minSteps[0] != minSteps[1]) return NO;\n System.out.println(\"0 and 1 in the same scc\");\n /*\n Check if gcd of the length of all simple cycles is 1\n by checking if it is an aperiodic graph\n https://en.wikipedia.org/wiki/Aperiodic_graph\n */\n depths = new int[N];\n Arrays.fill(depths, UNVISITED);\n depths[0] = 0;\n findDepths(0);\n\n int res = -1;\n for (int i = 0; i < from.length; i++) {\n int s = from[i];\n int t = to[i];\n if (depths[s] == UNVISITED || depths[t] == UNVISITED) continue;\n int len = depths[t] - depths[s] - 1;\n if (len == 0) continue;\n if (len < 0) len *= -1;\n if (res == -1) res = len;\n else res = gcd(res, len);\n }\n\n return res == 1 ? YES : NO;\n }", "void makeService(int loc_temp,int des_temp)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint last_direction = 0;\r\n\t\t\tint[] shortest_path = new int[6400];\r\n\t\t\tint j_current = loc_temp % 80;\r\n\t\t\tint i_current = loc_temp / 80;\r\n\t\t\tBFS.setShortest(des_temp,shortest_path,BFS.adj_const);\r\n\t\t\tint temp = shortest_path[loc_temp];\r\n\t\t\twhile(temp != -1)\r\n\t\t\t{\r\n\t\t\t\tint length_min = BFS.getShortest(temp, des_temp,BFS.adj_const);\r\n\t\t\t\tint direction = -1;\r\n\t\t\t\tint flow_min = Main.MAX_INT;\r\n\t\t\t\tif((i_current-1)>=0 && BFS.adj_const[(i_current-1)*80+j_current][i_current*80+j_current]==1 && Flow.flows[i_current-1][j_current][1]<flow_min)\r\n\t\t\t\t{\r\n\t\t\t\t\tint length_temp = BFS.getShortest((i_current-1)*80+j_current, des_temp, BFS.adj_const);\r\n\t\t\t\t\tif(length_temp <= length_min)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdirection = 0;//up\r\n\t\t\t\t\t\tflow_min = Flow.flows[i_current-1][j_current][1];\r\n\t\t\t\t\t\tlength_min = length_temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif((i_current+1)<80 && BFS.adj_const[(i_current+1)*80+j_current][i_current*80+j_current]==1 && Flow.flows[i_current][j_current][1]<flow_min)\r\n\t\t\t\t{\r\n\t\t\t\t\tint length_temp = BFS.getShortest((i_current+1)*80+j_current, des_temp, BFS.adj_const);\r\n\t\t\t\t\tif(length_temp <= length_min)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdirection = 1;//down\r\n\t\t\t\t\t\tflow_min = Flow.flows[i_current][j_current][1];\r\n\t\t\t\t\t\tlength_min = length_temp;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\tif((j_current-1)>=0 && BFS.adj_const[i_current*80+j_current-1][i_current*80+j_current]==1 && Flow.flows[i_current][j_current-1][0]<flow_min)\r\n\t\t\t\t{\t\r\n\t\t\t\t\tint length_temp = BFS.getShortest(i_current*80+j_current-1, des_temp, BFS.adj_const);\r\n\t\t\t\t\tif(length_temp <= length_min)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdirection = 2;//left\r\n\t\t\t\t\t\tflow_min = Flow.flows[i_current][j_current-1][0];\r\n\t\t\t\t\t\tlength_min = length_temp;\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\tif((j_current+1)<80 && BFS.adj_const[i_current*80+j_current+1][i_current*80+j_current]==1 && Flow.flows[i_current][j_current][0]<flow_min)\r\n\t\t\t\t{\r\n\t\t\t\t\tint length_temp = BFS.getShortest(i_current*80+j_current+1, des_temp, BFS.adj_const);\r\n\t\t\t\t\tif(length_temp <= length_min)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdirection = 3;//right\r\n\t\t\t\t\t\tflow_min = Flow.flows[i_current][j_current][0];\r\n\t\t\t\t\t\tlength_min = length_temp;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\tLight light = Traffic.findLight(i_current,j_current);\r\n\t\t\t\tif(light != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tboolean first = true;\r\n\t\t\t\t\twhile(!leaveLight(light,last_direction,direction))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmeet_light = true;\r\n\t\t\t\t\t\tif(first)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.println(\"Taxi-\" + id + loc + \": Waiting at a traffic light\");\r\n\t\t\t\t\t\t\tfirst = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmeet_light = false;\r\n\t\t\t\t\tSystem.out.println(\"Taxi-\" + id + loc + \": Going through a traffic light\");\r\n\t\t\t\t}\r\n\t\t\t\tswitch(direction)\r\n\t\t\t\t{\r\n\t\t\t\tcase 0 ://up\r\n\t\t\t\t\tif(BFS.adj_matrix[(i_current-1)*80+j_current][i_current*80+j_current] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[i_current-1][j_current][1]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti_current -= 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1 ://down\r\n\t\t\t\t\tif(BFS.adj_matrix[(i_current+1)*80+j_current][i_current*80+j_current] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[i_current][j_current][1]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti_current += 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2 ://left\r\n\t\t\t\t\tif(BFS.adj_matrix[i_current*80+j_current][i_current*80+j_current-1] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[i_current][j_current-1][0]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tj_current -= 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3 ://right\r\n\t\t\t\t\tif(BFS.adj_matrix[i_current*80+j_current][i_current*80+j_current+1] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[i_current][j_current][0]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tj_current += 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tThread.sleep(100);\r\n\t\t\t\tlast_direction = direction;\r\n\t\t\t\tloc = new Coordinate(i_current,j_current);\r\n\t\t\t\tSystem.out.println(\"Taxi-\" + id + loc);\r\n\t\t\t\ttemp = shortest_path[i_current*80+j_current];\r\n\t\t\t}\t\t\r\n\t\t\tSystem.out.println(\"Passenger\" + passenger.loc + passenger.des + \": Taxi-\" + id + \" arrives at \" + des);\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Sorry to catch Exception!\");;\r\n\t\t}\r\n\t}", "public Path getShortestPath() {\n\t\tNodeRecord startRecord = new NodeRecord(start, null, 0.0f, (float) heuristic.estimate(start), Category.OPEN);\n\n\t\t// Initialize the open list\n\t\tPathFindingList open = new PathFindingList();\n\t\topen.addRecordByEstimatedTotalCost(startRecord);\n\t\trecords.set(Integer.parseInt(startRecord.node.id), startRecord);\n\t\tNodeRecord current = null;\n\t\t\n\t\t// Iterate through processing each node\n\t\twhile (!open.isEmpty()) {\n\t\t\t// Find smallest element in the open list using estimatedTotalCost\n\t\t\tcurrent = open.getSmallestNodeRecordByEstimatedTotalCost();\n\n\t\t\t// If its the goal node, terminate\n\t\t\tif (current.node.equals(end)) break;\n\n\t\t\t// Otherwise get its outgoing connections\n\t\t\tArrayList<DefaultWeightedEdge> connections = g.getConnections(current.node);\n\t\t\t\n\t\t\t// Loop through each connection\n\t\t\tfor (DefaultWeightedEdge connection : connections) {\n\t\t\t\t// Get the cost and other information for end node\n\t\t\t Vertex endNode = g.graph.getEdgeTarget(connection);\n\t\t\t int endNodeRecordIndex = Integer.parseInt(endNode.id);\n NodeRecord endNodeRecord = records.get(endNodeRecordIndex); // this is potentially null but we handle it\n\t\t\t\tdouble newEndNodeCost = current.costSoFar + g.graph.getEdgeWeight(connection);\n\t\t\t\tdouble endNodeHeuristic = 0;\n\t\t\t\t\n\t\t\t\t// if node is closed we may have to skip, or remove it from closed list\t\n\t\t\t\tif( endNodeRecord != null && endNodeRecord.category == Category.CLOSED ){ \n\t\t\t\t\t// Find the record corresponding to the endNode\n\t\t\t\t\tendNodeRecord = records.get(endNodeRecordIndex);\n\n\t\t\t\t\t// If we didn't find a shorter route, skip\n\t\t\t\t\tif (endNodeRecord.costSoFar <= newEndNodeCost) continue;\n\n\t\t\t\t\t// Otherwise remove it from closed list\n\t\t\t\t\trecords.get(endNodeRecordIndex).category = Category.OPEN;\n\n\t\t\t\t\t// Use node's old cost values to calculate its heuristic to save computation\n\t\t\t\t\tendNodeHeuristic = endNodeRecord.estimatedTotalCost - endNodeRecord.costSoFar;\n\n\t\t\t\t// Skip if node is open and we've not found a better route\n\t\t\t\t} else if( endNodeRecord != null && endNodeRecord.category == Category.OPEN ){ \n\t\t\t\t\t// Here we find the record in the open list corresponding to the endNode\n\t\t\t\t\tendNodeRecord = records.get(endNodeRecordIndex);\n\n\t\t\t\t\t// If our route isn't better, skip\n\t\t\t\t\tif (endNodeRecord.costSoFar <= newEndNodeCost) continue;\n\n\t\t\t\t\t// Use the node's old cost values to calculate its heuristic to save computation\n\t\t\t\t\tendNodeHeuristic = endNodeRecord.estimatedTotalCost - endNodeRecord.costSoFar;\n\n\t\t\t\t// Otherwise we know we've got an unvisited node, so make a new record\n\t\t\t\t} else { // if endNodeRecord.category == Category.UNVISITED\n\t\t\t\t endNodeRecord = new NodeRecord();\n\t\t\t\t\tendNodeRecord.node = endNode;\n\t\t\t\t\trecords.set(endNodeRecordIndex, endNodeRecord);\n\n\t\t\t\t\t// Need to calculate heuristic since this is new\n\t\t\t\t\tendNodeHeuristic = heuristic.estimate(endNode);\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\t// We're here if we need to update the node\n\t\t\t\t// update the cost, estimate, and connection\n\t\t\t\tendNodeRecord.costSoFar = newEndNodeCost;\n\t\t\t\tendNodeRecord.edge = connection;\n\t\t\t\tendNodeRecord.estimatedTotalCost = newEndNodeCost + endNodeHeuristic;\n\n\t\t\t\t// Add it to the open list\n\t\t\t\tif ( endNodeRecord.category != Category.OPEN ) {\n\t\t\t\t\topen.addRecordByEstimatedTotalCost(endNodeRecord);\n\t\t\t\t\tendNodeRecord.category = Category.OPEN;\n\t\t\t\t\trecords.set(endNodeRecordIndex, endNodeRecord);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\t// We’ve finished looking at the connections for\n\t\t\t// the current node, so add it to the closed list\n\t\t\t// and remove it from the open list\n\t\t\topen.removeRecord(current);\n\t\t\tcurrent.category = Category.CLOSED;\n\t\t\trecords.set(Integer.parseInt(current.node.id), current);\n\t\t}\n\t\t\n\t\t// We’re here if we’ve either found the goal, or\n\t\t// if we’ve no more nodes to search, find which.\n\t\tif (!current.node.equals(end)) {\n\t\t\t// Ran out of nodes without finding the goal, no solution\n\t\t\treturn null;\n\t\t} else {\n\t\t // Compile the list of connections in the path\n\t\t\tArrayList<DefaultWeightedEdge> path = new ArrayList<>();\n\n\t\t\twhile (!current.node.equals(start)) {\n\t\t\t\tpath.add(current.edge);\n\t\t\t\t// Set current (NodeRecord) to is source.\n\t\t\t\tcurrent = records.get( Integer.parseInt(g.graph.getEdgeSource(current.edge).id) );\n\t\t\t}\n\n\t\t\t// Reverse the path, and return it\n\t\t\tCollections.reverse(path);\n\t\t\treturn new Path(g, path);\n\t\t}\n\n\t}", "@SuppressWarnings(\"unchecked\")\n private RaptorData pruneDataForServiceDays(Graph graph, ArrayList<ServiceDay> serviceDays) {\n \n if (serviceDays.equals(cachedServiceDays))\n return cachedRaptorData;\n RaptorData data = graph.getService(RaptorDataService.class).getData();\n RaptorData pruned = new RaptorData();\n pruned.raptorStopsForStopId = data.raptorStopsForStopId;\n pruned.stops = data.stops;\n pruned.routes = new ArrayList<RaptorRoute>();\n pruned.routesForStop = new List[pruned.stops.length];\n \n for (RaptorRoute route : data.routes) {\n ArrayList<Integer> keep = new ArrayList<Integer>();\n \n for (int i = 0; i < route.boards[0].length; ++i) {\n Edge board = route.boards[0][i];\n int serviceId;\n if (board instanceof TransitBoardAlight) {\n serviceId = ((TransitBoardAlight) board).getPattern().getServiceId();\n } else {\n log.debug(\"Unexpected nonboard among boards\");\n continue;\n }\n for (ServiceDay day : serviceDays) {\n if (day.serviceIdRunning(serviceId)) {\n keep.add(i);\n break;\n }\n }\n }\n if (keep.isEmpty())\n continue;\n int nPatterns = keep.size();\n RaptorRoute prunedRoute = new RaptorRoute(route.getNStops(), nPatterns);\n for (int stop = 0; stop < route.getNStops() - 1; ++stop) {\n for (int pattern = 0; pattern < nPatterns; ++pattern) {\n prunedRoute.boards[stop][pattern] = route.boards[stop][keep.get(pattern)];\n }\n }\n pruned.routes.add(route);\n for (RaptorStop stop : route.stops) {\n List<RaptorRoute> routes = pruned.routesForStop[stop.index];\n if (routes == null) {\n routes = new ArrayList<RaptorRoute>();\n pruned.routesForStop[stop.index] = routes;\n }\n routes.add(route);\n }\n }\n for (RaptorStop stop : data.stops) {\n if (pruned.routesForStop[stop.index] == null) {\n pruned.routesForStop[stop.index] = Collections.emptyList();\n }\n }\n cachedServiceDays = serviceDays;\n cachedRaptorData = pruned;\n return pruned;\n }", "@Override\n public void fill(ArrayList<Package> warehousePackages) {\n int diffCounter = 0;\n int checkOnce = -1;\n boolean checkTwice = false;\n boolean sameI = false;\n int overWeight = 0;\n while (!isFull() && (warehousePackages.size() - overWeight) > 0) {\n for (int i = 0; i < warehousePackages.size(); i++) {\n sameI = false;\n int destination = warehousePackages.get(i).getDestination().getZipCode();\n int difference = Math.abs(destination - this.getZipDest());\n if (difference <= diffCounter + 10 && difference >= diffCounter) {\n if (!(warehousePackages.get(i).getWeight() +\n getCurrentWeight() > getMaxWeight())) {\n addPackage(warehousePackages.get(i));\n setCurrentWeight(getCurrentWeight() + warehousePackages.get(i).getWeight());\n warehousePackages.remove(i);\n sameI = true;\n break;\n } else {\n overWeight += 1;\n }\n }\n }\n if (!sameI) {\n diffCounter += 10;\n }\n }\n\n\n }", "public static Set<List<Vertex>> depthFirstSearch(Graph graph) {\n Set<List<Vertex>> arrayListHashSet=new HashSet<>();\n\n for(int i=0;i<graph.getVertices().size();i++){\n ArrayList<Vertex> visitedArrayList=new ArrayList<>();\n for(int j=0;j<graph.getVertices().size();j++){\n if(visitedArrayList.size()==0){\n if(!visitedArrayList.contains(graph.getVertices().get(i))){\n depthFirstSearch(graph.getVertices().get(i),visitedArrayList,graph);\n }\n }\n else{\n if(!visitedArrayList.contains(graph.getVertices().get(j))){\n depthFirstSearch(graph.getVertices().get(j),visitedArrayList,graph);\n }\n }\n }\n arrayListHashSet.add(visitedArrayList);\n }\n return arrayListHashSet; // this should be changed\n }", "private int[][] make_minimal_graph() {\n\n int[][] subs = new int[_subtypes.length][];\n for( int i=0; i<subs.length; i++ )\n subs[i] = _subtypes[i].clone();\n \n // For all types\n for( int i=0; i<subs.length; i++ ) {\n int[] subis = subs[i];\n // For all 'i' subtypes\n for( int j=0; j<subis.length && subis[j] != -1; j++ ) {\n int[] subjs = subs[subis[j]];\n // Pull out of subis all things found in subjs. We have a subtype isa\n // path from i->j by design of _subtypes, and the j->k list in subjs.\n // Remove any i->k as being redundant.\n int ix = j+1, ixx = j+1; // Index to read, index to keep non-dups\n int jx = 0; // Index to read the k's\n while( ix<subis.length && jx<subjs.length ) {\n int six = subis[ix];\n int sjx = subjs[jx];\n assert sjx != -1;\n if( six==-1 ) break; // Hit end-of-array sentinel\n if( six==sjx ) { ix++; jx++; } // i->j and j->sjx and i->sjx, skip both forward\n else if( six < sjx ) subis[ixx++] = subis[ix++]; // Keep and advance\n else jx++; // Advance\n }\n while( ixx < ix ) subis[ixx++] = -1; // Sentinel remaining unused elements\n }\n int ix = Util.find(subs[i],-1);\n if( ix != -1 ) subs[i] = Arrays.copyOfRange(subs[i],0,ix); // Compress extra elements\n }\n \n return subs;\n }", "void makeService(int loc_temp,int des_temp,ArrayList<Coordinate> path)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint last_direction = 0;\r\n\t\t\tint[] shortest_path = new int[6400];\r\n\t\t\tint j_current = loc_temp % 80;\r\n\t\t\tint i_current = loc_temp / 80;\r\n\t\t\tBFS.setShortest(des_temp,shortest_path,BFS.adj_const);\r\n\t\t\tint temp = shortest_path[loc_temp];\r\n\t\t\twhile(temp != -1)\r\n\t\t\t{\r\n\t\t\t\tint length_min = BFS.getShortest(temp, des_temp,BFS.adj_const);\r\n\t\t\t\tint direction = -1;\r\n\t\t\t\tint flow_min = Main.MAX_INT;\r\n\t\t\t\tif((i_current-1)>=0 && BFS.adj_const[(i_current-1)*80+j_current][i_current*80+j_current]==1 && Flow.flows[i_current-1][j_current][1]<flow_min)\r\n\t\t\t\t{\r\n\t\t\t\t\tint length_temp = BFS.getShortest((i_current-1)*80+j_current, des_temp, BFS.adj_const);\r\n\t\t\t\t\tif(length_temp <= length_min)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdirection = 0;//up\r\n\t\t\t\t\t\tflow_min = Flow.flows[i_current-1][j_current][1];\r\n\t\t\t\t\t\tlength_min = length_temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif((i_current+1)<80 && BFS.adj_const[(i_current+1)*80+j_current][i_current*80+j_current]==1 && Flow.flows[i_current][j_current][1]<flow_min)\r\n\t\t\t\t{\r\n\t\t\t\t\tint length_temp = BFS.getShortest((i_current+1)*80+j_current, des_temp, BFS.adj_const);\r\n\t\t\t\t\tif(length_temp <= length_min)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdirection = 1;//down\r\n\t\t\t\t\t\tflow_min = Flow.flows[i_current][j_current][1];\r\n\t\t\t\t\t\tlength_min = length_temp;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\tif((j_current-1)>=0 && BFS.adj_const[i_current*80+j_current-1][i_current*80+j_current]==1 && Flow.flows[i_current][j_current-1][0]<flow_min)\r\n\t\t\t\t{\t\r\n\t\t\t\t\tint length_temp = BFS.getShortest(i_current*80+j_current-1, des_temp, BFS.adj_const);\r\n\t\t\t\t\tif(length_temp <= length_min)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdirection = 2;//left\r\n\t\t\t\t\t\tflow_min = Flow.flows[i_current][j_current-1][0];\r\n\t\t\t\t\t\tlength_min = length_temp;\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\tif((j_current+1)<80 && BFS.adj_const[i_current*80+j_current+1][i_current*80+j_current]==1 && Flow.flows[i_current][j_current][0]<flow_min)\r\n\t\t\t\t{\r\n\t\t\t\t\tint length_temp = BFS.getShortest(i_current*80+j_current+1, des_temp, BFS.adj_const);\r\n\t\t\t\t\tif(length_temp <= length_min)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdirection = 3;//right\r\n\t\t\t\t\t\tflow_min = Flow.flows[i_current][j_current][0];\r\n\t\t\t\t\t\tlength_min = length_temp;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\tLight light = Traffic.findLight(i_current,j_current);\r\n\t\t\t\tif(light != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tboolean first = true;\r\n\t\t\t\t\twhile(!leaveLight(light,last_direction,direction))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmeet_light = true;\r\n\t\t\t\t\t\tif(first)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.println(\"Taxi-\" + id + loc + \": Waiting at a traffic light\");\r\n\t\t\t\t\t\t\tfirst = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmeet_light = false;\r\n\t\t\t\t\tSystem.out.println(\"Taxi-\" + id + loc + \": Going through a traffic light\");\r\n\t\t\t\t}\r\n\t\t\t\tswitch(direction)\r\n\t\t\t\t{\r\n\t\t\t\tcase 0 ://up\r\n\t\t\t\t\tif(BFS.adj_matrix[(i_current-1)*80+j_current][i_current*80+j_current] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[i_current-1][j_current][1]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti_current -= 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1 ://down\r\n\t\t\t\t\tif(BFS.adj_matrix[(i_current+1)*80+j_current][i_current*80+j_current] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[i_current][j_current][1]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti_current += 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2 ://left\r\n\t\t\t\t\tif(BFS.adj_matrix[i_current*80+j_current][i_current*80+j_current-1] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[i_current][j_current-1][0]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tj_current -= 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3 ://right\r\n\t\t\t\t\tif(BFS.adj_matrix[i_current*80+j_current][i_current*80+j_current+1] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[i_current][j_current][0]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tj_current += 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tThread.sleep(100);\r\n\t\t\t\tlast_direction = direction;\r\n\t\t\t\tloc = new Coordinate(i_current,j_current);\r\n\t\t\t\tpath.add(loc);\r\n\t\t\t\tSystem.out.println(\"Taxi-\" + id + loc);\r\n\t\t\t\ttemp = shortest_path[i_current*80+j_current];\r\n\t\t\t}\t\t\r\n\t\t\tSystem.out.println(\"Passenger\" + passenger.loc + passenger.des + \": Taxi-\" + id + \" arrives at \" + des);\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Sorry to catch Exception!\");;\r\n\t\t}\r\n\t}", "private void dfs(Map<Integer, List<Node>> map, int start, int end, int k, int stops, int price, boolean[] visited) {\n // base-case\n if (start == end) {\n min = Math.min(min, price);\n return;\n }\n if (stops >= k) {\n return;\n }\n if (visited[start]) {\n return;\n }\n // recursive rule\n visited[start] = true;\n List<Node> nodes = map.get(start);\n if (nodes != null) {\n for (Node node : nodes) {\n dfs(map, node.next, end, k, stops + 1, price + node.price, visited);\n }\n }\n // backing tracking\n visited[start] = false;\n }", "private void calculateShortestDistances (GraphStructure graph,int startVertex,int destinationVertex) {\r\n\t\t//traverseRecursively(graph, startVertex);\r\n\t\tif(pathList.contains(destinationVertex)) {\r\n\t\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\t\tdistanceArray[startVertex]=0;\r\n\t\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\t\tList<Edge> list;\r\n\t\t\tlist = graph.getAdjacencyList()[startVertex];\r\n\t\t\tif(startVertex==destinationVertex) {\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\tif(! isVisited[value.getVertex()]) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[startVertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t\tshortestPathList.add(value.getVertex());\r\n\t\t\t\t\t\t\tcalculateShortestDistances(graph,value.getVertex(), distanceValueOfDestinationVertex);\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t} \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*for(Integer value : spanningTreeSet) {\r\n\t\t\t\tSystem.out.print(value+\" \");\r\n\t\t\t}*/\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"No route is present between given vertices !\");\r\n\t\t}\r\n\t}", "@Test\n public void cyclicalGraphs1Test() throws Exception {\n // NOTE: we can't use the parser to create a circular graph because\n // vector clocks are partially ordered and do not admit cycles. So we\n // have to create circular graphs manually.\n ChainsTraceGraph g1 = new ChainsTraceGraph();\n List<EventNode> g1Nodes = addNodesToGraph(g1, new String[] { \"a\", \"a\",\n \"a\" });\n // Create a loop in g1, with 3 nodes\n g1Nodes.get(0).addTransition(g1Nodes.get(1), Event.defTimeRelationStr);\n g1Nodes.get(1).addTransition(g1Nodes.get(2), Event.defTimeRelationStr);\n g1Nodes.get(2).addTransition(g1Nodes.get(0), Event.defTimeRelationStr);\n exportTestGraph(g1, 0);\n\n ChainsTraceGraph g2 = new ChainsTraceGraph();\n List<EventNode> g2Nodes = addNodesToGraph(g2, new String[] { \"a\", \"a\" });\n // Create a loop in g2, with 2 nodes\n g2Nodes.get(0).addTransition(g2Nodes.get(1), Event.defTimeRelationStr);\n g2Nodes.get(1).addTransition(g2Nodes.get(0), Event.defTimeRelationStr);\n exportTestGraph(g2, 1);\n\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 1);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 2);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 3);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 4);\n\n ChainsTraceGraph g3 = new ChainsTraceGraph();\n List<EventNode> g3Nodes = addNodesToGraph(g2, new String[] { \"a\" });\n // Create a loop in g3, from a to itself\n g3Nodes.get(0).addTransition(g3Nodes.get(0), Event.defTimeRelationStr);\n exportTestGraph(g3, 2);\n\n testKEqual(g3Nodes.get(0), g2Nodes.get(0), 1);\n testKEqual(g3Nodes.get(0), g2Nodes.get(0), 2);\n testKEqual(g3Nodes.get(0), g2Nodes.get(0), 3);\n\n ChainsTraceGraph g4 = new ChainsTraceGraph();\n List<EventNode> g4Nodes = addNodesToGraph(g2, new String[] { \"a\" });\n exportTestGraph(g4, 2);\n\n testKEqual(g4Nodes.get(0), g2Nodes.get(0), 1);\n testNotKEqual(g4Nodes.get(0), g2Nodes.get(0), 2);\n testNotKEqual(g4Nodes.get(0), g2Nodes.get(0), 3);\n testNotKEqual(g4Nodes.get(0), g2Nodes.get(0), 4);\n }", "private Vector<Vector<BusStopInfo>> findRek (BusStopInterface from, BusStopInterface to, Vector <BusStopInfo> toInfo, Vector<BusStopInfo> visited, int swaps, int transfers )\r\n {\r\n Vector<Vector<BusStopInfo>> sciezka = new Vector<Vector<BusStopInfo>>();\r\n \r\n if(from.getName()==to.getName())\r\n {\r\n sciezka.add(toInfo);\r\n return sciezka;\r\n }\r\n\r\n for(BusStopInfo vis: visited)\r\n {\r\n if(vis.awtobus.busLine.getBusStop(vis.pozycja).getName()==from.getName())\r\n return sciezka;\r\n }\r\n\r\n Vector <BusStopInfo> fromInfo = findStopInfo(from);\r\n\r\n fromInfo = infoFilter(fromInfo, toInfo);\r\n\r\n for(BusStopInfo info: fromInfo)\r\n {\r\n int swapsNow = swaps;\r\n if(visited.size()>0 && info.awtobus.bus.getBusNumber()!=visited.lastElement().awtobus.bus.getBusNumber())\r\n {\r\n swapsNow++;\r\n }\r\n\r\n if(swapsNow <= transfers)\r\n {\r\n int nextPosition = info.pozycja +1; //ide do przodu linii\r\n int prevPosition = info.pozycja -1; //ide do tyłu linii\r\n\r\n Vector<BusStopInfo> temp = new Vector<BusStopInfo>(visited);\r\n temp.add(info);\r\n Vector<Vector<BusStopInfo>> result ;\r\n if(nextPosition<info.awtobus.busLine.getNumberOfBusStops())\r\n {\r\n BusStopInterface nextStop = info.awtobus.busLine.getBusStop(nextPosition);\r\n result = findRek(nextStop, to, toInfo, temp, swapsNow, transfers);\r\n for(Vector<BusStopInfo> res: result)\r\n {\r\n res.add(0, info);\r\n sciezka.add(res);\r\n }\r\n }\r\n if(prevPosition >= 0)\r\n {\r\n BusStopInterface prevStop = info.awtobus.busLine.getBusStop(prevPosition);\r\n result = findRek(prevStop, to, toInfo, temp, swapsNow, transfers);\r\n for(Vector<BusStopInfo> res: result)\r\n {\r\n res.add(0, info);\r\n sciezka.add(res);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return sciezka;\r\n }", "void leastCostPaths() {\t\n\t\tfor( int k = 0; k < N; k++ )\n\t\t\tfor( int i = 0; i < N; i++ )\n\t\t\t\tif( defined[i][k] )\n\t\t\t\t\tfor( int j = 0; j < N; j++ )\n\t\t\t\t\t\tif( defined[k][j]\n\t\t\t\t\t\t\t\t&& (!defined[i][j] || c[i][j] > c[i][k]+c[k][j]) ) {\t\n\t\t\t\t\t\t\tpath[i][j] = path[i][k];\n\t\t\t\t\t\t\tc[i][j] = c[i][k]+c[k][j];\n\t\t\t\t\t\t\tdefined[i][j] = true;\n\t\t\t\t\t\t\tif( i == j && c[i][j] < 0 ) return; // stop on negative cycle\n\t\t\t\t\t\t}\n\t}", "public void findFrequency(int size) {\r\n\t\tfor(i=0;i<size;i++) {\r\n\t\t\tfor (Entry en : dataEntries) {\t\t\r\n\t\t\t\ttemperature.add(en.getTemperature());\r\n\t\t\t\taches.add(en.getAches());\r\n\t\t\t\tcough.add(en.getCough());\r\n\t\t\t\tsoreThroat.add(en.getSoreThroat());\r\n\t\t\t\tdangerZone.add(en.getDangerZone());\r\n\t\t\t\thasCOVID19.add(en.getHasCOVID19());\r\n\t\t\t\t\r\n\t\t\t\tif (en.getHasCOVID19().equals(\"yes\")) {\r\n\t\t\t\t\ttemperatureIfCOVID19.add(en.getTemperature());\r\n\t\t\t\t\tachesIfCOVID19.add(en.getAches());\r\n\t\t\t\t\tcoughIfCOVID19.add(en.getCough());\r\n\t\t\t\t\tsoreThroatIfCOVID19.add(en.getSoreThroat());\r\n\t\t\t\t\tdangerZoneIfCOVID19.add(en.getDangerZone());\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@SuppressWarnings({\"rawtypes\", \"unchecked\", \"SuspiciousMethodCalls\"})\n private List getDepthFirstTraversal_iterative_usingStack_BigO_VPlusE() throws Exception {\n Map<Object, Boolean> visited = new LinkedHashMap<>();\n Stack watchStack = new Stack();\n\n V root = data.keySet().stream().findFirst().orElseThrow(() -> new Exception(\"Graph is Empty\"));\n watchStack.push(root);\n visited.put(root, true);\n\n while(!watchStack.isEmpty()) {\n Object currentVertex = watchStack.top();\n\n BinarySearchTree<E> edgeTree = data.getOrDefault(currentVertex, new BinarySearchTree<>());\n List<E> edges = edgeTree.getTreeByInOrder_depthFirst();\n\n //Remove an item from the stack when there are no edges or all the edges are visited for that vertex\n if(edgeTree.isEmpty() || visited.keySet().containsAll(edges)) {\n watchStack.pop();\n } else {\n for(E edge : edges) {\n if(!visited.containsKey(edge)) {\n watchStack.push(edge);\n visited.put(edge, true);\n break;\n }\n }\n }\n }\n return new ArrayList<>(visited.keySet());\n }", "private List<List<Integer>> dfs(int[][] graph, int start, Map<Integer, List<List<Integer>>> memo) {\n if (start == graph.length - 1) {\n return Collections.singletonList(Collections.singletonList(start));\n } else {\n List<List<Integer>> cur = new ArrayList<>();\n for (int dep : graph[start]) {\n List<List<Integer>> next = dfs(graph, dep, memo);\n for (List<Integer> path : next) {\n List<Integer> temp = new ArrayList<>();\n temp.add(start);\n temp.addAll(path);\n cur.add(temp);\n }\n }\n return memo.put(start, cur);\n }\n }", "private List<Set<GraphChange>> findChanges(Map<Collection<Node>, List<PossibleDConnectingPath>> paths) {\n List<Set<GraphChange>> pagChanges = new ArrayList<>();\n\n Set<Map.Entry<Collection<Node>, List<PossibleDConnectingPath>>> entries = paths.entrySet();\n /* Loop through each entry, ie each conditioned set of variables. */\n for (Map.Entry<Collection<Node>, List<PossibleDConnectingPath>> entry : entries) {\n Collection<Node> conditions = entry.getKey();\n List<PossibleDConnectingPath> dConnecting = entry.getValue();\n\n /* loop through each path */\n for (PossibleDConnectingPath possible : dConnecting) {\n List<Node> possPath = possible.getPath();\n /* Created with 2*# of undirectedPaths as appoximation. might have to increase size once */\n Set<GraphChange> pathChanges = new HashSet<>(2 * possPath.size());\n\n /* find those conditions which are not along the path (used in colider) */\n List<Node> outsidePath = new ArrayList<>(conditions.size());\n for (Node condition : conditions) {\n if (!possPath.contains(condition))\n outsidePath.add(condition);\n }\n\n /* Walk through path, node by node */\n for (int i = 0; i < possPath.size() - 1; i++) {\n Node current = possPath.get(i);\n Node next = possPath.get(i + 1);\n GraphChange gc;\n\n /* for each pair of nodes, add the operation to remove their edge */\n gc = new GraphChange();\n gc.addRemove(possible.getPag().getEdge(current, next));\n pathChanges.add(gc);\n\n /* for each triple centered on a node which is an element of the conditioning\n * set, add the operation to orient as a nonColider around that node */\n if (conditions.contains(current) && i > 0) {\n gc = new GraphChange();\n Triple nonColider = new Triple(possPath.get(i - 1), current, next);\n gc.addNonCollider(nonColider);\n pathChanges.add(gc);\n }\n\n /* for each node on the path not in the conditioning set, make a colider. It\n * is necessary though to ensure that there are no undirectedPaths implying that a\n * conditioned variable (even outside the path) is a decendant of a colider */\n if ((!conditions.contains(current)) && i > 0) {\n Triple colider = new Triple(possPath.get(i - 1), current, next);\n\n if (possible.getPag().isUnderlineTriple(possPath.get(i - 1), current, next))\n continue;\n\n Edge edge1 = possible.getPag().getEdge(colider.getX(), colider.getY());\n Edge edge2 = possible.getPag().getEdge(colider.getZ(), colider.getY());\n\n if (edge1.getNode1().equals(colider.getY())) {\n if (edge1.getEndpoint1().equals(Endpoint.TAIL)) {\n continue;\n }\n } else if (edge1.getNode2().equals(colider.getY())) {\n if (edge1.getEndpoint2().equals(Endpoint.TAIL)) {\n continue;\n }\n }\n\n if (edge2.getNode1().equals(colider.getY())) {\n if (edge2.getEndpoint1().equals(Endpoint.TAIL)) {\n continue;\n }\n } else if (edge2.getNode2().equals(colider.getY())) {\n if (edge2.getEndpoint2().equals(Endpoint.TAIL)) {\n continue;\n }\n }\n\n /* Simple case, no conditions outside the path, so just add colider */\n if (outsidePath.size() == 0) {\n gc = new GraphChange();\n gc.addCollider(colider);\n pathChanges.add(gc);\n continue;\n }\n\n /* ensure nondecendency in possible path between getModel and each conditioned\n * variable outside the path */\n for (Node outside : outsidePath) {\n\n /* list of possible decendant undirectedPaths */\n\n List<PossibleDConnectingPath> decendantPaths = new ArrayList<>();\n decendantPaths\n = PossibleDConnectingPath.findDConnectingPaths\n (possible.getPag(), current, outside, new ArrayList<Node>());\n\n if (decendantPaths.isEmpty()) {\n gc = new GraphChange();\n gc.addCollider(colider);\n pathChanges.add(gc);\n continue;\n }\n\n /* loop over each possible path which might indicate decendency */\n for (PossibleDConnectingPath decendantPDCPath : decendantPaths) {\n List<Node> decendantPath = decendantPDCPath.getPath();\n\n /* walk down path checking orientation (path may already\n * imply non-decendency) and creating changes if need be*/\n boolean impliesDecendant = true;\n Set<GraphChange> colideChanges = new HashSet<>();\n for (int j = 0; j < decendantPath.size() - 1; j++) {\n Node from = decendantPath.get(j);\n // chaneges from +1\n Node to = decendantPath.get(j + 1);\n Edge currentEdge = possible.getPag().getEdge(from, to);\n\n if (currentEdge.getEndpoint1().equals(Endpoint.ARROW)) {\n impliesDecendant = false;\n break;\n }\n\n gc = new GraphChange();\n gc.addCollider(colider);\n gc.addRemove(currentEdge);\n colideChanges.add(gc);\n\n gc = new GraphChange();\n gc.addCollider(colider);\n gc.addOrient(to, from);\n colideChanges.add(gc);\n }\n if (impliesDecendant)\n pathChanges.addAll(colideChanges);\n }\n }\n }\n }\n\n pagChanges.add(pathChanges);\n }\n }\n return pagChanges;\n }", "@Test\n void shortestPath() {\n directed_weighted_graph g0 = new DW_GraphDS();\n dw_graph_algorithms ag0 = new DWGraph_Algo();\n node_data n0 = new NodeData(0);\n node_data n1 = new NodeData(1);\n node_data n2 = new NodeData(2);\n node_data n3 = new NodeData(3);\n g0.addNode(n1);\n g0.addNode(n2);\n g0.addNode(n3);\n g0.connect(1, 2, 5);\n g0.connect(2, 3, 3);\n g0.connect(1, 3, 15);\n g0.connect(3, 2, 1);\n ag0.init(g0);\n\n List<node_data> list0 = ag0.shortestPath(1, 1); //should go from 1 -> 1\n int[] list0Test = {1, 1};\n int i = 0;\n for (node_data n : list0) {\n\n assertEquals(n.getKey(), list0Test[i]);\n i++;\n }\n\n List<node_data> list1 = ag0.shortestPath(1, 2); //should go 1 -> 2\n int[] list1Test = {1, 2};\n i = 0;\n for (node_data n : list1) {\n\n assertEquals(n.getKey(), list1Test[i]);\n i++;\n }\n g0.connect(1, 3, 2);\n List<node_data> list2 = ag0.shortestPath(1, 2); //should go 1 -> 3 -> 2\n int[] list2Test = {1, 3, 2};\n i = 0;\n for (node_data n : list2) {\n\n assertEquals(n.getKey(), list2Test[i]);\n i++;\n }\n\n g0.connect(1, 3, 10);\n List<node_data> list3 = ag0.shortestPath(1,3);\n int[] list3Test = {1, 2, 3};\n i = 0;\n for(node_data n: list3) {\n\n assertEquals(n.getKey(), list3Test[i]);\n i++;\n }\n/*\n\n List<node_data> list4 = ag0.shortestPath(1,4);\n int[] list4Test = {1, 4};\n i = 0;\n for(node_data n: list4) {\n\n assertEquals(n.getKey(), list4Test[i]);\n i++;\n }\n\n List<node_data> list5 = ag0.shortestPath(4,1);\n int[] list5Test = {4, 1};\n i = 0;\n for(node_data n: list5) {\n\n assertEquals(n.getKey(), list5Test[i]);\n i++;\n }\n*/\n }", "@Test\n public void blockArea() {\n EdgeIteratorState edge1 = graph.edge(0, 1).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(10).set(speedEnc, 10, 10);\n EdgeIteratorState edge2 = graph.edge(2, 3).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(0, 4).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(4, 5).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(6, 3).setDistance(100).set(speedEnc, 10, 10);\n\n // usually we would take the direct route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE), 3, 30, 3000, nodes(0, 1, 2, 3));\n\n // with forced edges we might have to go around\n assertPath(calcPath(0, 3, 3, ANY_EDGE), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, 6), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // with avoided edges we also have to take a longer route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge1)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge2)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // enforcing forbidden start/target edges still does not allow using them\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n\n // .. even when the nodes are just next to each other\n assertNotFound(calcPath(0, 1, edge1.getEdge(), ANY_EDGE, createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 1, ANY_EDGE, edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n }", "public List<Vertex> runTabuSearch() {\r\n\t\tBestPath = convertPath(ClothestPath.findCycle(this.vertexGraph, this.edgeGraph, this.isOriented));\r\n\t\tLastPath = new ArrayList<Vertex>(BestPath);\r\n\t\tint BestEval = fit(BestPath);\r\n\t\thistoBestPath.add(new ArrayList<Vertex>(BestPath));\r\n\r\n\t\tint iteration_actuel = 0;\r\n\t\twhile (iteration_actuel < this.numberIteration) {\r\n\t\t\tLastPath = newPath();\r\n\t\t\t\r\n\t\t\tif(LastPath.isEmpty()) {\r\n\t\t\t\titerationReal = iteration_actuel;\r\n\t\t\t\treturn BestPath;\r\n\t\t\t}\r\n\r\n\t\t\tif (fit(LastPath) < BestEval) {\r\n\t\t\t\tBestPath = new ArrayList<Vertex>(LastPath);\r\n\t\t\t\tBestEval = fit(LastPath);\r\n\t\t\t\thistoBestPath.add(new ArrayList<Vertex>(BestPath));\r\n\t\t\t}\r\n\r\n\t\t\titeration_actuel++;\r\n\t\t}\r\n\r\n\t\titerationReal = iteration_actuel;\r\n\t\treturn BestPath;\r\n\t}", "static void FindPath(vertex s, vertex[] array){\r\n\t\tvertex v; \r\n\t\tint min = Integer.MAX_VALUE;\r\n\t\t//node wN; vertex wV; //wN= adjacent node in LinkedList; wV= find the values in the vertices for wL\r\n\t\tint j =0;\r\n\t\ts.known = true;\r\n\t\ts.dist = 0;\r\n\t\tShortestPath(s, array);\r\n\t\r\n\t\twhile(j<array.length-1 ){ //&& array[j].known== false){\r\n\t\t\tint count = 0; \r\n\t\t\tmin = Integer.MAX_VALUE;\r\n\t\t\tfor(int i = 0; i<array.length; i++){\r\n\t\t\t\tif(array[i].known== false && array[i].dist < min){\r\n\t\t\t\t\tmin = array[i].dist;\r\n\t\t\t\t\tcount = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tv = array[count];\r\n //System.out.println(\"count: \" + count + \"Next v: \" + v.name);\r\n\t\t\tShortestPath(v, array);\r\n\t\t\tj++; \t\t\r\n }\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate void findSimplePaths(Integer currentVertex, Integer destinationVertex, double totalWeight, LinkedList<Integer> path, Set<Integer> allVertices, Set<Integer> visitedNodes, HashMap<LinkedList<Integer>, Double> allSimplePaths) {\n\t\tSet<DefaultEdge> connectedEdges = layout.edgesOf(currentVertex);\n\t\t// remove all of the edges that have been visited\n\t\tif (destinationVertex.equals(currentVertex)){\n\t\t\t// Completed the loop\n\t\t\tallSimplePaths.put(path, totalWeight);\n\t\t\treturn;\n\t\t}\n\t\tfor (DefaultEdge e : connectedEdges) {\n\t\t\tInteger v = layout.getEdgeTarget(e);\n\t\t\tif (!currentVertex.equals(layout.getEdgeSource(e))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (visitedNodes.contains(v)){\n\t\t\t\tcontinue; //already visited the edge, so skip it\n\t\t\t}\n\t\t\tDefaultBlock b = (DefaultBlock)blockData.get((int)currentVertex);\n\t\t\t// if it is a switch make sure the next block is a valid move\n\t\t\t/*\n\t\t\tif (b.getClass().equals(SwitchBlock.class)){\n\t\t\t\tint [] possibleNextBlocks = ((SwitchBlock) b).getPossibleNextBlocks();\n\t\t\t\tfor (Integer i : allVertices) {\n\t\t\t\t\tif (i.equals(possibleNextBlocks[0])) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (i.equals(possibleNextBlocks[1])) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n\t\t\t// If the block is closed, it is not a path\n\t\t\tif (b.broken) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// it is part of a path\n\t\t\ttotalWeight += b.blockLength;\n\t\t\tLinkedList<Integer> pathCopy = (LinkedList<Integer>)path.clone();\n\t\t\tSet<Integer> visitedNodesCopy = new HashSet<Integer>(visitedNodes.size());\n\t\t\tvisitedNodesCopy.addAll(visitedNodes);\n\t\t\tvisitedNodesCopy.add(v);\n\t\t\tpathCopy.add(pathCopy.size(), v);\n\t\t\tfindSimplePaths(v, destinationVertex, totalWeight, pathCopy, allVertices, visitedNodesCopy, allSimplePaths);\n\t\t}\n\t}", "public static int[] breadth_first_search(graphNode[] graph) {\n\t\tboolean[] visited = new boolean[graph.length];\n\t\tint[] prev = new int[graph.length];\n\t\tfor(int i=0; i<graph.length; i++) {\n\t\t\tvisited[i] = false;\n\t\t\tprev[i] = -1;\n\t\t}\n\t\tQueue Q = new Queue();\n\t\tQ.enqueue(0);\n\t\tvisited[0] = true;\n\t\twhile(!Q.isEmpty()) {\n\t\t\tint u = Q.dequeue();\n\t\t\tfor(graphNode i=graph[u]; i!=null; i=i.next) {\n\t\t\t\tif(!visited[i.dest]) {\n\t\t\t\t\tvisited[i.dest] = true;\n\t\t\t\t\tprev[i.dest] = u;\n\t\t\t\t\tQ.enqueue(i.dest);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn prev;\n\t}", "public List<Flight> TopAirline(int max) throws TravelException;" ]
[ "0.7518537", "0.4714363", "0.44924268", "0.44083273", "0.4316959", "0.42136133", "0.42053753", "0.41913798", "0.41859004", "0.41725248", "0.41563767", "0.41477057", "0.4139792", "0.41348693", "0.41291198", "0.41194096", "0.410909", "0.40663183", "0.40535107", "0.40427047", "0.4036738", "0.40330267", "0.40101534", "0.40010273", "0.39976135", "0.39967996", "0.3939633", "0.39005223", "0.3895053", "0.3888926", "0.38717997", "0.38654652", "0.38563922", "0.38420233", "0.3830656", "0.38170296", "0.38051257", "0.37823698", "0.37816212", "0.37810865", "0.3780357", "0.37801942", "0.37778407", "0.37632933", "0.37620634", "0.3760564", "0.3755199", "0.37548074", "0.3748708", "0.37402594", "0.37383363", "0.3737669", "0.3734716", "0.37256607", "0.37235117", "0.37115636", "0.37003952", "0.36987555", "0.36982867", "0.3695455", "0.3689812", "0.36883304", "0.36873284", "0.36847696", "0.36828583", "0.368285", "0.3681467", "0.3679271", "0.36766267", "0.36743826", "0.3672899", "0.3670625", "0.36695653", "0.36687747", "0.3667177", "0.3666019", "0.36649325", "0.3659732", "0.36551502", "0.36497205", "0.36429423", "0.3640453", "0.36358246", "0.36344388", "0.3634283", "0.363129", "0.3629903", "0.36232617", "0.36138067", "0.3612913", "0.36124256", "0.36119705", "0.36069223", "0.3604801", "0.36031446", "0.3601152", "0.35999295", "0.35971865", "0.35951382", "0.3594346" ]
0.7582316
0
This function generates a Java Calendar object for today with the time values initialised to the time the stock exchange opens
public static Calendar getExchOpeningTime() { Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); result.set(Calendar.MILLISECOND, 0); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "@NonNull public static CalendarDay today() {\n return from(LocalDate.now());\n }", "public static Date today() // should it be void?\n {\n GregorianCalendar currentDate = new GregorianCalendar();\n int day = currentDate.get(GregorianCalendar.DATE);\n int month = currentDate.get(GregorianCalendar.MONTH) + 1;\n int year = currentDate.get(GregorianCalendar.YEAR);\n int hour = currentDate.get(GregorianCalendar.HOUR_OF_DAY);\n int minute = currentDate.get(GregorianCalendar.MINUTE);\n return new Date(day, month, year, hour, minute);\n }", "public StockDate GetCalendar()\r\n\t{\r\n\t\treturn date;\r\n\t}", "public void setTodayCalendar()\n {\n this.currentCalendar = Calendar.getInstance();\n }", "protected Calendar getCurrentCalendar() {\n Calendar current = new Calendar();\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n SimpleDateFormat dateFormatHour = new SimpleDateFormat(\"H\");\n SimpleDateFormat dateFormatWeekDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat dateFormatMonth = new SimpleDateFormat(\"MMM\");\n\n current.setHour(dateFormatHour.format(calendar.getTime()).toString());\n current.setWeekday(dateFormatWeekDay.format(calendar.getTime()));\n current.setMonth(dateFormatMonth.format(calendar.getTime()));\n\n return current;\n }", "public static Calendar getFechaHoy(){\n\n Calendar cal = new GregorianCalendar();\n cal.set(Calendar.HOUR_OF_DAY,0);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "Calendar getCalendar();", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "public static Calendar getDefaultScheduleTime() {\n Calendar scheduled = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/Copenhagen\"));\n scheduled.add(Calendar.HOUR, 1);\n\n scheduled.set(Calendar.MINUTE, 0);\n scheduled.set(Calendar.SECOND, 0);\n scheduled.set(Calendar.MILLISECOND, 0);\n\n return scheduled;\n }", "public static Date createDate(int yyyy, int month, int day, int hour, int min) {\n/* 93 */ CALENDAR.clear();\n/* 94 */ CALENDAR.set(yyyy, month - 1, day, hour, min);\n/* 95 */ return CALENDAR.getTime();\n/* */ }", "public static Calendar getExchClosingTime() {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n return result;\r\n }", "Calendar getArrivalDateAndTime();", "public Calendar getCalendar() {\n Calendar c = Calendar.getInstance();\n c.setTime(cal.getTime());\n return c;\n }", "public Date getCurrentDate() {\n Calendar cal = Calendar.getInstance();\n cal.set(Calendar.HOUR_OF_DAY, 0); // ! clear would not reset the hour of day !\n cal.clear(Calendar.MINUTE);\n cal.clear(Calendar.SECOND);\n cal.clear(Calendar.MILLISECOND);\n\n Date currentDate = cal.getTime();\n return currentDate;\n }", "public static Calendar getExchOpeningTimeFromGraph(BaseGraph<AbstractGraphPoint> graph) {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n if (null != graph && 0 < graph.size()) {\r\n AbstractGraphPoint first = graph.first();\r\n result.setTimeInMillis(first.getTimestamp());\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n }\r\n return result;\r\n }", "@Override\n\tpublic Calendar getInitialDate() {\n\t\treturn Calendar.getInstance();\n\t}", "public static void updateCalendar() {\n time = Calendar.getInstance();\n hour = time.get(Calendar.HOUR_OF_DAY);\n minute = time.get(Calendar.MINUTE);\n day = time.get(Calendar.DAY_OF_MONTH);\n month = time.get(Calendar.MONTH) + 1; \n year = time.get(Calendar.YEAR);\n\n }", "Calendar toCalendar();", "Calendar toCalendar();", "public void setTodayDate() {\n\t\tfinal Calendar c = Calendar.getInstance();\r\n\t\tmYear = c.get(Calendar.YEAR);\r\n\t\tmMonth = c.get(Calendar.MONTH);\r\n\t\tmDay = c.get(Calendar.DAY_OF_MONTH);\r\n\r\n\t\tmaxYear = mYear - 10;\r\n\t\tmaxMonth = mMonth;\r\n\t\tmaxDay = mDay;\r\n\r\n\t\tminYear = mYear - 110;\r\n\t\tminMonth = mMonth;\r\n\t\tminDay = mDay;\r\n\t\t// display the current date (this method is below)\r\n\t\t// updateDisplay();\r\n\t\t updateDisplay(maxYear, maxMonth, maxDay);\r\n\t}", "public Calendar startOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE));\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) {\r\n Calendar usaCal = Calendar.getInstance(tz);\r\n usaCal.clear();\r\n usaCal.set(year, month, day, hrs, min, secs);\r\n return usaCal;\r\n }", "public Calendar() {\n\t\tthis(() -> LocalDateTime.now());\n\t}", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "public void get_fecha(){\n //Obtenemos la fecha\n Calendar c1 = Calendar.getInstance();\n fecha.setCalendar(c1);\n }", "private Date getSamoaNow() {\n\t\t// Get the current datetime in UTC\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(new Date());\n\t\t\n\t\t// Get the datetime minus 11 hours (Samoa is UTC-11)\n\t\tcalendar.add(Calendar.HOUR_OF_DAY, -11);\n\t\t\n\t\treturn calendar.getTime();\n\t}", "Calendar registeredAt();", "public static Calendar getExchOpeningCalendar(Calendar aDate) {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n if (null != aDate) {\r\n result.setTimeInMillis(aDate.getTimeInMillis());\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n }\r\n return result;\r\n }", "public static String getDate() {\n\t\tString\ttoday=\"\";\n\n\t\tCalendar Datenow=Calendar.getInstance();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t today = formatter.format(Datenow.getTime());\n\n\t return today;\n\t}", "private void setToday() {\r\n\t\tmTime = new Date().getTime();\r\n\t}", "public static Date todayStart() {\n return dayStart(new Date());\n }", "private boolean isToday(Calendar currentCal){\n return currentCal.get(Calendar.DATE) == Calendar.getInstance().get(Calendar.DATE)\n && currentCal.get(Calendar.MONTH) == Calendar.getInstance().get(Calendar.MONTH)\n && currentCal.get(Calendar.YEAR) == Calendar.getInstance().get(Calendar.YEAR);\n }", "private Date getCurrentDate() {\n return Date.from(LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toInstant());\n }", "public static Calendar ahoraCalendar() {\n return Calendar.getInstance(TimeZone.getTimeZone(\"America/Guayaquil\"));\n }", "public static Date getDateNowSingl(){\n\t\tconfigDefaultsTimeZoneAndLocale();\r\n\t\t\r\n\t\t// o time millis é sempre GMT 0, a transformação fica por conta do Date\r\n\t\treturn new Date(System.currentTimeMillis()+getPropDefaultForAll(TIME_CORRECTION));\r\n\t}", "public static String getToday() {\n return getToday(\"yyyy-MM-dd HH:mm:ss\");\n }", "Calendar getTimeStamp();", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "public void setupCalendar() { \n\t\tcal = whenIsIt();\n\t\tLocale here = Locale.US;\n\t\tthisMonth = cal.getDisplayName(2, Calendar.LONG_STANDALONE, here);\n\t\tdate = cal.get(5); //lesson learned: if it's a number do this\n\t\t//ADD CODE FOR ORDINALS HERE\n\t\tyear = cal.get(1);\n\t\tthisHour = cal.get(10);\n\t\tthisMinute = cal.get(12);\n\t\tthisSecond = cal.get(13);\n\t\tamPm = cal.getDisplayName(9, Calendar.SHORT, here);\n\t\tthisDay = thisMonth +\" \"+ addOrdinal(date) + \", \" + year;\n\t\tcurrentTime = fix.format(thisHour) + \":\" + fix.format(thisMinute) + \":\" + fix.format(thisSecond) + \" \" + amPm;\n\t}", "public static Date createDate(int yyyy, int month, int day) {\n/* 75 */ CALENDAR.clear();\n/* 76 */ CALENDAR.set(yyyy, month - 1, day);\n/* 77 */ return CALENDAR.getTime();\n/* */ }", "public void createDate(){\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy_MM_dd\"); //TODO -HHmm si dejo diagonales separa bonito en dia, pero para hacer un armado de excel creo que debo hacer un for mas\n currentDateandTime = sdf.format(new Date());\n Log.e(TAG, \"todays date is: \"+currentDateandTime );\n\n}", "private void getIntialCalender() {\n\n\t\ttry {\n\n\t\t\tc = Calendar.getInstance();\n\t\t\tString[] fields = Global_variable.str_booking_date.split(\"[-]\");\n\n\t\t\tString str_year = fields[0];\n\t\t\tString str_month = fields[1];\n\t\t\tString str_day = fields[2];\n\n\t\t\tSystem.out.println(\"!!!!\" + fields[0]);\n\t\t\tSystem.out.println(\"!!!!\" + fields[1]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields[2]);\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tyear = Integer.parseInt(str_year);\n\t\t\t} else {\n\t\t\t\tyear = c.get(Calendar.YEAR);\n\t\t\t}\n\n\t\t\tif (str_month.length() != 0) {\n\t\t\t\tmonth = Integer.parseInt(str_month) - 1;\n\t\t\t} else {\n\t\t\t\tmonth = c.get(Calendar.MONTH);\n\t\t\t}\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tday = Integer.parseInt(str_day);\n\t\t\t} else {\n\t\t\t\tday = c.get(Calendar.DAY_OF_MONTH);\n\t\t\t}\n\n\t\t\tString[] fields1 = Global_variable.str_booking_time.split(\"[:]\");\n\n\t\t\tString str_hour = fields1[0];\n\t\t\tString str_minutes = fields1[1];\n\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[0]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[1]);\n\n\t\t\tif (str_hour.length() != 0) {\n\t\t\t\thour = Integer.parseInt(str_hour);\n\t\t\t} else {\n\t\t\t\thour = c.get(Calendar.HOUR_OF_DAY);\n\t\t\t}\n\n\t\t\tif (str_minutes.length() != 0) {\n\t\t\t\tminutes = Integer.parseInt(str_minutes);\n\t\t\t} else {\n\t\t\t\tminutes = c.get(Calendar.MINUTE);\n\t\t\t}\n\n\t\t\tcurrDate = new java.sql.Date(System.currentTimeMillis());\n\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\tCalendar c1 = Calendar.getInstance();\n\t\t\tc1.setTime(new Date()); // Now use today date.\n\t\t\tc1.add(Calendar.DATE, 30); // Adding 30 days\n\t\t\toutput = sdf.format(c1.getTime());\n\t\t\tSystem.out.println(\"!!!!!!!!!!!!!!!\" + output);\n\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "abstract GregorianCalendar getThreadLocalCalendar();", "public Timestamp getToday()\n\t{\n\t\treturn m_today;\n\t}", "public static final DateUtil localToday()\n {\n return today(TimeZone.getDefault());\n }", "public abstract Date computeFirstFireTime(Calendar calendar);", "public Calendar getReturnDate()\n {\n /*New Calendar for Return Date*/\n Calendar dueDate = Calendar.getInstance();\n\n /*Month is Current Month*/\n dueDate.set(today.MONTH, today.get(today.MONTH));\n /*Year is Current Year*/\n dueDate.set(today.YEAR, today.get(today.YEAR));\n /*Due Date is 21 Days Later*/\n dueDate.set(today.DATE, today.get(today.DATE + 21));\n\n return dueDate;\n }", "private Date generateExpirationDate(){\n Calendar c = Calendar.getInstance();\n c.setTime(new Date());\n c.add(Calendar.DAY_OF_WEEK, CommonSecurityConfig.EXPIRATION);\n return c.getTime();\n }", "public static LocalDate generateExpiration() {\n LocalDate today = LocalDate.now(); //gives us the information at the moment the program is running\n int expYear = today.getYear() + 5;\n LocalDate exp = LocalDate.of(expYear, today.getMonth(), today.getDayOfMonth());\n return exp;\n }", "public PickDateTime(Calendar cal) {\n\t\tjbInit();\n\t}", "public int getToday() {\n \treturn 0;\n }", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute) {\r\n\t\tCalendar calendar = createCalendar(year, month, date);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, hour);\r\n\t\tcalendar.set(Calendar.MINUTE, minute);\r\n\t\treturn calendar;\r\n\t}", "public static void getCalendar(Calendar cal, QuoteShort q) {\n\t\tcal.set(q.getYear(), q.getMonth()-1, q.getDay(), q.getHh(), q.getMm(),q.getSs());\r\n\t}", "public static Calendar convertToExchCal(Calendar cal) {\r\n long timeInMillis = cal.getTimeInMillis();\r\n Calendar exchCal = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n exchCal.clear();\r\n exchCal.setTimeInMillis(timeInMillis);\r\n return exchCal;\r\n }", "private String getTodayDate(){\n // get current Date and Time for product_info table\n Date date = Calendar.getInstance().getTime();\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd hh:MM\", Locale.getDefault());\n return dateFormat.format(date);\n }", "Calendar occurredAt();", "public static Calendar getExchOpeningTimeFromPoint(AbstractGraphPoint aPoint) {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.setTimeInMillis(aPoint.getTimestamp());\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n return result;\r\n }", "private static List<LocalDateTime> createEmptyFutureSchedule(int days) {\n List<LocalDateTime> emptySchedule = new ArrayList<>();\n LocalDateTime dateTime = LocalDateTime.now();\n dateTime = dateTime.minusMinutes(dateTime.getMinute());\n dateTime = dateTime.minusSeconds(dateTime.getSecond());\n dateTime = dateTime.minusNanos(dateTime.getNano());\n int delta = Constant.END_WORKING_DAY_HOUR - dateTime.getHour();\n for (int i = 1; i < Constant.HOURS_PER_DAY * days + delta; i++) {\n LocalDateTime timeCell = dateTime.plusHours(i);\n if (timeCell.getHour() < Constant.END_WORKING_DAY_HOUR && timeCell.getHour() >= Constant.START_WORKING_DAY_HOUR && !timeCell.getDayOfWeek().equals(DayOfWeek.SUNDAY)) {\n emptySchedule.add(timeCell);\n }\n }\n return emptySchedule;\n }", "public Calendar toCalendar() {\n\t\treturn (Calendar) _cal.clone();\n\t}", "public static Date now() {\n return Calendar.getInstance().getTime();\n }", "public static Date now() {\n return Calendar.getInstance().getTime();\n }", "public GregorianCalendar getCalendar() {\r\n return new GregorianCalendar(this.year, this.month - 1, this.day);\r\n }", "public static void main(String[] args) {\n\t\tCalendar now = Calendar.getInstance();\r\n\t\tint hour = now.get(Calendar.HOUR_OF_DAY);\r\n\t\tint minute = now.get(Calendar.MINUTE);\r\n\t\tint month = now.get(Calendar.MONTH + 1);\r\n\t\tint day = now.get(Calendar.DAY_OF_MONTH);\r\n\t\tint year = now.get(Calendar.YEAR);\r\n\r\n\t\tSystem.out.println(now.getTime());\r\n\r\n\t\t// Crear una fecha fija\r\n\t\tCalendar sameDate = new GregorianCalendar(2010, Calendar.FEBRUARY, 22, 23, 11, 44);\r\n\r\n\t\t// mostrar los agradecimientos\r\n\t\tif (hour < 12)\r\n\t\t\tSystem.out.println(\"Buenos días. \\n\");\r\n\t\telse if (hour < 17)\r\n\t\t\tSystem.out.println(\"Buenas tardes. \\n\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Buenas noches charAt(\\n)\");\r\n\r\n\t\t// Mostrar minutos\r\n\t\tSystem.out.println(\"It is\");\r\n\t\tif (minute != 0) {\r\n\t\t\tSystem.out.print(\" \" + minute + \" \");\r\n\t\t\tSystem.out.print((minute != 1) ? \"minutes\" : \"minute\");\r\n\t\t\tSystem.out.print(\" past\");\r\n\t\t}\r\n\t\t// Mostrar la hora\r\n\t\tSystem.out.print(\" \");\r\n\t\tSystem.out.print((hour > 12) ? (hour - 12) : hour);\r\n\t\tSystem.out.print(\" o'clock on \\n\");\r\n\r\n\t\t// Mostrar el mes\r\n\r\n\t\tSystem.out.print(\"Estamos en el mes de: \");\r\n\t\tswitch (month) {\r\n\t\tcase 1:\r\n\t\t\tSystem.out.println(\"Enero\");\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tSystem.out.println(\"Febrero\");\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tSystem.out.println(\"Marzo\");\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tSystem.out.println(\"Abril\");\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tSystem.out.println(\"Mayo\");\r\n\t\t\tbreak;\r\n\t\tcase 6:\r\n\t\t\tSystem.out.println(\"Junio\");\r\n\t\t\tbreak;\r\n\t\tcase 7:\r\n\t\t\tSystem.out.println(\"Julio\");\r\n\t\t\tbreak;\r\n\t\tcase 8:\r\n\t\t\tSystem.out.println(\"Agosto\");\r\n\t\t\tbreak;\r\n\t\tcase 9:\r\n\t\t\tSystem.out.println(\"Septiembre\");\r\n\t\t\tbreak;\r\n\t\tcase 10:\r\n\t\t\tSystem.out.println(\"Octubre\");\r\n\t\t\tbreak;\r\n\t\tcase 11:\r\n\t\t\tSystem.out.println(\"Noviembre\");\r\n\t\t\tbreak;\r\n\t\tcase 12:\r\n\t\t\tSystem.out.println(\"Diciembre\");\r\n\r\n\t\t}\r\n\t}", "public Calendar getStartDate() {\n \t\tCalendar cal = Calendar.getInstance();\n \t\tcal.setTimeInMillis(startTime);\n \t\t\n\t\treturn cal;\n\t}", "public Calendar getCurrentCalendar()\n {\n return this.currentCalendar;\n }", "public Calendar getCalendar() {\n return cal;\n }", "private void gregorianCalendar() {\n\t\tCalendar calendar = context.getBean(\"calendar\",Calendar.class);\n\t\tDateFormat formatter = (DateFormat) context.getBean(\"formatter\");\n\t\tSystem.out.println(formatter.format(calendar.getTime()));\n\t}", "@Test\n\tpublic void testTradeDateFrom0() {\n\n\t\tfinal DDF_TradeDay day = DDF_TradeDay.D15;\n\n\t\tfinal DateTime today = new DateTime(\"2012-01-18T10:39:44.647-06:00\");\n\n\t\tfinal TimeValue value = DDF_TradeDay.tradeDateFrom(day, today);\n\n\t\tfinal DateTime trade = value.asDateTime();\n\n\t\tlogger.debug(\"day=\" + day);\n\t\tlogger.debug(\"today=\" + today);\n\t\tlogger.debug(\"trade=\" + trade);\n\n\t\tassertEquals(trade.getYear(), 2012);\n\t\tassertEquals(trade.getMonthOfYear(), 01);\n\t\tassertEquals(trade.getDayOfMonth(), 15);\n\n\t}", "hr.client.appuser.CouponCenter.TimeRange getExchangeTime();", "public static String now() {\n // TODO: move this method to DateUtils\n return fromCalendar(GregorianCalendar.getInstance());\n }", "private Date getFrom(RuleTypes.HistoricRequirements ph) {\n Calendar date = new GregorianCalendar();\n date.set(Calendar.HOUR_OF_DAY, 0);\n date.set(Calendar.MINUTE, 0);\n date.set(Calendar.SECOND, 0);\n date.set(Calendar.MILLISECOND, 0);\n int today;\n\n switch(ph) {\n case TODAY:\n return date.getTime();\n case YESTERDAY:\n date.add(Calendar.DAY_OF_MONTH, -1);\n return date.getTime();\n case THIS_WEEK:\n today = date.get(Calendar.DAY_OF_WEEK);\n date.add(Calendar.DAY_OF_WEEK,-today+Calendar.MONDAY);\n return date.getTime();\n case LAST_WEEK:\n today = date.get(Calendar.DAY_OF_WEEK);\n date.add(Calendar.DAY_OF_WEEK,-today+Calendar.MONDAY);\n date.add(Calendar.DAY_OF_MONTH, -7);\n return date.getTime();\n case THIS_MONTH:\n date.set(Calendar.DAY_OF_MONTH, date.getActualMinimum(Calendar.DAY_OF_MONTH));\n return date.getTime();\n case LAST_MONTH:\n date.set(Calendar.DAY_OF_MONTH, date.getActualMinimum(Calendar.DAY_OF_MONTH));\n date.add(Calendar.MONTH, -1);\n return date.getTime();\n case T12_HRS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -12);\n return date.getTime();\n case T24_HRS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -24);\n return date.getTime();\n case T2_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -48);\n return date.getTime();\n case T3_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -72);\n return date.getTime();\n case T4_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -96);\n return date.getTime();\n case T5_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -120);\n return date.getTime();\n case T6_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -144);\n return date.getTime();\n case T7_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -168);\n return date.getTime();\n }\n return null;\n }", "public static Date fechaInicial(Date hoy) {\n\t\thoy=(hoy==null?new Date():hoy);\n\t\tLong fechaCombinada = configuracion().getFechaCombinada();\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(hoy);\n\t\tif (fechaCombinada == 1l) {\n\t\t\tcalendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) - 1);\n\t\t\tcalendar.set(Calendar.HOUR_OF_DAY, 14);\n\t\t\tcalendar.set(Calendar.MINUTE, 0);\n\t\t\tcalendar.set(Calendar.SECOND, 0);\n\t\t} else {\n\t\t\tString fhoyIni = df.format(hoy);\n\t\t\ttry {\n\t\t\t\thoy = df.parse(fhoyIni);\n\t\t\t} catch (ParseException e) {\n\t\t\t\tlog.error(\"Error en fecha inicial\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\n\t\t\tcalendar.set(Calendar.MINUTE, 0);\n\t\t\tcalendar.set(Calendar.SECOND, 0);\n\t\t}\n\t\thoy = calendar.getTime();\n\t\treturn hoy;\n\t}", "public Calendar() {\n }", "public ArrayList<Event> getEventsByToday() {\n\t\tArrayList<Event> result = new ArrayList<Event>();\n\t\tCalendar today = Calendar.getInstance();\n\t\tfor (int i = 0; i < events.size(); i++) {\n\t\t\tif (events.get(i).getInitial_date().get(Calendar.YEAR) == today.get(Calendar.YEAR)\n\t\t\t\t\t&& events.get(i).getInitial_date().get(Calendar.MONTH) == today.get(Calendar.MONTH)\n\t\t\t\t\t&& events.get(i).getInitial_date().get(Calendar.DAY_OF_MONTH) == today.get(Calendar.DAY_OF_MONTH)) {\n\t\t\t\tresult.add(events.get(i));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "private Date getTestListingDateTimeStamp() {\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/London\"));\n\n GregorianCalendar calendar = new GregorianCalendar(2010, 0, 1, 17, 0);\n return new Date(calendar.getTimeInMillis());\n }", "public BwCalendar getCalendar() {\n if (calendar == null) {\n calendar = new BwCalendar();\n }\n\n return calendar;\n }", "public static Date ahora() {\n return ahoraCalendar().getTime();\n }", "@TargetApi(Build.VERSION_CODES.O)\n public LocalDate getTodayDate() {\n LocalDate date;\n date = LocalDate.now();\n return date;\n }", "@Test\n public void getterCalendar(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n Assert.assertEquals(2018,calendar.getYear());\n Assert.assertEquals(4,calendar.getMonth());\n Assert.assertEquals(25,calendar.getDayOfMonth());\n }", "public static String generateCurrentDayString() {\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\treturn dateFormat.format(new Date());\n\t}", "public JCalendar() {\r\n init();\r\n resetToDefaults();\r\n }", "public Calendar getCal() {\n return cal;\n }", "public static void createArrayOfCalendars() {\n\n GregorianCalendar[] calendars = new GregorianCalendar[12];\n\n /*\n\n At this point, every element in the array has a value of null.\n\n */\n\n for (GregorianCalendar calendar : calendars) {\n System.out.println(calendar);\n }\n \n /*\n * Create a new calendar object and assign it to each element in the array. \n * \n */\n \n for (int i = 0; i < calendars.length; i++) {\n calendars[i] = new GregorianCalendar(2021, i + 1, 1);\n }\n \n for (GregorianCalendar calendar : calendars) {\n System.out.println(calendar);\n }\n \n /*\n * An enhanced for loop cannot modify the values of the elements in the array (.g., references to calendars), but we can call \n * mutator methods which midify the properties fo the referenced objects (e.g., day of the month).\n */\n \n for (GregorianCalendar calendar : calendars) {\n calendar.add(GregorianCalendar.DAY_OF_MONTH, 2);\n }\n \n for (GregorianCalendar calendar : calendars) {\n System.out.println(calendar);\n }\n }", "public Calendar calendario(Date date) {\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(date);\r\n return calendar;\r\n }", "private static Calendar getCalendar(final Long timeInMilliseconds, final TimeZone timeZone) {\n\n final Calendar calendar = Calendar.getInstance(timeZone);\n calendar.setTimeInMillis(timeInMilliseconds);\n\n return calendar;\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tgetLayouts();\n\n\t\t\t\tCalendar pre = (Calendar) calendar.clone();\n\n\t\t\t\tcurrentMonth--;\n\n\t\t\t\tif (currentMonth == 0) {\n\t\t\t\t\tcurrentMonth = 12;\n\t\t\t\t\tcurrentYear--;\n\t\t\t\t}\n\t\t\t\tpre.set(Calendar.MONTH, currentMonth);\n\t\t\t\tpre.set(Calendar.YEAR, currentYear);\n\t\t\t\tpre.set(Calendar.DATE, 1);\n\n\t\t\t\tpositionPre = pre.getTime().toString().split(\" \");\n\t\t\t\tpreviousDayPosition = ReturnCalendarDetails\n\t\t\t\t\t\t.getPosition(positionPre[0]);\n\n\t\t\t\tgetCalendar(\n\t\t\t\t\t\tReturnCalendarDetails.getCurrentMonth(positionPre[1]),\n\t\t\t\t\t\tReturnCalendarDetails.getPosition(positionPre[0]),\n\t\t\t\t\t\tInteger.parseInt(positionPre[5]));\n\n\t\t\t\tSystem.out.println(\"!!\" + pre.getTime());\n\t\t\t}", "public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static String convertCalToBrokerTime(Calendar cal) {\r\n String result = \"\";\r\n Calendar gmtCal = DTUtil.convertToLondonCal(cal);\r\n SimpleDateFormat format1 = new SimpleDateFormat(\"yyyyMMdd HH:mm:ss\");\r\n String timeFMString = format1.format(gmtCal.getTime()) + \" GMT\";\r\n result = timeFMString;\r\n return result;\r\n }", "private static Calendar createCalendar(int year, int month, int date) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setLenient(false);\r\n\t\tcalendar.set(Calendar.YEAR, year);\r\n\t\tcalendar.set(Calendar.MONTH, month - 1);\r\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, date);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\treturn calendar;\r\n\t}", "public static boolean isToday(Calendar cal) {\n return isSameDay(cal, Calendar.getInstance());\n }", "private Date getCurrentDateTime() {\n return Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant());\n }", "XMLGregorianCalendar getSystemEntryDate();", "public void goToToday() {\n goToDate(today());\n }", "public static String getToday(String format) {\n Date c = Calendar.getInstance().getTime();\n System.out.println(\"Current time => \" + c);\n SimpleDateFormat df = new SimpleDateFormat(format, Locale.getDefault());\n return df.format(c);\n }", "public static String now() {\n\t\t\treturn fromCalendar(GregorianCalendar.getInstance());\n\t\t}", "public static void setTime(){\n\t\tCalendar cal = Calendar.getInstance();\n\t\tif (!JsonUtils.RUNNING_LOCALLY){\n\t\t\tcal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 4); //account for UTC offset because of lambda\n\t\t}\n\t\tCURRENT_TIME = formatTime(cal.getTime().toString());\n\t}", "public Calendar getCurrentMonthCalendarObj() throws Throwable{\r\n\r\n\t\tString dateInput = \"01/\"+month+\"/\"+year;\t\t\t\r\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MMMM/yyyy\");\r\n\t\tDate startDate = df.parse(dateInput);\r\n\t\tCalendar c = Calendar.getInstance(); // this takes current date\r\n\t c.setTime(startDate); // set date to specified in arguement\r\n\t\treturn c;\r\n\t}", "public Date getDateNow(){\n\t\tconfigDefaults(getProp(LOCALE), getProp(TIME_ZONE), null);\r\n\t\t\r\n\t\t// o time millis é sempre GMT 0, a transformação fica por conta do Date\r\n\t\treturn new Date(System.currentTimeMillis()+getProp(TIME_CORRECTION));\r\n\t}", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute, int second) {\r\n\t\tCalendar calendar = createCalendar(year, month, date, hour, minute);\r\n\t\tcalendar.set(Calendar.SECOND, second);\r\n\t\treturn calendar;\r\n\t}" ]
[ "0.65914094", "0.63238055", "0.6222478", "0.6186958", "0.6177609", "0.6113258", "0.6107154", "0.6067813", "0.6041003", "0.58676803", "0.57538074", "0.57274103", "0.5727327", "0.566251", "0.56378657", "0.5614263", "0.55741835", "0.5570057", "0.55655843", "0.55655843", "0.5550165", "0.5533651", "0.5489917", "0.5484284", "0.5471908", "0.5466522", "0.5462577", "0.5431061", "0.54203856", "0.5410201", "0.5405246", "0.53934604", "0.539079", "0.5390142", "0.53808725", "0.53684026", "0.53651255", "0.5363454", "0.53527755", "0.53440654", "0.53402644", "0.53391194", "0.5335672", "0.5333324", "0.53309995", "0.5328444", "0.53120613", "0.53075254", "0.5304964", "0.5280221", "0.5265941", "0.52606803", "0.52441466", "0.5243425", "0.52162814", "0.51982874", "0.5186441", "0.5167879", "0.5140403", "0.5133283", "0.5132448", "0.5132448", "0.5128614", "0.51188594", "0.5117532", "0.5117044", "0.51125497", "0.51120704", "0.51098794", "0.51091015", "0.5103953", "0.5094134", "0.50920516", "0.5083251", "0.5075489", "0.506784", "0.5044562", "0.5038491", "0.5031967", "0.50319356", "0.5023815", "0.5020938", "0.5007625", "0.5006979", "0.50068974", "0.50053626", "0.5004375", "0.4998677", "0.49950466", "0.49920467", "0.49870044", "0.49758813", "0.49660814", "0.4961932", "0.49555957", "0.4954884", "0.4951834", "0.49518102", "0.49485373", "0.4945931" ]
0.6256393
2
This function will create a Java Calendar object initialised to the date and time of the first point in a data graph or to the stock market opening time if their is no data in the graph. NB: We have observed that data does not always become available for a stock at the expected stock market opening time. This function may be used to retrieve the actual date & time a stock started to trade from its data graph
public static Calendar getExchOpeningTimeFromGraph(BaseGraph<AbstractGraphPoint> graph) { Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); if (null != graph && 0 < graph.size()) { AbstractGraphPoint first = graph.first(); result.setTimeInMillis(first.getTimestamp()); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Date computeFirstFireTime(Calendar calendar);", "public Calendar startOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE));\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public StockDate GetCalendar()\r\n\t{\r\n\t\treturn date;\r\n\t}", "public Calendar getStartDate() {\n \t\tCalendar cal = Calendar.getInstance();\n \t\tcal.setTimeInMillis(startTime);\n \t\t\n\t\treturn cal;\n\t}", "@Override\n\tpublic Calendar getInitialDate() {\n\t\treturn Calendar.getInstance();\n\t}", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public static Calendar getExchOpeningTime() {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n return result;\r\n }", "public static Calendar getExchOpeningTimeFromPoint(AbstractGraphPoint aPoint) {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.setTimeInMillis(aPoint.getTimestamp());\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n return result;\r\n }", "private void calculateFinancialStartDate(DepreciationCriteria criteria) {\n\t\tLong todate = criteria.getToDate();\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTimeInMillis(todate);\n\t\tint year = calendar.get(Calendar.YEAR);\n\t\tint month = calendar.get(Calendar.MONTH);\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 23);\n\t\tcalendar.set(Calendar.MINUTE, 59);\n\t\tcriteria.setToDate(calendar.getTimeInMillis());\n\n\t\t// choosing the finacial year based on todate month\n\t\tif (month < 3) {\n\t\t\tcriteria.setFinancialYear(year-1+\"-\"+year);\n\t\t\tyear = year - 1;\n\t\t}else\n\t\t\tcriteria.setFinancialYear(year+\"-\"+(year+1));\n\n\t\t// setting from date value\n\t\tcalendar.set(Calendar.YEAR, year);\n\t\tcalendar.set(Calendar.MONTH, Calendar.APRIL);\n\t\tcalendar.set(Calendar.DATE, 1);\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\n\t\tcalendar.set(Calendar.MINUTE, 0);\n\t\tcriteria.setFromDate(calendar.getTimeInMillis());\n\t\tSystem.err.println(\"from date calculated : \" + criteria.getFromDate());\n\t}", "protected Calendar getCurrentCalendar() {\n Calendar current = new Calendar();\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n SimpleDateFormat dateFormatHour = new SimpleDateFormat(\"H\");\n SimpleDateFormat dateFormatWeekDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat dateFormatMonth = new SimpleDateFormat(\"MMM\");\n\n current.setHour(dateFormatHour.format(calendar.getTime()).toString());\n current.setWeekday(dateFormatWeekDay.format(calendar.getTime()));\n current.setMonth(dateFormatMonth.format(calendar.getTime()));\n\n return current;\n }", "public Date getStartOfDay(Date date) {\n\t Calendar calendar = Calendar.getInstance();\n\t calendar.setTime(date);\n\t calendar.set(Calendar.HOUR_OF_DAY, 0);\n\t calendar.set(Calendar.MINUTE, 0);\n\t calendar.set(Calendar.SECOND, 0);\n\t calendar.set(Calendar.MILLISECOND, 0);\n\t return calendar.getTime();\n\t}", "public static Date getData(Date data) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\r\n\t\tcalendar.setTime(data);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\tcalendar.set(Calendar.MILLISECOND, 0);\r\n\r\n\t\treturn calendar.getTime();\r\n\t}", "public void initCalendarFirst() {\n getCurrentDate();\n mCalendar.setOnDateChangedListener(new OnDateSelectedListener() {\n @Override\n public void onDateSelected(@NonNull MaterialCalendarView widget, @NonNull CalendarDay select, boolean selected) {\n mSelectedDate = select.toString();\n String string[] = mSelectedDate.split(\"\\\\{|\\\\}\");\n String s = string[1]; //2017-8-14\n String string1[] = s.split(\"-\");\n int tempMonth = Integer.parseInt(string1[1]);\n String month = Integer.toString(tempMonth + 1);\n mDate1 = string1[0] + \"-\" + month + \"-\" + string1[2];\n }\n });\n }", "Calendar getCalendar();", "public static Date getStart(Date date) {\n if (date == null) {\n return null;\n }\n Calendar c = Calendar.getInstance();\n c.setTime(date);\n c.set(Calendar.HOUR_OF_DAY, 0);\n c.set(Calendar.MINUTE, 0);\n c.set(Calendar.SECOND, 0);\n c.set(Calendar.MILLISECOND, 0);\n return c.getTime();\n }", "public static Calendar getDefaultScheduleTime() {\n Calendar scheduled = Calendar.getInstance(TimeZone.getTimeZone(\"Europe/Copenhagen\"));\n scheduled.add(Calendar.HOUR, 1);\n\n scheduled.set(Calendar.MINUTE, 0);\n scheduled.set(Calendar.SECOND, 0);\n scheduled.set(Calendar.MILLISECOND, 0);\n\n return scheduled;\n }", "public TimeDateComponents getEventStartDate() {\n return getEventDates().getStartDate();\n }", "public static Date getStartOfDay(Date date)\n {\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(date);\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar.getTime();\n }", "public static Calendar getExchOpeningCalendar(Calendar aDate) {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n if (null != aDate) {\r\n result.setTimeInMillis(aDate.getTimeInMillis());\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n }\r\n return result;\r\n }", "private int getFirstRepresentingDay() {\n\t\tint firstRepresentingDay;\r\n\t\tGregorianCalendar myCalendar = new GregorianCalendar(year, month, 1);\r\n\r\n\t\tint daysofMonth = myCalendar.getActualMaximum(Calendar.DAY_OF_MONTH);\r\n\t\tint firstDayMonth = myCalendar.get(Calendar.DAY_OF_WEEK); // First day of month (relative to the week)\r\n\t\tint globalFirstDayMonth = myCalendar.get(Calendar.DAY_OF_YEAR);\r\n\r\n\t\tif (settings.getBoolean(\"firstDayofWeek\", true)) { //The default option is the week starting on monday\r\n\t\t\tfirstDayMonth = firstDayMonth - 1;\r\n\t\t\tif (firstDayMonth == 0)\r\n\t\t\t\tfirstDayMonth = 7;\r\n\t\t\tfirstRepresentingDay = globalFirstDayMonth - (firstDayMonth - 1);\r\n\t\t}\r\n\t\telse { //else we start the week on Sunday\r\n\t\t\tfirstRepresentingDay = globalFirstDayMonth - (firstDayMonth - 1);\r\n\t\t}\r\n\t\tif (firstDayMonth + daysofMonth < 37)\r\n\t\t\tcount = RingActivity.five_week_calendar;\r\n\t\telse\r\n\t\t\tcount = RingActivity.six_week_calendar;\r\n\r\n\t\treturn firstRepresentingDay;\r\n\t}", "java.util.Calendar getStartTime();", "public Calendar getCalendar() {\n Calendar c = Calendar.getInstance();\n c.setTime(cal.getTime());\n return c;\n }", "abstract GregorianCalendar getThreadLocalCalendar();", "public static Calendar getFechaHoy(){\n\n Calendar cal = new GregorianCalendar();\n cal.set(Calendar.HOUR_OF_DAY,0);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public java.util.Calendar getStartExecDate()\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(STARTEXECDATE$8, 0);\n if (target == null)\n {\n return null;\n }\n return target.getCalendarValue();\n }\n }", "public Calendar calculateStartTime(ConfigProperties cprop){\n\t\tCalendar d = Calendar.getInstance();\n\t\tString sd = cprop.getProperty(\"TIME.startdate\");\n\t\tString st = cprop.getProperty(\"TIME.starttime\");\n\t\t\n\t\t//SD defined\n\t\tif(sd!=null){\n\t\t\td.setTime(df.parse(sd,new ParsePosition(0)));\n\t\t}\n\t\t//SD not defined, use current date\n\t\t\n\t\t//ST defined\n\t\tif(st!=null){\n\t\t\tCalendar t = Calendar.getInstance();\n\t\t\tt.setTime(tf.parse(st,new ParsePosition(0)));\n\t\t\t//take the starttime and add it to the startdate\n\t\t\td.add(Calendar.HOUR_OF_DAY,t.get(Calendar.HOUR_OF_DAY));\n\t\t\td.add(Calendar.MINUTE,t.get(Calendar.MINUTE));\n\t\t\td.add(Calendar.SECOND,t.get(Calendar.SECOND));\n\t\t}\n\t\t//ST not defined use current plus a small delay to avoid misfires\n\t\telse {\n\t\t\td.add(Calendar.SECOND,START_DELAY);\n\t\t}\n\t\treturn d;\n\n\t}", "Calendar getTimeStamp();", "public static Date formatarDataInicial(Date dataInicial) {\r\n\t\tCalendar calendario = GregorianCalendar.getInstance();\r\n\t\tcalendario.setTime(dataInicial);\r\n\t\tcalendario.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendario.set(Calendar.MINUTE, 0);\r\n\t\tcalendario.set(Calendar.SECOND, 0);\r\n\t\treturn calendario.getTime();\r\n\t}", "public void setupCalendar() { \n\t\tcal = whenIsIt();\n\t\tLocale here = Locale.US;\n\t\tthisMonth = cal.getDisplayName(2, Calendar.LONG_STANDALONE, here);\n\t\tdate = cal.get(5); //lesson learned: if it's a number do this\n\t\t//ADD CODE FOR ORDINALS HERE\n\t\tyear = cal.get(1);\n\t\tthisHour = cal.get(10);\n\t\tthisMinute = cal.get(12);\n\t\tthisSecond = cal.get(13);\n\t\tamPm = cal.getDisplayName(9, Calendar.SHORT, here);\n\t\tthisDay = thisMonth +\" \"+ addOrdinal(date) + \", \" + year;\n\t\tcurrentTime = fix.format(thisHour) + \":\" + fix.format(thisMinute) + \":\" + fix.format(thisSecond) + \" \" + amPm;\n\t}", "private Date calculateDateForPosition(RegularTimePeriod period, DateTickMarkPosition position) {\n/* 1097 */ ParamChecks.nullNotPermitted(period, \"period\");\n/* 1098 */ Date result = null;\n/* 1099 */ if (position == DateTickMarkPosition.START) {\n/* 1100 */ result = new Date(period.getFirstMillisecond());\n/* */ }\n/* 1102 */ else if (position == DateTickMarkPosition.MIDDLE) {\n/* 1103 */ result = new Date(period.getMiddleMillisecond());\n/* */ }\n/* 1105 */ else if (position == DateTickMarkPosition.END) {\n/* 1106 */ result = new Date(period.getLastMillisecond());\n/* */ } \n/* 1108 */ return result;\n/* */ }", "Calendar occurredAt();", "public Calendar startOfMonth() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH), 1);\r\n\t\treturn c2;\r\n\t}", "Calendar getArrivalDateAndTime();", "public DateTime getStart() {\r\n return new DateTime(getStartMillis(), getChronology());\r\n }", "public static Date firstDay(final Date date) {\n final Calendar cal = new GregorianCalendar();\n cal.setTime(date);\n cal.set(Calendar.DAY_OF_MONTH, cal.getMinimum(Calendar.DAY_OF_MONTH));\n cal.set(Calendar.HOUR_OF_DAY, 00);\n cal.set(Calendar.MINUTE, 00);\n cal.set(Calendar.SECOND, 00);\n cal.set(Calendar.MILLISECOND, 00);\n return cal.getTime();\n }", "protected Date previousStandardDate(Date date, DateTickUnit unit) {\n/* */ Date d3;\n/* */ long millis;\n/* */ Date standardDate;\n/* */ Month month;\n/* */ Date d2, d1, d0, dd, mm;\n/* */ int years, years, years, years, years, years, months, months, months, months, months, days, days, days, days, hours, hours, hours, minutes, minutes, seconds, milliseconds;\n/* 920 */ Calendar calendar = Calendar.getInstance(this.timeZone, this.locale);\n/* 921 */ calendar.setTime(date);\n/* 922 */ int count = unit.getCount();\n/* 923 */ int current = calendar.get(unit.getCalendarField());\n/* 924 */ int value = count * current / count;\n/* */ \n/* 926 */ switch (unit.getUnit()) {\n/* */ \n/* */ case 6:\n/* 929 */ years = calendar.get(1);\n/* 930 */ months = calendar.get(2);\n/* 931 */ days = calendar.get(5);\n/* 932 */ hours = calendar.get(11);\n/* 933 */ minutes = calendar.get(12);\n/* 934 */ seconds = calendar.get(13);\n/* 935 */ calendar.set(years, months, days, hours, minutes, seconds);\n/* 936 */ calendar.set(14, value);\n/* 937 */ mm = calendar.getTime();\n/* 938 */ if (mm.getTime() >= date.getTime()) {\n/* 939 */ calendar.set(14, value - 1);\n/* 940 */ mm = calendar.getTime();\n/* */ } \n/* 942 */ return mm;\n/* */ \n/* */ case 5:\n/* 945 */ years = calendar.get(1);\n/* 946 */ months = calendar.get(2);\n/* 947 */ days = calendar.get(5);\n/* 948 */ hours = calendar.get(11);\n/* 949 */ minutes = calendar.get(12);\n/* 950 */ if (this.tickMarkPosition == DateTickMarkPosition.START) {\n/* 951 */ milliseconds = 0;\n/* */ }\n/* 953 */ else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) {\n/* 954 */ milliseconds = 500;\n/* */ } else {\n/* */ \n/* 957 */ milliseconds = 999;\n/* */ } \n/* 959 */ calendar.set(14, milliseconds);\n/* 960 */ calendar.set(years, months, days, hours, minutes, value);\n/* 961 */ dd = calendar.getTime();\n/* 962 */ if (dd.getTime() >= date.getTime()) {\n/* 963 */ calendar.set(13, value - 1);\n/* 964 */ dd = calendar.getTime();\n/* */ } \n/* 966 */ return dd;\n/* */ \n/* */ case 4:\n/* 969 */ years = calendar.get(1);\n/* 970 */ months = calendar.get(2);\n/* 971 */ days = calendar.get(5);\n/* 972 */ hours = calendar.get(11);\n/* 973 */ if (this.tickMarkPosition == DateTickMarkPosition.START) {\n/* 974 */ int seconds = 0;\n/* */ }\n/* 976 */ else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) {\n/* 977 */ int seconds = 30;\n/* */ } else {\n/* */ int seconds;\n/* 980 */ seconds = 59;\n/* */ } \n/* 982 */ calendar.clear(14);\n/* 983 */ calendar.set(years, months, days, hours, value, seconds);\n/* 984 */ d0 = calendar.getTime();\n/* 985 */ if (d0.getTime() >= date.getTime()) {\n/* 986 */ calendar.set(12, value - 1);\n/* 987 */ d0 = calendar.getTime();\n/* */ } \n/* 989 */ return d0;\n/* */ \n/* */ case 3:\n/* 992 */ years = calendar.get(1);\n/* 993 */ months = calendar.get(2);\n/* 994 */ days = calendar.get(5);\n/* 995 */ if (this.tickMarkPosition == DateTickMarkPosition.START) {\n/* 996 */ int minutes = 0;\n/* 997 */ int seconds = 0;\n/* */ }\n/* 999 */ else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) {\n/* 1000 */ int minutes = 30;\n/* 1001 */ int seconds = 0;\n/* */ } else {\n/* */ \n/* 1004 */ minutes = 59;\n/* 1005 */ seconds = 59;\n/* */ } \n/* 1007 */ calendar.clear(14);\n/* 1008 */ calendar.set(years, months, days, value, minutes, seconds);\n/* 1009 */ d1 = calendar.getTime();\n/* 1010 */ if (d1.getTime() >= date.getTime()) {\n/* 1011 */ calendar.set(11, value - 1);\n/* 1012 */ d1 = calendar.getTime();\n/* */ } \n/* 1014 */ return d1;\n/* */ \n/* */ case 2:\n/* 1017 */ years = calendar.get(1);\n/* 1018 */ months = calendar.get(2);\n/* 1019 */ if (this.tickMarkPosition == DateTickMarkPosition.START) {\n/* 1020 */ int hours = 0;\n/* */ }\n/* 1022 */ else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) {\n/* 1023 */ int hours = 12;\n/* */ } else {\n/* */ \n/* 1026 */ hours = 23;\n/* */ } \n/* 1028 */ calendar.clear(14);\n/* 1029 */ calendar.set(years, months, value, hours, 0, 0);\n/* */ \n/* */ \n/* 1032 */ d2 = calendar.getTime();\n/* 1033 */ if (d2.getTime() >= date.getTime()) {\n/* 1034 */ calendar.set(5, value - 1);\n/* 1035 */ d2 = calendar.getTime();\n/* */ } \n/* 1037 */ return d2;\n/* */ \n/* */ case 1:\n/* 1040 */ years = calendar.get(1);\n/* 1041 */ calendar.clear(14);\n/* 1042 */ calendar.set(years, value, 1, 0, 0, 0);\n/* 1043 */ month = new Month(calendar.getTime(), this.timeZone, this.locale);\n/* */ \n/* 1045 */ standardDate = calculateDateForPosition(month, this.tickMarkPosition);\n/* */ \n/* 1047 */ millis = standardDate.getTime();\n/* 1048 */ if (millis >= date.getTime()) {\n/* 1049 */ month = (Month)month.previous();\n/* */ \n/* */ \n/* 1052 */ month.peg(Calendar.getInstance(this.timeZone));\n/* 1053 */ standardDate = calculateDateForPosition(month, this.tickMarkPosition);\n/* */ } \n/* */ \n/* 1056 */ return standardDate;\n/* */ \n/* */ case 0:\n/* 1059 */ if (this.tickMarkPosition == DateTickMarkPosition.START) {\n/* 1060 */ int months = 0;\n/* 1061 */ int days = 1;\n/* */ }\n/* 1063 */ else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) {\n/* 1064 */ int months = 6;\n/* 1065 */ int days = 1;\n/* */ } else {\n/* */ \n/* 1068 */ months = 11;\n/* 1069 */ days = 31;\n/* */ } \n/* 1071 */ calendar.clear(14);\n/* 1072 */ calendar.set(value, months, days, 0, 0, 0);\n/* 1073 */ d3 = calendar.getTime();\n/* 1074 */ if (d3.getTime() >= date.getTime()) {\n/* 1075 */ calendar.set(1, value - 1);\n/* 1076 */ d3 = calendar.getTime();\n/* */ } \n/* 1078 */ return d3;\n/* */ } \n/* 1080 */ return null;\n/* */ }", "public Timestamp getHC_WorkStartDate2();", "public static void before0(){\n Calendar class0 = Calendar.getInstance();\n class0.set(2019,1,2,3,4,5);\n Calendar when = Calendar.getInstance();\n when.set(2019,1,2,3,4,6);\n boolean ret0 = class0.before(when);\n assert(class0.get(Calendar.YEAR)==2019);\n assert(class0.get(Calendar.MONTH)==1);\n assert(class0.get(Calendar.DATE)==2);\n assert(class0.get(Calendar.HOUR_OF_DAY)==3);\n assert(class0.get(Calendar.MINUTE)==4);\n assert(class0.get(Calendar.SECOND)==5);\n assert(when.get(Calendar.YEAR)==2019);\n assert(when.get(Calendar.MONTH)==1);\n assert(when.get(Calendar.DATE)==2);\n assert(when.get(Calendar.HOUR_OF_DAY)==3);\n assert(when.get(Calendar.MINUTE)==4);\n assert(when.get(Calendar.SECOND)==6);\n assert(ret0==true);\n System.out.println(ret0);\n }", "@SuppressWarnings(\"static-access\")\n\tprivate void initData() {\n\t\tstartDate = startDate.now();\n\t\tendDate = endDate.now();\n\t}", "public java.util.Calendar getJobStartDate()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(JOBSTARTDATE$0, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getCalendarValue();\r\n }\r\n }", "public static Date createDate(int yyyy, int month, int day, int hour, int min) {\n/* 93 */ CALENDAR.clear();\n/* 94 */ CALENDAR.set(yyyy, month - 1, day, hour, min);\n/* 95 */ return CALENDAR.getTime();\n/* */ }", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "public java.util.Calendar getCreated()\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(CREATED$0, 0);\n if (target == null)\n {\n return null;\n }\n return target.getCalendarValue();\n }\n }", "private Date getDefaultCenturyStart() {\n\t\tif (defaultCenturyStart == null) {\n\t\t\t// not yet initialized\n\t\t\tinitializeDefaultCenturyStart(defaultCenturyBase);\n\t\t}\n\t\treturn defaultCenturyStart;\n\t}", "public Calendar getCurrentMonthCalendarObj() throws Throwable{\r\n\r\n\t\tString dateInput = \"01/\"+month+\"/\"+year;\t\t\t\r\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MMMM/yyyy\");\r\n\t\tDate startDate = df.parse(dateInput);\r\n\t\tCalendar c = Calendar.getInstance(); // this takes current date\r\n\t c.setTime(startDate); // set date to specified in arguement\r\n\t\treturn c;\r\n\t}", "public Date getStart() throws ServiceLocalException {\n\t\treturn (Date) this.getPropertyBag().getObjectFromPropertyDefinition(\n\t\t\t\tAppointmentSchema.Start);\n\t}", "public static Calendar getCalendar(Date date) {\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tif (date != null) {\r\n\t\t\tcal.setTime(date);\r\n\t\t} else {\r\n\t\t\tcal.setTime(new Date());\r\n\t\t}\r\n\t\treturn cal;\r\n\t}", "java.util.Calendar getSearchRecurrenceStart();", "public Timestamp getDateStart();", "private Integer getStandardStart(int startTime) \n {\n \tif (startTime % 1440 > 960) {\n \t\tstartTime += 1440;\n \t}\n \tint startOfDay = startTime - (startTime % 1440);\n \t//we need a standard variable to indicate the day of week;\n \t//standard day starts at 08:00 = 480 minutes and ends at 16:00 = 960 minutes\n \tcapacityEndTime = startOfDay + 960;\n \treturn startOfDay + 480;\n }", "private Calendar constructPrincipleSymptomsDate() {\n\t\tCalendar psd = null ;\n\n\t\t//\n\t\t// This is a painfully inefficient way of doing it.\n\t\t// Optimization can wait until later!\n\t\tString sEpiSymponset, sEpiSymponsetHour, sEpiSymponsetMin ;\n\t\tString sEpiSymponsetYear, sEpiSymponsetMonth ;\n\n\t\tsEpiSymponset = od2p.getValue( \"DataSubmissionQuestionnaire\", \"epi_symponset\" ) ;\n\t\tif( sEpiSymponset != null ) {\n\t\t\tsEpiSymponset = od2p.getCorrectedDateTimeValueFromString( sEpiSymponset ) ;\n\t\t\tsEpiSymponsetHour = od2p.getValue( \"DataSubmissionQuestionnaire\", \"epi_symponset_hour\" ) ;\n\t\t\tsEpiSymponsetMin = od2p.getValue( \"DataSubmissionQuestionnaire\", \"epi_symponset_min\" ) ;\n\n\t\t\tXmlDateTime dt = XmlDateTime.Factory.newInstance() ;\n\t\t\tdt.setStringValue( sEpiSymponset ) ;\n\t\t\tpsd = dt.getCalendarValue() ;\n\t\t\tif( sEpiSymponsetHour != null && sEpiSymponsetMin != null) {\n\t\t\t\tpsd.set( Calendar.HOUR_OF_DAY, Integer.valueOf( sEpiSymponsetHour ) ) ;\n\t\t\t\tpsd.set( Calendar.MINUTE, Integer.valueOf( sEpiSymponsetMin ) ) ;\n\t\t\t}\n\t\t\tlog.debug( \"Principle symptoms date. Route1. \" + psd.toString() ) ;\n\t\t\treturn psd ;\n\t\t}\n\t\tsEpiSymponsetYear = od2p.getValue( \"DataSubmissionQuestionnaire\", \"epi_symponset_year\" ) ;\n\t\tif( sEpiSymponsetYear != null ) {\n\t\t\tsEpiSymponsetMonth = od2p.getValue( \"DataSubmissionQuestionnaire\", \"epi_symponset_month\" ) ;\n\t\t\tpsd = Calendar.getInstance() ;\n\t\t\tpsd.setTimeInMillis( 0 ) ;\n\t\t\tpsd.set( Integer.valueOf( sEpiSymponsetYear ), Integer.valueOf( sEpiSymponsetMonth ), 1, 0, 0) ;\n\t\t\tlog.debug( \"Principle symptoms date. Route2. \" + psd.toString() ) ;\n\t\t\treturn psd ;\n\t\t}\n\t\tlog.debug( \"Principle symptoms date. Route3. \" + psd ) ;\n\t\treturn psd ;\t\n\t}", "public BwCalendar fetchBeforeCalendar() {\n return beforeCalendar;\n }", "@Test\n\tpublic void testTradeDateFrom0() {\n\n\t\tfinal DDF_TradeDay day = DDF_TradeDay.D15;\n\n\t\tfinal DateTime today = new DateTime(\"2012-01-18T10:39:44.647-06:00\");\n\n\t\tfinal TimeValue value = DDF_TradeDay.tradeDateFrom(day, today);\n\n\t\tfinal DateTime trade = value.asDateTime();\n\n\t\tlogger.debug(\"day=\" + day);\n\t\tlogger.debug(\"today=\" + today);\n\t\tlogger.debug(\"trade=\" + trade);\n\n\t\tassertEquals(trade.getYear(), 2012);\n\t\tassertEquals(trade.getMonthOfYear(), 01);\n\t\tassertEquals(trade.getDayOfMonth(), 15);\n\n\t}", "protected Date nextStandardDate(Date date, DateTickUnit unit) {\n/* 1122 */ Date previous = previousStandardDate(date, unit);\n/* 1123 */ Calendar calendar = Calendar.getInstance(this.timeZone, this.locale);\n/* 1124 */ calendar.setTime(previous);\n/* 1125 */ calendar.add(unit.getCalendarField(), unit.getMultiple());\n/* 1126 */ return calendar.getTime();\n/* */ }", "public GregorianCalendar getStart() {\n return _start;\n }", "private Date getPreviosDayStartTime() {\n\t\treturn null;\n\t}", "public Date getTimeEntryStartDate()\n throws RedmineException\n {\n // update number of time entries, start date\n updateTimeEntryData();\n\n return timeEntryStartDate;\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(System.currentTimeMillis()); // Quantos Milisegundos desde data 01/01/1970\n\t\t\n\t\t// Data Atual\n\t\tDate agora = new Date();\n\t\tSystem.out.println(\"Data Atual: \"+agora);\n\t\t\n\t\tDate data = new Date(1_000_000_000_000L);\n\t\tSystem.out.println(\"Data com 1.000.000.000.000ms: \"+data);\n\t\t\n\t\t// METODOS\n\t\tdata.getTime();\n\t\tdata.setTime(1_000_000_000_000L);\n\t\tSystem.out.println(data.compareTo(agora)); // -1 para anterior, 0 para igual, +1 para posterior\n\t\t\n\t\t// GregorianCalendar\n\t\tCalendar c = Calendar.getInstance();\n\t\tc.set(1980, Calendar.FEBRUARY, 12);\n\t\tSystem.out.println(c.getTime());\n\t\tSystem.out.println(c.get(Calendar.YEAR)); // Ano\n\t\tSystem.out.println(c.get(Calendar.MONTH)); // Mes 0 - 11\n\t\tSystem.out.println(c.get(Calendar.DAY_OF_MONTH)); // Dia do mes\n\t\t\n\t\tc.set(Calendar.YEAR,2016); // Altera o Ano\n\t\tc.set(Calendar.MONTH, 10); // Altera o Mes 0 - 11\n\t\tc.set(Calendar.DAY_OF_MONTH, 24); // Altera o Dia do mes\n\t\tSystem.out.println(c.getTime());\n\t\t\n\t\tc.clear(Calendar.MINUTE); // limpa minutos\n\t\tc.clear(Calendar.SECOND); // limpa segundos\n\t\tSystem.out.println(c.getTime());\n\t\t\n\t\tc.add(Calendar.DAY_OF_MONTH,1); // adiciona dias (avança o mes e ano)\n\t\tc.add(Calendar.YEAR,1); // adiciona o ano \n\t\tSystem.out.println(c.getTime());\n\t\t\n\t\tc.roll(Calendar.DAY_OF_MONTH,20); // adiciona dias (não avança o mes e ano)\n\t\tSystem.out.println(c.getTime());\n\t\t\n\t\t// Saudação com Bom dia, Boa arde ou Boa noite\n\t\tCalendar c1 = Calendar.getInstance();\n\t\tint hora = c1.get(Calendar.HOUR_OF_DAY);\n\t\tSystem.out.println(hora);\n\t\tif(hora <= 12){\n\t\t\tSystem.out.println(\"Bom Dia\");\n\t\t} else if(hora > 12 && hora < 18){\n\t\t\tSystem.out.println(\"Boa Tarde\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Boa Noite\");\n\t\t}\n\t\t\n\n\t}", "OffsetDateTime startDateTime();", "public static Calendar getCalender(Date date) {\n\n Calendar calendar = Calendar.getInstance();\n\n if (date != null) {\n long millis = date.getTime();\n calendar.setTimeInMillis(millis);\n }\n\n return calendar;\n }", "public org.drip.analytics.date.JulianDate firstCouponDate()\n\t{\n\t\ttry {\n\t\t\treturn new org.drip.analytics.date.JulianDate (_lsPeriod.get (0).endDate());\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}", "public static Date setToBeginningOfDay(Date date) {\n\t\t\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(date);\n\t\tcal.set(Calendar.HOUR_OF_DAY, 0);\n\t cal.set(Calendar.MINUTE, 0);\n\t cal.set(Calendar.SECOND, 0);\n\t cal.set(Calendar.MILLISECOND, 0);\n\t return cal.getTime();\n\t}", "public void get_fecha(){\n //Obtenemos la fecha\n Calendar c1 = Calendar.getInstance();\n fecha.setCalendar(c1);\n }", "public static void updateCalendar() {\n time = Calendar.getInstance();\n hour = time.get(Calendar.HOUR_OF_DAY);\n minute = time.get(Calendar.MINUTE);\n day = time.get(Calendar.DAY_OF_MONTH);\n month = time.get(Calendar.MONTH) + 1; \n year = time.get(Calendar.YEAR);\n\n }", "private Date init(InputStream ouiData) throws IOException {\n DataInputStream din = new DataInputStream(ouiData);\n Date result = new Date(din.readLong());\n while (din.available() > 0) {\n Oui oui = new Oui(din);\n _byHashCode.put(oui.hashCode(), oui);\n }\n return result;\n }", "private void initializeDate() {\n\t\tfinal Calendar c = Calendar.getInstance();\n\t\tmYear = c.get(Calendar.YEAR);\n\t\tmMonth = c.get(Calendar.MONTH);\n\t\tmDay = c.get(Calendar.DAY_OF_MONTH);\n\t\t\n\t\texpense.setDate(c.getTime());\n\n\t\t// display the current date\n\t\tupdateDateDisplay();\n\t}", "public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private Date getTestListingDateTimeStamp() {\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/London\"));\n\n GregorianCalendar calendar = new GregorianCalendar(2010, 0, 1, 17, 0);\n return new Date(calendar.getTimeInMillis());\n }", "private Date getSamoaNow() {\n\t\t// Get the current datetime in UTC\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(new Date());\n\t\t\n\t\t// Get the datetime minus 11 hours (Samoa is UTC-11)\n\t\tcalendar.add(Calendar.HOUR_OF_DAY, -11);\n\t\t\n\t\treturn calendar.getTime();\n\t}", "private Date getFrom(RuleTypes.HistoricRequirements ph) {\n Calendar date = new GregorianCalendar();\n date.set(Calendar.HOUR_OF_DAY, 0);\n date.set(Calendar.MINUTE, 0);\n date.set(Calendar.SECOND, 0);\n date.set(Calendar.MILLISECOND, 0);\n int today;\n\n switch(ph) {\n case TODAY:\n return date.getTime();\n case YESTERDAY:\n date.add(Calendar.DAY_OF_MONTH, -1);\n return date.getTime();\n case THIS_WEEK:\n today = date.get(Calendar.DAY_OF_WEEK);\n date.add(Calendar.DAY_OF_WEEK,-today+Calendar.MONDAY);\n return date.getTime();\n case LAST_WEEK:\n today = date.get(Calendar.DAY_OF_WEEK);\n date.add(Calendar.DAY_OF_WEEK,-today+Calendar.MONDAY);\n date.add(Calendar.DAY_OF_MONTH, -7);\n return date.getTime();\n case THIS_MONTH:\n date.set(Calendar.DAY_OF_MONTH, date.getActualMinimum(Calendar.DAY_OF_MONTH));\n return date.getTime();\n case LAST_MONTH:\n date.set(Calendar.DAY_OF_MONTH, date.getActualMinimum(Calendar.DAY_OF_MONTH));\n date.add(Calendar.MONTH, -1);\n return date.getTime();\n case T12_HRS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -12);\n return date.getTime();\n case T24_HRS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -24);\n return date.getTime();\n case T2_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -48);\n return date.getTime();\n case T3_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -72);\n return date.getTime();\n case T4_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -96);\n return date.getTime();\n case T5_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -120);\n return date.getTime();\n case T6_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -144);\n return date.getTime();\n case T7_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -168);\n return date.getTime();\n }\n return null;\n }", "public String getStartDttm() {\n\t\t\n\t\tif (this.predefinedPeriod.getType() == PredefinedPeriodType.YEAR) {\n\t\t\treturn String.format(\"%04d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.YEAR)) + \"-01-01 00:00:00.000\"; \n\t\t} else if (this.predefinedPeriod.getType() == PredefinedPeriodType.MONTH) {\n\t\t\treturn String.format(\"%04d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.YEAR)) + \"-\" + \n\t\t\t\t\t String.format(\"%02d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.MONTH) + 1) + \"-01 00:00:00.000\";\n\t\t} else if (this.predefinedPeriod.getType() == PredefinedPeriodType.DAY) {\n\t\t\treturn String.format(\"%04d\", this.predefinedPeriod.getCalendarFrom().get(Calendar.YEAR)) + \"-\" + \n\t\t\t\t\t String.format(\"%02d\", this.predefinedPeriod.getCalendarFrom().get(Calendar.MONTH) + 1) + \n\t\t\t\t\t String.format(\"%02d\", this.predefinedPeriod.getCalendarFrom().get(Calendar.DAY_OF_MONTH)) + \" 00:00:00.000\";\n\t\t\t\n\t\t} else if (this.predefinedPeriod.getType() == PredefinedPeriodType.HOUR) {\n\t\t\treturn String.format(\"%04d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.YEAR)) + \"-\" + \n\t\t\t\t\t String.format(\"%02d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.MONTH) + 1) + \"-\" +\n\t\t\t\t\t String.format(\"%02d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.DAY_OF_MONTH)) + \" \" + \n\t\t\t\t\t String.format(\"%02d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.HOUR_OF_DAY)) + \":00:00.000\";\n\t\t\t\n\t\t} else if (this.predefinedPeriod.getType() == PredefinedPeriodType.INT_LT_HOUR) {\n\t\t\treturn String.format(\"%04d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.YEAR)) + \"-\" + \n\t\t\t\t\t String.format(\"%02d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.MONTH) + 1) + \"-\" + \n\t\t\t\t\t String.format(\"%02d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.DAY_OF_MONTH)) + \" \" + \n\t\t\t\t\t String.format(\"%02d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.HOUR_OF_DAY)) + \":\" + \n\t\t\t\t\t String.format(\"%02d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.MINUTE)) + \":\" +\n\t\t\t\t\t String.format(\"%02d\",this.predefinedPeriod.getCalendarFrom().get(Calendar.SECOND)) + \".000\";\n\n\t\t} \n\t\t\n\t\treturn null;\n\t}", "public static Date todayStart() {\n return dayStart(new Date());\n }", "public DefaultScheduleEvent getEventosCalendario(DateTime data, Servico servico) throws NullPointerException {\n\t\tList<ServicoJanelaAtendimento> servicoJanelaAtendimentos = new ArrayList<>();\n\t\tList<SolicitacaoServico> solicitacaoServicos = new ArrayList<>();\n\t\t\n\t\t\n\t\t\n\t\tgetServicoJanelaAtendimentoDAO().beginTransaction();\n\t\tservicoJanelaAtendimentos = getServicoJanelaAtendimentoDAO().getServicoJanelaPorDataJanela(data.toDate(), servico);\n\t\tgetServicoJanelaAtendimentoDAO().closeTransaction();\n\t\t\n\t\tDefaultScheduleEvent defaultScheduleEvent= new DefaultScheduleEvent();\n\t\tdefaultScheduleEvent.setAllDay(true);\n\t\tdefaultScheduleEvent.setData(data.toDate());\n\t\tdefaultScheduleEvent.setStartDate(data.toDate());\n\t\tdefaultScheduleEvent.setEndDate(data.plusHours(20).toDate());\n\t\t\n\t\t\n\t\tif(!servicoJanelaAtendimentos.isEmpty()) {\n\t\t\t\n\t\t\t\n\t\t\tgetSolicitacaoServicoDAO().beginTransaction();\n\t\t\tsolicitacaoServicos = getSolicitacaoServicoDAO().getSolicitacoesPorDataeServico(data.toDate(), servico);\n\t\t\tgetSolicitacaoServicoDAO().closeTransaction();\n\t\t\t\n\t\t\tint janelaServico = 0;\n\t\t\tint janelaSolicitacao = 0;\n\t\t\t\tfor(ServicoJanelaAtendimento servicoJanelaAtendimento: servicoJanelaAtendimentos) {\n\t\t\t\t\tjanelaServico = janelaServico + servicoJanelaAtendimento.getCapacidadePeriodo();\n\t\t\t\t}\n\t\t\t\tjanelaSolicitacao = solicitacaoServicos.size();\n\t\t\tint disponivel = janelaServico-janelaSolicitacao;\n\t\t\tif(disponivel > 0) {\n\t\t\t\tdefaultScheduleEvent.setTitle(\"Disponível\");\n\t\t\t\tdefaultScheduleEvent.setStyleClass(\"green\");\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\tdefaultScheduleEvent.setTitle(\"Encaixe\");\n\t\t\t\tdefaultScheduleEvent.setStyleClass(\"red\");\n\t\t\t\t\n\t\t\t}\n\t\t}else {\n\t\tdefaultScheduleEvent.setTitle(\"Não Disponível\");\n\t\tdefaultScheduleEvent.setStyleClass(\"no-color\");\n\t\t}\n\t\t\n\t\treturn defaultScheduleEvent;\n\t}", "public Date calculateLowestVisibleTickValue(DateTickUnit unit) { return nextStandardDate(getMinimumDate(), unit); }", "@SuppressWarnings(\"deprecation\")\r\n\tprivate void createCalendarEntry(){\r\n\t\t\r\n\t\tUri calendars = Uri.parse(CALENDAR_URI);\r\n\t\t \r\n\t\tCursor managedCursor = managedQuery(calendars, projection, null, null, null);\r\n\t\tString calName = \"\"; \r\n\t\tString calId = \"\"; \r\n\t\tif (managedCursor.moveToFirst()) {\r\n\t\t\t \r\n\t\t\t int idColumn = managedCursor.getColumnIndex(projection[0]);\r\n\t\t\t int nameColumn = managedCursor.getColumnIndex(projection[1]); \r\n\t\t\t \r\n\t\t\t do {\r\n\t\t\t calName = managedCursor.getString(nameColumn);\r\n\t\t\t calId = managedCursor.getString(idColumn);\r\n\t\t\t if (calName.contains(\"gmail\"))\r\n\t\t\t \tbreak;\r\n\t\t\t } while (managedCursor.moveToNext());\r\n\t }\r\n\t\t\r\n\t\tlong start = System.currentTimeMillis() + 120000;\r\n\t\tlong duration = DURATION + start;\r\n\t\t\r\n\t\tContentValues values = new ContentValues();\r\n\t\tvalues.put(DATE_START, start);\r\n\t\tvalues.put(DATE_END, duration);\r\n\t\tvalues.put(EVENT_TITLE, ocrData.getMedicine().getMedicine());\r\n\t\tvalues.put(EVENT_DESCRIPTION, \"Take \" + ocrData.getPatient2Medicine().getFrequencyOfIntake() \r\n\t\t\t\t+ \" by \" + ocrData.getPatient2Medicine().getMode());\r\n\t\tvalues.put(CALENDAR_ID, calId);\r\n\t\tvalues.put(EVENT_RULE, \"FREQ=\" + ocrData.getPatient2Medicine().getFrequencyOfIntake() + \";\");\r\n\t\tvalues.put(HAS_ALARM, 1);\r\n\t\t\r\n\t\tContentResolver cr = getContentResolver();\r\n\t\tUri event = cr.insert(Uri.parse(EVENT_URI), values);\r\n\t\t\r\n\t\tvalues = new ContentValues();\r\n\t\tvalues.put(\"event_id\", Long.parseLong(event.getLastPathSegment()));\r\n\t\tvalues.put(\"method\", 1);\r\n\t\tvalues.put(\"minutes\", 10 );\r\n\t\tcr.insert(Uri.parse(REMINDER_URI), values);\r\n\t}", "private void initiateProject() {\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yyyy\", Locale.getDefault());\n\n Date startDay = null;\n Date deadlineMinPace = null;\n Date deadlineMaxPace = null;\n\n try {\n startDay = dateFormat.parse(\"21-08-2018\");\n deadlineMinPace = dateFormat.parse(\"27-08-2018\");\n deadlineMaxPace = dateFormat.parse(\"25-08-2018\");\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n if (startDay != null && deadlineMinPace != null && deadlineMaxPace != null) {\n\n smp = new SmartProject(\"Test project\", \"Test project description\",\n 35, startDay, deadlineMinPace, deadlineMaxPace);\n\n System.out.println(\"===>>>\" + smp.toString());\n\n } else {\n System.out.println(\"===>>> Some date are null!\");\n }\n\n /*\n // *** print block ***\n smp.printEntries();\n\n for (float f : smp.getYAxisChartValuesMinPace()) {\n System.out.println(f);\n }\n\n for (float f : smp.getYAxisChartValuesMaxPace()) {\n System.out.println(f);\n }\n\n for (float f : smp.getFloatNumbersForXAxis()) {\n System.out.println(f);\n }\n */\n\n }", "public Date getEarliestFinishingDate();", "public Calendar getCurrentCalendar()\n {\n return this.currentCalendar;\n }", "public String[] getStarDate2(){\n\t\tstardate = new String[3];\n\t\t\n\t\tCalendar originaldate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\tCalendar instancedate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\t\t\t\n\t\t//originaldate.set(2008, 8, 8, 0, 0, 0);\n\t\toriginaldate.set(2162, 0, 4, 0, 0, 0);\n\t\t\n\t\t/*instancedate.add(Calendar.HOUR, 7);\n\t\tinstancedate.add(Calendar.MINUTE, 33);\n\t\tinstancedate.add(Calendar.YEAR, 156);\n\t\tinstancedate.add(Calendar.HOUR, -6*24);\n\t\tinstancedate.add(Calendar.MONTH, -3);*/\n\t\t\n\t\t\n\t\t// Get the represented date in milliseconds\n\t\tlong milis1 = originaldate.getTimeInMillis();\n\t\tlong milis2 = instancedate.getTimeInMillis();\n\t\t\n\t\t// Calculate difference in milliseconds\n\t\tlong diff = milis2 - milis1;\n\t\t \n\t\t// Calculate difference in seconds\n\t\tlong diffSeconds = diff / 1000;\n\t\t \n\t\t// Calculate difference in minutes\n\t\t//long diffMinutes = diff / (60 * 1000);\n\t\t\n\t\t// Calculate difference in hours\n\t\t//long diffHours = diff / (60 * 60 * 1000);\n\t\t\n\t\t// Calculate difference in days\n\t\t//long diffDays = diff / (24 * 60 * 60 * 1000);\n\t\t\n\t\t//double dec = -280000 - ((double)diffSeconds / 17280.0f);\n\t\tdouble dec = ((double)diffSeconds / 17280.0f);\n\t\t\t\t\n\t\tint mantel = (int)Math.ceil(dec/10000.0f);\n\t\t\t\t\n\t\tdouble kropp = (dec + (-(mantel-1)*10000.0f));\n\t\t\n\t\tif(kropp >= 10000) mantel += 2; //Fixing rounding error\n\t\t\n\t\tdouble mantelkropp = ((mantel-1) * 10000.0f) - kropp;\n\t\t\n\t\t/*Log.v(TAG, \"Diff: \" + Long.toString(diff));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(dec));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Integer.toString(mantel));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(kropp));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(mantelkropp));*/\n\t\t\n\t\tdec = mantelkropp;\n\t\t\n\t\tDecimalFormat maxDigitsFormatter;\n\t\tif(dec < 0)\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"#000000.0000\");\n\t\telse\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"0000000.0000\");\n \n try {\n\t stardate[0] = \"[\" + (maxDigitsFormatter.format(dec)).substring(0, 3) + \"]\";\n\t stardate[1] = \" 0\" + (maxDigitsFormatter.format(dec)).substring(3, 9);\n\t stardate[2] = \"\" + (maxDigitsFormatter.format(dec)).substring(9, 11);\n } catch(StringIndexOutOfBoundsException sbe) {\n \tif(DEBUG) Log.v(TAG, \"Could not format \" + sbe);\n \tif(DEBUG) Log.v(TAG, maxDigitsFormatter.format(dec));\n \tstardate[2] = \"--\"; \t \n }\n \n Log.v(TAG, \"Stardate: \" + stardate[0] + stardate[1] + stardate[2]);\n return stardate;\n\t\t\n\t}", "public Date getCurrentWeekStart() {\n Calendar cal = Calendar.getInstance();\n cal.set(Calendar.HOUR_OF_DAY, 0); // ! clear would not reset the hour of day !\n cal.clear(Calendar.MINUTE);\n cal.clear(Calendar.SECOND);\n cal.clear(Calendar.MILLISECOND);\n\n cal.setFirstDayOfWeek(Calendar.MONDAY);\n cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek());\n\n Date currentWeekStart = cal.getTime();\n\n return currentWeekStart;\n }", "org.apache.xmlbeans.XmlDateTime xgetSearchRecurrenceStart();", "public static long getStartOfDay(long time) {\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(time);\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar.getTimeInMillis();\n }", "public static Date getStartTimeToDate(final Date date) {\n final Calendar calendar = Calendar.getInstance();\n calendar.setTime(date);\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.SECOND, 0);\n return calendar.getTime();\n }", "public Calendar calendario(Date date) {\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(date);\r\n return calendar;\r\n }", "public Timestamp getDateStartSchedule() {\n\t\treturn (Timestamp) get_Value(\"DateStartSchedule\");\n\t}", "public IUTCTime getFirstTime() {\n if (null == firstTime) {\n return new UTCTime(0);\n }\n return firstTime;\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tgetLayouts();\n\n\t\t\t\tCalendar pre = (Calendar) calendar.clone();\n\n\t\t\t\tcurrentMonth--;\n\n\t\t\t\tif (currentMonth == 0) {\n\t\t\t\t\tcurrentMonth = 12;\n\t\t\t\t\tcurrentYear--;\n\t\t\t\t}\n\t\t\t\tpre.set(Calendar.MONTH, currentMonth);\n\t\t\t\tpre.set(Calendar.YEAR, currentYear);\n\t\t\t\tpre.set(Calendar.DATE, 1);\n\n\t\t\t\tpositionPre = pre.getTime().toString().split(\" \");\n\t\t\t\tpreviousDayPosition = ReturnCalendarDetails\n\t\t\t\t\t\t.getPosition(positionPre[0]);\n\n\t\t\t\tgetCalendar(\n\t\t\t\t\t\tReturnCalendarDetails.getCurrentMonth(positionPre[1]),\n\t\t\t\t\t\tReturnCalendarDetails.getPosition(positionPre[0]),\n\t\t\t\t\t\tInteger.parseInt(positionPre[5]));\n\n\t\t\t\tSystem.out.println(\"!!\" + pre.getTime());\n\t\t\t}", "String getStockData(String symbol) throws Exception\n\t{\n\t\tfinal String urlHalf1 = \"https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=\";\n\t\tfinal String urlHalf2 = \"&apikey=\";\n\t\tfinal String apiKey = \"FKS0EU9E4K4UQDXI\";\n\n\t\tString url = urlHalf1 + symbol + urlHalf2 + apiKey;\n\n\t\tJsonParser parser = new JsonParser();\n\n\t\tString hitUrl = url;\n\t\tString jsonData = getJsonData(hitUrl);\n\n\t\tJsonElement jsonTree = parser.parse(jsonData);\n\n\t\tString returnData = \"\";\n\n\t\tif (jsonTree.isJsonObject())\n\t\t{\n\t\t\tJsonObject jsonObject = jsonTree.getAsJsonObject();\n\n\t\t\tJsonElement timeSeries = jsonObject.get(\"Time Series (Daily)\");\n\n\t\t\tif (timeSeries.isJsonObject())\n\t\t\t{\n\t\t\t\tJsonObject timeObject = timeSeries.getAsJsonObject();\n\n\t\t\t\tDate date = new Date();\n\n\t\t\t\tCalendar calendar = new GregorianCalendar();\n\t\t\t\tcalendar.setTime(date);\n\n\t\t\t\t// Loop until we reach most recent Friday (market closes on Friday)\n\t\t\t\twhile (calendar.get(Calendar.DAY_OF_WEEK) < Calendar.FRIDAY\n\t\t\t\t\t\t|| calendar.get(Calendar.DAY_OF_WEEK) > Calendar.FRIDAY)\n\t\t\t\t{\n\t\t\t\t\tcalendar.add(Calendar.DAY_OF_MONTH, -1);\n\t\t\t\t}\n\n\t\t\t\tint year = calendar.get(Calendar.YEAR);\n\t\t\t\tint month = calendar.get(Calendar.MONTH) + 1;\n\t\t\t\tint day = calendar.get(Calendar.DAY_OF_MONTH);\n\n\t\t\t\tString dayToString = Integer.toString(day);\n\n\t\t\t\tif (dayToString.length() == 1)\n\t\t\t\t\tdayToString = \"0\" + dayToString;\n\n\t\t\t\tJsonElement currentData = timeObject.get(year + \"-\" + month + \"-\" + dayToString);\n\n\t\t\t\tif (currentData.isJsonObject())\n\t\t\t\t{\n\t\t\t\t\tJsonObject dataObject = currentData.getAsJsonObject();\n\n\t\t\t\t\tJsonElement openPrice = dataObject.get(\"1. open\");\n\t\t\t\t\tJsonElement closePrice = dataObject.get(\"4. close\");\n\t\t\t\t\tJsonElement highPrice = dataObject.get(\"2. high\");\n\t\t\t\t\tJsonElement lowPrice = dataObject.get(\"3. low\");\n\n\t\t\t\t\treturnData = year + \"-\" + month + \"-\" + dayToString + \" - \" + symbol + \": Opening price: $\"\n\t\t\t\t\t\t\t+ openPrice.getAsString() + \" / Closing price: $\" + closePrice.getAsString()\n\t\t\t\t\t\t\t+ \" / High price: $\" + highPrice.getAsString() + \" / Low price: $\" + lowPrice.getAsString();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn returnData;\n\t}", "public Date getActualStart()\r\n {\r\n return (m_actualStart);\r\n }", "public Date getStart() {\n return (Date) _start.clone();\n }", "public Calendar getStartTime() {\r\n\t\treturn startTime;\r\n\t}", "public Date getCurrentDate() {\n Calendar cal = Calendar.getInstance();\n cal.set(Calendar.HOUR_OF_DAY, 0); // ! clear would not reset the hour of day !\n cal.clear(Calendar.MINUTE);\n cal.clear(Calendar.SECOND);\n cal.clear(Calendar.MILLISECOND);\n\n Date currentDate = cal.getTime();\n return currentDate;\n }", "Date getStartDay();", "public GregorianCalendar getCalendar() {\r\n return new GregorianCalendar(this.year, this.month - 1, this.day);\r\n }", "Calendar registeredAt();", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "public Candle(ZonedStockDateTime pBeginning, final double pLow,\r\n final double pHigh, final double pOpen, final double pClose) {\r\n beginning = pBeginning;\r\n low = pLow;\r\n high = pHigh;\r\n open = pOpen;\r\n close = pClose;\r\n }", "org.apache.xmlbeans.XmlDateTime xgetStartTime();", "private Date calendarToDate(Calendar calendar) {\n return (Date) calendar.getTime();\n }" ]
[ "0.59976166", "0.599486", "0.59168035", "0.58145493", "0.5671935", "0.5646885", "0.56310344", "0.5474914", "0.54403806", "0.5392866", "0.53376377", "0.53219366", "0.5282867", "0.52453756", "0.5243018", "0.52387434", "0.52047884", "0.5202352", "0.5147413", "0.5147098", "0.5089298", "0.50806916", "0.506553", "0.50640374", "0.5059318", "0.5056928", "0.50394946", "0.50223845", "0.50083095", "0.5003416", "0.49843505", "0.49766824", "0.49764612", "0.49709833", "0.49410176", "0.4921602", "0.4918205", "0.4910616", "0.48991036", "0.4895245", "0.4884915", "0.48811153", "0.48747578", "0.48547912", "0.48488235", "0.48430583", "0.48408931", "0.48395067", "0.4838782", "0.48342967", "0.48268983", "0.48121437", "0.48064566", "0.48062974", "0.48051873", "0.48051137", "0.48019114", "0.4792277", "0.47889695", "0.47874698", "0.47849348", "0.4782591", "0.47825077", "0.4766834", "0.47662878", "0.47632736", "0.47484493", "0.47482526", "0.47467187", "0.47453645", "0.47407556", "0.47340995", "0.4732831", "0.4717261", "0.47065535", "0.47036344", "0.47001952", "0.46928293", "0.46862122", "0.468124", "0.46807617", "0.46718183", "0.46706957", "0.4670271", "0.46656284", "0.46600375", "0.46581933", "0.46577737", "0.46497235", "0.46479088", "0.4645378", "0.4643069", "0.46412238", "0.46338356", "0.46154627", "0.46154281", "0.46007228", "0.45950726", "0.4585554", "0.45826504" ]
0.6135886
0
Given any data point this function will construct a Java Calendar initialised to the data and time the stock market would have opened on the day the data point relates to.
public static Calendar getExchOpeningTimeFromPoint(AbstractGraphPoint aPoint) { Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); result.setTimeInMillis(aPoint.getTimestamp()); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public StockDate GetCalendar()\r\n\t{\r\n\t\treturn date;\r\n\t}", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "public void setupCalendar() { \n\t\tcal = whenIsIt();\n\t\tLocale here = Locale.US;\n\t\tthisMonth = cal.getDisplayName(2, Calendar.LONG_STANDALONE, here);\n\t\tdate = cal.get(5); //lesson learned: if it's a number do this\n\t\t//ADD CODE FOR ORDINALS HERE\n\t\tyear = cal.get(1);\n\t\tthisHour = cal.get(10);\n\t\tthisMinute = cal.get(12);\n\t\tthisSecond = cal.get(13);\n\t\tamPm = cal.getDisplayName(9, Calendar.SHORT, here);\n\t\tthisDay = thisMonth +\" \"+ addOrdinal(date) + \", \" + year;\n\t\tcurrentTime = fix.format(thisHour) + \":\" + fix.format(thisMinute) + \":\" + fix.format(thisSecond) + \" \" + amPm;\n\t}", "public static Date getData(Date data) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\r\n\t\tcalendar.setTime(data);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\tcalendar.set(Calendar.MILLISECOND, 0);\r\n\r\n\t\treturn calendar.getTime();\r\n\t}", "public abstract Date computeFirstFireTime(Calendar calendar);", "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public void getDateEvents(Connection connection, StoreData data){\n\t\t//The following code is used to prepare a sql statement to get all the events\n\t\tdata.resetSingle();\n\t\tPreparedStatement preStmt=null;\n\t\tString stmt = \"SELECT * FROM Event\";\n\t\t//prepares the date given to this method to be used to get the correct events \n\t\tString passedDate = data.getDate();\n\t\tSimpleDateFormat displayDate = new SimpleDateFormat(\"MM-dd-yyyy\");\n\t\tSimpleDateFormat dbDate = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tSimpleDateFormat theDay = new SimpleDateFormat(\"dd\");\n\t\tSimpleDateFormat month = new SimpleDateFormat(\"MM\");\n\t\tSimpleDateFormat year = new SimpleDateFormat(\"yyyy\");\n\t\tString formatSDate = null;\n\t\tString formatEDate = null;\n\t\tString sMonth = null;\n\t\tString eMonth = null;\n\t\tString sDay = null;\n\t\tString eDay = null;\n\t\tString curDay = null;\n\t\tString curMonth = null;\n\t\tint startD = 0;\n\t\tint endD = 0;\n\t\tint curD = 0;\n\t\tint startM = 0;\n\t\tint curM = 0;\n\t\tint endM = 0;\n\t\t\n\t\t//This try catch block is used to get the events that are returned based on\n\t\t//the dates that the event has\n\t\ttry{\n\t\t\tpreStmt = (PreparedStatement) connection.prepareStatement(stmt);\n\t\t\tResultSet rs = preStmt.executeQuery();\n\t\t\tStoreData newDay;\n\t\t\t//loops through all of the events storing the ones that have the matching dates\n\t\t\twhile(rs.next()){\n\t\t\t\tnewDay = new StoreData();\n\t\t\t\tString name = rs.getString(\"Name\");\n\t\t\t\tString description = rs.getString(\"Description\");\n\t\t\t\tString location = rs.getString(\"Location\");\n\t\t\t\tString date = rs.getString(\"Start_Date\");\n\t\t\t\tString endDate = rs.getString(\"End_Date\");\n\t\t\t\t//This try catch formats the dates to be used to check to see if they are correct\n\t\t\t\ttry {\n\n\t\t\t\t\tformatSDate = displayDate.format(dbDate.parse(date));\n\t\t\t\t\tformatEDate = displayDate.format(dbDate.parse(endDate));\n\t\t\t\t\tsDay = theDay.format(dbDate.parse(date));\n\t\t\t\t\teDay = theDay.format(dbDate.parse(endDate));\n\t\t\t\t\tcurDay = theDay.format(displayDate.parse(passedDate));\n\t\t\t\t\tsMonth = month.format(dbDate.parse(date));\n\t\t\t\t\teMonth = month.format(dbDate.parse(endDate));\n\t\t\t\t\tcurMonth = month.format(displayDate.parse(passedDate));\n\t\t\t\t\tstartD = Integer.parseInt(sDay);\n\t\t\t\t\tendD = Integer.parseInt(eDay);\n\t\t\t\t\tcurD = Integer.parseInt(curDay);\n\t\t\t\t\tstartM = Integer.parseInt(sMonth);\n\t\t\t\t\tcurM = Integer.parseInt(curMonth);\n\t\t\t\t\tendM = Integer.parseInt(eMonth);\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tString sTime = rs.getString(\"Start_Time\");\n\t\t\t\tString eTime = rs.getString(\"End_Time\");\n\t\t\t\tnewDay.setName(name);\n\t\t\t\tnewDay.setDescription(description);\n\t\t\t\tnewDay.setLocation(location);\n\t\t\t\tnewDay.setDate(date);\n\t\t\t\tnewDay.setEndDate(endDate);\n\t\t\t\tnewDay.setSTime(sTime);\n\t\t\t\tnewDay.setETime(eTime);\n\t\t\t\t//stores the events that match the date that was given\n\t\t\t\tif(curD >= startD && curD <= endD && curM == startM){\n\t\t\t\t\tdata.addDayEvent(newDay);\n\t\t\t\t}else if(startM < curM && curM == endM && curD <= endD){\n\t\t\t\t\tdata.addDayEvent(newDay);\n\t\t\t\t}else if(curD < startD || curD > endD){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"Man you got problems now\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@SuppressWarnings(\"static-access\")\n\tprivate void initData() {\n\t\tstartDate = startDate.now();\n\t\tendDate = endDate.now();\n\t}", "public Calendar startOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE));\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public static void updateCalendar() {\n time = Calendar.getInstance();\n hour = time.get(Calendar.HOUR_OF_DAY);\n minute = time.get(Calendar.MINUTE);\n day = time.get(Calendar.DAY_OF_MONTH);\n month = time.get(Calendar.MONTH) + 1; \n year = time.get(Calendar.YEAR);\n\n }", "Calendar getCalendar();", "public static void main(String[] args) {\n\t\tSystem.out.println(System.currentTimeMillis()); // Quantos Milisegundos desde data 01/01/1970\n\t\t\n\t\t// Data Atual\n\t\tDate agora = new Date();\n\t\tSystem.out.println(\"Data Atual: \"+agora);\n\t\t\n\t\tDate data = new Date(1_000_000_000_000L);\n\t\tSystem.out.println(\"Data com 1.000.000.000.000ms: \"+data);\n\t\t\n\t\t// METODOS\n\t\tdata.getTime();\n\t\tdata.setTime(1_000_000_000_000L);\n\t\tSystem.out.println(data.compareTo(agora)); // -1 para anterior, 0 para igual, +1 para posterior\n\t\t\n\t\t// GregorianCalendar\n\t\tCalendar c = Calendar.getInstance();\n\t\tc.set(1980, Calendar.FEBRUARY, 12);\n\t\tSystem.out.println(c.getTime());\n\t\tSystem.out.println(c.get(Calendar.YEAR)); // Ano\n\t\tSystem.out.println(c.get(Calendar.MONTH)); // Mes 0 - 11\n\t\tSystem.out.println(c.get(Calendar.DAY_OF_MONTH)); // Dia do mes\n\t\t\n\t\tc.set(Calendar.YEAR,2016); // Altera o Ano\n\t\tc.set(Calendar.MONTH, 10); // Altera o Mes 0 - 11\n\t\tc.set(Calendar.DAY_OF_MONTH, 24); // Altera o Dia do mes\n\t\tSystem.out.println(c.getTime());\n\t\t\n\t\tc.clear(Calendar.MINUTE); // limpa minutos\n\t\tc.clear(Calendar.SECOND); // limpa segundos\n\t\tSystem.out.println(c.getTime());\n\t\t\n\t\tc.add(Calendar.DAY_OF_MONTH,1); // adiciona dias (avança o mes e ano)\n\t\tc.add(Calendar.YEAR,1); // adiciona o ano \n\t\tSystem.out.println(c.getTime());\n\t\t\n\t\tc.roll(Calendar.DAY_OF_MONTH,20); // adiciona dias (não avança o mes e ano)\n\t\tSystem.out.println(c.getTime());\n\t\t\n\t\t// Saudação com Bom dia, Boa arde ou Boa noite\n\t\tCalendar c1 = Calendar.getInstance();\n\t\tint hora = c1.get(Calendar.HOUR_OF_DAY);\n\t\tSystem.out.println(hora);\n\t\tif(hora <= 12){\n\t\t\tSystem.out.println(\"Bom Dia\");\n\t\t} else if(hora > 12 && hora < 18){\n\t\t\tSystem.out.println(\"Boa Tarde\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Boa Noite\");\n\t\t}\n\t\t\n\n\t}", "Calendar getTimeStamp();", "private Date getTestListingDateTimeStamp() {\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/London\"));\n\n GregorianCalendar calendar = new GregorianCalendar(2010, 0, 1, 17, 0);\n return new Date(calendar.getTimeInMillis());\n }", "public static Calendar getExchOpeningTime() {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n return result;\r\n }", "private void initializeDate() {\n\t\tfinal Calendar c = Calendar.getInstance();\n\t\tmYear = c.get(Calendar.YEAR);\n\t\tmMonth = c.get(Calendar.MONTH);\n\t\tmDay = c.get(Calendar.DAY_OF_MONTH);\n\t\t\n\t\texpense.setDate(c.getTime());\n\n\t\t// display the current date\n\t\tupdateDateDisplay();\n\t}", "Calendar occurredAt();", "public static Calendar getExchOpeningTimeFromGraph(BaseGraph<AbstractGraphPoint> graph) {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n if (null != graph && 0 < graph.size()) {\r\n AbstractGraphPoint first = graph.first();\r\n result.setTimeInMillis(first.getTimestamp());\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n }\r\n return result;\r\n }", "public static Calendar getExchOpeningCalendar(Calendar aDate) {\r\n Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE);\r\n if (null != aDate) {\r\n result.setTimeInMillis(aDate.getTimeInMillis());\r\n result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n result.set(Calendar.MILLISECOND, 0);\r\n }\r\n return result;\r\n }", "public static Date createDate(int yyyy, int month, int day) {\n/* 75 */ CALENDAR.clear();\n/* 76 */ CALENDAR.set(yyyy, month - 1, day);\n/* 77 */ return CALENDAR.getTime();\n/* */ }", "public void initCalendarFirst() {\n getCurrentDate();\n mCalendar.setOnDateChangedListener(new OnDateSelectedListener() {\n @Override\n public void onDateSelected(@NonNull MaterialCalendarView widget, @NonNull CalendarDay select, boolean selected) {\n mSelectedDate = select.toString();\n String string[] = mSelectedDate.split(\"\\\\{|\\\\}\");\n String s = string[1]; //2017-8-14\n String string1[] = s.split(\"-\");\n int tempMonth = Integer.parseInt(string1[1]);\n String month = Integer.toString(tempMonth + 1);\n mDate1 = string1[0] + \"-\" + month + \"-\" + string1[2];\n }\n });\n }", "Calendar getArrivalDateAndTime();", "@SuppressWarnings(\"deprecation\")\r\n\tprivate void createCalendarEntry(){\r\n\t\t\r\n\t\tUri calendars = Uri.parse(CALENDAR_URI);\r\n\t\t \r\n\t\tCursor managedCursor = managedQuery(calendars, projection, null, null, null);\r\n\t\tString calName = \"\"; \r\n\t\tString calId = \"\"; \r\n\t\tif (managedCursor.moveToFirst()) {\r\n\t\t\t \r\n\t\t\t int idColumn = managedCursor.getColumnIndex(projection[0]);\r\n\t\t\t int nameColumn = managedCursor.getColumnIndex(projection[1]); \r\n\t\t\t \r\n\t\t\t do {\r\n\t\t\t calName = managedCursor.getString(nameColumn);\r\n\t\t\t calId = managedCursor.getString(idColumn);\r\n\t\t\t if (calName.contains(\"gmail\"))\r\n\t\t\t \tbreak;\r\n\t\t\t } while (managedCursor.moveToNext());\r\n\t }\r\n\t\t\r\n\t\tlong start = System.currentTimeMillis() + 120000;\r\n\t\tlong duration = DURATION + start;\r\n\t\t\r\n\t\tContentValues values = new ContentValues();\r\n\t\tvalues.put(DATE_START, start);\r\n\t\tvalues.put(DATE_END, duration);\r\n\t\tvalues.put(EVENT_TITLE, ocrData.getMedicine().getMedicine());\r\n\t\tvalues.put(EVENT_DESCRIPTION, \"Take \" + ocrData.getPatient2Medicine().getFrequencyOfIntake() \r\n\t\t\t\t+ \" by \" + ocrData.getPatient2Medicine().getMode());\r\n\t\tvalues.put(CALENDAR_ID, calId);\r\n\t\tvalues.put(EVENT_RULE, \"FREQ=\" + ocrData.getPatient2Medicine().getFrequencyOfIntake() + \";\");\r\n\t\tvalues.put(HAS_ALARM, 1);\r\n\t\t\r\n\t\tContentResolver cr = getContentResolver();\r\n\t\tUri event = cr.insert(Uri.parse(EVENT_URI), values);\r\n\t\t\r\n\t\tvalues = new ContentValues();\r\n\t\tvalues.put(\"event_id\", Long.parseLong(event.getLastPathSegment()));\r\n\t\tvalues.put(\"method\", 1);\r\n\t\tvalues.put(\"minutes\", 10 );\r\n\t\tcr.insert(Uri.parse(REMINDER_URI), values);\r\n\t}", "public static Date createDate(int yyyy, int month, int day, int hour, int min) {\n/* 93 */ CALENDAR.clear();\n/* 94 */ CALENDAR.set(yyyy, month - 1, day, hour, min);\n/* 95 */ return CALENDAR.getTime();\n/* */ }", "@Test\n public void getterCalendar(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n Assert.assertEquals(2018,calendar.getYear());\n Assert.assertEquals(4,calendar.getMonth());\n Assert.assertEquals(25,calendar.getDayOfMonth());\n }", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute) {\r\n\t\tCalendar calendar = createCalendar(year, month, date);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, hour);\r\n\t\tcalendar.set(Calendar.MINUTE, minute);\r\n\t\treturn calendar;\r\n\t}", "abstract GregorianCalendar getThreadLocalCalendar();", "private Date calculateDateForPosition(RegularTimePeriod period, DateTickMarkPosition position) {\n/* 1097 */ ParamChecks.nullNotPermitted(period, \"period\");\n/* 1098 */ Date result = null;\n/* 1099 */ if (position == DateTickMarkPosition.START) {\n/* 1100 */ result = new Date(period.getFirstMillisecond());\n/* */ }\n/* 1102 */ else if (position == DateTickMarkPosition.MIDDLE) {\n/* 1103 */ result = new Date(period.getMiddleMillisecond());\n/* */ }\n/* 1105 */ else if (position == DateTickMarkPosition.END) {\n/* 1106 */ result = new Date(period.getLastMillisecond());\n/* */ } \n/* 1108 */ return result;\n/* */ }", "public void get_fecha(){\n //Obtenemos la fecha\n Calendar c1 = Calendar.getInstance();\n fecha.setCalendar(c1);\n }", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "@Test\n\tpublic void testTradeDateFrom0() {\n\n\t\tfinal DDF_TradeDay day = DDF_TradeDay.D15;\n\n\t\tfinal DateTime today = new DateTime(\"2012-01-18T10:39:44.647-06:00\");\n\n\t\tfinal TimeValue value = DDF_TradeDay.tradeDateFrom(day, today);\n\n\t\tfinal DateTime trade = value.asDateTime();\n\n\t\tlogger.debug(\"day=\" + day);\n\t\tlogger.debug(\"today=\" + today);\n\t\tlogger.debug(\"trade=\" + trade);\n\n\t\tassertEquals(trade.getYear(), 2012);\n\t\tassertEquals(trade.getMonthOfYear(), 01);\n\t\tassertEquals(trade.getDayOfMonth(), 15);\n\n\t}", "public static void main(String[] args) {\n\n Calendar calendar = Calendar.getInstance();\n calendar.set(2003,7,31);\n calendar.set(Calendar.MONTH,8);\n// Date time1 = calendar.getTime();\n calendar.set(Calendar.DATE,5);\n Date time = calendar.getTime();\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n String format = simpleDateFormat.format(time);\n System.out.println(format);\n }", "protected Date nextStandardDate(Date date, DateTickUnit unit) {\n/* 1122 */ Date previous = previousStandardDate(date, unit);\n/* 1123 */ Calendar calendar = Calendar.getInstance(this.timeZone, this.locale);\n/* 1124 */ calendar.setTime(previous);\n/* 1125 */ calendar.add(unit.getCalendarField(), unit.getMultiple());\n/* 1126 */ return calendar.getTime();\n/* */ }", "private Date init(InputStream ouiData) throws IOException {\n DataInputStream din = new DataInputStream(ouiData);\n Date result = new Date(din.readLong());\n while (din.available() > 0) {\n Oui oui = new Oui(din);\n _byHashCode.put(oui.hashCode(), oui);\n }\n return result;\n }", "private void getIntialCalender() {\n\n\t\ttry {\n\n\t\t\tc = Calendar.getInstance();\n\t\t\tString[] fields = Global_variable.str_booking_date.split(\"[-]\");\n\n\t\t\tString str_year = fields[0];\n\t\t\tString str_month = fields[1];\n\t\t\tString str_day = fields[2];\n\n\t\t\tSystem.out.println(\"!!!!\" + fields[0]);\n\t\t\tSystem.out.println(\"!!!!\" + fields[1]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields[2]);\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tyear = Integer.parseInt(str_year);\n\t\t\t} else {\n\t\t\t\tyear = c.get(Calendar.YEAR);\n\t\t\t}\n\n\t\t\tif (str_month.length() != 0) {\n\t\t\t\tmonth = Integer.parseInt(str_month) - 1;\n\t\t\t} else {\n\t\t\t\tmonth = c.get(Calendar.MONTH);\n\t\t\t}\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tday = Integer.parseInt(str_day);\n\t\t\t} else {\n\t\t\t\tday = c.get(Calendar.DAY_OF_MONTH);\n\t\t\t}\n\n\t\t\tString[] fields1 = Global_variable.str_booking_time.split(\"[:]\");\n\n\t\t\tString str_hour = fields1[0];\n\t\t\tString str_minutes = fields1[1];\n\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[0]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[1]);\n\n\t\t\tif (str_hour.length() != 0) {\n\t\t\t\thour = Integer.parseInt(str_hour);\n\t\t\t} else {\n\t\t\t\thour = c.get(Calendar.HOUR_OF_DAY);\n\t\t\t}\n\n\t\t\tif (str_minutes.length() != 0) {\n\t\t\t\tminutes = Integer.parseInt(str_minutes);\n\t\t\t} else {\n\t\t\t\tminutes = c.get(Calendar.MINUTE);\n\t\t\t}\n\n\t\t\tcurrDate = new java.sql.Date(System.currentTimeMillis());\n\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\tCalendar c1 = Calendar.getInstance();\n\t\t\tc1.setTime(new Date()); // Now use today date.\n\t\t\tc1.add(Calendar.DATE, 30); // Adding 30 days\n\t\t\toutput = sdf.format(c1.getTime());\n\t\t\tSystem.out.println(\"!!!!!!!!!!!!!!!\" + output);\n\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void testDate() throws Exception {\r\n Calendar cal = Calendar.getInstance();\r\n Date d = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").parse(\"2015-01-01 00:00:00\");\r\n cal.setTime(d);\r\n System.out.println(cal.get(Calendar.WEEK_OF_YEAR));\r\n\r\n d = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").parse(\"2014-12-31 11:59:59\");\r\n cal.setTime(d);\r\n System.out.println(cal.get(Calendar.WEEK_OF_YEAR));\r\n\r\n cal.setTime(new Date());\r\n System.out.println(cal.get(Calendar.WEEK_OF_YEAR));\r\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tgetLayouts();\n\n\t\t\t\tCalendar pre = (Calendar) calendar.clone();\n\n\t\t\t\tcurrentMonth--;\n\n\t\t\t\tif (currentMonth == 0) {\n\t\t\t\t\tcurrentMonth = 12;\n\t\t\t\t\tcurrentYear--;\n\t\t\t\t}\n\t\t\t\tpre.set(Calendar.MONTH, currentMonth);\n\t\t\t\tpre.set(Calendar.YEAR, currentYear);\n\t\t\t\tpre.set(Calendar.DATE, 1);\n\n\t\t\t\tpositionPre = pre.getTime().toString().split(\" \");\n\t\t\t\tpreviousDayPosition = ReturnCalendarDetails\n\t\t\t\t\t\t.getPosition(positionPre[0]);\n\n\t\t\t\tgetCalendar(\n\t\t\t\t\t\tReturnCalendarDetails.getCurrentMonth(positionPre[1]),\n\t\t\t\t\t\tReturnCalendarDetails.getPosition(positionPre[0]),\n\t\t\t\t\t\tInteger.parseInt(positionPre[5]));\n\n\t\t\t\tSystem.out.println(\"!!\" + pre.getTime());\n\t\t\t}", "Calendar registeredAt();", "public Calendar calendario(Date date) {\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(date);\r\n return calendar;\r\n }", "protected Calendar getCurrentCalendar() {\n Calendar current = new Calendar();\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n SimpleDateFormat dateFormatHour = new SimpleDateFormat(\"H\");\n SimpleDateFormat dateFormatWeekDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat dateFormatMonth = new SimpleDateFormat(\"MMM\");\n\n current.setHour(dateFormatHour.format(calendar.getTime()).toString());\n current.setWeekday(dateFormatWeekDay.format(calendar.getTime()));\n current.setMonth(dateFormatMonth.format(calendar.getTime()));\n\n return current;\n }", "@Override\n\tpublic Calendar getInitialDate() {\n\t\treturn Calendar.getInstance();\n\t}", "public Entry(Calendar date){\n this.date = date; \n }", "public void processDate(boolean periodStart) {\n Calendar cal = Calendar.getInstance();\n if (year == null) {\n year = cal.get(Calendar.YEAR);\n }\n if (week != null) {\n cal.set(Calendar.WEEK_OF_YEAR, week);\n cal.setFirstDayOfWeek(Calendar.MONDAY);\n cal.set(Calendar.DAY_OF_WEEK, (periodStart) ? Calendar.MONDAY : Calendar.SUNDAY);\n week = null;\n month = TimeConstants.MONTHS_EN.split(\",\")[cal.get(Calendar.MONTH)].toLowerCase();\n day = cal.get(Calendar.DAY_OF_MONTH);\n }\n if (season != null) {\n if (\"Spring\".equalsIgnoreCase(season)) {\n cal.set(Calendar.MONTH, periodStart ? 2 : 4);\n } else if (\"Summer\".equalsIgnoreCase(season)) {\n cal.set(Calendar.MONTH, periodStart ? 5 : 7);\n } else if (\"Autumn\".equalsIgnoreCase(season)) {\n cal.set(Calendar.MONTH, periodStart ? 8 : 10);\n } else if (\"Winter\".equalsIgnoreCase(season)) {\n cal.set(Calendar.MONTH, periodStart ? 11 : 1);\n }\n cal.set(Calendar.DAY_OF_MONTH, periodStart ? 1 : cal.getActualMaximum(Calendar.DAY_OF_MONTH));\n month = TimeConstants.MONTHS_EN.split(\",\")[cal.get(Calendar.MONTH)].toLowerCase();\n day = cal.get(Calendar.DAY_OF_MONTH);\n season = null;\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null && day == 99) {\n cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));\n day = cal.get(Calendar.DAY_OF_MONTH);\n }\n if (day == null) {\n cal.set(Calendar.DAY_OF_MONTH, periodStart ? 1 : cal.getActualMaximum(Calendar.DAY_OF_MONTH));\n day = cal.get(Calendar.DAY_OF_MONTH);\n }\n }", "@Override\n public void onClick(View v) {\n Calendar calendar = Calendar.getInstance();\n Date now = calendar.getTime();\n int hour = calendar.get(Calendar.HOUR_OF_DAY);\n int minute = calendar.get(Calendar.MINUTE);\n Alarm alarm = new Alarm();\n alarm.setHour(hour);\n alarm.setMinute(minute);\n\n mAlarmClockViewModel.insertNewAlarmClock(alarm);\n AlarmClock currentClock = (AlarmClock) mRecyclerView.findViewById(R.id.alarm_clock_item);\n currentClock.setDate(now);\n }", "private void calculateFinancialStartDate(DepreciationCriteria criteria) {\n\t\tLong todate = criteria.getToDate();\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTimeInMillis(todate);\n\t\tint year = calendar.get(Calendar.YEAR);\n\t\tint month = calendar.get(Calendar.MONTH);\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 23);\n\t\tcalendar.set(Calendar.MINUTE, 59);\n\t\tcriteria.setToDate(calendar.getTimeInMillis());\n\n\t\t// choosing the finacial year based on todate month\n\t\tif (month < 3) {\n\t\t\tcriteria.setFinancialYear(year-1+\"-\"+year);\n\t\t\tyear = year - 1;\n\t\t}else\n\t\t\tcriteria.setFinancialYear(year+\"-\"+(year+1));\n\n\t\t// setting from date value\n\t\tcalendar.set(Calendar.YEAR, year);\n\t\tcalendar.set(Calendar.MONTH, Calendar.APRIL);\n\t\tcalendar.set(Calendar.DATE, 1);\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\n\t\tcalendar.set(Calendar.MINUTE, 0);\n\t\tcriteria.setFromDate(calendar.getTimeInMillis());\n\t\tSystem.err.println(\"from date calculated : \" + criteria.getFromDate());\n\t}", "protected Date previousStandardDate(Date date, DateTickUnit unit) {\n/* */ Date d3;\n/* */ long millis;\n/* */ Date standardDate;\n/* */ Month month;\n/* */ Date d2, d1, d0, dd, mm;\n/* */ int years, years, years, years, years, years, months, months, months, months, months, days, days, days, days, hours, hours, hours, minutes, minutes, seconds, milliseconds;\n/* 920 */ Calendar calendar = Calendar.getInstance(this.timeZone, this.locale);\n/* 921 */ calendar.setTime(date);\n/* 922 */ int count = unit.getCount();\n/* 923 */ int current = calendar.get(unit.getCalendarField());\n/* 924 */ int value = count * current / count;\n/* */ \n/* 926 */ switch (unit.getUnit()) {\n/* */ \n/* */ case 6:\n/* 929 */ years = calendar.get(1);\n/* 930 */ months = calendar.get(2);\n/* 931 */ days = calendar.get(5);\n/* 932 */ hours = calendar.get(11);\n/* 933 */ minutes = calendar.get(12);\n/* 934 */ seconds = calendar.get(13);\n/* 935 */ calendar.set(years, months, days, hours, minutes, seconds);\n/* 936 */ calendar.set(14, value);\n/* 937 */ mm = calendar.getTime();\n/* 938 */ if (mm.getTime() >= date.getTime()) {\n/* 939 */ calendar.set(14, value - 1);\n/* 940 */ mm = calendar.getTime();\n/* */ } \n/* 942 */ return mm;\n/* */ \n/* */ case 5:\n/* 945 */ years = calendar.get(1);\n/* 946 */ months = calendar.get(2);\n/* 947 */ days = calendar.get(5);\n/* 948 */ hours = calendar.get(11);\n/* 949 */ minutes = calendar.get(12);\n/* 950 */ if (this.tickMarkPosition == DateTickMarkPosition.START) {\n/* 951 */ milliseconds = 0;\n/* */ }\n/* 953 */ else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) {\n/* 954 */ milliseconds = 500;\n/* */ } else {\n/* */ \n/* 957 */ milliseconds = 999;\n/* */ } \n/* 959 */ calendar.set(14, milliseconds);\n/* 960 */ calendar.set(years, months, days, hours, minutes, value);\n/* 961 */ dd = calendar.getTime();\n/* 962 */ if (dd.getTime() >= date.getTime()) {\n/* 963 */ calendar.set(13, value - 1);\n/* 964 */ dd = calendar.getTime();\n/* */ } \n/* 966 */ return dd;\n/* */ \n/* */ case 4:\n/* 969 */ years = calendar.get(1);\n/* 970 */ months = calendar.get(2);\n/* 971 */ days = calendar.get(5);\n/* 972 */ hours = calendar.get(11);\n/* 973 */ if (this.tickMarkPosition == DateTickMarkPosition.START) {\n/* 974 */ int seconds = 0;\n/* */ }\n/* 976 */ else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) {\n/* 977 */ int seconds = 30;\n/* */ } else {\n/* */ int seconds;\n/* 980 */ seconds = 59;\n/* */ } \n/* 982 */ calendar.clear(14);\n/* 983 */ calendar.set(years, months, days, hours, value, seconds);\n/* 984 */ d0 = calendar.getTime();\n/* 985 */ if (d0.getTime() >= date.getTime()) {\n/* 986 */ calendar.set(12, value - 1);\n/* 987 */ d0 = calendar.getTime();\n/* */ } \n/* 989 */ return d0;\n/* */ \n/* */ case 3:\n/* 992 */ years = calendar.get(1);\n/* 993 */ months = calendar.get(2);\n/* 994 */ days = calendar.get(5);\n/* 995 */ if (this.tickMarkPosition == DateTickMarkPosition.START) {\n/* 996 */ int minutes = 0;\n/* 997 */ int seconds = 0;\n/* */ }\n/* 999 */ else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) {\n/* 1000 */ int minutes = 30;\n/* 1001 */ int seconds = 0;\n/* */ } else {\n/* */ \n/* 1004 */ minutes = 59;\n/* 1005 */ seconds = 59;\n/* */ } \n/* 1007 */ calendar.clear(14);\n/* 1008 */ calendar.set(years, months, days, value, minutes, seconds);\n/* 1009 */ d1 = calendar.getTime();\n/* 1010 */ if (d1.getTime() >= date.getTime()) {\n/* 1011 */ calendar.set(11, value - 1);\n/* 1012 */ d1 = calendar.getTime();\n/* */ } \n/* 1014 */ return d1;\n/* */ \n/* */ case 2:\n/* 1017 */ years = calendar.get(1);\n/* 1018 */ months = calendar.get(2);\n/* 1019 */ if (this.tickMarkPosition == DateTickMarkPosition.START) {\n/* 1020 */ int hours = 0;\n/* */ }\n/* 1022 */ else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) {\n/* 1023 */ int hours = 12;\n/* */ } else {\n/* */ \n/* 1026 */ hours = 23;\n/* */ } \n/* 1028 */ calendar.clear(14);\n/* 1029 */ calendar.set(years, months, value, hours, 0, 0);\n/* */ \n/* */ \n/* 1032 */ d2 = calendar.getTime();\n/* 1033 */ if (d2.getTime() >= date.getTime()) {\n/* 1034 */ calendar.set(5, value - 1);\n/* 1035 */ d2 = calendar.getTime();\n/* */ } \n/* 1037 */ return d2;\n/* */ \n/* */ case 1:\n/* 1040 */ years = calendar.get(1);\n/* 1041 */ calendar.clear(14);\n/* 1042 */ calendar.set(years, value, 1, 0, 0, 0);\n/* 1043 */ month = new Month(calendar.getTime(), this.timeZone, this.locale);\n/* */ \n/* 1045 */ standardDate = calculateDateForPosition(month, this.tickMarkPosition);\n/* */ \n/* 1047 */ millis = standardDate.getTime();\n/* 1048 */ if (millis >= date.getTime()) {\n/* 1049 */ month = (Month)month.previous();\n/* */ \n/* */ \n/* 1052 */ month.peg(Calendar.getInstance(this.timeZone));\n/* 1053 */ standardDate = calculateDateForPosition(month, this.tickMarkPosition);\n/* */ } \n/* */ \n/* 1056 */ return standardDate;\n/* */ \n/* */ case 0:\n/* 1059 */ if (this.tickMarkPosition == DateTickMarkPosition.START) {\n/* 1060 */ int months = 0;\n/* 1061 */ int days = 1;\n/* */ }\n/* 1063 */ else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) {\n/* 1064 */ int months = 6;\n/* 1065 */ int days = 1;\n/* */ } else {\n/* */ \n/* 1068 */ months = 11;\n/* 1069 */ days = 31;\n/* */ } \n/* 1071 */ calendar.clear(14);\n/* 1072 */ calendar.set(value, months, days, 0, 0, 0);\n/* 1073 */ d3 = calendar.getTime();\n/* 1074 */ if (d3.getTime() >= date.getTime()) {\n/* 1075 */ calendar.set(1, value - 1);\n/* 1076 */ d3 = calendar.getTime();\n/* */ } \n/* 1078 */ return d3;\n/* */ } \n/* 1080 */ return null;\n/* */ }", "@Test\n\tpublic void testTradeDateFrom1() {\n\n\t\tfinal DDF_TradeDay day = DDF_TradeDay.D15;\n\n\t\tfinal DateTime today = new DateTime(\"2012-01-12T10:39:44.647-06:00\");\n\n\t\tfinal TimeValue value = DDF_TradeDay.tradeDateFrom(day, today);\n\n\t\tfinal DateTime trade = value.asDateTime();\n\n\t\tlogger.debug(\"day=\" + day);\n\t\tlogger.debug(\"today=\" + today);\n\t\tlogger.debug(\"trade=\" + trade);\n\n\t\tassertEquals(trade.getYear(), 2012);\n\t\tassertEquals(trade.getMonthOfYear(), 01);\n\t\tassertEquals(trade.getDayOfMonth(), 15);\n\n\t}", "private Date correctTickDateForPosition(Date time, DateTickUnit unit, DateTickMarkPosition position) {\n/* 1580 */ Date result = time;\n/* 1581 */ switch (unit.getUnit()) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 1:\n/* 1589 */ result = calculateDateForPosition(new Month(time, this.timeZone, this.locale), position);\n/* */ break;\n/* */ \n/* */ case 0:\n/* 1593 */ result = calculateDateForPosition(new Year(time, this.timeZone, this.locale), position);\n/* */ break;\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 1599 */ return result;\n/* */ }", "public DateTime(final BusinessObject parent) {\n super(parent);\n if (clock == null) {\n throw new ApplicationException(\"Clock not set up\");\n }\n setValue(new java.util.Date(clock.getTime()));\n isNull = false;\n }", "public static Calendar getFechaHoy(){\n\n Calendar cal = new GregorianCalendar();\n cal.set(Calendar.HOUR_OF_DAY,0);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public Calendar forDate(Date date) {\r\n\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.setTime(date);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public DefaultScheduleEvent getEventosCalendario(DateTime data, Servico servico) throws NullPointerException {\n\t\tList<ServicoJanelaAtendimento> servicoJanelaAtendimentos = new ArrayList<>();\n\t\tList<SolicitacaoServico> solicitacaoServicos = new ArrayList<>();\n\t\t\n\t\t\n\t\t\n\t\tgetServicoJanelaAtendimentoDAO().beginTransaction();\n\t\tservicoJanelaAtendimentos = getServicoJanelaAtendimentoDAO().getServicoJanelaPorDataJanela(data.toDate(), servico);\n\t\tgetServicoJanelaAtendimentoDAO().closeTransaction();\n\t\t\n\t\tDefaultScheduleEvent defaultScheduleEvent= new DefaultScheduleEvent();\n\t\tdefaultScheduleEvent.setAllDay(true);\n\t\tdefaultScheduleEvent.setData(data.toDate());\n\t\tdefaultScheduleEvent.setStartDate(data.toDate());\n\t\tdefaultScheduleEvent.setEndDate(data.plusHours(20).toDate());\n\t\t\n\t\t\n\t\tif(!servicoJanelaAtendimentos.isEmpty()) {\n\t\t\t\n\t\t\t\n\t\t\tgetSolicitacaoServicoDAO().beginTransaction();\n\t\t\tsolicitacaoServicos = getSolicitacaoServicoDAO().getSolicitacoesPorDataeServico(data.toDate(), servico);\n\t\t\tgetSolicitacaoServicoDAO().closeTransaction();\n\t\t\t\n\t\t\tint janelaServico = 0;\n\t\t\tint janelaSolicitacao = 0;\n\t\t\t\tfor(ServicoJanelaAtendimento servicoJanelaAtendimento: servicoJanelaAtendimentos) {\n\t\t\t\t\tjanelaServico = janelaServico + servicoJanelaAtendimento.getCapacidadePeriodo();\n\t\t\t\t}\n\t\t\t\tjanelaSolicitacao = solicitacaoServicos.size();\n\t\t\tint disponivel = janelaServico-janelaSolicitacao;\n\t\t\tif(disponivel > 0) {\n\t\t\t\tdefaultScheduleEvent.setTitle(\"Disponível\");\n\t\t\t\tdefaultScheduleEvent.setStyleClass(\"green\");\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\tdefaultScheduleEvent.setTitle(\"Encaixe\");\n\t\t\t\tdefaultScheduleEvent.setStyleClass(\"red\");\n\t\t\t\t\n\t\t\t}\n\t\t}else {\n\t\tdefaultScheduleEvent.setTitle(\"Não Disponível\");\n\t\tdefaultScheduleEvent.setStyleClass(\"no-color\");\n\t\t}\n\t\t\n\t\treturn defaultScheduleEvent;\n\t}", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute, int second) {\r\n\t\tCalendar calendar = createCalendar(year, month, date, hour, minute);\r\n\t\tcalendar.set(Calendar.SECOND, second);\r\n\t\treturn calendar;\r\n\t}", "private void setCurrentDay() {\n Calendar c = Calendar.getInstance();\n\n year = c.get(Calendar.YEAR);\n month = c.get(Calendar.MONTH);\n day = c.get(Calendar.DAY_OF_MONTH);\n hour = c.get(Calendar.HOUR_OF_DAY);\n minute = c.get(Calendar.MINUTE);\n }", "Calendar toCalendar();", "Calendar toCalendar();", "public Candle(ZonedStockDateTime pBeginning, final double pLow,\r\n final double pHigh, final double pOpen, final double pClose) {\r\n beginning = pBeginning;\r\n low = pLow;\r\n high = pHigh;\r\n open = pOpen;\r\n close = pClose;\r\n }", "@Test\n\tpublic void testTradeDateFrom2() {\n\n\t\tfinal DDF_TradeDay day = DDF_TradeDay.D30;\n\n\t\tfinal DateTime today = new DateTime(\"2012-01-01T10:39:44.647-06:00\");\n\n\t\tfinal TimeValue value = DDF_TradeDay.tradeDateFrom(day, today);\n\n\t\tfinal DateTime trade = value.asDateTime();\n\n\t\tlogger.debug(\"day=\" + day);\n\t\tlogger.debug(\"today=\" + today);\n\t\tlogger.debug(\"trade=\" + trade);\n\n\t\tassertEquals(trade.getYear(), 2011);\n\t\tassertEquals(trade.getMonthOfYear(), 12);\n\t\tassertEquals(trade.getDayOfMonth(), 30);\n\n\t}", "@Test\n\tpublic void testDate2() {\n\t\ttry {\n\t\t\tfinal Date date = ParadoxDate.getDateFromParadoxDate(36160);\n\t\t\tfinal Calendar calendar = Calendar.getInstance();\n\t\t\tcalendar.setTime(date);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.DATE) == 1);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.MONTH) == 0);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.YEAR) == 100);\n\t\t} catch (final Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tAssert.fail();\n\t\t}\n\t}", "public static void main(String[] args) {\n System.out.println(new Date().getTime());\n\n // 2016-12-16 11:48:08\n Calendar calendar = Calendar.getInstance();\n calendar.set(2016, 11, 16, 12, 0, 1);\n System.out.println(calendar.getTime());\n Date date=new Date();\n SimpleDateFormat simpleDateFormat=new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n System.out.println(simpleDateFormat.format(date));\n\n\n }", "public void verifyDate(){\n\n // currentDateandTime dataSingleton.getDay().getDate();\n\n }", "XMLGregorianCalendar getSystemEntryDate();", "@Test\n\tpublic void testDate1() {\n\t\ttry {\n\t\t\tfinal Date date = ParadoxDate.getDateFromParadoxDate(0);\n\t\t\tfinal Calendar calendar = Calendar.getInstance();\n\t\t\tcalendar.setTime(date);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.DATE) == 1);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.MONTH) == 0);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.YEAR) == 1900);\n\t\t} catch (final Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tAssert.fail();\n\t\t}\n\t}", "Calendar getDepartureDateAndTime();", "private Date getFrom(RuleTypes.HistoricRequirements ph) {\n Calendar date = new GregorianCalendar();\n date.set(Calendar.HOUR_OF_DAY, 0);\n date.set(Calendar.MINUTE, 0);\n date.set(Calendar.SECOND, 0);\n date.set(Calendar.MILLISECOND, 0);\n int today;\n\n switch(ph) {\n case TODAY:\n return date.getTime();\n case YESTERDAY:\n date.add(Calendar.DAY_OF_MONTH, -1);\n return date.getTime();\n case THIS_WEEK:\n today = date.get(Calendar.DAY_OF_WEEK);\n date.add(Calendar.DAY_OF_WEEK,-today+Calendar.MONDAY);\n return date.getTime();\n case LAST_WEEK:\n today = date.get(Calendar.DAY_OF_WEEK);\n date.add(Calendar.DAY_OF_WEEK,-today+Calendar.MONDAY);\n date.add(Calendar.DAY_OF_MONTH, -7);\n return date.getTime();\n case THIS_MONTH:\n date.set(Calendar.DAY_OF_MONTH, date.getActualMinimum(Calendar.DAY_OF_MONTH));\n return date.getTime();\n case LAST_MONTH:\n date.set(Calendar.DAY_OF_MONTH, date.getActualMinimum(Calendar.DAY_OF_MONTH));\n date.add(Calendar.MONTH, -1);\n return date.getTime();\n case T12_HRS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -12);\n return date.getTime();\n case T24_HRS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -24);\n return date.getTime();\n case T2_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -48);\n return date.getTime();\n case T3_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -72);\n return date.getTime();\n case T4_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -96);\n return date.getTime();\n case T5_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -120);\n return date.getTime();\n case T6_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -144);\n return date.getTime();\n case T7_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -168);\n return date.getTime();\n }\n return null;\n }", "@Before\n public void SetUp(){\n calendar = new SystemCalendar(2018,4,25);\n DepartureTime = \"9:00AM\";\n DayOfWeek = calendar.getDayOfMonth();\n }", "public Calendar getCurrentMonthCalendarObj() throws Throwable{\r\n\r\n\t\tString dateInput = \"01/\"+month+\"/\"+year;\t\t\t\r\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MMMM/yyyy\");\r\n\t\tDate startDate = df.parse(dateInput);\r\n\t\tCalendar c = Calendar.getInstance(); // this takes current date\r\n\t c.setTime(startDate); // set date to specified in arguement\r\n\t\treturn c;\r\n\t}", "public PickDateTime(Calendar cal) {\n\t\tjbInit();\n\t}", "public AgendaMB() {\n GregorianCalendar dtMax = new GregorianCalendar(); \n Date dt = new Date();\n dtMax.setTime(dt); \n GregorianCalendar dtMin = new GregorianCalendar(); \n dtMin.setTime(dt);\n dtMin.add(Calendar.DAY_OF_MONTH, 1);\n dtMax.add(Calendar.DAY_OF_MONTH, 40);\n dataMax = dtMax.getTime();\n dataMin = dtMin.getTime(); \n }", "public TradingDayInfo(String ticker, String date, double openingPrice, double highPrice, double lowPrice, double closingPrice) {\n this.ticker = ticker;\n this.date = date;\n this.openingPrice = openingPrice;\n this.highPrice = highPrice;\n this.lowPrice = lowPrice;\n this.closingPrice = closingPrice;\n \n \n return;\n }", "abstract public Date getServiceAppointment();", "public Timestamp getHC_WorkStartDate2();", "public Calendar getStartDate() {\n \t\tCalendar cal = Calendar.getInstance();\n \t\tcal.setTimeInMillis(startTime);\n \t\t\n\t\treturn cal;\n\t}", "private Calendar constructPrincipleSymptomsDate() {\n\t\tCalendar psd = null ;\n\n\t\t//\n\t\t// This is a painfully inefficient way of doing it.\n\t\t// Optimization can wait until later!\n\t\tString sEpiSymponset, sEpiSymponsetHour, sEpiSymponsetMin ;\n\t\tString sEpiSymponsetYear, sEpiSymponsetMonth ;\n\n\t\tsEpiSymponset = od2p.getValue( \"DataSubmissionQuestionnaire\", \"epi_symponset\" ) ;\n\t\tif( sEpiSymponset != null ) {\n\t\t\tsEpiSymponset = od2p.getCorrectedDateTimeValueFromString( sEpiSymponset ) ;\n\t\t\tsEpiSymponsetHour = od2p.getValue( \"DataSubmissionQuestionnaire\", \"epi_symponset_hour\" ) ;\n\t\t\tsEpiSymponsetMin = od2p.getValue( \"DataSubmissionQuestionnaire\", \"epi_symponset_min\" ) ;\n\n\t\t\tXmlDateTime dt = XmlDateTime.Factory.newInstance() ;\n\t\t\tdt.setStringValue( sEpiSymponset ) ;\n\t\t\tpsd = dt.getCalendarValue() ;\n\t\t\tif( sEpiSymponsetHour != null && sEpiSymponsetMin != null) {\n\t\t\t\tpsd.set( Calendar.HOUR_OF_DAY, Integer.valueOf( sEpiSymponsetHour ) ) ;\n\t\t\t\tpsd.set( Calendar.MINUTE, Integer.valueOf( sEpiSymponsetMin ) ) ;\n\t\t\t}\n\t\t\tlog.debug( \"Principle symptoms date. Route1. \" + psd.toString() ) ;\n\t\t\treturn psd ;\n\t\t}\n\t\tsEpiSymponsetYear = od2p.getValue( \"DataSubmissionQuestionnaire\", \"epi_symponset_year\" ) ;\n\t\tif( sEpiSymponsetYear != null ) {\n\t\t\tsEpiSymponsetMonth = od2p.getValue( \"DataSubmissionQuestionnaire\", \"epi_symponset_month\" ) ;\n\t\t\tpsd = Calendar.getInstance() ;\n\t\t\tpsd.setTimeInMillis( 0 ) ;\n\t\t\tpsd.set( Integer.valueOf( sEpiSymponsetYear ), Integer.valueOf( sEpiSymponsetMonth ), 1, 0, 0) ;\n\t\t\tlog.debug( \"Principle symptoms date. Route2. \" + psd.toString() ) ;\n\t\t\treturn psd ;\n\t\t}\n\t\tlog.debug( \"Principle symptoms date. Route3. \" + psd ) ;\n\t\treturn psd ;\t\n\t}", "private Date getSamoaNow() {\n\t\t// Get the current datetime in UTC\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(new Date());\n\t\t\n\t\t// Get the datetime minus 11 hours (Samoa is UTC-11)\n\t\tcalendar.add(Calendar.HOUR_OF_DAY, -11);\n\t\t\n\t\treturn calendar.getTime();\n\t}", "public void setTodayCalendar()\n {\n this.currentCalendar = Calendar.getInstance();\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tgetLayouts();\n\n\t\t\t\tCalendar next = (Calendar) calendar.clone();\n\n\t\t\t\tif (currentMonth > 11) {\n\t\t\t\t\tcurrentMonth = 1;\n\t\t\t\t\tcurrentYear++;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentMonth++;\n\t\t\t\t}\n\n\t\t\t\tnext.set(Calendar.MONTH, currentMonth);\n\t\t\t\tnext.set(Calendar.YEAR, currentYear);\n\t\t\t\tnext.set(Calendar.DATE, 1);\n\n\t\t\t\tpositionNext = next.getTime().toString().split(\" \");\n\t\t\t\tgetCalendar(\n\t\t\t\t\t\tReturnCalendarDetails.getCurrentMonth(positionNext[1]),\n\t\t\t\t\t\tReturnCalendarDetails.getPosition(positionNext[0]),\n\t\t\t\t\t\tInteger.parseInt(positionNext[5]));\n\t\t\t}", "public void SetCurrentDate(CalendarWidget kCal) {\n\t\tfor(int i = 0; i < 42; ++i)\n\t\t{\n\t\t\tif(kCal.cell[i].date.getText().toString().length() == 0)\n\t\t\t\tcontinue;\n\t\t\tkCal.checkForCurrentData(kCal.cell[i]);\n\t\t}\n\t}", "public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "java.util.Calendar getLastrun();", "@Test\n\tpublic void testTradeDateFrom3() {\n\n\t\tfinal DDF_TradeDay day = DDF_TradeDay.D03;\n\n\t\tfinal DateTime today = new DateTime(\"2011-12-30T10:39:44.647-06:00\");\n\n\t\tfinal TimeValue value = DDF_TradeDay.tradeDateFrom(day, today);\n\n\t\tfinal DateTime trade = value.asDateTime();\n\n\t\tlogger.debug(\"day=\" + day);\n\t\tlogger.debug(\"today=\" + today);\n\t\tlogger.debug(\"trade=\" + trade);\n\n\t\tassertEquals(trade.getYear(), 2012);\n\t\tassertEquals(trade.getMonthOfYear(), 01);\n\t\tassertEquals(trade.getDayOfMonth(), 03);\n\n\t}", "public String[] getStarDate2(){\n\t\tstardate = new String[3];\n\t\t\n\t\tCalendar originaldate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\tCalendar instancedate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\t\t\t\n\t\t//originaldate.set(2008, 8, 8, 0, 0, 0);\n\t\toriginaldate.set(2162, 0, 4, 0, 0, 0);\n\t\t\n\t\t/*instancedate.add(Calendar.HOUR, 7);\n\t\tinstancedate.add(Calendar.MINUTE, 33);\n\t\tinstancedate.add(Calendar.YEAR, 156);\n\t\tinstancedate.add(Calendar.HOUR, -6*24);\n\t\tinstancedate.add(Calendar.MONTH, -3);*/\n\t\t\n\t\t\n\t\t// Get the represented date in milliseconds\n\t\tlong milis1 = originaldate.getTimeInMillis();\n\t\tlong milis2 = instancedate.getTimeInMillis();\n\t\t\n\t\t// Calculate difference in milliseconds\n\t\tlong diff = milis2 - milis1;\n\t\t \n\t\t// Calculate difference in seconds\n\t\tlong diffSeconds = diff / 1000;\n\t\t \n\t\t// Calculate difference in minutes\n\t\t//long diffMinutes = diff / (60 * 1000);\n\t\t\n\t\t// Calculate difference in hours\n\t\t//long diffHours = diff / (60 * 60 * 1000);\n\t\t\n\t\t// Calculate difference in days\n\t\t//long diffDays = diff / (24 * 60 * 60 * 1000);\n\t\t\n\t\t//double dec = -280000 - ((double)diffSeconds / 17280.0f);\n\t\tdouble dec = ((double)diffSeconds / 17280.0f);\n\t\t\t\t\n\t\tint mantel = (int)Math.ceil(dec/10000.0f);\n\t\t\t\t\n\t\tdouble kropp = (dec + (-(mantel-1)*10000.0f));\n\t\t\n\t\tif(kropp >= 10000) mantel += 2; //Fixing rounding error\n\t\t\n\t\tdouble mantelkropp = ((mantel-1) * 10000.0f) - kropp;\n\t\t\n\t\t/*Log.v(TAG, \"Diff: \" + Long.toString(diff));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(dec));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Integer.toString(mantel));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(kropp));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(mantelkropp));*/\n\t\t\n\t\tdec = mantelkropp;\n\t\t\n\t\tDecimalFormat maxDigitsFormatter;\n\t\tif(dec < 0)\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"#000000.0000\");\n\t\telse\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"0000000.0000\");\n \n try {\n\t stardate[0] = \"[\" + (maxDigitsFormatter.format(dec)).substring(0, 3) + \"]\";\n\t stardate[1] = \" 0\" + (maxDigitsFormatter.format(dec)).substring(3, 9);\n\t stardate[2] = \"\" + (maxDigitsFormatter.format(dec)).substring(9, 11);\n } catch(StringIndexOutOfBoundsException sbe) {\n \tif(DEBUG) Log.v(TAG, \"Could not format \" + sbe);\n \tif(DEBUG) Log.v(TAG, maxDigitsFormatter.format(dec));\n \tstardate[2] = \"--\"; \t \n }\n \n Log.v(TAG, \"Stardate: \" + stardate[0] + stardate[1] + stardate[2]);\n return stardate;\n\t\t\n\t}", "@Ignore\n\t@Test\n\tpublic void testDate3() {\n\t\ttry {\n\t\t\tfinal Date date = ParadoxDate.getDateFromParadoxDate(728783);\n\t\t\tfinal Calendar calendar = Calendar.getInstance();\n\t\t\tcalendar.setTime(date);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.DATE) == 4);\n\t\t\t// month is 0 indexed, so May is the 4th month\n\t\t\tAssert.assertTrue(calendar.get(Calendar.MONTH) == 4);\n\t\t\tAssert.assertTrue(calendar.get(Calendar.YEAR) == 1996);\n\t\t} catch (final Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tAssert.fail();\n\t\t}\n\t}", "private Calendar convertDateToCalendar(Date date) {\n Calendar calendar = GregorianCalendar.getInstance();\n calendar.setTime(date);\n return calendar;\n }", "public static Date formatarDataInicial(Date dataInicial) {\r\n\t\tCalendar calendario = GregorianCalendar.getInstance();\r\n\t\tcalendario.setTime(dataInicial);\r\n\t\tcalendario.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendario.set(Calendar.MINUTE, 0);\r\n\t\tcalendario.set(Calendar.SECOND, 0);\r\n\t\treturn calendario.getTime();\r\n\t}", "public Calendar endOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE) + 1);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public java.util.Calendar getFechaFacturado(){\n return localFechaFacturado;\n }", "public void setFechaFacturado(java.util.Calendar param){\n \n this.localFechaFacturado=param;\n \n\n }", "public void updateData() {\n\t\tcal = eventsData.getCalendar();\n\t\tfirstDayOfWeek = eventsData.getFirstDayOfWeek();\n\t\tcurrentDayOfMonth = eventsData.getDayNumber();\n\t\tnumberOfDays = eventsData.getNumberOfDays();\n\t\tnumberOfWeeks = eventsData.getNumberOfWeeks();\n\t\tyear = eventsData.getYearNumber();\n\t\tmonth = eventsData.getMonthNumber();\n\t\tday = eventsData.getDayNumber();\n\t\tweek = eventsData.getDayOfWeek();\n\t}", "public static Date today() // should it be void?\n {\n GregorianCalendar currentDate = new GregorianCalendar();\n int day = currentDate.get(GregorianCalendar.DATE);\n int month = currentDate.get(GregorianCalendar.MONTH) + 1;\n int year = currentDate.get(GregorianCalendar.YEAR);\n int hour = currentDate.get(GregorianCalendar.HOUR_OF_DAY);\n int minute = currentDate.get(GregorianCalendar.MINUTE);\n return new Date(day, month, year, hour, minute);\n }", "public static Calendar dateToCalendar(Date date){ \r\n Calendar cal = Calendar.getInstance();\r\n cal.setTime(date);\r\n return cal;\r\n }", "public Calendar() {\n }", "private static Calendar createCalendar(int year, int month, int date) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setLenient(false);\r\n\t\tcalendar.set(Calendar.YEAR, year);\r\n\t\tcalendar.set(Calendar.MONTH, month - 1);\r\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, date);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\treturn calendar;\r\n\t}", "public CalendarUtils(Calendar baseCalendar) {\r\n\t\tthis(baseCalendar.getTime(), baseCalendar.getTimeZone());\r\n\t}", "public void setDate(Calendar currentDate) {\r\n this.currentDate = currentDate;\r\n }", "public void setDateTime(java.util.Calendar param) {\n this.localDateTime = param;\n }", "Date getDataIns();", "@BeforeClass\n\tpublic static void setUp() {\n\t\tfutureDate = Calendar.getInstance();\n\t\tfutureDate.set(2015, 1, 1);\n\t\tpastDate = Calendar.getInstance();\n\t\tpastDate.set(2000, 1, 1);\n\t}", "public abstract MarketDataBox<LocalDate> getValuationDate();" ]
[ "0.6003875", "0.57305706", "0.54935724", "0.5490956", "0.54809535", "0.54572237", "0.53147846", "0.5298605", "0.52872574", "0.5285195", "0.5279734", "0.52653414", "0.52607113", "0.5256082", "0.5252091", "0.5228708", "0.5189558", "0.5116214", "0.51130706", "0.50959194", "0.5078201", "0.50771886", "0.5069911", "0.5052394", "0.50460434", "0.5008728", "0.5002772", "0.50020736", "0.49998853", "0.49885496", "0.49795076", "0.4963381", "0.49621844", "0.49620855", "0.49562082", "0.49504068", "0.49400184", "0.49364963", "0.49363098", "0.49192637", "0.49098477", "0.48853153", "0.48786137", "0.48778352", "0.48690996", "0.486216", "0.48572513", "0.48555204", "0.485414", "0.48533443", "0.4834791", "0.48320743", "0.4829037", "0.48270237", "0.4819045", "0.4817879", "0.4817879", "0.4813552", "0.480893", "0.48066983", "0.47945303", "0.47897002", "0.4788569", "0.47867662", "0.47823343", "0.4775491", "0.47740173", "0.47628242", "0.47617248", "0.47522643", "0.47478974", "0.4747871", "0.4740629", "0.4736191", "0.47355106", "0.4732509", "0.4729555", "0.47241238", "0.46999058", "0.46911198", "0.4682522", "0.46721417", "0.4671907", "0.46708342", "0.4660417", "0.46427587", "0.46336496", "0.46301043", "0.46261746", "0.46259448", "0.46208456", "0.46168357", "0.46141714", "0.4612623", "0.46123996", "0.46077755", "0.46065032", "0.4605862", "0.4604524", "0.46041954" ]
0.621077
0
Given a timestamp this function identifies the 'Pair' of flats so that the first flat starts before the timestamp and the second ends after it and their are no flats between the two. Simply given a timestamp it finds the pair of flats that 'straddle' that point.
public static GraphFlatPair getFlatPairAroundTimePoint(long timestamp, BaseGraph<AbstractGraphPoint> graph) { GraphFlatPair result = null; if (null != graph && 0 < graph.size()) { GraphFlatCollection<IGraphFlat> allFlats = DTUtil.findAllFlats(graph); TreeSet<GraphFlatPair> flatPairs = allFlats.getFlatPairs(); for (GraphFlatPair currPair : flatPairs) { long startTime = currPair.getFirstFlat().getEarliestPoint().getTimestamp(); long endTime = currPair.getSecondFlat().getLatestPoint().getTimestamp(); if (startTime <= timestamp && endTime >= timestamp) { result = currPair; break; } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Pair<DateTime, DateTime> getSegmentBounds(ReadableInstant instant) {\n LocalDate date = new DateTime(instant).toLocalDate(); // a day in the local time zone\n DateTime[] fenceposts = getSegmentFenceposts(date);\n for (int i = 0; i + 1 < fenceposts.length; i++) {\n if (!instant.isBefore(fenceposts[i]) && instant.isBefore(fenceposts[i + 1])) {\n return new Pair<>(fenceposts[i], fenceposts[i + 1]);\n }\n }\n return null; // should never get here because start <= instant < stop\n }", "private Obs findTrips(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY, int dist_th,\n\t\t\tint time_th) {\n\t\t/**\n\t\t * Marks array contain index of the towers that represent the starting\n\t\t * observation of a new trip.\n\t\t */\n\t\tboolean[] marks = new boolean[tstamps.length];\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\t\t/**\n\t\t * add 0 as the start of the first tower in this seq.\n\t\t */\n\t\t// int mIndex = 0;\n\t\t// marks[mIndex++] = 0;\n\n\t\tint current = 0;\n\t\tfor (int i = 1; i < tstamps.length; i++) {\n\t\t\ttry {\n\t\t\t\tString tstamp = tstamps[i];\n\n\t\t\t\t/**\n\t\t\t\t * if the time exceeds timing threshold, then check the distance\n\t\t\t\t * between towers. If this distance less than the distance\n\t\t\t\t * threshold, then previous tower is the end of the current\n\t\t\t\t * trip.\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\tDate sTime = formatter.parse(tstamps[current]);\n\t\t\t\tDate eTime = formatter.parse(tstamp);\n\t\t\t\tcal.setTime(sTime);\n\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\tcal.setTime(eTime);\n\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\tint diff = (ehour - hour) * HOUR + (eminute - minute);\n\t\t\t\t/**\n\t\t\t\t * check time difference with time threshold whatever the\n\t\t\t\t * distance between the starting tower\n\t\t\t\t */\n\t\t\t\tif (diff > time_th) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Check distance, if it distance less than distance\n\t\t\t\t\t * threshold mark the current tower as the start of a new\n\t\t\t\t\t * trip.\n\t\t\t\t\t */\n\t\t\t\t\tVertex sTower = towersXY.get(Integer.parseInt(towers[i - 1]));\n\t\t\t\t\tVertex tower = towersXY.get(Integer.parseInt(towers[i]));\n\n\t\t\t\t\tif (eculidean(sTower.getX(), tower.getX(), sTower.getY(), tower.getY()) < dist_th) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Update the trip sequences\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmarks[i] = true;\n\t\t\t\t\t\tcurrent = i;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} catch (ParseException ex) {\n\t\t\t\tLogger.getLogger(ObsTripsBuilder.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * construct observations and time stamps\n\t\t */\n\t\tString time = \"\";\n\t\tString obs = \"\";\n\t\t// time += tstamps[0];\n\t\t// obs += towers[0];\n\t\tfor (int i = 0; i < marks.length; i++) {\n\t\t\tif (marks[i]) {\n\n\t\t\t\ttime += RLM + tstamps[i];\n\t\t\t\tobs += RLM + towers[i];\n\t\t\t} else {\n\t\t\t\t// if (towers[i].equals(towers[i - 1])) {\n\t\t\t\t// System.out.println(towers[i] + \"\\t=\\t\" + towers[i - 1]);\n\t\t\t\t// continue;\n\t\t\t\t// }\n\t\t\t\t/**\n\t\t\t\t * Add comma separators\n\t\t\t\t */\n\t\t\t\tif (!time.isEmpty()) {\n\t\t\t\t\ttime += CLM;\n\t\t\t\t\tobs += CLM;\n\t\t\t\t}\n\t\t\t\ttime += tstamps[i];\n\t\t\t\tobs += towers[i];\n\t\t\t}\n\n\t\t}\n\t\treturn new Obs(obs, time);\n\t}", "private Points getTransactions(long startTimestamp, long endTimestamp) {\n if (startTimestamp > endTimestamp) {\n long tmp = startTimestamp;\n startTimestamp = endTimestamp;\n endTimestamp = tmp;\n }\n int low = 0;\n int high = transactionList.size() - 1;\n int x = -1;\n int y = -1;\n while (low <= high) {\n int mid = (high + low) >> 1;\n if (transactionList.get(mid).transactionTimestamp >= startTimestamp) {\n x = mid;\n high = mid - 1;\n } else {\n low = mid + 1;\n }\n }\n if (x == -1) {\n return new Points(-1, -1);\n }\n\n low = 0;\n high = transactionList.size() - 1;\n while (low <= high) {\n int mid = (high + low) >> 1;\n if (transactionList.get(mid).transactionTimestamp <= endTimestamp) {\n y = mid;\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n if (y == -1) {\n return new Points(-1, -1);\n }\n return new Points(x, y);\n }", "public Obs findtrips(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\tboolean marks[] = new boolean[towers.length];\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbuffer.add(towers[i]);\n\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\tjava.util.Date eTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\t\tif (time_diff > time_th) {\n\t\t\t\t\t\tmarks[i] = true;\n\n\t\t\t\t\t}\n\t\t\t\t\t// else {\n\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t */\n\t\t\t\t\tmax_distance = 0;\n\t\t\t\t\t// }\n\t\t\t\t} catch (ParseException ex) {\n\t\t\t\t\tLogger.getLogger(ObsTripsBuilder.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\tmarks[marks.length - 1] = true;\n\t\t}\n\n\t\t/**\n\t\t * User trips buffers.\n\t\t */\n\t\tString trips = towers[0];\n\t\tString tstrips = tstamps[0];\n\n\t\tfor (int i = 1; i < marks.length; i++) {\n\t\t\tboolean mark = marks[i];\n\t\t\ttrips += CLM + towers[i];\n\t\t\ttstrips += CLM + tstamps[i];\n\n\t\t\t/**\n\t\t\t * The end of the previous trip is the start of the new trip.\n\t\t\t */\n\t\t\tif (mark && i != marks.length - 1) {\n\t\t\t\ttrips += RLM + towers[i];\n\t\t\t\ttstrips += RLM + tstamps[i];\n\t\t\t}\n\n\t\t}\n\t\treturn new Obs(trips, tstrips);\n\n\t}", "public Obs findStops(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tString stops = \"\";\n\t\tString tstops = \"\";\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbuffer.add(towers[i]);\n\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\tjava.util.Date eTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\t\tif (time_diff > time_th) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add buffer mode to the stops\n\t\t\t\t\t\t */\n\t\t\t\t\t\tint index = modeIndex(buffer);\n\t\t\t\t\t\tif (index != -1) {\n\t\t\t\t\t\t\t// System.out.println(\"Find stop\");\n\t\t\t\t\t\t\tif (!stops.isEmpty()) {\n\t\t\t\t\t\t\t\tstops += CLM;\n\t\t\t\t\t\t\t\ttstops += CLM;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstops += buffer.get(index);\n\t\t\t\t\t\t\ttstops += tbuffer.get(index);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// else {\n\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t */\n\t\t\t\t\tmax_distance = 0;\n\t\t\t\t\t// }\n\t\t\t\t} catch (ParseException ex) {\n\t\t\t\t\tLogger.getLogger(ObsTripsBuilder.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\t/**\n\t\t\t * Add buffer mode to the stops\n\t\t\t */\n\t\t\tint index = modeIndex(buffer);\n\t\t\tif (index != -1) {\n\t\t\t\t// System.out.println(\"Find from the remaining buffer\");\n\t\t\t\tif (!stops.isEmpty()) {\n\t\t\t\t\tstops += CLM;\n\t\t\t\t\ttstops += CLM;\n\t\t\t\t}\n\t\t\t\tstops += buffer.get(index);\n\t\t\t\ttstops += tbuffer.get(index);\n\n\t\t\t}\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + stops);\n\t\t// System.out.println(\"time stamps:\\t\" + tstops);\n\t\treturn new Obs(stops, tstops);\n\n\t}", "public Obs algorithm2_2(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbuffer.add(towers[i]);\n\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\tjava.util.Date eTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\t\tif (time_diff > time_th) {\n\n\t\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\t\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t\t * observables.\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttrips.addAll(buffer);\n\t\t\t\t\t\ttstrips.addAll(tbuffer);\n\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\tmax_distance = 0;\n\t\t\t\t\t}\n\t\t\t\t} catch (ParseException parseException) {\n\t\t\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(0));\n\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + Arrays.toString(trips.toArray(new\n\t\t// String[trips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\t// System.out.println(\"time stamps:\\t\" +\n\t\t// Arrays.toString(tstrips.toArray(new\n\t\t// String[tstrips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\n\t}", "private static boolean isInOrderTimestamp(\n long timestamp,\n long prevTimestamp)\n {\n long timestampDiff = timestamp - prevTimestamp;\n\n // Assume that a diff this big must be due to reordering. Don't update\n // with reordered samples.\n return (timestampDiff < 0x80000000L);\n }", "public Obs algorithm2_3(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// buffer.add(towers[i]);\n\t\t\t// tbuffer.add(tstamps[i]);\n\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\tjava.util.Date eTime = formatter.parse(tstamps[i]);\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\t\tif (time_diff >= time_th) {\n\n\t\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\t\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t\t * observables.\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttrips.addAll(buffer);\n\t\t\t\t\t\ttstrips.addAll(tbuffer);\n\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\tmax_distance = 0;\n\t\t\t\t\t}\n\t\t\t\t} catch (ParseException parseException) {\n\t\t\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tbuffer.add(towers[i]);\n\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(0));\n\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + Arrays.toString(trips.toArray(new\n\t\t// String[trips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\t// System.out.println(\"time stamps:\\t\" +\n\t\t// Arrays.toString(tstrips.toArray(new\n\t\t// String[tstrips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\n\t}", "public Obs algorithm2_4(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\n\t\tfor (int i = 0; i < towers.length;) {\n\t\t\tboolean flag = true;\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// buffer.add(towers[i]);\n\t\t\t// tbuffer.add(tstamps[i]);\n\t\t\tif (max_distance > dist_th) {\n\t\t\t\tjava.util.Date sTime;\n\t\t\t\tjava.util.Date eTime;\n\t\t\t\tflag = false;\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tsTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\teTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\n\t\t\t\t\tcal.setTime(sTime);\n\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\t\t\t\t} catch (ParseException parseException) {\n\t\t\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t\t\t}\n\n\t\t\t\tif (time_diff >= time_th) {\n\t\t\t\t\tflag = true;\n\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t */\n\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t */\n\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t * observables.\n\t\t\t\t\t */\n\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t\t\t\tbuffer.remove(0);\n\t\t\t\t\ttbuffer.remove(0);\n\n\t\t\t\t\t// i--; // to keep a as it is.\n\n\t\t\t\t\t// buffer = new ArrayList<>();\n\t\t\t\t\t// tbuffer = new ArrayList<>();\n\t\t\t\t\tmax_distance = 0;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (flag) {\n\t\t\t\tbuffer.add(towers[i]);\n\t\t\t\ttbuffer.add(tstamps[i]);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(0));\n\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + Arrays.toString(trips.toArray(new\n\t\t// String[trips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\t// System.out.println(\"time stamps:\\t\" +\n\t\t// Arrays.toString(tstrips.toArray(new\n\t\t// String[tstrips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\n\t}", "public Obs algorithm2(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * trips sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\t\ttry {\n\n\t\t\tdouble max_distance = 0;\n\t\t\tint time_diff = 0;\n\t\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tbuffer.add(towers[i]);\n\t\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\tjava.util.Date eTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\t\tif (time_diff > time_th) {\n\n\t\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t\t * observables.\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttrips.addAll(buffer);\n\t\t\t\t\t\ttstrips.addAll(tbuffer);\n\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\tmax_distance = 0;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (NumberFormatException numberFormatException) {\n\t\t\tSystem.err.println(\"NumberFormatException\\t\" + numberFormatException.getMessage());\n\t\t} catch (ParseException parseException) {\n\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t}\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\n\t\t}\n\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t}", "public Obs algorithm2_5(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\n\t\tfor (int i = 0; i < towers.length;) {\n\t\t\tboolean flag = true;\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// buffer.add(towers[i]);\n\t\t\t// tbuffer.add(tstamps[i]);\n\t\t\tif (max_distance > dist_th) {\n\t\t\t\tjava.util.Date sTime;\n\t\t\t\tjava.util.Date eTime;\n\t\t\t\tflag = false;\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tsTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\teTime = formatter.parse(tstamps[i]);\n\n\t\t\t\t\tcal.setTime(sTime);\n\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\t\t\t\t} catch (ParseException parseException) {\n\t\t\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t\t\t}\n\n\t\t\t\tif (time_diff >= time_th) {\n\t\t\t\t\tflag = true;\n\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t */\n\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t */\n\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t * observables.\n\t\t\t\t\t */\n\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t\t\t\tbuffer.remove(0);\n\t\t\t\t\ttbuffer.remove(0);\n\n\t\t\t\t\t// i--; // to keep a as it is.\n\n\t\t\t\t\t// buffer = new ArrayList<>();\n\t\t\t\t\t// tbuffer = new ArrayList<>();\n\t\t\t\t\tmax_distance = 0;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (flag) {\n\t\t\t\tbuffer.add(towers[i]);\n\t\t\t\ttbuffer.add(tstamps[i]);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(0));\n\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + Arrays.toString(trips.toArray(new\n\t\t// String[trips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\t// System.out.println(\"time stamps:\\t\" +\n\t\t// Arrays.toString(tstrips.toArray(new\n\t\t// String[tstrips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\n\t}", "public Obs findStops_trips(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY)\n\t\t\tthrows ParseException {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tString stops = towers[0];\n\t\tString tstops = tstamps[0];\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbuffer.add(towers[i]);\n\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\t/**\n\t\t\t\t * if the time exceeds timing threshold, then check the distance\n\t\t\t\t * between towers. If this distance less than the distance\n\t\t\t\t * threshold, then previous tower is the end of the current\n\t\t\t\t * trip.\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\tjava.util.Date eTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\t\t\t\tcal.setTime(sTime);\n\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\tcal.setTime(eTime);\n\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\tif (time_diff > time_th) {\n\t\t\t\t\t// if (buffer.size() >= trip_length) {\n\t\t\t\t\tif (!stops.isEmpty()) {\n\t\t\t\t\t\tstops += CLM;\n\t\t\t\t\t\ttstops += CLM;\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * Add start and end of the trips to the stop sequences\n\t\t\t\t\t */\n\t\t\t\t\tstops += buffer.get(buffer.size() - 1);\n\t\t\t\t\ttstops += tbuffer.get(tbuffer.size() - 1);\n\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t\t// else {\n\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t/**\n\t\t\t\t * Reset maximum distances\n\t\t\t\t */\n\t\t\t\tmax_distance = 0;\n\t\t\t\t// }\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\t// if (buffer.size() >= trip_length) {\n\t\t\tif (!stops.isEmpty()) {\n\t\t\t\tstops += CLM;\n\t\t\t\ttstops += CLM;\n\t\t\t}\n\t\t\t/**\n\t\t\t * Add start and end of the trips to the stop sequences\n\t\t\t */\n\t\t\tstops += buffer.get(buffer.size() - 1);\n\t\t\ttstops += tbuffer.get(tbuffer.size() - 1);\n\n\t\t\t// }\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + stops);\n\t\t// System.out.println(\"time stamps:\\t\" + tstops);\n\t\treturn new Obs(stops, tstops);\n\n\t}", "int minLatest2(int[] times, int rest) {\n\t\t// pattern 1: <- AB, A ->, YZ <-, B ->\n\t\tint cand1 = times[1] + times[0] + times[rest - 1] + times[1];\n\t\t// pattern 2: <- AZ, A ->, AY <-, A ->\n\t\tint cand2 = times[rest - 1] + times[0] + times[rest - 2] + times[0];\n\t\treturn min(cand1, cand2);\n\t}", "private boolean overlaps(ThingTimeTriple a, ThingTimeTriple b)\r\n/* 227: */ {\r\n/* 228:189 */ return (a.from < b.to) && (a.to > b.from);\r\n/* 229: */ }", "private Pair Flats(double[] notes){\n\t\t//Bb (at 10) is the first one\n\t\t//Also, Cb = B and Fb = E\n\t\tdouble error = 0;\n\t\tint bestkey = 7;\n\t\t//First check for the keys with Cb and Fb\n\t\tint[] drkeys = new int[]{1, 6, 8};\n\t\tfor(int i: drkeys){\n\t\t\terror += notes[i+1];\n\t\t}\n\t\terror += notes[0];\n\t\tif (notes[5]<notes[4]){\n\t\t\terror+=notes[5];\n\t\t}\n\t\telse{\n\t\t\terror+=notes[4];\n\t\t\tbestkey = 6;\n\t\t}\n\t\tfor(int i=0; i<6; i++){\n\t\t\tdouble tp = flatsError(notes, i);\n\t\t\tif (tp < error){\n\t\t\t\terror = tp;\n\t\t\t\tbestkey =i;\n\t\t\t}\n\t\t}\n\t\treturn new Pair(error, bestkey);\n\t}", "public static int matchingPairs(String s, String t) {\n if(s.length() != t.length()) return 0;\r\n StringBuilder sb1 = new StringBuilder();\r\n StringBuilder sb2 = new StringBuilder();\r\n int res = 0;\r\n boolean hasDuplicates = false; //Edge Case where if it has Dups then you can just to inner swap and you will get same result\r\n Set<Character> dupsCheckSet = new HashSet<>();\r\n\r\n for(int idx = 0; idx < s.length(); idx++){\r\n if(s.charAt(idx) != t.charAt(idx)){\r\n sb1.append(s.charAt(idx));\r\n sb2.append(t.charAt(idx));\r\n }else {\r\n if(!dupsCheckSet.add(s.charAt(idx))){\r\n hasDuplicates = true;\r\n }\r\n res++;\r\n }\r\n }\r\n\r\n //if both string are same then you don't have to calculate\r\n if(sb1.length() == 0){\r\n if(hasDuplicates){\r\n return res;\r\n }\r\n return res - 2;\r\n }\r\n\r\n Map<Character, Integer> mapS = new HashMap<>(), mapT = new HashMap<>();\r\n for (int idx = 0; idx < sb1.length(); idx++){ //\"bd\",\"db\";\r\n //if mapS contains chars from sb2 then if we swap them with each other it will be a matching pair\r\n if(mapS.containsKey(sb2.charAt(idx))){\r\n res++;\r\n }\r\n //if both Chars are reverse of each other then we can switch and add 1 to it\r\n if(mapS.getOrDefault(sb2.charAt(idx), -1) == mapT.getOrDefault(sb1.charAt(idx), -2)){\r\n return res + 1;\r\n }\r\n mapS.put(sb1.charAt(idx), idx);\r\n mapT.put(sb2.charAt(idx), idx);\r\n }\r\n\r\n\r\n return res + ((sb1.length() == 1) ? -1 : 0);\r\n }", "Stream<Pair<T, Long>> withTimestamp(@Nullable String name);", "public static String timestampTilStrengForKalender(Timestamp timestamp) {\r\n\t\tString dato = timestamp.toString();\r\n\t\tif (dato == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tString[] datoOgKlokke = dato.split(\" \");\r\n\t\tString[] fiksdatoen = datoOgKlokke[0].split(\"-\");\r\n\t\tString str = String.join(\"-\", fiksdatoen);\r\n\t\tString finalDato = str + \"T\" + datoOgKlokke[1];\r\n\t\treturn finalDato.substring(0, 16) + \":00\";\r\n\t}", "public Obs filter(Obs obs, int time_th, int L) {\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\t\tString seq = obs.getSeq();\n\t\tString stamps = obs.getTimeStamp();\n\n\t\tString fseq = \"\";\n\t\tString fstamps = \"\";\n\n\t\tString[] towerSubseqs = new String[] { seq };\n\t\tString[] stampSubseqs = new String[] { stamps };\n\t\tif (seq.contains(RLM)) {\n\t\t\ttowerSubseqs = seq.split(RLM);\n\t\t\tstampSubseqs = stamps.split(RLM);\n\t\t}\n\n\t\tfor (int i = 0; i < towerSubseqs.length; i++) {\n\n\t\t\tString[] towers = towerSubseqs[i].trim().split(CLM);\n\t\t\tString[] tstamps = stampSubseqs[i].trim().split(CLM);\n\n\t\t\t// System.out.println(towers.length + \"\\t\" +\n\t\t\t// Arrays.toString(towers));\n\t\t\t/**\n\t\t\t * If the trip length less than specific length ignore it.\n\t\t\t */\n\t\t\tif (towers.length < L) {\n\t\t\t\t// System.out.println(\"towers.length <= L\");\n\t\t\t\ttowerSubseqs[i] = \"-\";\n\t\t\t\tstampSubseqs[i] = \"-\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tboolean[] marks = new boolean[towers.length];\n\n\t\t\tfor (int j = 1; j < towers.length; j++) {\n\t\t\t\ttry {\n\n\t\t\t\t\tif (!towers[j - 1].equals(towers[j])) {\n\t\t\t\t\t\t// System.out.println(\"! \" + towers[j - 1] + \" equals( \"\n\t\t\t\t\t\t// + towers[j] + \" )\");\n\t\t\t\t\t\tmarks[j] = true;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tDate sTime = formatter.parse(tstamps[j - 1]);\n\t\t\t\t\tDate eTime = formatter.parse(tstamps[j]);\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tint diff = (ehour - hour) * HOUR + (eminute - minute);\n\t\t\t\t\t/**\n\t\t\t\t\t * check time difference with time threshold whatever the\n\t\t\t\t\t * distance between the starting tower\n\t\t\t\t\t */\n\t\t\t\t\tif (diff < time_th) {\n\t\t\t\t\t\t// System.out.println(\"diff < time_th\");\n\t\t\t\t\t\tmarks[j] = false;\n\t\t\t\t\t}\n\t\t\t\t} catch (ParseException ex) {\n\t\t\t\t\tLogger.getLogger(ObsTripsBuilder.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\t\t}\n\t\t\t}\n\t\t\t/**\n\t\t\t * construct sequences from towers: <\\n If the length of the trinp\n\t\t\t * after removing the repeated values less than L ignore it else\n\t\t\t * construct a trip from the non-removed observations.>\n\t\t\t */\n\t\t\t// System.out.println(\"length\\t\" + length);\n\t\t\t// if (length <= L) {\n\t\t\t// System.out.println(\"length <= L\\t\" + length);\n\t\t\t// towerSubseqs[i] = \"-\";\n\t\t\t// stampSubseqs[i] = \"-\";\n\t\t\t// } else {\n\n\t\t\tString tmpObs = \"\";\n\t\t\tString tmpTime = \"\";\n\n\t\t\tfor (int j = 0; j < marks.length; j++) {\n\t\t\t\tboolean mark = marks[j];\n\t\t\t\tif (mark) {\n\t\t\t\t\tif (!tmpObs.isEmpty()) {\n\t\t\t\t\t\ttmpObs += CLM;\n\t\t\t\t\t\ttmpTime += CLM;\n\t\t\t\t\t}\n\t\t\t\t\ttmpObs += towers[j];\n\t\t\t\t\ttmpTime += tstamps[j];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// System.out.println(\"last \\t\" + tmpObs.split(CLM).length + \"\\t\" +\n\t\t\t// Arrays.toString(tmpObs.split(CLM)));\n\t\t\tif (tmpObs.split(CLM).length > L) {\n\t\t\t\ttowerSubseqs[i] = tmpObs;\n\t\t\t\tstampSubseqs[i] = tmpTime;\n\t\t\t}\n\n\t\t\t// }\n\t\t}\n\t\t/**\n\t\t * Construct trips\n\t\t */\n\t\tfor (int i = 0; i < towerSubseqs.length; i++) {\n\t\t\tif (!towerSubseqs[i].equals(\"-\")) {\n\t\t\t\tif (!fseq.isEmpty()) {\n\t\t\t\t\tfseq += RLM;\n\t\t\t\t\tfstamps += RLM;\n\t\t\t\t}\n\n\t\t\t\tfseq += towerSubseqs[i];\n\t\t\t\tfstamps += stampSubseqs[i];\n\t\t\t}\n\t\t}\n\n\t\treturn new Obs(fseq, fstamps);\n\t}", "private static void findPair(int[] nums, int target, int start, List<List<Integer>> result) {\n int end = nums.length - 1;\n\n while (start < end) {\n int diff = target - nums[start] - nums[end];\n\n if (diff == 0) {\n ArrayList<Integer> triplet = new ArrayList<>();\n triplet.add(target * -1);\n triplet.add(nums[start]);\n triplet.add(nums[end]);\n result.add(triplet);\n start++;\n end--;\n\n while (start < end && nums[start] == nums[start - 1]) {\n start++;\n }\n\n while (start < end && nums[end] == nums[end + 1]) {\n end--;\n }\n } else if (diff > 0) {\n start++;\n } else {\n end--;\n }\n }\n }", "public int findPairsTwoPointers(int[] nums, int k) {\n if (k < 0) {\n return 0;\n }\n Arrays.sort(nums); // O(N*logN)\n\n int i = 0;\n int j = 1;\n int count = 0;\n while (j < nums.length) { // O(N)\n if (i == j || nums[j] - nums[i] < k) {\n j++;\n } else if (nums[j] - nums[i] > k) {\n i++;\n } else {\n count += 1;\n j++;\n while (j < nums.length && nums[j] == nums[j - 1]) {\n j++;\n }\n }\n }\n return count;\n }", "long getTimeUntilNextTransit(Coordinates coord, long time) throws AstrometryException;", "public int findMinDifference(List<String> timePoints) {\n List<Integer> p = new ArrayList<>();\n for(String time:timePoints){\n String[] hm = time.split(\":\");\n int h = Integer.parseInt(hm[0]);\n int m = Integer.parseInt(hm[1]);\n p.add(h*60 + m);\n if(h<12){\n p.add((h+24)*60+m);\n }\n }\n int diff = Integer.MAX_VALUE;\n Collections.sort(p);\n for(int i=1; i<p.size(); i++){\n diff = Math.min(p.get(i)-p.get(i-1), diff);\n }\n return diff;\n }", "public boolean twoPair(int[] numArr) {\n\t\tfor (int i = 1; i < numArr.length-2; i++) {\n\t\t\tif (numArr[i-1]==numArr[i]&&numArr[i]==numArr[i+1]){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public long refineTimestamp(long timestamp) {\n long time = (timestamp / windowSlotSize) * windowSlotSize;\n return time;\n }", "protected ArrayList<int[]> findAdjacentRisk(int[] pair) {\n\t\tint x = pair[0];\n\t\tint y = pair[1];\n\t\tArrayList<int[]> neighbors = new ArrayList<int[]>();\n\t\tfor (int i = x - 1; i <= x + 1; i++) {\n\t\t\tfor (int j = y - 1; j <= y + 1; j++) {\n\t\t\t\tif (i >= 0 && i < maxX && j >= 0 && j < maxY ) {\n\t\t\t\t\tif (coveredMap[i][j] == SIGN_UNKNOWN || coveredMap[i][j] == SIGN_MARK) {\n\t\t\t\t\t\tneighbors.add(new int[]{i, j});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn neighbors;\n\t}", "protected ArrayList<int[]> findAdjacentMark(int[] pair) {\n\t\tint x = pair[0];\n\t\tint y = pair[1];\n\t\tArrayList<int[]> neighbors = new ArrayList<int[]>();\n\t\tfor (int i = x - 1; i <= x + 1; i++) {\n\t\t\tfor (int j = y - 1; j <= y + 1; j++) {\n\t\t\t\tif (i >= 0 && i < maxX && j >= 0 && j < maxY && coveredMap[i][j] == SIGN_MARK) {\n\t\t\t\t\tneighbors.add(new int[]{i, j});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn neighbors;\n\t}", "public ListNode loopDetection2(ListNode head) {\r\n if (head == null || head.next == null || head.next.next == null) {\r\n return null;\r\n }\r\n ListNode slow = head.next, fast = head.next.next;\r\n\r\n //Find meeting point. This will be LOOP_SIZE - k steps into the linked list. */\r\n while (fast != null && fast.next != null) {\r\n slow = slow.next;\r\n fast = fast.next.next;\r\n //Collision\r\n if (slow == fast) {\r\n break;\r\n }\r\n }\r\n\r\n //Error check - no meeting point, and therefore no loop\r\n if (fast == null || fast.next == null) {\r\n return null;\r\n }\r\n\r\n //Move slow to Head. Keep fast at Meeting Point. Each are k steps from the\r\n //Loop Start. If they move at the same pace, they must meet at Loop Start.\r\n slow = head;\r\n while (slow != fast) {\r\n slow = slow.next;\r\n fast = fast.next;\r\n }\r\n\r\n /* Both now point to the start of the loop. */\r\n return fast;\r\n\r\n }", "public static int findPath(int currentTime[],int tLeave[], int timeStation[][], int transferTime[][], int totalStations) {\n\t\tint numofLines = currentTime.length;\n\t\tif(numofLines != 2){\n\t\t\tSystem.err.println(\"Only two assembly line supported\");\n\t\t\treturn -1;\n\t\t}\n\t\t//Cost function array\n\t\tint f[][] = new int[numofLines][totalStations];\n\t\t//Station index back track array\n\t\tint i[][] = new int[numofLines][totalStations];\n\t\t\n\t\t//Final Cost and Final Station\n\t\tint finalCost = 0;\n\t\tint lastStation = 0;\n\t\t\n\t\t//Time for first station\n\t\tf[0][0] = currentTime[0]+timeStation[0][0];\n\t\tf[1][0] = currentTime[1]+timeStation[1][0];\n\t\t\n\t\t\n\t\tfor (int j = 1; j < totalStations; j++) {\n\t\t\t\n\t\t\t\n\t\t\tif((f[0][j-1] + timeStation[0][j]) <= (f[1][j-1]+ transferTime[1][j-1]+timeStation[0][j])){\n\t\t\t\tf[0][j]= f[0][j-1]+ timeStation[0][j];\n\t\t\t\ti[0][j] = 0;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tf[0][j]= f[1][j-1]+ transferTime[1][j-1]+timeStation[0][j];\n\t\t\t\ti[0][j]=1;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(f[1][j-1] + timeStation[1][j] <= f[0][j-1]+ transferTime[0][j-1]+timeStation[1][j]){\n\t\t\t\tf[1][j]= f[1][j-1]+ timeStation[1][j];\n\t\t\t\ti[1][j] = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tf[1][j]= f[0][j-1]+ transferTime[0][j-1]+timeStation[1][j];\n\t\t\t\ti[1][j] = 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tif((f[0][totalStations-1]+tLeave[0]) <= (f[1][totalStations-1]+tLeave[1] )){\n\t\t\tfinalCost = f[0][totalStations-1]+tLeave[0];\n\t\t\tlastStation = 0;\n\t\t}\n\t\telse{\n\t\t\tfinalCost = f[1][totalStations-1]+tLeave[1] ;\n\t\t\tlastStation = 1;\n\t\t}\t\n\t\n\t\tprintStation(lastStation,finalCost, i, totalStations);\n\t\treturn finalCost;\n\t}", "private void establishPairings() {\n int splineIdx = 0;\n double splineDist = 0.0;\n double seqDist = 0.0;\n Pt pt;\n Pt prevSeq = sequence.get(0);\n Pt prevSpline;\n for (int seqIdx=0; seqIdx < sequence.size(); seqIdx++) {\n\n // part 1: get pt and seqDist set up correctly\n pt = sequence.get(seqIdx);\n seqDist += prevSeq.distance(pt);\n prevSeq = pt;\n\n // part 2: find index of spline point that is just past where we\n // want to be, then find the interpolated point between our\n // known point and that spline point. Set the \"tween\" attribute\n // of the sequence point.\n double additionalDist = 0.0;\n prevSpline = spline.get(splineIdx);\n Pt spt;\n for (int sidx = splineIdx; sidx < spline.size(); sidx++) {\n\tspt = spline.get(sidx);\n\tadditionalDist = spt.distance(prevSpline);\n\tif (additionalDist + splineDist >= seqDist) {\n\t // the target point is between splineIdx and sidx\n\t Pt target = Functions.getPointAtDistance(spline, splineIdx, splineDist, 1, seqDist);\n\t pt.setAttribute(\"tween\", target);\n\t break;\n\t} else if (sidx >= (spline.size() -1)) {\n\t pt.setAttribute(\"tween\", spline.getLast());\n\t}\n\tprevSpline = spt;\n\tsplineIdx = sidx;\n\tsplineDist += additionalDist;\n }\n }\n }", "public static int findSeat(int[] gap) {\n int place = (gap[1] - gap[0]);\n place = place / 2;\n\n return gap[1] - place;\n }", "private void removeOldestPoint() {\n PathPoint p = points.get(points.size() - length - 1);\n // if points has 5 points (0-4), length=3, then remove points(5-3-1)=points(1) leaving 2-4 which is correct\n float t = p.t - firstTimestamp;\n st -= t;\n sx -= p.x;\n sy -= p.y;\n stt -= t * t;\n sxt -= p.x * t;\n syt -= p.y * t;\n }", "void processScanCoordinates(List<Long> scanTimeStampList, String scanType){\n List<LatLng> scanCoordinates = new ArrayList<>();\n System.out.println(\"LENGTH BEFOREEEE\" + scanTimeStampList.size() + scanType);\n for(int i = 0; i < stepTimeStamp.size()-1;i++){\n long upperTimeBound = stepTimeStamp.get((i+1));\n long lowerTimeBound = stepTimeStamp.get(i);\n List<Integer> scanIndexWithinStep = new ArrayList<>();\n //Searches through the list of timestamps and adds the scan numbers that fall within the step to a list\n for(int j = 0; j < scanTimeStampList.size();j++){\n if(scanTimeStampList.get(j) <= upperTimeBound && scanTimeStampList.get(j)> lowerTimeBound){\n scanIndexWithinStep.add(j);\n }\n }\n if(scanIndexWithinStep.size()>0) {\n //Can loop through them as they will be sequential\n for (int k = scanIndexWithinStep.get(0); k <= scanIndexWithinStep.get(scanIndexWithinStep.size() - 1); k++) {\n //Run the algorithm for each scan that falls within the time range for each step\n double tempLat;\n double tempLong;\n //Formula from Dr. Zheng's paper\n // i here represents the number of steps as the index number in adaptiveTimeList is the step number\n if (xIncreasing) {\n tempLat = startLat + STEP_LENGTH * (i + (double) (scanTimeStampList.get(k) - lowerTimeBound) / (double) (upperTimeBound - lowerTimeBound)) * yCompMotion * degToMRatio;\n } else {\n tempLat = startLat - STEP_LENGTH * (i + (double) (scanTimeStampList.get(k) - lowerTimeBound) / (double) (upperTimeBound - lowerTimeBound)) * yCompMotion * degToMRatio;\n }\n if (yIncreasing) {\n tempLong = startLong + STEP_LENGTH * (i + (double) (scanTimeStampList.get(k) - lowerTimeBound) / (double) (upperTimeBound - lowerTimeBound)) * xCompMotion * degToMRatio;\n } else {\n tempLong = startLong - STEP_LENGTH * (i + (double) (scanTimeStampList.get(k) - lowerTimeBound) / (double) (upperTimeBound - lowerTimeBound)) * xCompMotion * degToMRatio;\n }\n scanCoordinates.add(new LatLng(tempLat, tempLong));\n }\n }\n\n }\n System.out.println(\"LENGTHHHH AFTER\" + scanCoordinates.size() + scanType);\n if(scanType == \"mag\"){\n magCoords = scanCoordinates;\n }\n else if(scanType == \"gyro\"){\n gyroCoords = scanCoordinates;\n }\n else if(scanType == \"accel\"){\n accelCoords = scanCoordinates;\n }\n else if(scanType == \"blue\"){\n blueGlobalCoords = scanCoordinates;\n }\n else if(scanType == \"red\"){\n redGlobalCoords = scanCoordinates;\n }\n }", "private static int findPair(boolean[][] isFriends, boolean[] alreadyPaired, int numStudents) {\n int target = -1;\n for (int i = 0; i < numStudents; i++) {\n if (!alreadyPaired[i]) {\n target = i;\n break;\n }\n }\n \n if (target == -1)\n return 1;\n \n int count = 0;\n \n for (int i = target + 1; i < numStudents; i++) {\n if (!alreadyPaired[i] && isFriends[target][i]) {\n alreadyPaired[i] = true;\n alreadyPaired[target] = true;\n count += findPair(isFriends, alreadyPaired, numStudents);\n alreadyPaired[i] = false;\n alreadyPaired[target] = false;\n \n }\n }\n return count;\n }", "protected TimeInstant findCrossoverTime(TimeInstant t1, double y1, TimeInstant t2, double y2) {\n return t1.add( -y1 * ( t2.subtract(t1).doubleValue() ) / ( (double) (y2 - y1) ) );\n }", "private int findSecondPolynomial(double temperature) {\n int firstIndex = -1;\n if (polynomials ==null || polynomials.length==0) return BadIndex;\n for (int index=0; index< polynomials.length; index++) {\n if (polynomials[index].isInRange(temperature)) {\n if (firstIndex==-1) firstIndex=index; // no first index\n else return index; // First index exists. So this must be the second.\n }\n }\n return BadIndex;\n }", "public boolean hasTwoPairs() {\n\t\t\n\t\tboolean paired = false;\n\t\t\n\t\tif (firstDigit == secondDigit && thirdDigit == forthDigit) {paired = true;}\n\t\telse if (firstDigit == thirdDigit && secondDigit == forthDigit) {paired = true;}\n\t\telse if (firstDigit == forthDigit && secondDigit == thirdDigit) {paired = true;}\n\t\t\n\t\treturn paired;\n\t}", "public static TrafficSnapshot extractInfo(String timestamp) {\n // \"2016-12-01T05:00:00 5\" -> (\"2016-12-01\", \"05:00:00 5\")\n String[] split = timestamp.split(\"T\");\n String date = split[0];\n // \"5:00:00 5\" -> (\"05:00:00\", \"5\")\n String[] timeAndCars = split[1].split(\" \");\n String time = timeAndCars[0];\n int cars = Integer.parseInt(timeAndCars[1]);\n TrafficSnapshot ts = new TrafficSnapshot(date, time, cars);\n return ts;\n }", "private ArrayList findBestShiftGraph (TimeSeries timeSeries)\n {\n ArrayList candidateShiftGraph = new ArrayList (timeSeries.size() / 2);\n ArrayList bestShiftGraph = new ArrayList ();\n\n int matchCount = 0;\n int bestMatchCount = 0;\n int shiftOffset = 0;\n int bestShiftOffset = 0;\n\n // we can stop correlation runs when we get to point where remaining portion is too small\n int lastShiftOffset = timeSeries.size() - this.minPeriodLength;\n\n // successively shift to a starting point further to the right in the time series.\n for (shiftOffset = minPeriodLength; shiftOffset < lastShiftOffset; shiftOffset++)\n {\n matchCount = 0;\n candidateShiftGraph.clear();\n\n // compare the shifted version against as much of a non-shifted version as possible\n //the number of elements to compare decreases by one each time as shifting occurs\n int lastComparisonIndex = timeSeries.size() - shiftOffset;\n for (int j = 0 ; j < lastComparisonIndex; j++)\n {\n Double staticElement = null;\n Double shiftElement = null;\n\n // get the shifted element and the static one and comparet them for equality\n try\n {\n TimeSeriesValue staticVal = timeSeries.getValueAt (j);\n TimeSeriesValue shiftVal = timeSeries.getValueAt (j + shiftOffset);\n\n staticElement = new Double (((Number)staticVal.getValue()).doubleValue());\n shiftElement = new Double (((Number)shiftVal.getValue()).doubleValue());\n }\n catch (Exception e)\n {\n candidateShiftGraph.add (null);\n }\n\n // if elements are equal add that value to the shift graph, otherwise add null\n if (elementsAreEqual (staticElement, shiftElement))\n {\n candidateShiftGraph.add (staticElement);\n matchCount++;\n }\n else\n candidateShiftGraph.add (null);\n\n } // end for (j)\n\n // determine if this shift attempt resulted in more matches that anything previously tried\n // if so make this our 'best' attempt.\n if (matchCount > bestMatchCount)\n {\n bestMatchCount = matchCount;\n bestShiftOffset = shiftOffset;\n\n bestShiftGraph.clear();\n bestShiftGraph.addAll (candidateShiftGraph);\n candidateShiftGraph.clear();\n\n df.addText (\"Found new best shift graph : \" + bestShiftGraph.toString());\n } // end if\n } // end for (shiftOffset)\n\n return bestShiftGraph;\n }", "public static long pair(long a, long b) {\n if (a > -1 || b > -1) {\n //Creating an array of the two inputs for comparison later\n long[] input = {a, b};\n\n //Using Cantors paring function to generate unique number\n long result = (long) (0.5 * (a + b) * (a + b + 1) + b);\n\n /*Calling depair function of the result which allows us to compare\n the results of the depair function with the two inputs of the pair\n function*/\n if (Arrays.equals(depair(result), input)) {\n return result; //Return the result\n } else {\n return -1; //Otherwise return rouge value\n }\n } else {\n return -1; //Otherwise return rouge value\n }\n }", "private static Pair closest_pair(ArrayList<Point> pointset){\n\t\treturn null;\n\t}", "private List<GPairRecord<S,S>> getCrossingPairs(final Predicate<Pair<S, S>> predicate) {\n\n // get first and last terminal for each non-terminal\n Pair<S, S>[] pairs = getFirstLastMappingArray();\n\n // list of records of crossing pairs\n List<GPairRecord<S,S>> recordList = new ArrayList<>();\n\n // scan for crossing pairs in the right order\n slp.getOrderedProductions().stream().map(p -> p.getLeft()).forEach(nonTerminal -> consumeCrossingPairs(nonTerminal, recordList::add, pairs, predicate));\n return recordList;\n }", "private Vector getTimeSeg(Stroke theStroke)\n\t{\n\t\tdouble[] timeData = theStroke.getTimeData();\n\t\tm_timeSeg = new TimeBasedDetection(timeData);\n\t\tVector segPt_time = m_timeSeg.detectSegmentPoints();\n\t\treturn segPt_time;\n\t}", "private static long getTimestampStart(long timestamp, long start) {\n long timestampStart = 0;\n for (long i = timestamp; i >= timestamp-60; i--) {\n if ((i-start) % 60 == 0) {\n timestampStart = i;\n break;\n }\n }\n return timestampStart;\n }", "public long getDifference(final Timestamp timestamp) {\n return getDifference(timestamp.get());\n }", "private int twoPairs() {\n\t\tint check = 0;\n\t\tint[] pairPos = new int[2];\n\t\tfor (int counter = POS_ONE; counter < Constants.HAND_SIZE; counter++) {\n\t\t\tif (hand[counter - 1].getValueIndex() == hand[counter].getValueIndex()) {\n\t\t\t\tpairPos[check] = counter;\n\t\t\t\tcheck++;\n\t\t\t}\n\t\t}\n\t\tif (check == 2) {\n\t\t\tresult.setPrimaryValuePos(hand[pairPos[1]].getValueIndex());\n\t\t\tresult.setSecondaryValuePos(hand[pairPos[0]].getValueIndex());\n\t\t\tList<Card> tertiaryValue = Arrays.stream(hand)\n\t\t\t\t\t.filter(card -> card.getValueIndex() != hand[pairPos[0]].getValueIndex())\n\t\t\t\t\t.filter(card -> card.getValueIndex() != hand[pairPos[1]].getValueIndex())\n\t\t\t\t\t.collect(Collectors.toList());\n\t\t\tresult.setTertiaryValuePos(tertiaryValue.get(0).getValueIndex());\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "boolean isTwoPair();", "public int compareToTimestamp(long timestamp)\n {\n return Long.compare(divPosition, timestamp / size);\n }", "private Vector<Vector<BusStopInfo>> findRek (BusStopInterface from, BusStopInterface to, Vector <BusStopInfo> toInfo, Vector<BusStopInfo> visited, int swaps, int transfers )\r\n {\r\n Vector<Vector<BusStopInfo>> sciezka = new Vector<Vector<BusStopInfo>>();\r\n \r\n if(from.getName()==to.getName())\r\n {\r\n sciezka.add(toInfo);\r\n return sciezka;\r\n }\r\n\r\n for(BusStopInfo vis: visited)\r\n {\r\n if(vis.awtobus.busLine.getBusStop(vis.pozycja).getName()==from.getName())\r\n return sciezka;\r\n }\r\n\r\n Vector <BusStopInfo> fromInfo = findStopInfo(from);\r\n\r\n fromInfo = infoFilter(fromInfo, toInfo);\r\n\r\n for(BusStopInfo info: fromInfo)\r\n {\r\n int swapsNow = swaps;\r\n if(visited.size()>0 && info.awtobus.bus.getBusNumber()!=visited.lastElement().awtobus.bus.getBusNumber())\r\n {\r\n swapsNow++;\r\n }\r\n\r\n if(swapsNow <= transfers)\r\n {\r\n int nextPosition = info.pozycja +1; //ide do przodu linii\r\n int prevPosition = info.pozycja -1; //ide do tyłu linii\r\n\r\n Vector<BusStopInfo> temp = new Vector<BusStopInfo>(visited);\r\n temp.add(info);\r\n Vector<Vector<BusStopInfo>> result ;\r\n if(nextPosition<info.awtobus.busLine.getNumberOfBusStops())\r\n {\r\n BusStopInterface nextStop = info.awtobus.busLine.getBusStop(nextPosition);\r\n result = findRek(nextStop, to, toInfo, temp, swapsNow, transfers);\r\n for(Vector<BusStopInfo> res: result)\r\n {\r\n res.add(0, info);\r\n sciezka.add(res);\r\n }\r\n }\r\n if(prevPosition >= 0)\r\n {\r\n BusStopInterface prevStop = info.awtobus.busLine.getBusStop(prevPosition);\r\n result = findRek(prevStop, to, toInfo, temp, swapsNow, transfers);\r\n for(Vector<BusStopInfo> res: result)\r\n {\r\n res.add(0, info);\r\n sciezka.add(res);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return sciezka;\r\n }", "private static boolean hasSignOfZoneOffset(String ts) {\n if (ts.indexOf('+') > 0) {\n return true;\n }\n int pos = 0;\n for (int i = 0; i < 3; i++) {\n pos = ts.indexOf('-', pos + 1);\n if (pos < 0) {\n return false;\n }\n }\n return true;\n }", "public int findMinDifference(List<String> timePoints) {\n\t\tboolean checkTime[] = new boolean[24*60];\n\t\tfor(String timePoint : timePoints) {\n\t\t\tString[] time = timePoint.split(\":\");\n\t\t\tint minutes = Integer.parseInt(time[0])*60 + Integer.parseInt(time[1]);\n\t\t\tif(checkTime[minutes]) return 0;\n\t\t\tcheckTime[minutes] = true;\n\t\t}\n\t\t\n\t\tint minDifference = Integer.MAX_VALUE;\n\t\tint firstMinutes = 0, prevMinutes = -1;\n\t\tfor(int i = 0; i < checkTime.length; i++) {\n\t\t\tif(checkTime[i]) {\n\t\t\t\tif(prevMinutes != -1) {\n\t\t\t\t\tminDifference = Math.min(minDifference, (i-prevMinutes) > 720 ? (1440-i+prevMinutes) : (i-prevMinutes));\n\t\t\t\t} else {\n\t\t\t\t\tfirstMinutes = i;\n\t\t\t\t}\n\t\t\t\tprevMinutes = i;\n\t\t\t}\n\t\t}\n\t\tminDifference = Math.min(minDifference, (prevMinutes-firstMinutes) > 720 ? (1440-prevMinutes+firstMinutes) : (prevMinutes-firstMinutes));\n\t\treturn minDifference;\n\t}", "public ArrayList<Coordinate> transportLinePath()\r\n {\r\n Coordinate next_street1 = null;\r\n Coordinate next_street2 = null;\r\n Street next_street = null;\r\n ArrayList<Coordinate> line_coordinates = new ArrayList<Coordinate>();\r\n\r\n for (int i = 0; i < getStreetsMap().size(); i++)\r\n {\r\n Street s = getStreetsMap().get(i);\r\n Coordinate this_street1 = s.getCoordinates().get(0);\r\n Coordinate this_street2 = s.getCoordinates().get(2);\r\n\r\n if (i + 1 < getStreetsMap().size())\r\n {\r\n next_street = getStreetsMap().get(i+1);\r\n next_street1 = next_street.getCoordinates().get(0);\r\n next_street2 = next_street.getCoordinates().get(2);\r\n }\r\n else\r\n {\r\n break;\r\n }\r\n\r\n for (Stop stop : getStopsMap())\r\n {\r\n if (stop.getStreet().equals(s))\r\n {\r\n line_coordinates.add(stop.getCoordinate());\r\n }\r\n }\r\n\r\n if (s.getCoordinates().get(1) != null)\r\n {\r\n line_coordinates.add(s.getCoordinates().get(1));\r\n }\r\n\r\n //11\r\n if (this_street1.getX() == next_street1.getX() && this_street1.getY() == next_street1.getY())\r\n {\r\n line_coordinates.add(this_street1);\r\n }\r\n //12\r\n else if (this_street1.getX() == next_street2.getX() && this_street1.getY() == next_street2.getY())\r\n {\r\n line_coordinates.add(this_street1);\r\n }\r\n // 21\r\n else if (this_street2.getX() == next_street1.getX() && this_street2.getY() == next_street1.getY())\r\n {\r\n line_coordinates.add(this_street2);\r\n }\r\n //22\r\n else if (this_street2.getX() == next_street2.getX() && this_street2.getY() == next_street2.getY())\r\n {\r\n line_coordinates.add(this_street2);\r\n }\r\n\r\n }\r\n\r\n line_coordinates.add(getStopsMap().get(getStopsMap().size()-1).getCoordinate());\r\n return line_coordinates;\r\n }", "public static int[] findTripletWithCommonDifference(List<Integer> list) {\n for (int j = 1; j < list.size() - 1; j++)\n {\n // start with left and right index of j\n int i = j - 1, k = j + 1;\n\n // Find all i and k such that (i, j, k) forms a triplet of AP\n while (i >= 0 && k < list.size())\n {\n // if (A[i], A[j], A[k]) forms a triplet\n if (list.get(i) + list.get(k) == 2 * list.get(j))\n {\n int[] res = {list.get(i), list.get(j), list.get(k)};\n return res;\n }\n // else if (A[i] + A[k]) is less than 2*A[j] then\n // try next k. Else, try previous i.\n else if (list.get(i) + list.get(k) < 2 * list.get(j)) {\n k++;\n } else {\n i--;\n }\n }\n }\n return new int[0];\n }", "private Optional<Pair<S, S>> getCrossingPair(final Node<S> node, final Pair<S, S>[] map) {\n Pair<S, S> result = null;\n if(node.hasNext()) {\n //aX ?\n if(node.getElement().isTerminal()) {\n // ab\n if(!node.getNext().getElement().isTerminal()) {\n S a = node.getElement();\n S b = map[node.getNext().getElement().getId()].a;\n result = !a.equals(b) ? new Pair<S, S>(a,b) : null;\n }\n } // Ax or AX\n else {\n S a = map[node.getElement().getId()].b;\n S b = node.getNext().getElement();\n // Ab?\n if(b.isTerminal()) {\n result = !a.equals(b) ? new Pair<S, S>(a, b) : null;\n } //AB\n else {\n result = !a.equals(map[b.getId()].a) ? new Pair<S, S>(a, map[b.getId()].a) : null;\n }\n }\n }\n return Optional.ofNullable(result);\n }", "private boolean checkIfTransferHasBeenLongerThanAWeek(String lastTimeStamp, String currentTimeStamp) {\n // should be in same format now\n\n String[] previousDate = getDateFormatToCompare(lastTimeStamp);\n String[] currentDate = getDateFormatToCompare(currentTimeStamp);\n\n //2020-01-01T12:34:56.000Z\n //2020-01-07T13:14:52.777Z\n\n LOGGER.debug(\"Check for over week since last transfer default false\");\n return false;\n }", "private static boolean kthSmallesElementFound(int[] list1, int[] list2, int nElementsList1, int nElementsList2) {\n if(nElementsList2 < 1) {\n return true;\n }\n\n if(list1[nElementsList1-1] == list2[nElementsList2-1]) {\n return true;\n }\n\n if(nElementsList1 == list1.length) {\n return list1[nElementsList1-1] <= list2[nElementsList2];\n }\n\n if(nElementsList2 == list2.length) {\n return list2[nElementsList2-1] <= list1[nElementsList1];\n }\n\n return list1[nElementsList1-1] <= list2[nElementsList2] && list2[nElementsList2-1] <= list1[nElementsList1];\n }", "public int findMinDifference(List<String> timePoints) {\n timePoints.sort((t1, t2) -> {\n return t1.compareTo(t2);\n });\n\n int ans = Integer.MAX_VALUE;\n for (int i = timePoints.size() - 1; i > 0; i--) {\n String t1 = timePoints.get(i);\n String t2 = timePoints.get(i - 1);\n ans = Math.min(ans, calDiff(t1, t2));\n }\n\n // compare the first one and last one\n if (timePoints.size() > 1) {\n String t1 = timePoints.get(timePoints.size() - 1);\n int min1 = calMin(t1);\n String t2 = timePoints.get(0);\n int min2 = calMin(t2);\n int diff = (24 * 60 - min1) + min2;\n ans = Math.min(ans, diff);\n }\n\n return ans;\n }", "private Point[] nearestPairRec(Point[] range, boolean axis) {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (range.length < 4) return nearestPair3Points(range);\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2];\n\t\t\tdouble MinDistance = -1; //it will be change for sure, because we pass the array only if it containes 4 points and above.\n\t\t\tdouble MinDistanceInStrip;\n\t\t\t//step 4\n\t\t\tif (axis){\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getX(), range[(range.length)/2].getX(), axis), axis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getX(), range[range.length-1].getX() ,axis), axis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getY(), range[(range.length)/2].getY(), axis), axis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getY(), range[range.length-1].getY() ,axis), axis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}else if (MinPointsLeft!=null && MinPointsRight==null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}else if (MinPointsRight!=null && MinPointsLeft==null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 find the nearest point around the median\n\t\t\tint upper;\n\t\t\tint lower;\n\t\t\tif (MinDistance==-1) MinDistance = 0;\n\t\t\tif (axis){\n\t\t\t\tupper = (int) (range[(range.length)/2].getX()+MinDistance);\n\t\t\t\tlower = (int) (range[(range.length)/2].getX()-MinDistance);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tupper = (int) (range[(range.length)/2].getY()+MinDistance);\n\t\t\t\tlower = (int) (range[(range.length)/2].getY()-MinDistance);\n\t\t\t}\n\t\t\trange = getPointsInRangeOppAxis(lower, upper, axis);\n\t\t\tif (range.length>=2) MinPointsInStrip = nearestPointInArray(range);\n\t\t\tif (MinPointsInStrip[0]!=null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "private String syncTimeStamp(String timestamp){\r\n StringBuilder dateBuilder = new StringBuilder(timestamp);\r\n String time = dateBuilder.toString().split(\"T\")[1].substring(0, 8);\r\n String[] timeArr = time.split(\":\");\r\n String seconds = timeArr[2];\r\n String dd = dateBuilder.toString().split(\"T\")[0].split(\"-\")[2];\r\n String mm = dateBuilder.toString().split(\"T\")[0].split(\"-\")[1];\r\n String yyyy = dateBuilder.toString().split(\"T\")[0].split(\"-\")[0];\r\n int hour = Integer.parseInt(timeArr[0]);\r\n int minutes = Integer.parseInt(timeArr[1]);\r\n minutes += 30;\r\n hour+=5;\r\n if (minutes>=60){\r\n hour += 1;\r\n minutes -= 60;\r\n }\r\n if (hour >= 24){\r\n hour -= 24;\r\n dd = Integer.toString(Integer.parseInt(dd) + 1);\r\n if (Integer.parseInt(dd) < 10)\r\n dd = \"0\" + dd;\r\n }\r\n String minutesString;\r\n if (minutes < 10)\r\n minutesString = \"0\" + Integer.toString(minutes);\r\n else\r\n minutesString = Integer.toString(minutes);\r\n\r\n String hoursString;\r\n if (hour < 10)\r\n hoursString = \"0\" + Integer.toString(hour);\r\n else\r\n hoursString = Integer.toString(hour);\r\n String finalTime = hoursString + \":\" + minutesString + \":\" + seconds;\r\n String finalDate = dd + \"-\" + mm + \"-\" + yyyy;\r\n\r\n return (finalDate + \" \" + finalTime);\r\n }", "public static double getAttHour(String time1, String time2)\r\n/* 178: */ throws ParseException\r\n/* 179: */ {\r\n/* 180:258 */ double hour = 0.0D;\r\n/* 181:259 */ DateFormat fulDate = new SimpleDateFormat(\"HH:mm\");\r\n/* 182:260 */ long t12 = fulDate.parse(\"12:00\").getTime();\r\n/* 183:261 */ long t13 = fulDate.parse(\"13:00\").getTime();\r\n/* 184:262 */ long t1 = fulDate.parse(time1).getTime();\r\n/* 185:263 */ long PERHOUR = 3600000L;\r\n/* 186:264 */ if (time2 == null)\r\n/* 187: */ {\r\n/* 188:265 */ if (t12 - t1 > 0L) {\r\n/* 189:266 */ hour = (t12 - t1) / PERHOUR;\r\n/* 190: */ }\r\n/* 191: */ }\r\n/* 192: */ else\r\n/* 193: */ {\r\n/* 194:269 */ long t2 = fulDate.parse(time2).getTime();\r\n/* 195:270 */ if ((t1 <= t12) && (t2 >= t12) && (t2 <= t13)) {\r\n/* 196:271 */ hour = (t12 - t1) / PERHOUR;\r\n/* 197:272 */ } else if ((t1 <= t12) && (t2 >= t13)) {\r\n/* 198:273 */ hour = (t2 - t1) / PERHOUR - 1.0D;\r\n/* 199:274 */ } else if ((t1 >= t12) && (t1 <= t13) && (t2 >= t12) && (t2 <= t13)) {\r\n/* 200:275 */ hour = 0.0D;\r\n/* 201:276 */ } else if ((t1 >= t12) && (t1 <= t13) && (t2 >= t13)) {\r\n/* 202:277 */ hour = (t2 - t13) / PERHOUR;\r\n/* 203: */ } else {\r\n/* 204:279 */ hour = (t2 - t1) / PERHOUR;\r\n/* 205: */ }\r\n/* 206: */ }\r\n/* 207:282 */ DecimalFormat df = new DecimalFormat(\"#.0\");\r\n/* 208:283 */ return Double.parseDouble(df.format(hour));\r\n/* 209: */ }", "public static boolean isStraight(){\n boolean start = false;\n int count = 0;\n for (int i : rankFrequency) {\n if(i == 1){\n if(start){\n count++;\n }else{\n start=true;\n count++;\n }\n }else{\n if(start){\n count = 0;\n start = false;\n }\n }\n }\n\n return (count == 5);\n }", "public Intersection trace(Point start, Point end) {\n\t\tdouble curDist, closeDist;\r\n\t\tIntersection closestIntersection= new Intersection(60+1, null, null);\r\n\t\tfor(Thing thing:thing){\r\n\t\t Intersection thingIntersection = thing.getIntersection(start, end);\r\n\t\t\tcurDist = thingIntersection.getDistance();\r\n\t\t\tcloseDist = closestIntersection.getDistance();\r\n\t\t\tif (curDist < closeDist) {\r\n\t\t\t\tclosestIntersection = thingIntersection;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(Thing light:lights){\r\n\t\t Intersection thingIntersection = light.getIntersection(start, end);\r\n\t\t\tcurDist = thingIntersection.getDistance();\r\n\t\t\tcloseDist = closestIntersection.getDistance();\r\n\t\t\tif (curDist < closeDist) {\r\n\t\t\t\tclosestIntersection = thingIntersection;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn closestIntersection;\r\n\t}", "protected ArrayList<int[]> findAdjacentSafe(int[] pair) {\n\t\tint x = pair[0];\n\t\tint y = pair[1];\n\t\tArrayList<int[]> neighbors = new ArrayList<int[]>();\n\t\tfor (int i = x - 1; i <= x + 1; i++) {\n\t\t\tfor (int j = y - 1; j <= y + 1; j++) {\n\t\t\t\tif (i >= 0 && i < maxX && j >= 0 && j < maxY && coveredMap[i][j] != SIGN_UNKNOWN && coveredMap[i][j] != SIGN_MARK) {\n\t\t\t\t\tneighbors.add(new int[]{i, j});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn neighbors;\n\t}", "public static Long neighborPairsSingle(Set<Integer>[] graph) {\n long triangleCount = 0;\n int degv, degu, degw;\n for (int v = 0; v < graph.length; v++) {\n degv = graph[v].size();\n for (Integer u : graph[v]) {\n degu = graph[u].size();\n if (degu > degv || (degu == degv && v < u)) {\n for (Integer w : graph[v]) {\n if (w <= u)\n continue;\n degw = graph[w].size();\n if (degw > degv || (degw == degv && v < w)) {\n if (graph[u].contains(w))\n triangleCount++;\n }\n }\n }\n }\n }\n return triangleCount;\n }", "public boolean isPair() {\r\n\r\n return getHighestConsecutive() == 2;\r\n }", "private PairOfNodeIndexIntervals getValidNodeIndexIntervalPair(Match match) {\n\t\t// init pair to be null, which represents the current match does not produce a valid pair\n\t\tPairOfNodeIndexIntervals pair = null;\n\n\t\t// the indexes of the matched substrings\n\t\tint firstStrMatchedStartIndex = match.getFirstStringIndex();\n\t\tint secondStrMatchedStartIndex = match.getSecondStringIndex();\n\t\t// length of the matched substrings\n\t\tint matchedLen = match.getMatchLength();\n\n\t\tif (matchedLen % 2 == 0) {\n\t\t\t//if length of the matched substrings is even\n\t\t\tif (firstStrMatchedStartIndex % 2 == 0 && secondStrMatchedStartIndex % 2 == 0) {\n\t\t\t\t// if both substrings starts from even index, it is already a valid pair\n\t\t\t\tpair = createNodeIndexIntervalPair(firstStrMatchedStartIndex, secondStrMatchedStartIndex, matchedLen);\n\t\t\t} else if (firstStrMatchedStartIndex % 2 == 1 && secondStrMatchedStartIndex % 2 == 1) {\n\t\t\t\t// if both substrings starts from odd index, ignore the first and last characters\n\t\t\t\tpair = createNodeIndexIntervalPair(firstStrMatchedStartIndex + 1, secondStrMatchedStartIndex + 1,\n\t\t\t\t\t\tmatchedLen - 2);\n\t\t\t}\n\t\t} else {\n\t\t\t//if length of the matched substrings is odd\n\t\t\tif (firstStrMatchedStartIndex % 2 == 0 && secondStrMatchedStartIndex % 2 == 0) {\n\t\t\t\t// if both substrings starts from even index, ignore the last character\n\t\t\t\tpair = createNodeIndexIntervalPair(firstStrMatchedStartIndex, secondStrMatchedStartIndex, matchedLen - 1);\n\t\t\t} else if (firstStrMatchedStartIndex % 2 == 1 && secondStrMatchedStartIndex % 2 == 1) {\n\t\t\t\t// if both substrings starts from odd index, ignore the first character\n\t\t\t\tpair = createNodeIndexIntervalPair(firstStrMatchedStartIndex + 1, secondStrMatchedStartIndex + 1,\n\t\t\t\t\t\tmatchedLen - 1);\n\t\t\t}\n\t\t}\n\n\t\treturn pair;\n\t}", "public static void main(String[] args) {\n\t\tint arr[] = {20,35,-15,-15,7,55,1,-22};\n//\t\tint arr[] = {7,4,8,2};\n\n\t\tTimestamp timestamp = new Timestamp(System.currentTimeMillis());\n System.out.println(timestamp);\n\t\tfor(int gap = arr.length/2 ; gap >0 ; gap = gap/2)\n\t\t{\n\n\t\t\tfor(int i = gap ; i < arr.length;i++)\n\t\t\t{\n\t\t\t\tint key = arr[i];\n\t\t\t\tint j = i;\n\n\n\t\t\t\twhile(j>= gap && arr[j- gap] > key)\n\t\t\t\t{\n\t\t\t\t\tarr[j] = arr[j - gap];\n\t\t\t\t\tj = j- gap;\n\t\t\t\t}\n\t\t\t\tarr[j] = key;\n\t\t\t}\n\n\t\t}\n\t\tTimestamp timestamp1 = new Timestamp(System.currentTimeMillis());\n System.out.println(timestamp1);\n\t\t\n\t\tprint(arr);\n\t}", "int findPair(String a, String b)\r\n\t{\r\n\t\tfor (int i = 0; i < connectlist.size()/2; i++) \r\n\t\t{\r\n\t\t\tif (connectlist.get(i*2).compareToIgnoreCase(a)== 0)\r\n\t\t\t{\r\n\t\t\t\tif (connectlist.get(i*2+1).compareToIgnoreCase(b) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn i*2;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (connectlist.get(i*2).compareToIgnoreCase(b)== 0)\r\n\t\t\t{\r\n\t\t\t\tif (connectlist.get(i*2+1).compareToIgnoreCase(a) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn i*2;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "boolean hasXYPairs();", "public int masterCandles(DateTime dt1, DateTime dt2) {\r\n int count = 0;\r\n int ij = 0; \r\n for(int i=find_index(dt1); i <= find_index(dt2); i++ ) {\r\n if (this.candles.length <= i) {\r\n break;\r\n }\r\n int c = 0;\r\n for(int n=1; n <= 4; n++) {\r\n if(Double.compare(this.candles[i].getHigh(), this.candles[i+n].getHigh()) > 0 && Double.compare(this.candles[i].getLow(), this.candles[i+n].getLow()) < 0){\r\n c++;\r\n }\r\n }\r\n if (c == 4) {\r\n count++;\r\n }\r\n c = 0;\r\n ij++;\r\n }\r\n return count;\r\n }", "public static double closestPair(Point[] sortedX) {\n if (sortedX.length <= 1) {\n return Double.MAX_VALUE;\n }\n double mid = sortedX[(sortedX.length) / 2].getX();\n double firstHalf = closestPair(Arrays.copyOfRange(sortedX, 0, (sortedX.length) / 2));\n double secondHalf = closestPair(Arrays.copyOfRange(sortedX, (sortedX.length) / 2, sortedX.length));\n double min = Math.min(firstHalf, secondHalf);\n ArrayList<Point> close = new ArrayList<Point>();\n for (int i = 0; i < sortedX.length; i++) {\n double dis = Math.abs(sortedX[i].getX() - mid);\n if (dis < min) {\n close.add(sortedX[i]);\n }\n }\n // sort by Y coordinates\n Collections.sort(close, new Comparator<Point>() {\n public int compare(Point obj1, Point obj2) {\n return (int) (obj1.getY() - obj2.getY());\n }\n });\n Point[] near = close.toArray(new Point[close.size()]);\n\n for (int i = 0; i < near.length; i++) {\n int k = 1;\n while (i + k < near.length && near[i + k].getY() < near[i].getY() + min) {\n if (min > near[i].distance(near[i + k])) {\n min = near[i].distance(near[i + k]);\n System.out.println(\"near \" + near[i].distance(near[i + k]));\n System.out.println(\"best \" + best);\n\n if (near[i].distance(near[i + k]) < best) {\n best = near[i].distance(near[i + k]);\n arr[0] = near[i];\n arr[1] = near[i + k];\n // System.out.println(arr[0].getX());\n // System.out.println(arr[1].getX());\n\n }\n }\n k++;\n }\n }\n return min;\n }", "Tour crossOver(Tour p2, int x1, int x2) {\r\n\t\t// make an empty tour and then fill it in\r\n\t\tTour child = new Tour();\r\n\r\n\t\t// copy the 1st segment of (this) to the child\r\n\t\tfor (int i = 0; i < x1; i++) {\r\n\t\t child.index[i] = this.index[i];\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = x1; i <= x2; i++) {\r\n\t\t child.index[i] = p2.index[i];\r\n\t\t}\r\n\t\t// copy the cross-over portion of p2 to the child\r\n\t\t\r\n for (int i = x2 + 1; i < index.length; i++) {\r\n child.index[i] = this.index[i];\r\n }\t\t\r\n\t\t// copy the last segment of (this) to the child\r\n\r\n\t\t// Now we need to correct the child for any duplicate cities\r\n\t\t\r\n\t\t// First find out the unique elements of the cross-over segment\r\n\t\t// i.e., those elements of the cross-over segment of\r\n\t\t// p1 that are not in p2\r\n\t\tint[] uniq = new int[x2 - x1 + 1];\r\n\t\tint k = 0;\r\n\t\tboolean found = false;\r\n for (int i = x1; i <= x2; i++) {\r\n for (int j = x1; j <= x2; j++) {\r\n if (this.index[i] == p2.index[j]) {\r\n found = true;\r\n break;\r\n }\r\n }\r\n if (found) {\r\n found = false;\r\n continue;\r\n }\r\n uniq[k] = this.index[i];\r\n k++;\r\n }\r\n System.out.println();\r\n\t\t// *** TODO ***\r\n \r\n k--;\r\n found = false;\r\n for (int i = x1; i <= x2; i++) {\r\n for (int j = 0; j < x1; j++) {\r\n if (child.index[i] == child.index[j]) {\r\n child.index[i] = uniq[k];\r\n k--;\r\n found = true;\r\n break;\r\n }\r\n }\r\n \r\n if (found) {\r\n found = false;\r\n continue;\r\n }\r\n \r\n for (int j = x2 + 1; j < index.length; j++) {\r\n if (child.index[i] == child.index[j]) {\r\n child.index[i] = uniq[k];\r\n k--;\r\n break;\r\n }\r\n }\r\n }\r\n\t\t// scan the two portions of p1 that have been crossed into the\r\n\t\t// the child for any duplicates in the crossed-over \r\n\t\t// segment and if so replace with an element from the uniq list\r\n\t\t\r\n\t\tchild.distance = child.distance();\r\n\t\treturn child;\r\n\t}", "private static int nonConflictingBinarySearchFlight(Flight[] flights, int n) {\n int left = 0, right = n - 1;\n\n while (left <= right) {\n // We check if current flight(min) doesn't overlapp with the referenced\n // flight(n)\n int mid = (left + right) / 2;\n if (flights[mid].end <= flights[n].start) {\n // If current flight doesn't overlap we check if there is another flight\n // that doesn't overlap if there is we continue checking if not, we take\n // the current flight\n if (flights[mid + 1].end <= flights[n].start) {\n left = mid + 1;\n } else {\n return mid;\n }\n } else {\n // If we overlap we continua reducing the flights pool from the right\n right = mid - 1;\n }\n }\n\n // We return -1 if no non-conflight flight exists\n return -1;\n }", "public boolean rayCrossesSegment(LatLng point, LatLng a, LatLng b) {\n double px = point.longitude,\n py = point.latitude,\n ax = a.longitude,\n ay = a.latitude,\n bx = b.longitude,\n by = b.latitude;\n if (ay > by) {\n ax = b.longitude;\n ay = b.latitude;\n bx = a.longitude;\n by = a.latitude;\n }\n // alter longitude to cater for 180 degree crossings\n if (px < 0 || ax < 0 || bx < 0) {\n px += 360;\n ax += 360;\n bx += 360;\n }\n // if the point has the same latitude as a or b, increase slightly py\n if (py == ay || py == by) py += 0.00000001;\n\n\n // if the point is above, below or to the right of the segment, it returns false\n if ((py > by || py < ay) || (px > Math.max(ax, bx))) {\n return false;\n }\n // if the point is not above, below or to the right and is to the left, return true\n else if (px < Math.min(ax, bx)) {\n return true;\n }\n // if the two above conditions are not met, you have to compare the slope of segment [a,b] (the red one here) and segment [a,p] (the blue one here) to see if your point is to the left of segment [a,b] or not\n else {\n double red = (ax != bx) ? ((by - ay) / (bx - ax)) : Double.POSITIVE_INFINITY;\n double blue = (ax != px) ? ((py - ay) / (px - ax)) : Double.POSITIVE_INFINITY;\n return (blue >= red);\n }\n\n }", "public static long taskOfPairing(List<Long> freq) {\n // Write your code here\n long pairs = 0;\n boolean isOdd = false;\n boolean hasRemained = false;\n long curNum = 0;\n for (int weight = 1; weight <= freq.size(); weight++) {\n curNum = freq.get(weight - 1);\n pairs += (curNum / 2);\n if (curNum % 2 != 0) {\n if (hasRemained) {\n pairs++;\n hasRemained = false;\n } else {\n hasRemained = true;\n }\n isOdd = true;\n } else {\n if (!isOdd) {\n hasRemained = false;\n }\n isOdd = false;\n }\n\n }\n\n return pairs;\n\n }", "public Pair<Integer, Map<Vertex, Vertex>> ShortestDistance(Vertex source, Vertex zink) {\n Map<Vertex, Vertex> PredecessorMap = new HashMap<>();\n Map<Vertex, Integer> DistanceMap = new HashMap<>();\n Vertex a;\n // initialize arrays\n for (Vertex v : Vertices) {\n DistanceMap.put(v, 1000); //We initialize the array in infinite\n PredecessorMap.put(v, null);\n }\n DistanceMap.put(source, 0); //We put the source in 0\n for (Vertex v : Vertices) {\n while (!DistanceMap.isEmpty()) { //And we iterate until the distance map is empty\n a = getmin(DistanceMap); //we get the minimum vertex\n if(a==null) {\n return (new Pair<Integer, Map<Vertex, Vertex>>(DistanceMap.get(zink), PredecessorMap));\n }\n\n ArrayList<Edge> edges = a.getOutEdges(); //we get de edges connected to this vertex\n for (Edge e : edges) { //we iterate getting the vertex of each edge\n if (DistanceMap.containsKey(e.tovertex)) { //if the vertex is in the distance map:\n Integer alt = DistanceMap.get(a) + e.distance; //we get it value and plus the distance of the edge\n\n System.out.println(\"This is the distance going out from that Vertex: \" + alt + \", with previous distance: \" + DistanceMap.get(e.tovertex));\n if (alt < DistanceMap.get(e.tovertex)) { //if it is less, we put it in the arrays\n DistanceMap.put(e.tovertex, alt);\n PredecessorMap.put(e.tovertex, a);\n\n }\n }\n }\n DistanceMap.remove(a); //and we remove it of the array\n }\n }\n return (new Pair<Integer, Map<Vertex, Vertex>>(DistanceMap.get(zink), PredecessorMap));\n }", "private ArrayList<Point> findS(ArrayList<Point> s, Point p1, Point p2) {\n ArrayList<Point> s1 = new ArrayList<>();\n for(int i = 1; i < s.size(); i++){\n if(p1.x*p2.y + s.get(i).x*p1.y + p2.x*s.get(i).y - s.get(i).x*p2.y - p2.x*p1.y - p1.x*s.get(i).y > 0) {\n s1.add(s.get(i));\n }\n }\n return s1;\n }", "default Stream<Pair<T, Long>> withTimestamp() {\n return withTimestamp(null);\n }", "protected ArrayList<int[]> findAdjacentUnknown(int[] pair) {\n\t\tint x = pair[0];\n\t\tint y = pair[1];\n\t\tArrayList<int[]> neighbors = new ArrayList<int[]>();\n\t\tfor (int i = x - 1; i <= x + 1; i++) {\n\t\t\tfor (int j = y - 1; j <= y + 1; j++) {\n\t\t\t\tif (i >= 0 && i < maxX && j >= 0 && j < maxY && coveredMap[i][j] == SIGN_UNKNOWN) {\n\t\t\t\t\tneighbors.add(new int[]{i, j});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn neighbors;\n\t}", "private boolean isSurpass(State lastTime, State nowTime) {\n boolean result;\n String last;\n String now;\n try {\n last = ShortcutUtil.refFormatOnlyDate(Long.valueOf(lastTime.getTime_point()));\n now = ShortcutUtil.refFormatOnlyDate(Long.valueOf(nowTime.getTime_point()));\n }catch (Exception e){\n e.printStackTrace();\n return false;\n }\n result = !last.equals(now);\n return result;\n }", "public static int compareTimestamps(final String ts1, final String ts2) throws Exception {\r\n\r\n int result = 0;\r\n\r\n XMLGregorianCalendar date1 = DatatypeFactory.newInstance().newXMLGregorianCalendar(ts1);\r\n XMLGregorianCalendar date2 = DatatypeFactory.newInstance().newXMLGregorianCalendar(ts2);\r\n\r\n int diff = date1.compare(date2);\r\n if (diff == DatatypeConstants.LESSER) {\r\n result = -1;\r\n }\r\n else if (diff == DatatypeConstants.GREATER) {\r\n result = 1;\r\n }\r\n else if (diff == DatatypeConstants.EQUAL) {\r\n result = 0;\r\n }\r\n else if (diff == DatatypeConstants.INDETERMINATE) {\r\n throw new Exception(\"Date comparing: INDETERMINATE\");\r\n }\r\n\r\n return result;\r\n }", "private List<GPairRecord<S, S>> getNonCrossingPairs(final Predicate<Pair<S, S>> predicate) {\n List<GPairRecord<S, S>> recordList = new ArrayList<>();\n slp.getOrderedProductions().stream().map(p -> p.getLeft()).forEach(nonTerminal -> consumeNonCrossingPairs(nonTerminal, recordList::add, predicate));\n return recordList;\n }", "protected int find_by_index(DateTime dt){\r\n int in = 0;\r\n int l = this.candles.length;\r\n for(int i=0; i < l; i++){\r\n if (this.candles[i].getDT().isLower(dt) || this.candles[i].getDT().isEqual(dt)){\r\n in++;\r\n }\r\n }\r\n if (this.candles[in-1].getDT().isLower(dt)){\r\n return in-1;\r\n } else {\r\n return in;\r\n }\r\n }", "private static double getDISSIM(ArrayList<Point> r, ArrayList<Point> s, long t1, long tn){\n\t\tif(r.size() < 2 || s.size() < 2){\n\t\t\treturn INFINITY;\n\t\t}\n\t\t\n\t\tArrayList<Double> dist_t = new ArrayList<Double>();\n\t\tint index_r = 0, index_s = 0;\n\t\tfor(long t = t1; t <= tn; t += TIME_INCREMENT){\n\t\t\tPoint r_p1 = r.get(index_r);\n\t\t\tPoint r_p2 = r.get(index_r+1);\n\t\t\tPoint s_p1 = s.get(index_s);\n\t\t\tPoint s_p2 = s.get(index_s+1);\n\t\t\t\n\t\t\t// get the 'distance' between the two trajectories at time t\n\t\t\tdist_t.add(getDistance(r_p1, r_p2, s_p1, s_p2, t));\n\t\t\t\n\t\t\t// current time reached the time of the next point\n\t\t\tif(t > r_p2.timeLong && index_r < r.size()-2){\n\t\t\t\tindex_r++;\n\t\t\t}\n\t\t\tif(t > s_p2.timeLong && index_s < s.size()-2){\n\t\t\t\tindex_s++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdouble dissim = 0;\n\t\tfor(int i=0; i<dist_t.size()-1; i++) {\n\t\t\tdissim += (dist_t.get(i) + dist_t.get(i+1))*TIME_INCREMENT;\n\t\t}\n\t\t\n\t\treturn dissim/2;\n\t}", "private LatLng findPhotoOnTrack(LocalDateTime photodt) {\n Double previousLat = 0.0;\n Double previousLon = 0.0;\n LocalDateTime previousTime = null;\n LocalDateTime pointdt;\n long millisToPhoto = 0;\n long millisToEndpoint = 0;\n Double tagLat = 0.0;\n Double tagLon = 0.0;\n\n if (photodt.isBefore(startTrack) || photodt.isAfter(endTrack))\n return null; // Photo's date was before or after the start of the GPS track\n\n ArrayList<TrackPoint> points = tData.getTrackPoints();\n for (TrackPoint trackPoint : points) {\n pointdt = trackPoint.getTime();\n if (photodt.isAfter(pointdt)) {\n // The photo was taken AFTER this point\n previousLat = trackPoint.getLatitude();\n previousLon = trackPoint.getLongitude();\n previousTime = trackPoint.getTime();\n } else {\n // The photo was taken before or at the same time as this point\n try {\n // Convert date/times to Milliseconds\n millisToPhoto = java.time.Duration.between(previousTime, photodt).toMillis();\n millisToEndpoint = java.time.Duration.between(previousTime, pointdt).toMillis();\n } catch (NullPointerException e) {\n e.printStackTrace();\n System.exit(1);\n }\n if (millisToEndpoint != millisToPhoto) {\n // Photo was taken between track data points. So we have to extrapolate the position\n float pct = (float) millisToPhoto / (float) millisToEndpoint;\n extrapolatePoint midPoint = new extrapolatePoint(previousLat, previousLon, trackPoint.getLatitude(), trackPoint.getLongitude(), pct);\n tagLat = midPoint.latitude();\n tagLon = midPoint.longitude();\n } else {\n // Photo was taken at a track point location\n tagLat = trackPoint.getLatitude();\n tagLon = trackPoint.getLongitude();\n\n }\n break;\n }\n }\n return (new LatLng(tagLat, tagLon));\n }", "private int compareTimes(String time1, String time2) {\n \n String[] timeOneSplit = time1.trim().split(\":\");\n String[] timeTwoSplit = time2.trim().split(\":\");\n \n \n if (timeOneSplit.length == 2 && timeTwoSplit.length == 2) {\n \n String[] minutesAmPmSplitOne = new String[2];\n minutesAmPmSplitOne[1] = timeOneSplit[1].trim().substring(0, timeOneSplit[1].length() - 2);\n minutesAmPmSplitOne[1] = timeOneSplit[1].trim().substring(timeOneSplit[1].length() - 2, timeOneSplit[1].length());\n\n String[] minutesAmPmSplitTwo = new String[2];\n minutesAmPmSplitTwo[1] = timeTwoSplit[1].trim().substring(0, timeTwoSplit[1].length() - 2);\n minutesAmPmSplitTwo[1] = timeTwoSplit[1].trim().substring(timeTwoSplit[1].length() - 2, timeTwoSplit[1].length());\n \n int hourOne = Integer.parseInt(timeOneSplit[0]);\n int hourTwo = Integer.parseInt(timeTwoSplit[0]);\n \n //increment hours depending on am or pm\n if (minutesAmPmSplitOne[1].trim().equalsIgnoreCase(\"pm\")) {\n hourOne += 12;\n }\n if (minutesAmPmSplitTwo[1].trim().equalsIgnoreCase(\"pm\")) {\n hourTwo += 12;\n }\n \n if (hourOne < hourTwo) {\n \n return -1;\n }\n else if (hourOne > hourTwo) {\n \n return 1;\n }\n else {\n \n int minutesOne = Integer.parseInt(minutesAmPmSplitOne[0]);\n int minutesTwo = Integer.parseInt(minutesAmPmSplitTwo[0]);\n \n if (minutesOne < minutesTwo) {\n \n return -1;\n }\n else if (minutesOne > minutesTwo) {\n \n return 1;\n }\n else {\n \n return 0;\n }\n }\n }\n //time1 exists, time 2 doesn't, time 1 comes first!\n else if (timeOneSplit.length == 2 && timeTwoSplit.length != 2) {\n return -1;\n }\n else {\n return 1;\n }\n }", "public int maxEvents(int[] arrival, int[] duration) {\n int[][] events = new int[arrival.length][2];\n for (int i = 0; i < arrival.length; i++) {\n events[i] = new int[] {arrival[i], arrival[i] + duration[i]};\n }\n\n // events = [[1, 3], [3, 5], [3, 4], [5, 7], [7, 8]]\n // use start as a sweep line, from left to right\n // 1. create arrays to record all start points, and ends points\n // 2. sort starts and ends \n // 3. sweep starts and ends from left to right\n // time: O(nlogn), space: O(n)\n\n int[] starts = new int[events.length];\n int[] ends = new int[events.length];\n for (int i = 0; i < events.length; i++) {\n starts[i] = events[i][0];\n ends[i] = events[i][1];\n }\n\n Arrays.sort(starts);\n Arrays.sort(ends);\n\n int results = 0;\n int end = 0;\n for (int i = 0; i < events.length; i++) {\n if (starts[i] < ends[end]) {\n results++;\n } else {\n end++;\n }\n }\n return results;\n}", "public static int searchForIntervalBoundary(long time) {\n\n int intakeIndex = 1;\n\n for (int i = theirIntakes.size() - 1; i > 0; i--) {\n if (theirIntakes.get(i).getCreationTime() < time) {\n intakeIndex = i;\n break;\n }\n }\n\n return intakeIndex;\n\n }", "public boolean clashesWithSlot(Slot slot2) {\n\t\t//Looping through all possible pairs of timings of the 2 slots\n\t\tfor (ClassTiming timing1 : classTimings){\n\t\t\tfor (ClassTiming timing2 : slot2.classTimings){\n\t\t\t\t//For any of the class timings, if they are on the same day\n\t\t\t\tif (timing1.getThreeLetterDayOfTheWeek().equalsIgnoreCase(timing2.getThreeLetterDayOfTheWeek())){\n\t\t\t\t\t//Calculate the start and end time in minutes alone.\n\t\t\t\t\tint timing1StartTimeInMinutes = timing1.getStartHour()*60 + timing1.getStartMinute();\n\t\t\t\t\tint timing1EndTimeInMinutes = timing1.getEndHour()*60 + timing1.getEndMinute();\n\t\t\t\t\tint timing2StartTimeInMinutes = timing2.getStartHour()*60 + timing2.getStartMinute();\n\t\t\t\t\tint timing2EndTimeInMinutes = timing2.getEndHour()*60 + timing2.getEndMinute();\n\t\t\t\t\t\n\t\t\t\t\t//And if they overlap in any way return true \n\t\t\t\t\t//(Sketch this condition out to understand why it is correct)\n\t\t\t\t\tif ((timing1StartTimeInMinutes<=timing2StartTimeInMinutes && timing2StartTimeInMinutes<timing1EndTimeInMinutes) || (timing2StartTimeInMinutes<=timing1StartTimeInMinutes && timing1StartTimeInMinutes<timing2EndTimeInMinutes)){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//If we reached this point, there is no clash. Return false;\n\t\treturn false;\n\t}", "public Point2D\ngetFivePrimeTailIntersect(double gap)\nthrows Exception\n{\n\tdouble[] uArray = new double[2];\n\tint[] sideArray = new int[2];\n\tPoint2D intersect0Pt = new Point2D.Double();\n\tPoint2D intersect1Pt = new Point2D.Double();\n\n\tRectangle2D rect = this.getCenteredBoundingBox();\n\n\tboolean intersects = BLine2D.getRectangleRayIntersect(\n\t\trect, this.getFivePrimeRay(),\n\t\tintersect0Pt, intersect1Pt, uArray, sideArray);\n\n\tif (!intersects)\n\t\treturn (null);\n\n\tif (gap != 0.0)\n\t{\n\t\tBLine2D tmpLine = new BLine2D(this.getFivePrimeRay().getP1(),\n\t\t\tintersect0Pt);\n\t\ttmpLine.setRayFromLength(tmpLine.length() + gap);\n\t\tintersect0Pt = tmpLine.getP2();\n\t}\n\n\treturn (intersect0Pt);\n}", "static void findTwoMissingNumber(int a[]) {\n int miss1 = 0;\n int miss2;\n int miss1miss2 = 0;\n\n int size = a.length;\n for (int i = 0; i < size; i++) {\n miss1miss2 ^= ((i + 1) ^ a[i]);\n }\n\n miss1miss2 ^= (size + 1);\n miss1miss2 ^= (size + 2);\n\n int diff = miss1miss2 & (-miss1miss2);\n\n for (int i = 0; i < size; i++) {\n if (((i + 1) & diff) > 0)\n miss1 ^= (i + 1);\n\n if ((a[i] & diff) > 0)\n miss1 ^= a[i];\n }\n\n if (((size + 1) ^ diff) > 0)\n miss1 ^= (size + 1);\n\n if (((size + 2) ^ diff) > 0)\n miss1 ^= (size + 2);\n\n miss2 = miss1miss2 ^ miss1;\n\n System.out.println(miss1);\n System.out.println(miss2);\n }", "public Pair<Integer, Boolean> findPath(BabelSynset bs1, BabelSynset bs2) throws Exception {\n\t\tif(bs1.equals(bs2) && !bs1.equals(\"bn:00031027n\")) return new Pair<Integer, Boolean>(0, false);\n\t\tif(bs1.equals(bs2) && bs1.equals(\"bn:00031027n\")) return new Pair<Integer, Boolean>(0, true);\n\t\t\n\t\tA_parentsHigh = new ArrayList<String>();\n\t\t\n\t\tPair<Integer, Boolean> default_result = new Pair<Integer, Boolean>(0, true);\n\t\t\n\t\tint A_path = 0;\n\t\tString A_parent = bs1.getId().toString();\n\t\tB_recoverAncestors(bs2, 25);\n\t\t\n\t\tSystem.out.println(B_Ancestors+\"\\n\\n\");\n\t\t\n\t\tif(A_parent == null) return new Pair<Integer, Boolean>(B_Ancestors.size(), true);\n\t\tif(A_parent.equals(\"bn:00031027n\")) return new Pair<Integer, Boolean>(B_Ancestors.size()+1, true);\n\t\tfor(int i=0; i<50; i++) {\n\t\t\tSystem.out.println(A_parent);\n\t\t\tint B_path = 0;\n\t\t\tfor(String id : B_Ancestors) {\n\t\t\t\tif(A_parent.equals(id)) {\n\t\t\t\t\tSystem.out.println(\"Path di A: \" + A_path + \"\\nPath di B: \" + B_path);\n\t\t\t\t\tif(id.equals(\"bn:00031027n\")) return new Pair<Integer, Boolean>(A_path+B_path, true);\n\t\t\t\t\telse return new Pair<Integer, Boolean>(A_path+B_path, false);\n\t\t\t\t}\n\t\t\t\tB_path++;\n\t\t\t}\n\t\t\tif(A_parent.equals(\"bn:00031027n\")) break;\n\t\t\tA_parent = recoverParent(bn.getSynset(new BabelSynsetID(A_parent)));\n\t\t\tA_path++;\n\t\t}\n\t\treturn default_result;\n\t}", "void findLeadrsInArray1(int[] a){\n\t\tint n = a.length;\n\t\tboolean flag = true;\n\t\tfor(int i =0;i<n;i++){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(a[i] < a[j]){\n\t\t\t\t\tflag = false; \n\t\t\t\t}\n\t\t\t}\n\t\t\tif(flag != false){\n\t\t\t\tSystem.out.println(a[i]);\n\t\t\t}\n\t\t}\n\t}", "private static int findPairs(int[] nums, int k) {\n if(nums == null || nums.length == 0 || k < 0)\n return 0;\n\n int count = 0;\n Map<Integer, Integer> map = new HashMap<>();\n for(int i : nums)\n map.put(i, map.getOrDefault(i, 0) + 1);\n\n for(Map.Entry<Integer, Integer> entry : map.entrySet()) {\n if(k == 0) {\n if(entry.getValue() >= 2)\n count++;\n } else {\n if(map.containsKey(entry.getKey() + k))\n count++;\n }\n }\n return count;\n }", "private HandRankingValue checkAbovePair() {\n HandRankingValue aboveTrips = checkAboveTrips();\n if(aboveTrips != null)\n return aboveTrips;\n else {\n if(validTwoPair())\n return HandRankingValue.TWOPAIR;\n makePair();\n return HandRankingValue.PAIR;\n }\n }", "public Point[] nearestPair() {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (this.size<2)\treturn null; //step 1\n\t\t\tif (this.size==2){\n\t\t\t\tAnswer[0]=this.minx.getData();\n\t\t\t\tAnswer[1]=this.maxx.getData();\n\t\t\t\treturn Answer;\t\t\t\n\t\t\t}\n\t\t\tdouble MinDistance=-1; // for sure it will be change in the next section, just for avoid warrning.\n\t\t\tdouble MinDistanceInStrip=-1;\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2]; // around the median\n\t\t\tboolean LargestAxis = getLargestAxis(); //step 2\n\t\t\tContainer median = getMedian(LargestAxis); //step 3\n\t\t\tif (LargestAxis){// step 4 - calling the recursive function nearestPairRec\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.minx.getData().getX(), median.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextX().getData().getX(), this.maxx.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.miny.getData().getY(), median.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextY().getData().getY(), this.maxy.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (MinPointsLeft!=null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}\n\t\t\telse if (MinPointsRight!=null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 - nearest point around the median\n\t\t\tif (MinDistance==-1) MinDistance=0;\n\t\t\tMinPointsInStrip = nearestPairInStrip(median, MinDistance*2, LargestAxis);\n\t\t\tif (MinPointsInStrip != null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "static boolean helper1(Set<String> set, int[] stones, int index, int k) {\n System.out.println(index + \" \" + k);\n for (int i = index + 1; i < stones.length; i++) {\n int gap = stones[i] - stones[index];\n if (gap >= k - 1 && gap <= k + 1) {\n boolean res = helper1(set, stones, i, gap);\n if (res == true) return true;\n } else if (gap > k + 1) break;\n }\n return (index == stones.length - 1);\n }", "public void compressPairsGreedy(final List<GPairRecord<S, S>> pairApperances, final List<GPairRecord<S, S>> crossingPairs, final int largestTerminal) {\n\n BitSet bitSet = new BitSet(largestTerminal);\n BitSet leftSigma = new BitSet(largestTerminal);\n BitSet rightSigma = new BitSet(largestTerminal);\n\n List<List<Pair<S, Long>>> right = new ArrayList<>(largestTerminal);\n List<List<Pair<S, Long>>> left = new ArrayList<>(largestTerminal);\n\n // initial tables left and right\n for(int i = 0; i < largestTerminal; i++) {\n right.add(new ArrayList<Pair<S, Long>>());\n left.add(new ArrayList<Pair<S, Long>>());\n }\n\n // fill tables with k_{ab} and k_{ba}\n for(GPairRecord<S, S> record : pairApperances) {\n right.get(record.pair.a.getId()).add(new Pair<S, Long>(record.pair.b, record.getAppearences()));\n left.get(record.pair.b.getId()).add(new Pair<S, Long>(record.pair.a, record.getAppearences()));\n }\n\n for(GPairRecord<S, S> record : crossingPairs) {\n bitSet.set(record.pair.a.getId());\n bitSet.set(record.pair.b.getId());\n }\n\n int[] countR = new int[largestTerminal];\n int[] countL = new int[largestTerminal];\n\n for(int a = 0; a < bitSet.size(); a++) {\n if(bitSet.get(a)) {\n int[] count = null;\n if(countR[a] >= countL[a]) {\n leftSigma.set(a);\n count = countL;\n }\n else {\n rightSigma.set(a);\n count = countR;\n }\n\n Iterator<Pair<S, Long>> rightIterator = right.get(a).iterator();\n while (rightIterator.hasNext()) {\n Pair<S, Long> entry = rightIterator.next();\n count[entry.a.getId()] += entry.b;\n rightIterator.remove();\n }\n\n Iterator<Pair<S, Long>> leftIterator = left.get(a).iterator();\n while (leftIterator.hasNext()) {\n Pair<S, Long> entry = leftIterator.next();\n count[entry.a.getId()] += entry.b;\n leftIterator.remove();\n }\n }\n }\n\n long sumL = 0;\n long sumR = 0;\n\n // Sum up appearances: O(|G|)\n for(GPairRecord<S, S> record : pairApperances) {\n Pair<S,S> pair = record.pair;\n if(leftSigma.get(pair.a.getId()) && rightSigma.get(pair.b.getId())) {\n sumL += record.getAppearences();\n }\n\n if(rightSigma.get(pair.a.getId()) && leftSigma.get(pair.b.getId())) {\n sumR += record.getAppearences();\n }\n }\n\n // swap\n if(sumL < sumR) {\n BitSet tmp = rightSigma;\n rightSigma = leftSigma;\n leftSigma = tmp;\n }\n\n Iterator<GPairRecord<S, S>> pairRecordIterator = crossingPairs.iterator();\n while (pairRecordIterator.hasNext()) {\n Pair<S, S> pair = pairRecordIterator.next().pair;\n if(!leftSigma.get(pair.a.getId()) || !rightSigma.get(pair.b.getId())) {\n pairRecordIterator.remove();\n }\n }\n final BitSet fixedRightSigma = rightSigma;\n final BitSet fixedLeftSigma = leftSigma;\n\n // remove pairs we don't wanna compress: O(|G|)\n final List<GPairRecord<S,S>> uncrossedPairs = crossingPairs.stream()\n .filter(rec -> !rec.isCrossingPair())\n .filter(rec -> wordProperties.isPairAt(rec.node, rec.pair))\n .filter(rec -> fixedLeftSigma.get(rec.pair.a.getId()) && fixedRightSigma.get(rec.pair.b.getId()))\n .collect(Collectors.toList());\n\n // gather the uncrossed ones: O(|G|)\n if(!uncrossedPairs.isEmpty()) {\n final List<GPairRecord<S,S>> trash = new LinkedList<>();\n final Function<Pair<S, S>, Consumer<GPairRecord<S, S>>> consumerFunction = p ->\n {\n if(fixedLeftSigma.get(p.a.getId()) && fixedRightSigma.get(p.b.getId())) {\n return uncrossedPairs::add;\n }\n else {\n return trash::add;\n }\n };\n\n BiFunction<S, Integer, Boolean> doGreedyLeftPop = (nonTerminal, j) -> doLeftPop(nonTerminal, head -> head.isTerminal() && fixedRightSigma.get(head.getId()));\n\n BiFunction<S, Integer, Boolean> doGreedyRightPop = (nonTerminal, j) -> doRightPop(nonTerminal, tail -> tail.isTerminal() && fixedLeftSigma.get(tail.getId()));\n\n //pop: O(n+m)\n pop(phase, nonTerminal -> doGreedyLeftPop.apply(nonTerminal, 0), nonTerminal -> doGreedyRightPop.apply(nonTerminal, 0), consumerFunction);\n\n // O(|G|)\n sortPairs(uncrossedPairs);\n\n // O(|G|)\n compressUncrossedPairs(uncrossedPairs);\n }\n }", "public static final int[] TurnstilePassingTimeArray (\n\t\tfinal int[] arrivalTimeArray,\n\t\tfinal int[] directionArray)\n\t{\n\t\tint prevDirection = -1;\n\t\tint time = arrivalTimeArray[0];\n\t\tint[] turnstilePassingTimeArray = new int[arrivalTimeArray.length];\n\n\t\tjava.util.TreeMap<Integer, java.util.List<Integer>> exitListMap =\n\t\t\tnew java.util.TreeMap<Integer, java.util.List<Integer>>();\n\n\t\tjava.util.TreeMap<Integer, java.util.List<Integer>> entryListMap =\n\t\t\tnew java.util.TreeMap<Integer, java.util.List<Integer>>();\n\n\t\tfor (int i = 0; i < arrivalTimeArray.length; ++i) {\n\t\t\tif (0 == directionArray[i]) {\n\t\t\t\tif (entryListMap.containsKey (arrivalTimeArray[i]))\n\t\t\t\t\tentryListMap.get (arrivalTimeArray[i]).add (i);\n\t\t\t\telse {\n\t\t\t\t\tjava.util.List<Integer> entryIndexList = new java.util.ArrayList<Integer>();\n\n\t\t\t\t\tentryIndexList.add (i);\n\n\t\t\t\t\tentryListMap.put (arrivalTimeArray[i], entryIndexList);\n\t\t\t\t}\n\t\t\t} else if (1 == directionArray[i]) {\n\t\t\t\tif (exitListMap.containsKey (arrivalTimeArray[i]))\n\t\t\t\t\texitListMap.get (arrivalTimeArray[i]).add (i);\n\t\t\t\telse {\n\t\t\t\t\tjava.util.List<Integer> exitIndexList = new java.util.ArrayList<Integer>();\n\n\t\t\t\t\texitIndexList.add (i);\n\n\t\t\t\t\texitListMap.put (arrivalTimeArray[i], exitIndexList);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twhile (0 != entryListMap.size() || 0 != exitListMap.size()) {\n\t\t\tif (-1 == prevDirection || 1 == prevDirection) {\n\t\t\t\tboolean exitListNotEmpty = 0 != exitListMap.size();\n\n\t\t\t\tjava.util.Map.Entry<Integer, java.util.List<Integer>> firstElement = exitListNotEmpty ?\n\t\t\t\t\texitListMap.firstEntry() : entryListMap.firstEntry();\n\n\t\t\t\tint key = firstElement.getKey();\n\n\t\t\t\tjava.util.List<Integer> firstIndexList = firstElement.getValue();\n\n\t\t\t\tint index = firstIndexList.get (0);\n\n\t\t\t\tfirstIndexList.remove (0);\n\n\t\t\t\tif (exitListNotEmpty) {\n\t\t\t\t\tif (0 == firstIndexList.size()) exitListMap.remove (key);\n\t\t\t\t} else {\n\t\t\t\t\tif (0 == firstIndexList.size()) entryListMap.remove (key);\n\t\t\t\t}\n\n\t\t\t\ttime = key > time ? key : time;\n\t\t\t\tprevDirection = exitListNotEmpty ? 1 : 0;\n\t\t\t\tturnstilePassingTimeArray[index] = time;\n\t\t\t} else if (0 == prevDirection) {\n\t\t\t\tboolean entryListNotEmpty = 0 != entryListMap.size();\n\n\t\t\t\tjava.util.Map.Entry<Integer, java.util.List<Integer>> firstElement = entryListNotEmpty ?\n\t\t\t\t\tentryListMap.firstEntry() : exitListMap.firstEntry();\n\n\t\t\t\tint key = firstElement.getKey();\n\n\t\t\t\tjava.util.List<Integer> firstIndexList = firstElement.getValue();\n\n\t\t\t\tint index = firstIndexList.get (0);\n\n\t\t\t\tfirstIndexList.remove (0);\n\n\t\t\t\tif (entryListNotEmpty) {\n\t\t\t\t\tif (0 == firstIndexList.size()) entryListMap.remove (key);\n\t\t\t\t} else {\n\t\t\t\t\tif (0 == firstIndexList.size()) exitListMap.remove (key);\n\t\t\t\t}\n\n\t\t\t\ttime = key > time ? key : time;\n\t\t\t\tprevDirection = entryListNotEmpty ? 0 : 1;\n\t\t\t\tturnstilePassingTimeArray[index] = time;\n\t\t\t}\n\n\t\t\t++time;\n\t\t}\n\n\t\treturn turnstilePassingTimeArray;\n\t}", "public static Long neighborPairsDouble(Set<Integer>[] graphSet, int[][] graphArray) {\n long triangleCount = 0;\n int degv, u, w, degu, degw;\n for (int v = 0; v < graphArray.length; v++) {\n degv = graphArray[v].length;\n for (int i = 0; i < degv; i++) {\n u = graphArray[v][i];\n degu = graphArray[u].length;\n if (degu > degv || (degu == degv && v < u)) {\n for (int j = i + 1; j < degv; j++) {\n w = graphArray[v][j];\n degw = graphArray[w].length;\n if (degw > degv || (degw == degv && v < w)) {\n if (graphSet[u].contains(w))\n triangleCount++;\n }\n }\n }\n }\n }\n return triangleCount;\n }" ]
[ "0.542941", "0.5212273", "0.5080402", "0.50761473", "0.5000415", "0.4993118", "0.4985136", "0.49335903", "0.4926757", "0.49239957", "0.48507208", "0.48252907", "0.47948033", "0.47107178", "0.46984237", "0.461587", "0.4612746", "0.4593944", "0.45754504", "0.45097214", "0.4468561", "0.44544867", "0.44492203", "0.4446726", "0.4431946", "0.44260627", "0.4415571", "0.44119036", "0.4405563", "0.44008818", "0.4398369", "0.43754694", "0.43537742", "0.43456954", "0.4325985", "0.43166324", "0.43146732", "0.4309599", "0.43054602", "0.4302218", "0.42946196", "0.42700493", "0.42415318", "0.42243275", "0.4221691", "0.42095917", "0.41992557", "0.4146938", "0.4146874", "0.41414338", "0.4136709", "0.4127783", "0.41253453", "0.4120565", "0.41172236", "0.41169402", "0.41154286", "0.4115149", "0.4114843", "0.41140836", "0.41112742", "0.41085854", "0.41066313", "0.41011277", "0.40959692", "0.40913078", "0.4080111", "0.4070857", "0.4067388", "0.4067169", "0.40592906", "0.4050935", "0.40487924", "0.40469202", "0.40457675", "0.40410322", "0.4040577", "0.40387034", "0.40362754", "0.40348935", "0.40340912", "0.40329504", "0.40327653", "0.40305915", "0.4026904", "0.40135074", "0.4011413", "0.40072066", "0.39963832", "0.399612", "0.39946556", "0.39908212", "0.39864227", "0.39832118", "0.39804727", "0.3978703", "0.39730492", "0.39696205", "0.39682722", "0.39662492" ]
0.67727983
0
Bryn has defined a two step rounding process to handle all numbers received from the stock brokers API. Given any numeric value this function applies the first step of the rounding process and returns the result.
public static Number step1Rounding(Number value) { return rounder.performRounding(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double roundToOneDecimal(double num) {\n\t\treturn (int)((10 * num) + 0.5) / 10.0;\n\t}", "private static double rundeBetrag(double betrag){\n \tdouble round = Math.round(betrag*10000); \r\n \t\r\n \tround = round / 10000; \r\n \tround = Math.round(round*1000); \r\n \tround = round / 1000; \r\n \tround = Math.round(round*100); \r\n \r\n \treturn round / 100; \r\n }", "private double roundValue(double x) {\n\t\tx = x * 1000;\n\t\tx = Math.round(x);\n\t\tx = ((double) x) / 1000;\n\t\treturn x;\n\t}", "public static double round2(double num1) {\n\t\tnum1=((num1+.005)*100);\r\n\t\tnum1 = (int) num1;\r\n\t\treturn(num1/100);\r\n\t}", "public static double rounding(double value) {\n\t\treturn ((int) (value * 100)) / 100.0;\n\t}", "public double round (double value) {\n BigDecimal bd = new BigDecimal(value);\n bd = bd.setScale(2, RoundingMode.HALF_UP);\n return bd.doubleValue();\n }", "public double round(double value) {\n\t\treturn round(value, 2);\n\t}", "private double roundDecimal(double value, int precision) {\n \tdouble precisionMultiple = Math.pow(10, precision);\n \treturn Math.round(value * precisionMultiple) / precisionMultiple;\n }", "public static double round1(double n) {\r\n return Math.round(n * 10.0) / 10.0;\r\n }", "public static BigDecimal round(BigDecimal value, BigDecimal increment,RoundingMode roundingMode) {\r\n\t\tif (increment.signum() == 0) {\r\n\t\treturn value;\r\n\t\t} else {\r\n\t\t\tBigDecimal divided = value.divide(increment, 0, roundingMode);\r\n\t\t\tBigDecimal result = divided.multiply(increment);\r\n\t\t\tresult.setScale(2, RoundingMode.UNNECESSARY);\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}", "public static double round(double value) {\n BigDecimal bd = BigDecimal.valueOf(value);\n bd = bd.setScale(2, RoundingMode.HALF_UP);\n return bd.doubleValue();\n }", "static Double round(Double value) {\n BigDecimal bd = new BigDecimal(Double.toString(value));\n bd = bd.setScale(6, RoundingMode.HALF_UP);\n return bd.doubleValue();\n }", "public static double round2(double x) {\n\t\treturn Math.round(100 * x) / 100d;\n\t}", "public static double staticRound(double value) {\n BigDecimal bd = new BigDecimal(value);\n bd = bd.setScale(2, RoundingMode.HALF_UP);\n return bd.doubleValue();\n }", "protected BigDecimal returnRoundedValue(BigDecimal numberToConvert) {\r\n\t\treturn numberToConvert.setScale(2, RoundingMode.HALF_UP);\r\n\t}", "private static Number convert(Number value, UnitConverter cvtr,\r\n \t\t\tMathContext ctx) {\r\n \t\tif (cvtr instanceof RationalConverter) { // Try converting through Field\r\n \t\t\t\t\t\t\t\t\t\t\t\t\t// methods.\r\n \t\t\tRationalConverter rCvtr = (RationalConverter) cvtr;\r\n \t\t\tBigInteger dividend = rCvtr.getDividend();\r\n \t\t\tBigInteger divisor = rCvtr.getDivisor();\r\n \t\t\tif (dividend.abs().compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0)\r\n \t\t\t\tthrow new ArithmeticException(\"Multiplier overflow\"); //$NON-NLS-1$\r\n \t\t\tif (divisor.compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0)\r\n \t\t\t\tthrow new ArithmeticException(\"Divisor overflow\"); //$NON-NLS-1$\r\n\t\t\tif (value instanceof BigInteger || value instanceof Long || value instanceof Integer) {\r\n\t\t\t\treturn (value.longValue() * dividend.longValue())\r\n \t\t\t\t\t/ (divisor.longValue());\r\n\t\t\t} else {\r\n\t\t\t\treturn (value.doubleValue() * dividend.doubleValue())\r\n\t\t\t\t\t/ (divisor.doubleValue());\r\n\t\t\t\t// TODO use actual BigDecimal methods for BigDecimal\r\n\t\t\t}\r\n \t\t} else if (cvtr instanceof AbstractConverter.Compound\r\n \t\t\t\t&& cvtr.isLinear()) { // Do it in two parts.\r\n \t\t\tAbstractConverter.Compound compound = (AbstractConverter.Compound) cvtr;\r\n \t\t\tNumber firstConversion = convert(value, compound.getRight(), ctx);\r\n \t\t\tNumber secondConversion = convert(firstConversion,\r\n \t\t\t\t\tcompound.getLeft(), ctx);\r\n \t\t\treturn secondConversion;\r\n \t\t} else { // Try using BigDecimal as intermediate.\r\n \t\t\tBigDecimal decimalValue = BigDecimal.valueOf(value.doubleValue());\r\n \t\t\tBigDecimal newValue = cvtr.convert(decimalValue, ctx);\r\n \t\t\treturn newValue;\r\n \t\t\t// if (((FieldNumber)value) instanceof Decimal)\r\n \t\t\t// return (N)((FieldNumber)Decimal.valueOf(newValue));\r\n \t\t\t// if (((FieldNumber)value) instanceof Float64)\r\n \t\t\t// return (N)((FieldNumber)Float64.valueOf(newValue.doubleValue()));\r\n \t\t\t// throw new ArithmeticException(\r\n \t\t\t// \"Generic amount conversion not implemented for amount of type \" +\r\n \t\t\t// value.getClass());\r\n \t\t}\r\n \t}", "protected double round(double value, int precision) {\n int scale = (int) Math.pow(10, precision);\n return (double) Math.round(value * scale) / scale;\n }", "public static void main(String[] args) {\n\n BigDecimal test = BigDecimal.valueOf(12051);\n BigDecimal result = test.divide(BigDecimal.valueOf(100),2, BigDecimal.ROUND_UP);\n BigDecimal result1 = test.divide(BigDecimal.valueOf(100),2, BigDecimal.ROUND_CEILING);\n System.out.println(result);\n System.out.println(result1);\n }", "public static double round(double number) {\r\n //MiscStuff.writeToLog(number);\r\n Double d = new Double(number);\r\n String str = d.toString();\r\n str.trim();\r\n \r\n if(str.indexOf('.') + 3 < str.length()) {\r\n if(!str.equals(\"NaN\") && !str.equals(\"Infinity\") \r\n && !str.equals(\"-Infinity\")) {\r\n \r\n \r\n int i = str.indexOf('.');\r\n String str1 = str.substring(0, i + 3);\r\n d = new Double(str1);\r\n \r\n //MiscStuff.writeToLog(\" \" + str + \" \" + d);\r\n \r\n if(!str.substring(i+3).equals(\"\") ) {\r\n int rounder = new Integer(str.substring(i+3, i+4));\r\n \r\n if(5 <= rounder) {\r\n Double d2 = (10 - rounder) * .001;// d + new Float(.01);\r\n d = number + d2;\r\n //MiscStuff.writeToLog(\"Rounder \" + rounder + \" \" + d2);\r\n \r\n String str2 = d.toString();\r\n str2.trim();\r\n \r\n if(str2.indexOf('.') + 3 < str2.length()) \r\n d = Math2.round(d); //don't get stuck....\r\n }\r\n }\r\n \r\n number = d; \r\n }\r\n \r\n else {\r\n //MiscStuff.writeToLog(number); \r\n }\r\n }\r\n \r\n return number;\r\n }", "public static double roundPrice(double pNumber){\n\t\tBigDecimal bd = new BigDecimal(Double.toString(pNumber));\n\t\tbd = bd.setScale(2, BigDecimal.ROUND_HALF_UP);\n\t\treturn bd.doubleValue();\n\t}", "private double round(double value, int decimalPlaces) {\n return new BigDecimal(value).setScale(decimalPlaces, RoundingMode.HALF_UP).doubleValue();\n }", "static double roundDigits(double x, int digits) {\n if(Double.isNaN(x)) return x;\n double sgn = x < 0 ? -1 : 1;\n x = Math.abs(x);\n double power_of_10 = (int)Math.pow(10, digits);\n return sgn*(digits == 0\n // go to the even digit\n ? (x % 1 >= 0.5 && !(Math.floor(x)%2==0))\n ? Math.ceil(x)\n : Math.floor(x)\n : Math.floor(x * power_of_10 + 0.5) / power_of_10);\n }", "private void roundNumber(String roundingFormat){\n float num1 = 0;\n num1 = Float.parseFloat(txtBox.getText());\n DecimalFormat format = new DecimalFormat(roundingFormat);\n txtBox.setText(String.valueOf(format.format(num1)));\n }", "private double roundNumber(double in_number, int precision) {\r\n\t\tdouble round_precision = Math.pow(10, (double) precision);\r\n\t\treturn Math.round(in_number * round_precision) / round_precision;\r\n\t}", "public static double roundFee(double value, int decimals) {\r\n\t\t\r\n\t\tif (decimals<=0) return (double)Math.round(value);\r\n\t\tdouble divideby = Math.pow(10, (double)decimals);\r\n\t\tdouble rounded = Math.round(value * divideby)/((double)divideby);\r\n\t\treturn rounded;\r\n\t\t\r\n\t}", "private float getRoundFourDecimals(float priceIndex) {\n\t\t\n\t\tpriceIndex = ((float)(int)(priceIndex * 100000)) / (float)100000;\t\n\t\t\n\t\tpriceIndex = priceIndex * 10000;\n\t\tpriceIndex = ((float)(int)(priceIndex * 10)) / (float)10;\t\t\n\t\tpriceIndex = (float) Math.ceil(priceIndex);\n\n\t\tpriceIndex = priceIndex / 10000;\n\t\t\n\t\treturn priceIndex;\n\t}", "public void handleNextRound() {\n\t\t\r\n\t}", "double roundOff (double value) {\n\t\treturn Math.floor((value + EPSILON) * 100) / 100;\n\t}", "private static double snapSpace(double value, boolean snapToPixel) {\n return snapToPixel ? Math.round(value) : value;\n }", "double roundTwoDecimals(double d) { \n DecimalFormat twoDForm = new DecimalFormat(\"#.##\"); \n return Double.valueOf(twoDForm.format(d));\n }", "public static long kRounding(){\n\t\tScanner kbd = new Scanner(System.in); //see fairgame\n\t\tint input = kbd.nextInt();\n\t\tint Nput = input;\n\t\tint rounding = kbd.nextInt();\n\n\t\tint div2 = 0;\n\t\tint div5 = 0;\n\n\t\twhile (input % 2 == 0){\n\t\t\tdiv2++;\n\t\t\tinput = input/2;\n\t\t}\n\t\twhile (input % 5 == 0){\n\t\t\tdiv5++;\n\t\t\tinput = input/5;\n\t\t}\n\n\t\tint multiplierTwo = 1;\n\t\tint multiplierFive = 1;\n\t\tif(rounding - div2 > 0){\n\t\t\tmultiplierTwo = (int) Math.pow(2, rounding - div2);\n\t\t}\n\t\tif(rounding - div5 > 0){\n\t\t\tmultiplierFive = (int) Math.pow(5, rounding - div5)\n\t\t}\n\n\t\treturn multiplierTwo*(long)multiplierFive*(long)Nput;\n\t}", "private int round2(double candidate) {\n\tif (candidate > 0.5) {\n\t return(1);\n\t}\n\n\treturn(0);\n }", "public static double dparm_round (double value) {\n\t\tdouble result = value;\n\t\ttry {\n\t\t\tresult = Double.parseDouble (String.format (Locale.US, \"%.2e\", value));\t// limit to 3 significant digits\n\t\t} catch (Exception e) {\n\t\t\tresult = value;\n\t\t}\n\t\treturn result;\n\t}", "public int getRound()\r\n\t{\r\n\t\treturn this.round;\r\n\t}", "private static BigDecimal roundDecimalValue(BigDecimal dec, int precision, boolean isHalfToEven)\n {\n if(isHalfToEven){\n return dec.setScale(precision, RoundingMode.HALF_EVEN);\n }\n else {\n int sgn = dec.signum();\n if (sgn < 0)\n return dec.setScale(precision, RoundingMode.HALF_DOWN);\n else\n return dec.setScale(precision, RoundingMode.HALF_UP);\n }\n }", "public static double roundDouble(double value, int precision){\n\t\tint rounder = (int)Math.pow(10, precision);\n\t\treturn (double)Math.round(value * rounder) / rounder;\n\t}", "public double round(double value, int precision) {\n\t\ttry {\n\t\t\tBigDecimal bd = new BigDecimal(value);\n\t\t\tBigDecimal rounded = bd.setScale(precision,\n\t\t\t\t\tBigDecimal.ROUND_HALF_UP);\n\t\t\treturn rounded.doubleValue();\n\t\t} catch (Exception e) {\n\t\t\tLog.e(\"Engine\", \"round: error rounding number\");\n\t\t}\n\t\treturn 0;\n\t}", "private int convertX(double x)\n {\n return (int)Math.round(x);\n }", "public double round(Double num){\n\t\treturn Math.round(num*100.0)/100.0;\n\t}", "private double round(double data) {\n\n\t\treturn Math.rint(data / m_Precision) * m_Precision;\n\t}", "private double roundPrecision(double value, int decimalPlaces) {\r\n\t\t// Value is multiplied by an appropriate power of ten to shift the\r\n\t\t// decimal right the number of places that need to be preserved, then\r\n\t\t// rounded to the nearest whole number thus cutting off decimal places\r\n\t\t// past the places preserved, and then divided again by the power of ten\r\n\t\t// to move the decimal back.\r\n\t\treturn ((double) Math.round(value * Math.pow(10, decimalPlaces)))\r\n\t\t\t\t/ (double) Math.pow(10, decimalPlaces);\r\n\t}", "private static BigInteger divideAndRound(BigInteger a, BigInteger b) {\r\n BigInteger result = a.divide(b);\r\n //Case 1: Integer part of the quotient is positive, a%b*2>=b, then the float part of the quotient>=.5, therefore add 1 to quotient\r\n if(result.signum()>0 && a.mod(b).multiply(new BigInteger(\"2\")).compareTo(b)>=0)\r\n result = result.add(BigInteger.ONE);\r\n //Case 2: Integer part of the quotient is negative, a%b*2<=b but a%b<>0 , \r\n //then the float part of the quotient<=-0.5, therefore subtract 1 from quotient\r\n else if(result.signum()<0 && a.mod(b).multiply(new BigInteger(\"2\")).compareTo(b)<=0 && !a.mod(b).equals(BigInteger.ZERO))\r\n result = result.subtract(BigInteger.ONE);\r\n //Case 3: Integer part of the quotient is zero then two cases arise: a>0 or a<0\r\n else if(result.signum()==0)\r\n { \r\n //Case 1.1: a>0.5 then result=1\r\n if(a.compareTo(BigInteger.ZERO)>0 && a.mod(b).multiply(new BigInteger(\"2\")).compareTo(b)>=0)\r\n result = BigInteger.ONE;\r\n //Case 1.1: a<-0.5 then result=-1\r\n else if(a.compareTo(BigInteger.ZERO)<0 && a.mod(b).multiply(new BigInteger(\"2\")).compareTo(b)<=0)\r\n result = BigInteger.ZERO.subtract(BigInteger.ONE); //-1 :)\r\n }\r\n return result;\r\n }", "public static double round(double value, int places) {\n if (places < 0) \n \tthrow new IllegalArgumentException();\n long factor = (long) Math.pow(10, places);\n value = value * factor;\n long tmp = Math.round(value);\n return (double) tmp / factor;\n}", "public static double round(double theVal, int periods)\n {\n\tBigDecimal result = roundToBigDecimal(BigDecimal.valueOf(theVal),periods);\n\treturn result.doubleValue();\n }", "private Double roundNumber(final Number number, final int decimalPlaces) {\n\r\n\t\tfinal Double dcPlacesB10 = Math.pow(10, decimalPlaces);\r\n\r\n\t\tfinal Double res = Math.round(number.doubleValue() * dcPlacesB10) / dcPlacesB10;\r\n\r\n\t\treturn res;\r\n\t}", "public static double roundFiveDecimal(double number) {\n return (double)Math.round((number) * 100000d) / 100000d;\n }", "@Test\n public void roundOffDecimalPoints() throws IOException {\n BigDecimal actual = Utils.roundOffDecimalPoints(new BigDecimal(1), 2, 2);\n Assert.assertEquals(\"100.00\", actual.toString());\n }", "private int round(double val) {\n return (int) Math.round(val);\n }", "public static void main(String[] args) {\n Float f1 = 74.02f;\r\n System.out.println(\"float f1=\" + f1);\r\n Float f2 = f1 * 100;\r\n System.out.println(\"float f1 * 100 =\" + f2 + \", longvalue=\" + f2.longValue());\r\n System.out.println(\"float f1 * 100 =\" + f2 + \", rounded=\" + Math.round(f2));\r\n BigDecimal b1 = new BigDecimal(f1);\r\n System.out.println(\"BigDecimal b1=\" + b1);\r\n System.out.println(\"scale =\" + b1.scale());\r\n BigDecimal b2 = b1.setScale(2,BigDecimal.ROUND_HALF_UP);\r\n System.out.println(\"BigDecimal b2=\" + b2);\r\n System.out.println(\"scale =\" + b2.scale());\r\n System.out.println(\"b2.multiply(new BigDecimal(100) =\" + b2.multiply(new BigDecimal(100)));\r\n long l = b2.multiply(new BigDecimal(100)).longValue();\r\n System.out.println(\"long l =\" + l);\r\n System.out.println(\"b2.scaleByPowerOfTen(2) =\" + b2.scaleByPowerOfTen(2));\r\n System.out.println(\" using convertToPence(b1)=\" + convertToPence(b1));\r\n\r\n for (long l1 = 0; l1 <= 10000; l1++) {\r\n float f3 = l1;\r\n f3 = f3 / 100;\r\n float f4 = f3 * 100;\r\n if (f4 != l1) {\r\n //System.out.println(\"rounding error l1=\" + l1 + \", f3=\" + f3 + \", f4=\" + f4);\r\n BigDecimal b3 = convertFromPence(l1);\r\n long l2 = convertToPence(b3);\r\n if (l1 != l2) {\r\n System.out.println(\"rounding error l1=\" + l1 + \", l2=\" + l2);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n\r\n\r\n }", "public int getRound() {\n return round;\n }", "public BigDecimal getConvertedSplitQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ConvertedSplitQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "private int round1(double candidate) {\n\tif (candidate > 0.85) {\n\t return(1);\n\t} else if (candidate < 0.15) {\n\t return(0);\n\t}\n\t\n\treturn(-1);\n }", "protected double roundHalfUp(double num) {\r\n return (double) Math.round(num * 100) / 100;\r\n }", "public int getCurrentRound()\n\t{\n \treturn currentRound;\n\t}", "public static final double round(final double value, final int precision) {\n\t\tfinal int scale = (int) Math.pow(10, precision);\n\t\treturn (double) Math.round(value * scale) / scale;\n\t}", "public static int DIV_ROUND_UP(int a, int b) {\n\treturn (a + b - 1) / b;\n }", "public Integer getRound() {\n return round;\n }", "public static Double round(Double theVal, Long periods)\n {\n\tDouble val = theVal;\n\tif(val == null)\n\t{\n\t return null;\n\t}\n\tBigDecimal result = roundToBigDecimal(BigDecimal.valueOf(theVal).doubleValue(),periods);\n\treturn result.doubleValue();\n }", "public double topInt(double tenths) {\n double rounded = Math.floor(tenths)+1.0;\n\n return rounded;\n}", "@Override\n public void step(final EvaluationContext theContext)\n {\n // pop the top 2 values and add them\n // and push the result onto the value stack\n //\n final Double theSecondOperand = theContext.popValue();\n final Double theFirstOperand = theContext.popValue();\n theContext.pushValue(theFirstOperand / theSecondOperand);\n }", "private double roundUnit(double unit)\n {\n double ones = Math.pow(10, Math.ceil(Math.log10(unit)));\n double twos = Math.pow(10, Math.ceil(Math.log10(unit / 2))) * 2;\n double fives = Math.pow(10, Math.ceil(Math.log10(unit / 5))) * 5;\n\n return Math.min(Math.min(ones, twos), fives);\n }", "private String modifyValue(String value) {\n double d = Double.parseDouble(value);\n int v = round(d);\n return String.valueOf(v);\n }", "public String roundDown(){\n return \"Numero original: \" + this._X + \" numero redondeado hacia abajo \" + (int)Math.floor(this._X);\n }", "public static BigDecimal round(BigDecimal val) {\n return val.setScale(DECIMAL_NUMBER, RoundingMode.HALF_UP);\n }", "public double getRoundingIncrement() {\n return roundingIncrement;\n }", "public static double round(double value, int places) {\n\t if (places < 0) throw new IllegalArgumentException();\n\n\t long factor = (long) Math.pow(10, places);\n\t value = value * factor;\n\t long tmp = Math.round(value);\n\t return (double) tmp / factor;\n\t}", "public static float roundTo1D(float n)\n\t{\n\t\treturn Math.round(n*10.0f)/10.0f;\n\t}", "public static double round(double number, int n) {\n\t\tif (Double.isNaN(number))\n\t\t\treturn Float.NaN;\n\t\t\n\t\tlong d = (long) Math.pow(10, n);\n\t\treturn (double) Math.round(number * d) / d;\n\t}", "public PaxosRound createRound()\n {\n return createRound(0);\n }", "public synchronized int getCurrentRoundNumber()\r\n {\r\n return currentRoundNumber;\r\n }", "private double formatDoubleWithTwoDeci(double value) {\r\n \treturn Math.floor(value*1e2)/1e2;\r\n }", "public double getValue(){\n value*=100;\n value = Math.floor(value);\n value/=100;//returns to hundredths place\n return value;\n }", "public PaxosRound getRound(int a_round)\n {\n PaxosRound result = (PaxosRound) m_rounds.get(new Integer(a_round));\n return result;\n }", "public static double round(double value, int places) {\n if (places < 0) throw new IllegalArgumentException();\n\n long factor = (long) Math.pow(10, places);\n value = value * factor;\n long tmp = Math.round(value);\n return (double) tmp / factor;\n }", "public int getRoundNumber() {\n return roundNumber;\n }", "public static int decimalToAnyBase(int n, int b){\n int val = 0;\n\n int p = 1;\n while(n > 0){\n int d = n % b;\n n = n / b;\n val += p * d;\n p = p * 10;\n }\n\n return val;\n}", "public int getCurrentRound() {\n\t\treturn roundNumber;\n\t}", "public static int round(double a) {\n return (int) Math.floor(a + 0.5f);\n }", "java.math.BigDecimal getSingleBetMinimum();", "public double round(double value, int places) {\n if (places < 0) throw new IllegalArgumentException();\n\n BigDecimal bd = new BigDecimal(value);\n bd = bd.setScale(places, RoundingMode.HALF_UP);\n return bd.doubleValue();\n }", "public void incrementCurrentRoundNumber() {\n\t\t\n\t\tcurrentRoundnumber = currentRoundnumber +1;\n\t}", "public Money roundToFriendly() {\n int compare = amount.compareTo(BigDecimal.ONE);\n if(amount.compareTo(BigDecimal.ONE) == -1 || amount.compareTo(BigDecimal.ONE) == 0) {\n // USD, Euro, Bitcoin, etc\n return new Money(currency, BigDecimal.ONE);\n } else {\n // Any kind of Shilling\n double digitCount = Math.floor(Math.log10(amount.doubleValue())) + 1;\n // The power of 10 ABOVE the amount.\n BigDecimal friendly = BigDecimal.valueOf((long)Math.pow(10, digitCount));\n // Don't show unneeded decimals.\n friendly.setScale(0, BigDecimal.ROUND_DOWN);\n return new Money(currency, friendly);\n // Alternative way, round to a single significant digit, add a zero, change the first\n // digit to a one.\n }\n }", "public void convert(){\n afterValue = firstValue * 1000;\n }", "public static double round(double val, int places) {\n if (places < 0) throw new IllegalArgumentException();\n long factor = (long) Math.pow(10, places);\n val = val*factor;\n long tmp = Math.round(val);\n return (double) tmp/factor;\n }", "public BigDecimal getBSCA_ProfitPriceStdEntered();", "public static void main(String[] args) {\n\t\tdouble d = 302.200;\n\t\tdouble c = 302.700;\n\t\tSystem.out.println(Math.round(d));//retorna 302\n\t\tSystem.out.println(Math.round(c));//retorna 303\n\t}", "static double round2(double number) {\n\t\tnumber = (number * 100); \r\n\t\tnumber = (number + .5);\r\n\t\tnumber = (int) number;\r\n\t\tnumber = (number / 100);\r\n\t\tnumber = (double) number;\r\n=======\n\tpublic static double round2(double number) { //we gottem\r\n\t\tnumber = (number*100); \r\n\t\tnumber = (number+.5);\r\n\t\tnumber = (int)number;\r\n\t\tnumber = (number/100);\r\n\t\tnumber = (double)number;\r\n>>>>>>> branch 'master' of https://github.com/henryhoover/APCS4Fall.git\n\t\treturn number;\t\r\n\t}\r\n\r\n<<<<<<< HEAD\n\tpublic static double exponent(double base, int power) { //a call to exponent raises a value to the integer value. accepts double and integer, returns a double\r\n=======\n\tpublic static double exponent(double base, int power) { //mayhaps./????\r\n>>>>>>> branch 'master' of https://github.com/henryhoover/APCS4Fall.git\n\t\tif(power < 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"no negative powers\");\r\n\t\t}\r\n<<<<<<< HEAD\n\t\tif(power == 0) {\r\n\t\t\treturn(1);\r\n\t\t}\r\n\t\tint repeats = 1;\r\n\t\tdouble answer = base;\r\n\t\twhile (repeats != power) {\r\n\t\t\tanswer = base * base;\r\n\t\t\trepeats++;\r\n\t}\r\n\t\treturn(answer);\r\n\r\n=======\n\t\tint repeats = 1;\r\n\t\twhile (repeats < power) {\r\n\t\t\tpower++;\r\n\t\t\treturn(base*base);\r\n\t}\r\n\t\treturn(1);\r\n>>>>>>> branch 'master' of https://github.com/henryhoover/APCS4Fall.git\n\t}\r\n\t\r\n\t\r\n\tpublic static int factorial(int number) { //a call to factorial returns the factorial of the value passed. accepts and returns an int\r\n\t\tint answer = number;\r\n<<<<<<< HEAD\n\t\tint mult = number -1;\r\n=======\n>>>>>>> branch 'master' of https://github.com/henryhoover/APCS4Fall.git\n\t\tif (number < 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"no negative factorials\");\r\n\t\t}\r\n<<<<<<< HEAD\n\t\tdo {\r\n\t\t\tanswer = number;\r\n\t\t\tmult = mult - 1;\r\n\t\t\treturn(answer);\r\n\t\t} while (mult != 1);\r\n\r\n\t\t}\r\n\t\t\r\n\t\r\n=======\n\t\tif(number == 0) {\r\n\t\t\treturn(1);\r\n\t\t}\r\n\t\tfor (answer = number -1; answer <= number; answer++) {\r\n\t\t\tanswer = answer / 1;\r\n\r\n\t\t}\r\n\t\treturn(answer);\r\n\t}\r\n>>>>>>> branch 'master' of https://github.com/henryhoover/APCS4Fall.git\n\t\r\n\tpublic static boolean isPrime(int number) { //call to isPrime determines if an integer is prime. accepts an int and returns a boolean\r\n\t\tint factor = 2;\r\n\t\tif(isDivisibleBy(number, factor) == false) {\r\n\t\t\tfactor++;\r\n\t\t\treturn(true);\r\n\t\t} else {\r\n\t\t\treturn(false);\r\n\t\t}\r\n\t}\r\n\t\r\n<<<<<<< HEAD\n\tpublic static int gcf(int number1, int number2) { //a call to gcf returns the greatest ccommon factor of the 2 values passed. accepts 2 integers, rerturns an int\r\n\t\tint factor = 1;\r\n\t\tdouble larger = max(number1, number2);\r\n\t\tdouble smaller = min(number1, number2);\r\n\t\tfor (int i = 1; i <= (int)larger; i++) {\r\n\t\t\tif (isDivisibleBy((int)larger, i) == true) {\r\n\t\t\t\tif (isDivisibleBy((int)smaller, i) == true) {\r\n\t\t\t\t\tfactor = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn(factor);\r\n\t\t}\r\n=======\n\tpublic static int gcf(int number1, int number2) { //lets find out\r\n>>>>>>> branch 'master' of https://github.com/henryhoover/APCS4Fall.git\n\r\n<<<<<<< HEAD\n=======\n\t\tif(isPrime(number1 | number2) == false) {\r\n\t\t\twhile(number1 != number2) {\r\n\t\t\t\tif(number1 > number2) {\r\n\t\t\t\t\treturn(number1 - number2);\r\n\t\t\t\t}\r\n\t\t\t\tif(number1 < number2) {\r\n\t\t\t\t\treturn(number2 - number1);\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t\treturn(1);\r\n\t}", "public static BigDecimal roundToPoint99(BigDecimal x) {\n BigDecimal p49 = new BigDecimal(\".49\");\n BigDecimal p99 = new BigDecimal(\".99\");\n BigDecimal xModOne = x.remainder(new BigDecimal(1));\n\n // if the remainder is above or equal to .49, round up\n if(xModOne.compareTo(p49) >= 0 ) {\n return x.add(p99.subtract(xModOne)).stripTrailingZeros();\n } else {\n return x.subtract(xModOne).subtract(new BigDecimal(\".01\")).stripTrailingZeros();\n }\n }", "public Round getActualRound() {\n\t\treturn actualRound;\n\t}", "public void handleNewAuctionRound(int roundNumber, int amount, long price);", "public static String formatR(double number) {\r\n NumberFormat numberFormatter = NumberFormat.getNumberInstance();\r\n numberFormatter.setMinimumFractionDigits(2);\r\n return numberFormatter.format(Math2.round(number));\r\n //return Math2.round(number); \r\n }", "@Override\r\n\tpublic void setRound(int x) {\n\t\troundNum = x;\r\n\t\tupdate();\r\n\t}", "public double roundTwoDecimals(double d) {\r\n\t DecimalFormat twoDForm = new DecimalFormat(\"#.##\");\r\n\t return Double.valueOf(twoDForm.format(d));\r\n\t}", "public static double round(double value, int places) {\n if (places < 0) throw new IllegalArgumentException();\n\n BigDecimal bd = new BigDecimal(value);\n bd = bd.setScale(places, RoundingMode.HALF_UP);\n return bd.doubleValue();\n }", "public static double round(double value, int places) {\n if (places < 0) throw new IllegalArgumentException();\n\n BigDecimal bd = new BigDecimal(value);\n bd = bd.setScale(places, RoundingMode.HALF_UP);\n return bd.doubleValue();\n }", "public static int roundToInt(double x) {\n return (int) Math.round(x);\n }", "public Round getRound(){\n return mRound;\n }", "BigDecimal getLowPrice();", "public String getRoundedValue(final float value) {\n\t\tfinal BigDecimal bigDecimal = new BigDecimal(value).setScale(decimalPlaces, BigDecimal.ROUND_HALF_EVEN);\n\t\treturn bigDecimal.toString();\n\t}", "java.math.BigDecimal getMultipleBetMinimum();" ]
[ "0.61808", "0.6174214", "0.59811825", "0.5973279", "0.5919774", "0.5894772", "0.58272076", "0.58091336", "0.57661796", "0.57309663", "0.5711006", "0.5691332", "0.56904364", "0.5634686", "0.5617675", "0.5615899", "0.55356324", "0.5507985", "0.5489594", "0.547575", "0.5473838", "0.5445636", "0.54320085", "0.5402496", "0.5383979", "0.53467983", "0.53409076", "0.53139335", "0.5302862", "0.5292469", "0.5286899", "0.5284219", "0.5283434", "0.52579194", "0.52220553", "0.5219235", "0.5218009", "0.5191513", "0.5188826", "0.5173899", "0.51597244", "0.51594955", "0.51463723", "0.509873", "0.5090051", "0.50792736", "0.5068508", "0.5061481", "0.5037079", "0.50340974", "0.50331426", "0.50206125", "0.50166595", "0.5005379", "0.5004774", "0.5000921", "0.49883893", "0.49577418", "0.49316797", "0.48985192", "0.4895003", "0.48763943", "0.48737213", "0.4863117", "0.48614538", "0.48562187", "0.48531568", "0.4845797", "0.4834266", "0.4833897", "0.4833685", "0.48159403", "0.48110276", "0.48017842", "0.48005706", "0.47986808", "0.47960764", "0.47910866", "0.47813314", "0.47754654", "0.4766346", "0.47662693", "0.47607067", "0.47600508", "0.47498527", "0.47427756", "0.47389", "0.47343305", "0.4726073", "0.47242168", "0.47175962", "0.47139004", "0.47137052", "0.4703663", "0.4703663", "0.4700742", "0.4684032", "0.4683682", "0.46833706", "0.4683078" ]
0.6711932
0
This utility function converts a Java Calendar object into an integer number expressed in the format YYYYMMDD. This is often useful for sorting operations. Any time element will be ignored.
public static int convertCalendarToIntDate(Calendar calDate) { int result = 0; StringBuilder data = new StringBuilder(""); int year = calDate.get(Calendar.YEAR); int month = calDate.get(Calendar.MONTH); month++; int day = calDate.get(Calendar.DAY_OF_MONTH); data.append(Integer.toString(year)); switch (month) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: String strMonth = "0" + Integer.toString(month); data.append(strMonth); break; default: data.append(Integer.toString(month)); } switch (day) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: String strDay = "0" + Integer.toString(day); data.append(strDay); break; default: data.append(Integer.toString(day)); } result = Integer.parseInt(data.toString()); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getDateAsNumber(){\n\t\tSimpleDateFormat f = new SimpleDateFormat(\"yyyyMMdd\");\n\t\treturn Integer.parseInt(f.format(date.get()));\n\t}", "public static int parseDateForDB(Calendar c){\n return Integer.parseInt(c.get(Calendar.YEAR) + \"\"\n + (c.get(Calendar.MONTH) < 10 ? 0 + \"\" + (c.get(Calendar.MONTH) + 1) : (c.get(Calendar.MONTH) + 1)) + \"\"\n + (c.get(Calendar.DAY_OF_MONTH) < 10 ? 0 + \"\" + c.get(Calendar.DAY_OF_MONTH) : c.get(Calendar.DAY_OF_MONTH)));\n }", "@Test\n\tvoid teststringtoint(){\n\t\tCalendar cal=Calendar.getInstance();\n\t\tint m=cal.get(Calendar.MONTH);\n\t\tint d=cal.get(Calendar.DATE);\n\t\tSystem.out.println(\"m==\"+m+\" d==\"+d);\n\t}", "public int convertCalendarMillisecondsAsLongToDayOfMonthInt(long fingerprint) {\n\t\t\tDateFormat format = new SimpleDateFormat(\"dd\");\n\t\t\tDate date = new Date(fingerprint);\n\t\t\treturn Integer.parseInt(format.format(date));\n\t\t\t}", "public int convertStringDateToInteger(String date);", "public static int getDayNumberByDate(Date val) {\n\t\t if (val != null) {\n\t\t SimpleDateFormat format = new SimpleDateFormat(\"dd\");\n\t\t return parseInt(format.format(val));\n\t\t } else {\n\n\t\t return 0;\n\n\t\t }\n\t}", "public static int ConvertDateTimeToReportDay()\n {\n // Create an instance of SimpleDateFormat used for formatting\n // the string representation of date (month/day/year)\n DateFormat df = new SimpleDateFormat(\"yyyyMMdd\");\n\n // Get the date today using Calendar object.\n Date today = Calendar.getInstance().getTime();\n\n // Using DateFormat format method we can create a string\n // representation of a date with the defined format.\n String reportDate = df.format(today);\n\n return Integer.parseInt(reportDate);\n }", "public int convertCalendarMillisecondsAsStringToDayOfMonthInt(String s) {\n\t\t\tDateFormat format = new SimpleDateFormat(\"dd\");\n\t\t\tDate date = new Date(Long.parseLong(s));\n\t\t\treturn Integer.parseInt(format.format(date));\n\t\t\t}", "private static String toNumber(String in) {\n in = in.toLowerCase();\n for (int i = 0; i < MONTHS.length; i++)\n if (MONTHS[i].equals(in))\n return Integer.toString(i + 1);\n for (int i = 0; i < DAYS.length; i++)\n if (DAYS[i].equals(in))\n return Integer.toString(i);\n try {\n Integer.parseInt(in);\n } catch (NumberFormatException e) {\n throw new IllegalArgumentException(\"'\" + in + \"' is not a number!\");\n }\n return in;\n }", "public static int getDayFromTimestamp(long unixtime){\n \tCalendar c = Calendar.getInstance();\n \tc.setTimeInMillis(unixtime);\n \treturn c.get(Calendar.DATE);\n }", "Calendar toCalendar();", "Calendar toCalendar();", "public static int getYearByDate(Date val) {\n\t\tif (val != null) {\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy\");\n\t\t\treturn parseInt(format.format(val));\n\t\t} else {\n\n\t\t\treturn 0;\n\n\t\t}\n\t}", "public String cal(Calendar calendar) {\r\n String calendari;\r\n calendari = calendar.get(Calendar.DAY_OF_MONTH) + \"-\" + calendar.get(Calendar.MONTH) + \"-\" + calendar.get(Calendar.YEAR);\r\n return calendari;\r\n }", "static final public int toOrdinal(int yyyy, int mm, int dd )\n {\n // treat null date as a special case\n if ( (yyyy == 0) && (mm == 0) && (dd == 0) )\n {\n return NULL_ORDINAL;\n }\n\n // jan01OfYear handles missing day adjustment for years > 1582\n // We only need to handle year = 1582 here.\n int missingDayAdjust =\n ( yyyy == OJC_lastYYYY\n && ((mm == OJC_lastMM\n && dd > OJC_lastDD)\n || mm > OJC_lastMM ))\n ? missingDays : 0;\n\n return jan01OfYear(yyyy)\n + daysInYearPriorToMonth(mm, isLeap(yyyy))\n - missingDayAdjust\n + dd - 1;\n }", "public int toInt()\n\t{\n\t\treturn (int) toLong();\n\t}", "Long getCalendarId();", "public static int getNowDate() {\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyMMdd\");\n\t\treturn Integer.parseInt(dateFormat.format(new Date()));\n\t}", "public int getC_Calendar_ID() {\n\t\tInteger ii = (Integer) get_Value(\"C_Calendar_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public static long getDayNumber() {\n return getSecondsSinceEpoch() / SECS_TO_DAYS;\n }", "public int convertCalendarDateToDayOfWeekAsNum(String stringDate) throws ParseException {\n\t\t\t\tDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\tDate date = formatter.parse(stringDate);\n\t\t\t\tCalendar c = Calendar.getInstance();\n\t\t\t\tc.setTime(date);\n\t\t\t\tint dayOfWeek = c.get(Calendar.DAY_OF_WEEK);\n\t\t\t\treturn dayOfWeek;\n\t\t\t}", "public static Calendar extractDate(int date){\n Calendar c = Calendar.getInstance();\n String d = date+\"\";\n int year = Integer.parseInt(d.substring(0, 4));\n int month = Integer.parseInt(d.substring(4, 6))-1;\n int day = Integer.parseInt(d.substring(6, 8));\n c.set(year, month, day);\n return c;\n }", "public int convertCalendarMillisecondsAsLongToDayOfWeekAsNum(long fingerprint) {\n\t\t\t\tDate date = new Date(fingerprint);\n\t\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\t\tcal.setTime(date);\n\t\t\t\tint dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);\n\t\t\t\treturn dayOfWeek;\n\t\t\t}", "public static int toInt(java.lang.Object o)\n {\n if(o == null)\n {\n return 0;\n }\n else if(o.toString().equals(\"\"))\n {\n return 0;\n }\n else\n {\n return Integer.parseInt(o.toString());\n }\n }", "public static long getDayNumber(long date) {\n TimeZone tz = TimeZone.getDefault();\n long gmtOffset = tz.getOffset(date);\n return (date + gmtOffset) / DAY_IN_MILLIS;\n }", "public static long dateFun( java.sql.Date v ) {\n return v == null ? -1L : Functions.toLong( v );\n }", "public final int getDDD()\n {\n return(ordinal == NULL_ORDINAL) ? 0 : (ordinal - jan01OfYear(yyyy) + 1);\n }", "java.util.Calendar getNextrun();", "public static long toJulianDayNumber(Date date) {\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(date);\n\n\t\tint Y = cal.get(Calendar.YEAR);\n\t\tint M = cal.get(Calendar.MONTH) + 1; // jan=1, feb=2,...\n\t\tint D = cal.get(Calendar.DAY_OF_MONTH);\n\n\t\treturn (1461 * (Y + 4800 + (M - 14) / 12)) / 4\n\t\t+ (367 * (M - 2 - 12 * ((M - 14) / 12))) / 12\n\t\t- (3 * ((Y + 4900 + (M - 14) / 12) / 100)) / 4 + D - 32075;\n\t}", "public static int convertWeekDay(WeekDay day) {\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\tif (day == SUNDAY)\r\n\t\t\treturn (int)Math.pow(2,1);\r\n\t\telse\r\n\t\t\treturn (int)Math.pow(2,values().length - day.ordinal() + 1);\r\n\t}", "public String convertCalendarDateFormatFromNumbersToMonthDayComaYear(String stringDate) throws ParseException {\n\t\t\t\tDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\tDate date = formatter.parse(stringDate);\n\t\t\t\tlong mills = date.getTime();\n\t\t\t\tformatter = new SimpleDateFormat(\"MMM dd, yyyy\");\n\t\t\t\tdate = new Date(mills);\n\t\t\t\treturn formatter.format(date);\n\t\t\t}", "public int calcularEdad(GregorianCalendar gregorianCalendar);", "public static int parseTimeForDB(Calendar c){\n return Integer.parseInt(c.get(Calendar.HOUR_OF_DAY) + \"\"\n + (c.get(Calendar.MINUTE) < 10 ? 0 + \"\" + c.get(Calendar.MINUTE) : c.get(Calendar.MINUTE)));\n }", "public static String getTodayAsSecond(int d) {\n String result = \"0\";\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n Calendar calendar = Calendar.getInstance();\n try {\n calendar.add(Calendar.DAY_OF_YEAR, d);\n Date date = df.parse(df.format(calendar.getTime()));\n calendar.setTime(date);\n result = Long.toString(calendar.getTimeInMillis() / 1000);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return result;\n }", "public int getDaysSinceStartOfEpoch() {\r\n long millis = new GregorianCalendar(year, month - 1, day).getTimeInMillis();\r\n return (int) (millis / MILLIS_PER_DAY);\r\n\r\n }", "public final int getISOWeekNumber()\n {\n if ( ordinal < Jan_01_Leap100RuleYear ) return 0;\n int jan04Ordinal = jan01OfYear(yyyy) + 3;\n int jan04DayOfWeek = (jan04Ordinal + MondayIsZeroAdjustment - MIN_ORDINAL) % 7; // 0=Monday 6=Sunday\n int week1StartOrdinal = jan04Ordinal - jan04DayOfWeek;\n if ( ordinal < week1StartOrdinal )\n { // we are part of the previous year. Don't worry about year 0.\n jan04Ordinal = jan01OfYear(yyyy-1) + 3;\n jan04DayOfWeek = (jan04Ordinal + MondayIsZeroAdjustment - MIN_ORDINAL) % 7; // 0=Monday 6=Sunday\n week1StartOrdinal = jan04Ordinal - jan04DayOfWeek;\n }\n else if ( mm == 12 )\n { // see if we are part of next year. Don't worry about year 0.\n jan04Ordinal = jan01OfYear(yyyy+1) + 3;\n jan04DayOfWeek = (jan04Ordinal + MondayIsZeroAdjustment - MIN_ORDINAL) % 7; // 0=Monday 6=Sunday\n int week1StartNextOrdinal = jan04Ordinal - jan04DayOfWeek;\n if ( ordinal >= week1StartNextOrdinal ) week1StartOrdinal = week1StartNextOrdinal;\n }\n return((ordinal - week1StartOrdinal) / 7) + 1;\n }", "private static int monthStringToInteger(String month){\r\n\r\n\t\tswitch (month){\r\n\t\t\tcase \"Jan\": return 1;\r\n\t\t\tcase \"Feb\": return 2;\r\n\t\t\tcase \"Mar\": return 3;\r\n\t\t\tcase \"Apr\": return 4;\r\n\t\t\tcase \"May\": return 5;\r\n\t\t\tcase \"Jun\": return 6;\r\n\t\t\tcase \"Jul\": return 7;\r\n\t\t\tcase \"Aug\": return 8;\r\n\t\t\tcase \"Sep\": return 9;\r\n\t\t\tcase \"Oct\": return 10;\r\n\t\t\tcase \"Nov\": return 11;\r\n\t\t\tcase \"Dec\": return 12; \r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "public static String Milisec2DDMMYYYY(long ts) {\n\t\tif (ts == 0) {\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\tjava.util.Calendar calendar = java.util.Calendar.getInstance();\n\t\t\tcalendar.setTime(new java.util.Date(ts));\n\n\t\t\tString strTemp = Integer.toString(calendar\n\t\t\t\t\t.get(calendar.DAY_OF_MONTH));\n\t\t\tif (calendar.get(calendar.DAY_OF_MONTH) < 10) {\n\t\t\t\tstrTemp = \"0\" + strTemp;\n\t\t\t}\n\t\t\tif (calendar.get(calendar.MONTH) + 1 < 10) {\n\t\t\t\treturn strTemp + \"/0\" + (calendar.get(calendar.MONTH) + 1)\n\t\t\t\t\t\t+ \"/\" + calendar.get(calendar.YEAR);\n\t\t\t} else {\n\t\t\t\treturn strTemp + \"/\" + (calendar.get(calendar.MONTH) + 1) + \"/\"\n\t\t\t\t\t\t+ calendar.get(calendar.YEAR);\n\t\t\t}\n\t\t}\n\t}", "public static int getMonthNumberByDate(Date val) {\n\t\tif (val != null) {\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"MM\");\n\t\t\treturn parseInt(format.format(val));\n\t\t} else {\n\n\t\t\treturn 0;\n\n\t\t}\n\t}", "private Date calendarToDate(Calendar calendar) {\n return (Date) calendar.getTime();\n }", "public static int getYearOutOfCaseNumber(String caseNumber){\n\n return Integer.parseInt(caseNumber.substring(3,7));\n\n }", "private static int parseInt(final String date, final int beginIndex, final int endIndex) {\n int num = 0;\n for (int i = beginIndex; i < endIndex; i++) {\n final char c = date.charAt(i);\n if (c < '0' || c > '9') {\n throw LOGGER.logExceptionAsError(new DateTimeException(\"Invalid date time: \" + date));\n }\n num = num * 10 + (c - '0');\n }\n\n return num;\n }", "public static int getDifferenceDateOnlyYear(Long val) {\n\n Long date_current = Calendar.getInstance().getTimeInMillis();\n Long years_difference = date_current - val;\n\n Calendar c = Calendar.getInstance();\n c.setTimeInMillis(years_difference);\n return c.get(Calendar.YEAR) - 1970;\n\n }", "public int convertMonthNameToNumAsInt(String name) {\n\t\t int month = 0;\n\t\t name = name.substring(0,3);\n\t\t if (name.equals(\"Jan\")) { month = 1; }\n\t\t if (name.equals(\"Feb\")) { month = 2; }\n\t\t if (name.equals(\"Mar\")) { month = 3; }\n\t\t if (name.equals(\"Apr\")) { month = 4; }\n\t\t if (name.equals(\"May\")) { month = 5; }\n\t\t if (name.equals(\"Jun\")) { month = 6; }\n\t\t if (name.equals(\"Jul\")) { month = 7; }\n\t\t if (name.equals(\"Aug\")) { month = 8; }\n\t\t if (name.equals(\"Sep\")) { month = 9; }\n\t\t if (name.equals(\"Oct\")) { month = 10; }\n\t\t if (name.equals(\"Nov\")) { month = 11; }\n\t\t if (name.equals(\"Dec\")) { month = 12; }\n\t\t \treturn month;\n\t\t\t}", "Integer getDay();", "public static int SubDateTimeAndConvertToReportDay(int amount, int calendarType)\n {\n // Create an instance of SimpleDateFormat used for formatting\n // the string representation of date (month/day/year)\n DateFormat df = new SimpleDateFormat(\"yyyyMMdd\");\n\n // Get the date today using Calendar object.\n Calendar calendar = Calendar.getInstance();\n calendar.add(calendarType, -amount);\n Date newDay = calendar.getTime();\n\n // Using DateFormat format method we can create a string\n // representation of a date with the defined format.\n String reportDate = df.format(newDay);\n\n return Integer.parseInt(reportDate);\n }", "private int caBeDate(String str){\n if(!isNumber(str)){\n return 0;\n }if(str.length()<2){\n return 0;\n }if(str.length()==2){\n return 1;\n }if(str.length() == 3){\n return 2;\n }if(str.length() == 4){\n return 3;\n }if(str.length()>4){\n return 6;\n }\n return 0;\n }", "public int getDay(){\n String[] dateSplit = this.date.split(\"-\");\n calendar.set(Calendar.DAY_OF_MONTH, Integer.valueOf(dateSplit[2]));\n calendar.set(Calendar.MONTH, Integer.valueOf(dateSplit[1])-1);\n calendar.set(Calendar.YEAR, Integer.valueOf(dateSplit[0]));\n return calendar.get(Calendar.DAY_OF_WEEK);\n }", "public static int JsonToInteger(JsonObject jso, String param, int defaulx) {\n try {\n JsonElement res = securGetJSON(jso, param);\n if (res != null) {\n return res.getAsInt();\n } else {\n return defaulx;\n }\n } catch (Exception e) {\n return defaulx;\n }\n }", "protected static int getDay(String dateTime) {\n return Integer.parseInt(dateTime.substring(5, 7));\n }", "protected static final int getISOWeekNumber (int J, int year, int full)\n {\n if (year < full) {\n throw new IllegalArgumentException\n (\"getISOWeekNumber: year < full\");\n }\n\n int d4 = (((J + 31741 - (J % 7)) % 146097) % 36524) % 1461;\n int L = d4 / 1460;\n int d1 = ((d4 - L) % 365) + L;\n return ((d1/7) + 1);\n }", "public static int getDayOfWeekNr(int year, int month, int day, boolean calType) {\n\t\tint sdow = ((int) (swe_julday(year, month, day, 0.0, calType) - 5.5)) % 7;\n\t\treturn sdow;\n\t}", "@Test\n public void getEpochDay() {\n assertEquals(MinguoDate.of(110, 5, 19), MinguoChronology.INSTANCE.dateEpochDay(18766));\n assertEquals(MinguoDate.of(59, 1, 1), MinguoChronology.INSTANCE.dateEpochDay(0));\n }", "Day getDay(String account, int dayOfYear);", "public int getDayOfYear() {\n\n return this.get(DAY_OF_YEAR).intValue();\n\n }", "public static String getDateId() {\n Date date = new Date();\n String dateFormatStyle = \"yy-MM-dd-HH-mm-ss\";\n SimpleDateFormat sdf = new SimpleDateFormat(dateFormatStyle);\n String dateFormat = sdf.format(date);\n String[] formatedDate = dateFormat.split(\"-\");\n int i = 0;\n String year = formatedDate[i];\n String month = formatedDate[++i];\n String cDate = formatedDate[++i];\n String hour = formatedDate[++i];\n String minute = formatedDate[++i];\n String second = formatedDate[++i];\n return alphanum[Integer.parseInt(year)]\n .concat(alphanum[Integer.parseInt(month)])\n .concat(alphanum[Integer.parseInt(cDate)])\n .concat(alphanum[Integer.parseInt(hour)])\n .concat(alphanum[Integer.parseInt(minute)])\n .concat(alphanum[Integer.parseInt(second)]);\n }", "public static String dateConv(int date) {\n\t\tDate mills = new Date(date*1000L); \n\t\tString pattern = \"dd-MM-yyyy\";\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\tsimpleDateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT+1\"));\n\t\tString formattedDate = simpleDateFormat.format(mills);\n\t\treturn formattedDate;\n\t}", "private Calendar formatCalendar(Calendar calendar){\n calendar.set(\n calendar.get(Calendar.YEAR),\n calendar.get(Calendar.MONTH),\n calendar.get(Calendar.DAY_OF_MONTH),\n 0,\n 0,\n 0\n );\n return calendar;\n }", "public int getMonthInteger() \n\t{\n\t\t// 1 will be added here to be able to use this func alone to construct e.g adate\n\t\t// to get the name of the month from getMonth(), 1 must be deducted.\n\t\treturn 1+m_calendar.get(Calendar.MONTH);\n\n\t}", "private int daysSince1900(){\n return this.day + this.month*daysInMonth(this.getMonth(), this.getYear()) +\n (this.year- 1900)*365 + NumberLeapyearsSince1900(this.getYear());\n }", "public static int getDateCompareToday(int day) {\n\t\tDate date = new Date();\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(date);\n\t\tcalendar.add(Calendar.DATE, day);\n\t\tdate = calendar.getTime();\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyyMMdd\");\n\t\treturn Integer.parseInt(dateFormat.format(date));\n\t}", "public static Integer getYear(Date date){\r\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy\"); //EX 2016,02\r\n return new Integer(df.format(date));\r\n }", "public static int number(int m, int d, int y) {\n int n = 0;\n // Tests for user inputted month then reassigns amount of days to a variable.\n if (m == 1) {\n n = n+0;\n } else if (m == 2) {\n n = n+31;\n } else if (m == 3) {\n n = n+59;\n } else if (m == 4) {\n n = n+90;\n } else if (m == 5) {\n n = n+120;\n } else if (m == 6) {\n n = n+151;\n } else if (m == 7) {\n n = n+181;\n } else if (m == 8) {\n n = n+212;\n } else if (m == 9) {\n n = n+243;\n } else if (m == 10) {\n n= n+273;\n } else if (m == 11) {\n n = n+304;\n } else if (m == 12) {\n n = n+334;\n }\n // Calculates the amount of dyas in the year the date is, considering leap years.\n n = n+d+(y*365+y/4-y/100+y/400);\n // Tests if the year entered is a leap year, and if true, 1 day is subtracted.\n if (n/4 == 0 && n/100 == 0 && n/400 == 0 || n/4 == 0 && n/100 != 0) {\n n = n-1;\n }\n return n;\n }", "public static int cleanReleaseYear(Literal year) {\n String yearString;\n int yearInt = 0;\n if(year == null || \"\".equals(year.toString())) {\n yearString = \"0\";\n } else {\n yearString = year.toString();\n }\n Pattern p = Pattern.compile(\"\\\\d\\\\d\\\\d\\\\d\");\n Matcher m = p.matcher(yearString);\n if(m.find()) {\n yearString = m.group();\n yearInt = Integer.parseInt(yearString);\n }\n return yearInt;\n }", "public static int microDateDays(long modified) {\n return (int) ((modified / day) % 262144);\r\n }", "public static int getDay(long time) {\n return getDay(time, Calendar.DATE, 0);\n }", "public static Calendar startOfYear(Date referenceDate, TimeZone timeZone) {\r\n\t\tCalendar c1 = Calendar.getInstance(timeZone);\r\n\t\tc1.setTime(referenceDate);\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(timeZone);\r\n\t\tc2.clear();\r\n\t\tc2.set(c1.get(Calendar.YEAR), 0, 1);\r\n\t\treturn c2;\t\t\r\n\t}", "public Calendar dayOfYear(int dayOfMonth, int month) {\r\n\t\t\r\n\t Calendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t c2.clear();\r\n\t c2.set(Calendar.YEAR, baseCalendar.get(Calendar.YEAR));\r\n\t c2.set(Calendar.DATE, dayOfMonth);\r\n\t\tc2.set(Calendar.MONTH, month - 1);\r\n\t\treturn c2;\r\n\t}", "public static Integer toInteger(java.lang.Object o)\n {\n\t if(o == null)\n\t {\n\t return 0;\n\t }\n\t else if(o.toString().equals(\"\"))\n\t {\n\t return 0;\n\t }\n\telse\n\t{\n\t return Integer.valueOf(o.toString());\n\t}\n }", "private String convertDaysInIntToString(int daysBeforeExpiry) {\n if (daysBeforeExpiry <= 1) {\n return String.valueOf(daysBeforeExpiry) + \" day\";\n } else {\n return String.valueOf(daysBeforeExpiry) + \" days\";\n }\n }", "public static String getYYYYMMDD()\r\n/* 65: */ {\r\n/* 66: 81 */ String nowTime = \"\";\r\n/* 67: 82 */ Date now = new Date();\r\n/* 68: 83 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 69: 84 */ nowTime = formatter.format(now);\r\n/* 70: 85 */ return nowTime;\r\n/* 71: */ }", "private static int day(int month, int day, int year) {\n int y = year - (14 - month) / 12;\n int x = y + y / 4 - y / 100 + y / 400;\n int m = month + 12 * ((14 - month) / 12) - 2;\n int d = (day + x + (31 * m) / 12) % 7;\n return d;\n }", "public static Calendar endOfYear(Date referenceDate, TimeZone timeZone) {\r\n\t\tCalendar c1 = Calendar.getInstance(timeZone);\r\n\t\tc1.setTime(referenceDate);\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance();\r\n\t\tc2.clear();\r\n\t\tc2.set(c1.get(Calendar.YEAR) + 1, 0, 1);\r\n\t\tc2.setTimeZone(timeZone);\r\n\t\t\r\n\t\treturn c2;\r\n\t}", "public static Integer toInteger(Object value) {\n if (value instanceof Integer)\n return (Integer)value;\n else if (value instanceof Long)\n return (int)(long)(Long)value;\n else if (value instanceof Double)\n return (int)(double)(Double)value;\n else if (value == null)\n return null;\n else\n throw new RuntimeException(\"Can't convert [\" + value + \"] to Integer\");\n }", "private String intsToDays(int[] intArr) {\n String returnString = \"\";\n for (int i : intArr) {\n if (i == 1) {\n returnString = returnString + \" Mon\";\n }\n if (i == 2) {\n returnString = returnString + \" Tue\";\n }\n if (i == 3) {\n returnString = returnString + \" Wed\";\n }\n if (i == 4) {\n returnString = returnString + \" Thu\";\n }\n if (i == 5) {\n returnString = returnString + \" Fri\";\n }\n }\n return returnString;\n }", "public String convertCalendarMillisecondsAsLongToYearAsString(long fingerprint) {\n\t\t\t\tDateFormat format = new SimpleDateFormat(\"yyyy\"); // not \"yyyy-MM-dd HH:mm:ss\"\n\t\t\t\tDate date = new Date(fingerprint);\n\t\t\t\treturn format.format(date);\n\t\t\t}", "private static long makeEpoch() {\n Calendar c = Calendar.getInstance(TimeZone.getTimeZone(\"GMT-0\"));\n c.set(Calendar.YEAR, 1582);\n c.set(Calendar.MONTH, Calendar.OCTOBER);\n c.set(Calendar.DAY_OF_MONTH, 15);\n c.set(Calendar.HOUR_OF_DAY, 0);\n c.set(Calendar.MINUTE, 0);\n c.set(Calendar.SECOND, 0);\n c.set(Calendar.MILLISECOND, 0);\n return c.getTimeInMillis();\n }", "private int parseMDYYYYtoJDate(String sDate) throws OException\r\n\t{\r\n final int month = 0;\r\n final int day = 1;\r\n final int year = 2;\r\n int result = OCalendar.today();\r\n String separator = \"\";\r\n\r\n if(sDate.indexOf(\"/\") > 0)\r\n separator = \"/\";\r\n else if(sDate.indexOf(\"-\") > 0)\r\n separator = \"-\";\r\n else if(sDate.indexOf(\"\\\\\") > 0)\r\n separator = \"\\\\\";\r\n else\r\n return result;\r\n\r\n String subDate[] = sDate.split(separator);\r\n if(subDate.length != 3)\r\n return result;\r\n\r\n if((subDate[day].length() != 1 && subDate[day].length() != 2)\r\n || (subDate[month].length() != 1 && subDate[month].length() != 2)\r\n || (subDate[year].length() != 2 && subDate[year].length() != 4))\r\n return result;\r\n\r\n // Fix Month to MM\r\n if(subDate[month].length() == 1)\r\n subDate[month] = \"0\" + subDate[month];\r\n\r\n // Fix Day to DD\r\n if(subDate[day].length() == 1)\r\n subDate[day] = \"0\" + subDate[day];\r\n\r\n // Fix Year to YYYY\r\n if(subDate[year].length() == 2)\r\n subDate[year] = \"20\" + subDate[year];\r\n\r\n\r\n // Convert to Julian Date using YYYYMMDD convert function\r\n result = OCalendar.convertYYYYMMDDToJd(subDate[year] + subDate[month] + subDate[day]);\r\n\r\n return result;\r\n\t}", "public static int convertCalendarMillisecondsAsStringToDayOfWeekAsNum(String s) throws NumberFormatException, IOException {\n\t\t\t\ttry {\n\t\t\t\t\tlong l = Long.parseLong(s);\n\t\t\t\t\tDate date = new Date(l);\n\t\t\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\t\t\tcal.setTime(date);\n\t\t\t\t\tint dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);\n\t\t\t\t\treturn dayOfWeek;\n\t\t\t\t} catch(NumberFormatException exception) {\n\t\t\t\t\tfileWriterPrinter(\"\\\"NumberFormatException\\\" thrown \"\n\t\t\t\t\t\t\t+ exception.getMessage());\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}", "public static int getDays(Date t, Date baseDate) {\n Calendar cal = Calendar.getInstance();\n cal.setTime(baseDate);\n long sl = cal.getTimeInMillis();\n long el, delta;\n cal.setTime(t);\n el = cal.getTimeInMillis();\n delta = el - sl;\n int value = (int) (delta / (24 * 60 * 60 * 1000));\n\n return value;\n }", "private String YYYYMMDD(String str) {\n\t\tString[] s = str.split(\"/\");\n\t\treturn s[0] + parseToTwoInteger(Integer.parseInt(s[1].trim())) + parseToTwoInteger(Integer.parseInt(s[2].trim()));\n\t}", "Integer getTenYear();", "private String tilStandardDatostreng(Calendar c)\n {\n return c.get(Calendar.DATE) + \"/\" + (c.get(Calendar.MONTH) + 1) + \"/\" + c.get(Calendar.YEAR);\n }", "private static int characterToIntegerDigit(char c) {\n\t\t// since all characters are integers in UTF-16\n\t\tif (c >= 48 && c <= 57) {\n\t\t\treturn (c - 48);\n\t\t}\n\t\treturn -1;\n\t}", "public int getDate(String month)\n\t{\n\t\tint a[] = {1,2,3};\n\t\t//17 Feb 2011 00:00:00\n\t\t\n\t\t\n\t\tHashMap<String, Integer> map = new HashMap<String, Integer>();\n\t\tmap.put(\"Jan\", 1);\n\t\tmap.put(\"Feb\", 2);\n\t\tmap.put(\"Mar\", 3);\n\t\tmap.put(\"Apr\", 4);\n\t\tmap.put(\"May\", 5);\n\t\tmap.put(\"Jun\", 6);\n\t\tmap.put(\"Jul\", 7);\n\t\tmap.put(\"Aug\", 8);\n\t\tmap.put(\"Sep\", 9);\n\t\tmap.put(\"Oct\", 10);\n\t\tmap.put(\"Nov\", 11);\n\t\tmap.put(\"Dec\", 12);\n\t\t\n\t\tint mon = (int) map.get(month);\n\t\treturn mon;\n\t}", "public static int getYearFromTimestamp(long unixtime){\n \tCalendar c = Calendar.getInstance();\n \tc.setTimeInMillis(unixtime);\n \treturn c.get(Calendar.YEAR);\n }", "public int getMonthOfYear() {\n return _calendar.get(Calendar.MONTH) + 1;\n }", "private long getExistingCalendarId() {\n\t\tlong calID = 0;\n\n\t\tCursor cur = null;\n\t\tContentResolver cr = getContentResolver();\n\t\tUri uri = Calendars.CONTENT_URI;\n\t\tString selection = \"((\" + Calendars.ACCOUNT_NAME + \" = ?) AND (\"\n\t\t\t\t+ Calendars.ACCOUNT_TYPE + \" = ?) AND (\"\n\t\t\t\t+ Calendars.OWNER_ACCOUNT + \" = ?))\";\n\t\tString[] selectionArgs = new String[] { EMAIL_ID,\n\t\t\t\t\"com.google\", EMAIL_ID };\n\t\t// Submit the query and get a Cursor object back.\n\t\tcur = cr.query(uri, EVENT_PROJECTION, selection, selectionArgs, null);\n\n\t\t// Use the cursor to step through the returned records\n\t\twhile (cur.moveToNext()) {\n\t\t\tcalID = 0;\n\n\t\t\tString displayName = null;\n\t\t\tString accountName = null;\n\t\t\tString ownerName = null;\n\n\t\t\t// Get the field values\n\t\t\tcalID = cur.getLong(PROJECTION_ID_INDEX);\n\t\t\tdisplayName = cur.getString(PROJECTION_DISPLAY_NAME_INDEX);\n\t\t\taccountName = cur.getString(PROJECTION_ACCOUNT_NAME_INDEX);\n\t\t\townerName = cur.getString(PROJECTION_OWNER_ACCOUNT_INDEX);\n\n\t\t}\n\t\treturn calID;\n\t}", "public int getDayOfMonth();", "public int getDay() {\r\n return FormatUtils.uint8ToInt(mDay);\r\n }", "public Integer getEdad() {\n Calendar fechaNac_ = Calendar.getInstance();\n fechaNac_.setTime(fechaNac);\n try {\n return Math.abs(Calendar.getInstance().get(Calendar.YEAR) - fechaNac_.get(Calendar.YEAR));\n } catch (ArithmeticException e) {\n return -1;\n }\n }", "protected static final int jan01OfYear(int yyyy)\n {\n int leapAdjustment;\n if ( yyyy < 0 )\n {\n // years -1 -5 -9 were leap years.\n // adjustment -1->1 -2->1 -3->1 -4->1 -5->2 -6->2\n leapAdjustment = (3 - yyyy) / 4;\n return(yyyy * 365) - leapAdjustment + BC_epochAdjustment;\n }\n\n // years 4 8 12 were leap years\n // adjustment 1->0 2->0, 3->0, 4->0, 5->1, 6->1, 7->1, 8->1, 9->2\n leapAdjustment = (yyyy - 1) / 4;\n\n int missingDayAdjust = (yyyy > GC_firstYYYY) ? missingDays : 0;\n\n // mod 100 and mod 400 rules started in 1600 for Gregorian,\n // but 1800/2000 in the British scheme\n if ( yyyy > Leap100RuleYYYY )\n {\n leapAdjustment -= (yyyy-Leap100RuleYYYY+99) / 100;\n }\n if ( yyyy > Leap400RuleYYYY )\n {\n leapAdjustment += (yyyy-Leap400RuleYYYY+399) / 400;\n }\n\n return yyyy * 365\n + leapAdjustment\n - missingDayAdjust\n + AD_epochAdjustment;\n }", "protected final void toGregorian()\n {\n // ordinal must be set at this point.\n\n // handle the null date as a special case\n if ( ordinal == NULL_ORDINAL )\n {\n yyyy = 0;\n mm = 0;\n dd = 0;\n return;\n }\n if ( ordinal > MAX_ORDINAL )\n throw new IllegalArgumentException(\"invalid ordinal date: \"+ ordinal);\n else if ( ordinal >= GC_firstOrdinal )\n {\n yyyy = Leap400RuleYYYY\n + flooredMulDiv(ordinal - Jan_01_Leap400RuleYear,\n 10000,\n 3652425); /* 365 + 0.25 - 0.01 - 0.0025 */\n /* division may be done on a negative number.\n That's ok. We don't need to mess with the\n 100RuleYear. The 400RuleYear handles it all. */\n }\n\n else if ( ordinal >= Jan_01_0001 )\n {\n // Jan_01_0001 to Oct_04_1582\n // year 4 was first AD leap year.\n yyyy = 4 + flooredMulDiv(ordinal - Jan_01_0004, 100, 36525);\n /* 365 + 0.25 */\n }\n\n else if ( ordinal >= MIN_ORDINAL )\n {\n // LowestDate to Dec_31_0001BC\n // -1 was first BC leap year.\n // dividend will be negative\n yyyy = -1 + flooredMulDiv(ordinal - Jan_01_0001BC, 100, 36525);\n /* 365 + 0.25 */\n }\n else throw new IllegalArgumentException(\"invalid ordinal date: \"+ordinal);\n\n int aim = ordinal + 1;\n\n // Oct_15_1582 <= ordinal && ordinal <= Dec_31_1582\n if ( GC_firstOrdinal <= ordinal && ordinal <= GC_firstDec_31 ) aim += missingDays;\n\n // ddd should be 1..366\n int ddd = aim - jan01OfYear(yyyy);\n while ( ddd <= 0 )\n {\n // our approximation was too high\n yyyy--;\n ddd = aim - jan01OfYear(yyyy);\n }\n boolean leap = isLeap(yyyy);\n while ( ddd > (leap ? 366 : 365) )\n {\n // our approximation was too low\n yyyy++;\n ddd = aim - jan01OfYear(yyyy);\n leap = isLeap(yyyy);\n }\n\n mm = dddToMM(ddd, leap);\n dd = ddd - daysInYearPriorToMonth(mm, leap);\n\n // at this point yyyy, mm and dd have been computed.\n }", "public static Date createDate(int yyyy, int month, int day) {\n/* 75 */ CALENDAR.clear();\n/* 76 */ CALENDAR.set(yyyy, month - 1, day);\n/* 77 */ return CALENDAR.getTime();\n/* */ }", "private long diasToLong(int dias) {\n return dias * 24 * 60 * 60 * 1000;\n }", "public static int getYear(byte[] edid) {\n // Byte 17 is manufacture year-1990\n byte temp = edid[17];\n Logger.debug(\"Year-1990: {}\", temp);\n return temp + 1990;\n }", "public static int getTodaysDay() {\t\r\n\t\t\r\n\t\tTime time = new Time();\r\n\t\ttime.setToNow();\r\n\t\treturn time.monthDay;\t\r\n\t\t\r\n\t}", "public int turnWeekdayToNumber(String str){\n int number=0;\n switch (str){\n case \"Sunday\":\n number=7;\n break;\n case\"Saturday\":\n number=6;\n break;\n case\"Friday\":\n number=5;\n break;\n case\"Thursday\":\n number=4;\n break;\n case\"Wednesday\":\n number=3;\n break;\n case\"Tuesday\":\n number=2;\n break;\n case\"Monday\":\n number=1;\n break;\n default:\n break;\n }\n return number;\n }", "private String getDayFromUTCTimeStamp(String stDate_in) {\n try {\n long timeStamp = Long.parseLong(stDate_in) * 1000L;\n SimpleDateFormat sdfDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat sdfDateTime = new SimpleDateFormat(\"E MM/dd/yyyy HH:mm:ss\");\n Date netDate = (new Date(timeStamp));\n return sdfDay.format(netDate);\n } catch (Exception e) {\n AppDataLog.TPostExep(e);\n return null;\n }\n }", "public static int getTodaysYear() {\t\r\n\t\t\r\n\t\tTime time = new Time();\r\n\t\ttime.setToNow();\r\n\t\treturn time.year;\t\r\n\t\t\r\n\t}" ]
[ "0.6694453", "0.6301289", "0.629377", "0.6078314", "0.6021659", "0.59345156", "0.5737148", "0.5541539", "0.55145496", "0.53903145", "0.5349009", "0.5349009", "0.53206074", "0.52968687", "0.5269729", "0.52523017", "0.5243298", "0.52169585", "0.5170059", "0.5132877", "0.5120414", "0.51069295", "0.5100654", "0.5073003", "0.501816", "0.49700436", "0.49685493", "0.49570122", "0.4940772", "0.49353662", "0.4929533", "0.49292955", "0.4920591", "0.49192426", "0.49168462", "0.49114197", "0.48850188", "0.48818976", "0.48766205", "0.48731297", "0.48698634", "0.48599565", "0.48569745", "0.48556703", "0.48497993", "0.4838812", "0.4835434", "0.48245195", "0.48227546", "0.48113135", "0.48058176", "0.47849846", "0.47837737", "0.47823006", "0.47810218", "0.47787943", "0.47772163", "0.4772501", "0.47612", "0.47574675", "0.47571856", "0.47398117", "0.4738685", "0.47318396", "0.47131285", "0.4712896", "0.47043273", "0.46851853", "0.46629483", "0.46624383", "0.46431386", "0.46387738", "0.46380273", "0.4634732", "0.46342582", "0.4629879", "0.46296102", "0.46272764", "0.4625663", "0.46166262", "0.4612995", "0.45896083", "0.4589066", "0.45782942", "0.45701885", "0.45603848", "0.4559278", "0.45576742", "0.45534614", "0.4552185", "0.4544738", "0.454411", "0.45393732", "0.45338118", "0.45298877", "0.45239732", "0.45219812", "0.451821", "0.45110354", "0.45070216" ]
0.685801
0
Given a start and end point and a graph to scan this function looks for a point between the start and end that has a PB Value of at least DTConstants.getScaledPBVALUE();
public static boolean hasPBPointBetween(AbstractGraphPoint startPoint, AbstractGraphPoint endPoint, BaseGraph<AbstractGraphPoint> graph) { boolean result = false; if (null != startPoint && null != endPoint && null != graph && 0 < graph.size()) { //Ensure endPoint is after startPoint if (startPoint.getTimestamp() < endPoint.getTimestamp()) { //Get target value double pbValue = DTConstants.getScaledPBVALUE(); double dblHighestWAP = endPoint.getWAP(); double currWAP; double dblDiff; AbstractGraphPoint currPoint; //Subset the graph to deal only with points between the start and end NavigableSet<AbstractGraphPoint> subSet = graph.subSet(startPoint, true, endPoint, false); //Iterate through the set in reverse order (backwards in time) looking for a point with a WAP //at least pbValue LESS than the highest WAP so far. Iterator<AbstractGraphPoint> descIter = subSet.descendingIterator(); while(descIter.hasNext()){ //Get data for point currPoint = descIter.next(); currWAP = currPoint.getWAP(); //Update highest WAP so far if needed if(currWAP > dblHighestWAP){ dblHighestWAP = currWAP; } //Calculate diff between highest WAP so far and currWAP dblDiff = dblHighestWAP - currWAP; //Is the difference >= pbValue if so we have validated that there is a PB+ point between the two points if(dblDiff >= pbValue){ result = true; break; } } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean hasPBPointBetween(IGraphLine aLine, BaseGraph<AbstractGraphPoint> graph){\r\n return DTUtil.hasPBPointBetween(aLine.getStartPoint(), aLine.getEndPoint(), graph);\r\n }", "static Boolean pointInPgm(int x, int y) {\n return (x >= 0 ) && (y >= 0) && (x <= pgmInf.width) && (y <= pgmInf.height);\n }", "public boolean findStep(double acc) {\n\n //set the thresholds that are used to find the peaks\n// setThresholdsDiscreet(acc);\n setThresholdsContinuous(acc);\n\n //finds a point (peak) above the upperThreshold\n if (acc > upperThreshold) {\n if (!peakFound) {\n stepCount++;\n peakFound = true;\n return true;\n }\n }\n\n //after a new peak is found, program will find no more peaks until graph passes under lowerThreshold\n else if (acc < lowerThreshold) {\n if (peakFound) {\n peakFound = false;\n }\n }\n\n return false;\n }", "private Point findStartPoint(){\n Point min = points.get(0);\n for (int i = 1; i < points.size(); i++) {\n min = getMinValue(min, points.get(i));\n }\n return min;\n }", "public boolean pathExists(int startVertex, int stopVertex) {\n// your code here\n ArrayList<Integer> fetch_result = visitAll(startVertex);\n if(fetch_result.contains(stopVertex)){\n return true;\n }\n return false;\n }", "private static boolean checkHalfway(int[] arr, int searchValue, int begin, int end) {\r\n\t\treturn searchValue < arr[(begin+end+1)/2];\r\n\t}", "@Override\r\n public boolean breadthFirstSearch(T start, T end) {\r\n Vertex<T> startV = vertices.get(start);\r\n Vertex<T> endV = vertices.get(end);\r\n\r\n Queue<Vertex<T>> queue = new LinkedList<Vertex<T>>();\r\n Set<Vertex<T>> visited = new HashSet<>();\r\n\r\n queue.add(startV);\r\n visited.add(startV);\r\n\r\n while(queue.size() > 0){\r\n Vertex<T> next = queue.poll();\r\n if(next == null){\r\n continue;\r\n }\r\n if(next == endV){\r\n return true;\r\n }\r\n\r\n for (Vertex<T> neighbor: next.getNeighbors()){\r\n if(!visited.contains(neighbor)){\r\n visited.add(neighbor);\r\n queue.add(neighbor);\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }", "@Override\r\n protected Double g(Point from, Point to) {\r\n if (from.equals(to))\r\n return 0.0;\r\n\r\n if (field.isFree(new Point(to.x, to.y)) || to.equals(finish))\r\n return 1.0;\r\n\r\n return Double.MAX_VALUE;\r\n }", "public boolean reachable(Vertex start, Vertex end){\n\t\tSet<Vertex> reach = this.post(start); \n\t\treturn reach.contains(end);\n\t}", "public static Point searchNearestEgde(Rectangle bounds, Point first, Point next) {\n\n // One offset needed to avoid intersection with the wrong line.\n if (bounds.x + bounds.width <= first.x)\n first.x = bounds.x + bounds.width - 1;\n else if (bounds.x >= first.x) first.x = bounds.x + 1;\n\n if (bounds.y + bounds.height <= first.y)\n first.y = bounds.height + bounds.y - 1;\n else if (bounds.y >= first.y) first.y = bounds.y + 1;\n\n Line2D relationLine = new Line2D.Float(first.x, first.y, next.x, next.y);\n Line2D lineTop = new Line2D.Float(bounds.x, bounds.y, bounds.x\n + bounds.width, bounds.y);\n Line2D lineRight = new Line2D.Float(bounds.x + bounds.width, bounds.y,\n bounds.x + bounds.width, bounds.y + bounds.height);\n Line2D lineBottom = new Line2D.Float(bounds.x + bounds.width, bounds.y\n + bounds.height, bounds.x, bounds.y + bounds.height);\n Line2D lineLeft = new Line2D.Float(bounds.x, bounds.y + bounds.height,\n bounds.x, bounds.y);\n\n Point2D ptIntersectTop = ptIntersectsLines(relationLine, lineTop);\n Point2D ptIntersectRight = ptIntersectsLines(relationLine, lineRight);\n Point2D ptIntersectBottom = ptIntersectsLines(relationLine, lineBottom);\n Point2D ptIntersectLeft = ptIntersectsLines(relationLine, lineLeft);\n\n // line is to infinite, we must verify that the point find interst the\n // correct edge and the relation.\n int distTop = (int) lineTop.ptSegDist(ptIntersectTop)\n + (int) relationLine.ptSegDist(ptIntersectTop);\n int distRight = (int) lineRight.ptSegDist(ptIntersectRight)\n + (int) relationLine.ptSegDist(ptIntersectRight);\n int distBottom = (int) lineBottom.ptSegDist(ptIntersectBottom)\n + (int) relationLine.ptSegDist(ptIntersectBottom);\n int distLeft = (int) lineLeft.ptSegDist(ptIntersectLeft)\n + (int) relationLine.ptSegDist(ptIntersectLeft);\n\n if (ptIntersectTop != null && distTop == 0) {\n return new Point(RelationGrip.adjust((int) ptIntersectTop.getX()),\n (int) ptIntersectTop.getY());\n\n } else if (ptIntersectRight != null && distRight == 0) {\n return new Point((int) ptIntersectRight.getX(),\n RelationGrip.adjust((int) ptIntersectRight.getY()));\n\n } else if (ptIntersectBottom != null && distBottom == 0) {\n return new Point(RelationGrip.adjust((int) ptIntersectBottom.getX()),\n (int) ptIntersectBottom.getY());\n\n } else if (ptIntersectLeft != null && distLeft == 0) {\n return new Point((int) ptIntersectLeft.getX(),\n RelationGrip.adjust((int) ptIntersectLeft.getY()));\n\n } else {\n return null; // no point found!\n }\n }", "private int betweenPoints(int value,Individual ind) {\n\t\tfor(int i=_point1; i<_point2;i++) {\n\t\t\tif(value==ind.getGene(i)) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t\t\n\t}", "private int findCoordElementRegular(double coordValue, boolean bounded) {\n int n = orgGridAxis.getNcoords();\n if (n == 1 && bounded)\n return 0;\n\n double distance = coordValue - orgGridAxis.getCoordEdge1(0);\n double exactNumSteps = distance / orgGridAxis.getResolution();\n // int index = (int) Math.round(exactNumSteps); // ties round to +Inf\n int index = (int) exactNumSteps; // truncate down\n\n if (bounded && index < 0)\n return 0;\n if (bounded && index >= n)\n return n - 1;\n\n // check that found point is within interval\n if (index >= 0 && index < n) {\n double lower = orgGridAxis.getCoordEdge1(index);\n double upper = orgGridAxis.getCoordEdge2(index);\n if (orgGridAxis.isAscending()) {\n assert lower <= coordValue : lower + \" should be le \" + coordValue;\n assert upper >= coordValue : upper + \" should be ge \" + coordValue;\n } else {\n assert lower >= coordValue : lower + \" should be ge \" + coordValue;\n assert upper <= coordValue : upper + \" should be le \" + coordValue;\n }\n }\n\n return index;\n }", "public double P(SearchPath sp, int i, int j, boolean end) {\r\n\t\tsp.remove(\".\");\r\n\t\tint completeMatch = 0;\r\n\t\tint partialMatch = 0;\r\n\r\n\t\tint temp = Math.min(i, j);\r\n\t\tj = Math.max(i, j);\r\n\t\ti = temp;\r\n\r\n\t\tfor (SearchPath vertices : sp.expandAll()) {\r\n\t\t\tfor (SearchPath p : paths) {\r\n\t\t\t\tint currentIndex = end ? i : i + 1;\r\n\t\t\t\t// start at 1 if we might not care about the beginning node\r\n\r\n\t\t\t\tfor (int k = 0; k < p.size(); k++) {\r\n\t\t\t\t\tif (p.get(k) == vertices.get(currentIndex)) { // another match\r\n\t\t\t\t\t\tcurrentIndex++;\r\n\r\n\t\t\t\t\t\tif (end) {\r\n\t\t\t\t\t\t\tif (currentIndex == j - 1)\r\n\t\t\t\t\t\t\t\tpartialMatch++;\r\n\t\t\t\t\t\t\tif (currentIndex == j)\r\n\t\t\t\t\t\t\t\tcompleteMatch++;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (currentIndex == j) {\r\n\t\t\t\t\t\t\t\tpartialMatch++;\r\n\r\n\t\t\t\t\t\t\t\tif (p.get(k - j + i) == vertices.get(i))\r\n\t\t\t\t\t\t\t\t\tcompleteMatch++;\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\telse {\r\n\t\t\t\t\t\tcurrentIndex = end ? i : i + 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn partialMatch == 0 ? 0 : completeMatch / (double) partialMatch;\r\n\t}", "private int findCoordElementContiguous(double target, boolean bounded) {\n int n = orgGridAxis.getNcoords();\n\n // Check that the point is within range\n MinMax minmax = orgGridAxis.getCoordEdgeMinMax();\n if (target < minmax.min()) {\n return bounded ? 0 : -1;\n } else if (target > minmax.max()) {\n return bounded ? n - 1 : n;\n }\n\n int low = 0;\n int high = n - 1;\n if (orgGridAxis.isAscending()) {\n // do a binary search to find the nearest index\n int mid;\n while (high > low + 1) {\n mid = (low + high) / 2; // binary search\n if (intervalContains(target, mid, true, false))\n return mid;\n else if (orgGridAxis.getCoordEdge2(mid) < target)\n low = mid;\n else\n high = mid;\n }\n return intervalContains(target, low, true, false) ? low : high;\n\n } else { // descending\n // do a binary search to find the nearest index\n int mid;\n while (high > low + 1) {\n mid = (low + high) / 2; // binary search\n if (intervalContains(target, mid, false, false))\n return mid;\n else if (orgGridAxis.getCoordEdge2(mid) < target)\n high = mid;\n else\n low = mid;\n }\n return intervalContains(target, low, false, false) ? low : high;\n }\n }", "private static final boolean isArrayValueAtIndexInsideOrInsideAdjacent(DataSet aDataSet, int i, int pointCount, double aMin, double aMax)\n {\n // If val at index in range, return true\n double val = aDataSet.getX(i);\n if (val >= aMin && val <= aMax)\n return true;\n\n // If val at next index in range, return true\n if (i+1 < pointCount)\n {\n double nextVal = aDataSet.getX(i + 1);\n if (val < aMin && nextVal >= aMin || val > aMax && nextVal <= aMax)\n return true;\n }\n\n // If val at previous index in range, return true\n if (i > 0)\n {\n double prevVal = aDataSet.getX(i - 1);\n if ( val < aMin && prevVal >= aMin || val > aMax && prevVal <= aMax)\n return true;\n }\n\n // Return false since nothing in range\n return false;\n }", "public List<Point> scan(int par, int maxsteps, double low, double high) {\n MnParameterScan scan = new MnParameterScan(theFCN, theState.parameters());\n double amin = scan.fval();\n\n List<Point> result = scan.scan(par, maxsteps, low, high);\n if (scan.fval() < amin) {\n theState.setValue(par, scan.parameters().value(par));\n amin = scan.fval();\n }\n return result;\n }", "private int searchNext(JmtCell prev) {\r\n \t\tRectangle boundspadre = GraphConstants.getBounds((prev).getAttributes()).getBounds();\r\n \t\tObject[] listEdges = null;\r\n \t\tGraphModel graphmodel = graph.getModel();\r\n \t\tList<Object> next = new ArrayList<Object>();\r\n \r\n \t\tif (flag1 == false && prev.seen == false) {\r\n \r\n \t\t\t// Rectangle bounds =\r\n \t\t\t// GraphConstants.getBounds(((JmtCell)prev).getAttributes()).getBounds();\r\n \t\t\tif (!flag2) {\r\n \t\t\t\tboundspadre.setLocation(x, y + ((e + 1) * (42 + heightMax)) - (int) (boundspadre.getHeight() / 2) + 30);\r\n \t\t\t} else {\r\n \t\t\t\tboundspadre.setLocation(x - (int) (boundspadre.getWidth() / 2), y + ((e + 1) * (42 + heightMax))\r\n \t\t\t\t\t\t- (int) (boundspadre.getHeight() / 2) + 30);\r\n \t\t\t}\r\n \r\n \t\t\tGraphConstants.setBounds(prev.getAttributes(), boundspadre);\r\n \t\t\tx = (int) boundspadre.getCenterX() + widthMax + 50;\r\n \t\t\tprev.seen = true;\r\n \t\t\tflag2 = true;\r\n \t\t}\r\n \r\n \t\t// inserisco tutti gli archi uscenti e entranti di min.get(j) in\r\n \t\t// listEdges\r\n \t\tlistEdges = DefaultGraphModel.getOutgoingEdges(graphmodel, prev);\r\n \t\tVector<Object> listEdgestmp = new Vector<Object>();\r\n \t\tfor (Object listEdge : listEdges) {\r\n \t\t\tJmtCell qq = (JmtCell) (graphmodel.getParent(graphmodel.getTarget(listEdge)));\r\n \t\t\tif (!(qq).seen) {\r\n \t\t\t\tlistEdgestmp.add(listEdge);\r\n \t\t\t}\r\n \t\t}\r\n \t\tlistEdges = listEdgestmp.toArray();\r\n \r\n \t\tint numTarget = listEdges.length;\r\n \t\tif (numTarget == 0) {\r\n \t\t\treturn 1;\r\n \t\t}\r\n \r\n \t\tfor (int k = 0; k < numTarget; k++) {\r\n \t\t\tnext.add((graphmodel.getParent(graphmodel.getTarget(listEdges[k]))));\r\n \t\t}\r\n \r\n \t\tint j = 1;\r\n \t\tif (inRepositionSons == false && ((JmtCell) next.get(0)).seen == false) {\r\n \t\t\tj = searchNext((JmtCell) next.get(0));\r\n \t\t} else if (inRepositionSons == true && ((JmtCell) next.get(0)).seen == false) {\r\n \r\n \t\t\tRectangle bounds = GraphConstants.getBounds(((JmtCell) next.get(0)).getAttributes()).getBounds();\r\n \t\t\tbounds.setLocation((int) (boundspadre.getCenterX()) + widthMax + 50 - (int) (bounds.getWidth() / 2), (int) boundspadre.getCenterY()\r\n \t\t\t\t\t- (int) (bounds.getHeight() / 2));\r\n \t\t\tGraphConstants.setBounds(((JmtCell) next.get(0)).getAttributes(), bounds);\r\n \r\n \t\t\t((JmtCell) next.get(0)).seen = true;\r\n \t\t\tj = searchNext((JmtCell) next.get(0));\r\n \t\t}\r\n \r\n \t\tif (numTarget > 0) {\r\n \t\t\tif (!flag) {\r\n \t\t\t\trepositionSons(prev, next, j - 1, 1);\r\n \t\t\t} else {\r\n \t\t\t\trepositionSons(prev, next, -1, 0);\r\n \t\t\t}\r\n \t\t\tflag = false;\r\n \t\t}\r\n \r\n \t\t(prev).sons = 0;\r\n \t\tfor (int w = 0; w < numTarget; w++) {\r\n \t\t\tprev.sons += ((JmtCell) next.get(w)).sons;\r\n \t\t}\r\n \r\n \t\treturn prev.sons;\r\n \t}", "Pair<DateTime, DateTime> getSegmentBounds(ReadableInstant instant) {\n LocalDate date = new DateTime(instant).toLocalDate(); // a day in the local time zone\n DateTime[] fenceposts = getSegmentFenceposts(date);\n for (int i = 0; i + 1 < fenceposts.length; i++) {\n if (!instant.isBefore(fenceposts[i]) && instant.isBefore(fenceposts[i + 1])) {\n return new Pair<>(fenceposts[i], fenceposts[i + 1]);\n }\n }\n return null; // should never get here because start <= instant < stop\n }", "protected boolean hasConnection(int start, int end) {\n\t\tfor (Gene g : genes.values()) {\n\t\t\tif (g.start == start && g.end == end)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public int findBinIndex(Double precursor, Double binSize, Double minMass)\n\t{\n\t\treturn (int)((precursor-minMass)/binSize);\n\t}", "public boolean isPointInSegment(Coordinates point, Coordinates segmExtremityA, Coordinates segmExtremityB);", "public short[] getThresholdFromSliceofScanData(short[] data, int[] shape, int[] activePixels, int thresholdVal,\n\t\t\tint dimensionToTraverse, boolean isForward, short[] lookupTable) throws Exception {\n\t\t// assume dimensionToTraverse ==2\n\t\tif (shape.length != 3)\n\t\t\tthrow new Exception(\"Invalid shape\");\n\t\tshort[] res = null;\n\t\tif (dimensionToTraverse == 2) {\n\t\t\tif (shape[2] != lookupTable.length)\n\t\t\t\tthrow new Exception(\"shape[2] != lookupTable.length\");\n\t\t\tint sizeOfResult = shape[0] * shape[1];\n\t\t\tres = new short[sizeOfResult];\n\t\t\tArrays.fill(res, EDGE_POSITION_IF_PIXEL_MASKED_OUT);\n\t\t\tfor (int pixelInMask = 0; pixelInMask < sizeOfResult; pixelInMask++) {\n\t\t\t\tif (activePixels == null || activePixels[pixelInMask] == 1) {\n\t\t\t\t\tres[pixelInMask] = EDGE_POSITION_IF_ALL_BELOW_THRESHOLD;\n\t\t\t\t\tint numberPointsPerPixel = shape[dimensionToTraverse];\n\t\t\t\t\tfor (int iy = 0; iy < numberPointsPerPixel; iy++) {\n\t\t\t\t\t\tint pixel = isForward ? iy : numberPointsPerPixel - iy - 1;\n\t\t\t\t\t\tint val = data[pixel * sizeOfResult + pixelInMask];\n\t\t\t\t\t\tif (val >= thresholdVal) {\n\t\t\t\t\t\t\tif (iy == 0) {\n\t\t\t\t\t\t\t\t// all above\n\t\t\t\t\t\t\t\tres[pixelInMask] = EDGE_POSITION_IF_ALL_ABOVE_THRESHOLD;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tres[pixelInMask] = lookupTable[pixel];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (dimensionToTraverse == 0) {\n\t\t\tif (shape[0] != lookupTable.length)\n\t\t\t\tthrow new Exception(\"shape[0] != lookupTable.length\");\n\t\t\tint sizeOfResult = shape[1] * shape[2];\n\t\t\tres = new short[sizeOfResult];\n\t\t\tArrays.fill(res, EDGE_POSITION_IF_PIXEL_MASKED_OUT);\n\t\t\tint numberPointsPerPixel = shape[dimensionToTraverse];\n\t\t\t/*\n\t\t\t * for (int i = 0; i < shape[1]; i++) { for (int j = 0; j < shape[2]; j++) { int pixelInMask = i * shape[2]\n\t\t\t * + j;\n\t\t\t */for (int pixelInMask = 0; pixelInMask < sizeOfResult; pixelInMask++) {\n\n\t\t\t\tif (activePixels == null || activePixels[pixelInMask] == 1) {\n\t\t\t\t\tres[pixelInMask] = EDGE_POSITION_IF_ALL_BELOW_THRESHOLD;\n\t\t\t\t\tfor (int iy = 0; iy < numberPointsPerPixel; iy++) {\n\t\t\t\t\t\tint pixel = isForward ? iy : numberPointsPerPixel - iy - 1;\n\t\t\t\t\t\tint index = pixelInMask + pixel * sizeOfResult;\n\n\t\t\t\t\t\tint val = data[index];\n\t\t\t\t\t\tif (val >= thresholdVal) {\n\t\t\t\t\t\t\tif (iy == 0) {\n\t\t\t\t\t\t\t\t// all above\n\t\t\t\t\t\t\t\tres[pixelInMask] = EDGE_POSITION_IF_ALL_ABOVE_THRESHOLD;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tres[pixelInMask] = lookupTable[pixel];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t// }\n\t\t}\n\t\treturn res;\n\t}", "private boolean findPath(Node b, Node e) throws GraphException{\n\t\t\n\t\t//mark start node and push it on stack\n\t\tb.setMark(true);\n\t\tthis.S.push(b);\n\t\t\t\t\n\t\t// base case, start is the end and we did not exceed the number of bus changes limit\n\t\tif (this.changeCount <= this.changes && b == e){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// variables to hold old values in case we need to change back\n\t\tint holdOldValue = this.changeCount;\n\t\tString holdLine = this.testLine;\n\t\t\n\t\t//iterator over the edges incident on the start node\n\t\tIterator<Edge> iter = this.graph.incidentEdges(b);\n\t\t\n\t\t// loop through incident edges\n\t\twhile(iter.hasNext()){\n\t\t\tEdge line = iter.next();\n\t\t\tString s = line.getBusLine();\n\t\t\t// increase the bus changes count if we change busLines\n\t\t\tif (!s.equals(this.testLine)){\n\t\t\t\tthis.changeCount++;\n\t\t\t}\n\t\t\t// set the bus line to the current one we are on\n\t\t\tthis.testLine = s;\n\t\t\t\n\t\t\t// take the node that is connected to start node via the edge\n\t\t\tNode u;\n\t\t\tif(line.secondEndpoint().equals(b)){\n\t\t\t\tu = line.firstEndpoint();\n\t\t\t}else{\n\t\t\t\tu = line.secondEndpoint();\n\t\t\t}\n\t\t\t// make sure node is not marked and perform a recursive call on it if\n\t\t\t// also make sure that the number of changes allowed has not already been exceeded\n\t\t\tif (u.getMark() != true && this.changeCount <= this.changes){\n\t\t\t\tif (findPath(u, e) == true){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// undo changes to bus change count and current bus line if we move backwards\n\t\t\tif (holdOldValue < this.changeCount){\n\t\t\t\tthis.changeCount--;\n\t\t\t\tthis.testLine = holdLine;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t// unset the start node so that other recursive calls can use it and pop it off the stack\n\t\tb.setMark(false);\n\t\tthis.S.pop();\n\t\t\n\t\treturn false;\n\t}", "@SuppressWarnings(\"unused\")\n public static boolean withinRange(float value, float startValue, float endValue) {\n return value == ScWidget.valueRangeLimit(value, startValue, endValue);\n }", "public void testFindRangeBounds() {\n XYBlockRenderer renderer = new XYBlockRenderer();\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series = new XYSeries(\"S1\");\n series.add(1.0, null);\n dataset.addSeries(series);\n Range r = renderer.findRangeBounds(dataset);\n }", "private boolean intervalContains(double target, int coordIdx) {\n double midVal1 = orgGridAxis.getCoordEdge1(coordIdx);\n double midVal2 = orgGridAxis.getCoordEdge2(coordIdx);\n boolean ascending = midVal1 < midVal2;\n return intervalContains(target, coordIdx, ascending, true);\n }", "public boolean isOnSegment(Point2D point) {\n double x = point.getX();\n double y = point.getY();\n double val = this.a * x + this.b * y + this.c;\n if (val < 0.0) {\n val = -val;\n }\n if (val > EPS) {\n return false;\n }\n\n if ((x < (this.minx - EPS)) || (x > (this.maxx + EPS))) {\n return false;\n }\n if ((y < (this.miny - EPS)) || (y > (this.maxy + EPS))) {\n return false;\n }\n return true;\n }", "public boolean canPartition(int startIndex, int currentSum, int currentBucket) {\n\t\tif (currentBucket == 1) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (currentSum > target)\n\t\t\treturn false;\n\n\t\tif (currentSum == target) {\n\t\t\treturn canPartition(0, 0, currentBucket - 1);\n\t\t} else {\n\t\t\tfor (int index = startIndex; index < arr.length; index++) {\n\t\t\t\tif (!visited[index]) {\n\t\t\t\t\tvisited[index] = true;\n\t\t\t\t\tif (canPartition(index + 1, currentSum + arr[index], currentBucket)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tvisited[index] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "int rangeEnd(int start, int limitp, int val) {\n int c;\n int limit = Math.min(highStart, limitp);\n\n for (c = start+1; c < limit; c++) {\n if (get(c) != val) {\n break;\n }\n }\n if (c >= highStart) {\n c = limitp;\n }\n return c - 1;\n }", "private int searchR(Searching[] array, int start, int half, int end, int value) {\n if (value > array[end].getValue() || value < array[start].getValue()) {\n return -1;\n }\n int a = end - start;\n int b = array[end].getValue() - array[start].getValue();\n int c = value - array[start].getValue();\n int d = (c * a) / b;\n int slide = d + start;\n if (slide > end || slide < start) {\n return -1;\n }\n if (array[slide].getValue() == value) {\n return slide;\n }\n if (value < array[slide].getValue()) {\n end = slide;\n return searchR(array, start, half, end, value);\n } else {\n start = slide;\n return searchR(array, start, half, end, value);\n }\n }", "static Boolean lineBetween(int x1, int y1, int x2, int y2) {\n double m, b; // for line eqn.\n int maxV = Math.max( pgmInf.img[y1][x1], pgmInf.img[y2][x2] );\n int xmin = Math.min(x1, x2), xmax = Math.max(x1, x2);\n int ymin = Math.min(y1, y2), ymax = Math.max(y1, y2);\n\n if (x1 == x2) {\n // x = c\n for (int y=ymin ; y < ymax ; y++)\n if (pgmInf.img[y][x1] > maxV) return false;\n }\n else {\n // setup for y=mx + b form\n double top = (y1-y2), bot = (x1-x2);\n m = top / bot; \n\n if (m > -1 && m < 1) {\n // y = mx + b\n b = y1 - m * (double)x1;\n\n for (int x=xmin ; x < xmax ; x++) {\n int y = (int)Math.round( m * (double)x + b );\n if (pgmInf.img[y][x] > maxV ) return false;\n }\n }\n else {\n // x = my + b\n top = (x1-x2); bot = (y1-y2); \n m = top / bot; b = x1 - m * (double)y1;\n\n for (int y=ymin ; y < ymax ; y++) {\n int x = (int)Math.round( m* (double)y + b );\n if (pgmInf.img[y][x] > maxV) return false;\n }\n }\n }\n return true;\n }", "private void locateBestMatch(int queryStartIdx){\n \n double dist;\n double bsfDist = Double.MAX_VALUE;\n int bsfIdx = -1;\n\n double[] query = zNormalise(series, queryStartIdx, this.windowSize, false);\n double[] comparison;\n\n for(int comparisonStartIdx = 0; comparisonStartIdx <= seriesLength-windowSize; comparisonStartIdx+=stride){\n \n // exclusion zone +/- windowSize/2 around the window\n if(comparisonStartIdx >= queryStartIdx-windowSize*1.5 && comparisonStartIdx <= queryStartIdx+windowSize*1.5){\n continue;\n }\n \n // using a bespoke version of this, rather than the shapelet version, for efficiency - see notes with method\n comparison = zNormalise(series, comparisonStartIdx, windowSize, false);\n dist = 0;\n\n for(int j = 0; j < windowSize;j++){\n dist += (query[j]-comparison[j])*(query[j]-comparison[j]);\n if(dist > bsfDist){\n dist = Double.MAX_VALUE;\n break;\n }\n }\n\n if(dist < bsfDist){\n bsfDist = dist;\n bsfIdx = comparisonStartIdx;\n }\n\n }\n \n this.distances[queryStartIdx] = bsfDist;\n this.indices[queryStartIdx] = bsfIdx;\n }", "public interface IStartEndChecker {\n\n\t/**\n\t * Checks for overlap.\n\t *\n\t * @param first the first node\n\t * @param second the second node\n\t * @return true, if successful\n\t */\n\tpublic boolean hasOverlap(Position first, Position second);\n\n\t/**\n\t * <b>Checks if is in edge.</b>\n\t *\n\t * @param width the width of grid\n\t * @param height the height of grid \n\t * @param position the position of the node the we want to check\n\t * @return true, if is in edge\n\t */\n\tpublic boolean isInEdge(int width, int height, Position position);\n\t/**\n\t * used for validation on design map\n\t * @param matrix grid info\n\t * @return true, if has start node\n\t */\n\tpublic boolean hasStart(GridCellContentType[][] matrix);\n\t/**\n\t * used for validation on design map\n\t * @param matrix grind info\n\t * @return true, if has end\n\t */\n\tpublic boolean hasEnd(GridCellContentType[][] matrix);\n\t/**\n\t * check for size validation in grid design \n\t * @param height height of teh grid\n\t * @param width with of the grid\n\t * @return true if correct\n\t */\n\tpublic boolean isCorrectSize(int height, int width);\n\n}", "public void findTrack() {\n for (Node n : start_node.getLinks()) {\n precedenti.put(n, start_node);\n valori.put(n, calculator.calcDistance(n, start_node));\n }\n while (!da_collegare.isEmpty()) {\n Node piu_vicino = null;\n double min = Double.MAX_VALUE;\n for (Node n : da_collegare) {\n double dist = valori.get(n);\n if (dist - min < THRESHOLD) {\n min = dist;\n piu_vicino = n;\n }\n }\n double dist = valori.get(piu_vicino);\n for (Node n : piu_vicino.getLinks()) {\n double ricalc = dist + calculator.calcDistance(n, piu_vicino);\n if (ricalc - valori.get(n) < THRESHOLD) {\n precedenti.put(n, piu_vicino);\n valori.put(n, ricalc);\n }\n }\n da_collegare.remove(piu_vicino);\n }\n }", "public int search(int[] A, int target) {\n\n int start = 0;\n int end = A.length - 1;\n int mid;\n\n while (start + 1 < end) {\n mid = start + (end - start) / 2;\n if (A[mid] == target) {\n return mid;\n }\n if (A[start] < A[mid]) {\n // situation 1, red line\n if (A[start] <= target && target <= A[mid]) {\n end = mid;\n } else {\n start = mid;\n }\n } else {\n // situation 2, green line\n if (A[mid] <= target && target <= A[end]) {\n start = mid;\n } else {\n end = mid;\n }\n }\n } // while\n\n if (A[start] == target) {\n return start;\n }\n if (A[end] == target) {\n return end;\n }\n return -1;\n }", "public Coordinates inBetweenPoint(Coordinates a, Coordinates b, double ratio);", "private StreamEvent findIfActualMin(AttributeDetails latestEvent) {\n int indexCurrentMin = valueStack.indexOf(currentMin);\n int postBound = valueStack.indexOf(latestEvent) - indexCurrentMin;\n // If latest event is at a distance greater than maxPostBound from min, min is not eligible to be sent as output\n if (postBound > maxPostBound) {\n currentMin.notEligibleForRealMin();\n return null;\n }\n // If maxPreBound is 0, no need to check preBoundChange. Send output with postBound value\n if (maxPreBound == 0) {\n StreamEvent outputEvent = eventStack.get(indexCurrentMin);\n complexEventPopulater.populateComplexEvent(outputEvent, new Object[] { \"min\", 0, postBound });\n currentMin.sentOutputAsRealMin();\n return outputEvent;\n }\n int preBound = 1;\n double dThreshold = currentMin.getValue() + currentMin.getValue() * preBoundChange / 100;\n while (preBound <= maxPreBound && indexCurrentMin - preBound >= 0) {\n if (valueStack.get(indexCurrentMin - preBound).getValue() >= dThreshold) {\n StreamEvent outputEvent = eventStack.get(indexCurrentMin);\n complexEventPopulater.populateComplexEvent(outputEvent, new Object[] { \"min\", preBound, postBound });\n currentMin.sentOutputAsRealMin();\n return outputEvent;\n }\n ++preBound;\n }\n // Completed iterating through maxPreBound older events. No events which satisfy preBoundChange condition found.\n // Therefore min is not eligible to be sent as output.\n currentMin.notEligibleForRealMin();\n return null;\n }", "private double distancePointToSegment(Vector point, Vector startSegment, Vector endSegment) {\n\t\t// Segment. Starts and Ends in the same point -> Distance == distance\n\t\tif (startSegment.subtract(endSegment).equals(NULL_VECTOR_3DIM)) {\n\t\t\treturn point.subtract(startSegment).getNorm(); // Length of a-b\n\t\t}\n\t\t// https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line\n\t\t/*\n\t\t * es reicht aber aus, wenn man zusätzlich noch die Länge AB der Strecke\n\t\t * kennt. (Die Strecke sei AB, der Punkt P.) Dann kann man nämlich\n\t\t * testen, ob der Winkel bei A (PB²>PA²+AB²) oder bei B (PA²>PB²+AB²)\n\t\t * stumpf (>90 <180grad) ist. Im ersten Fall ist PA, im zweiten PB der\n\t\t * kürzeste Abstand, ansonsten ist es der Abstand P-Gerade(AB).\n\t\t */\n\n\t\t// TESTEN WO ES AM NÄCHSTEN AN DER STRECKE IST,NICHT NUR AN DER GERADEN\n\t\tline = startSegment.subtract(endSegment); // Vektor von start zum end.\n\t\tlineToPoint = startSegment.subtract(point); // vom start zum punkt.\n\t\tlineEnd = endSegment.subtract(startSegment); // vom ende zum start\n\t\tlineEndToPoint = endSegment.subtract(point); // vom start zum ende\n\n\t\t// Wenn größer 90Grad-> closest ist start\n\t\tdouble winkelStart = getWinkel(line, lineToPoint);\n\t\t// Wenn größer 90Grad -> closest ist end\n\t\tdouble winkelEnde = getWinkel(lineEnd, lineEndToPoint);\n\t\tif (winkelStart > 90.0 && winkelStart < 180.0) {\n\t\t\t// Start ist am nächsten. Der winkel ist über 90Grad somit wurde nur\n\t\t\t// der nächste nachbar auf der geraden ausserhalb der strecke\n\t\t\t// gefunden\n\t\t\treturn startSegment.subtract(point).getNorm();\n\t\t}\n\t\tif (winkelEnde > 90.0 && winkelEnde < 180.0) {\n\t\t\t// Ende ist am nächsten\n\t\t\treturn endSegment.subtract(point).getNorm();\n\t\t}\n\n\t\t// If not returned yet. The closest position ist on the line\n\t\treturn closestDistanceFromPointToEndlessLine(point, startSegment, endSegment);\n\t}", "private static int findNext(List<List<Integer>> m, int k, int val)\n {\n int res = -1;\n int base = val % 100;\n // we ignore one-digit base (meaning no base can start with zero)\n if (base < 10) {\n return res;\n }\n\n int min = base * 100;\n int max = (base + 1) * 100;\n List<Integer> list = m.get(k);\n Iterator<Integer> iter = list.iterator();\n while (iter.hasNext()) {\n int n = iter.next();\n if (n >= max) {\n break;\n }\n if (n >= min) {\n res = n;\n break;\n }\n }\n return res;\n }", "@JsMethod(name = \"containsPoint\")\n public boolean contains(double p) {\n return p >= lo && p <= hi;\n }", "public static int getStartIndexForRange(DataSet aDataSet, double aMin, double aMax)\n {\n int start = 0;\n int pointCount = aDataSet.getPointCount();\n while (start<pointCount && !isArrayValueAtIndexInsideOrInsideAdjacent(aDataSet, start, pointCount, aMin, aMax))\n start++;\n return start;\n }", "private Stack path(Graph graph, GraphNode start, GraphNode end) throws GraphException {\n\t\tGraph g = graph;\n\t\tGraphNode b = start;\n\t\tGraphNode e = end;\n\t\tGraphNode temp;\n\t\tStack p;\n\n\t\t// mark the beginning point and push it to the stack.\n\t\tb.setMark(true);\n\t\tedgeStack.push(b);\n\n\t\t// check if the starting and end point are equal.\n\t\tif (b == e) {\n\t\t\treturn edgeStack;\n\t\t}\n\t\t// iterates until it reaches the end point\n\t\telse {\n\t\t\t// initializes edges to the edges incident on node b\n\t\t\tIterator<GraphEdge> edges = graph.incidentEdges(b);\n\n\t\t\t// iterates until it reaches the end of nodes\n\t\t\twhile (edges.hasNext()) {\n\t\t\t\ttemp = edges.next().secondEndpoint();\n\n\t\t\t\t// checks if the second point of the edge has been discovered\n\t\t\t\tif (temp.getMark() == false ) {\n\t\t\t\t\tp = path(g, temp, e);\n\n\t\t\t\t\t// if the path ends return null\n\t\t\t\t\tif (p != null) {\n\t\t\t\t\t\treturn p;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tedgeStack.pop();\n\t\t}\n\t\treturn null;\n\t}", "public boolean contains2(DecimalPosition position) { // TODO rename: ???\n return position != null && position.getX() >= start.getX() && position.getY() >= start.getY() && position.getX() <= end.getX() && position.getY() <= end.getY();\n }", "private boolean checkConnection(int x1, int x2) {\n\t\treturn (xStartValue <= x1 && xEndValue >= x1) || (xStartValue <= x2 && xEndValue >= x2) ||\n\t\t\t\t(x1 <= xStartValue && x2 >= xStartValue) || (x1 <= xEndValue && x2 >= xEndValue);\n\t\t\n\t}", "public boolean contains(N startNode, N endNode, E label)\r\n/* 62: */ {\r\n/* 63:121 */ assert (checkRep());\r\n/* 64:122 */ if ((this.map.containsKey(startNode)) && (this.map.containsKey(endNode))) {\r\n/* 65:123 */ return ((Map)this.map.get(startNode)).get(endNode).equals(label);\r\n/* 66: */ }\r\n/* 67:125 */ return false;\r\n/* 68: */ }", "private int binarySearchEndBlock(int firstVis,List<BlockLine> blocks) {\n //end > firstVis\n int left = 0,right = blocks.size() - 1,mid,row;\n int max = right;\n while(left <= right){\n mid = (left + right) / 2;\n if(mid < 0) return 0;\n if(mid > max) return max;\n row = blocks.get(mid).endLine;\n if(row > firstVis) {\n right = mid - 1;\n }else if(row < firstVis) {\n left = mid + 1;\n }else{\n left = mid;\n break;\n }\n }\n return Math.max(0,Math.min(left,max));\n }", "private boolean isInsideBounderies(double value, Double min, Double max) {\r\n \tif (min == null && max == null) {\r\n \t\treturn true;\r\n \t}\r\n \telse if (min != null && max == null) {\r\n \t\treturn min <= value;\r\n \t}\r\n \telse if (min == null && max != null) {\r\n \t\treturn value <= max;\r\n \t}\r\n \treturn min <= value && value <= max;\r\n }", "private double checkBounds(double param, int i) {\n if (param < low[i]) {\n return low[i];\n } else if (param > high[i]) {\n return high[i];\n } else {\n return param;\n }\n }", "private StatusEnum stepInternal()\n {\n if (initialStep)\n {\n this.tail = map.getStart();\n this.openSet.push(map.getStart());\n initialStep = false;\n }\n\n if (status != StatusEnum.RUNNING)\n return status;\n\n cursor = openSet.pop(); // Pull the cursor off the open set min-heap\n if (cursor == null)\n {\n // The open set was empty, so although we have not reached the goal, there are no more points to investigate\n return StatusEnum.COMPLETED_NOT_FOUND;\n }\n\n while (closedSet.contains(cursor) || !map.isTraversable(cursor))\n {\n // The cursor is in the closed set (meaning it was already investigated) or the cursor point is non traversable on the map\n cursor = openSet.pop();\n if (cursor == null)\n {\n return StatusEnum.COMPLETED_NOT_FOUND;\n }\n }\n\n // The goal has been reached, the path is complete\n if (cursor.equals(map.getGoal()))\n {\n tail = cursor; // Set the member tail to be used in the reconstruction done in getPath()\n return StatusEnum.COMPLETED_FOUND;\n }\n\n // Add the cursor point to the closed set\n closedSet.add(cursor);\n\n // Get the list of neighboring points\n List<WeightedPoint> neighbors = neighborSelector.getNeighbors(map, cursor, heuristic);\n\n // Link the neighbors to the cursor (for backtracking the path when the goal is reached) and calculate their weight\n for (WeightedPoint wp : neighbors)\n {\n if (map.isTraversable(wp.getRow(), wp.getCol()) && !closedSet.contains(wp))\n {\n wp.setFromCost(cursor.getFromCost() + heuristic.distance(cursor, wp));\n\n if (dijkstra)\n {\n wp.setToCost(0);\n }\n else\n {\n wp.setToCost(heuristic.distance(wp, map.getGoal()));\n }\n wp.setPrev(cursor);\n }\n }\n\n if (shuffle)\n {\n // Shuffle the neighbors to randomize the order of testing nodes with the same cost value\n Collections.shuffle( neighbors );\n }\n Collections.sort( neighbors );\n\n // Put the neighbors on the open set\n for (WeightedPoint wp : neighbors)\n {\n if (!openSet.contains(wp))\n openSet.push(wp);\n }\n\n return StatusEnum.RUNNING;\n }", "private boolean inProcessRange(ProcessorDistributionKey key, ActiveTimeSpans active)\n {\n if (checkTime(active, key.getTimeSpan(), key.getConstraintKey()))\n {\n return true;\n }\n\n final AnimationPlan animationPlan = myAnimationPlan;\n final AnimationState currentAnimationState = myCurrentAnimationState;\n if (animationPlan == null || currentAnimationState == null)\n {\n return false;\n }\n\n final int loadAhead = myProcessorBuilder.getProcessorFactory().getLoadAhead(key.getGeometryType());\n\n final AnimationState state = animationPlan.findState(key.getTimeSpan(), currentAnimationState.getDirection());\n if (state == null)\n {\n return false;\n }\n animationPlan.getTimeSpanForState(state);\n boolean inRange = false;\n try\n {\n final int distance = animationPlan.calculateDistance(currentAnimationState, state);\n inRange = distance <= loadAhead;\n }\n catch (final RuntimeException e)\n {\n // If this test fails just fail the in range test as this always\n // happens during a plan\n // change where the distributor has yet to receive the updated\n // plan and ends up in\n // a race condition with the animation manager adjusting to the\n // new plan.\n inRange = false;\n }\n return inRange;\n }", "private void findBestPath(){\n\t\t// The method will try to find the best path for every starting point and will use the minimum\n\t\tfor(int start = 0; start < this.getDimension(); start++){\n\t\t\tfindBestPath(start);\t\n\t\t}\t\n\t}", "private static boolean hasVisibleRegion(int begin,int end,int first,int last) {\n return (end > first && begin < last);\n }", "public int[] findMinimunPathBF(int src, int[][] graph) {\r\n\t\t// The distance from the src to each vertices.\r\n\t\tint[] dist = new int[graph.length];\r\n\t\t// Maximizing the distance of the sre to all the vertices.\r\n\t\tfor (int i = 0; i < dist.length; i++) {\r\n\t\t\tdist[i] = Integer.MAX_VALUE;\r\n\t\t}\r\n\t\tdist[src] = 0;\r\n\r\n\t\t// Loop |v|-1 times, For each edge in the graph.\r\n\t\tfor (int k = 0; k < graph.length - 1; k++) {\r\n\t\t\t// For each edge in the graph. \r\n\t\t\tfor (int i = 0; i < graph.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < graph.length; j++) {\r\n\t\t\t\t\t// Relax edge(i, j).\r\n\t\t\t\t\tif (graph[i][j] != 0) {\r\n\t\t\t\t\t\tif (dist[i] != Integer.MAX_VALUE\r\n\t\t\t\t\t\t\t\t&& dist[j] > dist[i] + graph[i][j]) {\r\n\t\t\t\t\t\t\tdist[j] = dist[i] + graph[i][j];\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\t// Check if there is a negative cycle, loop the edges.\r\n\t\tfor (int i = 0; i < graph.length; i++) {\r\n\t\t\t// For each edge in the graph.\r\n\t\t\tfor (int j = 0; j < graph.length; j++) {\r\n\t\t\t\tif (graph[i][j] != 0) {\r\n\t\t\t\t\t// Still can relax the edges?.\r\n\t\t\t\t\tif (dist[i] != Integer.MAX_VALUE\r\n\t\t\t\t\t\t\t&& dist[j] > dist[i] + graph[i][j]) {\r\n\t\t\t\t\t\t// Put a sign of having a negative cycle.\r\n\t\t\t\t\t\tdist[0] = Integer.MIN_VALUE;\r\n\t\t\t\t\t\treturn dist;\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 dist;\r\n\t}", "public boolean find(int value) {\r\n // Write your code here\r\n for (int i = 0; i < elements.size() && elements.get(i) < value / 2 + 1; i++) {\r\n if (elements.get(i) * 2 == value && mapping.get(elements.get(i)) == 2) {\r\n return true;\r\n }\r\n if (elements.get(i) * 2 != value && mapping.containsKey(value - elements.get(i))) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "@JsMethod(name = \"interiorContainsPoint\")\n public boolean interiorContains(double p) {\n return p > lo && p < hi;\n }", "public void setGBInterval_point(java.math.BigInteger param){\n localGBInterval_pointTracker = param != null;\n \n this.localGBInterval_point=param;\n \n\n }", "public List<GeographicPoint> bfs(GeographicPoint start, \n\t\t\t \t\t\t\t\t GeographicPoint goal, Consumer<GeographicPoint> nodeSearched)\n\t{\n\t\t// TODO: Implement this method in WEEK 3\n\t\t\n\t\t// Hook for visualization. See writeup.\n\t\t//nodeSearched.accept(next.getLocation());\n\t\t\n\t\tSet<GeographicPoint> visited = new HashSet<GeographicPoint>();\n\t\tList<GeographicPoint> queue = new ArrayList<GeographicPoint>();\n\t\tHashMap<GeographicPoint, List<GeographicPoint>> prev = new HashMap<GeographicPoint, List<GeographicPoint>>();\n\t\t\n\t\tfor (GeographicPoint temp : map.keySet())\n\t\t\tprev.put(temp, new ArrayList<GeographicPoint>());\n\t\t\n\t\tif (!map.containsKey(start) || !map.containsKey(goal)) \n\t\t\treturn null;\n\t\t\n\t\tqueue.add(start);\n\t\twhile (!queue.isEmpty() && !visited.contains(goal)) {\n\t\t\t\n\t\t\tGeographicPoint currPoint = queue.get(0);\n\t\t\tMapNode currNode = map.get(currPoint);\n\t\t\tnodeSearched.accept(currPoint);\n\t\t\t\n\t\t\tqueue.remove(0);\n\t\t\tHashMap<MapEdge, GeographicPoint> neighbours = currNode.getNeighbours();\n\t\t\tfor (GeographicPoint n : neighbours.values()) {\n\t\t\t\tif (n.equals(start))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!visited.contains(n)) {\n\t\t\t\t\tqueue.add(n);\n\t\t\t\t\tvisited.add(n);\n\t\t\t\t\tprev.get(n).add(currPoint);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn backTrack(prev, goal);\n\t}", "private static int search(long[] numbers, int start, int end, long value) {\n if (start > end){\n return -1;\n }\n\n int middle = (start + end) / 2;\n\n if (numbers[middle] == value) {\n return middle;\n }\n\n if (numbers[middle] > value) {\n return search(numbers, start, middle - 1, value);\n }\n\n return search(numbers, middle + 1, end, value);\n }", "public boolean isLevelTrailSegment(int start, int end)\n {\n int max = markers[start];\n int min = markers[start];\n for (int i = start; i <= end; i++) {\n if (markers[i] > max) {\n max = markers[i];\n }\n \n if (markers[i] < min) {\n min = markers[i];\n }\n }\n \n return (max-min <= 10);\n }", "boolean isInInterval(int baseIndex);", "public void findBoundaryGivenPhi() {\n \r\n boundary.removeAllElements();\r\n \r\n \tfor(int i=0; i<pixelsWide-1; i++)\r\n \t\tfor(int j=0; j<pixelsHigh-1; j++) {\r\n Int2d pi = new Int2d(i,j);\r\n \r\n double sgnIJ = Math.signum( phi[i][j] );\r\n if( sgnIJ != Math.signum( phi[i+1][j] ) ) {\r\n if(!boundary.contains(pi)) boundary.add(pi);\r\n Int2d p2 = new Int2d(i+1,j);\r\n if(!boundary.contains(p2)) boundary.add(p2);\r\n }\r\n if( sgnIJ != Math.signum( phi[i][j+1] ) ) {\r\n if(!boundary.contains(pi)) boundary.add(pi);\r\n Int2d p2 = new Int2d(i,j+1);\r\n if(!boundary.contains(p2)) boundary.add(p2); \r\n }\r\n \r\n }\r\n \r\n \r\n }", "public void boundsCheck(BigDecimal d) throws InvalidDatatypeValueException {\n boolean minOk = false;\n boolean maxOk = false;\n String upperBound = (fMaxExclusive != null )? ( fMaxExclusive.toString() ):\n ( ( fMaxInclusive != null )?fMaxInclusive.toString():\"\");\n \n String lowerBound = (fMinExclusive != null )? ( fMinExclusive.toString() ):\n (( fMinInclusive != null )?fMinInclusive.toString():\"\"); \n String lowerBoundIndicator = \"\";\n String upperBoundIndicator = \"\";\n \n \n if ( isMaxInclusiveDefined){\n maxOk = (d.compareTo(fMaxInclusive) <= 0);\n upperBound = fMaxInclusive.toString();\n if ( upperBound != null ){\n upperBoundIndicator = \"<=\"; \n } else {\n upperBound=\"\";\n }\n } else if ( isMaxExclusiveDefined){\n maxOk = (d.compareTo(fMaxExclusive) < 0);\n upperBound = fMaxExclusive.toString();\n if ( upperBound != null ){\n upperBoundIndicator = \"<\";\n } else {\n upperBound = \"\";\n }\n } else{\n maxOk = (!isMaxInclusiveDefined && ! isMaxExclusiveDefined);\n }\n \n \n if ( isMinInclusiveDefined){\n minOk = (d.compareTo(fMinInclusive) >= 0);\n lowerBound = fMinInclusive.toString();\n if( lowerBound != null ){\n lowerBoundIndicator = \"<=\";\n }else {\n lowerBound = \"\";\n }\n } else if ( isMinExclusiveDefined){\n minOk = (d.compareTo(fMinExclusive) > 0);\n lowerBound = fMinExclusive.toString();\n if( lowerBound != null ){\n lowerBoundIndicator = \"<\";\n } else {\n lowerBound = \"\";\n }\n } else{\n minOk = (!isMinInclusiveDefined && !isMinExclusiveDefined);\n }\n \n if (!(minOk && maxOk))\n throw new InvalidDatatypeValueException (\n getErrorString(DatatypeMessageProvider.OutOfBounds,\n DatatypeMessageProvider.MSG_NONE,\n new Object [] { d.toString() , lowerBound ,\n upperBound, lowerBoundIndicator, upperBoundIndicator}));\n \n }", "protected int search(double value) {\n int n = sequence.size();\n int left = 0, right = n - 1, index = 0;\n while (left != right) {\n index = (right - left) / 2 + left;\n if (value >= sequence.get(index == left ? index + 1 : index)) {\n left = index == left ? index + 1 : index;\n } else {\n right = index;\n }\n }\n while (left > 0 && value == sequence.get(left - 1)) {\n left -= 1;\n }\n return left;\n }", "private boolean pointOnSegment(Waypoint w1, Waypoint w3, Waypoint w2){\n\t\tdouble w1x = w1.getX();\n\t\tdouble w1y = w1.getY();\n\t\tdouble w2x = w2.getX();\n\t\tdouble w2y = w2.getY();\n\t\tdouble w3x = w3.getX();\n\t\tdouble w3y = w3.getY();\n\t\t\n\t\tif (w3x <= Math.max(w1x, w2x) && w3x >= Math.min(w1x, w2x) && \n\t\t\tw3y <= Math.max(w1y, w2y) && w3y >= Math.min(w1y, w2y))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "protected int findInterval( Double val ){\n\t\tfor( int i = 0; i < histogram.length; i++ ){\n\t\t\tif( (lowerBound + i * this.interval) >= val )\n\t\t\t\treturn Math.max( 0, i - 1 );\n\t\t}\n\t\treturn histogram.length - 1;\n\t}", "private int findFrame(int startFrame){\n boolean flag=true;\n int startBitmap = startFrame/32;\n int startMask = startFrame%32;\n for(int i=startBitmap; i<bitMap.length; i++){\n for(int j=0; j<32;j++){\n if(flag && i==startBitmap){\n flag = false;\n j=startMask;\n }\n if(isEmpty(i,j)){\n return (i*32)+j;\n }\n }\n }\n return -1;\n }", "static int binarySearch(int arr[], int start, int end, int target ){\n if(start>end){\n return -1;\n }\n int mid = start+(end-start)/2;\n \n if(arr[mid] == target && (mid==0 || arr[mid-1]!=target)){\n return mid;\n }\n if(arr[mid] == target){\n return mid;\n }\n if(arr[mid]>=target && arr[mid]>arr[start]){\n return binarySearch(arr,start,mid-1,target);\n }\n // else if(arr[mid]<arr[start] && arr[mid]<target){\n // return binarySearch(arr,mid+1,end,target);\n // }\n return binarySearch(arr,mid+1,end,target);\n }", "@Override\n public boolean onRecurse(DefaultGraph graph, int cycleStart,\n int cycleSecond, int lastVertex, int current, int currentFaces,\n int edgesLeft, int edgesInCurrentCycle)\n {\n int girth = graph.getGirth();\n \n /* Minimum number of edges needed to finnish current cycle. */\n int neededInCurrent;\n if(edgesInCurrentCycle >= girth) {\n if(graph.hasEdge(current, cycleStart))\n neededInCurrent = 1;\n else\n neededInCurrent = 2;\n } else {\n neededInCurrent = girth - edgesInCurrentCycle;\n }\n \n /* Simple bounding based on edges left/current number of faces. The\n * +1 is the cycle we're currently working on. */\n int estimate = currentFaces + 1 + (edgesLeft - neededInCurrent) / girth;\n \n /* If we are not going to get higher than our previous result, we can\n * bound. Note that we add 1 to our previous result, this is because\n * either all results will be even, or all results will be odd. */\n if(estimate <= previousResult + 1) {\n return false;\n }\n \n /*float depth = (float) edgesLeft / (float) graph.getNumberOfEdges();\n if(previousResult >= 0 && current < 0 &&\n estimate * 0.8f <= previousResult && depth >= 0.3f) {\n if(graph.estimate() <= previousResult) {\n return false;\n }\n }*/\n \n return true;\n }", "private boolean findPixel(Location p) {\n\t\treturn !(bst.get(bst.getRoot(), p) == null);\n\t}", "public Integer binSearch(Integer target, Integer[] data, Integer left, Integer right) {\n if (right - left == 1) {\n if (data[left] == target) return left;\n if (data[right] == target) return right;\n }\n if (right - left == 0) {\n if (data[left] == target) return left;\n }\n Integer midpt = (right + left) / 2 ;\n if (target == data[midpt]) return midpt ;\n if (target > data[midpt] ) return binSearch(target, data, midpt, right) ;\n if (target < data[midpt] ) return binSearch(target, data, left, midpt) ;\n\n return -1;\n }", "public boolean pathExists(int start, int end) {\n boolean[] visited = new boolean[nodeCount];\n // find a path with a greedy search\n PairHeap q = new PairHeap();\n visited[start] = true;\n int next = start;\n try {\n while (next != end) {\n // check every neighbour of next - add if necessary\n for (int j = 0; j < nodeCount; j++) {\n if (roads[next][j] > 0 && !visited[j]) { // connected\n visited[j] = true;\n int x = xs[j] - xs[end];\n int y = ys[j] - ys[end];\n int d = (int) Math.sqrt(x * x + y * y);\n q.insert(j, d);\n }\n }\n next = q.deleteMin();\n }\n return true;\n } catch (NullPointerException e) {\n return false;\n }\n }", "private static boolean isOnSegment(Coord p, Coord q, Coord r) \n {\n if(r.x <= Math.max(p.x, q.x) && r.x >= Math.min(p.x, q.x) && \n r.y <= Math.max(p.y, q.y) && r.y >= Math.min(p.y, q.y)) \n return true; \n return false; \n }", "@Override\r\n public List<T> breadthFirstPath(T start, T end) {\r\n\r\n Vertex<T> startV = vertices.get(start);\r\n Vertex<T> endV = vertices.get(end);\r\n\r\n LinkedList<Vertex<T>> vertexList = new LinkedList<>();\r\n //Set<Vertex<T>> visited = new HashSet<>();\r\n ArrayList<Vertex<T>> visited = new ArrayList<>();\r\n\r\n LinkedList<Vertex<T>> pred = new LinkedList<>();\r\n int currIndex = 0;\r\n\r\n pred.add(null);\r\n\r\n vertexList.add(startV);\r\n visited.add(startV);\r\n\r\n LinkedList<T> path = new LinkedList<>();\r\n\r\n if (breadthFirstSearch(start, end) == false) {\r\n path = new LinkedList<>();\r\n return path;\r\n } else {\r\n while (vertexList.size() > 0) {\r\n Vertex<T> next = vertexList.poll();\r\n if(next == null){\r\n continue;\r\n }\r\n if (next == endV) {\r\n path.add(endV.getValue());\r\n break;\r\n }\r\n for (Vertex<T> neighbor : next.getNeighbors()) {\r\n if (!visited.contains(neighbor)) {\r\n pred.add(next);\r\n visited.add(neighbor);\r\n vertexList.add(neighbor);\r\n }\r\n }\r\n currIndex++;\r\n //path.add(next.getValue());\r\n\r\n }\r\n while (currIndex != 0) {\r\n Vertex<T> parent = pred.get(currIndex);\r\n path.add(parent.getValue());\r\n currIndex = visited.indexOf(parent);\r\n }\r\n }\r\n Collections.reverse(path);\r\n return path;\r\n }", "Long[] searchSolution(int timeLimit, Graph g);", "public boolean isInRange(Point testPt){\n\t\tfor(int i = 0; i < display.size();i++){\n\t\t\tif(testPt.x >= display.get(i).x && testPt.y >= display.get(i).y && testPt.x <= (display.get(i).x + display.get(i).width()) && testPt.y <= (display.get(i).y + display.get(i).height())){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private Point backtrack(Point p){\n\t\t// coordinates of the point\n\t\tint x = (int)p.getX();\n\t\tint y = (int)p.getY();\n\t\t// neigh hold the return value\n\t\tPoint neigh= p;\n\t\t// the lowest score\n\t\tint score=10000;\n\t\t// look at all the neighbor and compare them\n\t\tif(x>0\t && topology[x-1][y]>=0){\n\t\t\tscore = topology[x-1][y];\n\t\t\tneigh = new Point(x-1,y);\n\t\t}\n\t\tif(x<row-1 && topology[x+1][y]>=0 && score > topology[x+1][y]) {\n\t\t\tscore = topology[x+1][y];\n\t\t\tneigh = new Point(x+1,y);\n\t\t}\n\t\tif(y<col-1 && topology[x][y+1]>=0 && score > topology[x][y+1]) {\n\t\t\tscore = topology[x][y+1];\n\t\t\tneigh = new Point(x,y+1);\n\t\t}\n\t\tif(y>0 && topology[x][y-1]>=0 && score > topology[x][y-1]) {\n\t\t\tscore = topology[x][y-1];\n\t\t\tneigh = new Point(x,y-1);\n\t\t}\n\t\treturn neigh;\n\t}", "private static boolean isBetween(double start, double middle, double end) {\n if(start > end) {\n return end <= middle && middle <= start;\n }\n else {\n return start <= middle && middle <= end;\n }\n }", "private PathCostFlow findCheapestPath(int start, int end, double max_flow) throws Exception {\n if (getNode(start) == null || getNode(end) == null\n || !getNode(start).isSource() || getNode(end).isSource()) {\n throw new IllegalArgumentException(\"start must be the index of a source and end must be the index of a sink\");\n }\n double amount = Math.min(Math.min(getNode(start).getResidualCapacity(),\n getNode(end).getResidualCapacity()), max_flow);\n\n boolean[] visited = new boolean[n];\n int[] parent = new int[n];\n for (int i = 0; i < n; i++) {\n parent[i] = -1;\n }\n double[] cost = new double[n];\n for (int i = 0; i < n; i++) {\n cost[i] = Integer.MAX_VALUE;\n }\n cost[start] = 0;\n\n PriorityQueue<IndexCostTuple> queue = new PriorityQueue<IndexCostTuple>();\n queue.add(new IndexCostTuple(start, 0));\n\n while (!queue.isEmpty()) {\n IndexCostTuple current = queue.poll();\n\n // we found the target node\n if (current.getIndex() == end) {\n ArrayList<Integer> path = new ArrayList<Integer>();\n path.add(new Integer(end));\n while (path.get(path.size() - 1) != start) {\n path.add(parent[path.get(path.size() - 1)]);\n }\n Collections.reverse(path);\n if ((path.get(0) != start) || (path.get(path.size() - 1) != end)) {\n throw new Exception(\"I fucked up coding Dijkstra's\");\n }\n return new PathCostFlow(path, cost[end], amount);\n }\n\n // iterate through all possible neighbors of the current node\n for (int i = 0; i < n; i++) {\n SingleEdge e = matrix[current.getIndex()][i];\n if ((!visited[i]) && (e != null)\n && (current.getCost() + e.getCost(amount) < cost[i])) {\n cost[i] = current.getCost() + e.getCost(amount);\n parent[i] = current.getIndex();\n\n // update the entry for this node in the queue\n IndexCostTuple newCost = new IndexCostTuple(i, cost[i]);\n queue.remove(newCost);\n queue.add(newCost);\n }\n }\n visited[current.getIndex()] = true;\n }\n\n return null; //the target node was unreachable\n }", "private static int search(int[] nums, int target, int start, int end)\r\n\t{\n\t\tif (end == start)\r\n\t\t\treturn nums[start] == target ? start : -1;\r\n\t\t\r\n\t\tif(end - start == 1)\r\n\t\t{\r\n\t\t\tif(nums[start] == target)\r\n\t\t\t\treturn start;\r\n\t\t\tif(nums[end] == target)\r\n\t\t\t\treturn end;\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\t// If there are more than two elements\r\n\t\tint mid = (start + end) / 2;\r\n\t\tif (nums[mid] == target)\r\n\t\t\treturn mid;\r\n\t\telse if (nums[mid] > target)\r\n\t\t\treturn search(nums, target, start, mid - 1);\r\n\t\telse\r\n\t\t\treturn search(nums, target, mid + 1, end);\r\n\t}", "public static int findPosMin(List<Integer> values, int start) {\r\n int bestGuessSoFar = start;\r\n for (int i = start + 1; i < values.size(); i++) {\r\n if (values.get(i) < values.get(bestGuessSoFar)) {\r\n bestGuessSoFar = i;\r\n } // if\r\n } // for\r\n return bestGuessSoFar;\r\n }", "public int getLowerBound ();", "public static int findOneDPeakRecursive(int [] nums, int low, int high) {\n if (high < low) {\n return -1;\n }\n\n int mid = (high + low)/2;\n // Conquer\n int placement = peakOneD(mid, nums);\n // Divide/Combine\n if (placement == -1) {\n return findOneDPeakRecursive(nums, low, mid);\n }\n else if (placement == 1) {\n return findOneDPeakRecursive(nums, mid + 1, high);\n }\n else {\n return mid;\n }\n }", "private ECPoint checkPointOnCurve(byte[] compressedPoint) {\n ECPoint point = domainParams.getCurve().decodePoint(compressedPoint);\n Preconditions.checkArgument(point.isValid(), \"Invalid point: the point is not on the curve\");\n Preconditions.checkArgument(!point.isInfinity(), \"Invalid point: the point is at infinity\");\n return point;\n }", "default boolean isReachable(int vidxa, int vidxb) {\n Deque<Integer> stack = new ArrayDeque<>(16);\n BitSet vset = new BitSet(getVertexCount());\n while (!stack.isEmpty()) {\n int current = stack.pop();\n if (!vset.get(current)) {\n vset.set(current);\n if (current == vidxb) {\n return true;\n }\n for (int i = 0, n = this.getNextCount(current); i < n; i++) {\n int next = this.getNext(current, i);\n stack.push(next);\n }\n }\n }\n return false;\n }", "private Point[] nearestPairRec(Point[] range, boolean axis) {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (range.length < 4) return nearestPair3Points(range);\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2];\n\t\t\tdouble MinDistance = -1; //it will be change for sure, because we pass the array only if it containes 4 points and above.\n\t\t\tdouble MinDistanceInStrip;\n\t\t\t//step 4\n\t\t\tif (axis){\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getX(), range[(range.length)/2].getX(), axis), axis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getX(), range[range.length-1].getX() ,axis), axis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getY(), range[(range.length)/2].getY(), axis), axis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getY(), range[range.length-1].getY() ,axis), axis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}else if (MinPointsLeft!=null && MinPointsRight==null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}else if (MinPointsRight!=null && MinPointsLeft==null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 find the nearest point around the median\n\t\t\tint upper;\n\t\t\tint lower;\n\t\t\tif (MinDistance==-1) MinDistance = 0;\n\t\t\tif (axis){\n\t\t\t\tupper = (int) (range[(range.length)/2].getX()+MinDistance);\n\t\t\t\tlower = (int) (range[(range.length)/2].getX()-MinDistance);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tupper = (int) (range[(range.length)/2].getY()+MinDistance);\n\t\t\t\tlower = (int) (range[(range.length)/2].getY()-MinDistance);\n\t\t\t}\n\t\t\trange = getPointsInRangeOppAxis(lower, upper, axis);\n\t\t\tif (range.length>=2) MinPointsInStrip = nearestPointInArray(range);\n\t\t\tif (MinPointsInStrip[0]!=null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "public boolean onSegment(Line line) {\n\n // Define minimum and maximum for X and Y values.\n double maxX = Math.max(line.start().getX(), line.end().getX());\n double maxY = Math.max(line.start().getY(), line.end().getY());\n double minX = Math.min(line.start().getX(), line.end().getX());\n double minY = Math.min(line.start().getY(), line.end().getY());\n\n // Calculation deviation.\n double d = 0.0000000001;\n\n // Check if this point is in between minimum and maximum and return result.\n return minX - d <= this.x && this.x <= maxX + d && minY - d <= this.y && this.y <= maxY + d;\n\n }", "Iterable<Vertex> computePathToGraph(Loc start, Vertex end) throws GraphException;", "public boolean sps() {\n\t\tupdateFrontUnknown();\n\t\tboolean successful = false;\n\t\tfor (int i = 0; i < frontUnknown.size(); i++) {\n\t\t\tint x = frontUnknown.get(i)[0];\n\t\t\tint y = frontUnknown.get(i)[1];\n\t\t\tArrayList<int[]> knownNeighbors = findAdjacentSafe(frontUnknown.get(i));\n\t\t\tfor (int[] j: knownNeighbors) {\n\t\t\t\t//all clear neighbours\n\t\t\t\tif (answerMap[j[0]][j[1]] == findAdjacentMark(j).size()) {\n\t\t\t\t\tprobe(x, y);\n\t\t\t\t\tsuccessful = true;\n\t\t\t\t\tSystem.out.println(\"SPS: probe[\" + x + \",\" + y + \"]\");\n\t\t\t\t\tspsCount++;\n\t\t\t\t\tshowMap();\n\t\t\t\t\ti--;\n\t\t\t\t\tupdateFrontUnknown();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//all marked neighbours\n\t\t\t\t\tif (answerMap[j[0]][j[1]] == findAdjacentRisk(j).size()) {\n\t\t\t\t\t\tmark(x, y);\n\t\t\t\t\t\tsuccessful = true;\n\t\t\t\t\t\tSystem.out.println(\"SPS: probe[\" + x + \",\" + y + \"]\");\n\t\t\t\t\t\tspsCount++;\n\t\t\t\t\t\tshowMap();\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tupdateFrontUnknown();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn successful;\n\t}", "public List<Point> rangeSearch(Rectangle rect) {\n\t\tif (rect == null) {\n System.out.println(\"Rectangle can't be null\");\n\t\t\tSystem.exit(0);\n }\n List<Point> rangePoints = new List<>();\n if (!isEmpty()) {\n range(head, rect, rangePoints);\n }\n return rangePoints;\n\t}", "public int serachMaxOrMinPoint(int [] A){\r\n\t\r\n\tint mid, first=0,last=A.length-1;\r\n\t\r\n\twhile( first <= last){\r\n\t\tif(first == last){\r\n\t\t\treturn A[first];\r\n\t\t}\r\n\t\telse if(first == last-1){\r\n\t\t\treturn Math.max(A[first], A[last]);\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tmid= first + (last-first)/2;\r\n\t\t\t\r\n\t\t\tif(A[mid]>A[mid-1] && A[mid]>A[mid+1])\r\n\t\t\t\treturn A[mid];\r\n\t\t\telse if(A[mid]>A[mid-1] && A[mid]<A[mid+1])\r\n\t\t\t\tfirst=mid+1;\r\n\t\t\telse if(A[mid]<A[mid-1] && A[mid]>A[mid+1])\r\n\t\t\t\tlast=mid-1;\r\n\t\t\telse return -1;\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n\t\r\n}", "private static int breadthFirstSearch(Vertex start) throws Queue.UnderflowException, Queue.EmptyException {\n boolean visited[] = new boolean[48];\n //Keep a queue of vertecies and a queue of the depth of the verticies - they will be added to and poped from identically\n ListQueue<Vertex> queue = new ListQueue<Vertex>();\n ListQueue<Integer> numQueue = new ListQueue<Integer>();\n //Set the starting node as visited\n visited[start.index()] = true;\n queue.enqueue(start);\n numQueue.enqueue(new Integer(1));\n\n //Keep last\n int last = -1;\n //While the queue isnt empty\n while (!queue.isEmpty()) {\n //Pop off the top from both queues and mark as visited\n start = queue.dequeue();\n int current = numQueue.dequeue();\n visited[start.index] = true;\n //For all neigbors\n for (Vertex v : start.neighbors) {\n //If we havent visited it make sure to visit it\n if (visited[v.index()] == false) {\n //As we keep adding new nodes to visit keep track of the depth\n queue.enqueue(v);\n numQueue.enqueue(current + 1);\n }\n }\n //Keep track of the most recent depth before we pop it off (queue will be empty when we exit)\n last = current;\n }\n //Return the max of the depth\n return last;\n }", "public int find(int[] nums, int target, int start, int end){\n int middle = (start + end) / 2;\n\n while (start <= end){\n middle = (start + end) >> 1;\n if(nums[middle] == target){\n return middle;\n }\n else if(nums[middle] > target){\n end = middle - 1;\n }\n else {\n start = middle + 1;\n }\n }\n return -1;\n }", "@Override\n\tpublic int findSegment(int x, int y) {\n\t\treturn -1;\n\t}", "public static GraphNode getClosestGraphNodeWithPredicate(\n @NotNull GraphNode startNode,\n @NotNull Predicate<GraphNode> predicate\n ) {\n PriorityQueue<GraphNode> graphNodesToVisit = new PriorityQueue<>(\n new GraphNodePositionComparator(getPositionOf(startNode))\n );\n HashSet<GraphNode> alreadyToVisit = new HashSet<>();\n\n graphNodesToVisit.add(startNode);\n alreadyToVisit.add(startNode);\n\n while (!graphNodesToVisit.isEmpty()) {\n GraphNode node = graphNodesToVisit.poll();\n\n if (predicate.test(node))\n return node;\n\n for (GraphNode neighbor : node.neighbors) {\n if (!alreadyToVisit.contains(neighbor)) {\n graphNodesToVisit.add(neighbor);\n alreadyToVisit.add(neighbor);\n }\n }\n }\n\n return null;\n }", "int getPathCost(Coordinate end) {\n if (!graph.containsKey(end)) {\n // test use display point\n // System.err.printf(\"Graph doesn't contain end vertex \\\"%s\\\"\\n\", end);\n return Integer.MAX_VALUE;\n }\n int weight = Integer.MAX_VALUE;\n for (Coordinate key : graph.keySet()) {\n if (key.equals(end)) {\n weight = graph.get(key).dist;\n }\n }\n return weight;\n }", "static private void checkStartNode(PathFinder pathFinder) {\n for (Node n : pathFinder.getSpaceTimeGrid().getNodeLayerPointer(pathFinder.getStartTime()).getNodeList()) {\n if (n.getX() == pathFinder.getStartNode().getX() && n.getY() == pathFinder.getStartNode().getY()) {\n return;\n }\n }\n throw new PathNotPossibleException(\"The start point was placed outside the SpaceTimeGrid: (\" + pathFinder.getStartNode().getX() + \";\" + pathFinder.getStartNode().getY() + \")\");\n }", "private boolean isInBound(int current, int bound){\n return (current >= 0 && current < bound);\n }", "private static int findMaxPointsFromBottomRightToTopLeft(char[][] matrix, int startingCellX, int startingCellY, int endCellX, int endCellY, boolean[][] visited) {\n if (!inRange(matrix, startingCellX, startingCellY)) {\n return 0;\n }\n\n if (visited[endCellX][endCellY]) {\n return 0;\n }\n\n char ch = matrix[endCellX][endCellY];\n\n visited[endCellX][endCellY] = true;\n\n if (ch == '#') {\n return 0;\n }\n\n if (startingCellX == endCellX && startingCellY == endCellY) {\n if (ch == '#' || ch == '.') {\n return 0;\n }\n return 1; // if '*'\n }\n\n if (ch == '*') {\n\n int maxPointsFromUp = findMaxPointsFromBottomRightToTopLeft(matrix, startingCellX, startingCellY, endCellX - 1, endCellY, visited);\n int maxPointsFromLeft = findMaxPointsFromBottomRightToTopLeft(matrix, startingCellX, startingCellY, endCellX, endCellY - 1, visited);\n\n if (maxPointsFromLeft < maxPointsFromUp) {\n if (inRange(matrix, endCellX, endCellY - 1)) {\n visited[startingCellX][startingCellY + 1] = false;\n }\n } else {\n if (inRange(matrix, endCellX - 1, endCellY)) {\n visited[endCellX - 1][endCellY] = false;\n }\n }\n\n int maxPoints = 1 + Math.max(maxPointsFromLeft, maxPointsFromUp);\n return maxPoints;\n\n } else if (ch == '.') {\n\n int maxPointsFromUp = findMaxPointsFromBottomRightToTopLeft(matrix, startingCellX, startingCellY, endCellX - 1, endCellY, visited);\n int maxPointsFromLeft = findMaxPointsFromBottomRightToTopLeft(matrix, startingCellX, startingCellY, endCellX, endCellY - 1, visited);\n\n if (maxPointsFromLeft < maxPointsFromUp) {\n if (inRange(matrix, endCellX, endCellY - 1)) {\n visited[startingCellX][startingCellY + 1] = false;\n }\n } else {\n if (inRange(matrix, endCellX - 1, endCellY)) {\n visited[endCellX - 1][endCellY] = false;\n }\n }\n\n int maxPoints = Math.max(maxPointsFromLeft, maxPointsFromUp);\n\n return maxPoints;\n } else { // if ch == '#'\n return 0;\n }\n }", "@Override\n\tpublic boolean isStoppingConditionReached() {\n\n\t\tlong currentComputingTime = System.currentTimeMillis() - iterationStartingTime;\n\n\t\tif (Configurator.eINSTANCE.isSearchBudgetByTime()) // byTime\n\t\t\treturn super.isStoppingConditionReached() || currentComputingTime > durationThreshold;\n\t\tif (Configurator.eINSTANCE.isSearchBudgetByPrematureConvergence()) // byPrematureConvergence\n\t\t\treturn super.isStoppingConditionReached() || isStagnantState();\n\t\t// computeStagnantState\n\t\tif (Configurator.eINSTANCE.isSearchBudgetByPrematureConvergenceAndTime()) // byBoth\n\t\t\treturn super.isStoppingConditionReached() || isStagnantState() || currentComputingTime > durationThreshold;\n\t\treturn super.isStoppingConditionReached(); // classic\n\n\t}", "private int binarySearchQ7(int first, int last, K key)\n {\n int index;\n \n if (first > last)\n index = first; \n else \n {\n int mid = first + (last - first) / 2;\n K midKey = dictionary[mid].getKey(); \n if (key.equals(midKey))\n index = mid; \n else if (key.compareTo(midKey) < 0)\n index = binarySearchQ7(first, mid - 1, key);\n else\n index = binarySearchQ7(mid + 1, last, key);\n } \n return index;\n }" ]
[ "0.5799063", "0.5196416", "0.51921296", "0.5130196", "0.5066578", "0.5035948", "0.5026182", "0.5018982", "0.49713615", "0.49685708", "0.49613807", "0.49462992", "0.4939893", "0.49279246", "0.49220908", "0.49213612", "0.4876054", "0.48667696", "0.48588592", "0.48562858", "0.4837454", "0.4832674", "0.48073086", "0.48071063", "0.47952536", "0.4793991", "0.47878352", "0.47800344", "0.47724897", "0.47652024", "0.47593382", "0.47504732", "0.4747941", "0.4740797", "0.47383934", "0.47359198", "0.47349676", "0.47335184", "0.47304752", "0.47149307", "0.47144818", "0.47115722", "0.47012818", "0.4699332", "0.4691264", "0.4684796", "0.4679982", "0.46773806", "0.4669781", "0.46618858", "0.4660621", "0.46571952", "0.46509716", "0.46481085", "0.46459034", "0.46419626", "0.46370113", "0.46299878", "0.46259952", "0.46243423", "0.4623254", "0.46220887", "0.46196485", "0.46159092", "0.46031407", "0.4601466", "0.45925054", "0.45909697", "0.45863697", "0.4584995", "0.45828673", "0.4579944", "0.4575212", "0.45746025", "0.45731106", "0.4570377", "0.45672148", "0.4565372", "0.45525366", "0.45489088", "0.45461726", "0.45460713", "0.45445424", "0.45418522", "0.45410258", "0.45398685", "0.45397386", "0.45361075", "0.45328563", "0.45315373", "0.45301875", "0.45234242", "0.45187315", "0.45187262", "0.45168555", "0.45129272", "0.45122746", "0.45086092", "0.45079666", "0.45040038" ]
0.71309763
0
Alias for the hasPBPointBetween(AbstractGraphPoint startPoint, AbstractGraphPoint endPoint, BaseGraph graph) that takes its start and end points from the provided IGraphLine object.
public static boolean hasPBPointBetween(IGraphLine aLine, BaseGraph<AbstractGraphPoint> graph){ return DTUtil.hasPBPointBetween(aLine.getStartPoint(), aLine.getEndPoint(), graph); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean hasPBPointBetween(AbstractGraphPoint startPoint, AbstractGraphPoint endPoint, BaseGraph<AbstractGraphPoint> graph) {\r\n boolean result = false;\r\n if (null != startPoint && null != endPoint && null != graph && 0 < graph.size()) {\r\n //Ensure endPoint is after startPoint\r\n if (startPoint.getTimestamp() < endPoint.getTimestamp()) {\r\n //Get target value\r\n double pbValue = DTConstants.getScaledPBVALUE();\r\n double dblHighestWAP = endPoint.getWAP();\r\n double currWAP;\r\n double dblDiff;\r\n AbstractGraphPoint currPoint;\r\n //Subset the graph to deal only with points between the start and end\r\n NavigableSet<AbstractGraphPoint> subSet = graph.subSet(startPoint, true, endPoint, false);\r\n //Iterate through the set in reverse order (backwards in time) looking for a point with a WAP \r\n //at least pbValue LESS than the highest WAP so far.\r\n Iterator<AbstractGraphPoint> descIter = subSet.descendingIterator();\r\n while(descIter.hasNext()){\r\n //Get data for point\r\n currPoint = descIter.next();\r\n currWAP = currPoint.getWAP();\r\n //Update highest WAP so far if needed\r\n if(currWAP > dblHighestWAP){\r\n dblHighestWAP = currWAP;\r\n }\r\n //Calculate diff between highest WAP so far and currWAP\r\n dblDiff = dblHighestWAP - currWAP;\r\n //Is the difference >= pbValue if so we have validated that there is a PB+ point between the two points\r\n if(dblDiff >= pbValue){\r\n result = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return result;\r\n }", "public boolean isPointInLine(Coordinates point, Coordinates linePointA, Coordinates linePointB);", "public static boolean pointOnLine(int x1, int y1, int x2, int y2, int px, int py, int EPSILON) {\n\t\t// ..a.. ..b..\n\t\t// start |------P-----| end\t=> a+b = len\n\t\t//\t\t\t...len...\n\t\tint a = dist(x1, y1, px, py);\n\t\tint b = dist(x2, y2, px, py);\n\t\tint l = dist(x1, y1, x2, y2);\n\t\t\n\t\tint ab = a + b;\n\t\tint diff = Math.abs(l-ab);\n\t\t\n\t\treturn diff <= (EPSILON*EPSILON);\n\t}", "boolean between(tPoint p2)\n {\n if (! this.collinear(p2))\n return false;\n \n //check to see if line is vertical\n if (this.p0.x != this.p1.x)\n {\n //if not vertical, check to see if point overlaps in x\n return (((this.p0.x < p2.x) && (p2.x < this.p1.x)) |\n ((this.p0.x > p2.x) && (p2.x > this.p1.x)));\n }\n else\n {\n //if vertical, check to see if point overlaps in y\n return (((this.p0.y < p2.y) && (p2.y < this.p1.y)) |\n ((this.p0.y > p2.y) && (p2.y > this.p1.y)));\n }\n }", "private static boolean isPointOnLine(LineSegment a, Point2D b) {\r\n\t // Move the image, so that a.first is on (0|0)\r\n\t LineSegment aTmp = new LineSegment(new PointDouble(0, 0), new PointDouble(\r\n\t a.endPoint.getX() - a.startPoint.getX(), a.endPoint.getY() - a.startPoint.getY()));\r\n\t PointDouble bTmp = new PointDouble(b.getX() - a.startPoint.getX(), b.getY() - a.startPoint.getY());\r\n\t double r = crossProduct(aTmp.endPoint, bTmp);\r\n\t return Math.abs(r) < 0.000001;\r\n\t}", "public PointRelation pointLineRelation(Coordinates point, Coordinates linePointA, Coordinates linePointB);", "static Boolean lineBetween(int x1, int y1, int x2, int y2) {\n double m, b; // for line eqn.\n int maxV = Math.max( pgmInf.img[y1][x1], pgmInf.img[y2][x2] );\n int xmin = Math.min(x1, x2), xmax = Math.max(x1, x2);\n int ymin = Math.min(y1, y2), ymax = Math.max(y1, y2);\n\n if (x1 == x2) {\n // x = c\n for (int y=ymin ; y < ymax ; y++)\n if (pgmInf.img[y][x1] > maxV) return false;\n }\n else {\n // setup for y=mx + b form\n double top = (y1-y2), bot = (x1-x2);\n m = top / bot; \n\n if (m > -1 && m < 1) {\n // y = mx + b\n b = y1 - m * (double)x1;\n\n for (int x=xmin ; x < xmax ; x++) {\n int y = (int)Math.round( m * (double)x + b );\n if (pgmInf.img[y][x] > maxV ) return false;\n }\n }\n else {\n // x = my + b\n top = (x1-x2); bot = (y1-y2); \n m = top / bot; b = x1 - m * (double)y1;\n\n for (int y=ymin ; y < ymax ; y++) {\n int x = (int)Math.round( m* (double)y + b );\n if (pgmInf.img[y][x] > maxV) return false;\n }\n }\n }\n return true;\n }", "public boolean onSegment(Line line) {\n\n // Define minimum and maximum for X and Y values.\n double maxX = Math.max(line.start().getX(), line.end().getX());\n double maxY = Math.max(line.start().getY(), line.end().getY());\n double minX = Math.min(line.start().getX(), line.end().getX());\n double minY = Math.min(line.start().getY(), line.end().getY());\n\n // Calculation deviation.\n double d = 0.0000000001;\n\n // Check if this point is in between minimum and maximum and return result.\n return minX - d <= this.x && this.x <= maxX + d && minY - d <= this.y && this.y <= maxY + d;\n\n }", "public Point2D.Double\ngetLineIntersectPoint(BLine2D line)\n{\n\treturn (getSegmentIntersectPoint(line));\n}", "public boolean isPointInSegment(Coordinates point, Coordinates segmExtremityA, Coordinates segmExtremityB);", "public boolean contains(RMPoint aPoint)\n{\n // Get line width to be used in contain test\n float lineWidth = getStrokeWidth();\n \n // If polygon or line, make line width effectively at least 8, so users will have a better shot of selecting it\n if(this instanceof RMPolygonShape || this instanceof RMLineShape)\n lineWidth = Math.max(8, getStrokeWidth());\n \n // Get bounds, adjusted for line width\n RMRect bounds = getBoundsInside();\n bounds.inset(-lineWidth/2, -lineWidth/2);\n\n // If point isn't even in bounds rect, just return false\n if(!aPoint.inRect(bounds))\n return false;\n \n // Get shape path in bounds rect\n RMPath path = getPathInBounds();\n \n // Return whether path intersects point\n return path.intersects(aPoint, lineWidth);\n}", "public Point intersectionWith(Line other) {\r\n double m1 = this.lineSlope();\r\n double m2 = other.lineSlope();\r\n double b1 = this.intercept();\r\n double b2 = other.intercept();\r\n double interX, interY;\r\n if (m1 == m2) {\r\n return null;\r\n // this line is vertical\r\n } else if (m1 == Double.POSITIVE_INFINITY || m1 == Double.NEGATIVE_INFINITY) {\r\n interX = this.start.getX();\r\n if ((Math.min(other.start().getX(), other.end().getX()) <= interX\r\n && interX <= Math.max(other.end().getX(), other.start().getX()))) {\r\n // y value of intersection point\r\n interY = interX * m2 + b2;\r\n if (Math.min(this.start().getY(), this.end().getY()) <= interY\r\n && interY <= Math.max(this.start().getY(), this.end().getY())) {\r\n Point interPoint = new Point(Math.round(interX), Math.round(interY));\r\n return interPoint;\r\n }\r\n }\r\n return null;\r\n // other line is vertical\r\n } else if (m2 == Double.POSITIVE_INFINITY || m2 == Double.NEGATIVE_INFINITY) {\r\n interX = other.start.getX();\r\n if ((Math.min(this.start().getX(), this.end().getX()) <= interX\r\n && interX <= Math.max(this.end().getX(), this.start().getX()))) {\r\n // y value of intersection point\r\n interY = interX * m1 + b1;\r\n if (Math.min(other.start().getY(), other.end().getY()) <= interY\r\n && interY <= Math.max(other.start().getY(), other.end().getY())) {\r\n Point interPoint = new Point(Math.round(interX), Math.round(interY));\r\n return interPoint;\r\n }\r\n }\r\n return null;\r\n // this line is horizontal\r\n } else if (m1 == 0) {\r\n // y value of potential intersection point\r\n interY = this.start.getY();\r\n if ((Math.min(other.start().getY(), other.end().getY()) <= interY\r\n && interY <= Math.max(other.end().getY(), other.start().getY()))) {\r\n interX = ((interY - other.start.getY()) / other.lineSlope()) + other.start.getX();\r\n Point interPoint = new Point(Math.round(interX), Math.round(interY));\r\n if (Math.min(this.start().getX(), this.end().getX()) <= interX\r\n && interX <= Math.max(this.start().getX(), this.end().getX())) {\r\n return interPoint;\r\n }\r\n }\r\n return null;\r\n // other line is horizontal\r\n } else if (m2 == 0) {\r\n // y value of potential intersection point\r\n interY = this.start.getY();\r\n if ((Math.min(this.start().getY(), this.end().getY()) <= interY\r\n && interY <= Math.max(this.end().getY(), this.start().getY()))) {\r\n interX = ((interY - this.start.getY()) / this.lineSlope()) + this.start.getX();\r\n Point interPoint = new Point(Math.round(interX), Math.round(interY));\r\n if (Math.min(other.start().getX(), other.end().getX()) <= interX\r\n && interX <= Math.max(other.start().getX(), other.end().getX())) {\r\n return interPoint;\r\n }\r\n }\r\n return null;\r\n // lines are not horizontal or vertical\r\n } else {\r\n interX = (b1 - b2) / (m2 - m1);\r\n interY = (m1 * (interX - this.start.getX())) + this.start.getY();\r\n Point interPoint = new Point(Math.round(interX), Math.round(interY));\r\n if (Math.min(other.start().getX(), other.end().getX()) <= interX\r\n && interX <= Math.max(other.start().getX(), other.end().getX())\r\n || (Math.min(this.start().getX(), this.end().getX()) <= interX\r\n && interX <= Math.max(this.start().getX(), this.end().getX()))) {\r\n return interPoint;\r\n }\r\n }\r\n return null;\r\n }", "public static boolean pointIn(int a, int b, int point) {\n return point>a && point<b;\n }", "public static boolean onVerticalLine(Point p1, Point p2) {\n return (p1.getX() - p2.getX()) == 0;\n }", "public static boolean onHorizontalLine(Point p1, Point p2) {\n return (p1.getY() - p2.getY()) == 0;\n }", "private boolean isPointOnLine(Location loc, Line line) {\n\n\n //System.out.println(\"SX: \"+line.getStart().getxCoord()+\" SY: \"+line.getStart().getyCoord()+\" EX: \"+line.getEnd().getxCoord()+\" EY: \"+line.getEnd().getyCoord());\n //System.out.println(\"Weight: \" + line.getWeight());\n if (isInBounds(loc, line)) {\n Vector edge = new Vector(line.getStart(), line.getEnd());\n Vector click = new Vector(line.getStart(), loc);\n\n double weight = line.getWeight();\n if (weight <= 5) {\n weight = 12;\n }\n\n double scalarProj = click.scalarProjection(edge); // scalar project of click onto edge\n double yCompClick = Math.sqrt(Math.pow(click.magntiude(), 2) - Math.pow(scalarProj, 2)); // get y component of clicked location\n //System.out.println(\"Click Magnitude: \" + click.magntiude() + \" Scalar Projection: \" + scalarProj + \" yComponent of Click: \" + yCompClick);\n\n return (yCompClick <= weight / 2);\n }\n return false;\n\n\n\n }", "public boolean doLinesOverlap(Line2d line, Line2d otherLine)\n\t{\n\t\tdouble angle = (line.angle(otherLine));\n\t\tif(Gtk.epsilonEquals(angle, Math.PI/2)) return false;\n\t\tif (!Gtk.epsilonEquals(angle, Math.PI) \n\t\t\t\t|| !Gtk.epsilonEquals(angle, 0.0))\t\t\n\t\t{\n\t\t\tLine2d pLine = new Line2d (otherLine.getDirection(), line.getStartPoint());\n\t\t\tPoint2d pp = pLine.projectPoint(line.getEndPoint());\n\t\t\tpLine.setEndPoint(pp);\n\t\t\tline = pLine;\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tLine2d line1 = \n\t\t\t\tnew Line2d(line.pointOnLine(0.001), \n\t\t\t\t\t\tline.pointOnLine(line.factorForPoint(line.getEndPoint()) - 0.001));\n\t\t\t//the above line of code ensures that two lines with exactly one\n\t\t\t//end point (and no other overlap) are not returned, e.g.\n\t\t\t//Line1[(0.0, 0.0), (1.0, 0.0)] and Line2[(1.0, 1.0),(2.0, 1.0)]\n\t\t\tPoint2d lspp = otherLine.projectPoint(line1.getStartPoint());\n\t\t\tPoint2d lepp = otherLine.projectPoint(line1.getEndPoint());\n\t\t\tPoint2d olspp = line1.projectPoint(otherLine.getStartPoint());\n\t\t\tPoint2d olepp = line1.projectPoint(otherLine.getEndPoint());\n\t\t\t\n\t\t\treturn ((line1.isPointOnCurve(olspp)) \n\t\t\t\t\t|| line1.isPointOnCurve(olepp))\t|| \n\t\t\t\t\t((otherLine.isPointOnCurve(lspp)) \n\t\t\t\t\t\t\t|| otherLine.isPointOnCurve(lepp));\n\t\t}\n\t\tcatch (GeometryException ile)\n\t\t{\n\t\t\tile.printStackTrace();\n\t\t}\t\t\n\t\treturn false;\n\t}", "public static Boolean PointIsLeftOf(final Point point, final Point lineStart, final Point lineEnd) {\n Vector PS = Vector(lineStart, point), PQ = Vector(lineStart, lineEnd);\n return (dotProduct(PS, PQ) > 0);\n }", "public boolean passedBy(Line2D path) {\n\t\tfor (int i = 0; i < coordinates.size() - 1; i++) {\n\t\t\tvar p1 = coordinates.get(i);\n\t\t\tvar p2 = coordinates.get(i + 1);\n\t\t\tLine2D buildingEdge = new Line2D.Double(p1.getLng(), p1.getLat(), p2.getLng(), p2.getLat()); // x1, y1, x2, y2 \n\t\t\tif (buildingEdge.intersectsLine(path)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isIntersectLineInMiddle(Line line) {\n\t\tdouble a = subFloat(firstPoint.y, secondPoint.y); // a = firstPoint.y - secondPoint.y\n\t\tdouble b = subFloat(secondPoint.x, firstPoint.x); // b = secondPoint.x - firstPoint.x\n\t\tdouble c = subFloat(multiFloat(-a, firstPoint.x), multiFloat(b, firstPoint.y));\n\t\t// c = -a * firstPoint.x - b * firstPoint.y\n\n\t\tdouble aLine = subFloat(line.firstPoint.y, line.secondPoint.y); // aLine = line.firstPoint.y -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// line.secondPoint.y\n\t\tdouble bLine = subFloat(line.secondPoint.x, line.firstPoint.x); // bLine = line.secondPoint.x -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// line.firstPoint.x\n\t\tdouble cLine = subFloat(multiFloat(-aLine, line.firstPoint.x), multiFloat(bLine, line.firstPoint.y));\n\t\t// cLine = -aLine * line.firstPoint.x - bLine * line.firstPoint.y\n\n\t\t// 4 points on same line\n\t\t// (a * line.firstPoint.x + b * line.firstPoint.y + c == 0) &&\n\t\t// (a * line.secondPoint.x + b * line.secondPoint.y + c == 0)\n\t\tif ((addFloat(multiFloat(a, line.firstPoint.x), multiFloat(b, line.firstPoint.y), c) == 0)\n\t\t\t\t&& (addFloat(multiFloat(a, line.secondPoint.x), multiFloat(b, line.secondPoint.y), c) == 0)) {\n\t\t\tif ((firstPoint.distanceFrom(line.firstPoint) >= getLength()\n\t\t\t\t\t&& firstPoint.distanceFrom(line.secondPoint) >= this.getLength())\n\t\t\t\t\t|| (secondPoint.distanceFrom(line.firstPoint) >= this.getLength()\n\t\t\t\t\t\t\t&& secondPoint.distanceFrom(line.secondPoint) >= this.getLength()))\n\t\t\t\treturn false;\n\t\t\treturn true;\n\t\t}\n\n\t\t// ((a * line.firstPoint.x + b * line.firstPoint.y + c) * (a *\n\t\t// line.secondPoint.x + b * line.secondPoint.y + c) < 0) &&\n\t\t// ((aLine * firstPoint.x + bLine * firstPoint.y + cLine) * (aLine *\n\t\t// secondPoint.x + bLine * secondPoint.y + cLine) < 0)\n\t\tif ((multiFloat(addFloat(multiFloat(a, line.firstPoint.x), multiFloat(b, line.firstPoint.y), c),\n\t\t\t\taddFloat(multiFloat(a, line.secondPoint.x), multiFloat(b, line.secondPoint.y), c)) < 0)\n\t\t\t\t&& (multiFloat(addFloat(multiFloat(aLine, firstPoint.x), multiFloat(bLine, firstPoint.y), cLine),\n\t\t\t\t\t\taddFloat(multiFloat(aLine, secondPoint.x), multiFloat(bLine, secondPoint.y), cLine)) < 0))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public boolean isLineCrossing(Simple2DPoint start, Simple2DPoint end) {\n\n\t\tLog.info(\"Does line:\"+start+\">\"+end+\" cross or is within box \"+this.toString());\n\n\t\t//TODO: we need to write a method that returns true or false depending if the line crosses this box\n\n\t\t//first check if either end of the line is inside\n\t\t//(in most cases this will be good enough)\n\t\tif (isPointInside(topleft.x, topleft.y)){\n\t\t\tLog.info(\"___________________contained within\");\n\t\t\treturn true;\n\t\t}\n\t\tif (isPointInside(end.x, end.y)){\n\t\t\tLog.info(\"___________________contained within\");\n\t\t\treturn true;\n\t\t}\n\n\t\t//Now we check if the line cross's the box, but doesnt end in it.\n\t\t//For collision detection this should be a lot less likely then the above, as it means a character has somehow ended up on either\n\t\t//side of a objects collision map at the same time.\n\n\t\t//We check for crossing lines by checking each side of this box as its own line against the supplied line.\n\t\t//Effectively making 4 separate \"is line crossing line\" tests\n\n\t\t//first we get the 4 corners of the box from the two we know already\n\t\tSimple2DPoint topLeft = topleft;\n\t\tSimple2DPoint topRight = new Simple2DPoint(bottomright.x,topleft.y);\n\t\tSimple2DPoint bottomLeft = new Simple2DPoint(topleft.x,bottomright.y);\n\t\tSimple2DPoint bottomRight = bottomright;\n\n\t\t//then we test each side against the supplied line\n\t\tSimple2DPoint intersectPoint = Polygon.lineIntersect2d(start, end, topLeft, topRight);\n\t\tif (intersectPoint!=null){\n\t\t\treturn true;\n\t\t}\n\n\t\tintersectPoint =Polygon.lineIntersect2d(start, end, topRight, bottomRight);\n\t\tif (intersectPoint!=null){\n\t\t\treturn true;\n\t\t}\n\n\t\tintersectPoint = Polygon.lineIntersect2d(start, end, bottomRight, bottomLeft);\n\t\tif (intersectPoint!=null){\n\t\t\treturn true;\n\t\t}\n\n\t\tintersectPoint = Polygon.lineIntersect2d(start, end, bottomLeft, topLeft);\n\t\tif (intersectPoint!=null){\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t\t\n\t}", "public LineRelation lineLineRelation(Coordinates line1PointA, Coordinates line1PointB,\n Coordinates line2PointA, Coordinates line2PointB);", "public Line(Point startingPoint, Point endingPoint) {\n this.startingPoint = startingPoint;\n this.endingPoint = endingPoint;\n }", "@Override\n public boolean isPointInPath(double x, double y) {\n return graphicsEnvironmentImpl.isPointInPath(canvas, x, y);\n }", "public abstract boolean containsPoint(int x, int y);", "public abstract boolean getEdge(Point a, Point b);", "public LineRelation lineSegmentRelation(Coordinates linePointA, Coordinates linePointB,\n Coordinates segmExtremityA, Coordinates segmExtremityB);", "public boolean containsPoint(Point pt)\n {\n\n // E[O(log(n))]\n if(_lineBVH != null)\n {\n throw new Error(\"Implement me Please!\");\n }\n else\n {\n // O(n).\n return _point_in_polygon_test(pt);\n }\n }", "@Override\n public boolean contains(Line l) {\n int maxLineX = Math.max(l.p1.x, l.p2.x);\n int minLineX = Math.min(l.p1.x, l.p2.x);\n int maxLineY = Math.max(l.p1.y, l.p2.y);\n int minLineY = Math.min(l.p1.y, l.p2.y);\n\n double[] lineEq = calculateLineEquation(l.p1, l.p2);\n double leftIntersectionX = xIntersection(lineEq, topLeftCorner.y);\n // the line intersects the left side of the square within bounds\n if (topLeftCorner.x <= leftIntersectionX && leftIntersectionX <= bottomRightCorner.x\n && minLineX <= leftIntersectionX && leftIntersectionX <= maxLineX) {\n return true;\n }\n\n double rightIntersectionX = xIntersection(lineEq, bottomRightCorner.y);\n // the line intersects the right side of the square within bounds\n if (topLeftCorner.x <= rightIntersectionX && rightIntersectionX <= bottomRightCorner.x\n && minLineX <= rightIntersectionX && rightIntersectionX <= maxLineX) {\n return true;\n }\n\n double topIntersectionY = yIntersection(lineEq, topLeftCorner.x);\n // the line intersects the top side of the square within bounds\n if (topLeftCorner.y <= topIntersectionY && topIntersectionY <= bottomRightCorner.y\n && minLineY <= topIntersectionY && topIntersectionY <= maxLineY) {\n return true;\n }\n\n double bottomIntersectionY = yIntersection(lineEq, bottomRightCorner.x);\n // the line intersects the bottom side of the square within bounds\n if (topLeftCorner.y <= bottomIntersectionY && bottomIntersectionY <= bottomRightCorner.y\n && minLineY <= bottomIntersectionY && bottomIntersectionY <= maxLineY) {\n return true;\n }\n\n return false;\n\n }", "private Point[] getBresenhamLine(Point p0, Point p1, int lineWidth) {\n int x0 = p0.X;\n int y0 = p0.Y;\n int x1 = p1.X;\n int y1 = p1.Y;\n\n // Calculate the distance between the 2 points for x and y\n int dx = Math.abs(x1 - x0);\n int dy = Math.abs(y1 - y0);\n\n // Define a direction to move\n int sx = x0 < x1 ? 1 : -1;\n int sy = y0 < y1 ? 1 : -1;\n\n // \n int err = dx - dy;\n\n List<Point> points = new ArrayList();\n\n while (true) {\n // Add the current point to the list\n points.add(new Point(x0, y0));\n for (int i = 0; i < lineWidth / 2; i++) {\n points.add(new Point(x0 + sx * i, y0));\n points.add(new Point(x0 - sx * i, y0));\n\n points.add(new Point(x0, y0 + sy * i));\n points.add(new Point(x0, y0 - sy * i));\n\n points.add(new Point(x0 + sx * i, y0 + sy * i));\n points.add(new Point(x0 - sx * i, y0 + sy * i));\n points.add(new Point(x0 + sx * i, y0 - sy * i));\n points.add(new Point(x0 - sx * i, y0 - sy * i));\n }\n\n // If the current point equals to the end position, break the loop\n if (x0 == x1 && y0 == y1) {\n break;\n }\n\n int e2 = 2 * err;\n if (e2 > -dy) {\n err = err - dy;\n x0 = x0 + sx;\n }\n if (e2 < dx) {\n err = err + dx;\n y0 = y0 + sy;\n }\n }\n\n Set<Point> uniquePoints = new HashSet<>(points);\n\n return uniquePoints.toArray(new Point[uniquePoints.size()]);\n }", "public PointRelation pointSegmentRelation(Coordinates point, Coordinates segmExtremityA, Coordinates segmExtremityB);", "public boolean intersects(GLineSegment lineSegment) {\n if(this.equals(lineSegment)) return(true);\n else if(this.slope()==lineSegment.slope()) return(false);\n else {\n //complicated stuff here.\n return(false);\n }\n }", "public Line(Point start, Point end) {\r\n this.start = new Point(start.getX(), start.getY());\r\n this.end = new Point(end.getX(), end.getY());\r\n if (this.start.getX() > this.end.getX()) {\r\n // swap points because end is left then start\r\n Point temp = this.start;\r\n this.start = this.end;\r\n this.end = temp;\r\n }\r\n }", "public boolean equals(Object lineSegment) {\n try {\n GLineSegment temp=(GLineSegment) lineSegment;\n return(( (this.point1.equals(temp.getFirstPoint())) &&\n (this.point2.equals(temp.getSecondPoint())) ) ||\n ( (this.point1.equals(temp.getSecondPoint())) &&\n (this.point2.equals(temp.getFirstPoint())) )); \n }\n catch(Exception e) {\n return(false);\n }\n }", "@Deprecated\r\n public LineIntersect intersectionOLD(Line2D line, Vector2f pIntersectPoint) {\r\n float Ay_minus_Cy = pointA.y - line.getPointA().y;\r\n float Dx_minus_Cx = line.getPointB().x - line.getPointA().x;\r\n float Ax_minus_Cx = pointA.x - line.getPointA().x;\r\n float Dy_minus_Cy = line.getPointB().y - line.getPointA().y;\r\n float Bx_minus_Ax = pointB.x - pointA.x;\r\n float By_minus_Ay = pointB.y - pointA.y;\r\n\r\n java.awt.geom.Line2D l1 = new java.awt.geom.Line2D.Float(this.pointA.x, this.pointA.y, this.pointB.x, this.pointB.y);\r\n if (l1.intersectsLine(line.getPointA().x, line.getPointA().y, line.getPointB().x, line.getPointB().y)) //return LINE_CLASSIFICATION.LINES_INTERSECT;\r\n {\r\n System.out.println(\"They intersect\");\r\n } else //return LINE_CLASSIFICATION.COLLINEAR;\r\n {\r\n System.out.println(\"They DO NOT intersect\");\r\n }\r\n\r\n float Numerator = (Ay_minus_Cy * Dx_minus_Cx) - (Ax_minus_Cx * Dy_minus_Cy);\r\n float Denominator = (Bx_minus_Ax * Dy_minus_Cy) - (By_minus_Ay * Dx_minus_Cx);\r\n\r\n // if lines do not intersect, return now\r\n if (Denominator != 0.0f) {\r\n if (Numerator != 0.0f) {\r\n System.out.println(\"App says They DO NOT intersect\");\r\n return LineIntersect.CoLinear;\r\n }\r\n System.out.println(\"App says They DO NOT intersect\");\r\n return LineIntersect.Parallel;\r\n }\r\n\r\n float FactorAB = Numerator / Denominator;\r\n float FactorCD = ((Ay_minus_Cy * Bx_minus_Ax) - (Ax_minus_Cx * By_minus_Ay)) / Denominator;\r\n\r\n // posting (hitting a vertex exactly) is not allowed, shift the results\r\n // if they are within a minute range of the end vertices\r\n// if (fabs(FactorCD) < 1.0e-6f) {\r\n// FactorCD = 1.0e-6f;\r\n// }\r\n// if (fabs(FactorCD - 1.0f) < 1.0e-6f) {\r\n// FactorCD = 1.0f - 1.0e-6f;\r\n// }\r\n\r\n // if an intersection point was provided, fill it in now\r\n if (pIntersectPoint != null) {\r\n pIntersectPoint.x = (pointA.x + (FactorAB * Bx_minus_Ax));\r\n pIntersectPoint.y = (pointA.y + (FactorAB * By_minus_Ay));\r\n }\r\n\r\n System.out.println(\"App says They DO intersect\");\r\n // now determine the type of intersection\r\n if ((FactorAB >= 0.0f) && (FactorAB <= 1.0f) && (FactorCD >= 0.0f) && (FactorCD <= 1.0f)) {\r\n return LineIntersect.SegmentsIntersect;\r\n } else if ((FactorCD >= 0.0f) && (FactorCD <= 1.0f)) {\r\n return (LineIntersect.ABisectsB);\r\n } else if ((FactorAB >= 0.0f) && (FactorAB <= 1.0f)) {\r\n return (LineIntersect.BBisectsA);\r\n }\r\n\r\n return LineIntersect.LinesIntersect;\r\n }", "private boolean isHorizantalLines2Points(Point p1, Point p2) {\n\n if (abs(p1.y - p2.y ) < 70 && p1.x != p2.x) {\n return true;\n }\n return false;\n }", "static void line() {\n int x1, x2, y1, y2;\n String m = \"\";\n \n System.out.print(\"Enter point 1: \");\n y1 = scan.nextInt(); x1 = scan.nextInt(); scan.nextLine();\n\n System.out.print(\"Enter point 2: \");\n y2 = scan.nextInt(); x2 = scan.nextInt(); scan.nextLine();\n\n if ( ! lineBetween(x1, y1, x2, y2) ) m = \" not\";\n\n System.out.printf(\"Point 2 is%s visible from point 1.\\n\", m);\n }", "public boolean locatePoint(Point2D p, VisualItem item) {\n Shape s = getShape(item);\n if ( s == null ) {\n return false;\n } else {\n double width = Math.max(2, getLineWidth(item));\n double halfWidth = width/2.0;\n \n EdgeItem edge = (EdgeItem)item;\n CallEdge callEdge = ReacherDisplay.Instance.getCallEdge(item);\n \n boolean retVal;\n //if (callEdge.isBranching())\n //{\n \tretVal = line1.intersects(p.getX()-halfWidth, p.getY()-halfWidth, width,width) || \n \t\t\tline2.intersects(p.getX()-halfWidth, p.getY()-halfWidth, width,width);\n /*}\n else\n {\n \tretVal = curve.intersects(p.getX()-halfWidth, p.getY()-halfWidth, width,width);\n } */ \n return retVal;\n }\n }", "private boolean isVerticalLines2points(Point p1, Point p2) {\n if (abs(p1.x - p2.x ) < 70 && p1.y != p2.y ) {\n\n return true;\n }\n return false;\n }", "public LineIntersect intersect(Line2D other, Vector2f intersectionPoint) {\r\n float denom = (other.pointB.y - other.pointA.y) * (this.pointB.x - this.pointA.x)\r\n - (other.pointB.x - other.pointA.x) * (this.pointB.y - this.pointA.y);\r\n float u0 = (other.pointB.x - other.pointA.x) * (this.pointA.y - other.pointA.y)\r\n - (other.pointB.y - other.pointA.y) * (this.pointA.x - other.pointA.x);\r\n float u1 = (other.pointA.x - this.pointA.x) * (this.pointB.y - this.pointA.y)\r\n - (other.pointA.y - this.pointA.y) * (this.pointB.x - this.pointA.x);\r\n\r\n //if parallel\r\n if (denom == 0.0f) {\r\n //if collinear\r\n if (u0 == 0.0f && u1 == 0.0f) {\r\n return LineIntersect.CoLinear;\r\n } else {\r\n return LineIntersect.Parallel;\r\n }\r\n } else {\r\n //check if they intersect\r\n u0 = u0 / denom;\r\n u1 = u1 / denom;\r\n\r\n float x = this.pointA.x + u0 * (this.pointB.x - this.pointA.x);\r\n float y = this.pointA.y + u0 * (this.pointB.y - this.pointA.y);\r\n\r\n if (intersectionPoint != null) {\r\n intersectionPoint.x = x; //(m_PointA.x + (FactorAB * Bx_minus_Ax));\r\n intersectionPoint.y = y; //(m_PointA.y + (FactorAB * By_minus_Ay));\r\n }\r\n\r\n // now determine the type of intersection\r\n if ((u0 >= 0.0f) && (u0 <= 1.0f) && (u1 >= 0.0f) && (u1 <= 1.0f)) {\r\n return LineIntersect.SegmentsIntersect;\r\n } else if ((u1 >= 0.0f) && (u1 <= 1.0f)) {\r\n return (LineIntersect.ABisectsB);\r\n } else if ((u0 >= 0.0f) && (u0 <= 1.0f)) {\r\n return (LineIntersect.BBisectsA);\r\n }\r\n\r\n return LineIntersect.LinesIntersect;\r\n }\r\n }", "public boolean contains2(DecimalPosition position) { // TODO rename: ???\n return position != null && position.getX() >= start.getX() && position.getY() >= start.getY() && position.getX() <= end.getX() && position.getY() <= end.getY();\n }", "public boolean isIntersectLine(Point p1, Point p2) {\n\t\t// Find the four orientations needed for general and special cases\n\t\tint o1 = orientation(firstPoint, secondPoint, p1);\n\t\tint o2 = orientation(firstPoint, secondPoint, p2);\n\t\tint o3 = orientation(p1, p2, firstPoint);\n\t\tint o4 = orientation(p1, p2, secondPoint);\n\n\t\t// General case\n\t\tif (o1 != o2 && o3 != o4) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Special Cases\n\t\t// p1, q1 and p2 are collinear and p2 lies on segment p1q1\n\t\tif (o1 == 0 && p1.onSegment(firstPoint, secondPoint)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// p1, q1 and p2 are collinear and q2 lies on segment p1q1\n\t\tif (o2 == 0 && p2.onSegment(firstPoint, secondPoint)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// p2, q2 and p1 are collinear and p1 lies on segment p2q2\n\t\tif (o3 == 0 && firstPoint.onSegment(p1, p2)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// p2, q2 and q1 are collinear and q1 lies on segment p2q2\n\t\tif (o4 == 0 && secondPoint.onSegment(p1, p2)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Or else\n\t\treturn false;\n\t}", "private void drawConnectLine(double[] startPoint, double[] endPoint, Color color) {\r\n\t\tdouble startX = startPoint[0];\r\n\t\tdouble startY = startPoint[1];\r\n\t\t\r\n\t\tdouble endX = endPoint[0];\r\n\t\tdouble endY = endPoint[1];\r\n\t\t\r\n\t\tGLine line = new GLine();\r\n\t\tline.setStartPoint(startX, startY);\r\n\t\tline.setEndPoint(endX, endY);\r\n\t\tline.setColor(color);\r\n\t\tadd(line);\r\n\t}", "public boolean contains(Point p);", "public void drawLine(Point2D startPoint, Point2D endPoint, double lineStroke, int EndType);", "@Test\n\t\tpublic void testIntersectAtEndPoints2(){\n\t\t\tGenericLineSegmentsIntersect v=new GenericLineSegmentsIntersect();\n\t\t\tint[][] lines={\n\t\t\t\t\t{1,5,5,1},\n\t\t\t\t\t{1,4,5,0},\n\t\t\t\t\t{2,2,6,10}\n\t\t\t};\n\n\t\t\tassertTrue(v.intersects(lines));\n\t\t}", "public static int sameSegment(Line2D line,Point2D pb0, Point2D pb1) {\r\n return sameSegment(line.getP1(), line.getP2(), pb0, pb1);\r\n }", "@Test\n\tpublic void testContains() {\n\t\tLine l1 = new Line(0, 0, 1, 0);\n\t\tLine l2 = new Line(0, 0, 0, 1);\n\t\tLine l3 = new Line(0, 0, 1, 1);\n\t\tLine l4 = new Line(2.65, 0.3, 2.65, 0.9);\n\n\t\tassertTrue(\"l1 does not contain point (0.5, 0)\",\n\t\t\t\tl1.contains(new Coord(0.5, 0)));\n\t\tassertTrue(\"l2 does not contain point (0, 0.5)\",\n\t\t\t\tl2.contains(new Coord(0, 0.5)));\n\t\tassertTrue(\"l3 does not contain point (0.5, 0.5)\",\n\t\t\t\tl3.contains(new Coord(0.5, 0.5)));\n\n\t\tassertTrue(\n\t\t\t\t\"l4 does not contain (2.6499999999999995, 0.46083784792155075)\",\n\t\t\t\tl4.contains(new Coord(2.6499999999999995, 0.46083784792155075)));\n\n\t\t// Check endpoints for l1\n\t\tassertTrue(\"l1 does not contain point (0, 0)\",\n\t\t\t\tl1.contains(new Coord(0, 0)));\n\t\tassertTrue(\"l1 does not contain point (1, 0)\",\n\t\t\t\tl1.contains(new Coord(1, 0)));\n\t}", "private static boolean isPointRightOfLine(LineSegment a, Point2D b) {\r\n\t // Move the image, so that a.first is on (0|0)\r\n\t LineSegment aTmp = new LineSegment(new PointDouble(0, 0), new PointDouble(\r\n\t a.endPoint.getX() - a.startPoint.getX(), a.endPoint.getY() - a.startPoint.getY()));\r\n\t PointDouble bTmp = new PointDouble(b.getX() - a.startPoint.getX(), b.getY() - a.startPoint.getY());\r\n\t return crossProduct(aTmp.endPoint, bTmp) < 0;\r\n\t}", "public boolean equals(Line other) {\n if(this.getStartDot().equals(other.getStartDot()) && this.getEndDot().equals(other.getEndDot()))\n \treturn true;\n else {\n\t\t\treturn false;\n\t\t}\n\t}", "public void paintLine(Point2D pt1, Point2D pt2, Graphics graphics) {\n Graphics2D g = (Graphics2D) graphics;\n g.setXORMode(java.awt.Color.lightGray);\n g.setColor(java.awt.Color.darkGray);\n if (pt1 != null && pt2 != null) {\n // the line connecting the segments\n OMLine cLine = new OMLine((float) pt1.getY(), (float) pt1.getX(), (float) pt2.getY(), (float) pt2.getX(), lineType);\n // get the map projection\n Projection proj = theMap.getProjection();\n // prepare the line for rendering\n cLine.generate(proj);\n // render the line graphic\n cLine.render(g);\n }\n }", "public boolean doesLineCut(Line line) {\n if (containsExclusive(line.getPoint1())) {\n return true;\n }\n if (containsExclusive(line.getPoint2())) {\n return true;\n }\n\n double x1 = Math.min(line.getPoint1().getX(), line.getPoint2().getX());\n double x2 = Math.max(line.getPoint1().getX(), line.getPoint2().getX());\n double y1 = Math.min(line.getPoint1().getY(), line.getPoint2().getY());\n double y2 = Math.max(line.getPoint1().getY(), line.getPoint2().getY());\n\n // y = mx + c\n // x = (y-c)/m\n double m = (line.getPoint2().getY() - line.getPoint1().getY()) / (line.getPoint2().getX() - line.getPoint1().getX());\n double c = line.getPoint1().getY() - (m * line.getPoint1().getX());\n\n double xNorth = Double.NaN;\n double xSouth = Double.NaN;\n double yWest = Double.NaN;\n double yEast = Double.NaN;\n if (Double.isInfinite(m)) {\n // Vertical line\n xNorth = x1;\n xSouth = x1;\n } else if (m == 0.0) {\n yWest = c;\n yEast = c;\n } else {\n xNorth = ((double) start.getY() - c) / m;\n xSouth = ((double) end.getY() - 1 - c) / m;\n yWest = m * (double) start.getX() + c;\n yEast = m * (double) end.getX() - 1 + c;\n }\n\n\n // Since both points are outside the rectangle, one crossed edged is enough.\n\n // Check north\n if (!Double.isNaN(xNorth) && start.getX() <= xNorth && xNorth < end.getX() && x1 <= xNorth && xNorth <= x2 && y2 > start.getY() && y1 < end.getY()) {\n return true;\n }\n // Check east\n if (!Double.isNaN(yWest) && start.getY() <= yWest && yWest < end.getY() && y1 <= yWest && yWest <= y2 && x2 > start.getX() && x1 < end.getX()) {\n return true;\n }\n // Check south\n if (!Double.isNaN(xSouth) && start.getX() <= xSouth && xSouth < end.getX() && x1 <= xSouth && xSouth <= x2 && y2 > start.getY() && y1 < end.getY()) {\n return true;\n }\n // Check west\n return !Double.isNaN(yEast) && start.getY() <= yEast && yEast < end.getY() && y2 <= yEast && yEast <= y2 && x2 > start.getX() && x1 < end.getX();\n }", "@InterestingAlgorithm\r\n public Object lineIntersect (Line2D l1, Line2D l2) {\r\n if (l1 == null || l2 == null)\r\n return (null);\r\n\r\n double slope1 = l1.getA();\r\n double slope2 = l2.getA();\r\n\r\n double offset1 = l1.getB();\r\n double offset2 = l2.getB();\r\n\r\n if (MathUtils.closeEnough(slope1, slope2)) {\r\n if (MathUtils.closeEnough(offset1, offset2))\r\n return (l1); // same\r\n else\r\n return (null); // parallel\r\n }\r\n\r\n Point2D point = new Point2D.Double((offset2 - offset1) / (slope1 - slope2), (slope1 * offset2 - slope2 * offset1) / (slope1 - slope2));\r\n\r\n return (point);\r\n }", "public CFWRect intersectsLine( CFWPoint poiBegI, CFWPoint poiEndI)\t{\r\n\t\t//1.rejust rect\r\n\t\t//correct: (m_poiLT.m_fX < m_poiRB.m_fX && m_poiLT.m_fY < m_poiRB.m_fY)\r\n\t\tif(m_poiLT.m_fX > m_poiRB.m_fX && m_poiLT.m_fY > m_poiRB.m_fY)\t{\r\n\t\t\t//exchange all\r\n\t\t\tCFWPoint poiTmp = m_poiLT;\r\n\t\t\tm_poiLT = m_poiRB;\r\n\t\t\tm_poiRB = poiTmp;\r\n\t\t}\r\n\t\telse if(m_poiLT.m_fX > m_poiRB.m_fX && m_poiLT.m_fY < m_poiRB.m_fY)\t{\r\n\t\t\t//exchange X\r\n\t\t\tfloat fXTmp = m_poiLT.m_fX;\r\n\t\t\tm_poiLT.m_fX = m_poiRB.m_fX;\r\n\t\t\tm_poiRB.m_fX = fXTmp;\r\n\t\t}\r\n\t\telse if(m_poiLT.m_fX < m_poiRB.m_fX && m_poiLT.m_fY > m_poiRB.m_fY)\t{\r\n\t\t\t//exchange Y\r\n\t\t\tfloat fYTmp = m_poiLT.m_fY;\r\n\t\t\tm_poiLT.m_fY = m_poiRB.m_fY;\r\n\t\t\tm_poiRB.m_fY = fYTmp;\r\n\t\t}\r\n\t\t//2.intersect test\r\n\t\tCFWPoint poiOutOfRect = new CFWPoint();\r\n\t\tboolean bPoiInsideRect = false;\r\n\t\tCFWRect rectRet = new CFWRect();\r\n\t\tif(!checkPoiInside( poiBegI, poiEndI))\t{\r\n\t\t\t//System.out.println(\"the line has no cross point with the rectangle!\");\r\n\t\t\treturn(rectRet);\r\n\t\t}\r\n\t\telse if(!checkPoiInside( poiEndI, poiBegI))\t{\r\n\t\t\t//System.out.println(\"the line has no cross point with the rectangle!\");\r\n\t\t\treturn(rectRet);\r\n\t\t}\r\n\t\telse\t{\r\n\t\t\tif(isInsideArea( 9, poiBegI))\t{\r\n\t\t\t\tif(isInsideArea( 9, poiEndI))\t{\r\n\t\t\t\t\t//System.out.println(\"the line has no cross point with the rectangle!\");\r\n\t\t\t\t\treturn(rectRet);\r\n\t\t\t\t}\r\n\t\t\t\trectRet.m_poiLT = poiBegI;\r\n\t\t\t\tpoiOutOfRect = poiEndI;\r\n\t\t\t\tbPoiInsideRect = true;\r\n\t\t\t}\r\n\t\t\tif(isInsideArea( 9, poiEndI))\t{\r\n\t\t\t\tif(isInsideArea( 9, poiBegI))\r\n\t\t\t\t\treturn(rectRet);\r\n\t\t\t\trectRet.m_poiLT = poiEndI;\r\n\t\t\t\tpoiOutOfRect = poiBegI;\r\n\t\t\t\tbPoiInsideRect = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//3.intersect\r\n\t\t//if the line is vertical to X/Y, return the line segment\r\n\t\tif(poiEndI.m_fX == poiBegI.m_fX)\t{\r\n\t\t\tif(!bPoiInsideRect)\t{\r\n\t\t\t\trectRet.m_poiLT.m_fX = poiEndI.m_fX;\r\n\t\t\t\t//less than the m_poiLT'Y, use the m_poiLT'Y\r\n\t\t\t\trectRet.m_poiLT.m_fY = Math.max( Math.min(poiBegI.m_fY, poiEndI.m_fY), m_poiLT.m_fY);\r\n\t\t\t\t//larger than m_poiRB's Y, use the m_poiRB's Y\r\n\t\t\t\trectRet.m_poiRB.m_fY = Math.min( Math.max(poiBegI.m_fY, poiEndI.m_fY), m_poiRB.m_fY);\r\n\t\t\t}\r\n\t\t\telse\t{\r\n\t\t\t\tif(poiOutOfRect.m_fY < m_poiLT.m_fY)\r\n\t\t\t\t\trectRet.m_poiRB.m_fY = m_poiLT.m_fY;\r\n\t\t\t\telse if(poiOutOfRect.m_fY > m_poiRB.m_fY)\r\n\t\t\t\t\trectRet.m_poiRB.m_fY = m_poiRB.m_fY;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\trectRet.m_poiRB.m_fX = poiEndI.m_fX;\r\n\t\t\t\r\n\t\t}\r\n\t\telse if(poiEndI.m_fY == poiBegI.m_fY)\t{\r\n\t\t\tif(!bPoiInsideRect)\t{\r\n\t\t\t\trectRet.m_poiLT.m_fX = Math.max( Math.min( poiBegI.m_fX, poiEndI.m_fX), m_poiLT.m_fX);\r\n\t\t\t\trectRet.m_poiLT.m_fY = poiEndI.m_fY;\r\n\t\t\t\trectRet.m_poiRB.m_fX = Math.min( Math.max( poiBegI.m_fX, poiEndI.m_fX), m_poiRB.m_fX);\r\n\t\t\t}\r\n\t\t\telse\t{\r\n\t\t\t\tif(poiOutOfRect.m_fX < m_poiLT.m_fX)\r\n\t\t\t\t\trectRet.m_poiRB.m_fX = m_poiLT.m_fX;\r\n\t\t\t\telse if(poiOutOfRect.m_fX > m_poiRB.m_fX)\r\n\t\t\t\t\trectRet.m_poiRB.m_fX = m_poiRB.m_fX;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\trectRet.m_poiRB.m_fY = poiEndI.m_fY;\r\n\t\t}\r\n\t\telse\t{\r\n\t\t\t//build line function\r\n\t\t\tdouble dK = (poiEndI.m_fY - poiBegI.m_fY)/(poiEndI.m_fX - poiBegI.m_fX);\r\n\t\t\tdouble dB = poiBegI.m_fY - dK*poiBegI.m_fX;\r\n\t\t\t//find intersect points\r\n\t\t\tCFWPoint poiIntersA = new CFWPoint( m_poiLT.m_fX - 1.0f, m_poiLT.m_fY - 1.0f, 0.0f);\r\n\t\t\tCFWPoint poiIntersB = new CFWPoint( m_poiLT.m_fX - 1.0f, m_poiLT.m_fY - 1.0f, 0.0f);\r\n\t\t\tfloat fXTmpA = (float)((m_poiLT.m_fY - dB)/dK);\r\n\t\t\tfloat fXTmpB = (float)((m_poiRB.m_fY - dB)/dK);\r\n\t\t\tfloat fYTmpA = (float)(dK*m_poiLT.m_fX + dB);\r\n\t\t\tfloat fYTmpB = (float)(dK*m_poiRB.m_fX + dB);\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fXTmpA, m_poiLT.m_fX, m_poiRB.m_fX, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = fXTmpA;\r\n\t\t\t\t\tpoiIntersA.m_fY = m_poiLT.m_fY;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = fXTmpA;\r\n\t\t\t\t\tpoiIntersB.m_fY = m_poiLT.m_fY;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fXTmpB, m_poiLT.m_fX, m_poiRB.m_fX, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = fXTmpB;\r\n\t\t\t\t\tpoiIntersA.m_fY = m_poiRB.m_fY;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = fXTmpB;\r\n\t\t\t\t\tpoiIntersB.m_fY = m_poiRB.m_fY;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fYTmpA, m_poiLT.m_fY, m_poiRB.m_fY, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = m_poiLT.m_fX;\r\n\t\t\t\t\tpoiIntersA.m_fY = fYTmpA;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = m_poiLT.m_fX;\r\n\t\t\t\t\tpoiIntersB.m_fY = fYTmpA;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fYTmpB, m_poiLT.m_fY, m_poiRB.m_fY, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = m_poiRB.m_fX;\r\n\t\t\t\t\tpoiIntersA.m_fY = fYTmpB;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = m_poiRB.m_fX;\r\n\t\t\t\t\tpoiIntersB.m_fY = fYTmpB;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(bPoiInsideRect)\t{\r\n\t\t\t\tCFWVector vecBE = new CFWVector(poiOutOfRect.sub(rectRet.m_poiLT));\r\n\t\t\t\tCFWVector vecBA = new CFWVector(poiIntersA.sub(rectRet.m_poiLT));\r\n\t\t\t\tCFWVector vecBB = new CFWVector(poiIntersB.sub(rectRet.m_poiLT));\r\n\t\t\t\tif(vecBE.isSameDir_VerticalIn(vecBA))\t{\r\n\t\t\t\t\trectRet.m_poiRB = poiIntersA;\r\n\t\t\t\t}\r\n\t\t\t\telse if(vecBE.isSameDir_VerticalIn(vecBB))\t{\r\n\t\t\t\t\trectRet.m_poiRB = poiIntersB;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\t{\r\n\t\t\t\trectRet.m_poiLT = poiIntersA;\r\n\t\t\t\trectRet.m_poiRB = poiIntersB;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//last check : intersected line segment whether inside rectangle\r\n\t\tif(!isInsideArea( 9, rectRet.m_poiLT) || !isInsideArea( 9, rectRet.m_poiRB))\t{\r\n\t\t\tSystem.out.println(\"generated line segment isn't inside rectangle!\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn(rectRet);\r\n\t}", "public Coordinates inBetweenPoint(Coordinates a, Coordinates b, double ratio);", "@Override\n\tpublic boolean contains(double x, double y) {\n\t\tfor (GPoint point : points) {\n\t\t\tif (point.equals(x, y)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < size() - 1; i++) {\n\t\t\tGPoint p1 = points.get(i);\n\t\t\tGPoint p2 = points.get(i + 1);\n\t\t\tif (GLine.intersects(x, y, p1.getX(), p1.getY(), p2.getX(), p2.getY(), getLineWidth())) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean pointOnSegment(Waypoint w1, Waypoint w3, Waypoint w2){\n\t\tdouble w1x = w1.getX();\n\t\tdouble w1y = w1.getY();\n\t\tdouble w2x = w2.getX();\n\t\tdouble w2y = w2.getY();\n\t\tdouble w3x = w3.getX();\n\t\tdouble w3y = w3.getY();\n\t\t\n\t\tif (w3x <= Math.max(w1x, w2x) && w3x >= Math.min(w1x, w2x) && \n\t\t\tw3y <= Math.max(w1y, w2y) && w3y >= Math.min(w1y, w2y))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean contains(Point point) {\n\t\treturn (point.x >= getX1() && point.y >= getY1() && point.x < getX2() && point.y < getY2());\n\t}", "public static Point searchNearestEgde(Rectangle bounds, Point first, Point next) {\n\n // One offset needed to avoid intersection with the wrong line.\n if (bounds.x + bounds.width <= first.x)\n first.x = bounds.x + bounds.width - 1;\n else if (bounds.x >= first.x) first.x = bounds.x + 1;\n\n if (bounds.y + bounds.height <= first.y)\n first.y = bounds.height + bounds.y - 1;\n else if (bounds.y >= first.y) first.y = bounds.y + 1;\n\n Line2D relationLine = new Line2D.Float(first.x, first.y, next.x, next.y);\n Line2D lineTop = new Line2D.Float(bounds.x, bounds.y, bounds.x\n + bounds.width, bounds.y);\n Line2D lineRight = new Line2D.Float(bounds.x + bounds.width, bounds.y,\n bounds.x + bounds.width, bounds.y + bounds.height);\n Line2D lineBottom = new Line2D.Float(bounds.x + bounds.width, bounds.y\n + bounds.height, bounds.x, bounds.y + bounds.height);\n Line2D lineLeft = new Line2D.Float(bounds.x, bounds.y + bounds.height,\n bounds.x, bounds.y);\n\n Point2D ptIntersectTop = ptIntersectsLines(relationLine, lineTop);\n Point2D ptIntersectRight = ptIntersectsLines(relationLine, lineRight);\n Point2D ptIntersectBottom = ptIntersectsLines(relationLine, lineBottom);\n Point2D ptIntersectLeft = ptIntersectsLines(relationLine, lineLeft);\n\n // line is to infinite, we must verify that the point find interst the\n // correct edge and the relation.\n int distTop = (int) lineTop.ptSegDist(ptIntersectTop)\n + (int) relationLine.ptSegDist(ptIntersectTop);\n int distRight = (int) lineRight.ptSegDist(ptIntersectRight)\n + (int) relationLine.ptSegDist(ptIntersectRight);\n int distBottom = (int) lineBottom.ptSegDist(ptIntersectBottom)\n + (int) relationLine.ptSegDist(ptIntersectBottom);\n int distLeft = (int) lineLeft.ptSegDist(ptIntersectLeft)\n + (int) relationLine.ptSegDist(ptIntersectLeft);\n\n if (ptIntersectTop != null && distTop == 0) {\n return new Point(RelationGrip.adjust((int) ptIntersectTop.getX()),\n (int) ptIntersectTop.getY());\n\n } else if (ptIntersectRight != null && distRight == 0) {\n return new Point((int) ptIntersectRight.getX(),\n RelationGrip.adjust((int) ptIntersectRight.getY()));\n\n } else if (ptIntersectBottom != null && distBottom == 0) {\n return new Point(RelationGrip.adjust((int) ptIntersectBottom.getX()),\n (int) ptIntersectBottom.getY());\n\n } else if (ptIntersectLeft != null && distLeft == 0) {\n return new Point((int) ptIntersectLeft.getX(),\n RelationGrip.adjust((int) ptIntersectLeft.getY()));\n\n } else {\n return null; // no point found!\n }\n }", "public int pointLineTest2(Point3D a, Point3D b) {\n int flag = this.pointLineTest(a,b);\n if(a._x < b._x ) {\n if(a._x<=_x && b._x>_x) {\n if (flag == LEFT) return DOWN;\n if (flag == RIGHT) return UP;\n }\n }\n else\n if(a._x > b._x ) {\n if(b._x<=_x && a._x>_x) {\n if (flag == RIGHT) return DOWN;\n if (flag == LEFT) return UP;\n }\n }\n return flag;\n }", "public static float PointDistanceToLine(final Point point, final Point lineStart, final Point lineEnd) {\n Vector rotated = VectorTurnedLeft(Vector(lineStart, lineEnd).normal());\n Vector base = Vector(point, lineStart);\n return abs(dotProduct(base, rotated));\n }", "public boolean isOnSegment(Point2D point) {\n double x = point.getX();\n double y = point.getY();\n double val = this.a * x + this.b * y + this.c;\n if (val < 0.0) {\n val = -val;\n }\n if (val > EPS) {\n return false;\n }\n\n if ((x < (this.minx - EPS)) || (x > (this.maxx + EPS))) {\n return false;\n }\n if ((y < (this.miny - EPS)) || (y > (this.maxy + EPS))) {\n return false;\n }\n return true;\n }", "public boolean hasEdge(T beg, T end);", "public boolean whithinRectangle(Point point1, Point point2) {\n\t\treturn false;\n\t}", "public boolean isIn(Point p)\n {\n \n \treturn isIn(p.x, p.y);\n \t\n //\tboolean cond1 = false;\n // boolean cond2 = false; \n // cond1 = (p.x>=rettangoloX)&&(p.x<=(rettangoloX+larghezza));\n // cond2 = (p.y>=rettangoloY)&&(p.y<=(rettangoloY+altezza));\n // return (cond1&&cond2);\n }", "private void defineLinePoints(int x1, int y1,int x2,int y2){\n Line line1 = new Line(x1, y1, x2, y2);\n for(int i = 0; i < line1.points.size(); i++){\n super.points.add(line1.points.get(i));\n }\n }", "public void draw( Graphics graphics, Point p1, Point p2 )\n {\n Rectangle rect = panel.getVisibleRect();\n int min_x = rect.x;\n int max_x = rect.x + rect.width;\n int min_y = rect.y;\n int max_y = rect.y + rect.height;\n\n // only draw in region\n if ( p2.x >= min_x && p2.x <= max_x )\n graphics.drawLine( p2.x, min_y, p2.x, max_y);\n\n if ( p2.y >= min_y && p2.y <= max_y )\n graphics.drawLine( min_x, p2.y, max_x, p2.y);\n }", "public boolean contains(PointF point)\n {\n return contains(point.x, point.y);\n }", "public boolean reachable(Vertex start, Vertex end){\n\t\tSet<Vertex> reach = this.post(start); \n\t\treturn reach.contains(end);\n\t}", "@JsMethod(name = \"containsPoint\")\n public boolean contains(double p) {\n return p >= lo && p <= hi;\n }", "public boolean hasEdge(T begin, T end);", "public boolean isAbove( final double x, final double y ) {\n\t\t// is the line above the point?\n\t\treturn ( this.getY1() < y ) && ( this.getY2() < y );\n\t}", "static Boolean pointInPgm(int x, int y) {\n return (x >= 0 ) && (y >= 0) && (x <= pgmInf.width) && (y <= pgmInf.height);\n }", "public boolean mergeIfPossible(Line other) {\n\t\tif (hasConnection(other)) {\n\t\t\tthis.xEndValue = xEndValue > other.xEndValue ? xEndValue : other.xEndValue;\n\t\t\tthis.xStartValue = xStartValue < other.xStartValue ? xStartValue : other.xStartValue;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean intersects (UCSCGeneLine first, int start, int end){\n\t\tif (end < first.getTxStart() || start > first.getTxEnd()) return false;\n\t\treturn true;\n\t}", "private static void testAndAddLine(int x1, int y1, int x2, int y2,\n GridGraph gridGraph, GridLineSet gridLineSet) {\n \n if (gridGraph.lineOfSight(x1, y1, x2, y2)) {\n gridLineSet.addLine(x1, y1, x2, y2, Color.GREEN);\n } else {\n gridLineSet.addLine(x1, y1, x2, y2, Color.RED);\n }\n }", "public LineRelation segmentSegmentRelation(Coordinates segm1PointA, Coordinates segm1PointB,\n Coordinates segm2PointA, Coordinates segm2PointB);", "@Test\n\tpublic void testSetLinePoints() {\n\t\tPathwayModel p = new PathwayModel();\n\t\tGraphicalLine i1 = new GraphicalLine();\n\t\tLinePoint pt1 = i1.getLinePoints().get(0);\n\t\tLinePoint pt2 = i1.getLinePoints().get(1);\n\n\t\t// checks\n\t\tassertNull(i1.getPathwayModel());\n\t\tassertNull(pt1.getPathwayModel());\n\t\tassertNull(pt2.getPathwayModel());\n\n\t\t// checks\n\t\tassertFalse(p.hasPathwayObject(i1));\n\t\tassertFalse(p.getGraphicalLines().contains(i1));\n\t\tassertNull(i1.getPathwayModel());\n\t\tassertFalse(p.hasPathwayObject(pt1));\n\t\tassertFalse(p.hasPathwayObject(pt2));\n\n\t\t// set new points\n\t\tList<LinePoint> points = new ArrayList<LinePoint>();\n\t\tpt3 = i1.new LinePoint(10, 18);\n\t\tpt4 = i1.new LinePoint(20, 18);\n\t\tpoints.add(pt3);\n\t\tpoints.add(pt4);\n\t\ti1.setLinePoints(points);\n\n\t\tp.addGraphicalLine(i1);\n\n\t\t// checks\n\t\tassertTrue(p.hasPathwayObject(i1));\n\t\tassertTrue(p.getGraphicalLines().contains(i1));\n\t\tassertEquals(i1.getPathwayModel(), p);\n\t\tassertFalse(p.hasPathwayObject(pt1));\n\t\tassertFalse(p.hasPathwayObject(pt2));\n\t\tassertNull(pt1.getPathwayModel());\n\t\tassertNull(pt2.getPathwayModel());\n\t\tassertTrue(p.hasPathwayObject(pt3));\n\t\tassertTrue(p.hasPathwayObject(pt4));\n\t\tassertEquals(pt3.getPathwayModel(), p);\n\t\tassertEquals(pt4.getPathwayModel(), p);\n\t}", "public void drawLine(int x1, int y1, int x2, int y2);", "static boolean onSegment(Point p, Point q, Point r)\n {\n if (\n q.getX() <= Math.max(p.getX(), r.getX()) &&\n q.getX() >= Math.min(p.getX(), r.getX()) &&\n q.getY() <= Math.max(p.getY(), r.getY()) &&\n q.getY() >= Math.min(p.getY(), r.getY()))\n {\n return true;\n }\n return false;\n }", "public static Point2D ptIntersectsLines(Line2D line1, Line2D line2) {\n // convert line2D to point\n final Point p1 = new Point((int) line1.getP1().getX(), (int) line1.getP1()\n .getY());\n final Point p2 = new Point((int) line1.getP2().getX(), (int) line1.getP2()\n .getY());\n final Point p3 = new Point((int) line2.getP1().getX(), (int) line2.getP1()\n .getY());\n final Point p4 = new Point((int) line2.getP2().getX(), (int) line2.getP2()\n .getY());\n\n // compute intersection point between two line\n // (http://en.wikipedia.org/wiki/Line-line_intersection)\n final int denom = (p1.x - p2.x) * (p3.y - p4.y) - (p1.y - p2.y)\n * (p3.x - p4.x);\n\n // no intersection (lines //)\n if (denom == 0) return new Point2D.Float(-1.0f, -1.0f);\n\n final int x = ((p1.x * p2.y - p1.y * p2.x) * (p3.x - p4.x) - (p1.x - p2.x)\n * (p3.x * p4.y - p3.y * p4.x))\n / denom;\n final int y = ((p1.x * p2.y - p1.y * p2.x) * (p3.y - p4.y) - (p1.y - p2.y)\n * (p3.x * p4.y - p3.y * p4.x))\n / denom;\n\n return new Point2D.Float(x, y);\n }", "public boolean pointWhithin(Point point) {\n\t\treturn false;\n\t}", "private boolean extend(Line workingSet, boolean direction) {\n\n\t\tPoint next_point = get_next_point(get_next_point_guess(workingSet,\n\t\t\t\tdirection));\n\n\t\tif (next_point != null) {\n\t\t\t// Check if candidate point fits the line\n\t\t\tif (fits_the_line(next_point, workingSet, direction)) {\n\t\t\t\tworkingSet.add_point(next_point, direction);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\n\t}", "@Override\n public boolean drawPathLine(Location loc1, Location loc2) {\n if (loc1.distanceTo(loc2) < DRAW_LINE_THRESHOLD_METERS) {\n return false;\n }\n Polyline line = new Polyline();\n List<GeoPoint> points = Arrays.asList(MapUtils.makeGeoPoint(loc1), MapUtils.makeGeoPoint(loc2));\n line.setPoints(points);\n line.setColor(Color.RED);\n line.setWidth(2.0f);\n mMap.getOverlayManager().add(line);\n\n mPathLines.add(line);\n return true;\n }", "private static Point2D getIntersectionFromParallel(LineSegment A, LineSegment B)\r\n\t{\r\n\t\t// Assume two lines are parallel at this point, return the highest end point (relative) of the two lines\r\n\t\tPoint2D Alow = Utilities.isBelow(A.startPoint, A.endPoint) ? A.startPoint : A.endPoint;\r\n\t\tPoint2D Blow = Utilities.isBelow(B.startPoint, B.endPoint) ? B.startPoint : B.endPoint;\r\n\t\treturn Utilities.isBelow(Alow, Blow) ? Blow : Alow;\r\n\t\t\r\n\t}", "@Override\n public boolean contain(int x, int y) {\n return(x>=this.x && y>=this.y && x<=this.x+(int)a && y<=this.y+(int)b);\n }", "private boolean commonEndPoint (Coordinate endPoint_in, Coordinate endPoint_out) {\r\n\t\tif (endPoint_in.equals3D(endPoint_out)) {\r\n\t\t\treturn true;\r\n\t\t} else return false;\t\r\n\t}", "@Test\n\tpublic void test2PointsParallelXParallel() {\n\t\tLine2D line1 = new Line2D(new Point2D(1, 11.2), new Point2D(5, 11.2));\n\t\tLine2D line2 = new Line2D(new Point2D(100, 11), new Point2D(-55, 11));\n\t\t\n\t\tAssert.assertTrue(\"不能正常处理两点式直线平行于x轴的情况\", line1.isParallel(line2));\n\t}", "public boolean containsPoint( double px, double py ) {\r\n return (( px > drawx-getWidth()/2) && ( px < drawx+getWidth()/2) \r\n && ( py > drawy-getHeight()/2) && ( py < drawy+getHeight()/2));\r\n }", "private boolean createContractPSInvoiceLines(MContractLine contractLine, MContractPSLine contractPSLine, MContractProcPeriod baseDocContractProcPeriod)\r\n\t{\r\n\t\tMContractCalender contractCalender = MContractCalender.get(getCtx(), contractLine.getJP_ContractCalender_Inv_ID());\r\n\r\n\t\tif(contractLine.getJP_DerivativeDocPolicy_Inv().equals(MContractLine.JP_DERIVATIVEDOCPOLICY_INV_ForTheDurationOfContractProcessPeriod)\t//DD\r\n\t\t\t|| contractLine.getJP_DerivativeDocPolicy_Inv().equals(MContractLine.JP_DERIVATIVEDOCPOLICY_INV_FromStartContractProcessPeriodToEnd)//PB\r\n\t\t\t|| contractLine.getJP_DerivativeDocPolicy_Inv().equals(MContractLine.JP_DERIVATIVEDOCPOLICY_INV_FromStartContractProcessPeriod) //PS\r\n\t\t\t|| contractLine.getJP_DerivativeDocPolicy_Inv().equals(MContractLine.JP_DERIVATIVEDOCPOLICY_INV_ToEndContractProcessPeriod ) )//PE\r\n\t\t{\r\n\t\t\tMContractProcPeriod contractProcPeriod = null;\r\n\t\t\tMContractProcPeriod startContractProcPeriod = null;\r\n\t\t\tMContractProcPeriod endContractProcPeriod = null;\r\n\r\n\t\t\tif(contractLine.getJP_DerivativeDocPolicy_Inv().equals(MContractLine.JP_DERIVATIVEDOCPOLICY_INV_ForTheDurationOfContractProcessPeriod))//DD\r\n\t\t\t{\r\n\t\t\t\tstartContractProcPeriod = contractCalender.getContractProcessPeriod(getCtx(), m_ContractContent.getJP_ContractProcDate_From());\r\n\t\t\t\tendContractProcPeriod = contractCalender.getContractProcessPeriod(getCtx(), m_ContractContent.getJP_ContractProcDate_To());\r\n\r\n\t\t\t}else if(contractLine.getJP_DerivativeDocPolicy_Inv().equals(MContractLine.JP_DERIVATIVEDOCPOLICY_INV_FromStartContractProcessPeriodToEnd)) {//PB\r\n\r\n\t\t\t\tstartContractProcPeriod = MContractProcPeriod.get(getCtx(), contractLine.getJP_ProcPeriod_Start_Inv_ID());\r\n\t\t\t\tendContractProcPeriod = MContractProcPeriod.get(getCtx(), contractLine.getJP_ProcPeriod_End_Inv_ID());\r\n\r\n\t\t\t}else if(contractLine.getJP_DerivativeDocPolicy_Inv().equals(MContractLine.JP_DERIVATIVEDOCPOLICY_INV_FromStartContractProcessPeriod)) {//PS\r\n\r\n\t\t\t\tstartContractProcPeriod = MContractProcPeriod.get(getCtx(), contractLine.getJP_ProcPeriod_Start_Inv_ID());\r\n\t\t\t\tendContractProcPeriod = contractCalender.getContractProcessPeriod(getCtx(), m_ContractContent.getJP_ContractProcDate_To());\r\n\r\n\t\t\t}else if(contractLine.getJP_DerivativeDocPolicy_Inv().equals(MContractLine.JP_DERIVATIVEDOCPOLICY_INV_ToEndContractProcessPeriod)){//PE\r\n\r\n\t\t\t\tstartContractProcPeriod = contractCalender.getContractProcessPeriod(getCtx(), m_ContractContent.getJP_ContractProcDate_From());\r\n\t\t\t\tendContractProcPeriod = MContractProcPeriod.get(getCtx(), contractLine.getJP_ProcPeriod_End_Inv_ID());\r\n\t\t\t}\r\n\r\n\r\n\t\t\tint i = 1;\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\tcontractProcPeriod = contractCalender.getContractProcessPeriod(getCtx(), startContractProcPeriod.getDateDoc(), null, i);\r\n\t\t\t\tif(contractProcPeriod.isContainedBaseDocContractProcPeriod(baseDocContractProcPeriod))\r\n\t\t\t\t{\r\n\t\t\t\t\tif(i == 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(contractProcPeriod.getJP_ContractProcPeriod_ID( ) == endContractProcPeriod.getJP_ContractProcPeriod_ID())\r\n\t\t\t\t\t\t\tcreateContractPSInvoiceLine(contractLine, contractPSLine, baseDocContractProcPeriod, contractProcPeriod, true, true, i);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tcreateContractPSInvoiceLine(contractLine, contractPSLine, baseDocContractProcPeriod, contractProcPeriod, true, false, i);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tif(contractProcPeriod.getJP_ContractProcPeriod_ID( ) == endContractProcPeriod.getJP_ContractProcPeriod_ID())\r\n\t\t\t\t\t\t\tcreateContractPSInvoiceLine(contractLine, contractPSLine, baseDocContractProcPeriod, contractProcPeriod, false, true, i);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tcreateContractPSInvoiceLine(contractLine, contractPSLine, baseDocContractProcPeriod, contractProcPeriod, false, false,i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\ti++;\r\n\r\n\t\t\t}while(contractProcPeriod.getJP_ContractProcPeriod_ID( ) != endContractProcPeriod.getJP_ContractProcPeriod_ID());\r\n\r\n\t\t}else if(contractLine.getJP_DerivativeDocPolicy_Inv().equals(MContractLine.JP_DERIVATIVEDOCPOLICY_INV_LumpOnACertainPointOfContractProcessPeriod)) {//LP\r\n\r\n\t\t\tMContractProcPeriod contractProcPeriod = MContractProcPeriod.get(getCtx(), contractLine.getJP_ProcPeriod_Lump_Inv_ID());\r\n\t\t\tcreateContractPSInvoiceLine(contractLine, contractPSLine, baseDocContractProcPeriod, contractProcPeriod, true, true, 1);\r\n\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}", "public boolean isInRect2(Point p) {\n\t\tLine AB = new Line(A1, B1);\n\t\tLine CD = new Line(C1, AB.getU());\n\t\tLine AD = new Line(A1, D1);\n\t\tLine BC = new Line(B1, AD.getU());\n\n\t\t// if(Line.isBetween2Lines2(AB, CD, p))\n\t\t// System.out.println(1);\n\t\t// if(Line.isBetween2Lines2(AD, BC, p))\n\t\t// System.out.println(2);\n\n\t\tif (Line.isBetween2Lines2(AB, CD, p) && Line.isBetween2Lines2(AD, BC, p)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "private void drawLine(GraphicsContext canvas, Point start, Point end) {\n canvas.strokeLine(\n start.X, start.Y,\n end.X, end.Y\n );\n }", "public boolean line(float x0, float y0, float x1, float y1)\r\n/* 355: */ {\r\n/* 356:412 */ float dx = Math.abs(x1 - x0);\r\n/* 357:413 */ float dy = Math.abs(y1 - y0);\r\n/* 358: */ int sx;\r\n/* 359: */ int sx;\r\n/* 360:416 */ if (x0 < x1) {\r\n/* 361:418 */ sx = 1;\r\n/* 362: */ } else {\r\n/* 363:421 */ sx = -1;\r\n/* 364: */ }\r\n/* 365: */ int sy;\r\n/* 366: */ int sy;\r\n/* 367:423 */ if (y0 < y1) {\r\n/* 368:425 */ sy = 1;\r\n/* 369: */ } else {\r\n/* 370:429 */ sy = -1;\r\n/* 371: */ }\r\n/* 372:431 */ float err = dx - dy;\r\n/* 373:432 */ boolean line = true;\r\n/* 374:433 */ while (line)\r\n/* 375: */ {\r\n/* 376:435 */ float e2 = 2.0F * err;\r\n/* 377:437 */ if (e2 > -dy)\r\n/* 378: */ {\r\n/* 379:439 */ err -= dy;\r\n/* 380:440 */ x0 += sx;\r\n/* 381: */ }\r\n/* 382:442 */ if (e2 < dx)\r\n/* 383: */ {\r\n/* 384:444 */ err += dx;\r\n/* 385:445 */ y0 += sy;\r\n/* 386: */ }\r\n/* 387:448 */ line = tileWalkable(x0, y0);\r\n/* 388:451 */ if ((x0 == x1) && (y0 == y1)) {\r\n/* 389: */ break;\r\n/* 390: */ }\r\n/* 391:457 */ if (getAgentOnTile(x0, y0) != null) {\r\n/* 392:459 */ line = false;\r\n/* 393: */ }\r\n/* 394: */ }\r\n/* 395:465 */ return line;\r\n/* 396: */ }", "@Test\n\tpublic void test2PointsParallelYParallel() {\n\t\tLine2D line1 = new Line2D(new Point2D(11.2, 1), new Point2D(11.2, 5));\n\t\tLine2D line2 = new Line2D(new Point2D(21.2, 100), new Point2D(21.2, -55));\n\t\t\n\t\tAssert.assertTrue(\"不能正常处理两点式直线平行于Y轴的情况\", line1.isParallel(line2));\n\t}", "public abstract boolean hasEdge(int from, int to);", "boolean isPointEnclosed(Point p);", "public boolean inside(Point p) {\n\t\tif (p.getX() < boundingRect.getX() || p.getY() < boundingRect.getY()) return false;\n\t\tif (p.getX() > boundingRect.getX() + boundingRect.getW() || \n\t\t p.getY() > boundingRect.getY() + boundingRect.getH()) return false;\n\n\t\t// Create a line from the point to the left\n\t\tLine l = new Line(p.getX(), p.getY(), p.getX() - boundingRect.getW(), p.getY());\n\n\t\t// Count intersections\n\t\tint count= 0;\t\t\n\t\tfor(int i=0; i<lines.size(); i++ ) {\n\t\t\tif (lines.get(i).intersectsAt(l) != null) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n // We are inside if the number of intersections is odd\n\t\treturn count%2 == 1;\n\t}", "public boolean isLineInBox(final Vec3 l1, final Vec3 l2)\n {\n // Put line in box space\n Mat4 mInv = m.getInverseSimple();\n Vec4 lb1 = mInv.multiply(l1.toPoint());\n Vec4 lb2 = mInv.multiply(l2.toPoint());\n\n // Get line midpoint and extent\n Vec4 lMid = (lb1.add(lb2)).multiply(0.5f);\n Vec4 l = lb1.subtract(lMid);\n Vec3 lExt = new Vec3(abs(l.getX()), abs(l.getY()), abs(l.getZ()));\n\n // Use Separating Axis Test\n // Separation vector from box center to line center is LMid, since the line is in box space\n for (int i = 0; i < 3; i++)\n {\n if (abs(lMid.get(i)) > extents.get(i) + lExt.get(i))\n {\n return false;\n }\n }\n\n // Crossproducts of line and each axis\n if ((abs(lMid.getY() * l.getZ()) - lMid.getZ() * l.getY()) > (extents.getY() * lExt.getZ() + extents.getZ() * lExt.getY()))\n {\n return false;\n }\n if (abs(lMid.getX() * l.getZ() - lMid.getZ() * l.getX()) > (extents.getX() * lExt.getZ() + extents.getZ() * lExt.getX()))\n {\n return false;\n }\n if (abs(lMid.getX() * l.getY() - lMid.getY() * l.getX()) > (extents.getX() * lExt.getY() + extents.getY() * lExt.getX()))\n {\n return false;\n }\n // No separating axis, the line intersects\n return true;\n }", "private boolean lineline(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4){\n float uA = ((x4-x3)*(y1-y3) - (y4-y3)*(x1-x3)) / ((y4-y3)*(x2-x1) - (x4-x3)*(y2-y1));\n float uB = ((x2-x1)*(y1-y3) - (y2-y1)*(x1-x3)) / ((y4-y3)*(x2-x1) - (x4-x3)*(y2-y1));\n\n return uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1;\n }", "private boolean hasEndPoint(TileFeature featureFrom, TileFeature featureTo)\r\n\t{\r\n\t\tif(((Road)featureTo).isEndPoint())\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t{\r\n\t\t\tIterator<TileFeature> neighborIterator = featureTo.getNeighborIterator();\r\n\t\t\twhile(neighborIterator.hasNext())\r\n\t\t\t{\r\n\t\t\t\tTileFeature neighbor = neighborIterator.next();\r\n\t\t\t\tif(neighbor == featureFrom)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\telse\r\n\t\t\t\t\treturn hasEndPoint(featureTo, neighbor);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}" ]
[ "0.7292554", "0.7037531", "0.6432954", "0.623064", "0.6223124", "0.60622257", "0.6035607", "0.58801156", "0.5747179", "0.57364374", "0.56108165", "0.55510074", "0.5474533", "0.54711974", "0.5467761", "0.5408743", "0.5387884", "0.5378327", "0.53321695", "0.5323887", "0.53088456", "0.53047866", "0.53011334", "0.5298214", "0.52938294", "0.52915365", "0.52871513", "0.52821666", "0.52802205", "0.52777475", "0.52710956", "0.52529943", "0.52393717", "0.52133596", "0.5194948", "0.51720846", "0.5131492", "0.5118614", "0.51087207", "0.5094856", "0.50505334", "0.50498825", "0.50302595", "0.5010495", "0.5006268", "0.49900162", "0.49822065", "0.49672145", "0.49625614", "0.49621952", "0.49575055", "0.4952559", "0.49494386", "0.49451688", "0.4943838", "0.49385342", "0.49384093", "0.49358454", "0.49316838", "0.4922418", "0.491955", "0.49117106", "0.49049437", "0.48951572", "0.48888978", "0.48854986", "0.48753664", "0.48746702", "0.48727468", "0.48721045", "0.48551488", "0.4852198", "0.48501006", "0.48445308", "0.48276386", "0.48218372", "0.48214203", "0.4816443", "0.481635", "0.4814968", "0.4812991", "0.47916573", "0.47795793", "0.47730872", "0.476242", "0.47547406", "0.475098", "0.47490674", "0.47306353", "0.47259903", "0.47246915", "0.47197008", "0.47194198", "0.47041774", "0.47041503", "0.47024956", "0.4701789", "0.4700657", "0.46672928", "0.46648028" ]
0.8375252
0
Given a RealTimeRunManager this function builds a graph object that contains all the loaded historic data points and all the historic points from the preloaded Y line graph (if one exists). The result is a single graph that covers multiple days and can be associated with a YLine.
public static BaseGraph<AbstractGraphPoint> buildYLinePlusHistDataGraph(RealTimeRunManager manager){ BaseGraph<AbstractGraphPoint> result = null; if(null != manager){ //GetPutup Putup myPutup = manager.getMyPutup(); if(null != myPutup){ BaseGraph<AbstractGraphPoint> preLoadedYLineGraph = myPutup.getPreLoadedYLineGraph(); BaseGraph<AbstractGraphPoint> graphHistoricData = manager.getGraphHistoricData(); result = graphHistoricData.replicateGraph(); result.clear(); result.addAll(graphHistoricData); if(null != preLoadedYLineGraph && 0 < preLoadedYLineGraph.size()){ result.addAll(preLoadedYLineGraph); } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createOnce(){\n\n //Entry\n entries = new ArrayList<Entry>();\n\n //ArrayList of LineData\n lineDatas = new ArrayList<LineData>();\n\n //LineDataSet :\n dataSets = new ArrayList<LineDataSet>();\n\n\n for (int x=0; x<graphsData.size(); x++){\n\n dataSets.add(new LineDataSet(new ArrayList<Entry>(),\"Data in \" + graphsData.get(x).getMonth()));\n\n for(int i=0; i<graphsData.get(x).getMonthList().size(); i++){\n dataSets.get(x).addEntry(new Entry(i, graphsData.get(x).getMonthList().get(i).getAverage()));\n dataSets.get(x).getEntryForIndex(i).setIcon(ContextCompat.getDrawable(context,R.drawable.screen));\n }\n\n dataSets.get(x).setColor(Color.rgb(0,187,207));\n\n lineDatas.add(new LineData(dataSets.get(x)));\n\n chart.notifyDataSetChanged();\n chart.invalidate();\n\n }\n\n }", "private void initChart() {\n Cartesian cartesian = AnyChart.line();\n\n cartesian.animation(true);\n\n cartesian.padding(10d, 20d, 5d, 20d);\n\n cartesian.crosshair().enabled(true);\n cartesian.crosshair()\n .yLabel(true)\n // TODO ystroke\n .yStroke((Stroke) null, null, null, (String) null, (String) null);\n\n cartesian.tooltip().positionMode(TooltipPositionMode.POINT);\n\n cartesian.title(\"Steps taken in this week and last week\");\n\n cartesian.yAxis(0).title(\"Steps\");\n cartesian.xAxis(0).labels().padding(5d, 5d, 5d, 5d);\n\n List<DataEntry> seriesData = new ArrayList<>();\n Log.d(\"Size This Week\",stepsTakenModelsThisWeek.size()+\"\");\n for(int i = 0 ; i<7 ; i++){\n CustomDataEntry c = new CustomDataEntry(days[i],stepsTakenModelsLastWeek.get(i).getSteps());\n if(i<stepsTakenModelsThisWeek.size()){\n c.setValue(\"value2\",stepsTakenModelsThisWeek.get(i).getSteps());\n }else{\n if(DateUtilities.getDayInAbbBySelectedDate(stepsTakenModelsLastWeek.get(i).getDate()).equals(\n DateUtilities.getCurrentDayInAbb()))\n {\n c.setValue(\"value2\",stepsToday);\n }else{\n c.setValue(\"value2\",0);\n }\n }\n seriesData.add(c);\n }\n\n Set set = Set.instantiate();\n set.data(seriesData);\n Mapping series1Mapping = set.mapAs(\"{ x: 'x', value: 'value' }\");\n Mapping series2Mapping = set.mapAs(\"{ x: 'x', value: 'value2' }\");\n\n Line series1 = cartesian.line(series1Mapping);\n series1.name(\"Last Week\");\n series1.hovered().markers().enabled(true);\n series1.hovered().markers()\n .type(MarkerType.CIRCLE)\n .size(4d);\n series1.tooltip()\n .position(\"right\")\n .anchor(Anchor.LEFT_CENTER)\n .offsetX(5d)\n .offsetY(5d);\n\n Line series2 = cartesian.line(series2Mapping);\n series2.name(\"This Week\");\n series2.hovered().markers().enabled(true);\n series2.hovered().markers()\n .type(MarkerType.CIRCLE)\n .size(4d);\n series2.tooltip()\n .position(\"right\")\n .anchor(Anchor.LEFT_CENTER)\n .offsetX(5d)\n .offsetY(5d);\n\n\n cartesian.legend().enabled(true);\n cartesian.legend().fontSize(13d);\n cartesian.legend().padding(0d, 0d, 10d, 0d);\n\n chart.setChart(cartesian);\n }", "public void loadGraph() {\n\t\tJSONArray data = null;\n\n\t\tswitch (mApp.getCurrentGroupBy()) {\n\t\tcase DATE:\n\n\t\t\tdata = DataBaseUtil.fetchEntriesByDateInJSON(mContext, mType.getId());\n\t\t\tbreak;\n\n\t\tcase MAX:\n\n\t\t\tdata = DataBaseUtil.fetchEntriesByMaxInJSON(mContext, mType.getId());\n\t\t\tbreak;\n\n\t\tcase NONE:\n\t\t\tdata = DataBaseUtil.fetchEntriesInJSON(mContext, mType.getId());\n\t\t\tbreak;\n\t\t}\n\t\tloadGraph(data);\n\t}", "private void makeChart() {\n\n Log.d(\"Chart\",\"Start Chart\");\n\n ArrayList<Entry> speedList = new ArrayList<>();\n ArrayList<Entry> avgSpeedList = new ArrayList<>();\n ArrayList<Entry> avgAltList = new ArrayList<>();\n\n int numberOfValues = trackingList.size();\n\n //Fills the data in the Arrays Entry (xValue,yValue)\n for(int i = 0; i < numberOfValues;i++){\n float avgSpeed = (float)averageSpeed;\n float avgAlt = (float)averageAlt;\n float curSpeed = (float)trackingList.get(i).getSpeed();\n\n Log.d(\"Chart\",\"CurSpeed: \" +curSpeed);\n\n avgSpeedList.add(new Entry(i*3,avgSpeed));\n speedList.add(new Entry(i*3,curSpeed));\n avgAltList.add(new Entry(i*3,avgAlt));\n }\n\n ArrayList<String> xAXES = new ArrayList<>();\n\n\n String[] xaxes = new String[xAXES.size()];\n for(int i=0; i<xAXES.size();i++){\n xaxes[i] = xAXES.get(i);\n }\n\n // More than one Array (Line in the Graph)\n ArrayList<ILineDataSet> lineDataSets = new ArrayList<>();\n\n //Speed Graph setup\n LineDataSet lineDataSet1 = new LineDataSet(speedList,\"Speed\");\n lineDataSet1.setDrawCircles(false);\n lineDataSet1.setColor(Color.BLUE);\n lineDataSet1.setLineWidth(2);\n\n //AvgSpeed setup\n LineDataSet lineDataSet2 = new LineDataSet(avgSpeedList,\"AvgSpeedLine\");\n lineDataSet2.setDrawCircles(false);\n lineDataSet2.setColor(Color.RED);\n lineDataSet2.setLineWidth(3);\n\n //AvgAlt setup\n LineDataSet lineDataSet3 = new LineDataSet(avgAltList,\"AvgAltLine\");\n lineDataSet3.setDrawCircles(false);\n lineDataSet3.setColor(Color.MAGENTA);\n lineDataSet3.setLineWidth(3);\n\n //Add them to the List\n lineDataSets.add(lineDataSet1);\n lineDataSets.add(lineDataSet2);\n lineDataSets.add(lineDataSet3);\n\n //setup for the xAxis\n XAxis xAxis = lineChart.getXAxis();\n xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\n\n //Puts the data in the Graph\n lineChart.setData(new LineData(lineDataSets));\n lineChart.setVisibleXRangeMaximum(65f);\n\n //Chart description\n lineChart.getDescription().setText(\"All Speed\");\n\n //Shows timer information when clicked\n lineChart.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Toast.makeText(getApplicationContext(), \"Its measured every 3 seconds\",Toast.LENGTH_LONG).show();\n }\n });\n }", "public void refreshGraph() {\n\n // Get all the times\n double[] times = dataSet.getTimes();\n\n int numPointsToDraw = (times.length > GRAPH_MAX_POINTS)? GRAPH_MAX_POINTS: times.length;\n\n // Store new points\n DataPoint[] freshPoints = new DataPoint[numPointsToDraw];\n // String for title of graph\n final int titleString;\n // String for the y-axis of graph\n final int axisLabel;\n\n // Calculate which points to draw\n int firstPointDrawn = (times.length-GRAPH_MAX_POINTS>0)?\n times.length-GRAPH_MAX_POINTS:\n 0;\n\n // if the switch is to the right\n if(velAccelSwitch.isChecked()) {\n // Get all the accelerations\n double[] accels = dataSet.getAccelerations();\n // Add the relevant accelerations to the \"to be drawn\" array\n for (int i = 0; i < numPointsToDraw; i++) {\n freshPoints[i] = new DataPoint(\n // / If the setting tells it to be in hours, divide by 3600\n (setting.isInHours())?\n times[i+firstPointDrawn]/3600:\n times[i+firstPointDrawn], accels[i+firstPointDrawn]);\n }\n // Set the graph title\n titleString = R.string.at_graph_label;\n axisLabel = R.string.acceleration_axis_label;\n } else {\n // Get all the velocities\n double[] velocities = dataSet.getSpeeds();\n // Add the relevant velocities to the \"to be drawn\" array\n for (int i = 0; i < numPointsToDraw; i++) {\n freshPoints[i] = new DataPoint(\n // If the setting tells it to be in hours, divide by 3600\n (setting.isInHours())?\n times[i+firstPointDrawn]/3600:\n times[i+firstPointDrawn],\n // If the setting tells it to be in km/h, multiply by 3.6\n (setting.isInKMPerH())?\n velocities[i+firstPointDrawn]*3.6:\n velocities[i+firstPointDrawn]);\n }\n // Set the graph title\n titleString = R.string.vt_graph_label;\n axisLabel = (setting.isInKMPerH())?\n R.string.velocity_axis_label_kmh:\n R.string.velocity_axis_label_ms;\n }\n\n // swap out the old DataPoints with the new ones\n points.resetData(freshPoints);\n // if there is data, stretch graph to fit it\n if (times.length-1>0) {\n // If the setting is on hours, stretch graph axises accordingly\n graphView.getViewport().setMinX((times[times.length-1] - GRAPH_TIME_RANGE)\n /((setting.isInHours())?3600:1));\n graphView.getViewport().setMaxX(times[times.length-1]\n /((setting.isInHours())?3600:1));\n }\n\n // Update elements of the UI\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n DecimalFormat df = new DecimalFormat(\"#.00\");\n\n // Set graph title\n graphTitle.setText(titleString);\n // Set max velocity\n maxVelocityView.setText(getString(R.string.max_velocity) + \":\\t\\t\\t\\t\\t\\t\\t\\t\" +\n df.format(dataSet.getMaxSpeed()) + \" m/s\");\n // Set max acceleration\n maxAccelerationView.setText(getString(R.string.max_acceleration) + \":\\t\\t\\t\" +\n df.format(dataSet.getMaxAcceleration()) + \" m/s\" + '\\u00B2');\n // Set time elapsed\n timeElapsedView.setText(getString(R.string.time_elapsed) + \":\\t\\t\\t\\t\\t\\t\\t\\t\" +\n df.format(dataSet.getTimeElapsedSeconds()) + \" s\");\n yAxisView.setText(axisLabel);\n xAxisView.setText((setting.isInHours())?\n R.string.time_axis_label_h:\n R.string.time_axis_label_s);\n }\n });\n\n }", "public void updateLineChart()\r\n {\r\n hoursLoggedSeries = new XYChart.Series<>();\r\n hoursLoggedSeries.setName(Integer.toString(LocalDate.now().getYear()));\r\n lineChart.getData().clear();\r\n \r\n try{\r\n populateSeriesFromDB();\r\n }\r\n catch(SQLException e)\r\n {\r\n System.err.println(e.getMessage());\r\n }\r\n lineChart.getData().addAll(hoursLoggedSeries);\r\n }", "public LineGraphVO makeLineGraphAllSetting()\n {\n int paddingBottom \t= LineGraphVO.DEFAULT_PADDING;\n int paddingTop \t\t= LineGraphVO.DEFAULT_PADDING;\n int paddingLeft \t= LineGraphVO.DEFAULT_PADDING;\n int paddingRight \t= LineGraphVO.DEFAULT_PADDING;\n\n //graph margin\n int marginTop \t\t= LineGraphVO.DEFAULT_MARGIN_TOP;\n int marginRight \t= LineGraphVO.DEFAULT_MARGIN_RIGHT;\n\n //max value\n int maxValue \t\t= LineGraphVO.DEFAULT_MAX_VALUE;\n\n //increment\n int increment \t\t= LineGraphVO.DEFAULT_INCREMENT;\n\n //GRAPH SETTING\n String[] legendArr \t= {\"MON\",\"TUE\",\"WED\",\"THU\",\"FRI\",\"SAT\",\"SUN\"};\n float[] graph1 \t\t= {55,57,48,53,50,57,64};\n// float[] graph2 \t\t= {000,100,200,100,200};\n// float[] graph3 \t\t= {200,500,300,400,000};\n\n List<LineGraph> arrGraph \t\t= new ArrayList<LineGraph>();\n\n arrGraph.add(new LineGraph(\"android\", 0xaa66ff33, graph1, R.mipmap.ic_launcher));\n // 친구랑 경쟁 몸무게\n// arrGraph.add(new LineGraph(\"ios\", 0xaa00ffff, graph2));\n// arrGraph.add(new LineGraph(\"tizen\", 0xaaff0066, graph3));\n\n LineGraphVO vo = new LineGraphVO(\n paddingBottom, paddingTop, paddingLeft, paddingRight,\n marginTop, marginRight, maxValue, increment, legendArr, arrGraph);\n\n //set animation\n vo.setAnimation(new GraphAnimation(GraphAnimation.DEFAULT_DURATION, GraphAnimation.DEFAULT_DURATION));\n //set graph name box\n vo.setGraphNameBox(new GraphNameBox());\n //set draw graph region\n//\t\tvo.setDrawRegion(true);\n\n //use icon\n//\t\tarrGraph.add(new Graph(0xaa66ff33, graph1, R.drawable.icon1));\n//\t\tarrGraph.add(new Graph(0xaa00ffff, graph2, R.drawable.icon2));\n//\t\tarrGraph.add(new Graph(0xaaff0066, graph3, R.drawable.icon3));\n\n//\t\tLineGraphVO vo = new LineGraphVO(\n//\t\t\t\tpaddingBottom, paddingTop, paddingLeft, paddingRight,\n//\t\t\t\tmarginTop, marginRight, maxValue, increment, legendArr, arrGraph, R.drawable.bg);\n return vo;\n }", "void createGraphForSingleLoad();", "public void setLineData(ArrayList<Integer> allDay) {\r\n\r\n ArrayList<String> xVals = new ArrayList<String>();\r\n for (int i = 1; i <= 24; i++) {\r\n xVals.add((i) + \"\");\r\n }\r\n\r\n ArrayList<Entry> vals1 = new ArrayList<Entry>();\r\n\r\n for (int i = 1; i <= 24; i++) {\r\n vals1.add(new Entry(allDay.get(i-1), i));\r\n }\r\n Log.v(\"vals1\",vals1.toString());\r\n \t\r\n \t\r\n// \tint count = 45;\r\n// \tint range = 100; \r\n// \tArrayList<String> xVals = new ArrayList<String>();\r\n// for (int i = 0; i < count; i++) {\r\n// xVals.add((1990 +i) + \"\");\r\n// }\r\n//\r\n// ArrayList<Entry> vals1 = new ArrayList<Entry>();\r\n//\r\n// for (int i = 0; i < count; i++) {\r\n// float mult = (range + 1);\r\n// float val = (float) (Math.random() * mult) + 20;// + (float)\r\n// // ((mult *\r\n// // 0.1) / 10);\r\n// vals1.add(new Entry(val, i));\r\n// }\r\n// \r\n \t\r\n // create a dataset and give it a type\r\n LineDataSet set1 = new LineDataSet(vals1, \"DataSet 1\");\r\n set1.setDrawCubic(true);\r\n set1.setCubicIntensity(0.2f);\r\n set1.setDrawFilled(true);\r\n set1.setDrawCircles(false); \r\n set1.setLineWidth(2f);\r\n set1.setCircleSize(5f);\r\n set1.setHighLightColor(Color.rgb(244, 117, 117));\r\n set1.setColor(Color.rgb(104, 241, 175));\r\n\r\n ArrayList<LineDataSet> dataSets = new ArrayList<LineDataSet>();\r\n dataSets.add(set1);\r\n\r\n // create a data object with the datasets\r\n LineData data = new LineData(xVals, dataSets);\r\n\r\n // set data\r\n nChart.setData(data);\r\n }", "private void createChart() {\n LineChart lineChart = (LineChart) findViewById(R.id.line_chart);\n\n // LineChart DataSet\n ArrayList<LineDataSet> dataSets = new ArrayList<>();\n\n // x-coordinate format value\n XAxis xAxis = lineChart.getXAxis();\n xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\n xAxis.setGranularity(1f); // only intervals of 1 day\n// xAxis.setValueFormatter(new DayAxisValueFormatter(lineChart));\n\n\n // x-coordinate value\n ArrayList<String> xValues = new ArrayList<>();\n xValues.add(\"No.1\");\n xValues.add(\"No.2\");\n xValues.add(\"No.3\");\n xValues.add(\"No.4\");\n xValues.add(\"No.5\");\n\n // value\n ArrayList<Entry> value = new ArrayList<>();\n String measureItemName = \"\";\n value.add(new Entry(100, 0));\n value.add(new Entry(120, 1));\n value.add(new Entry(150, 2));\n value.add(new Entry(250, 3));\n value.add(new Entry(500, 4));\n\n\n // add value to LineChart's DataSet\n LineDataSet valueDataSet = new LineDataSet(value, measureItemName);\n dataSets.add(valueDataSet);\n\n // set LineChart's DataSet to LineChart\n// lineChart.setData(new LineData(xValues, dataSets));\n lineChart.setData(new LineData(valueDataSet));\n }", "Graph getRecentGraph();", "private void drawChart() throws ParseException {\n Calendar cal = new GregorianCalendar();\n cal.setTime(new Date());\n cal.set(Calendar.DAY_OF_MONTH, -7);\n cal.set(Calendar.HOUR_OF_DAY, 0);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n Date startTime = cal.getTime();\n Date dayEnd = new Date();\n\n historyChart.setBackgroundColor(Color.WHITE);\n historyChart.setDrawBorders(true);\n\n\n ArrayList<String> xAxis = new ArrayList<>();\n ArrayList<Float> calories = new ArrayList<>();\n ArrayList<Float> calcium = new ArrayList<>();\n ArrayList<Float> sodium = new ArrayList<>();\n ArrayList<Float> carbs = new ArrayList<>();\n ArrayList<Float> cholestrol = new ArrayList<>();\n ArrayList<Float> iron = new ArrayList<>();\n ArrayList<Float> protien = new ArrayList<>();\n ArrayList<Float> sugar = new ArrayList<>();\n ArrayList<Float> totalfat = new ArrayList<>();\n\n NutritionHistory instance = NutritionHistory.getInstance();\n NutritionHistory.getInstance().getNutritionInformation(startTime, dayEnd, nutritionInformation -> {\n DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();\n FirebaseUser mCurrentUser = FirebaseAuth.getInstance().getCurrentUser();\n mDatabase.child(\"account\").child(mCurrentUser.getUid()).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n\n double caloriesNeeded = 2000L;\n for (DataSnapshot data : dataSnapshot.getChildren()) {\n switch (data.getKey()) {\n case \"calories\":\n caloriesNeeded = Double.parseDouble(String.valueOf(data.getValue()));\n }\n }\n\n NutrientConverter converter = new NutrientConverter(caloriesNeeded);\n\n NutritionInformation.NutritionInformationBuilder builder = new NutritionInformation.NutritionInformationBuilder();\n NutritionInformation current = builder.build();\n\n Long[] days = nutritionInformation.keySet().stream().toArray(Long[]::new);\n Arrays.sort(days);\n\n for(Long day: days) {\n xAxis.add(sdf2.format(new Date(day)).toString());\n calories.add(converter.convert(\"Calories\", (float) nutritionInformation.get(day).getCalories()));\n calcium.add(converter.convert(\"Calcium\", (float) nutritionInformation.get(day).getCalcium()));\n sodium.add(converter.convert(\"Sodium\", (float)nutritionInformation.get(day).getSodium()));\n carbs.add(converter.convert(\"Carbohydrates\", (float) nutritionInformation.get(day).getCarbohydrates()));\n cholestrol.add(converter.convert(\"Cholesterol\", (float)nutritionInformation.get(day).getCholesterol()));\n iron.add(converter.convert(\"Iron\", (float)nutritionInformation.get(day).getIron()));\n protien.add(converter.convert(\"Protein\", (float)nutritionInformation.get(day).getProtein()));\n sugar.add(converter.convert(\"Sugar\", (float)nutritionInformation.get(day).getSugar()));\n totalfat.add(converter.convert(\"Total Fat\", (float)nutritionInformation.get(day).getTotalFat()));\n }\n Log.i(\"HERE\", xAxis.toString());\n LineDataSet dataCalories = addValues(\"Calories\", calories);\n dataCalories.setColor(Color.RED);\n dataCalories.setLineWidth(2f);\n\n LineDataSet dataCalcium = addValues(\"Calcium\",calcium);\n dataCalcium.setColor(Color.rgb(181, 126\t, 220));\n dataCalcium.setLineWidth(2f);\n\n LineDataSet dataSodium = addValues(\"Sodium\", sodium);\n dataSodium.setColor(Color.BLUE);\n dataSodium.setLineWidth(2f);\n\n LineDataSet dataCarbs = addValues(\"Carbohydrates\",carbs);\n dataCarbs.setColor(Color.GREEN);\n dataCarbs.setLineWidth(2f);\n\n LineDataSet dataCholesterol = addValues(\"Cholesterol\", cholestrol);\n dataCholesterol.setColor(Color.YELLOW);\n dataCholesterol.setLineWidth(2f);\n\n LineDataSet dataIron = addValues(\"Iron\",iron);\n dataIron.setColor(Color.BLACK);\n dataIron.setLineWidth(2f);\n\n LineDataSet dataProtein = addValues(\"Protein\", protien);\n dataProtein.setColor(Color.CYAN);\n dataProtein.setLineWidth(2f);\n\n LineDataSet dataSugar = addValues(\"Sugar\",sugar);\n dataSugar.setColor(Color.MAGENTA);\n dataSugar.setLineWidth(2f);\n\n LineDataSet dataTotalFat = addValues(\"Total Fat\", totalfat);\n dataTotalFat.setColor(Color.rgb(248\t,131, 121));\n dataTotalFat.setLineWidth(2f);\n\n LineData lineData = new LineData(dataCalories, dataCalcium ,dataSodium, dataCarbs, dataIron, dataSugar, dataProtein, dataTotalFat, dataCholesterol);\n historyChart.setData(lineData);\n historyChart.getXAxis().setDrawAxisLine(true);\n historyChart.setVisibleXRange(0, xAxis.size() - 1);\n historyChart.getXAxis().setValueFormatter(new MyXAxisValueFormatter(xAxis));\n historyChart.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);\n historyChart.enableScroll();\n historyChart.getDescription().setEnabled(false);\n historyChart.getXAxis().setLabelCount(7, true);\n historyChart.setExtraBottomOffset(20f);\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n });\n\n designChart(xAxis);\n historyChart.invalidate();\n }", "ArrayList<JFreeChart> generateAll();", "@RequiresApi(api = Build.VERSION_CODES.O)\n public void createNewLineChart() {\n\n ArrayList<Entry> yValues = new ArrayList<>();\n yValues.clear();\n\n //Todays Date\n Date date = new Date();\n LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();\n// String currentMonth = getMonthForInt(localDate.getMonthValue());\n if (monthSelectedAsInt > localDate.getMonthValue()){\n yValues.add(new Entry(0, 0));\n } else if (monthSelectedAsInt == localDate.getMonthValue()){\n for (int i = 1; i <= localDate.getDayOfMonth() ; i++) {\n yValues.add(new Entry(i, occupancyRate[i]));\n }\n } else {\n for (int i = 1; i <= numberOfDays ; i++) {\n yValues.add(new Entry(i, occupancyRate[i]));\n }\n }\n\n //chart.setOnChartValueSelectedListener(this);\n\n // enable scaling and dragging\n chart.setDragEnabled(true);\n chart.setScaleEnabled(true);\n\n // if disabled, scaling can be done on x- and y-axis separately\n chart.setPinchZoom(false);\n\n LineDataSet set1;\n\n set1 = new LineDataSet(yValues, \"Occupany Rate \");\n set1.setDrawCircles(false);\n set1.setDrawValues(false);\n set1.setColor(Color.RED);\n\n ArrayList <ILineDataSet> dataSets = new ArrayList<>();\n dataSets.add(set1);\n LineData dataLine = new LineData(set1);\n chart.getDescription().setEnabled(false);\n chart.getXAxis().setTextSize(10f);\n chart.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);\n\n chart.getAxisLeft().setAxisMinimum(0);\n chart.getAxisLeft().setAxisMaximum(100);\n chart.getAxisRight().setAxisMinimum(0);\n chart.getAxisRight().setAxisMaximum(100);\n chart.getXAxis().setAxisMinimum(1);\n chart.getXAxis().setAxisMaximum(numberOfDays);\n\n chart.setData(dataLine);\n chart.invalidate();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_statistics_month, container, false);\n\n// create dbsteps instance\n dbSteps = new DBSteps(getActivity());\n\n// creating linechart\n lineChart = rootView.findViewById(R.id.line_chart);\n// creating barchart object to manipulate instance in the layout\n ArrayList<Entry> lineEntries = new ArrayList<Entry>();\n int iterator = 0;\n for (int steps : dbSteps.getDataWholeMonth()) {\n lineEntries.add(new Entry(iterator, steps));\n iterator++;\n }\n\n lineChart.getXAxis().setDrawGridLines(false);\n lineChart.getAxisLeft().setEnabled(false);\n lineChart.getAxisRight().setEnabled(false);\n lineChart.getDescription().setEnabled(false);\n\n\n LineDataSet lineDataSet = new LineDataSet(lineEntries, \"Month Steps\");\n lineDataSet.setAxisDependency(YAxis.AxisDependency.LEFT);\n lineDataSet.setHighlightEnabled(true);\n lineDataSet.setLineWidth(2);\n// lineDataSet.setColor(getActivity().getColor(\"defaultBlue\"));\n// lineDataSet.setCircleColor(getActivity().getColor(\"defaultOrange\"));\n// lineDataSet.setCircleRadius(6);\n// lineDataSet.setCircleHoleRadius(3);\n lineDataSet.setDrawHighlightIndicators(true);\n lineDataSet.setHighLightColor(Color.RED);\n lineDataSet.setDrawValues(false);\n lineDataSet.setValueTextSize(12);\n// lineDataSet.setValueTextColor(getActivity().getColor(\"primaryDark\"));\n\n LineData lineData = new LineData(lineDataSet);\n\n// lineChart.getDescription().setText(\"Price in last 12 days\");\n// lineChart.getDescription().setTextSize(12);\n// lineChart.setDrawMarkers(true);\n// lineChart.setMarker(markerView(context));\n// lineChart.getAxisLeft().addLimitLine(lowerLimitLine(2,\"Lower Limit\",2,12,getColor(\"defaultOrange\"),getColor(\"defaultOrange\")));\n// lineChart.getAxisLeft().addLimitLine(upperLimitLine(5,\"Upper Limit\",2,12,getColor(\"defaultGreen\"),getColor(\"defaultGreen\")));\n// lineChart.getXAxis().setPosition(XAxis.XAxisPosition.BOTH_SIDED);\n lineChart.animateY(1000);\n// lineChart.getXAxis().setGranularityEnabled(true);\n// lineChart.getXAxis().setGranularity(1.0f);\n// lineChart.getXAxis().setLabelCount(lineDataSet.getEntryCount());\n lineChart.setData(lineData);\n\n// create pie chart\n PieChart pieChart = (PieChart) rootView.findViewById(R.id.week_piechart);\n ArrayList<PieEntry> pieEntries = new ArrayList<>();\n pieEntries.add(new PieEntry(4f, 0));\n pieEntries.add(new PieEntry(12f, 0));\n pieEntries.add(new PieEntry(2f, 0));\n pieEntries.add(new PieEntry(8f, 0));\n\n PieDataSet pieDataSet = new PieDataSet(pieEntries, \"Activites\");\n pieDataSet.setColors(getResources().getColor(R.color.blue_pie), getResources().getColor(R.color.yellow_pie), getResources().getColor(R.color.red_pie), getResources().getColor(R.color.green_pie));\n PieData pieData = new PieData(pieDataSet);\n pieChart.setData(pieData);\n pieChart.setCenterText(\"Activities\");\n return rootView;\n }", "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 drawChart() {\n ArrayList<Entry> confuse = new ArrayList<>();\n ArrayList<Entry> attention = new ArrayList<>();\n ArrayList<Entry> engagement = new ArrayList<>();\n ArrayList<Entry> joy = new ArrayList<>();\n ArrayList<Entry> valence = new ArrayList<>();\n // point = \"Brow Furrow: \\n\";\n String dum = null, dum2 = null;\n for (int i = 0; i < size; i++) {\n //point += (\"\" + Emotion.getBrowFurrow(i).getL() + \" seconds reading of \" + Emotion.getBrowFurrow(i).getR() + \"\\n\");\n dum2 = Emotion.getBrowFurrow(i).getL().toString();\n dum = Emotion.getBrowFurrow(i).getR().toString();\n confuse.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n dum2 = Emotion.getAttention(i).getL().toString();\n dum = Emotion.getAttention(i).getR().toString();\n attention.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n dum2 = Emotion.getEngagement(i).getL().toString();\n dum = Emotion.getEngagement(i).getR().toString();\n engagement.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n dum2 = Emotion.getJoy(i).getL().toString();\n dum = Emotion.getJoy(i).getR().toString();\n joy.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n dum2 = Emotion.getValence(i).getL().toString();\n dum = Emotion.getValence(i).getR().toString();\n valence.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n }\n\n LineDataSet data1 = new LineDataSet(confuse,\"Confuse\");\n LineDataSet data2 = new LineDataSet(attention,\"Attention\");\n LineDataSet data3 = new LineDataSet(engagement,\"Engagement\");\n LineDataSet data4 = new LineDataSet(joy,\"Engagement\");\n LineDataSet data5 = new LineDataSet(valence,\"Valence\");\n data1.setColor(Color.BLUE);\n data1.setDrawCircles(false);\n data2.setColor(Color.YELLOW);\n data2.setDrawCircles(false);\n data3.setColor(Color.GRAY);\n data3.setDrawCircles(false);\n data4.setColor(Color.MAGENTA);\n data4.setDrawCircles(false);\n data5.setColor(Color.GREEN);\n data5.setDrawCircles(false);\n\n\n dataSets.add(data1);\n dataSets.add(data2);\n dataSets.add(data3);\n dataSets.add(data4);\n dataSets.add(data5);\n }", "@Override\n BackgroundLineChart generateLineChart() {\n\n final BackgroundLineChart lineChart;\n final NumberAxis xAxis = new NumberAxis();\n xAxis.setLabel(\"Time\");\n\n List<XYChart.Series<Number, Number>> seriesList = FXCollections.observableArrayList();\n\n for (DataPoint.Type type : DataPoint.Types.values()) {\n XYChart.Series<Number, Number> series = new XYChart.Series<>();\n series.setName(type.getName());\n seriesList.add(series);\n this.getSeriesMap().put(type, series);\n }\n\n lineChart = new BackgroundLineChart(this.captureSession, xAxis, new NumberAxis(), FXCollections.observableArrayList(seriesList));\n\n //@Source - https://stackoverflow.com/a/44957354 - Enables Toggle of Data Series by clicking on their icon in the legend\n for (Node n : lineChart.getChildrenUnmodifiable()) {\n if (n instanceof Legend) {\n Legend l = (Legend) n;\n for (Legend.LegendItem li : l.getItems()) {\n for (XYChart.Series<Number, Number> s : lineChart.getData()) {\n if (s.getName().equals(li.getText())) {\n li.getSymbol().setCursor(Cursor.HAND); // Hint user that legend symbol is clickable\n li.setText(li.getText() + \" On\");\n li.getSymbol().setOnMouseClicked(me -> {\n if (me.getButton() == MouseButton.PRIMARY) {\n s.getNode().setVisible(!s.getNode().isVisible()); // Toggle visibility of line\n\n String[] displayName = li.getText().split(\" \");\n li.setText(String.format(\"%s %s\", String.join(\" \", Arrays.copyOfRange(displayName, 0, displayName.length - 1)), (s.getNode().isVisible() ? \"On\" : \"Off\")));\n for (XYChart.Data<Number, Number> d : s.getData()) {\n if (d.getNode() != null) {\n d.getNode().setVisible(s.getNode().isVisible()); // Toggle visibility of every node in the series\n }\n }\n lineChart.redraw();\n }\n });\n break;\n }\n }\n }\n }\n }\n //---\n\n return lineChart;\n }", "public Parent createLineGraph(ObservableList<HappinessReport> data) {\n xAxis = new CategoryAxis();\n xAxis.setLabel(\"Country\");\n //Yaxis Creation\n yAxis = new NumberAxis();\n yAxis.setLabel(\"Life Expectancy (Years)\");\n //Chart Creation\n linechart = new LineChart<>(xAxis, yAxis);\n linechart.setTitle(\"Linechart\");\n //Country and Score Data load into chart\n for (int intx = 0; intx < data.size(); intx++) {\n XYChart.Series LineChartSeries = new XYChart.Series<>();\n LineChartSeries.getData().add(new XYChart.Data(String.valueOf(data.get(intx).getCountry()), data.get(intx).getExpectancy()));\n linechart.getData().add(LineChartSeries);\n }\n linechart.setTitle(\"Horizontal Bar Chart Example\");\n linechart.setVerticalGridLinesVisible(false);\n linechart.setLegendVisible(false);\n return linechart;\n }", "private void setDataLineChart() {\n\t\t\n\t\tchartLine.setTitle(\"Evolution du Solde\");\n\t\tchartLine.getData().clear();\n\t\t\n\t\tXYChart.Series series = new XYChart.Series();\n\t\tseries.getData().clear();\n\t\tseries.setName(\"Evolution du solde\");\n\t\t\n\t\tdouble solde = bal.getAmount();\n\t\tint currentYear = Calendar.getInstance().get(Calendar.YEAR);\n\t\tint currentMonth = Calendar.getInstance().get(Calendar.MONTH);\n\t\tint currentDay = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n\t\t\n\t\t\n\t\t// Create a calendar object and set year and month\n\t\tCalendar mycal = new GregorianCalendar(currentYear, currentMonth,\n\t\t\t\tcurrentDay);\n\t\t\n\t\t// Get the number of days in that month\n\t\tint daysInMonth = mycal.getActualMaximum(Calendar.DAY_OF_MONTH);\n\t\t\n\t\tif (!bal.getTransactions().isEmpty()) {\n\t\t\tfor (IOTransactionLogic transaction : bal.getTransactions()\n\t\t\t\t\t.get(currentYear)[currentMonth]) {\n\t\t\t\tsolde -= transaction.getAmount();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < currentDay; ++i) {\n\t\t\tif (!bal.getTransactions().isEmpty()) {\n\t\t\t\tfor (IOTransactionLogic transaction : bal.getTransactions()\n\t\t\t\t\t\t.get(currentYear)[currentMonth]) {\n\t\t\t\t\tjava.sql.Date dat = transaction.getDate();\n\t\t\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\t\t\tcal.setTime(dat);\n\t\t\t\t\tif (cal.get(Calendar.DAY_OF_MONTH) - 1 == i) {\n\t\t\t\t\t\tsolde += transaction.getAmount();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tseries.getData()\n\t\t\t\t\t.add(new XYChart.Data(String.valueOf(i + 1), solde));\n\t\t}\n\t\t\n\t\tchartLine.getData().addAll(series);\n\t\tchartLine.setLegendVisible(false);\n\t}", "private void getChartPoints(ArrayList<Map<String,Object>> result) {\n lineChart = (LineChart) findViewById(R.id.temperature_chart);\n\n chartPoints = new ArrayList<>();\n chartXLabels = new ArrayList<>();\n\n for (int i = result.size()-1; i >=0; i--) {\n chartPoints.add(new Entry((float) ((double)result.get(i).get(\"CurrentTemp\")), result.size()-1-i));\n chartXLabels.add(result.get(i).get(\"Time\").toString());\n }\n\n LineDataSet dataSet = new LineDataSet(chartPoints, getResources().getString(R.string.temperature_screen_chartLineLabel));\n dataSet.setAxisDependency(YAxis.AxisDependency.LEFT);\n dataSet.setColor(R.color.temperature_chart_line_color);\n dataSet.setCircleColor(R.color.temperature_chart_circle_color);\n\n LineData data = new LineData(chartXLabels, dataSet);\n lineChart.setData(data);\n\n //Chart interaction settings\n lineChart.setTouchEnabled(true);\n\n //Chart layout settings\n lineChart.setDrawGridBackground(false);\n lineChart.setBackgroundColor(getResources().getColor(R.color.temperature_chart_background_color));\n\n lineChart.getXAxis().setEnabled(true);\n lineChart.getXAxis().setDrawGridLines(true);\n lineChart.getXAxis().setTextColor(getResources().getColor(R.color.temperature_chart_XLabels_color));\n lineChart.getXAxis().setGridColor(getResources().getColor(R.color.temperature_chart_XGrid_color));\n lineChart.getXAxis().setAxisLineColor(getResources().getColor(R.color.temperature_chart_XAxis_color));\n lineChart.getXAxis().setTextSize(getResources().getDimensionPixelSize(R.dimen.temperature_chart_XAxis_labels_dimension));\n lineChart.getXAxis().setGridLineWidth(getResources().getDimension(R.dimen.temperature_chart_XAxis_GridWidth_dimension));\n lineChart.getXAxis().setAxisLineWidth(getResources().getDimension(R.dimen.temperature_chart_XAxis_AxisWidth_dimension));\n lineChart.getAxisLeft().setEnabled(true);\n lineChart.getAxisLeft().setDrawGridLines(true);\n lineChart.getAxisLeft().setTextColor(getResources().getColor(R.color.temperature_chart_YLabels_color));\n lineChart.getAxisLeft().setGridColor(getResources().getColor(R.color.temperature_chart_YGrid_color));\n lineChart.getAxisLeft().setAxisLineColor(getResources().getColor(R.color.temperature_chart_YAxis_color));\n lineChart.getAxisLeft().setTextSize(getResources().getDimensionPixelSize(R.dimen.temperature_chart_YAxis_labels_dimension));\n lineChart.getAxisLeft().setGridLineWidth(getResources().getDimension(R.dimen.temperature_chart_YAxis_GridWidth_dimension));\n lineChart.getAxisLeft().setAxisLineWidth(getResources().getDimension(R.dimen.temperature_chart_YAxis_AxisWidth_dimension));\n lineChart.getAxisRight().setEnabled(false);\n\n LimitLine minLimit = new LimitLine((float) minTemp, getResources().getString(R.string.temperature_screen_chartMinLimit));\n minLimit.setLineColor(getResources().getColor(R.color.temperature_chart_minLimit_color));\n minLimit.setTextColor(getResources().getColor(R.color.temperature_chart_minLimit_label_color));\n minLimit.setLineWidth(getResources().getDimensionPixelSize(R.dimen.temperature_chart_minLimit_width_dimension));\n minLimit.setTextSize(getResources().getDimensionPixelSize(R.dimen.temperature_chart_minLimit_label_dimension));\n LimitLine maxLimit=new LimitLine((float) maxTemp,getResources().getString(R.string.temperature_screen_chartMaxLimit));\n maxLimit.setLineColor(getResources().getColor(R.color.temperature_chart_maxLimit_color));\n maxLimit.setTextColor(getResources().getColor(R.color.temperature_chart_maxLimit_label_color));\n maxLimit.setLineWidth(getResources().getDimensionPixelSize(R.dimen.temperature_chart_maxLimit_width_dimension));\n maxLimit.setTextSize(getResources().getDimensionPixelSize(R.dimen.temperature_chart_maxLimit_label_dimension));\n lineChart.getAxisLeft().addLimitLine(minLimit);\n lineChart.getAxisLeft().addLimitLine(maxLimit);\n\n //Refreshes chart\n lineChart.invalidate();\n\n //Gets the most recent temperature registered\n TextView currentTempTextView = (TextView)findViewById(R.id.temperature_currentTemp_TextView);\n currentTemp=chartPoints.get(chartPoints.size()-1).getVal();\n currentTempTextView.setText(Float.toString(currentTemp)+\"ºC\");\n\n //Gets the higher and lower temperatures registered\n float higherTemp=-900;\n float lowerTemp=900;\n for (Entry entry:chartPoints)\n {\n if(entry.getVal()>higherTemp)\n higherTemp=entry.getVal();\n if(entry.getVal()<lowerTemp)\n lowerTemp=entry.getVal();\n }\n TextView lowerTempTextView = (TextView)findViewById(R.id.temperature_minTemp2_TextView);\n lowerTempTextView.setText(Float.toString(lowerTemp)+\"ºC\");\n TextView higherTempTextView = (TextView)findViewById(R.id.temperature_maxTemp2_TextView);\n higherTempTextView.setText(Float.toString(higherTemp)+\"ºC\");\n }", "private void populateOrdersAndMakeGraphs() {\n Database.getInstance().setCallback(new Database.Callback() {\n @Override\n public void dbCallback(Object o) {\n Customer tempCustomer = (Customer)o;\n log = tempCustomer.getLog();\n final Stack<Order> ordersStack = new Stack<Order>();\n ordersStack.addAll(log.getOrders().values());\n\n // get all orders from database\n while (ordersStack.size() > 0) {\n Order order = ordersStack.pop();\n Database.getInstance().setCallback(new Database.Callback() {\n @Override\n public void dbCallback(Object o) {\n orders.add((Order)o);\n\n if (orders.size() == log.getOrders().size()) {\n extractDataFromOrders(orders);\n\n // create charts and order list\n caffeineBarChart = findViewById(R.id.caffeineBarChart);\n moneyXYPlot = findViewById(R.id.moneyXYPlot);\n\n // setup charts and order list\n onCreateCaffeineBarChart(coffeeCaffeineSeries, teaCaffeineSeries);\n onCreateMoneyXYPlot(coffeeExpenditureSeries, teaExpenditureSeries);\n }\n }\n });\n Database.getInstance().getOrder(order.getId());\n }\n }\n });\n Database.getInstance().getUser(userID);\n }", "@Override\n\tprotected ArrayList<LineDataSet> buildDataSets(JSONArray array) {\n\t\tArrayList<LineDataSet> dataSets = new ArrayList<LineDataSet>();\n\t\tif (array == null) {\n\t\t\treturn dataSets;\n\t\t}\n\t\t\n\t\tdataSets.add(buildLineData(getYValues(array.optJSONObject(0).optJSONArray(\"list\")), R.color.chart_color1));\n\t\tdataSets.add(buildLineData(getYValues(array.optJSONObject(1).optJSONArray(\"list\")), R.color.chart_color2));\n\t\tshowTotal(array.optJSONObject(0));\n\t\tshowTotal(array.optJSONObject(1));\n\t\tString str1=array.optJSONObject(0).optString(\"label\");\n\t\tString str2=array.optJSONObject(1).optString(\"label\");\n\t\tmDxTipText.setText(str1);\n\t\tmZyTipText.setText(str2);\n\t\tmDxBottonText.setText(str1);\n\t\tmXyBottonText.setText(str2);\n\t\t\n\t\treturn dataSets;\n\t}", "void createGraphForMassiveLoad();", "private void setData(int count) {\n\n int goalValue = mSharedPreferences.getData(PREF_GOAL_VALUE);\n Log.e(TAG, \"setData: \" + goalValue);\n\n ArrayList<Entry> values = new ArrayList<>();\n values.add(new Entry(0, 0));\n for (int i = 1; i < count; i++) {\n\n float val = (float) (Math.random() * 10) + values.get(i-1).getY();\n Log.e(TAG, \"val 1: \" + val);\n\n if(val >= goalValue) val = goalValue;\n Log.e(TAG, \"val 2: \" + val);\n\n values.add(new Entry(i, val));\n }\n\n LineDataSet lineDataSet;\n\n if (mChart.getData() != null &&\n mChart.getData().getDataSetCount() > 0) {\n lineDataSet = (LineDataSet)mChart.getData().getDataSetByIndex(0);\n lineDataSet.setValues(values);\n mChart.getData().notifyDataChanged();\n mChart.notifyDataSetChanged();\n } else {\n // create a dataset and give it a type\n lineDataSet = new LineDataSet(values, \"\");\n\n lineDataSet.setColor(ContextCompat.getColor(getContext(), R.color.green));\n lineDataSet.setCircleColor(ContextCompat.getColor(getContext(), R.color.green));\n lineDataSet.setDrawIcons(false);\n lineDataSet.setLineWidth(2f);\n lineDataSet.setCircleRadius(1f);\n lineDataSet.setDrawCircleHole(false);\n lineDataSet.setDrawFilled(true);\n lineDataSet.disableDashedLine();\n\n mChart.setDescription(new Description()); // Hide the description\n mChart.getAxisLeft().setDrawGridLines(false);\n mChart.getAxisLeft().setDrawLabels(false);\n mChart.getAxisRight().setDrawGridLines(false);\n mChart.getAxisRight().setDrawLabels(false);\n mChart.getXAxis().setDrawGridLines(false);\n mChart.getXAxis().setDrawLabels(false);\n mChart.getLegend().setEnabled(false);\n\n lineDataSet.setDrawValues(false);\n\n if (Utils.getSDKInt() >= 18) {\n // fill drawable only supported on api level 18 and above\n final Drawable drawable = ContextCompat.getDrawable(getContext(), R.drawable.ic_add_black_24dp);\n lineDataSet.setFillDrawable(drawable);\n }\n else {\n lineDataSet.setFillColor(Color.BLACK);\n }\n\n\n ArrayList<Entry> values2 = new ArrayList<>();\n values2.add(new Entry(values.get(20).getX(), values.get(20).getY()));\n for (int i = 29; i >= 20; i--) {\n\n float val = (float) (Math.random() * 10) + values.get(i).getY();\n\n Log.d(TAG, \"Golden Values : \" + val);\n values2.add(new Entry(values.get(20).getX() + i, val));\n }\n\n LineDataSet lineDataSet2;\n\n lineDataSet2 = new LineDataSet(values2, \"Predicted\");\n\n lineDataSet2.setColor(ContextCompat.getColor(getContext(), R.color.colorOppositePrimary));\n lineDataSet2.setCircleColor(ContextCompat.getColor(getContext(), R.color.colorOppositePrimary));\n lineDataSet2.setDrawIcons(false);\n lineDataSet2.setLineWidth(2f);\n lineDataSet2.setCircleRadius(1f);\n lineDataSet2.setDrawCircleHole(false);\n lineDataSet2.setDrawFilled(true);\n lineDataSet2.disableDashedLine();\n\n lineDataSet2.setDrawValues(false);\n\n if (Utils.getSDKInt() >= 18) {\n // fill drawable only supported on api level 18 and above\n final Drawable drawable = ContextCompat.getDrawable(getContext(), R.drawable.ic_add_black_24dp);\n lineDataSet2.setFillDrawable(drawable);\n }\n else {\n lineDataSet2.setFillColor(Color.BLACK);\n }\n\n final ArrayList<ILineDataSet> dataSets = new ArrayList<>();\n dataSets.add(lineDataSet); // add the datasets\n// dataSets.add(lineDataSet2);\n\n // create a data object with the datasets\n final LineData data = new LineData(lineDataSet/*, lineDataSet2*/);\n\n // set data\n mChart.setData(data);\n\n// final ArrayList<ILineDataSet> dataSets2 = new ArrayList<>();\n// dataSets.add(lineDataSet2); // add the datasets\n\n // create a data object with the datasets\n// final LineData data2 = new LineData(dataSets2);\n// mChart.setData(data2);\n }\n }", "private LineData generateLineData() {\n\n LineData d = new LineData();\n LineDataSet set = new LineDataSet(ReportingRates, \" ARVs (Reporting Rates)\");\n set.setColors(Color.parseColor(\"#90ed7d\"));\n set.setLineWidth(2.5f);\n set.setCircleColor(Color.parseColor(\"#90ed7d\"));\n set.setCircleRadius(2f);\n set.setFillColor(Color.parseColor(\"#90ed7d\"));\n set.setMode(LineDataSet.Mode.CUBIC_BEZIER);\n set.setDrawValues(true);\n\n set.setAxisDependency(YAxis.AxisDependency.LEFT);\n d.addDataSet(set);\n\n return d;\n }", "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 }", "private void plotData(){\n List<Entry> entriesMedidas = new ArrayList<Entry>();\n try{\n // #1\n FileInputStream fis = getApplicationContext().openFileInput(fileName);\n InputStreamReader isr = new InputStreamReader(fis);\n BufferedReader reader = new BufferedReader(isr);\n\n // #2. Skips the name, birthdate and gender of the baby\n reader.readLine();\n reader.readLine();\n reader.readLine();\n\n // #3\n String line = reader.readLine();//First line with data\n\n while (line != null) {\n double[] datum = obtainSubstring(line, mag);\n entriesMedidas.add(new Entry((float) datum[0], (float) datum[1]));\n\n line = reader.readLine();\n }\n\n reader.close();\n isr.close();\n fis.close();\n\n }catch(IOException e){\n e.printStackTrace();\n }\n\n // #4\n LineDataSet lineaMedidas = new LineDataSet(entriesMedidas, this.name);\n lineaMedidas.setAxisDependency(YAxis.AxisDependency.LEFT);\n lineaMedidas.setColor(ColorTemplate.rgb(\"0A0A0A\"));\n lineaMedidas.setCircleColor(ColorTemplate.rgb(\"0A0A0A\"));\n todasMedidas.add(lineaMedidas);\n\n }", "private XYMultipleSeriesDataset getdemodataset() {\n\t\t\tdataset1 = new XYMultipleSeriesDataset();// xy轴数据源\n\t\t\tseries = new XYSeries(\"温度 \");// 这个事是显示多条用的,显不显示在上面render设置\n\t\t\t// 这里相当于初始化,初始化中无需添加数据,因为如果这里添加第一个数据的话,\n\t\t\t// 很容易使第一个数据和定时器中更新的第二个数据的时间间隔不为两秒,所以下面语句屏蔽\n\t\t\t// 这里可以一次更新五个数据,这样的话相当于开始的时候就把五个数据全部加进去了,但是数据的时间是不准确或者间隔不为二的\n\t\t\t// for(int i=0;i<5;i++)\n\t\t\t// series.add(1, Math.random()*10);//横坐标date数据类型,纵坐标随即数等待更新\n\n\t\t\tdataset1.addSeries(series);\n\t\t\treturn dataset1;\n\t\t}", "private Object[] importTempChartAussen() {\n ArrayList<String> xValues = new ArrayList<>();\n //values: beinhaltet die x und y Werte als Entry\n ArrayList<Entry> values = new ArrayList<>();\n\n SimpleDateFormat parser = new SimpleDateFormat(\"yyyy-MM-dd' '00:00:00\",\n Locale.GERMANY);\n Date d = new Date();\n d.setTime(d.getTime() - 604800000); //604800000ms=7d\n GregorianCalendar datenow = new GregorianCalendar();\n\n //ermittle die maximal Werte der letzten 7 Tage\n String query = \"SELECT datetime, Max(value) AS value FROM temperature where sensorid=1 AND datetime> '\"\n + parser.format(d)\n + \"' GROUP BY SUBSTR(datetime,0,11) ORDER BY datetime\";\n Cursor cr1 = db.getRawQuery(query);\n\n Date date = null;\n String day_of_week;\n SimpleDateFormat sdfDayMonth = new SimpleDateFormat(\"dd.MM\", Locale.GERMANY);\n SimpleDateFormat sdfYearMonthDateHourMinuteSecond = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.GERMANY);\n for (int i = 0; i < cr1.getCount(); i++) {\n //lese jeden Temperaturwert als Date ein und konvertiers dann zu einem GregorianCalendar\n\n try {\n date = sdfYearMonthDateHourMinuteSecond.parse(cr1.getString(cr1.getColumnIndex(\"datetime\")));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n GregorianCalendar g = new GregorianCalendar();\n g.setTime(date);\n\n if (datenow.get(GregorianCalendar.YEAR) == g\n .get(GregorianCalendar.YEAR)\n && datenow.get(GregorianCalendar.DAY_OF_YEAR) == g\n .get(GregorianCalendar.DAY_OF_YEAR)) {\n day_of_week = \"Heute \"; // unsichtbare Zeichen dahinter\n // damits ins Layout passt\n } else if (datenow.get(GregorianCalendar.YEAR) == g\n .get(GregorianCalendar.YEAR) && (datenow.get(GregorianCalendar.DAY_OF_YEAR)) == g\n .get(GregorianCalendar.DAY_OF_YEAR) + 1) {\n\n day_of_week = \"Gestern\";\n\n } else if (datenow.get(GregorianCalendar.YEAR) >= g\n .get(GregorianCalendar.YEAR)\n && datenow.get(GregorianCalendar.DAY_OF_YEAR) - 8 >= g\n .get(GregorianCalendar.DAY_OF_YEAR)) {\n\n day_of_week = sdfDayMonth.format(g.getTime());\n\n } else {\n day_of_week = g.getDisplayName(GregorianCalendar.DAY_OF_WEEK,\n GregorianCalendar.SHORT, Locale.GERMANY);\n }\n xValues.add(day_of_week);\n values.add(new Entry(i, cr1.getFloat(cr1.getColumnIndex(\"value\"))));\n cr1.moveToNext();\n }\n cr1.close();\n\n\n //erstellt ein LineDataSet mit den Objekten und entsprechenden Anpassungen\n LineDataSet set1 = new LineDataSet(values, \"Aussen\");\n // set1.setDrawCubic(true);\n set1.setCubicIntensity(0.2f);\n set1.setDrawCircles(false);\n set1.setLineWidth(2f);\n set1.setHighLightColor(Color.rgb(244, 117, 117));\n // set1.setColor(Color.rgb(104, 241, 175));\n set1.setColor(activity.getSharedPreferences(\"myprefs\", 0).getInt(\n \"trendcurveColorAussen\", Color.WHITE));\n set1.setFillColor(ColorTemplate.getHoloBlue());\n set1.setMode(LineDataSet.Mode.CUBIC_BEZIER);\n\n Object[] result = new Object[2];\n result[0] = set1;\n result[1] = xValues;\n return result;\n }", "public LineData() {\n\t\t\tallPoints = new ArrayList<>(SIZE_OF_ORIGINAL_LIST);\n\t\t}", "List<HistoryData> loadAllHistoryData();", "private void buildMonthly(int year, int month, int numdays, int dataIndex, Bundle bundle) {\n\n double[] raw_xdata = new double[numdays + 2];\n double[] raw_ydata1 = new double[numdays + 2];\n double[] raw_ydata2 = new double[numdays + 2];\n double[] raw_ydata3 = null;\n if (dataIndex == Constants.DATA_MONTHLY_TEMPERATURE) {\n raw_ydata3 = new double[numdays + 2];\n Arrays.fill(raw_ydata1, Constants.DATA_INVALID);\n Arrays.fill(raw_ydata2, Constants.DATA_INVALID);\n Arrays.fill(raw_ydata3, Constants.DATA_INVALID);\n }\n\n // set the first y1 and y2 values\n int xstart = bundle.getInt(\"xorigin1\", 0);\n raw_xdata[0] = xstart;\n\n // set the y1 and y2 values for the month\n for (int i = 1; i < numdays + 1; i++) {\n raw_xdata[i] = i;\n String filename = UtilsMisc.getDecimalFormat(year, 4) + \"-\" +\n UtilsMisc.getDecimalFormat(month + 1, 2) + \"-\" +\n UtilsMisc.getDecimalFormat(i, 2);\n if (summaryDB.isInSummaryTable(context, filename)) {\n int log_id = summaryDB.getMonitorID(context, filename);\n SummaryProvider.Summary summary = summaryDB.getSummary(context, log_id);\n switch (dataIndex) {\n case Constants.DATA_PEAKWATTS:\n raw_ydata1[i] = summary.getPeak_watts();\n raw_ydata2[i] = summary.getGenerated_watts();\n break;\n case Constants.DATA_PEAKTIME:\n long midnight = UtilsDate.get_midNightTimestamp(summary.getStart_time(), lat, lon);\n raw_ydata1[i] = UtilsDate.getTimeSeconds(summary.getPeak_time() - midnight);\n raw_ydata2[i] = summary.getGenerated_watts();\n break;\n case Constants.DATA_SUNLIGHT:\n raw_ydata1[i] = UtilsDate.getTimeSeconds(summary.getEnd_time() - summary.getStart_time());\n raw_ydata2[i] = summary.getGenerated_watts();\n break;\n case Constants.DATA_READINGS:\n raw_ydata1[i] = summaryDB.getDetailCount(context, log_id);\n raw_ydata2[i] = summary.getGenerated_watts();\n break;\n case Constants.DATA_MONTHLY_TEMPERATURE:\n raw_ydata1[i] = summary.getMinTemperature();\n raw_ydata2[i] = summary.getMaxTemperature();\n raw_ydata3[i] = summary.getGenerated_watts();\n break;\n case Constants.DATA_MONTHLY_CLOUDS:\n raw_ydata1[i] = summary.getAvgClouds();\n raw_ydata2[i] = summary.getGenerated_watts();\n break;\n default:\n break;\n }\n } else {\n if (dataIndex != Constants.DATA_MONTHLY_TEMPERATURE) {\n raw_ydata1[i] = 0.0;\n raw_ydata2[i] = 0.0;\n }\n }\n }\n\n // set the first and last y1 and y2 values\n int xend = numdays;\n raw_xdata[numdays+1] = xend + 1;\n switch (dataIndex) {\n case Constants.DATA_PEAKWATTS :\n raw_ydata1[numdays+1] = raw_ydata1[numdays]; raw_ydata2[numdays+1] = raw_ydata2[numdays];\n raw_ydata1[0] = raw_ydata1[1]; raw_ydata2[0] = raw_ydata2[1]; break;\n case Constants.DATA_PEAKTIME :\n raw_ydata1[numdays+1] = raw_ydata1[numdays]; raw_ydata2[numdays+1] = raw_ydata2[numdays];\n raw_ydata1[0] = raw_ydata1[1]; raw_ydata2[0] = raw_ydata2[1]; break;\n case Constants.DATA_SUNLIGHT :\n raw_ydata1[numdays+1] = raw_ydata1[numdays]; raw_ydata2[numdays+1] = raw_ydata2[numdays];\n raw_ydata1[0] = raw_ydata1[1]; raw_ydata2[0] = raw_ydata2[1]; break;\n case Constants.DATA_READINGS :\n raw_ydata1[numdays+1] = raw_ydata1[numdays]; raw_ydata2[numdays+1] = raw_ydata2[numdays];\n raw_ydata1[0] = raw_ydata1[1]; raw_ydata2[0] = raw_ydata2[1]; break;\n case Constants.DATA_MONTHLY_CLOUDS :\n raw_ydata1[numdays+1] = raw_ydata1[numdays]; raw_ydata2[numdays+1] = raw_ydata2[numdays];\n raw_ydata1[0] = raw_ydata1[1]; raw_ydata2[0] = raw_ydata2[1]; break;\n case Constants.DATA_MONTHLY_TEMPERATURE :\n Number[] numbers = UtilsMisc.toNumber(raw_ydata1, -273); // convert from kelvin to centigrade\n numbers = UtilsMisc.fix_end_numbers(numbers, true);\n numbers = UtilsMisc.fix_mid_numbers(numbers);\n raw_ydata1 = UtilsMisc.toDouble(numbers);\n\n numbers = UtilsMisc.toNumber(raw_ydata2, -273);\n numbers = UtilsMisc.fix_end_numbers(numbers, true);\n numbers = UtilsMisc.fix_mid_numbers(numbers);\n raw_ydata2 = UtilsMisc.toDouble(numbers);\n\n numbers = UtilsMisc.toNumber(raw_ydata3);\n numbers = UtilsMisc.fix_end_numbers(numbers, true);\n numbers = UtilsMisc.fix_mid_numbers(numbers);\n raw_ydata3 = UtilsMisc.toDouble(numbers);\n default :\n break;\n }\n\n LinearInterpolation lp1 = new LinearInterpolation(raw_xdata, raw_ydata1);\n LinearInterpolation lp2 = new LinearInterpolation(raw_xdata, raw_ydata2);\n LinearInterpolation lp3 = (raw_ydata3 != null)? new LinearInterpolation(raw_xdata, raw_ydata3): null;\n int time = xstart;\n ArrayList<Integer> xList = new ArrayList<>();\n ArrayList<Float> yList1 = new ArrayList<>();\n ArrayList<Float> yList2 = new ArrayList<>();\n ArrayList<Float> yList3 = new ArrayList<>();\n while (time < (xend+1)) {\n xList.add(time);\n yList1.add((float) lp1.interpolate(time));\n yList2.add((float) lp2.interpolate(time));\n if (lp3 != null)\n yList3.add((float) lp3.interpolate(time));\n time += 1;\n }\n\n int[] xdata = Ints.toArray(xList);\n float[] ydata1 = Floats.toArray(yList1);\n float[] ydata2 = Floats.toArray(yList2);\n float[] ydata3 = Floats.toArray(yList3);\n bundle.putIntArray(\"xdata1\", xdata);\n bundle.putIntArray(\"xdata2\", xdata);\n bundle.putIntArray(\"xdata3\", xdata);\n bundle.putFloatArray(\"ydata1\", ydata1);\n bundle.putFloatArray(\"ydata2\", ydata2);\n bundle.putFloatArray(\"ydata3\", ydata3.length > 0? ydata3: null);\n\n switch (dataIndex) {\n case Constants.DATA_MONTHLY_TEMPERATURE:\n smooth_plot(bundle, true, \"1\");\n smooth_plot(bundle, true, \"2\");\n break;\n case Constants.DATA_MONTHLY_CLOUDS:\n smooth_plot(bundle, true, \"1\");\n break;\n }\n\n }", "void createGraphForDistributedSingleLoad();", "public Object[][] buildNewGraphDataModel() {\r\n\t\t\r\n\t\tresetDataStructures();\r\n\t\tGraph g = UIFacade.getInstance().getGraph();\r\n\t\t\r\n\t\tObject[][] result = new Object[g.getN()][5];\r\n\t\t\r\n\t\tfor (int i = 0; i < g.getN(); i++) {\r\n\t\t\tNode node = g.getNode(i);\r\n\t\t\tComponentProperties cp = node.getProperties();\r\n //\t\t\t ID\r\n\t\t\tresult[i][0] = new Integer(\r\n\t\t\t\t\t((ID)cp.getPropertyByName(\"ID\")).getValue()); \t\t\t\r\n\t\t\tresult[i][1] = new Integer(DEFAULT_CLIENT_DEMAND); // Demand\t\t\t\r\n\t\t\tresult[i][2] = new Double(DEFAULT_CLIENT_TW_BEGIN);\r\n\t\t\tresult[i][3] = new Double(DEFAULT_CLIENT_TW_END);\r\n\t\t\tresult[i][4] = new Double(DEFAULT_CLIENT_TW_SERVICE);\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "private XYDataset createDataset() {\n final XYSeriesCollection dataset = new XYSeriesCollection();\n //dataset.addSeries(totalDemand);\n dataset.addSeries(cerContent);\n //dataset.addSeries(cerDemand);\n dataset.addSeries(comContent);\n //dataset.addSeries(comDemand);\n dataset.addSeries(activation);\n dataset.addSeries(resolutionLevel);\n \n return dataset;\n }", "@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)\n @Override\n public void onGlobalLayout() {\n\n lineChart.getViewTreeObserver().removeOnGlobalLayoutListener(this);\n\n /**An offset is used to calculate linear graph translation\n * along X and Y directions\n * */\n int offset = (lineChart.getHeight() - lineChart.getWidth()) / 2;\n\n FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) lineChart.getLayoutParams();\n layoutParams.width = lineChart.getHeight();\n layoutParams.height = lineChart.getWidth();\n\n /**The linechart layout parameters are converted to a frame.\n * Specifically, the width and height of the lineChart are reset\n * to dimensions that can create a FrameLayout*/\n lineChart.setLayoutParams(layoutParams);\n\n lineChart.setTranslationX(-offset);\n\n lineChart.setTranslationY(offset);\n ChartType chartType = Enum.valueOf(ChartType.class, chart_type);\n initLineChart(frag_type, chartType);\n// initLineChart(graph_type,device_id, axis_type);\n }", "private void plotDato() {\n List<Entry> entriesMedidas = new ArrayList<Entry>();\n entriesMedidas.add(new Entry((float) dato.getYears(), (float) dato.getMeasures()[mag]));\n LineDataSet lineaMedidas = new LineDataSet(entriesMedidas, \"Medida\");\n lineaMedidas.setAxisDependency(YAxis.AxisDependency.LEFT);\n lineaMedidas.setColor(ColorTemplate.rgb(\"0A0A0A\"));\n lineaMedidas.setCircleColor(ColorTemplate.rgb(\"0A0A0A\"));\n todasMedidas.add(lineaMedidas);\n }", "public void refreshGraphData() {\n\t\tLOGGER.finest(\"Finding builds to use for NeoLoad graphs. Currently I see \" + buildsAndDocs.size());\n\t\ttry {\n\t\t\tNeoLoadReportDoc doc = null;\n\t\t\tfinal Map<AbstractBuild<?, ?>, NeoLoadReportDoc> newBuildsAndDocs = new LinkedHashMap<AbstractBuild<?, ?>, NeoLoadReportDoc>();\n\n\t\t\t// look through all builds of the job\n\t\t\tfor (final AbstractBuild<?, ?> build: project.getBuilds()) {\n\t\t\t\tdoc = findXMLResultsFile(build);\n\n\t\t\t\t// if the correct file was found, and\n\t\t\t\t// only include successful builds.\n\t\t\t\tif (build != null && build.getResult() != null && build.getResult().isBetterThan(Result.FAILURE)) {\n\n\t\t\t\t\t// add the html results link to the build if it's not already there.\n\t\t\t\t\t// this is done here as well for builds that exist and don't already have the action.\n\t\t\t\t\t// this covers the case when the plugin is uninstalled, the action is lost,\n\t\t\t\t\t// and then the plugin is reinstalled.\n\t\t\t\t\tNeoResultsAction.addActionIfNotExists(build);\n\n\t\t\t\t\t// find the xml results file.\n\t\t\t\t\tdoc = findXMLResultsFile(build);\n\n\t\t\t\t\t// if the correct file was found\n\t\t\t\t\tif (doc != null) {\n\t\t\t\t\t\tnewBuildsAndDocs.put(build, doc);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// switch out the data for the new view\n\t\t\tfinal Map<AbstractBuild<?, ?>, NeoLoadReportDoc> oldBuildsAndDocs = buildsAndDocs;\n\t\t\tbuildsAndDocs = newBuildsAndDocs;\n\t\t\toldBuildsAndDocs.clear();\n\t\t} catch (final Exception e) {\n\t\t\tLOGGER.log(Level.SEVERE, \"Error finding NeoLoad xml results. \" + e.getMessage(), e);\n\t\t}\n\n\t\tLOGGER.finer(\"Found \" + buildsAndDocs.size() + \" builds to use for NeoLoad graphs.\");\n\t}", "private void initCourse(final ArrayList<CourseLearning> courseLearnings){\n// Log.i(\"courseinfo\", courseLearnings.get(0).toString());\n// Log.i(\"courseinfo\", courseLearnings.get(1).toString());\n// Log.i(\"courseinfo\", courseLearnings.get(2).toString());\n\n LineChartDatas chartData = new LineChartDatas(new Date());\n String[] posX = chartData.getPosX();\n// Log.i(\"date\", posX[0]+posX[1]+posX[2]+posX[3]+posX[4]+posX[5]+posX[6]);\n int[] posY = {0,0,0,0,0,0,0};\n Calendar calendar = Calendar.getInstance();\n Date date = new Date();\n calendar.setTime(date);\n ArrayList<String> week=new ArrayList<>();\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n for(int i =0;i<7;i++){\n calendar.add(Calendar.DATE,-1);\n date=calendar.getTime();\n String format = simpleDateFormat.format(date);\n Log.i(\"date:\",format);\n week.add(format);\n for(Iterator<CourseLearning> iterator=courseLearnings.iterator();iterator.hasNext();){\n CourseLearning courseLearning = iterator.next();\n if(simpleDateFormat.format(courseLearning.getTime()).equals(format)){\n posY[(6-i)%7] += courseLearning.getDruation()/60000;\n }\n }\n }\n for(int i =0;i<7;i++){\n Log.i(\"posY=\",posY[i]+\"\");\n }\n mPointValues=new ArrayList<>();\n mAxisValues = new ArrayList<>();\n\n for (int i = 0; i < 7 ; i++) {\n mPointValues.add(new PointValue(i, posY[i]));\n mAxisValues.add(new AxisValue(i).setLabel(posX[i])); //为每个对应的i设置相应的label(显示在X轴)\n }\n\n Line line = new Line(mPointValues).setColor(BLUE).setCubic(false);\n List<Line> lines = new ArrayList<Line>();\n lines.add(line);\n LineChartData data = new LineChartData();\n data.setLines(lines);\n\n//坐标轴\n Axis axisX = new Axis(); //X轴\n axisX.setHasTiltedLabels(true);\n axisX.setTextColor(BLUE);\n axisX.setName(\"当天课程学习\");\n axisX.setMaxLabelChars(10);\n axisX.setValues(mAxisValues);\n data.setAxisXBottom(axisX);\n\n Axis axisY = new Axis(); //Y轴\n axisY.setMaxLabelChars(7); //默认是3,只能看最后三个数字\n data.setAxisYLeft(axisY);\n\n//设置行为属性,支持缩放、滑动以及平移\n mLineChartView.setInteractive(true);\n mLineChartView.setZoomType(ZoomType.HORIZONTAL);\n mLineChartView.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);\n mLineChartView.setLineChartData(data);\n mLineChartView.setVisibility(View.VISIBLE);\n\n }", "@Override\r\n public void onCreate(Bundle savedState) {\r\n super.onCreate(savedState);\r\n \r\n if (savedState != null) {\r\n dataController.setViewableDataTableRows(\r\n GraphActivityFunctions.restoreViewableDataTableRows(savedState));\r\n }\r\n \r\n SharedPreferences sp = getPreferences(MODE_PRIVATE);\r\n dataController.setViewableDataTableRows(\r\n GraphActivityFunctions.restoreViewableDataTableRows(sp));\r\n \r\n setContentView(R.layout.graph);\r\n\r\n Integer currentYearMaximum = Utility.getNumOfCompoundingPeriods();\r\n setupValueSpinner();\r\n setupTimeSlider(currentYearMaximum);\r\n setupValueSlider(currentYearMaximum);\r\n setupGraphs(currentYearMaximum);\r\n setupCurrentValueFields();\r\n valueToDataTableItemCorrespondence = GraphActivityFunctions.createDataTableItems(GraphActivity.this);\r\n setDataChangedToggle(true);\r\n }", "private void loadTravelTracking() {\n\n ArrayList<LatLng> LatLngs = new ArrayList<LatLng>();\n\n HistoryDBHelper inst = HistoryDBHelper.getInstance(getContext());\n // SimpleDateFormat dateformat = new SimpleDateFormat(\"dd-MM-yyyy hh:mm:ss\", Locale.US);\n // String simpleDate = \"24-04-2021 08:00:00\";\n try {\n // Timestamp ts = Timestamp.valueOf(\"2021-04-24 13:00:27.627\");\n // Date date = new Date(ts.getTime());\n Date date = selectedDate;\n Log.d(TAG, date.toString());\n ArrayList<HistoryItem> historyItems = inst.retrieveByDate(date);\n //ArrayList<HistoryItem> historyItems = inst.getAllListHistory();\n int count = 0;\n Timestamp lastTimeStamp = new Timestamp(0);\n for (HistoryItem historyItem : historyItems) {\n Log.d(TAG, historyItem.toString() + count);\n Timestamp currentTimeStamp = historyItem.getTimestamp();\n // Ensure that two time stamps are 1 minutes away from each other.\n if (currentTimeStamp.getTime() - lastTimeStamp.getTime() > 1000 * 60) {\n LatLngs.add(new LatLng(historyItem.getLat(), historyItem.getLon()));\n lastTimeStamp = currentTimeStamp;\n }\n count++;\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n Log.e(TAG, \"Load Travel Tracking Date Error\");\n }\n\n Polyline line = map.addPolyline(new PolylineOptions()\n .addAll(LatLngs)\n .startCap(new RoundCap())\n .endCap(new ButtCap())\n .width(15)\n .color(Color.argb(255, 153, 27, 30)));\n\n line.setTag(new SimpleDateFormat(\"MM/dd/yyyy\", Locale.US).format(selectedDate));\n line.setJointType(JointType.ROUND);\n line.setClickable(true);\n\n map.setOnPolylineClickListener(new GoogleMap.OnPolylineClickListener() {\n @Override\n public void onPolylineClick(Polyline polyline) {\n if ((polyline.getColor() == Color.argb(255, 153, 27, 30))) {\n polyline.setColor(Color.argb(255, 255, 204, 0));\n } else {\n // The default pattern is a solid stroke.\n polyline.setColor(Color.argb(255, 153, 27, 30));\n }\n\n Toast.makeText(getActivity(), \"Date \" + polyline.getTag().toString(),\n Toast.LENGTH_SHORT).show();\n }\n });\n }", "void updateGraph(TimeSlot[] dataList) {\n \tXYChart.Series<String, Number> series = new XYChart.Series<String, Number>();\n \tfor(int i=0; i<dataList.length; i++) {\n \t\tTimeSlot t = dataList[i];\n \t\tseries.getData().add(new XYChart.Data<String, Number>(TimeSlot.getTime(i), t.getDifference()));\n \t}\n \tgraph.getData().add(series);\n }", "public void initGraphData(String dataSeriesName1, String dataSeriesName2, String dataSeriesName3) {\n m_pDataSeriesName1 = dataSeriesName1;\n m_pDataSeriesName2 = dataSeriesName2;\n m_pDataSeriesName3 = dataSeriesName3;\n\n initDataSeries(m_pDataSeriesName1, m_pDataSeriesName2, m_pDataSeriesName3);\n\n m_pAnimation = new Timeline();\n m_pAnimation.getKeyFrames().add(new KeyFrame(Duration.millis(2000), new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent actionEvent) {\n try {\n m_pLock.lock();\n if (mTimeInSecond != null) {\n\n addToDataSeries1(mTimeInSecond, mPlotValue1, CHART_MODE_2_SECONDS);\n addToDataSeries2(mTimeInSecond, mPlotValue2, CHART_MODE_2_SECONDS);\n addToDataSeries3(mTimeInSecond, mPlotValue3, CHART_MODE_2_SECONDS);\n\n if (mChartModeCounter % 10 == 0) {\n addToDataSeries1(mTimeInSecond, mPlotValue1, CHART_MODE_10_SECONDS);\n addToDataSeries2(mTimeInSecond, mPlotValue2, CHART_MODE_10_SECONDS);\n addToDataSeries3(mTimeInSecond, mPlotValue3, CHART_MODE_10_SECONDS);\n }\n\n if (mChartModeCounter % 30 == 0) {\n addToDataSeries1(mTimeInSecond, mPlotValue1, CHART_MODE_30_SECONDS);\n addToDataSeries2(mTimeInSecond, mPlotValue2, CHART_MODE_30_SECONDS);\n addToDataSeries3(mTimeInSecond, mPlotValue3, CHART_MODE_30_SECONDS);\n }\n\n if (mChartModeCounter % 300 == 0) {\n addToDataSeries1(mTimeInSecond, mPlotValue1, CHART_MODE_5_MINUTES);\n addToDataSeries2(mTimeInSecond, mPlotValue2, CHART_MODE_5_MINUTES);\n addToDataSeries3(mTimeInSecond, mPlotValue3, CHART_MODE_5_MINUTES);\n mChartModeCounter = 0;\n }\n\n mChartModeCounter += 2;\n\n // Set null after plotting\n mTimeInSecond = null;\n mPlotValue1 = null;\n mPlotValue2 = null;\n mPlotValue3 = null;\n\n // Update the X Axis if it has been initialized\n if (m_pXAxis != null) {\n int chartRange;\n ObservableList<XYChart.Data<Number, Number>> observableList1, observableList2, observableList3;\n switch (mChartMode) {\n case CHART_MODE_2_SECONDS:\n observableList1 = m_pDataSerieObservableList1_2SEC;\n observableList2 = m_pDataSerieObservableList2_2SEC;\n observableList3 = m_pDataSerieObservableList3_2SEC;\n chartRange = X_AXIS_RANGE_2_SECOND_MODE;\n break;\n case CHART_MODE_10_SECONDS:\n observableList1 = m_pDataSerieObservableList1_10SEC;\n observableList2 = m_pDataSerieObservableList2_10SEC;\n observableList3 = m_pDataSerieObservableList3_10SEC;\n chartRange = X_AXIS_RANGE_10_SECOND_MODE;\n break;\n case CHART_MODE_30_SECONDS:\n observableList1 = m_pDataSerieObservableList1_30SEC;\n observableList2 = m_pDataSerieObservableList2_30SEC;\n observableList3 = m_pDataSerieObservableList3_30SEC;\n chartRange = X_AXIS_RANGE_30_SECOND_MODE;\n break;\n case CHART_MODE_5_MINUTES:\n observableList1 = m_pDataSerieObservableList1_5MIN;\n observableList2 = m_pDataSerieObservableList2_5MIN;\n observableList3 = m_pDataSerieObservableList3_5MIN;\n chartRange = X_AXIS_RANGE_5_MINUTE_MODE;\n break;\n default:\n observableList1 = m_pDataSerieObservableList1_2SEC;\n observableList2 = m_pDataSerieObservableList2_2SEC;\n observableList3 = m_pDataSerieObservableList3_2SEC;\n chartRange = X_AXIS_RANGE_2_SECOND_MODE;\n break;\n }\n\n\n double maxValue = Math.max(Math.max(observableList1.get(observableList1.size() - 1).getXValue().doubleValue(),\n observableList2.get(observableList1.size() - 1).getXValue().doubleValue()),\n observableList3.get(observableList1.size() - 1).getXValue().doubleValue());\n double newLowerBound = maxValue - chartRange;\n double newUpperBound = maxValue;\n m_pXAxis.setLowerBound(newLowerBound);\n m_pXAxis.setUpperBound(newUpperBound);\n m_pXAxis.setDisable(false);\n }\n }\n } finally {\n m_pLock.unlock();\n }\n }\n }));\n m_pAnimation.setCycleCount(Timeline.INDEFINITE);\n m_pAnimation.play();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n View contentView = inflater.inflate(R.layout.activity_stats, null, false);\n drawer.addView(contentView, 0);\n\n //initializing stats\n stats = FileIOUtils.loadSerializableFromFile(getIntent().getExtras().getString(ScheduleActivity.EXTRA_PATH_TO_STATS), this);\n fillStatsRandomlyForDebug(); //TODO tmp only, to show cool charts\n\n if (stats == null) {\n Log.d(TAG, \"unable to load stats from file!!! exiting activity\");\n finish();\n }\n\n barChart = (BarChart) findViewById(R.id.bar_chart);\n errorNoData = (TextView) findViewById(R.id.error_no_data);\n headerText = (TextView) findViewById(R.id.header_stats_text);\n Button next = (Button) findViewById(R.id.next);\n Button prev = (Button) findViewById(R.id.previous);\n Button switchButton = (Button) findViewById(R.id.switch_button);\n\n switchButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n if (isMonthDisplayed) {\n isMonthDisplayed = false;\n setupBarChart(StatsUtils.ensureNotSunday(timePeriodInChart), false);\n } else {\n isMonthDisplayed = true;\n setupBarChart(StatsUtils.ensureNotSunday(timePeriodInChart), true);\n }\n }\n });\n\n next.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n if (isMonthDisplayed) {\n timePeriodInChart.add(Calendar.MONTH, 1);\n setupBarChart(StatsUtils.ensureNotSunday(timePeriodInChart), true);\n } else {\n timePeriodInChart.add(Calendar.DATE, 7);\n setupBarChart(StatsUtils.ensureNotSunday(timePeriodInChart), false);\n }\n }\n });\n\n prev.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n if (isMonthDisplayed) {\n timePeriodInChart.add(Calendar.MONTH, -1);\n setupBarChart(StatsUtils.ensureNotSunday(timePeriodInChart), true);\n } else {\n timePeriodInChart.add(Calendar.DATE, -7);\n setupBarChart(StatsUtils.ensureNotSunday(timePeriodInChart), false);\n }\n }\n });\n\n //displaying barChart\n setupBarChart(StatsUtils.ensureNotSunday(new GregorianCalendar()), false);\n }", "private ListStore<Line> createLines() {\n\t\tStyleInjectorHelper.ensureInjected(CommonGanttResources.resources.css(), true);\n\n\t\tLineProperties lineProps = GWT.create(LineProperties.class);\n\t\tListStore<Line> store = new ListStore<Line>(lineProps.key());\n\t\tString customCssStyle = CommonGanttResources.resources.css().todayLineMain();\n\t\tLine line = new Line(new Date(), \"Текушая дата :\" + new Date().toString(), customCssStyle);\n\t\tstore.add(line);\n\t\treturn store;\n\t}", "public void setupGraphs(String selectedPeriod)\n {\n // Reset the view\n clearErrors();\n readingGraph.removeAllSeries();\n\n ReadingGrapher grapher = new ReadingGrapher(getContext());\n LineGraphSeries<DataPoint> series = null;\n\n // Get the correct series for the selected period\n switch (selectedPeriod)\n {\n case \"day\":\n series = grapher.getSeriesForDay();\n break;\n case \"week\":\n series = grapher.getSeriesForWeek();\n break;\n case \"month\":\n series = grapher.getSeriesForMonth();\n break;\n case \"year\":\n series = grapher.getSeriesForYear();\n break;\n }\n\n // Success!\n if (series != null)\n {\n readingGraph.addSeries(series);\n\n // set manual x bounds to have nice steps\n readingGraph.getViewport().setMinX(grapher.getEarliestTime());\n readingGraph.getViewport().setMaxX(grapher.getLatestTime());\n readingGraph.getViewport().setXAxisBoundsManual(true);\n }\n else\n {\n addError(getString(R.string.graph_no_data));\n }\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_history);\n\n\t\tdatasource = new HoofitSQLiteDataSource(this);\n\t\tdatasource.openDatabaseToWrite();\n\t\n\t\t// draw sin curve\n//\t\tint num = 150;\n\t\tint num = datasource.getTotalNumberOfEntries();\n\t\tLog.d(\"HISTORY\", \"total number of entries: \" + num);\n\t\tString stepCounts = datasource.getAllStepCounts();\n\t\tString[] steps = stepCounts.split(\" \");\n\t\tGraphViewData[] data = new GraphViewData[num];\n\t\tfor (int i=0; i<num; i++) {\n\t\t\tLog.d(\"HISTORY\", i + \" : \" + steps[i]);\n\t\t data[i] = new GraphViewData(i, Double.parseDouble(steps[i]));\n\t\t}\n\t\tGraphView graphView = new BarGraphView(\n\t\t this\n\t\t , \"\"\n\t\t);\n\t\t// add data\n\t\tgraphView.addSeries(new GraphViewSeries(data));\n\t\t// set view port, start=0, size=5\n\t\tgraphView.setViewPort(0, 10);\n\t\tgraphView.setScrollable(true);\n\t\t// optional - activate scaling / zooming\n\t\tgraphView.setScalable(true);\n \n\n LinearLayout layout = (LinearLayout) findViewById(R.id.graph1);\n layout.addView(graphView);\n\n\n\t}", "@DISPID(25)\n\t// = 0x19. The runtime will prefer the VTID if present\n\t@VTID(36)\n\t@ReturnValue(type = NativeType.Dispatch)\n\tcom4j.Com4jObject buildTrendGraph(\n\t\t\t@Optional @DefaultValue(\"\") java.lang.String groupByField,\n\t\t\t@Optional @DefaultValue(\"\") java.lang.String sumOfField,\n\t\t\t@Optional @DefaultValue(\"0\") int maxCols,\n\t\t\t@Optional @MarshalAs(NativeType.VARIANT) java.lang.Object filter,\n\t\t\t@Optional @MarshalAs(NativeType.VARIANT) java.lang.Object frDate,\n\t\t\t@Optional @DefaultValue(\"0\") boolean forceRefresh,\n\t\t\t@Optional @DefaultValue(\"0\") boolean showFullPath);", "private void invokeHistoricChart(StockData sd)\r\n {\r\n\r\n debug(\"invokeHistoricChart(\" + sd.getName().toString() + \") - preparing to change\");\r\n\r\n String fileName = getString(\"WatchListTableModule.edit.historic_details_basic_name\") + sd.getSymbol().getDataSz();\r\n java.io.File theFile = new java.io.File(fileName);\r\n\r\n // First signal the chart if we are demo mode, we really do not want a problem\r\n // Then create a new instance of our chart.\r\n com.stockmarket.chart.ohlc.HighLowStockChart.DEMO_MODE = this.DEMO_MODE;\r\n com.stockmarket.chart.ohlc.HighLowStockChart chart = new com.stockmarket.chart.ohlc.HighLowStockChart();\r\n // If we have historic data send it through\r\n if (theFile.exists())\r\n {\r\n debug(\"invokeHistoricChart() - \" + fileName + \" exists preparing the Historic Chart\");\r\n chart.displayHighLowChart(fileName);\r\n }\r\n else if (this.DEMO_MODE)\r\n {\r\n // If we are demo mode display the Chart. With its default data\r\n javax.swing.JOptionPane.showMessageDialog(\r\n null,\r\n \"Application is in DEMO Mode\\n\"\r\n + \"No historic data for \"\r\n + sd.getName().toString()\r\n + \" exists, displaying default graph.\");\r\n chart.displayHighLowChart(null);\r\n }\r\n else\r\n {\r\n // If we are live mode and no historic data - tell the user to try later.\r\n // This is the case where the user reached a item to display as a chart\r\n // before the program has finished downloading.\r\n javax.swing.JOptionPane.showMessageDialog(\r\n null,\r\n \"Application has no historic data for \" + sd.getName().toString() + \"\\nTry again later!\");\r\n }\r\n\r\n debug(\"invokeHistoricChart() - Processing completed\");\r\n }", "public void generateGraph() {\n\t\tMap<Integer, MovingFObject> map = sc.getInitPos();\r\n\t\tgraph = new boolean[map.size()][map.size()];\r\n\t\tfor(int i = 0; i < map.size(); i++) {\r\n\t\t\tMovingFObject cloned = map.get(i).duplicate();\r\n\t\t\tArrayList<Location> locs = sc.traceLinearMotion(i,sc.getMaxVelocity(),cloned.getGoal());\r\n\t\t\tfor(int j = 0; j < map.size(); j++) {\r\n\t\t\t\tif(j != i) {\r\n\t\t\t\t\tfor(int k = 0; k < locs.size(); k++) {\r\n\t\t\t\t\t\tcloned.setLocation(locs.get(k));\r\n\t\t\t\t\t\tif(cloned.locationTouchingLocation(1, map.get(j), 2)) {\r\n\t\t\t\t\t\t\tgraph[i][j] = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(cloned.locationTouchingLocation(1, map.get(j), 0)) {\r\n\t\t\t\t\t\t\tgraph[j][i] = true;\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}", "private LineDataSet createSet(){\n LineDataSet set = new LineDataSet(null, \"SPL Db\");\n set.setDrawCubic(true);\n set.setCubicIntensity(0.2f);\n set.setAxisDependency(YAxis.AxisDependency.LEFT);\n set.setColor(ColorTemplate.getHoloBlue());\n set.setLineWidth(2f);\n set.setCircleSize(4f);\n set.setFillAlpha(65);\n set.setFillColor(ColorTemplate.getHoloBlue());\n set.setHighLightColor(Color.rgb(244,117,177));\n set.setValueTextColor(Color.WHITE);\n set.setValueTextSize(10f);\n\n return set;\n }", "public void buildGraph(){\n\t}", "public List<GlucoseData> getHistoryOfDay(Date day) {\n SimpleDateFormat fmt = new SimpleDateFormat(\"yyyyMMdd\");\n List<GlucoseData> history = new ArrayList<>();\n\n String selectQuery = \"SELECT * FROM \" + TABLE_HISTORY;\n\n SQLiteDatabase db = getReadableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n cursor.moveToFirst();\n\n try {\n if (cursor.moveToFirst()) {\n do {\n GlucoseData glucosedata = new GlucoseData();\n glucosedata.setID(cursor.getInt(cursor.getColumnIndex(KEY_HISTORY_ID)));\n glucosedata.setDate(cursor.getString(cursor.getColumnIndex(KEY_HISTORY_DATE)));\n glucosedata.setGlucoseLevel(cursor.getInt(cursor.getColumnIndex(KEY_HISTORY_GLUCOSELEVEL)));\n glucosedata.setComment(cursor.getString(cursor.getColumnIndex(KEY_HISTORY_COMMENT)));\n\n\n Date datadate = sqlDateFormat.parse(glucosedata.getDate());\n // Adding to list\n if(fmt.format(day).equals(fmt.format(datadate))) {\n history.add(glucosedata);\n }\n } while(cursor.moveToNext());\n }\n } catch (Exception e) {\n\n } finally {\n if (cursor != null && !cursor.isClosed()) {\n cursor.close();\n }\n }\n\n return history;\n }", "private void setData() {\n LineDataSet set1 = new LineDataSet(valuesTemperature, \"Temperature\");\n\n set1.setColor(Color.RED);\n set1.setLineWidth(1.0f);\n set1.setDrawValues(false);\n set1.setDrawCircles(false);\n set1.setMode(LineDataSet.Mode.LINEAR);\n set1.setDrawFilled(false);\n\n // create a data object with the data sets\n LineData data = new LineData(set1);\n\n // set data\n chartTemperature.setData(data);\n\n // get the legend (only possible after setting data)\n Legend l = chartTemperature.getLegend();\n l.setEnabled(true);\n\n\n // create a dataset and give it a type\n set1 = new LineDataSet(valuesPressure, \"Pressure\");\n\n set1.setColor(Color.GREEN);\n set1.setLineWidth(1.0f);\n set1.setDrawValues(false);\n set1.setDrawCircles(false);\n set1.setMode(LineDataSet.Mode.LINEAR);\n set1.setDrawFilled(false);\n\n // create a data object with the data sets\n data = new LineData(set1);\n\n // set data\n chartPressure.setData(data);\n\n // get the legend (only possible after setting data)\n l = chartPressure.getLegend();\n l.setEnabled(true);\n\n\n\n // create a dataset and give it a type\n set1 = new LineDataSet(valuesAltitude, \"Altitude\");\n\n set1.setColor(Color.BLUE);\n set1.setLineWidth(1.0f);\n set1.setDrawValues(false);\n set1.setDrawCircles(false);\n set1.setMode(LineDataSet.Mode.LINEAR);\n set1.setDrawFilled(false);\n\n // create a data object with the data sets\n data = new LineData(set1);\n\n // set data\n chartAltitude.setData(data);\n\n // get the legend (only possible after setting data)\n l = chartAltitude.getLegend();\n l.setEnabled(true);\n }", "public void refreshGraph()\n {\n graph.getViewport().setMinX(0);\n graph.removeAllSeries();\n for(CustomPair<String, CustomPair<Integer, Integer>> can:cans)\n {\n series.get(can.getKey()).resetData(new DataPoint[]{});\n }\n initGraph(graph);\n graphViewEditText.setText(\"\");\n }", "public List<GlucoseData> getCompleteHistory() {\n List<GlucoseData> history = new ArrayList<>();\n\n String selectQuery = \"SELECT * FROM \" + TABLE_HISTORY;\n\n SQLiteDatabase db = getReadableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n cursor.moveToFirst();\n\n try {\n if (cursor.moveToFirst()) {\n do {\n GlucoseData glucosedata = new GlucoseData();\n glucosedata.setID(cursor.getInt(cursor.getColumnIndex(KEY_HISTORY_ID)));\n glucosedata.setDate(cursor.getString(cursor.getColumnIndex(KEY_HISTORY_DATE)));\n glucosedata.setGlucoseLevel(cursor.getInt(cursor.getColumnIndex(KEY_HISTORY_GLUCOSELEVEL)));\n glucosedata.setComment(cursor.getString(cursor.getColumnIndex(KEY_HISTORY_COMMENT)));\n\n // Adding to list\n history.add(glucosedata);\n } while(cursor.moveToNext());\n }\n } catch (Exception e) {\n\n } finally {\n if (cursor != null && !cursor.isClosed()) {\n cursor.close();\n }\n }\n\n return history;\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 HistoryGraph() {\n revisions = new HashSet<Revision>();\n orderedRevisions = new ArrayList<Revision>();\n }", "public void recalculate(){\n\t\t\n\t\tLinkedList<Line> primaryLines = lineLists.get(0);\n\t\t\n\t\tfor (int i = 0; i < controlPoints.size()-1; i++){\n\t\t\tControlPoint current = controlPoints.get(i);\n\t\t\tControlPoint next = controlPoints.get(i+1);\n\t\t\t\n\t\t\tLine line = primaryLines.get(i);\n\t\t\t\n\t\t\tline.setStartX(current.getCenterX());\n\t\t\tline.setStartY(current.getCenterY());\n\t\t\tline.setEndX(next.getCenterX());\n\t\t\tline.setEndY(next.getCenterY());\n\t\t}\n\t}", "private ArrayList<Entry> setYAxisValues(){\n ArrayList<Entry> yVals = new ArrayList<Entry>();\n for (int z = 0; z < 235; z++) {\n yVals.add(new Entry((float)graphArray[z], z));\n }\n return yVals;\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 displayActiveData(JSONObject[] jsonObjects) {\r\n final SharedPreferences sharedPref = getSharedPreferences(getString(R.string.pref_file_key),\r\n Context.MODE_PRIVATE);\r\n\r\n int activeGoal = sharedPref.getInt(getResources().getString(R.string.active_goal_key), 0);\r\n\r\n int[] activeTime = {};\r\n try {\r\n // Populate array of active time for each day\r\n JSONArray fairlyActiveArray = jsonObjects[0]\r\n .getJSONArray(\"activities-minutesFairlyActive\");\r\n JSONArray veryActiveArray = jsonObjects[1]\r\n .getJSONArray(\"activities-minutesVeryActive\");\r\n\r\n activeTime = new int[fairlyActiveArray.length()];\r\n\r\n for(int i = 0; i < fairlyActiveArray.length(); i++) {\r\n int fairlyActiveMins = Integer.parseInt(fairlyActiveArray.getJSONObject(i)\r\n .getString(\"value\"));\r\n\r\n int veryActiveMins = Integer.parseInt(veryActiveArray.getJSONObject(i)\r\n .getString(\"value\"));\r\n\r\n activeTime[i] = fairlyActiveMins + veryActiveMins;\r\n }\r\n\r\n } catch(JSONException | NullPointerException e) {\r\n fitbitRequestError();\r\n return;\r\n }\r\n\r\n BarChart chart = findViewById(R.id.chart);\r\n\r\n ArrayList<BarEntry> entriesDay = new ArrayList<>();\r\n ArrayList<BarEntry> entriesSum = new ArrayList<>();\r\n int[] sumColours = new int[7];\r\n\r\n // For each day in the week create two bars, one showing the daily active time and one\r\n // for the running total.\r\n // If there is no data create a bar with value 0 so the day is still shown on the graph.\r\n float dayValue, sumValue = 0f;\r\n for (int i = 0; i < 7; i++) {\r\n if (i < activeTime.length) {\r\n dayValue = (float) activeTime[i];\r\n sumValue += dayValue;\r\n } else {\r\n dayValue = 0f;\r\n sumValue = 0f;\r\n }\r\n\r\n entriesDay.add(new BarEntry((float) i, dayValue));\r\n entriesSum.add(new BarEntry((float) i, sumValue));\r\n\r\n sumColours[i] = getResources().getColor(getProgressColour((int) sumValue,\r\n activeGoal));\r\n }\r\n\r\n // Show data on chart\r\n BarDataSet dataSetDay = new BarDataSet(entriesDay, \"1\");\r\n dataSetDay.setColor(getResources().getColor(R.color.colorGraph2));\r\n dataSetDay.setDrawValues(false);\r\n\r\n BarDataSet dataSetSum = new BarDataSet(entriesSum, \"2\");\r\n dataSetSum.setColors(sumColours);\r\n dataSetSum.setDrawValues(false);\r\n\r\n BarData barData = new BarData(dataSetDay, dataSetSum);\r\n\r\n chart.setData(barData);\r\n chart.getBarData().setBarWidth(chart.getBarData().getBarWidth() / 2);\r\n chart.groupBars(chart.getXAxis().getAxisMinimum(), 0.15f, 0f);\r\n\r\n // Create legend for the two datasets\r\n List<LegendEntry> legendEntries = new ArrayList<>();\r\n legendEntries.add(createLegendEntry(R.color.colorGraph2,\r\n getString(R.string.active_legend_daily)));\r\n if(activeGoal > 0) { // if the user has set an active time goal\r\n legendEntries.add(createLegendEntry(R.color.colorProgressRed, null));\r\n legendEntries.add(createLegendEntry(R.color.colorProgressAmber, null));\r\n legendEntries.add(createLegendEntry(R.color.colorProgressYellow, null));\r\n legendEntries.add(createLegendEntry(R.color.colorProgressGreen,\r\n getString(R.string.active_legend_total)));\r\n } else { // if they have not set a goal\r\n legendEntries.add(createLegendEntry(R.color.colorProgressGrey,\r\n getString(R.string.active_legend_total)));\r\n }\r\n\r\n chart.getLegend().setCustom(legendEntries);\r\n chart.invalidate();\r\n\r\n // Show active time goal\r\n String unit = getResources().getString(R.string.active_unit);\r\n TextView textViewSummary = findViewById(R.id.tv_goal_summary);\r\n if(activeGoal > 0) {\r\n textViewSummary.setText(getResources().getString(R.string.goal_value_unit,\r\n activeGoal, unit));\r\n } else {\r\n textViewSummary.setText(getResources().getString(R.string.no_goal_set));\r\n }\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_graph, container, false);\n mChart = (LineChart) rootView.findViewById(R.id.historical_chart);\n Paint p = mChart.getPaint(Chart.PAINT_INFO);\n p.setColor(getResources().getColor(android.support.v7.appcompat.R.color.material_grey_300));\n p.setTextSize(getResources().getDimensionPixelSize(R.dimen.graph_error_text_size));\n if(mStockDetail != null && mStockDetail.getHistoryStr() != null) {\n TextView stockName = (TextView) rootView.findViewById(R.id.stock_name);\n stockName.setText(mStockDetail.getName() + StockAdapter.OPEN_BRACE + mStockDetail.getSymbol() + StockAdapter.CLOSE_BRACE);\n stockName.setContentDescription(mStockDetail.getName() + StockAdapter.OPEN_BRACE + mStockDetail.getSymbol() + StockAdapter.CLOSE_BRACE);\n //mChart = (LineChart) rootView.findViewById(R.id.historical_chart);\n // no description text\n mChart.getDescription().setEnabled(false);\n\n // enable touch gestures\n mChart.setTouchEnabled(true);\n\n // enable scaling and dragging\n mChart.setDragEnabled(true);\n mChart.setScaleEnabled(true);\n mChart.setDrawGridBackground(false);\n mChart.setHighlightPerDragEnabled(true);\n // set an alternative background color\n\n //mChart.setBackgroundColor(Color.WHITE);\n\n // get the legend (only possible after setting data)\n Legend l = mChart.getLegend();\n l.setEnabled(false);\n\n XAxis xAxis = mChart.getXAxis();\n //xAxis.setPosition(XAxis.XAxisPosition.TOP_INSIDE);\n //xAxis.setTextSize(10f);\n xAxis.setTextColor(Color.WHITE);\n xAxis.setDrawAxisLine(false);\n xAxis.setDrawGridLines(false);\n xAxis.setCenterAxisLabels(true);\n //xAxis.setGranularity(1f); // one hour\n xAxis.setValueFormatter(new IAxisValueFormatter() {\n\n //private SimpleDateFormat mFormat = new SimpleDateFormat(\"dd MMM yy\");\n private SimpleDateFormat mFormat = new SimpleDateFormat(\"dd MMM yy\");\n\n @Override\n public String getFormattedValue(float value, AxisBase axis) {\n\n //long millis = TimeUnit.HOURS.toMillis((long) value);\n return mFormat.format(new Date((long) value));\n }\n });\n\n YAxis leftAxis = mChart.getAxisLeft();\n leftAxis.setPosition(YAxis.YAxisLabelPosition.INSIDE_CHART);\n leftAxis.setTextColor(Color.WHITE);\n leftAxis.setDrawGridLines(false);\n leftAxis.setGranularityEnabled(true);\n leftAxis.setDrawLabels(true);\n final DecimalFormat dollarFormat = (DecimalFormat) NumberFormat.getCurrencyInstance(Locale.US);\n leftAxis.setValueFormatter(new IAxisValueFormatter() {\n @Override\n public String getFormattedValue(float value, AxisBase axis) {\n return dollarFormat.format(value);\n }\n });\n YAxis rightAxis = mChart.getAxisRight();\n rightAxis.setEnabled(false);\n\n\n LineDataSet dataSet = new LineDataSet(mStockDetail.getDataEntries(), \"Label\"); // add entries to dataset\n dataSet.setColor(Color.WHITE);\n //dataSet.setCircleColor(Color.BLUE);\n dataSet.setDrawCircles(false);\n dataSet.setDrawFilled(true);\n //dataSet.setFillColor(R.color.colorPrimary);\n LineData lineData = new LineData(dataSet);\n //lineData.setDrawValues(false);\n //lineData.setValueTextSize(10f);\n lineData.setValueTextColor(Color.WHITE);\n mChart.setData(lineData);\n mChart.notifyDataSetChanged();\n mChart.invalidate(); // refresh\n mChart.setContentDescription(getString(R.string.a11y_history_graph,\n Float.toString(mChart.getYMin()), Float.toString(mChart.getYMax())));\n }\n return rootView;\n }", "private void updatePerformanceGraph(boolean isUpdate, PortfolioRecord portRecord) {\n XYChart.Series<String, Double> series = new XYChart.Series<>();\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"M/d/yy\");\n List<DataPoint> history = portRecord.getHistory();\n boolean lowerBoundFound = false;\n\n for (int i = 0; i < history.size(); i++) {\n DataPoint dataPoint = history.get(i);\n LocalDate date = dataPoint.getDate();\n double moneyMade = dataPoint.getMarketCloseValue() - dataPoint.getMoneyInvested();\n double percentReturn = (dataPoint.getMarketCloseValue() - dataPoint.getMoneyInvested()) / dataPoint.getMoneyInvested() * 100;\n\n if (date.compareTo(toDateBound) > 0) {\n toDateBound = history.get(i - 1).getDate();\n\n break;\n } else if (date.equals(toDateBound)) {\n series.getData().add(new XYChart.Data<>(date.format(formatter), currMode == Mode.GROSS_PROFITS ? moneyMade : percentReturn));\n\n break;\n } else if (date.compareTo(fromDateBound) > 0 && !lowerBoundFound) {\n series.getData().add(new XYChart.Data<>(date.format(formatter), currMode == Mode.GROSS_PROFITS ? moneyMade : percentReturn));\n lowerBoundFound = true;\n fromDateBound = date;\n\n } else if (date.equals(fromDateBound)) {\n series.getData().add(new XYChart.Data<>(date.format(formatter), currMode == Mode.GROSS_PROFITS ? moneyMade : percentReturn));\n lowerBoundFound = true;\n } else if (date.compareTo(fromDateBound) > 0 && date.compareTo(toDateBound) < 0) {\n series.getData().add(new XYChart.Data<>(date.format(formatter), currMode == Mode.GROSS_PROFITS ? moneyMade : percentReturn));\n }\n }\n\n if (series.getData().size() > MAX_DATA_POINTS) {\n series = resizeDataSeries(series);\n }\n\n formatYAxis();\n\n performanceGraph.getData().clear();\n performanceGraph.getData().add(series);\n overviewController.performanceManagerFinished(isUpdate, fromDateBound, toDateBound);\n }", "public List<HistoryVisit> extractHistory(Date startDate, Date endDate) throws HistoryMinerException {\r\n final String queryTemplate = \r\n \"SELECT visits.id, visits.visit_date, visits.visit_type, visits.session, places.id, places.url, places.title, \" +\r\n \"from_visits.id, from_places.url \" + \r\n \"FROM moz_historyvisits AS visits JOIN moz_places AS places ON visits.place_id = places.id \" +\r\n \"LEFT OUTER JOIN moz_historyvisits AS from_visits ON visits.from_visit = from_visits.id \" + \r\n \"LEFT OUTER JOIN moz_places AS from_places ON from_visits.place_id = from_places.id \" +\r\n \"WHERE visits.visit_date > %d \" + \r\n \"AND visits.visit_date < %d \" +\r\n \"ORDER BY visits.id\";\r\n\r\n List<HistoryVisit> results = new ArrayList<HistoryVisit>();\r\n \r\n try {\r\n Connection conn = null;\r\n Statement stmt = null;\r\n try {\r\n conn = DriverManager.getConnection(JDBC_SQLITE + this.getFirefoxHistoryDbPath());\r\n stmt = conn.createStatement();\r\n \r\n String query = String.format(queryTemplate, dateToPRTime(startDate), dateToPRTime(endDate));\r\n ResultSet rs = stmt.executeQuery(query);\r\n \r\n while (rs.next()) {\r\n long visitId = rs.getLong(1);\r\n Date visitDate = prTimeToDate(rs.getLong(2));\r\n int visitType = rs.getInt(3);\r\n long sessionId = rs.getLong(4);\r\n long locationId = rs.getLong(5);\r\n String url = rs.getString(6);\r\n String title = rs.getString(7);\r\n long fromVisitId = rs.getLong(8);\r\n String fromUrl = rs.getString(9);\r\n \r\n if (log.isTraceEnabled()) {\r\n StringBuilder logMsg = new StringBuilder();\r\n logMsg.append(DateFormat.getInstance().format(visitDate));\r\n logMsg.append('|');\r\n logMsg.append(Integer.toString(visitType));\r\n logMsg.append('|');\r\n logMsg.append(url == null ? NULL : url);\r\n logMsg.append('|');\r\n logMsg.append(title == null ? NULL : title);\r\n logMsg.append('|');\r\n logMsg.append(fromUrl == null ? NULL : fromUrl);\r\n logMsg.append(LINE_SEPARATOR);\r\n log.trace(logMsg.toString());\r\n }\r\n \r\n results.add(new HistoryVisit(visitId, visitDate, visitType, sessionId, locationId, url, title, fromVisitId, fromUrl));\r\n }\r\n } finally {\r\n if (stmt != null) { stmt.close(); }\r\n if (conn != null) { conn.close(); }\r\n }\r\n } catch (Exception e) {\r\n throw new HistoryMinerException(\r\n \"Error while processing SQLite output and generating file: \" + e, e);\r\n } \r\n return results;\r\n }", "private XYSeries createSeries() {\r\n return createSeries(0);\r\n }", "public void updateChart(){\n for(Pair<Number,Number> p : sss.getPopulationQueue()){\n this.population.getData().add(new XYChart.Data<>(p.getKey(),p.getValue()));\n }\n for(Pair<Number,Number> p : sss.getDeathsQueue()){\n this.deaths.getData().add(new XYChart.Data<>(p.getKey(),p.getValue()));\n }\n for(Pair<Number,Number> p : sss.getInfectionsQueue()){\n this.infections.getData().add(new XYChart.Data<>(p.getKey(),p.getValue()));\n }\n for(Pair<Number,Number> p : sss.getHealsQueue()){\n this.heals.getData().add(new XYChart.Data<>(p.getKey(),p.getValue()));\n }\n sss.clearPopulationQueue();\n sss.clearDeathsQueue();\n sss.clearInfectionsQueue();\n sss.clearHealsQueue();\n }", "private void prepareTimeline() {\n // Every frame to take any data from queue and add to chart\n new AnimationTimer() {\n @Override\n public void handle(long now) {\n int i = -1;\n for (NumberSeries numberSeries : AreaChartSample.this.numberSeries) {\n i = Math.max(i, numberSeries.updateSerie());\n }\n if (i >= 0) {\n updateAxis(i);\n }\n }\n }.start();\n }", "@Override\n public void updateHistory() {\n List<Integer> allItemIds = determineItemIds();\n if (allItemIds == null || allItemIds.size() == 0) {\n Log.i(TAG, \"No Item Ids exists to create history data sets.\");\n return;\n }\n\n long processTs = System.currentTimeMillis();\n long startLastMonth;\n long endLastMonth;\n // determine the last month depending from the process timestamp. In the first iteration\n // the process timestamp is the current timestamp. With the second iteration,\n startLastMonth = DateHelper.startOfLastMonth(processTs);\n endLastMonth = DateHelper.endOfLastMonth(processTs);\n // iterate through all known IDs. This is required because we want to create a history entry\n // for each item\n for (int itemId : allItemIds) {\n updatePriceHistory(itemId, startLastMonth, endLastMonth);\n }\n }", "public ArrayList<Double> getGraphData(String dependent_variable, Date start_time, Date end_time, String increment) {\n ArrayList<Double> valueList = new ArrayList<Double>();\n\n try {\n FileInputStream in = context.openFileInput(increment + \"_\" + dependent_variable + \"_data\");\n InputStreamReader inputStreamReader = new InputStreamReader(in);\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n String line;\n\n while ((line = bufferedReader.readLine()) != null) {\n try {\n String time_string = line.substring(0, line.indexOf(';'));\n DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n df.setTimeZone(SimpleTimeZone.getTimeZone(\"US/Central\"));\n Date time = df.parse(time_string);\n Double value = Double.parseDouble(line.substring(line.indexOf(';') + 1, line.length()));\n if (!time.after(end_time) && !time.before(start_time)) {\n valueList.add(value);\n }\n }\n catch (Exception e){\n Log.i(\"getGraphData\", \"exception: line = \" + line);\n e.printStackTrace();\n }\n }\n }\n catch (Exception e){\n e.printStackTrace();\n }\n return valueList;\n }", "public void populateDataForVisitTimeReport(final Date startDate, final Date endDate,\n final List<String> companyCodes) {\n\n // reset\n this.mapCompanyBranchVsListEmployee = new HashMap<>();\n this.mapCompanyBranchVsListOfPurposes = new HashMap<>();\n this.mapCompanyBranchVsVisitTimes = new HashMap<>();\n this.mapCompanyBranchPurposeVsVisitTimes = new HashMap<>();\n this.mapCompanyBranchEmployeePurposeVsVisitTimes = new HashMap<>();\n this.mapCompanyBranchEmployeeVsVisitTimes = new HashMap<>();\n // init\n for (final String companyCode : companyCodes) {\n for (final String branchCode : SummaryReportService.BRANCHES.keySet()) {\n final String key =\n String.format(SummaryReportService.COMPANY_BRANCH_KEY_PATTERN, companyCode, branchCode);\n this.mapCompanyBranchVsListEmployee.put(key, new ArrayList<Integer>());\n this.mapCompanyBranchVsListOfPurposes.put(key, new ArrayList<Short>());\n this.mapCompanyBranchVsVisitTimes.put(key, 0);\n }\n }\n\n final List<Daily_report> listDailyReport = this.getListVisited(startDate, endDate, companyCodes);\n\n for (final Daily_report daily : listDailyReport) {\n final String companyCode = daily.getDai_company_code();\n String branchCode = daily.getDai_point_code();\n\n final int employeeCode = daily.getDai_employee_code();\n final boolean isHQ = daily.getEmployee_mst().getEmp_settle_authority() == AuthorityLevels.HEAD_QUARTER;\n if (isHQ) {\n branchCode = SummaryReportConstants.HQ_CODE;\n }\n final String companyBranchKey =\n String.format(SummaryReportService.COMPANY_BRANCH_KEY_PATTERN, companyCode, branchCode);\n\n if (this.mapCompanyBranchVsListEmployee.containsKey(companyBranchKey)) {\n if (!this.mapCompanyBranchVsListEmployee.get(companyBranchKey).contains(employeeCode)) {\n this.mapCompanyBranchVsListEmployee.get(companyBranchKey).add(employeeCode);\n }\n }\n if (this.mapCompanyBranchVsListOfPurposes.containsKey(companyBranchKey)) {\n if (!this.mapCompanyBranchVsListOfPurposes.get(companyBranchKey)\n .contains(daily.getDai_work_tancode())) {\n this.mapCompanyBranchVsListOfPurposes.get(companyBranchKey).add(daily.getDai_work_tancode());\n }\n }\n if (this.mapCompanyBranchVsVisitTimes.containsKey(companyBranchKey)) {\n this.mapCompanyBranchVsVisitTimes.put(companyBranchKey,\n this.mapCompanyBranchVsVisitTimes.get(companyBranchKey) + 1);\n }\n else {\n this.mapCompanyBranchVsVisitTimes.put(companyBranchKey, 0);\n }\n\n final String companyBranchPurposeKey =\n String.format(SummaryReportService.COMPANY_BRANCH_PURPOSE_KEY_PATTERN, companyCode, branchCode,\n daily.getDai_work_tancode());\n this.updateCountersOfMap(this.mapCompanyBranchPurposeVsVisitTimes, companyBranchPurposeKey);\n\n final String companyBranchEmployeeKey = String.format(\n SummaryReportService.COMPANY_BRANCH_EMPLOYEE_KEY_PATTERN, companyCode, branchCode, employeeCode);\n this.updateCountersOfMap(this.mapCompanyBranchEmployeeVsVisitTimes, companyBranchEmployeeKey);\n\n final String companyBranchEmployeePurposeKey =\n String.format(SummaryReportService.COMPANY_BRANCH_EMPLOYEE_PURPOSE_KEY_PATTERN, companyCode,\n branchCode, employeeCode, daily.getDai_work_tancode());\n this.updateCountersOfMap(this.mapCompanyBranchEmployeePurposeVsVisitTimes, companyBranchEmployeePurposeKey);\n }\n\n }", "private void buildDaily(SummaryProvider.Summary summary, int log_id, String suffix,\n long midnight, int dataIndex, Bundle bundle) {\n ArrayList<DetailProvider.Detail> details = detailDB.getDetails(context, log_id);\n double[] raw_xdata = new double[details.size() + 2];\n double[] raw_ydata = new double[details.size() + 2];\n\n // set the first x and y values\n int xstart = bundle.getInt(\"xorigin\" + suffix, 0);\n raw_xdata[0] = xstart - 3600;\n switch (dataIndex) {\n case Constants.DATA_WATTHOURS :\n raw_ydata[0] = 0.0f; break;\n case Constants.DATA_WATTSNOW:\n raw_ydata[0] = 0.0f; break;\n case Constants.DATA_TEMPERATURE:\n raw_ydata[0] = details.get(0).getTemperature() - 273; break;\n case Constants.DATA_WIND:\n raw_ydata[0] = details.get(0).getWind_speed(); break;\n case Constants.DATA_CLOUDS:\n raw_ydata[0] = UtilsMisc.getValueinRange(details.get(0).getClouds(), 1.0f, 100.0f); break;\n default :\n break;\n }\n\n // set the y values from the detail records\n for (int i = 1; i < details.size() + 1; i++) {\n DetailProvider.Detail detail = details.get(i-1);\n raw_xdata[i] = UtilsDate.getTimeSeconds((detail.getTimestamp() * 1000) - midnight);\n switch (dataIndex) {\n case Constants.DATA_WATTHOURS :\n raw_ydata[i] = detail.getWatts_generated(); break;\n case Constants.DATA_WATTSNOW:\n raw_ydata[i] = detail.getWatts_now();break;\n case Constants.DATA_TEMPERATURE:\n raw_ydata[i] = detail.getTemperature() - 273; break;\n case Constants.DATA_WIND:\n raw_ydata[i] = detail.getWind_speed(); break;\n case Constants.DATA_CLOUDS:\n raw_ydata[i] = UtilsMisc.getValueinRange(detail.getClouds(), 1.0f, 100.0f); break;\n default :\n break;\n }\n }\n\n // set the last y value\n int xend = UtilsDate.getTimeSeconds(details.get(details.size()-1).getTimestamp()* 1000 - midnight);\n raw_xdata[details.size()+1] = xend + 1;\n switch (dataIndex) {\n case Constants.DATA_WATTHOURS :\n raw_ydata[details.size() + 1] = summary.getGenerated_watts(); break;\n case Constants.DATA_WATTSNOW:\n raw_ydata[details.size() + 1] = 0.0f; break;\n case Constants.DATA_TEMPERATURE:\n raw_ydata[details.size() + 1] = details.get(details.size()-1).getTemperature() - 273; break;\n case Constants.DATA_WIND:\n raw_ydata[details.size() + 1] = details.get(details.size()-1).getWind_speed(); break;\n case Constants.DATA_CLOUDS:\n raw_ydata[details.size() + 1] =\n UtilsMisc.getValueinRange(details.get(details.size()-1).getClouds(), 1.0f, 100.0f); break;\n default :\n break;\n }\n\n LinearInterpolation lp = new LinearInterpolation(raw_xdata, raw_ydata);\n int time = xstart;\n ArrayList<Integer> xList = new ArrayList<>();\n ArrayList<Float> yList = new ArrayList<>();\n while (time < xend) {\n float yval = (float) lp.interpolate(time);\n xList.add(time);\n yList.add(yval);\n time += Integer.parseInt(sharedPreferences.getString(Constants.MONITORING_FREQUENCY, \"5\")) * 60; // seconds\n }\n\n int[] xdata = Ints.toArray(xList);\n float[] ydata = Floats.toArray(yList);\n bundle.putIntArray(\"xdata\" + suffix, xdata);\n bundle.putFloatArray(\"ydata\" + suffix, ydata);\n\n switch (dataIndex) {\n case Constants.DATA_TEMPERATURE:\n case Constants.DATA_WIND:\n case Constants.DATA_CLOUDS:\n smooth_plot(bundle, true, suffix);\n }\n }", "private void prepareData(List<String[]> subset, Set<String> selections) {\n Bundle chartBundle = new Bundle();\n //Get the years and user selected data for the graph\n ArrayList<String> year = new ArrayList<>();\n ArrayList<ArrayList<Float>> data = new ArrayList<>();\n ArrayList<String> options = new ArrayList<>();\n float max=Float.MIN_VALUE;\n float min=Float.MAX_VALUE;\n boolean useLog = false;\n for (String option : selections) {\n //Loop over options\n ArrayList<Float> dataSeries = new ArrayList<>();\n int numOption = Integer.parseInt(option);\n //For every option get data required for the option\n options.add(OPTION_NAMES[numOption]);\n for (String[] line : subset) {\n dataSeries.add(Float.valueOf(line[numOption + CONSTANT]));\n }\n //Keep track of maximum of minimum values user has requested\n float tempMax = Collections.max(dataSeries);\n float tempMin = Collections.min(dataSeries);\n if (tempMax>max){\n max = tempMax;\n }\n if (tempMin<min && tempMin!=0){\n min=tempMin;\n }\n //Add user option to overall data they want to see\n data.add(dataSeries);\n }\n for (String[] line : subset) {\n //Loop preparing list of labels for X Axis\n year.add(line[2]);\n }\n if ((max/min)>50){\n //If the biggest and smallest values have a range bigger than factor of 50 then convert values to log scale\n useLog=true;\n for (int i=0;i<data.size();i++){\n //Loop which removes the data entries, converts them to log and then places them back to their original position in ArrayList\n ArrayList<Float> tempEntry = data.get(i);\n data.remove(i);\n ArrayList<Float> convertedValues = convertToLog(tempEntry);\n data.add(i,convertedValues);\n }\n }\n //Putting all the values in the Bundle in preparation for ChartActivity\n chartBundle.putSerializable(\"Data\", data);\n chartBundle.putString(\"country\", user_choice);\n chartBundle.putSerializable(\"Label\", options);\n chartBundle.putSerializable(\"year\", year);\n chartBundle.putBoolean(\"log\",useLog);\n Intent chart_intent = new Intent(this, ChartActivity.class);\n chart_intent.putExtra(\"Bundle\", chartBundle);\n startActivity(chart_intent);\n }", "private XYDataset createDataset() {\n\t \tXYSeriesCollection dataset = new XYSeriesCollection();\n\t \t\n\t \t//Definir cada Estacao\n\t\t XYSeries aes1 = new XYSeries(\"Estação1\");\n\t\t XYSeries aes2 = new XYSeries(\"Estação2\");\n\t\t XYSeries aes3 = new XYSeries(\"Estação3\");\n\t\t XYSeries aes4 = new XYSeries(\"Estação4\");\n\t\t XYSeries aes5 = new XYSeries(\"Estação5\");\n\t\t XYSeries aes6 = new XYSeries(\"Estação6\");\n\t\t XYSeries aes7 = new XYSeries(\"Estação7\");\n\t\t XYSeries aes8 = new XYSeries(\"Estação8\");\n\t\t XYSeries aes9 = new XYSeries(\"Estação9\");\n\t\t XYSeries aes10 = new XYSeries(\"Estação10\");\n\t\t XYSeries aes11 = new XYSeries(\"Estação11\");\n\t\t XYSeries aes12 = new XYSeries(\"Estação12\");\n\t\t XYSeries aes13 = new XYSeries(\"Estação13\");\n\t\t XYSeries aes14 = new XYSeries(\"Estação14\");\n\t\t XYSeries aes15 = new XYSeries(\"Estação15\");\n\t\t XYSeries aes16 = new XYSeries(\"Estação16\");\n\t\t \n\t\t //Definir numero de utilizadores em simultaneo para aparece na Interface\n\t\t XYSeries au1 = new XYSeries(\"AU1\");\n\t\t XYSeries au2 = new XYSeries(\"AU2\");\n\t\t XYSeries au3 = new XYSeries(\"AU3\");\n\t\t XYSeries au4 = new XYSeries(\"AU4\");\n\t\t XYSeries au5 = new XYSeries(\"AU5\");\n\t\t XYSeries au6 = new XYSeries(\"AU6\");\n\t\t XYSeries au7 = new XYSeries(\"AU7\");\n\t\t XYSeries au8 = new XYSeries(\"AU8\");\n\t\t XYSeries au9 = new XYSeries(\"AU9\");\n\t\t XYSeries au10 = new XYSeries(\"AU10\");\n\t\t \n\t\t //Colocar estacoes no gráfico\n\t\t aes1.add(12,12);\n\t\t aes2.add(12,37);\n\t\t aes3.add(12,62);\n\t\t aes4.add(12,87);\n\t\t \n\t\t aes5.add(37,12);\n\t\t aes6.add(37,37);\n\t\t aes7.add(37,62);\n\t\t aes8.add(37,87);\n\t\t \n\t\t aes9.add(62,12); \n\t\t aes10.add(62,37);\n\t\t aes11.add(62,62);\n\t\t aes12.add(62,87);\n\t\t \n\t\t aes13.add(87,12);\n\t\t aes14.add(87,37);\n\t\t aes15.add(87,62);\n\t\t aes16.add(87,87);\n\t\t \n\t\t//Para a bicicleta 1\n\t\t \t\n\t\t\t for(Entry<String, String> entry : position1.entrySet()) {\n\t\t\t\t String key = entry.getKey();\n\t\t\t\t \n\t\t\t\t String[] part= key.split(\",\");\n\t\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t\t \n\t\t\t\t au1.add(keyX,keyY);\n\t\t\t }\n\t\t \n\t\t\t //Para a bicicleta 2\n\t\t for(Entry<String, String> entry : position2.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au2.add(keyX,keyY);\n\t\t }\n\t\t \n\t\t //Para a bicicleta 3\n\t\t for(Entry<String, String> entry : position3.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au3.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position4.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au4.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position5.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au5.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position6.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au6.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position7.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au7.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position8.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au8.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position9.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au9.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position10.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au10.add(keyX,keyY);\n\t\t }\n\t\t \n\t\t //Add series to dataset\n\t\t dataset.addSeries(au1);\n\t\t dataset.addSeries(au2);\n\t\t dataset.addSeries(au3);\n\t\t dataset.addSeries(au4);\n\t\t dataset.addSeries(au5);\n\t\t dataset.addSeries(au6);\n\t\t dataset.addSeries(au7);\n\t\t dataset.addSeries(au8);\n\t\t dataset.addSeries(au9);\n\t\t dataset.addSeries(au10);\n\t\t \n\t\t \n\t\t dataset.addSeries(aes1);\n\t\t dataset.addSeries(aes2);\n\t\t dataset.addSeries(aes3);\n\t\t dataset.addSeries(aes4);\n\t\t dataset.addSeries(aes5);\n\t\t dataset.addSeries(aes6);\n\t\t dataset.addSeries(aes7);\n\t\t dataset.addSeries(aes8);\n\t\t dataset.addSeries(aes9);\n\t\t dataset.addSeries(aes10);\n\t\t dataset.addSeries(aes11);\n\t\t dataset.addSeries(aes12);\n\t\t dataset.addSeries(aes13);\n\t\t dataset.addSeries(aes14);\n\t\t dataset.addSeries(aes15);\n\t\t dataset.addSeries(aes16);\n\t\t \n\t\t return dataset;\n\t }", "private void addOrReplaceDataSeries() {\n int chartMode;\n try {\n m_pLock.lock();\n chartMode = mChartMode;\n } finally {\n m_pLock.unlock();\n }\n\n if (m_pLineChart.getData().size() > 0) {\n m_pLineChart.getData().clear();\n }\n\n switch (chartMode) {\n case CHART_MODE_2_SECONDS:\n m_pLineChart.getData().add(m_pDataSeries1_2SEC);\n m_pLineChart.getData().add(m_pDataSeries2_2SEC);\n m_pLineChart.getData().add(m_pDataSeries3_2SEC);\n break;\n case CHART_MODE_10_SECONDS:\n m_pLineChart.getData().add(m_pDataSeries1_10SEC);\n m_pLineChart.getData().add(m_pDataSeries2_10SEC);\n m_pLineChart.getData().add(m_pDataSeries3_10SEC);\n break;\n case CHART_MODE_30_SECONDS:\n m_pLineChart.getData().add(m_pDataSeries1_30SEC);\n m_pLineChart.getData().add(m_pDataSeries2_30SEC);\n m_pLineChart.getData().add(m_pDataSeries3_30SEC);\n break;\n case CHART_MODE_5_MINUTES:\n m_pLineChart.getData().add(m_pDataSeries1_5MIN);\n m_pLineChart.getData().add(m_pDataSeries2_5MIN);\n m_pLineChart.getData().add(m_pDataSeries3_5MIN);\n break;\n default:\n break;\n }\n\n m_pXAxis.setDisable(true);\n int chartRange;\n int tickUnit;\n ObservableList<XYChart.Data<Number, Number>> observableList1, observableList2, observableList3;\n switch (mChartMode) {\n case CHART_MODE_2_SECONDS:\n observableList1 = m_pDataSerieObservableList1_2SEC;\n observableList2 = m_pDataSerieObservableList2_2SEC;\n observableList3 = m_pDataSerieObservableList3_2SEC;\n chartRange = X_AXIS_RANGE_2_SECOND_MODE;\n tickUnit = X_AXIS_TICK_2_SECOND_MODE;\n break;\n case CHART_MODE_10_SECONDS:\n observableList1 = m_pDataSerieObservableList1_10SEC;\n observableList2 = m_pDataSerieObservableList2_10SEC;\n observableList3 = m_pDataSerieObservableList3_10SEC;\n chartRange = X_AXIS_RANGE_10_SECOND_MODE;\n tickUnit = X_AXIS_TICK_10_SECOND_MODE;\n break;\n case CHART_MODE_30_SECONDS:\n observableList1 = m_pDataSerieObservableList1_30SEC;\n observableList2 = m_pDataSerieObservableList2_30SEC;\n observableList3 = m_pDataSerieObservableList3_30SEC;\n chartRange = X_AXIS_RANGE_30_SECOND_MODE;\n tickUnit = X_AXIS_TICK_30_SECOND_MODE;\n break;\n case CHART_MODE_5_MINUTES:\n observableList1 = m_pDataSerieObservableList1_5MIN;\n observableList2 = m_pDataSerieObservableList2_5MIN;\n observableList3 = m_pDataSerieObservableList3_5MIN;\n chartRange = X_AXIS_RANGE_5_MINUTE_MODE;\n tickUnit = X_AXIS_TICK_5_MINUTE_MODE;\n break;\n default:\n observableList1 = m_pDataSerieObservableList1_2SEC;\n observableList2 = m_pDataSerieObservableList2_2SEC;\n observableList3 = m_pDataSerieObservableList3_2SEC;\n chartRange = X_AXIS_RANGE_2_SECOND_MODE;\n tickUnit = X_AXIS_TICK_2_SECOND_MODE;\n break;\n }\n\n if (observableList1.isEmpty() == false && observableList2.isEmpty() == false && observableList3.isEmpty() == false) {\n double maxValue = Math.max(Math.max(observableList1.get(observableList1.size() - 1).getXValue().doubleValue(),\n observableList2.get(observableList1.size() - 1).getXValue().doubleValue()),\n observableList3.get(observableList1.size() - 1).getXValue().doubleValue());\n double newLowerBound = maxValue - chartRange;\n double newUpperBound = maxValue;\n m_pXAxis.setLowerBound(newLowerBound);\n m_pXAxis.setUpperBound(newUpperBound);\n m_pXAxis.setTickUnit(tickUnit);\n m_pXAxis.setDisable(false);\n }\n \n // Update if there is some data series which is not to be plotted\n boolean toPlotDataSeries1 = mToPlotDataSeries1;\n boolean toPlotDataSeries2 = mToPlotDataSeries2;\n boolean toPlotDataSeries3 = mToPlotDataSeries3;\n mToPlotDataSeries1 = true;\n mToPlotDataSeries2 = true;\n mToPlotDataSeries3 = true; \n switchDataSeriesStatus(1, toPlotDataSeries1);\n switchDataSeriesStatus(2, toPlotDataSeries2);\n switchDataSeriesStatus(3, toPlotDataSeries3);\n \n\n }", "private void load() {\r\n\t\tswitch (this.stepPanel.getStep()) {\r\n\t\tcase StepPanel.STEP_HOST_GRAPH:\r\n\t\t\tloadGraph(StepPanel.STEP_HOST_GRAPH);\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_STOP_GRAPH:\r\n\t\t\tloadGraph(StepPanel.STEP_STOP_GRAPH);\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_CRITICAL_PAIRS:\r\n\t\t\tloadPairs();\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_FINISH:\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "@Override\n public void queryRecords() throws VizException {\n\n ResourceName rscName = getResourceData().getResourceName();\n\n DataTime cycleTime = rscName.getCycleTime();\n\n // latest should already be resolved here.\n if (rscName.isLatestCycleTime()) {\n return;\n }\n\n List<DataTime> availableTimes = new ArrayList<>();\n\n if (cycleTime != null && gridRscData.getPluginName()\n .equalsIgnoreCase(GempakGrid.gempakPluginName)) {\n try {\n String dataLocation = null;\n try {\n dataLocation = GempakGrid\n .getGempakGridPath(gridRscData.getGdfile());\n\n } catch (VizException e) {\n statusHandler.error(\"Unable to specify location for \"\n + gridRscData.getPluginName() + \" \"\n + gridRscData.getGdfile(), e);\n return;\n }\n String[] gridAvailableTimes = GempakGrid.getAvailableGridTimes(\n dataLocation, cycleTime.toString(),\n gridRscData.getGdfile().toLowerCase());\n for (int ii = 0; ii < gridAvailableTimes.length; ii++) {\n availableTimes.add(new DataTime(gridAvailableTimes[ii]));\n }\n } catch (Exception e) {\n return;\n }\n } else {\n availableTimes = gridRscData.getAvailableDataTimes();\n }\n\n ArrayList<DataTime> dataTimes = new ArrayList<>();\n\n // loop thru all the times for the grib records for this model and\n // if the time matches the cycle time for this resource and if\n // it hasn't already been added, add it to the queue of data objects\n // to be processed by the abstract class.\n for (DataTime dt : availableTimes) {\n\n // create a dataTime without a possible validPeriod.\n DataTime availTime = new DataTime(dt.getRefTime(),\n dt.getFcstTime());\n DataTime refTime = new DataTime(dt.getRefTime());\n\n if (cycleTime != null) {\n if (cycleTime.equals(refTime)) {\n if (!dataTimes.contains(availTime)) {\n dataTimes.add(availTime);\n }\n }\n } else { // for grid analysis\n dataTimes.add(availTime);\n }\n }\n setDataTimesForDgdriv(dataTimes);\n setAllFramesAsPopulated();\n }", "private void populateCharts() {\n\t\tpopulatePieChart1();\n\t\tpopulatePieChart2();\n\t\tpopulateBarChart1();\n\t\tpopulateBarChart2();\n\t}", "private LineData generateDataLine(int cnt) {\n\n ArrayList<Entry> e1 = new ArrayList<Entry>();\n\n for (int i = 0; i < 12; i++) {\n e1.add(new Entry(i, (int) (Math.random() * 65) + 40));\n }\n\n LineDataSet d1 = new LineDataSet(e1, \"New DataSet \" + cnt + \", (1)\");\n d1.setLineWidth(2.5f);\n d1.setCircleRadius(4.5f);\n d1.setHighLightColor(Color.rgb(244, 117, 117));\n d1.setDrawValues(false);\n\n ArrayList<Entry> e2 = new ArrayList<Entry>();\n\n for (int i = 0; i < 12; i++) {\n e2.add(new Entry(i, e1.get(i).getY() - 30));\n }\n\n LineDataSet d2 = new LineDataSet(e2, \"New DataSet \" + cnt + \", (2)\");\n d2.setLineWidth(2.5f);\n d2.setCircleRadius(4.5f);\n d2.setHighLightColor(Color.rgb(244, 117, 117));\n d2.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);\n d2.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[0]);\n d2.setDrawValues(false);\n\n ArrayList<ILineDataSet> sets = new ArrayList<ILineDataSet>();\n sets.add(d1);\n sets.add(d2);\n\n LineData cd = new LineData(sets);\n return cd;\n }", "protected void stopLocationUpdates() {\n\n mLineChart = (LineChartView) findViewById(R.id.linechart);\n\n /*String[] mLabels = {\"ANT\", \"GNU\", \"OWL\", \"APE\", \"COD\",\"YAK\", \"RAM\", \"JAY\"};\n LineSet data1 = new LineSet();\n LineSet data2 = new LineSet();\n float dataset1[] = {0.2f, 3.4f, 1.2f,4.3f,2.3f,4.3f,2.3f,3.1f };\n float dataset2[] = {0.4f, 1.4f, 2.2f,4.3f,3.3f,4.4f,1.3f,2.1f };\n data1.addPoints(mLabels, dataset1);\n data2.addPoints(mLabels, dataset2);\n //int[] colors1 = {Color.parseColor(\"#3388c6c3\"), Color.TRANSPARENT};\n data1.setLineColor(Color.parseColor(\"#3388c6c3\"));\n //int[] colors2 = {Color.parseColor(\"#1133c6c3\"), Color.TRANSPARENT};\n data2.setLineColor(Color.parseColor(\"#663313c3\"));\n mLineChart.addData(data1);\n mLineChart.addData(data2);\n mLineChart.show();*/\n LineChartView mLineChart = (LineChartView) findViewById(R.id.linechart);\n LineSet data1 = new LineSet();\n LineSet data2 = new LineSet();\n\n Float[] speedlist = userspeeds.toArray(new Float[userspeeds.size()]);\n Float[] compspeedlist = compspeeds.toArray(new Float[userspeeds.size()]);\n Long[] timelist = timeslots.toArray(new Long[timeslots.size()]);\n System.out.println(speedlist);\n System.out.println(timelist);\n\n float[] dataset1 = new float[speedlist.length];\n float[] dataset2 = new float[compspeedlist.length];\n String[] mLabels = new String[speedlist.length];\n //float dataset2[speedlist.length];\n for (int i=0; i<speedlist.length; i++) {\n dataset1[i] = speedlist[i];\n dataset2[i] = compspeedlist[i];\n mLabels[i] = \"\";\n }\n data1.addPoints(mLabels, dataset1);\n data2.addPoints(mLabels, dataset2);\n //int[] colors1 = {Color.parseColor(\"#3388c6c3\"), Color.TRANSPARENT};\n data1.setLineColor(Color.parseColor(\"#3388c6c3\"));\n //int[] colors2 = {Color.parseColor(\"#1133c6c3\"), Color.TRANSPARENT};\n data2.setLineColor(Color.parseColor(\"#663313c3\"));\n\n\n\n if (speedlist.length > 1) {\n mLineChart.addData(data1);\n mLineChart.addData(data2);\n mLineChart.show();\n }\n\n\n LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this);\n }", "public void resetGraph(){\n removeAllSeries();\n removeSeries(xySeries);\n removeSeries(currentPoint);\n xySeries = new PointsGraphSeries<>();\n currentPoint = new PointsGraphSeries<>();\n initGraph();\n }", "public LineChart() {\n init();\n }", "private List<Object[]> getAllCompanyVisitedInfoFromDailyReportByStartDateAndEndDate(final Date startDate,\n final Date endDate, final Employee_mst selectedEmployee) {\n return this.dailyRepo\n .getAllCompanyVisitedInfoFromDailyReportByStartDateAndEndDate(selectedEmployee.getEmp_code(), startDate,\n endDate)\n .maxResults(SummaryReportService.MAX_VISITED_COMPANIES_RECORD).getResultList();\n }", "private JFreeChart createChart ( final XYDataset dataset1, final XYDataset dataset2 ) {\n final JFreeChart result = ChartFactory.createTimeSeriesChart( null, \"\", \"\", dataset1, true, true, false );\n final XYPlot plot = result.getXYPlot();\n final XYItemRenderer renderer1 = new XYLineAndShapeRenderer( true, false );\n final XYItemRenderer renderer2 = new XYLineAndShapeRenderer( true, false );\n plot.setDomainPannable( true );\n plot.setRangePannable( true );\n plot.setDataset( SPEED_SERIES_DATASET, dataset2 );\n plot.mapDatasetToRangeAxis( SPEED_SERIES_DATASET, SPEED_SERIES_DATASET );\n plot.setRenderer( SPEED_SERIES_DATASET, renderer1 );\n plot.setDataset( POSITION_SERIES_DATASET, dataset1 );\n plot.mapDatasetToRangeAxis( POSITION_SERIES_DATASET, POSITION_SERIES_DATASET );\n plot.setRenderer( POSITION_SERIES_DATASET, renderer2 );\n plot.setBackgroundPaint( StartUI.MAIN_BACKGROUND_COLOR );\n plot.setDomainGridlinePaint( Color.decode(\"0x3b4246\") );\n plot.setRangeGridlinePaint( Color.decode(\"0x3b4246\") );\n plot.setRangeGridlineStroke( new BasicStroke( 0.8f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL ) );\n plot.setDomainGridlineStroke( new BasicStroke( 0.8f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL ) );\n renderer1.setSeriesPaint( 0, Color.decode( \"#AAFF44\" ) );\n renderer2.setSeriesPaint( 0, Color.decode( \"#EEDD00\" ) );\n result.setBackgroundPaint( null );\n result.removeLegend();\n return result;\n }", "protected List<Daily_report> getListPeriodicDailyReport(final Date startDate, final Date endDate,\n final String branchCode, final Employee_mst selectedEmployee) {\n TypedQuery<Daily_report> typedQuery = null;\n final StringBuilder query = new StringBuilder();\n query.append(\" FROM Daily_report A LEFT JOIN FETCH A.daily_activity_type B\");\n query.append(\" LEFT JOIN FETCH A.company_mst C LEFT JOIN FETCH A.industry_big_mst D\");\n query.append(\" LEFT JOIN FETCH A.employee_mst E\");\n query.append(\" WHERE C.com_delete_flg = 'false' AND E.emp_delete_flg = 'false'\");\n query.append(\" AND A.dai_work_date >= :startDate AND A.dai_work_date <= :endDate\");\n\n // not monthly report\n if (StringUtils.isNotEmpty(branchCode)) {\n query.append(\" AND A.pk.dai_point_code = :branchCode\");\n }\n if (selectedEmployee != null) {\n query.append(\" AND A.pk.dai_employee_code = :employeeCode\");\n }\n\n query.append(\" ORDER BY A.pk.dai_point_code, A.pk.dai_employee_code\");\n typedQuery = super.emMain.createQuery(query.toString(), Daily_report.class);\n\n if (StringUtils.isNotEmpty(branchCode)) {\n typedQuery.setParameter(\"branchCode\", branchCode);\n }\n if (selectedEmployee != null) {\n typedQuery.setParameter(\"employeeCode\", selectedEmployee.getEmp_code());\n }\n\n typedQuery.setParameter(\"startDate\", startDate).setParameter(\"endDate\", endDate);\n\n // order by\n List<Daily_report> results = typedQuery.getResultList();\n return results;\n }", "private ArrayList<JSONObject> loadCurrentTrackingObjects() {\n ArrayList<JSONObject> currentTrackingObjects = new ArrayList<JSONObject>();\n\n SharedPreferences prefs = context.getSharedPreferences(TRACKING_EVENTS_STORAGE, Context.MODE_PRIVATE);\n if (prefs.getAll().isEmpty()) {\n return null;\n }\n\n TreeMap<String, ?> keys = new TreeMap<String, Object>(prefs.getAll());\n for (Map.Entry<String, ?> entry : keys.entrySet()) {\n String data[] = ((String)entry.getValue()).split(\";\");\n currentTrackingObjects.add(buildTrackingItemObject(data[0], data[1], data[2], Long.parseLong(data[3])));\n }\n\n return currentTrackingObjects;\n }", "public XYDataset getLineDataset() {\n\n // Initialize some variables\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series[][] = new XYSeries[rois.length][images.length];\n String seriesname[][] = new String[rois.length][images.length];\n int currentSlice = ui.getOpenMassImages()[0].getCurrentSlice();\n ArrayList<String> seriesNames = new ArrayList<String>();\n String tempName = \"\";\n map = new HashMap<String, Pair<MimsPlus, Roi>>();\n double stat;\n\n // Image loop\n for (int j = 0; j < images.length; j++) {\n MimsPlus image;\n if (images[j].getMimsType() == MimsPlus.HSI_IMAGE || images[j].getMimsType() == MimsPlus.RATIO_IMAGE) {\n image = images[j].internalRatio;\n } else {\n image = images[j];\n }\n // Roi loop\n for (int i = 0; i < rois.length; i++) {\n\n // Set the Roi to the image.\n Integer[] xy = ui.getRoiManager().getRoiLocation(rois[i].getName(), image.getCurrentSlice());\n rois[i].setLocation(xy[0], xy[1]);\n image.setRoi(rois[i]);\n\n // Stat loop\n for (int k = 0; k < stats.length; k++) {\n\n // Generate a name for the dataset.\n String prefix = \"\";\n if (image.getType() == MimsPlus.MASS_IMAGE || image.getType() == MimsPlus.RATIO_IMAGE) {\n prefix = \"_m\";\n }\n if (seriesname[i][j] == null) {\n tempName = \"mean\" + prefix + image.getRoundedTitle(true) + \"_r\" + rois[i].getName();\n int dup = 1;\n while (seriesNames.contains(tempName)) {\n tempName = \"mean\" + prefix + image.getRoundedTitle(true) + \"_r\" + rois[i].getName() + \" (\" + dup + \")\";\n dup++;\n }\n seriesNames.add(tempName);\n seriesname[i][j] = tempName;\n }\n series[i][j] = new XYSeries(seriesname[i][j]);\n ij.gui.ProfilePlot profileP = new ij.gui.ProfilePlot(image);\n double[] newdata = profileP.getProfile();\n for (int p = 0; p < newdata.length; p++) {\n series[i][j].add(p, newdata[p]);\n }\n Pair tuple = new Pair(images[j], rois[i]);\n map.put(seriesname[i][j], tuple);\n\n } // End of Stat\n } // End of Roi\n } // End of Image\n\n // Populate the final data structure.\n for (int i = 0; i < rois.length; i++) {\n for (int j = 0; j < images.length; j++) {\n dataset.addSeries(series[i][j]);\n }\n }\n\n ui.getOpenMassImages()[0].setSlice(currentSlice);\n\n return dataset;\n }", "void draw (ObservableList<Node> objects, ObservableList<Node> persistentObjects) {\n\n// defines the start and end of the Line based on the first and last Event\n// of the Timeline, the zoom (stretch) and global edge of all Nodes (shift)\n start = (timeline.events.peekFirst().startDate[2] * stretch) - shift;\n end = (timeline.events.peekLast().startDate[2] * stretch) - shift;\n\n// defines the X coordinates of the Label before the first Event\n this.setLayoutX(start - this.width() - 10);\n\n// places and styles the accompanying Line\n line = new Line(start, y, end, y);\n line.setStyle(stylesheet.toString());\n line.getStyleClass().add(\"axisLine\");\n\n// sets right click on the Line to expand Timeline as well\n line.setOnMouseClicked(mouseEvent -> {\n if (mouseEvent.getButton() == MouseButton.SECONDARY)\n expandElement(timeline);\n });\n\n// draws the Label and Line on mainPane\n objects.addAll(this, line);\n\n// cycles through all Timeline Events\n// creates Marker and draws it on mainPane\n for (Event event : timeline.events) {\n if (event.visible) {\n Marker marker = new Marker(event, y);\n objects.addAll(marker, marker.line);\n }\n }\n\n// draws persistentLabel on persistentPane\n persistentObjects.add(persistentLabel);\n }", "private void setupDailyBarChart() {\r\n BarChart chart = findViewById(R.id.chart);\r\n chart.getDescription().setEnabled(false);\r\n chart.setExtraOffsets(0, 0, 0, 10);\r\n chart.setNoDataText(getResources().getString(R.string.loading_graph));\r\n chart.getPaint(Chart.PAINT_INFO).setTextSize(Utils.convertDpToPixel(16f));\r\n chart.getLegend().setEnabled(false);\r\n\r\n // Show time on x-axis at three hour intervals\r\n XAxis xAxis = chart.getXAxis();\r\n xAxis.setValueFormatter(new IAxisValueFormatter() {\r\n @Override\r\n public String getFormattedValue(float value, AxisBase axis) {\r\n int valueInt = (int) value;\r\n if(valueInt == 0) {\r\n return \"12am\";\r\n } else if(valueInt > 0 && valueInt < 12) {\r\n return valueInt + \"am\";\r\n } else if(valueInt == 12) {\r\n return \"12pm\";\r\n } else {\r\n return (valueInt - 12) + \"pm\";\r\n }\r\n }\r\n });\r\n\r\n xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\r\n xAxis.setDrawGridLines(false);\r\n xAxis.setTextSize(14f);\r\n // show label for every three hours\r\n xAxis.setGranularity(3.0f);\r\n xAxis.setLabelCount(8);\r\n xAxis.setGranularityEnabled(true);\r\n\r\n // Show non-sedentary hours on left y-axis\r\n YAxis yAxisLeft = chart.getAxisLeft();\r\n yAxisLeft.setAxisMinimum(0f);\r\n yAxisLeft.setTextSize(14f);\r\n yAxisLeft.setGranularity(1.0f); // show integer values on y axis\r\n yAxisLeft.setGranularityEnabled(true);\r\n\r\n YAxis yAxisRight = chart.getAxisRight();\r\n yAxisRight.setEnabled(false);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n View view = inflater.inflate(R.layout.fragment_performance_graph, container, false);\n chart = view.findViewById(R.id.chart1);\n\n // Selection of the spinner\n final Spinner spinner_years = (Spinner) view.findViewById(R.id.spinner_years);\n final Spinner spinner_months = (Spinner) view.findViewById(R.id.spinner_months);\n final Spinner spinner_days = (Spinner) view.findViewById(R.id.spinner_days);\n spinner_days.setSelection(0,false);\n spinner_months.setSelection(0,false);\n spinner_years.setSelection(0,false);\n spinner_months.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()\n {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id)\n {\n formData(\"Orders\",0,spinner_years.getSelectedItemPosition()==0?0:Integer.parseInt((String)spinner_years.getSelectedItem())\n ,position,\n spinner_days.getSelectedItemPosition(),milliseconds_data);\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent)\n {\n\n }\n });\n spinner_years.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()\n {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id)\n {\n formData(\"Orders\",0,position==0?0:Integer.parseInt((String)spinner_years.getSelectedItem()),\n spinner_months.getSelectedItemPosition(), spinner_days.getSelectedItemPosition(),milliseconds_data);\n\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent)\n {\n\n }\n });\n spinner_days.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()\n {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id)\n {\n formData(\"Orders\",0,spinner_years.getSelectedItemPosition()==0?0:Integer.parseInt((String)spinner_years.getSelectedItem()),\n spinner_months.getSelectedItemPosition(), position,milliseconds_data);\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent)\n {\n\n }\n });\n\n milliseconds_data = new LinkedHashMap<>();\n\n setChart();\n new Data2Task().execute((Void)null);\n return view;\n }", "@Override\n public void onSuccess() {\n view = (LineChartView) findViewById(R.id.lineview);\n line = new Line();\n line.setHasLines(true);\n line.setHasPoints(false);\n line.setStrokeWidth(1);\n data = new LineChartData(Arrays.asList(line));\n Axis axisX = new Axis();\n Axis axisY = new Axis().setHasLines(true);\n data.setAxisXBottom(axisX);\n data.setAxisYLeft(axisY);\n// bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.RGB_565);\n// canvas = new Canvas(bitmap);\n// view.setDrawer(new DrawingView.Drawer() {\n// @Override\n// public void draw(Canvas canvas) {\n// canvas.drawBitmap(bitmap, 0, 0, null);\n// }\n// });\n connection = connectionManager.getConnection();\n\n connection.addUpdateListener(new Connection.UpdateListener() {\n @Override\n public void update() {\n if (sensors == null) {\n sensors = connection.getSensors();\n list = (ListView) findViewById(R.id.channellist);\n list.post(new Runnable() {\n @Override\n public void run() {\n list.setAdapter(new ArrayAdapter<Sensor>(MainActivity.this, R.layout.itemview, sensors));\n list.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n activeSensor((Sensor) parent.getAdapter().getItem(position));\n draw();\n }\n });\n }\n });\n list.post(new Runnable() {\n @Override\n public void run() {\n list.setItemChecked(0, true);\n list.performItemClick(list.getChildAt(0), 0, 0);\n }\n });\n }\n draw();\n list.post(new Runnable() {\n @Override\n public void run() {\n int first = list.getFirstVisiblePosition();\n int last = list.getLastVisiblePosition();\n int j = 0;\n for (int i = first; i <= last; i++) {\n ((TextView) list.getChildAt(j++)).setText(sensors[i].toString());\n }\n }\n });\n }\n });\n aDialog.dismiss();\n }", "private void initializeChart(final List<DateCounter> data)\n {\n final XYSeries series = new XYSeries(TITLE_XY_SERIES);\n\n //Adding data to the chart\n addDataToXYSeries(data, series);\n\n //Finalizing the chart\n final XYSeriesCollection coll = new XYSeriesCollection(series);\n final JFreeChart chart = ChartFactory.createXYLineChart(TITLE_CHART, X_AXIS_TITLE,\n Y_AXIS_TITLE, coll, PlotOrientation.VERTICAL, true, true, false);\n final ChartPanel chartPanel = new ChartPanel(chart);\n chartPanel.setPreferredSize(new java.awt.Dimension(SIZE_CHART_PANEL, SIZE_CHART_PANEL));\n this.add(chartPanel, BorderLayout.CENTER);\n }", "@Override\n protected void createLines() {\n\n Line[] lines = new GraphicalLine[(2 * columns * rows) + columns + rows];\n int lineIndex = 0;\n\n int boxCounter = 0;\n int x = settings.dotStartX() + settings.dotWidth();\n int y = settings.dotStartY() + settings.lineOffset();\n boolean isTop = true;\n boolean isFirstRow = true;\n\n /* horizontal lines */\n /* for every row + 1 */\n for (int i = 0; i < rows + 1; i++) {\n\n /* for every column */\n for (int j = 0; j < columns; j++) {\n\n Line line = new GraphicalLine(x, y, settings.lineWidth(), settings.lineHeight());\n line.addBox(boxes[boxCounter]);\n if (isTop) {\n boxes[boxCounter].setTopLine(line);\n } else {\n boxes[boxCounter].setBottomLine(line);\n /* if there is a next row */\n if (i + 1 < rows + 1) {\n line.addBox(boxes[boxCounter + columns]);\n boxes[boxCounter + columns].setTopLine(line);\n }\n }\n boxCounter++;\n lines[lineIndex++] = line;\n x += settings.dotSeparatorLength();\n }\n boxCounter = isTop ? boxCounter - columns : boxCounter;\n if (isFirstRow) {\n isTop = false;\n isFirstRow = false;\n }\n y += settings.dotSeparatorLength();\n x = settings.dotStartX() + settings.dotWidth();\n }\n\n boxCounter = 0;\n x = settings.dotStartX() + settings.lineOffset();\n y = settings.dotStartY() + settings.dotWidth();\n\n /* vertical lines */\n /* for every row */\n for (int i = 0; i < rows; i++) {\n\n /* for every column + 1 */\n for (int j = 0; j < columns + 1; j++) {\n\n Line line = new GraphicalLine(x, y, settings.lineHeight(), settings.lineWidth());\n /* if there is a previous vertical line */\n if (j > 0) {\n boxes[boxCounter - 1].setRightLine(line);\n line.addBox(boxes[boxCounter - 1]);\n }\n /* if there is a next column */\n if (j + 1 < columns + 1) {\n boxes[boxCounter].setLeftLine(line);\n line.addBox(boxes[boxCounter]);\n boxCounter++;\n }\n lines[lineIndex++] = line;\n x += settings.dotSeparatorLength();\n }\n y += settings.dotSeparatorLength();\n x = settings.dotStartX() + settings.lineOffset();\n }\n\n this.lines = lines;\n }", "@RequestMapping(value=\"/async/graph\", method=RequestMethod.GET)\n\tpublic @ResponseBody GraphPojo getGraph() {\n\t\tList<Collection> collections = collectionService.findAllCurrent();\n\t\tList<Agent> agents = agentService.findAllCurrent();\n\t\tList<NodePojo> nodes = new ArrayList<NodePojo>();\n\t\tList<EdgePojo> edges = new ArrayList<EdgePojo>();\n\t\tList<String> nodeIds = new ArrayList<String>();\n\t\t\n\t\tNodePojo node;\n\t\tEdgePojo edge;\n\t\t\n\t\t// Nodes\n\t\tfor (Collection c : collections) {\n\t\t\tnode = new NodePojo();\n\t\t\tnode.setId(c.getEntityId());\n\t\t\tnode.setLabel(c.getLocalizedDescriptions().get(0).getTitle());\n\t\t\tnode.setType(\"collection\");\n\t\t\tnodes.add(node);\n\t\t\tnodeIds.add(node.getId());\n\t\t}\n\t\tfor (Agent agent : agents) {\n\t\t\tnode = new NodePojo();\n\t\t\tnode.setId(agent.getEntityId());\n\t\t\t\n\t\t\tif (agent.getForeName()==null) {\n\t\t\t\tnode.setType(\"organization\");\n\t\t\t} else {\n\t\t\t\tnode.setType(\"person\");\n\t\t\t}\n\t\t\t\n\t\t\tString name = (agent.getForeName()==null? \"\": (agent.getForeName() + \" \")) + agent.getName() ;\n\t\t\tnode.setLabel(name);\n\t\t\tnodes.add(node);\n\t\t\tnodeIds.add(node.getId());\n\t\t}\n\t\t\n\t\t// Edges\n\t\tfor (Collection c : collections) {\n\t\t\tif (c.getRelations()!=null) {\n\t\t\t\tfor (CollectionRelation cr : c.getRelations()) {\n\t\t\t\t\tedge = new EdgePojo();\n\t\t\t\t\tedge.setSource(cr.getSourceEntityId());\n\t\t\t\t\tedge.setTarget(cr.getTargetEntityId());\n\t\t\t\t\t\n\t\t\t\t\tif (!edges.contains(edge) && nodeIds.contains(edge.getSource()) && nodeIds.contains(edge.getTarget())) {\n\t\t\t\t\t\tedges.add(edge);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (c.getAgentRelations()!=null && c.getAgentRelations().size()!=0) {\n\t\t\t\tfor (CollectionAgentRelation car : c.getAgentRelations()) {\n\t\t\t\t\tedge = new EdgePojo();\n\t\t\t\t\tedge.setSource(c.getEntityId());\n\t\t\t\t\tedge.setTarget(car.getAgentId());\n\t\t\t\t\tif (!edges.contains(edge) && nodeIds.contains(edge.getSource()) && nodeIds.contains(edge.getTarget())) {\n\t\t\t\t\t\tedges.add(edge);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (Agent agent : agents) {\n\t\t\tif (agent.getParentAgentId()!=null && !agent.getParentAgentId().isEmpty()) {\n\t\t\t\tedge = new EdgePojo();\n\t\t\t\tedge.setSource(agent.getEntityId());\n\t\t\t\tedge.setTarget(agent.getParentAgentId());\n\t\t\t\t\n\t\t\t\tif (!edges.contains(edge) && nodeIds.contains(edge.getSource()) && nodeIds.contains(edge.getTarget())) {\n\t\t\t\t\tedges.add(edge);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tGraphPojo graph = new GraphPojo();\n\t\tgraph.setNodes(nodes);\n\t\tgraph.setEdges(edges);\n\t\t\n\t\treturn graph;\t\t\n\t}", "private XYDataset createDataset() {\n\t\tfinal XYSeriesCollection dataset = new XYSeriesCollection( ); \n\t\tdataset.addSeries(trainErrors); \n\t\tdataset.addSeries(testErrors);\n\t\treturn dataset;\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_map_chart, container, false);\n// ButterKnife.inject(this, rootView);\n init(rootView);\n chart = (LineChartView) rootView.findViewById(R.id.chart);\n swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipeRefreshLayout);\n swipeRefreshLayout.setOnRefreshListener(this);\n\n Calendar c = Calendar.getInstance();\n System.out.println(\"Current time => \" + c.getTime());\n\n SimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\n String formattedDate = df.format(c.getTime());\n\n getChart();\n// generateTempoData();\n return rootView;\n }", "public void getHistory() {\n List<Map<String, String>> HistoryList = null;\n HistoryList = getData();\n String[] fromwhere = {\"Line\", \"Station\", \"Repair_Time_Start\", \"Repair_Time_Finish\", \"Repair_Duration\"};\n int[] viewwhere = {R.id.Line, R.id.Station, R.id.RepairTimeStart, R.id.RepairTimeFinish, R.id.Duration};\n ABH = new SimpleAdapter(BreakdownHistory.this, HistoryList, R.layout.list_history, fromwhere, viewwhere);\n BreakdownHistory.setAdapter(ABH);\n }", "List<DataGatherMoment> getDataGatherMoments();", "@Override\n public void run() {\n seriesZ.appendData(new DataPoint(timestamp, z), true, 1000);\n\n if (gravarPontos ||(contador_pontos!=0 && !ePotenciaDeDois(contador_pontos))) {\n\n // Conta quantidade de pontos que estão sendo coletados\n contador_pontos++;\n\n Log.i(\"HisamotoGravandoPontos\", \" Gravando Pontos - \" + contador_pontos);\n\n\n vector_x[contador] = timestamp;\n vector_y[contador] = z;\n Log.i(\"HisamotoGravandoPontos\",\"Get \"+contador_pontos+\" - \" + z);\n contador++;\n\n } else if(contador_pontos > 0) {\n\n Log.i(\"HisamotoGravandoPontos\", \" Plotando pontos: \"+contador_pontos);\n\n int l = 0; // Ignorar primeiro valor, testar essa alteração\n Complex[] vecy = new Complex[contador_pontos];\n\n for (; l < contador_pontos; l++) {\n\n vecy[l] = new Complex((double) vector_y[l], 0);\n\n }\n\n complexFFT = new ComplexFFT();\n\n Complex[] y_processado = complexFFT.fft(vecy);\n\n graphFFT = (GraphView) findViewById(R.id.graphFFT);\n\n DataPoint[] datapoints = new DataPoint[contador_pontos];\n\n for (int i = 0; i < contador_pontos; i++) {\n\n double teste_x = i * qtd_pontos_segundo_amostra / (contador_pontos / 2);\n double teste_y = y_processado[i].abs();\n Log.i(\"TestePlot\", teste_x + \" | \" + teste_y);\n\n if(i == 0) {\n\n teste_y = 0;\n }\n // Pegando pico máximo\n if(teste_y > max_point_y) {\n\n max_point_y = teste_y;\n }\n\n datapoints[i] = new DataPoint(teste_x, teste_y);\n }\n\n\n\n altura = Float.valueOf(sharedPreferences.getString(\"largura_\", \"0\"));\n largura = Float.valueOf(sharedPreferences.getString(\"altura_\", \"0\"));\n massa_viga = Float.valueOf(sharedPreferences.getString(\"massa_viga_\", \"0\"));\n vao_peca = Float.valueOf(sharedPreferences.getString(\"vao_peca_\", \"0\"));\n\n Log.i(\"PicoMaximo\", \"altura: \" + altura);\n Log.i(\"PicoMaximo\", \"largura: \" + largura);\n Log.i(\"PicoMaximo\", \"massa_viga: \" + massa_viga);\n Log.i(\"PicoMaximo\", \"vao_peca: \" + vao_peca);\n\n //I= b.h³/12\n double valormoe = ((max_point_y*max_point_y)*massa_viga*(vao_peca*vao_peca*vao_peca))/(2.46*(largura*(altura*altura*altura)/12.0)*9.8);\n\n valor_moe.setText(\"\" + valormoe);\n\n graphFFT.removeAllSeries();\n serieFFT = new LineGraphSeries<DataPoint>(datapoints);\n\n serieFFT.setColor(Color.BLACK);\n serieFFT.setAnimated(true);\n serieFFT.setThickness(4);\n\n graphFFT.addSeries(serieFFT);\n graphFFT.setTitle(\"FFT\");\n\n gravarPontos = false;\n\n Log.i(\"Plotounomapa\", \"Plotouuuuuuuuuuuuuuuuuuuuu\");\n\n contador_pontos = 0;\n vector_x = new double[10000];\n vector_y = new double[10000];\n\n }\n }" ]
[ "0.58723426", "0.5697314", "0.565884", "0.5545756", "0.54903775", "0.5472164", "0.54128504", "0.5364741", "0.53072333", "0.5290794", "0.5243547", "0.5169606", "0.51556474", "0.51285475", "0.5115538", "0.4975648", "0.49714836", "0.4907172", "0.4896475", "0.48888665", "0.4882809", "0.47991073", "0.4798222", "0.47965613", "0.4733247", "0.47291288", "0.47215253", "0.47183377", "0.47147253", "0.47125208", "0.47107467", "0.47027755", "0.46703443", "0.46586052", "0.4647278", "0.46459937", "0.46197203", "0.4610804", "0.4609917", "0.460958", "0.46047142", "0.4598606", "0.4597156", "0.4592804", "0.45915517", "0.4584172", "0.45766422", "0.45719886", "0.45691523", "0.4564117", "0.4555909", "0.45543358", "0.4549006", "0.45309797", "0.45143843", "0.44835952", "0.44826564", "0.44804645", "0.44763628", "0.44753116", "0.44700414", "0.44642445", "0.44536382", "0.44480968", "0.44458827", "0.4445623", "0.44436452", "0.4440107", "0.44391724", "0.44390807", "0.4436948", "0.4426696", "0.4412404", "0.4391282", "0.43787616", "0.43759105", "0.4369945", "0.43679297", "0.4351596", "0.4344486", "0.43441796", "0.43406728", "0.43396047", "0.43342498", "0.4333802", "0.43336838", "0.43259427", "0.4325063", "0.43247998", "0.4320589", "0.431143", "0.4310775", "0.4309712", "0.430525", "0.43008766", "0.4296641", "0.42947182", "0.4293845", "0.42929453", "0.42908555" ]
0.7705797
0
Loads and parses the query file with the given name from classpath and stores its content in cache.
@Cacheable(value = "cypherQueriesCache", key = "#name", unless = "#result != null") private String loadCypher(String name) { try { logger.debug("Cypher query with name {} not found in cache, try loading it from file.", name); ResourcePatternResolver resolver = ResourcePatternUtils.getResourcePatternResolver(this.resourceLoader); Resource[] queryFiles = resolver.getResources("classpath*:queries/*.cql"); for (Resource queryFile : queryFiles) { if (queryFile.getFilename().endsWith(name + QUERY_FILE_SUFFIX)) { logger.debug("Found query file with name {} in classpath.", queryFile.getFilename()); InputStream inputStream = queryFile.getInputStream(); String cypher = StreamUtils.copyToString(inputStream, Charset.defaultCharset()); return cypher; } } logger.warn("Query file with name {} not found in classpath.", name + QUERY_FILE_SUFFIX); return null; } catch (IOException e) { throw new IllegalStateException("Invalid query file path.", e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadClasspathCypherScriptFile(String cqlFileName) {\n StringBuilder cypher = new StringBuilder();\n try (Scanner scanner = new Scanner(Thread.currentThread().getContextClassLoader().getResourceAsStream(cqlFileName))) {\n scanner.useDelimiter(System.getProperty(\"line.separator\"));\n while (scanner.hasNext()) {\n cypher.append(scanner.next()).append(' ');\n }\n }\n\n new ExecutionEngine(this.database).execute(cypher.toString());\n }", "public ZIPCachedQuery(File cacheFile) throws IOException {\n \t\tthis.dataFile = cacheFile;\n \t\tloadDataFromFile();\n \t}", "public String readQueryFile(String queryFileName) {\n assert queryFileName != null : \"queryFileName cannont be null\";\n StringBuilder queryBuilder = new StringBuilder();\n String query = null;\n InputStream input = null;\n\n try {\n input = new FileInputStream(queryFileName);\n List<String> queryLines = new ArrayList<>();\n queryLines.clear();\n queryLines.addAll(IOUtils.readLines(input));\n\n if (!queryLines.isEmpty()) {\n for (String queryLine : queryLines) {\n queryBuilder.append(queryLine).append(\"\\n\");\n }\n }\n\n } catch (FileNotFoundException ex) {\n //Logger.getLogger(OracleDAO.class.getName()).log(Level.SEVERE, null, ex);\n logger.error(queryFileName + \" could not be found\", ex);\n } catch (IOException ioe) {\n logger.error(\"There was a problem with the file \" + queryFileName, ioe);\n } finally {\n if (input != null) {\n try {\n input.close();\n } catch (IOException ex) {\n logger.error(\"There was a problem with the file \" + queryFileName, ex);\n }\n }\n }\n\n //InputStream input = new URL(queryFileName).openStream();\n query = queryBuilder.toString();\n return query;\n }", "void parseQueryFile(Path path, boolean hasFlag);", "public static HashMap<String, GoldQuery> loadQueriesAnswers(String queries) throws IOException {\n\t\t\n\t\t/* determine answers file based on input file */\n\t\t\n\t\tString answers = null;\n\t\t\n\t\tif (queries.contains(\"train_queries_2009\")) answers = queriesPath+\"train_results_2009.tab\";\n\t\telse if (queries.contains(\"train_queries_2010\")) answers = queriesPath+\"train_results_2010.tab\";\n\t\telse if (queries.contains(\"train_queries_2011\")) answers = queriesPath+\"train_results_2011.tab\";\n\t\telse if (queries.contains(\"test_queries_2009\")) answers = queriesPath+\"test_results_2009.tab\";\n\t\telse if (queries.contains(\"test_queries_2010\")) answers = queriesPath+\"test_results_2010.tab\";\n\t\telse if (queries.contains(\"test_queries_2011\")) answers = queriesPath+\"test_results_2011.tab\";\n\t\t\n\t\tSystem.out.println(\"Loading queries answers from: \" + answers);\n\t\t\n\t\tBufferedReader input;\n\t\tHashMap<String, GoldQuery> queriesAnswers = new HashMap<String, GoldQuery>();\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tinput = new BufferedReader(new FileReader(answers));\n\t\t\tString line = null;\n\t\t \n\t\t\twhile (( line = input.readLine()) != null){\t\t\t\t\n\t\t\t\tString[] contents = line.split(\"\\t\");\n\t\t\t\tGoldQuery gold = new GoldQuery(contents[0], contents[1], contents[2]);\n\t\t\t\tqueriesAnswers.put(contents[0], gold);\n\t\t\t}\n\t\t\t\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\treturn queriesAnswers;\t\t\n\t}", "public static StatementLocator fromClasspath(String path) {\n return fromClasspath(UseSTGroupCache.YES, path);\n }", "public void loadCache() {\n if (!directory.exists()) {\n directory.mkdirs();\n }\n File[] files = this.directory.listFiles();\n if (files == null) {\n return;\n }\n for (File file : files) {\n if (file.getName().endsWith(\".json\")) {\n cache.put(file.getName().split(\".json\")[0], new JsonDocument(file));\n }\n }\n }", "public SearchQuery loadSearch(String name) {\n\t\tif( name == null ) throw new NullPointerException(\"name is null\");\n\t\t\n\t\tString key = nameToKey(name);\n\t\tfinal String ERR_MSG = \"Failed to load query: \" + name;\n\t\ttry {\n\t\t\tsearchPrefs.sync();\n\t\t\tif( !searchPrefs.nodeExists(key) )\n\t\t\t\tthrow new SettingsException(\"No query stored for name: \" + name);\n\t\t\t\n\t\t\tPreferences searchNode = searchPrefs.node(key);\n\t\t\tbyte[] serialized = searchNode.getByteArray(DATA_KEY, null);\n\t\t\tif( serialized == null ) {\n\t\t\t\t_log.error(\"Search node [key=\" + key + \"] exists, but has no data.\");\n\t\t\t\tthrow new SettingsException(\"No query stored for name: \" + name);\n\t\t\t}\n\t\t\t\n\t\t\tObject queryObj = Util.deserialize(serialized);\n\t\t\tif( !(queryObj instanceof SearchQuery) ) {\n\t\t\t\t_log.error(\"Wrong class for query [key=\" + key + \"]: \" + queryObj.getClass().getName());\n\t\t\t\tthrow new SettingsException(\"Bad object stored for name: \" + name);\n\t\t\t}\n\t\t\treturn (SearchQuery)queryObj;\n\t\t\t\n\t\t} catch( BackingStoreException e ) {\n\t\t\t_log.error(ERR_MSG, e);\n\t\t\tthrow new SettingsException(ERR_MSG, e);\n\t\t} catch( IOException e ) {\n\t\t\t_log.error(ERR_MSG, e);\n\t\t\tthrow new SettingsException(ERR_MSG, e);\n\t\t} catch( ClassNotFoundException e ) {\n\t\t\t_log.error(ERR_MSG, e);\n\t\t\tthrow new SettingsException(ERR_MSG, e);\n\t\t}\n\t}", "public String getQuery(String queryName, String sqlFile) throws IOException {\r\n\r\n\t\tLOG.info(\"getQuery\");\r\n\r\n\t\tgetQuerys(sqlFile);\r\n\r\n\t\tString query = querysMap.get(queryName);\r\n\r\n\t\tLOG.debug(querysMap.containsKey(queryName));\r\n\r\n\t\tLOG.info(\"\\nQuery [\" + query + \"]\");\r\n\r\n\t\treturn query;\r\n\t\t\r\n\t}", "public void load() throws SparqlException {\n \tload(getLoadFilePath());\n }", "protected void loadFromListing(ListedRoot listedRoot, String query) {\n boolean isNameSearch = (StringUtil.firstIndexOf(query, '/', '\\\\', ':') == -1);\n\n // A single name without / and \\ and not ending in : was specified\n // Try to match (=contains) all entries recursively\n // If a directory name matches, it and all sub-entries are included in the result\n // Don't match the namespace, that's dumb.\n if (!query.isEmpty() && isNameSearch) {\n for (ListedNamespace namespace : listedRoot.namespaces()) {\n for (ListedEntry e : namespace.matchChildrenNameContains(query)) {\n e.assignToRoot(root);\n }\n }\n return;\n }\n\n // Loading of a directory hierarchy all at once. For paths, namespace is optional.\n // A single directory can be specified by querying name/ or /name\n\n List<String> parts = ListedEntry.tokenizePath(query);\n\n // Decide on the namespce to include. If no namespace was prefixed, do all of them.\n List<ListedNamespace> namespacesToCheck;\n if (!parts.isEmpty() && parts.get(0).endsWith(\":\")) {\n String namespace = parts.remove(0);\n ListedNamespace match = listedRoot.namespacesByName.get(namespace);\n if (match == null) {\n String namespaceLower = namespace.toLowerCase(Locale.ENGLISH);\n for (ListedNamespace n : listedRoot.namespaces()) {\n if (n.nameLowerCase().equals(namespaceLower)) {\n match = n;\n break;\n }\n }\n }\n if (match == null) {\n return;\n } else {\n namespacesToCheck = Collections.singletonList(match);\n }\n } else {\n namespacesToCheck = listedRoot.namespaces();\n }\n\n // Go by all matched namespaces and search the path query\n // Copy all matched elements into this listing's own root\n for (ListedNamespace namespace : namespacesToCheck) {\n for (ListedEntry e : namespace.matchWithPathPrefix(parts)) {\n e.assignToRoot(root);\n }\n }\n }", "protected void loadDataFromFile() throws IOException {\n \t\tInputStream is = null;\n \n \t\ttry {\n \t\t\tis = new BufferedInputStream(new GZIPInputStream(\n \t\t\t\t\tnew FileInputStream(this.dataFile)));\n \n \t\t\tint dataOffset = 0;\n \t\t\tByteArrayOutputStream os = new ByteArrayOutputStream();\n \n \t\t\twhile (true) {\n \t\t\t\tint b = is.read();\n \n \t\t\t\tif (b == 0) {\n \t\t\t\t\t// field separator reached.\n \t\t\t\t\tif (this.componentId == null) {\n \t\t\t\t\t\tbyte[] encoded = os.toByteArray();\n \t\t\t\t\t\tdataOffset += encoded.length;\n \t\t\t\t\t\tdataOffset += 1; // include the separator field\n \t\t\t\t\t\tcomponentId = new String(URLEncoding.decode(encoded),\n \t\t\t\t\t\t\t\t\"UTF-8\");\n \t\t\t\t\t} else if (this.query == null) {\n \t\t\t\t\t\tbyte[] encoded = os.toByteArray();\n \t\t\t\t\t\tdataOffset += encoded.length;\n \t\t\t\t\t\tdataOffset += 1; // include the separator field\n \n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\tString queryXml = new String(URLEncoding\n \t\t\t\t\t\t\t\t\t.decode(encoded), \"UTF-8\");\n \n \t\t\t\t\t\t\t// parse the query.\n \t\t\t\t\t\t\tSAXReader reader = new SAXReader();\n \t\t\t\t\t\t\tElement root = reader.read(\n \t\t\t\t\t\t\t\t\tnew StringReader(queryXml))\n \t\t\t\t\t\t\t\t\t.getRootElement();\n \t\t\t\t\t\t\tthis.query = root.getText();\n \t\t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\t\tthrow new IOException(\n \t\t\t\t\t\t\t\t\t\"Cannot unmarshall cached query.\");\n \t\t\t\t\t\t}\n \t\t\t\t\t} else if (this.optionalParams == null) {\n \t\t\t\t\t\tbyte[] encoded = os.toByteArray();\n \t\t\t\t\t\tdataOffset += encoded.length;\n \t\t\t\t\t\tdataOffset += 1; // include the separator field\n \n \t\t\t\t\t\tif (encoded.length > 0) {\n \t\t\t\t\t\t\tMap optionalParams = new HashMap();\n \t\t\t\t\t\t\tString urlEncoded = new String(URLEncoding\n \t\t\t\t\t\t\t\t\t.decode(encoded), \"UTF-8\");\n \t\t\t\t\t\t\tStringTokenizer tokenizer = new StringTokenizer(\n\t\t\t\t\t\t\t\t\turlEncoded, \"&\", false);\n \n \t\t\t\t\t\t\twhile (tokenizer.hasMoreTokens()) {\n String param = tokenizer.nextToken();\n\t\t\t\t\t\t\t\tString key = param.substring(0, param.indexOf('='));\n\t\t\t\t\t\t\t\tString value = param.substring(param.indexOf('=')+1);\n \t\t\t\t\t\t\t\toptionalParams.put(key, value);\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tthis.optionalParams = optionalParams;\n \t\t\t\t\t\t} else {\n \t\t\t\t\t\t\tthis.optionalParams = null;\n \t\t\t\t\t\t}\n \n \t\t\t\t\t\tthis.dataOffset = dataOffset;\n \t\t\t\t\t\treturn;\n \t\t\t\t\t}\n \n \t\t\t\t\tos.reset();\n \t\t\t\t} else if (b == -1) {\n \t\t\t\t\tthrow new IOException(\"Premature end of cached file.\");\n \t\t\t\t} else {\n \t\t\t\t\tos.write(b);\n \t\t\t\t}\n \t\t\t}\n \t\t} finally {\n \t\t\tif (is != null) {\n \t\t\t\ttry {\n \t\t\t\t\tis.close();\n \t\t\t\t} catch (IOException e) {\n \t\t\t\t\tlog.error(\"Cannot close input cache file: \"\n \t\t\t\t\t\t\t+ this.dataFile.getAbsolutePath());\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public abstract void loadKnowledge(String path) throws LoadKnowledgeException;", "void massiveModeLoading( File dataPath );", "public static Queries parseFile(File file) throws JAXBException {\n\t\tJAXBContext jc = JAXBContext.newInstance(\"com.insa.rila.xml.querie\");\n\t\tUnmarshaller u = jc.createUnmarshaller();\n\t\tObject o = u.unmarshal(file);\n\n\t\treturn (Queries) o;\n\t}", "private void loadTimingInformation()\n\t{\n\t\ttry\n\t\t{\n\t\t\tFile loadFile = new File(\"asdasda.save\");\n\t\t\tif(loadFile.exists())\n\t\t\t{\n\t\t\t\tqueryList.clear();\n\t\t\t\tScanner textScanner = new Scanner(loadFile);\n\t\t\t\twhile(textScanner.hasNext())\n\t\t\t\t{\n\t\t\t\t\tString query = textScanner.nextLine();\n\t\t\t\t\tlong queryTime = Long.parseLong(textScanner.nextLine());\n\t\t\t\t\tqueryList.add(new QueryInfo(query, queryTime));\n\t\t\t\t}\n\t\t\t\ttextScanner.close();\n\t\t\t\tJOptionPane.showMessageDialog(getAppFrame(), queryList.size() + \" QueryInfo objects were loaded into the application\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(getAppFrame(), \"File not present. No QueryInfo objects loaded\");\n\t\t\t}\n\t\t}\n\t\tcatch(IOException currentError)\n\t\t{\n\t\t\tdataController.displayErrors(currentError);\n\t\t}\n\t}", "public Queries loadQueries() {\r\n\t\tQueries queries = null;\r\n\t try {\r\n queries = Queries.unmarshalAsQueries();\r\n\t } catch (Exception e) {\r\n\t e.printStackTrace();\r\n\t }\r\n\t return queries;\r\n\t}", "@Override\n public Object load(Object query,\n CacheElement ce)\n throws ResourceException\n {\n throw new ResourceException(\"CachingProvider: load(Object) not supported, use load(String)\");\n }", "public DaoFileImpl(String path) {\r\n\t\tgson = new Gson();\r\n\t\tthis.path = path;\r\n\t\tthis.daoMap = new HashMap<>();\r\n\t\treadMapFromFile();\r\n\t}", "public static StatementLocator fromClasspath(UseSTGroupCache useCache, String path) {\n return forURL(useCache, ST4StatementLocator.class.getResource(path));\n }", "public void separateFileToQueries(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, File queriesFile, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath) {\n try {\n String allQueries = new String(Files.readAllBytes(Paths.get(queriesFile.getAbsolutePath())), Charset.defaultCharset());\n String[] allQueriesArr = allQueries.split(\"<top>\");\n\n for (String query : allQueriesArr) {\n if(query.equals(\"\")){\n continue;\n }\n String queryId = \"\", queryText = \"\", queryDescription = \"\";\n String[] lines = query.toString().split(\"\\n\");\n for (int i = 0; i < lines.length; i++){\n if(lines[i].contains(\"<num>\")){\n queryId = lines[i].substring(lines[i].indexOf(\":\") + 2);\n }\n else if(lines[i].contains(\"<title>\")){\n queryText = lines[i].substring(8);\n }\n else if(lines[i].contains(\"<desc>\")){\n i++;\n while(i < lines.length && !lines[i].equals(\"\")){\n queryDescription += lines[i];\n i++;\n }\n }\n }\n search(indexer, cityIndexer, ranker, queryText, withSemantic, chosenCities, citiesByTag, withStemming, saveInPath, queryId, queryDescription);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "protected static InputStream inputStreamFromClasspath(String path) {\n return Thread.currentThread().getContextClassLoader().getResourceAsStream(path);\n }", "private void readDocQueriesRelevance(){\n File f = new File(\"cranfield.query.relevance.txt\");\n if(f.exists() && !f.isDirectory()){\n try {\n FileReader fileReader=null;\n try {\n fileReader = new FileReader(f);\n } catch (FileNotFoundException ex) {\n Logger.getLogger(EvaluationQueries.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n BufferedReader bufferedReader = new BufferedReader(fileReader);\n String line;\n String[] querieDocRel;\n List<QuerieDocRelevance> tempQueriesRelevance;\n while ((line = bufferedReader.readLine()) != null) {\n querieDocRel = line.split(\"\\\\s+\");\n int querieNumber = Integer.parseInt(querieDocRel[0]);\n if(queriesRelevanceMap.containsKey(querieNumber)){\n tempQueriesRelevance = queriesRelevanceMap.get(querieNumber);\n tempQueriesRelevance.add(new QuerieDocRelevance(Integer.parseInt(querieDocRel[1]),Integer.parseInt(querieDocRel[2])));\n queriesRelevanceMap.put(querieNumber,tempQueriesRelevance);\n \n }else{\n tempQueriesRelevance = new ArrayList<>();\n tempQueriesRelevance.add(new QuerieDocRelevance(Integer.parseInt(querieDocRel[1]),Integer.parseInt(querieDocRel[2])));\n queriesRelevanceMap.put(querieNumber,tempQueriesRelevance); \n }\n \n }\n \n } catch (IOException ex) {\n Logger.getLogger(EvaluationQueries.class.getName()).log(Level.SEVERE, null, ex);\n } \n } \n \n }", "private static Trajectory readFile(String name) {\n\t\ttry {\n\t\t\tFile file = new File(cacheDirectory + name);\n\t\t\tFileInputStream fis = new FileInputStream(file);\n\t\t\tObjectInputStream ois = new ObjectInputStream(fis);\n\t\t\tTrajectory t = (Trajectory) ois.readObject();\n\t\t\tois.close();\n\t\t\tfis.close();\n\t\t\treturn t;\n\t\t}\n\t\tcatch (Exception e) { return null; }\n\t}", "public String query(String filename)\n\t{\n\t\treturn filename;\n\t}", "public static <T> T loadAs(String path) throws SlickException {\n\t\treturn loadAs(ResourceLoader.getResourceAsStream(path));\n\t}", "public abstract DbQuery getQuery(String queryName);", "protected List<QueryDefinition> loadQueryDefinitions() {\n try (InputStream qdStream = this.getClass().getResourceAsStream(\"/default-query-definitions.json\")) {\n if (qdStream == null) {\n LOGGER.info(\"Default query definitions file default-query-definitions.json not found\");\n return emptyList();\n }\n return loadQueryDefinitions(qdStream);\n } catch (Exception e) {\n LOGGER.error(\"Error when loading default query definitions from default-query-definitions.json\", e);\n return emptyList();\n }\n }", "public void startFetching(String query){\n this.query = query;\n\n // Need to clear previously open async tasks :\n cancelAllRegisteredAsyncs();\n\n // Async Call :\n new JSONDataFetch().execute(query);\n }", "protected void initQueryFromNamedDefinition(Query query, NamedQueryDefinition nqd) {\n\t\tquery.setCacheable( nqd.isCacheable() );\n\t\tquery.setCacheRegion( nqd.getCacheRegion() );\n\t\tquery.setReadOnly( nqd.isReadOnly() );\n\n\t\tif ( nqd.getTimeout() != null ) {\n\t\t\tquery.setTimeout( nqd.getTimeout() );\n\t\t}\n\t\tif ( nqd.getFetchSize() != null ) {\n\t\t\tquery.setFetchSize( nqd.getFetchSize() );\n\t\t}\n\t\tif ( nqd.getCacheMode() != null ) {\n\t\t\tquery.setCacheMode( nqd.getCacheMode() );\n\t\t}\n\t\tif ( nqd.getComment() != null ) {\n\t\t\tquery.setComment( nqd.getComment() );\n\t\t}\n\t\tif ( nqd.getFirstResult() != null ) {\n\t\t\tquery.setFirstResult( nqd.getFirstResult() );\n\t\t}\n\t\tif ( nqd.getMaxResults() != null ) {\n\t\t\tquery.setMaxResults( nqd.getMaxResults() );\n\t\t}\n\t\tif ( nqd.getFlushMode() != null ) {\n\t\t\tquery.setHibernateFlushMode( nqd.getFlushMode() );\n\t\t}\n\t}", "public InputSource getCachedFile(String fileURI) {\t\t\n\t InputSource in = null;\n\t\t\n\t\ttry {\n\t\t\tif(cache == null) return null;\n\t\t\t\n\t\t\tif(fileURI.endsWith(\"#\")) fileURI = fileURI.substring(0, fileURI.length() - 1);\n\t\t\t\n\t\t\tString localFileName = cache.getProperty(fileURI);\n\t\t\tif(localFileName != null) {\n\t\t\t File file = new File(localFileName);\n\t\t\t if(!file.exists() && localCacheDirectory != null)\n\t\t\t file = new File(localCacheDirectory + File.separator + localFileName);\t\t\t \n\t\t\t\tif(!file.exists()) {\n\t\t\t\t\tSystem.out.println(\"WARNING: Cached file does not exist \" + file);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t System.err.println(\"INFO: Using cached file \" + file + \" for URI \" + fileURI);\n\t\t\t\t in = new InputSource(new FileInputStream(file));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e) {\n\t\t}\n\t\t\n\t\treturn in;\t\t\n\t}", "public QueryCore(String query)\n {\n this.query = query;\n }", "public abstract Source load(ModuleName name);", "private List<HashMap<String,String>> performQuery(Model model, String queryName) throws Exception {\n String sparqlQueryString = this.getQueryFromFile(queryName);\n\n //Parameterized Queries with Jena\n //see: https://jena.apache.org/documentation/query/parameterized-sparql-strings.html\n ParameterizedSparqlString pss = new ParameterizedSparqlString();\n pss.setCommandText(sparqlQueryString);\n\n //build the prefix for source and target before run the query\n\n String inputURIMetadata = Dictionary.AVAILABLE_ONTOLOGIES_HASH.get(myJob.getInputFormat());\n String outputURIMetadata = Dictionary.AVAILABLE_ONTOLOGIES_HASH.get(myJob.getOutputFormat());\n\n //Node file = NodeFactory.createURI(inputURIMetadata+ myJob.getSourceFile());\n //Node object = NodeFactory.createURI(inputURIMetadata+ myJob.getSourceOjbect());\n\n //set parameters for the query\n //pss.setParam(\"fileName\",file);\n //pss.setParam(\"object\",object);\n pss.setNsPrefix(\"metadataSource\", inputURIMetadata);\n pss.setNsPrefix(\"metadataTarget\", outputURIMetadata);\n\n //Prints query after parameter set up\n System.out.println(\"\\n\"+pss.toString());\n\n Query query = pss.asQuery();\n\n QueryExecution qexec = QueryExecutionFactory.create(query, model);\n ResultSetRewindable results = ResultSetFactory.makeRewindable(qexec.execSelect());\n\n if(results.hasNext()){\n List<HashMap<String,String>> resultsObject = new ArrayList<>();\n while (results.hasNext()){\n QuerySolution q = results.next();\n HashMap<String,String> rowMap = new HashMap<>();\n for(String attribute : results.getResultVars()){\n RDFNode obj = q.get(attribute);\n String value = obj.toString();\n rowMap.put(attribute,value);\n }\n System.out.println(rowMap);\n resultsObject.add(rowMap);\n }\n qexec.close() ;\n return resultsObject;\n }else{\n throw new Exception(\"No results\");\n }\n }", "public static Path findItemInCache( final String name, final Configuration conf) throws IOException {\r\n\t\tif (name==null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tPath result = null;\r\n\t\tresult = findClassPathFile(name,conf);\r\n\t\tif (result!=null) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tresult = findNonClassPathFile(name,conf);\r\n\t\tif (result!=null) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tresult = findClassPathArchive(name,conf);\r\n\t\tif (result!=null) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tresult = findNonClassPathArchive(name,conf);\r\n\t\tif (result!=null) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static Object loadFromClassPath(String path) throws SlickException {\n\t\tObject o = new Object();\n\t\tInputStream in = IO_Object.class.getClassLoader().getResourceAsStream(path);\n\t\tObjectInputStream inStream;\n\t\ttry {\n\t\t\tinStream = new ObjectInputStream(in);\n\t\t\to = inStream.readObject();\n\t\t\tinStream.close();\n\t\t\treturn o;\n\t\t} catch (Exception ex) {\n\t\t\tthrow new SlickException(ex.getMessage(), ex.getCause());\n\t\t}\n\t\t\n\t}", "public void loadFromSortedFile(String file) throws Exception{\n if(file == null){\n throw new Exception(\"file is null\");\n }\n try{\n FileReader fr = new FileReader(file);\n BufferedReader br = new BufferedReader(fr);\n\n String s = null;\n while((s = br.readLine()) != null) {\n QueryItem qi = null;\n try{\n qi = new QueryItem(s);\n }catch(Exception e){\n System.out.println(\"[\"+s+\"] load error\");\n continue;\n }\n updateMobile(qi);\n }\n\n br.close();\n fr.close();\n }catch(IOException e){\n e.printStackTrace();\n }\n System.out.println(\"load finished\");\n }", "public SparseDataset parse(String name, String path) throws FileNotFoundException, IOException, ParseException {\n return parse(name, new File(path));\n }", "private void reloadData() throws IOException\n {\n /* Reload data from file, if it is modified after last scan */\n long mtime = loader.getModificationTime();\n if (mtime < lastKnownMtime) {\n return;\n }\n lastKnownMtime = mtime;\n\n InputStream in = loader.getInputStream();\n BufferedReader bin = new BufferedReader(new InputStreamReader(in));\n cache.clear();\n String line;\n while ((line = bin.readLine()) != null) {\n try {\n Map<String, Object> tuple = reader.readValue(line);\n updateLookupCache(tuple);\n } catch (JsonProcessingException parseExp) {\n logger.info(\"Unable to parse line {}\", line);\n }\n }\n IOUtils.closeQuietly(bin);\n IOUtils.closeQuietly(in);\n }", "public void load(String path) throws IOException, ClassNotFoundException {\n FileInputStream inputFile = new FileInputStream(path);\n ObjectInputStream objectInput = new ObjectInputStream(inputFile);\n\n map = (String[]) objectInput.readObject();\n\n objectInput.close();\n inputFile.close();\n }", "@SuppressWarnings(\"unchecked\") // hack to remove annoying warning of casting\n\tpublic void loadQValues(String path) {\n\t\ttry {\n\t\t\tqValues = (HashMap<StateActionPair, Double>) SLAPI.load(path);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public CacheEntry searchWithCache(String name) {\n CacheEntry entry = cacheHit(name);\n \n if (entry != null) return entry;\n \n // we grab serial number first; the worst that will happen is we cache a later\n // update with an earlier serial number, which would just flush anyway\n Object token = getCacheToken();\n DynamicMethod method = searchMethodInner(name);\n \n return method != null ? addToCache(name, method, token) : addToCache(name, UndefinedMethod.getInstance(), token);\n }", "public static void main(String[] args) {\n\t\tif(args.length >= 2){\n\t\t\ttry{\n\t\t\t\tpageSize = Integer.parseInt(args[1]);\n\t\t\t} \n\t\t\tcatch(NumberFormatException e){\n\t\t\t\tpageSize = 4096;\n\t\t\t\tSystem.out.println(\"Pagesize was not a number defaulting to 4096\");\n\t\t\t}\n\t\t\tFile f = new File(\"heap.\" + pageSize);\n\t\t\tsearchQuery = args[0];\n\n\t\t\tSystem.out.println(\"Reading File\");\n\t\t\tSystem.out.println(searchQuery);\n\t\t\tSystem.out.println(\"heap.\" + pageSize);\n\t\t\tstartTime = System.currentTimeMillis();\n\t\t\treadFile(f);\n\t\t\t\n\t\t\tSystem.out.println(\"Searching\");\n\t\t\t//search();\n\t\t\tendTime = System.currentTimeMillis();\n\t\t\tstdout();\n\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Run format: java dbquery [text] [pagesize]\");\n\t\t}\n\t}", "public synchronized InputStream tryToLoadFromEverywhere(String filename) {\n InputStream result = null;\n result = System.class.getResourceAsStream(filename);\n if (result != null) {\n return result;\n }\n\n result = Thread.currentThread().getContextClassLoader().getResourceAsStream(filename);\n if (result != null) {\n return result;\n }\n\n result = Thread.currentThread().getClass().getResourceAsStream(filename);\n if (result != null) {\n return result;\n }\n\n result = ClassLoader.getSystemResourceAsStream(filename);\n if (result != null) {\n return result;\n }\n result = ClassLoader.getSystemClassLoader().getResourceAsStream(filename);\n if (result != null) {\n return result;\n }\n\n return result;\n }", "public static void main(String[] args) {\n //Instantiate a new instance of the Queries class called query\n Queries query = new Queries();\n //Instantiate empty strings called search, queryTerm, and cache\n String search = \"\";\n String queryTerm = \"\";\n String cache = \"\";\n\n //For each item in the arguments array\n for (int i = 0; i < args.length; i++) {\n //If the item is --search, run the following\n if (args[i].equals(\"--search\")) {\n //If --search is the last argument, set the search string to null\n if (i == args.length - 1) {\n search = null;\n }\n //Otherwise set the search string to the next argument\n else {\n search = args[i + 1];\n }\n }\n //If the item is --query run the following\n if (args[i].equals(\"--query\")) {\n //If --query is the last argument, set the queryTerm string to null\n if (i == args.length - 1) {\n queryTerm = null;\n }\n else {\n //Add the next item to the query string\n queryTerm = args[i + 1];\n //Instantiate an integer called j as i+1\n int j = i + 1;\n //While j is less than the number of arguments -1, and the argument\n //after j isn't --search or --cache and queryTerm isn't --search or --cache, add the j+1 argument to the queryTerm string\n while (j < args.length - 1 && !args[j + 1].equals(\"--search\") && !args[j + 1].equals(\"--cache\") && !queryTerm.equals(\"--search\") && !queryTerm.equals(\"--cache\")) {\n queryTerm += \" \" + args[j + 1];\n j++;\n }\n }\n }\n //If the item is --cache, run the following\n if (args[i].equals(\"--cache\")) {\n //If --cache is the last argument, set the cache string to null\n if (i == args.length - 1) {\n cache = null;\n }\n //Otherwise, set the cache string to the next argument\n else {\n cache = args[i + 1];\n }\n }\n }\n //Create a new file object from the cache\n File folder = new File(cache);\n //Instantiate a boolean variable called noErrors to true\n Boolean noErrors = true;\n //If the queryTerm string is null, --cache, or --search (indicating a missing argument), print\n //the appropriate error message and set noErrors to false\n if (queryTerm == null || queryTerm.equals(\"--cache\") || queryTerm.equals(\"--search\")) {\n System.out.println(\"Missing value for --query\\n\"\n + \"Malformed command line arguments.\");\n noErrors = false;\n }\n //If the search string is null, --cache, or --query (indicating a missing argument), print\n //the appropriate error message and set noErrors to false\n else if (search == null || search.equals(\"--cache\") || search.equals(\"--query\")) {\n System.out.println(\"Missing value for --search\\n\"\n + \"Malformed command line arguments.\");\n noErrors = false;\n }\n //If the search string isn't any of the valid search options, print the appropriate error messages and set noErrors to false\n else if (!search.equals(\"author\") && !search.equals(\"publication\") && !search.equals(\"venue\")) {\n System.out.println(\"Invalid value for --search: \" + search);\n System.out.println(\"Malformed command line arguments.\");\n noErrors = false;\n }\n //If the folder created from the cache string isn't a directory, print the appropriate error messages and set noErrors to false\n else if (!folder.isDirectory()) {\n System.out.println(\"Cache directory doesn't exist: \" + cache);\n noErrors = false;\n }\n //If noErrors is true, call the appropriate query with the queryTerm string and folder as parameters\n if (noErrors) {\n if (search.equals(\"author\")) {\n query.authorSearch(queryTerm, folder);\n }\n else if (search.equals(\"venue\")) {\n query.venueSearch(queryTerm, folder);\n }\n else if (search.equals(\"publication\")) {\n query.publicationSearch(queryTerm, folder);\n }\n }\n\n }", "protected abstract Collection<Cache> loadCaches();", "private Object loadObjectFromFile(String filename) {\n //engine.logMessage(\"Loading cache data from: \"+filename);\n ObjectInputStream inputStream = null;\n try { \n inputStream = new ObjectInputStream(new BufferedInputStream(new FileInputStream(filename)));\n Object value=inputStream.readObject();\n inputStream.close(); \n return value;\n } catch (InvalidClassException e) {\n // this can happen if a data class has been updated in a never version compared to \n // the version of the data object stored in the cache\n try {if (inputStream!=null) inputStream.close();} catch (Exception x){}\n File file=new File(filename);\n file.delete();\n return null;\n } catch (Exception e) {\n engine.logMessage(\"WARNING: Unable to load data from cache: \"+e.getMessage());\n return null;\n } finally {\n try {if (inputStream!=null) inputStream.close();} catch (Exception x) {engine.logMessage(\"SYSTEM WARNING: Unable to close ObjectInputStream in cache: \"+x.getMessage());}\n } \n }", "public static void readQueryFromFile(String fileName, String outputFile, String outputMetricsFile, String op, Indexer si) {\n readQueryFromFile(fileName, outputFile, outputMetricsFile, op, si, null);\n }", "public JenaDataSource(String filePath)\n\t{\n\t\tOntModel model = null;\n\t\t\n\t\tInputStream is = getClass().getResourceAsStream(filePath);\n\t\tmodel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);\n\t\tmodel.read(is, null, \"TTL\");\n\t\tthis.populatePrefixMappings(model);\n\t\t\n\t\tsetModel(model);\n\t}", "public String readSQLFile(String filename) {\n\t\tString query = null;\n\t\ttry (BufferedReader reader = new BufferedReader(\n\t\t\t\tnew InputStreamReader(\n\t\t\t\t\t\tgetClass().getResourceAsStream(\"/sql/\" + filename + \".sql\")))) {\n\t\t\tList<String> lines = reader.lines().collect(Collectors.toList());\n\t\t\tquery = join(\" \", lines).replaceAll(\"\\\\s+\", \" \");\n\t\t} catch (IOException e) {\n\t\t\tString msg = \"Can't read SQL file \" + filename;\n\t\t\tlogger.error(msg, e);\n\t\t\tthrow new RuntimeException(msg, e);\n\t\t}\n\t\treturn query;\n\t}", "private InputSource classpathLookup(ResourceLocation matchingEntry) {\n\n InputSource source = null;\n\n Path cp = classpath;\n if (cp != null) {\n cp = classpath.concatSystemClasspath(\"ignore\");\n } else {\n cp = (new Path(getProject())).concatSystemClasspath(\"last\");\n }\n AntClassLoader loader = getProject().createClassLoader(cp);\n\n //\n // for classpath lookup we ignore the base directory\n //\n InputStream is\n = loader.getResourceAsStream(matchingEntry.getLocation());\n\n if (is != null) {\n source = new InputSource(is);\n URL entryURL = loader.getResource(matchingEntry.getLocation());\n String sysid = entryURL.toExternalForm();\n source.setSystemId(sysid);\n log(\"catalog entry matched a resource in the classpath: '\"\n + sysid + \"'\", Project.MSG_DEBUG);\n }\n\n return source;\n }", "public void performSearch() throws IOException {\n configuration();\n\n File fileDir = new File(queryFilePath);\n if (fileDir.isDirectory()) {\n File[] files = fileDir.listFiles();\n Arrays.stream(files).forEach(file -> performSearchUsingFileContents(file));\n }\n }", "void load (CacheEntry entry) throws IOException;", "public DataSetLoader load (String path) {\n\t\tJSONParser parser = new JSONParser();\n\t\t\n\t\t// Obtain the name of the data set from the file name\n\t\tString name = FilenameUtils.removeExtension(new File(path).getName());\n\t\t\n\t\ttry {\n\t\t\t// Parse the JSON file into a JSON object\n\t\t\tthis.dataSet = new DataSet(name, (JSONArray) parser.parse(new FileReader(CURRENT_DIR + \"data_sets/\" + path)));\n\t\t} \n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t\tcatch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn this;\n\t}", "public void parse(final Path path) {\n try (FileChannel fileChannel = FileChannel.open(path, StandardOpenOption.READ)) {\n // map class file to the memory\n // by choosing big endian, high order bytes must be put to the buffer before low order bytes\n ByteBuffer byteBuffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, fileChannel.size())\n .order(ByteOrder.BIG_ENDIAN);\n System.out.printf(\"Classfile %s\\n\", path.toString());\n parseConstantPool(byteBuffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public QueryCore loadQuery(String query, List<Object> l)\n {\n this.query = query;\n this.l = l;\n \n return this;\n }", "public interface QueryCache {\n IQ get(InputQuery inputQuery);\n\n void put(InputQuery inputQuery, IQ executableQuery);\n\n void clear();\n}", "public static void loadCache() {\n\t\t // it is the temporary replacement to database. We should use DB instead\n\t Circle circle = new Circle();\n\t circle.setId(\"1\");\n\t shapeMap.put(circle.getId(),circle);\n\n\t Square square = new Square();\n\t square.setId(\"2\");\n\t shapeMap.put(square.getId(),square);\n\n\t Rectangle rectangle = new Rectangle();\n\t rectangle.setId(\"3\");\n\t \n\t Circle circle2 = new Circle();\n\t circle2.setId(\"4\");\n\t circle2.setType(\"Big Circle\");\n\t shapeMap.put(circle2.getId(),circle2);\n\t shapeMap.put(rectangle.getId(), rectangle);\n\t }", "public static String get(String path)\n {\n try\n {\n URI uri = new URI(path);\n String fragment = uri.getFragment();\n if (fragment != null)\n {\n File file = new File(fragment);\n if (file.exists())\n return file.toString();\n }\n\n // remove the fragment\n path = uri.getPath();\n }\n catch (URISyntaxException e)\n {\n // do nothing... fall through to the remaining code\n }\n\n // otherwise, try to load from full path\n\n if (cachedFiles == null)\n return null;\n\n for (Path cachedFile : cachedFiles)\n {\n if (cachedFile.toString().endsWith(path))\n {\n return cachedFile.toString();\n }\n if (cachedFile.getParent().toString().endsWith(path))\n {\n return cachedFile.toString();\n }\n }\n\n return null;\n }", "public <K, V> Cache<K, V> getCache( String name, Class<K> keyClazz, Class<V> valueClazz )\n {\n if ( cacheManager == null )\n {\n LOG.error( \"Cannot fetch the cache named {}, the CacheServcie is not initialized\", name );\n throw new IllegalStateException( \"CacheService was not initialized\" );\n }\n\n LOG.info( \"fetching the cache named {}\", name );\n\n Cache<K, V> cache = cacheManager.getCache( name, keyClazz, valueClazz );\n\n return cache;\n }", "public final AstValidator.load_clause_return load_clause() throws RecognitionException {\n AstValidator.load_clause_return retval = new AstValidator.load_clause_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree LOAD75=null;\n AstValidator.filename_return filename76 =null;\n\n AstValidator.func_clause_return func_clause77 =null;\n\n AstValidator.as_clause_return as_clause78 =null;\n\n\n CommonTree LOAD75_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:227:13: ( ^( LOAD filename ( func_clause )? ( as_clause )? ) )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:227:15: ^( LOAD filename ( func_clause )? ( as_clause )? )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n LOAD75=(CommonTree)match(input,LOAD,FOLLOW_LOAD_in_load_clause900); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n LOAD75_tree = (CommonTree)adaptor.dupNode(LOAD75);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(LOAD75_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_filename_in_load_clause902);\n filename76=filename();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, filename76.getTree());\n\n\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:227:32: ( func_clause )?\n int alt19=2;\n int LA19_0 = input.LA(1);\n\n if ( (LA19_0==FUNC||LA19_0==FUNC_REF) ) {\n alt19=1;\n }\n switch (alt19) {\n case 1 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:227:32: func_clause\n {\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_func_clause_in_load_clause904);\n func_clause77=func_clause();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, func_clause77.getTree());\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n\n }\n\n\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:227:45: ( as_clause )?\n int alt20=2;\n int LA20_0 = input.LA(1);\n\n if ( (LA20_0==AS) ) {\n alt20=1;\n }\n switch (alt20) {\n case 1 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:227:45: as_clause\n {\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_as_clause_in_load_clause907);\n as_clause78=as_clause();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, as_clause78.getTree());\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n\n }\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "public static void benchmark_query(String[] args) {\n System.err.println(\"benchmark: query\");\n\n double time_load, time_first = 0, time_rest;\n long mem_graph;\n \n long m0, m1;\n m0 = get_memory_footprint();\n Model model = ModelFactory.createDefaultModel();\n\n long t0, t1;\n t0 = System.nanoTime();\n InputStream in = FileManager.get().open(args[1]);\n model.read(in, null, \"N-TRIPLES\");\n t1 = System.nanoTime();\n m1 = get_memory_footprint();\n time_load = (t1-t0)/1e9;\n mem_graph = m1-m0;\n\n t0 = System.nanoTime();\n Resource personClass = model.createResource(\"http://dbpedia.org/ontology/Person\");\n StmtIterator results = model.listStatements(null, RDF.type, personClass);\n long nb_stmts = 0;\n while (results.hasNext()) {\n Statement s = results.next();\n nb_stmts += 1;\n if (nb_stmts == 1) {\n t1 = System.nanoTime();\n time_first = (t1-t0)/1e9;\n t0 = System.nanoTime();\n }\n }\n t1 = System.nanoTime();\n time_rest = (t1-t0)/1e9;\n\n System.err.println(\"parsed: \" + model.size() + \" statements\");\n System.err.println(\"matched: \" + nb_stmts + \" statements\");\n System.out.println(time_load + \",\" + mem_graph + \",\" + time_first + \",\" + time_rest);\n }", "public static void loadFileFromClasspath(final String aFile)\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(classLoader);\n\t\t\tfinal Resource resource = resolver.getResource(aFile);\n\t\t\tif (resource == null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfinal InputStream inputStream = resource.getInputStream();\n\t\t\tcreateTransformer(inputStream, resource.getDescription());\n\t\t}\n\t\tcatch (final Exception e)\n\t\t{\n\t\t\tlogger.warn(\"Unable to load file \" + aFile, e);\n\t\t}\n\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic static void prepareQuery() throws InterruptedException, FileNotFoundException, IOException{\n\t\tint querySetSize=2;\n\t\tHashMap<Integer, Integer> totQ=(HashMap<Integer, Integer>) General.readObject(\"O:/ImageRetrieval/Herve1.5K/Herve_querys_L_to_L.hashMap\");\n\t\t\n\t\tString subQSetFolder=\"O:/ImageRetrieval/Herve1.5K/HerveQuerys_LtoL_perSubSet\"+querySetSize+\"/\";\n\t\tGeneral.makeORdelectFolder(subQSetFolder);\n\t\tRandom rand=new Random();\n\t\tArrayList<HashMap<Integer, Integer>> Qsets =General.randSplitHashMap(rand, totQ, 0, querySetSize);\n\t\tint totQnum=0;\n\t\tfor (int i = 0; i < Qsets.size(); i++) {\n\t\t\tGeneral.writeObject(subQSetFolder+\"Q\"+i+\".hashMap\", Qsets.get(i));\n\t\t\tSystem.out.println(i+\", \"+Qsets.get(i).size());\n\t\t\ttotQnum+=Qsets.get(i).size();\n\t\t}\n\t\tGeneral.Assert(totQnum==totQ.size(), \"err, totQnum:\"+totQnum+\", should ==\"+totQ.size());\n\t\tSystem.out.println(\"taget querySetSize:\"+querySetSize+\", totQnum:\"+totQnum+\", should ==\"+totQ.size());\n\t}", "private InputSource filesystemLookup(ResourceLocation matchingEntry) {\n\n String uri = matchingEntry.getLocation();\n // the following line seems to be necessary on Windows under JDK 1.2\n uri = uri.replace(File.separatorChar, '/');\n URL baseURL;\n\n //\n // The ResourceLocation may specify a relative path for its\n // location attribute. This is resolved using the appropriate\n // base.\n //\n if (matchingEntry.getBase() != null) {\n baseURL = matchingEntry.getBase();\n } else {\n try {\n baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir());\n } catch (MalformedURLException ex) {\n throw new BuildException(\"Project basedir cannot be converted to a URL\");\n }\n }\n\n URL url = null;\n try {\n url = new URL(baseURL, uri);\n } catch (MalformedURLException ex) {\n // this processing is useful under Windows when the location of the DTD\n // has been given as an absolute path\n // see Bugzilla Report 23913\n File testFile = new File(uri);\n if (testFile.exists() && testFile.canRead()) {\n log(\"uri : '\"\n + uri + \"' matches a readable file\", Project.MSG_DEBUG);\n try {\n url = FILE_UTILS.getFileURL(testFile);\n } catch (MalformedURLException ex1) {\n throw new BuildException(\n \"could not find an URL for :\" + testFile.getAbsolutePath());\n }\n } else {\n log(\"uri : '\"\n + uri + \"' does not match a readable file\", Project.MSG_DEBUG);\n\n }\n }\n\n InputSource source = null;\n if (url != null && \"file\".equals(url.getProtocol())) {\n String fileName = FILE_UTILS.fromURI(url.toString());\n if (fileName != null) {\n log(\"fileName \" + fileName, Project.MSG_DEBUG);\n File resFile = new File(fileName);\n if (resFile.exists() && resFile.canRead()) {\n try {\n source = new InputSource(Files.newInputStream(resFile.toPath()));\n String sysid = JAXPUtils.getSystemId(resFile);\n source.setSystemId(sysid);\n log(\"catalog entry matched a readable file: '\"\n + sysid + \"'\", Project.MSG_DEBUG);\n } catch (IOException ex) {\n // ignore\n }\n }\n }\n }\n return source;\n }", "public void cacheableQuery() throws HibException;", "@Override\n\t\tpublic void configure(JobConf job) {\n\t\t\twords = job.get(\"search.word\").split(\"[ \\t]+\");\n\t\t\ttry {\n\t\t\t\tPath[] filemapcache = DistributedCache.getLocalCacheFiles(job);\n\t\t\t\tfor (Path file : filemapcache) {\n\t\t\t\t\tBufferedReader fis = new BufferedReader(new FileReader(\n\t\t\t\t\t\t\tfile.toString()));\n\t\t\t\t\tparseFileMap(fis, filemap);\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public static List<SQLquery> updateQueryList() throws IOException {\n\n List<String> querynames = new ArrayList<String>();\n List<SQLquery> queries = new ArrayList<SQLquery>();\n File curDir = new File(\".\");\n String[] fileNames = curDir.list();\n\n for (int i = 0; i <= fileNames.length - 1; i++) {\n\n /**\n * SELECT ONLY .XYZ FILES FROM FOLDER\n */\n System.out.println(fileNames[i]);\n if (fileNames[i].contains(\".xyz\")) {\n\n querynames.add(fileNames[i]);\n\n }\n\n }\n\n /**\n * create SQLquery objects with appropriate name and query string\n */\n for ( String querypath : querynames ) {\n\n String content = new String(Files.readAllBytes(Paths.get(querypath)));\n SQLquery newquery = new SQLquery(querypath.replace(\".xyz\",\"\"),content);\n queries.add(newquery);\n\n }\n\n /**\n * return query list\n */\n return queries;\n\n }", "public interface DocumentTypeQueryService extends XmlLoader {\n\n @Cacheable(value= org.kuali.rice.kew.api.doctype.DocumentType.Cache.NAME, key=\"'{BO}' + 'documentTypeId=' + #p0\")\n public DocumentType findById(String documentTypeId);\n\n @Cacheable(value= org.kuali.rice.kew.api.doctype.DocumentType.Cache.NAME, key=\"'{BO}' + 'name=' + #p0\")\n public DocumentType findByName(String name);\n\n @Cacheable(value= org.kuali.rice.kew.api.doctype.DocumentType.Cache.NAME,\n key=\"'{BO}' + 'documentTypeId=' + #p0.getId() + '|' + 'name=' + #p0.getName() + '|' + 'label=' + #p0.getLabel() + '|' + 'active=' + #p0.isActive() +'docGroupName=' + #p1 + '|' + 'climbHierarchy=' + #p2\")\n public Collection<DocumentType> find(DocumentType documentType, String docGroupName, boolean climbHierarchy);\n\n @Cacheable(value= org.kuali.rice.kew.api.doctype.DocumentType.Cache.NAME, key=\"'{BO}{root}' + 'documentTypeId=' + #p0.getId()\")\n public DocumentType findRootDocumentType(DocumentType docType);\n \n /**\n * Returns the DocumentType of the Document with the given ID. \n * \n * @since 2.3\n */\n @Cacheable(value= org.kuali.rice.kew.api.doctype.DocumentType.Cache.NAME, key=\"'{BO}' + 'documentId=' + #p0\")\n public DocumentType findByDocumentId(String documentId);\n \n}", "private void addQuery(String query){\n this.queries.add( query);\n }", "protected Source executeQuery(Session session, String path, String statement)\n throws IOException {\n try {\n // modify path for query execution\n statement = path + statement;\n\n QueryManager queryManager = session.getWorkspace()\n .getQueryManager();\n Query query = queryManager.createQuery(statement,\n JaxenQueryHandler.FULL_XPATH);\n QueryResult result = query.execute();\n\n return new QueryResultSource(this, session, result.getNodes(),\n iClient);\n } catch (RepositoryException e) {\n throw new SourceException(\"Cannot execute query '\" + statement\n + \"'\", e); //$NON-NLS-1$\n }\n }", "private void getCache(Context context) throws IOException {\n\t\t // Read file from distributed caches - each line is a item/itemset with its frequent\n\n \t// get caches files.\n\t\tfor (int i = 0; i < 10; i++)\n\t\t\tSystem.out.println(\"SETUP ------ MAPPER ----------- GET FREQUENT ITEMS--------------\");\n\t\t\n\t\t\n\t\t// URI to locate cachefile, ex URI a = new URI(\"http://www.foo.com\");\n\t\tList<URI> uris = Arrays.asList(context.getCacheFiles());\n\t\t\n\t\tSystem.out.println(\"Reading cached files\");\n\t\t// read cache files which contains candidates?\n\t\t\n\t\tnItems = 0;\n\t\t\n\t\tfor (URI uri : uris) {\n\t\t\tPath p = new Path(uri);\n\t\t\tSystem.out.println(\"Loading \" + uri.toString());\n\t\t\tFileSystem fs = FileSystem.get(context.getConfiguration());\n\t\t\tInputStreamReader ir = new InputStreamReader(fs.open(p));\n\t\t\tBufferedReader data = new BufferedReader(ir);\n\t \twhile (data.ready()) { \t\t\n\t \t\tString line=data.readLine();\n\t \t\tif (line.matches(\"\\\\s*\")) continue; // be friendly with empty lines\n\t \t\tString[] numberStrings = line.split(\"\\t\");\n\t \t\t\n \n\t \t\tint frequentItem = Integer.parseInt(numberStrings[0]);\n \t\t\tif (!hashItems.containsKey(frequentItem)) {\n\t \t\t\t\thashItems.put(frequentItem, nItems);\n\t \t\t\t\tnItems++;\n\t \t\t\t}\n\t \t\t}\n\t \t\t\n\t \t} \n\n }", "private static void readDatabase(String path) {\n try {\n FileInputStream fileIn = new FileInputStream(path + \"/database.ser\");\n ObjectInputStream inStream = new ObjectInputStream(fileIn);\n database = (Database) inStream.readObject();\n inStream.close();\n fileIn.close();\n } catch (IOException i) {\n i.printStackTrace();\n } catch (ClassNotFoundException c) {\n c.printStackTrace();\n }\n }", "private void load(FileInputStream input) {\n\t\t\r\n\t}", "private void readFromFile(String path) throws ClassNotFoundException {\n\t\ttry {\n\t\t\tInputStream file = new FileInputStream(path);\n\t\t\tInputStream buffer = new BufferedInputStream(file);\n\t\t\tObjectInput input = new ObjectInputStream(buffer);\n\n\t\t\ttagList = (HashMap<String, Integer>) input.readObject();\n\t\t\tinput.close();\n\t\t} catch (IOException ex) {\n\t\t\tSystem.out.println(\"Cannot read from input.\");\n\t\t}\n\t}", "private ProviderLoader loadFileProvider(final cacheItem cached) {\n final File file = cached.getFirst();\n final PluginScanner second = cached.getSecond();\n return filecache.get(file, second);\n }", "public SimpleDatabase executeSqlFile(String name) {\n // possibly trim .sql extension\n if (name.toLowerCase().endsWith(\".sql\")) {\n name = name.substring(0, name.length() - 4);\n }\n SQLiteDatabase db = context.openOrCreateDatabase(name);\n int id = context.getResourceId(name, \"raw\");\n return executeSqlFile(db, id);\n }", "public CorpusSearch(Path searchRoot, MdCSearchQuery query) {\n try {\n this.searchRoot = searchRoot;\n this.query = query;\n extensions = new String[]{\n \".gly\", \".GLY\", \".hie\", \".HIE\"\n };\n fileIterator = Files\n .walk(searchRoot)\n .filter(this::isJSeshPath)\n .iterator();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "@SuppressWarnings(\"Duplicates\")\n public static void readQueryFromFile(String fileName, String outputFile, String outputMetricsFile, String op, Indexer si, Thesaurus thesaurus) {\n try (BufferedReader in = new BufferedReader(new FileReader(fileName))) {\n String line, queryTimes;\n int id = 0;\n double latency, median;\n long start, end, tStart = System.currentTimeMillis();\n ArrayList<Double> medianLatency = new ArrayList<>();\n Query query;\n List<SearchData> results;\n a:\n while ((line = in.readLine()) != null) {\n id++;\n\n start = System.currentTimeMillis();\n\n if (thesaurus != null) {\n line = thesaurus.getExpandedQuery(line);\n }\n\n query = new Query(id, line);\n\n switch (op) {\n case \"words\":\n results = booleanSearchWord(query, si);\n break;\n\n case \"frequency\":\n results = booleanSearchFrequency(query, si);\n break;\n\n default:\n System.err.println(\"Option not found.\");\n break a;\n }\n\n end = System.currentTimeMillis();\n latency = (double) (end - start);\n medianLatency.add(latency);\n\n SaveToFile.saveResults(results, outputFile);\n\n }\n long tEnd = System.currentTimeMillis();\n\n Collections.sort(medianLatency);\n\n System.out.println(\"\\tQuery Throughput: \" + (double) Math.round((id / ((tEnd - tStart) / 1000.0)) * 10) / 10 + \" queries per second\");\n\n\n if (medianLatency.size() % 2 == 0) {\n median = (medianLatency.get(medianLatency.size() / 2) + medianLatency.get((medianLatency.size() / 2) + 1)) / 2;\n System.out.println(\"\\tMedian query latency: \" + median + \" ms\");\n queryTimes = \"Query Throughput: \" + (double) Math.round((id / ((tEnd - tStart) / 1000.0)) * 10) / 10 + \" queries per second\\n\" +\n \"Median query latency: \" + median + \" ms\\n\";\n\n } else {\n System.out.println(\"\\tMedian query latency: \" + medianLatency.get(Math.round(medianLatency.size() / 2)) + \" ms\");\n queryTimes = \"Query Throughput: \" + (double) Math.round((id / ((tEnd - tStart) / 1000.0)) * 10) / 10 + \" queries per second\\n\" +\n \"Median query latency: \" + medianLatency.get(Math.round(medianLatency.size() / 2)) + \" ms\\n\";\n }\n\n SaveToFile.saveMetrics(queryTimes, outputMetricsFile);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void queryDataPreProcess(String queryText) throws Exception {\n StopwordRemover stopwordRemover = new StopwordRemover();\n WordNormalizer wordNormalizer = new WordNormalizer();\n\n // initiate the BufferedWriter to output result\n FilePathGenerator fpg = new FilePathGenerator(\"result.txt\");\n String path = fpg.getPath();\n\n // queryId\n String queryId = \"\";\n if (queryId == null || queryId.length() == 0){\n// queryId = UUID.randomUUID().toString().replace(\"-\", \"\");\n queryId = String.valueOf(FileConst.query_doc_id);\n }\n\n // append query_id:query_text to exiting doc_id:doc_content text file\n try (FileWriter fileWriter = new FileWriter(path, true); // Path.ResultAssignment1\n BufferedWriter bw = new BufferedWriter(fileWriter)){\n // write doc_id into the result file\n bw.write(queryId + '\\n');\n\n // load doc content\n char[] content = queryText.toCharArray();\n\n // initiate a word object to hold a word\n char[] word;\n\n // initiate the WordTokenizer\n WordTokenizer tokenizer = new WordTokenizer(content);\n\n // process the query word by word iteratively\n while ((word = tokenizer.nextWord()) != null){\n word = wordNormalizer.lowercase(word);\n // write only non-stopword into result file\n if (!stopwordRemover.isStopword(Arrays.toString(word))){\n bw.append(wordNormalizer.toStem(word)).append(\" \");\n query_tokens.add(wordNormalizer.toStem(word));\n }\n }\n bw.append(\"\\n\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public RetrieveFileFromCacheRequest(String fileRef, String uniquePluginName) {\n mFileRef = fileRef;\n mUniquePluginName = uniquePluginName;\n }", "public void loadRules(String path) {\n\n // Checking if the file exists...\n File ruleFile = new File(path);\n if (!ruleFile.exists()) {\n System.err.println(\"The file at \" + path + \" could not be found in RuleLoader!\");\n return;\n }\n\n Scanner sc;\n try {\n sc = new Scanner(ruleFile);\n } catch (FileNotFoundException e) {\n System.err.println(\"The file at \" + path + \" could not be found in RuleLoader!\");\n return;\n }\n sc.useDelimiter(\",\");\n\n // Now begin reading each line in the file.\n // - Lines which are blank or start with # (comment) are ignored.\n // - PathRules start with an & to indicate that they are\n // referencing an existing rule.\n // - Rules created from each line are added to the PhuJusAgent via the\n // addRule method.\n while (sc.hasNextLine()) {\n String readLine = sc.nextLine();\n\n // Ignore blank lines or comments\n if (readLine.length() == 0 || readLine.startsWith(\"#\")) {\n continue;\n }\n\n TFRule tfNewbie = null;\n // PathRules start with a ~/= to indicate that they are pathrules\n if (readLine.startsWith(\"&\")) {\n //TODO: Fix the PathRule loading code\n agent.debugPrintln(\"PathRule loading code not implemented.\");\n //pathNewbie = createPathRuleFromLine(readLine);\n }\n else {\n tfNewbie = createTFRuleFromLine(readLine);\n System.out.println(\"Loading rule \" + readLine);\n }\n if (tfNewbie != null) agent.addRule(tfNewbie);\n }\n }", "public String ReadFile_FromClassPath(String sFileName) {\n String stemp = null;\n\n try {\n InputStream is = getClass().getClassLoader().getResourceAsStream(sFileName);\n stemp = getStringFromInputStream(is);\n\n } catch (Exception e) {\n stemp = null;\n throw new Exception(\"ReadFile_FromClassPath : \" + e.toString());\n } finally {\n return stemp;\n }\n }", "@Cacheable(CacheConfig.CACHE_TWO)\n public File getFile() {\n ClassLoader classLoader = Utility.class.getClassLoader();\n File file = new File(classLoader.getResource(path1).getFile());\n logger.info(\"Cache is not used .... \");\n return file;\n }", "public interface QueryPostProcessor\n{\n\tFile postProcessResults(File queryResults);\n}", "private static void load(){\n }", "private void performSearchUsingFileContents(File file) {\n try {\n FileUtility.CustomFileReader customFileReader =\n new FileUtility.CustomFileReader(file.getAbsolutePath()\n .replace(\".txt\", \"\"));\n\n String queryString = null; int i = 1;\n while ((queryString = customFileReader.readLineFromFile()) != null) {\n \t\n Query q = new QueryParser(Version.LUCENE_47, \"contents\",\n analyzer).parse(QueryParser.escape(queryString));\n\n collector = TopScoreDocCollector\n .create(100, true);\n searcher.search(q, collector);\n ScoreDoc[] hits = collector.topDocs().scoreDocs;\n\n Map<String, Float> documentScoreMapper =\n new HashMap<>();\n Arrays.stream(hits).forEach(hit ->\n {\n int docId = hit.doc;\n Document d = null;\n try {\n d = searcher.doc(docId);\n documentScoreMapper.put(d.get(\"path\"), hit.score);\n } catch (IOException e) {\n e.printStackTrace();\n }\n });\n\n SearchResult searchResult =\n new SearchResult(String.valueOf(i), documentScoreMapper);\n\n FileUtility.writeToFile(searchResult, SEARCH_RESULT_DIR + File.separator + i);\n i++;\n\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "protected void loadFile(String resourcePath) {\n // Locate the resource in the classpath\n //URL fileUrl = this.getClass().getResource(resourcePath);\n //File f = new File(fileUrl.getFile());\n List<String[]> data = new LinkedList<>();\n String readLine;\n String[] splitLine;\n\n InputStream in = this.getClass().getResourceAsStream(resourcePath);\n BufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\n /*\n Attempt to read the data from the csv file, provided the input stream was\n actually opened and store the String[] by splitting.\n */\n try {\n log.info(\"Reading data from {}\", resourcePath);\n while((readLine = reader.readLine()) != null) {\n splitLine = readLine.split(DELIMITER);\n\n if (this.validateData(splitLine))\n data.add(splitLine);\n else\n log.error(\"Skipping {}\", readLine);\n }\n }\n catch(IOException e) {\n log.debug(e.getLocalizedMessage());\n }\n finally {\n IOUtils.closeQuietly(reader);\n IOUtils.closeQuietly(in);\n }\n\n //Using toMap collector to provide a keyMapper function that serves as a test for duplicates based on the passenger ID.\n //https://stackoverflow.com/questions/52148400/remove-duplicates-from-a-list-of-string-array\n //This will use the first element as a key and the currently selected element as the value for mapping\n this.lines = new LinkedList<>(\n data.stream().collect(Collectors.toMap(arr -> arr[0], Function.identity(),\n (a, b) -> a)).values());\n\n log.info(\"File {} with {} lines has been loaded\", resourcePath, lines.size());\n }", "private void loadStaticEntity(String path) {\r\n assert (entityManager != null);\r\n \r\n try {\r\n Scanner sc = new Scanner(new File(path));\r\n while (sc.hasNext()) {\r\n int id = sc.nextInt();\r\n float x = sc.nextFloat();\r\n float y = sc.nextFloat();\r\n int kwidth = sc.nextInt();\r\n int kheight = sc.nextInt();\r\n entityManager.addEntity(new StaticEntity(handler, id, Tile.TILEWIDTH * x, \r\n Tile.TILEHEIGHT * y, Tile.TILEWIDTH * kwidth, Tile.TILEHEIGHT * kheight));\r\n }\r\n sc.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public static Object load(String path) throws SlickException {\n\t\tObject o = new Object();\n\t\tObjectInputStream inStream;\n\t\ttry {\n\t\t\tinStream = new ObjectInputStream(new FileInputStream(path));\n\t\t\to = inStream.readObject();\n\t\t\tinStream.close();\n\t\t\treturn o;\n\t\t} catch (Exception ex) {\n\t\t\tthrow new SlickException(ex.getMessage(), ex.getCause());\n\t\t}\n\t}", "public static void loadClass(String name) {\n\n }", "void loadProducts(String filename);", "public static String readCachedFile(Context ctx, String filename){\n \t\treturn readCachedFile(ctx, filename, true);\n \t}", "@Test\n\tpublic void testQueryCaching(){\n\t\tqueryCache();\n\t\tqueryCache2();\n\t}", "private InputStream findStreamInClasspathOrFileSystem(String url) throws IOException {\n\t\tInputStream is = this.getClass().getClassLoader().getResourceAsStream(url);\n\t\t// if not found in the CLASSPATH, load from the file system\n\t\tif (is == null)\n\t\t\tis = new FileInputStream(url);\n\t\treturn is;\n\t}", "public void load() {\n ClassLoader loader;\n Class c;\n Mapper result;\n Method m;\n Object[] tables;\n\n if (isLoaded()) {\n return;\n }\n loader = Mapper.class.getClassLoader();\n try {\n c = loader.loadClass(name);\n } catch (ClassNotFoundException e) {\n throw new IllegalStateException(e.toString());\n }\n try {\n m = c.getMethod(\"load\", new Class[]{});\n } catch (NoSuchMethodException e) {\n throw new IllegalStateException(e.toString());\n }\n try {\n tables = (Object[]) m.invoke(null, new Object[] {});\n } catch (InvocationTargetException e) {\n throw new IllegalStateException(e.getTargetException().toString());\n } catch (IllegalAccessException e) {\n throw new IllegalStateException(e.toString());\n }\n parser = (Parser) tables[0];\n oag = (Oag) tables[1];\n }", "CloudCache getCache(String cacheName);", "private CacheHelper loadCacheHelper(String className)\n throws Exception {\n\n // use the context class loader to load class so that any\n // user-defined classes in WEB-INF can also be loaded.\n ClassLoader cl = Thread.currentThread().getContextClassLoader();\n Class helperClass = cl.loadClass(className);\n\n CacheHelper helper = (CacheHelper) helperClass.newInstance();\n\n return helper;\n }", "private static InputStream getStream(String inResName) {\n\n ClassLoader loader = Thread.currentThread().getContextClassLoader();\n InputStream is = loader.getResourceAsStream(inResName);\n if (is == null) {\n log.error(\"Resource '\" + inResName + \"' not found in classpath\");\n }\n return is;\n\n }", "public abstract void load();" ]
[ "0.58792686", "0.58093685", "0.56234306", "0.5521013", "0.54836357", "0.52768105", "0.5236837", "0.5203174", "0.5199262", "0.5188649", "0.5164219", "0.51599264", "0.51567703", "0.513977", "0.51149213", "0.5114064", "0.50984", "0.50785226", "0.5036936", "0.49819395", "0.49693123", "0.496742", "0.49356627", "0.49350664", "0.49248305", "0.49160388", "0.49116766", "0.4858037", "0.48515975", "0.4843549", "0.48190624", "0.48078272", "0.4803261", "0.47785562", "0.47341537", "0.47308648", "0.47259519", "0.47214743", "0.470617", "0.4699462", "0.46739146", "0.4672939", "0.46593407", "0.4655967", "0.4651087", "0.46464077", "0.46409902", "0.46222106", "0.46151558", "0.46142292", "0.46030387", "0.4599898", "0.4597357", "0.45863196", "0.45851907", "0.4580975", "0.45760402", "0.4572521", "0.45715877", "0.4567163", "0.45610714", "0.4551886", "0.45509818", "0.45483762", "0.45385772", "0.45242697", "0.45153913", "0.45138782", "0.44973361", "0.4496514", "0.44944882", "0.4492739", "0.4492246", "0.4480248", "0.44760922", "0.44759682", "0.44747305", "0.44645953", "0.44615194", "0.44542533", "0.4450661", "0.44484162", "0.44466606", "0.4442638", "0.44243416", "0.44156003", "0.4407291", "0.4402076", "0.43941712", "0.43908188", "0.438973", "0.43889642", "0.43881926", "0.4386408", "0.43780008", "0.43777573", "0.43744802", "0.43727887", "0.43709064", "0.4370533" ]
0.7307294
0
Initializes the controller class.
@Override public void initialize(URL url, ResourceBundle rb) { MyUtils.populateColumnNames(cmbSc, "task"); txtSi.setText(si); MyUtils.selectComboBoxValue(cmbSc, sc); refreshTbl(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initialize() {\n\t\tcontroller = Controller.getInstance();\n\t}", "public MainController() {\n\t\tcontroller = new Controller(this);\n\t}", "public abstract void initController();", "public Controller() {\n super();\n }", "public Controller() {\n super();\n }", "public Controller()\n\t{\n\n\t}", "private static CompanyController initializeController() {\n\n controller = new CompanyController();\n return controller;\n }", "public MainController() {\n initializeControllers();\n initializeGui();\n runGameLoop();\n }", "public Controller() {\n this.model = new ModelFacade();\n this.view = new ViewFacade();\n }", "public Controller()\r\n\t{\r\n\t\tview = new View();\r\n\t}", "public Controller() {\n\t\tthis(null);\n\t}", "public void init(){\n\t\t//Makes the view\n\t\tsetUpView();\n\n\t\t//Make the controller. Links the action listeners to the view\n\t\tnew Controller(this);\n\t\t\n\t\t//Initilize the array list\n\t\tgameInput = new ArrayList<Integer>();\n\t\tuserInput = new ArrayList<Integer>();\n\t\thighScore = new HighScoreArrayList();\n\t}", "private void initialize() {\n\t\tinitializeModel();\n\t\tinitializeBoundary();\n\t\tinitializeController();\n\t}", "public void init() {\n\t\tkontrolleri1 = new KolikkoController(this);\n\t}", "protected void initialize() {\n super.initialize(); // Enables \"drive straight\" controller\n }", "public Controller() {\n model = new Model();\n comboBox = new ChannelComboBox();\n initView();\n new ChannelWorker().execute();\n timer = new Timer();\n }", "protected CityController() {\r\n\t}", "public void initialize() {\n warpController = new WarpController(this);\n kitController = new KitController(this);\n crafting = new CraftingController(this);\n mobs = new MobController(this);\n items = new ItemController(this);\n enchanting = new EnchantingController(this);\n anvil = new AnvilController(this);\n blockController = new BlockController(this);\n hangingController = new HangingController(this);\n entityController = new EntityController(this);\n playerController = new PlayerController(this);\n inventoryController = new InventoryController(this);\n explosionController = new ExplosionController(this);\n requirementsController = new RequirementsController(this);\n worldController = new WorldController(this);\n arenaController = new ArenaController(this);\n arenaController.start();\n if (CompatibilityLib.hasStatistics() && !CompatibilityLib.hasJumpEvent()) {\n jumpController = new JumpController(this);\n }\n File examplesFolder = new File(getPlugin().getDataFolder(), \"examples\");\n examplesFolder.mkdirs();\n\n File urlMapFile = getDataFile(URL_MAPS_FILE);\n File imageCache = new File(dataFolder, \"imagemapcache\");\n imageCache.mkdirs();\n maps = new MapController(this, urlMapFile, imageCache);\n\n // Initialize EffectLib.\n if (com.elmakers.mine.bukkit.effect.EffectPlayer.initialize(plugin, getLogger())) {\n getLogger().info(\"EffectLib initialized\");\n } else {\n getLogger().warning(\"Failed to initialize EffectLib\");\n }\n\n // Pre-create schematic folder\n File magicSchematicFolder = new File(plugin.getDataFolder(), \"schematics\");\n magicSchematicFolder.mkdirs();\n\n // One-time migration of legacy configurations\n migrateConfig(\"enchanting\", \"paths\");\n migrateConfig(\"automata\", \"blocks\");\n migrateDataFile(\"automata\", \"blocks\");\n\n // Ready to load\n load();\n resourcePacks.startResourcePackChecks();\n }", "public ClientController() {\n }", "public Controller() {\n\t\tthis.nextID = 0;\n\t\tthis.data = new HashMap<Integer, T>();\n\t}", "public ListaSEController() {\n }", "boolean InitController();", "public MenuController() {\r\n\t \r\n\t }", "@Override\n\tprotected void initController() throws Exception {\n\t\tmgr = orderPickListManager;\n\t}", "public CustomerController() {\n\t\tsuper();\n\n\t}", "public End_User_0_Controller() {\r\n\t\t// primaryStage = Users_Page_Controller.primaryStage;\r\n\t\t// this.Storeinfo = primaryStage.getTitle();\r\n\t}", "public Controller(){\r\n\t\tthis.fabricaJogos = new JogoFactory();\r\n\t\tthis.loja = new Loja();\r\n\t\tthis.preco = 0;\r\n\t\tthis.desconto = 0;\r\n\t}", "private Controller() {\n\t\tthis.gui = GUI.getInstance();\n\t\tthis.gui.setController(this);\n\t}", "public GameController() {\r\n\t\tsuper();\r\n\t\tthis.model = Main.getModel();\r\n\t\tthis.player = this.model.getPlayer();\r\n\t\tthis.timeline = this.model.getIndefiniteTimeline();\r\n\t}", "public PlantillaController() {\n }", "public Controller() {\n\t\tplaylist = new ArrayList<>();\n\t\tshowingMore = false;\n\t\tstage = Main.getStage();\n\t}", "public IfController()\n\t{\n\n\t}", "public TournamentController()\n\t{\n\t\tinitMap();\n\t}", "public GeneralListVueController() {\n\n\t}", "private ClientController() {\n }", "public Controller()\n\t{\n\t\ttheParser = new Parser();\n\t\tstarList = theParser.getStars();\n\t\tmessierList = theParser.getMessierObjects();\n\t\tmoon = new Moon(\"moon\");\n\t\tsun = new Sun(\"sun\");\n\t\tconstellationList = theParser.getConstellations();\n\t\tplanetList = new ArrayList<Planet>();\n\t\ttheCalculator = new Calculator();\n\t\tepoch2000JD = 2451545.0;\n\t}", "private void initialiseController() \r\n {\r\n defaultVectors();\r\n if(grantsByPIForm == null) \r\n {\r\n grantsByPIForm = new GrantsByPIForm(); //(Component) parent,modal);\r\n }\r\n grantsByPIForm.descriptionLabel.setText(UnitName);\r\n grantsByPIForm.descriptionLabel.setFont(new Font(\"SansSerif\",Font.BOLD,14));\r\n queryEngine = QueryEngine.getInstance();\r\n coeusMessageResources = CoeusMessageResources.getInstance();\r\n registerComponents();\r\n try {\r\n setFormData(null);\r\n }\r\n catch(Exception e) {\r\n e.printStackTrace(System.out);\r\n }\r\n }", "public LogMessageController() {\n\t}", "public LoginPageController() {\n\t}", "public ControllerEnfermaria() {\n }", "public ProvisioningEngineerController() {\n super();\n }", "private StoreController(){}", "public GenericController() {\n }", "@Override\n\tpublic void initialize() {\n\t\tinitializeModel(getSeed());\n\t\tinitializeView();\n\t\tinitializeControllers();\n\t\t\n\t\tupdateScore(8);\n\t\tupdateNumberCardsLeft(86);\n\n\t}", "public Controller() {\n\t\tenabled = false;\n\t\tloop = new Notifier(new ControllerTask(this));\n\t\tloop.startPeriodic(DEFAULT_PERIOD);\n\t}", "public MapController() {\r\n\t}", "@Override\r\n\tpublic void initControllerBean() throws Exception {\n\t}", "private void setupController() {\n setupWriter();\n Controller controller1 = new Controller(writer);\n controller = controller1;\n }", "public WfController()\n {\n }", "public Controller() {\n\n lastSearches = new SearchHistory();\n\n }", "private ClientController(){\n\n }", "public LoginController() {\r\n }", "public PersonasController() {\r\n }", "private void initBefore() {\n // Crear Modelo\n model = new Model();\n\n // Crear Controlador\n control = new Controller(model, this);\n\n // Cargar Propiedades Vista\n prpView = UtilesApp.cargarPropiedades(FICHERO);\n\n // Restaurar Estado\n control.restaurarEstadoVista(this, prpView);\n\n // Otras inicializaciones\n }", "public StoreController() {\n }", "public ConsoleController() {\n\t\tcommandDispatch = new CommandDispatch();\n\t}", "public LoginController() {\r\n\r\n }", "public final void init(final MainController mainController) {\n this.mainController = mainController;\n }", "public SMPFXController() {\n\n }", "public Controller()\r\n {\r\n fillBombs();\r\n fillBoard();\r\n scoreBoard = new ScoreBoard();\r\n }", "public GUIController() {\n\n }", "public void init(){\n this.controller = new StudentController();\n SetSection.displayLevelList(grade_comp);\n new DesignSection().designForm(this, editStudentMainPanel, \"mini\");\n }", "public void init(final Controller controller){\n Gdx.app.debug(\"View\", \"Initializing\");\n \n this.controller = controller;\n \n //clear old stuff\n cameras.clear();\n \n //set up renderer\n hudCamera = new OrthographicCamera();\n hudCamera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\n \n batch = new SpriteBatch();\n igShRenderer = new ShapeRenderer();\n shapeRenderer = new ShapeRenderer();\n \n //set up stage\n stage = new Stage();\n \n //laod cursor\n cursor = new Pixmap(Gdx.files.internal(\"com/BombingGames/WurfelEngine/Core/images/cursor.png\"));\n\n controller.getLoadMenu().viewInit(this);\n \n initalized = true;\n }", "@PostConstruct\n public void init() {\n WebsocketController.getInstance().setTemplate(this.template);\n try {\n\t\t\tthis.chatController = ChatController.getInstance();\n } catch (final Exception e){\n LOG.error(e.getMessage(), e);\n }\n }", "public ControllerTest()\r\n {\r\n }", "public SearchedRecipeController() {\n }", "public FilmOverviewController() {\n }", "public CreditPayuiController() {\n\t\tuserbl = new UserController();\n\t}", "private void initComponents() {\r\n\t\temulator = new Chip8();\r\n\t\tpanel = new DisplayPanel(emulator);\r\n\t\tregisterPanel = new EmulatorInfoPanel(emulator);\r\n\t\t\r\n\t\tcontroller = new Controller(this, emulator, panel, registerPanel);\r\n\t}", "public RootLayoutController() {\n }", "public MehController() {\n updateView(null);\n }", "public Controller(int host) {\r\n\t\tsuper(host);\r\n\t}", "public WorkerController(){\r\n\t}", "public TipoInformazioniController() {\n\n\t}", "private void initializeMealsControllers() {\n trNewPetMeal = MealsControllersFactory.createTrNewPetMeal();\n trObtainAllPetMeals = MealsControllersFactory.createTrObtainAllPetMeals();\n trDeleteMeal = MealsControllersFactory.createTrDeleteMeal();\n trUpdateMeal = MealsControllersFactory.createTrUpdateMeal();\n }", "public ProductOverviewController() {\n }", "public ProduktController() {\r\n }", "public Controller(ViewIF view) {\n\t\tthis.view = view;\n\t\tthis.dao = new DAO();\n\t\tthis.stats = new Statistics(this.dao);\n\t\tthis.gameStarted = false;\n\t}", "private void initializeMedicationControllers() {\n trNewPetMedication = MedicationControllersFactory.createTrNewPetMedication();\n trObtainAllPetMedications = MedicationControllersFactory.createTrObtainAllPetMedications();\n trDeleteMedication = MedicationControllersFactory.createTrDeleteMedication();\n trUpdateMedication = MedicationControllersFactory.createTrUpdateMedication();\n }", "public PersonLoginController() {\n }", "public PremiseController() {\n\t\tSystem.out.println(\"Class PremiseController()\");\n\t}", "public TaxiInformationController() {\n }", "public LoginController() {\n\t\treadFromFile();\n\t\t// TODO Auto-generated constructor stub\n\t}", "public Controller(){\n initControl();\n this.getStylesheets().addAll(\"/resource/style.css\");\n }", "public CreateDocumentController() {\n }", "public ControllerRol() {\n }", "Main ()\n\t{\n\t\tview = new View ();\t\t\n\t\tmodel = new Model(view);\n\t\tcontroller = new Controller(model, view);\n\t}", "public Controller () {\r\n puzzle = null;\r\n words = new ArrayList <String> ();\r\n fileManager = new FileIO ();\r\n }", "public void init() {\n \n }", "public Controller() {\n\t\tdoResidu = false;\n\t\tdoTime = false;\n\t\tdoReference = false;\n\t\tdoConstraint = false;\n\t\ttimeStarting = System.nanoTime();\n\t\t\n\t\tsetPath(Files.getWorkingDirectory());\n\t\tsetSystem(true);\n\t\tsetMultithreading(true);\n\t\tsetDisplayFinal(true);\n\t\tsetFFT(FFT.getFastestFFT().getDefaultFFT());\n\t\tsetNormalizationPSF(1);\n\t\tsetEpsilon(1e-6);\n\t\tsetPadding(new Padding());\n\t\tsetApodization(new Apodization());\n\n\t\tmonitors = new Monitors();\n\t\tmonitors.add(new ConsoleMonitor());\n\t\tmonitors.add(new TableMonitor(Constants.widthGUI, 240));\n\n\t\tsetVerbose(Verbose.Log);\n\t\tsetStats(new Stats(Stats.Mode.NO));\n\t\tsetConstraint(Constraint.Mode.NO);\n\t\tsetResiduMin(-1);\n\t\tsetTimeLimit(-1);\n\t\tsetReference(null);\n\t\tsetOuts(new ArrayList<Output>());\n\t}", "public OrderInfoViewuiController() {\n\t\tuserbl = new UserController();\n\t}", "public SessionController() {\n }", "@Override\n\tprotected void setController() {\n\t\t\n\t}", "public MainFrameController() {\n }", "public LicenciaController() {\n }", "public NearestParksController() {\n this.bn = new BicycleNetwork();\n this.pf = new LocationFacade();\n // this.bn.loadData();\n }", "public MotorController() {\n\t\tresetTachometers();\n\t}", "public AwTracingController() {\n mNativeAwTracingController = nativeInit();\n }", "public Controller(IView view) {\n\t\tengine = new Engine(this);\n\t\tclock = new Clock();\n\t\tsoundEmettor = new SoundEmettor();\n\t\tthis.view = view;\n\t}", "public HomeController() {\n }", "public HomeController() {\n }" ]
[ "0.8125658", "0.78537387", "0.78320265", "0.776199", "0.776199", "0.76010174", "0.74497247", "0.7437837", "0.7430714", "0.742303", "0.74057597", "0.7341963", "0.7327749", "0.72634363", "0.72230434", "0.7102504", "0.70575505", "0.69873077", "0.69721675", "0.6944077", "0.6912564", "0.688884", "0.6881247", "0.68776786", "0.68723065", "0.6868163", "0.68672407", "0.6851157", "0.6846883", "0.6840198", "0.68382674", "0.68338853", "0.6795918", "0.67823315", "0.6766882", "0.67650586", "0.6750353", "0.6749068", "0.6745654", "0.6743223", "0.67401046", "0.6727867", "0.6723379", "0.6695514", "0.6689967", "0.66892517", "0.66791916", "0.6677345", "0.66644365", "0.6664202", "0.66616154", "0.66532296", "0.66481894", "0.6644939", "0.6639398", "0.6633576", "0.66312426", "0.662608", "0.66258574", "0.66105217", "0.6606984", "0.66024727", "0.6597095", "0.6580141", "0.65786153", "0.65752715", "0.6574144", "0.6551536", "0.655142", "0.6547574", "0.6545647", "0.6541474", "0.6529243", "0.65284246", "0.6525593", "0.6523344", "0.6519832", "0.65134746", "0.65079254", "0.6497635", "0.64952356", "0.6493943", "0.6492926", "0.6483847", "0.6483173", "0.648183", "0.6479119", "0.64789915", "0.6476928", "0.64734083", "0.6465272", "0.64616114", "0.6444024", "0.64379543", "0.6431962", "0.64292705", "0.6425357", "0.6417148", "0.6416786", "0.64161026", "0.64161026" ]
0.0
-1
do something or nothig ;]
public void sort(List<T> objects, Comparator<T> comparator) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doNothing(){\n\t}", "public static void doNothing(){\n\t}", "public void woke(){\n\n //TODO\n\n }", "public void smell() {\n\t\t\n\t}", "public void furyo ()\t{\n }", "@Override\n\tpublic void some() {\n\t\t\n\t}", "public void logic(){\r\n\r\n\t}", "public void baocun() {\n\t\t\n\t}", "public void gored() {\n\t\t\n\t}", "void berechneFlaeche() {\n\t}", "protected void execute() {\n \t// literally still do nothing\n }", "public void think() {\n\t\t\n\t}", "public void excavate();", "@Override\n\tpublic void doIt() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "public void nullstill();", "protected void doSomethingElse()\r\n {\r\n \r\n }", "public void doSomething(){\n return;\n }", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "public void noReturn() {\n\t\tSystem.out.println(\"noReturn method will not returing any thing\");\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "public void doit() {\n // Do nothing\n }", "private static void notPossible () {\r\n\t\tSystem.out.println(\"This operation is not possible\");\r\n\t}", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tno();\n\t\t\t\t}", "public void doSomething() {\n\t}", "public boolean method_218() {\r\n return false;\r\n }", "public void noreturn(){\n System.out.println(\"universal\");\n }", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic boolean postIt() {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic boolean paie() {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic void just() {\n\t\t\r\n\t}", "public void wild(){\n\t}", "public void Tyre() {\n\t\t\r\n\t}", "public void doCure();", "private void Nice(){\n }", "protected void nop() throws Exception {\n reply_ok();\n }", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic boolean voidIt() {\n\t\treturn false;\r\n\t}", "public boolean method_216() {\r\n return false;\r\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "public boolean isVoid()\r\n/* 146: */ {\r\n/* 147:177 */ return false;\r\n/* 148: */ }", "static void return_unconditionally(String passed){\n\t\tcomplete_return_requirements();\n\t}", "@Override public void action() {\n //Do Nothing\n assert(checkRep());\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "boolean doSomething() {\n\t\treturn true;\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "public boolean method_108() {\r\n return false;\r\n }", "public abstract boolean esComestible();", "@Override\n\tpublic void doYouWantTo() {\n\n\t}", "public boolean method_2453() {\r\n return false;\r\n }", "void blackhole(){ if (zzAtBOL) return; }", "public void doSomething(){\n\t\t// now in here calling doMore();\n\t\tdoMore();\n\t\tSystem.out.println(\"-----------\");\n\t\t\n\t\t\t\n\t\t}", "@Override\r\n\tpublic String doSome() {\n\t\tSystem.out.println(\"执行dosome()方法\");\r\n\t\treturn \"abcde\";\r\n\t}", "public void noReturnOnVoid() {\n\t\treturn;\n\t}", "protected boolean func_70041_e_() { return false; }", "@Override\n\tpublic void exucute() {\n\t\t\n\t}", "public boolean method_3897() {\r\n return false;\r\n }", "static void call_when_no_carry(String passed){\n\t\tif(!CS)\n\t\t\tcomplete_call_req(passed.substring(4));\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "public boolean method_196() {\r\n return false;\r\n }", "public boolean method_214() {\r\n return false;\r\n }", "void bye();", "static void jump_without_condition(String passed){\n\t\tcomplete_jump_req(passed.substring(4));\n\t}", "public boolean method_210() {\r\n return false;\r\n }", "@Override\n\tpublic void leti() \n\t{\n\t}", "static void jump_when_sign_not(String passed){\n\t\tif(!S)\n\t\t\tcomplete_jump_req(passed.substring(3));\n\t}", "public void method_4270() {}", "public boolean method_198() {\r\n return false;\r\n }", "public boolean method_2434() {\r\n return false;\r\n }", "public void doTheFaultyThing();", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void doThing() {\n\t\tSystem.out.print(\"ÎäÆ÷ÊDZ¦½£,\");\r\n\t}", "public void method(){}", "static void call_without_condition(String passed){\n\t\tcomplete_call_req(passed.substring(5));\n\t}", "public boolean method_194() {\r\n return false;\r\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n public String visit(DoStmt n, Object arg) {\n return null;\n }", "@Override\r\n\tpublic void doing() {\n\t\tSystem.out.println(\"doing\");\r\n\t}", "@Override\n protected void doAct() {\n }", "boolean isNoOp();", "private void test() {\n\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "static void return_when_zero(String passed){\n\t\tif(Z)\n\t\t\tcomplete_return_requirements();\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public boolean method_4088() {\n return false;\n }", "public void disparar(){}", "default boolean isSpecial() { return false; }", "static void return_not_zero(String passed){\n\t\tif(!Z)\n\t\t\tcomplete_return_requirements();\n\t}", "public boolean method_4093() {\n return false;\n }", "public void orina() {\n System.out.println(\"Que bien me quedé! Deposito vaciado.\");\n }", "@Override\n public boolean c() {\n return false;\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void mo38117a() {\n }", "static void return_not_carry(String passed){\n\t\tif(!CS)\n\t\t\tcomplete_return_requirements();\n\t}", "void unavailable();", "void unavailable();", "static void call_when_parity_not(String passed){\n\t\tif(!P)\n\t\t\tcomplete_call_req(passed.substring(4));\n\t}" ]
[ "0.67409694", "0.6466994", "0.64530134", "0.6430639", "0.64125454", "0.63235277", "0.6292125", "0.6269731", "0.62456", "0.6242658", "0.6215193", "0.6214036", "0.62126696", "0.6164746", "0.6160586", "0.6150086", "0.613691", "0.6136875", "0.6126539", "0.6109496", "0.6102251", "0.6066977", "0.60520875", "0.6018788", "0.60175467", "0.6014726", "0.60111284", "0.5998346", "0.59666073", "0.5958818", "0.5939977", "0.5918082", "0.5899245", "0.588089", "0.5865696", "0.5856557", "0.5855386", "0.58516985", "0.5833855", "0.5827284", "0.58134884", "0.5812899", "0.58127105", "0.58055", "0.58022296", "0.580217", "0.5801382", "0.5796877", "0.57887864", "0.5783037", "0.5782696", "0.5779557", "0.57727754", "0.5770223", "0.5769944", "0.5764845", "0.5764148", "0.57604545", "0.57518363", "0.574588", "0.57440555", "0.57428586", "0.5731772", "0.5727713", "0.57268745", "0.57208955", "0.57179356", "0.57096004", "0.57048106", "0.57046276", "0.5703362", "0.57032746", "0.5691235", "0.56852996", "0.5679239", "0.56759214", "0.5671605", "0.5668384", "0.56663275", "0.5664263", "0.5662694", "0.5653769", "0.56514466", "0.5649668", "0.5646432", "0.5643817", "0.5631443", "0.5624391", "0.56240225", "0.5621885", "0.5621387", "0.56146586", "0.5612425", "0.5609097", "0.5604804", "0.5601841", "0.5600005", "0.5598515", "0.5597092", "0.5597092", "0.5596906" ]
0.0
-1
sort BundleInfo by version
public EclipseInfo sortByVersion(){ getBundleInfos().sortValues(new BundleInfoVersionComparator(), false); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String getBundleSpecVersion(String headers) {\n Map<String, List<String>> res = new HashMap<String, List<String>>();\n\n String[] headersTokens = headers.split(\";\");\n if (headersTokens.length > 1) {\n ArrayList<String> curHeader = new ArrayList<String>();\n String key = \"\";\n for (int i = 0; i < headersTokens.length; i++) {\n if (!(headersTokens[i].startsWith(\"uses:=\")\n || headersTokens[i].startsWith(\"version=\"))) {\n key = headersTokens[i];\n } else {\n if (headersTokens[i].startsWith(\"version=\")) {\n String[] lastToken = headersTokens[i].split(\",\");\n curHeader.add(lastToken[0]);\n res.put(key, new ArrayList<String>(curHeader));\n \n if (headersTokens[i].length() > lastToken[0].length()) {\n key = headersTokens[i].substring(lastToken[0].length() + 1);\n curHeader.clear();\n }\n } else if (headersTokens[i].startsWith(\"uses:=\")) {\n if (i != headersTokens.length - 1 && !headersTokens[i+1].startsWith(\"version=\")) {\n String[] lastToken = headersTokens[i].split(\",\");\n curHeader.add(headersTokens[i].substring(0, headersTokens[i].length() - (lastToken[lastToken.length - 1].length())));\n res.put(key, new ArrayList<String>(curHeader));\n\n key = lastToken[lastToken.length - 1];\n curHeader.clear();\n } else {\n curHeader.add(headersTokens[i]);\n }\n }\n }\n }\n } else {\n res.put(headers, Collections.EMPTY_LIST);\n }\n return \"\";\n }", "public int compareTo(Bundle o) {\n throw new UnsupportedOperationException();\n }", "@Override\n public int compareTo(ApiVersion other) {\n if (!prerelease.isEmpty()) {\n if (other.prerelease.isEmpty()) {\n return -1;\n }\n return prerelease.compareTo(other.prerelease);\n }\n if (!other.prerelease.isEmpty()) {\n return 1;\n }\n if (major != other.major) {\n return Integer.compare(major, other.major);\n }\n if (minor != other.minor) {\n return Integer.compare(minor, other.minor);\n }\n return Integer.compare(patch, other.patch);\n }", "@Override\n public int compare( ArtifactMetadata o1, ArtifactMetadata o2 )\n {\n int result =\n new DefaultArtifactVersion( o2.getVersion() ).compareTo( new DefaultArtifactVersion( o1.getVersion() ) );\n return result != 0 ? result : o1.getId().compareTo( o2.getId() );\n }", "int getVendorListVersion();", "@Override\n\tpublic int compare(Manifestacija o1, Manifestacija o2) {\n\t\treturn o1.getNaziv().compareTo(o2.getNaziv());\n\t}", "public void sort() {\r\n for (int i = 0; i < namesOfApp.length && i < runTimeOfApp.length; i++) {\r\n for (int j = 0; j < i; j++) {\r\n if (runTimeOfApp[j] < runTimeOfApp[i]) {\r\n String tempName = namesOfApp[i];\r\n long tempRunTime = runTimeOfApp[i];\r\n namesOfApp[i] = namesOfApp[j];\r\n runTimeOfApp[i] = runTimeOfApp[j];\r\n namesOfApp[j] = tempName;\r\n runTimeOfApp[j] = tempRunTime;\r\n }\r\n }\r\n }\r\n\r\n }", "public int getInstalledBundles();", "private static void sortPhotosByNumberTags() {\n\t\tCollections.sort(photoList, new Comparator<Photo>() {\n\t\t\tpublic int compare(Photo p1, Photo p2) {\n\n\t\t\t\tInteger s1 = p1.getTagList().size();\n\t\t\t\tInteger s2 = p2.getTagList().size();\n\n\t\t\t\tint sComp = s1.compareTo(s2);\n\n\t\t\t\treturn -1 * sComp;\n\t\t\t}\n\t\t});\n\t}", "protected abstract Comparator<UsageInfo> makeUsageInfoComparator();", "int getPackageVersion(String packageName);", "private boolean sort(long codeSystemVersionId){\n org.hibernate.Session hb_session = HibernateUtil.getSessionFactory().openSession();\n hb_session.getTransaction().begin();\n boolean s = false;\n try\n {\n String hql = \"select distinct csev from CodeSystemEntityVersion csev\";\n hql += \" join fetch csev.codeSystemMetadataValues csmv\";\n hql += \" join fetch csmv.metadataParameter mp\";\n hql += \" join fetch csev.codeSystemEntity cse\";\n hql += \" join fetch cse.codeSystemVersionEntityMemberships csvem\";\n hql += \" join fetch csvem.codeSystemVersion csv\";\n \n \n HQLParameterHelper parameterHelper = new HQLParameterHelper();\n parameterHelper.addParameter(\"csv.\", \"versionId\", codeSystemVersionId);\n\n // Parameter hinzufügen (immer mit AND verbunden)\n hql += parameterHelper.getWhere(\"\");\n logger.debug(\"HQL: \" + hql);\n\n // Query erstellen\n org.hibernate.Query q = hb_session.createQuery(hql);\n\n // Die Parameter können erst hier gesetzt werden (übernimmt Helper)\n parameterHelper.applyParameter(q);\n \n List<CodeSystemEntityVersion> csevList = q.list();\n \n HashMap<Integer,CodeSystemEntityVersion> workList = new HashMap<Integer, CodeSystemEntityVersion>();\n ArrayList<Integer> sortList = new ArrayList<Integer>();\n \n Iterator<CodeSystemEntityVersion> iter = csevList.iterator();\n while(iter.hasNext()){\n boolean found = false;\n CodeSystemEntityVersion csev = (CodeSystemEntityVersion)iter.next();\n \n //Get the Level\n int level = 0;\n Iterator<CodeSystemMetadataValue> iter1 = csev.getCodeSystemMetadataValues().iterator();\n while(iter1.hasNext()){\n CodeSystemMetadataValue csmv = (CodeSystemMetadataValue)iter1.next();\n if(csmv.getMetadataParameter().getParamName().equals(\"Level\")){\n\n String cleaned = csmv.getParameterValue();\n \n if(cleaned.contains(\" \"))\n cleaned = cleaned.replace(\" \", \"\");\n\n level = Integer.valueOf(cleaned);\n }\n }\n \n if(level == lowestLevel){\n \n CodeSystemVersionEntityMembershipId csvemId = null;\n Set<CodeSystemVersionEntityMembership> csvemSet = csev.getCodeSystemEntity().getCodeSystemVersionEntityMemberships();\n Iterator<CodeSystemVersionEntityMembership> it = csvemSet.iterator();\n while(it.hasNext()){\n \n CodeSystemVersionEntityMembership member = (CodeSystemVersionEntityMembership)it.next();\n if(member.getCodeSystemEntity().getId().equals(csev.getCodeSystemEntity().getId())\n && member.getCodeSystemVersion().getVersionId().equals(codeSystemVersionId)){\n \n csvemId = member.getId();\n }\n }\n \n CodeSystemVersionEntityMembership c = (CodeSystemVersionEntityMembership)hb_session.get(CodeSystemVersionEntityMembership.class, csvemId);\n c.setIsMainClass(Boolean.TRUE);\n hb_session.update(c);\n \n workList.put(level, csev);\n sortList.add(level);\n }else{\n \n int size = sortList.size();\n int count = 0;\n while(!found){\n \n if((sortList.get(size-(1+count))-level) == -1){\n \n //Setting MemberShip isMainClass false\n CodeSystemVersionEntityMembershipId csvemId = null;\n Set<CodeSystemVersionEntityMembership> csvemSet = csev.getCodeSystemEntity().getCodeSystemVersionEntityMemberships();\n Iterator<CodeSystemVersionEntityMembership> it = csvemSet.iterator();\n while(it.hasNext()){\n\n CodeSystemVersionEntityMembership member = (CodeSystemVersionEntityMembership)it.next();\n if(member.getCodeSystemEntity().getId().equals(csev.getCodeSystemEntity().getId())\n && member.getCodeSystemVersion().getVersionId().equals(codeSystemVersionId)){\n\n csvemId = member.getId();\n }\n }\n\n CodeSystemVersionEntityMembership c = (CodeSystemVersionEntityMembership)hb_session.get(CodeSystemVersionEntityMembership.class, csvemId);\n c.setIsMainClass(Boolean.FALSE);\n hb_session.update(c);\n \n found = true;\n sortList.add(level);\n workList.put(level, csev);\n CodeSystemEntityVersion csevPrev = workList.get(sortList.get(size-(1+count)));\n \n CodeSystemEntityVersionAssociation association = new CodeSystemEntityVersionAssociation(); \n association.setCodeSystemEntityVersionByCodeSystemEntityVersionId1(new CodeSystemEntityVersion());\n association.getCodeSystemEntityVersionByCodeSystemEntityVersionId1().setVersionId(csevPrev.getVersionId());\n association.setCodeSystemEntityVersionByCodeSystemEntityVersionId2(new CodeSystemEntityVersion());\n association.getCodeSystemEntityVersionByCodeSystemEntityVersionId2().setVersionId(csev.getVersionId());\n association.setAssociationKind(2); // 1 = ontologisch, 2 = taxonomisch, 3 = cross mapping \n association.setLeftId(csevPrev.getVersionId()); // immer linkes Element also csev1\n association.setAssociationType(new AssociationType()); // Assoziationen sind ja auch CSEs und hier muss die CSEVid der Assoziation angegben werden.\n association.getAssociationType().setCodeSystemEntityVersionId(4L);\n // Weitere Attribute setzen\n association.setStatus(Definitions.STATUS_CODES.ACTIVE.getCode());\n association.setStatusDate(new Date());\n association.setInsertTimestamp(new Date());\n // Beziehung abspeichern\n hb_session.save(association);\n \n CodeSystemEntityVersion csevLoc = (CodeSystemEntityVersion)hb_session.get(CodeSystemEntityVersion.class, csevPrev.getVersionId());\n if(csevLoc.getIsLeaf() != Boolean.FALSE){\n csevLoc.setIsLeaf(Boolean.FALSE);\n hb_session.update(csevLoc);\n }\n\n }else{\n count++; \n found=false;\n }\n } \n }\n }\n \n hb_session.getTransaction().commit();\n s = true;\n }\n catch (Exception e)\n {\n hb_session.getTransaction().rollback();\n s = false;\n logger.error(\"[\" + this.getClass().getCanonicalName() + \"] Fehler bei initList(): \" + e.getMessage());\n }\n finally\n {\n hb_session.close();\n }\n return s;\n }", "@Override\n public int compareTo(VersionPair o) {\n return this.elasticsearch.compareTo(o.elasticsearch);\n }", "public VersionRange getBundleVersionRange();", "@Override\n public int compareTo(@NonNull Version other) {\n return toBigInteger().compareTo(other.toBigInteger());\n }", "@Override\n\tpublic int compareTo(Version o) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int compareTo(Version other) {\n\t\tif(other.qualifier != qualifier) {\n\t\t\treturn (int) Math.signum(qualifier.ordinal() - other.qualifier.ordinal());\n\t\t}\n\t\t\n\t\t/*\n\t\t * Secondly, check for identifier differences.\n\t\t */\n\t\tint[] otherIdentifiers = other.identifiers;\n\t\tint commonIdentifiers = Math.min(otherIdentifiers.length, identifiers.length);\n\t\tfor(int i = 0; i < commonIdentifiers; i++) {\n\t\t\tif(identifiers[i] != otherIdentifiers[i]) {\n\t\t\t\treturn (int) Math.signum(identifiers[i] - otherIdentifiers[i]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Thirdly, check that the patch are the same even if version doesn't declare it fully,\n\t\t * example: '0.1' and '0.1.0' should be considered the same.\n\t\t */\n\t\tint maxIdentifiers = Math.max(otherIdentifiers.length, identifiers.length);\n\t\tfor(int i = commonIdentifiers; i < maxIdentifiers; i++) {\n\t\t\tif(identifiers.length == maxIdentifiers && identifiers[i] != 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(otherIdentifiers.length == maxIdentifiers && otherIdentifiers[i] != 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * All identifiers from the common are 0, so the versions are the same.\n\t\t\t */\n\t\t\tif(i == maxIdentifiers - 1) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * Finally check for identifiers length.\n\t\t */\n\t\treturn identifiers.length - otherIdentifiers.length;\n\t}", "public void sortLibrary() {\n libraries.sort(Comparator.comparingLong(Library::getSignupCost));\n\n //J-\n// libraries.sort((o1, o2) -> Long.compare(\n// o2.getCurrentScore() - (2 * o2.getDailyShipCapacity() * o2.getSignupCost()),\n// o1.getCurrentScore() - (2 * o1.getDailyShipCapacity() * o1.getSignupCost())\n// ));\n\n// libraries.sort((o1, o2) -> Long.compare(\n// (o2.getBooksCount() + o2.getSignupCost()) * o2.getDailyShipCapacity(),\n// (o1.getBooksCount() + o1.getSignupCost()) * o1.getDailyShipCapacity()));\n //J+\n }", "private void updateBundleLabelList() {\n List<String> selection = Utils.jListGetValuesWrapper(bundle_label_list);\n List<String> items = new ArrayList<String>();\n // Go through all of the header fields and add them with their variations\n boolean tags_present = false;\n BundlesG globals = getRTParent().getRootBundles().getGlobals();\n Iterator<String> it = globals.fieldIterator();\n while (it.hasNext()) {\n String fld = it.next(); int fld_i = globals.fieldIndex(fld);\n if (globals.isScalar(fld_i)) {\n items.add(fld + SIMPLESTAT_LM);\n\titems.add(fld + COMPLEXSTAT_LM);\n } else if (fld.equals(\"tags\")) {\n tags_present = true;\n } else {\n items.add(fld + ITEMS_LM);\n\titems.add(fld + COUNT_LM);\n }\n BundlesDT.DT datatype = globals.getFieldDataType(fld_i);\n if (globals.isScalar(fld_i) == false && datatype == BundlesDT.DT.INTEGER) datatype = null;\n if (datatype != null) {\n String appends[] = BundlesDT.dataTypeVariations(datatype, globals);\n\tfor (int i=0;i<appends.length;i++) items.add(fld + BundlesDT.DELIM + appends[i]);\n }\n }\n Collections.sort(items, new CaseInsensitiveComparator());\n // Add the tag options at the end\n if (tags_present) {\n items.add(\"tags\" + ITEMS_LM);\n items.add(\"tags\" + BundlesDT.MULTI + ITEMS_LM);\n items.add(\"tags\" + BundlesDT.MULTI + COUNT_LM);\n Iterator<String> it2 = globals.tagTypeIterator();\n while (it2.hasNext()) {\n String tag_type = it2.next();\n items.add(\"tags\" + BundlesDT.MULTI + BundlesDT.DELIM + tag_type + ITEMS_LM);\n items.add(\"tags\" + BundlesDT.MULTI + BundlesDT.DELIM + tag_type + COUNT_LM);\n }\n }\n // Insert the default items\n items.add(0, TIMEFRAME_LM);\n items.add(0, LASTHEARD_LM);\n items.add(0, FIRSTHEARD_LM);\n items.add(0, BUNDLECOUNT_LM);\n // Convert and update the list\n setListAndResetSelection(bundle_label_list, items, selection);\n }", "private GeofenceInfoContent[] sortByDate(GeofenceInfoContent[] geofenceInfoContents){\n GeofenceInfoContent infoContent = null;\n for(int j = 0; j < geofenceInfoContents.length; j++) {\n for (int i = 0; i < geofenceInfoContents.length; i++) {\n infoContent = geofenceInfoContents[i];\n if (i < geofenceInfoContents.length - 1) {\n String year1 = infoContent.getYear();\n String year2 = geofenceInfoContents[i + 1].getYear();\n int year1Int = Integer.parseInt(year1);\n int year2Int = Integer.parseInt(year2);\n if (year1Int < year2Int) {\n geofenceInfoContents[i] = geofenceInfoContents[i + 1];\n geofenceInfoContents[i + 1] = infoContent;\n }\n }\n }\n }\n return geofenceInfoContents;\n }", "void comparatorSort() {\n Collections.sort(vendor, Vendor.sizeVendor); // calling collection sort method and passing list and comparator variables\r\n for (HDTV item : vendor) { //looping arraylist\r\n System.out.println(\"Brand: \" + item.brandname + \" Size: \" + item.size);\r\n }\r\n }", "@Override\n\t\t\t\tpublic int compare(RestDynamicSemanticVersion o1, RestDynamicSemanticVersion o2)\n\t\t\t\t{\n\t\t\t\t\tif (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == ((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (o1.semanticChronology != null) //If one chronology is here, they both should be here\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (o1.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o1.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Some other dialect... just sort on the dialect text\n\t\t\t\t\t\t\t\treturn AlphanumComparator.compare(Util.readBestDescription(o1.semanticChronology.assemblage.nid),\n\t\t\t\t\t\t\t\t\t\tUtil.readBestDescription(o2.semanticChronology.assemblage.nid), true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//If chronology isn't populated, I can't sort here\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//should be impossible - not the same, and neither is preferred - must be invalid data.\n\t\t\t\t\t\tLogManager.getLogger().warn(\"Unexpected sort case\");\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}", "private static void listBundle() {\r\n\t\tSystem.out.println(\"listBundle\");\r\n\r\n\t\tif (bundles.isEmpty()){\r\n\t\t\tSystem.out.println(\"There are no bundles\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tSet<Integer> bundleIds = bundles.keySet();\r\n\t\tIterator<Integer> itr = bundleIds.iterator();\r\n\r\n\t\twhile (itr.hasNext()) {\r\n\t\t\tInteger bundleId = (Integer) itr.next();\r\n\t\t\tBundle b = bundles.get(bundleId);\r\n\r\n\t\t\tprintBundle(b);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tList<Library> list=new ArrayList<Library>();\r\n\t\tlist.add(new Library(100, \"bhagyesh\"));\r\n\t\tlist.add(new Library(4, \"patel\"));\r\n\t\tlist.add(new Library(5, \"sid\"));\r\n\t\tlist.add(new Library(78, \"naitik\"));\r\n\t\tlist.add(new Library(39, \"amit\"));\r\n\t\t\r\n \tlist.stream().forEach(p -> System.out.println(p.getName()));\r\n \tlist.sort(Comparator.comparing(Library::getName));\r\n \tlist.stream().forEach(p -> System.out.println(p.getName()));\r\n \r\n \t\r\n \t\r\n \t\r\n\t}", "public String[] moveBundleToJar(Bundle bundle, String filename, boolean forceScanBundle)\n \t{\n File fileOut = context.getDataFile(filename);\n boolean createNewJar = true;\n if (fileOut.exists())\n if (bundle.getLastModified() <= (fileOut.lastModified() + ONE_SEC_IN_MS)) // File sys is usually accurate to sec \n {\n createNewJar = false;\n if (!forceScanBundle)\n return null; // Use cached jar file\n }\n \n Set<String> packages = new HashSet<String>();\n \t\ttry {\n \t\t\tManifest manifest = null;\n \t\t\tString path = MANIFEST_PATH;\n \t\t\tURL url = bundle.getEntry(path);\n \t\t\tJarOutputStream zos = null;\n \t\t\tif (createNewJar)\n \t\t\t{\n \t\t\tInputStream in = null;\n \t\t\tif (url != null)\n \t\t\t{\n \t\t\t\ttry {\n \t\t\t\t\tin = url.openStream();\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\tif (in != null)\n \t\t\t{\n manifest = new Manifest(new BufferedInputStream(in));\n } else {\n manifest = new Manifest();\n }\n \t\t\t\n \t\t\tFileOutputStream out = new FileOutputStream(fileOut);\n \t\t\t\n \t zos = new JarOutputStream(out);\n \t if (manifest != null) {\n \t JarEntry e = new JarEntry(MANIFEST_DIR);\n \t e.setTime(System.currentTimeMillis());\n \t e.setSize(0);\n \t e.setCrc(0);\n \t zos.putNextEntry(e);\n \t e = new JarEntry(MANIFEST_NAME);\n \t e.setTime(System.currentTimeMillis());\n \t zos.putNextEntry(e);\n \t manifest.write(zos);\n \t zos.closeEntry();\n \t }\n \t\t\t}\n \t\t\tString paths = \"/\";\n \t\t\tString filePattern = \"*\";\n \t\t\t@SuppressWarnings(\"unchecked\")\n \t\t\tEnumeration<URL> entries = bundle.findEntries(paths, filePattern, true);\n \t\t\twhile (entries.hasMoreElements())\n \t\t\t{\n \t\t\t\turl = entries.nextElement();\n \t\t\t\tString name = url.getPath();\n \t\t\t\tif (name.startsWith(\"/\"))\n \t\t\t\t\tname = name.substring(1);\n \t\t name = entryName(name);\n \t if (name.equals(\"\") || name.equals(\".\"))\n \t continue;\n \t if ((name.equalsIgnoreCase(MANIFEST_DIR)) || (name.equalsIgnoreCase(MANIFEST_PATH)))\n \t\tcontinue;\n \t if (createNewJar)\n \t {\n \t boolean isDir = name.endsWith(\"/\");\n \t long size = isDir ? 0 : -1; // ***????**** file.length();\n \t JarEntry e = new JarEntry(name);\n \t e.setTime(fileOut.lastModified()); //???\n \t if (size == 0) {\n \t e.setMethod(JarEntry.STORED);\n \t e.setSize(0);\n \t e.setCrc(0);\n \t }\n \t zos.putNextEntry(e);\n \t if (!isDir) {\n \t\t InputStream inStream = url.openStream();\n \t\t copyStream(inStream, zos);\n \t inStream.close();\n \t }\n \t zos.closeEntry();\n \t }\n \t \n \t if (!(name.toUpperCase().startsWith(MANIFEST_DIR)))\n \t \t\tpackages.add(getPackageFromName(name));\n \t\t\t}\n \t\t\tif (zos != null)\n \t\t\t zos.close();\n \t\t} catch (FileNotFoundException e) {\n \t\t\te.printStackTrace();\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\treturn packages.toArray(EMPTY_ARRAY);\n \t}", "public static String getPatchesInfo() {\n\t String ret = \"SPA verzija \"+getCurrentVersion()+\"\\n\";\n\t ret = ret + \"Informacije o zakrpama:\\n\";\n\t\tStringTokenizer tokens = getClassPathTokens();\n while (tokens.hasMoreTokens()) {\n String tok = tokens.nextToken();\n//System.out.println(\"Looking \"+tok);\n if (tok.toLowerCase().endsWith(\".jar\")) {\n String fn = tok.substring(tok.lastIndexOf(File.separatorChar)+1);\n//System.out.println(\"Examine jar file \"+fn);\n if (fn.startsWith(\"0\")) {\n//System.out.println(\"Processing patch \"+fn);\n\t try {\n\t JarFile jar = new JarFile(tok);\n\t ret = ret + \"-----------------------------------\\n\"\n\t \t\t\t\t\t+fn+\"\\n\"\n\t \t\t\t\t\t+ \"-----------------------------------\\n\"\n\t \t\t\t\t\t+ \" content: \\n\";\n\t Enumeration jarentries = jar.entries();\n\t while (jarentries.hasMoreElements()) {\n JarEntry element = (JarEntry)jarentries.nextElement();\n//System.out.println(\"Processing entry \"+element);\n\t\t\t\t\t\t\tif (!element.isDirectory()) {\n\t\t\t\t\t\t\t ret = ret + \" \"+new Timestamp(element.getTime())+\" \"+element+\"\\n\";\n\t\t\t\t\t\t\t}\n\t }\n\t ret = ret + \"-----------------------------------\\n\";\n\t } catch (IOException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t }\n }\n }\n }\t \n return ret;\n\t}", "@Override\n public int compareTo(@NonNull Version other) {\n return createBigInteger(this).compareTo(createBigInteger(other));\n }", "public void sort() {\r\n\t\tCollections.sort(parts);\r\n\t}", "private List<Content> sortContentMapByVolumeAndBarcode(Map<Integer, List<Content>> unOrderderdContentMap) {\n\n\t\tList<Content> contentsLongList = new LinkedList<>();\n\n\t\tfor (Map.Entry<Integer, List<Content>> entry : unOrderderdContentMap.entrySet())\n\t\t\tfor (Content content : entry.getValue())\n\t\t\t\tcontentsLongList.add(content);\n\n\t\tCollections.sort(contentsLongList, (c1, c2) -> {\n\t\t\tInteger c1Volume = c1.getVolume();\n\t\t\tInteger c2Volume = c2.getVolume();\n\t\t\tString c1Barcode = c1.getBarcode();\n\t\t\tString c2Barcode = c2.getBarcode();\n\n\t\t\treturn c2Volume - c1Volume != 0 ? c2Volume - c1Volume : c1Barcode.compareTo(c2Barcode);\n\t\t});\n\n\t\treturn contentsLongList;\n\t}", "private DBObject buildSortSpec(final GetObjectInformationParameters params) {\n\t\tfinal DBObject sort = new BasicDBObject();\n\t\tif (params.isObjectIDFiltersOnly()) {\n\t\t\tsort.put(Fields.VER_WS_ID, 1);\n\t\t\tsort.put(Fields.VER_ID, 1);\n\t\t\tsort.put(Fields.VER_VER, -1);\n\t\t}\n\t\treturn sort;\n\t}", "@Override\n\t\tpublic int compare(ModCandidate a, ModCandidate b) {\n\n\t\t\tif (a.isRoot()) {\n\t\t\t\tif (!b.isRoot()) {\n\t\t\t\t\treturn -1; // only a is root\n\t\t\t\t}\n\t\t\t} else if (b.isRoot()) {\n\t\t\t\treturn 1; // only b is root\n\t\t\t}\n\n\t\t\t// sort id desc\n\t\t\tint idCmp = a.getId().compareTo(b.getId());\n\t\t\tif (idCmp != 0) return idCmp;\n\n\t\t\t// sort version desc (lower version later)\n\t\t\tint versionCmp = b.getVersion().compareTo(a.getVersion());\n\t\t\tif (versionCmp != 0) return versionCmp;\n\n\t\t\t// sort nestLevel asc\n\t\t\tint nestCmp = a.getMinNestLevel() - b.getMinNestLevel(); // >0 if nest(a) > nest(b)\n\t\t\tif (nestCmp != 0) return nestCmp;\n\n\t\t\tif (a.isRoot()) return 0; // both root\n\n\t\t\tList<ModCandidate> parents = new ArrayList<>(a.getParentMods().size() + b.getParentMods().size());\n\t\t\tparents.addAll(a.getParentMods());\n\t\t\tparents.addAll(b.getParentMods());\n\t\t\tparents.sort(this);\n\n\t\t\tif (a.getParentMods().contains(parents.get(0))) {\n\t\t\t\tif (b.getParentMods().contains(parents.get(0))) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} else {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}", "private static void sortSlidesByNumberTags() {\n\t\tCollections.sort(slideList, new Comparator<Slide>() {\n\t\t\tpublic int compare(Slide s1, Slide s2) {\n\n\t\t\t\tInteger sS1 = s1.getTagList().size();\n\t\t\t\tInteger sS2 = s2.getTagList().size();\n\n\t\t\t\tint sComp = sS1.compareTo(sS2);\n\n\t\t\t\treturn -1 * sComp;\n\t\t\t}\n\t\t});\n\t}", "public int compareVersion(String version1, String version2) {\n String[] v1 = version1.split(\"\\\\.\");\n String[] v2 = version2.split(\"\\\\.\");\n \n int i = 0;\n while (i < v1.length && i < v2.length) {\n int num1 = Integer.parseInt(v1[i]);\n int num2 = Integer.parseInt(v2[i]);\n if (num1 > num2) return 1;\n else if (num1 < num2) return -1;\n i++;\n }\n while (i < v1.length) {\n int num1 = Integer.parseInt(v1[i++]);\n if (num1 > 0) return 1;\n }\n while (i < v2.length) {\n int num2 = Integer.parseInt(v2[i++]);\n if (num2 > 0) return -1;\n }\n return 0;\n }", "private void sortCoreTypes() {\n\t\tArrays.sort(coreBuiltin, (o1, o2) -> Long.compare(o1.id, o2.id));\n\t}", "@Override\n\tpublic void readAllAGBVersionsOfSource(int sourceId, int version1, int version2) {\n\t\t\n\t\tAPIController apic = new APIController();\n\t\tString sources = apic.getAllAGBVersionsOfSource(sourceId).toString();\n\t\t\n\t\tString agbtext1 = null;\n\t\tString agbtext2 = null;\n\t\t\n\t\t// Version in allAGBVersions[0] ist die neuste Version, z.B. Version 3\n\t\t// allAGBVersions[1], Version 2\n\t\t// allAGBVersions[2], Version 1\n\t\tallAGBVersions = sources.split(\"],\");\n\t\t//System.out.println(\"Array-Laenge: \" + allAGBVersions.length);\n\t\tint counter = allAGBVersions.length;\n\t\t//System.out.println(\"Counter-Laenge: \" + counter);\n\t\t\n\t\tallAGBVersionsCorrectOrder = new String[counter+1];\n\t\t//System.out.println(\"Array-Laenge: \" + allAGBVersionsCorrectOrder.length);\n\t\tint counter2 = counter;\n\t\t\n\t\tfor (int i = 0; i < allAGBVersions.length; i++)\n\t\t{\n\t\t\tallAGBVersionsCorrectOrder[counter2] = allAGBVersions[i];\n\t\t\tcounter2--;\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\tfor (int i = counter; i < 0 ; i--)\n\t\t{\n\t\t\tallAGBVersionsCorrectOrder[c] = allAGBVersions[i];\n\t\t\tc++;\n\t\t\t\n\t\t}*/\n\t\t\n\t\t//System.out.print(\"Korrigierte Arraylaenge: \" + allAGBVersionsCorrectOrder.length);\n\t\t\n\t\tfor (int i = 1; i < allAGBVersionsCorrectOrder.length; i++)\n\t\t{\n\t\t\tif (i == version1)\n\t\t\t{\n\t\t\t\tagbtext1 = allAGBVersionsCorrectOrder[i];\n\t\t\t\t//System.out.println(\"AGB1-Version gesetzt: \");\n\t\t\t}\n\t\t\t\n\t\t\tif (i == version2)\n\t\t\t{\n\t\t\t\tagbtext2 = allAGBVersionsCorrectOrder[i];\n\t\t\t\t//System.out.println(\"AGB2-Version gesetzt: \");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Suche nach AGB-Version: \");\n\t\t\t}\n\t\t} //endfor\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//System.out.println(\"AGB-Version1: \"+ agbtext1);\n\t\t//System.out.println(\"AGB-Version2: \"+ agbtext2);\n\t\t\n\t\t// Speichere Version1 mit BreakIterator in ArrayListe\n\t\tSystem.out.println(\"Verarbeite AGB-Version1 mit BreakIterator: \");\n\n\t\tLocale currentLocale1 = new Locale(\"de\", \"DE\");\n\t\t\n\t\tBreakIterator sentenceIterator1 = BreakIterator.getSentenceInstance(currentLocale1);\n\t\tsentenceIterator1.setText(agbtext1);\n\n\t\tfor (int last = sentenceIterator1.first(), next = sentenceIterator1.next();\n\t\t next != BreakIterator.DONE;\n\t\t last = next, next = sentenceIterator1.next())\n\t\t {\n\t\t CharSequence part = agbtext1.subSequence( last, next );\n\t\t \n\t\t if (Character.isLetterOrDigit(part.charAt(0)))\n\t\t {\n\t\t \t//System.out.println(part);\n\t\t \tagbversion1.add((String)part);\n\t\t } // endif\n\t\t \n\t\t } //endfor\n\t\t\n\t\t\n\t\t// Speichere Version2 mit BreakIterator in ArrayListe\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\"Verarbeite AGB-Version2 mit BreakIterator: \");\n\t\tSystem.out.println(\" \");\n\n\t\tLocale currentLocale2 = new Locale(\"de\", \"DE\");\n\t\t\n\t\tBreakIterator sentenceIterator2 = BreakIterator.getSentenceInstance(currentLocale2);\n\t\tsentenceIterator2.setText(agbtext2);\n\n\t\tfor (int last = sentenceIterator2.first(), next = sentenceIterator2.next();\n\t\t next != BreakIterator.DONE;\n\t\t last = next, next = sentenceIterator2.next())\n\t\t {\n\t\t CharSequence part = agbtext2.subSequence( last, next );\n\t\t \n\t\t if (Character.isLetterOrDigit(part.charAt(0)))\n\t\t {\n\t\t \t//System.out.println(part);\n\t\t \tagbversion2.add((String)part);\n\t\t } // endif\n\t\t \n\t\t } //endfor\n\t\t\n\t\t\n\t}", "private void getVersionName(String packageName) {\n String versionName = \"\";\n //Get the current App Version\n try {\n PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);\n versionName = packageInfo.versionName;\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n\n\n final String finalVersionName = versionName;\n Observable<String> versionObserver = VersionInfo.getInstance().isUpdateAvailable(packageName, this);\n if (versionObserver == null) {\n Toast.makeText(this, \"Package => \" + packageName + \" not found on Play Store\", Toast.LENGTH_SHORT).show();\n return;\n }\n versionObserver.subscribeOn(Schedulers.newThread())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new Observer<String>() {\n @Override public void onCompleted() {\n\n }\n\n @Override public void onError(Throwable e) {\n e.printStackTrace();\n }\n\n @Override public void onNext(String s) {\n if (s != null && !s.isEmpty()) {\n mTextViewVersionInfo.setText(s);\n //Version class will help us to compare two different versions\n Version currentVersion = new Version(finalVersionName);\n Version playStoreVersion = new Version(s);\n\n\n\n if (currentVersion.compareTo(playStoreVersion) == -1) {\n //A new Version is available\n //TODO SHOW UPDATE DIALOG\n } else {\n //No Update Available\n //TODO No Dialog Required\n }\n }\n }\n });\n }", "public void testSortJarList() throws Exception {\n\t\tjsystem.launch();\n\t\tScenarioUtils.createAndCleanScenario(jsystem, jsystem.getCurrentScenario());\n\t\tString txt = jsystem.sortJarList();\n\t\tvalidateJarList(txt, 2);\n\t}", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "public int getResolvedBundles();", "List<String> apiVersions();", "public void jsort() {\n\tArrays.sort(data);\n }", "private static String m35239a(Context context) {\n try {\n return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;\n } catch (NameNotFoundException unused) {\n return null;\n }\n }", "@Override\n public int compare(PackageOverride o1, PackageOverride o2) {\n boolean isVersionInRange1 = isVersionInRange(o1, mVersionCode);\n boolean isVersionInRange2 = isVersionInRange(o2, mVersionCode);\n if (isVersionInRange1 != isVersionInRange2) {\n return isVersionInRange1 ? -1 : 1;\n }\n\n // Otherwise, prefer overrides whose version range is before versionCode.\n boolean isVersionAfterRange1 = isVersionAfterRange(o1, mVersionCode);\n boolean isVersionAfterRange2 = isVersionAfterRange(o2, mVersionCode);\n if (isVersionAfterRange1 != isVersionAfterRange2) {\n return isVersionAfterRange1 ? -1 : 1;\n }\n\n // If both overrides' version ranges are either before or after versionCode, prefer\n // those whose version range is closer to versionCode.\n return Long.compare(\n getVersionProximity(o1, mVersionCode), getVersionProximity(o2, mVersionCode));\n }", "public void sortElements(){\n\t\tgetInput();\n\t\tPeople[] all = countAndSort(people, 0, people.length-1);\n\t\t//PrintArray(all);\n\t\tSystem.out.println(InversionCount);\n\t}", "public List<SortedArrayInfo> sortHistory();", "public static String getVersionInfo() {\n return getCommonManifestEntry(getJarPathFromClassPath(getAppJarName()),null);\n }", "@Override\n public int compare(SongInfo o1, SongInfo o2) {\n return o1.getSongName().compareTo(o2.getSongName());\n }", "public int compareVersion(String version1, String version2) {\n String[] v1 = version1.split(\"\\\\.\");\n String[] v2 = version2.split(\"\\\\.\");\n \n int length = Math.max(v1.length, v2.length);\n for (int i = 0; i < length; i++) {\n Integer num1 = i < v1.length ? Integer.parseInt(v1[i]) : 0;\n Integer num2 = i < v2.length ? Integer.parseInt(v2[i]) : 0;\n \n //Note that int cannot be dereferenced, so we must use Integer for \n //num1 and num2.\n int compare = num1.compareTo(num2);\n if (compare != 0) return compare;\n }\n return 0;\n }", "public static int m19633b(Context context) {\n int i = 0;\n try {\n return context.getPackageManager().getPackageInfo(context.getPackageName(), i).versionCode;\n } catch (Throwable unused) {\n return i;\n }\n }", "private void sortDate()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getReleaseDate().compareTo(b.getReleaseDate());\n if( result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "@Override\n public int compareTo(ModuleVersion that) {\n int diff = this.name.compareTo(that.name);\n if (diff != 0) return diff;\n\n // Empty version orders before non-empty\n if (this.version.isEmpty() || that.version.isEmpty()) {\n return (this.version.isEmpty() ? -1 : 0) +\n (that.version.isEmpty() ? +1 : 0);\n }\n\n return this.version.get().compareTo(that.version.get());\n }", "Collection<String> getVersions();", "public static void sortedByPriority(HashMap<Integer, BlockInfo> blockInfo){\r\n\t\t\r\n\t\tList<Entry<Integer, BlockInfo>> list = new ArrayList<Entry<Integer,BlockInfo>>(blockInfo.entrySet());\r\n\t\t\r\n\t\tCollections.sort(list, new Comparator<Map.Entry<Integer, BlockInfo>>(){\r\n\t\t\t public int compare(Map.Entry<Integer,BlockInfo> e1, Map.Entry<Integer,BlockInfo> e2){ \t \r\n\t\t\t \t double v1 = (double) ((Map.Entry<Integer,BlockInfo>)e1).getValue().getPriority(); \r\n\t\t\t \t double v2 = (double) ((Map.Entry<Integer,BlockInfo>)e2).getValue().getPriority(); \r\n\t\t\t \t double flag = v2-v1;\r\n\t\t\t \t if(flag > 0.0){\r\n\t\t\t \t\t return 1;\r\n\t\t\t \t }else if(flag == 0){\r\n\t\t\t\t\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t\t\t\t\t }else {\r\n\t\t\t\t\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t }); \r\n\t\t\r\n\t\tblockInfo.clear();\r\n\t\t\r\n\t\tfor(int i=0; i<list.size(); i++){\r\n\t\t\tblockInfo.put(list.get(i).getKey(), list.get(i).getValue());\r\n\t\t}\r\n\t\t\r\n\t}", "synchronized Collection getZombieAffected(Bundle [] bundles) {\n // set of affected bundles will be in start-level/bundle-id order \n TreeSet affected = new TreeSet(new Comparator() {\n public int compare(Object o1, Object o2) {\n BundleImpl b1 = (BundleImpl)o1; \n BundleImpl b2 = (BundleImpl)o2;\n int dif = b1.getStartLevel() - b2.getStartLevel();\n if (dif == 0) {\n dif = (int)(b1.getBundleId() - b2.getBundleId());\n }\n return dif;\n }\n public boolean equals(Object o) {\n return ((o != null) && getClass().equals(o.getClass()));\n }\n });\n if (bundles == null) {\n if (Debug.packages) {\n Debug.println(\"getZombieAffected: check - null\");\n }\n for (Iterator i = packages.values().iterator(); i.hasNext();) {\n Pkg p = (Pkg)i.next();\n for (Iterator ps = p.providers.iterator(); ps.hasNext(); ) {\n ExportPkg ep = (ExportPkg)ps.next();\n if (ep.zombie) {\n if (Debug.packages) {\n Debug.println(\"getZombieAffected: found zombie - \" + ep.bpkgs.bundle);\n }\n affected.add(ep.bpkgs.bundle);\n }\n }\n }\n } else {\n for (int i = 0; i < bundles.length; i++) {\n if (bundles[i] != null) {\n if (Debug.packages) {\n Debug.println(\"getZombieAffected: check - \" + bundles[i]);\n }\n BundleImpl tmp = (BundleImpl)bundles[i];\n\n if (tmp.isFragment() &&\n tmp.isAttached() && \n !affected.contains(tmp.getFragmentHost())) {\n affected.add(tmp.getFragmentHost());\n } else {\n affected.add(bundles[i]);\n }\n }\n }\n }\n ArrayList moreBundles = new ArrayList(affected);\n for (int i = 0; i < moreBundles.size(); i++) {\n BundleImpl b = (BundleImpl)moreBundles.get(i);\n for (Iterator j = b.getExports(); j.hasNext(); ) {\n ExportPkg ep = (ExportPkg)j.next();\n if (ep.pkg != null && ep.pkg.providers.contains(ep)) {\n for (Iterator k = ep.getPackageImporters().iterator(); k.hasNext(); ) {\n Bundle ib = (Bundle)k.next();\n if (!affected.contains(ib)) {\n moreBundles.add(ib);\n if (Debug.packages) {\n Debug.println(\"getZombieAffected: added - \" + ib);\n }\n affected.add(ib);\n }\n }\n }\n }\n }\n return affected;\n }", "private void sort() {\n setFiles(getFileStreamFromView());\n }", "private List<String> parseVersions(JSONArray versions) {\n\t\tList<String> parsedVersions = new ArrayList<>();\n\t\t\n\t\tfor (Integer i = 0; i < versions.length(); i++) {\n\t\t\tJSONObject version = versions.getJSONObject(i);\n\t\t\tString versionName = version.getString(\"name\");\n\t\t\tparsedVersions.add(versionName);\n\t\t}\n\t\t\n\t\treturn parsedVersions;\n\t\t\n\t}", "public List<String> versions(final PomId id) {\n\t\tfinal List<Pom> poms = get(id);\n\t\tfinal List<String> versions = new ArrayList<String>();\n\t\tfor (final Pom pom: poms) {\n\t\t\tfinal String version = pom.getVersion();\n\t\t\tif (versions.contains(version)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tversions.add(version);\n\t\t}\n\t\tCollections.sort(versions);\n\t\treturn versions;\n\t}", "public void sort()\n\t{\n\n\n\t\t// Sort the Product Inventory Array List (by Product Name)\n\t\tCollections.sort(myProductInventory);\n\n\n\n\n\t}", "public static String Sorts(Map<Integer,Double> docsInfo) {\n Map<Integer, Double> sorted = docsInfo.entrySet().stream().sorted(Map.Entry.comparingByValue()).collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue(), (e1, e2) -> e2,\n LinkedHashMap::new));\n String ans = \"\";\n sorted = docsInfo\n .entrySet()\n .stream()\n .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))\n .collect(\n Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,\n LinkedHashMap::new));\n for(Map.Entry<Integer, Double> en : sorted.entrySet()) {\n ans = ans + (\"doc.Id ---> \" + en.getKey() +\"\\n\");\n }\n GUI.count = String.valueOf(sorted.size());\n return ans;\n }", "private String getVersionName() {\n\n\t\tString versionName = \"\";\n\t\tPackageManager packageManager = getPackageManager();\n\t\ttry {\n\t\t\tPackageInfo packageInfo = packageManager\n\t\t\t\t\t.getPackageInfo(getPackageName(), 0);// 获取包的内容\n\t\t\t// int versionCode = packageInfo.versionCode;\n\t\t\tversionName = packageInfo.versionName;\n\t\t\tSystem.out.println(\"versionName = \" + versionName);\n\t\t} catch (NameNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn versionName;\n\t}", "public int compareTo(@NotNull Object o)\n {\n JavaVersion other = (JavaVersion) o;\n if (major != other.major) {\n return major - other.major;\n } else {\n if (minor != other.minor) {\n return minor - other.minor;\n } else {\n if (tertiary != other.tertiary) {\n return tertiary - other.tertiary;\n } else {\n if (update != other.update) {\n return update - other.update;\n } else {\n return 0;\n }\n }\n }\n }\n }", "protected void sortCode() {\n for (int i = 1; i < codeCount; i++) {\n int who = i;\n for (int j = i + 1; j < codeCount; j++) {\n if (code[j].getFileName().compareTo(code[who].getFileName()) < 0) {\n who = j; // this guy is earlier in the alphabet\n }\n }\n if (who != i) { // swap with someone if changes made\n SketchCode temp = code[who];\n code[who] = code[i];\n code[i] = temp;\n }\n }\n }", "public int getLibVersionNumber();", "JDKSort() {\n }", "@Test\n public void mergeSortWithSv2() throws Exception {\n ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher);\n try (ClusterFixture cluster = builder.build();\n ClientFixture client = cluster.clientFixture()) {\n List<QueryDataBatch> results = client.queryBuilder().physicalResource(\"xsort/one_key_sort_descending_sv2.json\").results();\n assertEquals(500_000, client.countResults(results));\n validateResults(client.allocator(), results);\n }\n }", "private String m5297b() {\n String str = \"\";\n try {\n return getPackageManager().getPackageInfo(getPackageName(), 0).versionName;\n } catch (NameNotFoundException e) {\n e.printStackTrace();\n return str;\n }\n }", "private void initialiseLevelPackages() {\n\t\tlevelPackages = new ArrayList<LevelPackage>();\n\n\t\tFileHandle handle = Gdx.files.internal(BackendHelper.getAssetDirPath()\n\t\t\t\t+ \"json/levels\");\n\t\tFileHandle[] possiblePackageDirs = handle.list();\n\t\tfor (FileHandle dir : possiblePackageDirs) {\n\t\t\tif (!dir.isDirectory()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString name = dir.name();\n\t\t\tif (name.length() != 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (name.matches(\"[0-9][0-9]\")) {\n\t\t\t\ttry {\n\t\t\t\t\tif (dir.child(\"package.json\").exists()) {\n\t\t\t\t\t\tlevelPackages.add(this.loadPackage(Integer\n\t\t\t\t\t\t\t\t.parseInt(name)));\n\t\t\t\t\t}\n\t\t\t\t} catch (GdxRuntimeException ex) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Ignore. Just in case, libGdx' documentation of is telling\n\t\t\t\t\t * the truth (which it isn't) and an exception is thrown in\n\t\t\t\t\t * dir.child, because it is internal an non-existent\n\t\t\t\t\t */\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tCollections.sort(levelPackages, new Comparator<LevelPackage>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(LevelPackage o1, LevelPackage o2) {\n\t\t\t\treturn (int) Math.signum(o1.getLevelPackageId()\n\t\t\t\t\t\t- o2.getLevelPackageId());\n\t\t\t}\n\t\t});\n\t}", "public static List<String> m21382B(Context context) {\n List installedPackages = context.getPackageManager().getInstalledPackages(0);\n if (installedPackages == null || installedPackages.isEmpty()) {\n return null;\n }\n ArrayList arrayList = new ArrayList(installedPackages.size());\n for (int i = 0; i < installedPackages.size(); i++) {\n PackageInfo packageInfo = (PackageInfo) installedPackages.get(i);\n if ((packageInfo.applicationInfo.flags & 1) == 0) {\n arrayList.add(packageInfo.packageName);\n }\n }\n return arrayList;\n }", "public static void sortitems(ArrayList<item> svd)\r\n{\n\r\n\tCollections.sort(svd, new Comparator<item>(){\r\n\t\tpublic int compare(item o1, item o2){\r\n\t\t\t\tif(o1.density == o2.density)\r\n\t\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t\t\t\t\treturn o1.density > o2.density ? -1 : 1;\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}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\r\n}", "public int compareTo(int majorVersion, int minorVersion) {\n if (getMajor() == majorVersion) {\n return Integer.compare(getMinor(), minorVersion);\n }\n return Integer.compare(getMajor(), majorVersion);\n }", "public static String obtenerversionApp(Context context){\n String respuesta=\"\";\n try {\n PackageInfo packageInfo=context.getPackageManager().getPackageInfo(context.getPackageName(),0);\n respuesta=packageInfo.versionName;\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n return respuesta;\n }", "public String getPackaging();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "public void moveBundles(AssetManager assetManager) {\n\n String[] files = null;\n\n //Get cpu_abi for SDK versions above API 21\n String cpu_abi = Build.CPU_ABI;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n String[] abis = Build.SUPPORTED_ABIS;\n for (String ab : abis) {\n try {\n files = assetManager.list(\"celix_bundles/\" + ab);\n if (files.length > 0) {\n cpu_abi = ab;\n break;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n } else {\n //Get cpu_abi for SDK version below API 21\n try {\n files = assetManager.list(\"celix_bundles/\" + Build.CPU_ABI);\n if (files.length == 0) {\n files = assetManager.list(\"celix_bundles/\" + Build.CPU_ABI2);\n cpu_abi = Build.CPU_ABI2;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n Log.e(\"Bundles\", \"Using \" + cpu_abi + \" bundles\");\n this.cpu_abi = cpu_abi;\n\n if (files != null) {\n //Move bundles from assets to internal storage (/data/data/com.inaetics.demonstrator/celix_bundles\n for (String fileName : files) {\n File bundleFile = new File(bundleLocation + \"/\" + fileName);\n try {\n InputStream in = assetManager.open(\"celix_bundles/\" + cpu_abi + \"/\" + fileName);\n moveBundle(in,bundleFile);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n bundlesMoved = true;\n } else {\n Log.e(\"Zips\", \"No zips for supported abis found!\");\n }\n }", "public void f7(List<Book> a) {\r\n Collections.sort(a, new Comparator<Book>() {\r\n @Override\r\n public int compare(Book o1, Book o2) {\r\n if (o1.getPrice() > o2.getPrice()) {\r\n return 1;\r\n } else if (o1.getPrice() < o2.getPrice()) {\r\n return -1;\r\n } else {\r\n return o1.getName().compareToIgnoreCase(o2.getName());\r\n }\r\n }\r\n });\r\n }", "public int getVersionIndex();", "public String getVersion();", "public String getVersion();", "public String getVersion();", "public String getVersion();", "public static native int getSaioVersion(String packagename, int type, byte[] info);", "public static void main(String[] args) {\n\t\tList<Product> prodList = new ArrayList<>();\n\t\tprodList.add(new Product(12, \"Refrigerator\", \"Whirlpool\", 43000.00f));\n\t\tprodList.add(new Product(16, \"Mobile\", \"Samsung\", 18000.00f));\n\t\tprodList.add(new Product(11, \"Laptop\", \"Lenovo\", 28300.00f));\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before Sorting\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\tCollections.sort(prodList);\n\t\t\n\t\tSystem.out.println(\"After Sorting\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\tProductNameComparator pnc = new ProductNameComparator();\n\t\tCollections.sort(prodList, pnc);\n\t\t\n\t\tSystem.out.println(\"After Sorting as per name\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\tCollections.sort(prodList,Collections.reverseOrder());\n\t\t\n\t\tSystem.out.println(\"After Sorting as per desc id\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\tCollections.sort(prodList,Collections.reverseOrder(pnc));\n\t\t\n\t\tSystem.out.println(\"After Sorting as per desc name\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\t\n\t\tCollections.sort(prodList, (p1,p2)-> p1.getPrice()>p2.getPrice()?1:-1 );\n\t\tSystem.out.println(\"After Sorting as per price\");\n\t\tprodList.forEach(p->System.out.println(p));\n\t\t\n\t\tCollections.sort(prodList, (p1,p2)-> p1.getPrice()<p2.getPrice()?1:-1 );\n\t\tSystem.out.println(\"After Sorting as per desc price\");\n\t\tprodList.forEach(System.out::println);\n\t\t\n\t}", "public static native int getUBootEnvVersion(byte[] info);" ]
[ "0.58565825", "0.56455624", "0.55063033", "0.5489136", "0.5478079", "0.54010224", "0.5316695", "0.52885365", "0.5280602", "0.5266418", "0.5243919", "0.5241037", "0.52307725", "0.51562554", "0.51547444", "0.5153871", "0.5137595", "0.5130722", "0.51266986", "0.5125426", "0.50995284", "0.5035691", "0.5027902", "0.49844506", "0.4979808", "0.49747968", "0.49590495", "0.49288917", "0.49194705", "0.49158114", "0.48985645", "0.4886014", "0.4875366", "0.48523295", "0.48434222", "0.48424655", "0.484169", "0.4841606", "0.4841606", "0.4841606", "0.4841606", "0.4841606", "0.4841606", "0.4841606", "0.4841606", "0.4835299", "0.4834365", "0.48330653", "0.4798833", "0.47830066", "0.47766078", "0.4769055", "0.4760598", "0.4760487", "0.47574332", "0.47569427", "0.4755937", "0.47472924", "0.47428238", "0.47304222", "0.47294527", "0.47158077", "0.47143078", "0.47107467", "0.47098666", "0.47067317", "0.46957868", "0.46853745", "0.46853173", "0.46845636", "0.46714216", "0.4662569", "0.4654376", "0.46540776", "0.4646765", "0.46398136", "0.46217397", "0.46133465", "0.4612863", "0.46116763", "0.46116763", "0.46116763", "0.46116763", "0.46116763", "0.46116763", "0.46116763", "0.46116763", "0.46116763", "0.46116763", "0.46116763", "0.46100396", "0.4598499", "0.45980313", "0.45962253", "0.45962253", "0.45962253", "0.45962253", "0.45931923", "0.45916328", "0.45878255" ]
0.69537693
0
Added Department section in the json object
private String getListData() { String jsonStr = "{ \"users\" :[" + "{\"name\":\"Ritesh Kumar\",\"designation\":\"Team Leader\",\"department\":\"Main office\",\"location\":\"Brampton\"}" + ",{\"name\":\"Frank Lee\",\"designation\":\"Developer\",\"department\":\"Developer's office\",\"location\":\"Markham\"}" + ",{\"name\":\"Arthur Young\",\"designation\":\"Charted Accountant\",\"department\":\"Account office\",\"location\":\"Toronto\"}] }"; return jsonStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addDepartment(IBaseDTO dto) {\n\t\tSysDepartment sd=new SysDepartment();\n\t\t\n\t\tsd.setName((String)dto.get(\"name\"));\n\t\tsd.setParentId((String)dto.get(\"parentId\"));\n\t\tsd.setRemarks((String)dto.get(\"remark\"));\n\t\tsd.setTagShow((String)dto.get(\"tagShow\"));\n\t\tsd.setId(ks.getNext(\"sys_department\"));\n\t\t\n\t\tdao.saveEntity(sd);\n\t\tcts.reload();\n\t}", "public void setDepartment(Department d) {\r\n department = d;\r\n }", "public void setDepartment(Department department) {\n this.department = department;\n }", "public void addDepartmentRow(Departmentdetails departmentDetailsFeed);", "public static void addDept() {\n\t\tScanner sc = ReadFromConsole.sc;\n\n\t\tSystem.out.println(\"Enter Department name: \");\n\t\tString deptName = sc.nextLine();\n\n\t\tsc.nextLine(); // had to add this in to prevent input lines with different data types from\n\t\t\t\t\t\t// printing simultaneously, if you know a better solution, let me know\n\n\t\tSystem.out.println(\"Enter Department phone number: \");\n\t\tString deptPhoneNum = sc.nextLine();\n\n\t\tDepartment dept1 = new Department(deptName, deptPhoneNum);\n\t\t// pass in the info for each department\n\t\t// dept1 is the reference to the newly created obj\n\t\t// new Department = creates a new department obj and the Department constructor has a\n\t\t// counter variable which increments the id# and assigns it as new department id\n\n\t\tdeptInfo.add(dept1);\n\t\t// adding the newly created obj ref into arrlist\n\n\t}", "public void setDepartment(String department) {\n this.department = department;\n }", "@JsonSetter(\"department\")\n public void setDepartment (String value) { \n this.department = value;\n notifyObservers(this.department);\n }", "@RequestMapping(value = \"addUpdateDepartment\", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)\n protected void addUpdateDepartment(HttpServletRequest request, HttpServletResponse response) throws Exception {\n String json = \"\";\n String resultado = \"\";\n Integer idManagLab = 0;\n Integer department = 0;\n Integer idRecord = 0;\n\n\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream(), \"UTF8\"));\n json = br.readLine();\n //Recuperando Json enviado desde el cliente\n JsonObject jsonpObject = new Gson().fromJson(json, JsonObject.class);\n\n if(jsonpObject.get(\"idManagLab\") != null && !jsonpObject.get(\"idManagLab\").getAsString().isEmpty() ) {\n idManagLab = jsonpObject.get(\"idManagLab\").getAsInt();\n }\n\n if (jsonpObject.get(\"department\") != null && !jsonpObject.get(\"department\").getAsString().isEmpty()) {\n department = jsonpObject.get(\"department\").getAsInt();\n }\n\n\n if (jsonpObject.get(\"idRecord\") != null && !jsonpObject.get(\"idRecord\").getAsString().isEmpty()) {\n idRecord = jsonpObject.get(\"idRecord\").getAsInt();\n }\n\n\n\n\n User usuario = seguridadService.getUsuario(seguridadService.obtenerNombreUsuario());\n\n if (idRecord == 0) {\n if (department != 0 && idManagLab!= 0) {\n\n //search record\n DepartamentoDireccion record = organizationChartService.getDepManagementRecord(idManagLab, department);\n\n if (record == null) {\n DepartamentoDireccion dep = new DepartamentoDireccion();\n dep.setFechaRegistro(new Timestamp(new Date().getTime()));\n dep.setUsuarioRegistro(usuario);\n dep.setDepartamento(laboratoriosService.getDepartamentoById(department));\n dep.setDireccionLab(organizationChartService.getManagmentLabById(idManagLab));\n dep.setPasivo(false);\n organizationChartService.addOrUpdateDepManagement(dep);\n } else {\n resultado = messageSource.getMessage(\"msg.existing.record.error\", null, null);\n throw new Exception(resultado);\n }\n\n }\n } else {\n DepartamentoDireccion rec = organizationChartService.getDepManagementById(idRecord);\n if (rec != null) {\n rec.setPasivo(true);\n organizationChartService.addOrUpdateDepManagement(rec);\n }\n }\n\n\n } catch (Exception ex) {\n logger.error(ex.getMessage(), ex);\n ex.printStackTrace();\n resultado = messageSource.getMessage(\"msg.add.depManag.error\", null, null);\n resultado = resultado + \". \\n \" + ex.getMessage();\n\n } finally {\n Map<String, String> map = new HashMap<String, String>();\n map.put(\"idManagLab\", idManagLab.toString());\n map.put(\"mensaje\", resultado);\n map.put(\"idRecord\", \"\");\n map.put(\"department\", \"\");\n String jsonResponse = new Gson().toJson(map);\n response.getOutputStream().write(jsonResponse.getBytes());\n response.getOutputStream().close();\n }\n }", "@JsonGetter(\"department\")\n public String getDepartment ( ) { \n return this.department;\n }", "@Override\r\n\tpublic void addDepartment(Department department) {\n\r\n\t\tgetHibernateTemplate().save(department);\r\n\t}", "public void setDepartment(String department) {\r\n\t\tthis.department=department;\r\n\t}", "void insertDepartment(String depName, Date creationDate, long idParentDepartment);", "public void setDepartment(String department) {\r\n\t\tthis.department = department;\r\n\t}", "public void AddDepartment(String nomDepart)\n\t{ \n\t\tDepartment depart = new Department();\n\t\tdepart.setNameDepartment(nomDepart);\n\t\tdepartments.add(depart);\n\t}", "public void AddDep(Department dep) {\n\t\tddi.Add(dep);\n\t\t\n\t}", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"department\"})\n public void _2_1_3_addExistDept() throws Exception {\n Department dept = new Department();\n dept.setName(d_1_1.getName());\n dept.setDescription(\"测试新增重复部门\");\n dept.setParent(d_1.getId());\n try {\n RequestBuilder request = post(\n \"/api/v1.0/companies/\"+\n d_1.getCompany()+\n \"/departments\")\n .contentType(CONTENT_TYPE)\n .header(AUTHORIZATION, ACCESS_TOKEN)\n .content(json(dept));\n this.mockMvc.perform(request)\n .andDo(print())\n .andExpect(status().isConflict());\n } catch(Exception e) {\n throw(e);\n } finally {\n cleanNode(LdapNameBuilder.newInstance(d_1.getId())\n .add(\"ou\",dept.getName())\n .build().toString());\n }\n }", "public void add(Department dep)\n\t{\n\t\tHRProtocol envelop = null;\n\t\tenvelop = new HRProtocol(HRPROTOCOL_ADD_DEPARTMENT_REQUEST, dep, null);\n\t\tsendEnvelop(envelop);\n\t\tenvelop = receiveEnvelop();\n\t\tif(envelop.getPassingCode() == HRPROTOCOL_ADD_DEPARTMENT_RESPONSE)\n\t\t{\t//Success in transition\n\t\t}else\n\t\t{\n\t\t\t//Error in transition. or other error codes.\n\t\t}\n\t}", "void modifyDepartment(Department dRef);", "public ResponseEntity<ApiMessageResponse> createDepartment(DepartmentRequest departmentRequest) {\n //Creating a new object of department model to save on database\n DepartmentModel departmentModel = new DepartmentModel(0L, departmentRequest.getName(), departmentRequest.getActive());\n\n departmentRepository.save(departmentModel); //Saving in database\n\n return new ResponseEntity<>(new ApiMessageResponse(201, \"Department Created\"), HttpStatus.CREATED);\n }", "public void setDepartment(String dept) {\r\n\t\tdepartment = dept;\r\n\t}", "@Override\n\tpublic void buideJson(JSONObject job) throws JSONException {\n\t\ttry\n\t\t{\n\t\t\tif(!job.isNull(\"id\"))\n\t\t\t{\n\t\t\t\tthis.id = job.getString(\"id\");\n\t\t\t}\n\t\t\tif(!job.isNull(\"title\"))\n\t\t\t{\n\t\t\t\tthis.title = job.getString(\"title\");\n\t\t\t}\n\t\t\tif(!job.isNull(\"intro\"))\n\t\t\t{\n\t\t\t\tthis.intro = job.getString(\"intro\");\n\t\t\t}\n\t\t\tif (!job.isNull(\"child\")) {\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tJSONArray cardarr = job.getJSONArray(\"child\");\n\t\t\t\t\tif (null != cardarr && cardarr.length() > 0) {\n\t\t\t\t\t\tthis.child = new ArrayList<DeptVo>();\n\t\t\t\t\t\tfor (int i = 0; i < cardarr.length(); i++) {\n\t\t\t\t\t\t\tDeptVo vo = new DeptVo();\n\t\t\t\t\t\t\tvo.buideJson(cardarr.getJSONObject(i));\n\t\t\t\t\t\t\tchild.add(vo);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}catch(Exception e)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void setDepartmentid(Integer departmentid) {\n this.departmentid = departmentid;\n }", "public void setDepartmentid(Integer departmentid) {\n this.departmentid = departmentid;\n }", "public void setDepartmentName(String departmentName) {\n this.departmentName = departmentName;\n }", "public void setDepartment(String department) {\n if(department==null){\n department = \"\";\n }\n this.department = department;\n }", "public void updateDepartment(IBaseDTO dto) {\n\t\tString id=(String)dto.get(\"id\");\n\t\tSysDepartment sd=(SysDepartment)dao.loadEntity(SysDepartment.class,id);\n\t\tif(sd!=null)\n\t\t{\n\t\t\t\n\t\t\tsd.setName((String)dto.get(\"name\"));\n\t\t\tsd.setParentId((String)dto.get(\"parentId\"));\n\t\t\tsd.setRemarks((String)dto.get(\"remark\"));\n\t\t\tsd.setTagShow((String)dto.get(\"tagShow\"));\n\t\t\tsd.setAdmin((String)dto.get(\"admin\"));\n\t\t}\n\t\tcts.reload();\n\t\tdao.saveEntity(sd);\n\t}", "public void setDepartmentname(java.lang.String newDepartmentname) {\n\tdepartmentname = newDepartmentname;\n}", "@RequestMapping(\"/add\")\n @ResponseBody\n public JSONObject addDepart(HttpServletRequest request , HttpServletResponse response, Map<String,Object>map){\n JSONObject jo = new JSONObject();\n try\n {\n // department.setSort(departmentService.max());\n boolean index = departmentService.add(map);\n Operationlog operationlog = new Operationlog();\n operationlogService.addLog(\"添加用户\",\"2\",request);\n }\n catch (Exception e)\n {\n e.printStackTrace();\n jo.put(\"status\",\"1\");\n jo.put(\"code\",0);\n jo.put(\"msg\",\"ok\");\n return jo;\n }\n jo.put(\"status\",1);\n jo.put(\"code\",0);\n jo.put(\"msg\",\"ok\");\n return (JSONObject) JSONObject.toJSON(jo);\n }", "private void addAllDepartments() {\n\t\tfinal BillingPeriod bp = (BillingPeriod) this.getBean().getContainer()\n\t\t\t\t.findBean(\"org.rapidbeans.clubadmin.domain.BillingPeriod\", this.getBillingPeriod().getIdString());\n\t\tfor (RapidBean bean : this.getBean().getContainer()\n\t\t\t\t.findBeansByType(\"org.rapidbeans.clubadmin.domain.Department\")) {\n\t\t\tfinal Department dep = (Department) bean;\n\t\t\tif (bp.getDepartments() == null || !bp.getDepartments().contains(dep)) {\n\t\t\t\tbp.addDepartment(dep);\n\t\t\t}\n\t\t}\n\t}", "public void SetDepartmentID(String DepartmentID)\n {\n this.DepartmentID=DepartmentID;\n }", "@Override\n\tpublic void addDept(DeptInf dept) {\n\t\tdeptMapper.insert(dept);\n\t}", "public Department(String name){\n this.name = name;\n }", "public Department getDepartment() {\n return department;\n }", "public String getDepartment() {\r\n return department;\r\n }", "public void assignDepartment(String departmentName);", "public void setDepartmentName(String departmentName)\r\n\t{\r\n\t\tthis.departmentName = departmentName;\r\n\t}", "public void setDepartmentId(Long departmentId) {\n this.departmentId = departmentId;\n }", "public void setDepartmentId(Long departmentId) {\n this.departmentId = departmentId;\n }", "public void setDepartmentId(Long departmentId) {\n this.departmentId = departmentId;\n }", "public void setDepartmentId(int value) {\n this.departmentId = value;\n }", "public String getDepartment() {\n return department;\n }", "public String getDepartment() {\n return department;\n }", "public String getDepartment() {\n return department;\n }", "public String getDepartment() {\n return department;\n }", "public String getDepartment() {\n return department;\n }", "public void setDepartmentId(Integer departmentId) {\n this.departmentId = departmentId;\n }", "public void setDepartmentId(Integer departmentId) {\n this.departmentId = departmentId;\n }", "public void setDepartmentId(Integer departmentId) {\n this.departmentId = departmentId;\n }", "@PostMapping(\"/company-departments\")\n @Timed\n public ResponseEntity<CompanyDepartment> createCompanyDepartment(@RequestBody CompanyDepartment companyDepartment) throws URISyntaxException {\n log.debug(\"REST request to save CompanyDepartment : {}\", companyDepartment);\n if (companyDepartment.getId() != null) {\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(\"companyDepartment\", \"idexists\", \"A new companyDepartment cannot already have an ID\")).body(null);\n }\n CompanyDepartment result = companyDepartmentRepository.save(companyDepartment);\n return ResponseEntity.created(new URI(\"/api/company-departments/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(\"companyDepartment\", result.getId().toString()))\n .body(result);\n }", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"department\"})\n public void _2_1_2_addSecondLevelDept() throws Exception {\n Department dept = new Department();\n dept.setName(\"testadd2nddept\");\n dept.setDescription(\"测试新增二级部门\");\n dept.setParent(d_1.getId());\n try {\n RequestBuilder request = post(\n \"/api/v1.0/companies/\"+\n d_1.getCompany()+\n \"/departments\")\n .contentType(CONTENT_TYPE)\n .header(AUTHORIZATION, ACCESS_TOKEN)\n .content(json(dept));\n this.mockMvc.perform(request)\n .andDo(print())\n .andExpect(status().isCreated())\n .andExpect(jsonPath(\"$.id\",is(\n LdapNameBuilder.newInstance(d_1.getId())\n .add(\"ou\",dept.getName())\n .build().toString()\n )))\n .andExpect(jsonPath(\"$.name\",is(dept.getName())))\n .andExpect(jsonPath(\"$.description\",is(dept.getDescription())))\n .andExpect(jsonPath(\"$.company\",is(d_1.getCompany().toString())))\n .andExpect(jsonPath(\"$.parent\",is(d_1.getId().toString())));\n } catch(Exception e) {\n throw(e);\n } finally {\n cleanNode(LdapNameBuilder.newInstance(d_1.getId())\n .add(\"ou\",dept.getName())\n .build().toString());\n }\n }", "@RequestMapping(value = \"/department/add.html\", method = RequestMethod.POST)\n\tpublic String add(@ModelAttribute Department department) {\n\t\tdepartment = deptDao.saveDepartment(department);\n\t\tSystem.out.println(\"Department saved\");\n\t\treturn \"redirect:list.html\";\n\n\t}", "@Override\n public void setDepartments() throws DepartmentCreationException {\n\n }", "public void AddEmployeeToDepartement(String nameDepartement , Employee emp)\n\t{\n\t\tfor(Department depart : departments)\n\t\t{\n\t\t\tif(depart.getNameDepartment().equals(nameDepartement)) \n\t\t\t{\n\t\t\t\tdepart.addEmployee(emp);\n\t\t\t}\n\t\t}\n\t}", "public String getDepartment(){\n\t\treturn departName;\n\t}", "public String getDepartmentid() {\n return departmentid;\n }", "public Department() \n {\n name = \"unnamed department\";\n }", "@Test\n @IfProfileValue(name=\"dept-test-group\", values = {\"all\",\"dept-update\"})\n public void _2_4_2__addBCtoDept() throws Exception {\n Department d = d_1;\n d.addBusinessCategory(bc_1);\n this.mockMvc.perform(put(\"/api/v1.0/companies/\"+\n d.getCompany()+\n \"/departments/\"+\n d.getId())\n .contentType(CONTENT_TYPE)\n .header(AUTHORIZATION, ACCESS_TOKEN)\n .content(json(d)))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$.id\",is(d.getId().toString())))\n .andExpect(jsonPath(\"$.description\",is(d.getDescription())))\n .andExpect(jsonPath(\"$.businessCategories\",hasSize(1)))\n .andExpect(jsonPath(\"$.businessCategories[0].product\",is(bc_1.getProduct())))\n .andExpect(jsonPath(\"$.businessCategories[0].locality\",is(bc_1.getLocality())));\n }", "public String GetDept()\r\n {\r\n return Department;\r\n }", "public Departmentdetails getDepartmentByName(String departmentName);", "public void addToDepartmentFullNameList(String fullName) {\n departmentFullNameList.add(fullName);\n }", "@Override\n public void setEmployeeDepartment(int employeeId, int departmentId) {\n\n }", "private void processDeptsAndCollections(Map<String, String> row, Map<String, Dept> deptsAdded,\n Map<String, Collection> collectionsAdded) {\n String deptName = sanitizeString(row.get(departmentHeading));\n String collName = sanitizeString(row.get(collectionHeading));\n //if (deptName.isEmpty()) {\n // // Don't add anything if the department field was empty\n // return;\n //}\n Dept dept;\n Collection coll;\n\n if (failedDeptAttempts >= maxDeptAttempts) {\n throw new RuntimeException(\"Aborting: too many failed attempts to add Departments\");\n }\n if (failedCollAttempts >= maxCollAttempts) {\n throw new RuntimeException(\"Aborting: too many failed attempts to add Collections\");\n }\n //System.out.println(deptsAdded.get(deptName));\n if (deptsAdded.get(deptName) == null) {\n dept = new Dept();\n // id is auto-generated\n dept.setName(deptName);\n try {\n deptRepo.saveAndFlush(dept);\n deptsAdded.put(deptName, dept);\n }\n catch (Exception exception) {\n System.out.println(\"Skipped Dept: duplicate or malformed entry\");\n System.out.println(exception.toString());\n failedDeptAttempts++;\n }\n }\n // How to handle null deptsAdded.get(deptName)?\n if (collectionsAdded.get(collName) == null) {\n coll = new Collection();\n // id is auto-generated\n coll.setName(collName);\n coll.setDept(deptsAdded.get(deptName));\n try {\n collectionRepo.saveAndFlush(coll);\n collectionsAdded.put(collName, coll);\n } catch (Exception exception) {\n System.out.println(\"Skipped Collection: duplicate or malformed entry, or missing Dept\");\n System.out.println(exception.toString());\n failedCollAttempts++;\n }\n }\n }", "public String getDepartment() {\r\n\t\treturn department;\r\n\t}", "public String getDepartment() {\r\n\t\treturn department;\r\n\t}", "public String getDepartment() {\r\n\t\treturn department;\r\n\t}", "public int getDepartmentId() {\n return departmentId;\n }", "public final void setDepartmentName(final String dName) {\n this.departmentName = dName;\n }", "public void AddEmployee(String firstName ,String lastName , String name_department)\n\t{\n\t\tEmployee emp = new Employee();\n\t\temp.setName(firstName);\n\t\temp.setSurname(lastName);\n\t\temp.setDepartment(SearchDepartment(name_department));\n\t\tAddEmployeeToDepartement(name_department,emp);\n\t}", "public String getDepartmentName() {\n return departmentName;\n }", "public List<Departmentdetails> getDepartmentDetails();", "@Test\n @IfProfileValue(name=\"dept-test-group\", values = {\"all\",\"dept-update\"})\n public void _2_4_1_updateExistDept() throws Exception {\n Department d = d_1;\n d.setDescription(\"修改部门1描述\");\n this.mockMvc.perform(put(\"/api/v1.0/companies/\"+\n d.getCompany()+\n \"/departments/\"+\n d.getId())\n .contentType(CONTENT_TYPE)\n .header(AUTHORIZATION, ACCESS_TOKEN)\n .content(json(d)))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$.id\",is(d.getId().toString())))\n .andExpect(jsonPath(\"$.description\",is(d.getDescription())));\n }", "public static void updateDept() {\n\t}", "public void saveOrUpdate(Department obj) {\n\t\t\n\t\tif( obj.getId() == null ) {// the department doesn't exist in the database\n\t\t\tdao.insert(obj);\n\t\t}else {\n\t\t\tdao.update(obj);\n\t\t}\n\t}", "public void setDepartment(String department) {\n this.department = department == null ? null : department.trim();\n }", "protected Department getDepartmentData(JCheckBox chcBox) {\r\n if (chcBox.isSelected()) {\r\n departmentsNumber++;\r\n }\r\n\r\n int discount = (departmentsNumber > 1) ? 18 : 0;\r\n int cost = determineCost(chcBox);\r\n\r\n Department department = new Department.Builder()\r\n .name(chcBox.getText())\r\n .cost(cost)\r\n .discount(discount)\r\n .build();\r\n\r\n return department;\r\n }", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"department\"})\n public void _2_1_1_addFirstLevelDept() throws Exception {\n Department dept = new Department();\n dept.setName(\"testadddept\");\n dept.setDescription(\"测试新增一级部门\");\n dept.setCompany(c_1.getId());\n try {\n RequestBuilder request = post(\"/api/v1.0/companies/\"+c_1.getId().toString()+\"/departments\")\n .contentType(CONTENT_TYPE)\n .header(AUTHORIZATION, ACCESS_TOKEN)\n .content(json(dept));\n this.mockMvc.perform(request)\n .andDo(print())\n .andExpect(status().isCreated())\n .andExpect(jsonPath(\"$.id\",is(\n LdapNameBuilder.newInstance(c_1.getId())\n .add(\"ou\",\"departments\")\n .add(\"ou\",dept.getName())\n .build().toString()\n )))\n .andExpect(jsonPath(\"$.name\",is(dept.getName())))\n .andExpect(jsonPath(\"$.description\",is(dept.getDescription())))\n .andExpect(jsonPath(\"$.company\",is(c_1.getId().toString())))\n .andExpect(jsonPath(\"$.parent\",is(\n LdapNameBuilder.newInstance(c_1.getId())\n .add(\"ou\",\"departments\")\n .build().toString()\n )));\n } catch(Exception e) {\n throw(e);\n } finally {\n cleanNode(LdapNameBuilder.newInstance(c_1.getId())\n .add(\"ou\",\"departments\")\n .add(\"ou\",dept.getName())\n .build().toString());\n }\n\n }", "public LevelOneDepartment addLevelTwoDepartment(RetailscmUserContext userContext, String levelOneDepartmentId, String name, String description, Date founded , String [] tokensExpr) throws Exception;", "public Department createNewDepartment(Department newDepartment) {\n this.departmentDao.insert(newDepartment);\n return newDepartment;\n }", "Department createOrUpdate(Department department);", "@Override\n public void setDepartmentEmployee(Employee employee, int departmentId) {\n\n }", "public void setDepartmentId (java.lang.String departmentId) {\r\n\t\tthis.departmentId = departmentId;\r\n\t}", "public interface DepartmentService {\n public Map<String,Object> departmentList();\n public Map<String,Object> departmentAdd(Map<String,Object> params);\n public Map<String,Object> departmentEdit(Map<String,Object> params);\n public Map<String,Object> departmentDelete(Map<String,Object> params);\n public Map<String,Object> departmentDeleteCascade(Map<String,Object> params);\n public Map<String,Object> departmentNewRoot();\n\n}", "public void addStaff(String json){\n\t\tthis.addStaff(gs.fromJson(json, Staff.class));\r\n\t}", "public synchronized String getDepartment()\r\n {\r\n return department;\r\n }", "@Override\n\t\t\tpublic boolean addDept(Dept dept) {\n\t\t\t\treturn false;\n\t\t\t}", "public void setDepartments(DepartmentAccessBean newDeparments) throws Exception {\n\tif (newDeparments == null) {\n\t\tdepartmentcode = null;\n\t\tdepartmentname = \"\";\n\t}\n\telse {\n\t\tdepartmentcode = new Integer(newDeparments.getDivision());\n\t\tdepartmentname = newDeparments.getName();\n\t}\n}", "@Override\n public Employee updateEmployeeDepartment(int employeeId, int departmentId) {\n return null;\n }", "private void add(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tList<Department> list = service.selectDepartmentAll();\r\n\t\tSystem.out.println(list);\r\n\t\trequest.setAttribute(\"list\", list);\r\n\t\trequest.getRequestDispatcher(\"/WEB-INF/jsp/GongGaoTianJia.jsp\").forward(request, response);\r\n\t}", "public Long getDepartmentId() {\n return departmentId;\n }", "public Long getDepartmentId() {\n return departmentId;\n }", "public Long getDepartmentId() {\n return departmentId;\n }", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"department\"})\n public void _2_2_3_getSubDept() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n d_1.getCompany()+\n \"/departments?parent=\"+\n d_1.getId().toString())\n .header(AUTHORIZATION,ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.departments\",hasSize(2)))\n .andExpect(jsonPath(\"$._embedded.departments[0].parent\",is(d_1.getId().toString())));\n }", "public void setDept(String dept) {\n this.dept = dept;\n }", "@RequestMapping(\"/select.do\")\r\n\t@ResponseBody\r\n\tpublic JsonResult selectDept(String deptId){\n\t\tList<Department> list = deptService.selectDept(deptId);\r\n\t\treturn new JsonResult(list);\r\n\t}", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"department\"})\n public void _2_2_1_getAllDept() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n c_1.getId().toString()+\n \"/departments\")\n .header(AUTHORIZATION,ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.departments\",hasSize(4)));\n }", "public void setDeptTable(Departments value);", "public final void setDepartmentId(final Integer dId) {\n this.departmentId = dId;\n }", "public void setDept_name(java.lang.String dept_name) {\r\n this.dept_name = dept_name;\r\n }", "public Integer getDepartmentId() {\n return departmentId;\n }", "public Integer getDepartmentId() {\n return departmentId;\n }", "public Integer getDepartmentId() {\n return departmentId;\n }" ]
[ "0.6727589", "0.6490208", "0.64714926", "0.6459321", "0.645874", "0.6434636", "0.63519245", "0.6228464", "0.6187688", "0.61390185", "0.61316043", "0.6102095", "0.6099086", "0.60701925", "0.606952", "0.60336924", "0.6026632", "0.6010603", "0.59394234", "0.59358037", "0.59328806", "0.58685166", "0.58685166", "0.58467126", "0.5846582", "0.58439404", "0.58399546", "0.5801211", "0.57958496", "0.57818455", "0.5779386", "0.5763845", "0.5763083", "0.5761779", "0.57339203", "0.5724738", "0.57004225", "0.57004225", "0.57004225", "0.56979287", "0.569387", "0.569387", "0.569387", "0.569387", "0.569387", "0.5666329", "0.5666329", "0.5666329", "0.5629864", "0.5629734", "0.55871207", "0.5575914", "0.5561176", "0.5551543", "0.5538841", "0.5523316", "0.5501492", "0.5486468", "0.5464574", "0.5455479", "0.5445967", "0.5443049", "0.54420394", "0.54420394", "0.54420394", "0.54160297", "0.54131997", "0.540716", "0.5405763", "0.5391827", "0.53875893", "0.53748846", "0.5366591", "0.53510106", "0.53432363", "0.5342017", "0.5339702", "0.5339101", "0.5335441", "0.5324442", "0.53239614", "0.53215104", "0.53201044", "0.5305687", "0.53039396", "0.5302109", "0.53018385", "0.52960414", "0.5279889", "0.5279889", "0.5279889", "0.52690136", "0.5267639", "0.5265853", "0.52616215", "0.52486324", "0.5241382", "0.52181816", "0.52174324", "0.52174324", "0.52174324" ]
0.0
-1
0 if positive, 1 if negative
public static int sign(int num) { return (num >> 31) & 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean isPositive();", "public boolean isPositive()\n\t{\n\t\treturn _bIsPositive;\n\t}", "private boolean isPositive() {\n return this._isPositive;\n }", "public static void main(String[] args){\n int num= 120;\n boolean positive = num>0;\n boolean negative = num <0;\n boolean zero = num ==0;\n\n\n System.out.println(num + \" is positive? \"+positive);\n System.out.println(num + \" is negative? \"+negative);\n System.out.println(num + \" is zero? \"+zero);\n\n\n\n }", "boolean isZero();", "public boolean isNegative();", "private double signum(double d) {\n if (d > 0) {\n return 1.0;\n }\n else if (d < 0) {\n return -1.0;\n }\n else {\n return 0.0;\n }\n }", "private int signBit() {\n return signum < 0 ? 1 : 0;\n }", "private int activate(float sum) {\r\n if (sum > 0) {\r\n return 1;\r\n } else {\r\n return -1;\r\n }\r\n }", "private int signInt() {\n return signum < 0 ? -1 : 0;\n }", "public boolean isPositive()\n {\n return Native.fpaIsNumeralPositive(getContext().nCtx(), getNativeObject());\n }", "public static final int sign(float x) {\n \t\treturn (x < 0f) ? -1 : 1;\n \t}", "public boolean isZero() {return false;}", "private int nn(int x)\n {\n return x > 0 ? 1 : 0;\n }", "public double abs(double value){return value < 0? value*-1: value;}", "public static int sign(double x) {\n\t // A true signum could be implemented in C++ as below.\n\t // template <typename T> int sgn(T val) {\n\t // return (T(0) < val) - (val < T(0));\n //}\n if (x >= 0)\n return 1;\n return -1;\n }", "public static int sign(boolean b) {\n if (b)\n return 1;\n return -1;\n }", "public static final int sign(int x) {\n \t\treturn (x < 0) ? -1 : 1;\n \t}", "public static final int sign(double x) {\n \t\treturn (x < 0d) ? -1 : 1;\n \t}", "public static int BIASED_ONE_OR_ZERO()\n\t{\n\t}", "protected int sign(@Const Vector3 v) {\n switch (dominantAxis) {\n case X:\n return (v.x >= 0.0 ? 1 : -1);\n case Y:\n return (v.y >= 0.0 ? 1 : -1);\n case Z:\n return (v.z >= 0.0 ? 1 : -1);\n default:\n return 0;\n }\n }", "String getZero_or_one();", "private int cal(int i)\r\n/* 52: */ {\r\n/* 53:50 */ if (i < 0) {\r\n/* 54:51 */ return -i;\r\n/* 55: */ }\r\n/* 56:53 */ return i;\r\n/* 57: */ }", "@Override\r\n\tpublic int operar() {\n\t\treturn 0;\r\n\t}", "private int getPositiveCount(){\n return m_PositiveCount;\n }", "public static final int sign(short x) {\n \t\treturn (x < 0) ? -1 : 1;\n \t}", "protected int getNegativeOnes() {\n Rating[] ratingArray = this.ratings;\n int negOneCount = 0;\n for(int i = 0; i < ratingArray.length; i++) {\n if(ratingArray[i] != null) {\n if(ratingArray[i].getScore() == -1) negOneCount++;\n }\n }\n return negOneCount;\n }", "public static final int sign(long x) {\n \t\treturn (x < 0) ? -1 : 1;\n \t}", "public static final int signum(double diff){\n\t if ( diff > 0 )\r\n\t {\r\n\t return 1;\r\n\t }\r\n\t if ( diff < 0 )\r\n\t {\r\n\t return -1;\r\n\t }\r\n\t else\r\n\t {\r\n\t return 1;\r\n\t }\r\n\t }", "boolean isNeg();", "@Override\r\n\tpublic double alapterulet() {\n\t\treturn 0;\r\n\t}", "protected boolean isPositive(Instance i) {\n TreeNode leaf = traverseTree(i);\n return leaf != null && leaf.isPositiveLeaf();\n }", "private void incrPositiveCount(){\n m_PositiveCount++;\n }", "protected final byte signOf(double f) {\n return f > 0 ? (byte) 1 : (f == 0 ? (byte) 0 : (byte) -1);\n }", "public void addTruePositive(long delta) {\n truePositive += delta;\n }", "private static void determineIsPositiveInt() {\n System.out.println(\"Enter a number:\");\r\n Scanner s = new Scanner(System.in);\r\n int i = Integer.parseInt(s.nextLine());\r\n if (i > 0)\r\n System.out.println(\"Positive i\");\r\n else if (i == 0)\r\n System.out.println(\"i=0\");\r\n else\r\n System.out.println(\"Negative i\");\r\n }", "public double hasNegSign(double value) {\n if (value < 0) {\n return value * -1;\n } else {\n return value;\n }\n }", "Float getStatus();", "@Override\n\tpublic double getWeight(double x) {\n\t\tif (-0.5 <= x && x < 0.5)\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n\t}", "public Binary negative(){\n\n Binary ret1= this.flip();\n Binary ret2= ret1.suma1();\n return ret2;\n }", "public void addTrueNegative(long delta) {\n trueNegative += delta;\n }", "public boolean isNegative() {\n return this.negative;\n }", "@Override\n public S isZero() {\n rule.addConstraint(new IsEqualAccordingToCompareToConstraint<>(zero()));\n return myself;\n }", "private void incrNegativeCount(){\n m_NegativeCount++;\n }", "@Test\n public void testSignum() {\n System.out.println(Integer.signum(50));\n\n // returns -1 as int value is less than 0\n System.out.println(Integer.signum(-50));\n\n // returns 0 as int value is equal to 0\n System.out.println(Integer.signum(0));\n }", "private void swapSign() {\n isPositive = !isPositive;\n }", "public boolean almostZero(double a);", "private double f(double x) {\r\n if(x<0){\r\n double x1 = x*-1;\r\n return interpretador.getResultado(\"!\"+x1);\r\n }\r\n return interpretador.getResultado(x);\r\n }", "@Test\n\tvoid testNegativeInteger() {\n\t\tint result = calculator.negativeInteger(-4,-3);\n\t\tassertEquals(-1,result);\n\t}", "public int abs(int val)\n {\n return val < 0 ? -1 * val: val;\n }", "@Override\n\tpublic boolean isSigned(int arg0) throws SQLException {\n\t\treturn false;\n\t}", "public static void main(String[] args) {\n\t\tint num=15;\r\n\t\tif(num>0)\r\n\t\t\tSystem.out.println(\"itspositive\");\r\n\t\telse if(num<0)\r\nSystem.out.println(\"its negative\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"zero\");\r\n\t}", "public int getTrueValue()\n {\n\t// Local constants\n\n\t// Local variables\n\n\t/************ Start getTrueValue Method ***************/\n\n // Return true value\n return trueValue;\n\n }", "private static boolean isPositive(int ID) {\n return ID > 0;\n }", "public static void determineIsPositiveFloat() {\n System.out.println(\"Enter a number:\");\r\n Scanner num = new Scanner(System.in);\r\n float i = Float.parseFloat(num.nextLine());\r\n float absI = Math.abs(i);\r\n if (i == 0)\r\n System.out.println(\"Number is zero\");\r\n else if ((i > 0) && (i < 1))\r\n System.out.println(\"Number is small positive\");\r\n else if ((i >= 1) && (i < 1000000))\r\n System.out.println(\"Number is positive\");\r\n else if (i >= 1000000)\r\n System.out.println(\"Number is large positive\");\r\n else if ((i < 0) && (absI < 1))\r\n System.out.println(\"Number is small negative\");\r\n else if ((absI >= 1) && (absI <= 1000000))\r\n System.out.println(\"Number is negative\");\r\n else\r\n System.out.println(\"Number is large negative\");\r\n }", "@Override\n public int compareTo(final Vector v) {\n return (int) Math.signum(abs() - v.abs());\n }", "public Scalar neg() {\n\t\treturn mul(new RealScalar(-1));\n\t}", "public void sign() {\n System.out.print(\"Enter an integer: \");\n int int1 = in.nextInt();\n\n if (int1 > 0) {\n System.out.println(\"\\nPositive.\\n\");\n } else if (int1 < 0) {\n System.out.println(\"\\nNegative.\\n\");\n } else {\n System.out.println(\"\\nZero.\\n\");\n }\n }", "private int abs(int input) {\n\t\tif (input < 0) {\n\t\t\tinput = input * (-1);\n\t\t}\n\t\treturn input;\n\t}", "default double signum() {\r\n\t\treturn signum(evaluate());\r\n\t}", "public int computeStatus() {\n\t\tif(isOutcomeExceeded()) return 0;\r\n\t\t\r\n\t\t//the new loan is too expensive\r\n\t\tif(isOutcomeExceeded(mMonthlyLoan)) return 0;\r\n\t\t\r\n\t\tint domainCoeff = DBOperations.getDomainCoeffById(mDomainId); // (0, 10] \r\n\t\tint expCoeff = DBOperations.getExperienceCoeffById(mExperienceId); // (0, 5]\r\n\t\t\r\n\t\tint backgroundCoeff = domainCoeff * expCoeff; // (0, 50]\r\n\t\tif(isIncomeRaising) backgroundCoeff *= 2; // (0, 100]\r\n\t\t\r\n\t\tint incomeCoeff = getIncomeWeight(mMonthlyIncome); // (0, 100]\r\n\t\t\r\n\t\tint coeff = (int) ((backgroundCoeff * 0.20) + (incomeCoeff * 0.55)); // (0, 75]\r\n\t\tif(mHadOtherLoans) coeff += 5; // (0, 80]\r\n\t\tif(mHasDelayedPays) coeff -= 10; // (0, 80]\r\n\t\t\r\n\t\tif((mMonthlyIncome - mMonthlyOutcome) * MAXIMUM_SURE_OUTCOME_PERCENTAGE / 100 >= mMonthlyLoan) {\r\n\t\t\tcoeff += 20; // (0, 100]\r\n\t\t}\r\n\t\t\r\n\t\tif(coeff <= 25) return 0;\r\n\t\treturn coeff < 55 ? 1 : 2;\r\n\t}", "public boolean posNeg(int a, int b, boolean negative) {\n if (negative){\n return(a < 0 && b < 0);\n }\n\n return((a < 0 && b >= 0) || (a >= 0 && b < 0));\n}", "private static int calcReturn(int x) {\n if ( x < 0 )\n return Expr.CMP_LESS ;\n if ( x > 0 )\n return Expr.CMP_GREATER ;\n return Expr.CMP_EQUAL ;\n }", "public static float abs(float input){\n\t\tif(input < 0){\n\t\t\treturn -1 * input;\n\t\t}\n\t\treturn input;\n\t}", "public boolean getZeroFlag() {\n // PROGRAM 1: Student must complete this method\n // return value is a placeholder, student should replace with correct return\n int zero = 0; //integer to keep track of how many '1's are in the output array\n for (int i = 0; i < output.length; i++) {\n if (output[i]) { //when we come across a 1, add 1 to the zero integer.\n zero += 1;\n }\n }\n if (zero > 0) { //if the method caught any '1's, then the output binary number is not 0.\n zeroFlag = false;\n } else {\n zeroFlag = true; //otherwise, it is\n }\n return zeroFlag; //return the zeroFlag\n }", "public void addFalsePositive(long delta) {\n falsePositive += delta;\n }", "@Override\r\n\tpublic int calculax2p(int score, boolean zerou) {\r\n\t\tif(score > getMaiorScore()) {\r\n\t\t\treturn score / 1000;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "public double getPosReal() {\n\t return (real < 0) ? -real : real;\n\t}", "public boolean isNegative()\n {\n return Native.fpaIsNumeralNegative(getContext().nCtx(), getNativeObject());\n }", "private int getNegativeCount(){\n return m_NegativeCount;\n }", "boolean incLowValue() { return true; }", "public boolean isZero() {\n\t\treturn ((get() >> 7) & 1) == 1;\n\t}", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n System.out.println(\"Enter a number:\");\n int number = input.nextInt();\n\n //WRITE YOUR CODE HERE:\n String result = (number > 0) ? number + \" is positive\" : (number < 0) ? number + \" is negative\" : \"it is zero\";\n System.out.println (result);\n\n\n\n }", "private int abs(int i) {\n\t\tif(i<0)\n\t\t\ti *= -1;\n\n\t\treturn i;\n\t}", "private int abs(int i) {\n\t\tif(i<0) i=-i;\n\t\treturn i;\n\t}", "public boolean get_exponent_sign();", "public int resta(){\r\n return x-y;\r\n }", "public static void main(String[] args) {\n\t\tint i = -10;\r\n\t\tif (i < 0) {\r\n\t\t\tSystem.out.println(\"Positive of \" + i + \" is \" + (-i));\r\n\t\t} else {\r\n\t\t\tSystem.out.println(i + \" is Positive Number only\");\r\n\t\t}\r\n\t}", "@Override\n\tpublic double bonus() {\n\t\treturn 0;\n\t}", "public double threshold(double z) {\n\t\t// This must be implemented by you\n\t\tif(z>=0) {\n\t\t\treturn 1;\n\t\t}else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public double calculateAccuracy() {\n final long divisor = truePositive + trueNegative + falsePositive + falseNegative;\n if(divisor == 0) {\n return 0.0;\n } else {\n return (truePositive + trueNegative) / (double)divisor;\n }\n }", "public int xIncriment(){\n\t\tswitch (direction){\n\t\t\tcase NORTH: \n\t\t\t\treturn 0;\n\t\t\tcase NORTHEAST:\n\t\t\t\treturn 1;\n\t\t\tcase EAST:\n\t\t\t\treturn 1;\n\t\t\tcase SOUTHEAST:\n\t\t\t\treturn 1;\n\t\t\tcase SOUTH:\n\t\t\t\treturn 0;\n\t\t\tcase SOUTHWEST:\n\t\t\t\treturn -1;\n\t\t\tcase WEST:\n\t\t\t\treturn -1;\n\t\t\tdefault: //NORTHWEST\n\t\t\t\treturn -1;\n\t\t}\n\t}", "@Override\r\n\tpublic double getY1() {\n\t\treturn 0;\r\n\t}", "public boolean isZero()\r\n\t{\r\n\t\tif(this.get_coefficient()==0)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static final int signum(long value) { \n\t\tif (value > 0) return 1; \n\t\tif (value < 0) return -1 ; \n\t\telse return 0; \n\t}", "default A isZero() {\n return satisfiesNumberCondition(new NumberCondition<>(0, EQUAL_TO));\n }", "public int compareTo(Valuable p){\n\treturn (int)Math.signum(this.value-p.getValue());\n}", "public boolean growsNegative();", "public static int abs(int a) {\n if(a < 0){\n return -a;\n } else {\n return a;\n }\n }", "@Override\n\tpublic double operation(int xValue, int yValue) {\n\t\treturn -1;\n\t}", "public static int abs(int a) {\n\t\treturn ((a<0)?-a:a);\n\t}", "@Override\n\tpublic double perimetro() {\n\t\treturn 0;\n\t}", "public int baseZeroValue() {\n return this.value - 1;\n }", "public boolean isNegative()\n\t{\n\t\t// TO DO\n\t\treturn isNeg;\n\t}", "@Override\r\n\tprotected Integer zero() {\n\t\treturn 0;\r\n\t}", "private void scaleToPositive() {\r\n // Obtain min value\r\n double minScalarization = Double.MAX_VALUE;\r\n for (S solution : solutions()) {\r\n if (scalarization.getAttribute(solution) < minScalarization) {\r\n minScalarization = scalarization.getAttribute(solution);\r\n }\r\n }\r\n if (minScalarization < 0) {\r\n // Avoid scalarization values of 0\r\n double eps = 10e-6;\r\n for (S solution : solutions()) {\r\n scalarization.setAttribute(solution, eps + scalarization.getAttribute(solution) + minScalarization);\r\n }\r\n }\r\n }", "public double threshold(double z) {\n\t\tif(z>=0) {\n\t\t\treturn 1;\n\t\t}else {\n\t\t\treturn 0;\n\t\t}\n\t}", "@Override\r\n\tprotected Integer deriveLower() {\r\n\t return 0;\r\n\t}", "public double inhoud() {\n return 0.0;\n }", "public int storrelse();", "public static double sigmFunc(double a){\n if (a > 0){\n return 1;\n } else return 0;\n }" ]
[ "0.7108732", "0.6691979", "0.6646622", "0.65794396", "0.6564112", "0.6458411", "0.6441478", "0.6430603", "0.64095336", "0.638986", "0.63409287", "0.63044924", "0.62545633", "0.62322724", "0.62196434", "0.62151474", "0.6170733", "0.61653185", "0.6156554", "0.60787874", "0.6051198", "0.5968863", "0.5966184", "0.5949467", "0.59196335", "0.59062207", "0.5847423", "0.5837205", "0.5822759", "0.5812433", "0.5801956", "0.5782561", "0.57800937", "0.5779029", "0.57306725", "0.5697591", "0.56905174", "0.5682561", "0.56811446", "0.5678796", "0.56615907", "0.56546575", "0.56502527", "0.56410444", "0.5618188", "0.56096494", "0.5604105", "0.55969447", "0.5593806", "0.5593513", "0.5589045", "0.5588847", "0.5575391", "0.557218", "0.5570552", "0.55692714", "0.55674934", "0.55648273", "0.5559281", "0.55560625", "0.55477804", "0.55373687", "0.5531674", "0.55305445", "0.5530269", "0.5527983", "0.55161124", "0.5510848", "0.5508958", "0.5492155", "0.5488515", "0.5485466", "0.5482792", "0.5482764", "0.5461849", "0.5454054", "0.5451975", "0.5451863", "0.5443782", "0.5442576", "0.5429832", "0.5428092", "0.5427909", "0.5425774", "0.54221237", "0.5420725", "0.5404676", "0.54030895", "0.54005146", "0.540035", "0.5388977", "0.5388392", "0.5386107", "0.53842443", "0.5379169", "0.5372529", "0.53679514", "0.5364452", "0.5359627", "0.53455186", "0.5335009" ]
0.0
-1
add and edge to a node
public void addEdge(Edge e){ adjacentEdges.add(e); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addEdge(Node from, Node to);", "void addEdge(int x, int y);", "void add(Edge edge);", "public abstract boolean addEdge(Node node1, Node node2, int weight);", "void addEdge(int source, int destination, int weight);", "public void addEdge(int start, int end);", "boolean addEdge(E edge);", "public void addEdge(E e){\n\t\tedges.add(e);\n\t}", "public void addEdge(int start, int end, double weight);", "public abstract void addEdge(Point p, Direction dir);", "void addEdge(Edge e) {\n if (e.getTail().equals(this)) {\n outEdges.put(e.getHead(), e);\n\n return;\n } else if (e.getHead().equals(this)) {\n indegree++;\n inEdges.put(e.getTail(), e);\n\n return;\n }\n\n throw new RuntimeException(\"Cannot add edge that is unrelated to current node.\");\n }", "public void addEdge(Edge e){\n\t\tedges.put(e.hashCode(), e);\n\t\te.getHead().addConnection(e);\n\t\te.getTail().addConnection(e);\n\t}", "public void addEdge(String node1, String node2) {\n\r\n LinkedHashSet<String> adjacent = map.get(node1);\r\n// checking to see if adjacent node exist or otherwise is null \r\n if (adjacent == null) {\r\n adjacent = new LinkedHashSet<String>();\r\n map.put(node1, adjacent);\r\n }\r\n adjacent.add(node2); // if exist we add the instance node to adjacency list\r\n }", "public void addEdge(edge_type edge) {\n //first make sure the from and to nodes exist within the graph\n assert (edge.getFrom() < nextNodeIndex) && (edge.getTo() < nextNodeIndex) :\n \"<SparseGraph::AddEdge>: invalid node index\";\n\n //make sure both nodes are active before adding the edge\n if ((nodeVector.get(edge.getTo()).getIndex() != invalid_node_index)\n && (nodeVector.get(edge.getFrom()).getIndex() != invalid_node_index)) {\n //add the edge, first making sure it is unique\n if (isEdgeNew(edge.getFrom(), edge.getTo())) {\n edgeListVector.get(edge.getFrom()).add(edge);\n }\n\n //if the graph is undirected we must add another connection in the opposite\n //direction\n if (!isDirectedGraph) {\n //check to make sure the edge is unique before adding\n if (isEdgeNew(edge.getTo(), edge.getFrom())) {\n GraphEdge reversedEdge = new GraphEdge(edge.getTo(),edge.getFrom(),edge.getCost());\n edgeListVector.get(edge.getTo()).add(reversedEdge);\n }\n }\n }\n }", "public void addEdge(){\n Node[] newAdjacent = new Node[adjacent.length + 1];\n for (int i = 0; i < adjacent.length; i++) {\n newAdjacent[i] = adjacent[i];\n }\n adjacent = newAdjacent;\n }", "private void addNode(NeuralNode node) {\r\n\t\tinnerNodes.add(node);\r\n\t}", "int addEdge(int tail, int head);", "public void addEdge(Integer id, UNode n1, UNode n2, String edge)\r\n {\r\n UEdge e = new UEdge(id, n1, n2, edge);\r\n n1.addOutEdge(e);\r\n n2.addInEdge(e);\r\n uEdges.put (id, e);\r\n }", "public void addEdge(FlowEdge e){\n int v = e.getFrom();\n int w = e.getTo();\n adj[v].add(e); //add forward edge\n adj[w].add(e); //add backward edge\n }", "public void addEdge(N startNode, N endNode, E label)\r\n/* 43: */ {\r\n/* 44: 89 */ assert (checkRep());\r\n/* 45: 90 */ if (!contains(startNode)) {\r\n/* 46: 90 */ addNode(startNode);\r\n/* 47: */ }\r\n/* 48: 91 */ if (!contains(endNode)) {\r\n/* 49: 91 */ addNode(endNode);\r\n/* 50: */ }\r\n/* 51: 92 */ ((Map)this.map.get(startNode)).put(endNode, label);\r\n/* 52: 93 */ ((Map)this.map.get(endNode)).put(startNode, label);\r\n/* 53: */ }", "public Edge<V> addEdge(V source, V target);", "void addEdge(Edge e) {\n\t\t\tif(!_edges.containsKey(e.makeKey())) {\n\t\t\t\t_edges.put(e.makeKey(),e);\n\t\t\t\te._one.addNeighborEdge(e);\n\t\t\t\te._two.addNeighborEdge(e);\n\t\t\t}\n\t\t}", "public boolean addEdge(T begin, T end, int weight);", "public void addNode(Node node){subNodes.add(node);}", "public void addEdge(Edge e)\r\n\t{\n\t\tint v = e.either(), w = e.other(v);\r\n\t\tadj[v].add(e);\r\n\t\tadj[w].add(e);\r\n\t}", "private void addEdge(int from, int to, Edge e) {\n _edges.get(from).set(to, e);\n _edgeMap.put(e, new int [] {from, to});\n }", "void addEdge(int x,int y) {\n adj[x].add(y);\n }", "public E addEdge(V tail, V head);", "public void addEdge(Edge e){\n edgeList.add(e);\n }", "boolean addEdge(V v, V w);", "public void addEdge(DirectedEdge e) \n {\n int v = e.from();\n adj[v].add(e);\n E++;\n }", "public void addNode(NodeImpl node) {\n supervisedNodes.add(node);\n \n colorNodes();\n shortenNodeLabels();\n colorNodeLabels();\n colorNodeLabelBorders();\n }", "void addEdge(Edge e) {\n edges.add(e);\n addVerticle(e.v1);\n addVerticle(e.v2);\n }", "public void addEdge(Edge e) {\n int v = e.either();\n int w = e.other(v);\n adj[v].add(e);\n adj[w].add(e);\n E++;\n }", "public abstract boolean putEdge(Edge incomingEdge);", "public void addEdge(Edge edge){\n \n synchronized(vertexes){\n Long start = edge.getStart();\n Vertex sVertex = vertexes.get(start);\n if(sVertex != null){\n sVertex.addEdge(edge, true);\n }\n// if undirected graph then adds edge to the finish vertex too \n if(!edge.isDirected()){\n Long finish = edge.getFinish();\n Vertex fVertex = vertexes.get(finish);\n if(fVertex != null){\n fVertex.addEdge(edge, false);\n }\n }\n }\n \n }", "public boolean addEdge(T beg, T end);", "public void addEdge(int u, int v, double w) {\n\t\t\n\t}", "void addNode(int node);", "void addEdge(int from, int to) {\n\t\tadjList.get(from).add(to);\n\t}", "protected void addEdge(CyEdge edge, LayoutNode v1, LayoutNode v2) {\n\tLayoutEdge newEdge = new LayoutEdge(edge, v1, v2);\n\tupdateWeights(newEdge);\n\tedgeList.add(newEdge);\n }", "public IEdge addEdge(String from, String to, Double cost);", "public void treeEdge(Edge e) {}", "private void addNode(DLinkedNode node){\n node.pre = head;\n node.post = head.post;\n\n head.post.pre = node;\n head.post = node;\n }", "public void nodeAdded(GraphEvent e);", "void addEdge(JNode edge) {\n List<JNode> newEdges = this.getEdges();\n newEdges.add(edge);\n this.setEdges(newEdges);\n }", "void addEdge(Vertex v1, Vertex v2, Double w) throws VertexNotInGraphException;", "public void add(Node<T> n){\n\t\tconnect.add(n);\n\t}", "public void addEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge = new Edge(v1, v2, edgeInfo);\n if(adjLists[v1].contains(edge)){\n return;\n }\n adjLists[v1].addLast(edge);\n }", "private void addNode(DLinkedNode node) {\n\t\t\tnode.pre = head;\n\t\t\tnode.post = head.post;\n\n\t\t\thead.post.pre = node;\n\t\t\thead.post = node;\n\t\t}", "public void addNode() {\r\n \r\n Nod nod = new Nod(capacitate_noduri);\r\n numar_noduri++;\r\n noduri.add(nod);\r\n }", "public void addVertex();", "public void addEdge(int v1, int v2) {\r\n addEdge(v1, v2, null);\r\n }", "boolean addEdge(V v, V w, double weight);", "void addEdgeTo(char v, int e) {\r\n\t\t// does an edge to v already exist?\r\n\t\tfor (int i = 0; i < currentVertex.outList.size(); i++) {\r\n\t\t\tNeighbor neighbor = currentVertex.outList.get(i);\r\n\t\t\tif (neighbor.vertex.label == v) {\r\n\t\t\t\tneighbor.edge = e;\r\n\t\t\t\tfindNeighbor(findVertex(v).inList, currentVertex.label).edge = e;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// add to current's inList\r\n\t\tNeighbor newNeighbor = new Neighbor(findVertex(v), e);\r\n\t\tcurrentVertex.outList.add(newNeighbor);\r\n\r\n\t\t// add to neighbor's outList\r\n\t\tNeighbor current = new Neighbor(currentVertex, e);\r\n\t\tnewNeighbor.vertex.inList.add(current);\r\n\r\n\t\tedges++;\r\n\t}", "void addNode(String node);", "public void addEdge(StubEdge e) {\n }", "public Node appendNode(Node node);", "public void addEdge(int v1, int v2) {\n addEdge(v1, v2, null);\n }", "public void addEdge(int v1, int v2) {\n addEdge(v1, v2, null);\n }", "public void addEdge(int u, int v) {\n if (u > nodes.size() || v > nodes.size() || u <= 0 || v <= 0) {\n throw new IllegalArgumentException(\"An invalid node was given\");\n }\n // note that we have to subtract 1 from each since node 1 is located in index 0\n nodes.get(u - 1).addEdge(nodes.get(v - 1));\n }", "private void addEdge() {\n childMatrix[randomParent][childMatrix[randomParent][0]] = randomChild;\n childMatrix[randomParent][0]++;\n parentMatrix[randomChild][parentMatrix[randomChild][0]] = randomParent;\n parentMatrix[randomChild][0]++;\n }", "private void addNode(Node node)\n\t{\n\t\tif (node == null)\n\t\t\treturn;\n\t\tthis.nodes[node.getRowIndex()][node.getColumnIndex()] = node;\n\t}", "void addDirectedEdge(final Node first, final Node second)\n {\n if ( first == second )\n {\n return;\n }\n else if (first.connectedNodes.contains(second))\n return;\n else\n first.connectedNodes.add(second);\n }", "@Override\n\tpublic void addNode(node_data n) {\n\t\tif (Nodes.keySet().contains(n.getKey())) {\n\t\t\tSystem.err.println(\"Err: key already exists, add fail\");\n\t\t\treturn;\n\t\t}\n\t\tif(n.getWeight()<=0)\n\t\t{\n\t\t\tSystem.err.println(\"The weight must be positive! . The node hadn't been added successfully..\");\n\t\t\treturn;\n\t\t}\n\t\tthis.Nodes.put(n.getKey(), n);//n used to be casted into (node)\n\t\tthis.Edges.put(n.getKey(), new HashMap<Integer,edge_data>());\n\t\tMC++;\n\n\t}", "public void addEdge(int v1, int v2) {\n\t\tedges[v1][v2] = 1;\n\t\tedges[v2][v1] = 1;\n\t\tsize++;\n\t}", "public void addEdge(Character sourceId, Character destinationId) {\n Node sourceNode = getNode(sourceId);\n Node destinationNode = getNode(destinationId);\n sourceNode.adjacent.add(destinationNode);\n }", "void addEdge(String origin, String destination, double weight){\n\t\tadjlist.get(origin).addEdge(adjlist.get(destination), weight);\n\t\tedges++;\n\t}", "@Override\n\tpublic boolean addNode(N node)\n\t{\n\t\tif (node == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (nodeEdgeMap.containsKey(node))\n\t\t{\n\t\t\t// Node already in this Graph\n\t\t\treturn false;\n\t\t}\n\t\tnodeList.add(node);\n\t\tnodeEdgeMap.put(node, new HashSet<ET>());\n\t\tgcs.fireGraphNodeChangeEvent(node, NodeChangeEvent.NODE_ADDED);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean addEdge(ET edge)\n\t{\n\t\tif (edge == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (edgeList.contains(edge))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tList<N> graphNodes = edge.getAdjacentNodes();\n\t\tfor (N node : graphNodes)\n\t\t{\n\t\t\taddNode(node);\n\t\t\tnodeEdgeMap.get(node).add(edge);\n\t\t}\n\t\tedgeList.add(edge);\n\t\tgcs.fireGraphEdgeChangeEvent(edge, EdgeChangeEvent.EDGE_ADDED);\n\t\treturn true;\n\t}", "public void addEdge(String n1, String n2) {\n if (!this.graph.containsKey(n1)) {\n addNode(n1);\n }\n if (!this.graph.containsKey(n2)) {\n addNode(n2);\n }\n Edgeq edge = new Edgeq(n1, n2);\n this.graph.get(n1).add(edge);\n\n edge = new Edgeq(n2, n1);\n this.graph.get(n2).add(edge);\n }", "public void addNode(final Instruction instruction) {\n instructions.add(instruction);\n if (prevInstruction != null) {\n addEdge(prevInstruction, instruction);\n }\n prevInstruction = instruction;\n }", "void addFlight(Node toNode);", "public void addNode(GraphNode<T> node) {\n\tmRoot.addNode(node);\n\tmNodesCount++;\n }", "public void addTwoWayVertex(String node1, String node2) {\r\n addEdge(node1, node2);\r\n addEdge(node2, node1);\r\n }", "protected void addNode (Node node, int index)\n {\n Node currentNode = adjacencySequences[index];\n if (currentNode == null)\n adjacencySequences[index] = node;\n else\n {\n Node previousNode = null;\n while (currentNode != null && currentNode.edgeWeight < node.edgeWeight)\n {\n previousNode = currentNode;\n currentNode = currentNode.nextNode;\n }\n\n if (previousNode == null)\n adjacencySequences[index] = node;\n else\n previousNode.nextNode = node;\n \n node.nextNode = currentNode;\n }\n }", "void addEdge(int vertex1, int vertex2){\n adjList[vertex1].add(vertex2);\n adjList[vertex2].add(vertex1);\n }", "public void addEdge (E vertex1, E vertex2, int edgeWeight) throws IllegalArgumentException\n {\n if(vertex1 == vertex2)\n return;\n \n int index1 = this.indexOf (vertex1);\n if (index1 < 0)\n throw new IllegalArgumentException (vertex1 + \" was not found!\");\n \n int index2 = this.indexOf (vertex2);\n if (index2 < 0)\n throw new IllegalArgumentException (vertex2 + \" was not found!\");\n\n\n if (this.hasEdge (vertex1, vertex2))\n {\n this.removeNode (index1, index2);\n this.removeNode (index2, index1);\n }\n \n Node node = new Node(index2, edgeWeight);\n this.addNode(node, index1);\n node = new Node(index1, edgeWeight);\n this.addNode(node, index2);\n }", "@Override\n public void addEdge(V source, V destination, double weight)\n {\n super.addEdge(source, destination, weight);\n super.addEdge(destination, source, weight);\n }", "public void addEdge(Edge e) {\r\n int v = e.from();\r\n int w = e.to();\r\n validateVertex(v);\r\n validateVertex(w);\r\n adj[v].add(e);\r\n indegree[w]++;\r\n E++;\r\n }", "void addNeighborEdge(Edge e) {\n\t\t\t_neighborEdges.put(e,false);\n\t\t}", "public void addEdge(Edge e) {\n incident.add(e);\n }", "void addEdge(Vertex u, Vertex v) {\r\n\t\tu.addNeighbor(v);\r\n\t}", "void addEdge(int a, int b) {\n Edge e = new Edge(V[a], V[b]);\n V[a].Adj.add(e);\n V[b].Adj.add(e);\n }", "public void addEdge(int source, int target, Cost w) {\n\t\tedges[source][target] = w;\n\t}", "private void addEdgeWithInst(NasmInst source, NasmInst destination) {\n if (source == null || destination == null)\n throw new FgException(\"ERROR: Can't create an edge without a source and a destination\");\n Node from = inst2Node.get(source);\n Node to = inst2Node.get(destination);\n if (from == null || to == null)\n throw new FgException(\"ERROR: No nodes matching with given Source or destination \");\n graph.addEdge(from, to);\n }", "void addEdge(int s1,int c,int s2)\r\n\t{\r\n\t\tg[s1][c][s2]=true;\r\n\t}", "void addNode(Node n) {\n nodes.put(n.id, n);\n }", "public void addEdge(Node src, Node dest, int cost){\n if(nodes.containsKey(src) && nodes.containsKey(dest)){\n Edge newEdge = new Edge(src, dest, cost);\n nodes.get(src).add(dest);\n src.addNodeEdge(newEdge);\n\n Edge otherEdge = new Edge(dest, src, cost);\n nodes.get(dest).add(src);\n dest.addNodeEdge(otherEdge);\n\n\n }\n\n }", "public boolean addEdge(String id1, String id2, Integer weight)\n\t{\n\t\t// if its a new edge, or a new edge weight\n\t\tif (!hasEdge(id1, id2) || (weight != null && edgeWeight(id1, id2) == null))\n\t\t{\n\t\t\tNode n1 = getNode(id1);\n\t\t\tNode n2 = getNode(id2);\n\t\t\tn1.addEdge(n2, weight);\n\t\t\tn2.addEdge(n1, weight);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void addNode(Character charId, Node node) {\n graph.put(charId, node);\n }", "public void addEdge(Node n1, Node n2, int weight) {\n\t\tthis.edges.add(new Edge(n1, n2, weight));\n\t\tadjacencyList.get(n1.getIdNode()).add(new NodePair(n2.getIdNode(), weight));\n\n\n\t\tnrOfEdges++;\n\t}", "EdgeNode(VertexNode correspondingVertex){\n setCorrespondingVertex(correspondingVertex);\n }", "public void addEdge(int v1, int v2) {\r\n\t\tadjList[v1].add(v2);\r\n\t}", "private void addEdge(int start, int end) {\n adjMatrix[start][end] = 1;\n // for undirected graph\n adjMatrix[end][start] = 1;\n }", "public Node(Edge edge) {\n this.edge = edge;\n }", "@Test\n\tpublic void addEdgeTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tassertTrue(graph.addEdge(edge_0));\n\t\tassertFalse(graph.addEdge(edge_0));\n\t}", "public boolean addEdge(Edge e) {\n return g.addNode(e.getSrc())&&g.addNode(e.getDst())&&g.addEdge(e.getSrc(),e.getDst());\n }", "private Edge addEdge(Node source, Node dest, double weight)\r\n\t{\r\n\t final Edge newEdge = new Edge(edgeType, source, dest, weight);\r\n\t if (!eSet.add(newEdge))\r\n\t\tthrow new RuntimeException(\"Edge already exists!\");\r\n\t source.addEdge(newEdge);\n\t return newEdge;\r\n\t}", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge1 = new Edge(v1, v2, edgeInfo);\n Edge edge2 = new Edge(v2, v1, edgeInfo);\n if(!adjLists[v1].contains(edge1)){\n adjLists[v1].addLast(edge1);\n }\n if(!adjLists[v2].contains(edge2)){\n adjLists[v2].addLast(edge2);\n }\n }" ]
[ "0.8026272", "0.77887315", "0.77788883", "0.769147", "0.754985", "0.7339072", "0.73152703", "0.7214416", "0.7201552", "0.71232665", "0.70859736", "0.7084505", "0.7031816", "0.70316666", "0.70315915", "0.7025291", "0.7024754", "0.69921863", "0.69831586", "0.6980278", "0.6959056", "0.6944743", "0.6937094", "0.6929115", "0.6895054", "0.68627065", "0.6858678", "0.68526095", "0.68440217", "0.68197864", "0.67961806", "0.6788512", "0.67713195", "0.67605174", "0.6754359", "0.67436403", "0.6732337", "0.672781", "0.6725606", "0.6719089", "0.6711501", "0.67098117", "0.6708735", "0.6691258", "0.66795737", "0.6672994", "0.6667585", "0.6664393", "0.6662916", "0.6660082", "0.6630121", "0.6622151", "0.66208595", "0.6605936", "0.66008395", "0.6576988", "0.6571922", "0.65635085", "0.6563274", "0.6563274", "0.6556634", "0.6554873", "0.65511566", "0.6543627", "0.6541412", "0.6534212", "0.65181637", "0.65171593", "0.6517029", "0.651454", "0.65038645", "0.6502208", "0.65016323", "0.65014935", "0.64743954", "0.64732444", "0.6469604", "0.64652634", "0.64633286", "0.6459006", "0.64503235", "0.644756", "0.6444751", "0.6441348", "0.6435248", "0.64324206", "0.6430239", "0.64172435", "0.64149797", "0.64097285", "0.64092374", "0.6409094", "0.6406881", "0.6406729", "0.64066875", "0.6405732", "0.6403768", "0.6400499", "0.639629", "0.6392703" ]
0.6962796
20
add a list of nodes as edges to a given node
public void addAllEdges(ArrayList<Node> nList, ArrayList<Obstacle> oList) { for (int i = 0; i < nList.size(); i++) { Node node = nList.get(i); double w = node.vertex.distanceTo(this.vertex); Edge e = new Edge(w, node); if (!e.intersectObstacleHuh(oList, this) && !(w == 0.0)){ //if this edge does not intersect any obstacles in give map, add //as a visible edge to node this.addEdge(e); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addEdge(Node from, Node to);", "public void addEdge(int start, int end);", "public void addEdge(){\n Node[] newAdjacent = new Node[adjacent.length + 1];\n for (int i = 0; i < adjacent.length; i++) {\n newAdjacent[i] = adjacent[i];\n }\n adjacent = newAdjacent;\n }", "public void addEdge(int start, int end, double weight);", "void addEdges(Collection<ExpLineageEdge> edges);", "void addEdge(int source, int destination, int weight);", "void addEdge(int from, int to) {\n\t\tadjList.get(from).add(to);\n\t}", "public void addEdge(List<List<Integer>> graph, int from, int to) {\r\n graph.get(from).add(to);\r\n graph.get(to).add(from);\r\n }", "void addEdge(int x, int y);", "public void addEdge(E e){\n\t\tedges.add(e);\n\t}", "void addNodes(List<CyNode> nodes);", "public abstract boolean addEdge(Node node1, Node node2, int weight);", "public static void addEdge(List<List<Integer>> graph, int from, int to) {\n\t graph.get(from).add(to);\n\t graph.get(to).add(from);\n\t }", "public static void addEdge(List<List<Integer>> graph, int from, int to) {\n graph.get(from).add(to);\n }", "public void addEdge(Edge e){\n edgeList.add(e);\n }", "int addEdge(int tail, int head);", "void addEdge(int vertex1, int vertex2){\n adjList[vertex1].add(vertex2);\n adjList[vertex2].add(vertex1);\n }", "public void addEdge(Edge e){\n\t\tadjacentEdges.add(e);\n\t}", "public void addEdge(String node1, String node2) {\n\r\n LinkedHashSet<String> adjacent = map.get(node1);\r\n// checking to see if adjacent node exist or otherwise is null \r\n if (adjacent == null) {\r\n adjacent = new LinkedHashSet<String>();\r\n map.put(node1, adjacent);\r\n }\r\n adjacent.add(node2); // if exist we add the instance node to adjacency list\r\n }", "void add(Edge edge);", "private void addLinkesToGraph()\n\t{\n\t\tString from,to;\n\t\tshort sourcePort,destPort;\n\t\tMap<Long, Set<Link>> mapswitch= linkDiscover.getSwitchLinks();\n\n\t\tfor(Long switchId:mapswitch.keySet())\n\t\t{\n\t\t\tfor(Link l: mapswitch.get(switchId))\n\t\t\t{\n\t\t\t\tfrom = Long.toString(l.getSrc());\n\t\t\t\tto = Long.toString(l.getDst());\n\t\t\t\tsourcePort = l.getSrcPort();\n\t\t\t\tdestPort = l.getDstPort();\n\t\t\t\tm_graph.addEdge(from, to, Capacity ,sourcePort,destPort);\n\t\t\t} \n\t\t}\n\t\tSystem.out.println(m_graph);\n\t}", "public void addEdge(N startNode, N endNode, E label)\r\n/* 43: */ {\r\n/* 44: 89 */ assert (checkRep());\r\n/* 45: 90 */ if (!contains(startNode)) {\r\n/* 46: 90 */ addNode(startNode);\r\n/* 47: */ }\r\n/* 48: 91 */ if (!contains(endNode)) {\r\n/* 49: 91 */ addNode(endNode);\r\n/* 50: */ }\r\n/* 51: 92 */ ((Map)this.map.get(startNode)).put(endNode, label);\r\n/* 52: 93 */ ((Map)this.map.get(endNode)).put(startNode, label);\r\n/* 53: */ }", "private static void addAllEdgeInstances (Graph graph, boolean isDirected){\n Collection<Node> noteSet = graph.getNodeSet();\n\n for (Iterator<Node> iterator = noteSet.iterator(); iterator.hasNext();) {\n Node startNode = (Node) iterator.next();\n\n for (Iterator<Node> iterator2 = noteSet.iterator(); iterator2.hasNext();) {\n Node endNode = (Node) iterator2.next();\n\n if (!(startNode == endNode)){\n graph.addEdge(startNode.toString().concat(endNode.toString()), startNode, endNode, isDirected);\n }\n\n }\n }\n }", "public boolean addEdge(T begin, T end, int weight);", "public E addEdge(V tail, V head);", "private void addEdge(int from, int to, Edge e) {\n _edges.get(from).set(to, e);\n _edgeMap.put(e, new int [] {from, to});\n }", "public void addEdge(FlowEdge e){\n int v = e.getFrom();\n int w = e.getTo();\n adj[v].add(e); //add forward edge\n adj[w].add(e); //add backward edge\n }", "public void addEdges(Edge value)\r\n\t{\r\n\t\tedges.add(value);\r\n\t}", "public Edge<V> addEdge(V source, V target);", "private void addEdge(int start, int end) {\n adjMatrix[start][end] = 1;\n // for undirected graph\n adjMatrix[end][start] = 1;\n }", "public IEdge addEdge(String from, String to, Double cost);", "private Graph<Node, DefaultEdge> addEdges(Graph<Node, DefaultEdge> g) {\n List<Edge> edges = edgeRepository.findAll();\n edges.forEach(e -> g.addEdge(new Node(e.getA()), new Node(e.getB())));\n return g;\n }", "void addEdge(Edge e) {\n edges.add(e);\n addVerticle(e.v1);\n addVerticle(e.v2);\n }", "public void addNode(Node node){subNodes.add(node);}", "public void addEdge(DirectedEdge e) \n {\n int v = e.from();\n adj[v].add(e);\n E++;\n }", "public void addEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge = new Edge(v1, v2, edgeInfo);\n if(adjLists[v1].contains(edge)){\n return;\n }\n adjLists[v1].addLast(edge);\n }", "public void addEdge(Node n1, Node n2, int weight) {\n\t\tthis.edges.add(new Edge(n1, n2, weight));\n\t\tadjacencyList.get(n1.getIdNode()).add(new NodePair(n2.getIdNode(), weight));\n\n\n\t\tnrOfEdges++;\n\t}", "void addEdge(Edge e) {\n if (e.getTail().equals(this)) {\n outEdges.put(e.getHead(), e);\n\n return;\n } else if (e.getHead().equals(this)) {\n indegree++;\n inEdges.put(e.getTail(), e);\n\n return;\n }\n\n throw new RuntimeException(\"Cannot add edge that is unrelated to current node.\");\n }", "public void insertEdges(Edge[] E){\n\t\tthis.edges = E;\n\t\tthis.nodesLength = nodesLength(E);\n\t\tthis.nodes = new Node[(int)this.nodesLength];\n\t\tfor (long n = 0; n < this.nodesLength; n++) {\n\t\t\tthis.nodes[(int)n] = new Node(n);\n\t\t}\n\t\tthis.edgesLength = E.length;\n\t\t\n\t\t\n\t\tfor (long edgeToAdd = 0; edgeToAdd < this.edgesLength; edgeToAdd++) {\n\t\t\tthis.nodes[(int)E[(int)edgeToAdd].getFrom()].getEdges().add(E[(int)edgeToAdd]);\n\t\t\tthis.nodes[(int)E[(int)edgeToAdd].getTo()].getEdges().add(E[(int)edgeToAdd]);\n\t\t}\n\t\t\n\t}", "public Edge addEdge(Id nodeAIn, Id nodeBIn){//adds an edge to the list\n\t\tint i;\n\t\tEdge e = null;\n\t\tfor(i = 0; i < listOfEdges.size(); i++){\n\t\t\te = listOfEdges.get(i);\n\t\t\tif(e==null) continue;\n\t\t\tif((nodeAIn.compare(e.getNodeA()) && nodeBIn.compare(e.getNodeB())) || (nodeBIn.compare(e.getNodeA()) && nodeAIn.compare(e.getNodeB()))) break;\n\t\t}\n\t\tif(i < listOfEdges.size()){ // found duplicate\n\t\t\t//System.out.println(\"found dupe\");\n\t\t\treturn e;\n\t\t}\n\t\tNode A = returnNodeById(nodeAIn);\n\t\tNode B = returnNodeById(nodeBIn);\n\t\tif(A == null || B == null) return null;\n\t\tedge_count++;\n\t\tfor(; edge_arrayfirstopen < edge_arraysize && listOfEdges.get(edge_arrayfirstopen) != null; edge_arrayfirstopen++);\n\t\tif(edge_arrayfirstopen >= edge_arraysize){\t//resize\n\t\t\tedge_arraysize = edge_arrayfirstopen+1;\n\t\t\tlistOfEdges.ensureCapacity(edge_arraysize);\n\t\t\tlistOfEdges.setSize(edge_arraysize);\n\t\t}\n\t\tId eid = new Id(edge_arrayfirstopen, edge_count);\n\t\te = new Edge(nodeAIn, nodeBIn, eid);\n\t\tlistOfEdges.set(edge_arrayfirstopen, e);\n\t\t\n\t\tif(edge_arraylasttaken < edge_arrayfirstopen) edge_arraylasttaken = edge_arrayfirstopen; //todo redo\n\n\t\tA.addEdgeId(eid);\n\t\tB.addEdgeId(eid);\n\t\te.updateLength(this);\n\t\treturn e;\n\t}", "public void addEdge(Edge e){\n\t\tedges.put(e.hashCode(), e);\n\t\te.getHead().addConnection(e);\n\t\te.getTail().addConnection(e);\n\t}", "private void addEdge(AtomVertex v, AtomEdge... l) {\n for (AtomEdge e : l) {\n adjacencyMatrix.addEdge(v, e.getSinkVertex(), e.getWeight());\n }\n }", "public void addEdge(int i, int j)\n {\n adjList[i].add(j);\n adjList[j].add(i);\n numEdges++;\n }", "private void createEdges() throws IOException {\r\n\t\tString line;\r\n\t\tString fromVertex=null;\r\n\t\tString toVertex=null;\r\n\t\twhile((line=next(1))!=null) {\r\n\t\t\tif(line.startsWith(\"[\"))\r\n\t\t\t\t{\r\n\t\t\t\tthis.buffer=line;\r\n\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\tint colon=line.indexOf(':');\r\n\t\t\tif(colon==-1) continue;\r\n\t\t\tif(line.startsWith(\"id:\"))\r\n\t\t\t\t{\r\n\t\t\t\ttoVertex= line.substring(colon+1).trim();\r\n\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\tif(line.startsWith(\"is_a:\"))\r\n\t\t\t\t{\r\n\t\t\t\tfromVertex = nocomment(line.substring(colon+1));\r\n\t\t\t\t//System.out.println(fromVertex+\" to be connected to: \"+toVertex);\r\n\t\t\t\tTerm fromNode = terms.get(fromVertex);\r\n\t\t\t\tTerm toNode = terms.get(toVertex);\r\n\t\t\t\tif (fromNode.namespace.equals(\"molecular_function\") && toNode.namespace.equals(\"molecular_function\")){\r\n\t\t\t\t\tdagMF.addEdge(fromNode, toNode);\r\n\t\t\t\t}\r\n\t\t\t\telse if (fromNode.namespace.equals(\"biological_process\") && toNode.namespace.equals(\"biological_process\")){\r\n\t\t\t\t\tdagBP.addEdge(fromNode, toNode);\r\n\t\t\t\t} \r\n\t\t\t\telse if (fromNode.namespace.equals(\"cellular_component\") && toNode.namespace.equals(\"cellular_component\")){\r\n\t\t\t\t\tdagCC.addEdge(fromNode, toNode);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.out.println(\"FAILED TO ADD TO DAG, not belonging to the same NAMESPACE\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}", "public void addEdge(int v1, int v2) {\r\n\t\tadjList[v1].add(v2);\r\n\t}", "private void addEdge(int node1, int node2, int cost, int bandwidth) throws IllegalArgumentException {\n // We can't add edges between non-existent nodes\n int nodeCount = mGraph.getNodeCount();\n if (node1 >= nodeCount || node2 >= nodeCount) {\n throw new IllegalArgumentException();\n }\n\n // Add forward edge\n int edgeCount = mGraph.getEdgeCount() / 2;\n\n Edge forward = mGraph.addEdge(String.valueOf(edgeCount + \"f\"), node1, node2, true);\n forward.addAttribute(\"ui.label\", String.valueOf(edgeCount));\n forward.addAttribute(\"edge.cluster\", String.valueOf(edgeCount));\n forward.addAttribute(\"cost\", cost);\n\n // Add backward edge\n Edge backward = mGraph.addEdge(String.valueOf(edgeCount + \"b\"), node2, node1, true);\n backward.addAttribute(\"edge.cluster\", String.valueOf(edgeCount));\n backward.addAttribute(\"cost\", cost);\n\n // Add edge to the SimpleEdge list\n mEdgeList.add(new SimpleEdge(node1, node2, cost, bandwidth));\n }", "@Override\n public void addEdge(V from, V to)\n {\n\n if (from.equals(null) || to.equals(null)){\n throw new IllegalArgumentException();\n }\n\n if (contains(from)){\n\n\t ArrayList <V> edges = getEdges(from);\n\n \t if (!edges.contains(to)){\n \t\t edges.add(to);\n graph.put(from, edges);\n \t }\n\t }\n\n \tif (!contains(from)){\n \t ArrayList <V> newEdge = new ArrayList<>();\n \t newEdge.add(to);\n \t graph.put(from, newEdge);\n \t}\n\n \tif (!contains(to)){\n \t ArrayList<V> e = new ArrayList<>();\n \t graph.put(to, e);\n \t}\n\n\n\n\n\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 }", "public void addEdge(int u, int v) {\n if (u > nodes.size() || v > nodes.size() || u <= 0 || v <= 0) {\n throw new IllegalArgumentException(\"An invalid node was given\");\n }\n // note that we have to subtract 1 from each since node 1 is located in index 0\n nodes.get(u - 1).addEdge(nodes.get(v - 1));\n }", "void addEdgeTo(char v, int e) {\r\n\t\t// does an edge to v already exist?\r\n\t\tfor (int i = 0; i < currentVertex.outList.size(); i++) {\r\n\t\t\tNeighbor neighbor = currentVertex.outList.get(i);\r\n\t\t\tif (neighbor.vertex.label == v) {\r\n\t\t\t\tneighbor.edge = e;\r\n\t\t\t\tfindNeighbor(findVertex(v).inList, currentVertex.label).edge = e;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// add to current's inList\r\n\t\tNeighbor newNeighbor = new Neighbor(findVertex(v), e);\r\n\t\tcurrentVertex.outList.add(newNeighbor);\r\n\r\n\t\t// add to neighbor's outList\r\n\t\tNeighbor current = new Neighbor(currentVertex, e);\r\n\t\tnewNeighbor.vertex.inList.add(current);\r\n\r\n\t\tedges++;\r\n\t}", "void addEdge(String origin, String destination, double weight){\n\t\tadjlist.get(origin).addEdge(adjlist.get(destination), weight);\n\t\tedges++;\n\t}", "public boolean addEdge(T beg, T end);", "void addEdge(int a, int b) {\n Edge e = new Edge(V[a], V[b]);\n V[a].Adj.add(e);\n V[b].Adj.add(e);\n }", "public void addEdge(int v1, int v2) {\n\t\tedges[v1][v2] = 1;\n\t\tedges[v2][v1] = 1;\n\t\tsize++;\n\t}", "public void addEdge(Graph graph, int source, int destination, double weight){\r\n\r\n Node node = new Node(destination, weight);\r\n LinkedList<Node> list = null;\r\n\r\n //Add an adjacent Node for source\r\n list = adjacencyList.get((double)source);\r\n if (list == null){\r\n list = new LinkedList<Node>();\r\n }\r\n\r\n list.addFirst(node);\r\n adjacencyList.put((double)source, list);\r\n\r\n //Add adjacent node again since graph is undirected\r\n node = new Node(source, weight);\r\n\r\n list = null;\r\n\r\n list = adjacencyList.get((double)destination);\r\n\r\n if (list == null){\r\n list = new LinkedList<Node>();\r\n }\r\n\r\n list.addFirst(node);\r\n adjacencyList.put((double)destination, list);\r\n }", "void addEdge(int x,int y) {\n adj[x].add(y);\n }", "public void addEdge(Edge e)\r\n\t{\n\t\tint v = e.either(), w = e.other(v);\r\n\t\tadj[v].add(e);\r\n\t\tadj[w].add(e);\r\n\t}", "public void addEdge(Edge e) {\n incident.add(e);\n }", "public void addVertex (){\t\t \n\t\tthis.graph.insert( new MyList<Integer>() );\n\t}", "public void addEdge(Integer id, UNode n1, UNode n2, String edge)\r\n {\r\n UEdge e = new UEdge(id, n1, n2, edge);\r\n n1.addOutEdge(e);\r\n n2.addInEdge(e);\r\n uEdges.put (id, e);\r\n }", "private void addNode(NeuralNode node) {\r\n\t\tinnerNodes.add(node);\r\n\t}", "public void conecta (Integer a, Integer b){\n listaEdges[a].add(b);\n listaEdges[b].add(a);\n }", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge1 = new Edge(v1, v2, edgeInfo);\n Edge edge2 = new Edge(v2, v1, edgeInfo);\n if(!adjLists[v1].contains(edge1)){\n adjLists[v1].addLast(edge1);\n }\n if(!adjLists[v2].contains(edge2)){\n adjLists[v2].addLast(edge2);\n }\n }", "public void addEdge(Edge e) {\n int v = e.either();\n int w = e.other(v);\n adj[v].add(e);\n adj[w].add(e);\n E++;\n }", "public void edgeMake(int vertex1, int vertex2) {\n addVertex(vertex1); // both vertices added to the set\n addVertex(vertex2);\n adjacencyMap.get(vertex1).add(vertex2); // both vertices receive the edge\n adjacencyMap.get(vertex2).add(vertex1);\n }", "public void addEdge(int v1, int v2, Object edgeInfo) {\n //your code here\n \tfor (Edge e : myAdjLists[v1]) {\n \t\tif (e.to() == v2) {\n \t\t\te.setObjectInfo(edgeInfo);\n \t\t\treturn;\n \t\t}\n \t}\n \tEdge toAdd = new Edge(v1, v2, edgeInfo);\n \tmyAdjLists[v1].add(toAdd);\t\n }", "private Graph<Node, DefaultEdge> addNodes(Graph<Node, DefaultEdge> g) {\n List<Node> nodes = nodeRepository.findAll();\n nodes.forEach(g::addVertex);\n return g;\n }", "boolean addEdge(E edge);", "void addAll(Graph graph);", "public void addLine(String startNode, String endNode) {\n int startIndex =Integer.parseInt(startNode);\n int endIndex = Integer.parseInt(endNode);\n\n if (startIndex >= 0 && endIndex >= 0) {\n// visited[startIndex]=-1;\n// visited[endIndex]=-1;\n adjacencyMatrix[startIndex][endIndex] = 1;\n }\n }", "public void addEdge(Node source, Node destination, int weight) {\n nodes.add(source);\n nodes.add(destination);\n checkEdgeExistance(source, destination, weight);\n\n if (!directed && source != destination) {\n checkEdgeExistance(destination, source, weight);\n }\n }", "public void addEdge(V from, V to) {\n Set<V> edges = new HashSet<>();\n edges.add(to);\n this.addEdges(from, edges);\n }", "public void addEdge(int v1, int v2, int weight) {\n\t\tedges[v1][v2] = weight;\n\t\tedges[v2][v1] = weight;\n\t\tsize++;\n\n\t}", "public void addEdge(Node src, Node dest, int cost){\n if(nodes.containsKey(src) && nodes.containsKey(dest)){\n Edge newEdge = new Edge(src, dest, cost);\n nodes.get(src).add(dest);\n src.addNodeEdge(newEdge);\n\n Edge otherEdge = new Edge(dest, src, cost);\n nodes.get(dest).add(src);\n dest.addNodeEdge(otherEdge);\n\n\n }\n\n }", "public void addEdge(Character sourceId, Character destinationId) {\n Node sourceNode = getNode(sourceId);\n Node destinationNode = getNode(destinationId);\n sourceNode.adjacent.add(destinationNode);\n }", "public void addEdge(int source, int target, Cost w) {\n\t\tedges[source][target] = w;\n\t}", "void addEdge(Edge e) {\n\t\t\tif(!_edges.containsKey(e.makeKey())) {\n\t\t\t\t_edges.put(e.makeKey(),e);\n\t\t\t\te._one.addNeighborEdge(e);\n\t\t\t\te._two.addNeighborEdge(e);\n\t\t\t}\n\t\t}", "void addEdge(int s1,int c,int s2)\r\n\t{\r\n\t\tg[s1][c][s2]=true;\r\n\t}", "@DisplayName(\"Add edges\")\n @Test\n public void testAddEdges() {\n boolean directed1 = true;\n graph = new Graph(new Edge[0], directed1, 0, 5, GraphType.RANDOM);\n graph.addEdges(edges);\n List<Integer> l0 = new ArrayList<>();\n List<Integer> l1 = new ArrayList<>();\n List<Integer> l2 = new ArrayList<>();\n List<Integer> l4 = new ArrayList<>();\n l0.add(1);\n l1.add(2);\n l2.add(3);\n l4.add(0);\n\n Assertions.assertEquals(l0.get(0), graph.getNeighbours(0).get(0));\n Assertions.assertEquals(l1.get(0), graph.getNeighbours(1).get(0));\n Assertions.assertEquals(l2.get(0), graph.getNeighbours(2).get(0));\n Assertions.assertEquals(l4.get(0), graph.getNeighbours(4).get(0));\n }", "public abstract void addEdge(Point p, Direction dir);", "public void addEdge(edge_type edge) {\n //first make sure the from and to nodes exist within the graph\n assert (edge.getFrom() < nextNodeIndex) && (edge.getTo() < nextNodeIndex) :\n \"<SparseGraph::AddEdge>: invalid node index\";\n\n //make sure both nodes are active before adding the edge\n if ((nodeVector.get(edge.getTo()).getIndex() != invalid_node_index)\n && (nodeVector.get(edge.getFrom()).getIndex() != invalid_node_index)) {\n //add the edge, first making sure it is unique\n if (isEdgeNew(edge.getFrom(), edge.getTo())) {\n edgeListVector.get(edge.getFrom()).add(edge);\n }\n\n //if the graph is undirected we must add another connection in the opposite\n //direction\n if (!isDirectedGraph) {\n //check to make sure the edge is unique before adding\n if (isEdgeNew(edge.getTo(), edge.getFrom())) {\n GraphEdge reversedEdge = new GraphEdge(edge.getTo(),edge.getFrom(),edge.getCost());\n edgeListVector.get(edge.getTo()).add(reversedEdge);\n }\n }\n }\n }", "Graph(List<Edge> edges) {\n\n //one pass to find all vertices\n // this step avoid add isolated coordinates to the graph\n for (Edge e : edges) {\n if (!graph.containsKey(e.startNode)) {\n graph.put(e.startNode, new Node(e.startNode));\n }\n if (!graph.containsKey(e.endNode)) {\n graph.put(e.endNode, new Node(e.endNode));\n }\n }\n\n //another pass to set neighbouring vertices\n for (Edge e : edges) {\n graph.get(e.startNode).neighbours.put(graph.get(e.endNode), e.weight);\n //graph.get(e.v2).neighbours.put(graph.get(e.v1), e.dist); // also do this for an undirected graph\n }\n }", "@Override\r\n public void addEdge(Vertex v1, Vertex v2) {\r\n adjacencyList.get(v1).add(v2); //put v2 into the LinkedList of key v1.\r\n adjacencyList.get(v2).add(v1); //put v1 into the LinkedList of key v2.\r\n }", "@Test\n\tpublic void addEdgeTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tassertTrue(graph.addEdge(edge_0));\n\t\tassertFalse(graph.addEdge(edge_0));\n\t}", "public void addEdge(String n1, String n2) {\n if (!this.graph.containsKey(n1)) {\n addNode(n1);\n }\n if (!this.graph.containsKey(n2)) {\n addNode(n2);\n }\n Edgeq edge = new Edgeq(n1, n2);\n this.graph.get(n1).add(edge);\n\n edge = new Edgeq(n2, n1);\n this.graph.get(n2).add(edge);\n }", "void addEdge(Vertex v1, Vertex v2, Double w) throws VertexNotInGraphException;", "public void addEdge (E vertex1, E vertex2, int edgeWeight) throws IllegalArgumentException\n {\n if(vertex1 == vertex2)\n return;\n \n int index1 = this.indexOf (vertex1);\n if (index1 < 0)\n throw new IllegalArgumentException (vertex1 + \" was not found!\");\n \n int index2 = this.indexOf (vertex2);\n if (index2 < 0)\n throw new IllegalArgumentException (vertex2 + \" was not found!\");\n\n\n if (this.hasEdge (vertex1, vertex2))\n {\n this.removeNode (index1, index2);\n this.removeNode (index2, index1);\n }\n \n Node node = new Node(index2, edgeWeight);\n this.addNode(node, index1);\n node = new Node(index1, edgeWeight);\n this.addNode(node, index2);\n }", "public void addEdgeFrom(char v, int e) {\r\n\t\t// does an edge from v already exist?\r\n\t\tfor (int i = 0; i < currentVertex.inList.size(); i++) {\r\n\t\t\tNeighbor neighbor = currentVertex.inList.get(i);\r\n\t\t\tif (currentVertex.inList.get(i).vertex.label == v) {\r\n\t\t\t\tneighbor.edge = e; \r\n\t\t\t\tfindNeighbor(findVertex(v).outList, currentVertex.label).edge = e;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// add to current's inList\r\n\t\tNeighbor newNeighbor = new Neighbor(findVertex(v), e);\r\n\t\tcurrentVertex.inList.add(newNeighbor);\r\n\r\n\t\t// add to neighbor's outList\r\n\t\tNeighbor current = new Neighbor(currentVertex, e);\r\n\t\tnewNeighbor.vertex.outList.add(current);\r\n\r\n\t\tedges++;\r\n\t}", "void addDirectedEdge(final Node first, final Node second)\n {\n if ( first == second )\n {\n return;\n }\n else if (first.connectedNodes.contains(second))\n return;\n else\n first.connectedNodes.add(second);\n }", "private void addEdgeWithInst(NasmInst source, NasmInst destination) {\n if (source == null || destination == null)\n throw new FgException(\"ERROR: Can't create an edge without a source and a destination\");\n Node from = inst2Node.get(source);\n Node to = inst2Node.get(destination);\n if (from == null || to == null)\n throw new FgException(\"ERROR: No nodes matching with given Source or destination \");\n graph.addEdge(from, to);\n }", "public void setEdge(int v1, int v2, int weight) {\n LinkedList<Integer> tmp = adjList.elementAt(v1);\n if(adjList.elementAt(v1).contains(v2) == false) {\n tmp.add(v2);\n adjList.set(v1, tmp);\n totalEdges ++;\n LinkedList<Integer> tmp2 = adjWeight.elementAt(v1);\n tmp2.add(weight);\n adjWeight.set(v1, tmp2);\n }\n }", "private Edge addEdge(Node source, Node dest, double weight)\r\n\t{\r\n\t final Edge newEdge = new Edge(edgeType, source, dest, weight);\r\n\t if (!eSet.add(newEdge))\r\n\t\tthrow new RuntimeException(\"Edge already exists!\");\r\n\t source.addEdge(newEdge);\n\t return newEdge;\r\n\t}", "public void addEdge(Edge e) {\r\n int v = e.from();\r\n int w = e.to();\r\n validateVertex(v);\r\n validateVertex(w);\r\n adj[v].add(e);\r\n indegree[w]++;\r\n E++;\r\n }", "public void addEdge(String from, String to) {\n Vertex v, w;\n if (hasEdge(from, to)) return; // no duplicate edges\n mNumEdges += 1;\n if ((v = getVertex(from)) == null)\n v = addVertex(from);\n if ((w = getVertex(to)) == null)\n w = addVertex(to);\n mAdjList.get(v).add(w);\n mAdjList.get(w).add(v); // undirected graph only\n }", "@FXML private void addEdges()\t\t\n\t{ \t\n\t\tif (getSelection().size() >= 2)\t\t\n\t\t{\n\t\t\tList<Edge> edges = getDrawModel().connectSelectedNodes();\n\t\t\tfor (Edge e: edges)\n\t\t\t\tadd(0, e, getActiveLayerName());\n\t\t}\n\t}", "public void addNeighbor(Node node){\n neighbors.add(node);\n liveNeighbors.add(node);\n }", "@Override\n public void addEdge(V source, V destination, double weight)\n {\n super.addEdge(source, destination, weight);\n super.addEdge(destination, source, weight);\n }", "protected void addEdge(int src, int dest) {\n\t\tthis.adjListArray[src].add(dest);\n\t}", "private void initializeEdges() {\n for (NasmInst inst : nasm.listeInst) {\n if (inst.source == null || inst.destination == null)\n return;\n Node from = inst2Node.get(label2Inst.get(inst.source.toString()));\n Node to = inst2Node.get(label2Inst.get(inst.destination.toString()));\n if (from == null || to == null)\n return;\n graph.addEdge(from, to);\n }\n }", "public void addEdge(int v1, int v2) {\r\n addEdge(v1, v2, null);\r\n }" ]
[ "0.75173587", "0.73267716", "0.71603495", "0.712714", "0.7038755", "0.6941814", "0.6847333", "0.6831036", "0.68188214", "0.6762855", "0.6745265", "0.6714425", "0.6709204", "0.6700326", "0.66924417", "0.6665868", "0.66379094", "0.65967005", "0.6560416", "0.6559565", "0.6558618", "0.65534055", "0.65132225", "0.6513055", "0.64638174", "0.64599615", "0.6441998", "0.64381087", "0.641815", "0.63813454", "0.63424486", "0.6341611", "0.63405174", "0.6328624", "0.63115805", "0.63023055", "0.630038", "0.6298482", "0.62824667", "0.6273887", "0.62583494", "0.62396157", "0.62250483", "0.61970234", "0.619401", "0.6180785", "0.61589336", "0.6158225", "0.61422133", "0.6136426", "0.61356807", "0.61292005", "0.6117924", "0.6114069", "0.6092433", "0.60921293", "0.6085844", "0.60804415", "0.6073428", "0.6069321", "0.60479504", "0.6040914", "0.6040552", "0.6018992", "0.6011213", "0.60079664", "0.6007705", "0.60012853", "0.60005563", "0.59908336", "0.5989813", "0.5989337", "0.59768385", "0.59527355", "0.5944576", "0.59371656", "0.5924368", "0.5923276", "0.59085184", "0.59081656", "0.5892794", "0.5884779", "0.58834976", "0.5882699", "0.58762884", "0.5872519", "0.586019", "0.58510077", "0.58475083", "0.584729", "0.5846693", "0.5837193", "0.5836401", "0.58312637", "0.58310854", "0.5830303", "0.5827244", "0.58264434", "0.5820742", "0.5818566" ]
0.594788
74
returns humand readable node object
public String toString(){ return vertex.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Node getNode();", "public String toString(){\n return \"Node: \" + data;\n }", "public String getNodeValue ();", "public String getNode() {\n return node;\n }", "public Node getNode();", "public String getNode()\n {\n return node;\n }", "@AutoEscape\n\tpublic String getNode_1();", "public String getNode() {\n return node;\n }", "@AutoEscape\n\tpublic String getNode_2();", "@AutoEscape\n\tpublic String getNode_4();", "@Override\n public String toString() {\n return InternalNodeSerializer.toString(this);\n }", "@AutoEscape\n\tpublic String getNode_5();", "@AutoEscape\n\tpublic String getNode_3();", "public String printNodeData(Node<T> node){\n return String.valueOf(node.data);\n }", "@Override\n public Object string(Object node) {\n return ((Node<E>) node).element.toString();\n }", "private String node(String name) { return prefix + \"AST\" + name + \"Node\"; }", "public abstract Node getNode();", "entities.Torrent.NodeId getNode();", "entities.Torrent.NodeId getNode();", "Term getNodeTerm();", "@Override\r\n public String toString(){\r\n return Integer.toString(node);\r\n }", "java.lang.String getEntryNode();", "public String getNodeValue(Node node) throws Exception;", "public abstract String toName(Object inNode);", "public Node readTree() {\n boolean totuusarvo = b.readBoolean();\n if (totuusarvo == true) {\n return new Node(b.readShort(), -1, null, null);\n } else {\n return new Node(\"9000\", -1, readTree(), readTree());\n }\n }", "public String getNodeDescription() {\n return nodeDescription;\n }", "public interface Node extends Serializable {\n\n\tvoid setOwner(Object owner);\n Object getOwner();\n\n String getName();\n Node getChild(int i);\n List<Node> childList();\n\n Node attach(int id, Node n) throws VetoTypeInduction;\n void induceOutputType(Class type) throws VetoTypeInduction;\n int getInputCount();\n\tClass getInputType(int id);\n List<Class> getInputTypes();\n Class getOutputType();\n Tuple.Two<Class,List<Class>> getType();\n\n Object evaluate();\n\n boolean isTerminal();\n\n <T extends Node> T copy();\n String debugString(Set<Node> set);\n}", "@Override\n public String toString() {\n return \"Node [id=\" + id + \", data=\" + data + \", red=\" + red + \"]\";\n }", "public int getNodeLabel ();", "public String getNodeDescription() {\n return nodeDescription;\n }", "public String toString() {\n\t\tStringBuilder sb = new StringBuilder(\"BNNode \" + name + \":\\n\");\n\t\tif (isEvidence)\n\t\t\tsb.append(\" EVIDENCE\\n\");\n\t\tsb.append(\" value: \" + value + \"\\n\");\n\t\tsb.append(\" parents:\");\n\t\tif (parents.length == 0)\n\t\t\tsb.append(\" (none)\");\n\t\telse\n\t\t\tfor (BNNode parent : parents) \n\t\t\t\tsb.append(\" \" + parent.name);\n\t\tsb.append(\"\\n children:\");\n\t\tif (children.length == 0)\n\t\t\tsb.append(\" (none)\");\n\t\telse\n\t\t\tfor (BNNode child : children) \n\t\t\t\tsb.append(\" \" + child.name);\n\t\tsb.append(\"\\n CPT:\");\n\t\tfor (double cp : cpt)\n\t\t\tsb.append(\" \" + cp);\n\t\treturn sb.toString();\n\t}", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n traverseNode(sb, \"\", \"\", root, false);\n return sb.toString();\n }", "public Node getNode (){\n if (_node == null){\n Label label = new Label(_value);\n label.setFont(DEFAULT_FONT);\n _node = label;\n }\n return _node;\n }", "public String nodeAndElementsAsText() {\n\t\treturn \"\";\n\t}", "@Override\r\n\tpublic String toString() {\n\t\treturn (this.id + \"\\t\" + this.name + \"\\t\" + this.nodeType);\r\n\t}", "TNode createTNode();", "public abstract <T extends INode<T>> String nodeToString(int nodeId, T node, boolean isInitial, boolean isTerminal);", "public static String getNodeStr(Node curr) {\r\n\t\treturn curr.str;\r\n\t}", "@Override\n public Object string(Object node) {\n Node<E> myNode = (Node<E>)node;\n String parentString = \"null\";\n if (myNode.parent != null) {\n parentString = myNode.parent.element.toString();\n }\n return myNode.element + \"_p(\" + parentString + \")\"; }", "public String getAsText()\n {\n StringWriter sw = new StringWriter();\n DOMWriter dw = new DOMWriter(sw);\n dw.print((Node)getValue());\n return sw.toString();\n }", "public String getTextValue (Node node);", "OperationNode getNode();", "@Override\r\n \tpublic final String toStringAsNode(boolean printRangeInfo) {\r\n \t\tString str = toStringClassName();\r\n \t\t\r\n \t\tif(printRangeInfo) {\r\n \t\t\tif(hasNoSourceRangeInfo()) {\r\n \t\t\t\tstr += \" [?+?]\";\r\n \t\t\t} else {\r\n \t\t\t\tstr += \" [\"+ getStartPos() +\"+\"+ getLength() +\"]\";\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn str;\r\n \t}", "public String toString()\r\n {\n \tString result = \"\";\r\n \tNode n = this.top;\r\n \twhile (n != null)\r\n \t{\r\n \t\tresult = result + \" \" + n.getItem().toString();\r\n \t\tn = n.getNext();\r\n \t}\r\n \treturn result.trim();\r\n }", "@Override\n public String toString() {\n return (this.originalValue == null ? this.getValue() : this.originalValue) + (this.nodeType.getName() == null\n ? \"\" : (\":\" + this.nodeType.getName()));\n }", "public String toString()\r\n/* 112: */ {\r\n/* 113:199 */ String s = \"\";\r\n/* 114:200 */ for (N node : getNodes())\r\n/* 115: */ {\r\n/* 116:201 */ s = s + \"\\n{ \" + node + \" \";\r\n/* 117:202 */ for (N suc : getSuccessors(node)) {\r\n/* 118:203 */ s = s + \"\\n ( \" + getEdge(node, suc) + \" \" + suc + \" )\";\r\n/* 119: */ }\r\n/* 120:205 */ s = s + \"\\n} \";\r\n/* 121: */ }\r\n/* 122:207 */ return s;\r\n/* 123: */ }", "public static String TNodeToString(TNode n) {\n if (n == null)\n return \"NULL\";\n else\n return n.getName() + \":\" + n.getPort();\n }", "@Override\n public String toString() {\n return \"Node{\" +\n \"course=\" + course +\n \", nextNode=\" + nextNode +\n '}';\n }", "@Override\n\tpublic java.lang.String getNode_1() {\n\t\treturn _dictData.getNode_1();\n\t}", "public void printNode(Node n);", "private Node getNode(String resource)\r\n {\r\n return Node.getNode(resource);\r\n }", "private String getLabelNodeAvl(){\n return concatLabel(this.root);\n }", "public ReactorResult<org.ontoware.rdf2go.model.node.Node> getAllTextWriter_asNode_() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), TEXTWRITER, org.ontoware.rdf2go.model.node.Node.class);\r\n\t}", "public Node(){}", "String getNodeName();", "public void displayNode() {\n\t\t\tSystem.out.println(\"{ \" + data + \" } \");\n\t\t}", "FedoraBinary asBinary(Node node);", "public String toString() {\r\n\t\tString cad = \"\";\r\n\t\tfor (int i = 0; i < nodes_.size(); i++) {\r\n\t\t\tcad += nodes_.get(i).getVal() + \" - \";\r\n\t\t}\r\n\t\treturn cad;\r\n\t}", "public String toString() { return kind() + \":\"+ text() ; }", "private static String printNode(Node node) {\n\t\tif (node instanceof TextNode) {\n\t\t\tTextNode textNode = (TextNode) node;\n\t\t\treturn addEscapes(\n\t\t\t\t\ttextNode.getText(),\n\t\t\t\t\tEscapableArrays.textEscapable(),\n\t\t\t\t\tParserDelimiters.ESCAPE_DELIMITER.getValue()\n\t\t\t);\n\t\t}\n\t\t\n\t\tif (node instanceof ForLoopNode) {\n\t\t\treturn printForLoopNode((ForLoopNode) node);\n\t\t}\n\t\t\n\t\tif (node instanceof EchoNode) {\n\t\t\treturn printEchoNode((EchoNode) node);\n\t\t}\n\t\t\n\t\treturn \"\";\n\t}", "@Override\n public String toString() {\n return \"GraphModelNode: \" + getText(); //$NON-NLS-1$\n }", "@Override\n\tpublic java.lang.String getNode_2() {\n\t\treturn _dictData.getNode_2();\n\t}", "public static String asString(final Node node) {\r\n if (node == null) {\r\n return \"null\";\r\n }\r\n\r\n return asString(new DOMSource(node), DEFAULT_BUFFER_SIZE);\r\n }", "public String toString() {\n\t\tString tester = \"\";\n\t\tfor(String node : nodes.keySet())\n\t\t{\n\t\t\ttester += \" \" + nodes.get(node) + \" \\n\";\n\t\t}\n\t\treturn tester;\n\t}", "NodeInformationProvider getNodeInformationProvider();", "@Override\n public Node getFullNode() {\n return getBasicNode();\n }", "public TMNode getNode() {\n return node;\n }", "public String getNodeName()\n {\n return displayNode.toString();\n }", "public short getNode() {\n return node;\n }", "@Override\n\tpublic java.lang.String getNode_5() {\n\t\treturn _dictData.getNode_5();\n\t}", "public final IRNode getNode() {\r\n return f_node;\r\n }", "public String toString() {\n\t\tNode current = top;\n\t\tStringBuilder s = new StringBuilder();\n\t\twhile (current != null) {\n\t\t\ts.append(current.value + \" \");\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\treturn s.toString();\n\t}", "@Override\n\tpublic java.lang.String getNode_4() {\n\t\treturn _dictData.getNode_4();\n\t}", "public String toString() {\n String toReturn = \"\";\n\n Node walker = this.first;\n while(walker != null) {\n toReturn += walker.data + \"\\t\";\n walker = walker.next;\n }\n\n return toReturn;\n }", "public interface Node {\n public int arityOfOperation();\n public String getText(int depth) throws CalculationException;\n public double getResult() throws CalculationException;\n public boolean isReachable(int depth);\n public List<Node> getAdjacentNodes();\n public String getTitle();\n public void setDepth(int depth);\n}", "List<Node> getNode(String str);", "public String toString(org.w3c.dom.Node n){\n int nodeHandle=getDTMHandleFromNode(n);\n DTM dtm=getDTM(nodeHandle);\n XMLString strVal=dtm.getStringValue(nodeHandle);\n return strVal.toString();\n }", "@Override\n public String toString(){\n String result = \"\";\n Node n = first;\n while(n != null){\n result += n.value + \" \";\n n = n.next;\n }\n return result;\n }", "@Override\r\n\tpublic String toString() {\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tif(id != null) sb.append(\"#\" + id);\r\n\t\tif(_class != null) sb.append(\".\" + _class);\r\n\t\tif(elemnt != null) sb.append(elemnt);\r\n\t\tfor (Attr attr : attrs) {\r\n\t\t\tsb.append(attr.toString());\r\n\t\t}\r\n\t\tfor (String pseudo : pseudos) {\r\n\t\t\tsb.append(\":\" + pseudo);\r\n\t\t}\t\t\r\n\t\t\r\n\t\t//if(child != null) sb.append(child.getExp() + child.toString());\r\n\t\tif(child != null) sb.append(\" \" + child.toString());\r\n\t\t\r\n\t\treturn sb.toString();\r\n\t}", "public String toString() {\n return toString(overallRoot, 0.0, weightedNodeHeight(overallRoot));\n }", "Node getSourceNode();", "public Node() {}", "public Node() {}", "public Node() {}", "public Node() {}", "entities.Torrent.NodeIdOrBuilder getNodeOrBuilder();", "entities.Torrent.NodeIdOrBuilder getNodeOrBuilder();", "@Test\n public void testToRulenode() {\n System.out.println(\"AbsolutePathNode - testToRulenode\");\n final AbsolutePathNode instance = new AbsolutePathNode();\n final String expResult = \"apath\";\n final String result = instance.toRulenode();\n System.out.printf(\"Expected: %s\\n\", expResult);\n System.out.printf(\" Result: %s\\n\", result);\n assertEquals(expResult, result);\n }", "public interface Node extends TreeComponent {\n /**\n * The types of decision tree nodes available.\n */\n enum NodeType {\n Internal,\n Leaf\n }\n\n /**\n * Gets the type of this node.\n * @return The type of node.\n */\n NodeType getType();\n\n void print();\n\n String getClassLabel(DataTuple tuple);\n}", "@Override\n public String toString() { return root.toString(); }", "public Node getNode() {\n return node;\n }", "public Node getNode() {\n return node;\n }", "public String toString() {\n return tree.toString();\n }", "public interface Node {\n\n\tLong getClsId();\n\n\tNode getParent();\n\n\tvoid setParent(Node p);\n\n\tNode[] getChildrenArray();\n\n\tList<Node> getChildrenList();\n\n\tvoid resetChildren(Node[] children);\n\n\tObject getValue(int attr);\n\n\tObject setValue(int attr, Object value);\n\n\tlong getLongValue(int attr);\n\n\tInteger getId();\n}", "public String toString(){\n String re = null;\n Node tmp = head;\n while(tmp != null) {\n re = re + \" \" + tmp.element.toString();\n }\n return re;\n }", "@Override\n\tpublic String toString() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"node:\\n\").append(nodeJo);\n\t\tsb.append(\"\\nedges:\\n\").append(edgesJa);\n\t\treturn sb.toString();\n\t}", "Object get(Node node);", "public String toString()\n\t{\n\t\tNode current = head.getNext();\n\t\tString output = \"\";\n\t\t\n\t\twhile(current != null){\n\t\t\toutput += \"[\" + current.getData().toString() + \"]\\n\";\n\t\t\tcurrent = current.getNext();\n\t\t}\n\t\t\n\t\treturn output;\n\t}", "public ReactorResult<org.ontoware.rdf2go.model.node.Node> getAllOriginalTextWriter_asNode_() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), ORIGINALTEXTWRITER, org.ontoware.rdf2go.model.node.Node.class);\r\n\t}", "public String toString(){\r\n\t\treturn root.toString();\r\n\t}", "abstract public Node load();" ]
[ "0.69781256", "0.6891004", "0.67425346", "0.66328347", "0.66243434", "0.6605511", "0.6558947", "0.65267843", "0.6501711", "0.6448545", "0.6445223", "0.6433623", "0.6432986", "0.6422221", "0.6359603", "0.6274888", "0.6274348", "0.6265717", "0.6265717", "0.62613153", "0.624423", "0.6237218", "0.61873406", "0.617971", "0.617799", "0.6171269", "0.6164155", "0.61301357", "0.6117095", "0.6103023", "0.60734993", "0.60569507", "0.6034121", "0.5992629", "0.5988582", "0.5970277", "0.59528154", "0.5947348", "0.59351027", "0.590189", "0.58857286", "0.58822095", "0.58757526", "0.5871127", "0.58630913", "0.58504117", "0.5843193", "0.5843176", "0.5838156", "0.5830777", "0.5830413", "0.581461", "0.57889575", "0.57850426", "0.57661426", "0.57624495", "0.57561934", "0.5756145", "0.57519823", "0.5750221", "0.57497025", "0.57490164", "0.57404137", "0.5730355", "0.57278556", "0.5720229", "0.5716287", "0.57143587", "0.5707243", "0.57016575", "0.5699152", "0.56983715", "0.5692167", "0.56868875", "0.56792384", "0.5674276", "0.5670629", "0.5661336", "0.5657029", "0.5649814", "0.5648336", "0.5645491", "0.5645491", "0.5645491", "0.5645491", "0.5643465", "0.5643465", "0.56429034", "0.56408286", "0.56383544", "0.5633334", "0.5633334", "0.5626597", "0.56233305", "0.56214064", "0.5615743", "0.5612529", "0.5609596", "0.56071615", "0.5605121", "0.55998236" ]
0.0
-1
String rootDirectory = request.getSession().getServletContext().getRealPath("/");
@Override public String saveFile(MultipartFile file, String rootDirectory ) { String path = null; try { if (file != null && !file.isEmpty()) { java.util.Date date = new java.util.Date(); int i = (int) (date.getTime() / 1000); String extention = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1); String fileName =file.getOriginalFilename().substring(0, file.getOriginalFilename().lastIndexOf(".")); path = rootDirectory + fileName + "-" + i + "."+ extention; File finalFilePath = new File(path); //create all path directories if not exist finalFilePath.getParentFile().mkdirs(); file.transferTo(new File(path)); } } catch (IOException e) { e.printStackTrace(); } return path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IPath getRuntimeBaseDirectory(TomcatServer server);", "protected String getRootPath() {\n\t\treturn \"/WEB-INF\";\n\t}", "@Override\r\n\tpublic String getRootDir() {\t\t\r\n\t\treturn Global.USERROOTDIR;\r\n\t}", "Path getRootPath();", "String rootPath();", "private String getPath() {\n\t\treturn context.getRealPath(\"WEB-INF/ConnectionData\");\n\t}", "private String getPath() {\n\t\treturn context.getRealPath(\"WEB-INF/ConnectionData\");\n\t}", "private String getPath() {\n\t\treturn context.getRealPath(\"WEB-INF/ConnectionData\");\n\t}", "private String getPath() {\n\t\treturn context.getRealPath(\"WEB-INF/ConnectionData\");\n\t}", "private String getPath() {\r\n\t\t\treturn context.getRealPath(\"WEB-INF/ConnectionData\");\r\n\t\t}", "public String getDocumentBase() {\n return getServerBase() + getContextPath() + \"/\";\n }", "public abstract String getRequestServletPath();", "public void init( ){\n\t filepath = getServletContext().getContextPath();\r\n\tappPath = getServletContext().getRealPath(SAVE_DIR);\r\n\t \r\n\t }", "public static File getRootDirectory() {\n\t\treturn ROOT_DIRECTORY;\n\t}", "private static String getPath (HttpServletRequest request) {\n String path = request.getServletPath();\n return path != null ? path : request.getPathInfo();\n }", "@Override\n public File getServletTempDirectory(String moduleContextPath) {\n ApplicationDescriptor desc = getApplicationDescriptor(moduleContextPath);\n if (desc == null) {\n return null;\n }\n String domainDir = deploymentManager.getInstanceProperties().getProperty(WLPluginProperties.DOMAIN_ROOT_ATTR);\n assert domainDir != null;\n\n // FIXME can we get this via JMX ?\n File tmpPath = new File(new File(domainDir), \"servers\" + File.separator + desc.getServerName() + File.separator + \"tmp\" // NOI18N\n + File.separator + \"_WL_user\" + File.separator + desc.getName()); // NOI18N\n if (tmpPath.exists() && tmpPath.isDirectory()) {\n File[] subDirs = tmpPath.listFiles();\n if (subDirs != null) {\n for (File subdir : subDirs) {\n // FIXME multiple subdirs - what does that mean\n File servletDir = new File(subdir, \"jsp_servlet\"); // NOI18N\n if (servletDir.exists() && servletDir.isDirectory()) {\n // FIXME make simpler\n return servletDir.getParentFile();\n }\n }\n }\n }\n return null;\n }", "public static String rootDir()\n {\n read_if_needed_();\n \n return _root;\n }", "FsPath baseDir();", "public URL getRootDirURL() {\n\t\treturn null;\n\t}", "public String getRootPath() {\r\n return rootPath;\r\n }", "public String getRootPath() {\n return root.getPath();\n }", "public File getRootDir() {\n return rootDir;\n }", "public File getRootDir() {\r\n\t\treturn rootDir;\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException \r\n{\nresponse.getWriter().append(\"Served at: \").append(request.getContextPath()); \r\n}", "String getRootServerBaseUrl();", "public static String sBasePath() \r\n\t{\r\n\t\tif(fromJar) \r\n\t\t{\r\n\t\t\tFile file = new File(System.getProperty(\"java.class.path\"));\r\n\t\t\tif (file.getParent() != null)\r\n\t\t\t{\r\n\t\t\t\treturn file.getParent().toString();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\treturn new java.io.File(\"\").getCanonicalPath();\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "public String getWorkDirectory(){\n String wd = \"\";\n try {\n wd = new File(\"test.txt\").getCanonicalPath().replace(\"/test.txt\",\"\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n return wd;\n }", "public static String getBasepath() {\n\t\treturn basepath;\n\t}", "public static String getBasepath() {\n\t\treturn basepath;\n\t}", "public File getCommonDir()\n {\n return validatePath(ServerSettings.getInstance().getProperty(ServerSettings.COMMON_DIR));\n }", "private String getInitialDirectory() {\n String lastSavedPath = controller.getLastSavePath();\n\n if (lastSavedPath == null) {\n return System.getProperty(Constants.JAVA_USER_HOME);\n }\n\n File lastSavedFile = new File(lastSavedPath);\n\n return lastSavedFile.getAbsoluteFile().getParent();\n }", "String getDir();", "public String getServletPath() {\n return servletPath;\n }", "File getRootDir() {\n\t\treturn rootDirFile;\n\t}", "@Override\n\t\tpublic String getServletPath() {\n\t\t\treturn null;\n\t\t}", "String getContextPath();", "String getContextPath();", "String getContextPath();", "public static String getBaseDir() {\r\n Path currentRelativePath = Paths.get(System.getProperty(\"user.dir\"));\r\n return currentRelativePath.toAbsolutePath().toString();\r\n }", "private String getDataDirectory() {\n Session session = getSession();\n String dataDirectory;\n try {\n dataDirectory = (String) session.createSQLQuery(DATA_DIRECTORY_QUERY).list().get(0);\n } finally {\n releaseSession(session);\n }\n return dataDirectory;\n }", "@Override\n\tpublic String getServletPath() {\n\t\treturn null;\n\t}", "public static String uploadDir() {\n\n String uploads = stringValue(\"treefs.uploads\");\n if(isNullOrEmpty(uploads)) {\n // default home location\n uploads = home() + File.separator + \"uploads\";\n } else {\n uploads = home() + File.separator + uploads;\n }\n\n System.out.println(\"uploadDir=\" + uploads);\n return uploads;\n }", "protected File getRootDir() {\r\n\t\tif (rootDir == null) {\r\n\t\t\trootDir = new File(getProperties().getString(\"rootDir\"));\r\n\t\t\tif (! rootDir.exists())\r\n\t\t\t\tif (! rootDir.mkdirs())\r\n\t\t\t\t\tthrow new RuntimeException(\"Could not create root dir\");\r\n\t\t}\r\n\t\treturn rootDir;\r\n\t}", "private String getWebTmpDir()\n\t\t\tthrows Exception\n\t{\n\t\t\treturn Contexto.getPropiedad(\"TMP.UPLOAD2\");\n }", "private static void findPath()\r\n {\r\n String temp_path = System.getProperty(\"user.dir\");\r\n char last = temp_path.charAt(temp_path.length() - 1);\r\n if(last == 'g')\r\n {\r\n path = \".\";\r\n }\r\n else\r\n {\r\n path = \"./bag\";\r\n }\r\n \r\n }", "public String getServletPath() {\n return servletPath;\n }", "public static String findCurrentDirectory() {\n\t\tString absolutePath = new File(\"\").getAbsolutePath();\n\t return absolutePath;\n\t}", "public String getLocalBasePath() {\n\t\treturn DataManager.getLocalBasePath();\n\t}", "java.io.File getBaseDir();", "public String getDir();", "public void customRootDir() {\n //Be careful with case when res is false which means dir is not valid.\n boolean res = KOOM.getInstance().setRootDir(this.getCacheDir().getAbsolutePath());\n }", "private Path getDefaultLogsSessionDirectory(String sLogsDownloadPath)\n\t{\n\t\tPath sessionDirectory;\n\t\tString sCurrentIp = spotInfo.getUPMip();\t\t\n\t\ttry\n\t\t{\n\t\t\tsessionDirectory = Paths.get( sLogsDownloadPath, sCurrentIp+\"_\"+ EdtUtil.getDateTimeStamp( \"yyyy-MM-dd'T'HHmmss\" ) ); // The path is built with the download_path/target_unit_ip/timestamp/\n\t\t}\n\t\tcatch (RuntimeException e)\n\t\t{\n\t\t\tsessionDirectory = Paths.get( sLogsDownloadPath, sCurrentIp+\"_tmp\" );\n\t\t}\n\t\treturn sessionDirectory;\n\t}", "private String getTmpPath() {\n return getExternalFilesDir(null).getAbsoluteFile() + \"/tmp/\";\n }", "private static String getRioHomeDirectory() {\n String rioHome = RioHome.get();\n if(!rioHome.endsWith(File.separator))\n rioHome = rioHome+File.separator;\n return rioHome;\n }", "public static File getWorkspaceDir(BundleContext context)\n {\n return new File(getTargetDir(context), \"../../\");\n }", "public Path getDataDirectory();", "static String getBase(HttpServletRequest request) {\n String fullPath = request.getRequestURI();\n int baseEnd = getDividingIndex(fullPath);\n return fullPath.substring(0, baseEnd + 1);\n }", "VirtualDirectory getRootContents();", "String getDirectoryPath();", "private File getTempFolder(String osBasePath) {\n File baseTempFolder = new File(osBasePath, \"temp\");\n return baseTempFolder;\n }", "@Override\r\n\tpublic void init(ServletConfig config) throws ServletException {\n\t\tsuper.init(config);\r\n\t\tString realPath = config.getServletContext().getRealPath(\"/\");\r\n\t\tString path = realPath + \"WEB-INF\"+ System.getProperty(\"file.separator\") +\"logs\"+ System.getProperty(\"file.separator\")+\"payments\"+ System.getProperty(\"file.separator\");\r\n\r\n\t\tthis.filePath = path;// this.getInitParameter(\"TMP_PATH\");\r\n\t\tlog.debug(\"Initializing payment log file at loc: \"+ this.filePath);\r\n\t}", "public String getCurrentPath() {\n\t\treturn \"\";\n\t}", "public String getUserStorageLocation(){\n Authentication auth = SecurityContextHolder.getContext().getAuthentication();\n String user = (String) auth.getPrincipal();\n return user + \"/\";\n }", "public static Path locateLogosDir(ServiceContext context) {\n ServletContext servletContext = null;\n \n if(context == null) {\n context = ServiceContext.get();\n }\n \n if(context == null) {\n throw new RuntimeException(\"Null Context found!!!!\");\n } else if (context.getServlet() != null) {\n servletContext = context.getServlet().getServletContext();\n }\n\n return locateLogosDir(servletContext, context.getApplicationContext(),\n context.getAppPath());\n }", "public File getBasedir()\n {\n return basedir;\n }", "public static String getPath() {\n\t\t// Lấy đường dẫn link\n\t\tAuthentication auth1 = SecurityContextHolder.getContext().getAuthentication();\n\t\tAgentconnection cus = (Agentconnection) auth1.getPrincipal();\n\t\t \n\t\t//String PATH_STRING_REAL = fileStorageProperties.getUploadDir()+cus.getMerchant()+\"/hotel/images/\" + year + \"/\" + month + \"/\" ;\n\t String PATH_STRING_REAL = \"E:/ezcloud/upload/\"+cus.getMerchant()+\"/hotel/images/\" + year + \"/\" + month + \"/\" ;\n\t return PATH_STRING_REAL;\n\t}", "public static Path locateHarvesterLogosDir(ServiceContext context) {\n ServletContext servletContext = null;\n if (context.getServlet() != null) {\n servletContext = context.getServlet().getServletContext();\n }\n return locateHarvesterLogosDir(servletContext,\n context.getApplicationContext(), context.getAppPath());\n }", "public String getBaseDirectory()\n {\n return m_baseDirectory;\n }", "public static String getPath(HttpServletRequest request) {\n return request.getRequestURI().substring(request.getContextPath().length());\n }", "public File getCacheRoot()\r\n {\r\n return cache.getCacheRoot();\r\n }", "public synchronized static String getCurrentDirectory() {\n if (currentDirectory == null)\n currentDirectory = canon(System.getProperty(\"user.home\"));\n return currentDirectory;\n }", "public void setRootDir(String rootDir);", "public IDirectory getRootDirectory() {\r\n return rootDir;\r\n }", "public static String getRootPath(Activity activity) {\n String path;\n if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {\n path = activity.getExternalFilesDir(null).getAbsolutePath()\n + File.separator + \"Autonomes Fahrzeug\" + File.separator;\n } else {\n path = Environment.getExternalStorageDirectory() + File.separator\n + \"Autonomes Fahrzeug\" + File.separator;\n }\n return path;\n }", "protected void setRootPath(String root) {\n this.root = new File(root);\n this.appsDir = new File(this.root, APPS_ROOT);\n this.m2Dir = new File(M2_ROOT);\n }", "Object getDir();", "public static String getCloudTestRootPath() {\n\n return getCLOUDTEST_HOME() + File.separator + rootFolderName\n + File.separator;\n }", "void setAppRootDirectory(String rootDir);", "public File getApplicationPath()\n {\n return validateFile(ServerSettings.getInstance().getProperty(ServerSettings.APP_EXE));\n }", "static File getAppDir(String app) {\n return Minecraft.a(app);\n }", "public static Path locateResourcesDir(ServletContext context,\n ApplicationContext applicationContext) {\n Path property = null;\n try {\n property = applicationContext.getBean(GeonetworkDataDirectory.class).getResourcesDir();\n } catch (NoSuchBeanDefinitionException e) {\n final String realPath = context.getRealPath(\"/WEB-INF/data/resources\");\n if (realPath != null) {\n property = IO.toPath(realPath);\n }\n }\n\n if (property == null) {\n return IO.toPath(\"resources\");\n } else {\n return property;\n }\n }", "public String getContextPath() {\n return FxJsfUtils.getRequest().getContextPath();\n }", "public String getBasePath(){\r\n\t\t \r\n\t\t String basePath = properties.getProperty(\"getPath\");\r\n\t\t if(basePath != null) return basePath;\r\n\t\t else throw new RuntimeException(\"getPath not specified in the configuration.properties file.\");\r\n\t }", "public static Path locateResourcesDir(ServiceContext context) {\n if (context.getServlet() != null) {\n return locateResourcesDir(context.getServlet().getServletContext(), context.getApplicationContext());\n }\n\n return context.getBean(GeonetworkDataDirectory.class).getResourcesDir();\n }", "public static String getServletPath(HttpServletRequest request) {\n String servletPath = request.getServletPath();\n String requestUri = request.getRequestURI();\n\n // Detecting other characters that the servlet container cut off (like anything after ';')\n if (requestUri != null && servletPath != null && !requestUri.endsWith(servletPath)) {\n int pos = requestUri.indexOf(servletPath);\n if (pos > -1) {\n servletPath = requestUri.substring(requestUri.indexOf(servletPath));\n }\n }\n\n if (null != servletPath && !\"\".equals(servletPath)) {\n return servletPath;\n }\n\n int startIndex = \"\".equals(request.getContextPath()) ? 0 : request.getContextPath().length();\n int endIndex = request.getPathInfo() == null ? requestUri.length() : requestUri.lastIndexOf(request.getPathInfo());\n\n if (startIndex > endIndex) { // this should not happen\n endIndex = startIndex;\n }\n\n return requestUri.substring(startIndex, endIndex);\n }", "protected String getBaseDir(Element root) {\n\t\tString basedir = root.getAttribute(\"basedir\");\n\n\t\tif (basedir.length() == 0) {\n\t\t\t// No base dir defined\n\t\t\treturn null;\n\t\t}\n\n\t\tif (new File(basedir).isAbsolute()) {\n\t\t\t// An absolute base dir defined\n\t\t\treturn basedir;\n\t\t} else {\n\t\t\t// Append the current working directory to the relative base dir\n\t\t\treturn new File(System.getProperty(\"user.dir\"), basedir)\n\t\t\t\t\t.getAbsolutePath();\n\t\t}\n\t}", "public String getApplicationContext()\n {\n return configfile.getApplicationPath(getASPManager().getCurrentHostIndex());\n }", "@SuppressWarnings(\"unchecked\")\n public Map<String, String> getMapContextPath() {\n FacesContext facesContext = FacesContext.getCurrentInstance();\n ExternalContext extenalContext = facesContext.getExternalContext();\n HttpServletRequest request = (HttpServletRequest) extenalContext.getRequest();\n return (Map<String, String>) request.getSession().getAttribute(\"MAP_CONTEXT_PATH\");\n //xxx_temp end\n }", "public File getLocalCacheDirectory() {\n return pathsProvider.getLocalAcmCacheDir();\n }", "String getCookiePath()\n {\n return getApplicationContext();\n }", "public File getServiceRoot(String serviceName) {\n return new File(new File(new File(getRootDir(), ToolboxFoldersFileConstants.WEB_INF), ToolboxFoldersFileConstants.SERVICES), serviceName);\n }", "private String getFilePath(){\n\t\tif(directoryPath==null){\n\t\t\treturn System.getProperty(tmpDirSystemProperty);\n\t\t}\n\t\treturn directoryPath;\n\t}", "public File getHomeDir() {\n\t\tFile f = new File(System.getProperty(\"user.home\"),MuViChatConstants.muviHomeDir);\t\t\n if (!f.isDirectory()) {\n\t f.mkdir();\t \n\t }\n return f;\n\t}", "private String generateSavePath(HttpSession session) {\n try {\n\t\t\tint adminId = ((Admin) session.getAttribute(\"emm.admin\")).getAdminID();\n\t\t\tRandom random = new Random();\n\t\t\tint randomNum = random.nextInt();\n\t\t\tString savePath = AgnUtils.getTempDir() + File.separator +\n\t\t\t \"tmp_csv_file_\" + adminId + \"_\" + randomNum + \".csv\";\n\t\t\treturn savePath;\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Cannot create temp file path for upload file storage\", e);\n\t\t\treturn null;\n\t\t}\n }", "public String getWebappPathPrefix() {\n return webSiteProps.getWebappPathPrefix();\n }", "public static File getBaseDir()\n {\n return fBaseDir;\n }", "public static String getCurrentPath() {\n File file = new File(\"\");\n return file.getAbsolutePath();\n }", "public String getPath() {\n\t\treturn this.baseDir.getAbsolutePath();\n\t}", "public serverHttpHandler( String rootDir ) {\n this.serverHome = rootDir;\n }", "private static File getExternalCacheDir(Context context) {\n // TODO: This needs to be moved to a background thread to ensure no disk access on the\n // main/UI thread as unfortunately getExternalCacheDir() calls mkdirs() for us (even\n // though the Volley library will later try and call mkdirs() as well from a background\n // thread).\n return context.getExternalCacheDir();\n }", "public static String getUserDir() {\r\n\t\treturn userDir;\r\n\t}" ]
[ "0.71699566", "0.7055788", "0.6686687", "0.6612563", "0.65533996", "0.6525139", "0.6525139", "0.6525139", "0.6525139", "0.6479644", "0.63547873", "0.6330258", "0.63001263", "0.62684107", "0.62418336", "0.6191932", "0.6127235", "0.60964036", "0.60934955", "0.6071023", "0.6035355", "0.6009877", "0.5995221", "0.5980781", "0.5922239", "0.5868667", "0.58584946", "0.58496547", "0.58496547", "0.584665", "0.58457536", "0.58401555", "0.5840027", "0.5827639", "0.58112305", "0.5797302", "0.5797302", "0.5797302", "0.5780454", "0.5775971", "0.5771419", "0.57608306", "0.57522005", "0.5740335", "0.5724331", "0.572371", "0.5722581", "0.57196766", "0.57159096", "0.57080454", "0.5704753", "0.570365", "0.56884325", "0.56555057", "0.5651399", "0.5643389", "0.56393105", "0.5636662", "0.5633989", "0.56283677", "0.56036764", "0.55776393", "0.5563047", "0.55595523", "0.5545048", "0.553815", "0.5532247", "0.55315894", "0.5517622", "0.5517236", "0.55095637", "0.550457", "0.54992884", "0.5489444", "0.5487876", "0.5486817", "0.5482836", "0.5481853", "0.5480976", "0.54782337", "0.54773074", "0.54743546", "0.5473444", "0.5456164", "0.54515", "0.5443926", "0.5436509", "0.5436224", "0.5433808", "0.5433669", "0.5421287", "0.54211146", "0.5420762", "0.5419383", "0.54171354", "0.541229", "0.54066944", "0.5404358", "0.53953373", "0.53949815", "0.53935647" ]
0.0
-1
broadcasting have message to all it's neighbors
public static void broadcastHaveMessage(String peerID, byte[] pieceIndex){ for (RemotePeerInfo peer : Constants.listOfAllPeers) { if(!peer.peerID.equals(peerID)){ try { Message msg = new Message(1 + pieceIndex.length, 4, pieceIndex); byte[] msgByteArray = msg.createMessage(); utilities.writeToOutputStream(peer.out, msgByteArray); } catch (Exception e) { e.printStackTrace(); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void broadcast() {\n for (int i = 1; i <= nbMessagesToBroadcast; i++) {\n Message broadcastMsg = new Message(pid, pid, i,false, null);\n lcb.broadcast(broadcastMsg);\n logs.add(String.format(\"b %d\\n\",i));\n }\n }", "private void broadcast(String message)\n \t{\n \t\tfor(int i = 0; i < players.length; i++)\n \t\t{\n // PROTOCOL\n \t\t\tplayers[i].sendMessage(message);\n // PROTOCOL\n \t\t}\n \t}", "synchronized void broadcastMessage(Message message) throws InterruptedException {\n for (Neighbor neighbor : node.getNeighbors()) {\n if (!neighbor.getAddress().equals(message.getSender())) {\n neighbor.sendMessage(message);\n }\n }\n }", "@Override\n public void run()\n {\n try\n {\n MulticastSocket multicastSocket = new MulticastSocket(55559);\n //My chosen multicast ip.\n String multicastIP = \"224.0.159.82\";\n multicastSocket.joinGroup(InetAddress.getByName(multicastIP));\n //Receiver on continuous loop.\n while (receiverOn)\n {\n //Check network flag.\n if (frame.getSelectPanel().network())\n {\n DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);\n multicastSocket.receive(receivePacket);\n byte[] b = receivePacket.getData();\n System.out.println(\"Receive: \" + b.length);\n ByteArrayInputStream bis = new ByteArrayInputStream(b);\n ObjectInput in = new ObjectInputStream(bis);\n\n try\n {\n int[] data = (int[]) in.readObject();\n System.out.println(\"This: \" + frame.getId() + \"\\tFrom: \" + data[0]);\n //Exclude messages that originated at this peer.\n if (data[0] != frame.getId())\n {\n //Action based on int at data[1]\n switch (data[1])\n {\n case Draw.CLEAR:\n case Draw.DRAW:\n case Draw.TEXT:\n case Draw.CIRCLE:\n case Draw.IMAGE:\n frame.getDraw().put(data);\n break;\n case REQ_IP:\n int key = data[0];\n String ip = String.format(\"%d.%d.%d.%d\", data[2], data[3], data[4], data[5]);\n frame.getPeerCache().addPeer(new Triple<>(key, ip, data[6]));\n int size = frame.getPeerCache().getSize();\n frame.getPeerCount().setText(String.format(\"Peer count: %d\", size));\n int[] myIp = frame.getMyIp();\n size = frame.getActionCache().getSize();\n int[] ipAns = {frame.getId(), ANS_IP, myIp[0], myIp[1], myIp[2], myIp[3], size};\n frame.getBroadcaster().put(ipAns);\n break;\n case ANS_IP:\n /*\n * 0 = id\n * 1 = data type\n * 2,3,4,6 = IP\n */\n key = data[0];\n ip = String.format(\"%d.%d.%d.%d\", data[2], data[3], data[4], data[5]);\n frame.getPeerCache().addPeer(new Triple<>(key, ip, data[6]));\n frame.getPeerCount().setText(\n String.format(\"Peer count: %d\", frame.getPeerCache().getSize()));\n break;\n case LEAVE_NOTE:\n ip = String.format(\"%d.%d.%d.%d\", data[2], data[3], data[4], data[5]);\n frame.getPeerCache().removePeer(ip);\n frame.getPeerCount().setText(\n String.format(\"Peer count: %d\", frame.getPeerCache().getSize()));\n break;\n case REQ_HISTORY:\n /*\n * 0 = id\n * 1 = data type\n * 2 = tarID\n * 3,4,5,6 = IP\n */\n if (data[2] == frame.getId())\n {\n ip = String.format(\"%d.%d.%d.%d\", data[3], data[4], data[5], data[6]);\n System.out.println(\"History request from \" + ip);\n UdpClient historyClient = new UdpClient(ip, frame.getActionCache());\n Thread historyThread = new Thread(historyClient);\n historyThread.start();\n }\n break;\n case CLEAR_REQ:\n String reqTitle = String.format(\"Peer %d has requested a clear.\", data[1]);\n int dialogResult = JOptionPane.showConfirmDialog(frame, \"Would you like to clear?\",\n reqTitle,\n JOptionPane.YES_NO_OPTION);\n if (dialogResult == JOptionPane.YES_OPTION)\n {\n int[] clear = {frame.getId(), Draw.CLEAR};\n frame.getDraw().put(clear);\n frame.clearAll();\n }\n break;\n case IMAGE_REQ:\n System.out.print(\"IMAGE REQUEST: \");\n System.out.println(data[2] + \" vs \" + frame.getId());\n if (data[2] == frame.getId())\n {\n ip = String.format(\"%d.%d.%d.%d\", data[4], data[5], data[6], data[7]);\n System.out.println(\"Image request from \" + ip);\n BufferedImage image = frame.getImageCache().get(data[3], data[7]);\n\n TcpClient tcpClient = new TcpClient(ip, image);\n Thread tcpThread = new Thread(tcpClient);\n tcpThread.start();\n }\n break;\n default:\n //Rogue packet protection.\n System.out.println(\"Received invalid packet.\");\n System.out.println(Arrays.toString(data));\n }\n }\n } catch (ClassNotFoundException | IndexOutOfBoundsException e)\n {\n //Rogue packet protection.\n //Message given, loop continues.\n System.out.println(\"Exception: Received invalid packet.\");\n e.printStackTrace();\n }\n }\n }\n } catch (IOException | InterruptedException e)\n {\n System.err.println(\"Error in Receiver class.\");\n System.err.println(e.getMessage());\n e.printStackTrace();\n }\n }", "public void broadcast(Object msg);", "@Override\r\n\t\t\tpublic void broadcast(ID source, ID target, Boolean hit) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n public void broadcast(T msg) {\n for (Integer i : activeUsers.keySet()) {\n this.send(Integer.valueOf(i), msg);\n }\n\n }", "public final void broadcast()\n\t{\n\t\ttopic.broadcast(originalMessage);\n\t}", "@Override\n\tpublic void forceStateBroadcast() {\n\t\tpeerDiscoveryService.sendStateMulticast();\n\t}", "public static void opBroadcast(String message){\n JawaChat.opsOnline.values().forEach((target) -> {\n target.sendMessage(message);\n });\n logMessage(message, \"op channel\");\n }", "private void broadcast(ArrayList<Integer> update){\n for (Player p : players.values()){\n p.sendModel(update);\n }\n }", "private static void multicast(String msg) {\n \tfor(int id : IPs.keySet()) {\n \t\ttry {\n \t\t\tunicast_send(id, msg);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n \t}\n }", "@Override\n public void broadcastBlock(final Block block) {}", "public void broadcastMessage(String message) {\n for (WebSocket conn : reverseMap.keySet()) {\n conn.send(message);\n }\n }", "public void broadcast(byte[] data)\n\t{\n\t\tfor(Connection c : CLIENTS)\n\t\t{\n\t\t\tsend(new Packet(data, c.getAddress(), c.getPort()));\n\t\t}\n\t}", "public void broadCast(InfinispanComMessage infinispanComMessage){\n for(String node: nodes.keySet()){\n if(!node.equals(InfinispanComNode.COORDINATOR)){\n nodes.put(node, infinispanComMessage);\n }\n }\n }", "public void broadcastToChannelMembers(L2GameServerPacket gsp) \r\n\t{\r\n\t\tif (_partys != null)\r\n\t\t\tfor (L2Party party : _partys)\r\n\t\t\t\tif (party != null)\r\n\t\t\t\t\tparty.broadcastToPartyMembers(gsp);\r\n\t}", "public void Bcast(int[] data, int root) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tEntered Bcast int[]\");\n }\n\n int size = group_.Size();\n int old_rank = Rank();\n int rank = relativeRank(root,old_rank,size);\n\n int dest;\n int src;\n\n boolean received = false;\n\n Message send;\n Message recv = null;\n\n /*\n * Error checking\n */\n\n /*\n * Binary-tree broadcast\n */\n for (int stage = 0; stage < (int)Math.ceil(Math.log(size)/Math.log(2)); stage++) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tRank: \" + old_rank + \", Relative rank: \" + rank + \" Stage: \" + stage);\n }\n\n // Receive stage\n if (rank < Math.pow(2,stage+1) && rank >= Math.pow(2,stage)) {\n\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\t\" + rank + \" is receiving from \" + (rank - (Math.pow(2,stage))));\n }\n\n // Copy the received message into recv.\n recv = group_.Recv(originalRank(root, (int)(rank-Math.pow(2,stage)), size), BROADCAST_TAG);\n // Set received to true\n received = true;\n\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\t\" + rank + \" received OK\");\n System.err.println(\"Array has length: \" + recv.dataToPrimitiveInt().length);\n System.err.println(\"Data has length: \" + data.length);\n }\n\n if (recv.getType() != Message.TYPE_INT) {\n throw new MpiException(\"Message types do not match, please check your tag usage\");\n }\n else {\n System.arraycopy(recv.dataToPrimitiveInt(), 0, data, 0, recv.dataToPrimitiveInt().length);\n }\n }\n\n // Send stage\n else if (rank < Math.pow(2,stage) && (rank+Math.pow(2,stage)) < size) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\t\" + rank + \" is sending to \" + (int)(rank + Math.pow(2,stage)));\n }\n\n // If a message has been received then recycle this and update its source before sending it on.\n if (received) {\n send = recv;\n send.setSource(originalRank(root,rank,size));\n }\n // Otherwise read in the values from the given data (this should only happen at the \"root\")\n else {\n send = new Message(Message.dataToByteArray(data), originalRank(root,rank,size), BROADCAST_TAG, Message.TYPE_INT);\n recv = send;\n received = true;\n }\n\n // Send the message\n group_.Send(send, originalRank(root, (int)(rank+Math.pow(2,stage)), size));\n }\n }\n\n BROADCAST_TAG--;\n }", "private void broadcast(String msg) {\n\t\tIterator i = onlineUsers.entrySet().iterator();\n\t\t\n\t\twhile (i.hasNext()) {\n\t\t\tMap.Entry p = (Map.Entry)i.next();\n\t\t\tUser u = (User)p.getValue();\n\t\t\t\n\t\t\tu.output.println(msg);\n\t\t}\n\t}", "@Override\n public void sendMessageToAllEdges(Vertex<OID_T, VDATA_T, EDATA_T> vertex, OUT_MSG_T message) {\n VertexImpl<GS_VID_T, OID_T, VDATA_T, EDATA_T> vertexImpl =\n (VertexImpl<GS_VID_T, OID_T, VDATA_T, EDATA_T>) vertex;\n\n long lid = vertexImpl.getLocalId();\n long offset = idParser.getOffset(lid);\n long oeBeginOffset = JavaRuntime.getLong(offsetBeginPtrFirstAddr + offset * 8);\n long oeEndOffset = JavaRuntime.getLong(offsetEndPtrFirstAddr + offset * 8);\n long curAddress = nbrUnitInitAddress + nbrUnitEleSize * oeBeginOffset;\n long endAddress = nbrUnitInitAddress + nbrUnitEleSize * oeEndOffset;\n\n while (curAddress < endAddress) {\n nbrUnit.setAddress(curAddress);\n grapeVertex.setValue((GS_VID_T) nbrUnit.vid());\n sendMessage(grapeVertex, message);\n curAddress += nbrUnitEleSize;\n }\n\n // send msg through outgoing adjlist\n // AdjList<GS_VID_T, ?> adaptorAdjList = fragment.getOutgoingAdjList(grapeVertex);\n //\n // for (NbrBase<GS_VID_T, ?> nbr : adaptorAdjList.nbrBases()) {\n // com.alibaba.graphscope.ds.Vertex<GS_VID_T> curVertex = nbr.neighbor();\n // sendMessage(curVertex, message);\n // }\n\n }", "public void Bcast(float[] data, int root) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tEntered Bcast float[]\");\n }\n\n int size = group_.Size();\n int old_rank = Rank();\n int rank = relativeRank(root,old_rank,size);\n\n int dest;\n int src;\n\n boolean received = false;\n\n Message send;\n Message recv = null;\n\n /*\n * Error checking\n */\n\n /*\n * Binary-tree broadcast\n */\n for (int stage = 0; stage < (int)Math.ceil(Math.log(size)/Math.log(2)); stage++) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tRank: \" + old_rank + \", Relative rank: \" + rank + \" Stage: \" + stage);\n }\n\n // Receive stage\n if (rank < Math.pow(2,stage+1) && rank >= Math.pow(2,stage)) {\n\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\t\" + rank + \" is receiving from \" + (rank - (Math.pow(2,stage))));\n }\n\n // Copy the received message into recv.\n recv = group_.Recv(originalRank(root, (int)(rank-Math.pow(2,stage)), size), BROADCAST_TAG);\n // Set received to true\n received = true;\n\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\t\" + rank + \" received OK\");\n }\n\n if (recv.getType() != Message.TYPE_FLOAT) {\n throw new MpiException(\"Message types do not match, please check your tag usage\");\n }\n else {\n System.arraycopy(recv.dataToPrimitiveFloat(), 0, data, 0, recv.dataToPrimitiveFloat().length);\n }\n }\n\n // Send stage\n else if (rank < Math.pow(2,stage) && (rank+Math.pow(2,stage)) < size) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\t\" + rank + \" is sending to \" + (int)(rank + Math.pow(2,stage)));\n }\n\n // If a message has been received then recycle this and update its source before sending it on.\n if (received) {\n send = recv;\n send.setSource(originalRank(root,rank,size));\n }\n // Otherwise read in the values from the given data (this should only happen at the \"root\")\n else {\n send = new Message(Message.dataToByteArray(data), originalRank(root,rank,size), BROADCAST_TAG, Message.TYPE_FLOAT);\n recv = send;\n received = true;\n }\n\n // Send the message\n group_.Send(send, originalRank(root, (int)(rank+Math.pow(2,stage)), size));\n }\n }\n\n BROADCAST_TAG--;\n }", "private void broadcastVertexId() throws IOException {\r\n\t\tPageRankWritable msg = new PageRankWritable();\r\n\t\tmsg.setSenderId(getVertexID());\r\n\t\tsendMessageToNeighbors(msg);\r\n\t}", "public void broadcast(android.os.Message r11) {\n /*\n r10 = this;\n monitor-enter(r10);\n r9 = r10.mReg;\t Catch:{ all -> 0x0036 }\n if (r9 != 0) goto L_0x0007;\n L_0x0005:\n monitor-exit(r10);\t Catch:{ all -> 0x0036 }\n L_0x0006:\n return;\n L_0x0007:\n r4 = r11.what;\t Catch:{ all -> 0x0036 }\n r5 = r10.mReg;\t Catch:{ all -> 0x0036 }\n r3 = r5;\n L_0x000c:\n r9 = r3.senderWhat;\t Catch:{ all -> 0x0036 }\n if (r9 < r4) goto L_0x002f;\n L_0x0010:\n r9 = r3.senderWhat;\t Catch:{ all -> 0x0036 }\n if (r9 != r4) goto L_0x0034;\n L_0x0014:\n r7 = r3.targets;\t Catch:{ all -> 0x0036 }\n r8 = r3.targetWhats;\t Catch:{ all -> 0x0036 }\n r2 = r7.length;\t Catch:{ all -> 0x0036 }\n r0 = 0;\n L_0x001a:\n if (r0 >= r2) goto L_0x0034;\n L_0x001c:\n r6 = r7[r0];\t Catch:{ all -> 0x0036 }\n r1 = android.os.Message.obtain();\t Catch:{ all -> 0x0036 }\n r1.copyFrom(r11);\t Catch:{ all -> 0x0036 }\n r9 = r8[r0];\t Catch:{ all -> 0x0036 }\n r1.what = r9;\t Catch:{ all -> 0x0036 }\n r6.sendMessage(r1);\t Catch:{ all -> 0x0036 }\n r0 = r0 + 1;\n goto L_0x001a;\n L_0x002f:\n r3 = r3.next;\t Catch:{ all -> 0x0036 }\n if (r3 != r5) goto L_0x000c;\n L_0x0033:\n goto L_0x0010;\n L_0x0034:\n monitor-exit(r10);\t Catch:{ all -> 0x0036 }\n goto L_0x0006;\n L_0x0036:\n r9 = move-exception;\n monitor-exit(r10);\t Catch:{ all -> 0x0036 }\n throw r9;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.os.Broadcaster.broadcast(android.os.Message):void\");\n }", "public void onReceiveGetNeighbours(GetNeighboursMessage message) {\n if (routing.get(message.sender) == null) {\n //Note: should exist cause neighbour\n routing.put(message.sender, routing.get(message.lastSender));\n }\n if (message.receiver == id) {\n // we are the destination\n Set<Integer> neighbourIds = neighbours.stream().map(Bunker::getId).collect(Collectors.toSet());\n GiveNeighboursMessage giveNeighboursMessage = new GiveNeighboursMessage();\n giveNeighboursMessage.receiver = message.sender;\n giveNeighboursMessage.sender = id;\n giveNeighboursMessage.ids = neighbourIds;\n sendGiveNeighbours(giveNeighboursMessage);\n } else {\n // route to destination\n message.lastSender = id;\n // we should know receiver at this step\n sendGetNeighbours(message);\n }\n }", "public void broadcast(String msg, TBGPCommand command) {\n\t\tplayers.forEach((k,v) -> k.sendMessage(new TBGPMessage(command,msg)));\n\t}", "public List<Transmission> broadcastMessage(\n Iterable<NetworkDestination> destinations, MendelMessage message)\n throws IOException {\n List<Transmission> transmissions = new ArrayList<>();\n for (NetworkDestination destination : destinations) {\n Transmission trans = sendMessage(destination, message);\n transmissions.add(trans);\n }\n return transmissions;\n }", "public int publishToAll(Message message);", "private static void broadcastLandingLocations() {\n ArrayList<Pair<Integer, Integer>> ccBySize = new ArrayList<>();\n for (int cc = 1; cc < CONNECTED_COMPONENT_SIZES.size(); ++cc) {\n ccBySize.add(new Pair<Integer, Integer>(cc, CONNECTED_COMPONENT_SIZES.get(cc)));\n }\n // Sort connected components by size, decreasing\n ccBySize.sort(new Comparator<Pair<Integer, Integer>>() {\n @Override\n public int compare(Pair<Integer, Integer> o1, Pair<Integer, Integer> o2) {\n return o2.getSecond() - o1.getSecond();\n }\n });\n int[][] locationsWithinCC = new int[CONNECTED_COMPONENT_SIZES.size()][];\n ArrayList<HashSet<Integer>> landingCoordinates = new ArrayList<>(CONNECTED_COMPONENT_SIZES.size());\n for (int cc = 0; cc < CONNECTED_COMPONENT_SIZES.size(); ++cc) {\n locationsWithinCC[cc] = new int[CONNECTED_COMPONENT_SIZES.get(cc)];\n landingCoordinates.add(new HashSet<>());\n }\n // Indices within locationsWithinCC arrays\n int[] locationsWithinCCIndices = new int[CONNECTED_COMPONENT_SIZES.size()];\n for (int r = 0; r < MAP_HEIGHT; ++r) {\n for (int c = 0; c < MAP_WIDTH; ++c) {\n int cc = CONNECTED_COMPONENTS[r][c];\n if (cc == IMPASSIBLE_TERRAIN) continue;\n int coord = (r << 16) | c;\n locationsWithinCC[cc][locationsWithinCCIndices[cc]++] = coord;\n }\n }\n //System.out.println(Arrays.deepToString(locationsWithinCC));\n int communicationArrayIndex = 1;\n int totalNumCoords = 0; // Keep track of the size of a set of landing coordinates that spans all connected components\n // Fill communication array until we can no longer fit a set of totalNumCoords into the array\n while (COMMUNICATION_ARRAY_LENGTH - communicationArrayIndex >= totalNumCoords) {\n totalNumCoords = 0;\n // Choose (cc size)^(1/4) locations in each cc\n for (int cc = 1; cc < CONNECTED_COMPONENT_SIZES.size(); ++cc) {\n HashSet<Integer> chosenCoords = landingCoordinates.get(cc);\n // Clear any previously generated landing locations for each connected component\n chosenCoords.clear();\n // Generate new unique landing locations (not necessarily distinct from previously generated locations)\n int numDesiredCoords = (int) Math.pow(CONNECTED_COMPONENT_SIZES.get(cc), 1d/4d);\n int[] locations = locationsWithinCC[cc];\n for (; chosenCoords.size() < numDesiredCoords;) {\n int randCoord = locations[rand.nextInt(locations.length)];\n chosenCoords.add(randCoord);\n }\n totalNumCoords += numDesiredCoords;\n }\n if (totalNumCoords > COMMUNICATION_ARRAY_LENGTH - communicationArrayIndex) {\n // Prevent overflow of communication array\n break;\n }\n //for (int cc = 1; cc < CONNECTED_COMPONENT_SIZES.size(); ++cc) {\n // System.out.println(landingCoordinates.get(cc));\n //}\n // Write landing locations to communication array in decreasing order of connected component size\n for (Pair<Integer, Integer> ccSizePair : ccBySize) {\n int cc = ccSizePair.getFirst();\n for (Integer coord : landingCoordinates.get(cc)) {\n gc.writeTeamArray(communicationArrayIndex, coord);\n ++communicationArrayIndex;\n }\n }\n }\n gc.writeTeamArray(0, communicationArrayIndex - 1); // write number of generated landing locations\n }", "public void Bcast(long[] data, int root) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tEntered Bcast long[]\");\n }\n\n int size = group_.Size();\n int old_rank = Rank();\n int rank = relativeRank(root,old_rank,size);\n\n int dest;\n int src;\n\n boolean received = false;\n\n Message send;\n Message recv = null;\n\n /*\n * Error checking\n */\n\n /*\n * Binary-tree broadcast\n */\n for (int stage = 0; stage < (int)Math.ceil(Math.log(size)/Math.log(2)); stage++) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tRank: \" + old_rank + \", Relative rank: \" + rank + \" Stage: \" + stage);\n }\n\n // Receive stage\n if (rank < Math.pow(2,stage+1) && rank >= Math.pow(2,stage)) {\n\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\t\" + rank + \" is receiving from \" + (rank - (Math.pow(2,stage))));\n }\n\n // Copy the received message into recv.\n recv = group_.Recv(originalRank(root, (int)(rank-Math.pow(2,stage)), size), BROADCAST_TAG);\n // Set received to true\n received = true;\n\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\t\" + rank + \" received OK\");\n }\n\n if (recv.getType() != Message.TYPE_LONG) {\n throw new MpiException(\"Message types do not match, please check your tag usage\");\n }\n else {\n System.arraycopy(recv.dataToPrimitiveLong(), 0, data, 0, recv.dataToPrimitiveLong().length);\n }\n }\n\n // Send stage\n else if (rank < Math.pow(2,stage) && (rank+Math.pow(2,stage)) < size) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\t\" + rank + \" is sending to \" + (int)(rank + Math.pow(2,stage)));\n }\n\n // If a message has been received then recycle this and update its source before sending it on.\n if (received) {\n send = recv;\n send.setSource(originalRank(root,rank,size));\n }\n // Otherwise read in the values from the given data (this should only happen at the \"root\")\n else {\n send = new Message(Message.dataToByteArray(data), originalRank(root,rank,size), BROADCAST_TAG, Message.TYPE_LONG);\n recv = send;\n received = true;\n }\n\n // Send the message\n group_.Send(send, originalRank(root, (int)(rank+Math.pow(2,stage)), size));\n }\n }\n\n BROADCAST_TAG--;\n }", "public void Bcast(double[] data, int root) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tEntered Bcast double[]\");\n }\n\n int size = group_.Size();\n int old_rank = Rank();\n int rank = relativeRank(root,old_rank,size);\n\n int dest;\n int src;\n\n boolean received = false;\n\n Message send;\n Message recv = null;\n\n /*\n * Error checking\n */\n\n /*\n * Binary-tree broadcast\n */\n for (int stage = 0; stage < (int)Math.ceil(Math.log(size)/Math.log(2)); stage++) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tRank: \" + old_rank + \", Relative rank: \" + rank + \" Stage: \" + stage);\n }\n\n // Receive stage\n if (rank < Math.pow(2,stage+1) && rank >= Math.pow(2,stage)) {\n\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\t\" + rank + \" is receiving from \" + (rank - (Math.pow(2,stage))));\n }\n\n // Copy the received message into recv.\n recv = group_.Recv(originalRank(root, (int)(rank-Math.pow(2,stage)), size), BROADCAST_TAG);\n // Set received to true\n received = true;\n\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\t\" + rank + \" received OK\");\n }\n\n if (recv.getType() != Message.TYPE_DOUBLE) {\n throw new MpiException(\"Message types do not match, please check your tag usage\");\n }\n else {\n System.arraycopy(recv.dataToPrimitiveDouble(), 0, data, 0, recv.dataToPrimitiveDouble().length);\n }\n }\n\n // Send stage\n else if (rank < Math.pow(2,stage) && (rank+Math.pow(2,stage)) < size) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\t\" + rank + \" is sending to \" + (int)(rank + Math.pow(2,stage)));\n }\n\n // If a message has been received then recycle this and update its source before sending it on.\n if (received) {\n send = recv;\n send.setSource(originalRank(root,rank,size));\n }\n // Otherwise read in the values from the given data (this should only happen at the \"root\")\n else {\n send = new Message(Message.dataToByteArray(data), originalRank(root,rank,size), BROADCAST_TAG, Message.TYPE_DOUBLE);\n recv = send;\n received = true;\n }\n\n // Send the message\n group_.Send(send, originalRank(root, (int)(rank+Math.pow(2,stage)), size));\n }\n }\n\n BROADCAST_TAG--;\n }", "private void broadcast(String msg) {\n\t\tfor (PrintWriter out : clients) {\n\t\t\tout.println(msg);\n\t\t\tout.flush();\n\t\t}\n\t}", "private AddrBroadcast(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public void broadcast(CommonPacket packet) {\n super.broadcast(packet);\n }", "public void sendGetNeighbours(GetNeighboursMessage message) {\n routing.get(message.receiver).onReceiveGetNeighbours(message);\n }", "public void broadcastMsg(String msg) {\n for (Client c : sockets) {\n c.sendMessage(msg);\n }\n }", "public void broadcast(DefinedPacket packet)\n {\n for (UserConnection con : connections.values())\n {\n con.packetQueue.add(packet);\n }\n }", "public void broadcast(String message) throws BroadcastException {\n\t\t\n\t}", "public void broadcast(PacketHandle packet) {\n super.broadcast(packet);\n }", "synchronized void sendTo(Message message, InetSocketAddress receiver) throws InterruptedException {\n Neighbor neighbor = node.getNeighbor(receiver);\n if (neighbor != null) {\n neighbor.sendMessage(message);\n }\n }", "public void multicast(MessageType mt, Object o) {\n\t\tMap<ITrObjectRepresentation, List<String>> advertised = ai.getAdvertisedObjects();\n\t\tfor (ICameraController icc : camController.getNeighbours()) {\n camController.sendMessage(icc.getName(), mt, o);\n \n if (mt == MessageType.StartSearch) {\n List<String> cams = advertised.get((ITrObjectRepresentation) o);\n ai.incrementSentMessages();\n if (cams != null) {\n if (!cams.contains(icc.getName())) {\n cams.add(icc.getName());\n }\n } else {\n cams = new ArrayList<String>();\n cams.add(icc.getName());\n advertised.put((ITrObjectRepresentation) o, cams);\n }\n }\n }\n if (mt == MessageType.StopSearch) {\n advertised.remove((ITrObjectRepresentation) o);\n }\n\t}", "void send(StrictBitVector messageZero, StrictBitVector messageOne);", "public void broadcastPacket(Message packet) {\n CacheFactory.doClusterTask(new BroadcastMessage(packet));\n }", "public void Gossipalgorithm() {\n\t\tint T = numofConnections();\n\t\tint t = 0;\n\t\tint rounds = 0;\n\t\tint size = Sizeofnetwork();\n\t\tint connections;\n\t\tString[] nodeswithMessage, nodetorecieve;\n\t\tnodeswithMessage = new String [size];\n\t\t\n\t\tArrays.fill(nodeswithMessage, \"null\");\n\t\t\n\t\t//while the number of nodes with message is not equal to the number of nodes\n\t\twhile ((rounds != size)) {\n\t\t\tconnections = 0;\n\t\t\tnumofnodewithmessage = 0;\n\t\t\tint ab = 0;\n\t\t\t//update on which nodes has recieved the message\n\t\t\tArrays.fill(nodeswithMessage, \"null\");\n\t\t\tfor (String nodes : Push.outputNodes) {\n\t\t\t\tnodeswithMessage[ab] = nodes;\n\t\t\t\tab++;\n\t\t\t}\n\t\t\t//how many nodes has recieved message\n\t\t\tfor (int l=0; l<nodeswithMessage.length; l++) {\n\t\t\t\tif(!nodeswithMessage[l].equals(\"null\")) {\n\t\t\t\t\tnumofnodewithmessage++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//set array to host nodes with message\n\t\t\tnodetorecieve = new String[numofnodewithmessage];\n\t\t\tint flip = 0;\n\t\t\tfor (int a = 0; a < nodeswithMessage.length; a++) {\n\t\t\t\tif (!nodeswithMessage[a].equals(\"null\")) {\n\t\t\t\t\tnodetorecieve[flip] = nodeswithMessage[a];\n\t\t\t\t\tflip++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//for all the nodes with message, randomly choose a node in its connected nodes mapping, specified in the \n\t\t\t//Nodeswithconnect Hashmap to send the message to\n\t\t\tfor (int i = 0; i < nodetorecieve.length; i++) {\n\t\t\t\tconnections = 0;\n\t\t\t\tfor (int p=0; p < (Nodeswithconnect.get(nodetorecieve[i])).length; p++) {\n\t\t\t\t\tconnections++;\n\t\t\t\t}\n\t\t\t\tint rand = new Random().nextInt(connections);\n\t\t\t\tnetworkk.setMessage(Nodeswithconnect.get(nodetorecieve[i])[rand]);\n\t\t\t\t\n\t\t\t}\n\t\t\t//update the number of nodes with message.\n\t\t\trounds = numofnodewithmessage;\n\t\t\t//delay for some interval\n\t\t\ttry {\n\t\t\t\tThread.sleep(500);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public abstract boolean broadcast() throws IOException;", "public void broadCastMessage(String message){\n\t\tfor (Socket s : connectedClientSockets){\n\t\t\tsendMsgToSocket(message, s);\n\t\t}\n\t}", "public void initiate() {\n // all we know is neighbours\n Set<Integer> idsToSend = neighbours.stream().map(Bunker::getId).collect(Collectors.toSet());\n sendGetCount(idsToSend);\n }", "@Override\n public void run() {\n //gets messages\n byte[] b = new byte[65000];\n try {\n multicastSocket = new MulticastSocket(mcastPort);\n multicastSocket.joinGroup(InetAddress.getByName(mscastAdress));\n\n while (true) {\n try {\n DatagramPacket received = new DatagramPacket(b, b.length);\n multicastSocket.receive(received);\n DealWithPacketBackup deal = new DealWithPacketBackup(received , multicastSocket , Peer.getPeerId());\n Peer.getExecutor().execute(deal);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public SuperPeer forward(String command, Message message) {\n IPv4 neighbor;\n Socket nSock;\n DataOutputStream toNeighbor;\n\n message.decrementTTL().setSender(this.getAddress());\n for (String n : this.neighbors) {\n try {\n this.log(String.format(\"-> Forwarding '%s %s' to (%s)\", command, message, n));\n neighbor = new IPv4(n);\n // forward the message to each, with the TTL decremented\n nSock = new Socket(neighbor.getAddress(), neighbor.getPort());\n toNeighbor = new DataOutputStream(nSock.getOutputStream());\n\n toNeighbor.writeUTF(this.toString()); // initial handshake\n toNeighbor.writeUTF(String.format(\"%s %s\", command, message));\n nSock.close();\n } catch (Exception e) {\n this.log(String.format(\"-> Could not connect to (%s). Is it live?\", n));\n }\n }\n return this;\n }", "public void receive(){\n for (int i = 0; i < neurons.size(); i++){\n neurons.get(i).calculateActivation();\n }\n }", "@Override\n \t\t\tpublic void run ()\n \t\t\t{\n \t\t\t\tsynchronized ( heard )\n \t\t\t\t{\n \t\t\t\t\theard.clear ();\n \t\t\t\t}\n \t\t\t\t// re-transmit own until not in a block\n \t\t\t\tsynchronized ( own )\n \t\t\t\t{\n \t\t\t\t\tif ( !own.isEmpty () )\n \t\t\t\t\t{\n \t\t\t\t\t\tfor ( BitcoinPeer peer : network.getConnectPeers () )\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tInvMessage tm = (InvMessage) peer.createMessage (\"inv\");\n \t\t\t\t\t\t\tfor ( Tx t : own )\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tlog.debug (\"Re-broadcast \" + t.getHash ());\n \t\t\t\t\t\t\t\ttm.getTransactionHashes ().add (new Hash (t.getHash ()).toByteArray ());\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tpeer.send (tm);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}", "private void sendBroadcast(String messageStr) {\n StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();\n StrictMode.setThreadPolicy(policy);\n byte[] sendData = messageStr.getBytes();\n try {\n DatagramSocket sendSocket = new DatagramSocket(null);\n sendSocket.setReuseAddress(true);\n sendSocket.bind(new InetSocketAddress(9876));\n sendSocket.setBroadcast(true);\n\n //Broadcast to all IP addresses on subnet\n try {\n DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, InetAddress.getByName(\"255.255.255.255\"), 9876);\n sendSocket.send(sendPacket);\n Log.i(getClass().getName(), \"Request packet sent to: 255.255.255.255 (DEFAULT)\");\n } catch (Exception e) {\n Log.e(\"sendBroadcast\", \"IOException: \" + e.getMessage());\n }\n } catch (IOException e) {\n Log.e(\"sendBroadcast\", \"IOException: \" + e.getMessage());\n }\n }", "private void forwardMessageToAll(Message m) {\n for (GuestToken tok: guestTokens.values())\n {\n tok.sendMessage(m);\n }\n for (EmployeeToken tok: employeeTokens.values())\n {\n tok.sendMessage(m);\n }\n }", "@Override\n\t\t\t\t\tpublic Method handleBroadcastMethod(Element parent,\n\t\t\t\t\t\t\tFBroadcast src) {\n\t\t\t\t\t\treturn super.handleBroadcastMethod(parent, src);\n\t\t\t\t\t}", "void sendMulticast(String message);", "@Override\n\tpublic void BroadcastMessage(String message) {\n\t\t\n\t\ttry\n\t\t{\n\t\tfor(Socket s : clients)\n\t\t{\n\t\t\tprintWriters.get(s).println(message);\n\t\t}\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void uponNeighbourUp(NeighbourUp notification, short sourceProto) {\n for(Host h: notification.getNeighbours()) {\n neighbours.add(h);\n logger.info(\"New neighbour: \" + h);\n eagerPushPeers.add(h);\n }\n }", "void broadCastMessageLocal(Message message) {\n/* 1691 */ if (this.creatures != null)\n/* 1692 */ for (Iterator<Creature> it = this.creatures.iterator(); it.hasNext(); ) {\n/* */ \n/* 1694 */ Creature creature = it.next();\n/* 1695 */ if (!creature.getCommunicator().isInvulnerable()) {\n/* 1696 */ creature.getCommunicator().sendMessage(message);\n/* */ }\n/* */ } \n/* */ }", "protected int route(byte buffer[], int source) {\n \n // Get the message level\n byte messageLevel = getMessageLevel( buffer );\n // get the messageID\n byte messageID[] = getMessageID( buffer );\n \n // Check that the message was not received before\n if( messageIsNew( messageID )){\n \trecordMessageID( messageID );\n }\n else{\n \treturn Constants.SUCCESS;\n }\n \n // If I am not the sender of the message\n // add it to the message queue\n if (messageLevel == Constants.MESSAGE_ALL && source != Constants.SRC_ME){\n // Add message to message queue\n \taddMessageToQueue( buffer );\n }\n else if (messageLevel == Constants.MESSAGE_TARGET){\n \tbyte[] target = getTarget( buffer );\n \tif (target == this.address) {\n \t\t//Add to the message queue\n \t\treturn Constants.SUCCESS; //DO NOT send to all threads.\n \t}\n }\n \n // Send the message to all the threads\n synchronized (this.rwThreads) {\n for (ReadWriteThread aThread : rwThreads) {\n Log.d(TAG, \"Writing to device on thread: \" + aThread.getName());\n aThread.write(buffer);\n }\n }\n \n return Constants.SUCCESS;\n }", "public void sendMessageToAllClients(MessageWrapper message) {\n sendMessageToServer(message);\n\n for (SendenDevice device : clientsConnected.values()) {\n if (!device.getDeviceMac().equals(wiFiP2PInstance.getThisDevice().getDeviceMac())) {\n sendMessage(device, message);\n }\n }\n }", "public void broadcast(String message){\n Iterator it = subscribedClientsOutputStreams.iterator(); \n while(it.hasNext()){\n try{\n PrintWriter writer = (PrintWriter) it.next();\n writer.println(message);\n writer.flush();\n }catch(Exception ex){\n ex.printStackTrace();\n }\n }\n }", "@Override\n public void run() {\n String message = router.toString() + \"/\" + router.toString() + \"/\" + 0 + \"/\" + router.getPort() + \"/\";\n Set<Map.Entry<Node, Double>> neighbours = router.getNeighbours().entrySet();\n for (Map.Entry<Node, Double> m : neighbours) {\n Node n = m.getKey();\n message += n.toString() + \" \" + m.getValue() + \" \" + n.getPort() + \"/\";\n }\n buffer.initLSA(router.toString(), message);\n\n Processor p = new Processor(network, processing_buffer, router, nodeSequence);\n new Thread(p).start();\n\n for (Node n : router.getNeighbours().keySet()) {\n heartBeat.put(n.toString(), 0);\n }\n\n receive();\n }", "public void broadcastmsg(String msg){\r\n Server.getUsers().forEach((user) -> {\r\n user.sendmsg(msg);\r\n });\r\n }", "private void push() {\n ImmutableSortedSet<T> myAvailable = _outstanding.apply(\n new Syncd.Transformer<ImmutableSortedSet<T>, ImmutableSortedSet<T>>() {\n public Tuple<ImmutableSortedSet<T>, ImmutableSortedSet<T>> apply(ImmutableSortedSet<T> aBefore) {\n final SortedSet<T> myRemaining = new TreeSet<>(new MessageComparator<T>());\n\n // Identify those messages that are sequentially contiguous from _floor and can be passed on\n //\n ImmutableSortedSet<T> myAccessible =\n new ImmutableSortedSet.Builder<>(new MessageComparator<T>()).addAll(\n Iterables.filter(aBefore, new Predicate<T>() {\n public boolean apply(T aMessage) {\n Long myCurrent = _floor.get();\n\n if (aMessage.getSeq() == myCurrent) {\n // This message can be sent out to listeners so long as we're first to try\n //\n if (_floor.testAndSet(myCurrent, myCurrent + 1))\n return true;\n } else\n // This message must remain\n //\n myRemaining.add(aMessage);\n\n // Couldn't send message out or it must remain\n //\n return false;\n }\n })\n ).build();\n\n return new Tuple<>(new ImmutableSortedSet.Builder<>(\n new MessageComparator<T>()).addAll(myRemaining).build(),\n myAccessible);\n }\n }\n );\n\n send(myAvailable);\n archive(myAvailable);\n }", "private void send()\n {\n\n\tRouterPacket pkt;\n if(poisonEnabled){\n\t // Create a false distance table\n int[] tmpDistTable = new int[RouterSimulator.NUM_NODES];\n System.arraycopy(myDistTable,0,tmpDistTable,0,RouterSimulator.NUM_NODES);\n for(int i = 0;i<neighbours.length;i++){\n if(neighbours[i]){\n\t\t //Poisoned reverse\n for(int j = 0;j<route.length;j++){\n\t\t\t// All routes that goes through my node, set to infinity\n if(route[j] == i && j!=i){\n tmpDistTable[j] = RouterSimulator.INFINITY;\n }\n }\n\t\t // Send new packet\n pkt = new RouterPacket(myID,i,tmpDistTable);\n sendUpdate(pkt);\n }\n }\n } else {\n for (int i = 0; i < neighbours.length; i++) {\n if (neighbours[i]) {\n\t\t // Send new packet\n pkt = new RouterPacket(myID, i, myDistTable);\n sendUpdate(pkt);\n }\n }\n }\n\n\n }", "public void onBlockNeighborChange(int l) {}", "public boolean isBroadcast() {\r\n \t\treturn (broadcast != null);\r\n \t}", "@Override\n public void sendMessage(Message<M> message) {\n long vertexId = message.getReceiver();\n Queue<Message<M>> sendQueue = sendQueues.get(vertexId);\n if (sendQueue == null) {\n sendQueue = new LinkedList<>();\n sendQueues.put(vertexId, sendQueue);\n }\n\n Message<M> initial = sendQueue.peek();\n if (combiner != null && initial != null) {\n initial = sendQueue.poll();\n M value = combiner.combine(initial.getValue(), message.getValue());\n message.setValue(value);\n }\n sendQueue.offer(message);\n\n if (sendQueue.size() > sendThreshold) {\n sendMessages(sendQueue);\n }\n }", "public void changingNeighbor() {\n }", "public synchronized void broadcast(String message, String username)\r\n {\r\n\r\n\r\n if (username == \"server\")\r\n {\r\n\r\n }\r\n //this was for private chat\r\n else\r\n {\r\n int k = 0;\r\n while (k < clientList.size())\r\n {\r\n if(clientList.get(k).username.equals(username))\r\n {\r\n try \r\n {\r\n OutputStream os = clientList.get(k).socket.getOutputStream();\r\n OutputStreamWriter osw = new OutputStreamWriter(os);\r\n BufferedWriter bw = new BufferedWriter(osw);\r\n bw.write(message);\r\n bw.flush();\r\n }\r\n catch(IOException e)\r\n {\r\n System.out.println(\"Error setting up private chat\");\r\n }\r\n }\r\n }\r\n }\r\n String messageLf = \" \" + message + \"\\n\";\r\n\r\n\r\n System.out.print(messageLf);\r\n for(int i = clientList.size(); --i >= 0;)\r\n {\r\n ClientProcess ct = clientList.get(i);\r\n\r\n if(!ct.writeMessage(messageLf))\r\n {\r\n clientList.remove(i);\r\n displayMessage(\"Disconnected Client \" + ct.username + \" removed from list.\");\r\n }\r\n }\r\n }", "private void publishMessage() throws InterruptedException {\n\t\tDatagramPacket[] packets = moveReceivedPacketsToArray();\r\n\t\t// get packet info\r\n\t\tDatagramPacket packet = packets[0];\r\n\t\tbyte[] packetData = packet.getData();\r\n\t\tbyte[] topicNumberInBytes = new byte[4];\r\n\t\tfor (int index = 2; index < 6; index++) {\r\n\t\t\ttopicNumberInBytes[index - 2] = packetData[index];\r\n\t\t}\r\n\t\tByteBuffer wrapped = ByteBuffer.wrap(topicNumberInBytes);\r\n\t\tint topicNumber = wrapped.getInt();\r\n\r\n\t\t// check if the topic exists\r\n\t\tif (topicNumbers.containsKey(topicNumber)) {\r\n\t\t\tString topicName = topicNumbers.get(topicNumber);\r\n\t\t\tif (subscriberMap.containsKey(topicName)) {\r\n\t\t\t\tArrayList<Integer> topicSubscribers = subscriberMap.get(topicName);\r\n\t\t\t\tfor (int index = 0; index < topicSubscribers.size(); index++) {\r\n\t\t\t\t\t// make an array\r\n\t\t\t\t\tDatagramPacket[] packetsToSendToSub = new DatagramPacket[packets.length];\r\n\t\t\t\t\t// change the destination of all the packets\r\n\t\t\t\t\tfor (int i = 0; i < packets.length; i++) {\r\n\t\t\t\t\t\tDatagramPacket tempPacket = packets[i];\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * String pubMessage = processMessageFromPacket(tempPacket); byte[]\r\n\t\t\t\t\t\t * messagePacketBytes = createPacketData(Constants.PUBLICATION, message[2],\r\n\t\t\t\t\t\t * topicNumber, pubMessage.getBytes()); byte[] packetContent =\r\n\t\t\t\t\t\t * tempPacket.getData();\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tInetSocketAddress subAddress = new InetSocketAddress(Constants.DEFAULT_DST_NODE,\r\n\t\t\t\t\t\t\t\ttopicSubscribers.get(index));\r\n\t\t\t\t\t\ttempPacket.setSocketAddress(subAddress);\r\n\t\t\t\t\t\tpacketsToSendToSub[i] = tempPacket;\r\n\t\t\t\t\t}\r\n\t\t\t\t\taddItemsToQueue(packetsToSendToSub);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws UnknownHostException, IOException{\n\n \n InetAddress group = InetAddress.getByName(\"224.0.0.100\");\n MulticastSocket s = new MulticastSocket(5000);\ntry {\n \n\n s.joinGroup(group);\n \n //Abrimos a interfaz\n Interfaz interfaz = new Interfaz(s,group); \n interfaz.setVisible(true);\n\n}catch (SocketException e){System.out.println(\"Socket: \" + e.getMessage());\n}catch (IOException e){System.out.println(\"IO: \" + e.getMessage());\n}finally{\n }\n}", "public void process(SymmetricMessage msg) throws IOException {\n relay(msg);\n }", "public void broadcastClusterGaggle() {\r\n \tint[] temp = getCluster();\r\n \tExperiment e = getExperiment();\r\n \tif (temp == null)\r\n \t\tSystem.out.println(\"getCluster returns null\");\r\n \tif(e == null)\r\n \t\tSystem.out.println(\"getExperiment returns null\");\r\n \tif(framework == null)\r\n \t\tSystem.out.println(this.toString() + \": framework is null\");\r\n \tframework.broadcastGeneCluster(getExperiment(), getCluster(), null);\r\n\t}", "@Override\n public void processBroadcastElement(SocketEvent event, Context ctx, Collector<KeyedDataPoint> out) throws Exception {\n BroadcastState<String, SocketEvent> bcState = ctx.getBroadcastState(amplificationDesc);\n // storing in MapState with null as VOID default value\n bcState.put(event.streamKey, event);\n }", "public static void allBroadcast(JSONObject obj,Socket s,boolean f){\n\t\tfor(Connection con:Control.getInstance().getConnections()){\n\t\t\tif(f){\n\t\t\t\tcon.writeMsg(obj.toJSONString());\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(!con.getSocket().getRemoteSocketAddress().toString().equals(s.getRemoteSocketAddress().toString())){\n\t\t\t\t\tcon.writeMsg(obj.toJSONString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void processNeighbors() {\n for(int i = 0; i < this.nextAvailPort; i++) {\n if(this.ports[i] == null) { continue; }\n System.out.println(this.ports[i].getRemoteRouterDesc().simulatedIPAddress);\n }\n }", "@Override\n\tpublic void sendBroadcast(Broadcast b) {\n\t\tArrayList<MicroService> a = registrationHashMap.get(b);\n\t\t// adding the broadcast message to the queue of each microservice on the subscribed list\n\t\tfor (Object o : a) {\n\t\t\tint index = registeredMicroservice.indexOf(o);\n\t\t\tmicroserviceMessageQueue.get(index).add(b);\n\t\t}\n\t}", "public void broadcastInfo(String msg){\n\t\tfor (User u : Servidor.users) {\n\t\t\ttry {\t\t\t\t\n\t\t\t\tDataOutputStream o = new DataOutputStream(u.getSocket().getOutputStream());\n\t\t\t\to.writeUTF(msg);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void notifyAllFriends(PresenceModel presence);", "public void begin() {\n multicastAlgorithm.setPacketOutlet(this);\n unicastAlgorithm.setPacketOutlet(this);\n receiver.setMulticastAlgorithm(multicastAlgorithm);\n receiver.setUnicastAlgorithm(unicastAlgorithm);\n receiver.launch(true);\n sender.launch(true);\n }", "void forward(IMessage message, IChannel sender);", "public void sendPeerListToAll() {\r\n\t\tPacket packet = new Packet();\r\n\t\tpacket.eventCode = 1;\r\n\t\tfor(int i = 0; i < peerClientNodeConnectionList.size(); i++) {\r\n\t\t\tPeer peer = new Peer();\r\n\t\t\tpeer.peerID = peerClientNodeConnectionList.get(i).peerClientID;\r\n\t\t\tpeer.peerIP = peerClientNodeConnectionList.get(i).peerClientIP;\r\n\t\t\tpeer.peerPort = peerClientNodeConnectionList.get(i).peerClientListeningPort;\r\n\t\t\tpacket.peerList.add(peer);\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0; i < peerClientNodeConnectionList.size(); i++) {\r\n\t\t\ttry {\r\n\t\t\t\tpeerClientNodeConnectionList.get(i).outStream.writeObject(packet);\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t}", "Publisher<INDArrayMessage> incomingPublisher();", "public void broadcast(String user, String message) {\n\t\tfor (HandleClient c : clients)\n\t\t\tif (!c.getUserName().equals(user)) {\n\t\t\t\tc.sendMessage(1, user, message);\n\t\t\t}\n\t}", "private void sendMessage() {\n Log.d(\"sender\", \"Broadcasting message\");\n Intent intent = new Intent(\"custom-event-name\");\n // You can also include some extra data.\n double[] destinationArray = {getDestination().latitude,getDestination().longitude};\n intent.putExtra(\"destination\", destinationArray);\n LocalBroadcastManager.getInstance(this).sendBroadcast(intent);\n }", "void process(ToSend m) {\n ByteBuffer requestBuffer = buildMsg(m.state.ordinal(), m.leader, m.zxid, m.electionEpoch, m.peerEpoch, m.configData);\n\n manager.toSend(m.sid, requestBuffer);\n\n }", "private void sendmessage(int new_offset[], int[] port_list) {\n\t\ttry {\n\n\t\t\t/**\n\t\t\t * \n\t\t\t * port_list has the port of all processes. Message will be sent to\n\t\t\t * all process.\n\t\t\t * \n\t\t\t */\n\n\t\t\tfor (int i = 0; i < port_list.length; i++) {\n\t\t\t\tSocket processClient = new Socket(\"localhost\", port_list[i]);\n\t\t\t\tprocessClient.setReuseAddress(true);\n\t\t\t\tOutputStream processStream = processClient.getOutputStream();\n\t\t\t\tBufferedWriter processWriter = new BufferedWriter(\n\t\t\t\t\t\tnew OutputStreamWriter(processStream));\n\n\t\t\t\tprocessWriter.write(\"Master: Offset =\" + new_offset[i]);\n\n\t\t\t\t// System.out.println(\"Sending data from Master to other process running on \"\n\t\t\t\t// + port_list[i]);\n\n\t\t\t\tprocessWriter.flush();\n\t\t\t\t// processWriter.close();\n\t\t\t\tprocessClient.close();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public synchronized void broadcast(INDArray array) {\n if (array == null)\n return;\n\n Preconditions.checkArgument(!array.isView() || array.elementWiseStride() != 1, \"View can't be used in DeviceLocalNDArray\");\n\n Nd4j.getExecutioner().commit();\n\n val config = OpProfiler.getInstance().getConfig();\n val locality = config.isCheckLocality();\n\n if (locality)\n config.setCheckLocality(false);\n val numDevices = Nd4j.getAffinityManager().getNumberOfDevices();\n val deviceId = Nd4j.getAffinityManager().getDeviceForCurrentThread();\n\n if (!delayedMode) {\n // in immediate mode we put data in\n\n for (int i = 0; i < numDevices; i++) {\n // if current thread equal to this device - we just save it, without duplication\n if (deviceId == i) {\n set(i, array.detach());\n } else {\n set(i, Nd4j.getAffinityManager().replicateToDevice(i, array));\n }\n\n }\n } else {\n // we're only updating this device\n set(Nd4j.getAffinityManager().getDeviceForCurrentThread(), array);\n delayedArray = array.dup(array.ordering()).detach();\n\n // and marking all other devices as stale, and provide id of device with the most recent array\n for (int i = 0; i < numDevices; i++) {\n if (i != deviceId) {\n updatesMap.get(i).set(deviceId);\n }\n }\n }\n\n config.setCheckLocality(locality);\n }", "public void relay(Message msg) {\n if (roles.containsKey(msg.dst)) {\n roles.get(msg.dst).deliver(msg);\n //System.out.println(msg.print());\n } else {\n if (debug) {\n System.out.print(\"\\nServer: \" + index + \": Dst not found: \" + msg.print());\n }\n }\n }", "public void privateBroadcast(String message, String privateReceptor) {\n\t\tfor (UserThread aUser : userThreads) {\n\t\t\tif (aUser.getUserName().equals(privateReceptor)) {\n\t\t\t\taUser.sendMessage(message);\n\t\t\t}\n\t\t}\n\t}", "private void sendUpdates() {\n\n List<PeerUpdateMessage.Part> parts = new ArrayList<PeerUpdateMessage.Part>();\n for (ActivePlayer peer : player.getSavedNeighbors()) {\n PeerUpdateMessage.Part part = new PeerUpdateMessage.Part(\n peer.character.id, peer.character.getExtrapolatedMotionState());\n parts.add(part);\n }\n\n if (!parts.isEmpty()) {\n PeerUpdateMessage msg = new PeerUpdateMessage(parts);\n new ToClientMessageSink(player.session).sendWithoutConfirmation(msg);\n }\n }", "public void Barrier() {\n int[] bcastData = {0};\n int[] outdata = new int[1];\n\n AllReduce(bcastData,outdata,Mpi.SUM);\n }", "private void mutate() {\n\t\tfor (int i = 0; i < population; ++i) {\n\t\t\tpopulationArray.set(i, populationArray.get(i).generateNeighbor());\n\t\t}\n\t}", "@Override\n\tpublic void invoke() {\n\t\t\n\t\tIBuffer b = Buffer.getBuffer();\n\t\tint r = b.getRemainingCapacity();\n\t\t\n\t\t// the buffer is empty - this means that invoke was called after a grid was removed\n\t\t// and we need to fill it up to prevent starvation. Ideally the only way this could\n\t\t// happen is if the buffer size was 1\n\t\tif (r == 0) {\n\t\t\tPublisher.getInstance().send(new ProduceMessage());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (r < b.getCapacity())\n\t\t\tPublisher.getInstance().send(new ProduceMessage());\n\t\t\n\t\tif (r > 0)\n\t\t\tPublisher.getInstance().send(new ConsumeMessage());\n\t\t\n\t}", "public Broadcast getBroadcast() {\r\n \t\treturn broadcast;\r\n \t}", "@Override\n public void run() {\n List<Integer> list = new ArrayList<Integer>();\n int num_peer = P.peer_port.length;\n int ind = -1;\n while (P.choke_thread_running) {\n synchronized (P.lock_current_neighbors) { //lock the object\n for (int i = 0; i < num_peer; i++) {\n list.add(i);\n }\n //select randomly.\n java.util.Collections.shuffle(list);\n int[] cn = P.current_neighbors.clone();\n Arrays.sort(cn);\n for (int i = 0; i < num_peer; i++) {\n int ind2 = list.get(i);\n if (P.is_interested[ind2] && Arrays.binarySearch(cn, P.peer_id[ind2]) < 0 && P.peer_id[ind2] != P.id && P.sockets[ind2]!=null) {\n ind = ind2;\n P.current_neighbors[P.current_neighbors.length - 1] = P.peer_id[ind];\n break;\n }\n\n }\n }\n //send unchoke message.\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 1; //unchoke.\n msg.payload = null; //no payload.\n \n if (ind >= 0) //there is someone interested in my data.\n {\n P.send(P.peer_id[ind], msg);\n P.print(\"OptChoke unchoked peer with id \" + P.peer_id[ind]);\n }\n ind = -1;\n //print debugging info.\n \n //sleep some interval.\n try {\n Thread.sleep(1000 * P.optimistic_unchoking_interval);\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }\n }", "private void join (Block b) {\n\t\tArrayList<Block> neighbors = getAdj(b); // All of the neighbors.\n\t\tfor (Block neighbor: neighbors) { // Iterates through all of the neighbors.\n\t\t\tif (neighbor.t == ' ') { // Important, checks if the neighbor is a wall or not.\n\t\t\t\tfor (Block member: neighbor.tree) {\n\t\t\t\t\tb.tree.add(member);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (Block member : b.tree) { // Iterates through all of the members of the tree.\n\t\t\tif (member.t == ' ') member.tree = b.tree; // Sets the trees of the members to the shared tree. \n\t\t}\n\t\tb.t = ' ';\n\t}", "public static void opBroadcast(BaseComponent[] baseComp){\n JawaChat.opsOnline.values().forEach((target) -> {\n target.spigot().sendMessage(baseComp);\n });\n String logmsg = \"\";\n for (BaseComponent comp : baseComp){\n logmsg += comp.toPlainText();\n }\n logMessage(logmsg, \"op channel\");\n }", "private synchronized void flushMessageQueue() {\n\t\tif(peers.size() > 0) {\n\t\t\twhile(!noPeersMessageQueue.isEmpty()) {\n\t\t\t\tpropagateToAllPeers(noPeersMessageQueue.poll());\n\t\t\t}\n\t\t}\n\t}", "public void relay(Message msg) throws IOException {\n if (Destination.BROADCAST.name().equals(msg.getDestination())) {\n bradcast(msg);\n return;\n }\n usersConnected.get(msg.getDestination()).sendMessage(msg);\n }", "@Override\n\tpublic synchronized void sendBroadcast(Broadcast b) {\n\t\tif (typesQueue != null && !typesQueue.isEmpty())\n\t\t{\n\t\t\tif(typesQueue.containsKey(b.getClass()) && !typesQueue.get(b.getClass()).isEmpty())\n\t\t\t{\n\t\t\t\tif(subscribersMessages!=null)\n\t\t\t\t{\n\t\t\t\t\tfor (Subscriber s : typesQueue.get(b.getClass())) {\n\t\t\t\t\t\tsubscribersMessages.get(s).add(b);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tnotifyAll();\n\t}" ]
[ "0.6745808", "0.6530819", "0.6516562", "0.6272593", "0.6248642", "0.61319697", "0.59604526", "0.59125304", "0.58673126", "0.5857072", "0.5851101", "0.58467746", "0.58408326", "0.5783418", "0.5688467", "0.5684713", "0.56705093", "0.5664514", "0.56423706", "0.5631228", "0.56051105", "0.55843693", "0.5579581", "0.5574221", "0.5557055", "0.5549044", "0.55430937", "0.5519937", "0.55172133", "0.5505903", "0.54766095", "0.5467412", "0.54580617", "0.54196703", "0.5418788", "0.539949", "0.5358014", "0.5356389", "0.53417474", "0.53251827", "0.5315421", "0.53087825", "0.5293247", "0.5283967", "0.52809656", "0.52785575", "0.5274368", "0.52672404", "0.52582765", "0.52502364", "0.524747", "0.52261883", "0.522431", "0.52154946", "0.52115905", "0.52093387", "0.51982194", "0.51826656", "0.51782656", "0.51752347", "0.51734567", "0.5173295", "0.51680124", "0.51657975", "0.515069", "0.51494104", "0.5144975", "0.51364285", "0.5133285", "0.5125778", "0.51214725", "0.5116914", "0.5112853", "0.51091045", "0.51072645", "0.51045316", "0.51010585", "0.5092723", "0.50877875", "0.5075631", "0.50697994", "0.50676316", "0.5053417", "0.50421494", "0.50377345", "0.50358033", "0.5032253", "0.5028886", "0.5019735", "0.5014817", "0.5004616", "0.49786818", "0.49772635", "0.49742675", "0.4972563", "0.49662554", "0.4964761", "0.49643126", "0.4958491", "0.49558917", "0.49531826" ]
0.0
-1
Inizializza i componenti necessari a testare i metodi.
@BeforeEach void setUp() throws Exception { price=new Price(990.0, 1760.0); classification= new Classification("Sport", "Tennis"); event= new Event("Abierto", "17AZvbG62X1NsqR", "https://www.ticketmaster.com.mx/abierto-mexicano-de-tenis-miercoles-acapulco-guerrero-03-17-2021/event/140058FF8A8F176F","2021-03-17" , "18:00:00",classification , price); event1= new Event("Abierto", "17AZvbG62X1NsqR", "https://www.ticketmaster.com.mx/abierto-mexicano-de-tenis-miercoles-acapulco-guerrero-03-17-2021/event/140058FF8A8F176F","2021-03-23" , "18:00:00",classification , price); events.set(0, event); events.set(1, event1); Stato = new State("Monterrey", 403, events ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public test_para_lanzar_metodos() {\n initComponents();\n \n \n \n \n \n \n }", "private void initcomponent() {\n\r\n\t}", "public InicioTeste() {\n initComponents();\n }", "private void setup(){\n\n // menginisialisasi variabel component\n component = DaggerApplicationComponent.builder()\n .applicationModule(new ApplicationModule(this)).build();\n\n // memanggil fungsi inject\n component.inject(this);\n }", "private void createUIComponents() {\n table = new ShareTraderTable();\n }", "@BeforeEach\n\tvoid criaNovo()\n\t{\n\t\tcontatoBasico = new Contato(\"Matheus\", \"Gaudencio\", \"123\");\n\t}", "public ComponentTypeMock(){\n\t\tattributes = \"component\";\n\t}", "public void setUp() throws Exception\r\n {\r\n m_name = \"test\";\r\n m_activation = ActivationPolicy.STARTUP;\r\n m_collection = CollectionPolicy.WEAK;\r\n m_lifestyle = LifestylePolicy.SINGLETON;\r\n m_classname = ComponentDirectiveTestCase.class.getName();\r\n m_categories = new CategoriesDirective( new CategoryDirective[0] );\r\n m_context = \r\n new ContextDirective( \r\n new PartReference[]\r\n {\r\n new PartReference( \"abc\", new ValueDirective( \"abc\" ) ),\r\n new PartReference( \"def\", new ValueDirective( \"def\" ) )\r\n }\r\n );\r\n m_parts = new PartReference[0];\r\n m_base = null;\r\n m_directive = \r\n new ComponentDirective( \r\n m_name, m_activation, m_collection, m_lifestyle, m_classname, \r\n m_categories, m_context, m_parts, m_base );\r\n }", "public EcriveurMetierTest() {\r\n\t\t\r\n\t\tsuper();\r\n\t\t\r\n\t}", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "public TestManageBean() {\n }", "@Before\n public void setUp(){\n Cic.populate();\n }", "private void inicializarComponentes() \n\t{\n\t\tthis.table=new JTable(); \n\t\ttablas.setBackground(Color.white);\n\t\tscroll =new JScrollPane(table); // Scroll controla la tabla\n\t\tthis.add(scroll,BorderLayout.CENTER);\n\t\tthis.add(tablas,BorderLayout.NORTH);\n\t\t\n\t}", "@Before\n public void init(){\n }", "@Before\r\n public void setUp() {\n articuloPrueba = new Articulo();\r\n \r\n \r\n }", "public DepControlar() {\n \n initComponents();\n depservice = new DepService();\n }", "@Before\n @Override\n public void init() {\n }", "public void InicializarComponentes() {\n campoCadastroNome = findViewById(R.id.campoCadastroNome);\n campoCadastroEmail = findViewById(R.id.campoCadastroEmail);\n campoCadastroSenha = findViewById(R.id.campoCadastroSenha);\n switchEscolhaTipo = findViewById(R.id.switchCadastro);\n botaoFinalizarCadastro = findViewById(R.id.botaoFinalizarCriacao);\n\n\n }", "public abstract void setupComponent();", "@Before\n public void init() {\n }", "public meseros() {\n initComponents();\n }", "@Before\n\tpublic void init() {\n\t}", "private void inicializarComponentes() {\n universidadesIncluidos = UniversidadFacade.getInstance().listarTodosUniversidadOrdenados();\n universidadesIncluidos.removeAll(universidadesExcluidos);\n Comunes.cargarJList(jListMatriculasCatastrales, universidadesIncluidos);\n }", "@Before\n public void inicializaBaseDatos() throws Exception {\n app = Helpers.fakeApplication(settings());\n databaseTester = new JndiDatabaseTester(\"DefaultDS\");\n IDataSet initialDataSet = new FlatXmlDataSetBuilder().build(new\n FileInputStream(\"test/resources/tareas_dataset_1.xml\"));\n databaseTester.setDataSet(initialDataSet);\n databaseTester.onSetup();\n }", "private void initComponent() {\n\t\taddGrid();\n\t\taddToolBars();\n\t}", "public void testGetComponent() throws Exception {\n Component component = Aura.getInstanceService()\n .getInstance(\"auratest:testComponent1\", ComponentDef.class, null);\n assertEquals(\"Default String\", component.getAttributes().getExpression(\"myString\")); // from\n // the\n // component\n assertEquals(true, component.getAttributes().getExpression(\"myBoolean\")); // from\n // the\n // parent\n // component\n assertEquals(\"Interface String\", component.getAttributes().getExpression(\"interfaceString\")); // from\n // the\n // interface\n assertEquals(\"1\", component.getGlobalId());\n }", "private void initComponents() {\n\t\t\n\t}", "private void initComponents() {\n\t\t\n\t}", "public PessoaTest() {\n pessoa.setNome(\"Thiago\");\n pessoa.setSobrenome(\"Cury\"); \n pessoa.setIdade(36); \n }", "@PostConstruct\n\tpublic void inicializar() {\n\t}", "public FrameManageTests() {\n initComponents();\n }", "@Override\n protected void setup() {\n super.setup();\n addBehaviour(new Comportamiento());\n \n }", "@Test\n public void init() {\n }", "protected void setUp() throws Exception {\n TestHelper.loadSingleXMLConfig(TestHelper.NAMESPACE, TestHelper.CONFIG_FILE);\n propertiesPanel = new PropertiesPanel(new UMLModelManager());\n\n panel = new ConcurrencyPropertyPanel(propertiesPanel);\n }", "public CadastroComplemento() {\n initComponents();\n \n }", "@BeforeEach\r\n void setUp() {\r\n\r\n dome = new Dome();\r\n\r\n }", "void inicializaComponentes(){\r\n\t\t\r\n\t\t//Botão com status\r\n\t\ttgbGeral = (ToggleButton) findViewById(R.id.tgbGeral);\r\n\t\ttgbGeral.setOnClickListener(this);\r\n\t\ttgbMovimento = (ToggleButton) findViewById(R.id.tgbMovimento);\r\n\t\ttgbMovimento.setOnClickListener(this);\r\n\t\ttgbfogo = (ToggleButton) findViewById(R.id.tgbFogo);\r\n\t\ttgbfogo.setOnClickListener(this);\r\n\r\n\t\t//botão\r\n\t\tbtnTemperatura = (Button) findViewById(R.id.btnTemperatura);\r\n\t\tbtnTemperatura.setOnClickListener(this);\r\n\t\t\r\n\t\t//label\r\n\t\ttxtLegenda = (TextView) findViewById(R.id.txtSensorLegenda);\r\n\t}", "public PerezosoTest()\n {\n }", "public TestBase()\r\n\t{\r\n\t\tprop = new Properties();\r\n\t\ttry {\r\n\t\t\tFile file = new File(\"src\\\\test\\\\resources\\\\intellicus.properties\");\r\n\t\t\tFileInputStream fis = new FileInputStream(file);\r\n\t\t\tprop.load(fis);\r\n\t\t} catch (FileNotFoundException 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\t\r\n\t}", "private void createUIComponents() {\n\n String[] criterios = {\"Nombre\",\"Identificación\"};\n DefaultListModel modelo = new DefaultListModel();\n criterioBusquedaComboBox = new JComboBox(criterios);\n tablaCitas = new JTable();\n tablaBusqueda = new JTable();\n tableModel = (DefaultTableModel) tablaCitas.getModel();\n tableModelBusqueda = (DefaultTableModel) tablaBusqueda.getModel();\n scrollerTable = new JScrollPane(tablaCitas, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n scrollerBusqueda = new JScrollPane(tablaBusqueda, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n guardarInformacionButton = new JButton(\"Guardar información\");\n guardarInformacionButton.setVisible(false);\n }", "public void init() {\n entityPropertyBuilders.add(new DefaultEntityComponentBuilder(environment));\n entityPropertyBuilders.add(new FilterTransientFieldComponentBuilder(environment));\n entityPropertyBuilders.add(new MakeAccessibleComponentBuilder(environment));\n entityPropertyBuilders.add(new PrimaryKeyComponentBuilder(environment));\n\n // Field meta property builders\n fieldPropertyBuilders.add(new FilterPrimaryKeyComponentBuilder(environment));\n fieldPropertyBuilders.add(new FilterTransientFieldComponentBuilder(environment));\n fieldPropertyBuilders.add(new MakeAccessibleComponentBuilder(environment));\n fieldPropertyBuilders.add(new TtlFieldComponentBuilder(environment));\n fieldPropertyBuilders.add(new CompositeParentComponentBuilder(environment));\n fieldPropertyBuilders.add(new CollectionFieldComponentBuilder(environment));\n fieldPropertyBuilders.add(new MapFieldComponentBuilder(environment));\n fieldPropertyBuilders.add(new SimpleFieldComponentBuilder(environment));\n }", "public TelaConversao() {\n initComponents();\n }", "@Override\n public void initComponent() {\n }", "@Override\n public void initComponent() {\n }", "public Tmpenlaties() {\n initComponents();\n }", "public UICadMovel() {\n initComponents();\n }", "public ConsultaEquipo() {\n initComponents();\n }", "public TelaPrincipalMDI() {\n initComponents();\n }", "@Before\n public void setUp(){\n cmTest = new CoffeeMaker();\n\n }", "@Override\r\n public void initComponent() {\n }", "public InjectingComponentType() {\n }", "@Test\n public void ctor(){\n assertNotNull(CuT.templateEngine, \"The Template Engine is Null and should not be\");\n }", "public DepoIslemleri() {\n initComponents();\n setLocationRelativeTo(null);\n basla();\n }", "private ProtomakEngineTestHelper() {\r\n\t}", "public TrCompanyCreditTransactionDetailDAOTest() {\r\n\t}", "@Before\n public void init() {\n final Map<String, DataType> defaultTypes = new HashMap<>();\n defaultTypes.put(\"frieda\", StringCell.TYPE);\n defaultTypes.put(\"berta\", StringCell.TYPE);\n ReadAdapterFactory<String, String> readAdapterFactory = new ReadAdapterFactory<String, String>() {\n\n @Override\n public ReadAdapter<String, String> createReadAdapter() {\n return new TestReadAdapter();\n }\n\n @Override\n public ProducerRegistry<String, ? extends ReadAdapter<String, String>> getProducerRegistry() {\n return m_producerRegistry;\n }\n\n @Override\n public Map<String, DataType> getDefaultTypeMap() {\n return defaultTypes;\n }\n\n };\n m_testInstance = new DefaultTypeMappingFactory<>(readAdapterFactory);\n }", "public JPMetaDados() {\n initComponents();\n postgresElicitedBases = FacadePostgresElicitedBases.getPostgresElicitedBases();\n// MetodosUtil.setCombo(jCSGBD);\n jCSGBD.addItemListener(new ComboListener(this));\n }", "public EjemplarUI() {\n initComponents();\n controlador = Controladores.peliculaController;\n }", "public AllLaboTest() {\n }", "public TestDataBean() {\n\t}", "@BeforeEach\n void init() {\n carte = new Carte();\n planning = new Planning(carte);\n }", "public TelaCadasroProjeto() {\n initComponents();\n }", "@Component(dependencies = MockMainComponent.class, modules = MockTranslateModule.class)\n@PerFragment\npublic interface MockTranslateComponent extends TranslateComponent {\n\n}", "public test() {\n initComponents();\n }", "public Captura() {\n initComponents();\n }", "public mitigacao() {\n initComponents();\n }", "@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 inicializar() {\r\n try {\r\n anioDeclaracion = 0;\r\n existeDedPatente = false;\r\n deducciones = false;\r\n detaleExoDedMul = new ArrayList<String>();\r\n activaBaseImponible = 0;\r\n verBuscaPatente = 0;\r\n inicializarValCalcula();\r\n datoGlobalActual = new DatoGlobal();\r\n patenteActual = new Patente();\r\n patenteValoracionActal = new PatenteValoracion();\r\n verPanelDetalleImp = 0;\r\n habilitaEdicion = false;\r\n numPatente = \"\";\r\n buscNumPat = \"\";\r\n buscAnioPat = \"\";\r\n catDetAnio = new CatalogoDetalle();\r\n verguarda = 0;\r\n verActualiza = 0;\r\n verDetDeducciones = 0;\r\n verBotDetDeducciones = 0;\r\n listarAnios();\r\n } catch (Exception ex) {\r\n LOGGER.log(Level.SEVERE, null, ex);\r\n }\r\n }", "public TelaDoador() {\n initComponents();\n conexao = ModuloConexao.conector();\n }", "public GUITest() {\n }", "public void testInitialization() {\n assertNotNull(container);\n }", "public TelaCidadaoDescarte() {\n initComponents();\n }", "@Test\n\tpublic void testInit() {\n\t\t/*\n\t\t * This test is just use to initialize everything and ensure a better\n\t\t * performance measure for all the other tests.\n\t\t */\n\t}", "@Before\r\n\tpublic void setup(){\n\t\t\r\n\t\tMufasaRepository testAccounts = MufasaRepository.getInstance();\r\n\t\ttestAccounts.addMufasa( new Mufasa(\"firstName\", \"lastName\", \"username\", \"password\", 42) );\r\n\t\t\r\n\t\t//Mock create\r\n\t\texampleX= EasyMock.createMock(MufasaRepository.class);//what does this do?\r\n\t\ttestAccounts.tulosta();\r\n\t}", "@Test\r\n\tpublic void testGetMetaProperties() throws Exception {\r\n\t\tAdvancedExampleComponent component = new AdvancedExampleComponent();\r\n\t\tXMLBasedPropertyContainer container = new XMLBasedPropertyContainer(XMLBasedPropertyProvider.getInstance()\r\n\t\t\t\t.getMetaPropertiesSet(component.getClass()), component);\r\n\t\tvalidateMetaProperties(container.getMetaProperties());\r\n\t\tcontainer.getProperties();\r\n\t\tvalidateMetaProperties(container.getMetaProperties());\r\n\t}", "public MetadataPanel()\n {\n fieldMap = new HashMap<String, Component>();\n initialiseUI();\n }", "protected void setUp() {\n // set up for test\n instance = new GeneralizationImpl();\n GeneralizableElement mockChild = EasyMock.createMock(GeneralizableElement.class);\n GeneralizableElement mockParent = EasyMock.createMock(GeneralizableElement.class);\n Classifier mockPowertype = EasyMock.createMock(Classifier.class);\n instance.setChild(mockChild);\n instance.setDiscriminator(TEST_DISCRIMINATORS[0]);\n instance.setParent(mockParent);\n instance.setPowertype(mockPowertype);\n\n }", "public JuegoCarta() {\n initComponents();\n dibujarPuntuaciones();\n }", "public iDentistry() {\n initComponents();\n initMyComponents();\n }", "private void testInitialization() {\r\n\r\n\r\n\t\tthis.myMapDB = MapDB.getInstance();\r\n\t\tthis.myClumpDB = ClumpDB.getInstance();\r\n\t}", "public Component() {\n }", "private void initComponent() {\n\t\tmlistview=(ClickLoadListview) findViewById(R.id.ListView_hidden_check);\n\t\tChemicals_directory_search=(CustomFAB) findViewById(R.id.company_hidden_search);\n\t\tChemicals_directory_search.setVisibility(View.GONE);\n\t\ttopbar_com_name=(TopBarView) findViewById(R.id.topbar_com_name);\n\t\tsearch_chemical_name=(SearchInfoView) findViewById(R.id.search_chemical_name);\n\t}", "public TelaInicial() {\n initComponents();\n }" ]
[ "0.6797777", "0.6511016", "0.63096", "0.62574774", "0.6222537", "0.62045586", "0.61286616", "0.606183", "0.6008852", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5984584", "0.59598345", "0.59394413", "0.5939258", "0.59330755", "0.5928256", "0.5912148", "0.5886579", "0.58855665", "0.58824986", "0.5874582", "0.5853773", "0.58444923", "0.58401495", "0.5838028", "0.5834553", "0.58196795", "0.5817139", "0.5817139", "0.5816914", "0.5802527", "0.5796526", "0.57955045", "0.57927424", "0.5790807", "0.57803696", "0.57786447", "0.57726246", "0.57656723", "0.576325", "0.5762337", "0.57586056", "0.5751605", "0.5750492", "0.5750492", "0.574891", "0.5737436", "0.57343924", "0.5731406", "0.57201535", "0.57167757", "0.5714469", "0.5702504", "0.5698358", "0.5686353", "0.5683115", "0.5680372", "0.5678894", "0.5669308", "0.56678003", "0.566453", "0.5661444", "0.56586087", "0.56580895", "0.56574345", "0.56557566", "0.5654203", "0.56531876", "0.5648764", "0.56385064", "0.56357366", "0.5629962", "0.56280833", "0.562568", "0.56184125", "0.56150705", "0.5606515", "0.5602704", "0.5600573", "0.55965954", "0.5578336", "0.55776644", "0.55762297", "0.55758166" ]
0.0
-1
Questo testa se il numero totale di eventi di un determinato stato e' corretto;
@Test void testConfrontaData() throws Exception { assertEquals(2,stats.NumeroTotaleEventi(Stato)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void totalHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getTotalHires() == 4);\n\t}", "public int probabilidadesHastaAhora(){\n return contadorEstados + 1;\n }", "private void assertCountEvent(int exepectedCount, String eleementName, String json) {\n\n// System.out.println(\"debug \"+eleementName+\" \"+matchEventCount(eleementName, json));\n assertEquals(\"For event '\" + eleementName + \"' expecting count\", exepectedCount, matchEventCount(eleementName, json));\n }", "@Test\n\tpublic void completeHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfCompleteHires() == 2);\n\t}", "@Test\n public void testVaticanReportMorePlayersEvent() {\n Game game = new Game(2);\n FaithTrack faithTrack1 = game.getPlayers().get(0).getFaithTrack();\n FaithTrack faithTrack2 = game.getPlayers().get(1).getFaithTrack();\n\n // entering the first vatican section\n faithTrack1.increasePos(7);\n // triggers the first vatican report\n faithTrack2.increasePos(8);\n\n // putting a sleep in order to let the dispatcher notify the subscribers\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n assertEquals(2, faithTrack1.getBonusPoints()[0]);\n assertEquals(2, faithTrack2.getBonusPoints()[0]);\n }", "@Test\n public void currentProgressTest() {\n\n smp.checkAndFillGaps();\n smp.increaseCurrentProgress();\n smp.increaseCurrentProgress();\n smp.increaseCurrentProgress();\n smp.increaseCurrentProgress();\n smp.increaseCurrentProgress();\n\n assertEquals(5, smp.getCurrentProgress());\n assertEquals(30, smp.getUnitsTotal() - smp.getCurrentProgress());\n assertEquals(Float.valueOf(30), smp.getEntriesCurrentPace().lastEntry().getValue());\n assertTrue(smp.getEntriesCurrentPace().size() > 0);\n assertFalse(smp.isFinished());\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd-MMM-YY\", Locale.getDefault());\n\n for (Map.Entry<Date, Float> entry : smp.getEntriesCurrentPace().entrySet()) {\n System.out.println(dateFormat.format(entry.getKey()) + \" : \" + entry.getValue());\n }\n\n\n for (int i = 0; i < 30; i++) {\n smp.increaseCurrentProgress();\n }\n\n assertTrue(smp.isFinished());\n\n smp.increaseCurrentProgress();\n\n assertEquals(Float.valueOf(0), smp.getEntriesCurrentPace().lastEntry().getValue());\n\n }", "@Test\n public void testSalaire() {\n Assert.assertTrue(e.calculSalaire() == 15 * 20 + e.getSalaire());\n }", "@Test\n public void testInterestAccumulated() {\n //Just ensure that the first two digits are the same\n assertEquals(expectedResults.getInterestAccumulated(), results.getInterestAccumulated(), 0.15);\n }", "@Test\n public void testVaticanReport1Event() {\n Game game = new Game(2);\n FaithTrack faithTrack1 = game.getPlayers().get(0).getFaithTrack();\n FaithTrack faithTrack2 = game.getPlayers().get(1).getFaithTrack();\n\n // triggers the first vatican report\n faithTrack1.increasePos(8);\n\n // putting a sleep in order to let the dispatcher notify the subscribers\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n assertEquals(2, faithTrack1.getBonusPoints()[0]);\n assertEquals(0, faithTrack2.getBonusPoints()[0]);\n }", "public void testZStats() {\n\t\t// Make sure we clear all stats before beginning test\n\t\tsolo.pressSpinnerItem(3, 1);\n\t\tsolo.goBackToActivity(\"OptionsActivity\");\n\t\tsolo.clickOnText(\"Begin Rehearsing\");\n\t\tsolo.pressMenuItem(2);\n\t\tsolo.pressSpinnerItem(0, 0);\n\t\tsolo.goBackToActivity(\"StatsActivity\");\n\t\tsolo.pressSpinnerItem(1, -1);\n\t\tsolo.goBackToActivity(\"StatsActivity\");\n\t\tsolo.pressSpinnerItem(2, -1);\n\t\tsolo.goBackToActivity(\"StatsActivity\");\n\t\tsolo.clickOnButton(\"Clear Stats\");\n\t\tsolo.clickOnButton(\"Yes\");\n\t\tsolo.waitForText(\"Stats cleared for the current selection.\");\n\t\tsolo.goBackToActivity(\"MainActivity\");\n\n\t\t// Generate prompt stats (3 of them)\n\t\tsolo.clickOnText(\"LINE!\");\n\t\tsolo.clickOnText(\"Next\");\n\t\tsolo.clickOnText(\"LINE!\");\n\t\tsolo.clickOnText(\"Next\");\n\t\tsolo.clickOnText(\"LINE!\");\n\t\tsolo.clickLongOnText(\"Next\");\n\n\t\t// Generate completion stats (1 of them)\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tsolo.clickOnText(\"Next\");\n\t\t}\n\n\t\t// Finally create another viewed stat (2 in total)\n\t\tsolo.clickLongOnText(\"Next\");\n\n\t\tsolo.pressMenuItem(2);\n\t\tsolo.pressSpinnerItem(0, -5);\n\t\tsolo.goBackToActivity(\"StatsActivity\");\n\t\tsolo.pressSpinnerItem(1, -5);\n\t\tsolo.goBackToActivity(\"StatsActivity\");\n\t\tsolo.pressSpinnerItem(2, -5);\n\t\tsolo.goBackToActivity(\"StatsActivity\");\n\n\t\tviews = (TextView) solo.getView(R.id.textViewsNum);\n\t\tprompts = (TextView) solo.getView(R.id.textPromptsNum);\n\t\tcompletions = (TextView) solo.getView(R.id.textCompleteNum);\n\n\t\tassertEquals(views.getText().toString(), \"2\");\n\t\tassertEquals(prompts.getText().toString(), \"3\");\n\t\tassertEquals(completions.getText().toString(), \"1\");\n\t}", "@Test\n public void testGenerateStatistics() {\n Statistics me = new Statistics(0, numFishes, numSharks);\n Statistics prog = dataHandler.generateStatistics();\n //assertEquals(me, prog);\n if (me.getIterationStep() == prog.getIterationStep()\n && me.getFishAmount() == prog.getFishAmount()\n && me.getSharksAmount() == prog.getSharksAmount()) {\n assertTrue(true);\n } else {\n assertTrue(false);\n }\n }", "@Test\n\tvoid calcularSalarioConMasCuarentaHorasPagoPositivoTest() {\n\t\tEmpleadoPorComision empleadoPorComision = new EmpleadoPorComision(\"Eiichiro oda\", \"p33\", 400000, 500000);\n\t\tdouble salarioEsperado = 425000;\n\t\tdouble salarioEmpleadoPorComision = empleadoPorComision.calcularSalario();\n\t\tassertEquals(salarioEsperado, salarioEmpleadoPorComision);\n\n\t}", "private void ruotaNuovoStatoPaziente() {\r\n\t\tif(nuovoStatoPaziente==StatoPaziente.WAITING_WHITE)\r\n\t\t\tnuovoStatoPaziente = StatoPaziente.WAITING_YELLOW;\r\n\t\telse if(nuovoStatoPaziente==StatoPaziente.WAITING_YELLOW)\r\n\t\t\tnuovoStatoPaziente = StatoPaziente.WAITING_RED;\r\n\t\telse if(nuovoStatoPaziente==StatoPaziente.WAITING_RED)\r\n\t\t\tnuovoStatoPaziente = StatoPaziente.WAITING_WHITE;\r\n\t\t\r\n\t}", "@Test\n\tpublic void bikesDamaged()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfBikesDamaged() == 1);\n\t}", "@Test(timeout=2000)\n public void countTest()\n {\n int[] mixed = {1,5,3,8,10,34,62,31,45,20};\n int mixedOdds = 5;\n int mixedEvens = 5;\n int[] even = {2,4,6,8,10,20,30,58};\n int[] odd = {1,3,5,7,9,11,13,15,19};\n int[] singleEven = {2};\n int[] singleOdd = {1};\n \n assertEquals( \"Counting odds in array of mixed odds and evens failed.\", mixedOdds, OddsEvens.count( mixed, true ) );\n assertEquals( \"Counting evens in array of mixed odds and evens failed.\", mixedEvens, OddsEvens.count( mixed, false ) );\n assertEquals( \"Counting odds in an array of all evens failed.\", 0, OddsEvens.count( even, true ) );\n assertEquals( \"Counting evens in an array of all evens failed.\", even.length, OddsEvens.count( even, false ) );\n assertEquals( \"Counting odds in an array of all odds failed.\", odd.length, OddsEvens.count( odd, true ) );\n assertEquals( \"Counting evens in an array of all odds failed.\", 0, OddsEvens.count( odd, false ) );\n assertEquals( \"Counting odds in an array of a single even failed.\", 0, OddsEvens.count( singleEven, true ) );\n assertEquals( \"Counting evens in an array of a single even failed.\", 1, OddsEvens.count( singleEven, false ) );\n assertEquals( \"Counting odds in an array of a single odd failed.\", 1, OddsEvens.count( singleOdd, true ) );\n assertEquals( \"Counting evens in an array of a single odd failed.\", 0, OddsEvens.count( singleOdd, false ) );\n }", "@Test(groups = \"wso2.das4esb.stats\", description = \"Test total faults count in per-second table\")\n public void testSecondTableTotalErrorCount() throws Exception {\n int count = getCounts(TestConstants.ESB_STAT_PER_SECOND_ALL_TABLE, TestConstants.FAULT_COUNT, \"ALL\");\n Assert.assertEquals(count, NUMBER_OF_FAULTS*NUMBER_OF_PROXIES, \"Total faults count is incorrect\" +\n \" in per-second table.\");\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 boolean calcularTotal() {\r\n double dou_debe = 0;\r\n double dou_haber = 0;\r\n for (int i = 0; i < tab_tabla2.getTotalFilas(); i++) {\r\n try {\r\n if (tab_tabla2.getValor(i, \"ide_cnlap\").equals(p_con_lugar_debe)) {\r\n dou_debe += Double.parseDouble(tab_tabla2.getValor(i, \"valor_cndcc\"));\r\n } else if (tab_tabla2.getValor(i, \"ide_cnlap\").equals(p_con_lugar_haber)) {\r\n dou_haber += Double.parseDouble(tab_tabla2.getValor(i, \"valor_cndcc\"));\r\n }\r\n } catch (Exception e) {\r\n }\r\n }\r\n eti_suma_debe.setValue(\"TOTAL DEBE : \" + utilitario.getFormatoNumero(dou_debe));\r\n eti_suma_haber.setValue(\"TOTAL HABER : \" + utilitario.getFormatoNumero(dou_haber));\r\n\r\n double dou_diferencia = Double.parseDouble(utilitario.getFormatoNumero(dou_debe)) - Double.parseDouble(utilitario.getFormatoNumero(dou_haber));\r\n eti_suma_diferencia.setValue(\"DIFERENCIA : \" + utilitario.getFormatoNumero(dou_diferencia));\r\n if (dou_diferencia != 0.0) {\r\n eti_suma_diferencia.setStyle(\"font-size: 14px;font-weight: bold;color:red\");\r\n } else {\r\n eti_suma_diferencia.setStyle(\"font-size: 14px;font-weight: bold\");\r\n return true;\r\n }\r\n return false;\r\n }", "@Test\n public void testCalculerDroitPassage() {\n int nbrDoitPassage = 3;\n double valeurLot = 1000;\n double expResult = 350;\n double result = CalculAgricole.calculerMontantDroitsPassage(nbrDoitPassage, valeurLot);\n assertEquals(\"Montant pour las droits du passage n'était pas correct.\", expResult, result, 0);\n\n }", "@Test\n\tvoid calcularSalarioSinVentasPagoPositivoTest() {\n\t\tEmpleadoPorComision empleadoPorComision = new EmpleadoPorComision(\"Hiromu Arakawa\", \"p24\", 400000, 0);\n\t\tdouble salarioEsperado = 400000;\n\t\tdouble salarioEmpleadoPorComision = empleadoPorComision.calcularSalario();\n\t\tassertEquals(salarioEsperado, salarioEmpleadoPorComision);\n\n\t}", "@Test\n\tpublic void activeHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfActiveHires() == 1);\n\t}", "private void calculeStatAdd() {\n resourceA = this.getContext().getGame().getPlayer(idPlayer).getInventory().getValueRessource(type);\n int win = resourceA - resourceB;\n int diff = (resourceB - resourceA) + value;\n this.getContext().getStats().incNbRessourceWinPlayers(idPlayer,type,win);\n this.getContext().getStats().incNbRessourceExtendMaxPlayers(idPlayer,type,diff);\n }", "@Test\n public void createStatisticsF03_TC2_valid() {\n try {\n Statistica statistica = appService.getStatistica();\n assertTrue(true);\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"Literatura\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"Literatura\") == 1);\n } catch (NotAbleToCreateStatisticsException e) {\n assertTrue(false);\n e.printStackTrace();\n }\n\n }", "@Test\n public void testViewStatistics() {\n for (int i = 0; i < 10; i++) {\n presenter.onViewStatistics();\n }\n Assert.assertEquals(10, view.getManageViewStatisticsClicks());\n }", "@Test\n\tpublic void lateHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfLateHires() == 1);\n\t}", "@Test\n\tpublic void testCalHealth() {\n\t\tnpc.setLevel(1);\n\t\tnpc.setHealth(55);\n\t\tassertFalse(npc.getHealth() == npc.getMaxHealth());\n\t\tnpc.calHealth();\n\t\tassertTrue(npc.getHealth() == npc.getMaxHealth());\n\t}", "public void aumentaInSitu(){\n if(quantidade_in_situ<quantidade_disponivel)\n quantidade_in_situ++;\n else\n return;\n }", "public void calcularEntropia(){\n //Verificamos si será con la misma probabilida o con probabilidad\n //especifica\n if(contadorEstados == 0){\n //Significa que será con la misma probabilidad por lo que nosotros\n //calcularemos las probabilidades individuales\n for(int i = 0; i < numEstados; i++){\n probabilidadEstados[i] = 1.0 / numEstados;\n }\n }\n for(int i = 0; i < numEstados; i++){\n double logEstado = Math.log10(probabilidadEstados[i]);\n logEstado = logEstado * (-1);\n double logDos = Math.log10(2);\n double divisionLog = logEstado / logDos;\n double entropiaTmp = probabilidadEstados[i] * divisionLog;\n resultado += entropiaTmp;\n }\n }", "public int defaultAnomaly(int total);", "private boolean isNormalCountOK(int normalObs, int numNormalReads, int tumorObs) {\n\t\treturn normalObs == 0 || (tumorObs >= 20 && numNormalReads >= 20);\t\t\n\t}", "@Test\n public void is_totalPrice_Is_displayed_properly_Added_To_The_Menu_Failure_Senario_Summation_Incorrect(){\n int isTotalPriceDisplayedSumIncorrect = restaurant.displayCost(totalPrice).size();\n restaurant.displayCost(\"InCorrect Amount Displayed due to Wrong Summation\", isTotalPriceDisplayedSummationCorrect);\n assertEquals(isTotalPriceDisplayedSumIncorrect,restaurant.displayCost(totalPrice).size());\n\n\n }", "@Test\n\tpublic void totalBikes()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getTotalBikes() == 4);\n\t}", "public void testSummaryStatsPartialLog() {\n\n // TODO: Create File in platform independent way.\n File testFile = new File(\"src/test/data/dataset98.txt\");\n GcManager gcManager = new GcManager();\n File preprocessedFile = gcManager.preprocess(testFile, null);\n gcManager.store(preprocessedFile, false);\n JvmRun jvmRun = gcManager.getJvmRun(new Jvm(null, null), Constants.DEFAULT_BOTTLENECK_THROUGHPUT_THRESHOLD);\n Assert.assertEquals(\"GC event type count not correct.\", 2, jvmRun.getEventTypes().size());\n Assert.assertEquals(\"GC blocking event count not correct.\", 2, jvmRun.getBlockingEventCount());\n Assert.assertEquals(\"GC pause total not correct.\", 61, jvmRun.getTotalGcPause());\n Assert.assertEquals(\"GC first timestamp not correct.\", 1002192, jvmRun.getFirstGcEvent().getTimestamp());\n Assert.assertEquals(\"GC last timestamp not correct.\", 1002847, jvmRun.getLastGcEvent().getTimestamp());\n Assert.assertEquals(\"GC last duration not correct.\", 41, jvmRun.getLastGcEvent().getDuration());\n Assert.assertEquals(\"Stopped Time event count not correct.\", 6, jvmRun.getStoppedTimeEventCount());\n Assert.assertEquals(\"Stopped time total not correct.\", 1064, jvmRun.getTotalStoppedTime());\n Assert.assertEquals(\"Stopped first timestamp not correct.\", 1000964,\n jvmRun.getFirstStoppedEvent().getTimestamp());\n Assert.assertEquals(\"Stopped last timestamp not correct.\", 1003884,\n jvmRun.getLastStoppedEvent().getTimestamp());\n Assert.assertEquals(\"Stopped last duration not correct.\", 1000688, jvmRun.getLastStoppedEvent().getDuration());\n Assert.assertEquals(\"JVM first event timestamp not correct.\", 1000964, jvmRun.getFirstEvent().getTimestamp());\n Assert.assertEquals(\"JVM last event timestamp not correct.\", 1003884, jvmRun.getLastEvent().getTimestamp());\n Assert.assertEquals(\"JVM run duration not correct.\", 3920, jvmRun.getJvmRunDuration());\n Assert.assertEquals(\"GC throughput not correct.\", 98, jvmRun.getGcThroughput());\n Assert.assertEquals(\"Stopped time throughput not correct.\", 73, jvmRun.getStoppedTimeThroughput());\n Assert.assertTrue(Analysis.WARN_GC_STOPPED_RATIO + \" analysis not identified.\",\n jvmRun.getAnalysis().contains(Analysis.WARN_GC_STOPPED_RATIO));\n }", "boolean hasTotalBet();", "boolean hasTotalBet();", "@Test\n\tpublic void testCalculateCalories() \n\t{\n\t\tParticipant participant = new Participant(\"Daniel\", 155, Participant.GENDER.MALE, 1);\n\t\tparticipant.setCurrentBeers(2);\n\t\tparticipant.setCurrentWine(2);\n\t\tparticipant.setCurrentCocktails(2);\n\t\tparticipant.setCurrentShots(3);\n\t\t\n\t\tassertEquals(1228, HealthCalculator.caluclateCalories(participant));\n\t}", "@Test\n\tpublic void bikesOnHire()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfBikesOnHire() == 2);\n\t}", "@Test\n public void pruebaCalculCamiseta() {\n System.out.println(\"prueba Calcul Camiseta\");\n Camiseta camisetaTest = new Camiseta(1);\n assertEquals(190, (camisetaTest.calculCamiseta(1)),0) ;\n \n Camiseta camisetaTestDos = new Camiseta(2);\n assertEquals(1481.2, (camisetaTestDos.calculCamiseta(7)),0) ;\n \n Camiseta camisetaTestTres = new Camiseta(3);\n assertEquals(1178, (camisetaTestTres.calculCamiseta(4)),0) ;\n \n \n }", "void assertTotalCntPctEquals(T key, double expected);", "private void test(NFV root) throws Exception{\n\t\tlong beginAll=System.currentTimeMillis();\n\t\tNFV rootTest = init(root);\n\t\tlong endAll=System.currentTimeMillis();\n //System.out.println(\"Total time -> \" + ((endAll-beginAll)/1000) + \"s\");\n\t\trootTest.getPropertyDefinition().getProperty().forEach(p ->{\n \tif(p.isIsSat()){\n\t\t\t\tmaxTotTime = maxTotTime<(endAll-beginAll)? (endAll-beginAll) : maxTotTime;\n\t\t\t\tSystem.out.print(\"time: \" + (endAll-beginAll) + \"ms;\");\n\t\t\t\ttotTime += (endAll-beginAll);\n \t\tnSAT++;\n \t}\n \telse{\n \t\tnUNSAT++;\n \t}\n });\n return;\n\t}", "@Test\n public void testGetPercentComplete_1()\n throws Exception {\n ScriptProgressContainer fixture = new ScriptProgressContainer(1, \"\");\n\n int result = fixture.getPercentComplete();\n\n assertEquals(1, result);\n }", "public void sumaPuntos() {\r\n int rojo = 0;\r\n int azul = 0;\r\n for (int i = 1; i < 10; i++) {\r\n\r\n if (tablero[1][i].getTipo().equals(\"Rojo\")) {\r\n rojo += tablero[1][i].getValor();\r\n }\r\n\r\n if (tablero[8][i].getTipo().equals(\"Azul\")) {\r\n azul += tablero[8][i].getValor();\r\n }\r\n\r\n }\r\n if (rojo > azul) {\r\n this.setResultado(\"Rojo\");\r\n this.agregarVictoria(jugadorRojo);\r\n }\r\n if (azul > rojo) {\r\n this.setResultado(\"Azul\");\r\n this.agregarVictoria(jugadorAzul);\r\n }\r\n \r\n this.setReplay(true);\r\n }", "private boolean decideIfEventShouldBeReportedAsAFailure() {\n \tint value = new Random().nextInt(100);\n \tif (value < TARGET_SUCCESS_RATE) {\n \t\treturn false;\n \t} else {\n \treturn true;\n \t}\n }", "private boolean shouldProcessEvent(TimeSeriesEvent e) {\r\n return modCountOnLastRefresh < e.getSeriesModCount();\r\n }", "void assertTotalTimePctEquals(T key, double expected);", "private void calculeStatRemove() {\n resourceA = this.getContext().getGame().getPlayer(idPlayer).getInventory().getValueRessource(type);\n int loose = resourceB - resourceA;\n int diff = (resourceA - resourceB) + value;\n this.getContext().getStats().incNbRessourceLoosePlayers(idPlayer,type,loose);\n this.getContext().getStats().incNbRessourceNotLoosePlayers(idPlayer,type,diff);\n }", "@Test\n public void testAnalisarPeriodo() throws Exception {\n System.out.println(\"analisarPeriodo\");\n int[][] dadosFicheiro = null;\n int lowerLimit = 0;\n int upperLimit = 0;\n int linhas = 0;\n int[] expResult = null;\n int[] result = ProjetoV1.analisarPeriodo(dadosFicheiro, lowerLimit, upperLimit, linhas);\n assertArrayEquals(expResult, result);\n\n }", "@Test\n public void shouldDecrementCredibilityScore(){\n mEventsReport.userUpVote();\n mEventsReport.userDownVote();\n assertEquals(0, mEventsReport.getReportCredibilityScore());\n }", "@Test\n public void getEventTest() {\n Event[] event = new Event[3];\n event[0] = Event.ZERO;\n god.getEvent(event, board, actions);\n assertEquals(actions[2][3][0].getStatus(), true);\n assertEquals(actions[4][3][0].getStatus(), false);\n assertEquals(actions[2][2][0].getStatus(), true);\n assertEquals(actions[2][4][0].getStatus(), false);\n assertEquals(actions[0][0][0].getStatus(), false);\n event[0] = Event.BUILD;\n god.getEvent(event, board, actions);\n assertEquals(actions[2][3][0].getStatus(), true);\n assertEquals(actions[4][3][0].getStatus(), false);\n assertEquals(actions[2][2][0].getStatus(), true);\n assertEquals(actions[2][4][0].getStatus(), false);\n assertEquals(actions[0][0][0].getStatus(), false);\n event[0] = Event.MOVE;\n event[1] = Event.UP;\n god.getEvent(event, board, actions);\n for (int i = 2; i < 5; i++) {\n for (int j = 2; j < 5; j++) {\n if ((i == 3 && j\n == 3) || (i == 2 && j == 4) || (i == 4 && j == 3)) {\n assertEquals(actions[i][j][1].getStatus(), false);\n } else if (i == 2 && j ==\n 2) {\n assertEquals(actions[i][j][2].getStatus(), true);\n } else {\n assertEquals(actions[i][j][1].getStatus(), true);\n }\n }\n }\n board[2][2].addBlock(new Block(TypeBlock.WORKER));\n god.setWorker(new int[]{\n 2, 2});\n event[0] = Event.MOVE;\n event[1] = Event.UP;\n god.getEvent(event,\n board, actions);\n assertEquals(StatusPlayer.WIN, god.getPlayerStatus());\n event[0] = Event.BUILD;\n god.getEvent(event, board, actions);\n event[0] =\n Event.ONE;\n god.getEvent(event, board, actions);\n assertEquals(StatusPlayer.WIN, god.getPlayerStatus());\n god.setStatusPlayer(StatusPlayer.GAMING);\n god.getEvent(event, board,\n actions);\n assertEquals(StatusPlayer.IDLE, god.getPlayerStatus());\n for (int i\n = 0; i < 5; i++) {\n for (int j = 0; j < 5; j++) {\n\n actions[i][j][0].set(false);\n actions[i][j][1].set(false);\n actions[i][j][2].set(false);\n }\n }\n event[0] = Event.ONE;\n god.getEvent(event, board, actions);\n assertEquals(StatusPlayer.LOSE, god.getPlayerStatus());\n event[0] = Event.ONE;\n actions[0][0][0].set(true);\n god.getEvent(event, board, actions);\n\n assertEquals(StatusPlayer.GAMING, god.getPlayerStatus());\n event[0] =\n Event.MOVE;\n event[1] = Event.ZERO;\n god.getEvent(event, board, actions);\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < 5; j++) {\n\n actions[i][j][0].set(false);\n actions[i][j][1].set(false);\n actions[i][j][2].set(false);\n }\n }\n actions[0][0][1].set(true);\n event[0] = Event.ONE;\n god.getEvent(event, board,\n actions);\n assertEquals(StatusPlayer.GAMING, god.getPlayerStatus());\n event[0]\n = Event.MOVE;\n god.getEvent(event, board, actions);\n\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < 5; j++) {\n\n actions[i][j][0].set(false);\n actions[i][j][1].set(false);\n actions[i][j][2].set(false);\n }\n }\n\n actions[0][0][2].set(true);\n\n event[0] = Event.ONE;\n god.getEvent(event, board, actions);\n assertEquals(StatusPlayer.GAMING, god.getPlayerStatus());\n\n event[0] = Event.BUILD;\n god.getEvent(event, board, actions);\n for (int i = 0;\n i < 5; i++) {\n for (int j = 0; j < 5; j++) {\n\n actions[i][j][0].set(false);\n actions[i][j][1].set(false);\n actions[i][j][2].set(false);\n }\n }\n event[0] = Event.TWO;\n god.getEvent(event,\n board, actions);\n assertEquals(StatusPlayer.IDLE, god.getPlayerStatus());\n\n god.setStatusPlayer(StatusPlayer.WIN);\n event[0] = Event.TWO;\n god.getEvent(event, board, actions);\n assertEquals(StatusPlayer.WIN,\n god.getPlayerStatus());\n event[0] = Event.ONE;\n god.getEvent(event, board,\n actions);\n assertEquals(StatusPlayer.WIN, god.getPlayerStatus());\n }", "public int obtTotalEpVistosTemp() {\n\t\tint visto = 0;\n\t\tfor (Episodio episodio : this.episodios) {\n\t\t\tif (episodio.isFlag()) {\n\t\t\t\tvisto++;\n\t\t\t}\n\t\t}\n\t\treturn visto;\n\t}", "@Test\n public void testGetPercentComplete() {\n TaskSeriesCollection c = createCollection2();\n TaskSeriesCollection c3 = createCollection3();\n assertEquals(new Double(0.111), c3.getPercentComplete(0, 0, 0));\n }", "@Test\n public void subtotal_isCorrect() {\n\n MainActivity.items.add(new Item(\"food\", 20.99, 2, 0));\n MainActivity.items.add(new Item(\"games\", 10, 1, 10));\n\n Cart.update_total();\n assert (Cart.sub_sum == 20.99 * 2 + 10 * 0.9);\n }", "@Test\n\tpublic void testPrixAction() {\n\t\tassertEquals(200, TypeChaine.prixAction(TypeChaine.SACKSON, 2));\n\t\tassertEquals(300, TypeChaine.prixAction(TypeChaine.SACKSON, 3));\n\t\tassertEquals(400, TypeChaine.prixAction(TypeChaine.SACKSON, 4));\n\t\tassertEquals(500, TypeChaine.prixAction(TypeChaine.SACKSON, 5));\n\t\tassertEquals(600, TypeChaine.prixAction(TypeChaine.SACKSON, 6));\n\t\tassertEquals(600, TypeChaine.prixAction(TypeChaine.SACKSON, 8));\n\t\tassertEquals(600, TypeChaine.prixAction(TypeChaine.SACKSON, 10));\n\t\tassertEquals(700, TypeChaine.prixAction(TypeChaine.SACKSON, 11));\n\t\tassertEquals(700, TypeChaine.prixAction(TypeChaine.SACKSON, 15));\n\t\tassertEquals(700, TypeChaine.prixAction(TypeChaine.SACKSON, 20));\n\t\tassertEquals(800, TypeChaine.prixAction(TypeChaine.SACKSON, 21));\n\t\tassertEquals(800, TypeChaine.prixAction(TypeChaine.SACKSON, 22));\n\t\tassertEquals(800, TypeChaine.prixAction(TypeChaine.SACKSON, 30));\n\t\tassertEquals(900, TypeChaine.prixAction(TypeChaine.SACKSON, 31));\n\t\tassertEquals(900, TypeChaine.prixAction(TypeChaine.SACKSON, 33));\n\t\tassertEquals(900, TypeChaine.prixAction(TypeChaine.SACKSON, 40));\n\t\tassertEquals(1000, TypeChaine.prixAction(TypeChaine.SACKSON, 41));\n\t\tassertEquals(1000, TypeChaine.prixAction(TypeChaine.SACKSON, 42));\n\n\t\t// cas categorie hotel = 2\n\t\tassertEquals(300, TypeChaine.prixAction(TypeChaine.HYDRA, 2));\n\t\tassertEquals(400, TypeChaine.prixAction(TypeChaine.HYDRA, 3));\n\t\tassertEquals(500, TypeChaine.prixAction(TypeChaine.HYDRA, 4));\n\t\tassertEquals(600, TypeChaine.prixAction(TypeChaine.HYDRA, 5));\n\t\tassertEquals(700, TypeChaine.prixAction(TypeChaine.HYDRA, 6));\n\t\tassertEquals(700, TypeChaine.prixAction(TypeChaine.HYDRA, 8));\n\t\tassertEquals(700, TypeChaine.prixAction(TypeChaine.HYDRA, 10));\n\t\tassertEquals(800, TypeChaine.prixAction(TypeChaine.HYDRA, 11));\n\t\tassertEquals(800, TypeChaine.prixAction(TypeChaine.HYDRA, 15));\n\t\tassertEquals(800, TypeChaine.prixAction(TypeChaine.HYDRA, 20));\n\t\tassertEquals(900, TypeChaine.prixAction(TypeChaine.HYDRA, 21));\n\t\tassertEquals(900, TypeChaine.prixAction(TypeChaine.HYDRA, 22));\n\t\tassertEquals(900, TypeChaine.prixAction(TypeChaine.HYDRA, 30));\n\t\tassertEquals(1000, TypeChaine.prixAction(TypeChaine.HYDRA, 31));\n\t\tassertEquals(1000, TypeChaine.prixAction(TypeChaine.HYDRA, 33));\n\t\tassertEquals(1000, TypeChaine.prixAction(TypeChaine.HYDRA, 40));\n\t\tassertEquals(1100, TypeChaine.prixAction(TypeChaine.HYDRA, 41));\n\t\tassertEquals(1100, TypeChaine.prixAction(TypeChaine.HYDRA, 42));\n\n\t\t// cas categorie hotel = 3\n\t\tassertEquals(400, TypeChaine.prixAction(TypeChaine.PHOENIX, 2));\n\t\tassertEquals(500, TypeChaine.prixAction(TypeChaine.PHOENIX, 3));\n\t\tassertEquals(600, TypeChaine.prixAction(TypeChaine.PHOENIX, 4));\n\t\tassertEquals(700, TypeChaine.prixAction(TypeChaine.PHOENIX, 5));\n\t\tassertEquals(800, TypeChaine.prixAction(TypeChaine.PHOENIX, 6));\n\t\tassertEquals(800, TypeChaine.prixAction(TypeChaine.PHOENIX, 8));\n\t\tassertEquals(800, TypeChaine.prixAction(TypeChaine.PHOENIX, 10));\n\t\tassertEquals(900, TypeChaine.prixAction(TypeChaine.PHOENIX, 11));\n\t\tassertEquals(900, TypeChaine.prixAction(TypeChaine.PHOENIX, 15));\n\t\tassertEquals(900, TypeChaine.prixAction(TypeChaine.PHOENIX, 20));\n\t\tassertEquals(1000, TypeChaine.prixAction(TypeChaine.PHOENIX, 21));\n\t\tassertEquals(1000, TypeChaine.prixAction(TypeChaine.PHOENIX, 22));\n\t\tassertEquals(1000, TypeChaine.prixAction(TypeChaine.PHOENIX, 30));\n\t\tassertEquals(1100, TypeChaine.prixAction(TypeChaine.PHOENIX, 31));\n\t\tassertEquals(1100, TypeChaine.prixAction(TypeChaine.PHOENIX, 33));\n\t\tassertEquals(1100, TypeChaine.prixAction(TypeChaine.PHOENIX, 40));\n\t\tassertEquals(1200, TypeChaine.prixAction(TypeChaine.PHOENIX, 41));\n\t\tassertEquals(1200, TypeChaine.prixAction(TypeChaine.PHOENIX, 42));\n\t}", "@Test\n public void testCalculerMontantService() {\n double expResult = 0.0;\n double result = CalculAgricole.calculerMontantServices();\n assertEquals(\"Montant pour las droits du passage n'était pas correct.\", expResult, result, 0);\n }", "@Test\n public void is_totalPrice_Is_displayed_properly_Added_To_The_Menu_Success_Senario_Correct_Sum(){\n int isTotalPriceDisplayedSummationCorrect = restaurant.displayCost(totalPrice).size();\n restaurant.displayCost(\"Correct Sum Amount Displayed\", isTotalPriceDisplayed);\n assertEquals(isTotalPriceDisplayed,restaurant.getTotalPrice().size());\n\n\n }", "public void Times() \n {\n if(status.getStatus_NUM() == 1 || status.getStatus_NUM() == 2 || status.getStatus_NUM() == 3)\n { //Waiting Time\n startWaitingTime = System.nanoTime();\n if(status.getStatus_NUM() != 1 || status.getStatus_NUM() != 2 || status.getStatus_NUM() != 3)\n {\n endWaitingTime = System.nanoTime();\n }\n \n totalWaitingTime += endWaitingTime - startWaitingTime;\n }\n //When it is running status \n else if(status.getStatus_NUM() == 0)\n {\n //Running Time\n startRunningTime = System.nanoTime();\n //Add a process\n if(status.getStatus_NUM() != 0)\n {\n endRunningTime = System.nanoTime();\n }\n \n totalRunningTime += endRunningTime - startRunningTime;\n }\n //When it is terminated\n else\n {\n System.out.println(\"Terminated\");\n System.out.println(\"Total Running Time : \" + totalRunningTime);\n System.out.println(\"Total Waiting Time : \" + totalWaitingTime);\n }\n }", "@Test\n void getTotal() {\n Tests tests = new Tests();\n tests.setTotal(78645);\n int total = tests.getTotal();\n assertEquals(78645,tests.getTotal());\n\n }", "public int getCantCalif() {\n\t\tint calificacion = 0;\n\t\tfor (Episodio episodio : this.episodios) {\n\t\t\tif (episodio.isFlag()) {\n\t\t\t\tcalificacion += episodio.getCalificacion();\n\t\t\t}\n\t\t}\n\t\treturn calificacion;\n\t}", "public void prinRecaudacion()\n {\n System.out.println(\"La cantidad recaudada por la maquina1 es \" + maquina1.getTotal());\n System.out.println(\"La cantidad recaudada por la maquina2 es \" + maquina2.getTotal());\n System.out.println(\"La cantidad total es\" + ( maquina1.getTotal() + maquina2.getTotal()));\n}", "public void nourrir() {\n if (!autoriseOperation()) {\n return;\n }\n\n incrFaim(-2);\n incrPoids(1);\n incrHumeur(1);\n incrXp(1);\n\n System.out.println(tamagoStats.getXp());\n setChanged();\n notifyObservers();\n\n }", "private int getExpectedStat(Stat stat, int individualValue, int natureValue) {\n return getExpectedStat(stat, getLevel(), individualValue, getTotalEvs(stat), baseValues, natureValue);\n\n }", "private void calcFinanceTotals() {\n System.out.println(\"calcFinanceTotals\");\n financeWindow.clear();\n for (int i = 0; i < clubEventList.totalSize(); i++) {\n financeWindow.calcPlus(clubEventList.getUnfiltered(i));\n }\n financeWindow.display();\n }", "@Override\r\n\t\tpublic int calculAnomaly(int total, int freq) {\n\t\t\treturn (int) Math.round(Math.log((double)total/(double)freq));\r\n\r\n\r\n\t\t}", "public void testNoBeforeYesSameElapsed() throws Exception{\n \n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n \"15,8,D,12,Yes\",\n \"16,8,D,12,No\",\n \n \"24,4,B,15,Yes\",\n \"25,4,B,15,No\",\n \"26,4,B,15,No\",\n \n \"28,2,C,22,Yes\",\n \"29,2,C,22,No\",\n \"30,2,C,22,Yes\",\n \"30,2,C,22,Yes\",\n };\n \n /**\n * \n * \n * \n */\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team8,1,12\",\n \"2,team4,1,15\",\n \"3,team2,1,22\",\n \"4,team1,0,0\",\n \"4,team3,0,0\",\n \"4,team5,0,0\",\n \"4,team6,0,0\",\n \"4,team7,0,0\",\n };\n \n scoreboardTest (8, runsData, rankData);\n }", "public Long getProgressTotalToDo();", "@Test\n public void testPercentages(){\n assertTrue(Results.percentages());\n }", "@Test\n\tpublic void testPotencia0() {\n\t\tdouble resultado=Producto.potencia(0, 8);\n\t\tdouble esperado=0;\n\t\t\n\t\tassertEquals(esperado,resultado);\n\t}", "public int determineNumberOfEvents(AIMBenefitStatusGroup group) { \t\n \tList<AIMBenefitStatus> statusList = group.getBenefitStatuses();\n \t \tSet<String> benefitNumberSet = new TreeSet<String>();\t\t \t \t \t \t\n\t \tfor(int i = 0; i<statusList.size(); i++) {\n\t \t\tAIMBenefitStatus aimBenefitStatus = statusList.get(i); \t\t\t \t\t\n\t \t\tbenefitNumberSet.add(aimBenefitStatus.getBenefitNumber());\t \t\t \n\t \t}\n\t \treturn benefitNumberSet.size();\n }", "public static void analyzeEventsQueriesAmounts() throws SQLException\r\n\t{\r\n\t\tStatement stat = conn.createStatement();\r\n \r\n ResultSet result = stat.executeQuery(\"SELECT * FROM fraud.afm_fraudeventrecord;\");\r\n \r\n while (result.next())\r\n {\r\n \tString event = result.getString(\"eventType\");\r\n \tString user = result.getString(\"userId\");\r\n \t\r\n \tif (\r\n \t\t\t(event.contains(\"LOAD\"))\r\n \t&& \t\t(user.equals(\"user40\"))\r\n \t\t\t\r\n \t\t\t){\r\n \tSystem.out.print(new Date(result.getInt(\"timestamp\")));\r\n \tSystem.out.print(\" User : \" + user);\r\n \tSystem.out.print(\" Event : \" + event);\r\n \t\r\n \tString recordId = result.getString(\"fraudScoreRecordId\");\r\n \t\r\n \tif (recordId != null)\r\n \t{\r\n \t\tStatement stat2 = conn.createStatement();\r\n \t\tResultSet s = stat2.executeQuery(\"SELECT * FROM fraud.afm_fraudscorerecord where recordId='\"+recordId+\"';\");\r\n \t\twhile (s.next())\r\n \t\t{\r\n \t\t\tSystem.out.print(\" Query Type: \" + s.getString(\"queryType\"));\r\n \t\t\tSystem.out.print(\" Amount: \" + s.getDouble(\"transactionAmount\"));\r\n \t\t}\r\n \t}\r\n \t\r\n \t\r\n \tSystem.out.println();\r\n \t} \t\r\n }\r\n stat.close();\r\n\t}", "@Test\r\n\tpublic void getTotal_3oh(){\n\t\tcart = new TourShoppingCart(MockRules.getRules());\r\n\t\tcart.add(new Item(ItemType.OH, BigDecimal.valueOf(300.00)) );\r\n\t\tcart.add(new Item(ItemType.OH, BigDecimal.valueOf(300.00)) );\r\n\t\tcart.add(new Item(ItemType.OH, BigDecimal.valueOf(300.00)) );\r\n\t\tcart.add(new Item(ItemType.BC, BigDecimal.valueOf(110.00)) );\r\n\t\tassert cart.total().equals(BigDecimal.valueOf(710.00));\r\n\t\tSystem.out.println(cart.total());\r\n\t}", "@Test\r\n\tpublic void testCalculadorDescuento() {\r\n\r\n\t\tSystem.out.println(\"Calcular descuento \" + carritoCompraService.calculadorDescuento(17.6, 50d));\r\n\t\tassertEquals(carritoCompraService.calculadorDescuento(17.6d, 50d), 8.8);\r\n\t}", "public void imprimirResultados(){\n System.out.println(\"t (tiempo actual) \"+t);\n \n \n System.out.println(\"\\nGanancia total: $\"+R);\n System.out.println(\"Costos por mercaderia comprada: $\"+C);\n System.out.println(\"Costos por mantenimiento inventario: $\"+H);\n System.out.println(\"Ganancia promeio de la tienda por unidad de tiempo: $\"+(R-C-H)/T);\n \n }", "public void hora()\n {\n horaTotal = HoraSalida - HoraLlegada;\n\n }", "@Test\n\tvoid testCalculateMarkTillSemesterSuccess3() {\n\t\n\t\tString semesterName = \"20193\";\n\t\t\n\t\tUser user = userService.findByUsername(\"B17DCCN123\");\n\t\tStudent student = user.getStudent();\n\t\tList<StudentResult> resultsTillSemester = resultService.findResultTillSemester(student.getId(),\n\t\t\t\tsemesterName);\n\t\t\n\t\tString tktMark = \"\";\n\t\t\n\t\tfor (StudentResult result : resultsTillSemester) {\n\t\t\tSubject subject = result.getStudentRegister().getCourse().getSubject();\n\t\t\tif (subject.getName().equals(\"Toán kinh tế\")) {\n\t\t\t\ttktMark = result.getMarkToChar();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tList<Object> listGpaResultsTillNow = MarkUtility.calculateMarkTillSemester(resultsTillSemester);\n\t\tint passedCreditsTillNow = (int) listGpaResultsTillNow.get(0);\n\t\tfloat gpaTillNow = (float) listGpaResultsTillNow.get(1);\n\t\t\n\t\tDecimalFormat df = new DecimalFormat(\"#.##\");\n\t\t\n\t\tassertTrue(\n\t\t\t\ttktMark.equals(\"C\") && \n\t\t\t\tpassedCreditsTillNow == 18 && \n\t\t\t\tdf.format(gpaTillNow).equals(\"3.19\")\n\t\t\t\t);\n\t}", "int countByExample(EventDetail eventDetail);", "@Test\n void totalPercentageNoOrderLine() {\n allProducts.add(new Product(null, 1, \"productTest\", 10.0, null, null, null,null));\n\n ArrayList<ProductIncome> productIncomes = productBusiness.computeProductsIncome(allProducts, allOrderLines);\n productIncomes.get(0).calculPercentage();\n assertEquals(0.0, productIncomes.get(0).getPercentage(), 0 );\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n }", "@Test\n public void testWinLossRatio(){\n float wins = 0;\n float losses = 0;\n\n realDie1 = new Dice();\n realDie2 = new Dice();\n realDie3 = new Dice();\n\n game = new Game(realDie1, realDie2, realDie3);\n\n when (mockPlayer.getBalance()).thenReturn(100);\n\n int currentGameWins = 0;\n\n for (int i = 0; i < 10000; i++) {\n currentGameWins = game.playRound(mockPlayer, DiceValue.ANCHOR, 10);\n\n if (currentGameWins == 0) {\n losses ++;\n } else {\n wins ++;\n }\n\n }\n System.out.println(\"Wins = \" + wins + \" Losses = \" + losses);\n float ratio = wins/(losses + wins);\n System.out.println(\"Win ratio = \" + ratio);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tint N = getN();\n\t\t\t\tint T = getT();\n\t\t\t\t\n\t\t\t\tStopwatch stopwatch = new Stopwatch();\n\t\t\t\tPercolationStats ps = new PercolationStats(N, T);\n\t\t\t\t\n\t\t\t\t// results of running PercolationStats object after passing N and T \n\t\t\t\t// N - size of the Table (N * N)\n\t\t\t\t// T - times object runs the simulation\n\t\t\t\tString runTime= \"\" + stopwatch.elapsedTime(); // gets run Time\n\t\t\t\tString mean = \t\"\" + ps.mean(); // gets Mean - look at Statistics\n\t\t\t\tString stddev = \"\" + ps.stddev(); // gets Standard Deviation\n\t\t\t\tString HiLo = \t\"\" + ps.confidenceLo() + \", \" + ps.confidenceHi(); // gets 95% confidence interval:\n\t\t\t\tResultScreenGUI result = new ResultScreenGUI(mean, stddev, HiLo, runTime);\n\t\t\t\tresult.pack();\n\t\t\t\tresult.setVisible(true);\n\t\t\t}", "@Test\n void totalPercentageOneProduct() {\n allProducts.add(new Product(null, 1, \"productTest\", 10.0, null, null, null,null));\n allOrderLines.add(new OrderLine(new Product(1), null, 2, 10.0));\n\n ArrayList<ProductIncome> productIncomes = productBusiness.computeProductsIncome(allProducts, allOrderLines);\n productIncomes.get(0).calculPercentage();\n assertEquals(100.0, productIncomes.get(0).getPercentage(), 0);\n }", "private void updateStats()\n\t{\n\n\t\tint[] temp = simulation.getStatValue();\n\t\tfor(int i = 0; i < temp.length; i++)\n\t\t{\n\t\t\tthis.statsValues[i].setText(Integer.toString(temp[i]));\n\t\t}\n\t\t\n\t\tint[] temp2 = simulation.getNumberInEachLine();\n\t\tfor(int i = 0; i < temp2.length; i++)\n\t\t{\n\t\t\tthis.eatValues[i].setText(Integer.toString(temp2[i]));\n\t\t}\n\t}", "private void updateExpectedTotalOffices() {\n mExpectedTotalOffices++;\n }", "@Test\r\n\tpublic void testGetNumDivisions() {\r\n\t\tint numDivisions = 2;\r\n\t\tassertEquals(numDivisions, stats.getNumDivisions());\r\n\t}", "public int getAmountDone();", "@Test\r\n\tpublic void testGetNumGoalsForDivisionError() {\r\n\t\tint numGoalsDivError = -1;\r\n\t\tassertEquals(numGoalsDivError, stats.getNumGoalsForDivision(\"By Zero Division\"));\r\n\t}", "@Test\r\n public void testCalcularPosicion() {\r\n System.out.println(\"calcularPosicion\");\r\n int saltos = 41;\r\n int inicio = 8;\r\n int expResult = 11;\r\n int result = Cifrado.calcularPosicion(saltos, inicio);\r\n assertEquals(expResult, result);\r\n \r\n }", "@Test\n public void testCalculateOverallPercentageOfDelays() throws ParseException, IOException {\n System.out.println(\"calculateOverallPercentageOfDelays\");\n OrganizationsRegister ro = info(\"a\", \"b\");\n double expResult = 100.0;\n double result = ro.calculateOverallPercentageOfDelays();\n assertEquals(expResult, result);\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\n}", "public void calculations(){\n\n int temp_size1 = fight_list.get(0).t1.members.size();\n int[] t1_counter = new int[temp_size1 + 1]; //counter for deaths: 0, 1, 2..., party size.\n float t1_avg = 0; //Average number of deaths.\n\n //We don't need to calculate for t2 right now, because t2 is just monsters.\n //temp_size = fight_list.get(0).t2.members.size();\n //int[] t2_counter = new int[temp_size + 1];\n\n for(FightResult fig : this.fight_list){\n int i = 0;\n while(i != fig.t1_deaths){\n i++;\n }\n t1_counter[i]++;\n t1_avg += fig.t1_deaths;\n }//end for\n\n System.out.println(t1_avg);\n System.out.println(Float.toString(t1_avg/fight_list.size()) + \" / \" + Integer.toString(temp_size1));\n\n String axis = \"# of deaths: \\t\";\n int axis_int = 0;\n String t1_results = \"Happened: \\t\";\n for(int i : t1_counter){\n axis += Integer.toString(axis_int++) + \"\\t\";\n t1_results += Integer.toString(i) + \"\\t\";\n }//end for\n System.out.println(axis);\n System.out.println(t1_results);\n\n float tpk_amount = t1_counter[temp_size1]; //by taking the size, we take the item at the end of the array. In this case, the number where everyone dies.\n tpk_amount = (tpk_amount/fight_list.size())*100;\n System.out.println(\"Probability of TPK: \" + Float.toString(tpk_amount) + \" %.\");\n\n System.out.println(\"\\n--------\\n\");\n }", "public void eventLiving(double[] changes){\n living = (int) Math.floor(living * (1 + (changes[0]/100)));\n living += changes[1];\n \n if(living > 100){\n living = 100;\n }\n \n if(living < 0){\n living = 0;\n }\n }", "@Test\r\n public void testMedia() {\r\n EstatisticasUmidade e = new EstatisticasUmidade();\r\n e.setValor(5.2);\r\n e.setValor(7.0);\r\n e.setValor(1.3);\r\n e.setValor(6);\r\n e.setValor(0.87);\r\n double result= e.media(1);\r\n assertArrayEquals(\"ESPERA RESULTADO\", 5.2 , result, 0.1);\r\n }", "public void testSummaryStatsStoppedTime() {\n File testFile = new File(\"src/test/data/dataset41.txt\");\n GcManager gcManager = new GcManager();\n File preprocessedFile = gcManager.preprocess(testFile, null);\n gcManager.store(preprocessedFile, false);\n JvmRun jvmRun = gcManager.getJvmRun(new Jvm(null, null), Constants.DEFAULT_BOTTLENECK_THROUGHPUT_THRESHOLD);\n Assert.assertTrue(JdkUtil.LogEventType.G1_YOUNG_PAUSE.toString() + \" collector not identified.\",\n jvmRun.getEventTypes().contains(LogEventType.G1_YOUNG_PAUSE));\n Assert.assertTrue(JdkUtil.LogEventType.APPLICATION_STOPPED_TIME.toString() + \" not identified.\",\n jvmRun.getEventTypes().contains(LogEventType.APPLICATION_STOPPED_TIME));\n Assert.assertEquals(\"GC Event count not correct.\", 2, jvmRun.getEventTypes().size());\n Assert.assertEquals(\"GC pause total not correct.\", 61, jvmRun.getTotalGcPause());\n Assert.assertEquals(\"GC first timestamp not correct.\", 2192, jvmRun.getFirstGcEvent().getTimestamp());\n Assert.assertEquals(\"GC last timestamp not correct.\", 2847, jvmRun.getLastGcEvent().getTimestamp());\n Assert.assertEquals(\"GC last duration not correct.\", 41, jvmRun.getLastGcEvent().getDuration());\n Assert.assertEquals(\"Stopped Time event count not correct.\", 6, jvmRun.getStoppedTimeEventCount());\n Assert.assertEquals(\"Stopped time total not correct.\", 1064, jvmRun.getTotalStoppedTime());\n Assert.assertEquals(\"Stopped first timestamp not correct.\", 964, jvmRun.getFirstStoppedEvent().getTimestamp());\n Assert.assertEquals(\"Stopped last timestamp not correct.\", 3884, jvmRun.getLastStoppedEvent().getTimestamp());\n Assert.assertEquals(\"Stopped last duration not correct.\", 1000688, jvmRun.getLastStoppedEvent().getDuration());\n Assert.assertEquals(\"JVM first event timestamp not correct.\", 964, jvmRun.getFirstEvent().getTimestamp());\n Assert.assertEquals(\"JVM last event timestamp not correct.\", 3884, jvmRun.getLastEvent().getTimestamp());\n Assert.assertEquals(\"JVM run duration not correct.\", 4884, jvmRun.getJvmRunDuration());\n Assert.assertEquals(\"GC throughput not correct.\", 99, jvmRun.getGcThroughput());\n Assert.assertEquals(\"Stopped time throughput not correct.\", 78, jvmRun.getStoppedTimeThroughput());\n Assert.assertTrue(Analysis.WARN_GC_STOPPED_RATIO + \" analysis not identified.\",\n jvmRun.getAnalysis().contains(Analysis.WARN_GC_STOPPED_RATIO));\n }", "@Test\n\tpublic void testPotencia1() {\n\t\tdouble resultado=Producto.potencia(4, 0);\n\t\tdouble esperado=1.0;\n\t\t\n\t\tassertEquals(esperado,resultado);\n\t}", "@Test\n public void countNbrOfBoxAligneByAtBeginning(){\n int res = alignment.countNbrOfBoxAligneBy(player,2);\n assertEquals(\"EXpected 1 alignmenet\", 1, res);\n }", "void checkConsumption()\n {\n assertEquals(\"Consumption doesn't match\", keyEventPair.getKey().isConsumed(), keyEventPair.getValue().isConsumed());\n }", "@Test\n public void testSummaryChange() throws Exception {\n String changedSumamry = \"New summary\";\n EventData deltaEvent = prepareDeltaEvent(createdEvent);\n deltaEvent.setSummary(changedSumamry);\n updateEventAsOrganizer(deltaEvent);\n\n /*\n * Check that summary has been updated\n */\n AnalyzeResponse analyzeResponse = receiveUpdateAsAttendee(PartStat.ACCEPTED, CustomConsumers.ALL, changedSumamry, 1);\n AnalysisChange change = assertSingleChange(analyzeResponse);\n assertSingleDescription(change, changedSumamry);\n }", "@Override\n\tpublic String StatistiqueNbrRisuqe(){\n float m= accountRepository.NbrStatus(\"a risque\");\n float s=accountRepository.NbrStatus(\"Stable\");\n float res =( m / s)*100;\n return res+\"%\";\n\n\t}", "public int findTotalEvents() throws DAOException;", "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 }", "public Double getTotalAnomalyPercentage();" ]
[ "0.6124261", "0.6106938", "0.60680956", "0.593869", "0.5824756", "0.5802684", "0.57872385", "0.5730139", "0.57301384", "0.56679237", "0.5651565", "0.5650269", "0.5640435", "0.56379247", "0.5633462", "0.56223947", "0.5596154", "0.55922395", "0.5574622", "0.55744135", "0.55724174", "0.5547081", "0.5537173", "0.5527422", "0.5522693", "0.5520927", "0.5499708", "0.5499147", "0.54921144", "0.5479214", "0.54758394", "0.54726833", "0.54699636", "0.5462523", "0.5462523", "0.5457742", "0.5453514", "0.54476446", "0.54416484", "0.5416023", "0.5413599", "0.5412172", "0.5399115", "0.53893566", "0.5383709", "0.53783274", "0.5375757", "0.5368491", "0.5361964", "0.5361213", "0.53596795", "0.5358567", "0.5358464", "0.535467", "0.5353533", "0.53533375", "0.5352938", "0.5348434", "0.53404194", "0.5337093", "0.53219944", "0.53173935", "0.5313667", "0.5305923", "0.5299239", "0.5291338", "0.5290473", "0.5289445", "0.52886206", "0.52860254", "0.5283186", "0.52799743", "0.5275465", "0.5274471", "0.52645123", "0.52634686", "0.5252967", "0.52502793", "0.52384835", "0.523641", "0.5234891", "0.52316916", "0.5227359", "0.5226637", "0.5226056", "0.522558", "0.5224897", "0.52209145", "0.52170694", "0.5211955", "0.5210499", "0.52103734", "0.52046216", "0.51992935", "0.5198215", "0.5197707", "0.5193977", "0.51928", "0.51833737", "0.51824075" ]
0.72556406
0
Chiffrement d'une String en blowfish
private String encrypt(String input){ byte[] crypt = null; try { // Génération d'une spec de clé secrète à partir de la clé "secret" SecretKeySpec KS = new SecretKeySpec(SECRET_KEY.getBytes(), "Blowfish"); // Initialisation d'un code basé sur blowfish Cipher cipher = Cipher.getInstance("Blowfish"); cipher.init(Cipher.ENCRYPT_MODE, KS); // chiffrement du message crypt = cipher.doFinal(input.getBytes()); } catch (NoSuchAlgorithmException e) { System.err.println("Algorithme inconnu " + e.getMessage()); } catch (NoSuchPaddingException e) { System.err.println("Offset inconnu " + e.getMessage()); } catch (InvalidKeyException e) { System.err.println("Clé non valide " + e.getMessage()); } catch (IllegalBlockSizeException e) { System.err.println("Bloc de taille invalide " + e.getMessage()); } catch (BadPaddingException e) { System.err.println("Mauvais Padding : " + e.getMessage()); } // (pour des raisons d'encodage des caractères et de sauvegarde des bytes[] en base, on gardera les HexValues) return byteArrayToHexString(crypt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String Crypt(String s);", "private String decodageCesar(String text) {\n if (text == null || text.equals(\"\")) {\n throw new AssertionError(\"Aucun texte n'est saisie\");\n }\n String decoding = decodageMot(text);\n SubstCipher decodingText = new SubstCipher(this.shiftAlea);\n decodingText.ensureNegativeShift();\n decodingText.buildShiftedTextFor(decoding);\n return decodingText.getLastShiftedText();\n }", "private void convertToString(String s)\n\t{\n\t\tchar chars[] = s.toCharArray();\n\t\tfor(int i = 0; i < chars.length; i+=3)\n\t\t{\n\t\t\tString temp = \"\";\n\t\t\ttemp += chars[i];\n\t\t\ttemp += chars[i+1];\n\t\t\tif(chars[i] < '3')\n\t\t\t{\n\t\t\t\ttemp += chars[i+2];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ti -= 1;\n\t\t\t}\n\t\t\t\n\t\t\tif(!temp.equals(\"256\"))\n\t\t\t{\n\t\t\t\tmyDecryptedMessage += (char)(Integer.parseInt(temp));\n\t\t\t}\n\t\t}\n\t}", "public String encrypt(String geheimtext);", "private String encodageCesar(String text) {\n if (text == null || text.equals(\"\")) {\n throw new AssertionError(\"Aucun texte n'est saisie\");\n }\n SubstCipher encodingText = new SubstCipher(this.shiftAlea);\n encodingText.buildShiftedTextFor(text);\n String encoding = encodingText.getLastShiftedText();\n return encodageMot(encoding);\n }", "static String stringCutter1(String s) {\n int value = s.length() % 2 == 0 ? s.length() / 2 : s.length() / 2 + 1;\n\n // pemotongan string untuk pemotongan kelompok pertama\n String sentence1 = s.substring(0, value);\n\n // perulangan untuk menggeser nilai setiap karakter\n String wordNow = \"\";\n for (int i = 0; i < sentence1.length(); i++) {\n char alphabet = sentence1.toUpperCase().charAt(i);\n // pengubahan setiap karakter menjadi int\n // untuk menggeser 3 setiap nilai nya\n int asciiDecimal = (int) alphabet;\n // pengecekan kondisi apabila karakter melewati kode ascii nya\n if (asciiDecimal > 124) {\n int alphabetTransfer = 0 + (127 - asciiDecimal);\n wordNow += (char) alphabetTransfer;\n\n } else {\n int alphabetTrasfer = asciiDecimal + 3;\n wordNow += (char) alphabetTrasfer;\n }\n }\n return wordNow;\n }", "public static String deMaxim(String value) {\r\n if (value == null)\r\n return null;\r\n if (!value.startsWith(\"­­10\") && !value.startsWith(\"--10\"))\r\n return value; // not a password\r\n try {\r\n byte[] key = \"zP7Qn%9x\".getBytes(\"ISO-8859-1\"); // 8 byte key,\r\n // Giraffchen\r\n Key secretKey = new SecretKeySpec(key, \"DES\");\r\n byte[] input = hexStringToByteArray(value.substring(4));\r\n Cipher cipher = Cipher.getInstance(\"DES/ECB/NoPadding\");\r\n cipher.init(Cipher.DECRYPT_MODE, secretKey);\r\n byte[] result = cipher.doFinal(input);\r\n // find 0 byte\r\n int len = 0;\r\n for (int i = 0; i < result.length; i++) {\r\n if (result[i] == 0) {\r\n len = i;\r\n break;\r\n }\r\n }\r\n if (len == 0)\r\n len = result.length;\r\n byte[] text = new byte[len];\r\n System.arraycopy(result, 0, text, 0, len);\r\n return new String(text, \"ISO-8859-1\");\r\n } catch (Exception e) {\r\n throw new RuntimeException(e);\r\n }\r\n }", "private String decodageMot(String message) {\n if (message == null || message.equals(\"\")) {\n throw new AssertionError(\"Texte non saisie\");\n } \n return transformWords(message, 2);\n }", "private String encodageMot(String message) {\n if (message == null || message.equals(\"\")) {\n throw new AssertionError(\"Texte non saisie\");\n } \n return transformWords(message, 1); \n }", "String decodeString();", "private String fjernSkilleTegn (String inputString) {\n\t\t\tfor (int i = 0; i < skilleTegn.length; i++) {\n\t\t\t\tinputString = inputString.replace(Character.toString(skilleTegn[i]), \"\");\n\t\t\t}\n\t\t\treturn inputString;\n\t}", "@Override\r\n\tpublic String encriptar(String string) {\n\r\n \r\n String newName=\"\";\r\n for (int i = 0; i < string.length(); i++) {\r\n // instrucción switch con tipo de datos int\r\n switch (string.charAt(i)) \r\n {\r\n case 'a' : newName+=\"1,\";\r\n break;\r\n case 'b' : newName+=\"2,\";\r\n break;\r\n case 'c' : newName+=\"3,\";\r\n break;\r\n case 'd' : newName+=\"4,\";\r\n break;\r\n case 'e' : newName+=\"5,\";\r\n break;\r\n case 'f' : newName+=\"6,\";\r\n break;\r\n case 'g' : newName+=\"7,\";\r\n break;\r\n case 'h' : newName+=\"8,\";\r\n break;\r\n case 'i' : newName+=\"9,\";\r\n break;\r\n case 'j' : newName+=\"10,\";\r\n break;\r\n case 'k' : newName+=\"11,\";\r\n break;\r\n case 'l' : newName+=\"12,\";\r\n break;\r\n case 'm' : newName+=\"13,\";\r\n break;\r\n case 'n' : newName+=\"14,\";\r\n break;\r\n case 'ñ' : newName+=\"15,\";\r\n break;\r\n case 'o' : newName+=\"16,\";\r\n break;\r\n case 'p' : newName+=\"17,\";\r\n break;\r\n case 'q' : newName+=\"18,\";\r\n break;\r\n case 'r' : newName+=\"19,\";\r\n break;\r\n case 's' : newName+=\"20,\";\r\n break;\r\n case 't' : newName+=\"21,\";\r\n break;\r\n case 'u' : newName+=\"22,\";\r\n break;\r\n case 'v' : newName+=\"23,\";\r\n break;\r\n case 'w' : newName+=\"24,\";\r\n break;\r\n case 'x' : newName+=\"25,\";\r\n break;\r\n case 'y' : newName+=\"26,\";\r\n break;\r\n case 'z' : newName+=\"27,\";\r\n break;\r\n case ' ' : newName+=\"0,\";\r\n break;\r\n \r\n \r\n }\r\n \r\n }\r\n \r\n String palabraFinal= eliminarComaSi(newName);\r\n return palabraFinal;\r\n\t}", "static String stringCutter2(String s) {\n int value = s.length() % 2 == 0 ? s.length() / 2 : s.length() / 2 + 1;\n // pemotongan string untuk kelompok ke dua\n String sentence2 = s.substring(value, s.length());\n\n // perulangan untuk membalik setiap karakter pada kelompok kata ke dua\n String sentence2reverse = \"\";\n for (int i = sentence2.length() - 1; i >= 0; i--) {\n sentence2reverse += sentence2.toUpperCase().charAt(i);\n }\n return sentence2reverse;\n }", "private static String zzgr(String string2) {\n int n = string2.length();\n StringBuilder stringBuilder = new StringBuilder(n);\n int n2 = 0;\n while (n2 < n) {\n char c = string2.charAt(n2);\n if (c >= ' ' && c <= '~' && c != '\\\"' && c != '\\'') {\n stringBuilder.append(c);\n } else {\n stringBuilder.append(String.format(\"\\\\u%04x\", c));\n }\n ++n2;\n }\n return stringBuilder.toString();\n }", "@Override\n public String convertedText() {\n\n String input = mStringInputEditText.getText().toString();\n if (input.length() != 0) {\n String hexCode = String.format(\"%x\", new BigInteger(1, input.getBytes()));\n return mCheckBox.isChecked() ? hexCode.replaceAll(\"..(?!$)\", \"$0 \") : hexCode;\n } else {\n return \"\";\n }\n }", "public static String crypter (String chaineACrypter, int codeCryptage) {\r\n char car;\r\n char newCar;\r\n int charLength = chaineACrypter.length();\r\n\r\n for(int i = 0; i < charLength; i++){\r\n car = chaineACrypter.charAt(i);\r\n if(car >= 'a' && car <= 'z'){\r\n newCar = (char)(car + codeCryptage);\r\n if (i == 0) {\r\n chaineACrypter = newCar + chaineACrypter.substring(i+1);\r\n }else{\r\n chaineACrypter = chaineACrypter.substring(0, i) + newCar + chaineACrypter.substring(i+1);\r\n }\r\n }else if(car >= 'A' && car <= 'Z'){\r\n newCar = (char)(car - codeCryptage);\r\n if (i == 0) {\r\n chaineACrypter = newCar + chaineACrypter.substring(i+1);\r\n }else{\r\n chaineACrypter = chaineACrypter.substring(0, i) + newCar + chaineACrypter.substring(i+1);\r\n }\r\n }else if(car >= '0' && car <= '9'){\r\n newCar = (char)(car + 7 % codeCryptage);\r\n if (i == 0) {\r\n chaineACrypter = newCar + chaineACrypter.substring(i+1);\r\n }else{\r\n chaineACrypter = chaineACrypter.substring(0, i) + newCar + chaineACrypter.substring(i+1);\r\n }\r\n }\r\n }\r\n\r\n\r\n return chaineACrypter;\r\n }", "private static String scramble(String text) {\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-1\");\n md.update(text.getBytes(\"UTF-8\"));\n StringBuffer sb = new StringBuffer();\n for (byte b : md.digest()) sb.append(Integer.toString(b & 0xFF, 16));\n return sb.toString();\n } catch (UnsupportedEncodingException e) {\n return null;\n } catch (NoSuchAlgorithmException e) {\n return null;\n }\n }", "static String hash(String motDePasse) {\n\t\tString encoded = null;\n\t\ttry {\n\t MessageDigest md = MessageDigest.getInstance(\"SHA-256\");\n\t byte[] hashInBytes = md.digest(motDePasse.getBytes(StandardCharsets.UTF_8));\n\n\t\t\t// bytes to hex\n\t StringBuilder sb = new StringBuilder();\n\t for (byte b : hashInBytes) {\n\t sb.append(String.format(\"%02x\", b));\n\t }\n\t encoded = sb.toString();\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn encoded;\n\n\t\t\n\t}", "@Override\r\n\tpublic String desencriptar(String string) {\n\r\n\t\tString palabra = string;\r\n\t\tString[] parts = string.split(\",\");\r\n String newName=\"\";\r\n for (int i = 0; i < parts.length; i++) {\r\n // instrucción switch con tipo de datos int\r\n switch (parts[i]) \r\n {\r\n case \"1\" : newName+=\"a\";\r\n break;\r\n case \"2\" : newName+=\"b\";\r\n break;\r\n case \"3\" : newName+=\"c\";\r\n break;\r\n case \"4\" : newName+=\"d\";\r\n break;\r\n case \"5\" : newName+=\"e\";\r\n break;\r\n case \"6\" : newName+=\"f\";\r\n break;\r\n case \"7\" : newName+=\"g\";\r\n break;\r\n case \"8\" : newName+=\"h\";\r\n break;\r\n case \"9\" : newName+=\"i\";\r\n break;\r\n case \"10\" : newName+=\"j\";\r\n break;\r\n case \"11\" : newName+=\"k\";\r\n break;\r\n case \"12\" : newName+=\"l\";\r\n break;\r\n case \"13\" : newName+=\"m\";\r\n break;\r\n case \"14\" : newName+=\"n\";\r\n break;\r\n case \"15\" : newName+=\"ñ\";\r\n break;\r\n case \"16\" : newName+=\"o\";\r\n break;\r\n case \"17\" : newName+=\"p\";\r\n break;\r\n case \"18\" : newName+=\"q\";\r\n break;\r\n case \"19\" : newName+=\"r\";\r\n break;\r\n case \"20\" : newName+=\"s\";\r\n break;\r\n case \"21\" : newName+=\"t\";\r\n break;\r\n case \"22\" : newName+=\"u\";\r\n break;\r\n case \"23\" : newName+=\"v\";\r\n break;\r\n case \"24\" : newName+=\"w\";\r\n break;\r\n case \"25\" : newName+=\"x\";\r\n break;\r\n case \"26\" : newName+=\"y\";\r\n break;\r\n case \"27\" : newName+=\"z\";\r\n break;\r\n case \"0\" : newName+=\" \";\r\n break;\r\n case \"28\" : newName+=\" \";\r\n break;\r\n \r\n \r\n }\r\n \r\n }\r\n \r\n return newName ;\r\n\t}", "private String avoidErrorChar (String original) {\n\t\tStringBuffer modSB = new StringBuffer();\n\t\tfor (int j=0; j < original.length(); j++) {\n\t\t\tchar c = original.charAt(j);\n\t\t\tif (c == '\\n') {\n\t\t\t\tmodSB.append(\"\\\\n\"); // rimpiazzo il ritorno a capo con il simbolo \\n\n\t\t\t} else if (c == '\"') {\n\t\t\t\tmodSB.append(\"''\"); // rimpiazzo le doppie virgolette (\") con due apostofi ('')\n\t\t\t} else if ((int)c > 31 || (int)c !=127){ // non stampo i primi 32 caratteri di controllo\n\t\t\t\tmodSB.append(c);\n\t\t\t}\n\t\t}\n\t\treturn modSB.toString();\n\t}", "public static String hackerSpeak(String str) {\n\n String replace = str.replace(\"a\", \"4\").replace(\"e\", \"3\").replace(\"i\", \"1\").replace(\"o\", \"0\").replace(\"s\", \"5\");\n return replace;\n }", "String einfachesErsetzen(String s) {\n\t\tString newS = s.replace(\"2\", \"0\");\n\t\tif (newS == s) {\n\t\t\tSystem.out.println(\"gleich\");\n\t\t}\n\t\treturn newS;\n\t}", "@Override\n public String decrypt(String s) throws NotInAlphabetException{\n passwordPos = 0; //initialize to 0\n return super.decrypt(s); //invoke parent\n }", "public abstract String mo24851a(String str);", "private String prepare(String originStr)\r\n {\r\n String result=originStr.toLowerCase();\r\n result = result.replace('ä','a');\r\n result = result.replace('ö','o');\r\n result = result.replace('ü','u');\r\n// result = result.replace(':',' ');\r\n// result = result.replace(';',' ');\r\n// result = result.replace('<',' ');\r\n// result = result.replace('>',' ');\r\n// result = result.replace('=',' ');\r\n// result = result.replace('?',' ');\r\n// result = result.replace('[',' ');\r\n// result = result.replace(']',' ');\r\n// result = result.replace('/',' ');\r\n return result;\r\n }", "public String Decrypt(String s);", "private static char[] m3268z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArray[0] ^ 18);\n }\n return toCharArray;\n }", "CamembertdeNormandie(Machecoulais machecoulais, Context context, String str) {\n super(0);\n this.f16562a = machecoulais;\n this.f16563b = context;\n this.f16564c = str;\n }", "private static String decrypt(String in){\n\n\t\t\tString alphabet = \"1234567890\";\n\n\t\t\tString scramble1 = \"<;\\'_$,.?:|)\";\n\t\t String scramble2 = \"XYZVKJUTHM\";\n\t\t String scramble3 = \"tuvwxyz&*}\";\n\t\t String scramble4 = \"~!-+=<>%@#\";\n\t\t String scramble5 = \"PUDHCKSXWZ\";\n\n\t\t char messageIn[] = in.toCharArray();\n\t\t String r = \"\";\n\n\t\t for(int i = 0; i < in.length(); i++){\n\t\t if(i % 3 == 0){\n\t\t int letterIndex = scramble1.indexOf(in.charAt(i));\n\t\t r += alphabet.charAt(letterIndex);\n\t\t }else if (i % 3 == 1){\n\t\t int letterIndex = scramble2.indexOf(in.charAt(i));\n\t\t r += alphabet.charAt(letterIndex);\n\t\t }else if (i % 3 == 2){\n\t\t int letterIndex = scramble3.indexOf(in.charAt(i));\n\t\t r += alphabet.charAt(letterIndex);\n\t\t }\n\t\t }\n\t\treturn r;\n\t}", "private static String RemoveSpecialCharacter (String s1) {\n String tempResult=\"\";\n for (int i=0;i<s1.length();i++) {\n if (s1.charAt(i)>64 && s1.charAt(i)<=122){\n tempResult=tempResult+s1.charAt(i);\n }\n }\n return tempResult;\n }", "C1111j mo5881f(String str);", "abstract String mo1747a(String str);", "String mo2801a(String str);", "String decrypt(String text) {\n\t\tchar letter;\n\t\tString finalString = \"\";\t\t\t\t\t// slutliga klartexten\n\t\tint start = key.getStart();\t\t\t\t\t// deklarerar nyckelns startläge\n\t\tint k ;\t\t\t\t\t\t\t\t\t\t// variabel för bokstavens startläge i vanliga alfabetet\n\t\tStringBuilder sb = new StringBuilder();\t\t\t\t\t// skapar en stringbuilder som kan modifieras, bygger upp textsträngar av olika variabler\n\t\t\t\t\t\t\n\t\t// loopen går igenom alla tecken i min krypterade text \t\t\t\n\t\tfor(int i = 0; i < text.length(); i++) {\t\t\t// for-loop för att gå igenom hela texten\t\t\t\t\n\t\t\tletter = text.charAt(i);\t\t\t\t\t\t// ger bokstaven på platsen 0,1,2,3.....\n\t\t\tif(letter == ' ') {\t\t\t\t\t\t\t\t// om det är ett blanktecken så ska det vara ett blanktecken\n\t\t\t\tsb.append(' ');\t\t\t\t\t\t\t\t// sparar blanksteg i en stringBuilder\n\t\t\t} else {\n\t\t\t\tint index=0;\n\t\t\t\tstart=start%26;\t\t\t\t\t\t\t\t// vi behöver endast 26 värden\n\t\t\t\tkey.getStart();\n\n\t\t\t\t\n\t\t\t\twhile(index<26 &&(letter!=key.getLetter(index))) {\t\t// så länge som chiffret inte motsvarar förskjutningen\n\t\t\t\t\tindex++;\t\t\t\t\t\t\t\t\t\t\t// så fortsätter den leta\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tk=index-start;\n\t\t\t\t\n\t\t\t\tif(k>=0)\n\t\t\t\t\tletter=(char)('A'+k);\n\t\t\t\telse letter=(char)('Z'-(start-1-index));\t\t\t\t// räknar från index, om index mindre än start så räknar den bakåt\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// så att det inte blir tokigt mellan Z och A.\n\t\t\t\t\n\t\t\t\tsb.append(letter);\t\t\t\t\t\t\t\t\t\t//lagrar bokstav i stringBuilder\n\t\t\t\tstart++;\t\t\t\t\t\t\t\t\t\t\t\t//chiffret börjar om\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\n\t\t\t}\n\t\treturn sb.toString();\t\t\t\t\t\t\t\t\t\t// returnerar sluttexten\n\t\t}", "public static String decryptBellaso(String encryptedText, String bellasoStr) {\r\n String decryptedText = \"\";\r\n\t\t\r\n\t\tchar [] deText = new char[encryptedText.length()];\r\n\t\t\r\n\t mappingKeyToMessage(bellasoStr,encryptedText);\r\n\t \r\n\t char [] enText = encryptedText.toCharArray();\r\n\t\tchar [] blText = bellasoStr.toCharArray();\r\n\t\t\r\n\t\tint i=0;\r\n\t\tint diff = 0;\r\n\t\t\r\n\t\tdiff = diff + enText[i];\r\n\t\tdiff = diff + blText[1];\r\n\t\tdiff += RANGE;\r\n\t\tSystem.out.print(diff);\r\n\t\tdo {\r\n\t\t\tfor(char m: enText) {\r\n\t\t\t\r\n\t\t\t\tif (diff <32) {\r\n\t\t\t\t\tdiff += RANGE;\r\n\t\t\t\t\tm += diff;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tm +=diff;\r\n\t\t\t\t\tdeText[i] = m;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}while(i<encryptedText.length());\r\n\t\tdecryptedText = String.valueOf(deText);\r\n\t\t\r\n\t \r\n\t return decryptedText; \r\n\t}", "public static String decryptPassword(String s)\n {\n String pass = \"\";\n int i = 0;\n while (i < s.length() - 1)\n {\n char ch = s.charAt(i);\n char ch2 = s.charAt(i + 1);\n if (Character.isLowerCase(ch2) && Character.isUpperCase(ch) && Character.isSpecia;) {\n pass = pass + ch2 + ch + \"*\";\n i = i + 2;\n }\n if (Character.isDigit(ch)) {\n pass = \"0\"+pass;\n i = i + 1;\n } else {\n pass = pass + ch;\n i = i + 1;\n }\n }\n return pass;\n }", "@Test\r\n public void testDescifrar() {\r\n System.out.println(\"descifrar\");\r\n String frase = \"KRÑD\";\r\n int base = 3;\r\n char[] expResult = {'H','O','L','A'};\r\n char[] result = Cifrado.descifrar(frase, base);\r\n assertArrayEquals(expResult, result);\r\n \r\n }", "String checkString(String str) {\n\t\tString output = \"\";\n\t\tfor (int index = str.length() - 1; index >= 0; index--) {\n\t\t\toutput = output + str.charAt(index);\n\t\t}\n\t\treturn output;\n\t}", "@Override\n public String convertedText() {\n\n if (mHexInputEditText.length() != 0) {\n String hexCode = mHexInputEditText.getText().toString();\n StringBuilder hexCodeBuilder = new StringBuilder(\n mCheckBox.isChecked() ? hexCode.replaceAll(\" \", \"\") : hexCode);\n\n if (hexCodeBuilder.length() % 2 == 1) {\n hexCodeBuilder.append('0');\n }\n\n StringBuilder stringBuilder = new StringBuilder();\n for (int i = 0; i < hexCodeBuilder.length(); i += 2) {\n try {\n stringBuilder.append((char) Integer.parseInt(\n hexCodeBuilder.substring(i, i + 2), 16));\n } catch (NumberFormatException e) {\n e.printStackTrace();\n stringBuilder.append(\"¿\");\n }\n }\n stringBuilder.trimToSize();\n return stringBuilder.toString();\n } else {\n return \"\";\n }\n }", "String convert(String msg) {\n for (int i = 0; i < msg.length(); i++) {\n if (msg.charAt(i) < 65 || msg.charAt(i) > 90) {\n throw new EnigmaException(\"Illegal input\");\n }\n }\n int index = 0;\n String result = \"\";\n while (index < msg.length()) {\n int num = msg.charAt(index) - 65;\n if (manyRotors[4].atNotch() && !manyRotors[3].atNotch()) {\n manyRotors[4].advance();\n manyRotors[3].advance();\n } else if (manyRotors[3].atNotch()) {\n manyRotors[4].advance();\n manyRotors[3].advance();\n manyRotors[2].advance();\n } else manyRotors[4].advance();\n for (int i = manyRotors.length - 1; i > 0; i--) {\n num = manyRotors[i].convertForward(num);\n }\n for (int i = 0; i < manyRotors.length; i++) {\n num = manyRotors[i].convertBackward(num);\n }\n result += String.valueOf((char) (num + 65));\n index++;\n }\n return result;\n //return null;\n // FIXME\n }", "protected static String removeBannedCharacters(String st) {\n return st.replaceAll(\"[^A-Za-z]\", \"\");\n }", "void mo5871a(String str);", "private String e19BuildStaffGageString(String s) {\n String tmp1 = null;\n if ((s != null) && (s.length() > 0)) {\n tmp1 = String.format(\"%c%s-%c\", SEP_CHAR, s, SEP_CHAR);\n } else {\n tmp1 = String.format(\"%c-----%c\", SEP_CHAR, SEP_CHAR);\n }\n\n return tmp1;\n }", "private static char[] m7947z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArray[0] ^ 16);\n }\n return toCharArray;\n }", "public final void mo7596sH(String str) {\n }", "public static String staticDecode(String input) {\n \n CipherProcessor bcp = new BlowfishCipherProcessor();\n return bcp.decode(input);\n }", "private final void m46527f(String str) {\n if (C15333p.m44598e()) {\n if (m46510O() == null) {\n m46509N();\n }\n if (m46510O().booleanValue()) {\n m46523a(str, null);\n return;\n }\n String str2 = \"javascript:\";\n String valueOf = String.valueOf(str);\n m46525c(valueOf.length() != 0 ? str2.concat(valueOf) : new String(str2));\n return;\n }\n String str3 = \"javascript:\";\n String valueOf2 = String.valueOf(str);\n m46525c(valueOf2.length() != 0 ? str3.concat(valueOf2) : new String(str3));\n }", "public void bewegeKamel(Charakter charakter);", "private void Trans(String s) {\n }", "void mo3768a(String str);", "@Test\n public void testEncodingNegative()\n {\n byte[] orginalBytes = sensitiveString.getBytes();\n byte[] encoded = StateUtils.encode(orginalBytes);\n encoded[1] = (byte) 9;\n try\n {\n byte[] decoded = StateUtils.decode(encoded);\n Assertions.assertFalse(Arrays.equals(decoded, orginalBytes));\n }\n catch (Exception e)\n {\n // do nothing\n }\n }", "C12000e mo41087c(String str);", "public static String romaCoding(String s){\n s = s.toLowerCase().replaceAll(\" \", \"\");\n StringBuffer sb = new StringBuffer(s);\n System.out.println(s);\n /**\n * Step1: Reverse the string\n */\n String step1 = sb.reverse().toString();\n System.out.println(step1);\n\n /**\n * Step2: Rail Fence Cipher Coding\n */\n String step2 = RailFenceCipher.railFenceCipherCoding(step1);\n System.out.println(step2);\n\n /**\n * Step3: Computer Key Board Coding\n */\n String step3 = \"\";\n Map<Character, Character> map = KeyBoard.getCodingMap();\n for(int i = 0; i < step2.length(); i++){\n step3 = step3 + map.get(step2.charAt(i));\n }\n System.out.println(step3);\n\n /**\n * Step4: Covert string to numbers with Nokia phone keyboard\n */\n String step4 = \"\";\n Map nokiaMap = KeyBoard.getNokiaCodingMap();\n for(int i = 0; i < step3.length(); i++){\n step4 = step4 + nokiaMap.get(step3.charAt(i)) + \"\";\n }\n System.out.println(step4);\n\n /**\n * Step5: Convert string to morse code\n */\n String step5 = \"\";\n Map morseMap = MorseCode.getMorseMap();\n for(int i = 0; i < step4.length(); i++){\n Character c = step4.charAt(i);\n step5 = step5 + morseMap.get(c) + \"/\";\n }\n System.out.println(step5);\n return step5;\n }", "public static String evensOnly( String s ) {\n String s2 = \"\"; //tkaing pieces of the string --> put it into s2 ean empty string\n for (int i = 0; i < s.length(); i++) {\n if ((int)s.charAt(i) % 2 == 0) // putting int infront truns it into the ascii value --> so you can check if its divisible by 2\n s2 = s2 + s.charAt(i); // add it to string\n }\n return s2;\n // return new String( \"HJHJHJ\" );\n }", "public static String b(String paramString)\r\n/* 690: */ {\r\n/* 691:682 */ String str = \"\";\r\n/* 692:683 */ int i1 = -1;\r\n/* 693:684 */ int i2 = paramString.length();\r\n/* 694:686 */ while ((i1 = paramString.indexOf('§', i1 + 1)) != -1) {\r\n/* 695:687 */ if (i1 < i2 - 1)\r\n/* 696: */ {\r\n/* 697:688 */ char c1 = paramString.charAt(i1 + 1);\r\n/* 698:690 */ if (c(c1)) {\r\n/* 699:691 */ str = \"§\" + c1;\r\n/* 700:692 */ } else if (d(c1)) {\r\n/* 701:693 */ str = str + \"§\" + c1;\r\n/* 702: */ }\r\n/* 703: */ }\r\n/* 704: */ }\r\n/* 705:698 */ return str;\r\n/* 706: */ }", "public static String encriptar(String input){\n try {\n\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n\n byte[] messageDigest = md.digest(input.getBytes());\n\n BigInteger no = new BigInteger(1, messageDigest);\n\n String hashtext = no.toString(16);\n while (hashtext.length() < 32) {\n hashtext = \"0\" + hashtext;\n }\n return hashtext;\n }\n\n catch (NoSuchAlgorithmException e) {\n throw new RuntimeException(e);\n }\n }", "public static String decode(String inString) throws Exception{\r\n\t\tStringBuilder decodedString = new StringBuilder();\r\n\t\tString[] splitString = inString.split(\"\\\\s\");\r\n\t\tString type = splitString[3].substring(5, splitString[3].length());\r\n\t\tString Key = splitString[4].substring(4, splitString[4].length()-1);\r\n\t\tStringBuilder temp = new StringBuilder();\r\n\t\tfor(int j=0;j<5;j++){\r\n\t\t\tdecodedString.append(splitString[j]);\r\n\t\t\tdecodedString.append(\" \");\r\n\t\t}\r\n\t\tif(type.equals(\"Caesar\")){\r\n\t\t\tString encodedString = unHex(splitString[5]);\r\n\t\t\tinString = encodedString;\r\n\t\t\tchar[] alphabet ={'a','b','c','d','e','f','g','h','i','j','k','l','m',\r\n\t\t\t\t\t'n','o','p','q','r','s','t','u','v','w','x','y','z','å','ä','ö','A','B',\r\n\t\t\t\t\t'C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W',\r\n\t\t\t\t\t'X','Y','Z','Å','Ä','Ö','0','1','2','3',\r\n\t\t\t\t\t'4','5','6','7','8','9','!','?',')','(','=','>','<','/','&','%','#','@','$','[',']'};\r\n\t\t\tint Keyint = (int) (Long.parseLong(Key,16)%alphabet.length);\r\n\t\t\tSystem.out.println(\"Here is \"+ Keyint);\r\n\t\t\tfor(int i = 0; i < inString.length(); i++){\r\n\t\t\t\tchar a = inString.charAt(i);\r\n\t\t\t\tint used = 0;\r\n\t\t\t\tfor(char b: alphabet){\r\n\t\t\t\t\tif(b==a){\r\n\t\t\t\t\t\tif(indexOf(alphabet,b)<Keyint){\r\n\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\tdecodedString.append(\r\n\t\t\t\t\t\t\t\t\t\talphabet[(alphabet.length-\r\n\t\t\t\t\t\t\t\t\t\t\t\tKeyint+indexOf(alphabet,b))]);\r\n\t\t\t\t\t\t\t\tused = 1;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}catch(Exception c){\r\n\t\t\t\t\t\t\t\tSystem.out.print(c.getMessage());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\tdecodedString.append(alphabet[(indexOf(alphabet,b)\r\n\t\t\t\t\t\t\t\t\t\t-Keyint)]);\r\n\t\t\t\t\t\t\t\tused = 1;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}catch(Exception c){\r\n\t\t\t\t\t\t\t\tSystem.out.print(c.getMessage());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(used==0){\r\n\t\t\t\t\tdecodedString.append(a);\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t}\r\n\t\telse if(type.equals(\"AES\")){\r\n\t\t\tString neuKey = unHex(Key);\r\n\t\t\tbyte[] keyContent = Base64.getDecoder().decode(neuKey);\r\n\t\t\tString encodedString = unHex(splitString[5]);\r\n\t\t\tbyte[] encoded = hexStringToByteArray(splitString[5]);\r\n\t\t\tSystem.out.println(\"This is: \"+ new String(encoded,\"UTF8\"));\r\n\t\t\tinString = encodedString;\r\n\t\t\tSecretKeySpec decodeKey = new SecretKeySpec(keyContent, \"AES\");\r\n\t\t\tCipher AEScipher = Cipher.getInstance(\"AES\");\r\n\t\t\tAEScipher.init(Cipher.DECRYPT_MODE, decodeKey);\r\n\t\t\tbyte[] decryptedData;\r\n\t\t\tdecryptedData = AEScipher.doFinal(encoded);\r\n\t\t decodedString.append(new String(decryptedData,\"UTF8\"));\r\n\t\t}\r\n\t\telse{\r\n\t\t\tthrow new Exception(\"Not a valid encryption\");\r\n\t\t}\r\n\t\tdecodedString.append(splitString[splitString.length-2]);\r\n\t\tdecodedString.append(\" \");\r\n\t\tdecodedString.append(splitString[splitString.length-1]);\r\n\t\treturn decodedString.toString();\r\n\t\t\r\n\t}", "public String cleanTheString(String input) {\n String result = \"\";\n if (input != null && !input.isEmpty()) {\n\n for (int k = 0; k < input.length(); k++) {\n if (!(input.charAt(k) == '0'\n || // unallowed characters\n input.charAt(k) == '1' || input.charAt(k) == '2' || input.charAt(k) == '3'\n || input.charAt(k) == '4' || input.charAt(k) == '5' || input.charAt(k) == '6'\n || input.charAt(k) == '7' || input.charAt(k) == '8' || input.charAt(k) == '9'\n || input.charAt(k) == 'A' || input.charAt(k) == 'B' || input.charAt(k) == 'C'\n || input.charAt(k) == 'D' || input.charAt(k) == 'E' || input.charAt(k) == 'F')) {\n } else\n result = result + Character.toString(input.charAt(k));\n\n }\n\n }\n\n return result;\n }", "public abstract void fazerCoisa( String string );", "public static String canonicalDecomposeWithSingleQuotation(String paramString)\n/* */ {\n/* 2506 */ char[] arrayOfChar1 = paramString.toCharArray();\n/* 2507 */ int i = 0;\n/* 2508 */ int j = arrayOfChar1.length;\n/* 2509 */ Object localObject1 = new char[arrayOfChar1.length * 3];\n/* 2510 */ int k = 0;\n/* 2511 */ int m = localObject1.length;\n/* */ \n/* 2513 */ char[] arrayOfChar2 = new char[3];\n/* */ \n/* */ \n/* */ \n/* 2517 */ int i2 = 4;\n/* */ \n/* */ \n/* 2520 */ int i6 = (char)indexes[8];\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 2527 */ int i1 = 0xFF00 | i2;\n/* 2528 */ int i3 = 0;\n/* 2529 */ int i8 = 0;\n/* 2530 */ long l = 0L;\n/* 2531 */ int i5 = 0;\n/* 2532 */ int i10 = 0;\n/* */ int i9;\n/* 2534 */ int i7 = i9 = -1;\n/* */ for (;;) {\n/* 2536 */ int n = i;\n/* */ \n/* 2538 */ while ((i != j) && (((i5 = arrayOfChar1[i]) < i6) || \n/* */ \n/* 2540 */ (((l = getNorm32(i5)) & i1) == 0L) || ((i5 >= 44032) && (i5 <= 55203))))\n/* */ {\n/* */ \n/* 2543 */ i8 = 0;\n/* 2544 */ i++;\n/* */ }\n/* */ \n/* */ int i4;\n/* 2548 */ if (i != n) {\n/* 2549 */ i4 = i - n;\n/* 2550 */ if (k + i4 <= m) {\n/* 2551 */ System.arraycopy(arrayOfChar1, n, localObject1, k, i4);\n/* */ }\n/* */ \n/* 2554 */ k += i4;\n/* 2555 */ i3 = k;\n/* */ }\n/* */ \n/* */ \n/* 2559 */ if (i == j) {\n/* */ break;\n/* */ }\n/* */ \n/* 2563 */ i++;\n/* */ char c2;\n/* 2565 */ if (isNorm32Regular(l)) {\n/* 2566 */ c2 = '\\000';\n/* 2567 */ i4 = 1;\n/* */ \n/* */ }\n/* 2570 */ else if ((i != j) && \n/* 2571 */ (Character.isLowSurrogate(c2 = arrayOfChar1[i]))) {\n/* 2572 */ i++;\n/* 2573 */ i4 = 2;\n/* 2574 */ l = getNorm32FromSurrogatePair(l, c2);\n/* */ } else {\n/* 2576 */ c2 = '\\000';\n/* 2577 */ i4 = 1;\n/* 2578 */ l = 0L;\n/* */ }\n/* */ \n/* */ char[] arrayOfChar3;\n/* */ char c1;\n/* 2583 */ if ((l & i2) == 0L)\n/* */ {\n/* 2585 */ i7 = i9 = (int)(0xFF & l >> 8);\n/* 2586 */ arrayOfChar3 = null;\n/* 2587 */ i10 = -1;\n/* */ } else {\n/* 2589 */ localObject2 = new DecomposeArgs(null);\n/* */ \n/* */ \n/* 2592 */ i10 = decompose(l, i2, (DecomposeArgs)localObject2);\n/* 2593 */ arrayOfChar3 = extraData;\n/* 2594 */ i4 = ((DecomposeArgs)localObject2).length;\n/* 2595 */ i7 = ((DecomposeArgs)localObject2).cc;\n/* 2596 */ i9 = ((DecomposeArgs)localObject2).trailCC;\n/* 2597 */ if (i4 == 1)\n/* */ {\n/* 2599 */ c1 = arrayOfChar3[i10];\n/* 2600 */ c2 = '\\000';\n/* 2601 */ arrayOfChar3 = null;\n/* 2602 */ i10 = -1;\n/* */ }\n/* */ }\n/* */ \n/* 2606 */ if (k + i4 * 3 >= m)\n/* */ {\n/* 2608 */ localObject2 = new char[m * 2];\n/* 2609 */ System.arraycopy(localObject1, 0, localObject2, 0, k);\n/* 2610 */ localObject1 = localObject2;\n/* 2611 */ m = localObject1.length;\n/* */ }\n/* */ \n/* */ \n/* 2615 */ Object localObject2 = k;\n/* 2616 */ if (arrayOfChar3 == null)\n/* */ {\n/* 2618 */ if (needSingleQuotation(c1))\n/* */ {\n/* */ \n/* 2621 */ localObject1[(k++)] = 39;\n/* 2622 */ localObject1[(k++)] = c1;\n/* 2623 */ localObject1[(k++)] = 39;\n/* 2624 */ i9 = 0;\n/* 2625 */ } else if ((i7 != 0) && (i7 < i8))\n/* */ {\n/* */ \n/* 2628 */ k += i4;\n/* 2629 */ i9 = insertOrdered((char[])localObject1, i3, localObject2, k, c1, c2, i7);\n/* */ }\n/* */ else\n/* */ {\n/* 2633 */ localObject1[(k++)] = c1;\n/* 2634 */ if (c2 != 0) {\n/* 2635 */ localObject1[(k++)] = c2;\n/* */ }\n/* */ \n/* */ }\n/* */ \n/* */ }\n/* 2641 */ else if (needSingleQuotation(arrayOfChar3[i10])) {\n/* 2642 */ localObject1[(k++)] = 39;\n/* 2643 */ localObject1[(k++)] = arrayOfChar3[(i10++)];\n/* 2644 */ localObject1[(k++)] = 39;\n/* 2645 */ i4--;\n/* */ do {\n/* 2647 */ localObject1[(k++)] = arrayOfChar3[(i10++)];\n/* 2648 */ i4--; } while (i4 > 0);\n/* */ }\n/* 2650 */ else if ((i7 != 0) && (i7 < i8)) {\n/* 2651 */ k += i4;\n/* 2652 */ i9 = mergeOrdered((char[])localObject1, i3, localObject2, arrayOfChar3, i10, i10 + i4);\n/* */ }\n/* */ else\n/* */ {\n/* */ do {\n/* 2657 */ localObject1[(k++)] = arrayOfChar3[(i10++)];\n/* 2658 */ i4--; } while (i4 > 0);\n/* */ }\n/* */ \n/* */ \n/* 2662 */ i8 = i9;\n/* 2663 */ if (i8 == 0) {\n/* 2664 */ i3 = k;\n/* */ }\n/* */ }\n/* 2667 */ return new String((char[])localObject1, 0, k);\n/* */ }", "void mo8713dV(String str);", "@Test\n public void testRedundant2version() {\n String ver2 = Textile.straighten_weft2(\"aad.bbd+d*ac\");\n assertEquals(\"d.bbac\",ver2);\n }", "private static char[] m619z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArray[0] ^ 20);\n }\n return toCharArray;\n }", "public static String encryptBellaso(String plainText, String bellasoStr) {\r\n\t\tString encryptedText = \"\";\r\n\t\t\r\n\t\tchar [] enText = new char[plainText.length()];\r\n\t\t\r\n\t\t\r\n\t mappingKeyToMessage(bellasoStr,plainText);\r\n\t \r\n\t char [] plText = plainText.toCharArray();\r\n\t\tchar [] blText = bellasoStr.toCharArray();\r\n\t\t\r\n\t\tint i=0;\r\n\t\tint sum = 0;\r\n\t\t\r\n\t\tsum = sum + plText[i];\r\n\t\tsum = sum + blText[1];\r\n\t\tsum -= RANGE;\r\n\t\tSystem.out.print(sum);\r\n\t\tdo {\r\n\t\t\tfor(char m: plText) {\r\n\t\t\t\r\n\t\t\t\tif (sum >95) {\r\n\t\t\t\t\tsum -= RANGE;\r\n\t\t\t\t\tm += sum;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tm +=sum;\r\n\t\t\t\t\tenText[i] = m;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}while(i<plainText.length());\r\n\t\tencryptedText = String.valueOf(enText);\r\n\t\t\r\n\t \r\n\t return encryptedText; \r\n\t}", "void mo12635a(String str);", "public static String remove(String str){\n\t\tString str2 = str.trim();\n\t\tstr2 = str2.replaceAll(\"à|á|ả|ã|ạ|â|ầ|ấ|ẩ|ẫ|ậ|ằ|ắ|ẳ|ẵ|ặ|ă\", \"a\");\n\t\tstr2 = str2.replaceAll(\"í|ì|ỉ|ĩ|ị\",\"i\");\n\t\tstr2 = str2.replaceAll(\"ư|ứ|ừ|ử|ữ|ự|ú|ù|ủ|ũ|ụ\",\"u\");\n\t\tstr2 = str2.replaceAll(\"ế|ề|ể|ễ|ệ|é|è|ẻ|ẽ|ẹ|ê\",\"e\");\n\t\tstr2 = str2.replaceAll(\"ố|ồ|ổ|ỗ|ộ|ớ|ờ|ở|ỡ|ợ|ó|ò|ỏ|õ|ọ|ô|ơ\",\"o\");\n\t\tstr2= str2.replaceAll(\"ý|ỳ|ỷ|ỹ|ỵ\",\"y\");\n\t\t\n\t\tstr2 = str2.replaceAll(\"Ấ|Ầ|Ẩ|Ẫ|Ậ|Ắ|Ằ|Ẳ|Ẵ|Ặ|Á|À|Ả|Ã|Ạ|Â|Ă\",\"A\");\n\t\tstr2 = str2.replaceAll(\"Í|Ì|Ỉ|Ĩ|Ị\",\"I\");\n\t\tstr2 = str2.replaceAll(\"Ứ|Ừ|Ử|Ữ|Ự|Ú|Ù|Ủ|Ũ|Ụ|Ư\",\"U\");\n\t\tstr2 = str2.replaceAll(\"Ế|Ề|Ể|Ễ|Ệ|É|È|Ẻ|Ẽ|Ẹ|Ê\",\"E\");\n\t\tstr2 = str2.replaceAll(\"Ố|Ồ|Ổ|Ô|Ộ|Ớ|Ờ|Ở|Ỡ|Ợ|Ó|Ò|Ỏ|Õ|Ọ|Ô|Ơ\",\"O\");\n\t\tstr2= str2.replaceAll(\"Ý|Ỳ|Ỷ|Ỹ|Ỵ\",\"Y\");\n\t\tstr2 = str2.replaceAll(\"đ\",\"d\");\n\t\tstr2 = str2.replaceAll(\"Đ\",\"D\");\n\t\t\n\t\tstr2 = str2.replaceAll(\"ò\", \"\");\n\t\treturn str2;\n\t}", "public String codifica(String cadena) {\n MessageDigest messageDigest = null;\n\n //Se crea objeto de string buffer para almacenar la concatenacion de los datos del arreglo.\n StringBuffer sb = null;\n try {\n //Se inicializa el objeto y se le pasa el tipo de encriptacion deseada\n messageDigest = MessageDigest.getInstance(\"SHA-512\");\n\n //Se extraen los bytes que contiene la cadena\n byte[] encripta = messageDigest.digest(cadena.getBytes());\n\n //Se inicializa un objeto tipo String buffer\n sb = new StringBuffer();\n\n //Se recorre el arreglo de bytes que genero messageDigest\n for (byte hashB : encripta) {\n // se concatena los datos obtenidos del arreglo\n sb.append(String.format(\"%02x\", hashB));\n }\n\n } catch (Exception e) {\n// log.info(e.getMessage());\n// errorService.createError(e.getMessage(), \"Error encriptando la cadena: \"+ cadena);\n }\n\n return sb.toString();\n }", "void mo1935c(String str);", "private static String descifrarBase64(String arg) {\n Base64.Decoder decoder = Base64.getDecoder();\n byte[] decodedByteArray = decoder.decode(arg);\n\n return new String(decodedByteArray);\n }", "private static void decodeString(String in){\n\t\t//reverse anything done in encoded string\n\t\tString demess = decrypt(in);\n\t\tString decodeMessage = bigIntDecode(demess);\n\n\t\tSystem.out.println(\"Decoded message: \" + decodeMessage + \"***make function to actually decode!\");\n\t}", "@Test void longerMessage() {\n\t\tString message = \" ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ\" +\n\t\t\t\t\" ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\t\tAztecCode marker = new AztecEncoder().addUpper(message).fixate();\n\t\tclearMarker(marker);\n\n\t\tassertTrue(new AztecDecoder().process(marker));\n\t\tassertEquals(message, marker.message);\n\t}", "String replaceInString(String s) {\n\t\tString newS = s.replaceAll(\"[a-zA-Z]+\", \"WORT\");\n\t\tif (newS == s) {\n\t\t\tSystem.out.println(\"gleich\");\n\t\t}\n\t\treturn newS;\n\t}", "private static String normalize(String s) {\r\n\t\t//return Normalizer.normalize(s, Normalizer.Form.NFC);\r\n\t\treturn s;\r\n\t}", "public String encriptarMensajeArchivo(String mensaje){\n \n String textoEncriptado=\"\";\n \n for (int i = 0; i < mensaje.length(); i++) {\n String letra = mensaje.charAt(i)+\"\";\n System.out.println(letra);\n if(!letra.equals(\" \")){\n for (Map.Entry<String, String> entry : diccionarioEncriptado.entrySet()) {\n String key = entry.getKey();\n String value = entry.getValue();\n if(letra.equals(key)){\n textoEncriptado+=value;\n }\n } \n }else{\n textoEncriptado+=\"-\";\n } \n } \n return textoEncriptado;\n }", "public void mo1949a(String str) throws cf {\r\n try {\r\n byte[] bytes = str.getBytes(\"UTF-8\");\r\n m10262a(bytes, 0, bytes.length);\r\n } catch (UnsupportedEncodingException e) {\r\n throw new cf(\"UTF-8 not supported!\");\r\n }\r\n }", "public String entschlüsseln(SecretKey key, String nachricht) throws Exception{\n BASE64Decoder myDecoder2 = new BASE64Decoder();\n byte[] crypted2 = myDecoder2.decodeBuffer(nachricht);\n\n // Entschluesseln\n Cipher cipher2 = Cipher.getInstance(\"AES\");\n cipher2.init(Cipher.DECRYPT_MODE, key);\n byte[] cipherData2 = cipher2.doFinal(crypted2);\n String erg = new String(cipherData2);\n\n // Klartext\n return(erg);\n\n}", "private static String lettre2Chiffre1(String n) {\n\t\tString c= new String() ;\n\t\tswitch(n) {\n\t\tcase \"A\": case \"J\":\n\t\t\tc=\"1\";\n\t\t\treturn c;\n\t\tcase \"B\": case \"K\": case \"S\":\n\t\t\tc=\"2\";\n\t\t\treturn c;\n\t\tcase \"C\": case\"L\": case \"T\":\n\t\t\tc=\"3\";\n\t\t\treturn c;\n\t\tcase \"D\": case \"M\": case \"U\":\n\t\t\tc=\"4\";\n\t\t\treturn c;\n\t\tcase \"E\": case \"N\": case \"V\":\n\t\t\tc=\"5\";\n\t\t\treturn c;\n\t\tcase \"F\": case \"O\": case \"W\":\n\t\t\tc=\"6\";\n\t\t\treturn c;\n\t\tcase \"G\": case \"P\": case \"X\":\n\t\t\tc=\"7\";\n\t\t\treturn c;\n\t\tcase \"H\": case \"Q\": case \"Y\":\n\t\t\tc=\"8\";\n\t\t\treturn c;\n\t\tcase \"I\": case \"R\": case \"Z\":\n\t\t\tc=\"4\";\n\t\t\treturn c;\n\t\t\t\n\t\t}\n\t\treturn c;\n\t\t\n\t\n\t\t}", "public static String removeInvalidCharacteres(String string) {\n\t\tString corretString = string;\n\t\tif (containsInvalidCharacterInLogin(string)) {\n\t\t\tString regex = \"[|\\\"&*=+'@#$%\\\\/?{}?:;~<>,\\u00C0\\u00C1\\u00C2\\u00C3\\u00C4\\u00C5\\u00C6\\u00C7\\u00C8\\u00C9\\u00CA\\u00CB\\u00CC\\u00CD\\u00CE\\u00CF\\u00D0\\u00D1\\u00D2\\u00D3\\u00D4\\u00D5\\u00D6\\u00D8\\u0152\\u00DE\\u00D9\\u00DA\\u00DB\\u00DC\\u00DD\\u0178\\u00E0\\u00E1\\u00E2\\u00E3\\u00E4\\u00E5\\u00E6\\u00E7\\u00E8\\u00E9\\u00EA\\u00EB\\u00EC\\u00ED\\u00EE\\u00EF\\u00F0\\u00F1\\u00F2\\u00F3\\u00F4\\u00F5\\u00F6\\u00F8\\u0153\\u00DF\\u00FE\\u00F9\\u00FA\\u00FB\\u00FC\\u00FD\\u00FF]\";\n\t\t\tPattern p = Pattern.compile(regex);\n\t\t\tMatcher m = p.matcher(string);\n\t\t\tcorretString = m.replaceAll(\"\");\n\t\t\t//System.out.println(corretString);\n\t\t}\n\t\t\n\t\tcorretString = corretString.replace(\"\\\\\", \"\");\n\t\t\n\t\treturn corretString;\n\t}", "String attack();", "public String getPalavraEmbaralhada(String palavra);", "public static String str2MD5(String strs) {\n StringBuffer sb = new StringBuffer();\n try {\n MessageDigest digest = MessageDigest.getInstance(\"MD5\");\n byte[] bs = digest.digest(strs.getBytes());\n /*\n * after encryption is -128 to 127 ,is not safe\n * use it to binary operation,get new encryption result\n *\n * 0000 0011 0000 0100 0010 0000 0110 0001\n * &0000 0000 0000 0000 0000 0000 1111 1111\n * ---------------------------------------------\n * 0000 0000 0000 0000 0000 0000 0110 0001\n *\n * change to 16 bit\n */\n for (byte b : bs) {\n int x = b & 255;\n String s = Integer.toHexString(x);\n if (x < 16) {\n sb.append(\"0\");\n }\n sb.append(s);\n }\n\n } catch (Exception e) {\n System.out.println(\"encryption lose\");\n }\n return sb.toString();\n }", "public final String a(String str, String str2) {\n try {\n SecretKeyFactory instance = SecretKeyFactory.getInstance(\"PBKDF2WithHmacSHA1\");\n char[] charArray = \"FreeFire_Shopee_20190813\".toCharArray();\n j.a((Object) charArray, \"(this as java.lang.String).toCharArray()\");\n Charset charset = d.h.d.f32688a;\n if (str2 != null) {\n byte[] bytes = str2.getBytes(charset);\n j.a((Object) bytes, \"(this as java.lang.String).getBytes(charset)\");\n SecretKey generateSecret = instance.generateSecret(new PBEKeySpec(charArray, bytes, 1000, BitmapCounterConfig.DEFAULT_MAX_BITMAP_COUNT));\n byte[] bArr = new byte[32];\n byte[] bArr2 = new byte[16];\n j.a((Object) generateSecret, \"secretKey\");\n System.arraycopy(generateSecret.getEncoded(), 0, bArr, 0, 32);\n System.arraycopy(generateSecret.getEncoded(), 32, bArr2, 0, 16);\n SecretKeySpec secretKeySpec = new SecretKeySpec(bArr, \"AES\");\n IvParameterSpec ivParameterSpec = new IvParameterSpec(bArr2);\n Cipher instance2 = Cipher.getInstance(\"AES/CBC/PKCS5PADDING\");\n instance2.init(2, secretKeySpec, ivParameterSpec);\n byte[] doFinal = instance2.doFinal(v.h(str));\n j.a((Object) doFinal, \"decryptResult\");\n return new String(doFinal, d.h.d.f32688a);\n }\n throw new m(\"null cannot be cast to non-null type java.lang.String\");\n } catch (Exception e2) {\n e2.printStackTrace();\n return str;\n }\n }", "@Test\n public void defaultEncoding() throws SecureCellException {\n String passphrase = \"\\u6697\\u53F7\";\n SecureCell.Seal cellA = SecureCell.SealWithPassphrase(passphrase);\n SecureCell.Seal cellB = SecureCell.SealWithPassphrase(passphrase.getBytes(StandardCharsets.UTF_8));\n byte[] message = \"All your base are belong to us!\".getBytes(StandardCharsets.UTF_8);\n\n byte[] encrypted = cellA.encrypt(message);\n byte[] decrypted = cellB.decrypt(encrypted);\n\n assertArrayEquals(message, decrypted);\n }", "C12000e mo41091f(String str);", "public final String mo38c(Context context, String str) {\n Signature[] signatureArr;\n if (TextUtils.isEmpty(this.f27b)) {\n this.f27b = context.getPackageName();\n }\n if (TextUtils.isEmpty(this.f28c)) {\n String str2 = null;\n try {\n signatureArr = context.getPackageManager().getPackageInfo(this.f27b, 64).signatures;\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n signatureArr = null;\n }\n if (signatureArr != null && signatureArr.length > 0) {\n byte[] byteArray = signatureArr[0].toByteArray();\n try {\n MessageDigest instance = MessageDigest.getInstance(\"SHA1\");\n if (instance != null) {\n byte[] digest = instance.digest(byteArray);\n StringBuilder sb = new StringBuilder();\n for (byte b : digest) {\n sb.append(Integer.toHexString((b & 255) | 256).substring(1, 3));\n }\n str2 = sb.toString();\n }\n } catch (NoSuchAlgorithmException e2) {\n e2.printStackTrace();\n }\n }\n this.f28c = str2;\n }\n String a = ((C0041x2) this.f26a).mo126a(this.f27b, this.f28c, str);\n return TextUtils.isEmpty(a) ? \"\" : a;\n }", "int mo23349e(String str, String str2);", "void mo1934b(String str);", "public static String convertText(String s) {\r\n StringCharacterIterator stringcharacteriterator = new StringCharacterIterator(s);\r\n StringBuffer stringbuffer = new StringBuffer();\r\n int ai[] = new int[s.length()];\r\n int i = 0;\r\n int j = 0;\r\n for(char c = stringcharacteriterator.first(); c != '\\uFFFF'; c = stringcharacteriterator.next())\r\n if(c == '%')\r\n {\r\n c = stringcharacteriterator.next();\r\n if(c != '%')\r\n {\r\n stringbuffer.append('%');\r\n c = stringcharacteriterator.previous();\r\n } else\r\n {\r\n c = stringcharacteriterator.next();\r\n switch(c)\r\n {\r\n case 37: // '%'\r\n stringbuffer.append('%');\r\n break;\r\n\r\n case 80: // 'P'\r\n case 112: // 'p'\r\n stringbuffer.append('\\361');\r\n break;\r\n\r\n case 67: // 'C'\r\n case 99: // 'c'\r\n stringbuffer.append('\\355');\r\n break;\r\n\r\n case 68: // 'D'\r\n case 100: // 'd'\r\n stringbuffer.append('\\u00b0');\r\n break;\r\n\r\n case 85: // 'U'\r\n case 117: // 'u'\r\n ai[stringbuffer.length()] ^= 1;\r\n i++;\r\n break;\r\n\r\n case 79: // 'O'\r\n case 111: // 'o'\r\n ai[stringbuffer.length()] ^= 2;\r\n j++;\r\n break;\r\n\r\n default:\r\n if(c >= '0' && c <= '9')\r\n {\r\n int k = 3;\r\n char c1 = (char)(c - 48);\r\n for(c = stringcharacteriterator.next(); c >= '0' && c <= '9' && --k > 0; c = stringcharacteriterator.next())\r\n c1 = (char)(10 * c1 + (c - 48));\r\n\r\n stringbuffer.append(c1);\r\n }\r\n c = stringcharacteriterator.previous();\r\n break;\r\n }\r\n }\r\n } else\r\n if(c == '^')\r\n {\r\n c = stringcharacteriterator.next();\r\n if(c == ' ')\r\n stringbuffer.append('^');\r\n } else\r\n {\r\n stringbuffer.append(c);\r\n }\r\n s = Unicode.char2DOS437(stringbuffer, 2, '?');\r\n\r\n\t\tString ss = s;\r\n\t\treturn ss;\r\n\t}", "private String filterValue(String value) {\n try {\n // First, filter out any non-ASCII characters.\n byte[] raw = value.getBytes(\"US-ASCII\");\n String ascii = new String(raw, \"US-ASCII\");\n \n // Make sure there's no newlines\n ascii = ascii.replace('\\n', ' ');\n \n return ascii;\n } catch(UnsupportedEncodingException e) {\n // should never happen\n throw new RuntimeException(\"Missing ASCII encoding\", e);\n }\n }", "void mo37759a(String str);", "@Override\n public String encrypt(String s) throws NotInAlphabetException{ \n passwordPos = 0; //initialize to 0\n return super.encrypt(s); //invoke parent\n }", "public abstract byte[] mo32305a(String str);", "public static String m3184a(String str) {\n if (str == null) {\n return null;\n }\n try {\n MessageDigest.getInstance(\"SHA-256\").update(str.getBytes(\"UTF-8\"));\n str = String.format(Locale.US, \"%064x\", new Object[]{new BigInteger(1, r1.digest())});\n } catch (Exception e) {\n C0784a.m3252a(C0766d.class, e);\n str = null;\n }\n return str;\n }", "private void m125703b(String str) {\n Context context = getContext();\n if (context != null) {\n ZRouter.m72966a(context, new RouterUrl.C14428a(Uri.parse(C6969H.m41409d(\"G738BDC12AA6AE466E71D9B07\"))).mo76341a(C6969H.m41409d(\"G6F91DA178024A439EF0D\"), str).mo76344a(false).mo76345a());\n }\n }", "@Test\n public void someTests() {\n StringPair[] spvalues = new StringPair[]{\n new StringPair(\"\\u00C6neid\", \"AEneid\"),\n new StringPair(\"\\u00e9tude\", \"etude\"),\n // Chinese\n new StringPair(\"\\u5317\\u4eb0\", \"Bei Jing \"),\n // Canadian syllabics\n new StringPair(\"\\u1515\\u14c7\\u14c7\", \"shanana\"),\n // Cherokee\n new StringPair(\"\\u13d4\\u13b5\\u13c6\", \"taliqua\"),\n // Syriac\n new StringPair(\"\\u0726\\u071b\\u073d\\u0710\\u073a\", \"ptu'i\"),\n //Devangari\n new StringPair(\"\\u0905\\u092d\\u093f\\u091c\\u0940\\u0924\", \"abhijiit\"),\n // Bengali\n new StringPair(\"\\u0985\\u09ad\\u09bf\\u099c\\u09c0\\u09a4\", \"abhijiit\"),\n //Malayalaam\n new StringPair(\"\\u0d05\\u0d2d\\u0d3f\\u0d1c\\u0d40\\u0d24\", \"abhijiit\"),\n /*\n * Malayalaam. The correct transliteration is \"malayaalam\", but\n * since junidecode is context insentitive this is the best we can\n * do.\n */\n new StringPair(\"\\u0d2e\\u0d32\\u0d2f\\u0d3e\\u0d32\\u0d2e\\u0d4d\", \"mlyaalm\"),\n // Japanese\n new StringPair(\"\\u3052\\u3093\\u307e\\u3044\\u8336\", \"genmaiCha \")\n };\n for (StringPair sp : spvalues) {\n String decoded = Junidecode.unidecode(sp.getLeft());\n assertEquals(sp.getRight(), decoded);\n sevenBitPurity(decoded);\n }\n }", "private String composeCharacterString(String string) {\n return null;\r\n }", "private static boolean m66068b(String str) {\n for (int i = 0; i < str.length(); i++) {\n char charAt = str.charAt(i);\n if (charAt <= 31 || charAt >= 127 || \" #%/:?@[\\\\]\".indexOf(charAt) != -1) {\n return true;\n }\n }\n return false;\n }", "public void invertirFrase(Cadena C1, String frase) {\r\n\r\n char aux;\r\n String resp = \"\";\r\n\r\n for (int i = C1.getFrase().length() - 1; i >= 0; i--) {\r\n\r\n aux = C1.getFrase().charAt(i);\r\n resp = resp + aux;\r\n\r\n }\r\n System.out.println(resp);\r\n\r\n }", "public static String encipher(String string, String key){\n key = key != null ? key : defaultKey;\n String newString = \"\";\n string = Enigma.handleStringOnInput(string);\n string = string.toUpperCase();\n for (int i = 0; i < string.length(); i++){\n int temp = alphabetL.indexOf(string.charAt(i));\n newString += key.charAt(temp);\n }\n return newString;\n }", "public static void main(String[] args) {\n\n\t\t\n\t\tString s = \"平仮�??stringabc片仮�??numbers 123漢字gh%^&*#$1@):\";\n\t\t\n\t\t//Regular Expression: [^a-zA-Z0-9]\n\t\t\n\t\ts = s.replaceAll(\"[^a-zA-Z0-9]\", \"-\"); // ^ symbol is used for not/except\n\t\tSystem.out.println(s);\n\t}" ]
[ "0.63219225", "0.6254435", "0.62143415", "0.61981165", "0.617154", "0.61409634", "0.6106541", "0.6092872", "0.6057742", "0.6009548", "0.6008888", "0.5919922", "0.5876385", "0.58694524", "0.5866743", "0.5861068", "0.58311146", "0.58011353", "0.579213", "0.5748684", "0.57391226", "0.57296187", "0.57244706", "0.5718536", "0.5671391", "0.5665674", "0.5658686", "0.565061", "0.5639776", "0.56385297", "0.5610423", "0.56001866", "0.55889285", "0.55829716", "0.5582168", "0.5581478", "0.5571346", "0.5565734", "0.5563401", "0.55566907", "0.5556125", "0.5554635", "0.5548449", "0.55184716", "0.5516781", "0.5509948", "0.550945", "0.55051845", "0.5501646", "0.54958344", "0.54935807", "0.5491019", "0.54748034", "0.54732233", "0.54652125", "0.5462822", "0.5462539", "0.54583913", "0.5458003", "0.5457557", "0.54522395", "0.5451153", "0.54410833", "0.5432611", "0.54325885", "0.5431157", "0.5430457", "0.543018", "0.54287076", "0.5410193", "0.54087317", "0.5407026", "0.5400997", "0.53993213", "0.5385711", "0.53829074", "0.5382355", "0.5371339", "0.5370354", "0.53700453", "0.5365842", "0.53646034", "0.53624123", "0.53618854", "0.5358346", "0.5349784", "0.53490275", "0.53455156", "0.5344214", "0.53419805", "0.5339992", "0.5333373", "0.5333048", "0.5332008", "0.5317987", "0.53122765", "0.53099865", "0.53058654", "0.53046423", "0.53043365" ]
0.59503573
11
Enregistrement d'un nouvel utilisateur
public boolean registerNewUser(String email, String pass, int accountID){ String encPass = encrypt(pass); PreparedStatement pst; try { // Préparation de l'insertion pst = connection.prepareStatement("INSERT INTO user (email, password) VALUES (?,?)"); pst.setString(1, email); pst.setString(2, encPass); pst.executeUpdate(); // Récupération de l'ID de l'utilisateur pst = connection.prepareStatement("SELECT id FROM user WHERE email = ?"); pst.setString(1, email); if(!pst.execute()){ return false; } ResultSet rs = pst.getResultSet(); rs.next(); int id = rs.getInt(1); //TODO récupération du mot de passe en provenance de la banque String accPass = "lalala"; // Enregistrement du nouveau compte en banque pst = connection.prepareStatement("INSERT INTO account_access (id, account_id, password) VALUES (?,?,?)"); pst.setInt(1, id); pst.setInt(2, accountID); pst.setString(3, accPass); if(!(pst.executeUpdate() == 1)){ return false; } return true; } catch (SQLException e) { System.err.println("[ERREUR SQL] Impossible d'insérer le nouvel utilisateur: " + e.getMessage()); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean createUser(Utilisateur u) {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic Utilisateur addUser() {\n\t\treturn null;\r\n\t}", "public void effacerUtilisateur() {\r\n this.modele.effacerUtilisateur(this.modele);\r\n this.modele = new Utilisateurs();\r\n }", "public void createUtilisateur(UtilisateurBean u) {\n\t}", "public void createUser() {\r\n\t\tif(validateUser()) {\r\n\t\t\t\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"INSERT INTO t_user (nom,prenom,userName,pass,tel,type,status) values(?,?,?,?,?,?,?)\");\r\n\t\t\t\tps.setString(1, this.getNom());\r\n\t\t\t\tps.setString(2, this.getPrenom());\r\n\t\t\t\tps.setString(3, this.getUserName());\r\n\t\t\t\tps.setString(4, this.getPassword());\r\n\t\t\t\tps.setInt(5, Integer.parseInt(this.getTel().trim()));\r\n\t\t\t\tps.setString(6, this.getType());\r\n\t\t\t\tps.setBoolean(7, true);\r\n\t\t\t\tps.executeUpdate();\r\n\t\t\t\tnew Message().error(\"Fin d'ajout d'utilisateur\");\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tnew Message().error(\"Echec d'ajout d'utilisateur\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closePrepareStatement(ps);\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public void ajouterRole(RoleUtilisateur ru);", "public void register(String form /* should be a Form from GUI */){\n String email = \"email\";\n String nome_completo = \"full_name\";\n Date data_nascimento = new Date(1996-10-21);\n String password = getMd5(\"password\");\n String nif = \"nif\";\n String morada = \"morada\";\n String telemovel = \"telemovel\";\n User user = new User(email);\n if (!user.exists()){\n user.setNome_completo(nome_completo);\n user.setData_nascimento(data_nascimento);\n user.setPassword(password);\n user.setNif(nif);\n user.setMorada(morada);\n user.setTelemovel(telemovel);\n user.setAdmin(FALSE);\n //System registers person\n //db.register(user)\n }\n }", "private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}", "void registerUser(User newUser);", "Boolean registerNewUser(User user);", "static void effacerEnregistrer(){\n users.clear();\n }", "public void addUtilisateur(Utilisateur utilisateur) {\n\t\ttry {\n\t\t\tutilisateurDAO.insert(utilisateur);\n\t\t} catch (DALException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void registrarUsuarioFinal(){\r\n Usuario nuevoUsuario= new Usuario();\r\n nuevoUsuario.setNombreUsuario(nuevoNombreUsuario);\r\n nuevoUsuario.setPassword(nuevoPasswordUsuario);\r\n nuevoUsuario.setTipoUsuario(\"final\");\r\n \r\n IUsuarioDAO iusuarioDAO = new UsuarioDAOImp();\r\n iusuarioDAO.agregarUsuario(nuevoUsuario);\r\n FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Usuario registrado\", \"Usuario registrado exitosamente\");\r\n FacesContext.getCurrentInstance().addMessage(null, facesMessage);\r\n\r\n }", "@Override\n public void onClick(View v) {\n trasferisci_utente();\n\n // controlla se tutti i dati sono inseriti\n if (checkInput())\n {\n creaUser();\n NOME = username.getText().toString();\n CHIAVE = password.getText().toString();\n\n // controlla se l'utente USER con i dati inseriti negli edit_text è gia presente\n if (checkUser(persone, NOME, CHIAVE)) {\n\n errore_utente.setVisibility(View.GONE);\n\n // impedisce a due utenti di avere lo stesso username\n if(checkUsername(persone, NOME)) {\n\n errore_duplicato_username.setVisibility(View.GONE);\n\n persone.add(user);\n\n Intent showResult = new Intent(Registration.this, MainActivity.class);\n showResult.putExtra(PERSONA_PATH, persone);\n //showResult.putExtra(UTENTE_PATH, user);\n startActivity(showResult);\n } else {\n errore_duplicato_username.setVisibility(View.VISIBLE);\n }\n } else {\n errore_utente.setVisibility(View.VISIBLE);\n }\n }\n }", "@Override\n\tpublic void registrarAtencion(TramiteUsuario tramite) {\n\t\ttramite.setSecUsuario1( Usuario.getUsuarioBean() );\n\t\ttramite.setSecUsuario2( Usuario.getUsuarioBean() );\n\t\ttramite.setEstado(1);\n\t\ttramite.setEstadoTramiteFinal( ParametroUtil.EstadoTramite.ATENDIDO.value );\n\t\ttramite.setFechaRegistro( new Date() );\n\t\ttramiteDAO.registrarMovimiento( tramite );\n\t\t\n\t\ttramite.getTramite().setEstado( ParametroUtil.EstadoTramite.ATENDIDO.value );\n\t\ttramiteDAO.registrar( tramite.getTramite() );\n\t\t\n\t}", "public void insertUser() {}", "public void registrar() {\n try {\r\n do {\r\n //totalUsuarios = this.registraUnUsuario(totalUsuarios);\r\n this.registraUnUsuario();\r\n } while (!this.salir());\r\n } catch (IOException e) {\r\n flujoSalida.println(\"Error de entrada/salida, finalizará la aplicación.\");\r\n }\r\n flujoSalida.println(\"Total usuarios registrados: \"+totalUsuarios);\r\n }", "public void addUtilisateurToGroupe(Utilisateur utilisateur, Groupe groupe);", "private void registerUser() {\n\n // Get register name\n EditText mRegisterNameField = (EditText) findViewById(R.id.register_name_field);\n String nickname = mRegisterNameField.getText().toString();\n\n // Get register email\n EditText mRegisterEmailField = (EditText) findViewById(R.id.register_email_field);\n String email = mRegisterEmailField.getText().toString();\n\n // Get register password\n EditText mRegisterPasswordField = (EditText) findViewById(R.id.register_password_field);\n String password = mRegisterPasswordField.getText().toString();\n\n AccountCredentials credentials = new AccountCredentials(email, password);\n credentials.setNickname(nickname);\n\n if (DataHolder.getInstance().isAnonymous()) {\n credentials.setOldUsername(DataHolder.getInstance().getUser().getUsername());\n }\n\n sendRegistrationRequest(credentials);\n }", "@Override\n\tpublic void regist(User user) {\n\t\tdao.addUser(user);\n\t}", "private void register() {\r\n if (mName.getText().length() == 0) {\r\n mName.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mEmail.getText().length() == 0) {\r\n mEmail.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() == 0) {\r\n mPassword.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() < 6) {\r\n mPassword.setError(\"password must have at least 6 characters\");\r\n return;\r\n }\r\n\r\n\r\n final String email = mEmail.getText().toString();\r\n final String password = mPassword.getText().toString();\r\n final String name = mName.getText().toString();\r\n\r\n FirebaseAuth.getInstance().createUserWithEmailAndPassword(email, password).addOnCompleteListener(getActivity(), new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n if (!task.isSuccessful()) {\r\n Snackbar.make(view.findViewById(R.id.layout), \"sign up error\", Snackbar.LENGTH_SHORT).show();\r\n } else {\r\n String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();\r\n\r\n //Saves the user's info in the database\r\n Map<String, Object> mNewUserMap = new HashMap<>();\r\n mNewUserMap.put(\"email\", email);\r\n mNewUserMap.put(\"name\", name);\r\n\r\n FirebaseDatabase.getInstance().getReference().child(\"users\").child(uid).updateChildren(mNewUserMap);\r\n }\r\n }\r\n });\r\n\r\n }", "public void registrarAdministrador() throws IOException {\n\n //asignamos al usuario la imagen de perfil default\n usuarioView.setUsuarioFotoRuta(getPathDefaultUsuario());\n usuarioView.setUsuarioFotoNombre(getNameDefaultUsuario());\n\n //Se genera un login y un pass aleatorio que se le envia al proveedor\n MD5 md = new MD5();\n GenerarPassword pass = new GenerarPassword();\n SendEmail email = new SendEmail();\n\n password = pass.generarPass(6);//Generamos pass aleatorio\n\n //Encriptamos las contraseñas\n usuarioView.setUsuarioPassword(md.getMD5(password));//Se encripta la contreseña\n usuarioView.setUsuarioRememberToken(md.getMD5(password));\n\n //el metodo recibe los atributos, agrega al atributo ciudad del objeto usuario un objeto correspondiente, \n //de la misma forma comprueba el rol y lo asocia, por ultimo persiste el usuario en la base de datos\n usuarioView.setSmsCiudad(ciudadDao.consultarCiudad(usuarioView.getSmsCiudad()));//Asociamos una ciudad a un usuario\n usuarioView.setSmsRol(rolDao.consultarRol(usuarioView.getSmsRol()));//Asociamos un rol a un usuario\n usuarioView.setUsuarioEstadoUsuario(1);//Asignamos un estado de cuenta\n usuarioView.setSmsNacionalidad(nacionalidadDao.consultarNacionalidad(usuarioView.getSmsNacionalidad()));\n\n //registramos el usuario y recargamos la lista de clientes\n usuarioDao.registrarUsuario(usuarioView);\n usuariosListView = adminDao.consultarUsuariosAdministradores();\n\n //Enviar correo\n email.sendEmailAdministradorBienvenida(usuarioView, password);\n\n //limpiamos objetos\n usuarioView = new SmsUsuario();\n password = \"\";\n }", "public ErrorCode regist( String uname, String pass ){\n ErrorCode eCode = userBaseInfoManager.regist( uname, uname + \"nick\", pass );\n if( eCode.isSuccess() ) {\n User user = getUserByName( uname );\n initNewUser( user );\n }\n return eCode;\n }", "@Override\r\n public void registrarUsuario(User u) {\r\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\r\n }", "public void insererUtilisateur (Utilisateur u) {\r\n\t\ttry {\r\n\t\t\tString requete = \"INSERT INTO UTILISATEUR (idU, nomU, prenomU, login, motDePasse, idR) values (?,?,?,?,?,?);\";\r\n\t\t\tPreparedStatement ps = this.connexion.mysql.prepareStatement(requete);\r\n\t\t\tps.setInt(1, u.getIdentifiantUtilisateur());\r\n\t\t\tps.setString(2, u.getNomUtilisateur());\r\n\t\t\tps.setString(3, u.getPrenomUtilisateur());\r\n\t\t\tps.setString(4, u.getLoginUtilisateur());\r\n\t\t\tps.setString(5, u.getMotdepasseUtilisateur());\r\n\t\t\tps.setString(6, String.valueOf(u.getIdentifiantRole()));\r\n\t\t\tps.executeUpdate();\r\n\t\t\tSystem.out.println(\"UTILISATEUR AJOUTE\");\r\n\t\t}\r\n\t\t\r\n\t\tcatch (SQLException e) {\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "void regist(User user) throws SQLException;", "private void registerUser(){\n mAuth.createUserWithEmailAndPassword(correo, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //mapa de valores\n Map<String, Object> map = new HashMap<>();\n map.put(\"name\",name);\n map.put(\"email\",correo);\n map.put(\"password\",password);\n map.put(\"birthday\",cumple);\n map.put(\"genre\",genre);\n map.put(\"size\",size);\n //obtenemos el id asignado por la firebase\n String id= mAuth.getCurrentUser().getUid();\n //pasamos el mapa de valores\n mDatabase.child(\"Users\").child(id).setValue(map).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task2) {\n //validams que la tarea sea exitosa\n if(task2.isSuccessful()){\n startActivity(new Intent(DatosIniciales.this, MainActivity.class));\n //evitamos que vuelva a la pantalla con finsh cuando ya se ha registrado\n finish();\n }else{\n Toast.makeText(DatosIniciales.this, \"Algo fallo ups!!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }else{\n Toast.makeText(DatosIniciales.this, \"No pudimos completar su registro\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "public void register() {\n int index = requestFromList(getUserTypes(), true);\n if (index == -1) {\n guestPresenter.returnToMainMenu();\n return;\n }\n UserManager.UserType type;\n if (index == 0) {\n type = UserManager.UserType.ATTENDEE;\n } else if (index == 1) {\n type = UserManager.UserType.ORGANIZER;\n } else {\n type = UserManager.UserType.SPEAKER;\n }\n String name = requestString(\"name\");\n char[] password = requestString(\"password\").toCharArray();\n boolean vip = false;\n if(type == UserManager.UserType.ATTENDEE) {\n vip = requestBoolean(\"vip\");\n }\n List<Object> list = guestManager.register(type, name, password, vip);\n int id = (int)list.get(0);\n updater.addCredentials((byte[])list.get(1), (byte[])list.get(2));\n updater.addUser(id, type, name, vip);\n guestPresenter.printSuccessRegistration(id);\n }", "public void save() {\r\n\t\tString checkQuery = \"SELECT * FROM users WHERE id = \" + this.id;\r\n\t\tStatement stm;\r\n\t\tResultSet rs = null;\r\n\t\ttry {\r\n\t\t\tconnection = DBConnection.getConnection();\r\n\t\t\tstm = connection.createStatement();\r\n\t\t\trs = stm.executeQuery(checkQuery);\r\n\t\t\t// istnieje już ten obiekt - update\r\n\t\t\tif (rs.first()) {\r\n\t\t\t\tString query = \"UPDATE users SET name = \" + toStringOrNULL(name)\r\n\t\t\t\t\t\t+ \", password = \" + toStringOrNULL(password)\r\n\t\t\t\t\t\t+ \", is_admin = \" + isAdmin \r\n\t\t\t\t\t\t+ \", removed_at = \" + toStringOrNULL(removedAt) \r\n\t\t\t\t\t\t+ \" WHERE id = \" + getId();\r\n\t\t\t\texecuteNonReturningQuery(query);\r\n\t\t\t}\r\n\t\t\t// jeszcze go nie ma - zapis nowego\r\n\t\t\telse {\r\n\t\t\t\tString query = \"INSERT INTO users (name, password, removed_at, is_admin) VALUES (\"\r\n\t\t\t\t\t\t+ toStringOrNULL(name) + \", \"\r\n\t\t\t\t\t\t+ toStringOrNULL(password) + \", \"\r\n\t\t\t\t\t\t+ toStringOrNULL(removedAt) + \", \"\r\n\t\t\t\t\t\t+ isAdmin + \")\";\r\n\t\t\t\texecuteNonReturningQuery(query);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tconnection.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean register(String u_Name, String u_pw, String f_name){\n List<User> userList = userDao.getUserFromUsername(u_Name);\n //1.check if userName is used\n if (userList.size() != 0){ \n return false;\n }\n //2.create user and add to the DB\n User user = new User(u_Name, u_pw, f_name);\n userDao.addUser(user);\n //3.return true\n return true;\n }", "private void metodoSalvarUsuarioFirebase(final Usuarios variavelClasseUsuarios) {\n\n refAutenticacaofb = ConfiguracaoFirebase.metodoAutenticacaoFirebase();\n refAutenticacaofb.createUserWithEmailAndPassword(variavelClasseUsuarios.getEmail(),\n variavelClasseUsuarios.getSenha()).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if(task.isSuccessful()){\n\n idUsuario = task.getResult().getUser().getUid();\n variavelClasseUsuarios.setId(idUsuario);\n variavelClasseUsuarios.salvarUsuario();\n\n if(pegarTipoUsuarioSwitch() == \"Cliente\"){\n\n startActivity(new Intent(CadastroUsuario.this, Home.class));\n finish();\n Toast.makeText(CadastroUsuario.this, \"Usuário salvo com sucesso\", Toast.LENGTH_LONG).show();\n }else{\n\n startActivity(new Intent(CadastroUsuario.this, PainelEmpresa.class));\n finish();\n Toast.makeText(CadastroUsuario.this, \"Empresa inserida com sucesso!\", Toast.LENGTH_LONG).show();\n }\n\n\n }\n\n\n\n }\n });\n\n }", "@Override\n\tpublic boolean register(UserInfo ui, String password) {\n\t\treturn _uim.insert(ui, password);\n\t}", "private void registrarDatosBD(String nombre, String apellido, String usuario, String clave, String fnacim) {\n\t\tUsuario u = new Usuario(0, nombre, apellido, usuario, clave, fnacim, 0, 0);\n\t\t// 02. Registrar el obj usando la clase de gestion y guardando\n\t\tint ok = new GestionUsuarios().registrar(u);\n\n\t\t// salidas\n\t\tif (ok == 0) {\n\t\t\tJOptionPane.showMessageDialog(this, \"Error al registrar\");\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(this, \"Registro OK\");\n\t\t}\n\t}", "public void ajouterUser(Utilisateur user) {\n SQLiteDatabase db = this.getWritableDatabase(); // On veut écrire dans la BD\n ContentValues values = new ContentValues();\n values.put(USER_NOM, user.getNom());\n values.put(USER_AGE, user.getAge());\n values.put(USER_SEX, user.getSex());\n// Insérer le nouvel enregistrement\n long id = db.insert(TABLE_USER, null, values);\n db.close(); // Fermer la connexion\n }", "@Override\n\tpublic boolean registerUtente(Utente user) {\n\t\tif(!userExists(user)) {\n\t\t\tDB db = getDB();\n\t\t\tMap<Long, UtenteBase> users = db.getTreeMap(\"users\");\n\t\t\tlong hash = (long) user.getUsername().hashCode();\n\t\t\tusers.put(hash, user);\n\t\t\tdb.commit();\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\t\n\t}", "@Override\r\n\tpublic boolean insertUsuario(Usuario user) {\n\t\treturn false;\r\n\t}", "public void registerUser(Register reg)\r\n {\n\t Session session = HibernateUtils.getSession();\r\n\t Transaction tx = session.beginTransaction();\r\n\t session.save(reg);\r\n\t tx.commit();\r\n\t session.close();\r\n }", "public void registrarUsuario(String cedula, String nombre, String apellido, String correo, String contrasena) {\n\n usuario = new Usuario(cedula, nombre, apellido, correo, contrasena);\n usuarioDAO.create(usuario);\n\n }", "public Utilisateur() {\n\t\tsuper();\n\t}", "public void registerUser(RegisterForm form) throws DAOException;", "private void newUser(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\ttry {\n\t\t\tPrintWriter out = res.getWriter();\n\t\t\tString name = req.getParameter(Constants.NAME_USER);\n\t\t\tUserDB.introduceUser(name);\n\t\t\tlong id = UserDB.getUserId(name);\n\t\t\tUsuario u = new Usuario(name, Long.toString(id));\n\t\t\tout.print(gson.toJson(u));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tres.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n\t\t}\n\t}", "private void addInstituicao() {\n\n if (txtNome.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(null, \"Campo Nome Invalido\");\n txtNome.grabFocus();\n return;\n } else if (txtNatureza.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(null, \"Campo Natureza Invalido\");\n txtNatureza.grabFocus();\n return;\n }\n if ((instituicao == null) || (instituicaoController == null)) {\n instituicao = new Instituicao();\n instituicaoController = new InstituicaoController();\n }\n instituicao.setNome(txtNome.getText());\n instituicao.setNatureza_administrativa(txtNatureza.getText());\n if (instituicaoController.insereInstituicao(instituicao)) {\n limpaCampos();\n JOptionPane.showMessageDialog(null, \"Instituicao Cadastrada com Sucesso\");\n }\n }", "private void registerUserOnServer() throws IOException {\r\n\t\tdataSending.sendMessage(Server.REGISTER+\" \"+userName, Long.toString(userModel.ID));\r\n\t}", "public void addUser(Person person){\n \t\n \ttry {\n\t\t\tperson.sethPassword(Base64.getEncoder().encodeToString(MessageDigest.getInstance(\"SHA-256\").digest(person.gethPassword().getBytes(StandardCharsets.UTF_8))));\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n \t\n \t\n \tSystem.out.println(\"aanmaken van \" + person.getLogin());\n \tem.persist(person);\n \t\n }", "@PostMapping(value = \"/utilisateur/create\")\n public String saveNewUtilisateur(Model model, @Valid Utilisateur utilisateur, BindingResult bindingResult){\n if (utilisateurRepository.findByUsername(utilisateur.getUsername())==null && utilisateurRepository.findByEmail(utilisateur.getEmail())==null){\n utilisateur.getRoles().add(RoleEnum.ROLE_USER);\n utilisateurRepository.save(utilisateur);\n model.addAttribute(\"utilisateur\",utilisateur);\n logger.info(\"L'utilisateur \"+utilisateur.getUsername()+\" a été ajouté a la DB\");\n return \"confirmationUtilisateur\";\n }else{\n if (utilisateurRepository.findByUsername(utilisateur.getUsername().toLowerCase())!=null ){\n bindingResult.rejectValue(\"username\",\"utilisateur.username\", \"ce pseudo est déjà utilisé :(\");\n }\n if (utilisateurRepository.findByEmail(utilisateur.getEmail().toLowerCase())!=null){\n bindingResult.rejectValue(\"email\",\"utilisateur.email\", \"cet e-mail est déjà associé à un autre compte :(\");\n }\n model.addAttribute(\"utilisateur\",utilisateur);\n return \"inscription\";\n }\n }", "public static boolean registrazione(Studente s) {\n\t\tif(s.getUsername()==null || s.getNome()==null || s.getEmail()==null || s.getCognome()==null || \n\t\t\t\ts.getPassword()==null) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\tString passwordCriptata = PasswordUtils.generateSecurePassword(s.getPassword());\n\t\t\ts.setPassword(passwordCriptata);\n\t\t\tStudenteDao dao = new StudenteDao();\n\t\t\tif(dao.add(s)) {\n\t\t\t\tdao.close();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn false;\n\t\t}\n\t}", "private void insert() {//将数据录入数据库\n\t\tUser eb = new User();\n\t\tUserDao ed = new UserDao();\n\t\teb.setUsername(username.getText().toString().trim());\n\t\tString pass = new String(this.pass.getPassword());\n\t\teb.setPassword(pass);\n\t\teb.setName(name.getText().toString().trim());\n\t\teb.setSex(sex1.isSelected() ? sex1.getText().toString().trim(): sex2.getText().toString().trim());\t\n\t\teb.setAddress(addr.getText().toString().trim());\n\t\teb.setTel(tel.getText().toString().trim());\n\t\teb.setType(role.getSelectedIndex()+\"\");\n\t\teb.setState(\"1\");\n\t\t\n\t\tif (ed.addUser(eb) == 1) {\n\t\t\teb=ed.queryUserone(eb);\n\t\t\tJOptionPane.showMessageDialog(null, \"帐号为\" + eb.getUsername()\n\t\t\t\t\t+ \"的客户信息,录入成功\");\n\t\t\tclear();\n\t\t}\n\n\t}", "public Register() {\n user = new User();\n em = EMF.createEntityManager();\n valid = false;\n }", "private void createNewUser() {\n ContentValues contentValues = new ContentValues();\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.GENDER, getSelectedGender());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.PIN, edtConfirmPin.getText().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.LAST_NAME, edtLastName.getText().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.FIRST_NAME, edtFirstName.getText().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.STATUS, spnStatus.getSelectedItem().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.DATE_OF_BIRTH, edtDateOfBirth.getText().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.BLOOD_GROUP, spnBloodGroup.getSelectedItem().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.IS_DELETED, \"N\");\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.MOBILE_NUMBER, edtMobileNumber.getText().toString());\n contentValues.put(DataBaseConstants.Constants_TBL_CATEGORIES.CREATE_DATE, Utils.getCurrentDateTime(Utils.DD_MM_YYYY));\n\n dataBaseHelper.saveToLocalTable(DataBaseConstants.TableNames.TBL_PATIENTS, contentValues);\n context.startActivity(new Intent(CreatePinActivity.this, LoginActivity.class));\n }", "@Override\n\tpublic boolean addNewUser() {\n\t\treturn false;\n\t}", "void createUser() throws SQLException {\n String name = regName.getText();\n String birthdate = regAge.getText();\n String username = regUserName.getText();\n String password = regPassword.getText();\n String query = \" insert into users (name, birthdate, username, password)\"\n + \" values (?, ?, ?, ?)\";\n\n DB.registerUser(name, birthdate, username, password, query);\n }", "public void testInsererUtilisateur() {\n System.out.println(\"insererUtilisateur\");\n Utilisateur putilisateur = null;\n boolean expResult = false;\n boolean result = Utilisateur.insererUtilisateur(putilisateur);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "@Override\r\n\tpublic boolean register(String email, String id, String pw) {\n\t\treturn jdbcTemplate.update(\"insert into s_member values(?,?,?,\"\r\n\t\t\t\t+ \"'normal',sysdate)\",email,id,pw)>0;\r\n\t}", "Utilizator createUser(String username, String password, String nume,\n\t\t\tString prenume, String tip, String aux);", "public boolean registrar(usuario usr) {\n\n PreparedStatement ps = null;\n Conectar ct = new Conectar();\n Connection con = ct.conexion();\n //INSEERTAR DENTRO DE LA TABLA TRABAJO LOS DATOS DE REGISTRO\n String sql = \"INSERT INTO trabajo (usuario, password, Email, id_tipo, Nombre) VALUES(?,?,?,?,?)\";\n\n try {\n ps = con.prepareStatement(sql);\n\n ps.setString(1, usr.getUsuario());\n\n ps.setString(2, usr.getPassword());\n\n ps.setString(3, usr.getEmail());\n\n ps.setInt(4, usr.getId_tipo());\n\n ps.setString(5, usr.getNombre());\n\n ps.execute();\n return true;\n\n } catch (SQLException ex) {\n Logger.getLogger(sqlUsuario.class.getName()).log(Level.SEVERE, null, ex);\n return false;\n }\n }", "@Override\n\tpublic void crearUsuario(UsuarioEntity Usuario) {\n\t\treposUsuarios.save(Usuario);\n\t}", "private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }", "@Override\n public boolean userRegister(User user) \n { \n Connection conn = null;\n Statement stmt = null;\n try \n {\n db_controller.setClass();\n conn = db_controller.getConnection();\n stmt = conn.createStatement();\n String sql;\n \n sql = \"INSERT INTO users (firstname,lastname,username,password,city,number) \"\n + \"values ('\"+ user.getFirstname()+\"',\" \n + \"'\" + user.getLastname() + \"',\" \n + \"'\" + user.getUsername() + \"',\" \n + \"'\" + user.getPassword() + \"',\" \n + \"'\" + user.getCity() + \"',\"\n + \"'\" + user.getNumber() + \"')\";\n int result = stmt.executeUpdate(sql);\n \n stmt.close();\n conn.close();\n if(result == 1) return true;\n else return false;\n } \n catch (SQLException ex) { ex.printStackTrace(); return false;} \n catch (ClassNotFoundException ex) { ex.printStackTrace(); return false;} \n }", "public void newUser(User user);", "public void addUsuario(Usuario usuario) {\n\t\t\n\t}", "@WebMethod public Pertsona register(String izena, String abizena1, String abizena2, String erabiltzaileIzena, String pasahitza, String telefonoa, String emaila, LocalDate jaiotzeData, String mota) throws UserAlreadyExist;", "public boolean newUser(String username, String password, int uType, String fName, String lName, String email){\n\t\ttry{\n\t\t\tresultSet = statement.executeQuery(\"select uid from User where username='\"+username+\"' or email='\"+email+\"'\");\n\t\t\tif(resultSet.next()){\n\t\t\t\tSystem.out.println(\"already in\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tresultSet = statement.executeQuery(\"select max(Uid) from User\");\n\t\t\tresultSet.next();\n\t\t\tint userNumber = resultSet.getInt(1)+1;\n\t\t\tstatement.executeUpdate(\"insert into User values(\"+userNumber+\",'\"+username+\"','\"+password+\"',\"+uType+\",'\"+fName+\"','\"+lName+\"','\"+email+\"',\"+1+\")\");\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "@Override\n\tpublic Integer addRoleUtilisateur(RoleUtilisateur r) {\n\t\treturn roleUtilisateurDAO.addRoleUtilisateur(r);\n\t}", "private void registerUser(String email, String passwd){\n\n mAuth.createUserWithEmailAndPassword(email, passwd)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n String key = \"\";\n //checking if success\n if(task.isSuccessful()){\n key = task.getResult().getUser().getUid();\n toastMessage(\"seccuss here \"+key);\n String name = \"\";\n String phone = \"\";\n String c = String.valueOf(spinner.getSelectedItem());\n Classe classe = new Classe(c);\n name = nom.getText().toString();\n phone = tel.getText().toString();\n UserInformation U = new UserInformation(name,phone,classe);\n // toastMessage(\"hello uid \"+Useruid);\n myRef.child(\"users\").child(key).setValue(U);\n /* sharedPref = getApplicationContext().getSharedPreferences(Name, MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(Key, key);\n editor.apply();*/\n\n }else{\n toastMessage(\"Failed\"); }\n\n\n }\n });\n /*sharedPref = getApplicationContext().getSharedPreferences(Name, MODE_PRIVATE);\n uid = sharedPref.getString(Key, null);\n // toastMessage(\"hello thoast \"+uid);\n return uid ;*/\n }", "void addUser(String uid, String firstname, String lastname, String pseudo);", "@Override\n\tpublic void insert(User entity) {\n\t\tuserlist.put(String.valueOf(entity.getDni()), entity);\n\t}", "public void createSystemUser(String nam, String surnam, String id, String username, String password) {\n\t\ttry {\n\t\t\trestaurant.addUser(nam, surnam, id, username, password);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "protected void accionUsuario() {\n\t\t\r\n\t}", "public void saveOrUpdateProfile(){\n try {\n \n if(PersonalDataController.getInstance().existRegistry(username)){\n PersonalDataController.getInstance().update(username, staff_name, staff_surname, \n Integer.parseInt(id_type), \n id_number, imagePic, phone_number, mobile_number, email, birthdate, \n Integer.parseInt(gender), birthdate);\n }else{\n PersonalDataController.getInstance().create(username, staff_name, staff_surname, \n Integer.parseInt(id_type), \n id_number, imagePic, phone_number, mobile_number, email, birthdate, \n Integer.parseInt(gender));\n }\n } catch (GB_Exception ex) {\n LOG.error(ex);\n GBMessage.putMessage(GBEnvironment.getInstance().getError(32), null);\n }\n GBMessage.putMessage(GBEnvironment.getInstance().getError(33), null);\n }", "private void btnAgregarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {\n String v_nombre=\" \";\n\n if(txtNombreAU.getText().length()==0){\n Utilidades.mensajeInformacion(\"Digite un nombre, por favor\", \"Informacion\");\n return;\n }\n v_nombre=txtNombreAU.getText(); \n //Valido la contrasenia\n if(txtContraseniaAU.getText().length()==0){\n Utilidades.mensajeInformacion(\"Es obligatorio ingresar una contraseña\", \"Informacion\");\n return;\n }\n if(!validarContraseniaUsuario(txtContraseniaAU.getText())){\n return;\n }\n String v_contrasenia=txtContraseniaAU.getText();\n //Valido nombre completo\n if(txtNombreCompletoAU.getText().length()==0){\n Utilidades.mensajeInformacion(\"Es obligatorio ingresar el nombre completo\", \"Informacion\");\n return;\n }\n String v_nombreCompleto=txtNombreCompletoAU.getText();\n \n //Valido que se escogio un valor para el cargo\n int v_cargo=0;\n //10 = Administrador, 20=Funcionario\n if(rbtnAdministradorAU.isSelected()){\n v_cargo=10;\n }else if(rbtnFuncionarioAU.isSelected()){\n v_cargo=20;\n }else{\n Utilidades.mensajeInformacion(\"Escoga un cargo\", \"Informacion\");\n return;\n }\n \n //Creo y agreggo un usuario dependiendo del cargo escogido (Administrador o funcionario)\n try{\n boolean agregado=false;\n if(v_cargo==10){\n Administrador nuevoUsuario=new Administrador(v_nombre, v_contrasenia, v_nombreCompleto, null);\n agregado = administrador.agregarUsuario(nuevoUsuario);\n\n } \n if(v_cargo==20){\n Funcionario nuevoUsuario=new Funcionario(v_nombre, v_contrasenia, v_nombreCompleto, null);\n agregado = administrador.agregarUsuario(nuevoUsuario);\n }\n\n\n if(agregado){\n Utilidades.mensajeExito(\"Se agrego el Usuario\", \"Agregacion Exitosa\");\n limpiarCamposAgregarUsuario();\n }else{\n Utilidades.mensajeError(\"El Usuario a agregar ya existe\", \"Error\");\n }\n\n }catch (IOException ex) {\n Logger.getLogger(Funcionario.class.getName()).log(Level.SEVERE, null, ex);\n Utilidades.mensajeAdvertencia(\"Se ha interrumpido la conexion con el servidor\", \"Error\");\n }\n \n }", "private void registrar() {\n String nombre = txtNombre.getText();\n if (!nombre.trim().isEmpty()) {\n Alumno a = new Alumno();\n \n // cont++ , ++cont\n// contIds++;\n a.setNombre(nombre);\n a.setId(++contIds);\n \n listaAlumnos.add(a);\n\n lblCantidad.setText(\"Cantidad de nombres: \" + listaAlumnos.size());\n\n txtNombre.setText(null);\n txtNombre.requestFocus();\n // Actualiza la interfaz gráfica de la tabla\n tblNombres.updateUI();\n \n// int cont = 1;\n// System.out.println(\"------------------\");\n// System.out.println(\"Listado de alumnos\");\n// System.out.println(\"------------------\");\n// for (String nom : listaNombres) {\n// System.out.println(cont+\") \"+nom);\n// cont++;\n// }\n// System.out.println(\"------------------\");\n }\n }", "public void registerUser(User1 u1) {\n\t\tSession session = sf.openSession();\n\t\tTransaction tx = session.beginTransaction();\t\t\n\t\t\n \tsession.save(u1);\t\t\n \t \n \ttx.commit();\n \tsession.close();\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public String enregistrerAuteur(Auteur a) {\n auteurDao.creerAuteur(a);\n return \"SUCCESS\";\n }", "void register() {\n if (registerView.getFirstName().length() == 0 || registerView.getLastName().length() == 0 || registerView.getUsername().length() == 0 || registerView.getPassword().length() == 0) {\n IDialog invalidRegistrationDialog\n = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Fields must be non-empty!\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n } else {\n if (userController.registerUser(registerView.getFirstName(), registerView.getLastName(), registerView.getUsername(), registerView.getPassword()) != null) {\n mainFrame.setPanel(panelFactory.createPanel(PanelFactoryOptions.panelNames.MAIN_MENU));\n } else {\n IDialog invalidRegistrationDialog = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Username is already taken\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n }\n }\n }", "public void addUser() {\n\t\tUser user = dataManager.findCurrentUser();\r\n\t\tif (user != null) {\r\n\t\t\tframeManager.addUser(user);\r\n\t\t\tpesquisar();\r\n\t\t} else {\r\n\t\t\tAlertUtils.alertSemPrivelegio();\r\n\t\t}\r\n\t}", "public static void registrazione(String givenemail, String nome, String conome, String provincia, String orari, String password, String materie) {\n\n String email = mailtoDB(givenemail);\n String materieLC = materie.toLowerCase();\n final String percorsoReg = \"insegnanti\"; //Percorso registrazione account.\n final String percorsoDati = \"province\"; //Percorso registrazione dati.\n\n //Creazione arraylist materie da stringa.\n ArrayList<String> listamaterie = new ArrayList<String>(Arrays.asList(materieLC.split(\"[,\\n]\")));\n int index=0;\n for (String s : listamaterie) {\n listamaterie.set(index,s.trim());\n index++;\n }\n\n //Creazione oggetti \"rins\" e \"ins\" rispettivamente per registrazione password account e dati.\n RegTeacher rins = new RegTeacher(password, provincia);\n Teacher ins = new Teacher(givenemail, nome, conome, provincia, orari, \"0000\", listamaterie);\n\n //Registrazione rins, usando percorso Reg.\n DatabaseReference regRef = FirebaseDatabase.getInstance().getReference(percorsoReg);\n regRef.child(email).setValue(rins);\n\n //Registrazione ins, serve creare nuovo percorso.\n DatabaseReference dataRef = FirebaseDatabase.getInstance().getReference(percorsoDati).child(provincia.toLowerCase());\n dataRef.child(email).setValue(ins);\n }", "@Override\r\n\tpublic boolean registerSuperUser(String username, String password, String firstName, String lastName) {\n\t\tSuperUser tempSuperUser = new SuperUser(username, password, firstName, lastName);\r\n\t\t\r\n\t\treturn sudao.createSuperUser(tempSuperUser);\r\n\t}", "@Override\n\tpublic void registrarSalida() {\n\t\t\n\t}", "@Override\n\tpublic void registrarSalida() {\n\t\t\n\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tUsuarioPojo user = null;\r\n\t\t\t\tUsuarioPersistencia up = new UsuarioPersistencia();\r\n\r\n\t\t\t\t//int id = up.obtenerIdEmple();\r\n\t\t\t\tString usuarioMail = txtUsuario.getText();\r\n\t\t\t\tString password = new String(pwdPass.getPassword()); // DNI de momento\r\n\t\t\t\tString passwordC = new String(pwdConfPass.getPassword());\r\n\t\t\t\tString apenom = txtApenom.getText();\r\n\t\t\t\tString dni = txtDni.getText();\r\n\t\t\t\tint numSS = Integer.parseInt(txtSegSoc.getText());\r\n\t\t\t\tString cuenta = txtCuenta.getText();\r\n\r\n\t\t\t\tif (password.equals(passwordC)) {\r\n\t\t\t\t\t// creamos un objeto usuario si coinciden las contraseñas\r\n\t\t\t\t\tuser = new UsuarioPojo(apenom, numSS, cuenta, dni, usuarioMail, password);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (user != null) {\r\n\t\t\t\t\t// insertaremos el usuario si coinciden las contraseñas\r\n\t\t\t\t\tup = new UsuarioPersistencia();\r\n\t\t\t\t\tint res = up.insertarUser(user);\r\n\r\n\t\t\t\t\tif (res == 1) { // se habrá registrado al usuario\r\n\t\t\t\t\t\tSystem.out.println(\"Insertado correctamente\");\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Registro insertado correctamente\",\r\n\t\t\t\t\t\t\t\t\"Resultado del Registro\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t\t\tdispose(); // dispose cierra ventana actual, System.exit(0) sale del programa\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// mostramos msg si no coinciden las contraseñas, manteniendo el control en dreg\r\n\t\t\t\t\tSystem.out.println(\"No insertado\");\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Contraseñas introducidas no coinciden\", \"Error de contraseña\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\t// limpiamos campos de contraseña\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n\tpublic void registrarSalida() {\n\n\t}", "public void new_user(){\n }", "@RequestMapping(\"/createnewuser\")\r\n\tpublic ModelAndView userCreated(@ModelAttribute(\"rg\") Register reg) {\r\n\t\t\r\n\t\tBigInteger num = reg.getMb_no();\r\n\t\tSystem.out.println(\"mbno=\"+num.toString());\r\n\t\t//Doing the entry of New User in Spring_Users table\r\n\t\t\r\n\t\tString username = reg.getEmail_id();\r\n\t\tString password = reg.getPassword();\r\n\t\tSpringUsers su = new SpringUsers();\r\n\t\tsu.setUsername(username);\r\n\t\tsu.setPassword(password);\r\n\t\tsu.setEnabled(1);\r\n\t\tSystem.out.println(\"username=\"+username);\r\n\t\tSystem.out.println(\"password=\"+password);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tString r = reg.getUser_type();\r\n\t\t\r\n\t\t//if(r.equals(\"ROLE_INDIVIDUAL\"))\r\n\t\t\t//return new ModelAndView(\"individualhomepage\");\r\n\t\t//if(r.equals(\"ROLE_BROKER\"))\r\n\t//\t\treturn new ModelAndView(\"brokerhomepage\");\r\n\t\t//if(r.equals(\"ROLE_BUILDER\"))\r\n\t\t//\treturn new ModelAndView(\"builderhomepage\");\r\n\t\t\r\n\t//\tint i = susvc.entryOfNewUser(su);\r\n\t\t\r\n\t\tint j = regsvc.registerNewUser(reg);\r\n\t\t \r\n\t\treturn new ModelAndView(\"usercreated\");\r\n\r\n\t}", "private void register(String username,String password){\n\n }", "private void charge_up() throws GB_Exception {\n try{\n if(PersonalDataController.getInstance().existRegistry(username)){\n putPersonalInformation();\n }else{\n putDefaultInformation();\n }\n } catch (SQLException | IOException ex) {\n LOG.error(ex);\n throw new GB_Exception(\"Error al carga informacion de usuario. Comuniquese con su administrador.\");\n }\n }", "public void EnregistrerEmploye(String nom, String prenom, String couriel, String adresse,\n\t\t\tString numero, int heuresTravaille, int leTauxHoraire,int unSalaire){\n\t\t\n\t\tEmploye exploite = new Employe(nom,prenom,couriel,adresse,numero,heuresTravaille,leTauxHoraire,unSalaire);\n\t\tGestion.addEmploye(exploite);\n\t}", "public void createPersonalInfos(JFrame jFrame, ControllerAdmin controllerAdminPersonalInfos){\n JLabel jLabelAcount = new JLabel(\"Compte\");\n jLabelAcount.setBounds(20, 20, 100, 28);\n\n JLabel jLabelId = new JLabel(\"Identifiant :\");\n jLabelId.setBounds(40, 50, 300, 28);\n JTextField jTextFieldId = new JTextField(controllerAdminPersonalInfos.getUser().getId());\n jTextFieldId.setBounds(40, 80, 300, 28);\n\n JLabel jLabelLastName = new JLabel(\"Nom :\");\n jLabelLastName.setBounds(40, 110, 300, 28);\n JTextField jTextFieldLastName = new JTextField(controllerAdminPersonalInfos.getUser().getLastName());\n jTextFieldLastName.setBounds(40, 140, 300, 28);\n\n JLabel jLabelFirstName = new JLabel(\"Prenom :\");\n jLabelFirstName.setBounds(40, 170, 300, 28);\n JTextField jTextFieldFirstName = new JTextField(controllerAdminPersonalInfos.getUser().getFirstName());\n jTextFieldFirstName.setBounds(40, 200, 300, 28);\n\n JLabel jLabelEmail = new JLabel(\"Email :\");\n jLabelEmail.setBounds(40, 230, 300, 28);\n JTextField jTextFieldEmail = new JTextField(controllerAdminPersonalInfos.getUser().getEmail());\n jTextFieldEmail.setBounds(40, 260, 300, 28);\n\n JLabel jLabelPassword = new JLabel(\"Mot de passe :\");\n jLabelPassword.setBounds(40, 290, 300, 28);\n JPasswordField jPasswordFieldPassword = new JPasswordField(controllerAdminPersonalInfos.getUser().getPassword());\n jPasswordFieldPassword.setBounds(40, 320, 300, 28);\n\n JButton jButtonModifPassword = new JButton(\"Modifier le mot de passe\");\n jButtonModifPassword.setBounds(350, 320, 200, 28);\n\n //set editabilite\n jTextFieldId.setEditable(false);\n jTextFieldLastName.setEditable(false);\n jTextFieldFirstName.setEditable(false);\n jTextFieldEmail.setEditable(false);\n jPasswordFieldPassword.setEditable(false);\n\n // Ajout des element à la JFrame\n jFrame.add(jLabelAcount);\n jFrame.add(jLabelId);\n jFrame.add(jTextFieldId);\n jFrame.add(jLabelLastName);\n jFrame.add(jTextFieldLastName);\n jFrame.add(jLabelFirstName);\n jFrame.add(jTextFieldFirstName);\n jFrame.add(jLabelEmail);\n jFrame.add(jTextFieldEmail);\n jFrame.add(jLabelPassword);\n jFrame.add(jButtonModifPassword);\n jFrame.add(jPasswordFieldPassword);\n\n jButtonModifPassword.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n createModifPassword(jFrame, controllerAdminPersonalInfos);\n jFrame.repaint();\n }\n });\n\n jFrame.setLayout(null);\n jFrame.setVisible(true);\n }", "public static void createMysqlUser(Eleve e) {\n Session session = HibernateUtils.getSessionFactory().openSession();\r\n String SQLRequest = \"CREATE USER '\" + e.getAbreviation() + \"'@'%' IDENTIFIED BY '\" + e.getPwd() + \"'; \";\r\n System.out.println(SQLRequest);\r\n session.beginTransaction();\r\n session.createSQLQuery(SQLRequest).executeUpdate();\r\n session.getTransaction().commit();\r\n session.close();\r\n\r\n }", "boolean registrarUsuario(Usuario usuario) throws Exception;", "public void creatUser(String name, String phone, String email, String password);", "@Override\r\n\tpublic void modifierPrenom(int idUtilisateur, String nouveauPrenom) {\n\r\n\t}", "com.soa.SolicitarCreditoDocument.SolicitarCredito addNewSolicitarCredito();", "public void registerUser(User newUser) {\r\n userRepo.save(newUser);\r\n }", "public String registrarExtra(){\n\t\tFacesContext context = FacesContext.getCurrentInstance();\n\t\tActividad actividad = context.getApplication().evaluateExpressionGet(context, \"#{actividad}\", Actividad.class);\n\t\tEncargado encargado = context.getApplication().evaluateExpressionGet(context, \"#{encargado}\", Encargado.class);\n\t\t\n\t\ttry {\n\t\t\tactividad.registrarActividad_Encargado(encargado.getCedula());\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\t\n\t\t\t\t\t\n\t\t// put the user object into the POST request \n\t\tFacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"actividad\", actividad);\n\t\t\n\t\treturn \"principalAdministrador.xhtml\";\n\t}", "@Override\n public void registrarMiembro(UsuarioDTO miembroDTO) {\n if (usuarioDAO.buscar(miembroDTO.getLogin()) != null) {\n throw new ExcepcionUsuarioYaExistente(\"Error: El usuario ya existe\");\n }\n\n Miembro miembro = new Miembro(miembroDTO.getLogin(), miembroDTO.getNombre(), miembroDTO.getClave(), miembroDTO.getUbicacion(), miembroDTO.getBiografia());\n\n if (miembroDTO.getAvatar() != null) {\n miembro.setAvatar(miembroDTO.getAvatar());\n\n } else {\n try {\n ClassPathResource backImgFile = new ClassPathResource(\"image/generic-avatar.jpg\");\n byte[] arrayPic = new byte[(int) backImgFile.contentLength()];\n backImgFile.getInputStream().read(arrayPic);\n miembro.setAvatar(arrayPic);\n\n } catch (IOException ex) {\n throw new ExcepcionErrorInterno(\"Error: No se pudo crear el miembro\");\n }\n }\n\n usuarioDAO.crear(miembro);\n }", "public Utilisateur(String login, String pwd, String nom, String prenom) {\n\t\tsuper();\n\t\tthis.login = login;\n\t\tthis.pwd = pwd;\n\t\tthis.nom = nom;\n\t\tthis.prenom = prenom;\n\t}", "public void Register() {\n Url url = new Url();\n User user = new User(fname.getText().toString(), lname.getText().toString(), username.getText().toString(), password.getText().toString());\n Call<Void> registerUser = url.createInstanceofRetrofit().addNewUser(user);\n registerUser.enqueue(new Callback<Void>() {\n @Override\n public void onResponse(Call<Void> call, Response<Void> response) {\n Toast.makeText(getActivity(), \"User Registered successfully\", Toast.LENGTH_SHORT).show();\n }\n\n @Override\n public void onFailure(Call<Void> call, Throwable t) {\n Toast.makeText(getActivity(), \"Error\" + t, Toast.LENGTH_SHORT).show();\n }\n });\n }", "private void register(String username, String password) {\n User u = null;\n try {\n u = userDao.loadByLogin(username, password);\n } catch (Exception ignored) {}\n if (u == null) {\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"tmp_username\", username);\n editor.putString(\"tmp_password\", password);\n editor.commit();\n Intent intent = new Intent(LoginActivity.this, InfoActivity.class);\n startActivity(intent);\n } else {\n try {\n Toast.makeText(getApplicationContext(), \"Register Failed\", Toast.LENGTH_SHORT).show();\n } catch (Exception e) {\n Looper.prepare();\n Toast.makeText(getApplicationContext(), \"Register Failed\", Toast.LENGTH_SHORT).show();\n Looper.loop();\n }\n }\n }", "public String addUser() {\n\t\t\t\treturn null;\r\n\t\t\t}", "public login() {\n\n initComponents();\n \n usuarios.add(new usuarios(\"claudio\", \"claudioben10\"));\n usuarios.get(0).setAdminOno(true);\n \n }", "public void createNewClient(String nom, String prenom, String tel, String mail, String adresse) throws SQLException {\n\t\tint tmp = getLastClientId();\n\t\tSystem.out.println(tmp);\n\t\tif(tmp != 0) {\n\t\t\t//voir generated keys pour l'id\n\t\t\tClient tmpClient = new Client(tmp, nom, prenom, tel, mail, adresse);\n\t\t\tClient tmp2 = create(tmpClient);\n\t\t\tSystem.out.println(tmp2.getLogin());\n\t\t\tSystem.out.println(\"Succès lors de la création de l'utilisateur\");\n\t\t}else\n\t\t\tSystem.out.println(\"Erreur lors de la création de l'utilisateur\");\n\t}" ]
[ "0.71558404", "0.7038353", "0.7031756", "0.7015406", "0.6989056", "0.69227326", "0.6888336", "0.68532467", "0.68076444", "0.67817163", "0.6780337", "0.6778839", "0.67663604", "0.673294", "0.6680652", "0.66697115", "0.66655785", "0.6638908", "0.6616492", "0.65943986", "0.65779305", "0.6576059", "0.65680856", "0.65562356", "0.65535283", "0.65504414", "0.65345013", "0.6506722", "0.64671594", "0.64600444", "0.645187", "0.64511263", "0.6443176", "0.64391404", "0.64363885", "0.64109313", "0.63994217", "0.63917506", "0.63826364", "0.6376515", "0.6363719", "0.6360625", "0.6354509", "0.6350866", "0.6343991", "0.63434714", "0.63249665", "0.6319968", "0.6303703", "0.63010395", "0.6292314", "0.62788886", "0.62756765", "0.6256446", "0.6242666", "0.6232084", "0.6231554", "0.6226051", "0.6225285", "0.62178916", "0.6215991", "0.62081516", "0.6202949", "0.6195298", "0.6190222", "0.61896104", "0.6185558", "0.61786777", "0.61715585", "0.61701405", "0.6168219", "0.61670256", "0.6165065", "0.6164595", "0.61594015", "0.6159263", "0.6157979", "0.61555785", "0.61555785", "0.61501366", "0.6145554", "0.6135908", "0.6135866", "0.61277646", "0.6127287", "0.6116942", "0.6115919", "0.61134845", "0.61117804", "0.6107769", "0.61069703", "0.61053026", "0.61012644", "0.6096415", "0.6096279", "0.60918397", "0.60896385", "0.60861063", "0.60821307", "0.6080871", "0.6079763" ]
0.0
-1
Get product by provided id.
CafeProduct getProductById(final Integer productId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Product getProductByID(Long id);", "@Override\n\tpublic Product getProduct(int id) {\n\t\treturn productDao.getProduct(id);\n\t}", "public Product getProductWithId(int id) {\n for (Product s : products) {\n if (s.getId() == id) { return s;}\n }\n return null;\n }", "public Product getProduct(int id) {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\r\n\t\tProduct product = (Product) session.get(Product.class, id);\r\n\t\treturn product;\r\n\t}", "public Product selectProduct(long id) {\n return entityManager.find(Product.class, id);\n }", "@Override\n\tpublic Product getProductByid(long id) {\n\t\treturn productDao.getProductByid(id);\n\t}", "public Product get(String id);", "public Optional<Product> getProduct(final long id) {\n\t\treturn productRepository.findById(id);\n\t}", "public Product getProductFromId(Integer prodId) throws BackendException;", "@GetMapping(\"/getProduct/{id}\")\n\tpublic Product getProduct(@PathVariable(\"id\") Long id){\n\n\t\treturn productServiceImpl.getProduct(id);\n\t}", "@RequestMapping(value = \"/api/products/{id}\", method = RequestMethod.GET)\n\tpublic Product getOneProduct(@PathVariable(\"id\") long id) {\n\t\treturn this.productRepo.findById(id).orElseThrow(() -> {\n\t\t\tthrow new ProductNotFoundException();\n\t\t});\n\t}", "@Override\n\tpublic Product findProductById(Long id) {\n\t\treturn productDAO.findById(id).orElse(null);\n\t}", "Product getProductById(Integer productId);", "Product getProductById(Integer productId);", "@Override\r\n\tpublic Product getProduct(String productId) {\n\t\treturn dao.getProduct(productId);\r\n\t}", "@Override\n\tpublic Product getProduct(@Min(value = 1, message = \"Invalid Product ID.\") long id) {\n\t\treturn productRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException(\"Product not found\"));\n\t}", "@Override\r\n\tpublic Product getProduct(int productId) {\n\t\treturn dao.getProduct(productId);\r\n\t}", "public Product getProductByID(String id) {\n String query = \"select * from Trungnxhe141261_Product\\n \"\r\n + \"where id=?\";\r\n try {\r\n conn = new DBContext().getConnection();//mo ket noi voi sql\r\n ps = conn.prepareStatement(query);\r\n ps.setString(1, id);\r\n rs = ps.executeQuery();\r\n while (rs.next()) {\r\n return new Product(rs.getInt(1),\r\n rs.getString(2),\r\n rs.getString(3),\r\n rs.getDouble(4),\r\n rs.getString(5),\r\n rs.getString(6));\r\n }\r\n } catch (Exception e) {\r\n }\r\n return null;\r\n }", "@Override\r\n\tpublic Product getProduct(String id) {\n\t\treturn null;\r\n\t}", "public Product getProductById(final String id) \n\t{\n\n\t\treturn productDataDao.getProductById(id);\n\n\t}", "@Override\r\n\tpublic Product get(int id) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic Product getById(int id) throws SQLException {\n\t\treturn productDao.getById(id);\n\t}", "@Override\r\n\tOptional<Product> findById(String id);", "@GetMapping(\"/products/{id}\")\n\tpublic Product getOneProduct(@PathVariable(\"id\") int id) {\n\t\t//enhanced for loop \n\t\tfor (Product product : products) {\n\t\t\tif (product.getId() == id) {\n\t\t\t\treturn product;\n\t\t\t}\n\t\t}\n\t\tthrow new ProductNotFoundException() ;\n\t}", "Product findProductById(Long id);", "Product getProductById(Integer productID);", "@RequestMapping(value = \"/getId/{id}\")\n\tpublic @ResponseBody ProductDto getById(@PathVariable(\"id\") int id) {\n\t\treturn productFacade.getProductById(id);\n\t}", "@Override\r\n\tpublic ProductRaw getById(int id) {\n\t\treturn productRawDao.selectByPrimaryKey(id);\r\n\t}", "@Override\n\tpublic Product findproduct(Integer id) {\n\t\t\n\t\tConnection conn=null;\n\t\tPreparedStatement pst=null;\n\t\tResultSet rs=null;\n\t\t Product product =null;\n\t\t\n\t\ttry {\n\t\t\tconn=DBUtils.getConnection();\n\t\t\tpst=conn.prepareStatement(\"select id,category_id,name,Subtitle,main_image,sub_images,detail,price,stock,status,create_time,update_time from product where id=?\");\n\t\t\tpst.setInt(1, id);\n\t\t\trs=pst.executeQuery();\n\t\t if(rs.next()) {\n\t\t \t product =new Product(rs.getInt(\"id\"),rs.getInt(\"category_id\"),rs.getString(\"name\"),rs.getString(\"Subtitle\"),rs.getString(\"main_image\"),rs.getString(\"sub_images\"),rs.getString(\"detail\"),rs.getBigDecimal(\"price\"),rs.getInt(\"stock\"),rs.getInt(\"status\"),rs.getDate(\"create_time\"),rs.getDate(\"update_time\"));\n\t\t \t\n\t\t \t \n\t\t } \n\t\t\t\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tDBUtils.Close(conn, pst, rs);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\n\t\t\n\t\t\n\t\treturn product;\n\t}", "public Product findProduct(int id)\n {\n for(Product product : stock)\n {\n if(id == product.getID())\n {\n return product;\n }\n }\n System.out.println(\"Error: Could not find ID: \" + id);\n return null;\n }", "public Product seekProduct(int id) throws Exception {\n\t\treturn this.dao.showOne(id);\r\n\t}", "public Product getByID(int id) {\n if (!isValidID(id)) {\n System.out.println(\"Ese item no existe\");\n return null;\n }\n\n Product r = null;\n try {\n r = products[id].clone();\n } catch (CloneNotSupportedException e) {\n e.printStackTrace();\n }\n return r;\n }", "public Product findProductById(Integer id) {\n\t\treturn null;\n\t}", "@Override\n public ServiceCall<NotUsed, Product> getProductById(String id) {\n return request -> CompletableFuture\n .completedFuture(productRepository.getProduct(id));\n }", "@Transactional\n\tpublic Product getProductById(int id) {\n\n\t\tProduct product = hibernateTemplate.get(Product.class, id);\n\n\t\treturn product;\n\t}", "public Product findById(int id) {\n\t\tProduct p = null;\n\t\ttry (Connection c = JdbcUtil.getConnection()) {\n\t\t\tPreparedStatement s = c.prepareStatement(\"select * from product where product_id=?\");\n\t\t\ts.setInt(1, id);\n\t\t\tResultSet rs = s.executeQuery(); // 0 or 1 row as primary key is compared here\n\t\t\tif (rs.next()) {// rs.next() : moves cursor to first row\n\t\t\t\tp = mapRow(rs);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn p;\n\t}", "@Override\n\tpublic Products queryProductbyId(Integer id) {\n\t\treturn (Products)getSqlMapClientTemplate().queryForObject(buildId(SQL_PREFIX, \"queryProductbyId\"),id);\n\t}", "@Override\n\tpublic Optional<Product> findById(Long id) {\n\t\t return productRepository.findById(id);\n\t}", "public Product getProduct(long id, HttpServletRequest request) {\n RestTemplate restTemplate = new RestTemplate();\n Product product = new Product();\n String requestUrl = String.format(\"%s://%s:%d/products/\" + id, request.getScheme(), request.getServerName(), request.getServerPort());\n try {\n product = restTemplate.getForObject(requestUrl, Product.class);\n return product;\n } catch (Exception e) {\n return product;\n }\n }", "Product findById(long id);", "public Product getProduct(long productId) {\n\t\tProduct product = restTemplate.getForObject(\"http://PRODUCT-SERVICE/products/product-id/\" + productId, Product.class);\n\t\treturn product;\n\t}", "@Override\n\t@Transactional\n\tpublic Product getProductById(int productId) {\n\t\tOptional<Product>product = productDAO.findById(productId);\n\t\tif(product.isPresent()) return product.get();\n\t\telse return null;\n\t}", "@Override\n\tpublic Product getById(int productId) {\n\t\treturn session.get(Product.class, productId);\n\t}", "@GetMapping(path = \"/products/{id}\")\n public ResponseEntity<Product> getProductById(@PathVariable(name=\"id\") Long id){\n Product product = productService.findById(id);\n if (product!=null)\n return ResponseEntity.ok(product);\n return ResponseEntity.notFound().build();\n }", "public Product GetProductbyid(int Id) {\n\t\treturn null;\n\t}", "@Override\r\n public Optional<Product> findbyId(Long id) {\r\n return productRepository.findById(id);\r\n }", "public Optional<Product> getProduct(String productId);", "@GetMapping(\"{id}\")\n public ResponseEntity<ProductDto> getProductById(@PathVariable UUID id) {\n LOGGER.info(\"Get product by id.\");\n return Optional.ofNullable(productService.getProductById(id))\n .map(product -> new ResponseEntity<>(defaultConversionService\n .convert(product, ProductDto.class), HttpStatus.OK))\n .orElse(new ResponseEntity<>(HttpStatus.BAD_REQUEST));\n }", "@Override\r\n\tpublic Product showOne(int id) throws Exception {\n\t\treturn this.dao.showOne(id);\r\n\t}", "@GetMapping(\"/id/{id}\")\n public ProductDto getProductById(\n @PathVariable(\"id\") String id\n ){\n return productService.getProductById(id);\n }", "@GetMapping(\"/products/{id}\")\r\n\t@ApiOperation(value=\"Return unique product.\")\r\n\tpublic Product showOneProduct(@PathVariable(value=\"id\") long id){\n\t\treturn productRepository.findById(id);\r\n\t}", "public ProductApiResponse getProductById(Integer id) throws ProductException {\n\n\t\tProduct product = new Product();\n\n\t\tString productName = \"\";\n\n\t\tProductApiResponse productApiResponse = new ProductApiResponse();\n\t\ttry {\n\t\t\t// find the product id in the repository\n\t\t\tproduct = productRepository.findProductByProductId(id);\n\n\t\t\tif (product != null) {\n\t\t\t\t// if product id is available in the repository then call the external api to\n\t\t\t\t// get the product name\n\n\t\t\t\tproductName = productExtApiService.getProductName(id);\n\n\t\t\t\tif (productName != null) {\n\t\t\t\t\tproductApiResponse = setProductName(product, productName);\n\t\t\t\t} else {\n\t\t\t\t\tlogger.info(\"Product Name not available\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlogger.info(\"Product Id:\" + id + \"is not available in the repository\");\n\t\t\t\tthrow new ProductNotFoundException(\"Product Id:\" + id + \"is not available in the repository\");\n\n\t\t\t}\n\t\t} catch (RestClientException e) {\n\t\t\tlogger.info(\"Error in calling the external api to get the product name\");\n\t\t\tthrow new RestClientException(\"Error in calling the external api to get the product name.\");\n\t\t}\n\n\t\treturn productApiResponse;\n\t}", "public EquipmentProduct findEquipmentProductById(Long id) {\n\t\tlogger.info(\"[method : findEquipmentProductById][Type : DAO]\");\n\t\tSession session = this.sessionFactory.getCurrentSession();\n\t\tStringBuffer strQuery = new StringBuffer();\n\n\t\tstrQuery = strQuery.append(\"from EquipmentProduct ep where isDeleted = false and ep.id = :id\");\n\t\tlogger.info(\"[method : findEquipmentProductById][Query : \" + strQuery.toString() + \"]\");\n\n\t\t// prepare statement\n\t\tQuery query = session.createQuery(strQuery.toString());\n\t\tquery.setLong(\"id\", id);\n\n\t\t// execute\n\t\tEquipmentProduct equipmentProduct = (EquipmentProduct) query.uniqueResult();\n\n\t\treturn equipmentProduct;\n\t}", "@Override\n\tpublic IDataResult<Product> getById(int id) {\n\t\tvar product = productDao.getById(id);\n\t\tif (product.id == 0) {\n\t\t\treturn new ErrorDataResult<Product>(\"Böyle bir ürün bulunmuyor.\");\n\t\t}\n\t\treturn new SuccessDataResult<Product>(product);\n\t}", "@RequestMapping(value = \"/products/{productId}\", method = RequestMethod.GET, produces = \"application/json\")\n\tpublic ResponseEntity<Product> getSingleProduct(@PathVariable int productId) {\n\t\tProduct productById = pm.getProductById(productId);\n\t\tif (productById != null) {\n\t\t\treturn new ResponseEntity<Product>(productById, HttpStatus.OK);\n\t\t}\n\t\treturn new ResponseEntity<Product>(productById, HttpStatus.NOT_FOUND);\n\t}", "Product getProductById(Serializable productId);", "@Transactional(readOnly = true) \n public Product findOne(Long id) {\n log.debug(\"Request to get Product : {}\", id);\n Product product = productRepository.findOne(id);\n return product;\n }", "public Product lookupProduct(int productId) {\n for( Product product : allProducts ) {\n if(product.getId() == productId) {\n return product;\n }\n }\n return null;\n }", "public ProductCompare getProductByID(String id) { //Must be int type because when saving to Session, it is still int\n String query = \"SELECT * FROM Product WHERE ProductID = ?\";\n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, id);\n rs = ps.executeQuery();\n while (rs.next()) {\n return (new ProductCompare(rs.getInt(\"ProductID\"),\n rs.getString(\"ProductName\"), \n rs.getString(\"Description\"),\n rs.getInt(\"SellPrice\"), \n rs.getString(\"imageLink\"),\n rs.getFloat(\"height\"),\n rs.getFloat(\"width\"),\n rs.getFloat(\"weight\")\n ));\n }\n } catch (Exception e) {\n }\n return null;\n }", "public Product lookupProduct(int productId) {\n for(Product product : allProducts) {\n if(product.getId() == productId) {\n return product;\n }\n }\n \n return null;\n }", "public static Product getProductViaId(int prodId) {\r\n\t\tdbConnect();\r\n\t\tStatement stmt = null;\r\n\t\tResultSet rs = null;\r\n\t\tfinal String GET_PRODUCT = \"SELECT * FROM product WHERE product_id = \" + prodId;\r\n\t\tProduct product = null;\r\n\t\ttry {\r\n\t\t\tstmt = conn.createStatement();\r\n\t\t\trs = stmt.executeQuery(GET_PRODUCT);\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tint productId = rs.getInt(2);\r\n\t\t\t\tString productName = rs.getString(3);\r\n\t\t\t\tString productUnit = rs.getString(4);\r\n\t\t\t\tString productDescription = rs.getString(5);\r\n\t\t\t\tdouble priceForPurchase = rs.getDouble(6);\r\n\t\t\t\tdouble priceForSales = rs.getDouble(7);\r\n\t\t\t\tdouble stockQuantity = rs.getDouble(8);\r\n\r\n\t\t\t\tproduct = new Product(productId, productName, productUnit, productDescription, priceForPurchase,\r\n\t\t\t\t\t\tpriceForSales, stockQuantity);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tstmt.close();\r\n\t\t\trs.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn product;\r\n\t}", "public Product loadProductFromId(int productId) {\n ResultSet rs = database.getProduct(productId);\n Product newProduct = null;\n\n try {\n if (rs.next()) {\n newProduct = new Product(rs.getString(\"name\"), rs.getString(\"description\"), rs.getString(\"type\"), new Money(rs.getString(\"price\")), productId, rs.getBoolean(\"currentlyselling\"));\n } else {\n throw new NoSuchProductException(productId);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n if (newProduct == null) {\n throw new NoSuchProductException(productId);\n }\n return newProduct;\n }", "@Override\r\n\tpublic ProductMaster getProductById(int productId) {\n\t\treturn this.repository.findById(productId).orElse(null);\r\n\t}", "@RequestMapping(value = Constants.GET_PRODUCT_BY_ID, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<String> getProductDetails(@PathVariable (Constants.ID) Integer id) {\n try {\n ResponseWrapper result = productService.getProductDetails(id);\n ObjectMapper mapper = new ObjectMapper().configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false);\n mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);\n return new ResponseEntity<>(mapper.writeValueAsString(result), HttpStatus.OK);\n }\n catch (Exception e) {\n logger.error(Constants.EXCEPTION + e);\n return ExceptionHandler.handleException();\n }\n }", "public Producto findProductoById(Long id) {\n\t\treturn findById(Producto.class, id);\n\t}", "@Override\r\n\tpublic ProductModel getSingleProduct(long id) {\n\t\treturn productConverterShowAll.convert(productRepositoryImpl.getSingleProduct(id));\r\n\t}", "@Override\n\tpublic Product selectById(int id) throws ProductRepositoryException {\n\t\ttry (Connection conn = DriverManager.getConnection(dbUrl, userName, password)) {\n\t\t\t// statement with the parameter\n\t\t\tPreparedStatement stmt = conn.prepareStatement(QUERY_SELECT_BY_ID_STATEMENT);\n\t\t\t// setting every value for the parameter (begins with 1)\n\t\t\tstmt.setInt(1, id);\n\t\t\t// executing\n\t\t\tResultSet result = stmt.executeQuery();\n\t\t\t// throwing exception, when there is no more data-sets\n\t\t\tif (!result.next()) {\n\t\t\t\tthrow new ProductRepositoryException(\"Product with ID\" + id + \" doesn't exist\");\n\t\t\t}\n\n\t\t\tProduct entity = readProduct(result);\n\t\t\treturn entity;\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error loading a Product-dataset\\n\");\n\t\t\te.printStackTrace();\n\t\t\tthrow new ProductRepositoryException(\"Error loading a product dataset\", e);\n\t\t}\n\t}", "public Product selectProductName( int id) {\n\t\treturn productMapper.selectProductName(id);\r\n\t}", "@GetMapping(\"/product/{id}\")\n\tpublic Product getProductById(@PathVariable(\"id\") Long id);", "@Override\r\n\tpublic Product getProductById(String productId, String filePath) {\r\n\t\treturn productDetailsRepository.getProductById(productId, filePath);\r\n\t}", "public static Product lookupProduct(int productId) {\n for (int index = 0; index < Inventory.getAllProducts().size(); index++) {\n Product currentProduct = Inventory.getAllProducts().get(index);\n if (currentProduct.getId() == productId) {\n return currentProduct;\n }\n }\n return null;\n }", "public Product findProduct(int productId) {\n\t\treturn null;\n\t}", "public Product ProductDetail(int id){\n Product p = new Product();\n connect();\n ResultSet result = null;\n String sql = \"SELECT * FROM productos WHERE id_producto = ?\";\n \n try{\n PreparedStatement ps = connect.prepareStatement(sql);\n ps.setInt(1, id);\n result = ps.executeQuery();\n if(result != null){\n p.setProductId(\"\"+result.getInt(\"id_producto\"));\n p.setProductDescription(result.getString(\"descripcion\"));\n p.setProductPresentation(result.getString(\"presentacion\"));\n p.setProductCuantity(result.getInt(\"cantidad\"));\n p.setProductPrice(result.getFloat(\"precio\"));\n p.setProductProvider(result.getInt(\"proveedor\"));\n }\n connect.close();\n return p;\n }catch(SQLException ex){\n ex.printStackTrace();\n } \n return p;\n }", "@Override\n\tpublic ProductVo selectOne(String id) {\n\t\treturn sqlSession.selectOne(\"product.selectOne\", id);\n\t}", "Product getProductDetails(int idproduct) throws DataBaseException;", "@GetMapping(\"/productos/{id}\")\n @Timed\n public ResponseEntity<Producto> getProducto(@PathVariable Long id) {\n log.debug(\"REST request to get Producto : {}\", id);\n Producto producto = productoRepository.findOne(id);\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(producto));\n }", "ProductEntity findById(long id);", "@GetMapping(\"/findProduct/{productid}\")\n @ResponseBody\n public ResponseEntity<ProductEntity> findProductByID(@PathVariable Integer productid) {\n ProductEntity productResponse = productService.viewproductbyid(productid);\n return new ResponseEntity<>(productResponse, HttpStatus.OK);\n }", "@GetMapping(VERSION + \"/product/{productId}\")\n public ResponseEntity<?> retrieveProductDetails(@PathVariable(\"productId\") String productId) {\n ProductDto productDto = productCompositeService.fetchProductById(productId);\n return ResponseEntity.ok().body(productDto);\n }", "public static Product getProduct(int productId) throws SQLException\n\t{\n\t\tProduct product = null;\n\t\tLogger logger = null;;\n\t\ttry{\n\t\t\tPreparedStatement statement = connection.prepareStatement(selectOneQuery);\n\t\t\tstatement.setInt(1, productId);\n\t\t\tResultSet resultset = statement.executeQuery();\n\t\t\twhile (resultset.next()) {\n\t\t\t\tString productName = resultset.getString(2);\n\t\t\t\t\n\t\t\t\tlogger .info(productName);\n\t\t\t\tproduct= new Product(productName);\n\t\t\t}\n\t\t}catch(SQLException e)\n\t\t{\n\t\t\tlogger.error(e);\n\t\t}\n\t\t\n\t\treturn product;\n\t\t\n\t}", "private Observable<Product> retrieveProductFromProductSystem(Long productId) {\n return new GetProductCommand(productId, productService).observe();\n }", "@Override\n\tpublic Product loadById(int id) {\n\t\treturn null;\n\t}", "@Override\n @Transactional\n public Producto findById(long id) {\n return productoDao.findById(id);\n }", "@Override\n public ProjectproductDTO findOne(String id) {\n log.debug(\"Request to get Projectproduct : {}\", id);\n Projectproduct projectproduct = projectproductRepository.findOne(UUID.fromString(id));\n ProjectproductDTO projectproductDTO = projectproductMapper.projectproductToProjectproductDTO(projectproduct);\n return projectproductDTO;\n }", "@GetMapping (\"/{id}\")\n public ResponseEntity<ProductDto> getOneProduct(@PathVariable Long id){\n return new ResponseEntity<>(productService.oneProductDto(id), HttpStatus.OK);\n }", "void viewProductById(long id);", "Product selectByPrimaryKey(Integer id);", "@Override\n @Transactional(readOnly = true)\n public ProductDTO findOne(Long id) {\n log.debug(\"Request to get Product : {}\", id);\n Product product = productRepository.findOneWithEagerRelationships(id);\n return productMapper.toDto(product);\n }", "@ApiOperation(value = \"Product by ID\", response = Product.class)\n\t@ApiResponses(value = {\n @ApiResponse(code = 200, message = \"Return a Product Object.\", response = Product.class ),\n @ApiResponse(code = 400, message = \"Return a error object\", response = error.class) })\n\t\n\t@GetMapping(path = \"/api/products/{product_id}\")\n\tpublic ResponseEntity<Optional<Product>> getById(\n\t\t\t@PathVariable(name = \"product_id\", required = true) Integer productId) {\n\t\treturn ResponseEntity.ok(productService.findById(productId));\n\t}", "@RequestMapping(method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_UTF8_VALUE })\n\t@ResponseStatus(HttpStatus.OK)\n\tpublic PriceDetail findPriceDetailsByProductId(@PathVariable(\"id\") Long productId) {\n\t\tLOGGER.debug(\"PriceDetailResource.findPriceDetailsByProductId Finding price details by Product Id \" + productId);\n\t\tPriceDetail priceDetail = priceDetailService.findByProductId(productId);\n\t\tif(priceDetail == null){\n\t\t\tthrow new ProductNotFoundException(\"Price for product \" + productId + \" not found.\");\n\t\t}\n\t\treturn priceDetail;\n\t}", "@Override\n public Product findProductById(String productId)\n {\n\t\t// if the productID is not valid then it will throw the Exception\n\t\t\n \t Product pro=ProductStore.map.get(productId);\n \t if(pro==null)\n \t {\n \t\t throw new InValidIdException(\"Incorrect Id \");\n \t }\n \t \n \t // if the productId is valid it will return Product\n \t else\n \t\t return pro;\n }", "@RequestMapping(value=\"/getProduct\", produces = MediaType.APPLICATION_JSON_VALUE)\n\tpublic ResponseEntity<ResponseDTO> getProduct(@RequestParam int id)\n\t{\n\t\tResponseDTO responseDTO = new ResponseDTO();\n\t\tOptional<Users> user= customerService.getUserByEmail(SecurityUtils.getCurrentUserLogin());\n\t\t\n\t\tif (user.isPresent()) {\n\t\t\t\n\t\t\tresponseDTO.setProductList(productService.getproductByCategoryId(id));\n\t\t\t//responseDTO.setCategoryNames(category);\n\t\t\tresponseDTO.setMessage(\"success\");\n\t\t}\n\t\t\n\n\t\n\t\treturn new ResponseEntity<ResponseDTO>(responseDTO,HttpStatus.OK);\n\t}", "@Override\n public Product getProductById(long id, boolean retrieveAssociation) throws Exception\n {\n PreparedStatement query = _da.getCon().prepareStatement(\"SELECT * FROM Products WHERE productId = ?\");\n query.setLong(1, id);\n _da.setSqlCommandText(query);\n ResultSet productResult = _da.callCommandGetRow();\n if(productResult.next())\n return buildProduct(productResult, retrieveAssociation);\n\n return null;\n }", "Product selectByPrimaryKey(Long id);", "@GetMapping(value = \"/{id}\")\n\tpublic ResponseEntity<Product> findById(@PathVariable Long id) {\n\t\tProduct cat = categoryRepository.findById(id).get();\n\t\treturn ResponseEntity.ok().body(cat);\n\t}", "public List<Product> getProductByID() {\n List<Product> listProduct= productBean.getProductByID(productId);\n return listProduct;\n }", "public ProductView get(String id, String developerId) {\n LOG.debug(\"Enter. id: {}, developerId: {}.\", id, developerId);\n\n ProductView result = cacheApplication.getProductById(developerId, id);\n\n if (result == null) {\n LOG.debug(\"Cache fail, get from database.\");\n\n List<ProductView> productViews = fetchProducts(developerId);\n\n result = productViews.stream().filter(view -> id.equals(view.getId())).findAny().orElse(null);\n }\n\n LOG.debug(\"Exit. productView: {}.\", result);\n return result;\n }", "@GetMapping(path = \"/products/{id}\")\n Product getProductById(@RequestHeader(HttpHeaders.AUTHORIZATION) String token, @PathVariable Long id);", "static public Product[] retrieve(int[] id) {\n\t\t\n\t\tProduct[] list = null;\n\t\t\n\t\treturn list;\n\t}", "CatalogItem getItembyId(final Long id);" ]
[ "0.85038114", "0.84221286", "0.8384023", "0.83488333", "0.8346603", "0.8281538", "0.8278932", "0.820037", "0.81812376", "0.8103075", "0.80738086", "0.8053274", "0.805252", "0.805252", "0.80416906", "0.80237216", "0.7998011", "0.79830736", "0.7974379", "0.79454577", "0.79403275", "0.792878", "0.7928193", "0.79072547", "0.7904246", "0.78981435", "0.7867849", "0.7850402", "0.7845931", "0.7840747", "0.7839999", "0.7836897", "0.78305143", "0.7822248", "0.78173023", "0.7801774", "0.77832776", "0.77527463", "0.77405685", "0.7728397", "0.76983035", "0.7683011", "0.7666422", "0.7656834", "0.7643083", "0.76357526", "0.762104", "0.7575061", "0.7573288", "0.7531254", "0.75051075", "0.7505012", "0.7478597", "0.7473162", "0.7470529", "0.74609506", "0.7434461", "0.7433489", "0.74272156", "0.73765403", "0.7374372", "0.734589", "0.73132455", "0.7309941", "0.7306792", "0.73066926", "0.7299547", "0.7299318", "0.7286613", "0.7282692", "0.7279231", "0.72641236", "0.72611755", "0.725278", "0.72288495", "0.7223209", "0.72017103", "0.72013", "0.72003967", "0.7199347", "0.71792763", "0.7170311", "0.7165851", "0.716042", "0.715598", "0.7132033", "0.712485", "0.7124321", "0.7097225", "0.7085296", "0.70826626", "0.70800126", "0.70785487", "0.70783406", "0.70406747", "0.70392823", "0.7036802", "0.70259345", "0.7013248", "0.7006989" ]
0.82859117
5
Delete product by id
void deleteProduct(Integer productId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void deleteProduct(Long id);", "void deleteProduct(int productId) throws ProductException;", "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Product : {}\", id);\n productRepository.delete(id);\n }", "public void deleteProductById(int id) {\n\t\tproductMapper.deleteProductById(id);\r\n\t}", "@Override\n\tpublic void deleteProduct(int product_id) {\n\n\t}", "@DeleteMapping(path =\"/products/{id}\")\n public ResponseEntity<Void> deleteProduct(@PathVariable(name=\"id\") Long id) {\n log.debug(\"REST request to delete Product with id : {}\", id);\n productService.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }", "@DeleteMapping(\"/product/{id}\")\n\t@ApiOperation(value = \"\", authorizations = { @Authorization(value=\"JWT\") })\n\tString deleteProduct(@PathVariable Long id) {\n\t\tproductRepo.deleteById(id);\n\t\treturn \"deleted successfully\";\n\t}", "private void removeProduct(int id)\n {\n manager.removeProduct(id);\n }", "@Override\n public void delete(String id) {\n log.debug(\"Request to delete Projectproduct : {}\", id);\n projectproductRepository.delete(UUID.fromString(id));\n }", "@Transactional\n\tpublic void deleteProduct(int id) {\n\n\t\tProduct product = hibernateTemplate.get(Product.class, id);\n\t\thibernateTemplate.setCheckWriteOperations(false);\n\t\thibernateTemplate.delete(product);\n\n\t}", "@DeleteMapping(\"/productos/{id}\")\n @Timed\n public ResponseEntity<Void> deleteProducto(@PathVariable Long id) {\n log.debug(\"REST request to delete Producto : {}\", id);\n productoRepository.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }", "@Override\n\tpublic ProductDto deleteProduct(int id) {\n\t\treturn null;\n\t}", "@Override\n\tpublic int deleteproduct(Integer id) {\n\t\tConnection conn=null;\n\t\tPreparedStatement pst=null;\n\t\ttry {\n\t\t\tconn=DBUtils.getConnection();\n\t\t\tpst=conn.prepareStatement(\"delete from product where id=?\");\n\t\t\tpst.setInt(1,id);\n\t\t\t\n\t\t\treturn pst.executeUpdate();\n\t\t\t\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tDBUtils.Close(conn, pst);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\treturn 0;\n\t}", "public void delete(Long id) {\n log.debug(\"Request to delete Product : {}\", id);\n productRepository.delete(id);\n productSearchRepository.delete(id);\n }", "public void deleteProductDetails(long id) {\n entityManager.createQuery(\"DELETE FROM ProductDetails pd WHERE pd.product.id=:id\")\n .setParameter(\"id\", id)\n .executeUpdate();\n }", "void deleteCategoryProducts(long id);", "public void deleteProduct(Product product) throws BackendException;", "void deleteProduct(Product product) throws ServiceException;", "public Product deleteProduct(int id) {\n\r\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\r\n\t\tProduct product = (Product) session.get(Product.class, id);\r\n\r\n\t\tif (product != null)\r\n\t\t\tsession.delete(product);\r\n\t\treturn product;\r\n\t}", "@DeleteMapping(\"/products/{id}\")\n\tpublic List<Product> removeOneProduct(@PathVariable(\"id\") int id){\n\t\t//counter for loop \n\t\tfor (int i=0; i < products.size(); i++) {\n\t\t\tif (products.get(i).getId() == id) {\n\t\t\t\tproducts.remove(i);\n\t\t\t\treturn products;\n\t\t\t}\n\t\t}\n\t\t\n\t\tthrow new ProductNotFoundException();\n\t\t\n\t}", "@ResponseStatus(HttpStatus.OK)\n\t@ResponseBody\n\t@DeleteMapping(value = \"/{id}\", produces = MediaType.APPLICATION_JSON_VALUE)\n\tpublic void deleteProductoById(@PathVariable(\"id\") Long id) {\n\t\t// Verifica si el producto existe\n\t\tProducto producto = productoService.findById(id);\n\n\t\tInventario invantario = inventarioService.findByCodProducto(producto.getCodProducto());\n\t\tinventarioService.delete(invantario);\n\t}", "@RequestMapping(method = RequestMethod.DELETE, value = \"/{id}\",\n produces = \"application/json\", headers = \"Accept=application/json\" )\n public ResponseEntity<?> deleteInventoryByProductId(@PathVariable(\"id\") Integer id){\n Product product = productService.getProductById(id);\n\n //Desassociando o produto do estoque\n Inventory inventory = inventoryService.getInventoryItemByProductId(id);\n product.setInventory(null);\n inventory.setProduct(product);\n inventoryService.updateInventoryItem(inventory);\n\n //Deletando o produto do estoque\n inventoryService.deleteInventoryItem(inventory.getInventoryId());\n\n return ResponseEntity.noContent().build();\n }", "@Override\n\tpublic void deleteProduct(int theId) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\tQuery theQuery = currentSession.createQuery(\"delete from Products where id=:productId\");\n\t\t\n\t\ttheQuery.setParameter(\"productId\", theId);\n\t\t\n\t\ttheQuery.executeUpdate();\n\t\t\n\t}", "@Override\n @Transactional\n public void delete(long id) {\n productoDao.deleteById(id);\n }", "@Override\n\tpublic void deleteProductImage(String id) {\n\t\tthis.productGaleryRepository.deleteById(Long.parseLong(id));\n\t}", "@Override\n public void delete(Long id) {\n log.debug(\"Solicitud para obtener borrar ProductPurchase : {}\", id);\n productPurchaseRepository.deleteById(id);\n }", "@Override\r\n\tpublic int deleteOne(int id) {\n\t\treturn productRawDao.deleteByPrimaryKey(id);\r\n\t}", "@Override\n\tpublic void deleteOne(String id) {\n\t\tsqlSession.delete(\"product.deleteOne\", id);//상품 삭제\n\t\tsqlSession.delete(\"product.deleteAll\", id);//상품 시작일 모두 삭제\n\t}", "@Override\r\n\tpublic int deleteProductById(String productId) {\n\t\treturn dao.deleteProductById(productId);\r\n\t}", "@RequestMapping(\n method = RequestMethod.DELETE,\n path = \"{productId}\"\n )\n public void deleteProductFromShoppingCartById(@PathVariable(\"productId\") UUID productId){\n shoppingCartService.deleteProductFromShoppingCartById(productId);\n }", "public void DeleteProductById(String pid) {\r\n String query = \"delete from Trungnxhe141261_Product\\n\"\r\n + \"where id=?\";\r\n\r\n try {\r\n conn = new DBContext().getConnection();//mo ket noi voi sql\r\n ps = conn.prepareStatement(query);\r\n ps.setString(1, pid);\r\n ps.executeUpdate();\r\n } catch (Exception e) {\r\n }\r\n\r\n }", "public Boolean deleteProductbygraphql(int id)\n\t{\n\t\tif(productrepo.existsById(id))\n\t\t{\n\t\t\tproductrepo.deleteById(id);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t}", "@RequestMapping(path=\"/eliminar\", method=RequestMethod.GET)\r\n\tpublic String deleteProduct(@RequestParam(name=\"id\")int id,Model model) {\n\t\tproductoDAO.deleteProducto(id);\r\n\t\t//retornamos lista de productos\r\n\t\treturn \"redirect:/producto\";\r\n\t}", "@DeleteMapping(\"/deleteproduct/{productId}\")\n\t\tpublic String deleteProduct(@PathVariable(value = \"productId\") int productId) throws ProductNotFoundException {\n\t\t\tlogger.info(\"product deleted displyed\");\n\t\t\tProduct product = productService.getProductById(productId)\n\t\t\t\t\t.orElseThrow(() -> new ProductNotFoundException(\"No product found with this Id :\" + productId));\n\t\t\tproductService.deleteProduct(product);\n\t\t\treturn \"Product Deleted Successfully\";\n\t\t}", "@Override\r\n\tpublic void delete(int id) {\n\t\r\n\t\tProduct product = get(id);\r\n\t\tList<PropertyValue> list = propertyValueService.list(product);\r\n\t\tfor(PropertyValue p : list) {\r\n\t\tpropertyValueMapper.deleteByPrimaryKey(p.getId());\r\n\t\t}\r\n\t\tList<ProductImage> list2 = productImageService.list(id);\r\n\t\tfor(ProductImage pi : list2) {\r\n\t\tproductImageService.delete(id);}\r\n\t\tList<OrderItem> list3 = orderItemService.list(get(id));\r\n\t\tfor(OrderItem oi : list3) {\r\n\t\t\torderItemService.delete(oi.getId());\r\n\t\t\t\r\n\t\t}\r\n\t\tproductMapper.deleteByPrimaryKey(id);//外键约束\r\n\t}", "@Override\r\n\tpublic int delById(int id) {\n\t\tint flag=0;\r\n\t\ttry {\r\n\t\t\tString sql=\"DELETE FROM payedproduct WHERE PayedProduct_id=?\";\r\n\t\t\tflag= qr.update(sql, id);\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}\r\n\t\treturn flag;\r\n\t}", "public void Deleteproduct(Product objproduct) {\n\t\t\n\t}", "public void deleteProduct(Product product_1) {\n\r\n\t}", "@Override\n\tpublic void remove(Long id) {\n\t\tproductRepository.delete(id);\n\t}", "void delete(Product product) throws IllegalArgumentException;", "@Transactional\n public void deleteProduct(Long productId) throws NoSuchProductException {\n Product product = productRepository.findProductById(productId);\n if(product == null){\n throw new NoSuchProductException(\"There is no such product !!! \");\n }\n basketProductRepository.deleteBasketProductsByProduct_Id(productId);\n productRepository.delete(product);\n }", "@Override\n\tpublic boolean deleteProductData(int id) {\n\t\treturn dao.deleteProductData(id);\n\t}", "@GetMapping(\"/delete\")\r\n\tpublic String delete(@RequestParam Integer id) \r\n\t{\r\n\t\tservice.deleteProduct(id);\r\n\t\t/*\r\n\t\tList<Product> list=service.getAllProducts();\r\n\t\tmodel.addAttribute(\"list\", list);\r\n\t\treturn \"ProductData\";\r\n\t\t */\r\n\t\treturn \"redirect:all\";\r\n\t}", "@Override\r\n\tpublic boolean deleteProduct(int productId) {\n\t\treturn dao.deleteProduct(productId);\r\n\t}", "@GetMapping(\"/delete\")\n public RedirectView delete(Long id, Principal p) {\n if(applicationUserRepository.findByUsername(p.getName()).getAdmin()) {\n for (LineItem item : lineItemRepository.findAll()) {\n if (item.getProduct().getId() == id) {\n lineItemRepository.deleteById(item.getId());\n }\n }\n productRepository.deleteById(id);\n }\n return new RedirectView(\"/products\");\n }", "@Override\n\t@Transactional\n\tpublic void deleteProduct(int productId) {\n\t\tproductDAO.deleteById(productId);\n\n\t}", "@Override\r\n\tpublic int deleteProduct(Product product) {\n\t\treturn 0;\r\n\t}", "public void delete(int id) {\n SQLiteDatabase database = this.getWritableDatabase();\n database.delete(PRODUCT_TABLE, KEY_ID + \" = ?\", new String[]{Integer.toString(id)});\n database.close();\n }", "@Writer\n int deleteByPrimaryKey(Integer productId);", "@DeleteMapping(\"/product/{productid}\") \nprivate void deleteProduct(@PathVariable(\"productid\") int productid) \n{ \nproductsService.delete(productid); \n}", "void deleteCategoryParameterProductDetails(long id);", "public boolean EliminarProducto(int id) {\n boolean status=false;\n int res =0;\n try {\n conectar();\n res=state.executeUpdate(\"delete from producto where idproducto=\"+id+\";\");\n \n if(res>=1){\n status=true;\n }\n con.close();\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n return status;\n }", "@Transactional\n public void deleteProduct(Integer productId) {\n ProductEntity productEntity = productRepository\n .findById(productId)\n .orElseThrow(() -> new NotFoundException(getNotFoundMessage(productId)));\n productEntity.setRemoved(true);\n productRepository.save(productEntity);\n cartRepository.deleteRemovedFromCart(productId);\n }", "@Override\r\n\tpublic ProductMaster deleteProduct(int productId) {\n\t\tProductMaster productMaster = this.repository.findById(productId).orElseThrow(() -> new IllegalArgumentException(\"Invalid book Id:\" + productId));\r\n\t\tif(productMaster!=null)\r\n\t\t\tthis.repository.deleteById(productId);\r\n\t\treturn productMaster;\r\n\t}", "@RequestMapping(value=\"/deleteproducts/{id}\",method = RequestMethod.GET) \r\n public ModelAndView delete(@PathVariable int id){ \r\n \tSystem.out.println(\"delete is called\");\r\n productDao.deleteProducts(id);\r\n return new ModelAndView(\"redirect:/viewproducts\"); \r\n }", "public void delete(String id) {\n log.debug(\"Request to delete ProductSms : {}\", id);\n productSmsRepository.deleteById(id);\n }", "public int productDelete(Product product){\n int rowsAffected = 0;\n connect();\n String sql = \"DELETE FROM productos WHERE id_producto = ?\";\n \n try{\n PreparedStatement ps = connect.prepareStatement(sql);\n ps.setInt(1, Integer.parseInt(product.getProductId()));\n rowsAffected = ps.executeUpdate();\n connect.close();\n }catch(SQLException ex){\n ex.printStackTrace();\n }\n return rowsAffected;\n }", "@Override\n\tpublic void deleteById(int id) {\n\t\tProduct p = em.getReference(Product.class, id); \n\t\tem.remove(p);\n\t\t/*//JPQL simply translates into SQL queries, hence Cascade and Fetch will not work with queries. \n\t\t * //If te cascading was configured on teh database side, then query based operations can be used.\n\t\t * Query q = em.createQuery(\"delete from Product as p where p.id = :idparam\");\n\t\t * q.setParameter(\"idparam\", id); q.executeUpdate();\n\t\t */\n\t}", "public void delete(Integer id);", "public void delete(Integer id);", "public void delete(Integer id);", "public void delete(int id);", "@Override\n\tpublic int deleCartById(int id) {\n\t\treturn sqlSessionTemplate.delete(sqlId(\"deleteById\"),id);\n\t}", "public void delete(SgfensPedidoProductoPk pk) throws SgfensPedidoProductoDaoException;", "public void delete(String id);", "public void delete(String id);", "public void delete(String id);", "public void delete(String id);", "public void delete(String id);", "@Override\n\tpublic int delete(ProductDTO dto) {\n\t\treturn 0;\n\t}", "private void deleteProduct() {\n // Only perform the delete if this is an existing Product.\n if (mCurrentProductUri != null) {\n // Call the ContentResolver to delete the pet at the given content URI.\n // Pass in null for the selection and selection args because the mCurrentProductUri\n // content URI already identifies the pet that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentProductUri, null, null);\n\n // Show a toast message depending on whether or not the delete was successful.\n if (rowsDeleted == 0) {\n // If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, getString(R.string.editor_delete_product_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the delete was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_delete_product_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n // Close the activity\n finish();\n }", "boolean deleteProduct(ProductDTO productDTO, Authentication authentication);", "public void deleteById(String id);", "void delete(final Long id);", "@Override\n\tpublic int deleteFromLicenseOrderProductByPrimaryKey(Integer id) {\n\t\treturn licenseOrderProductMapper.deleteByPrimaryKey(id);\n\t}", "@DeleteMapping(\"/delete\")\r\n\tpublic ProductDetails deleteProduct(@Valid @RequestBody DeleteProduct request) {\r\n\t\treturn productUtil.toProductDetails(productService.deleteProduct(request.getProduct_Id()));\r\n\r\n\t}", "public void deleteProduct(Product product){\n\t\tdao.deleteProduct(product);\n\t}", "public void delete(Long id);", "public void delete(Long id);", "public void delete(Long id);", "public void delete(Long id);", "public void delete(Long id);", "void deleteById(Integer id);", "void deleteById(Integer id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "@DELETE\n @Path(\"{id:\\\\d+}\")\n public String eliminarProductora(@PathParam(\"id\") Long id) throws BusinessLogicException {\n LOGGER.log(Level.INFO, \"ProdcutoraResource eliminarcategoria: input: {0}\", id);\n CategoriaEntity entity = categoriaLogic.getCategoria(id);\n if (entity == null) {\n throw new WebApplicationException(\"El recurso /productoras/\" + id + \" no existe.\", 404);\n }\n categoriaLogic.borrarCategoria(id);\n LOGGER.info(\"ProduccionResource eliminarProduccion: output: void\");\n return \"Se borro exitosamente la categoria con id: \" + id;\n }", "public void deleteProductById(long id) {\n\t\tif(existById(id))\n\t\t\tadminCategoryRepoIF.deleteById(id);\n\t}", "void deleteById(int id);", "@Override\n\tpublic boolean deleteProductById(int[] idArray) {\n\t\treturn false;\n\t}", "@Override\n\t@Transactional // de escritura\n\tpublic void deleteById(Long id) {\n\t\tproductoDao.deleteById(id);\n\t}", "public boolean delete(int productId) {\n\t\treturn dao.delete(productId);\n\t}" ]
[ "0.9171445", "0.84613955", "0.83377355", "0.83112466", "0.8269032", "0.8240872", "0.82112134", "0.8173118", "0.81667584", "0.8104922", "0.80716956", "0.8047363", "0.80000013", "0.7975696", "0.7972366", "0.7947062", "0.7919945", "0.79101306", "0.7895886", "0.7893873", "0.783184", "0.7780804", "0.77640694", "0.7749649", "0.77022934", "0.769815", "0.7694489", "0.7692545", "0.76760346", "0.76756847", "0.76301545", "0.76102185", "0.7595766", "0.7581892", "0.7575958", "0.7574776", "0.7558694", "0.751224", "0.748909", "0.7479308", "0.7472028", "0.7469595", "0.7461882", "0.7452567", "0.74196124", "0.7410135", "0.7406058", "0.7399678", "0.7329958", "0.7314568", "0.72939664", "0.7284331", "0.7279585", "0.72660035", "0.7263203", "0.72605413", "0.7259709", "0.7252069", "0.7222628", "0.7222628", "0.7222628", "0.7203228", "0.7199382", "0.71961004", "0.7194746", "0.7194746", "0.7194746", "0.7194746", "0.7194746", "0.7188558", "0.7188443", "0.7149964", "0.7137259", "0.7137189", "0.71324784", "0.71313196", "0.7128926", "0.71269137", "0.71269137", "0.71269137", "0.71269137", "0.71269137", "0.7117168", "0.7117168", "0.71124506", "0.71124506", "0.71124506", "0.71124506", "0.71124506", "0.71124506", "0.71124506", "0.71124506", "0.71124506", "0.71124506", "0.7111331", "0.7109095", "0.71014386", "0.71002495", "0.7092494", "0.7089888" ]
0.88115484
1
TODO Autogenerated method stub System.out.println("FoodShopServiceimpl addFoodshop");
@Override public int addFoodshop(FoodshopVO vo) { return dao.insertFoodshop(vo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic int addshop(Shop shop) {\n\t\treturn dao.addshop(shop);\r\n\t}", "@Override\r\n\tpublic void AddShop(Shop shop) {\n\t\tSystem.out.println(\"-------ShopDaoImp.AddShop-----------\"\r\n\t\t\t\t+ shop.getName());\r\n\t\tgetSession().save(shop);\r\n\t}", "@Override\n\tpublic String addShop(Food f, int fsnu) {\n\t\treturn ob.addShop(f, fsnu);\n\t}", "public void addShop() {\n FacesContext context = FacesContext.getCurrentInstance();\n\n log.info(\"OrdersBean : AddShop\");\n\n int idAds = Integer.parseInt(getParam(\"adsId\"));\n\n if (idAds == 0) {\n context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, JsfUtils.returnMessage(getLocale(), \"fxs.addShopButton.addShopError\"), null));\n return;\n }\n\n adsBean.getAdsId(idAds);\n\n init();\n checkIfOrdersEntityIsNullAndCreateOrders();\n\n if (contractsBean.createContract()) {\n context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, JsfUtils.returnMessage(getLocale(), \"fxs.addShopButton.addShopSuccess\"), null));\n } else {\n context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, JsfUtils.returnMessage(getLocale(), \"fxs.addShopButton.addShopError\"), null));\n }\n findOrderAndfindContracts();\n }", "@Override\r\n\tpublic boolean addFoods(Food food) {\n\t\tString sql=\"INSERT INTO food(id, foodName, price, discount, num, salNum, des, logo, busId, state) VALUES (?,?,?,?,?,?,?,?,?,?)\"; \r\n\t\t\t\t\r\n\t\treturn BaseDao.execute(sql, food.getId(),food.getFoodName(),food.getPrice(),food.getDiscount(),food.getNum(),food.getSalNum(),food.getDes(),food.getLogo(),food.getBusId(),food.getState())>0;\r\n\t}", "public void addProduct(Product product);", "public void addToOrder(Food food){\n foods.add(food);\n price = price + food.getPrice();\n }", "public boolean addFood(Food food) {\n\t\tint i=foodDao.addFood(food);\r\n\t\tif(i > 0){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "com.soa.SolicitarServicioDocument.SolicitarServicio addNewSolicitarServicio();", "void addCatFood(Long catId, Long foodId);", "void addProduct(Product product);", "public void createFood() {\n }", "MealDto addMeal(MealDto meal, int restaurantId);", "@Override\r\n\tpublic boolean add(ServicesDto servicesDto) {\r\n\t\ttry {\r\n\t\t\t// add the category to database table\r\n\t\t\tsessionFactory.getCurrentSession().persist(servicesDto);\r\n\t\t\treturn true;\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Override\n\tpublic void add() {\n\n\t\tSystem.out.println(\"UserServiceImpl....\");\n\t\tthis.repository.respository();\n\n\t}", "void add(ProductCategory category);", "void addList(ShoppingList _ShoppingList);", "@Override\n\tpublic int add(Goods goods) {\n\t\treturn goodsDao.add(goods);\n\t}", "@Override\r\n\tpublic int insertNewShop(Shop shop) {\n\t\treturn sm.insert(shop);\r\n\t}", "public void addFood(Food food, double serving) {\n\t\t\n\t\tString foodName = food.getName();\n\t\t\n\t\tif (foodDetail.containsKey(foodName)) {\n\t\t\tif (foodPortion.get(foodName) + serving==0) {\n\t\t\t\tfoodPortion.remove(foodName);\n\t\t\t\tfoodDetail.remove(foodName);\n\t\t\t\tmeal.remove(foodName);\n\t\t\t} else {\n\t\t\t\tfoodPortion.put(foodName, foodPortion.get(foodName) + serving);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tmeal.add(foodName);\n\t\t\tfoodDetail.put(foodName, food);\n\t\t\tfoodPortion.put(foodName, serving);\n\t\t}\n\t}", "void addService(ServiceInfo serviceInfo);", "@Override\n\tpublic int add(FoodCategory foodCategory) {\n\t\treturn foodCategoryDao.add(foodCategory);\n\t}", "void addService(Long orderId, Long serviceId);", "public interface DrugShopService {\n// -- 表关系:\n// -- 药品商店\n\n//-- 1\n//-- (查询农药)\n public List<Drug> selectDrugList(Integer startNum, Integer cellCount) throws Exception;\n// -- userinfo drug person_drug\n\n// 显示总页数\n public Integer selectDrugCount() throws Exception;\n//\n// -- 2 显示后继页内容\n //同上\n//-- 3 点击后传送商品id\n public Drug selectDrugInfo(Integer drugId) throws Exception;\n//-- ` 查询商品信息是否存在(商品不存在)\n\n//-- ` 根据信息判断商品数量\n//-- ` 判断余额\n//-- 4 更新商品剩余数量\n public void updateDrugYpcount(Integer YpcountChange) throws Exception;\n//-- 8 插入背包\n public void insertDrugInfo(Drug drug) throws Exception;\n//-- 9 更新余额\n public void updateUserMoney(Integer uMoneyChange) throws Exception;\n}", "@PostMapping(value = \"/addEmployee\")\n\tpublic void addEmployee() {\n\t\tEmployee e = new Employee(\"Iftekhar Khan\");\n\t\tdataServiceImpl.add(e);\n\t}", "public void add(Product product) {\r\n sessionFactory.getCurrentSession()\r\n .save(product);\r\n }", "public void addIngredientRecipe(IngredientRecipePOJO ingr);", "@Override\r\n\tpublic void addProduct() {\n\r\n\t\ttry {\r\n\t\t\toos = new ObjectOutputStream(new FileOutputStream(\"pizza.txt\"));\r\n\t\t\r\n\t\t\tint flag = 1;\r\n\t\t\twhile (flag == 1) {\r\n\t\t\t\tSystem.out.println(\"Enter your Pid\");\r\n\t\t\t\tint pId = sc.nextInt();\r\n\t\t\t\tSystem.out.println(\"Enter your pname\");\r\n\t\t\t\tString pName = sc.next();\r\n\t\t\t\tSystem.out.println(\"Enter your pprice\");\r\n\t\t\t\tint pPrice = sc.nextInt();\r\n\t\t\t\tSystem.out.println(\"enter quantity\");\r\n\t\t\t\tint pqty = sc.nextInt();\r\n\t\t\t\tPizzaBean pb = new PizzaBean(pId, pName, pPrice, pqty);\r\n\t\t\t\tpizza.add(pb);\r\n\t\t\t\tSystem.out\r\n\t\t\t\t\t\t.println(\"Do you want to add one more record press 1 otherwise any number\");\r\n\t\t\t\tflag = sc.nextInt();\r\n\t\t\t}\r\n\t\t\t\toos.writeObject(pizza);\r\n\t\t\t\toos.flush();\r\n\t\t\t\toos.close();\r\n\t\t\t\tSystem.out.println(\"----Pizzas succesfully added----------\");\r\n\t\t}\r\n\t\t\t catch (IOException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t\r\n\t}", "public void Addproduct(Product objproduct) {\n\t\t\n\t}", "@Override\n\tpublic Equipment addEquipment(Equipment equipment, int idCat, int idFourn) {\n\t\treturn dao.addEquipment(equipment, idCat, idFourn);\n\t}", "public void addFood(Food food) {\n if (this.isSuitable(food)) {\n this.foods[position++] = food;\n }\n }", "public boolean addDish(int code, String name, String description, int price, String presentation, String image, String ingredients, String categorie) {\n Categories tempC = searchCategorie(categorie);\n if (verFood(code)) {\n Dish newDish = new Dish(code, name, description, price, presentation, image, ingredients);\n tempC.getListDish().add(newDish);\n return true;\n }\n return false;\n }", "public void agregar(Producto producto) throws BusinessErrorHelper;", "public void addShop(Shop shop,SQLiteDatabase db){\n ContentValues contentValues = new ContentValues();\n contentValues.put(ShopContract.ShopEntry.COLUMN_NAME_TYPE, shop.getType());\n contentValues.put(ShopContract.ShopEntry.COLUMN_NAME_MANAGER, shop.getManager());\n contentValues.put(ShopContract.ShopEntry.COLUMN_NAME_IMAGE, shop.getImagePath());\n contentValues.put(ShopContract.ShopEntry.COLUMN_NAME_LOCATION, shop.getLocation());\n contentValues.put(ShopContract.ShopEntry.COLUMN_NAME_PHONE, shop.getPhone());\n contentValues.put(ShopContract.ShopEntry.COLUMN_NAME_NAME, shop.getName());\n contentValues.put(ShopContract.ShopEntry.COLUMN_NAME_LICENSE, shop.getLicense());\n db.insert(ShopContract.ShopEntry.TABLE_NAME, null, contentValues);\n //return newRowId;\n }", "x0401.oecdStandardAuditFileTaxPT1.ProductDocument.Product addNewProduct();", "@PostMapping(\"/customers\")\n public void addCustomer(@RequestBody CustomerHibernate theCustomerHibernate) {\n //this is to force a save for a new item .... instead of update\n\n theCustomerHibernate.setId(0);\n\n customerService.save(theCustomerHibernate);\n }", "@Override\n\tpublic String addFood(String fname, double fprice, int typeid) {\n\t\treturn fb.addFood(fname, fprice, typeid);\n\t}", "public interface ShopService {\n\n\t//根据ID查询\n\tpublic Shop findById(Long id);\n\t\n\t//根据网点编号查询\n\tpublic Shop findByShopNo(String shopNo);\n\n\t//创建\n\tpublic Shop create(Shop shop);\n\t\n\t//更新\n\tpublic Shop update(Shop shop);\t\n\t\n}", "public void addProduct(Product p) {\n c.addProduct(p);\n }", "@Override\n\tpublic void insertarServicio(Servicio nuevoServicio) {\n\t\tservicioDao= new ServicioDaoImpl();\n\t\tservicioDao.insertarServicio(nuevoServicio);\n\t\t\n\t\t\n\t}", "public void addBusiness(String name, String fiscalCode, String partitaIva) {\n//public void addBusiness(String name, String fiscalCode, String partitaIva, String Category) {\n\t\tBusiness business = new Business();\n\t\tbusiness.setName(name);\n\t\tbusiness.setFiscalCode(fiscalCode);;\n\t\tbusiness.setPIva(partitaIva);\n\t//\tList<String> categories = new ArrayList<String>();\n\t//\tcategories.add(Category);\n\t//\tbusiness.setCategories(categories);\n // longitudine e latitudine\n\t\tbusiness.setPosition(48.32222, 32.222222);\n\n\t\tMap<String, Object> ret = _businessService.createBusiness(business);\n\t\tbusiness = null;\n\t\tbusiness = (Business) ret.get(\"business\");\n\t\tif (business != null) {\n\t\t\tSystem.out.println(\"ADD business_Id\" + business.get_id());\n\t\t}\n\t\tfor (Map.Entry<String, Object> entry : ret.entrySet())\n\t\t\tSystem.out.println(entry.getKey() + \" - \" + entry.getValue().toString());\n\n\t\tSystem.out.println(\"called shell command 'createBusiness' - created: \" + (Boolean) ret.get(\"created\"));\n\t}", "@PostMapping(\"/add\")\r\n\tpublic ProductDetails addProduct(@Valid @RequestBody AddProduct request) {\r\n\r\n\t\tProduct product = productUtil.getProduct();\r\n\t\tproduct.setProduct_Id(productUtil.generateId());\r\n\t\tproduct.setProduct_Name(request.getProduct_Name());\r\n\t\tproduct.setProduct_Price(request.getProduct_Price());\r\n\t\tproduct.setProduct_Quantity(request.getProduct_Quantity());\r\n\t\tproduct.setProduct_Availability(request.isProduct_Availability());\r\n\t\tproduct = productService.addProduct(product);\r\n\t\treturn productUtil.toProductDetails(product);\r\n\r\n\t}", "@Override\r\n\tpublic int add(Product product) throws Exception {\n\t\treturn this.dao.add(product);\r\n\t}", "public void addFacility(Facility someFacility);", "void addFruit(Fruit item){\n\t\tfruitList.add(item);\n\t}", "public void add(Goods goods) {\n\t\tsm.insert(\"com.huyu.entity.Goods.add\", goods);\n\t}", "public void insertFood(String rest_id,String restName, String FoodName, String category, String ratting, String price) {\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"rest_id\",rest_id);\n contentValues.put(\"restName\", restName);\n contentValues.put(\"name\", FoodName);\n contentValues.put(\"category\", category);\n contentValues.put(\"price\", price);\n contentValues.put(\"ratting\", ratting);\n\n long isInsert = database.insert(AppConstant.FOOD_TABLE_NAME, null, contentValues);\n if (isInsert == -1) {\n Toast.makeText(context, \"Food item failed to register.\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(context, \"Food item registered successfully.\", Toast.LENGTH_SHORT).show();\n }\n }", "public addproduct() {\n\t\tsuper();\n\t}", "public ShopService(String name)\n\t{\n\t\tthis.name = name;\n\t}", "Product addOneProduct(String name, String imgNameBarcode, String imgName, String barcode) throws Exception;", "@Test\r\n public void createFoodCategory() {\r\n repo = ctx.getBean(FoodCategoryRepository.class);\r\n// MainMeal meal= new MainMeal.Builder(\"Pap and Vors\")\r\n// .Amountprice(79000)\r\n// .build();\r\n FoodCategory cat= new FoodCategory.Builder(\"Gatsby\")\r\n .build();\r\n repo.save(cat);\r\n id = cat.getId(); \r\n Assert.assertNotNull(cat);\r\n \r\n \r\n }", "public interface AddStudentBookOrderPackageService extends EntityService<StudentBookOrderPackage> {\n public StudentBookOrderPackage addStudentBookOrderPackage(String spotCode, String orderCodes, String logisticCode, int isNoce, String loginName)throws Exception;\n}", "com.synergyj.cursos.webservices.ordenes.XMLBFactura addNewXMLBFactura();", "@Override\r\n public JSONObject addFood(JSONObject input) {\r\n //Lay thong tin\r\n int userId = (Integer) input.get(\"userId\");\r\n int foodId = (Integer) input.get(\"foodId\");\r\n Date dateAdded = (Date) input.get(\"dateAdded\");\r\n Date dateExpired = (Date) input.get(\"dateExpired\");\r\n boolean isNotify = (Boolean) input.get(\"isNotify\");\r\n\r\n Refrigerator refrigerator = new Refrigerator();\r\n refrigerator.setUserID(userId);\r\n refrigerator.setFoodID(foodId);\r\n refrigerator.setDateAdded(dateAdded);\r\n refrigerator.setDateExpired(dateExpired);\r\n refrigerator.setIsNotify(isNotify);\r\n\r\n em.persist(refrigerator);\r\n\r\n //Tra ket qua??????????\r\n JSONObject result = new JSONObject();\r\n result.put(\"result\", \"Added\");\r\n return result;\r\n }", "public void insert(Service servico){\n Database.servico.add(servico);\n }", "@Override\n\tpublic void insertProduct(ProductVO dto) {\n\n\t}", "public interface GoodsTypeService {\n /**\n * 更新商品类型\n *\n * @param gtn\n * @return\n */\n public int updateGoodsTypeTN(GoodsType gtn);\n /**\n * 添加商品规格关系\n * @param goodsType\n * @return\n */\n public int addGoodsType(GoodsType goodsType);\n}", "Integer addUser(ServiceUserEntity user);", "public void add() {\n\n }", "void add(Lugar lugar);", "public abstract T addService(BindableService bindableService);", "boolean add(DishCategory dishCategory );", "public interface ShopService {\n void insertShop(Shop record, String leverLength);\n void insertNewShop(Shop record);\n List<AdminShopVo> adminListShop(String id);\n List<AdminShopVo> adminListNewShop(String id);\n PageResult<AppShopVo> appListShop(ShopParam shopParam,String uid);\n PageResult<Shop> appListNewShop(ShopParam shopParam);\n PageResult<Shop> appListNewShop1(ShopParam shopParam);\n List<User> listUser();\n AppMerchantsVo selectMerchant(String id);\n AppMerchantsVo selectNewMerchant(String id);\n List<Shop> listMerchant(String userid);\n //\n void modifyShopAttribute(String id,Integer type,Integer sign);\n List<MerchantVo> listmerchantvo();\n void updateShopPrice(String shopid,Integer nodelever,String price);\n void updateByPrimaryKeySelective(Shop shop);\n Shop selectShop(String uid,String shopid);\n Shop selectShop(String shopid);\n //void updateNewShop(Shop record);\n Shop selectShopDetail(String id);\n Shop selectShopDetail(String id,String uid);\n\n}", "public abstract T addService(ServerServiceDefinition service);", "public int addSale(SaleVO vo) {\n\t\treturn sale.Add(vo);\r\n\t}", "public void newFood(Food food) {\n\t\t\n\t\tfoodDao.newFood(food);\n\t\t\n\t}", "public void addShopEndLeasing() {\n log.info(\"OrdersBean : addShopEndLeasing\");\n FacesContext context = FacesContext.getCurrentInstance();\n int idContract = Integer.parseInt(getParam(\"idContract\"));\n init();\n checkIfOrdersEntityIsNullAndCreateOrders();\n\n if (contractsBean.createContractEndLeasing(idContract)) {\n context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, JsfUtils.returnMessage(getLocale(), \"fxs.addShopButton.addShopSuccess\"), null));\n } else {\n context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, JsfUtils.returnMessage(getLocale(), \"fxs.addShopButton.addShopError\"), null));\n }\n findOrderAndfindContracts();\n }", "public void add(Good good) {\n cargo.add(good);\n numOfGoods++;\n }", "@CrossOrigin(origins = \"http://localhost:8000\")\n @ApiOperation(value = \"Add a new order\", response = PizzaOrder.class, produces = \"application/json\")\n @RequestMapping(value = \"/orders\", method = RequestMethod.POST, consumes = \"application/json\")\n public PizzaOrder addPizzaOrder(\n @ApiParam(value = \"New pizza order to add\", required = true) @RequestBody PizzaOrder pizzaOrder) {\n\t\t \n\tlogger.info(\"TrackingId:89a80896-35a4-468c-9ec3-b762ab161429|ClientId:89a80897-35a4-468c-9ec3-b762ab161429|Pizza Ordered : {}\",pizzaOrder.getId());\t \n return pizzaOrderService.addOrder(pizzaOrder);\n }", "@Override\r\n\tpublic void add(Goods goods) {\n\t\tgd.addGoods(goods);\r\n\t\tgd.addGb(goods.getId(),goods.getBid());\r\n\t\tgd.addGt(goods.getId(),goods.getTid());\r\n\t}", "private void addProduct()\n {\n System.out.println(\"|➕| Add new Product:\\n\");\n System.out.println(\"|➕| Enter ID\\n\");\n int id = Integer.parseInt(reader.getInput());\n System.out.println(\"|➕| Enter Name\\n\");\n String name = reader.getInput();\n manager.addProduct(id, name);\n }", "public void addFood(int quantity) {\n if (quantity > 0) {\n this.food += quantity;\n System.out.printf(\"\\u001B[34mINFO:\\u001B[0m %d of food added.\\n\", quantity);\n } else {\n System.out.println(\"\\u001B[34mINFO:\\u001B[0m There are no food to add.\");\n }\n }", "@RequestMapping(value = \"/food/add\", method = RequestMethod.POST)\n\tpublic String add(HttpServletRequest request, Map<String, Object> model) throws JsonProcessingException {\n\t\tFood food = new Food(request.getParameter(\"name\"), request.getParameter(\"brand\"),\n\t\t\t\trequest.getParameter(\"quality\"), request.getParameter(\"type\"));\n\t\tList<Food> foods = foodService.findAll();\n\t\tfoodService.add(food);\n\n\t\tmodel.put(\"foods\", foods);\n\n\t\tmodel.put(\"types\", Food.TYPE.values());\n\t\tmodel.put(\"qualities\", Food.QUALITY.values());\n\t\tmodel.put(\"qualitycounts\", mapper.writeValueAsString(foodService.qualityCounts(foods)));\n\n\t\treturn \"index\";\n\t}", "public void addEmployee(Employee emp) {\n\t\t\r\n\t}", "public void addToSale(ItemDTO item, int quantity){\n this.saleInfo.addItem(item, quantity);\n }", "public void AddDep(Department dep) {\n\t\tddi.Add(dep);\n\t\t\n\t}", "@Override\r\n\tpublic boolean addProduct(ProductDAO product) {\n\t\treturn false;\r\n\t}", "private void add() {\n\n\t}", "Product addNewProductInStore(Product newProduct);", "@Override\r\n\tpublic void addDepartment(Department department) {\n\r\n\t\tgetHibernateTemplate().save(department);\r\n\t}", "void registerGoods(Goods goods, int quantity) throws StoreKeeperWorkException;", "@RequestMapping(\n method = RequestMethod.POST,\n consumes = MediaType.APPLICATION_JSON_VALUE,\n path = \"{productId}\"\n )\n public void addProductToShoppingCart(@PathVariable(\"productId\") UUID productId){\n shoppingCartService.insertProduct(productId);\n }", "public void add() {\n }", "ProductView addProduct(ProductBinding productToAdd) throws ProductException;", "public void addItemToSale(String productId, int quantity) {\r\n if (productId.isEmpty()) {\r\n System.out.println(\"Class CashRegister, method addItemToSale\");\r\n System.out.println(\"product id is missing - enter valid product id\");\r\n System.exit(1);\r\n }\r\n if (quantity <= 0) {\r\n System.out.println(\"Class CashRegister, method addItemToSale\");\r\n System.out.println(\"quantity is less than or equal to 0 - enter valid quantity\");\r\n System.exit(1);\r\n }\r\n FakeDatabase db = new FakeDatabase();\r\n Product product = db.findProduct(productId);\r\n\r\n if (product != null) { //product found in database\r\n receipt.addLineItem(product, quantity);\r\n } else {\r\n System.out.println(\"Class CashRegister, method addItemToSale\");\r\n System.out.println(\"product id not found in database - enter valid product id\");\r\n System.exit(1);\r\n }\r\n }", "public void addService(String serviceName, CheckBox dateOfBirth, CheckBox address, CheckBox typeOfLicense,\n CheckBox proofOfResidence, CheckBox proofOfStatus, CheckBox proofOfPhoto, double servicePrice) {\n DatabaseReference dR;\n dR = FirebaseDatabase.getInstance().getReference(\"ServiceRequests\");\n\n Service serviceRequest = new ServiceCategories(serviceName, dateOfBirth.isChecked(), address.isChecked(),\n typeOfLicense.isChecked(), proofOfResidence.isChecked(), proofOfStatus.isChecked(),\n proofOfPhoto.isChecked(), servicePrice);\n dR.child(serviceName).setValue(serviceRequest);\n\n }", "public void add() {\n\t\t\n\t}", "net.webservicex.www.WeatherForecasts addNewWeatherForecasts();", "@Override\n @Transactional\n public HotelResponseDTO addReview(String hotelId, AddReviewRequestDTO addReviewRequest) {\n Optional<Hotel> optionalHotel = hotelRepository.findByHotelId(hotelId);\n Hotel hotel = optionalHotel.orElseThrow(() -> {\n logger.error(\"Hotel information not found | hotelId:{}\", hotelId);\n return new BookingServiceException(\"Hotel information not found | hotelId:\" + hotelId);\n });\n if (hotel.isDeleted()) {\n logger.info(\"Hotel is inactive | hotelId:{}\", hotelId);\n throw new BookingServiceException(\"Hotel is inactive | hotelId:\" + hotelId);\n }\n Review review = new Review();\n String generatedReviewId = CommonUtil.getGeneratedId();\n review.setReviewId(generatedReviewId);\n review.setHotel(hotel);\n review.setComment(addReviewRequest.getComment());\n review.setRatingValue(addReviewRequest.getRatingValue());\n Optional<User> optionalUser = userRepository.findByUserId(addReviewRequest.getUserId());\n optionalUser.ifPresent(review::setReviewedBy);\n Date reviewedDate = new Date();\n review.setReviewedDate(reviewedDate);\n review.setDeleted(false);\n reviewRepository.save(review);\n logger.info(\"Created hotel review information successfully | hotelId:{}\", hotelId);\n return makeHotelResponseDTO(hotel);\n }", "@Test\n public void testAddItem() throws Exception {\n System.out.println(\"addItem\");\n Orcamentoitem orcItem = null;\n EJBContainer container = javax.ejb.embeddable.EJBContainer.createEJBContainer();\n OrcamentoService instance = (OrcamentoService)container.getContext().lookup(\"java:global/classes/OrcamentoService\");\n instance.addItem(orcItem);\n container.close();\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public void addFood(View view) {\n\t\tContext context = getApplicationContext();\n\t\tif (foodName.isEmpty()) {\n\t\t\tCharSequence text = \"Select a food\";\n\t\t\tint duration = Toast.LENGTH_SHORT;\n\n\t\t\tToast toast = Toast.makeText(context, text, duration);\n\t\t\ttoast.show();\n\t\t} else if (location.isEmpty()) {\n\t\t\tCharSequence text = \"Select a location\";\n\t\t\tint duration = Toast.LENGTH_SHORT;\n\n\t\t\tToast toast = Toast.makeText(context, text, duration);\n\t\t\ttoast.show();\n\t\t} else {\n\t\t\t// Valid input, package name and location and send back array to\n\t\t\t// stockactivity\n\t\t\tIntent resultIntent = new Intent();\n\t\t\tresultIntent.putExtra(\"foodName\", foodName);\n\t\t\tresultIntent.putExtra(\"location\", location);\n\t\t\tsetResult(Activity.RESULT_OK, resultIntent);\n\t\t\tfinish();\n\t\t overridePendingTransition(R.anim.fade_in, R.anim.fade_out);\n\t\t}\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n RequestDispatcher dispatcher = request.getRequestDispatcher(\"article/create/success.jsp\");\n\n Article article = new Article();\n Shelf shelf = new Shelf();\n List<Shelf> shelfs = new ArrayList<>();\n Context context = null;\n ArticleServiceItf articleServices = null;\n ShelfServiceItf shelfService = null;\n\n try {\n context = new InitialContext();\n shelfService = (ShelfServiceItf) context.lookup(\"java:global/ShelfService\");\n shelf = shelfService.findShelfById(Integer.valueOf(request.getParameter(\"productShelf\")));\n shelfs = shelfService.findAll();\n\n article.setName(request.getParameter(\"productName\"));\n article.setPicturelink(request.getParameter(\"productImage\"));\n article.setBrand(request.getParameter(\"productBrand\"));\n article.setPrix(Float.valueOf(request.getParameter(\"productPrice\")));\n article.setShelf(shelf);\n System.out.println(\"DEBUG productBrand set to: \" + request.getParameter(\"productBrand\"));\n articleServices = (ArticleServiceItf) context.lookup(\"java:global/ArticleService\");\n } catch (Exception e) {\n dispatcher = request.getRequestDispatcher(\"article/create/error.jsp\");\n request.setAttribute(\"error\", e);\n dispatcher.forward(request, response);\n }\n\n //On utilise un Validator afin de vérifier que notre objet Article est en phase avec les contraintes\n ValidatorFactory factory = Validation.buildDefaultValidatorFactory();\n Validator validator = factory.getValidator();\n Set<ConstraintViolation<Article>> constraintViolationSet = validator.validate(article);\n\n if(constraintViolationSet.isEmpty()) {\n //Pas d'erreurs après vérification, on peut persister l'objet\n try {\n articleServices.addArticle(article);\n dispatcher.forward(request, response);\n } catch (ArticleException e) {\n dispatcher = request.getRequestDispatcher(\"article/create/error.jsp\");\n request.setAttribute(\"error\", e);\n dispatcher.forward(request, response);\n }\n }\n else {\n //Une ou plusieurs erreurs pendant la vérification. On informe l'utilisateur\n dispatcher = request.getRequestDispatcher(\"admin/create-article.jsp\");\n request.setAttribute(\"errors\", constraintViolationSet);\n request.setAttribute(\"shelfs\", shelfs);\n dispatcher.forward(request, response);\n }\n }", "@Service\npublic interface RestaurantService {\n\n void save();\n\n}", "@Override\r\n\tpublic int insert(shopPet t) {\n\t\treturn dao.insert(t);\r\n\t}", "@Override\n\tpublic void insertUserAndShopData() {\n\t\t\n\t}", "@Override\n\tpublic void add(Discount discount) {\n\t\t\n\t}", "void add(Order o);", "public AddFavouriteService() {\n super(\"AddFavouriteService\");\n }", "@RequestMapping(value=\"/add\", method = RequestMethod.POST)\r\n public void addAction(@RequestBody Reservation reservation){\n reservationService.create(reservation);\r\n }", "@CrossOrigin(origins = \"http://localhost:8081\")\n @PostMapping(path=\"/add\") // path name after '/option'\n public @ResponseBody ResponseEntity<MenuOp> addNewOption (@RequestParam String menuid , @RequestParam String name\n , @RequestParam String price) {\n\n //check if the id for the item exists, assigning values tot he new menu option if exists\n Integer m = Integer.valueOf(menuid);\n if( menuRepository.existsById(m)) {\n LOG.info(\"Name: {}, Price: {}\", name, price);\n MenuOp menuOp = new MenuOp();\n menuOp.setMenuid(menuid);\n menuOp.setName(name);\n menuOp.setPrice(price);\n\n //save the menu option in the repository, return response entity\n menuOpRepository.save(menuOp);\n return ResponseEntity.ok(menuOp);\n }else{\n return (ResponseEntity<MenuOp>) ResponseEntity.badRequest();\n }\n }" ]
[ "0.70184577", "0.688535", "0.68615097", "0.6786287", "0.6620852", "0.65936905", "0.65631616", "0.6547774", "0.6514246", "0.6503919", "0.6467871", "0.63904923", "0.6174403", "0.61126864", "0.60864884", "0.6080103", "0.6070931", "0.6025893", "0.6007093", "0.6005991", "0.6001075", "0.5999491", "0.5981316", "0.5947747", "0.591586", "0.5902466", "0.5894367", "0.5882896", "0.5877524", "0.5873614", "0.58670944", "0.5846045", "0.58386505", "0.58368564", "0.58184963", "0.5811627", "0.5809141", "0.57993764", "0.5793181", "0.57884043", "0.57776874", "0.5771895", "0.57698363", "0.57634544", "0.5753108", "0.57400155", "0.57361645", "0.57146955", "0.571364", "0.57134926", "0.5708766", "0.57041574", "0.569545", "0.56954294", "0.5694259", "0.5693969", "0.5693414", "0.5678989", "0.567137", "0.566905", "0.5661028", "0.5654691", "0.56465715", "0.564612", "0.5644503", "0.5639959", "0.56392723", "0.56187034", "0.56104654", "0.560958", "0.5603242", "0.55978805", "0.55973625", "0.5595456", "0.5589502", "0.55861086", "0.5584412", "0.5574657", "0.5574124", "0.55709326", "0.5557564", "0.55563635", "0.5553728", "0.55468684", "0.5546836", "0.55461884", "0.5543744", "0.55384254", "0.553796", "0.5533937", "0.55326957", "0.55262685", "0.55252856", "0.5523721", "0.55227405", "0.5519655", "0.55156547", "0.5511058", "0.5510592", "0.55101866" ]
0.80972224
0
TODO Autogenerated method stub
@Override public int discountsearch(FoodshopVO vo) { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public int locsearch(FoodshopVO vo) { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Logs a user in with its password
public String logInUser(Long userId) { return TokenAuthService.addBearer(tokenAuthService.createTokenForUser(userId)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User logInUser(final String login, final String password);", "void login(String user, String password);", "public void login() {\n\t\tUser user = new User(\"admin\", \"12345678\", Role.ADMIN);\n\t\tuser.setEmail(\"[email protected]\");\n\t\t\n\t\tif(user != null) {\n\t\t\tuserBean.setLoggedInUser(user);\n\t\t\tFacesContext context = FacesContext.getCurrentInstance();\n\t\t\tHttpServletRequest req = (HttpServletRequest)context.getExternalContext().getRequest();\n\t\t\treq.getSession().setAttribute(ATTR_USER, user);\n\t\t}else{\n\t\t\tkeepDialogOpen();\n\t\t\tdisplayErrorMessageToUser(\"Wrong Username/Password. Try again\");\n\t\t}\n\t\t\n\t}", "public void signIn(String userName, String password) {\n\t}", "User login(String username, String password);", "private void login(String username,String password){\n\n }", "public void login(User user);", "public static void logIn(String user, String password) {\n clear(USERNAME_FIELD);\n type(USERNAME_FIELD, user);\n clear(PASSWORD_FIELD);\n type(PASSWORD_FIELD, password);\n click(LOGIN_BUTTON);\n }", "User signIn(String login, String password);", "private void logIn() throws IOException {\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n String line = reader.readLine();\n String[] a = line.split(\";\");\n\n String user = a[0];\n String password = a[1];\n boolean rez = service.checkPassword(user, password);\n if(rez == TRUE)\n System.out.println(\"Ok\");\n else\n System.out.println(\"Not ok\");\n }", "public void logIn(String username, String password) {\n\t\t// Validate input\n\t\tif (username == null) throw new IllegalArgumentException(\"Username cannot be null\");\n\t\tif (password == null) throw new IllegalArgumentException(\"Password cannot be null\");\n\t\t\n\t\t// Keep these at bay\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t\tthis.temporarySession = new SessionImpl();\n\t\tthis.temporarySession.setDB(new ConnectDB());\n\t\tthis.temporarySession.setLoggedIn(true);\n\t\tthis.session = new SessionImpl();\n\t\t\n\t\t// Lets load the user data.. maybe there is no user...\n\t\tloadUser();\n\n\t\t// The generated hash for the given username and password, including the new salt\n\t\tgeneratedHash = generateNewHash();\n\n\t\t// Set the session logging status to the outcome of this action.\n\t\tthis.session.setLoggedIn(isSamePass(user.getPassword()));\n\n\t\t// Grant DB access only if logged in.\n if ( this.session.isLoggedIn() ) {\n \t// Grant DB access\n \tthis.session.setDB(new ConnectDB());\n \t\n \t// Set the user to the session.\n \tthis.session.setUser(user);\n \t\n \t// Load all user privileges.\n \t\tloadUserPrivileges();\n \t\tthis.session.setUserPrivileges(userPrivilege);\n }\n\t}", "public void login() {\n try {\n callApi(\"GET\", \"account/session\", null, null, true);\n } catch (RuntimeException re) {\n\n }\n\n Map<String, Object> payload = new HashMap<>();\n payload.put(\"name\", \"admin\");\n payload.put(\"password\", apiAdminPassword);\n payload.put(\"remember\", 1);\n\n callApi(\"POST\", \"account/signin\", null, payload, true);\n }", "public int logIn() {\n guestPresenter.printLogInMessage();\n int id = requestInt(\"id\");\n char[] password = requestString(\"password\").toCharArray();\n UserManager.UserType user = guestManager.logIn(id, password);\n\n if (user == null) {\n guestPresenter.logInFailure();\n return -1;\n } else {\n return id;\n }\n }", "public User login(String loginName, String password) throws UserBlockedException;", "LoginContext login(String username, String password) throws LoginException;", "@When(\"^User login into the app with username and password$\")\n\tpublic void user_login_to_the_app_with_username_and_password() {\n\t\tSystem.out.println(\"User is logged\");\n\t}", "public void login(String uname, String pwd) {\n username.type(uname);\n password.type(pwd);\n loginButton.click();\n }", "private void logIn() {\n char[] password = jPasswordField1.getPassword();\n String userCode = jTextField1.getText();\n\n String txtpassword = \"\";\n for (char pw : password) {\n txtpassword += pw;\n }\n if (\"\".equals(txtpassword)) {\n JOptionPane.showMessageDialog(this, textBundle.getTextBundle().getString(\"enterPassword\"), \"No Password\", JOptionPane.WARNING_MESSAGE);\n } else if (txtpassword.equals(userData.get(0).toString())) {\n jPasswordField2.setEnabled(true);\n jPasswordField3.setEnabled(true);\n jPasswordField2.setEditable(true);\n jPasswordField3.setEditable(true);\n jPasswordField2.grabFocus();\n }\n }", "void login(String cuid, String pass)\n throws RemoteException;", "public void login() {\n if (!areFull()) {\n return;\n }\n\n // Get the user login info\n loginInfo = getDBQuery(nameField.getText());\n if (loginInfo.equals(\"\")) {\n return;\n }\n\n // Get password and check if the entered password is true\n infoArray = loginInfo.split(\" \");\n String password = infoArray[1];\n if (!passField.getText().equals(password)) {\n errorLabel.setText(\"Wrong Password!\");\n return;\n }\n\n continueToNextPage();\n }", "@WebMethod public boolean logIn(String userName, String password);", "@When(\"^The user logs in \\\"([^\\\"]*)\\\" and \\\"([^\\\"]*)\\\"$\")\r\n\tpublic void the_user_logs_in(String username, String password) throws Throwable {\n\t\tfaceAgile.login(username, password);\r\n\t}", "public void loginTo(String strUserName,String strPasword)\n { \n if(strUserName.equals(\"\"))\n \tthis.getUserName().clear();\n \n if(strPasword.equals(\"\"))\n \tthis.getPassword().clear();\n \n \n \tthis.getUserName().sendKeys(strUserName); \n\n this.getPassword().sendKeys(strPasword); \n\n this.getLoginButton().click(); \n }", "void loginAttempt(String email, String password);", "public void login(String username, String password, Context context) {\n\t\tUserVO userVO = new UserVO();\n\t\tuserVO.setId(username);\n\t\tuserVO.setPassword(password);\n\t\t\n\t\tLoginTask loginTask = new LoginTask();\n\t\tloginTask.setContext(context);\n\t\tloginTask.execute(userVO);\n\t}", "public void loginAsTom() {\n textFieldUsername.withTimeoutOf(2000, MILLIS).type(\"tomsmith\");\n textFieldPassword.type(\"SuperSecretPassword!\");\n buttonLogin.click();\n }", "@Override\n public boolean userLogin(String username, String password) \n {\n User tmpUser = null;\n tmpUser = getUser(username);\n if(tmpUser == null) return false;\n if(tmpUser.getPassword().equals(password)) return true;\n return false;\n }", "public void login () {\n\t\tGPPSignIn.sharedInstance().authenticate();\n\t}", "protected Response login() {\n return login(\"\");\n }", "public int login(String username, String password) \n {\n\treturn this.acctCtrl.login(username, password);\n\n }", "protected void login() {\n\t\t\r\n\t}", "User login(String email, String password) throws AuthenticationException;", "public void doLogin() {\r\n\t\tif(this.getUserName()!=null && this.getPassword()!=null) {\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"Select idUser,nom,prenom,userName,type,tel from t_user where userName=? and pass=? and status=?\");\r\n\t\t\t\tps.setString(1, this.getUserName());\r\n\t\t\t\tps.setString(2, this.getPassword());\r\n\t\t\t\tif(rs.next()) {\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"idUser\", rs.getInt(\"idUser\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"nom\", rs.getString(\"nom\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"prenom\", rs.getString(\"prenom\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"userName\", rs.getString(\"userName\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"type\", rs.getString(\"type\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"tel\", rs.getString(\"tel\"));\r\n\t\t\t\t\tFacesContext.getCurrentInstance().getExternalContext().redirect(\"view/welcome.xhtml\");\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tnew Message().error(\"echec de connexion\");\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tnew Message().warnig(\"Nom d'utilisateur ou mot de passe incorrecte\");\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic user login(String name, String pwd) {\n\t\treturn userM.login(pwd,name);\r\n\t\t\r\n\t}", "public void Login(String userName, String password) \n\t{\n\t\ttxtUserName.sendKeys(userName);\n\t\ttxtPassword.sendKeys(password);\n\t}", "public User doAuthentication(String account, String password);", "public String signIn(String username, String password);", "void login(String email, String password) throws InvalidCredentialsException, IOException;", "public abstract void login(String userName, String password) throws RemoteException;", "public Integer logIn(String u_name, String u_pw){\n //find entry with u_name = this.u_name\n //probably not so safe\n //getting user with index 0 because getUserFromUsername returns List\n User user = userDao.getUserFromUsername(u_name).get(0);\n //print at console\n LOGGER.info(\"User: \" + user);\n //returns integer 1 if user.get_pw equals to this.pw or 0 if not\n if (user.getU_Pw().equals(u_pw)){\n return user.getU_Id();\n }else{\n return 0;\n }\n }", "public void login(String email,String password) {\r\n\t\tthis.setChanged();\r\n\t\tthis.notifyObservers(STATE_LOGGING_IN);\r\n\t\tUser.server_login(email, password, new Callable()\r\n\t\t{\r\n\t\t\t@Override\r\n\t\t\tpublic void callback(final Object d) {\r\n\t\t\t\tif(d == null) {\r\n\t\t\t\t\tsetChanged();\r\n\t\t\t\t\tnotifyObservers(STATE_LOGIN_FAIL);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tsetChanged();\r\n\t\t\t\t\r\n\t\t\t\t// do some debug action after logged in\r\n\t\t\t\tServer.server_do_debug();\r\n\t\t\t\t\r\n\t\t\t\tnotifyObservers(STATE_LOGIN_SUCCESS);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}", "public Person login(String username, String password);", "@Override\n\tpublic User login(String user, String pass) {\n\t\treturn null;\n\t}", "public static int logIn(String userName, String password, String token) throws ClassNotFoundException, SQLException { \n String[] name = {userName};\n String[] pk = {userPK};\n List<user> tempU = selectUser(pk, name);\n if(tempU.isEmpty()) {\n return -2;\n }\n else if(tempU.get(0).getPassWord().equals(encytp(password))) {\n String[] temp = {token, userName};\n String[] restriction = {VERTIFY};\n updateUser(restriction, temp);\n return 0;\n }\n else {\n return -1;\n }\n }", "User login(Uuid id, String username, String password, Time creationTime);", "String signIn(String userName, String password) throws UserNotFoundException;", "@Override\n\tpublic MemberDTO login(String id, String passwd) {\n\t\treturn adminDao.login(id, passwd);\n\t}", "public String login(String username, String password){\n return login.login(username, password);\n }", "private void byPassLogin(String email) {\n User user = new User(123, email, Grade.A, 100, 9999991, 50f, 25f);\n Login(user);\n }", "public void login(String email, String password){\n User user = new User(email);\n if (user.exists()){\n //------------\n user.setPassword(getMd5(password)); // this should not be here in final product, only for demonstration\n //------------\n if(user.passwordMatch(getMd5(password))){\n //logs person in\n System.out.println(\"ok\");\n }\n }\n }", "public void login() {\n\t\tloggedIn = true;\n\t}", "public void doLogin(String userName,String password) {\n\t\tenterText(usernamelocator, userName);\n\t\tenterText(passwordlocator, password);\n\t\tclick(loginButton);\n\t}", "public void doLogin(String username, String password) {\n typeUsername(username);\n typePassword(password);\n clickLoginButton();\n }", "public void login() {\n\n String username = usernameEditText.getText().toString();\n String password = passwordEditText.getText().toString();\n regPresenter.setHost(hostEditText.getText().toString());\n regPresenter.login(username, password);\n }", "@Override\n\tpublic void loginUser() {\n\t\t\n\t}", "public String login() {\n try {\n HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n request.login(name, password);\n initUser();\n request.getSession().setAttribute(\"current_user\", this);\n return \"/index?faces-redirect=true\";\n } catch (ServletException e) {\n FacesContext context = FacesContext.getCurrentInstance();\n FacesMessage message = new FacesMessage(\"Wrong login or password\");\n message.setSeverity(FacesMessage.SEVERITY_ERROR);\n context.addMessage(\"login\", message);\n }\n return \"/pages/login.xhtml\";\n }", "public void loginAsUser() {\n vinyardApp.navigateToUrl(\"http://localhost:8080\");\n vinyardApp.fillUsername(\"user\");\n vinyardApp.fillPassord(\"123\");\n vinyardApp.clickSubmitButton();\n }", "public void LogIn() {\n\t\t\r\n\t}", "private void login() {\n AnonimoTO dati = new AnonimoTO();\n String username = usernameText.getText();\n String password = passwordText.getText();\n\n if (isValidInput(username, password)) {\n dati.username = username;\n dati.password = password;\n\n ComplexRequest<AnonimoTO> request =\n new ComplexRequest<AnonimoTO>(\"login\", RequestType.SERVICE);\n request.addParameter(dati);\n\n SimpleResponse response =\n (SimpleResponse) fc.processRequest(request);\n\n if (!response.getResponse()) {\n if (ShowAlert.showMessage(\n \"Username o password non corretti\", AlertType.ERROR)) {\n usernameText.clear();\n passwordText.clear();\n }\n }\n }\n\n }", "@Override\n\tpublic boolean login(String userName, String password) {\n\t\tuk.ac.glasgow.internman.users.User user = users.getUser(userName, password);\n\t\tif (user != null){\n\t\t\tcurrentUser = user;\n\t\t\treturn true;\n\t\t}\n\t\telse return false;\n\t}", "public void login() {\n presenter.login(username.getText().toString(), password.getText().toString());\n }", "@Test\r\n\tpublic void login() {\n\t\tUser loginExit = userMapper.login(\"wangxin\", \"123456\");\r\n\t\tif (loginExit == null) {\r\n\t\t\tSystem.out.println(\"用户不存在\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(loginExit);\r\n\t\t\tSystem.out.println(\"登录成功!\");\r\n\t\t}\r\n\t}", "@Override public User login(String username, String password)\r\n throws RemoteException, SQLException {\r\n this.username = username;\r\n this.password = password;\r\n user = gameListClientModel.login(username, password);\r\n return gameListClientModel.login(username, password);\r\n }", "Login(String strLogin)\n {\n \tsetLogin(strLogin);\n }", "public void user_signin()\r\n\t{\r\n\t\t\r\n\t\tdriver.findElement(By.id(\"email\")).clear();\r\n\t\tdriver.findElement(By.id(\"email\")).sendKeys(UID);\r\n\t\t\r\n\t\tdriver.findElement(By.id(\"pass\")).clear();\r\n\t\tdriver.findElement(By.id(\"pass\")).sendKeys(PWD);\r\n\t}", "public static void logIn(WebDriver dr) throws IOException {\n\t\tScanner sc = new Scanner(System.in);\n\t\t// Username\n\t\tSystem.out.println(\"Enter username:\");\n\t\tString username=sc.nextLine();\n\t\tIzletPage.clickLUsername(dr);\n\t\tIzletPage.sendKeysLUsername(dr, username);\n\t\t// Password\n\t\tSystem.out.println(\"Enter password: \");\n\t\tString pass = sc.nextLine();\n\t\tIzletPage.clickLPassword(dr);\n\t\tIzletPage.sendKeysLPassword(dr, pass);\n\t\t// Log in button\n\t\tIzletPage.clickLogInButton(dr);\n\t\tsc.close();\n\t}", "public boolean loginUser();", "public User logIn(String username, String password) {\n\t\tUser user = null;\n\t\ttry {\n\t\t\tTypedQuery<User> query = em.createNamedQuery(\"User.findByCredentials\", User.class);\n\t\t\tquery.setParameter(\"inUsername\", username);\n\t\t\tquery.setParameter(\"inPassword\", password);\n\t\t\tuser = query.getSingleResult();\n\t\t\tif (user != null) {\n\t\t\t\tuser.setToken(generateToken());\n\t\t\t\tem.merge(user);\n\t\t\t}\n\t\t\treturn user;\n\t\t} catch (Exception e) {\n\t\t\tlogger.log(Level.WARNING, \"User not found\", e.getMessage());\n\t\t\treturn null;\n\t\t}\n\t}", "public void login(String username, String password) {\n\t\tusernameBox.sendKeys(username);\n\t\tpasswordBox.sendKeys(password);\n\t\tloginButton.click();\n\t}", "public String login() {\r\n FacesContext context = FacesContext.getCurrentInstance();\r\n HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();\r\n System.out.println(\"Username: \" + email);\r\n System.out.println(\"Password: \" + password);\r\n try {\r\n //this method will actually check in the realm for the provided credentials\r\n request.login(this.email, this.password);\r\n\r\n } catch (ServletException e) {\r\n context.addMessage(null, new FacesMessage(\"Login failed.\"));\r\n return \"error\";\r\n }\r\n return \"/faces/users/index.xhtml\";\r\n }", "public abstract User login(User data);", "@Override\n\tpublic UtenteBase login(String username, String password) {\n\t\t\n\t\tUtenteBase user = getUtente(username);\n\t\tif(user != null) {\n\t\t\tif(user.getPassword().equals(Utils.MD5(password))) {\n\t\t\t\tgetThreadLocalRequest().getSession().setAttribute(\"user\", user);\n\t\t\t\treturn user;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn null;\n\t\t} else\n\t\t\treturn null;\n\t}", "@Override\n\tpublic boolean login(String username, String password) {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean login(String username, String password) {\n\t\treturn userProviderService.login(username, password);\n\t}", "private int logIn()\r\n\t{\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tString username;\r\n\t\tString password;\r\n\t\tint index;\r\n\t\t\r\n\t\t//prompt user for username and password\r\n\t\tSystem.out.println(\"Enter your username\");\r\n\t\tusername = input.nextLine();\r\n\t\tSystem.out.println(\"Enter your password\");\r\n\t\tpassword = input.nextLine();\r\n\t\t\r\n\t\tindex = checkUserExists(username);\t\t\t\t\t\t\t\t\t//get the index of the username so we can find the password\r\n\t\tif (index == -1 || !userAccounts[1][index].equals(password))\t\t//username or password is incorrect\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\nIncorrect Username/Password\");\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tSystem.out.println(\"Login Successful\");\r\n\t\treturn 1;\r\n\t}", "@Override\n\tpublic boolean login(String username, String password)\n\t{\n\t\ttry\n\t\t{\n\t\t\tpassword = resolve(Hasher.class).hash(password);\n\t\t\tList<User> users = this.getRepository().findByFields(new String[]{\"username\", username}, new String[]{\"password\", password});\n\t\t\tif (!users.isEmpty())\n\t\t\t{\n\t\t\t\tthis.user = users.get(0);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tcatch (SQLException e)\n\t\t{\n\t\t\tresolve(EventBus.class).fire(new ErrorEvent(e));\n\t\t}\n\n\t\treturn false;\n\t}", "public void logincredentials() {\n\t\tutil.entertext(prop.getValue(\"locators.text.uname\"), \"admin\");\n\t\tutil.entertext(prop.getValue(\"locators.text.password\"), \"Admin123\");\n\t\tutil.ClickElement(prop.getValue(\"locators.button.regdesk\"));\n\t\tutil.ClickElement(prop.getValue(\"locators.button.login\"));\n\t\tlogreport.info(\"logged into the application\");\n\n\t}", "@Override\n\tpublic User login(User user) {\n\t\treturn userMapper.login(user);\n\t}", "public void login(String username, String password) {\n User user = new User(username, password);\r\n String paramBodyJsonStr = new Gson().toJson(user);\r\n Logger.d(\"paramBodyJsonStr=\" + paramBodyJsonStr);\r\n // handle login\r\n AndroidNetworking.post()\r\n .setContentType(\"application/json; charset=utf-8\")\r\n .setTag(this)\r\n .setUrl(Constants.URL_LOGIN)\r\n .build()\r\n .setApplicationJsonString(paramBodyJsonStr)\r\n .setAnalyticsListener(analyticsListener)\r\n .getAsJSONObject(new JSONObjectRequestListener() {\r\n @Override\r\n public void onResponse(JSONObject result) {\r\n Logger.d(\"response result=\" + result.toString());\r\n Result<LoggedInUser> defultResult = loginRepository.getDataSource().login(username, password);\r\n LoggedInUser data = ((Result.Success<LoggedInUser>) defultResult).getData();\r\n loginResult.setValue(new LoginResult(new LoggedInUserView(data.getDisplayName())));\r\n }\r\n\r\n @Override\r\n public void onError(ANError anError) {\r\n loginResult.setValue(new LoginResult(new Result.Error(anError)));\r\n Logger.d(\"anError=\" + anError.toString());\r\n if (!TextUtils.isEmpty(anError.getErrorDetail())) {\r\n Logger.d(\"getMessage=\" + anError.getMessage() + \" getErrorDetail=\" + anError.getErrorDetail());\r\n }\r\n }\r\n });\r\n\r\n }", "private void loginIn(String user, String pass, int message){\n writeTextIntoTextBox(R.id.username_text_input, user);\n writeTextIntoTextBox(R.id.password_text_input, pass);\n clickId(R.id.login_button);\n checkLoginMessage(message);\n clickId(R.id.alt_button);\n checkIfAtLogin();\n }", "public void logIn(View v){\n mUsername = (EditText) findViewById(R.id.username);\n mPassword = (EditText) findViewById(R.id.password);\n\n // Reset errors.\n mUsername.setError(null);\n mPassword.setError(null);\n\n // Store the data\n username = mUsername.getText().toString();\n password = mPassword.getText().toString();\n\n //Check username\n if (TextUtils.isEmpty(username)) {\n mUsername.setError(fielderror);\n checklog = false;\n }\n\n // Check for a valid password, if the user entered one.\n if (TextUtils.isEmpty(password)) {\n mPassword.setError(fielderror);\n checklog = false;\n }\n if(checklog == true) {\n loginUser();\n }\n\n\n }", "public static boolean login(Context ctx) {\n\t\t\n\t\tString username = ctx.formParam(\"username\");\n\t\tString password = ctx.formParam(\"password\");\n\t\t\n\t\tSystem.out.println(username);\n\t\tSystem.out.println(password);\n\t\t\n\t\tif(username.equals(\"user\") && password.equals(\"pass\")) {\n\t\t\tctx.res.setStatus(204);\n\t\t\tctx.sessionAttribute(\"user\", new User(\"McBobby\",true));\n\t\t\treturn true;\n\t\t}else {\n\t\t\t\n\t\t\tctx.res.setStatus(400);\n\t\t\tctx.sessionAttribute(\"user\", new User(\"fake\",false));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\n//\t\tctx.queryParam(password); /authenticate?password=value\n//\t\tctx.pathParam(password); /authenticate/{password}\n\t}", "public LoginUser(String username, String password) {\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t}", "public void login(String login, String password) {\n // TODO implement logging in to Admin Panel\n driver.get(Properties.getBaseAdminUrl());\n driver.findElement(By.id(\"email\")).sendKeys(login);\n driver.findElement(By.id(\"passwd\")).sendKeys(password);\n driver.findElement(By.name(\"submitLogin\")).click();\n if (login == null || password == null) {\n throw new UnsupportedOperationException();\n }\n }", "public static void userLogin(Context context)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\r\n\t\t\tString username = context.formParam(\"myUsername\");\r\n\t\t\tString password = context.formParam(\"myPassword\");\r\n\t\t\t\r\n\t\t\tif(myAccountServ.attemptLoginServiceLayer(username, password)) //if true then get user account from DB\r\n\t\t\t{\r\n\t//\t\t\tSystem.out.println(myAccountServ.getMyAccountFromDatabase(username, password));\r\n\t\t\t\tcontext.sessionAttribute(\"currentUser\", myAccountServ.getMyAccountFromDatabase(username, password)); //set session to user account info\r\n\t//\t\t\tSystem.out.println(((Account)context.sessionAttribute(\"currentUser\")));\r\n\t//\t\t\tSystem.out.println(((Account)context.sessionAttribute(\"currentUser\")).getRoleId() == 1);\r\n\t\t\t\tif(((Account)context.sessionAttribute(\"currentUser\")).getRoleId() == 1)//check user role id if they employeee\r\n\t\t\t\t{\r\n\t\t\t\t\t//take me to the employee page\r\n\t\t\t\t\tcontext.redirect(\"/html/employee-page.html\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(((Account)context.sessionAttribute(\"currentUser\")).getRoleId() == 0) // or if they manager\r\n\t\t\t\t{\r\n\t\t\t\t\tcontext.redirect(\"/html/manager-page.html\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse//if we failed login attempt... send us back to login page aka \"/index.html\"\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"not correct credentials\");\r\n\t\t\t\tcontext.redirect(\"/index.html\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tLogging.error(e);\r\n\t\t}\r\n\t\t\r\n//\t\tSystem.out.println(\"username: \" + username);\r\n//\t\tSystem.out.println(\"pssword: \" + password);\r\n\t}", "private void authenticate(String user, String pass) {\n }", "protected synchronized void login() {\n\t\tauthenticate();\n\t}", "@Override\n public User login(String username, String password) {\n User u = userDataMapper.getUserByUserName(username);\n if (u != null && u.getPassword().equals(password))\n return u;\n return null;\n }", "public void loginUser(String username, String password)\n {\n // check password and username entered\n if(StringUtils.isNotBlank(username) &&\n StringUtils.isNotBlank(password))\n {\n // username and password not blank: continue\n // check user exists\n UserEntry template = new UserEntry();\n template.setUsername(username);\n\n UserEntry existingUser =\n spaceSearcher.getUserByUsername(username);\n\n if(existingUser != null)\n {\n // user exists\n try\n {\n boolean correctPassword = CipherUtils.verifyPassword(password,\n existingUser.getPassword(), existingUser.getSalt());\n\n if(correctPassword)\n {\n // login successful\n JOptionPane.showMessageDialog(loginForm,\n \"Welcome Back \" + existingUser.getUsername()+ \"!\");\n\n loginForm.setVisible(false);\n loginForm.dispose();\n\n // create new main form\n new MainForm(existingUser);\n }\n else\n {\n JOptionPane.showMessageDialog(loginForm,\n \"Incorrect username or password!\");\n }\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }\n else\n {\n JOptionPane.showMessageDialog(loginForm,\n \"User does not exist! Please register.\");\n }\n }\n else\n {\n JOptionPane.showMessageDialog(loginForm,\n \"Please enter a valid username and password.\");\n }\n }", "@Override\n\tpublic void loginAuth(String userId, String password) {\n\t\tUserDTO loginUserInfo = loginDao.loginAuthDAO(userId);\n\t}", "public static void login() {\n\t\t\n\t\t\n\n\t\twhile(!userIsLogged) {\n\n\t\t\tSystem.out.println(\"--> LOGIN <--\");\n\n\t\t\tString username = \"\";\n\t\t\tString password = \"\";\n\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Username: \");\n\t\t\t\tusername = Main.scanner.nextLine();\n\t\t\t\tSystem.out.print(\"Password: \");\n\t\t\t\tpassword = Main.scanner.nextLine();\n\n\t\t\t\tif(username.isEmpty() && password.isEmpty()) {\n\t\t\t\t\tSystem.out.println(\"\\n>> Username or Password not inserted\\n\");\n\t\t\t\t}\n\n\t\t\t} while (username.isEmpty() && password.isEmpty());\n\n\n\t\t\tfor (Person person : userList) {\n\t\t\t\tif (person.getUsername().equals(username) && person.getPassword().equals(password)) {\n\t\t\t\t\t// loging correct\n\t\t\t\t\tloggedUser = person;\n\t\t\t\t\tuserIsLogged = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!userIsLogged) {\n\t\t\t\tSystem.out.println(\"\\n>> Wrong username or password\\n\");\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"Welcome \" + loggedUser.getName() + \" \" + loggedUser.getSurname());\n\t}", "public String login(){\n UsernamePasswordToken token = new UsernamePasswordToken(user.getAccount(),\n user.getPassword());\n\n// \"Remember Me\" built-in:\n token.setRememberMe(user.isRememberMe());\n\n Subject currentUser = SecurityUtils.getSubject();\n\n\n try {\n currentUser.login(token);\n } catch (AuthenticationException e) {\n // Could catch a subclass of AuthenticationException if you like\n FacesContext.getCurrentInstance().addMessage(\n null,\n new FacesMessage(\"Login Failed: \" + e.getMessage(), e\n .toString()));\n return \"/login\";\n }\n return \"index\";\n }", "public static void Login() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void login() {\n\t\tsuper.login();\n\t}", "void login(String userName) throws IllegalArgumentException, IOException;", "private void auto_log_in()\n {\n jtf_username.setText(Config.USERNAME);\n jpf_password.setText(Config.PASSWORD);\n jb_prijavi.doClick();\n\n }", "int authenticateUser(IDAOSession session, String userName, String password);", "@When(\"^Enter password as \\\"([^\\\"]*)\\\"$\")\n\tpublic void enter_password_as(String arg1) throws Throwable {\n\t\tpass = arg1;\n\t\tSystem.out.println(userName+\" - \"+ pass);\n\t\tloginPage.loginWithCredentials(userName, pass);\n\t}", "@Override\n\tpublic SmbmsUser login(String userCode, String userPassword) {\n\t\treturn sud.login(userCode, userPassword);\n\t}", "public void login_pw() {\n\t\tIntent intent = new Intent(this, ResetPasswordActivity.class);\n\t\tstartActivity(intent);\n\t}", "private static void loginToAccount() {\n\n\t\tSystem.out.println(\"Please enter your userName : \");\n\t\tString userName=scan.nextLine();\n\n\t\tSystem.out.println(\"Please enter your Password : \");\n\t\tString password=scan.nextLine();\n\n\t\tif(userName.equals(userName)&& password.equals(password))\n\t\t\tSystem.out.println(\"Welcome to AnnyBank\");\n\n\t\ttransactions();\n\t}" ]
[ "0.7958234", "0.79360735", "0.75537384", "0.7391002", "0.7334946", "0.7265172", "0.72136635", "0.71882385", "0.71461266", "0.71458185", "0.71017474", "0.70779115", "0.70389813", "0.7037826", "0.70218885", "0.70142776", "0.70115596", "0.69699883", "0.6949619", "0.69436246", "0.6940408", "0.6936477", "0.69297457", "0.69196403", "0.6907271", "0.68814147", "0.68592805", "0.6822858", "0.67991453", "0.679698", "0.67800623", "0.6774298", "0.6773328", "0.67649245", "0.676463", "0.676212", "0.675421", "0.6746572", "0.6745954", "0.6745591", "0.67360985", "0.6732045", "0.6730575", "0.67141545", "0.6713748", "0.67113477", "0.6692712", "0.6684375", "0.6671403", "0.6671093", "0.6667022", "0.66659886", "0.66497177", "0.66482854", "0.66468686", "0.66330636", "0.66299796", "0.6628981", "0.6626425", "0.6617882", "0.6611809", "0.6609109", "0.6603311", "0.66027164", "0.6599809", "0.6586114", "0.65755504", "0.65688515", "0.65667236", "0.6565781", "0.65651983", "0.65593165", "0.6557022", "0.65518534", "0.65507525", "0.6547916", "0.6545385", "0.653868", "0.65319735", "0.6528977", "0.6527433", "0.652441", "0.6523003", "0.6509975", "0.6491231", "0.64889324", "0.64873743", "0.6485862", "0.6476485", "0.6475368", "0.64684325", "0.6466388", "0.64646685", "0.64491224", "0.64456904", "0.64424425", "0.6442297", "0.64398843", "0.6439102", "0.6436174", "0.6430359" ]
0.0
-1
Creates a Course without any owners, followers or posts
public Course createTestCourseObject() { Course course = new Course(makeRandomString()); return courseRepository.save(course); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void create() {\n Application.currentUserCan( 1 );\n \n String author = session.get(\"userEmail\");\n String title = params.get( \"course[title]\", String.class );\n String content = params.get( \"course[content]\", String.class );\n \n if( title.length() > 0 && content.length() > 0 ) {\n Course course = new Course(title, content, author);\n course.save();\n }\n \n index();\n }", "public com.ms3.training.services.model.Course create(java.lang.String title);", "public CreateCourse() {\r\n super(\"Create Course\", \"Creates a course\", \"`!createcourse`\", commands, \"admin\");\r\n this.requiredUserPermissions = new Permission[]{Permission.ADMINISTRATOR}; // User must have administrator privileges\r\n }", "public void createCourse(String courseName, int courseCode){}", "@Override\n public void create(Course t) {\n String statement = INSERT;\n data.makeUpdateStatement(statement,new Object[]{(Object)t.getTitle(),(Object)t.getStream(), (Object)t.getType(),\n (Object)t.getStart_date(),(Object)t.getEnd_date()});\n Course lastCreatedCourse = getByMaxId(); //after the course creation, we get back the last course with the id\n t.setId(lastCreatedCourse.getId()); //and set the id to the given course\n data.closeConnections(data.ps, data.conn);\n \n }", "public Course() {}", "public long createCourse(Course course) {\n long id = -1;\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues courseContentValues = new ContentValues();\n courseContentValues.put(Config.COLUMN_COURSE_TITLE, course.getCourseTitle());\n courseContentValues.put(Config.COLUMN_COURSE_CODE, course.getCourseCode());\n\n try {\n id = db.insertOrThrow(Config.TABLE_NAME_COURSE,\n null, courseContentValues);\n } catch (SQLException e) {\n Log.d(TAG, \"Exception: \" + e.getMessage());\n Toast.makeText(context,\n \"Operation Failed: \" + e.getMessage(), Toast.LENGTH_LONG).show();\n } finally {\n db.close();\n }\n return id;\n }", "public Course() {\n }", "public Course() {\n }", "@RequestMapping(value = \"/api/user/{userId}/course\", method = RequestMethod.POST)\n public ResponseEntity<Course> newCourse(@PathVariable String userId, @RequestBody Course courseDetails) {\n try {\n return new ResponseEntity<>(courseService.addCourse(courseDetails, userId), HttpStatus.ACCEPTED);\n } catch (JgitException e) {\n logger.error(\"Error in adding a new course\");\n return new ResponseEntity<>(courseDetails, HttpStatus.PARTIAL_CONTENT);\n }\n }", "@RequestMapping(value = \"/course\",method = RequestMethod.POST)\n @PostMapping(consumes = {\n MediaType.APPLICATION_XML_VALUE,\n MediaType.APPLICATION_JSON_VALUE,\n }, produces = {\n MediaType.APPLICATION_XML_VALUE,\n MediaType.APPLICATION_JSON_VALUE,\n })\n public ResponseEntity<Courses> addNew(@RequestBody Courses course){\n Courses courses = new Courses();\n courses.setCourseName(course.getCourseName());\n courses.setCourseNumber(course.getCourseNumber());\n courses.setCourseNature(course.getCourseNature());\n courses.setTheoreticalHours(course.getTheoreticalHours());\n courses.setCourseDescription(course.getCourseDescription());\n courses.setCourseCredit(course.getCourseCredit());\n courses.setExperimentHours(course.getExperimentHours());\n courses.setOpenSemester(course.getOpenSemester());\n coursesService.save(courses);\n return new ResponseEntity<Courses>(courses, HttpStatus.OK);\n }", "public Course() {\n\n\t}", "private void setupCreateCourse() {\n\t\tmakeButton(\"Create Course\", (ActionEvent e) -> {\n\t\t\ttry {\n\t\t\t\tString[] inputs = getInputs(new String[] { \"Name:\", \"Number:\" });\n\t\t\t\tif (inputs == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tint num = Integer.parseInt(inputs[1]);\n\t\t\t\tadCon.createCourse(inputs[0], num);\n\t\t\t\tupdateCourses();\n\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\tJOptionPane.showMessageDialog(getRootPane(), \"Course number must be a number\", \"Error\",\n\t\t\t\t\t\tJOptionPane.OK_OPTION);\n\t\t\t}\n\t\t});\n\t}", "public Course() {\n this(\"course\", null);\n }", "public Course() {\n super();\n }", "public void insertCourse(){\n \n }", "void addCourse(Course course);", "@OnClick (R.id.create_course_btn)\n public void createCourse()\n {\n\n CourseData courseData = new CourseData();\n courseData.CreateCourse( getView() ,UserData.user.getId() ,courseName.getText().toString() , placeName.getText().toString() , instructor.getText().toString() , Integer.parseInt(price.getText().toString()), date.getText().toString() , descreption.getText().toString() ,location.getText().toString() , subField.getSelectedItem().toString() , field.getSelectedItem().toString());\n }", "public void addCourse(Courses course) throws SQLException {\n ConnectDB db = ConnectDB.getInstance();\n Connection con = null;\n PreparedStatement ps = null;\n ResultSet rs = null;\n\n try {\n String sql = \"insert into [dbo].[Courses] values (?,?,?,?,?,?,?)\";\n\n con = db.openConnection();\n ps = con.prepareStatement(sql);\n ps.setString(1, course.getCourseName());\n ps.setString(2, course.getCourseImage());\n ps.setInt(3, course.getFee());\n ps.setInt(4, course.getCourseDuration());\n ps.setString(5, course.getTeacherName());\n ps.setString(6, course.getCourseDescription());\n ps.setInt(7, course.getCategory());\n ps.execute();\n\n } catch (Exception ex) {\n Logger.getLogger(CoursesDAO.class.getName()).log(Level.SEVERE,\n null, ex);\n } finally {\n ps.close();\n con.close();\n\n }\n }", "public void insertCourse(Course course) {\n ProgressTrackerDatabase.databaseWriteExecutor.execute(() -> {\n mCourseDao.insert(course);\n });\n }", "private UserCourseCourse() {\n\t}", "@RequestMapping(method = RequestMethod.POST, value = \"/courses\") \n\t\tpublic ResponseEntity<String> addCourse(@Valid @RequestBody Course course) {\n\t\treturn courseService.addCourse(course);\n\t}", "@Override\n\tpublic void addCourse(Course c) {\n\t\tsessionFactory.getCurrentSession().saveOrUpdate(c);\n\t\t\n\t}", "public void insertCourse(Course course) {\n\t\tthis.getHibernateTemplate().save(course);\n\n\t}", "public long createCourse(String category, String courseName, String assignmentName, String description, String dueDate, String completed)\r\n{\r\nContentValues initialValues = new ContentValues();\r\ninitialValues.put(KEY_CATEGORY, category);\r\ninitialValues.put(KEY_COURSENAME, courseName);\r\ninitialValues.put(KEY_ASSIGNMENTNAME, assignmentName);\r\ninitialValues.put(KEY_DESCRIPTION, description);\r\ninitialValues.put(KEY_DUEDATE, dueDate);\r\ninitialValues.put(KEY_COMPLETED, completed);\r\n\r\nreturn database.insert(DATABASE_TABLE, null, initialValues);\r\n}", "public StudentCourse() {\n this(\"student_course\", null);\n }", "@PostMapping(\"/course-resources\")\n @Timed\n public ResponseEntity<CourseResource> createCourseResource(@RequestBody CourseResource courseResource) throws URISyntaxException {\n log.debug(\"REST request to save CourseResource : {}\", courseResource);\n if (courseResource.getId() != null) {\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, \"idexists\", \"A new courseResource cannot already have an ID\")).body(null);\n }\n CourseResource result = courseResourceService.save(courseResource);\n return ResponseEntity.created(new URI(\"/api/course-resources/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "@Override\r\n\tpublic void newDeleteCourse(Course course) {\n\t\tcourse.setValid(0);\r\n\t\tthis.update(course);\r\n\t}", "public boolean addCourse(Course c) {\n\t\treturn false;\n\t}", "protected Course(Course course) {\n this.courseCode = course.getCourseCode();\n this.courseTitle = course.getCourseTitle();\n this.courseStatus = course.getCourseStatus();\n this.credit = course.getCourseCredit();\n this.preReqList = course.getPrerequisites();\n }", "public void insert(Course course) {\n\t\tString sql = \"INSERT course(Cour_Name,CourCate_ID,Cour_BriefIntro) \"\n\t\t\t\t+ \"VALUES(?,?,?)\";\n\t\ttry {\n\t\t\t\n\t\t\tconn = dataSource.getConnection();\n\t\t\tsmt = conn.prepareStatement(sql);\n\t\t\tsmt.setString(1, course.getCourName());\n\t\t\tsmt.setInt(2, course.getCourseCate().getCourCateId());\t\t\t\n\t\t\tsmt.setString(3, course.getCourBriefIntro());\n\t\t\tsmt.executeUpdate();\t\t\t\n\t\t\tsmt.close();\n \n\t\t} catch (SQLException e) {\n\t\t\tthrow new RuntimeException(e);\n \n\t\t} finally {\n\t\t\tif (conn != null) {\n\t\t\t\ttry {\n\t\t\t\t\tconn.close();\n\t\t\t\t} catch (SQLException e) {}\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void save(org.holtz.eve.jpa.entity.TCsCourse course) {\n\r\n\t}", "@Override\n\tpublic CourseLesson createCourseLesson(CourseLesson courseLesson) {\n\t\treturn lessonRepository.save(courseLesson);\n\t}", "public void addCourse(Course c){\n\t\tcourses.add(c);\n\t}", "public Course(String courseName) {\n this.courseName = courseName;\n }", "int insert(Course record);", "int insert(Course record);", "@Test\n\tpublic void testCreateCourseScoped() throws Exception {\n\t\tfinal Course course = this.zeusClient.courses().get(1L);\n\t\tassertNotNull(course);\n\n\t\tfinal Series series = this.zeusClient.series().getAll(course).get(0);\n\t\tassertNotNull(series);\n\n\t\tfinal Exercise exercise = this.zeusClient.exercises().getAll(series).get(0);\n\t\tassertNotNull(exercise);\n\n\t\tlong id = -1;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tid = this.zeusClient.submissions().create(course, series, exercise, CODE);\n\t\t\t} catch (final UnprocessableEntityException ex) {\n\t\t\t\tThread.sleep(1000L);\n\t\t\t}\n\t\t} while (id <= 0L);\n\n\t\tfinal Submission submission = this.zeusClient.submissions().get(id);\n\t\tassertNotNull(submission);\n\t\tassertEquals(SubmissionStatus.QUEUED, submission.getStatus());\n\t\tassertEquals(CODE, submission.getCode());\n\t}", "public Course(@NotBlank String name, @NotBlank String lecturer, @NotBlank String description) {\n this.name = name;\n this.lecturer = lecturer;\n this.description = description;\n }", "public void testAddCourse() {\n\t System.out.println(\"addCourse\");\n\t Course course = course1;\n\t Student instance = student1;\n\t instance.addCourse(course);\n\t }", "Paper addNewPaper(PaperForm form, Long courseId)throws Exception;", "public void addCourse(Course c) {\n\t\tcourseList.add(c);\n\t}", "public int addCourseToCartFirstTime(String username, String course) {\n SQLiteDatabase db = dButils.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(Cart.KEY_username, username);\n values.put(Cart.KEY_courseInCart, course);\n long res = db.insert(Cart.TABLE,null,values);\n db.close();\n return (int)res;\n }", "public Course() {\n term = \"\";\n subject = \"\";\n number = 0;\n newRoom = 0;\n oldRoomLetter = \"\";\n section = new String();\n crossList = new String();\n title = new String();\n faculty = new String();\n building = new String();\n room = \"\";\n startDate = \"\";\n dayTime = new String();\n\n }", "@BeforeEach\r\n void createCourse() {\r\n date = new Date(1220227200L * 1000);\r\n lecture = new Lecture();\r\n lecture.setCourseId(\"CSE1230\");\r\n lecture.setDuration(50);\r\n lecture.setLectureId(9);\r\n lecture.setScheduledDate(date);\r\n }", "public void addCourse(Connection con) throws SQLException, NumberFormatException, IllegalArgumentException {\r\n //Get the current data from the fields\r\n int intSID = getSID();\r\n String strName = getName();\r\n String strTitle = getTitle();\r\n String strDepartment = getDepartment();\r\n int intCredits = getCredits();\r\n String strDescription = getDescription();\r\n String strOutcomes= getOutcomes();\r\n String strContactEmail = getContactEmail();\r\n String strContactName = getContactName();\r\n\r\n //Add the course to the database!\r\n //Unless passing an illegal argument\r\n illegalDataFieldsCheck(intSID, strName, strTitle);\r\n Queries.addCourse(con, intSID, strName, strTitle, strDepartment, intCredits, strDescription, strOutcomes, strContactEmail, strContactName);\r\n\r\n //Clear all the fields\r\n cbAllCID.setSelectedIndex(0);\r\n clearFields();\r\n }", "@Override\n\tpublic boolean addCourse(Course course) {\n\t\tboolean isCourseAdded = false;\n\t\tconn = DBUtils.connectToDb();\n\t\tString query = \"insert into course (course_name,start_date,end_date,capacity) values (?,?,?,?);\";\n\t\tpst = DBUtils.getPreparedStatement(conn, query);\n\t\tint rows = 0;\n\t\ttry {\n\t\t\tpst.setString(1, course.getCourse_name());\n\t\t\tpst.setString(2, course.getStart_date());\n\t\t\tpst.setString(3, course.getEnd_date());\n\t\t\tpst.setInt(4, course.getCapacity());\n\n\t\t\trows = pst.executeUpdate();\n\t\t\tDBUtils.closeConnections();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (rows > 0)\n\t\t\tisCourseAdded = true;\n\n\t\treturn isCourseAdded;\n\t}", "@Override\r\n\tpublic int addCourse(Courses course) {\n\t\tString sql=\"insert into courseshv values(?,?)\";\r\n\t\tPreparedStatement pstmt=null;\r\n\t\tint rowAdded=0;\r\n\t\ttry {\r\n\t\t\tpstmt=conn.prepareStatement(sql);\r\n\t\t\tpstmt.setLong(1, course.getCourseid());\r\n\t\t\tpstmt.setString(2, course.getCourseName());\r\n\t\t\trowAdded=pstmt.executeUpdate();\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}\r\n\t\treturn rowAdded;\r\n\t}", "public static Course addCourse() {\n\n Course newCourse = new Course();\n\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Enter the name of course\");\n String courseName = scan.nextLine();\n newCourse.setCourseName(courseName);\n\n System.out.println(\"Enter course ID number\");\n String numberID = scan.nextLine();\n newCourse.setCourseID(numberID);\n\n System.out.println(\"Enter the first and last name of teacher\");\n String name = scan.nextLine();\n\n// newCourse.setTaughtBy(name);\n\n System.out.println(\"Enter the first and last name of student\");\n String name2 = scan.nextLine();\n\n// newCourse.setTakenBy(name2);\n\n\n return newCourse;\n\n }", "int insert(courses record);", "@Override\n public int createCourse(String name, String description, int nbHourTotal, int idT, int promoId){\n Connection connection = getConnection();\n int result = 0;\n if(connection != null){\n try{\n PreparedStatement preparedStatement = connection.prepareStatement(\"INSERT INTO Courses(courseName, courseDescription, nbHourTotal, idTeacher, idPromo) VALUES (? ,? ,? ,?, ?)\");\n preparedStatement.setString(1, name);\n preparedStatement.setString(2, description);\n preparedStatement.setInt(3, nbHourTotal);\n preparedStatement.setInt(4, idT);\n preparedStatement.setInt(5, promoId);\n result = preparedStatement.executeUpdate();\n\n }catch (SQLException e){\n e.printStackTrace();\n }\n finally {\n closeConnection(connection);\n }\n }\n return result;\n }", "public static Course createCourse(String code) { \n final Course course = new Course();\n course.setId(code + \"001\");\n course.setCode(code);\n course.setTitle(\"This is the title of a Course\");\n course.setDescription(new CourseDescription(\"This is the description of a course and is typically very long\", \"\"));\n CourseCredit credit = new CourseCredit();\n credit.setValue(\"3\");\n credit.setType(CourseCreditType.CPE);\n course.setCredit(credit);\n CourseLength length = new CourseLength();\n length.setValue(4320);\n length.setInterval(\"Day\");\n course.setLength(length);\n course.setType(\"Classroom-Day\");\n course.setObjective(\"--- objective ---\");\n return course;\n }", "public CSCourses() {\n courseList = new LinkedList<Course>(); \n numOfCourses = 0;\n }", "public static ArrayList<Course> addCourses() {\n System.out.println(\"\\nAdd a course!\");\n do {\n listOfCourses.add(createCourse());\n System.out.print(\"\\n Would you like to add a new course?(yes or no): \");\n boolean yesOrNo = yesOrNoValidation();\n if (yesOrNo) {\n } else if (!yesOrNo) {\n break;\n }\n } while (true);\n return listOfCourses;\n }", "private void addCourse() throws IOException, InterruptedException {\n Scanner sc = new Scanner(System.in);\n Course course = new Course();\n\n System.out.println(\"\\nPlease enter the course code:\");\n String courseID = sc.nextLine();\n while(!courseID.matches(\"^[a-zA-Z]{2}[0-9]{4}$\"))\n {\n System.out.println(\"Invalid input! Please enter again!\");\n System.out.println(\"\\nPlease enter the course code:\");\n courseID = sc.nextLine();\n }\n courseID = courseID.toUpperCase();\n //Course course = new Course(courseID,null,-1)\n\n while(courseMgr.readCourseByID(courseID)!=null){\n ErrorCodeBoundary.printErrorCourseAlreadyExist();\n System.out.println(\"\\n***********What would you like to do next ?***********\");\n System.out.println(\" Course Information \");\n System.out.println(\"______________________________________________________\\n\");\n System.out.println(\"|1. Add another course |\");\n System.out.println(\"|2. Update information for this course |\");\n System.out.println(\"|----------------------------------------------------|\");\n System.out.println(\"|0. Return to admin menu page |\");\n System.out.println(\"|----------------------------------------------------|\");\n System.out.println(\"______________________________________________________\");\n\n //sc.nextLine();\n int choice;\n\n do {\n while (!sc.hasNextInt()) {\n System.out.println(\"Invalid input! Please enter your choice:\");\n sc.next();\n }\n choice = sc.nextInt();\n if((choice < 0) || (choice > 2))\n System.out.println(\"Invalid input! Please enter your choice:\");\n } while ((choice < 0) || (choice > 2));\n if(choice == 1){\n System.out.println(\"\\nPlease enter another course code:\");\n sc.nextLine();\n courseID = sc.nextLine();\n while(!courseID.matches(\"^[a-zA-Z]{2}[0-9]{4}$\"))\n {\n System.out.println(\"Invalid input! Please enter again!\");\n System.out.println(\"\\nPlease enter the course code:\");\n courseID = sc.nextLine();\n }\n\n }\n else if(choice ==2){\n this.courseIDExist = courseID;\n this.updCourse();\n return;\n }\n else\n return;\n\n\n }\n\n courseID = courseID.toUpperCase();\n course.setCourseID(courseID);\n\n\n System.out.println(\"Please enter the school:\");\n String school = sc.nextLine();\n while(!school.matches(\"^[a-zA-Z]*$\"))\n {\n System.out.println(\"Invalid input! Please enter again!\");\n System.out.println(\"Please enter the school:\");\n school = sc.nextLine();\n }\n school = school.toUpperCase();\n course.setSchool(school);\n\n System.out.println(\"\\n**************Please choose a course type**************\");\n System.out.println(\" Course Type Information \");\n System.out.println(\"______________________________________________________\\n\");\n System.out.println(\"|1. Lecture only |\");\n System.out.println(\"|2. Lecture with tutorial |\");\n System.out.println(\"|3. Lecture tutorial and lab |\");\n System.out.println(\"______________________________________________________\");\n\n\n int courseType;\n do {\n while (!sc.hasNextInt()) {\n System.out.println(\"Invalid input! Please enter the course type:\");\n sc.next();\n }\n courseType = sc.nextInt();\n if((courseType < 1) || (courseType > 3))\n System.out.println(\"Input number out of range! Please enter the course type:\");\n } while ((courseType < 1) || (courseType > 3));\n\n course.setCourseType(courseType-1);\n\n\n System.out.println(\"\\nHow many indices for this course?\");\n int noOfIndex;\n do {\n while (!sc.hasNextInt()) {\n System.out.println(\"Invalid input! Please enter the number of index for this course:\");\n sc.next();\n }\n noOfIndex = sc.nextInt();\n if(noOfIndex < 1)\n System.out.println(\"The number of index can't be less than 1.Please enter the number of index for this course:\");\n } while (noOfIndex < 1);\n\n ArrayList<String> dateAndTime = new ArrayList<String>();\n CourseIndex courseIndex = new CourseIndex();\n ArrayList<CourseCompo> courseCompoList = new ArrayList<CourseCompo>();\n\n for(int i=0;i<noOfIndex;i++){\n courseIndex = this.addCourseIndex(courseID);\n \n \n if (courseIndex==null)\n return;\n courseCompoList = this.addCourseComp(courseType);\n for(CourseCompo courseComp:courseCompoList){\n courseIndex.addCourseCompo(courseComp);\n }\n\n /*\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }*/\n course.addCourseIndex(courseIndex);\n CourseManager courseManager = new CourseManager();\n courseManager.addCourseToDB(course);\n System.out.println(\"\\nThe course have been added successfully.\");\n printAllCourseInDB();\n\n\n }\n }", "@RequestMapping(value = \"/staff/coursecreate\")\n\tpublic String redirectToCourseCreate(Model model) {\n\t\tCourse course = new Course();\n\t\tmodel.addAttribute(\"course\", course);\n\t\treturn \"staff/coursecreate\";\n\t}", "Course() {\r\n\t\tsetValidDays(true);\r\n\t\tsetName(null);\r\n\t\tsetNumberOfDays(0);\r\n\t\tsetPrice(0.0);\r\n\t}", "public static List<Course> createCourseList() {\n List<Course> courses = new ArrayList<Course>();\n courses.add(createCourse(\"12345\"));\n courses.add(createCourse(\"67890\"));\n return courses;\n }", "@POST\r\n\t@Path(\"/student\")\r\n\tpublic void enrollStudentToCourse(@FormParam(\"studentID\") String studentID,\r\n\t\t\t@FormParam(\"courseID\") String courseID) {\r\n\r\n\t\tStudent student = InMemoryDataStore.getStudent(studentID);\r\n\t\tCourse course = InMemoryDataStore.getCourse(courseID);\r\n\r\n\t\tif (student == null || course == null) {\r\n\t\t\tthrow new WebApplicationException(Response.Status.BAD_REQUEST);\r\n\t\t}\r\n\r\n\t\tstudent.addCourse(courseID);\r\n\t\tcourse.addStudent(studentID);\r\n\t}", "public Course(String courseId, String courseIdSchool, String teacherId, String courseName, String courseType, String courseAcademy, Float courseCredit, String courseArea, String courseTeacher) {\n this.courseId = courseId;\n this.courseIdSchool = courseIdSchool;\n this.teacherId = teacherId;\n this.courseName = courseName;\n this.courseType = courseType;\n this.courseAcademy = courseAcademy;\n this.courseCredit = courseCredit;\n this.courseArea = courseArea;\n this.courseTeacher = courseTeacher;\n }", "public Course(String mandatoryElective, String name, String code, String instructor, String credits, String acronym, String monday, String tuesday, String wednesday, String thurdsday, String friday, String tut, String lab, String preConditions, String postConditions) {\r\n this.name = name;\r\n this.acronym = acronym;\r\n this.instructor = instructor;\r\n this.mandatoryElective = mandatoryElective;\r\n this.credits = credits;\r\n this.code = code;\r\n this.monday = monday;\r\n this.tuesday = tuesday;\r\n this.wednesday = wednesday;\r\n this.thurdsday = thurdsday;\r\n this.friday = friday;\r\n this.tut = tut;\r\n this.lab = lab;\r\n this.preConditions = preConditions;\r\n this.postConditions = postConditions;\r\n }", "public Course(String courseName) {\n studentList = new ArrayList<Student>(MAXSTUDENT);\n this.courseName = courseName;\n studentCount = 0;\n }", "public Course(String courseName, String courseID, Course[] prerequisites, Textbook[] textbooks) {\r\n COURSE_NAME = courseName;\r\n COURSE_ID = courseID;\r\n PREREQUISITE_COURSES = prerequisites;\r\n TEXTBOOKS = textbooks;\r\n }", "@Override\r\n\tpublic int addCourse(CourselistDto course) {\n\t\treturn courselistDao.addCourse(course);\r\n\t}", "public Course(int id, String name, String description) {\n this.id = id;\n this.name = name;\n this.description = description;\n this.teachers = new ArrayList<>();\n }", "public Course()\n\t{\n\t\tstudents = new Student[30];\n\t\tnumStudents = 0;\n\t}", "public Post createTestPostObject(Course course) {\n Post post = new Post(makeRandomString(), makeRandomString(), course,\n new Date(), new Date());\n return postRepository.save(post);\n }", "public Student(String name, String gender, String email){\n this.name = name;\n this.gender = gender;\n this.email = email;\n this.course1 = new Course();\n this.course2 = new Course();\n this.course3 = new Course();\n }", "public void addCourse(Course course) {\n\t\tif (!this.hasCourse(course)) {\n\t\t\tthis.courses.add(course);\n\t\t}\n\t}", "public SelectCourse() {\n super();\n }", "private void addNewCoursesOnClick(){\n dataSource.open();\n dataSource.createCourses(editTextCourses.getText().toString(),editTextTeacher.getText().toString(),editTextWhen.getText().toString(),editTextWhere.getText().toString(),editTextGrading.getText().toString(),editTextOther.getText().toString());\n dataSource.close();\n CoursesListElement courses = new CoursesListElement(editTextCourses.getText().toString(),editTextTeacher.getText().toString(),editTextWhen.getText().toString(),editTextWhere.getText().toString(),editTextGrading.getText().toString(),editTextOther.getText().toString(),0);\n listElements.add(courses);\n // setting list adapter\n listView.setAdapter(new ActionListAdapter(getActivity(),R.id.list_courses, listElements));\n newCourses.setVisibility(View.GONE);\n editTextCourses.setText(\"\");\n editTextTeacher.setText(\"\");\n editTextWhen.setText(\"\");\n editTextWhere.setText(\"\");\n editTextGrading.setText(\"\");\n editTextOther.setText(\"\");\n }", "public void assignCourse(Course course) {\r\n this.course.add(course);\r\n }", "public void courseOperation() {\n\t\tthePerson.createCourseMenu();\n\t}", "@Test\r\n \t public void testAddnewCourse() {\r\n \t \tLoginpg loginPage = new Loginpg();\r\n \t \tloginPage.setUsernameValue(\"admin\");\r\n \t \tloginPage.setpassWordValue(\"myvirtualx\");\r\n \t \tloginPage.clickSignin();\r\n \t \t\r\n \t \tCoursepg coursePage= new Coursepg();\r\n \t \tcoursePage.clickCourse().clickNewCourse().typeNewCourseName(\"selenium\").clickSubmit();\r\n \t\r\n \t }", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS \" + ConstantUtils.T_COURSE_DATA + \n\t\t\t\t\"(course_id TEXT not null unique, course_data TEXT, time TEXT)\");\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS \" + ConstantUtils.T_UPDATE + \n\t\t\t\t\"(course_id TEXT not null, id TEXT not null unique, content TEXT, date TEXT, is_show INTEGER, no INTEGER not null unique)\");\n\t}", "@Override\n\tpublic void createBourse(Bourse brs) {\n\t\t\n\t}", "public Course (double creditHours) {\r\n\t\tname = \"A New Course\";\r\n\t\tnumGrade = 0;\r\n\t\tcredithours = creditHours;\r\n\t\tletterGrade = \"\";\r\n\t}", "private Course dummyCourse(int crn)\n\t{\n\t\tCourse rVal = new Course(null, null, crn, 0, null, 0, 0, 0, 1);\n\t\treturn rVal;\n\t}", "public long addOrUpdateCourse(Course course) {\n\t\tSQLiteDatabase db = this.getWritableDatabase();\n\t\tContentValues values = new ContentValues();\n\t\tvalues.put(COURSE_C_VERSIONID, course.getVersionId());\n\t\tvalues.put(COURSE_C_TITLE, course.getTitleJSONString());\n\t\tvalues.put(COURSE_C_LOCATION, course.getLocation());\n\t\tvalues.put(COURSE_C_SHORTNAME, course.getShortname());\n\t\tvalues.put(COURSE_C_LANGS, course.getLangsJSONString());\n\t\tvalues.put(COURSE_C_IMAGE, course.getImageFile());\n\t\tvalues.put(COURSE_C_GROUP, course.getCourseGroup());\n\t\tvalues.put(COURSE_C_DATE, getDate());\n\n\t\tif (!this.isInstalled(course.getShortname())) {\n\t\t\tLog.v(TAG, \"Record added\");\n\t\t\treturn db.insertOrThrow(COURSE_TABLE, null, values);\n\t\t} else if(this.toUpdate(course.getShortname(), course.getVersionId())){\n\t\t\tlong toUpdate = this.getCourseID(course.getShortname());\n\t\t\tif (toUpdate != 0) {\n\t\t\t\tdb.update(COURSE_TABLE, values, COURSE_C_ID + \"=\" + toUpdate, null);\n\t\t\t\t// remove all the old activities\n\t\t\t\tString s = ACTIVITY_C_COURSEID + \"=?\";\n\t\t\t\tString[] args = new String[] { String.valueOf(toUpdate) };\n\t\t\t\tdb.delete(ACTIVITY_TABLE, s, args);\n\t\t\t\treturn toUpdate;\n\t\t\t}\n\t\t} \n\t\t\n\t\treturn -1;\n\t\t\n\t}", "public void addCourse(Course o) {\r\n\t\t\tcourseTaken.add(o);\r\n\t\t}", "@Insert\n void insert(Course... courses);", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REGISTER_COURSE_REQUEST) {\n // Make sure the request was successful\n if (resultCode == RESULT_OK) {\n Course newCourse = data.getParcelableExtra(\"new course\");\n if (newCourse != null) {\n insertCourseToList(newCourse);\n } else {\n // do nothing\n }\n }\n }\n }", "private void setupRemoveCourse() {\n\t\tmakeButton(\"Remove Course\", (ActionEvent e) -> {\n\t\t\ttry {\n\t\t\t\tint row = table.getSelectedRow();\n\n\t\t\t\tif (row < 0) {\n\t\t\t\t\tJOptionPane.showMessageDialog(getRootPane(), \"Please select a course\", \"Error\",\n\t\t\t\t\t\t\tJOptionPane.OK_OPTION);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tint courseId = adCon.getCourseIdFromRow(row);\n\t\t\t\tadCon.removeCourse(courseId);\n\t\t\t\tupdateCourses();\n\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\tJOptionPane.showMessageDialog(getRootPane(), \"Course number must be a number\", \"Error\",\n\t\t\t\t\t\tJOptionPane.OK_OPTION);\n\t\t\t}\n\t\t\tcourseInfo.setText(\"Course deleted.\");\n\t\t});\n\t}", "public Course(int id, String name, String description, Faculty teacher){\n this.id = id;\n this.name = name;\n this.description = description;\n this.teachers = new ArrayList<>();\n this.teachers.add(teacher);\n }", "private void obtainCourseSafely() {\n System.out.println(\"What is the name of the Course you wish to add (eg. CPSC 210)\");\n String name = scanner.nextLine();\n\n System.out.println(\"How many Sub-Classes does this have? (eg. CPSC 210 201 and CPSC 210 202 would mean 2)\");\n subClassNames = getNames(obtainIntSafely(1, 999, \"Enter int > 0\"), \"Class\");\n subClassTimes = getTimes(name, subClassNames);\n\n boolean response1 = yesNoQuestion(\"Does this class have a separate lab component?\");\n if (response1) {\n System.out.println(\"How many Labs does this have?\");\n labNames = getNames(obtainIntSafely(1, 999, \"Enter int > 0\"), \"Lab\");\n labTimes = getTimes(name, labNames);\n }\n\n boolean response2 = yesNoQuestion(\"Does this class have a separate tutorial component?\");\n if (response2) {\n System.out.println(\"How many Tutorials does this have?\");\n tutorialNames = getNames(obtainIntSafely(1, 999, \"Enter int > 0\"), \"Tutorial\");\n tutorialTimes = getTimes(name, tutorialNames);\n }\n\n if (response1 || response2) {\n activeCourseList.add(new Course(name, subClassNames, subClassTimes, response1, labNames, labTimes,\n response2, tutorialNames, tutorialTimes));\n } else {\n activeCourseList.add(new Course(name, subClassNames, subClassTimes));\n }\n }", "Student createStudent();", "@Test\n public void noEqualsCourses() {\n final CourseType courseType1 = new CourseType(\"N\", \"Pic\", 5, 1);\n courseType1.setId(\"ID\");\n courseType1.setCourses(List.of(new Course(\"C1\"), new Course(\"C2\")));\n courseType1.setAllowedDishes(List.of(new Dish(\"D1\"), new Dish(\"D2\")));\n final CourseType courseType2 = new CourseType(\"N\", \"Pic\", 5, 1);\n courseType2.setId(\"ID\");\n courseType2.setCourses(List.of(new Course(\"C1\")));\n courseType2.setAllowedDishes(List.of(new Dish(\"D1\"), new Dish(\"D2\")));\n final CourseType courseTypeNull = new CourseType(\"N\", \"Pic\", 5, 1);\n courseTypeNull.setId(\"ID\");\n courseTypeNull.setCourses(null);\n courseTypeNull.setAllowedDishes(List.of(new Dish(\"D1\"), new Dish(\"D2\")));\n\n assertNotEquals(courseType1, courseType2);\n assertNotEquals(courseType1, courseTypeNull);\n assertNotEquals(courseTypeNull, courseType1);\n }", "@Override\n\tpublic void addCourse(String courseName) {\n\t\tcd.addCourse(courseName);\n\t}", "private void saveCourse() {\n String nameString = mNameEditText.getText().toString().trim();\n\n // Check if this is supposed to be a new pet\n // and check if all the fields in the editor are blank\n if (mCurrentCourseUri == null && TextUtils.isEmpty(nameString)) {\n // Since no fields were modified, we can return early without creating a new pet.\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 pet attributes from the editor are the values.\n ContentValues values = new ContentValues();\n values.put(CourseEntry.COLUMN_COURSE_NAME, nameString);\n\n // Determine if this is a new or existing pet by checking if mCurrentPetUri is null or not\n if (mCurrentCourseUri == null) {\n // This is a NEW pet, so insert a new pet into the provider,\n // returning the content URI for the new pet.\n Uri newUri = getContentResolver().insert(CourseEntry.CONTENT_URI_COURSE, 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_course_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_course_successful),\n Toast.LENGTH_SHORT).show();\n }\n } else {\n\n int rowsAffected = getContentResolver().update(mCurrentCourseUri, 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_course_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_course_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n }", "public static Course createEntity(EntityManager em) {\n Course course = new Course()\n .title(DEFAULT_TITLE)\n .description(DEFAULT_DESCRIPTION)\n .courseStartDate(DEFAULT_COURSE_START_DATE)\n .courseEndDate(DEFAULT_COURSE_END_DATE)\n .registerStartDate(DEFAULT_REGISTER_START_DATE)\n .registerEndDate(DEFAULT_REGISTER_END_DATE)\n .duration(DEFAULT_DURATION)\n .maximumNumberOfParticipants(DEFAULT_MAXIMUM_NUMBER_OF_PARTICIPANTS)\n .minimalNumberOfParticipants(DEFAULT_MINIMAL_NUMBER_OF_PARTICIPANTS)\n .lecturerName(DEFAULT_LECTURER_NAME)\n .lecturerSurname(DEFAULT_LECTURER_SURNAME)\n .pointPerCourse(DEFAULT_POINT_PER_COURSE)\n .isVisibleInApp(DEFAULT_IS_VISIBLE_IN_APP);\n return course;\n }", "public Optional<DbStudentEntity> create(\n final Id id,\n final String name,\n final String address,\n final String rollNo,\n final String collegeCode,\n final String courseCode);", "public Course(int id, String title) {\n this.id = id;\n this.title = title;\n }", "public CourseManager()\n\t{\n\t\tcourseOfferings = new TreeSet<>(new CourseComparator());\n\n\t\tnetwork = new TreeSet<>();\n\t}", "@Test\n public void constructorDefault() {\n final CourseType courseType = new CourseType();\n\n assertNull(courseType.getId());\n assertNull(courseType.getName());\n assertNull(courseType.getPicture());\n assertNull(courseType.getPosition());\n assertNull(courseType.getStatus());\n assertNull(courseType.getCourses());\n assertNull(courseType.getAllowedDishes());\n }", "public static void addCourse() {\n\t\t \r\n\t Scanner user_input = new Scanner(System.in);\r\n\t \r\n\t // input course name\r\n\t System.out.printf(\"%-35s %s\", \"Enter Course Name:\", \"\");\r\n\t Course_name = user_input.nextLine();\r\n\t \r\n\t // input vehicle Height checks if its numeric\r\n\t System.out.printf(\"%-35s %s\", \"Please Course ID:\", \"\");\r\n\t Course_ID = user_input.nextLine();\r\n\t \r\n\t System.out.printf(\"%-35s %s\", \"Enter pay rates per hour:\", \"\");\r\n\t Course_pay = user_input.nextInt();\r\n\t \r\n\t Course newCourse = new Course(Course_name, Course_ID, Course_pay);\t\t\t//Creats object for the course and adds to course array\r\n\t array.add(newCourse);\r\n\t \r\n\t System.out.printf(\"New Course created successfully for %s !%n\", Course_name);\r\n\t \r\n\t Admin.menuChoice();\r\n\t user_input.close();\r\n\t }", "int insertSelective(Course record);", "void create(Student entity);", "int insert(TrainingCourse record);", "@Override\r\n\tpublic void delete(org.holtz.eve.jpa.entity.TCsCourse course) {\n\r\n\t}", "@Transactional\n public Optional<Course> save(CourseDTO courseDTO) {\n CourseExists(courseDTO.getCourseCode());\n NumberOfStudentsInCourse(courseDTO.getId());\n Course course = courseMapper.mapFromCourseDTOtoCourse(courseDTO);\n course.setCreateTime(java.time.Clock.systemUTC().instant());\n course.setModifiedTime(java.time.Clock.systemUTC().instant());\n return Optional.of(courseDAO.save(course));\n }" ]
[ "0.7350077", "0.7243404", "0.6887928", "0.6874972", "0.6804459", "0.6787115", "0.66148806", "0.65737736", "0.65737736", "0.6558112", "0.64991003", "0.64819473", "0.6476087", "0.64719075", "0.646321", "0.64049315", "0.6387338", "0.62681174", "0.61681736", "0.6146063", "0.61040556", "0.6096005", "0.60910845", "0.6088644", "0.60840666", "0.5911287", "0.5883063", "0.58750737", "0.58703977", "0.5869308", "0.5758413", "0.5756217", "0.5750675", "0.5736452", "0.57352346", "0.57151437", "0.57151437", "0.5708523", "0.56944543", "0.5684264", "0.5659485", "0.5633506", "0.5611594", "0.55714464", "0.55584013", "0.5554069", "0.55518734", "0.55395025", "0.5537442", "0.54956275", "0.54943997", "0.5477351", "0.54718995", "0.547122", "0.5469127", "0.545587", "0.5429873", "0.5423159", "0.5420395", "0.5411903", "0.540262", "0.5402014", "0.539938", "0.53947806", "0.53890145", "0.53638405", "0.5335607", "0.5334275", "0.5300839", "0.52933055", "0.52864033", "0.5279626", "0.5255397", "0.52504176", "0.5246716", "0.52246785", "0.5223651", "0.52223486", "0.522203", "0.52149993", "0.52106154", "0.5208822", "0.51906365", "0.5181344", "0.5179721", "0.5170135", "0.5165064", "0.5164821", "0.5147461", "0.51468456", "0.5145239", "0.51424545", "0.51316845", "0.51252216", "0.5116234", "0.5115729", "0.5108799", "0.51011735", "0.5092496", "0.5084109" ]
0.63698226
17
Creates a Post without anything
public Post createTestPostObject(Course course) { Post post = new Post(makeRandomString(), makeRandomString(), course, new Date(), new Date()); return postRepository.save(post); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@PostMapping(\"/posts\")\n ResponseEntity<?> createPost(@RequestBody Post post) {\n post.setOwner(SecurityContextHolder.getContext().getAuthentication().getName());\n post.setDateCreated(LocalDateTime.now());\n\n EntityModel<Post> newPost = modelAssembler.toModel(postRepository.save(post));\n return ResponseEntity.created(newPost.getRequiredLink(IanaLinkRelations.SELF).toUri()).body(newPost);\n }", "private void createPost() {\n PostModel model = new PostModel(23, \"New Title\", \"New Text\");\n Call<PostModel> call = jsonPlaceHolderAPI.createPost(model);\n call.enqueue(new Callback<PostModel>() {\n @Override\n @EverythingIsNonNull\n public void onResponse(Call<PostModel> call, Response<PostModel> response) {\n if (!response.isSuccessful()) {\n textResult.setText(response.code());\n return;\n }\n PostModel postResponse = response.body();\n String content = \"\";\n assert postResponse != null;\n content += \"Code: \" + response.code() + \"\\n\";\n content += \"ID: \" + postResponse.getId() + \"\\n\";\n content += \"User ID: \" + postResponse.getUserId() + \"\\n\";\n content += \"Title: \" + postResponse.getUserId() + \"\\n\";\n content += \"Body: \" + postResponse.getText();\n textResult.append(content);\n }\n\n @Override\n @EverythingIsNonNull\n public void onFailure(Call<PostModel> call, Throwable t) {\n textResult.setText(t.getMessage());\n }\n });\n }", "@Override\n\tpublic Post createPost(Post post) {\n\t\treturn postDao.createPost(post);\n\t}", "public void createPost( BlogPost post );", "@PostMapping(\"/\")\n private ResponseEntity<Post> createPost(@RequestBody Post post) {\n User user = getCurrentUser();\n post.setCreated(new Date());\n post.setUserId(user.getId());\n post = postService.add(post);\n\n return new ResponseEntity<>(post, HttpStatus.OK);\n }", "@PostMapping(\"\")\n public ResponseEntity<Post> createPost(@Valid @RequestBody Post post) {\n return ResponseEntity.status(HttpStatus.CREATED)\n .body(postService.createPost(post));\n }", "public Post() {\n\t\t\n\t}", "Post save(Post post) throws Exception;", "CompletableFuture<PostResponse> createNewPost(Post post);", "@Test(enabled=false)\n\tpublic void createPostCheckBodyContents() {\n\t\tPosts posts = new Posts(\"4\", \"Packers\", \"Favre\");\n\t\t\n\t\tgiven().\n\t\twhen().contentType(ContentType.JSON).\n\t\tbody(posts).\n\t\tpost(\"http://localhost:3000/posts/\").\n\t\tthen().\n\t\tstatusCode(201).\n\t\tbody(\"id\", is(posts.getId())).\n\t\tbody(\"title\",is(posts.getTitle())).\n\t\tbody(\"author\",is(posts.getAuthor()));\n\t}", "public Post() {\n }", "public Post()\n {\n }", "@Test(enabled=true)\n\tpublic void createCompletePost() {\n\t\tPosts posts = new Posts(\"5\", \"Lakers\", \"Horry\");\n\t\t\n\t\tString id =\n\n\t\tgiven()\n\t\t.contentType(ContentType.JSON)\n\t\t.body(posts)\n\t\t.when()\n\t\t.post(\"http://localhost:3000/posts/\")\n\t\t.then()\n\t\t.statusCode(201)\n\t\t.extract()\n\t\t.path(\"id\");\n\t\t\n\t\tgiven()\n\t\t.pathParams(\"id\", id)\n\t\t.when().get(\"http://localhost:3000/posts/{id}\")\n\t\t.then()\n\t\t.statusCode(200)\n\t\t.body(\"id\", is(posts.getId()))\n\t\t.body(\"title\",is(posts.getTitle()))\n\t\t.body(\"author\",is(posts.getAuthor()));\n\t}", "@Test(expected = NullPointerException.class)\r\n public void createNewPostTest(){\r\n\r\n Post post = new Post();\r\n post.setUserId(2l);\r\n post.setCreatedAt(new GregorianCalendar(2015,5,8).getTime());\r\n post.setDescription(\"PEOPLE ARE BAD AT TAKING OVER FROM AUTONOMOUS CARS.\");\r\n post.setLikes(15);\r\n \r\n entityTransaction.begin();\r\n assertNull(\"Post ID must be null\" , post.getPostId());\r\n entityManager.persist(post);\r\n entityTransaction.commit(); \r\n\r\n post = new Post();\r\n post.setUserId(3000l);\r\n post.setCreatedAt(new GregorianCalendar(2016,5,8).getTime());\r\n post.setDescription(\"ROBOTIC FOOD DELIVERY IS ROLLING INTO THE UNITED STATES IN FEBRUARY.\");\r\n post.setLikes(115);\r\n \r\n entityTransaction.begin();\r\n entityManager.persist(post);\r\n entityTransaction.commit(); \r\n \r\n\r\n \r\n \r\n post = new Post();\r\n post.setUserId(1l);\r\n post.setCreatedAt(new GregorianCalendar(2015,5,7).getTime());\r\n post.setDescription(null);\r\n post.setLikes(5);\r\n \r\n if(post.getDescription()== null || post.getDescription().equals(\"\"))\r\n throw new NullPointerException();\r\n\r\n }", "@POST(\"posts\")\n Call<Post> createPost(@Body Post post);", "@Override\n public Post createPost(Post post, String token) throws TokenException {\n User user = sender.getUserFromUserAPI(token);\n if (user == null) {\n logger.info(\"Invalid token: \"+ token +\" User could not be retrieved\");\n throw new TokenException(\"Invalid Token.\");};\n post.setUserId(user.getUserId());\n post.setUser(user);\n Post savedPost = postRepository.save(post);\n return savedPost;\n }", "void savePost(Post post);", "@Test\n public void createPost() {\n User bob = new User(\"Jasdeep\",\"Madan\",\"JD\",\"[email protected]\",\"password\", \"member\", true, true).save();\n\n //Create a new Category and save it\n Category category = new Category(\"Tech\", \"Some Description\").save();\n\n // Create a new post\n new Article(\"My first post\", \"Hello world\", bob, category, true, null, null).save();\n\n // Test that the post has been created\n assertEquals(1, Article.count());\n\n // Retrieve all posts created by Bob\n List<Article> bobPosts = Article.find(\"byAuthor\", bob).fetch();\n\n // Tests\n assertEquals(1, bobPosts.size());\n Article firstPost = bobPosts.get(0);\n assertNotNull(firstPost);\n assertEquals(bob, firstPost.author);\n assertEquals(\"My first post\", firstPost.title);\n assertEquals(\"Hello world\", firstPost.content);\n assertNotNull(firstPost.submit_date);\n }", "@POST\n Call<Post> createPost(@Body Post post);", "public Post(){\n\n }", "@PostMapping(\"/posts/create\")\n @ResponseBody\n public String createPost() {\n return \"Create new post.\";\n }", "Mono<Post> create(String circleId, Post post);", "@PostMapping(\"/addPost\")\n public ResponseEntity addNewPost(@RequestBody Post post){\n postService.postNewInfo(post);\n return new ResponseEntity(HttpStatus.OK);\n }", "public Post addNewPost(@RequestBody NewPostBean post, String userTokenId);", "@FormUrlEncoded\n @POST(\"posts\")\n Call<Post> createPost(@Field(\"userId\") int userId, @Field(\"title\") String title, @Field(\"body\") String text);", "public Postoj() {}", "@PostMapping(\"/posts/create\")\n public String createPost(\n Model model,\n @RequestParam(name = \"title\") String title,\n @RequestParam(name = \"body\") String body,\n @RequestParam(name = \"team\") String teamIDString,\n @RequestParam(name = \"sport\") String sportIDString) {\n\n long teamID = Long.parseLong(teamIDString);\n long sportID = Long.parseLong(sportIDString);\n\n Team thisTeam = teamRepository.findOne(teamID);\n Sport thisSport = sportRepository.findOne(sportID);\n\n\n// Which user is being assigned to this post?\n\n User foundUser = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n User dbUser = userRepository.findOne(foundUser.getId());\n\n\n\n\n// Now it's time to actually make the post.\n\n Post post = new Post();\n post.setTitle(title);\n post.setBody(body);\n post.setSport(thisSport);\n post.setTeam(thisTeam);\n post.setAuthor(dbUser);\n\n postRepository.save(post);\n\n// After post is created, give user options to do something next\n\n Post createdPost = postRepository.findOne(post.getId());\n model.addAttribute(\"createdPost\", createdPost);\n\n\n// Send email commented out for now so I don't send an email every time\n\n// emailService.prepareAndSend(post, \"Congratulations James! You have been hired for this position\", \"You have been hired for this position: 1007A McDonalds Region Manager\");\n\n return \"posts/create-success\";\n }", "@PostMapping(\"/post\")\n PostDTO newPost(@RequestBody PostDTO postDTO);", "@FormUrlEncoded\n @POST(\"posts/\")\n Call<Post> createPostUrlFormatted(\n @Field(\"userId\") Integer id,\n @Field(\"title\") String title,\n @Field(\"body\") String body\n );", "@RequestMapping(value = \"/blog/newpost\", method = RequestMethod.POST)\n\tpublic String newPost(HttpServletRequest request, Model model) {\n\t\tString title=request.getParameter(\"title\");\n\t\tString body=request.getParameter(\"body\");\n\t\t\n\t\t//Validate parameters if not valid send back to form w/ error message\n\t\tif (title==\"\" || body==\"\"){\n\t\t\tif (title!=\"\"){\n\t\t\t\tmodel.addAttribute(\"title\",title);\n\t\t\t}\n\t\t\tif(body!=\"\"){\n\t\t\t\tmodel.addAttribute(\"body\",body);\n\t\t\t}\n\t\t\tmodel.addAttribute(\"error\",\"Post must have a Title and Body!\");\n\t\t\treturn \"newpost\";\n\t\t}\n\t\t\n\t\t//if they validate, create a new post\n\t\tInteger userId = (Integer) request.getSession().getAttribute(AbstractController.userSessionKey);\n\t\tUser author= userDao.findByUid(userId);\n\t\tPost post = new Post(title,body,author);\n\t\tpostDao.save(post);\n\t\tmodel.addAttribute(\"post\", post);\n\t\treturn \"redirect:\"+ post.getAuthor().getUsername()+\"/\"+ post.getUid(); \t\t\n\t}", "@Override\r\n\tpublic void createPost(Integer postID, Integer parentPostID,\r\n\t\t\tString posterName, String message, String[] imageName,\r\n\t\t\tString[] imageID) {\n\t\t\r\n\t}", "@Test\n public void createHouseholdUsingPostTest() throws ApiException {\n Household household = null;\n Household response = api.createHouseholdUsingPost(household);\n\n // TODO: test validations\n }", "@Test\n public void createPost() throws IOException {\n PostData postData = new PostData()\n .withId(101)\n .withUserId(1)\n .withTitle(\"New Post\")\n .withBody(\"This is the body of the post.\");\n\n // Create an HTTP Post Request\n HttpPost post = new HttpPost(POSTS);\n\n // Set the \"Content-type\" header of the\n // HTTP Post Request to \"Application/json; charset=UTF-8\"\n post.setHeader(\n CONTENT_TYPE,\n \"Application/json; charset=UTF-8\"\n );\n\n // Create a String Entity out of the JSON data and add it\n // to the HTTP Post Request.\n //\n // This will serialize the JSON data into a String\n post.setEntity(\n new StringEntity(\n this.gson.toJson(postData)\n )\n );\n\n // Execute the HTTP Post with the client\n HttpResponse response = this.httpClient.execute(post);\n\n // Get a PostData class instance from the response\n PostData responsePostData = getPostData(response);\n\n // Make assertions about the response\n assertThat(response.getStatusLine().getStatusCode())\n .isEqualTo(201);\n\n // Make assertions about the data returned\n assertThat(responsePostData.getId()).isEqualTo(101);\n assertThat(responsePostData.getUserId()).isEqualTo(1);\n assertThat(responsePostData.getTitle())\n .isEqualTo(postData.getTitle());\n assertThat(responsePostData.getBody())\n .isEqualTo(postData.getBody());\n }", "@Override\n\tpublic Post add(Post entity) {\n\t\treturn null;\n\t}", "public PostPO clickOnNewPost() {\n\t\tnewPost.click();\n\t\treturn new PostPO();\n\t}", "@Test(enabled=false)\n\tpublic void basicPost() {\t\n\t\tResponse res = \n\t\tgiven().\n\t\tbody(\" { \\\"id\\\": \\\"2\\\",\"\n\t\t\t\t+ \"\\\"title\\\": \\\"Cleveland\\\", \"\n\t\t\t\t+ \"\\\"author\\\": \\\"Kyrie\\\" }\").\n\t\twhen().\n\t\tcontentType(ContentType.JSON).\n\t\tpost(\"http://localhost:3000/posts/\");\n\t\n\t\tSystem.out.println(res.asString());\n\t}", "@Override\n public void onClick(View view) {\n CreatePost createPost = new CreatePost(context, selectedPic);\n createPost.execute(title.getText().toString(), description.getText().toString());\n }", "public void create(Post post) {\r\n jdbcOp.update(SQL_INSERT_TICKET,\r\n post.getCustomerName(),\r\n post.getSubject(), \r\n post.getBody(),\r\n post.getCategories());\r\n// for (String role : user.getRoles()) {\r\n// jdbcOp.update(SQL_INSERT_ROLE,\r\n// user.getUsername(),\r\n// role); \r\n }", "@Override\r\n\tpublic void addPost(Post post) {\n\t\tgetHibernateTemplate().save(post);\r\n\t}", "public CreatePost(Context context) {\n this.context = context;\n }", "private void createPostXML() {\n Call<PostModel> call = jsonPlaceHolderAPI.createPostXML(23, \"New Title\", \"New Text\");\n call.enqueue(new Callback<PostModel>() {\n @Override\n @EverythingIsNonNull\n public void onResponse(Call<PostModel> call, Response<PostModel> response) {\n if (!response.isSuccessful()) {\n textResult.setText(response.code());\n return;\n }\n PostModel postResponse = response.body();\n String content = \"\";\n assert postResponse != null;\n content += \"Code: \" + response.code() + \"\\n\";\n content += \"ID: \" + postResponse.getId() + \"\\n\";\n content += \"User ID: \" + postResponse.getUserId() + \"\\n\";\n content += \"Title: \" + postResponse.getUserId() + \"\\n\";\n content += \"Body: \" + postResponse.getText();\n textResult.append(content);\n }\n\n @Override\n @EverythingIsNonNull\n public void onFailure(Call<PostModel> call, Throwable t) {\n textResult.setText(t.getMessage());\n }\n });\n }", "@Test\n public void createEmptyPost_Post_ERROR() throws Exception {\n RequestBuilder requestBuilder = MockMvcRequestBuilders\n .post(\"/post\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(\"{\\\"title\\\":null,\\\"description\\\":\\\"bar\\\",\\\"userId\\\":\\\"1\\\"}\");\n\n// when(postService.createPost(any(), anyString(),anyString())).thenReturn(fakeSavedPost);\n\n mockMvc.perform(requestBuilder)\n .andExpect(status().isBadRequest())\n .andReturn();\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == CREATE_NEW_POST) {\n if (resultCode == RESULT_OK) {\n String user = data.getStringExtra(PostingActivity.USER);\n String subject = data.getStringExtra(PostingActivity.SUBJECT);\n String question = data.getStringExtra(PostingActivity.QUESTION);\n\n Post post = new Post(user, subject, question);\n postQuestion(post);\n }\n }\n }", "@RequestMapping(value=\"/fpost/new\",method = RequestMethod.POST)\r\n\tpublic ResponseEntity<Fpost> addNewFpost(@RequestBody Fpost fpost) {\r\n\t\tSystem.out.println(\"Adding new fpost\");\r\n\t\t\t\r\n\t\t\tboolean b =fpostDAO.add(fpost);\r\n\t\t\tif(b) System.out.println(\"fpost added Successfully\");\r\n\t\t\telse System.out.println(\"fpost NOT added\");\r\n\t\t\t\r\n\t\treturn new ResponseEntity<Fpost>(fpost, HttpStatus.OK);\r\n\t}", "public long ashirPostCreating(AshirBlogPostingHelper post) {\n long result;\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(Col_2, post.getPost());\n values.put(Col_3, post.getImage());\n //inserting valuse into table columns\n result = db.insert(NAME_OF_TABLE, null, values);\n db.close();\n return result;\n\n }", "public PostRecord() {\n super(PostTable.POST);\n }", "public void savePost(VBeatPostModel post) {\n AppLocalDB.getInstance().db.postDao().insertAll(post);\n }", "private void verifyPost() {\n if(TextUtils.isEmpty(newArticleTitle)){\n articleTitle.setError(\"Your post requires a title!\");\n articleTitle.requestFocus();\n return;\n }\n\n if(TextUtils.isEmpty(newArticleContent)){\n articleContent.setError(\"Your post requires a some content!\");\n articleContent.requestFocus();\n return;\n }\n\n // Pass in the calling activity such that official and team news are separated\n databaseReference = FirebaseDatabase.getInstance().getReference(callingActivity);\n\n String postId = databaseReference.push().getKey();\n\n NewsPost newsPost = new NewsPost(newArticleTitle, newArticleContent,\n newArticlePosterUsername, newArticlePosterProfileImage, dayDate, dayTime);\n\n databaseReference.child(postId).setValue(newsPost);\n\n // Close the activity\n finish();\n }", "@Then(\"^Post should be created successfully$\")\n\tpublic void post_should_be_created_successfully() throws Throwable {\n\t throw new PendingException();\n\t}", "@Test(enabled=false)\n\tpublic void objectPost() {\t\n\t\tPosts posts = new Posts(\"3\", \"Seahawks\", \"Wilson\");\n\t\t\n\t\tResponse res = given().\n\t\twhen().\n\t\tcontentType(ContentType.JSON).\n\t\tbody(posts).\n\t\tpost(\"http://localhost:3000/posts/\");\n\t\n\t\tSystem.out.println(\"Response as object: \"+res.asString());\n\t}", "private void createPostMap() {\n Map<String, String> map = new HashMap<>();\n map.put(\"userId\", \"12\");\n map.put(\"title\", \"New Title\");\n Call<PostModel> call = jsonPlaceHolderAPI.createPostMap(map);\n call.enqueue(new Callback<PostModel>() {\n @Override\n @EverythingIsNonNull\n public void onResponse(Call<PostModel> call, Response<PostModel> response) {\n if (!response.isSuccessful()) {\n textResult.setText(response.code());\n return;\n }\n PostModel postResponse = response.body();\n String content = \"\";\n assert postResponse != null;\n content += \"Code: \" + response.code() + \"\\n\";\n content += \"ID: \" + postResponse.getId() + \"\\n\";\n content += \"User ID: \" + postResponse.getUserId() + \"\\n\";\n content += \"Title: \" + postResponse.getTitle() + \"\\n\";\n content += \"Body: \" + postResponse.getText();\n textResult.append(content);\n }\n\n @Override\n @EverythingIsNonNull\n public void onFailure(Call<PostModel> call, Throwable t) {\n textResult.setText(t.getMessage());\n }\n });\n }", "private void postNewPost() {\n if (mIsReplyOnBulletin) {\n OperationManager operationManager = OperationManager.getInstance(NewPostActivity.this);\n operationManager.postNewReply(etNewPostMsg.getText().toString(),\n getIntent().getExtras().getLong(EXTRA_POST_ID), NewPostActivity.this);\n } else {\n OperationManager operationManager = OperationManager.getInstance(NewPostActivity.this);\n operationManager.postNewBulletin(etNewPostSubject.getText().toString()\n , etNewPostMsg.getText().toString(), mFilesAdapter.getData(), NewPostActivity.this);\n\n }\n finish();\n }", "@When(\"^I Create a post with title \\\"(.*?)\\\" and body \\\"(.*?)\\\"$\")\n\tpublic void i_Create_a_post_with_title_and_body(String title, String body) throws Throwable {\n\t\tString postsData = \"{\\\"title\\\":\\\" \"+ title + \"\\\",\" + \"\\\"body\\\":\\\" \" + body +\"}\";\n\t\t\t\t;\n\t\t\n\t\tresponse = request.when().body(postsData).post(\"/posts\");\n\t\tSystem.out.println(\"response: \" + response.prettyPrint());\n\t}", "protected abstract void sendNewPost(Discussion discussion, Post post);", "public Post(String user, String postContent, String webAddress) {\n this.orderPosted = nextOrderPosted;\n nextOrderPosted++;\n this.user = user;\n this.postContent = postContent;\n this.webAddress = webAddress;\n// this.myAuthor=myAuthor;\n\n }", "@RequestMapping(\"/post\")\n public String createPost(Model model) {\n if(!model.containsAttribute(\"message\")){\n model.addAttribute(\"message\", new Message());\n }\n\n return \"form\";\n }", "@Test\n\tpublic void testCreatePostLive() throws Exception\n\t{\n\t}", "@RequestMapping(value = \"/newPost\", method = RequestMethod.POST)\n\tpublic String setNewPost(@ModelAttribute(\"post\") @Valid Post post, BindingResult result, ModelMap model) {\n\n\t\tif (result.hasErrors()) {\n\t\t\tSystem.out.println(\"There are errors newPost\");\n\t\t\tmodel.addAttribute(\"allpostTypes\", postService.AllPostType());\n\t\t\treturn \"/admin/post/newPost\";\n\t\t}\n\n\t\tpost = createPost(post);\n\n\t\tLike like = new Like();\n\t\tlike.setPost(post);\n\t\tlikeService.saveLike(like);\n\n\t\tUser user = userService.findUserByUsername(getPrincipal());\n\t\tpost.setUser(user);\n\t\tpostService.updatePost(post);\n\n\t\tmodel.addAttribute(\"operationmessage\",\n\t\t\t\tmessageSource.getMessage(\"message.newpost.success\", null, LocaleContextHolder.getLocale()));\n\t\treturn \"redirect:/profile/\" + getPrincipal();\n\t}", "public void create(){}", "void sendPost(String title, String body);", "public LatestPost() {\n\t}", "private Posts() {\n }", "private void writeNewPost(String userId, String username, String title, String body) {\n String key = mDatabase.child(\"posts\").push().getKey();\n Post post = new Post(userId, username, title, body);\n Map<String, Object> postValues = post.toMap();\n\n Map<String, Object> childUpdates = new HashMap<>();\n childUpdates.put(\"/posts/\" + key, postValues);\n childUpdates.put(\"/user-posts/\" + userId + \"/\" + key, postValues);\n\n mDatabase.updateChildren(childUpdates);\n }", "public Post save(Post post) {\n return postsDao.save(post);\n }", "void create(T entity) throws Exception;", "public ViajeroEntity create (ViajeroEntity viajeroEntity){\n LOGGER.log(Level.INFO, \"Creando un review nuevo\");\n em.persist(viajeroEntity);\n return viajeroEntity;\n }", "Article createArticle();", "void create(int id, int authorId, String title);", "@Override\n\tpublic Model create() {\n\t\treturn null;\n\t}", "public static Result postAddPaper() {\n Form<PaperFormData> formData = Form.form(PaperFormData.class).bindFromRequest();\n Paper info1 = new Paper(formData.get().title, formData.get().authors, formData.get().pages,\n formData.get().channel);\n info1.save();\n return redirect(routes.PaperController.listProject());\n }", "public Todo create(long todoId);", "@Test\n public void createTemporaryRelatedContentUsingPOSTTest() throws ApiException {\n RelatedContentRepresentation relatedContent = null;\n RelatedContentRepresentation response = api.createTemporaryRelatedContentUsingPOST(relatedContent);\n\n // TODO: test validations\n }", "@GetMapping(\"/api/comment/create/{post_id}\")\n\tpublic ResponseEntity<Comment> createCommentForPost(@PathVariable(\"post_id\") Long post_Id,\n\t @RequestParam(defaultValue = \"{{name}}\") String name,\n\t @RequestParam(defaultValue = \"{{data}}\") String data\n\t)\n\t{\n\t\tif (!postRepo.existsById(post_Id)) {\n\t\t\treturn new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);\n\t\t}\n\n\t\t// Create the new comment and find the post\n\t\tComment comment = new Comment(name, data);\n\t\tPost post = postRepo.findPostById(post_Id);\n\n\t\taddCommentToPost(comment, post);\n\n\t\tcommentRepo.save(comment);\n\t\tpostRepo.save(post);\n\n\t\treturn new ResponseEntity<>(comment, HttpStatus.OK);\n\t}", "@Test\n public void testClientPostsNoBody() throws Exception {\n sendSimplePostRequest(3, null, false);\n\n // Headers\n parser.readFrame();\n output.clearTrace();\n\n parser.readFrame();\n\n Assert.assertEquals(\"3-RST-[11]\\n\", output.getTrace());\n }", "@Test\n public void postTest(){\n Post post = new Post(\"Title 1\",\"Body 1\");\n\n given().accept(ContentType.JSON)\n .and().contentType(ContentType.JSON)\n .body(post)\n .when().post(\"/posts\")\n .then().statusCode(201)\n .body(\"title\",is(\"Title 1\"),\n \"body\",is(\"Body 1\"),\n \"id\",is(101));\n }", "@Transactional(propagation = Propagation.REQUIRED, readOnly = false)\n\t@Override\n\tpublic void addPost(Post post) {\n\t\tpostDao.addPost(post);\n\t}", "public Builder clearPost() {\n copyOnWrite();\n instance.clearPost();\n return this;\n }", "@Override\n\tpublic Post toPost(PostDto postDto ) {\n\t\treturn new Post(employeeDao.readEmployeeById(postDto.getEmployeeId()), postDto.getBody(), LocalDateTime.now(), ticketDao.readTicket(postDto.getTicketId()));\n\t}", "public Post(User user, String content, String url) {\n //Updates static post counter variable by 1\n postCounter++;\n //Sets post id to current post counter value\n this.id = postCounter;\n //Fills fields with data added with the constructor\n this.user = user;\n this.content = content;\n this.url = url;\n }", "Post save(Post post, Long authorId, String category);", "public PostRecord(Integer id, Integer userId, String title, String body, String date) {\n super(PostTable.POST);\n\n set(0, id);\n set(1, userId);\n set(2, title);\n set(3, body);\n set(4, date);\n }", "public boolean addPost(Post post) throws SQLException\n {\n boolean isAdded=false;\n try\n {\n database = dbH.getReadableDatabase();\n dbH.openDataBase();\n ContentValues values = new ContentValues();\n values.put(\"postBody\", post.getPostBody());\n values.put(\"postedBy\", post.getPostedBy());\n values.put(\"postedAt\", post.getPostedAt());\n values.put(\"postID\", post.getPostID());\n values.put(\"image\" , post.getBitmap());\n\n isAdded=database.insert(\"Post\", null, values)>0;\n\n }\n catch(SQLException e)\n {\n e.printStackTrace();\n }\n finally{\n if(database!=null && database.isOpen())\n dbH.close();\n }\n return isAdded;}", "E create(E entity);", "E create(E entity);", "int insert(PmPost record);", "@Test\n void postTest() {\n URI uri = URI.create(endBody + \"/post\");\n\n // create a dummy body for easy JSON conversion\n QuestionText newQuestion = new QuestionText(\"Test\");\n\n // convert to json and send / store the response\n HttpResponse<String> response = HttpMethods.post(uri, gson.toJson(newQuestion));\n\n assertEquals(200, response.statusCode());\n }", "@Override\n public boolean create(Revue objet) {\n return false;\n }", "@Test (groups = \"create_post\")\n public void DTest_Show_Post_success(){\n\n System.out.println(\"Show PostID# \"+ createdPost);\n System.out.println(\"Generated Post Title: \"+ createdTitle);\n System.out.println(\"Generated Post Content: \"+ createdContent);\n System.out.println(\"Request to: \" + resourcePath + \"/\" + createdPost);\n\n given()\n .spec(RequestSpecs.generateToken())\n .get(String.format(\"%s/%s\",resourcePath,createdPost.toString()))\n .then()\n .body(\"data.id\", equalTo(createdPost))\n .and()\n .body(\"data.title\", equalTo(createdTitle))\n .and()\n .body(\"data.content\", equalTo(createdContent))\n .and()\n .statusCode(200)\n .spec(ResponseSpecs.defaultSpec());\n }", "public Post(long timeStamp, String userName, Long postId) {\n this.arrivalTime = timeStamp;\n this.userName = userName;\n this.totalScore = 10;\n this.postId = postId;\n }", "E create(Resource data);", "@GetMapping(path = \"create_post\")\n public String create_post(Model model){\n model.addAttribute(\"feed\" , new Feed() );\n return \"create_post\";\n }", "void create(T entity);", "public boolean create(ModelObject obj);", "@PostMapping()\n @ApiOperation(value = \"생성\")\n public ApiResult create(@RequestBody SampleDto sampleDto){\n log.info(\"Create\");\n\n return OK(\n sampleService.create(\n sampleDto.getTitle(), sampleDto.getDescription()\n )\n );\n }", "@Override\n\tpublic Post updatePost(Post post) {\n\t\treturn null;\n\t}", "@Test\n public void createBaasBusinessUsingPostTest() throws ApiException {\n CreateBaasBusinessCO baasBusinessCO = null;\n BaasBusinessVO response = api.createBaasBusinessUsingPost(baasBusinessCO);\n\n // TODO: test validations\n }", "@RequestMapping(method = RequestMethod.POST)\n public Bin create() {\n throw new NotImplementedException(\"To be implemented\");\n }", "void create(Model model) throws Exception;", "@POST\n @Path(\"/new\")\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n public Response createNewBlah(\n BlahPayload entity,\n @Context UriInfo uri,\n @Context HttpServletRequest request) {\n try {\n final long start = System.currentTimeMillis();\n final String authorId = BlahguaSession.ensureAuthenticated(request, true);\n if (!BlahguaSession.isAuthenticatedClient(request))\n throw new InvalidAuthorizedStateException();\n entity = getBlahManager().createBlah(LocaleId.en_us, authorId, entity);\n final Response response = RestUtilities.make201CreatedResourceResponse(entity, new URI(uri.getAbsolutePath() + entity.getId()));\n getSystemManager().setResponseTime(CREATE_BLAH_OPERATION, (System.currentTimeMillis() - start));\n return response;\n } catch (InvalidRequestException e) {\n return RestUtilities.make400InvalidRequestResponse(request, e);\n } catch (ResourceNotFoundException e) {\n return RestUtilities.make404ResourceNotFoundResponse(request, e);\n } catch (StateConflictException e) {\n return RestUtilities.make409StateConflictResponse(request, e);\n } catch (InvalidAuthorizedStateException e) {\n return RestUtilities.make401UnauthorizedRequestResponse(request, e);\n } catch (SystemErrorException e) {\n return RestUtilities.make500AndLogSystemErrorResponse(request, e);\n } catch (Exception e) {\n return RestUtilities.make500AndLogSystemErrorResponse(request, e);\n }\n }", "public Post(User user, String content) {\n //Updates static post counter variable by 1\n postCounter++;\n //Sets post id to current post counter value\n this.id = postCounter;\n this.user = user;\n this.content = content;\n }" ]
[ "0.7440482", "0.74346423", "0.73977154", "0.73348767", "0.7286598", "0.702004", "0.70136404", "0.6950119", "0.6909419", "0.68857515", "0.68435305", "0.6756766", "0.67363", "0.6715142", "0.66520166", "0.6641089", "0.6597919", "0.6564922", "0.6548229", "0.65253603", "0.6519238", "0.65161145", "0.6416626", "0.63229156", "0.63172174", "0.6291042", "0.6286589", "0.6225243", "0.6171736", "0.61703163", "0.61686075", "0.6153348", "0.6137625", "0.6134898", "0.60939556", "0.60936695", "0.6084188", "0.6064759", "0.6050574", "0.60413706", "0.60349053", "0.6018046", "0.5907141", "0.5904196", "0.59025204", "0.5894607", "0.5882224", "0.5876181", "0.5874285", "0.58188", "0.5813046", "0.58122575", "0.5804251", "0.5788896", "0.57813007", "0.5778914", "0.57642573", "0.57450074", "0.57414544", "0.57306904", "0.5727972", "0.5726208", "0.5724106", "0.57127374", "0.5711902", "0.5702246", "0.5700388", "0.56855357", "0.56839186", "0.5670063", "0.5667427", "0.5664743", "0.5664072", "0.56597805", "0.56511617", "0.5640303", "0.5637903", "0.5635464", "0.56223214", "0.56191134", "0.56075805", "0.5591626", "0.558904", "0.558904", "0.5587051", "0.55699426", "0.5568788", "0.5542619", "0.5541905", "0.5538396", "0.55348796", "0.5533238", "0.55324405", "0.55036813", "0.5500425", "0.5498184", "0.54864824", "0.548433", "0.54744184", "0.5457699" ]
0.6507745
22
nothing to do yet
@Override public void initialize(Bootstrap<SeqNumConfiguration> bootstrap) { }
{ "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 grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "private void kk12() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "private stendhal() {\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "public void method_4270() {}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "public void mo38117a() {\n }", "protected void mo6255a() {\n }", "private void getStatus() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "private void m50366E() {\n }", "@Override\n protected void getExras() {\n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private void strin() {\n\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "protected boolean func_70814_o() { return true; }", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "public void mo12628c() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "public void baocun() {\n\t\t\n\t}", "public void mo6081a() {\n }", "public abstract void mo70713b();", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void mo21877s() {\n }", "public void redibujarAlgoformers() {\n\t\t\n\t}", "public void mo55254a() {\n }", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "private static void iterator() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "public abstract void mo56925d();", "@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}", "@Override public int describeContents() { return 0; }", "@Override\n\tprotected void logic() {\n\n\t}", "public void mo115190b() {\n }", "public abstract void mo6549b();", "private void parseData() {\n\t\t\r\n\t}", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "public void mo21825b() {\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "void mo57277b();", "public void mo12930a() {\n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n public void memoria() {\n \n }", "public void mo3376r() {\n }", "public void identify() {\n\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo21793R() {\n }", "protected java.util.List x (java.lang.String r19){\n /*\n r18 = this;\n r0 = r18;\n r2 = r0.K;\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\n r2 = (java.util.List) r2;\n if (r2 == 0) goto L_0x000f;\n L_0x000e:\n return r2;\n L_0x000f:\n r12 = java.util.Collections.emptyList();\n r2 = r18.bp();\n r3 = r18.TaskHandler(r19);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r4 = r2.setDrawable(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n if (r4 != 0) goto L_0x0026;\n L_0x0021:\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0026:\n r13 = r2.getScaledMaximumFlingVelocity(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r14 = new java.io.ByteArrayOutputStream;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r2 = 2048; // 0x800 float:2.87E-42 double:1.0118E-320;\n r14.<creatCallTask>(r2);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13, r14);\t Catch:{ all -> 0x00f2 }\n r2 = r14.toByteArray();\t Catch:{ all -> 0x00f2 }\n r2 = com.duokan.kernel.DkUtils.decodeSimpleDrm(r2);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r4 = \"UTF-8\";\n r3.<creatCallTask>(r2, r4);\t Catch:{ all -> 0x00f2 }\n r2 = new org.json.JSONObject;\t Catch:{ all -> 0x00f2 }\n r2.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n if (r2 != 0) goto L_0x0055;\n L_0x004a:\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0055:\n r3 = \"pictures\";\n r15 = com.duokan.reader.common.getPhysicalYPixels.setDrawable(r2, r3);\t Catch:{ all -> 0x00f2 }\n r16 = new java.util.ArrayList;\t Catch:{ all -> 0x00f2 }\n r2 = r15.length();\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.<creatCallTask>(r2);\t Catch:{ all -> 0x00f2 }\n r2 = 0;\n L_0x0067:\n r3 = r15.length();\t Catch:{ all -> 0x00f2 }\n if (r2 >= r3) goto L_0x00d0;\n L_0x006d:\n r3 = r15.getJSONObject(r2);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_md5\";\n r7 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_url\";\n r6 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_size\";\n r8 = r3.getLong(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"width\";\n r10 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"height\";\n r11 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r4 = \".\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r2);\t Catch:{ all -> 0x00f2 }\n r4 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r17 = \"file:///stuffs/\";\n r0 = r17;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r7);\t Catch:{ all -> 0x00f2 }\n r3 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n r3 = r18;\n r3 = r3.setDrawable(r4, r5, r6, r7, r8, r10, r11);\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.add(r3);\t Catch:{ all -> 0x00f2 }\n r2 = r2 + 1;\n goto L_0x0067;\n L_0x00d0:\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r1 = r16;\n r2.putIfAbsent(r0, r1);\t Catch:{ all -> 0x00f2 }\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\t Catch:{ all -> 0x00f2 }\n r2 = (java.util.List) r2;\t Catch:{ all -> 0x00f2 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n r18.bq();\n goto L_0x000e;\n L_0x00f2:\n r2 = move-exception;\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n throw r2;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n L_0x00fa:\n r2 = move-exception;\n r2 = r12;\n L_0x00fc:\n r18.bq();\n goto L_0x000e;\n L_0x0101:\n r2 = move-exception;\n r18.bq();\n throw r2;\n L_0x0106:\n r3 = move-exception;\n goto L_0x00fc;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.duokan.reader.domain.bookshelf.jv.MyContextWrapper(java.lang.String):java.util.List\");\n }", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "public void mo21878t() {\n }", "@Override\r\n\tprotected void processInit() {\n\r\n\t}", "private void init() {\n\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic int sub() {\n\t\treturn 0;\r\n\t}", "@Override\n public void preprocess() {\n }", "@Override\n public int retroceder() {\n return 0;\n }" ]
[ "0.6106569", "0.60834163", "0.6064461", "0.6015456", "0.59833896", "0.5946322", "0.59131056", "0.5862406", "0.5862406", "0.5840434", "0.5813796", "0.5810636", "0.5802016", "0.5800202", "0.5793572", "0.5790893", "0.577759", "0.5761792", "0.5761074", "0.5757549", "0.5749601", "0.57429975", "0.5716308", "0.57099295", "0.56784666", "0.56614083", "0.56385046", "0.56307936", "0.5628827", "0.56258684", "0.5625223", "0.56242096", "0.56242096", "0.56194216", "0.5614741", "0.5605735", "0.5597762", "0.5575846", "0.55452347", "0.554213", "0.554213", "0.554213", "0.554213", "0.554213", "0.554213", "0.554213", "0.5527121", "0.55238444", "0.55133426", "0.5496193", "0.5489599", "0.5486064", "0.54795647", "0.5475406", "0.5473728", "0.5460488", "0.5457497", "0.54440457", "0.54413104", "0.5438781", "0.54349214", "0.5422613", "0.5415786", "0.54107183", "0.5409447", "0.53939515", "0.53939515", "0.53878236", "0.53810465", "0.5379817", "0.5370255", "0.53628886", "0.5361535", "0.53554976", "0.53554153", "0.5346635", "0.5345538", "0.5344374", "0.534375", "0.5336419", "0.53269273", "0.53259814", "0.53253925", "0.5317175", "0.5313549", "0.53087884", "0.5308013", "0.53040594", "0.53024524", "0.5301352", "0.52962744", "0.5287651", "0.5283941", "0.527806", "0.5273071", "0.5269823", "0.526848", "0.5266955", "0.5266739", "0.5266666", "0.5265264" ]
0.0
-1
Created by mauchilan on 20/3/17.
public interface UsuarioDao extends GenericDao<Usuario, Integer> { List<Usuario> getAllUsuario(); List<Usuario> getUsuarioByEstado(Object[] parameters); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void anular() {\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 int describeContents() { return 0; }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void gored() {\n\t\t\n\t}", "private void m50366E() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public void init() {\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n protected void initialize() {\n\n \n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n public void init() {}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "@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 init() {\n\n\t}", "@Override\n protected void init() {\n }", "private void kk12() {\n\n\t}", "private void strin() {\n\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n protected void initialize() \n {\n \n }", "public void method_4270() {}", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void init() {\n\t}", "public void mo4359a() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n public void initialize() { \n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override public int describeContents() { return 0; }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "public void m23075a() {\n }", "@Override\n public int getSize() {\n return 1;\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n public void init() {\n }" ]
[ "0.5955577", "0.5804739", "0.58047175", "0.5731462", "0.5688046", "0.5667873", "0.5667873", "0.56401175", "0.56342286", "0.5622523", "0.5597232", "0.55538785", "0.55490303", "0.55433077", "0.5530508", "0.55272937", "0.5527241", "0.5527241", "0.5527241", "0.5527241", "0.5527241", "0.552249", "0.5513638", "0.5512346", "0.54939944", "0.54863197", "0.5480339", "0.547881", "0.54687667", "0.5462566", "0.5446623", "0.5446623", "0.54421085", "0.5439613", "0.54377073", "0.5418196", "0.54167134", "0.5415534", "0.541002", "0.5405157", "0.5405157", "0.5405157", "0.5405157", "0.5405157", "0.5405157", "0.53959906", "0.53933996", "0.5389351", "0.53844756", "0.53833085", "0.5377471", "0.5377471", "0.5377471", "0.5373367", "0.53650445", "0.53644997", "0.5359465", "0.53505003", "0.5349402", "0.5349402", "0.53474504", "0.5347219", "0.5347219", "0.5347219", "0.5340887", "0.53373075", "0.53373075", "0.53373075", "0.5320892", "0.53197384", "0.5319394", "0.53188187", "0.5317716", "0.5313303", "0.5313254", "0.53034204", "0.5298624", "0.5289745", "0.52822053", "0.52612525", "0.52544105", "0.52544105", "0.5250157", "0.52396435", "0.52369756", "0.52369756", "0.5235614", "0.52313876", "0.52313876", "0.52313876", "0.52313876", "0.52313876", "0.52313876", "0.52313876", "0.52201754", "0.5216488", "0.52014077", "0.5199073", "0.5194406", "0.5186747", "0.51850134" ]
0.0
-1
in every 2 hours period do this check whether there is a must send notification by checking database if so send it.
@Scheduled(fixedRateString = "PT120M") void someJob(){ // String s = "Testing message.\nNow time is : "+new Date(); //// System.out.println(s); // PushNotificationOptions.sendMessageToAllUsers(s); // //get all schedules in current dayOfWeek Collection<Notification> notifications = notificationService.findAllByDayOfWeekAndTime(); for(Notification notification : notifications){ // System.out.println(notification.toString()); // System.out.println(!notification.getStatus()); //// System.out.println(check(notification.getStartTime())); // //check for already not sent notifications , also check for time difference < TIME_CONSTANT // if(!notification.getStatus() && check(notification.getStartTime())){ // //send push notification // PushNotificationOptions.sendMessageToAllUsers(notification.getMessage()); // //mark the notification as sent // notificationService.setStatus(notification.getNotificationId()); // } if(checkForDayTime()){ PushNotificationOptions.sendMessageToAllUsers(notification.getMessage()); notificationService.setStatus(notification.getNotificationId()); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Scheduled(fixedRate = 60_000)\n public void checkEventTime() {\n isTimeService.findAll().forEach(event -> {\n if (event.getSchedulledTime().isBefore(LocalDateTime.now())) {\n this.producer.sendReachTimeMessage(new IsTime(event.getMessageId()));\n this.isTimeService.deleteById(event.getSchedulledId());\n }\n });\n// log.info(\"Schedulled time check.\");\n }", "private void check() {\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n Date date = new Date();\n Date date2 = new Date();\n\n Calendar calendar = Calendar.getInstance();\n date = calendar.getTime();\n\n // Se traen todos los miembros.\n Iterator e = memberBroker.getList(\"name\", \"ASC\");\n membersData member;\n accountsData account;\n //Calendar hoy = Calendar.getInstance();\n StringBuffer managerBody = new StringBuffer(\"\");\n StringBuffer memberBody = new StringBuffer(\"\");\n sendMail sm = new sendMail();\n\n\n while (e.hasNext()) { \n member = new membersData();\n account = new accountsData();\n member = (membersData) e.next();\n account=(accountsData) accountBroker.getData(member.getId_account());\n \n \n System.out.println(\"CHECKING (\" + member.getname() + -+member.getid() + -+member.getId_account() + \")\");\n\n //String mainURL = TMSConfigurator.getMainURL();\n String mainURL = account.getMain_url();\n managerBody = new StringBuffer(\"\");\n\n memberBody = new StringBuffer(\"\");\n\n // Se toma la fecha de hoy y la fecha de expiracion y se calcula la diferencia\n date2 = member.getExpired_date();\n long days = daysBetween(new Date(date.getTime()), new Date(date2.getTime()));\n \n if (days == 1) {\n System.out.println(\"un dia antes\");\n memberBody.append(\"Cuenta: \" + member.getname() + \"<br>\");\n memberBody.insert(0, \"La cuenta esta apunto de expirar le queda \" + days + \".<br>\");\n sm.sendCheckTasks(member.getemail_work(), memberBody.toString());\n\n managerBody.append(\"<BLOCKQUOTE>Miembro: \" + member.getname() + \"<br>\");\n managerBody.insert(0, \"La cuenta esta apunto de expirar le queda \"+days+\".<br>\");\n \n sm.sendCheckTasks(account.getEmail(),\n managerBody.toString());\n sm.sendCheckTasks(account.getEmail(),\n managerBody.toString());\n\n }\n if (days == 0) {\n System.out.println(\"ultimo dia\");\n memberBody.append(\"Cuenta: \" + member.getname() + \"<br>\");\n memberBody.insert(0, \"La cuenta esta apunto de expirar le queda \" + days + \".<br>\");\n sm.sendCheckTasks(member.getemail_work(), memberBody.toString());\n\n managerBody.append(\"<BLOCKQUOTE>Miembro: \" + member.getname() + \"<br>\");\n managerBody.insert(0, \"La cuenta esta apunto de expirar le queda \"+days+\".<br>\");\n \n sm.sendCheckTasks(account.getEmail(),\n managerBody.toString());\n sm.sendCheckTasks(account.getEmail(),\n managerBody.toString());\n }\n if (days == 7) {\n System.out.println(\"a una semana\");\n memberBody.append(\"Cuenta: \" + member.getname() + \"<br>\");\n memberBody.insert(0, \"La cuenta esta apunto de expirar le queda \" + days + \".<br>\");\n sm.sendCheckTasks(member.getemail_work(), memberBody.toString());\n\n managerBody.append(\"<BLOCKQUOTE>Miembro: \" + member.getname() + \"<br>\");\n managerBody.insert(0, \"La cuenta esta apunto de expirar le queda \"+days+\".<br>\");\n \n sm.sendCheckTasks(account.getEmail(),\n managerBody.toString());\n sm.sendCheckTasks(account.getEmail(),\n managerBody.toString());\n }\n /*if (hoy.getTimeInMillis() > end) {\n // Ya estas atrasado mas alla del umbral maximo permitido!!\n System.out.println(\"\\t\\t\\tAtrasada!!\");\n if (atrasadoEquipo == false) {\n // Al menos un miembro del equipo esta atrazado.\n managerBody.append(\"Proyecto: \" + proyecto.getname() + \"<br>\");\n atrasadoEquipo = true;\n }\n if (atrasado == false) {\n // Este member no estaba atrasado, se agrega el encabezado para\n // su email. \n memberBody.append(\"Proyecto: \" + proyecto.getname() + \"<br>\");\n managerBody.append(\"<BLOCKQUOTE>Miembro: \" + team.getparentMember().getname() + \"<br>\");\n }\n if (team.getparentMember().getprofile().equals(\"0\") ||\n team.getparentMember().getprofile().equals(\"1\")) {\n // Siempre el mensaje de atrazo, pero no es un usuario externo\n memberBody.append(\"<BLOCKQUOTE>Tarea (<a href='\" + mainURL + \"/tasks.do?operation=view&id=\" +\n task.getid() + \"'>\" + task.getname() + \"</a>):\\tAtrasada<br>\" +\n \"</BLOCKQUOTE>\");\n } else {\n // Se trata de un usuario del cliente\n memberBody.append(\"<BLOCKQUOTE>Tarea (<a href='\" + mainURL + \"/portalTasks.do?operation=view&id=\" +\n task.getid() + \"'>\" + task.getname() + \"</a>):\\tAtrasada<br>\" +\n \"</BLOCKQUOTE>\");\n }\n managerBody.append(\"<BLOCKQUOTE>Tarea (<a href='\" + mainURL + \"/tasks.do?operation=view&id=\" +\n task.getid() + \"'>\" + task.getname() + \"</a>):\\tAtrasada<br>\" + \"\\t Asignada a: \" +\n (task.getassigned_to() == 0 ? \"No Asignada\" : task.getparentAssigned().getname()) +\n \"</BLOCKQUOTE>\");\n // Se cambia el valor\n atrasado = true;\n } else {\n System.out.println(\"\\t\\t\\tOK!!\");\n }\n // Se le envia el email al miembro del equipo si y solo si esta atrazado\n if (atrasado) {\n // enviar correo al usuario\n memberBody.insert(0, \"Las siguientes tareas est&aacute;n atrasadas m&aacute;s all&aacute; del umbral de tolerancia permitido.<br>\");\n managerBody.append(\"</BLOCKQUOTE>\");\n sm.sendCheckTasks(team.getparentMember().getemail_work(),\n memberBody.toString());\n }\n // Si alguien del proyecto esta atrazado se envia la lista de cada member\n // al administrador\n if (atrasadoEquipo) {\n managerBody.insert(0, \"Las siguientes tareas est&aacute;n atrasadas m&aacute;s all&aacute; del umbral de tolerancia permitido.<br>\");\n sm.sendCheckTasks(proyecto.getparentOwner().getemail_work(),\n managerBody.toString());\n }\n */\n\n\n // while de miembros\n\n\n }\n }", "protected void notificationOnExpiration() {\n }", "private boolean neededToRequestPushWooshServer(Context context)\n\t{\n\t\tCalendar nowTime = Calendar.getInstance();\n\t\tCalendar tenMinutesBefore = Calendar.getInstance();\n\t\ttenMinutesBefore.add(Calendar.MINUTE, -10); // decrement 10 minutes\n\n\t\tCalendar lastPushWooshRegistrationTime = Calendar.getInstance();\n\t\tlastPushWooshRegistrationTime.setTime(new Date(PreferenceUtils.getLastRegistration(context)));\n\n\t\tif (tenMinutesBefore.before(lastPushWooshRegistrationTime) && lastPushWooshRegistrationTime.before(nowTime))\n\t\t{\n\t\t\t// tenMinutesBefore <= lastPushWooshRegistrationTime <= nowTime\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private void sendNotification() {\n }", "static void sendNotifications() {\n\t\testablishConnection();\n\t\tSystem.out.println(\"sending multiple notificatiosn\");\n\t}", "private void createScheduledNotification(List<SessionModel> values, int test)\n\t{\n\n\t\t// Get new calendar object and set the date to now\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTimeInMillis(System.currentTimeMillis());\n\t\t// Add defined amount of days to the date\n\n\t\tgetBaseContext();\n\t\t// Retrieve alarm manager from the system\n\t\tAlarmManager alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);\n\n\t\tfor (SessionModel element : values) {\n\n\t\t\tString[] ymd = element.getStartDateSplit();\n\t\t\tint month = Integer.parseInt(ymd[0]);\n\t\t\tint date = Integer.parseInt(ymd[1]);\n\t\t\tint year = Integer.parseInt(ymd[2]);\n\n\t\t\tString[] hm = element.getStartTimeSplit();\n\t\t\tint hour = Integer.parseInt(hm[0]);\n\t\t\tint min = Integer.parseInt(hm[1]);\n\n\t\t\tcalendar.set(Calendar.YEAR, year);\n\t\t\tcalendar.set(Calendar.MONTH, month);\n\t\t\tcalendar.set(Calendar.DATE, date);\n\t\t\tcalendar.set(Calendar.HOUR, hour);\n\t\t\tcalendar.set(Calendar.MINUTE, min);\n\n\t\t\tlong secs = calendar.getTimeInMillis();\n\t\t\tsecs -= 600000;\n\t\t\tcalendar.setTimeInMillis(secs);\n\t\t\tLog.w(\"AlarmManager-TDC2014 \", \"Setting Alarm Time : \" + calendar.toString());\n\t\t\tint id = (int) System.currentTimeMillis();\n\t\t\tIntent intent = new Intent(\"net.redirectme.apps.SESSION_NOTIFY\");\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TEXT, element.getId());\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TITLE, element.getName());;\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SUBJECT, element.getAuthor());\n\n\t\t\tint trackIcon = element.getTrackIcon();\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SHORTCUT_ICON, trackIcon);\n\n\n\t\t\tPendingIntent pendingIntent = PendingIntent.getBroadcast(this, id, intent, PendingIntent.FLAG_ONE_SHOT);\n\t\t\talarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);\n\n\t\t}\n\t\tif(test==1)\n\t\t{\n\t\t\t// 5secs from now\n\t\t\tcalendar.setTimeInMillis(System.currentTimeMillis() + 10000);\n\t\t\tLog.w(\"AlarmManager-TEST \", \"Setting Alarm Time : \" + calendar.getTime());\n\t\t\tint id = (int) System.currentTimeMillis();\n\t\t\tIntent intent = new Intent(\"net.redirectme.apps.SESSION_NOTIFY\");\n\t\t\tlong value = 1;\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TEXT, value);\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TITLE, \"Test Session\");;\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Sanjeev BA\");\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SHORTCUT_ICON, R.drawable.track_43_general);\n\n\t\t\tPendingIntent pendingIntent = PendingIntent.getBroadcast(this, id, intent, 0);\n\t\t\talarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);\n\t\t}\n\n\t}", "@Override\n public void run() {\n Calendar calendar = Calendar.getInstance();\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n String dateTime = simpleDateFormat.format(calendar.getTime());\n\n //Find the current time\n SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat(\"hh:mm:ss a\");\n String currentTime = simpleDateFormat1.format(calendar.getTime());\n\n //Find duration of current date and first day\n Date date1,date2;\n String dateStr1 = data.getDate();\n String dateStr2 = dateTime;\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\");\n try{\n date1 = sdf.parse(dateStr1);\n date2 = sdf.parse(dateStr2);\n long diff = date2.getTime() - date1.getTime();\n long totalDay = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channel = new NotificationChannel(\"My Notification\", \"My Notification\", NotificationManager.IMPORTANCE_DEFAULT);\n NotificationManager manager = getSystemService(NotificationManager.class);\n manager.createNotificationChannel(channel);\n }\n\n //Exercise Time\n if(totalDay==0 || totalDay==1 || (totalDay>4+dayInSpace && totalDay<=10+dayInSpace)){\n if (currentTime.equals(\"05:00:00 PM\")) {\n NotificationExercise();\n }\n }\n\n if(totalDay==2){\n if (currentTime.equals(\"08:00:00 PM\")) {\n NotificationExercise();\n }\n }\n\n if(totalDay==3){\n if (currentTime.equals(\"10:00:00 PM\")) {\n NotificationExercise();\n }\n }\n\n if(totalDay>=5 && totalDay<=4+dayInSpace){\n if (currentTime.equals(\"03:00:00 AM\")) {\n NotificationExercise();\n }\n }\n\n //Eating time (After half hour wake up-breakfast, After five hours wake up-lunch, Before four hours sleep-dinner)\n if(totalDay==0 || totalDay==1){\n if (currentTime.equals(\"07:30:00 AM\") || currentTime.equals(\"12:00:00 PM\") || currentTime.equals(\"07:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay==2){\n if (currentTime.equals(\"08:30:00 AM\") || currentTime.equals(\"01:00:00 PM\") || currentTime.equals(\"10:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay==3){\n if (currentTime.equals(\"10:30:00 AM\") || currentTime.equals(\"03:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay==4){\n if (currentTime.equals(\"12:00:00 AM\") || currentTime.equals(\"12:30:00 PM\") || currentTime.equals(\"05:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay>=5 && totalDay<=4+dayInSpace){\n if (currentTime.equals(\"05:00:00 AM\") || currentTime.equals(\"03:30:00 PM\") || currentTime.equals(\"08:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay>4+dayInSpace && totalDay<=10+dayInSpace){\n if (currentTime.equals(\"08:30:00 AM\") || currentTime.equals(\"01:00:00 PM\") || currentTime.equals(\"7:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n //Take Melatonin time\n if(totalDay>=5 && totalDay<5+dayInSpace){\n if (currentTime.equals(\"09:00:00 AM\")) {\n NotificationTakeMelatonin();\n }\n }\n\n if(totalDay>=4+dayInSpace && totalDay<=6+dayInSpace){\n if (currentTime.equals(\"11:00:00 PM\")) {\n NotificationTakeMelatonin();\n }\n }\n\n //Nap time\n if(totalDay>=4 && totalDay<4+dayInSpace){\n if (currentTime.equals(\"06:00:00 PM\")) {\n NotificationNap();\n }\n }\n\n if(totalDay>=4 && totalDay<4+dayInSpace){\n if (currentTime.equals(\"08:00:00 PM\")) {\n NotificationNap();\n }\n }\n\n //Sleep Time\n if(totalDay==0){\n if (currentTime.equals(\"12:00:00 AM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay==0 || totalDay==1){\n if (currentTime.equals(\"11:00:00 PM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay==3){\n if (currentTime.equals(\"02:00:00 AM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay==4){\n if (currentTime.equals(\"04:00:00 AM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay>=5 && totalDay<5+dayInSpace){\n if (currentTime.equals(\"09:00:00 AM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay>=4+dayInSpace && totalDay<=10+dayInSpace){\n if (currentTime.equals(\"11:00:00 PM\")) {\n NotificationSleep();\n }\n }\n\n //Wake Up Time\n if(totalDay==0 || totalDay==1){\n if (currentTime.equals(\"07:00:00 AM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay==2){\n if (currentTime.equals(\"08:00:00 AM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay==3){\n if (currentTime.equals(\"10:00:00 AM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay==4){\n if (currentTime.equals(\"12:00:00 PM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay>=5 && totalDay<5+dayInSpace){\n if (currentTime.equals(\"03:00:00 PM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay>=5+dayInSpace && totalDay<=10+dayInSpace){\n if (currentTime.equals(\"08:00:00 AM\")) {\n NotificationWakeUp();\n }\n }\n\n }catch(ParseException e){\n Log.d(\"error\",\"error\");\n }\n }", "public static void updateNotification(Context context) {\n Alibi alibi = (Alibi) context.getApplicationContext();\n UserEvent event = alibi.getUserEventManager().getCurrentEvent();\n\n /* Don't set a notification if there isn't already one active; if the\n * event has not been running as long as the reminder interval, there\n * hasn't been a notification set yet.\n */\n long interval = alibi.getSettingsManager().getReminderDelayMillis();\n long startTime = event.getStartTime();\n long currentTime = System.currentTimeMillis();\n\n if (currentTime >= startTime + interval)\n setNotification(context, getNotificationMessage(event));\n }", "public void sendAccountExpirationHalfWayEmail() throws MessagingException{\r\n\t\tList<Account> accounts = accountRepository.findAll();\r\n\t\tfor( Account acc: accounts)\t{\r\n\t\t\tif(acc.getAlwaysActive() == false && acc.getActive()==true && acc.getType()==AccountType.TRIAL && acc.getExpirationDate() == null){\r\n\t\t\t\tint comparatorVal = DateTimeComparator.getDateOnlyInstance()\r\n\t\t\t\t\t\t.compare((new DateTime(acc.getStartDate()).plusDays(getTrial.getHalfwayDays())), new DateTime());\r\n\t\t\t\tif(comparatorVal==0){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tsendHalfWayTrialEmail(acc.getUser().getUsername());\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(MessagingException e){\r\n\t\t\t\t\t\tlog.error(\"exception while sending email to \"+acc.getUser().getUsername());\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}", "private void sendEmailToSubscriberForHealthTips() {\n\n\n\n }", "@Override\n\t\t\tpublic void doTimerCheckWork() {\n\n\t\t\t\tif (CommonUtil.isWifiApEnabled(mWifiManager)) {\n\t\t\t\t\tLog.v(TAG, \"Wifi enabled success!\");\n\t\t\t\t\tIntent intentService = new Intent(mContext,\n\t\t\t\t\t\t\tProcessMsgService.class);\n\t\t\t\t\tmContext.startService(intentService);\n\t\t\t\t\tString action = Constants.ACTION_HOTSPOT_AVAILABLE;\n\t\t\t\t\tIntent intent = new Intent(action);\n\t\t\t\t\tmContext.sendBroadcast(intent);\n\t\t\t\t\tthis.exit();\n\t\t\t\t} else {\n\t\t\t\t\tString action = Constants.ACTION_HOTSPOT_UNAVAILABLE;\n\t\t\t\t\tIntent intent = new Intent(action);\n\t\t\t\t\tmContext.sendBroadcast(intent);\n\t\t\t\t\tLog.v(TAG, \"Wifi enabled failed!\");\n\t\t\t\t}\n\t\t\t}", "protected void checkNotifications() {\n List<PushNotification> polled;\n boolean onlyOne;\n\n // Leave this mutually exclusive section as fast as possible...\n lock.lock();\n try {\n if (stopped) {\n LOGGER.debug(\"Push notification service stopped. Aborting polling of queue...\");\n return;\n }\n\n PushNotification first = submittedNotifcations.poll();\n if (null == first) {\n // Queue has no notification with an expired delay\n LOGGER.debug(\"Queue has no notification with an expired delay and holds {} buffered notifications\", I(submittedNotifcations.size()));\n return;\n }\n\n // Check for more\n PushNotification notification = submittedNotifcations.poll();\n if (notification != null) {\n polled = new LinkedList<>();\n polled.add(first);\n LOGGER.debug(\"Polled notification \\\"{}\\\" for user {} in context {} from queue\", first.getTopic(), I(first.getUserId()), I(first.getContextId()));\n do {\n polled.add(notification);\n LOGGER.debug(\"Polled notification \\\"{}\\\" for user {} in context {} from queue\", notification.getTopic(), I(notification.getUserId()), I(notification.getContextId()));\n notification = submittedNotifcations.poll();\n } while (null != notification);\n onlyOne = false;\n } else {\n polled = Collections.singletonList(first);\n LOGGER.debug(\"Polled notification \\\"{}\\\" for user {} in context {} from queue\", first.getTopic(), I(first.getUserId()), I(first.getContextId()));\n onlyOne = true;\n }\n\n if (submittedNotifcations.isEmpty()) {\n cancelTimerTask();\n LOGGER.debug(\"Dropped polling timer task since queue is currently empty\");\n }\n } finally {\n lock.unlock();\n }\n\n if (onlyOne) {\n // There was only a single one available\n PushNotification first = polled.get(0);\n NotificationsHandler task = new NotificationsHandler(first);\n if (tryExecuteTask(task, first.getUserId(), first.getContextId())) {\n LOGGER.debug(\"Submitted delivery of polled notification with topic \\\"{}\\\" to user {} in context {}\", first.getTopic(), I(first.getUserId()), I(first.getContextId()));\n } else {\n // Processor rejected task execution. Perform with current thread.\n task.run();\n }\n } else {\n // Handle them all\n Map<ContextAndTopicKey, Map<Integer, List<PushNotification>>> polledNotificationsPerContextAndTopic = new LinkedHashMap<>();\n for (PushNotification notification : polled) {\n put(notification, polledNotificationsPerContextAndTopic);\n }\n for (Map.Entry<ContextAndTopicKey, Map<Integer, List<PushNotification>>> entry : polledNotificationsPerContextAndTopic.entrySet()) {\n ContextAndTopicKey key = entry.getKey();\n Map<Integer, List<PushNotification>> notificationsPerUser = entry.getValue();\n NotificationsHandler task = new NotificationsHandler(key.contextId, key.topic, notificationsPerUser);\n if (tryExecuteTask(task, -1, key.contextId)) {\n if (LOGGER.isDebugEnabled()) {\n int[] userIds = Coll2i(notificationsPerUser.keySet());\n Object sUserIds = userIds.length <= 10 ? toStringObjectFor(userIds) : null;\n userIds = null;\n if (sUserIds == null) {\n LOGGER.debug(\"Submitted delivery of polled notifications with topic \\\"{}\\\" to users in context {}\", key.topic, I(key.contextId));\n } else {\n LOGGER.debug(\"Submitted delivery of polled notifications with topic \\\"{}\\\" to users {} in context {}\", key.topic, sUserIds, I(key.contextId));\n }\n }\n } else {\n // Processor rejected task execution. Perform with current thread.\n task.run();\n }\n }\n }\n }", "private void selfCheck()\n {\n createSession();\n\n // Verify that we can create a mail body\n ImmutableNotification notification = Notification.builder(Instant.now(), \"message\")\n .siteId(1)\n .projectName(\"project\")\n .projectId(2)\n .workflowName(\"workflow\")\n .revision(\"revision\")\n .attemptId(3)\n .sessionId(4)\n .taskName(\"task\")\n .timeZone(ZoneOffset.UTC)\n .sessionUuid(UUID.randomUUID())\n .sessionTime(OffsetDateTime.now())\n .workflowDefinitionId(5L)\n .build();\n try {\n body(notification);\n }\n catch (Exception e) {\n throw ThrowablesUtil.propagate(e);\n }\n }", "private void scheduleNotification(Notification notification) {\n\n Intent notificationIntent2 = new Intent(MainActivity.this, NotificationPublisher.class);\n notificationIntent2.putExtra(NotificationPublisher.NOTIFICATION_ID, 1);\n notificationIntent2.putExtra(NotificationPublisher.NOTIFICATION, notification);\n PendingIntent pendingIntent2 = PendingIntent.getBroadcast(MainActivity.this, 0, notificationIntent2, PendingIntent.FLAG_UPDATE_CURRENT);\n Date date = new Date();\n\n Calendar calnoti = Calendar.getInstance();\n calnoti.setTime(date);\n\n calnoti.set(Calendar.HOUR_OF_DAY, mHour-1);\n calnoti.set(Calendar.MINUTE, mMin);\n calnoti.set(Calendar.SECOND, 0);\n calnoti.set(Calendar.YEAR,mYear);\n calnoti.set(Calendar.MONTH,mMonth);\n calnoti.set(Calendar.DAY_OF_MONTH,mDay);\n //long futureInMillis2 = SystemClock.elapsedRealtime() + delay;\n AlarmManager alarmManager2 = (AlarmManager) getSystemService(Context.ALARM_SERVICE);\n alarmManager2.set(AlarmManager.RTC_WAKEUP, calnoti.getTimeInMillis(), pendingIntent2);\n }", "boolean hasSendTime();", "public void mo33398h() {\n String str = \"com.tencent.android.tpush.service.channel.heartbeatIntent.pullup\";\n String str2 = \"TpnsChannel\";\n try {\n if (this.f23285A == null) {\n IntentFilter intentFilter = new IntentFilter();\n intentFilter.addAction(\"android.intent.action.SCREEN_ON\");\n intentFilter.addAction(\"android.intent.action.SCREEN_OFF\");\n intentFilter.addAction(\"android.intent.action.USER_PRESENT\");\n intentFilter.addAction(str);\n C6973b.m29776f().registerReceiver(this.f23292L, intentFilter);\n this.f23285A = PendingIntent.getBroadcast(C6973b.m29776f(), 0, new Intent(str), 134217728);\n }\n long currentTimeMillis = System.currentTimeMillis();\n if (f23282q > f23278m) {\n f23282q = f23278m;\n }\n if (XGPushConfig.isForeignWeakAlarmMode(C6973b.m29776f())) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"schedulePullUpHeartbeat WaekAlarmMode heartbeatinterval: \");\n sb.append(f23280o);\n sb.append(\" ms\");\n C6864a.m29305f(str2, sb.toString());\n f23282q = f23280o;\n }\n f23282q = C7055h.m30166a(C6973b.m29776f(), \"com.tencent.android.xg.wx.HeartbeatIntervalMs\", f23282q);\n long j = currentTimeMillis + ((long) f23282q);\n mo33391b(true);\n C7045d.m30117a().mo34149a(0, j, this.f23285A);\n } catch (Throwable th) {\n C6864a.m29302d(str2, \"scheduleHeartbeat error\", th);\n }\n }", "@Override\n public void onMessageReceived(RemoteMessage remoteMessage2) {\n Log.i(TAG, \"알림 메시지\" + remoteMessage2);\n\n remoteMessage = remoteMessage2;\n if(remoteMessage.getData().get(\"title\").equals(\"NEW!\")){\n sendNotificationNewDevice(remoteMessage.getData().get(\"body\"));\n }\n //String now = dateFormat.format (System.currentTimeMillis());\n else {\n sendNotificationDangerAlert();\n }\n }", "@Override\n public void run() {\n\n try {\n LocalDateTime now = LocalDateTime.now();\n voda bot = new voda();\n\n List<Integer> notifyTime = Arrays.asList(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23);\n int currentHour = now.getHour();\n\n ArrayList<Integer> consulted = dbmodel.MysqlCon.getFollowers();\n\n for (Integer ntime : notifyTime) {\n if (ntime == currentHour) {\n for (Integer consultedUser : consulted) {\n bot.sendTextToIdMessage(consultedUser, dbmodel.MysqlCon.getEveryDayWaterUserWaterCountView(consultedUser));\n }\n }\n }\n\n\n } catch (Exception e) {\n System.out.println();\n }\n }", "@Override\n public void setNotification() {\n if (getTense() == Tense.FUTURE) {\n //Context ctx = SHiTApplication.getContext();\n //SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(ctx);\n\n int leadTimeEventMinutes = SHiTApplication.getPreferenceInt(Constants.Setting.ALERT_LEAD_TIME_EVENT, LEAD_TIME_MISSING);\n\n if (leadTimeEventMinutes != LEAD_TIME_MISSING) {\n if (travelTime > 0) {\n leadTimeEventMinutes += travelTime;\n }\n\n setNotification(Constants.Setting.ALERT_LEAD_TIME_EVENT\n , leadTimeEventMinutes\n , R.string.alert_msg_event\n , getNotificationClickAction()\n , null);\n }\n }\n }", "@Scheduled\n\tpublic void executeNotification();", "protected void recurringAlert() {\n\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(DeviceTrackerApplication.getContext());\n alertDialogBuilder.setTitle(getString(R.string.app_name));\n alertDialogBuilder\n .setMessage(R.string.user_not_logged_in)\n .setCancelable(false)\n .setPositiveButton(R.string.ok_msg, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n if (!Utils.isAppInForeground(LoggedInCheckService.this)) {\n Intent intent = new Intent(LoggedInCheckService.this, SplashActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }\n }\n });\n alertDialog = alertDialogBuilder.create();\n alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);\n\n if (timer2 != null) {\n timer2.cancel();\n }\n\n timer2 = new Timer();\n long alertInterval = getSharedPreferences(Utility.SETTINGS_SHARED_PREFERENCE, Context.MODE_PRIVATE).getInt(Utility.ALERT_INTERVAL, 2) * 60 * 1000;\n timer2.scheduleAtFixedRate(new TimerTask() {\n @Override\n public void run() {\n Handler handler = new Handler(Looper.getMainLooper()) {\n @Override\n public void handleMessage(Message msg) {\n alertDialog.show();\n }\n };\n Message message = handler.obtainMessage();\n message.sendToTarget();\n }\n }, alertInterval , alertInterval);\n\n }", "public boolean sendWarning(Notification notification, int member_id) {\n boolean done = false;\n\n String sql = \"INSERT INTO notify(member_id, notification_id, seen) VALUES (?,?,?)\";\n\n try ( Connection con = connect(); PreparedStatement pstmt = con.prepareStatement(sql)) {\n pstmt.setInt(1, member_id);\n pstmt.setInt(2, notification.getNotification_id());\n\n pstmt.setBoolean(3, false);\n //en la base de datos poner por defecto el valor del tiempo actual con el metodo now()\n pstmt.executeUpdate();\n done = true;\n\n } catch (SQLException e) {\n System.out.println(\"Error inserting notify\");\n System.out.println(e.getMessage());\n }\n\n return done;\n }", "@Override\n public void run() {\n NotificationHelper nh = new NotificationHelper(getApplicationContext(), alarmId);\n\n /* AlarmEntity is null for snoozed alarm\n * Get actual alarm time by: CurrentTime - silenceTimeout\n */\n if (isSnoozed) {\n nh.deliverMissedNotification(\n System.currentTimeMillis() - (Long.parseLong(silenceTimeStr) * 60000));\n } else\n nh.deliverMissedNotification(alarmEntity.getAlarmTime());\n\n stopAlarmService();\n }", "private void sendNotifications() {\n this.sendNotifications(null);\n }", "public MonitorResult checkNotifications() {\r\n MonitorResult result = new MonitorResult();\r\n result.setComponent(\"NOTIFICATIONS\");\r\n\r\n logger.info(\"Testing NOTIFICATIONS...\");\r\n\r\n double duration = 0;\r\n boolean success = false;\r\n Date start = new Date();\r\n long startTime = start.getTime();\r\n\r\n try {\r\n\r\n long currentDateMs = (new Date()).getTime();\r\n Date comparisonDate = new Date(currentDateMs - getMonitorConfiguration().getNotificationSendInterval());\r\n\r\n Long unsentNotificationCount = getNotificationDAO().getUnsentNotifications(comparisonDate);\r\n\r\n if (unsentNotificationCount > 0) {\r\n throw new AditInternalException(\"Number of notifications not sent in time: \" + unsentNotificationCount);\r\n } else {\r\n logger.info(\"No waiting notifications older than \" + comparisonDate + \" were found.\");\r\n \tsuccess = true;\r\n }\r\n\r\n Date end = new Date();\r\n long endTime = end.getTime();\r\n duration = (endTime - startTime) / 1000.0;\r\n result.setDuration(duration);\r\n result.setSuccess(success);\r\n\r\n } catch (Exception e) {\r\n logger.error(\"Error while testing NOTIFICATIONS: \", e);\r\n result.setSuccess(false);\r\n List<String> exceptions = new ArrayList<String>();\r\n exceptions.add(e.getMessage());\r\n result.setExceptions(exceptions);\r\n }\r\n\r\n return result;\r\n }", "@Override\n\tprotected Result check() throws Exception {\n\t\tif (failedMessageMeter != null && failedMessageMeter.getFifteenMinuteRate() > 0) {\n\t\t\treturn Result.unhealthy(\">1 messages failed to be sent to Kafka in the past 15minutes\");\n\t\t} else {\n\t\t\treturn Result.healthy();\n\t\t}\n\t}", "@Override\n public void run() {\n int time = 59;\n while (time >= -1) {\n try {\n Message message = new Message();\n message.what = AppConfig.CHECKCODE;\n message.obj = time;\n handler.sendMessage(message);\n Thread.sleep(1000);\n time--;\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }", "@Override\n public void schedulePeriodicNotification(Context context, long time, String title, String text, int period) {\n Notification notification = new Notification(title, text, new Date(time), Long.toString(time));\n notification.setNotificationID(notificationId);\n notification.setRequestCode(requestCode);\n user.addNotification(notification);\n Intent intent = new Intent(context, NotificationReceiver.class);\n intent.putExtra(getString(R.string.title), title);\n intent.putExtra(getString(R.string.text), text);\n intent.putExtra(getString(R.string.notificationid), Integer.toString(notificationId));\n notificationId++;\n PendingIntent pending = PendingIntent.getBroadcast(context, requestCode, intent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n requestCode++;\n AlarmManager manager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n assert manager != null;\n manager.setInexactRepeating(AlarmManager.RTC_WAKEUP, time,\n AlarmManager.INTERVAL_DAY*period, pending);\n }", "public TestNotification sendNow(TestNotification notif) {\n\t\treturn null;\n\t}", "@Scheduled(fixedDelay = 10000)\n\tpublic void verificaConexao() {\n\t\tverificaConexao(internet);\n\t\tverificaConexao(vpn);\n\t}", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "@Override\n\tprotected void onHandleIntent(final Intent intent) {\n\t\ttimeFromNow = intent.getExtras().getFloat(\"timeFromNow\");\n\t\tLog.i(\"LocalNotification\", \"scheduleNotification -> timeFromNow: \" + timeFromNow);\n \tTimer t = new Timer(); \n\t\tTimerTask task = new TimerTask() {\n\t\t\t@Override\n\t\t\tpublic void run() { \n\t\t\t\tcreateNotif(intent);\n\t\t\t}\n\t\t};\n\t\tt.schedule(task, (long) (timeFromNow*1000));\n\t}", "@Scheduled(cron = \"0 0 18 * * SUN\")\n\tvoid refreshNotifications(){\n\t\tnotificationService.refreshAll();\n\t}", "private void m29985m() {\n String str = \"com.tencent.android.tpush.service.channel.heartbeatIntent\";\n String str2 = \"TpnsChannel\";\n try {\n if (this.f23299z == null) {\n C6973b.m29776f().registerReceiver(new BroadcastReceiver() {\n public void onReceive(Context context, Intent intent) {\n C7005b.m29964a().m29983k();\n }\n }, new IntentFilter(str));\n this.f23299z = PendingIntent.getBroadcast(C6973b.m29776f(), 0, new Intent(str), 134217728);\n }\n long currentTimeMillis = System.currentTimeMillis();\n if (f23279n > f23278m) {\n f23279n = f23278m;\n }\n if (XGPushConfig.isForeignWeakAlarmMode(C6973b.m29776f())) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"scheduleHeartbeat WaekAlarmMode heartbeatinterval: \");\n sb.append(f23280o);\n sb.append(\" ms\");\n C6864a.m29305f(str2, sb.toString());\n f23279n = f23280o;\n }\n f23279n = C7055h.m30166a(C6973b.m29776f(), \"com.tencent.android.xg.wx.HeartbeatIntervalMs\", f23279n);\n C7045d.m30117a().mo34149a(0, currentTimeMillis + ((long) f23279n), this.f23299z);\n } catch (Throwable th) {\n C6864a.m29302d(str2, \"scheduleHeartbeat error\", th);\n }\n }", "public static void scheduleRepeatingElapsedNotification45(Context context) {\n\n\n // Setting intent to class where notification will be handled\n Intent intent = new Intent(context, AlarmReceiver.class);\n\n // Setting pending intent to respond to broadcast sent by AlarmManager everyday at 8am\n alarmIntentElapsed = PendingIntent.getBroadcast(context, ALARM_TYPE_ELAPSED, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Getting instance of AlarmManager service\n alarmManagerElapsed = (AlarmManager)context.getSystemService(ALARM_SERVICE);\n\n // Daily inexact alarm from phone boot - current set to test for 10 seconds\n alarmManagerElapsed.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), 60000 * 45, alarmIntentElapsed);\n }", "protected List<NotificationInfo> assertMadeNotifications(int number) {\n //get notification then clear the notification list\n UserSetting setting = userSettingService.get(rootIdentity.getRemoteId());\n List<NotificationInfo> got = notificationService.storeDigestJCR();\n if (setting.isActive(UserSetting.EMAIL_CHANNEL, getPlugin().getKey().getId())) {\n got = notificationService.storeInstantly();\n assertEquals(number, got.size());\n }\n //\n if (setting.isInDaily(getPlugin().getKey().getId())) {\n got = notificationService.storeDigestJCR();\n assertEquals(number, got.size());\n }\n \n return got;\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n \n if(switchesSubsystem.readyToFire()) {\n \t\tSmartDashboard.putString(\"DB/String \"+0, \"ready to fire\");\n \t} else {\n \t\tSmartDashboard.putString(\"DB/String \"+0, \"reloading\");\n \t}\n \n SmartDashboard.putString(\"DB/String \"+1, \"Wound switch: \" + switchesSubsystem.isBarDown());\n \tSmartDashboard.putString(\"DB/String \"+2, \"Taut switch: \" + switchesSubsystem.isTaut());\n \tSmartDashboard.putString(\"DB/String \"+3, \"Fired switch: \" + switchesSubsystem.isLauncherFired());\n }", "private void monitoringLicenseAndSendNotification(NotificationBean notificationBean){\n\t\t\n//System.out.println(\"execute cmd -- \" + notificationBean.getConnection() + \" --- \" + notificationBean.getNotificationLmstatCmdLoc());\t\t\n\t\t\n\t\t//download lmstat file and delete it remotely\t\t\n//\t\tNetWorkUtil.executeSCPCmdForNotification(notificationBean.getConnection(),\n//\t\t\tnotificationBean.getNotificationLmstatCmdLoc(),LicLiteData.licLiteDataTmpDir);\n\n//local one_server.log and two_server.log test\nif(isGetingOneServerFile()){\nSystem.out.println(\"downloading one_server.log ...\");\n\tNetWorkUtil.executeSCPCmdForNotification(notificationBean.getConnection(),\n\t\t\tnotificationBean.getNotificationLmstatCmdLoc(),LicLiteData.licLiteDataTmpDir);\n}else{\n\tString cmdTwoServerLog = \"cat /home/leo/Desktop/log/two_server.log > /home/leo/Desktop/log/notificationtmp\";\n\tNetWorkUtil.executeSCPCmdForNotification(notificationBean.getConnection(),\n\t\t\tcmdTwoServerLog , LicLiteData.licLiteDataTmpDir);\nSystem.out.println(\"downloading two_server.log ...\");\n}\n\t\t\n\t\t\n\t\t\n\t\t//parse file to generate notification bean\n\t\tString notificationTmpFile = LicLiteData.licLiteDataTmpDir + File.separator + LicLiteData.NOTIFICATION_TMP_FILE;\n//System.out.println(\"notificationTmpFile --> \" + notificationTmpFile);\n\t\tNotificationCmpBean notificationCmpBean = Parser.parseDownloadDataFileToNotificationCmpBean(notificationTmpFile,\n\t\t\tnotificationBean.getNotificationLicenseName(),notificationBean.getNotificationLicenseUserName());\n//System.out.println(\"notificationCmpBean --> \" + notificationCmpBean.toString());\n//System.out.println(\"notificationCmpBean --> \" + notificationTmpFile);\n//System.out.println(\"NotificationLicenseName --> \" + notificationBean.getNotificationLicenseName());\n//System.out.println(\"NotificationLicenseUserName --> \" + notificationBean.getNotificationLicenseUserName());\n//System.out.println(\"licenseName, userName, cmpbeanStr -> \" + notificationBean.getNotificationLicenseName() \n//+ \" -- \" + notificationBean.getNotificationLicenseUserName() + \"\\n\" + notificationCmpBean.toString());\t\t\n\t\tif(notificationCmpBean.getFeatureNameCmp() == null){\n\t\t\t//stop service\n\t\t\t\n\t\t\t//toast say : \"wrong feature name or user name\"\n\t\t}else {\n\t\t\tif(LicLiteData.previousNotificationBean == null){\n\t\t\t\tLicLiteData.previousNotificationBean = notificationCmpBean;\n\t\t\t} else {\n\t\t\t\t//compare previous and current bean to see if need to send notification\n\t\t\t\t//compare LicLiteData.previousNotificationBean as 1st bean with notificationCmpBean as 2nd bean\n//System.out.println(\"LicLiteData.previousNotificationBean --> \" + LicLiteData.previousNotificationBean.toString());\n//System.out.println(\"notificationCmpBean --> \" + notificationCmpBean.toString());\n\t\t\t\tArrayList<NotificationCmpResultBean> tmpCmpResultBeanList = UIUtil\n\t\t\t\t\t.comparePreviousWithSecondNotificationBean(LicLiteData.previousNotificationBean , notificationCmpBean);\n//System.out.println(\"tmpCmpResultBeanList --> \" + tmpCmpResultBeanList);\t\t\t\t\n\t\t\t\tif(tmpCmpResultBeanList.size() > 0){\n//System.out.println(\"sending notification...\");\n\t\t\t\t\tLicLiteData.notificationCmpResultBeanList = tmpCmpResultBeanList;\n\t\t\t\t\t\n\t\t\t\t\tsendNotification();\n\t\t\t\t} else {\n//System.out.println(\"not sending notification...\");\n\t\t\t\t}\n\t\t\t\t//set the ischanged file to true for future comparison\n\t\t\t\tfor(int i = 0; i < notificationCmpBean.getUserUsageListCmp().size(); i++){\n\t\t\t\t\tnotificationCmpBean.getUserUsageListCmp().get(i).setChanged(true);\n\t\t\t\t}\n\t\t\t\t//notificationCmpBean overwrite LicLiteData.previousNotificationBean\n\t\t\t\tLicLiteData.previousNotificationBean = notificationCmpBean;\n\t\t\t} \n\t\t\t\n\t\t}\n\t\t\n\t\t//delete download local lmstat file\n\t\t//this one doesn't needed anymore\n\t\t\n\t\t\n\t}", "void sendScheduledNotifications(JobProgress progress);", "private void check() {\n ShedSolar.instance.haps.post( Events.WEATHER_REPORT_MISSED );\n LOGGER.info( \"Failed to receive weather report\" );\n\n // check again...\n startChecker();\n }", "public void teleopPeriodic() {\r\n Scheduler.getInstance().run();\r\n OI.poll();\r\n }", "public static void scheduleRepeatingElapsedNotification60(Context context) {\n\n\n // Setting intent to class where notification will be handled\n Intent intent = new Intent(context, AlarmReceiver.class);\n\n // Setting pending intent to respond to broadcast sent by AlarmManager everyday at 8am\n alarmIntentElapsed = PendingIntent.getBroadcast(context, ALARM_TYPE_ELAPSED, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Getting instance of AlarmManager service\n alarmManagerElapsed = (AlarmManager)context.getSystemService(ALARM_SERVICE);\n\n // Daily inexact alarm from phone boot - current set to test for 10 seconds\n alarmManagerElapsed.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), 60000 * 60, alarmIntentElapsed);\n }", "private void notifyUser(List<String> result) {\r\n\t\t\tif(Util.getProperty(getApplicationContext(),\"notificationTimeChanged\",\"\").equals(\"true\") \r\n\t\t\t\t\t|| !notifiedToday())\r\n\t\t\t{\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"notificationTimeChanged\", \"false\");\r\n\t\t\t\tif(result.size() > 0){\r\n\t\t\t\t\tint itemsDue = result.size();\r\n\t\t\t\t\tStringBuffer notificationText = new StringBuffer();\r\n\t\t\t\t\tfor(int i=0; i<itemsDue; i++){\r\n\t\t\t\t\t\tif(i!=0)\r\n\t\t\t\t\t\t\tnotificationText.append(\", \");\r\n\t\t\t\t\t\tnotificationText.append(result.get(i));\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tContext context = getApplicationContext();\r\n\t\t\t\t\tNotificationManager nm = (NotificationManager)context.getSystemService(NOTIFICATION_SERVICE);\r\n\t\t\t\t\tIntent notificationIntent = new Intent(context,ReminderActivity.class);\r\n\t\t\t\t\tPendingIntent pi = PendingIntent.getActivity(context, 0, notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);\r\n\t\t\t\t\tNotification n = new Notification.Builder(context)\r\n\t\t\t\t\t.setContentTitle(String.valueOf(itemsDue) + \" Items Due\")\r\n\t\t\t\t\t.setContentText(notificationText.toString())\r\n\t\t\t\t\t.setSmallIcon(R.drawable.ic_launcher)\r\n\t\t\t\t\t//.setLargeIcon(R.drawable.ic_basket)\r\n\t\t\t\t\t.setContentIntent(pi)\r\n\t\t\t\t\t.build();\t \r\n\t\t\t\t\tnm.notify(1, n);\r\n\t\t\t\t}\r\n\t\t\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"dd-MMM-yyyy\",Locale.US);\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"ServiceLastRanOn\",formatter.format(new Date()));\r\n\t\t\t}\r\n\t\t}", "public void teleopPeriodic() {\r\n\t\tScheduler.getInstance().run();\r\n\t}", "private void upgradeAlertsForVersion16(SQLiteDatabase database){\n\t\tCursor cursor = database.query(iStayHealthyDatabaseSchema.ALERTSTABLE, null, null, null, null, null, iStayHealthyDatabaseSchema.ALERTLABEL);\n\t\tif(1 >= cursor.getColumnCount()){\n\t\t\tcursor.close();\n\t\t\treturn;\n\t\t}\n\t\tint standardInterval = 24 * 60 * 60 * 1000;//24 hour repeat interval\n\t\tAlarmManager alarm = (AlarmManager) context.getApplicationContext().getSystemService(Context.ALARM_SERVICE);\n\t\tint requestCode = 0;\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tjava.util.Date date = new java.util.Date();\n\t\tlong now = date.getTime();\n\t\twhile(cursor.moveToNext()){\n\t\t\tlong rowId = cursor.getLong(cursor.getColumnIndex(iStayHealthyDatabaseSchema.KEY_ID));\n\t\t\tString label = cursor.getString(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTLABEL));\n\t\t\tint repeat = cursor.getInt(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTREPEATPATTERN));\n\t\t\tlong startTime = cursor.getLong(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTSTARTTIME));\n\t\t\tCalendar alarmCalendar = Calendar.getInstance();\n\t\t\talarmCalendar.setTimeInMillis(startTime);\n\t\t\tboolean isEveryDay = (0 < repeat);\n\t\t\tcalendar.set(Calendar.HOUR_OF_DAY, alarmCalendar.get(Calendar.HOUR_OF_DAY));\n\t\t\tcalendar.set(Calendar.MINUTE, alarmCalendar.get(Calendar.MINUTE));\n\n\t\t\tlong time = calendar.getTimeInMillis();\n\t\t\tIntent intent = new Intent(context, AlarmReceiver.class);\n\t\t\tintent.putExtra(\"Label\", label);\n\t\t\tintent.putExtra(\"isEveryDay\", isEveryDay);\n\t\t\t\n\t\t\tPendingIntent pendingSingleIntent = PendingIntent.getBroadcast(context, 0, intent, 0);\t\t\n\t\t\talarm.cancel(pendingSingleIntent);\n\t\t\t\n\t\t\t\n\t\t\tIntent newIntent = new Intent(context, AlarmReceiver.class);\n\t\t\tnewIntent.putExtra(\"Label\", label);\n\t\t\tnewIntent.putExtra(\"isVibrate\", true);\n\t\t\tnewIntent.putExtra(\"isEveryDay\", isEveryDay);\n\t\t\tnewIntent.putExtra(\"requestCode\", requestCode);\n\t\t\tPendingIntent newPendingIntent = PendingIntent.getBroadcast(context.getApplicationContext(), requestCode, newIntent, 0);\n\t\t\t\n\t\t\tif(isEveryDay){\n\t\t\t\talarm.setRepeating(AlarmManager.RTC_WAKEUP, time, standardInterval, newPendingIntent);\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tlong diff = startTime - now;\n\t\t\t\tif( 0 < diff){\n\t\t\t\t\talarm.set(AlarmManager.RTC_WAKEUP, startTime, newPendingIntent);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tContentValues content = new ContentValues();\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTLABEL, label);\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTREPEATPATTERN, repeat);\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTSTARTTIME, startTime);\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTREQUESTCODE, requestCode);\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTTEXT, cursor.getString(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTTEXT)));\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTSOUND, cursor.getString(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTSOUND)));\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTHOUR, cursor.getInt(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTHOUR)));\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.AlERTMINUTE, cursor.getInt(cursor.getColumnIndex(iStayHealthyDatabaseSchema.AlERTMINUTE)));\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTTIMEZONEOFFSET, cursor.getLong(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTTIMEZONEOFFSET)));\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.GUIDTEXT, java.util.UUID.randomUUID().toString());\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.TINTABEEKEY, cursor.getString(cursor.getColumnIndex(iStayHealthyDatabaseSchema.TINTABEEKEY)));\n\t\t\tdatabase.updateWithOnConflict(iStayHealthyDatabaseSchema.ALERTSTABLE, content, iStayHealthyDatabaseSchema.KEY_ID + \"=\" + rowId, null, SQLiteDatabase.CONFLICT_IGNORE);\t\t\t\t\n\n\t\t\trequestCode = requestCode + 1;\n\t\t}\n\t\t\n\t\tcursor.close();\n\t}", "@Override\r\n public void run() {\n d2++;\r\n if (d2 == 1) {\r\n onReceive(new byte[]{Message.TIMER_MESSAGE, Message.TFP2_EXPIRE});\r\n }\r\n }", "public void execute(JobExecutionContext context) {\n sendSevenDaysExpiringEmails();\n sendOneDayExpiringEmails();\n sendOneDayExpiredEmails();\n }", "private void doSomeThingRepeat() {\n\t\t\n\t\ttimer.scheduleAtFixedRate(new TimerTask() {\n\t\t\tint mHourNow = 0, mMinuteNow = 0;\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t\tfinal Calendar c = Calendar.getInstance();\n\t\t\t\tmHourNow = c.get(Calendar.HOUR_OF_DAY);\n\t\t\t\tmMinuteNow= c.get(Calendar.MINUTE);\n\t\t\t\ttime = prefs.getString(\"time\", \"\");\n\t\t\t\tString mHour = time.substring(0, 2);\n\t\t\t\tString mMinute = time.substring(3, 5) ;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tint mh = Integer.parseInt(mHour);\n\t\t\t\tint mm = Integer.parseInt(mMinute);\n\t\t\t\t\t\n\t\t\t\tif (mHourNow == mh && mMinuteNow == mm) {\n\t\t\t\t\tplayMediaAlarm();\n\t\t\t\t}\n\t\t\t\t\tLog.d(\"Myservice-doSomeThingRepeat\", mHourNow +\"h\"+ mMinuteNow + \"&&\" +mHour +\"h\" + mMinute);\n\t\t\t\t\n\t\t\t}\n\t\t}, 0, UPDATE);\n\t}", "public void sendIncidentNotification() {\n\n final ParseQuery<ParseObject> pendingNotifs = ParseQuery.getQuery(\"PendingNotifications\");\n pendingNotifs.whereEqualTo(\"username\", ParseUser.getCurrentUser().getUsername());\n pendingNotifs.findInBackground(new FindCallback<ParseObject>() {\n @Override\n public void done(List<ParseObject> objects, ParseException e) {\n if ( e == null) {\n if (objects.size()>0) {\n for (ParseObject object : objects) {\n String type = object.getString(\"type\");\n\n Intent activityIntent = new Intent(getApplicationContext(), MyNeighbourhood.class);\n PendingIntent contentIntent = PendingIntent.getActivity(NotificationAbstract.this, 0,activityIntent, 0);\n\n String message = \"A new \" + type + \" incident has occurred in your neighbourhood. Check 'my Neighbourhood' to view details\";\n android.app.Notification notification = new NotificationCompat.Builder(mContext, StarterApplication.CHANNEL_1_ID)\n .setSmallIcon(R.drawable.unnamed)\n .setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(),\n R.drawable.unnamed))\n .setContentTitle(\"New \" + type + \" Incident\")\n .setContentText(message)\n .setStyle(new NotificationCompat.BigTextStyle())\n .setPriority(NotificationCompat.PRIORITY_HIGH)\n .setCategory(NotificationCompat.CATEGORY_MESSAGE)\n .setContentIntent(contentIntent)\n .build();\n\n notificationManager.notify(1, notification);\n Log.i(\"NotificationIncident\", \"sent\");\n\n ParseUser.getCurrentUser().put(\"notifiedUpdated\", \"true\");\n try {\n object.delete();\n } catch (ParseException e1) {\n e1.printStackTrace();\n }\n ParseUser.getCurrentUser().saveInBackground();\n\n }\n }\n }\n }\n });\n\n\n if (ParseUser.getCurrentUser().getString(\"notifiedUpdated\").matches(\"false\")) {\n Log.i(\"Incident:\", \"Incident notification needs to be sent\");\n // the user is NOT up to date, so query incidents\n\n\n\n }\n\n else {\n Log.i(\"Incident\", \"Incident notification not sending\");\n String stat = ParseUser.getCurrentUser().getString(\"pending\");\n if (stat != null){\n\n }\n else {\n\n }\n }\n }", "private void scheduleTasks() {\n\t\ttimer.scheduleAtFixedRate(new TimerTask() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// Prepare JSON Ping Message\n\t\t\t\ttry {\n\t\t\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\t\t\tObjectNode objectNode = mapper.createObjectNode();\n\t\t\t\t\tobjectNode.put(\"type\", \"PING\");\n\n\t\t\t\t\twebSocket.sendText(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(objectNode));\n\n\t\t\t\t\tlog.debug(\"Send Ping to Twitch PubSub. (Keep-Connection-Alive)\");\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tlog.error(\"Failed to Ping Twitch PubSub. ({})\", ex.getMessage());\n\t\t\t\t\treconnect();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}, 7000, 282000);\n\t}", "@Override\n public void teleopPeriodic() {\n Scheduler.getInstance().run();\n \n }", "public static void scheduleRepeatingElapsedNotification15(Context context) {\n\n\n // Setting intent to class where notification will be handled\n Intent intent = new Intent(context, AlarmReceiver.class);\n\n // Setting pending intent to respond to broadcast sent by AlarmManager everyday at 8am\n alarmIntentElapsed = PendingIntent.getBroadcast(context, ALARM_TYPE_ELAPSED, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Getting instance of AlarmManager service\n alarmManagerElapsed = (AlarmManager)context.getSystemService(ALARM_SERVICE);\n\n // Daily inexact alarm from phone boot - current set to test for 10 seconds\n alarmManagerElapsed.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), 60000 * 15, alarmIntentElapsed);\n }", "public void checkAccountExpiration() throws MessagingException{\r\n\t\tList<Account> accounts = accountRepository.findAll();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\r\n\t\t\r\n\t\t//Username Password does not exist its only for faking user to system default\r\n\t\tUsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(\"[email protected]\",\r\n\t\t\t\t\"Test1234@\");\r\n\t\tSecurityContextHolder.getContext().setAuthentication(authRequest);\r\n\t\t\r\n\t\tfor( Account acc: accounts)\t{\r\n\t\t\tif(acc.getAlwaysActive() == false && acc.getActive() == true){\r\n\t\t\t\tDate expiration = acc.getExpirationDate() != null ? acc.getExpirationDate() :\r\n\t\t\t\t\tDateUtil.toDate(DateUtil.adjustDate(DateUtil.fromDate(acc.getStartDate()), Calendar.DAY_OF_MONTH, acc.getType() == AccountType.TRIAL ? getTrial.getTrialDays() : PREMIUM_EXPIRATION_DAYS));\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif (DateUtil.getDaysRemaining(expiration) <= -1){\r\n\t\t\t\t\tacc.setActive(false);\r\n\t\t\t\t\tacc.setExpirationDate(new Date());\r\n\t\t\t\t\tacc.setCurrency(\"SGD\");\r\n\t\t\t\t\tUser user = new User();\r\n\t\t\t\t\tuser.setId(1L);\r\n\t\t\t\t\tacc.setLastModifiedBy(user);\r\n\t\t\t\t\tacc.setLastModifiedDate(new Date());\r\n\t\t\t\t\taccountRepository.save(acc);\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\tsendTrialExpiredEmail(acc.getUser().getUsername());\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(MessagingException e){\r\n\t\t\t\t\t\tlog.error(\"exception while sending email to \"+acc.getUser().getUsername());\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}", "private static Boolean notifyOrder(String orderNo , String kitchenName){\n\t\tBoolean notified = false;\n\t\ttry {\n\t\t\tConnection connection = DBConnection.createConnection();\n\t\t\tSQL:{\n\n\t\t\t\tPreparedStatement preparedStatement = null;\n\t\t\t\tString sql = \"UPDATE fapp_order_tracking SET notify = 'Y',notified_time=current_timestamp \"\n\t\t\t\t\t\t+ \" WHERE order_id = (SELECT order_id from fapp_orders where order_no = ?) \"\n\t\t\t\t\t\t+ \" AND kitchen_id = (SELECT kitchen_id from fapp_kitchen where kitchen_name = ?)\";\n\n\t\t\t\ttry {\n\t\t\t\t\tpreparedStatement = connection.prepareStatement(sql);\n\t\t\t\t\tpreparedStatement.setString(1, orderNo);\n\t\t\t\t\tpreparedStatement.setString(2, kitchenName);\n\t\t\t\t\tint updatedRow = preparedStatement.executeUpdate();\n\t\t\t\t\tif(updatedRow>0){\n\t\t\t\t\t\tnotified = true;\n\t\t\t\t\t\tSystem.out.println(\"1. Notifed !!\");\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t}finally{\n\t\t\t\t\tif(preparedStatement!=null){\n\t\t\t\t\t\tpreparedStatement.close();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSQL:{\n\t\t\t\tPreparedStatement preparedStatement = null;\n\t\t\t\tString sql = \"UPDATE fapp_orders SET order_status_id = 3\"\n\t\t\t\t\t\t+ \" WHERE order_id = (SELECT order_id from fapp_orders where order_no = ?) \";\n\t\t\t\ttry {\n\t\t\t\t\tpreparedStatement = connection.prepareStatement(sql);\n\t\t\t\t\tpreparedStatement.setString(1, orderNo);\n\t\t\t\t\tint updatedRow = preparedStatement.executeUpdate();\n\t\t\t\t\tif(updatedRow>0){\n\t\t\t\t\t\tnotified = true;\n\t\t\t\t\t\tSystem.out.println(\"2. order status change!!\");\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t}finally{\n\t\t\t\t\tif(connection!=null){\n\t\t\t\t\t\tconnection.close();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\treturn notified;\n\t}", "@Scheduled(cron = \"0 1 * * * *\")\n public void dailyTasks(){\n logger.info(\"Daily task started\");\n\n logger.info(\"Sending overdue emails\");\n List<Payment> overduePayments = new ArrayList<>();\n List<Payment> futurePayments = new ArrayList<>();\n paymentService.addPendingPayments(futurePayments, overduePayments);\n for(Payment overdue: overduePayments){\n Client client = overdue.getClient();\n if(client == null) throw new IllegalStateException(\"Payment \" + overdue.getId() + \" should have a valid client \");\n String email = client.getEmail();\n if(StringUtils.isEmpty(email)) continue;\n overdueEmailBody.replaceAll(\"\\\\$name\", client.getFirstName()).replaceAll(\"\\\\$unit\", overdue.getUnit().getName()).replaceAll(\"\\\\amount\", String.valueOf(overdue.getAmount()));\n emailSender.sendEmail(email, overdueEmailSubject, overdueEmailBody );\n }\n for(Payment payment: futurePayments){\n Client client = payment.getClient();\n if(client == null) throw new IllegalStateException(\"Payment \" + payment.getId() + \" should have a valid client \");\n String email = client.getEmail();\n if(StringUtils.isEmpty(email)) continue;\n futureEmailBody.replaceAll(\"\\\\$name\", client.getFirstName()).replaceAll(\"\\\\$unit\", payment.getUnit().getName()).replaceAll(\"\\\\amount\", String.valueOf(payment.getAmount()));\n emailSender.sendEmail(email, futureEmailSubject, futureEmailBody );\n }\n\n }", "private void sendNotifications() {\n for (long sid : self.getCurrentAndNextConfigVoters()) {\n QuorumVerifier qv = self.getQuorumVerifier();\n ToSend notmsg = new ToSend(\n ToSend.mType.notification,\n proposedLeader,\n proposedZxid,\n logicalclock.get(),\n QuorumPeer.ServerState.LOOKING,\n sid,\n proposedEpoch,\n qv.toString().getBytes(UTF_8));\n\n LOG.debug(\n \"Sending Notification: {} (n.leader), 0x{} (n.zxid), 0x{} (n.round), {} (recipient),\"\n + \" {} (myid), 0x{} (n.peerEpoch) \",\n proposedLeader,\n Long.toHexString(proposedZxid),\n Long.toHexString(logicalclock.get()),\n sid,\n self.getMyId(),\n Long.toHexString(proposedEpoch));\n\n sendqueue.offer(notmsg);\n }\n }", "public void sendDiscrepancyEmail() throws Exception;", "@Override\r\n\tpublic void sendNotifications() {\n\r\n\t}", "@Scheduled(cron = \"0 * * * * *\")\r\n\tpublic void run() {\r\n\r\n\t\tString[] emailArray = new String[emailRecipientList.size()];\r\n\t\temailArray = emailRecipientList.toArray(emailArray);\r\n\t\tLOGGER.debug(\"Sending a email to \" + emailArray);\r\n //Current time\r\n\t\tLocalDateTime now = LocalDateTime.now();\r\n\t\t//Current time - 1 hour\r\n\t\tLocalDateTime after = LocalDateTime.now().minusHours(1);\r\n\r\n\t\tTimestamp dateCreatedBefore = Timestamp.valueOf(now);\r\n\t\tTimestamp dateCreatedAfter = Timestamp.valueOf(after);\r\n\t\t// Search for file id's added for the last hour \r\n\t\tList<Long> ids = infoDataService.searchFileId(null, null, \r\n\t\t\t\tdateCreatedBefore, dateCreatedAfter, null, null,null);\r\n\t\t// Create a email body \r\n\t\tStringBuffer emailBody =new StringBuffer();\r\n\t\temailBody.append(\"New Files Uploaded:\");\r\n for(Long id : ids) {\r\n \ttry {\r\n \t FileInfo metaData = infoDataService.findRecordById(id);\r\n \t emailBody.append(System.lineSeparator());\r\n \t emailBody.append(\"*******************************************************\");\r\n \t emailBody.append(System.lineSeparator());\r\n \t emailBody.append(\"ID:\"+metaData.getId());\r\n \t emailBody.append(\", ORIGINAL NAME: \"+metaData.getFileName());\r\n \t Long size = metaData.getSize()/1000;\r\n \t emailBody.append(\", SIZE (KB):\"+size);\r\n \t emailBody.append((metaData.getPublicAccess())?\", PUBLIC ACCESS: true\":\" , PUBLIC ACCESS: false\");\r\n \t emailBody.append(\", TIME UPLOADED:\"+metaData.getUploadedTs().toLocalDateTime());\r\n \t emailBody.append(System.lineSeparator());\r\n \t}\r\n \tcatch(Exception e) {\r\n \t\temailBody.append(Utilities.NO_DATA_FOR_ID+id); \t\t\r\n \t}\r\n }\r\n // Sending a scheduled email \r\n SimpleMailMessage msg = new SimpleMailMessage();\r\n\t\tmsg.setTo(emailArray);\r\n\t\tmsg.setSubject(Utilities.SCHEDULER_SUBJECT);\r\n\t\tmsg.setText(emailBody.toString());\r\n\t\tmsg.setFrom(emailSender);\r\n\r\n\t\t// TODO\r\n\t\t// Uncomment the next line after adding a correct credentials to the\r\n\t\t// application.properies file\r\n\t\t// javaMailSender.send(msg);\r\n\r\n\t}", "public void teleopPeriodic()\n\t{\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n Log.i(\"BASH\", \"Notification sent\");\n\n Log.i(\"BASH\", \"RECIEVED\");\n\n createNotification(context, \"Times up\", \"5 sec\", \"as\");\n\n }", "public void setWaterReminder(int hourGap, String userID) {\n \tif (hourGap ==0) \n \t\treturn;\n \t\n \tTimer timer = new Timer ();\n \tTimerTask hourlyTask = new TimerTask () {\n \t @Override\n \t public void run () {\n \t // your code here...\n \tTextMessage textMessage = new TextMessage(\"It is time to drink your water :)\");\n \tPushMessage pushMessage = new PushMessage(userID, textMessage);\n \ttry {\n \tResponse<BotApiResponse> response =\n \t LineMessagingServiceBuilder\n \t .create(\"CJo3Ka/VX7VW4fsG78i5dNDpP5qqYgr1PD7YUclFFc62ZtnrIpHiM/Muof6oLc/J/bPoaheiYdHNoUkg09kAt5VqnD+tMyzOCClGLwvJaR3+etoVOdsHo1DGXv2UqOljNgUIFR/zQWk1U4iFRPr4TQdB04t89/1O/w1cDnyilFU=\") // channel access token\n \t .build()\n \t .pushMessage(pushMessage)\n \t .execute();\n \tSystem.out.println(response.code() + \" \" + response.message());\n \t}\n \tcatch (Exception e) {\n \t\te.printStackTrace();\n \t}\n \t }\n \t};\n\n \t// schedule the task to run starting now and then every hour...\n \ttimer.schedule (hourlyTask, 0l, 1000*60*60*hourGap);\n\n\t}", "public void run() {\n String lg_ti = \"Test.\";\n String des_ti = \"The license valid until \";\n String ban_ti = \"Warning!\";\n getNotificationData();\n //notificationShow(des_ti,lg_ti,ban_ti);\n }", "public void waitForNotificationOrFail() {\n new PollingCheck(5000) {\n @Override\n protected boolean check() {\n return mContentChanged;\n }\n }.run();\n mHT.quit();\n }", "private void sendNotification(Map<String, String> serverData) {\n Intent intent = new Intent(serverData.get(\"click_action\"));\n String title = serverData.get(\"title\");\n String body = serverData.get(\"body\");\n intent.putExtra(\"title\",title);\n intent.putExtra(\"body\",body);\n intent.putExtra(\"order\" , serverData.get(\"order\"));\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this,0 /* request code */, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n long[] pattern = {500,500,500,500,500};\n\n Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n NotificationCompat.Builder notificationBuilder = (NotificationCompat.Builder) new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ok)\n .setContentTitle(serverData.get(\"title\"))\n .setContentText(serverData.get(\"body\"))\n .setAutoCancel(true)\n .setVibrate(pattern)\n .setLights(Color.BLUE,1,1)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(0 , notificationBuilder.build());\n }", "@Override\n protected void onResume() {\n super.onResume();\n\n// queryTicket();\n// timer = new Timer();\n// timer.schedule(new TimerTask() {\n//\n// @Override\n// public void run() {\n// // TODO Auto-generated method stub\n// handler.sendEmptyMessage(1);\n// }\n// }, 0, 2000);\n }", "@Override\n public void teleopPeriodic() {\n\tupdateDiagnostics();\n\tScheduler.getInstance().run();\n }", "@Override\n public void run() {\n alarm.setAlarm(getApplicationContext(), System.currentTimeMillis(), time);\n\n while (RESULT) {\n try {\n sleep(1000);\n time += 1000;\n if (time == 10000) {\n time = 0;\n }\n //Utils.messageDisplay(\"Upload time ...: \" + message + \" - time :\" + getTime(System.currentTimeMillis()));\n //sendNotification(message + getTime(System.currentTimeMillis()) + \" CANCEL_TIME :\" + CANCEL_TIME, id);\n sendNotification(message +\" ID : \"+id, id);\n } catch (Exception e) {\n Utils.messageDisplay(\"Error : \" + e.getMessage());\n }\n }\n alarm.cancelAlarm(getApplicationContext());\n\n Utils.messageDisplay(\"cancle alram service ...\");\n\n sendNotification(\"Alram --> Alram\", id);\n }", "private void backgroundTimerHandler() {\n if (timer == null);\n timer = new Timer();\n\n TimerTask timerTask = new TimerTask() {\n @Override\n public void run() {\n ReportSender.sendReport();\n }\n };\n\n timer.schedule(timerTask, timerTime);\n }", "private void sendNotification() {\n int mNotificationId = 001;\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_action_camera)\n .setContentTitle(\"Daily Selfie\")\n .setContentText(\"Time for another selfie\");\n Intent resultIntent = new Intent(this, MainActivity.class);\n PendingIntent resultPendingIntent =\n PendingIntent.getActivity(\n this,\n 0,\n resultIntent,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n // Gets an instance of the NotificationManager service\n NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n // Builds the notification and issues it.\n mNotifyMgr.notify(mNotificationId, mBuilder.build());\n }", "private void setNotifications() {\n RealmManager realmManager = new RealmManager();\n realmManager.open();\n RecurringDao recurringDao = realmManager.createRecurringDao();\n\n List<Recurring> recurringTransactions = recurringDao.getAllRecurringTransactions();\n NotificationScheduler notificationScheduler = new NotificationScheduler(this);\n\n for (Recurring recurring : recurringTransactions) {\n notificationScheduler.schedule(recurring);\n }\n realmManager.close();\n }", "@Override\r\n public void run() {\n d1++;\r\n if (d1 == 1) {\r\n onReceive(new byte[]{Message.TIMER_MESSAGE, Message.TFP1_EXPIRE});\r\n }\r\n if (d1 == 10) {\r\n onReceive(new byte[]{Message.TIMER_MESSAGE, Message.TFP1_EXPIRE_N});\r\n }\r\n }", "private void notifyExpire(final Helper helper) {\n final Island island = EmberIsles.getInstance().getWorldManager().getIslandAtLoc(helper.getWorldType(), helper.getIslandKey().getGridX(), helper.getIslandKey().getGridZ());\n // Safety check against programming bugs, data corruption etc since island can't be null here for valid helper data\n if (island == null) {\n return;\n }\n final Player recipient = Bukkit.getPlayer(helper.getPlayerId());\n final Player sender = Bukkit.getPlayer(island.getOwner());\n if (recipient == null || sender == null) {\n return;\n }\n if (sender.isOnline()) {\n sender.sendMessage(String.format(EmberIsles.getInstance().getMessage(\"helper-expire-sender\"), recipient.getName()));\n }\n if (recipient.isOnline()) {\n recipient.sendMessage(String.format(EmberIsles.getInstance().getMessage(\"helper-expire-recipient\"), sender.getName()));\n }\n }", "@Scheduled(fixedRate = 19000)\n public void tesk() {\n\t\tDateFormat df = new SimpleDateFormat(\"MM/dd/yyyy\");\n DateFormat tf =new SimpleDateFormat(\"HH:mm\");\n\t\t// Get the date today using Calendar object.\n\t\tDate today = Calendar.getInstance().getTime(); \n\t\t// Using DateFormat format method we can create a string \n\t\t// representation of a date with the defined format.\n\t\tString reportDate = df.format(today);\n\t\tString repo = tf.format(today);\n\t\tSystem.out.println(\"Report Date: \" + reportDate);\n \n\t\t List<Tacher> tacher= tacherservice.findBydatetime(today, repo);\n\t\t\n\t\t if (tacher!=null){\t \n \t\t for(int i=0; i<tacher.size(); i++) {\n \t\t\t Tacher current = tacher.get(i);\n \t\t\t System.out.println(\"Tacher: \" + current.getId()+\" Statut=\"+current.getStatut()); \n \t\t tacherservice.metajourtacher(current.getId());\n \t\t System.out.println(\"Tacher: \" + current.getId()+\" Statut=\"+current.getStatut());\n \t\t } ///// fermeteur de for \n\t\t }//fermeteur de if\n\t}", "boolean hasReceiveTime();", "@Scheduled(fixedDelay = 3000)\n public void sendAdhocMessages() {\n log.info(loadQuotations.loadLastQuotations());\n simpMessagingTemplate.convertAndSend(\"/topic/user\", loadQuotations.loadLastQuotations());\n }", "@Override\r\n public void run() {\n d7++;\r\n if (d7 == 1) {\r\n onReceive(new byte[]{Message.TIMER_MESSAGE, Message.TFP7_EXPIRE});\r\n }\r\n }", "private void handleActionOnce() {\n // TODO: Handle action\n try {\n Executors.newScheduledThreadPool(1).submit(new NewsReceiveTask(getApplicationContext() , true));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void teleopPeriodic() {\n\t\tOI.refreshAll();\n\t\tScheduler.getInstance().run();\n\t\tlog();\n\t}", "public void teleopPeriodic() {\r\n }", "@Override\n public void teleopPeriodic()\n {\n Scheduler.getInstance().run();\n }", "@Override\n public void run() {\n try {\n while(true) {\n Thread.sleep(NOTIFY_PERIOD);\n this.handle.tryExtendTTL();\n }\n } catch (InterruptedException ex) {\n // silient ignore\n } catch (Exception ex) {\n LOG.error(\"exception occurred\", ex);\n }\n }", "private void peek_server_update(){\n java.util.Timer timer = new java.util.Timer(true);\n TimerTask taskPeek = new TimerTask() {\n public void run() {\n try {\n String user_id = RegistrationManager.getUserId();\n if (user_id == null || user_id.length() == 0) {\n return;\n }\n// WifiManager wifi = (WifiManager) getSystemService(WIFI_SERVICE);\n// if (wifi.getWifiState() == WifiManager.WIFI_STATE_ENABLED) {\n// JsonManager.peek_request(user_id);\n// }\n JsonManager.peek_request(user_id);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }\n };\n JsonManager.getServerConfig();\n int periodPeek = Config.PEEK_TIMER() * 1000;\n timer.schedule(taskPeek, periodPeek, periodPeek);\n }", "@Override\n public void teleopPeriodic() {\n }", "@Override\n public void teleopPeriodic() {\n }", "@SuppressLint(\"WrongConstant\")\n private Notification prepareNotification() {\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O &&\n mNotificationManager.getNotificationChannel(FOREGROUND_CHANNEL_ID) == null) {\n CharSequence name = getString(R.string.text_name_notification);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(FOREGROUND_CHANNEL_ID, name, importance);\n channel.enableVibration(false);\n mNotificationManager.createNotificationChannel(channel);\n }\n\n Intent notificationIntent = new Intent(this, Principal.class);\n notificationIntent.setAction(Constants.ACTION.MAIN_ACTION);\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n\n // if min sdk goes below honeycomb\n /*if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n } else {\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n }*/\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // make a stop intent\n Intent stopIntent = new Intent(this, Servicio_cargar_punto_google.class);\n stopIntent.setAction(Constants.ACTION.STOP_ACTION);\n PendingIntent pendingStopIntent = PendingIntent.getService(this, 0, stopIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.notification);\n //remoteViews.setOnClickPendingIntent(R.id.btn_stop, pendingStopIntent);\n remoteViews.setTextViewText(R.id.tv_fecha, fecha);\n\n // if it is connected\n switch (stateService) {\n case Constants.STATE_SERVICE.NOT_CONNECTED:\n remoteViews.setTextViewText(R.id.tv_estado, \"Sin conexión a internet . . .\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_advertencia);\n break;\n case Constants.STATE_SERVICE.CONNECTED:\n remoteViews.setTextViewText(R.id.tv_estado, \"Traigo en camino\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_carrito_verde);\n break;\n case Constants.STATE_SERVICE.GPS_INACTIVO:\n remoteViews.setTextViewText(R.id.tv_estado, \"GPS inactivo\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_advertencia);\n break;\n case Constants.STATE_SERVICE.SIN_INTERNET:\n remoteViews.setTextViewText(R.id.tv_estado, \"Sin conexión a internet . .\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_advertencia);\n break;\n }\n\n // notification builder\n NotificationCompat.Builder notificationBuilder;\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n notificationBuilder = new NotificationCompat.Builder(this, FOREGROUND_CHANNEL_ID);\n } else {\n notificationBuilder = new NotificationCompat.Builder(this);\n }\n notificationBuilder\n .setContent(remoteViews)\n .setSmallIcon(R.drawable.ic_carrito_verde)\n .setCategory(NotificationCompat.CATEGORY_SERVICE)\n .setOnlyAlertOnce(true)\n .setOngoing(true)\n .setAutoCancel(true)\n .setContentIntent(pendingIntent);\n\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {\n notificationBuilder.setVisibility(Notification.VISIBILITY_PUBLIC);\n }\n\n return notificationBuilder.build();\n }", "public void sendNotificaitoin(User user) throws MailException, InterruptedException {\n\n\n System.out.println(\"Sending email...\");\n\n SimpleMailMessage mail = new SimpleMailMessage();\n mail.setTo(\"[email protected]\");\n mail.setFrom(\"[email protected]\");\n mail.setSubject(\"notification\");\n mail.setText(\"time is running out\");\n javaMailSender.send(mail);\n\n System.out.println(\"Email Sent!\");\n }", "private void startEmergency()\n {\n sendUserPresentLocationDetailsToEmergencyConatct();\n\n /*final ClientConfiguration clientConfiguration = getClientConfiguration();\n completedTime = completedTime + clientConfiguration.getTimeDelayEmergency();\n Timer timer = new Timer();\n timer.schedule(new TimerTask()\n {\n @Override\n public void run()\n {\n completedTime = completedTime + clientConfiguration.getTimeDelayEmergency();\n if (clientConfiguration.getMaxTimeEmergency() < completedTime)\n {\n completedTime = 0;\n cancel();\n notifyEmergencyCompleted();\n }\n else\n {\n sendUserPresentLocationDetailsToEmergencyConatct();\n }\n }\n }, clientConfiguration.getTimeDelayEmergency(), clientConfiguration.getTimeDelayEmergency());*/\n }", "public static void enableRegNotifications() {\n\t\t\n\t}", "void check_and_send(){\r\n\t\twhile(not_ack_yet <= WINDOW_SIZE){\r\n\t\t\tif(covered_datagrams >= total_datagrams)\r\n\t\t\t\treturn;\r\n\t\t\t//send one data more\r\n\t\t\tcovered_datagrams++;\r\n\t\t\tbyte[] data_to_send = Helper.get_bytes(data_send,(covered_datagrams-1)*BLOCK_SIZE,BLOCK_SIZE);\r\n\t\t\tDataDatagram send = new DataDatagram((short)the_connection.session_num,\r\n\t\t\t\t\t(short)(covered_datagrams),data_to_send,the_connection);\r\n\t\t\tsend.send_datagram();\r\n\t\t\tput_and_set_timer(send);\r\n\t\t}\r\n\t}", "private void informTimeToCross() {\n if (continueAskingTimes) {\n requestTimes();\n }\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n mContext = context;\n systems = new Systems(context);\n mCalendar = new GregorianCalendar();\n mManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);\n\n // Check Connected Network\n if(systems.isNetworkAvailable(context))\n {\n try {\n if(!systems.getFarDay(0).equals(systems.getString(\"WheatherAlarmDate\", \"null\"))) {\n // Get Local Weather : Reh\n LocalWeather localWeather = new LocalWeather(context);\n String Reh = localWeather.execute().get();\n\n // Check Reh Value is Valid?\n if (Reh != null) {\n // get Preference Setting Value\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);\n boolean vibrate = prefs.getBoolean(\"Setting_Vibrate\", true);\n boolean sound = prefs.getBoolean(\"Setting_Sound\", true);\n\n // Set Auto WaterGoal\n if (prefs.getBoolean(\"Setting_AutoGoal\", true)) {\n int recommandAmount = systems.getInt(\"userWeight\", 60) * 30 + (500 - Integer.parseInt(Reh) * 3);\n systems.putString(\"WaterGoal\", String.valueOf(recommandAmount));\n\n // Send Notification\n if (prefs.getBoolean(\"Setting_AutoGoalPush\", true))\n systems.sendNotification(\"물 한잔 해요\", \"오늘의 습도 : \" + Reh + \"%, 목표 섭취량 : \" + recommandAmount + \"ml\", 1, vibrate, sound);\n }\n\n // Save Reh Data\n systems.putString(\"Reh\", Reh);\n\n // Cancel this Alarm\n mManager.cancel(pendingIntent(requestC));\n\n // Set Next Alarm\n mCalendar.set(mCalendar.get(Calendar.YEAR), mCalendar.get(Calendar.MONTH), mCalendar.get(Calendar.DAY_OF_MONTH), 7, 0);\n mCalendar.add(Calendar.DATE, 1);\n mManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, mCalendar.getTimeInMillis(), 1200 * 1000, pendingIntent(requestC));\n\n // Set Preference\n systems.putString(\"WheatherAlarmDate\", systems.getFarDay(0));\n }\n }\n }\n catch (Exception e){\n // Network Error\n }\n }\n }", "public void onMessageReceived(RemoteMessage remoteMessage) {\n if (remoteMessage.getData().size() > 0) {\n Log.e(\"ORM\", \"Message data payload: \" + remoteMessage.getData());\n }\n PreferenceManager.getDefaultSharedPreferences(getBaseContext());\n // Check if message contains a notification payload.\n if (remoteMessage.getNotification() != null) {\n // for foreground\n Map<String, String> data = null;\n if (remoteMessage.getData().get(\"type\") != null) {\n data = remoteMessage.getData();\n Log.i(TAG, \"onMessageReceived: type = \" + remoteMessage.getData().get(\"type\"));\n Log.i(TAG, \"onMessageReceived: time = \" + remoteMessage.getSentTime());\n sendNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody(), data);\n }\n } else {\n // for background\n if (remoteMessage.getData().size() > 0) {\n switch (remoteMessage.getData().get(\"type\")) {\n case \"alarm_alert\":\n String[] request_link = remoteMessage.getData().get(\"api\").split(\"\\\\?\");\n new JSONResponse(this, request_link[0], request_link[1], new JSONResponse.onComplete() {\n @Override\n public void onComplete(JSONObject json) {\n Log.i(TAG, \"onComplete: alarm_alert data json = \" + json);\n try {\n JSONArray jsonArr = json.getJSONArray(\"data\");\n for (int i = 0; i < jsonArr.length(); i++) {\n JSONObject obj = jsonArr.getJSONObject(i);\n String time = obj.getString(\"day\") + \" \" + obj.getString(\"time\");\n String task = \"\";\n for (int j = 0; j < obj.getJSONArray(\"task\").length(); j++) {\n if (j != 0) {\n task += \",\";\n }\n task += obj.getJSONArray(\"task\").getString(j);\n }\n String title = obj.getString(\"stage\");\n Log.i(TAG, \"onComplete: alarm_alert time = \" + time);\n Log.i(TAG, \"onComplete: alarm_alert task = \" + task);\n String value = obj.getString(\"value\");\n String[] a = time.split(\" \");\n String requestCode = a[0].replace(\"-\", \"\") + a[1].replace(\":\", \"\");\n requestCode = requestCode.substring(2, 12);\n int rc = Integer.parseInt(requestCode);\n Log.i(TAG, \"onComplete: requestCode = \" + rc);\n long delta = calculateDelay(time);\n boolean enable = value.equals(\"on\");\n if (delta >= 0) {\n sendMsgForAlertSystem(title, task, delta, rc, enable);\n }\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n });\n break;\n case \"nutrition\":\n String[] request_link1 = remoteMessage.getData().get(\"api\").split(\"\\\\?\");\n Log.i(TAG, \"onMessageReceived: \" + request_link1);\n new JSONResponse(this, request_link1[0], request_link1[1], new JSONResponse.onComplete() {\n @Override\n public void onComplete(JSONObject json) {\n Log.i(TAG, \"onComplete: json = \" + json);\n try {\n int rc = json.getInt(\"rc\");\n if (rc == 0) {\n JSONArray data = json.getJSONObject(\"data\").getJSONArray(\"data\");\n Log.i(TAG, \"onComplete: json data = \" + data);\n for (int i = 0; i < data.length(); i++) {\n JSONObject obj = data.getJSONObject(i);\n Log.i(TAG, \"onComplete: json data item = \" + obj);\n String title = obj.getString(\"title\");\n String time = obj.getString(\"time\");\n String content = \"\";\n JSONArray food = obj.getJSONArray(\"food\");\n JSONArray quantity = obj.getJSONArray(\"quantity\");\n for (int j = 0; j < food.length(); j++) {\n content += food.getString(j) + \" \" + quantity.getString(j);\n if (j < food.length() - 1) {\n content += \",\";\n }\n }\n Log.i(TAG, \"onComplete: json data content = \" + content);\n String today = getRealFormat(\"yyyy-MM-dd\").format(new Date());\n if (time != null && isTime(time) && !title.equals(\"\") && !content.equals(\" \")) {\n long delta = calculateDelay(today + \" \" + (time.length() < 6 ? time + \":00\" : time));\n delta -= delta - 10 * 60 * 1000; // 10min before\n String requestCode = today.replace(\"-\", \"\") + i;\n int resC = Integer.parseInt(requestCode.substring(2));\n if (delta >= 0) {\n// sendMsgForNutrition(title, content, time, delta, resC, i);\n sendMsgFor(API.ACTION_NUTRITION, title, content, time, delta, resC, i);\n } else {\n delta = delta + 24 * 60 * 60 * 1000;\n Date tmp = new Date();\n tmp.setTime(new Date().getTime() + 24 * 60 * 60 * 1000);\n String tomorrow = getRealFormat(\"yyyy-MM-dd\").format(tmp);\n requestCode = tomorrow.replace(\"-\", \"\") + i;\n resC = Integer.parseInt(requestCode.substring(2));\n// sendMsgForNutrition(title, content, time, delta, resC, i);\n sendMsgFor(API.ACTION_NUTRITION, title, content, time, delta, resC, i);\n }\n }\n }\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n });\n break;\n case \"client_alert\":\n String[] request_link2 = remoteMessage.getData().get(\"api\").split(\"\\\\?\");\n Log.i(TAG, \"onMessageReceived: \" + request_link2);\n new JSONResponse(this, request_link2[0], request_link2[1], new JSONResponse.onComplete() {\n @Override\n public void onComplete(JSONObject json) {\n Log.i(TAG, \"onComplete: json = \" + json);\n try {\n int rc = json.getInt(\"rc\");\n if (rc == 0) {\n JSONArray data = json.getJSONObject(\"data\").getJSONArray(\"data\");\n Log.i(TAG, \"onComplete: json data = \" + data);\n for (int i = 0; i < data.length(); i++) {\n JSONObject obj = data.getJSONObject(i);\n Log.i(TAG, \"onComplete: json data item = \" + obj);\n String title = obj.getString(\"title\");\n String time = obj.getString(\"time\");\n String content = \"\";\n JSONArray contentArr = obj.getJSONArray(\"content\");\n for (int j = 0; j < contentArr.length(); j++) {\n content += contentArr.getString(j);\n if (j < contentArr.length() - 1) {\n content += \",\";\n }\n }\n Log.i(TAG, \"onComplete: json data content = \" + content);\n String today = getRealFormat(\"yyyy-MM-dd\").format(new Date());\n Log.i(TAG, \"onComplete: isTime = \" + isTime(time));\n if (time != null && isTime(time) && !title.equals(\"\") && !content.equals(\" \")) {\n long delta = calculateDelay(today + \" \" + (time.length() < 6 ? time + \":00\" : time));\n delta -= delta - 10 * 60 * 1000; // 10min before\n String requestCode = today.replace(\"-\", \"\") + (i + 10);\n int resC = Integer.parseInt(requestCode.substring(2));\n if (delta >= 0) {\n// sendMsgForClientAlert(title, content, time, delta, resC, i);\n sendMsgFor(API.ACTION_CLIENT_ALERT, title, content, time, delta, resC, i);\n } else {\n delta = delta + 24 * 60 * 60 * 1000;\n Date tmp = new Date();\n tmp.setTime(new Date().getTime() + 24 * 60 * 60 * 1000);\n String tomorrow = getRealFormat(\"yyyy-MM-dd\").format(tmp);\n requestCode = tomorrow.replace(\"-\", \"\") + (i + 10);\n resC = Integer.parseInt(requestCode.substring(2));\n// sendMsgForClientAlert(title, content, time, delta, resC, i);\n sendMsgFor(API.ACTION_CLIENT_ALERT, title, content, time, delta, resC, i);\n }\n }\n }\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n });\n break;\n }\n }\n }\n }", "private void notifyStakeholder(){\n }", "@Override\n public void onReceive(Context k1, Intent k2) {\n Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(k1)\n .setSmallIcon(R.drawable.ic_logo)\n .setContentTitle(\"Missed Task!\")\n .setContentText(\"Check your feed for details!\")\n .setSound(alarmSound);\n int mNotificationId = 001;\n\n\n NotificationManager mNotifyMgr =\n (NotificationManager) k1.getSystemService(Context.NOTIFICATION_SERVICE);\n// Builds the notification and issues it.\n mNotifyMgr.notify(mNotificationId, mBuilder.build());\n\n }", "@Override\n public synchronized void enableIfPossible() {\n if (!enabled && analyticNotificationConfig != null) {\n if (lastNotificationTimeMs == null) {\n reset();\n\n } else {\n // See if we should resume notifications.\n if (analyticNotificationConfig.getResumeAfter() != null) {\n final Instant resumeTime = SimpleDurationUtil.plus(\n lastNotificationTimeMs,\n analyticNotificationConfig.getResumeAfter());\n final Instant now = Instant.now();\n if (now.isAfter(resumeTime)) {\n reset();\n }\n }\n }\n }\n }" ]
[ "0.6686329", "0.63562876", "0.62219584", "0.61696553", "0.6163989", "0.6116342", "0.6112527", "0.6055009", "0.6002878", "0.59440506", "0.5940745", "0.5930527", "0.5908151", "0.58977896", "0.58941746", "0.5884432", "0.5880623", "0.58761525", "0.5866256", "0.5854404", "0.5848766", "0.5840318", "0.5828263", "0.57794553", "0.5769679", "0.5765591", "0.57559234", "0.5755293", "0.57487553", "0.57317877", "0.57282776", "0.5719766", "0.5719766", "0.5719766", "0.5719766", "0.5709261", "0.56964266", "0.5689966", "0.56836593", "0.5683006", "0.5673202", "0.5671852", "0.5671753", "0.5656898", "0.5649908", "0.56485045", "0.5643693", "0.5638211", "0.56273645", "0.56265247", "0.5625747", "0.56247854", "0.5620995", "0.5606059", "0.5595734", "0.5595508", "0.5591578", "0.55868757", "0.5578704", "0.55777586", "0.55639464", "0.5559166", "0.5555865", "0.5554731", "0.55504006", "0.55412465", "0.55333143", "0.5532883", "0.5530781", "0.5529458", "0.5522217", "0.5521026", "0.5517427", "0.55143076", "0.55130535", "0.54957217", "0.5495406", "0.54946613", "0.5491688", "0.54810584", "0.5480527", "0.5480029", "0.54771644", "0.5473561", "0.54673356", "0.5457722", "0.54544705", "0.5453625", "0.5453625", "0.5443357", "0.54221493", "0.54159665", "0.5414858", "0.54123425", "0.54081", "0.5407584", "0.540603", "0.5402375", "0.5392354", "0.5392048" ]
0.68188536
0
in every sunday 6.00pm do this clearing notification Collection and re adding them.set status to false
@Scheduled(cron = "0 0 18 * * SUN") void refreshNotifications(){ notificationService.refreshAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void refreshNotification() {\n String str = this.mCurrentAddedNotiSsid;\n if (str != null) {\n showNotification(str, true, true);\n }\n String str2 = this.mCurrentDeletedNotiSsid;\n if (str2 != null) {\n showNotification(str2, false, true);\n }\n }", "private void createScheduledNotification(List<SessionModel> values, int test)\n\t{\n\n\t\t// Get new calendar object and set the date to now\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTimeInMillis(System.currentTimeMillis());\n\t\t// Add defined amount of days to the date\n\n\t\tgetBaseContext();\n\t\t// Retrieve alarm manager from the system\n\t\tAlarmManager alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);\n\n\t\tfor (SessionModel element : values) {\n\n\t\t\tString[] ymd = element.getStartDateSplit();\n\t\t\tint month = Integer.parseInt(ymd[0]);\n\t\t\tint date = Integer.parseInt(ymd[1]);\n\t\t\tint year = Integer.parseInt(ymd[2]);\n\n\t\t\tString[] hm = element.getStartTimeSplit();\n\t\t\tint hour = Integer.parseInt(hm[0]);\n\t\t\tint min = Integer.parseInt(hm[1]);\n\n\t\t\tcalendar.set(Calendar.YEAR, year);\n\t\t\tcalendar.set(Calendar.MONTH, month);\n\t\t\tcalendar.set(Calendar.DATE, date);\n\t\t\tcalendar.set(Calendar.HOUR, hour);\n\t\t\tcalendar.set(Calendar.MINUTE, min);\n\n\t\t\tlong secs = calendar.getTimeInMillis();\n\t\t\tsecs -= 600000;\n\t\t\tcalendar.setTimeInMillis(secs);\n\t\t\tLog.w(\"AlarmManager-TDC2014 \", \"Setting Alarm Time : \" + calendar.toString());\n\t\t\tint id = (int) System.currentTimeMillis();\n\t\t\tIntent intent = new Intent(\"net.redirectme.apps.SESSION_NOTIFY\");\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TEXT, element.getId());\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TITLE, element.getName());;\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SUBJECT, element.getAuthor());\n\n\t\t\tint trackIcon = element.getTrackIcon();\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SHORTCUT_ICON, trackIcon);\n\n\n\t\t\tPendingIntent pendingIntent = PendingIntent.getBroadcast(this, id, intent, PendingIntent.FLAG_ONE_SHOT);\n\t\t\talarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);\n\n\t\t}\n\t\tif(test==1)\n\t\t{\n\t\t\t// 5secs from now\n\t\t\tcalendar.setTimeInMillis(System.currentTimeMillis() + 10000);\n\t\t\tLog.w(\"AlarmManager-TEST \", \"Setting Alarm Time : \" + calendar.getTime());\n\t\t\tint id = (int) System.currentTimeMillis();\n\t\t\tIntent intent = new Intent(\"net.redirectme.apps.SESSION_NOTIFY\");\n\t\t\tlong value = 1;\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TEXT, value);\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TITLE, \"Test Session\");;\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Sanjeev BA\");\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SHORTCUT_ICON, R.drawable.track_43_general);\n\n\t\t\tPendingIntent pendingIntent = PendingIntent.getBroadcast(this, id, intent, 0);\n\t\t\talarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);\n\t\t}\n\n\t}", "void clearPersistentNotifications();", "private void setNotifications() {\n RealmManager realmManager = new RealmManager();\n realmManager.open();\n RecurringDao recurringDao = realmManager.createRecurringDao();\n\n List<Recurring> recurringTransactions = recurringDao.getAllRecurringTransactions();\n NotificationScheduler notificationScheduler = new NotificationScheduler(this);\n\n for (Recurring recurring : recurringTransactions) {\n notificationScheduler.schedule(recurring);\n }\n realmManager.close();\n }", "public void sync_notifications() {\n Log.i(TAG,\"********** sync_notifications\");\n\n if (NotifierConfiguration.cfg_notifier_paused) {\n Log.i(TAG, \"Notifier paused. Ignoring...\");\n return;\n }\n\n sync_in_progress = true;\n /**\n * Initially mark everything in notifications table as inactive\n */\n ntfcn_items.markAllInactive();\n\n for (StatusBarNotification asbn : getActiveNotifications()) {\n StatusBarNotification sbn = asbn.clone();\n\n String condensed_string = ntfcn_items.getCondensedString(sbn);\n\n Log.i(TAG,\"Condensed string: \" + condensed_string);\n\n try {\n PackageManager pm = getPackageManager();\n String app_name = (String) pm.getApplicationLabel(\n pm.getApplicationInfo(sbn.getPackageName(), PackageManager.GET_META_DATA));\n\n Log.i(TAG,\"ID :\" + sbn.getId() + \"\\t\" + sbn.getNotification().tickerText +\n \"\\t\" + sbn.getPackageName());\n\n Log.i(TAG,\"App name :\" + app_name + \"\\n\");\n\n HashSet<String> exclusion_list = NotifierConfiguration.excluded_packages;\n if (exclusion_list.contains(sbn.getPackageName())) {\n Log.i(TAG, \"Pkg: \" + sbn.getPackageName() + \" in exclusion list. Ignoring.\");\n continue;\n }\n\n /** skip group headers */\n if ( ((sbn.getNotification().flags & Notification.FLAG_GROUP_SUMMARY) != 0)) {\n Log.i(TAG, \"skippiing group header key: \" + sbn.getKey());\n continue;\n }\n\n /** Add a new active notification entry or\n * just mark it as active if it already exists\n */\n addActiveSBN(sbn);\n\n\n /**\n if (sbn.getNotification().extras.get(NotificationCompat.EXTRA_TEMPLATE).equals(\n \"android.app.Notification$MessagingStyle\")\n ) {\n\n Log.e(TAG, \"Messaging\");\n Log.i(TAG, \"Extra Messages: \" +\n sbn.getNotification().extras.get(NotificationCompat.EXTRA_MESSAGES).toString());\n\n Log.i(TAG, \"Extra Messages History: \" +\n sbn.getNotification().extras.get(Notification.EXTRA_HISTORIC_MESSAGES));\n\n Log.i(TAG, \"Extra conversation title: \" +\n sbn.getNotification().extras.get(NotificationCompat.EXTRA_CONVERSATION_TITLE));\n }\n\n\n Log.i(TAG, \"Flags: \" +\n ((sbn.getNotification().flags & Notification.FLAG_GROUP_SUMMARY) != 0));\n\n Log.i(TAG, \"Title :\" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_TITLE) + \"\\n\");\n Log.i(TAG, \"Text :\" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_TEXT) + \"\\n\");\n Log.i(TAG, \"Extra conv titles: \" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_CONVERSATION_TITLE));\n\n Log.i(TAG, \"Extra info text: \" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_INFO_TEXT));\n Log.i(TAG, \"Extra Messages: \" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_MESSAGES));\n\n Log.i(TAG, \"Extra big text lines\" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_BIG_TEXT));\n Log.i(TAG, \"Extra text lines\" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_TEXT_LINES));\n Log.i(TAG, \"Extra sub text \" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_SUB_TEXT));\n Log.i(TAG, \"Extra summary text \" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_SUMMARY_TEXT));\n\n Log.i(TAG, \"Extra title big: \" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_TITLE_BIG));\n\n\n Log.i(TAG, \"SBN group? \" + sbn.isGroup());\n Log.i(TAG, \"Clearable? \" + sbn.isClearable());\n Log.i(TAG, \"Posted at \" + DateUtils.getRelativeTimeSpanString(sbn.getPostTime()));\n Log.i(TAG, \"Group key \" + sbn.getGroupKey());\n Log.i(TAG, \"SBN key \" + sbn.getKey());\n Log.i(TAG, \"TAG \" + sbn.getTag());\n Log.i(TAG, \"Click Action :\" + sbn.getNotification().contentIntent.toString());\n\n Log.i(TAG, \"Delete Action :\" + sbn.getNotification().deleteIntent.toString());\n\n for (Notification.Action action : sbn.getNotification().actions) {\n Log.i(TAG, \"Action :\" + action.title + \" Intent: \" + action.actionIntent.toString() + \"\\n\");\n }\n */\n } catch(Exception e) {\n Log.e(TAG, \"Exception occurred while syncing notifications: \" + e.getMessage());\n }\n }\n\n /**\n * If there are entries previously marked inactive, but doesn't have its cleared time set,\n * Set its cleared time to now\n */\n ntfcn_items.update_cleared_time_if_zero();\n this.num_active = ntfcn_items.getActiveCount();\n sync_in_progress = false;\n\n /** Update active notifications count in persistent notification */\n pnotif_builder.setContentText(\"Tap to open Notifications Center\");\n\n if (NotifierConfiguration.cfg_svc_notification_enabled) {\n show_notification();\n }\n\n /**\n * TODO: if needed, remove all inactive applications at this point\n * if NotifierConfiguration.cfg_cache_notifications_enabled is false\n */\n }", "private void refresh() {\n ArrayList<Note> notes = db.getAllNotes();\n ArrayList<Note> notesWithNotification = new ArrayList<Note>();\n\n for (int index = 0; index < notes.size(); index++) {\n if (notes.get(index).getNotification() != null) {\n notesWithNotification.add(notes.get(index));\n }\n }\n\n mNoteWithNotificationList = notesWithNotification;\n }", "void removeOldNotification();", "@Scheduled(fixedRateString = \"PT120M\")\n\tvoid someJob(){\n//\t\tString s = \"Testing message.\\nNow time is : \"+new Date();\n////\t\tSystem.out.println(s);\n//\t\tPushNotificationOptions.sendMessageToAllUsers(s);\n//\n\t\t//get all schedules in current dayOfWeek\n\t\tCollection<Notification> notifications = notificationService.findAllByDayOfWeekAndTime();\n\t\tfor(Notification notification : notifications){\n//\t\t\tSystem.out.println(notification.toString());\n//\t\t\tSystem.out.println(!notification.getStatus());\n////\t\t\tSystem.out.println(check(notification.getStartTime()));\n//\t\t\t//check for already not sent notifications , also check for time difference < TIME_CONSTANT\n//\t\t\tif(!notification.getStatus() && check(notification.getStartTime())){\n//\t\t\t\t//send push notification\n//\t\t\t\tPushNotificationOptions.sendMessageToAllUsers(notification.getMessage());\n//\t\t\t\t//mark the notification as sent\n//\t\t\t\tnotificationService.setStatus(notification.getNotificationId());\n//\t\t\t}\n\t\t\tif(checkForDayTime()){\n\t\t\t\tPushNotificationOptions.sendMessageToAllUsers(notification.getMessage());\n\t\t\t\tnotificationService.setStatus(notification.getNotificationId());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}", "@Override\n public void setNotification() {\n if (getTense() == Tense.FUTURE) {\n //Context ctx = SHiTApplication.getContext();\n //SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(ctx);\n\n int leadTimeEventMinutes = SHiTApplication.getPreferenceInt(Constants.Setting.ALERT_LEAD_TIME_EVENT, LEAD_TIME_MISSING);\n\n if (leadTimeEventMinutes != LEAD_TIME_MISSING) {\n if (travelTime > 0) {\n leadTimeEventMinutes += travelTime;\n }\n\n setNotification(Constants.Setting.ALERT_LEAD_TIME_EVENT\n , leadTimeEventMinutes\n , R.string.alert_msg_event\n , getNotificationClickAction()\n , null);\n }\n }\n }", "public void setAlarms()\n\t{\n\t\tSharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\n\t\tAlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);\n\t\t\n\t\tSet<String> set;\n\t\tset=sp.getStringSet(\"lowattnotifs\", null);\n\t\tif(set!=null)\n\t\t{\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tcal.set(Calendar.HOUR_OF_DAY, 19);\n\t\t\tcal.set(Calendar.MINUTE, 0);\n\t\t\tcal.set(Calendar.SECOND, 0);\n\t\t\t\n\t\t\tIntent attintent = new Intent(this, Monitor.class);\n\t\t\tattintent.putExtra(\"attordate\", 0);\n\t\t\tPendingIntent attpintent = PendingIntent.getService(this, 0, attintent, 0);\n\t\t\t\n\t\t\talarm.cancel(attpintent);\t\t//cancel all alarms for attendance reminders\n\t\t\t\n\t\t\t//check if set contains these days\n\t\t\tfor(int i=0; i<7; i++)\n\t\t\t{\n\t\t\t\tif(set.contains(String.valueOf(i)))\n\t\t\t\t{\n\t\t\t\t\tcal.set(Calendar.DAY_OF_WEEK, i);\n\t\t\t\t\talarm.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), attpintent);\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"Set for day: \"+i, Toast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void ifNotificationOnChecked() {\n\t\tif (notificationOnChecked && bNotification) {\n\t\t\tnotifyMain(\"Autostop:\\n\" + upTime + \" s\", \"Recording...\");\n\t\t} else {\n\t\t\tif (notificationManager != null) {\n\t\t\t\tnotificationManager.cancelAll();\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void run() {\n Calendar calendar = Calendar.getInstance();\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n String dateTime = simpleDateFormat.format(calendar.getTime());\n\n //Find the current time\n SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat(\"hh:mm:ss a\");\n String currentTime = simpleDateFormat1.format(calendar.getTime());\n\n //Find duration of current date and first day\n Date date1,date2;\n String dateStr1 = data.getDate();\n String dateStr2 = dateTime;\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\");\n try{\n date1 = sdf.parse(dateStr1);\n date2 = sdf.parse(dateStr2);\n long diff = date2.getTime() - date1.getTime();\n long totalDay = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channel = new NotificationChannel(\"My Notification\", \"My Notification\", NotificationManager.IMPORTANCE_DEFAULT);\n NotificationManager manager = getSystemService(NotificationManager.class);\n manager.createNotificationChannel(channel);\n }\n\n //Exercise Time\n if(totalDay==0 || totalDay==1 || (totalDay>4+dayInSpace && totalDay<=10+dayInSpace)){\n if (currentTime.equals(\"05:00:00 PM\")) {\n NotificationExercise();\n }\n }\n\n if(totalDay==2){\n if (currentTime.equals(\"08:00:00 PM\")) {\n NotificationExercise();\n }\n }\n\n if(totalDay==3){\n if (currentTime.equals(\"10:00:00 PM\")) {\n NotificationExercise();\n }\n }\n\n if(totalDay>=5 && totalDay<=4+dayInSpace){\n if (currentTime.equals(\"03:00:00 AM\")) {\n NotificationExercise();\n }\n }\n\n //Eating time (After half hour wake up-breakfast, After five hours wake up-lunch, Before four hours sleep-dinner)\n if(totalDay==0 || totalDay==1){\n if (currentTime.equals(\"07:30:00 AM\") || currentTime.equals(\"12:00:00 PM\") || currentTime.equals(\"07:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay==2){\n if (currentTime.equals(\"08:30:00 AM\") || currentTime.equals(\"01:00:00 PM\") || currentTime.equals(\"10:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay==3){\n if (currentTime.equals(\"10:30:00 AM\") || currentTime.equals(\"03:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay==4){\n if (currentTime.equals(\"12:00:00 AM\") || currentTime.equals(\"12:30:00 PM\") || currentTime.equals(\"05:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay>=5 && totalDay<=4+dayInSpace){\n if (currentTime.equals(\"05:00:00 AM\") || currentTime.equals(\"03:30:00 PM\") || currentTime.equals(\"08:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay>4+dayInSpace && totalDay<=10+dayInSpace){\n if (currentTime.equals(\"08:30:00 AM\") || currentTime.equals(\"01:00:00 PM\") || currentTime.equals(\"7:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n //Take Melatonin time\n if(totalDay>=5 && totalDay<5+dayInSpace){\n if (currentTime.equals(\"09:00:00 AM\")) {\n NotificationTakeMelatonin();\n }\n }\n\n if(totalDay>=4+dayInSpace && totalDay<=6+dayInSpace){\n if (currentTime.equals(\"11:00:00 PM\")) {\n NotificationTakeMelatonin();\n }\n }\n\n //Nap time\n if(totalDay>=4 && totalDay<4+dayInSpace){\n if (currentTime.equals(\"06:00:00 PM\")) {\n NotificationNap();\n }\n }\n\n if(totalDay>=4 && totalDay<4+dayInSpace){\n if (currentTime.equals(\"08:00:00 PM\")) {\n NotificationNap();\n }\n }\n\n //Sleep Time\n if(totalDay==0){\n if (currentTime.equals(\"12:00:00 AM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay==0 || totalDay==1){\n if (currentTime.equals(\"11:00:00 PM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay==3){\n if (currentTime.equals(\"02:00:00 AM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay==4){\n if (currentTime.equals(\"04:00:00 AM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay>=5 && totalDay<5+dayInSpace){\n if (currentTime.equals(\"09:00:00 AM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay>=4+dayInSpace && totalDay<=10+dayInSpace){\n if (currentTime.equals(\"11:00:00 PM\")) {\n NotificationSleep();\n }\n }\n\n //Wake Up Time\n if(totalDay==0 || totalDay==1){\n if (currentTime.equals(\"07:00:00 AM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay==2){\n if (currentTime.equals(\"08:00:00 AM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay==3){\n if (currentTime.equals(\"10:00:00 AM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay==4){\n if (currentTime.equals(\"12:00:00 PM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay>=5 && totalDay<5+dayInSpace){\n if (currentTime.equals(\"03:00:00 PM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay>=5+dayInSpace && totalDay<=10+dayInSpace){\n if (currentTime.equals(\"08:00:00 AM\")) {\n NotificationWakeUp();\n }\n }\n\n }catch(ParseException e){\n Log.d(\"error\",\"error\");\n }\n }", "private void sendNotifications() {\n this.sendNotifications(null);\n }", "private void refreshEvents() {\r\n\t\ttry {\r\n\t\t\tif (SimpleSetting.ShowAlerts.getBoolean(true)) {\r\n\t\t\t\tloadUpcomingEvents();\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tRTeamLog.i(SUFFIX, \"Exception while refreshing events: %s\", e.getMessage());\r\n\t\t}\r\n\t}", "public void reload() {\n waiterNotifications.clear();\n waiterNotifications.addAll(Local.getInstance().getWaiterNotificationList());\n notifyDataSetChanged();\n\n }", "private void notifyUser(List<String> result) {\r\n\t\t\tif(Util.getProperty(getApplicationContext(),\"notificationTimeChanged\",\"\").equals(\"true\") \r\n\t\t\t\t\t|| !notifiedToday())\r\n\t\t\t{\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"notificationTimeChanged\", \"false\");\r\n\t\t\t\tif(result.size() > 0){\r\n\t\t\t\t\tint itemsDue = result.size();\r\n\t\t\t\t\tStringBuffer notificationText = new StringBuffer();\r\n\t\t\t\t\tfor(int i=0; i<itemsDue; i++){\r\n\t\t\t\t\t\tif(i!=0)\r\n\t\t\t\t\t\t\tnotificationText.append(\", \");\r\n\t\t\t\t\t\tnotificationText.append(result.get(i));\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tContext context = getApplicationContext();\r\n\t\t\t\t\tNotificationManager nm = (NotificationManager)context.getSystemService(NOTIFICATION_SERVICE);\r\n\t\t\t\t\tIntent notificationIntent = new Intent(context,ReminderActivity.class);\r\n\t\t\t\t\tPendingIntent pi = PendingIntent.getActivity(context, 0, notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);\r\n\t\t\t\t\tNotification n = new Notification.Builder(context)\r\n\t\t\t\t\t.setContentTitle(String.valueOf(itemsDue) + \" Items Due\")\r\n\t\t\t\t\t.setContentText(notificationText.toString())\r\n\t\t\t\t\t.setSmallIcon(R.drawable.ic_launcher)\r\n\t\t\t\t\t//.setLargeIcon(R.drawable.ic_basket)\r\n\t\t\t\t\t.setContentIntent(pi)\r\n\t\t\t\t\t.build();\t \r\n\t\t\t\t\tnm.notify(1, n);\r\n\t\t\t\t}\r\n\t\t\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"dd-MMM-yyyy\",Locale.US);\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"ServiceLastRanOn\",formatter.format(new Date()));\r\n\t\t\t}\r\n\t\t}", "private void renewTimes() {\n String time_morgens_new = time_prefs.getString(\"time_morgens\", getResources().getString(R.string.default_morgens));\n String time_mittags_new = time_prefs.getString(\"time_mittags\", getResources().getString(R.string.default_mittags));\n String time_abends_new = time_prefs.getString(\"time_abends\", getResources().getString(R.string.default_abends));\n String time_zur_nacht_new = time_prefs.getString(\"time_morgens\", getResources().getString(R.string.default_morgens));\n /*comparison of class local time variblaes with new Preferences\n deletes alarms affected medicines and creates new alarms for them\n */\n\n if (!time_morgens.equals(time_morgens_new)) {\n //list all affected Meds and iterate for each\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Morgens\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n\n if (!time_mittags.equals(time_mittags_new)) {\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Mittags\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n if (!time_abends.equals(time_abends_new)) {\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Abends\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n if (!time_zur_nacht.equals(time_zur_nacht_new)) {\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Morgens\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n }", "public static void enableRegNotifications() {\n\t\t\n\t}", "protected void notificationOnExpiration() {\n }", "public void sendIncidentNotification() {\n\n final ParseQuery<ParseObject> pendingNotifs = ParseQuery.getQuery(\"PendingNotifications\");\n pendingNotifs.whereEqualTo(\"username\", ParseUser.getCurrentUser().getUsername());\n pendingNotifs.findInBackground(new FindCallback<ParseObject>() {\n @Override\n public void done(List<ParseObject> objects, ParseException e) {\n if ( e == null) {\n if (objects.size()>0) {\n for (ParseObject object : objects) {\n String type = object.getString(\"type\");\n\n Intent activityIntent = new Intent(getApplicationContext(), MyNeighbourhood.class);\n PendingIntent contentIntent = PendingIntent.getActivity(NotificationAbstract.this, 0,activityIntent, 0);\n\n String message = \"A new \" + type + \" incident has occurred in your neighbourhood. Check 'my Neighbourhood' to view details\";\n android.app.Notification notification = new NotificationCompat.Builder(mContext, StarterApplication.CHANNEL_1_ID)\n .setSmallIcon(R.drawable.unnamed)\n .setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(),\n R.drawable.unnamed))\n .setContentTitle(\"New \" + type + \" Incident\")\n .setContentText(message)\n .setStyle(new NotificationCompat.BigTextStyle())\n .setPriority(NotificationCompat.PRIORITY_HIGH)\n .setCategory(NotificationCompat.CATEGORY_MESSAGE)\n .setContentIntent(contentIntent)\n .build();\n\n notificationManager.notify(1, notification);\n Log.i(\"NotificationIncident\", \"sent\");\n\n ParseUser.getCurrentUser().put(\"notifiedUpdated\", \"true\");\n try {\n object.delete();\n } catch (ParseException e1) {\n e1.printStackTrace();\n }\n ParseUser.getCurrentUser().saveInBackground();\n\n }\n }\n }\n }\n });\n\n\n if (ParseUser.getCurrentUser().getString(\"notifiedUpdated\").matches(\"false\")) {\n Log.i(\"Incident:\", \"Incident notification needs to be sent\");\n // the user is NOT up to date, so query incidents\n\n\n\n }\n\n else {\n Log.i(\"Incident\", \"Incident notification not sending\");\n String stat = ParseUser.getCurrentUser().getString(\"pending\");\n if (stat != null){\n\n }\n else {\n\n }\n }\n }", "public void save() {\n JobNotificationDao dao = new JobNotificationDao();\n projectBean.getWorkload().getJobConfiguration().getNotifications().clear();\n for (JobNotification notification : notifications) {\n notification.copyTransient();\n notification = dao.saveOrUpdate(notification);\n projectBean.getWorkload().getJobConfiguration().getNotifications().add(notification);\n }\n }", "public void removeAlarms (){\n AlarmManager alarmManager = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE);\n for (int i = 0; i < dogMetaDataArrayList.size(); i++){\n Intent recreateIntent = new Intent(getContext(), OneTimeReciveNotification.class);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(getContext(), i, recreateIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n pendingIntent.cancel();\n alarmManager.cancel(pendingIntent);\n }\n }", "void enableNotifications();", "@Override\n\tpublic void saveNotifications() {\n\t}", "private void retrieveNotification() { =====================================================\n // Creating Notification Model\n // =====================================================\n\n// Bitmap patientAvatar1 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_18);\n// Bitmap patientAvatar2 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_19);\n// Bitmap patientAvatar3 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_20);\n//\n// Patient patient1 = new Patient(\"Garry\", \"Reese\", \"123AB456\", patientAvatar1);\n// Patient patient2 = new Patient(\"Lillian\", \"Wade\", \"987CD654\", patientAvatar2);\n// Patient patient3 = new Patient(\"Laura\", \"Freeman\", \"AV12G64\", patientAvatar3);\n//\n// Bitmap caregiverAvatar1 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_01);\n// Bitmap caregiverAvatar2 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_02);\n// Bitmap caregiverAvatar3 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_03);\n// Bitmap caregiverAvatar4 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_04);\n// Bitmap caregiverAvatar5 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_05);\n//\n// DateTime date1 = DateTime.now();\n// DateTime date2 = DateTime.now().minusDays(2).minusHours(2);\n// DateTime date3 = DateTime.now().minusDays(5).plusHours(1);\n// DateTime date4 = DateTime.now().minusDays(4).minusHours(2);\n// DateTime date5 = DateTime.now().minusDays(1).plusHours(1);\n// DateTime date6 = DateTime.now().minusDays(3).plusHours(5);\n//\n// String caregiverName1 = \"John Doe\";\n// String caregiverName2 = \"Jane Doe\";\n// String caregiverName3 = \"Tracy Lee\";\n// String caregiverName4 = \"Apple Tan\";\n// String caregiverName5 = \"Bethany Mandler\";\n//\n// String summary1 = \"Updated information of patient Garry Reese\";\n// String summary2 = \"Log new problem for patient Lilian Wade\";\n// String summary3 = \"Create new patient Laura Freeman\";\n// String summary4 = \"Recommended the game category memory to patient Garry Reese\";\n// String summary5 = \"Updated the milk allergy of patient Lillian Wade\";\n// String summary6 = \"Log new problem for patient Garry Reese\";\n//\n// Notification notification1 = new Notification(date1, caregiverName1, caregiverAvatar1, summary1, patient1, Notification.STATUS_NONE, Notification.TYPE_UPDATE_INFO_FIELD);\n// Notification notification2 = new Notification(date2, caregiverName2, caregiverAvatar2, summary2, patient2, Notification.STATUS_NONE, Notification.TYPE_NEW_INFO_OBJECT);\n// Notification notification3 = new Notification(date3, caregiverName3, caregiverAvatar3, summary3, patient3, Notification.STATUS_NONE, Notification.TYPE_NEW_PATIENT);\n// Notification notification4 = new Notification(date4, caregiverName4, caregiverAvatar4, summary4, patient1, Notification.STATUS_NONE, Notification.TYPE_GAME_RECOMMENDATION);\n// Notification notification5 = new Notification(date5, caregiverName5, caregiverAvatar5, summary5, patient2, Notification.STATUS_NONE, Notification.TYPE_UPDATE_INFO_OBJECT);\n// Notification notification6 = new Notification(date6, caregiverName3, caregiverAvatar3, summary6, patient1, Notification.STATUS_NONE, Notification.TYPE_NEW_INFO_OBJECT);\n//\n ArrayList<Notification> notificationList = new ArrayList<>();\n//// notificationList.add(notification1);\n//// notificationList.add(notification2);\n//// notificationList.add(notification3);\n//// notificationList.add(notification4);\n//// notificationList.add(notification5);\n//// notificationList.add(notification6);\n\n dbfile db = new dbfile();\n notificationList = db.prepareNotificationList(getApplicationContext());\n Log.v(\"WHY LIKE THAT\", String.valueOf(notificationList.size()));\n // =====================================================\n // Building the Notification Group based on the notification\n // =====================================================\n\n HashMap patientAndNotificationGroupMap = new HashMap();\n\n for(Notification notification:notificationList) {\n Patient currentPatient = notification.getAffectedPatient();\n String patientNric = currentPatient.getNric();\n\n if (patientAndNotificationGroupMap.containsKey(patientNric)) {\n NotificationGroup notifGroup = (NotificationGroup) patientAndNotificationGroupMap.get(patientNric);\n if(notification.getStatus() == Notification.STATUS_NONE) {\n notifGroup.getUnprocessedNotif().add(notification);\n } else {\n notifGroup.getProcessedNotif().add(notification);\n }\n } else {\n NotificationGroup newNotifGroup = new NotificationGroup();\n newNotifGroup.setAffectedPatient(currentPatient);\n if(notification.getStatus() == Notification.STATUS_NONE) {\n newNotifGroup.getUnprocessedNotif().add(notification);\n } else {\n newNotifGroup.getProcessedNotif().add(notification);\n }\n patientAndNotificationGroupMap.put(patientNric, newNotifGroup);\n }\n }\n\n ArrayList<NotificationGroup> notificationGroupList = new ArrayList<>();\n NotificationComparator comparator = new NotificationComparator();\n for (Object obj : patientAndNotificationGroupMap.values()) {\n NotificationGroup notificationGroup = (NotificationGroup) obj;\n\n // Set notification status\n UtilsUi.setNotificationGroupStatus(this, notificationGroup);\n\n // Sort the notifications by date\n Collections.sort(notificationGroup.getProcessedNotif(), comparator);\n Collections.sort(notificationGroup.getUnprocessedNotif(), comparator);\n\n // Set the summary\n UtilsUi.setNotificationGroupSummary(this, notificationGroup);\n\n notificationGroupList.add(notificationGroup);\n }\n\n DataHolder.setNotificationGroupList(notificationGroupList);\n }", "private void checkPendingCMMNotif()\n throws AlertException {\n\n NodeChange curNotif = null;\n while (true) {\n synchronized(cmmNotifications) {\n try {\n curNotif = (NodeChange) cmmNotifications.removeFirst();\n } catch (NoSuchElementException no) {\n return;\n }\n } \n processCMMNotif(curNotif);\n }\n }", "public void emptyBox()\n {\n this.notifications = new TreeSet<>();\n this.setUpdated();\n }", "public static void createNotification(Context context, Reminder reminder) {\n Intent viewIntent = new Intent(context, MainScreen.class);\n viewIntent.putExtra(\"NOTIFICATION_ID\", reminder.getId());\n viewIntent.putExtra(\"NOTIFICATION_DISMISS\", true);\n PendingIntent pending = PendingIntent.getActivity(context, reminder.getId(), viewIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n /* // Create intent for notification snooze click behaviour\n Intent snoozeIntent = new Intent(context, SnoozeActionReceiver.class);\n snoozeIntent.putExtra(\"NOTIFICATION_ID\", reminder.getId());\n PendingIntent pendingSnooze = PendingIntent.getBroadcast(context, reminder.getId(), snoozeIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n*/\n int imageResId = context.getResources().getIdentifier(reminder.getIcon(), \"drawable\", context.getPackageName());\n\n\n /*NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_ID)\n .setSmallIcon(R.drawable.notification_icon)\n .setContentTitle(textTitle)\n .setContentText(textContent)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT);\n\n */\n NotificationCompat.Builder builder = new NotificationCompat.Builder(context)\n .setSmallIcon(imageResId)\n .setColor(Color.parseColor(reminder.getColour()))\n .setStyle(new NotificationCompat.BigTextStyle().bigText(reminder.getContent()))\n .setContentTitle(reminder.getTitle())\n .setContentText(reminder.getContent())\n .setTicker(reminder.getTitle())\n .setContentIntent(pending);\n\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);\n\n /*if (sharedPreferences.getBoolean(\"checkBoxNagging\", false)) {\n Intent swipeIntent = new Intent(context, DismissReceiver.class);\n swipeIntent.putExtra(\"NOTIFICATION_ID\", reminder.getId());\n PendingIntent pendingDismiss = PendingIntent.getBroadcast(context, reminder.getId(), swipeIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n builder.setDeleteIntent(pendingDismiss);\n\n Calendar calendar = Calendar.getInstance();\n calendar.add(Calendar.MINUTE, sharedPreferences.getInt(\"nagMinutes\", context.getResources().getInteger(R.integer.default_nag_minutes)));\n calendar.add(Calendar.SECOND, sharedPreferences.getInt(\"nagSeconds\", context.getResources().getInteger(R.integer.default_nag_seconds)));\n Intent alarmIntent = new Intent(context, NagReceiver.class);\n AlarmUtil.setAlarm(context, alarmIntent, reminder.getId(), calendar);\n }*/\n\n String soundUri = sharedPreferences.getString(\"NotificationSound\", \"content://settings/system/notification_sound\");\n if (soundUri.length() != 0) {\n builder.setSound(Uri.parse(soundUri));\n }\n if (sharedPreferences.getBoolean(\"checkBoxLED\", true)) {\n builder.setLights(Color.BLUE, 700, 1500);\n }\n if (sharedPreferences.getBoolean(\"checkBoxOngoing\", false)) {\n builder.setOngoing(true);\n }\n if (sharedPreferences.getBoolean(\"checkBoxVibrate\", true)) {\n long[] pattern = {0, 300, 0};\n builder.setVibrate(pattern);\n }\n /*if (sharedPreferences.getBoolean(\"checkBoxMarkAsDone\", false)) {\n Intent intent = new Intent(context, DismissReceiver.class);\n intent.putExtra(\"NOTIFICATION_ID\", reminder.getId());\n PendingIntent pendingIntent = PendingIntent.getBroadcast(context, reminder.getId(), intent, PendingIntent.FLAG_UPDATE_CURRENT);\n builder.addAction(R.drawable.ic_done_white_24dp, context.getString(R.string.mark_as_done), pendingIntent);\n }\n if (sharedPreferences.getBoolean(\"checkBoxSnooze\", false)) {\n builder.addAction(R.drawable.ic_snooze_white_24dp, context.getString(R.string.snooze), pendingSnooze);\n }*/\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n builder.setPriority(Notification.PRIORITY_HIGH);\n }\n\n NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(reminder.getId(), builder.build());\n }", "public void refreshAllRepeatReminderDates(){\n for(int position=0;position<reminderItems.size();position++){\n refreshRepeatReminder(position);\n }\n }", "public void addNotificationAlarm() {\n // get hour and minute from time preference\n SharedPreferences settingsPrefs = PreferenceManager.getDefaultSharedPreferences(this);\n String time = settingsPrefs.getString(SettingsActivity.KEY_NOTIFICATION_TIME, TimePreference.DEFAULT_TIME);\n final int notificationHour = TimePreference.getHourFromString(time);\n final int notificationMinute = TimePreference.getMinuteFromString(time);\n\n // build DateTime for next alarm\n ZonedDateTime notificationTime = ZonedDateTime.now()\n .truncatedTo(ChronoUnit.DAYS)\n .plusHours(notificationHour)\n .plusMinutes(notificationMinute);\n\n if (notificationTime.isBefore(ZonedDateTime.now())) {\n notificationTime = notificationTime.plusDays(1);\n }\n\n // create alarm\n AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);\n am.setInexactRepeating(AlarmManager.RTC_WAKEUP,\n notificationTime.toInstant().toEpochMilli(),\n AlarmManager.INTERVAL_DAY,\n buildAlarmPendingIntent());\n\n // too ensure alarm is recreated if device is restarted\n setBootReceiverEnabled(true);\n }", "public void saveAllNot() {\n SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putBoolean(SW_ALLNOT, allNotifications.isChecked());\n editor.commit();\n }", "private void cleanSweep(){\n // Corrects the reminder dates for those reminders which will be repeating.\n refreshAllRepeatReminderDates();\n\n // Starts removing expired reminders.\n Calendar timeRightNow = Calendar.getInstance();\n boolean cleanList;\n for (int outerCounter=0; outerCounter<reminderItems.size();outerCounter++) {\n cleanList=true;\n for (int counter = 0; counter < reminderItems.size(); counter++) {\n int year = reminderItems.get(counter).getReminderYear();\n int month = reminderItems.get(counter).getReminderMonth();\n int day = reminderItems.get(counter).getReminderDay();\n int hour = reminderItems.get(counter).getReminderHour();\n int minute = reminderItems.get(counter).getReminderMinute();\n int second = 0;\n\n Calendar timeOfDeletion = Calendar.getInstance();\n timeOfDeletion.set(year, month, day, hour, minute, second);\n\n if (timeOfDeletion.before(timeRightNow)) {\n deleteReminderItem(counter);\n cleanList=false;\n break;\n }\n }\n if(cleanList){\n break;\n }\n }\n\n // Refreshes the reminder date descriptions (correcting \"Today\" and \"Tomorrow\" depending on the date).\n refreshAllDateDescriptions();\n }", "void updateNotification() {\n\t\tif (isPlaying()) {\n\t\t\tmNotification.icon = R.drawable.ic_now_playing;\n\t\t} else if (isPaused()) {\n\t\t\tmNotification.icon = R.drawable.ic_pause_track;\n\t\t}\n\t\tNotificationManager nM = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\t\tnM.notify(NOTIFICATION_ID, mNotification);\n\t}", "private void sendQueuedNotifications() {\n Notification n;\n while ((n = pendingNotifs.poll()) != null) {\n broadcaster.sendNotification(n);\n }\n }", "public void init() {\n Set<JobNotification> existing = projectBean.getJobConfiguration().getNotifications();\n this.notifications = new ArrayList<JobNotification>();\n if (existing != null) {\n for (JobNotification n : existing) {\n n.initTransient();\n notifications.add(n);\n }\n }\n }", "@ServiceAction\n protected void onNotificationDismissed(final ArrayList<Integer> serversRequiringNotification) {\n Observable.from(servers)\n .filter(new Func1<MinecraftServerEntity, Boolean>() {\n @Override\n public Boolean call(MinecraftServerEntity server) {\n return serversRequiringNotification.contains(server.getId());\n }\n })\n .map(new Func1<MinecraftServerEntity, MinecraftServerEntity>() {\n @Override\n public MinecraftServerEntity call(MinecraftServerEntity server) {\n server.setHasOfflineStatusBeenSeen(true);\n return server;\n }\n })\n .subscribeOn(AndroidSchedulers.mainThread())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new Action1<MinecraftServerEntity>() {\n @Override\n public void call(MinecraftServerEntity server) {\n if (DEBUG)\n Log.d(TAG, String.format(\"'%s' offline status has been seen by the user. Updating the database\", server.getName()));\n //We update the value in the database\n runtimeMinecraftServerDao.update(server);\n }\n });\n }", "protected void checkNotifications() {\n List<PushNotification> polled;\n boolean onlyOne;\n\n // Leave this mutually exclusive section as fast as possible...\n lock.lock();\n try {\n if (stopped) {\n LOGGER.debug(\"Push notification service stopped. Aborting polling of queue...\");\n return;\n }\n\n PushNotification first = submittedNotifcations.poll();\n if (null == first) {\n // Queue has no notification with an expired delay\n LOGGER.debug(\"Queue has no notification with an expired delay and holds {} buffered notifications\", I(submittedNotifcations.size()));\n return;\n }\n\n // Check for more\n PushNotification notification = submittedNotifcations.poll();\n if (notification != null) {\n polled = new LinkedList<>();\n polled.add(first);\n LOGGER.debug(\"Polled notification \\\"{}\\\" for user {} in context {} from queue\", first.getTopic(), I(first.getUserId()), I(first.getContextId()));\n do {\n polled.add(notification);\n LOGGER.debug(\"Polled notification \\\"{}\\\" for user {} in context {} from queue\", notification.getTopic(), I(notification.getUserId()), I(notification.getContextId()));\n notification = submittedNotifcations.poll();\n } while (null != notification);\n onlyOne = false;\n } else {\n polled = Collections.singletonList(first);\n LOGGER.debug(\"Polled notification \\\"{}\\\" for user {} in context {} from queue\", first.getTopic(), I(first.getUserId()), I(first.getContextId()));\n onlyOne = true;\n }\n\n if (submittedNotifcations.isEmpty()) {\n cancelTimerTask();\n LOGGER.debug(\"Dropped polling timer task since queue is currently empty\");\n }\n } finally {\n lock.unlock();\n }\n\n if (onlyOne) {\n // There was only a single one available\n PushNotification first = polled.get(0);\n NotificationsHandler task = new NotificationsHandler(first);\n if (tryExecuteTask(task, first.getUserId(), first.getContextId())) {\n LOGGER.debug(\"Submitted delivery of polled notification with topic \\\"{}\\\" to user {} in context {}\", first.getTopic(), I(first.getUserId()), I(first.getContextId()));\n } else {\n // Processor rejected task execution. Perform with current thread.\n task.run();\n }\n } else {\n // Handle them all\n Map<ContextAndTopicKey, Map<Integer, List<PushNotification>>> polledNotificationsPerContextAndTopic = new LinkedHashMap<>();\n for (PushNotification notification : polled) {\n put(notification, polledNotificationsPerContextAndTopic);\n }\n for (Map.Entry<ContextAndTopicKey, Map<Integer, List<PushNotification>>> entry : polledNotificationsPerContextAndTopic.entrySet()) {\n ContextAndTopicKey key = entry.getKey();\n Map<Integer, List<PushNotification>> notificationsPerUser = entry.getValue();\n NotificationsHandler task = new NotificationsHandler(key.contextId, key.topic, notificationsPerUser);\n if (tryExecuteTask(task, -1, key.contextId)) {\n if (LOGGER.isDebugEnabled()) {\n int[] userIds = Coll2i(notificationsPerUser.keySet());\n Object sUserIds = userIds.length <= 10 ? toStringObjectFor(userIds) : null;\n userIds = null;\n if (sUserIds == null) {\n LOGGER.debug(\"Submitted delivery of polled notifications with topic \\\"{}\\\" to users in context {}\", key.topic, I(key.contextId));\n } else {\n LOGGER.debug(\"Submitted delivery of polled notifications with topic \\\"{}\\\" to users {} in context {}\", key.topic, sUserIds, I(key.contextId));\n }\n }\n } else {\n // Processor rejected task execution. Perform with current thread.\n task.run();\n }\n }\n }\n }", "public void checkNotificationBroadcastSupport() {\n int i = 0;\n this.mShouldBroadcastNotifications = false;\n WallpaperManager wallpaperManager = (WallpaperManager) this.mContext.getSystemService(WallpaperManager.class);\n if (wallpaperManager != null) {\n WallpaperInfo wallpaperInfo = wallpaperManager.getWallpaperInfo();\n if (wallpaperInfo != null) {\n ComponentName component = wallpaperInfo.getComponent();\n String packageName = component.getPackageName();\n if (NOTIFYABLE_PACKAGES.contains(packageName)) {\n this.mWallpaperPackage = packageName;\n String className = component.getClassName();\n String[] strArr = NOTIFYABLE_WALLPAPERS;\n int length = strArr.length;\n while (true) {\n if (i >= length) {\n break;\n } else if (className.startsWith(strArr[i])) {\n this.mShouldBroadcastNotifications = true;\n break;\n } else {\n i++;\n }\n }\n }\n }\n }\n }", "private void sendNotifications(String userMessage) {\n if (this.notifications == null) {\n this.notifications = new ConcurrentLinkedQueue<Notification>();\n }\n \n // not sure if the synchronize is needed here, let's see ...\n // synchronized (notifications) {\n if (!this.notifications.isEmpty()) {\n ObjectName source = getObjectName();\n Notification n = new Notification(NotificationType.setOfNotifications, source, counter++,\n userMessage);\n n.setUserData(this.notifications);\n super.sendNotification(n);\n this.notifications.clear();\n // }\n }\n }", "static void sendNotifications() {\n\t\testablishConnection();\n\t\tSystem.out.println(\"sending multiple notificatiosn\");\n\t}", "void notifyStatus(String strStatus)\n \t{\n \tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\n \tboolean bNotify = prefs.getBoolean(\"notify_status\", true);\n \t\n \tif (bNotify)\n \t{\n \t \tNotification notification = new Notification(\n \t \t\t\tR.drawable.icon, strStatus, System.currentTimeMillis());\n \t \tPendingIntent contentIntent = PendingIntent.getActivity(\n \t \t\t\tthis, 0, new Intent(this, MainActivity.class), 0);\n \t \tnotification.setLatestEventInfo(\n \t \t\t\tthis, getText(R.string.app_name), strStatus, contentIntent);\n \t \tmNM.notify(R.string.app_name, notification);\n \t}\n \n \t}", "private void setDay() {\n Boolean result = false;\n for (int i = 0; i < 7; ++i) {\n if(mAlarmDetails.getRepeatingDay(i))\n result = true;\n mAlarmDetails.setRepeatingDay(i, mAlarmDetails.getRepeatingDay(i));\n }\n if(!result)\n mAlarmDetails.setRepeatingDay((Calendar.getInstance().get(Calendar.DAY_OF_WEEK) - 1), true);\n }", "public void updateNotification(){\n Bitmap androidImage=BitmapFactory.decodeResource(getResources(),R.drawable.mascot_1);\n NotificationCompat.Builder notifyBuilder=getNotificationBuilder();\n notifyBuilder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(androidImage).setBigContentTitle(\"Notificacion actualizada!\"));\n mNotifyManager.notify(NOTIFICATION_ID,notifyBuilder.build());\n setNotificationButtonState(false, false, true);\n\n }", "void clearNotifications() throws NoUserSelectedException;", "private void goforeground() {\n //CREATES NOTIFICATION\n Intent openappintent = new Intent(this, MainActivity.class);\n PendingIntent openapppendingIntent = PendingIntent.getActivity(this, 0, openappintent, 0);\n\n Intent resettrackingserviceintent = new Intent(this, PostureService.class);\n resettrackingserviceintent.putExtra(PACKAGE_NAME + \".myaction\", intentresetid);\n PendingIntent resettrackingpendingIntent = PendingIntent.getService(this, 56, resettrackingserviceintent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n\n Intent pauseserviceintent = new Intent(this, PostureService.class);\n pauseserviceintent.putExtra(PACKAGE_NAME + \".myaction\", intentpauseid);\n PendingIntent pausependingpendingIntent = PendingIntent.getService(this, 43, pauseserviceintent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n Intent exitserviceintent = new Intent(this, PostureService.class);\n exitserviceintent.putExtra(PACKAGE_NAME + \".myaction\", intentexitid);\n PendingIntent exitpendingpendingIntent = PendingIntent.getService(this, 54, exitserviceintent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(this.getBaseContext());\n\n if (!pausetracking) {\n builder.setContentTitle(getString(R.string.slouchierunning));\n pauseaction = new NotificationCompat.Action(R.drawable.ic_pause_circle_outline_black_24dp, getString(R.string.pause), pausependingpendingIntent);\n } else {\n pauseaction = new NotificationCompat.Action(R.drawable.ic_pause_circle_filled_black_24dp, getString(R.string.paused), pausependingpendingIntent);\n builder.setContentTitle(getString(R.string.slouchiepaused));\n\n }\n\n builder\n .setColor(Color.rgb(43, 169, 224))\n .setSmallIcon(R.drawable.notification_icon)\n .setContentIntent(openapppendingIntent);\n if (countdown == 0) {\n builder.setPriority(Notification.PRIORITY_DEFAULT);\n\n builder\n .addAction(R.drawable.ic_refresh_black_24dp, getString(R.string.reset), resettrackingpendingIntent)\n .addAction(pauseaction)\n .addAction(R.drawable.ic_highlight_off_black_24dp, getString(R.string.exit), exitpendingpendingIntent);\n }\n\n if (countdown > 0 && !pausetracking) {\n builder.setPriority(Notification.PRIORITY_HIGH)\n .setVibrate(new long[50]);\n builder.setContentText(getString(R.string.situpright) + \" \" + String.valueOf(countdown) + \" \" + getString(R.string.seconds))\n .setProgress(resettime / resetsteptime, resettime / resetsteptime - countdown, false)\n .setContentTitle(getString(R.string.slouchiestarting));\n }\n\n\n posturenotification = builder.build();\n startForeground(55, posturenotification);\n }", "private void setFinalNotification() {\n //finished downloading all files\n // update notification\n String note = getResources().getString(R.string.update_complete);\n mBuilder.setContentTitle(note)\n .setContentText(\"\")\n .setSmallIcon(R.drawable.ic_launcher_mp)\n .setTicker(note)\n .setProgress(0, 0, false);\n nm.notify(0, mBuilder.build());\n }", "public void setNotifications(ArrayList<TaskModel> temp, Context context){\n if (temp.isEmpty()) {\n return;\n }\n TaskModel t = temp.get(0);\n\n //Add counter and t.getTimeLeft()(in some fucked up value);\n int toAdd = (int)t.getTimeLeft() / 1000 / 60;\n AlarmManager manager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n Intent intent= new Intent(context, NotificationReceiver.class);\n intent.putExtra(\"content\", t.getTitle());\n PendingIntent alarmIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n Calendar c = Calendar.getInstance();\n c.add(Calendar.MINUTE, (toAdd));\n long time = c.getTimeInMillis();\n manager.set(AlarmManager.RTC_WAKEUP, time, alarmIntent);\n //set task for deletion\n final TaskModel toDelete = t;\n Handler timerHandler = new Handler();\n Runnable timerRunnable = new Runnable(){\n @Override\n public void run(){\n deleteTask(tasks, toDelete);\n }\n };\n timerHandler.postDelayed(timerRunnable, time - 100);\n\n // counter += toAdd;\n }", "public void reset() {\n mNewNotificationCount.setValue(0);\n }", "public ArrayList<Notification> getAllNotifications(){\n\n \t\tArrayList<Notification> newListofEntries = new ArrayList<Notification>();\n \t\t\n \t\tCursor cur = this.getAllEntriesNotification();\n \t\t\n \t\tif (this.cursorHasRows(cur)) {\n \t\t\tif (cur.moveToFirst()) {\n \t\t\t\tdo {\n \t\t\t\t\tNotification newObjActivity = new Notification();\n \t\t\t\t\n \t\t\t\t\t\tnewObjActivity.notificationID = (cur.getInt(cur.getColumnIndex(\"notificationID\")));\n \t\t\t\t\t\tnewObjActivity.notificationType = Notification.getNOTIFTYPEValue(cur.getInt(cur.getColumnIndex(\"notificationType\")));\n \t\t\t\t\t\tnewObjActivity.notificationState = Notification.getNOTIFSTATEValue(cur.getInt(cur.getColumnIndex(\"notificationState\")));\n \t\t\t\t\t\tnewObjActivity.ref_id = (cur.getString(cur.getColumnIndex(\"ref_id\")));\n \t\t\t\t\t\tnewObjActivity.ref_type = (cur.getString(cur.getColumnIndex(\"ref_type\")));\n \t\t\t\t\t\tnewObjActivity.coachID = (cur.getInt(cur.getColumnIndex(\"coach_id\")));\n \t\t\t\t\t\tnewObjActivity.coachAvatarURL = (cur.getString(cur.getColumnIndex(\"coach_avatar_url\")));\n \t\t\t\t\t\tnewObjActivity.mealID = (cur.getString(cur.getColumnIndex(\"meal_id\")));\n \t\t\t\t\t\tnewObjActivity.timestamp = AppUtil.toDate(new Timestamp(cur.getLong(cur.getColumnIndex(\"timestamp\"))));\n \t\t\t\t\t\tnewObjActivity.coachMessage = (cur.getString(cur.getColumnIndex(\"message\")));\n \t\t\t\t\t\n \t\t\t\t\t\t//add the meal to the array list\n \t\t\t\t\t\tnewListofEntries.add(newObjActivity);\n \t\t\t\t\t\t\n \t\t\t\t\t\t\n \t\t\t\t\t\t\n \t\t\t\t} while (cur.moveToNext());\n \t\t\t}\n \t\t}\n \t\t\n \t\tcur.close();\n \t\treturn newListofEntries;\n \t}", "public void clear() {\r\n\t\tfor(int i = MIN_WEEKDAY; i <= MAX_WEEKDAY; i++)\r\n\t\t\tfor(int j = MIN_SEGMENT; j <= MAX_SEGMENT; j++) {\r\n\t\t\t\tschedule[i][j] = false;\r\n\t\t\t\tnotifyListeners(i, j);\r\n\t\t\t}\r\n\t}", "private void upgradeAlertsForVersion16(SQLiteDatabase database){\n\t\tCursor cursor = database.query(iStayHealthyDatabaseSchema.ALERTSTABLE, null, null, null, null, null, iStayHealthyDatabaseSchema.ALERTLABEL);\n\t\tif(1 >= cursor.getColumnCount()){\n\t\t\tcursor.close();\n\t\t\treturn;\n\t\t}\n\t\tint standardInterval = 24 * 60 * 60 * 1000;//24 hour repeat interval\n\t\tAlarmManager alarm = (AlarmManager) context.getApplicationContext().getSystemService(Context.ALARM_SERVICE);\n\t\tint requestCode = 0;\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tjava.util.Date date = new java.util.Date();\n\t\tlong now = date.getTime();\n\t\twhile(cursor.moveToNext()){\n\t\t\tlong rowId = cursor.getLong(cursor.getColumnIndex(iStayHealthyDatabaseSchema.KEY_ID));\n\t\t\tString label = cursor.getString(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTLABEL));\n\t\t\tint repeat = cursor.getInt(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTREPEATPATTERN));\n\t\t\tlong startTime = cursor.getLong(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTSTARTTIME));\n\t\t\tCalendar alarmCalendar = Calendar.getInstance();\n\t\t\talarmCalendar.setTimeInMillis(startTime);\n\t\t\tboolean isEveryDay = (0 < repeat);\n\t\t\tcalendar.set(Calendar.HOUR_OF_DAY, alarmCalendar.get(Calendar.HOUR_OF_DAY));\n\t\t\tcalendar.set(Calendar.MINUTE, alarmCalendar.get(Calendar.MINUTE));\n\n\t\t\tlong time = calendar.getTimeInMillis();\n\t\t\tIntent intent = new Intent(context, AlarmReceiver.class);\n\t\t\tintent.putExtra(\"Label\", label);\n\t\t\tintent.putExtra(\"isEveryDay\", isEveryDay);\n\t\t\t\n\t\t\tPendingIntent pendingSingleIntent = PendingIntent.getBroadcast(context, 0, intent, 0);\t\t\n\t\t\talarm.cancel(pendingSingleIntent);\n\t\t\t\n\t\t\t\n\t\t\tIntent newIntent = new Intent(context, AlarmReceiver.class);\n\t\t\tnewIntent.putExtra(\"Label\", label);\n\t\t\tnewIntent.putExtra(\"isVibrate\", true);\n\t\t\tnewIntent.putExtra(\"isEveryDay\", isEveryDay);\n\t\t\tnewIntent.putExtra(\"requestCode\", requestCode);\n\t\t\tPendingIntent newPendingIntent = PendingIntent.getBroadcast(context.getApplicationContext(), requestCode, newIntent, 0);\n\t\t\t\n\t\t\tif(isEveryDay){\n\t\t\t\talarm.setRepeating(AlarmManager.RTC_WAKEUP, time, standardInterval, newPendingIntent);\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tlong diff = startTime - now;\n\t\t\t\tif( 0 < diff){\n\t\t\t\t\talarm.set(AlarmManager.RTC_WAKEUP, startTime, newPendingIntent);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tContentValues content = new ContentValues();\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTLABEL, label);\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTREPEATPATTERN, repeat);\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTSTARTTIME, startTime);\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTREQUESTCODE, requestCode);\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTTEXT, cursor.getString(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTTEXT)));\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTSOUND, cursor.getString(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTSOUND)));\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTHOUR, cursor.getInt(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTHOUR)));\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.AlERTMINUTE, cursor.getInt(cursor.getColumnIndex(iStayHealthyDatabaseSchema.AlERTMINUTE)));\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.ALERTTIMEZONEOFFSET, cursor.getLong(cursor.getColumnIndex(iStayHealthyDatabaseSchema.ALERTTIMEZONEOFFSET)));\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.GUIDTEXT, java.util.UUID.randomUUID().toString());\n\t\t\tcontent.put(iStayHealthyDatabaseSchema.TINTABEEKEY, cursor.getString(cursor.getColumnIndex(iStayHealthyDatabaseSchema.TINTABEEKEY)));\n\t\t\tdatabase.updateWithOnConflict(iStayHealthyDatabaseSchema.ALERTSTABLE, content, iStayHealthyDatabaseSchema.KEY_ID + \"=\" + rowId, null, SQLiteDatabase.CONFLICT_IGNORE);\t\t\t\t\n\n\t\t\trequestCode = requestCode + 1;\n\t\t}\n\t\t\n\t\tcursor.close();\n\t}", "public void setNotifications(ArrayList<Notification> notif) {\n\t\tnotifications = notif;\t\n\t}", "private void updateNotificationStatus(final boolean isNotificationOn) {\n showProgressDialog();\n IApiClient client = ApiClient.getApiClient();\n Call<ResUpdateProfile> resUpdateProfileCall = client.updateSettingsWithoutImage(RequestBody.create(MediaType.parse(ServiceConstants.TYPE_MULTIPART), MethodFactory.UPDATE_SETTINGS.getMethod()),\n RequestBody.create(MediaType.parse(ServiceConstants.TYPE_MULTIPART), mAppSharedPreference.getString(PreferenceKeys.KEY_SERVICE_KEY, ServiceConstants.SERVICE_KEY)),\n RequestBody.create(MediaType.parse(ServiceConstants.TYPE_MULTIPART), mAppSharedPreference.getString(PreferenceKeys.KEY_USER_ID, \"\")),\n RequestBody.create(MediaType.parse(ServiceConstants.TYPE_MULTIPART), \"\"),\n RequestBody.create(MediaType.parse(ServiceConstants.TYPE_MULTIPART), isNotificationOn ? \"1\" : \"0\"),\n RequestBody.create(MediaType.parse(ServiceConstants.TYPE_MULTIPART), \"\"),\n RequestBody.create(MediaType.parse(ServiceConstants.TYPE_MULTIPART), \"\"));\n resUpdateProfileCall.enqueue(new Callback<ResUpdateProfile>() {\n @Override\n public void onResponse(Call<ResUpdateProfile> call, Response<ResUpdateProfile> response) {\n dismissProgressDialog();\n ResUpdateProfile resUpdateProfile = response.body();\n if (resUpdateProfile != null) {\n if (resUpdateProfile.getSuccess() == ServiceConstants.SUCCESS) {\n mAppSharedPreference.setBoolean(PreferenceKeys.KEY_NOTIFICATION_ON, isNotificationOn);\n } else {\n ToastUtils.showShortToast(SettingsActivity.this, resUpdateProfile.getErrstr());\n }\n } else {\n ToastUtils.showShortToast(SettingsActivity.this, R.string.err_network_connection);\n }\n }\n\n @Override\n public void onFailure(Call<ResUpdateProfile> call, Throwable t) {\n dismissProgressDialog();\n ToastUtils.showShortToast(SettingsActivity.this, R.string.err_network_connection);\n }\n });\n }", "private void listenForNotificationEvents() {\n\t\twhile (!shutdownRequested) {\n\t\t\ttry {\n\t\t\t\tNotificationJob job = notificationQueue.poll( 1000, TimeUnit.MILLISECONDS );\n\t\t\t\t\n\t\t\t\tif (job != null) {\n\t\t\t\t\tprocessNotificationJob( job );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// Ignore and continue looping until shutdown requested\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void run() {\n NotificationHelper nh = new NotificationHelper(getApplicationContext(), alarmId);\n\n /* AlarmEntity is null for snoozed alarm\n * Get actual alarm time by: CurrentTime - silenceTimeout\n */\n if (isSnoozed) {\n nh.deliverMissedNotification(\n System.currentTimeMillis() - (Long.parseLong(silenceTimeStr) * 60000));\n } else\n nh.deliverMissedNotification(alarmEntity.getAlarmTime());\n\n stopAlarmService();\n }", "public void setPermanentNotification(boolean value) {\n permanentNotification.set(value);\n }", "public static void removeAll() {\n\t\t\n\t\tif(notificationsView != null) {\n\t\t\tComponent[] notifications = notificationsView.getComponents();\n\t\t\tfor(Component notification : notifications) {\n\t\t\t\tNotification n = (Notification) notification;\n\t\t\t\tif(n.expireOnDisconnect)\n\t\t\t\t\tn.removeNow();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@SuppressLint(\"WrongConstant\")\n private Notification prepareNotification() {\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O &&\n mNotificationManager.getNotificationChannel(FOREGROUND_CHANNEL_ID) == null) {\n CharSequence name = getString(R.string.text_name_notification);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(FOREGROUND_CHANNEL_ID, name, importance);\n channel.enableVibration(false);\n mNotificationManager.createNotificationChannel(channel);\n }\n\n Intent notificationIntent = new Intent(this, Principal.class);\n notificationIntent.setAction(Constants.ACTION.MAIN_ACTION);\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n\n // if min sdk goes below honeycomb\n /*if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n } else {\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n }*/\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // make a stop intent\n Intent stopIntent = new Intent(this, Servicio_cargar_punto_google.class);\n stopIntent.setAction(Constants.ACTION.STOP_ACTION);\n PendingIntent pendingStopIntent = PendingIntent.getService(this, 0, stopIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.notification);\n //remoteViews.setOnClickPendingIntent(R.id.btn_stop, pendingStopIntent);\n remoteViews.setTextViewText(R.id.tv_fecha, fecha);\n\n // if it is connected\n switch (stateService) {\n case Constants.STATE_SERVICE.NOT_CONNECTED:\n remoteViews.setTextViewText(R.id.tv_estado, \"Sin conexión a internet . . .\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_advertencia);\n break;\n case Constants.STATE_SERVICE.CONNECTED:\n remoteViews.setTextViewText(R.id.tv_estado, \"Traigo en camino\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_carrito_verde);\n break;\n case Constants.STATE_SERVICE.GPS_INACTIVO:\n remoteViews.setTextViewText(R.id.tv_estado, \"GPS inactivo\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_advertencia);\n break;\n case Constants.STATE_SERVICE.SIN_INTERNET:\n remoteViews.setTextViewText(R.id.tv_estado, \"Sin conexión a internet . .\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_advertencia);\n break;\n }\n\n // notification builder\n NotificationCompat.Builder notificationBuilder;\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n notificationBuilder = new NotificationCompat.Builder(this, FOREGROUND_CHANNEL_ID);\n } else {\n notificationBuilder = new NotificationCompat.Builder(this);\n }\n notificationBuilder\n .setContent(remoteViews)\n .setSmallIcon(R.drawable.ic_carrito_verde)\n .setCategory(NotificationCompat.CATEGORY_SERVICE)\n .setOnlyAlertOnce(true)\n .setOngoing(true)\n .setAutoCancel(true)\n .setContentIntent(pendingIntent);\n\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {\n notificationBuilder.setVisibility(Notification.VISIBILITY_PUBLIC);\n }\n\n return notificationBuilder.build();\n }", "public void clearWeeklyView(){\n\t\tthis.weeklyView=false;\n\t\tnotifyDataSetChanged();\n\t\tnotifyDataSetInvalidated();\n\t}", "void storeEvents()\n {\n this.storedPresences = new ArrayList<Presence>();\n this.storeEvents = true;\n }", "private Notification prepareNotification() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && mNotificationManager.getNotificationChannel(FOREGROUND_CHANNEL_ID) == null) {\n CharSequence name = getString(R.string.text_name_notification);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(FOREGROUND_CHANNEL_ID, name, importance);\n channel.enableVibration(false);\n mNotificationManager.createNotificationChannel(channel);\n }\n\n Intent notificationIntent = new Intent(this, MainUIActivity.class);\n notificationIntent.setAction(Constants.ACTION.MAIN_ACTION);\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n\n // if min sdk goes below honeycomb\n /*if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n } else {\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n }*/\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // make a stop intent\n Intent stopIntent = new Intent(this, MyService.class);\n stopIntent.setAction(Constants.ACTION.STOP_ACTION);\n PendingIntent pendingStopIntent = PendingIntent.getService(this, 0, stopIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.service_notification);\n remoteViews.setOnClickPendingIntent(R.id.btn_stop, pendingStopIntent);\n\n // if it is connected\n switch (stateService) {\n case Constants.STATE_SERVICE.NOT_CONNECTED:\n remoteViews.setTextViewText(R.id.tv_state, \"Help Desk DISCONNECTED\");\n remoteViews.setTextColor(R.id.tv_state, getResources().getColor(android.R.color.holo_red_light));\n break;\n case Constants.STATE_SERVICE.CONNECTED:\n remoteViews.setTextColor(R.id.tv_state, getResources().getColor(android.R.color.black));\n remoteViews.setTextViewText(R.id.tv_state, \"Help Desk CONNECTED\");\n break;\n }\n\n // notification builder\n NotificationCompat.Builder notificationBuilder;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n notificationBuilder = new NotificationCompat.Builder(this, FOREGROUND_CHANNEL_ID);\n } else {\n notificationBuilder = new NotificationCompat.Builder(this);\n }\n notificationBuilder\n .setContent(remoteViews)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setCategory(NotificationCompat.CATEGORY_SERVICE)\n .setOnlyAlertOnce(true)\n .setOngoing(true)\n .setAutoCancel(true)\n .setContentIntent(pendingIntent);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n notificationBuilder.setVisibility(Notification.VISIBILITY_SECRET);\n }\n\n return notificationBuilder.build();\n }", "protected List<NotificationInfo> assertMadeNotifications(int number) {\n //get notification then clear the notification list\n UserSetting setting = userSettingService.get(rootIdentity.getRemoteId());\n List<NotificationInfo> got = notificationService.storeDigestJCR();\n if (setting.isActive(UserSetting.EMAIL_CHANNEL, getPlugin().getKey().getId())) {\n got = notificationService.storeInstantly();\n assertEquals(number, got.size());\n }\n //\n if (setting.isInDaily(getPlugin().getKey().getId())) {\n got = notificationService.storeDigestJCR();\n assertEquals(number, got.size());\n }\n \n return got;\n }", "private void updateNewsMessages() {\n getNewsMessages().clear();\n getNewsMessages().addAll(getNewsMap().values());\n }", "public void mo33398h() {\n String str = \"com.tencent.android.tpush.service.channel.heartbeatIntent.pullup\";\n String str2 = \"TpnsChannel\";\n try {\n if (this.f23285A == null) {\n IntentFilter intentFilter = new IntentFilter();\n intentFilter.addAction(\"android.intent.action.SCREEN_ON\");\n intentFilter.addAction(\"android.intent.action.SCREEN_OFF\");\n intentFilter.addAction(\"android.intent.action.USER_PRESENT\");\n intentFilter.addAction(str);\n C6973b.m29776f().registerReceiver(this.f23292L, intentFilter);\n this.f23285A = PendingIntent.getBroadcast(C6973b.m29776f(), 0, new Intent(str), 134217728);\n }\n long currentTimeMillis = System.currentTimeMillis();\n if (f23282q > f23278m) {\n f23282q = f23278m;\n }\n if (XGPushConfig.isForeignWeakAlarmMode(C6973b.m29776f())) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"schedulePullUpHeartbeat WaekAlarmMode heartbeatinterval: \");\n sb.append(f23280o);\n sb.append(\" ms\");\n C6864a.m29305f(str2, sb.toString());\n f23282q = f23280o;\n }\n f23282q = C7055h.m30166a(C6973b.m29776f(), \"com.tencent.android.xg.wx.HeartbeatIntervalMs\", f23282q);\n long j = currentTimeMillis + ((long) f23282q);\n mo33391b(true);\n C7045d.m30117a().mo34149a(0, j, this.f23285A);\n } catch (Throwable th) {\n C6864a.m29302d(str2, \"scheduleHeartbeat error\", th);\n }\n }", "private void scheduleNotification(Notification notification) {\n\n Intent notificationIntent2 = new Intent(MainActivity.this, NotificationPublisher.class);\n notificationIntent2.putExtra(NotificationPublisher.NOTIFICATION_ID, 1);\n notificationIntent2.putExtra(NotificationPublisher.NOTIFICATION, notification);\n PendingIntent pendingIntent2 = PendingIntent.getBroadcast(MainActivity.this, 0, notificationIntent2, PendingIntent.FLAG_UPDATE_CURRENT);\n Date date = new Date();\n\n Calendar calnoti = Calendar.getInstance();\n calnoti.setTime(date);\n\n calnoti.set(Calendar.HOUR_OF_DAY, mHour-1);\n calnoti.set(Calendar.MINUTE, mMin);\n calnoti.set(Calendar.SECOND, 0);\n calnoti.set(Calendar.YEAR,mYear);\n calnoti.set(Calendar.MONTH,mMonth);\n calnoti.set(Calendar.DAY_OF_MONTH,mDay);\n //long futureInMillis2 = SystemClock.elapsedRealtime() + delay;\n AlarmManager alarmManager2 = (AlarmManager) getSystemService(Context.ALARM_SERVICE);\n alarmManager2.set(AlarmManager.RTC_WAKEUP, calnoti.getTimeInMillis(), pendingIntent2);\n }", "@Override\n public void onCreate() {\n\n mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n if(AlarmTask.code == 3) {\n spref = getApplicationContext().getSharedPreferences(\"my_data\", 0);\n food = new AddFoodActivity();\n editor = spref.edit();\n message = \"Reset data\";\n Toast.makeText(NotifyService.this, \"Notification reset: \" + spref.getFloat(\"kalori\",0), Toast.LENGTH_LONG).show();\n editor.putStringSet(\"SetSiang\", null);\n editor.putStringSet(\"SetPagi\", null);\n editor.putStringSet(\"SetMalam\", null);\n editor.commit();\n food.setNull();\n }\n\n\n }", "@Override\n public void teleopPeriodic() {\n\tupdateDiagnostics();\n\tScheduler.getInstance().run();\n }", "public void clearUpToDateStatus() {\n\t\tif(upToDateIds != null) {\n\t\t\tSystem.out.println(\"Clearing Up To Date Status.\");\n\t\t\tupToDateIds.clear();\n\t\t}\n\t}", "void disableNotifications();", "public void checkBlackOutPeriod(){\n\n\n // loop through all filings and output filing date value in milli seconds\n System.out.println(\"checking black out period status for filings : \"+blackOutPeriodDuration);\n\n BaseTradeMarkApplicationService baseTradeMarkApplicationService = serviceBeanFactory.getBaseTradeMarkApplicationService();\n\n\n for(Iterator<BaseTrademarkApplication> iter = baseTradeMarkApplicationService.findAll().iterator(); iter.hasNext(); ) {\n BaseTrademarkApplication current = iter.next();\n\n if((current.getApplicationFilingDate() != null && current.getFilingStatus().equals(\"TEAS RF New Application\") )|| (current.getApplicationFilingDate() != null && current.getFilingStatus().equals(\"New Application\") ) ){\n // check that date + duration against current time\n if((current.getApplicationFilingDate().getTime() + current.getBlackOutPeriod()) < new Date().getTime()){\n\n System.out.println(\"Filing has expired from the black out period\");\n\n //baseTradeMarkApplicationService.save(current);\n\n // we need to check current filings to make sure there are no active office action\n\n if(current.hasActiveOfficeAction() == false){\n\n OfficeActions officeActions = new OfficeActions();\n officeActions.setParentMarkImagePath(current.getTradeMark().getTrademarkImagePath());\n officeActions.setStandardCharacterMark(current.isStandardTextMark());\n officeActions.setStandardCharacterText(current.getTradeMark().getTrademarkStandardCharacterText());\n officeActions.setParentMarkOwnerName(current.getPrimaryOwner().getOwnerDisplayname());\n officeActions.setParentSerialNumber(current.getTrademarkName());\n officeActions.setParentRegistrationNumber(current.getRegistrationID());\n officeActions.setActiveAction(true);\n long dueDate = new Date().getTime()+current.getBlackOutPeriod()+current.getOfficeActionResponsePeriod();\n officeActions.setDueDate(new Date(dueDate));\n //officeActions.setOfficeActionCode(\"Missing transliteration\");\n\n\n // create office action event here\n // filing document is only created if an office action is created with required actions\n\n\n\n\n // required actions section\n\n\n // required action Translation\n if (current.getTradeMark().isStandardCharacterMark() || current.getTradeMark().getTrademarkDesignType().equals(\"Design with Text\")) {\n if (current.getTradeMark().getForeignLanguageTranslationUSText() == null || current.getTradeMark().getForeignLanguageTranslationUSText() == null || current.getTradeMark().getForeignLanguageType_translation() == null ){\n\n // create required action here\n RequiredActions requiredActions = new RequiredActions();\n requiredActions.setRequiredActionType(\"Translation of Foreign Wording\");\n requiredActions.setTranslationTextForeign(current.getTradeMark().getForeignLanguageTranslationOriginalText());\n requiredActions.setTranslationTextEnglish(current.getTradeMark().getForeignLanguageTranslationUSText());\n requiredActions.setTranslationTextLanguage(current.getTradeMark().getForeignLanguageType_translation());\n\n\n\n officeActions.addRequiredActions(requiredActions);\n\n\n\n }\n\n\n }\n\n // required action disclaimer\n\n if(current.getTradeMark().getDisclaimerDeclarationList().size() == 0){\n // you have to provide at least one disclaimer\n RequiredActions requiredActions = new RequiredActions();\n requiredActions.setRequiredActionType(\"Disclaimer Required\");\n\n officeActions.addRequiredActions(requiredActions);\n\n }\n\n\n // office action is created only if there are required actions\n if(officeActions.getRequiredActions().size() > 0){\n current.setFilingStatus(\"Non-Final Action Mailed\");\n officeActions.setOfficeActionCode(\"Non-Final Action Mailed\");\n\n\n // create an default office action object and attach it to filing\n current.addOfficeAction(officeActions);\n officeActions.setTrademarkApplication(current);\n\n FilingDocumentEvent filingDocumentEvent = new FilingDocumentEvent();\n filingDocumentEvent.setEventDescription(\"Office Action Outgoing\");\n\n filingDocumentEvent.setDocumentType(\"XML\");\n Date date = new Date();\n filingDocumentEvent.setEventDate(date);\n\n current.addFilingDocumentEvent(filingDocumentEvent);\n }\n\n baseTradeMarkApplicationService.save(current);\n\n\n\n\n }\n\n\n\n\n // also check for number of required actions.\n // if there are none. office action is not saved\n\n\n\n\n\n // set relevant office actions\n\n\n\n }\n else{\n System.out.println(\"filing is still in the black out period\");\n\n }\n }\n else{\n System.out.println(\"Filing is not Submitted yet.\");\n }\n }\n\n\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(getApplicationContext(), ReminderBroadcastReceiver.class);\n intent.putExtra(\"notificationText\", reminderData.getNotificationText());\n\n // Create pending intent with time given\n PendingIntent alarmIntent = PendingIntent.getBroadcast(getApplicationContext(), notificationId,\n intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Create AlarmManager which is sent with pending intent\n AlarmManager alarm = (AlarmManager) getSystemService(ALARM_SERVICE);\n // Create time when notification will fire\n Calendar startTime = Calendar.getInstance();\n startTime.set(Calendar.DAY_OF_WEEK, startTime.get(Calendar.DAY_OF_WEEK));\n startTime.set(Calendar.HOUR_OF_DAY, timePicker.getHour());\n startTime.set(Calendar.MINUTE, timePicker.getMinute());\n startTime.set(Calendar.SECOND, 0);\n\n long alarmStartTime = startTime.getTimeInMillis();\n\n\n /* If reminder time is smaller than current time, start notification on next day, still in progress */\n\n /*\n if (startTime.getTimeInMillis() < System.currentTimeMillis()) {\n startTime.set(Calendar.DAY_OF_WEEK, startTime.get(Calendar.DAY_OF_WEEK + 1));\n alarmStartTime = startTime.getTimeInMillis();\n }\n else\n {\n alarmStartTime = startTime.getTimeInMillis();\n }\n */\n\n\n // Set alarm with (type, milliseconds, intent)\n // With RTC_WAKEUP we wake the device up and deliver the pending intent\n alarm.set(AlarmManager.RTC_WAKEUP, alarmStartTime, alarmIntent);\n saveData();\n\n }", "private void setupNotificationLayout() {\n //Setup notification area to begin date-set process on click.\n notificationLayout.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n showTimerPickerDialog();\n return false;\n }\n });\n\n //Remove date from task and updated view\n notificationRemoveButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n cal = null;\n EventBus.getDefault().post(new TaskEditedEvent());\n }\n });\n }", "@Scheduled(fixedRate = 60_000)\n public void checkEventTime() {\n isTimeService.findAll().forEach(event -> {\n if (event.getSchedulledTime().isBefore(LocalDateTime.now())) {\n this.producer.sendReachTimeMessage(new IsTime(event.getMessageId()));\n this.isTimeService.deleteById(event.getSchedulledId());\n }\n });\n// log.info(\"Schedulled time check.\");\n }", "@Override\r\n\tpublic void sendNotifications() {\n\r\n\t}", "public void announceAllUsers(String notificationText) throws RemoteException {\r\n notif.insertAll(new Notification(notificationText, 1));\r\n\r\n if (onlineUsers.size() > 0) {\r\n\r\n for (int i = 0; i < map.size(); i++) {\r\n if (map.get(onlineUsers.get(i).getId()) != null) {\r\n map.get(onlineUsers.get(i).getId()).updateUrAdminNOtification();\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }", "public void sendStatusUpdateNotification() {\n\n ParseQuery<ParseObject> query = ParseQuery.getQuery(\"IncidentReports\");\n query.whereEqualTo(\"username\", ParseUser.getCurrentUser().getUsername());\n query.whereEqualTo(\"notified\", \"false\");\n query.findInBackground(new FindCallback<ParseObject>() {\n @Override\n public void done(List<ParseObject> objects, ParseException e) {\n if (e == null && objects.size()>0) {\n\n Intent activityIntent = new Intent(getApplicationContext(), MyActivity.class);\n PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 0,activityIntent, 0);\n\n String message = \"An incident report you have submitted has been reviewed. Go to 'My Activity' to view update.\";\n android.app.Notification notification = new NotificationCompat.Builder(mContext, StarterApplication.CHANNEL_1_ID)\n .setSmallIcon(R.drawable.unnamed)\n .setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(),\n R.drawable.unnamed))\n .setContentTitle(\"Status Update\")\n .setContentText(message)\n .setStyle(new NotificationCompat.BigTextStyle())\n .setPriority(NotificationCompat.PRIORITY_HIGH)\n .setCategory(NotificationCompat.CATEGORY_MESSAGE)\n .setContentIntent(contentIntent)\n .build();\n\n for (ParseObject object : objects) {\n object.put(\"notified\", \"true\");\n object.saveInBackground();\n }\n\n notificationManager.notify(1, notification);\n Log.i(\"Notification\", \"sent\");\n\n }\n\n else {\n Log.i(\"Notification\", \"Not sent\");\n if (e != null) {\n Log.i(\"Error:\", e.getMessage());\n }\n\n\n }\n }\n });\n }", "public static void updateNotification(Context context) {\n Alibi alibi = (Alibi) context.getApplicationContext();\n UserEvent event = alibi.getUserEventManager().getCurrentEvent();\n\n /* Don't set a notification if there isn't already one active; if the\n * event has not been running as long as the reminder interval, there\n * hasn't been a notification set yet.\n */\n long interval = alibi.getSettingsManager().getReminderDelayMillis();\n long startTime = event.getStartTime();\n long currentTime = System.currentTimeMillis();\n\n if (currentTime >= startTime + interval)\n setNotification(context, getNotificationMessage(event));\n }", "private void sendNotification() {\n }", "private void getActivatedWeekdays() {\n }", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n\n AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);\n Intent notificationIntent = new Intent(\"android.media.action.DISPLAY_NOTIFICATION\");\n notificationIntent.addCategory(\"android.intent.category.DEFAULT\");\n\n PendingIntent broadcast = PendingIntent.getBroadcast(this, 100, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n Calendar cal = Calendar.getInstance();\n cal.add(Calendar.HOUR, 18);\n\n\n// alarmManager.setExact(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), broadcast);\n alarmManager.setRepeating(AlarmManager.RTC, cal.getTimeInMillis(), alarmManager.INTERVAL_DAY, broadcast);\n\n\n// alarmManager.setExact(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), broadcast);\n return START_STICKY;\n }", "@Override\n public void run()\n {\n Intent intent = new Intent(context, NotifyService.class);\n intent.putExtra(NotifyService.INTENT_NOTIFY, true);\n intent.putExtra(\"REMINDER\", showInfo);\n PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, 0);\n\n boolean alarmUp = (PendingIntent.getBroadcast(context, 0,\n new Intent(\"is.activites.scheduleActivites.INTENT_NOTIFY\"),\n PendingIntent.FLAG_NO_CREATE) != null);\n\n // Sets an alarm - note this alarm will be lost if the phone is turned off and on again\n if(!alarmUp) am.set(AlarmManager.RTC_WAKEUP, date.getTimeInMillis(), pendingIntent);\n }", "private void updateGroupInvitationNotification() {\n Set<String> keys = mGroupInvitationInfos.keySet();\n int size = keys.size();\n Logger.d(TAG,\n \"updateGroupInvitationNotification entry, with size: \"\n + size);\n if (size == SINGLE_GROUP_INVITATION) {\n String sessionId = keys.iterator().next();\n GroupInvitationInfo info = mGroupInvitationInfos\n .get(sessionId);\n if (info == null) {\n Logger.v(TAG,\n \"updateGroupInvitationNotification info is null\");\n return;\n }\n Context context = info.context;\n StringBuilder titleBuilder = new StringBuilder(\n info.notifyTitle);\n titleBuilder\n .append(context\n .getString(R.string.group_invitation_notify_title));\n titleBuilder.append(BLANK_SPACE);\n titleBuilder.append(info.sender);\n String notifyContent = info.notifyInfo;\n Intent intent = info.intent;\n if (intent != null) {\n intent.setClass(context, InvitationDialog.class);\n if (Logger.getIsIntegrationMode()) {\n intent.putExtra(\n InvitationDialog.KEY_STRATEGY,\n InvitationDialog.STRATEGY_IPMES_GROUP_INVITATION);\n } else {\n intent.putExtra(\n InvitationDialog.KEY_STRATEGY,\n InvitationDialog.STRATEGY_GROUP_INVITATION);\n }\n intent.putExtra(NOTIFY_TITLE, titleBuilder.toString());\n intent.putExtra(NOTIFY_CONTENT, notifyContent);\n }\n PendingIntent contentIntent = PendingIntent.getActivity(\n context, 0, intent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n Notification.Builder builder = new Notification.Builder(\n context);\n builder.setContentTitle(titleBuilder.toString());\n builder.setContentText(notifyContent);\n builder.setContentIntent(contentIntent);\n builder.setSmallIcon(info.icon);\n builder.setWhen(System.currentTimeMillis());\n builder.setAutoCancel(false);\n Logger.v(\n TAG,\n \"updateGroupInvitationNotification notification checked: \"\n + SettingsFragment.IS_NOTIFICATION_CHECKED\n .get() + \" intent: \" + intent);\n if (SettingsFragment.IS_NOTIFICATION_CHECKED.get()) {\n Notification notification = builder.getNotification();\n NotificationManager groupInviteNotification = (NotificationManager) context\n .getSystemService(Context.NOTIFICATION_SERVICE);\n groupInviteNotification.notify(GROUP_INVITATION_TAG,\n NOTIFICATION_ID_CHAT, notification);\n }\n } else if (size > 1) {\n String sessionId = keys.iterator().next();\n GroupInvitationInfo info = mGroupInvitationInfos\n .get(sessionId);\n if (info == null) {\n Logger.v(TAG,\n \"updateGroupInvitationNotification info is null\");\n return;\n }\n Context context = info.context;\n StringBuilder titleBuilder = new StringBuilder();\n titleBuilder.append(size);\n titleBuilder.append(BLANK_SPACE);\n titleBuilder\n .append(context\n .getString(R.string.group_multi_invitation_title));\n String notifyTitle = titleBuilder.toString();\n String notifyContent = context\n .getString(R.string.group_multi_invitation_content);\n Intent intent = info.intent;\n if (intent != null) {\n intent.setClass(context, ChatMainActivity.class);\n intent.putExtra(NOTIFY_CONTENT, notifyContent);\n }\n PendingIntent contentIntent = PendingIntent.getActivity(\n context, 0, intent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n Notification.Builder builder = new Notification.Builder(\n context);\n builder.setContentTitle(notifyTitle);\n builder.setContentText(notifyContent);\n builder.setContentIntent(contentIntent);\n builder.setSmallIcon(info.icon);\n builder.setWhen(System.currentTimeMillis());\n builder.setAutoCancel(false);\n Logger.v(\n TAG,\n \"updateGroupInvitationNotification notification checked: \"\n + SettingsFragment.IS_NOTIFICATION_CHECKED\n .get() + \" intent: \" + intent);\n if (SettingsFragment.IS_NOTIFICATION_CHECKED.get()) {\n Notification notification = builder.getNotification();\n NotificationManager groupInviteNotification = (NotificationManager) context\n .getSystemService(Context.NOTIFICATION_SERVICE);\n groupInviteNotification.notify(GROUP_INVITATION_TAG,\n NOTIFICATION_ID_CHAT, notification);\n }\n } else {\n cancelGroupInviteNotification();\n }\n Logger.v(TAG, \"updateGroupInvitationNotification exit\");\n }", "protected void recurringAlert() {\n\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(DeviceTrackerApplication.getContext());\n alertDialogBuilder.setTitle(getString(R.string.app_name));\n alertDialogBuilder\n .setMessage(R.string.user_not_logged_in)\n .setCancelable(false)\n .setPositiveButton(R.string.ok_msg, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n if (!Utils.isAppInForeground(LoggedInCheckService.this)) {\n Intent intent = new Intent(LoggedInCheckService.this, SplashActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }\n }\n });\n alertDialog = alertDialogBuilder.create();\n alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);\n\n if (timer2 != null) {\n timer2.cancel();\n }\n\n timer2 = new Timer();\n long alertInterval = getSharedPreferences(Utility.SETTINGS_SHARED_PREFERENCE, Context.MODE_PRIVATE).getInt(Utility.ALERT_INTERVAL, 2) * 60 * 1000;\n timer2.scheduleAtFixedRate(new TimerTask() {\n @Override\n public void run() {\n Handler handler = new Handler(Looper.getMainLooper()) {\n @Override\n public void handleMessage(Message msg) {\n alertDialog.show();\n }\n };\n Message message = handler.obtainMessage();\n message.sendToTarget();\n }\n }, alertInterval , alertInterval);\n\n }", "@Scheduled(fixedDelay = 1000, initialDelay = 1000)\n public void processLocalEvents() {\n List<StockLocalEventStore> list = repository.findBySent(false);\n for (int i = 0; i < list.size(); i++) {\n publishAndUpdateLocalEvents(list.get(i));\n }\n }", "protected boolean notificationEnabled(SessionState state)\n\t{\n\t\treturn true;\n\n\t}", "public static void aviUsers() {\n\t\tsendNotification();\r\n\t}", "public void generateWeeklySchedule(){\r\n for (int i = 0; i < numDayWorkWeek; i++)\r\n weeklySchedule.get(i).clear();\r\n\r\n int day = 0;\r\n int workHrs = 0;\r\n\r\n for (Task unfinishedTask: unfinished){\r\n if (day > numDayWorkWeek - 1) break;\r\n\r\n //if there is room for this task --> add it. Else, move to the next day\r\n if (workHrs + unfinishedTask.getHrsLeft() <= dailyWorkload){\r\n weeklySchedule.get(day).add(unfinishedTask);\r\n workHrs += unfinishedTask.getHrsLeft();\r\n }\r\n else{\r\n day++;\r\n weeklySchedule.get(day).add(unfinishedTask);\r\n workHrs = unfinishedTask.getHrsLeft();\r\n }\r\n }\r\n }", "@Override\n public void onChildAdded(DataSnapshot dataSnapshot, String s) {\n long lastMessageTime = sharedPref.getLong(\"last_announcement\", System.currentTimeMillis());\n\n /*get announcementItem from database*/\n AnnouncementItem announcementItem = dataSnapshot.getValue(AnnouncementItem.class);\n\n /*compare time of last read announcementItem and announcementItem from database*/\n if (announcementItem.getTime() > lastMessageTime) {\n /*builder for push notification*/\n Notification.Builder builder = new Notification.Builder(AnnouncementService.this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"Announcement\")\n .setContentText(\"There is a new announcement\");\n\n /*intent for push notification*/\n Intent resultIntent = new Intent(AnnouncementService.this, AnnouncementsActivity.class);\n\n /*build stack for intent calls*/\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(AnnouncementService.this);\n stackBuilder.addParentStack(Sahaya.class);\n stackBuilder.addNextIntent(resultIntent);\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n\n /*add resultPendingIndent to builder*/\n builder.setContentIntent(resultPendingIntent);\n\n /*build push notification*/\n Notification notification = builder.build();\n notification.defaults |= Notification.DEFAULT_SOUND;\n notification.defaults |= Notification.DEFAULT_VIBRATE;\n\n /*get notification manager*/\n NotificationManager notificationManager = (NotificationManager) getSystemService(Service.NOTIFICATION_SERVICE);\n\n /*show notification*/\n notificationManager.notify(0, notification);\n }\n\n /*set last read message time as current time*/\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putLong(\"last_announcement\", System.currentTimeMillis());\n editor.apply();\n\n }", "public boolean hasNotifications()\n {\n return !this.notifications.isEmpty();\n }", "@Override\n public void onCreate() {\n FirebaseAuth auth = FirebaseAuth.getInstance();\n\n /*Get Firebase Database Instance*/\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n\n /*Get discussion database reference*/\n discussionRef = database.getReference(\"announcements\");\n\n /*Get Default Shared Preferences associated with app*/\n final SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);\n\n /*ChildEventListener to handle discussion database changes*/\n final ChildEventListener childEventListener = new ChildEventListener() {\n @Override\n public void onChildAdded(DataSnapshot dataSnapshot, String s) {\n /*Retrieve last read announcementItem time from preferences*/\n long lastMessageTime = sharedPref.getLong(\"last_announcement\", System.currentTimeMillis());\n\n /*get announcementItem from database*/\n AnnouncementItem announcementItem = dataSnapshot.getValue(AnnouncementItem.class);\n\n /*compare time of last read announcementItem and announcementItem from database*/\n if (announcementItem.getTime() > lastMessageTime) {\n /*builder for push notification*/\n Notification.Builder builder = new Notification.Builder(AnnouncementService.this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"Announcement\")\n .setContentText(\"There is a new announcement\");\n\n /*intent for push notification*/\n Intent resultIntent = new Intent(AnnouncementService.this, AnnouncementsActivity.class);\n\n /*build stack for intent calls*/\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(AnnouncementService.this);\n stackBuilder.addParentStack(Sahaya.class);\n stackBuilder.addNextIntent(resultIntent);\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n\n /*add resultPendingIndent to builder*/\n builder.setContentIntent(resultPendingIntent);\n\n /*build push notification*/\n Notification notification = builder.build();\n notification.defaults |= Notification.DEFAULT_SOUND;\n notification.defaults |= Notification.DEFAULT_VIBRATE;\n\n /*get notification manager*/\n NotificationManager notificationManager = (NotificationManager) getSystemService(Service.NOTIFICATION_SERVICE);\n\n /*show notification*/\n notificationManager.notify(0, notification);\n }\n\n /*set last read message time as current time*/\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putLong(\"last_announcement\", System.currentTimeMillis());\n editor.apply();\n\n }\n\n @Override\n public void onChildChanged(DataSnapshot dataSnapshot, String s) {\n\n }\n\n @Override\n public void onChildRemoved(DataSnapshot dataSnapshot) {\n\n }\n\n @Override\n public void onChildMoved(DataSnapshot dataSnapshot, String s) {\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n };\n\n /*set childListener to database reference based on user*/\n auth.addAuthStateListener(new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n if (user != null) {\n discussionRef.addChildEventListener(childEventListener);\n } else {\n discussionRef.removeEventListener(childEventListener);\n }\n }\n });\n super.onCreate();\n }", "protected List<NotificationInfo> assertMadeWebNotifications(int number) {\n //get web's notification then clear the notification list\n UserSetting setting = userSettingService.get(rootIdentity.getRemoteId());\n List<NotificationInfo> got = notificationService.storeWebNotifs();\n if (setting.isActive(WebChannel.ID, getPlugin().getKey().getId())) {\n got = notificationService.storeWebNotifs();\n assertEquals(number, got.size());\n }\n \n return got;\n }", "private void updateNotification() {\n Bitmap image = null;\n if(currentPlayingItem!=null && currentPlayingItem.hasImage()) {\n image = ((MusicPlayerApplication)getApplication()).imagesCache.getImageSync(currentPlayingItem);\n }\n\n\t\t/* Update remote control client */\n if(currentPlayingItem==null) {\n remoteControlClient.setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED);\n } else {\n if(isPlaying()) {\n remoteControlClient.setPlaybackState(RemoteControlClient.PLAYSTATE_PLAYING);\n } else {\n remoteControlClient.setPlaybackState(RemoteControlClient.PLAYSTATE_PAUSED);\n }\n RemoteControlClient.MetadataEditor metadataEditor = remoteControlClient.editMetadata(true);\n metadataEditor.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, currentPlayingItem.getTitle());\n metadataEditor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, currentPlayingItem.getArtist());\n metadataEditor.putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, currentPlayingItem.getArtist());\n metadataEditor.putLong(MediaMetadataRetriever.METADATA_KEY_DURATION, getDuration());\n if(currentPlayingItem.hasImage()) {\n metadataEditor.putBitmap(METADATA_KEY_ARTWORK, image);\n } else {\n metadataEditor.putBitmap(METADATA_KEY_ARTWORK, icon.copy(icon.getConfig(), false));\n }\n metadataEditor.apply();\n }\n\n sendPlayingStateBroadcast();\n\t\t\n\t\t/* Update notification */\n\t\tNotification.Builder notificationBuilder = new Notification.Builder(this);\n\t\tnotificationBuilder.setSmallIcon(R.drawable.audio_white);\n notificationBuilder.setContentIntent(pendingIntent);\n notificationBuilder.setOngoing(true);\n\t\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n\t\t\tnotificationBuilder.setChannelId(NOTIFICATION_CHANNEL);\n\t\t}\n\n if(Build.VERSION.SDK_INT >= 21) {\n int playPauseIcon = isPlaying() ? R.drawable.button_pause : R.drawable.button_play;\n if (currentPlayingItem == null) {\n notificationBuilder.setContentTitle(getString(R.string.noSong));\n notificationBuilder.setContentText(getString(R.string.app_name));\n notificationBuilder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher));\n } else {\n notificationBuilder.setContentTitle(currentPlayingItem.getTitle());\n notificationBuilder.setContentText(currentPlayingItem.getArtist());\n if (image == null) {\n notificationBuilder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher));\n } else {\n notificationBuilder.setLargeIcon(image);\n }\n }\n notificationBuilder.addAction(R.drawable.button_quit, getString(R.string.quit), quitPendingIntent);\n notificationBuilder.addAction(R.drawable.button_previous, getString(R.string.previous), previousPendingIntent);\n notificationBuilder.addAction(playPauseIcon, getString(R.string.pause), playpausePendingIntent);\n notificationBuilder.addAction(R.drawable.button_next, getString(R.string.next), nextPendingIntent);\n notificationBuilder.setColor(getResources().getColor(R.color.primaryDark));\n notificationBuilder.setStyle(new Notification.MediaStyle().setShowActionsInCompactView(2));\n notification = notificationBuilder.build();\n } else {\n int playPauseIcon = isPlaying() ? R.drawable.pause : R.drawable.play;\n notificationBuilder.setContentTitle(getResources().getString(R.string.app_name));\n\n RemoteViews notificationLayout = new RemoteViews(getPackageName(), R.layout.layout_notification);\n\n if (currentPlayingItem == null) {\n notificationLayout.setTextViewText(R.id.textViewArtist, getString(R.string.app_name));\n notificationLayout.setTextViewText(R.id.textViewTitle, getString(R.string.noSong));\n notificationLayout.setImageViewBitmap(R.id.imageViewNotification, BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher));\n } else {\n String title = currentPlayingItem.getArtist();\n if (!title.equals(\"\")) title += \" - \";\n title += currentPlayingItem.getTitle();\n notificationBuilder.setContentText(title);\n notificationLayout.setTextViewText(R.id.textViewArtist, currentPlayingItem.getArtist());\n notificationLayout.setTextViewText(R.id.textViewTitle, currentPlayingItem.getTitle());\n if (image != null) {\n notificationLayout.setImageViewBitmap(R.id.imageViewNotification, image);\n } else {\n notificationLayout.setImageViewBitmap(R.id.imageViewNotification, BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher));\n }\n }\n notificationLayout.setOnClickPendingIntent(R.id.buttonNotificationQuit, quitPendingIntent);\n notificationLayout.setOnClickPendingIntent(R.id.buttonNotificationPrevious, previousPendingIntent);\n notificationLayout.setImageViewResource(R.id.buttonNotificationPlayPause, playPauseIcon);\n notificationLayout.setOnClickPendingIntent(R.id.buttonNotificationPlayPause, playpausePendingIntent);\n notificationLayout.setOnClickPendingIntent(R.id.buttonNotificationNext, nextPendingIntent);\n notification = notificationBuilder.build();\n notification.bigContentView = notificationLayout;\n }\n\t\t\n\t\tnotificationManager.notify(NOTIFICATION_ID, notification);\n\t}", "public void setNotifyFrequency(String days) {\n Log.d(Logger.TAG, \"List = \" + getNotifyFrequency());\n Log.d(Logger.TAG, \"day = \" + days);\n if (!getNotifyFrequency().contains(days)) {\n editSharedPrefs().putString(SHARED_PREFS_NOTIFY_FREQ, days).apply();\n }\n }", "void parseEventList() {\n\t\tfor (int eventsId : events.keySet()) {\n\t\t\tfinal Event event = events.get(eventsId);\n\t\t\tif (users.get(event.getUser().getName()).isActiveStatus()\n\t\t\t\t\t&& !event.isViewed()\n\t\t\t\t\t&& event.getInnerSisdate().compareTo(\n\t\t\t\t\t\t\tnew GregorianCalendar()) >= 0) {\n\t\t\t\tevent.setViewed(true);\n\t\t\t\tfinal SimpleDateFormat fm = new SimpleDateFormat(\n\t\t\t\t\t\t\"dd.MM.yyyy-HH:mm:ss\");\n\t\t\t\tt.schedule(new TimerTask() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tif (event.isActive()) {\n\t\t\t\t\t\t\tgenerateEventMessage(\"User \"\n\t\t\t\t\t\t\t\t\t+ event.getUser().getName()\n\t\t\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t\t\t+ fm.format(event.getInnerSisdate()\n\t\t\t\t\t\t\t\t\t\t\t.getTime()) + \" \" + event.getText());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, event.getInnerSisdate().getTime());\n\n\t\t\t}\n\t\t}\n\n\t}", "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 }", "static public void clearLocalNotifications(Context context) {\n\t\tAlarmReceiver.clearAlarm(context);\n\t}", "public void removeActiveNotification(boolean rescheduled){\r\n\t\ttry{\r\n\t\t\t_notificationActivity.stopTextToSpeechPlayback();\r\n\t\t\tNotification notification = this.getActiveNotification();\r\n\t\t\tif(notification == null){\r\n\t\t\t\tLog.e(_context, \"NotificationViewFlipper.removeActiveNotification() Active Notification Is Null. Exiting...\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tthis.removeNotification(this.getDisplayedChild(), rescheduled);\r\n\t\t\t//Clear the status bar notification.\r\n\t \tCommon.clearNotification(_context, this, notification.getNotificationType());\r\n\t\t}catch(Exception ex){\r\n\t\t\tLog.e(_context, \"NotificationViewFlipper.removeActiveNotification() ERROR: \" + ex.toString());\r\n\t\t}\r\n\t}", "@Override\r\n public void onRefresh() {\r\n tasksubject1.clear();\r\n tasksubject.clear();\r\n tasksubject3.clear();\r\n tasksubject2.clear();\r\n tasksubject4.clear();\r\n tasksubject5.clear();\r\n\r\n String k = client.getClientInfo().userId;\r\n java.util.Calendar calendar = java.util.Calendar.getInstance();\r\n SimpleDateFormat mdformat = new SimpleDateFormat(\"yyyy-MM-dd \");\r\n String date = mdformat.format(calendar.getTime());\r\n\r\n try {\r\n sendRequest(\"SELECT Subject,status,WhoId,id FROM Task WHERE ActivityDate=\" + date + \" and status ='Not Started' and ownerid='\" + k + \"'\");\r\n } catch (UnsupportedEncodingException e) {\r\n e.printStackTrace();\r\n }\r\n adapter.notifyDataSetChanged();\r\n pullToRefresh.setRefreshing(false);\r\n }", "void clearAllNotifications(long timeout);", "public void clearAppointments(){\n appointments.clear();\n }" ]
[ "0.67248106", "0.64135295", "0.63531595", "0.62517095", "0.62504995", "0.614467", "0.611838", "0.6101447", "0.6005047", "0.59613055", "0.5957891", "0.59199417", "0.59050894", "0.58821887", "0.5877708", "0.58572257", "0.5847977", "0.5842829", "0.58420175", "0.5803596", "0.5795552", "0.579403", "0.5766981", "0.57655656", "0.57248175", "0.57243127", "0.57154614", "0.5708848", "0.5707813", "0.569316", "0.568887", "0.5688269", "0.5673666", "0.5653596", "0.5644282", "0.5642262", "0.5638658", "0.55953264", "0.55919737", "0.55741006", "0.556901", "0.5560527", "0.5548214", "0.5545919", "0.55402017", "0.55344146", "0.5533497", "0.55297756", "0.5525045", "0.5524319", "0.5524177", "0.5516769", "0.5516658", "0.551508", "0.550316", "0.54989576", "0.54986954", "0.54965764", "0.54867107", "0.54822433", "0.54790336", "0.54768056", "0.5474795", "0.5470898", "0.5469465", "0.54691535", "0.5456696", "0.54565424", "0.545431", "0.5450446", "0.54429555", "0.54352707", "0.54327476", "0.5428045", "0.5423579", "0.54144657", "0.54114616", "0.54083455", "0.5405815", "0.54016834", "0.5396904", "0.53902894", "0.5375518", "0.5371242", "0.53655916", "0.5358124", "0.535197", "0.53466475", "0.5340113", "0.5336156", "0.5331239", "0.5321721", "0.5311405", "0.53050596", "0.5299218", "0.5292283", "0.5283831", "0.5282866", "0.5277102", "0.5271647" ]
0.6493158
1
/ there are a bunch of tabs, and given the chosen tab, we need to set the background of white on it, but also need to remove this attribute on other tabs, if set
protected void activateTab() { GWT.log("activateTab " + getActiveTabId()); List<String> ids = new ArrayList<String>(); ids.add("contestsli"); ids.add("driversli"); ids.add("chatsli"); ids.add("dirli"); ids.add("menuli"); for (String id : ids) { com.google.gwt.dom.client.Element element = DOM.getElementById(id); if (element != null) { element.removeAttribute("style"); } } String tabId = getActiveTabId(); if (tabId != null) { com.google.gwt.dom.client.Element element = DOM.getElementById(tabId); if (element != null) { element.setAttribute("style", "background:white;"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void prepareTabBackground(final Tab tab) {\n if (!CustomTabIntentDataProvider.isTrustedCustomTab(mIntent, mSession)) return;\n\n int backgroundColor = mIntentDataProvider.getColorProvider().getInitialBackgroundColor();\n if (backgroundColor == Color.TRANSPARENT) return;\n\n // Set the background color.\n tab.getView().setBackgroundColor(backgroundColor);\n\n // Unset the background when the page has rendered.\n EmptyTabObserver mediaObserver = new EmptyTabObserver() {\n @Override\n public void didFirstVisuallyNonEmptyPaint(final Tab tab) {\n tab.removeObserver(this);\n\n // Blink has rendered the page by this point, but we need to wait for the compositor\n // frame swap to avoid flash of white content.\n mCompositorViewHolder.get().getCompositorView().surfaceRedrawNeededAsync(() -> {\n if (!tab.isInitialized()\n || ActivityUtils.isActivityFinishingOrDestroyed(mActivity)) {\n return;\n }\n tab.getView().setBackgroundResource(0);\n });\n }\n };\n\n tab.addObserver(mediaObserver);\n }", "@Override\n\tprotected int getMainTabBackgroundDrawable() {\n\t\treturn R.color.white;\n\t}", "@Override\n\t\t\tpublic void onTabChanged(String tabId) {\n\t\t\t\t\n\t\t\t\ttabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()).setBackgroundColor(Color.parseColor(\"#FFBF00\"));\n\t\t\t\tfor(int i=0;i<tabHost.getTabWidget().getChildCount();i++){\n\t\t\t\t\tif(i != tabHost.getCurrentTab()){\n\t\t\t\t\t\ttabHost.getTabWidget().getChildAt(i).setBackgroundResource(R.drawable.tab_fonis);\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "private void setTabBg(View vFocused, boolean selected) {\n if (selected) {\n SkinUtil.instance().setViewBackground(this, vFocused, R.drawable.bg_title_item_c);\n } else {\n SkinUtil.instance().setViewBackground(this, vFocused, R.drawable.btn_filter_tab_selector);\n }\n }", "@Override\r\n\t\t\t\tpublic void onTabChanged(String tabId) {\r\n\t\t\t\t\t for(int i=0;i<mTabHost.getTabWidget().getChildCount();i++)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t mTabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor(\"#96E0D2\"));\r\n\t\t\t\t\t } \r\n\t\t\t\t\t mTabHost.getTabWidget().getChildAt(Integer.parseInt(tabId)).setBackgroundColor(Color.parseColor(\"#65D2BD\"));\r\n\t\t\t\t}", "void toogleTab(View tab) {;\n\t\tbuttonAbout1.setBackgroundResource(R.drawable.menu_haut_sousmenu_on);\n\t\tbuttonAbout2.setBackgroundResource(R.drawable.menu_haut_sousmenu_on);\n\t}", "public void setTabColor(TabHost tabhost) {\n\n int COLOR_TRANSPARENT = 0;\n\n for(int i=0;i<tabhost.getTabWidget().getChildCount();i++)\n tabhost.getTabWidget().getChildAt(i).setBackgroundColor(COLOR_TRANSPARENT); //unselected\n\n if(tabhost.getCurrentTab()==0)\n tabhost.getTabWidget().getChildAt(tabhost.getCurrentTab()).setBackgroundColor(R.color.darkgreen); //1st tab selected\n else\n tabhost.getTabWidget().getChildAt(tabhost.getCurrentTab()).setBackgroundColor(R.color.darkgreen); //2nd tab selected\n }", "@Override\n public void onTabChanged(String tabNumber) {\n for (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {\n// tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor(\"#FF0000\")); // unselected\n TextView tv = (TextView) tabHost.getTabWidget().getChildAt(i).findViewById(android.R.id.title); //Unselected Tabs\n tv.setTextColor(Color.parseColor(\"#ffffff\"));\n }\n// tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()).setBackgroundColor(Color.parseColor(\"#0000FF\")); // selected\n TextView tv = (TextView) tabHost.getCurrentTabView().findViewById(android.R.id.title); //for Selected Tab\n tv.setTextColor(Color.parseColor(\"#ffffff\"));\n\n //Change tab underline indicator color\n TabWidget widget = tabHost.getTabWidget();\n for(int i = 0; i < widget.getChildCount(); i++) {\n View v = widget.getChildAt(i);\n\n // Look for the title view to ensure this is an indicator and not a divider.\n TextView tvv = (TextView)v.findViewById(android.R.id.title);\n if(tvv == null) {\n continue;\n }\n v.setBackgroundResource(R.drawable.tab_widget_bottom_indicator_by_xml);\n }\n\n //Tab Animation part\n currentView = tabHost.getCurrentView();\n if (tabHost.getCurrentTab() > currentTab){\n previousView.setAnimation(outTOLeftAnimation());\n currentView.setAnimation(inFromRightAnimation());\n } else {\n previousView.setAnimation(outTORightAnimation());\n currentView.setAnimation(inFromLeftAnimation());\n }\n\n previousView = currentView;\n currentTab = tabHost.getCurrentTab();\n }", "@Override\n public void onTabSelected(TabLayout.Tab tab) {\n if(tab.getPosition()==0)\n {\n imgBeranda.setImageResource(tabSelected[0]);\n txtBeranda.setTextColor(getResources().getColor(R.color.blue_selected));\n imgKontrak.setImageResource(tabUnselected[1]);\n txtKontrak.setTextColor(getResources().getColor(R.color.grey_unselected));\n imgProfil.setImageResource(tabUnselected[2]);\n txtProfil.setTextColor(getResources().getColor(R.color.grey_unselected));\n imgBantuan.setImageResource(tabUnselected[3]);\n txtBantuan.setTextColor(getResources().getColor(R.color.grey_unselected));\n }\n else if(tab.getPosition()==1)\n {\n imgBeranda.setImageResource(tabUnselected[0]);\n txtBeranda.setTextColor(getResources().getColor(R.color.grey_unselected));\n imgKontrak.setImageResource(tabSelected[1]);\n txtKontrak.setTextColor(getResources().getColor(R.color.blue_selected));\n imgProfil.setImageResource(tabUnselected[2]);\n txtProfil.setTextColor(getResources().getColor(R.color.grey_unselected));\n imgBantuan.setImageResource(tabUnselected[3]);\n txtBantuan.setTextColor(getResources().getColor(R.color.grey_unselected));\n\n }\n else if(tab.getPosition()==2)\n {\n imgBeranda.setImageResource(tabUnselected[0]);\n txtBeranda.setTextColor(getResources().getColor(R.color.grey_unselected));\n imgKontrak.setImageResource(tabUnselected[1]);\n txtKontrak.setTextColor(getResources().getColor(R.color.grey_unselected));\n imgProfil.setImageResource(tabSelected[2]);\n txtProfil.setTextColor(getResources().getColor(R.color.blue_selected));\n imgBantuan.setImageResource(tabUnselected[3]);\n txtBantuan.setTextColor(getResources().getColor(R.color.grey_unselected));\n\n }\n else if(tab.getPosition()==3)\n {\n imgBeranda.setImageResource(tabUnselected[0]);\n txtBeranda.setTextColor(getResources().getColor(R.color.grey_unselected));\n imgKontrak.setImageResource(tabUnselected[1]);\n txtKontrak.setTextColor(getResources().getColor(R.color.grey_unselected));\n imgProfil.setImageResource(tabUnselected[2]);\n txtProfil.setTextColor(getResources().getColor(R.color.grey_unselected));\n imgBantuan.setImageResource(tabSelected[3]);\n txtBantuan.setTextColor(getResources().getColor(R.color.blue_selected));\n\n\n }\n\n }", "private void setColorTab(final boolean set) {\n getStyleClass().removeAll(\"red-tab-tablecell\", \"green-tab-tablecell\", \"orange-tab-tablecell\");\n if (!(getTableRow() == null || getTableRow().getItem() == null || isEmpty() || !set)) {\n Story story = (Story) getTableRow().getItem();\n Story.StoryState storyState = story.getStoryState();\n\n final int storyPriority = getModel().getStoryPriority(story);\n long lowerPriorityCount = story.getDependencies()\n .stream()\n .filter(param -> {\n Integer priority = getModel().getStoryPriority(param);\n return priority < storyPriority;\n })\n .count();\n boolean badDependency = lowerPriorityCount > 0;\n\n if (badDependency) {\n getStyleClass().add(\"red-tab-tablecell\");\n getTooltip().setText(InternationalizationHelper.tryGet(\"BadDependencyTooltip\"));\n }\n else if (storyState == Story.StoryState.Ready) {\n getStyleClass().add(\"green-tab-tablecell\");\n getTooltip().setText(InternationalizationHelper.tryGet(\"ReadyStoryTooltip\"));\n }\n else if (story.getAcceptanceCriteria().size() > 0) {\n getStyleClass().add(\"orange-tab-tablecell\");\n getTooltip().setText(InternationalizationHelper.tryGet(\"UnestimatedTooltip\"));\n }\n }\n }", "private void configure_tabs() {\n Objects.requireNonNull(tabs.getTabAt(0)).setIcon(R.drawable.baseline_map_white_24);\n Objects.requireNonNull(Objects.requireNonNull(tabs.getTabAt(0)).getIcon()).setColorFilter(getResources().getColor(R.color.colorIconSelected), PorterDuff.Mode.SRC_IN);\n Objects.requireNonNull(tabs.getTabAt(1)).setIcon(R.drawable.baseline_view_list_white_24);\n Objects.requireNonNull(Objects.requireNonNull(tabs.getTabAt(1)).getIcon()).setColorFilter(getResources().getColor(R.color.colorIconNotSelected), PorterDuff.Mode.SRC_IN);\n Objects.requireNonNull(tabs.getTabAt(2)).setIcon(R.drawable.baseline_people_white_24);\n Objects.requireNonNull(Objects.requireNonNull(tabs.getTabAt(2)).getIcon()).setColorFilter(getResources().getColor(R.color.colorIconNotSelected), PorterDuff.Mode.SRC_IN);\n swipeRefreshLayout.setEnabled(false);\n\n // Set on Tab selected listener\n tabs.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {\n @Override\n public void onTabSelected(TabLayout.Tab tab) {\n // Change color of the tab -> orange\n if (tab.getIcon() != null)\n tab.getIcon().setColorFilter(getApplicationContext().getResources().getColor(R.color.colorIconSelected), PorterDuff.Mode.SRC_IN);\n\n // set the current page position\n current_page = tab.getPosition();\n\n // if the current page is the ListMatesFragment, remove the searchView\n if(mToolbar_navig_utils!=null){\n if(current_page==2)\n mToolbar_navig_utils.getSearchView().setVisibility(View.GONE);\n else\n mToolbar_navig_utils.getSearchView().setVisibility(View.VISIBLE);\n }\n\n // refresh title toolbar (different according to the page selected)\n if(mToolbar_navig_utils !=null)\n mToolbar_navig_utils.refresh_text_toolbar();\n\n // Disable pull to refresh when mapView is displayed\n if(tab.getPosition()==0)\n swipeRefreshLayout.setEnabled(false);\n else\n swipeRefreshLayout.setEnabled(true);\n }\n\n @Override\n public void onTabUnselected(TabLayout.Tab tab) {\n\n // if the searchView is opened, close it\n if(mToolbar_navig_utils !=null) {\n if (mToolbar_navig_utils.getSearchView() != null) {\n if (!mToolbar_navig_utils.getSearchView().isIconified()) {\n mToolbar_navig_utils.getSearchView().setIconified(true);\n\n // Recover the previous list of places nearby generated\n switch (current_page) {\n case 0:\n getPageAdapter().getMapsFragment().recover_previous_state();\n break;\n case 1:\n getPageAdapter().getListRestoFragment().recover_previous_state();\n break;\n }\n }\n }\n }\n\n // Change color of the tab -> black\n if (tab.getIcon() != null)\n tab.getIcon().setColorFilter(getApplicationContext().getResources().getColor(R.color.colorIconNotSelected), PorterDuff.Mode.SRC_IN);\n }\n\n @Override\n public void onTabReselected(TabLayout.Tab tab) {\n }\n });\n }", "private void eric_function()\n\t{\n \ttabHost = (TabHost) findViewById(R.id.mytab1);\n \ttabHost.setup();\n \t \n \t//tabHost.setBackgroundColor(Color.argb(150, 20, 80, 150));\n \ttabHost.setBackgroundResource(R.drawable.ic_launcher);\n \t\n \t\n \t//\n \tTabSpec tabSpec;\n \t// 1\n \ttabSpec = tabHost.newTabSpec(tab_list[0]);\n \ttabSpec.setIndicator(\"a.1\");\n \ttabSpec.setContent(R.id.widget_layout_blue2);\n \ttabHost.addTab(tabSpec);\n \t// 2\n \ttabSpec = tabHost.newTabSpec(tab_list[1]);\n \ttabSpec.setIndicator(\"a2\");\n \ttabSpec.setContent(R.id.widget_layout_green2);\n \ttabHost.addTab(tabSpec); \t\n \t// 3\n \ttabSpec = tabHost.newTabSpec(tab_list[2]);\n \ttabSpec.setIndicator(\"a3\");\n \ttabSpec.setContent(R.id.widget_layout_red2);\n \ttabHost.addTab(tabSpec); \t\n \t//\n\t\ttabHost.setOnTabChangedListener(listener1);\n \t//\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void applyTab();", "protected void setBackground (Color4f color)\n {\n final Color c = color.getColor();\n setBackground(c);\n getContentPane().setBackground(c);\n for (int ii = 0, nn = _tabs.getComponentCount(); ii < nn; ii++) {\n ((ManagerPanel)_tabs.getComponentAt(ii)).setBackground(c);\n }\n// SwingUtil.applyToHierarchy(this, new SwingUtil.ComponentOp() {\n// public void apply (Component comp) {\n// comp.setBackground(c);\n// }\n// });\n }", "public void setInnerAreaBackground(int tabSelectionIndex, Color innerAreaBackground) {\r\n\t\tif (tabSelectionIndex == 0) {\r\n\t\t\tthis.settings.setGraphicsCurveAreaBackground(innerAreaBackground);\r\n\t\t\tthis.graphicsTabItem.setCurveAreaBackground(innerAreaBackground);\r\n\t\t}\r\n\t\telse if (tabSelectionIndex > 0) if (this.displayTab.getItem(tabSelectionIndex) instanceof StatisticsWindow) {\r\n\t\t\tthis.settings.setSatisticsInnerAreaBackground(innerAreaBackground);\r\n\t\t\tthis.statisticsTabItem.setInnerAreaBackground(innerAreaBackground);\r\n\t\t}\r\n\t\telse if (this.displayTab.getItem(tabSelectionIndex) instanceof DigitalWindow) {\r\n\t\t\tthis.settings.setDigitalInnerAreaBackground(innerAreaBackground);\r\n\t\t\tthis.digitalTabItem.setInnerAreaBackground(innerAreaBackground);\r\n\t\t}\r\n\t\telse if (this.displayTab.getItem(tabSelectionIndex) instanceof AnalogWindow) {\r\n\t\t\tthis.settings.setAnalogInnerAreaBackground(innerAreaBackground);\r\n\t\t\tthis.analogTabItem.setInnerAreaBackground(innerAreaBackground);\r\n\t\t}\r\n\t\telse if (this.displayTab.getItem(tabSelectionIndex) instanceof CellVoltageWindow) {\r\n\t\t\tthis.settings.setCellVoltageInnerAreaBackground(innerAreaBackground);\r\n\t\t\tthis.cellVoltageTabItem.setInnerAreaBackground(innerAreaBackground);\r\n\t\t}\r\n\t\telse if (this.displayTab.getItem(tabSelectionIndex) instanceof FileCommentWindow) {\r\n\t\t\tthis.settings.setFileCommentInnerAreaBackground(innerAreaBackground);\r\n\t\t\tthis.fileCommentTabItem.setInnerAreaBackground(innerAreaBackground);\r\n\t\t}\r\n\t\telse if (this.displayTab.getItem(tabSelectionIndex) instanceof ObjectDescriptionWindow) {\r\n\t\t\tthis.settings.setObjectDescriptionInnerAreaBackground(innerAreaBackground);\r\n\t\t\tthis.objectDescriptionTabItem.setInnerAreaBackground(innerAreaBackground);\r\n\t\t}\r\n\t\telse if ((this.displayTab.getItem(tabSelectionIndex) instanceof GraphicsWindow) && this.isRecordSetVisible(GraphicsType.COMPARE)) {\r\n\t\t\tthis.settings.setCompareCurveAreaBackground(innerAreaBackground);\r\n\t\t\tthis.compareTabItem.setCurveAreaBackground(innerAreaBackground);\r\n\t\t}\r\n\t\telse if ((this.displayTab.getItem(tabSelectionIndex) instanceof GraphicsWindow) && this.isRecordSetVisible(GraphicsType.UTIL)) {\r\n\t\t\tthis.settings.setUtilityCurveAreaBackground(innerAreaBackground);\r\n\t\t\tthis.utilGraphicsTabItem.setCurveAreaBackground(innerAreaBackground);\r\n\t\t}\r\n\t\telse if (this.displayTab.getItem(tabSelectionIndex) instanceof HistoGraphicsWindow) {\r\n\t\t\tthis.settings.setObjectDescriptionInnerAreaBackground(innerAreaBackground);\r\n\t\t\tthis.histoGraphicsTabItem.setCurveAreaBackground(innerAreaBackground);\r\n\t\t}\r\n\t}", "@Override\n\tpublic void onTabChanged(String tabId) {\n\t\tcurrenttab = tabHost.getCurrentTab();\n\t\tif (currenttab == 0) {\n\t\t\tTravellersinfo.setTextColor(Color.parseColor(\"#d16413\"));\n\t\t\tMemberslogin.setTextColor(Color.parseColor(\"#000000\"));\n\t\t\ttravellerssecondrow.setVisibility(View.VISIBLE);\n\t\t} else {\n\t\t\tMemberslogin.setTextColor(Color.parseColor(\"#d16413\"));\n\t\t\tTravellersinfo.setTextColor(Color.parseColor(\"#000000\"));\n\n\t\t\ttravellerssecondrow.setVisibility(View.GONE);\n\t\t}\n\n\t\tfor (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {\n\t\t\ttabHost.getTabWidget().getChildAt(i)\n\t\t\t\t\t.setBackgroundResource(R.drawable.boxtypboders);\n\t\t}\n\n\t\t// Adding bottom image on current tab\n\t\ttabHost.getTabWidget().getChildAt(tabHost.getCurrentTab())\n\t\t\t\t.setBackgroundResource(R.drawable.selectedtab);\n\t}", "@Override\n public void onTabUnselected(TabLayout.Tab tab) {\n if(mToolbar_navig_utils !=null) {\n if (mToolbar_navig_utils.getSearchView() != null) {\n if (!mToolbar_navig_utils.getSearchView().isIconified()) {\n mToolbar_navig_utils.getSearchView().setIconified(true);\n\n // Recover the previous list of places nearby generated\n switch (current_page) {\n case 0:\n getPageAdapter().getMapsFragment().recover_previous_state();\n break;\n case 1:\n getPageAdapter().getListRestoFragment().recover_previous_state();\n break;\n }\n }\n }\n }\n\n // Change color of the tab -> black\n if (tab.getIcon() != null)\n tab.getIcon().setColorFilter(getApplicationContext().getResources().getColor(R.color.colorIconNotSelected), PorterDuff.Mode.SRC_IN);\n }", "public void setSurroundingBackground(int tabSelectionIndex, Color surroundingBackground) {\r\n\t\tif (tabSelectionIndex == 0) {\r\n\t\t\tthis.settings.setGraphicsSurroundingBackground(surroundingBackground);\r\n\t\t\tthis.graphicsTabItem.setSurroundingBackground(surroundingBackground);\r\n\t\t}\r\n\t\telse if (tabSelectionIndex > 0) if (this.displayTab.getItem(tabSelectionIndex) instanceof StatisticsWindow) {\r\n\t\t\tthis.settings.setSatisticsSurroundingAreaBackground(surroundingBackground);\r\n\t\t\tthis.statisticsTabItem.setSurroundingAreaBackground(surroundingBackground);\r\n\t\t}\r\n\t\telse if (this.displayTab.getItem(tabSelectionIndex) instanceof DigitalWindow) {\r\n\t\t\tthis.settings.setDigitalSurroundingAreaBackground(surroundingBackground);\r\n\t\t\tthis.digitalTabItem.setSurroundingAreaBackground(surroundingBackground);\r\n\t\t}\r\n\t\telse if (this.displayTab.getItem(tabSelectionIndex) instanceof AnalogWindow) {\r\n\t\t\tthis.settings.setAnalogSurroundingAreaBackground(surroundingBackground);\r\n\t\t\tthis.analogTabItem.setSurroundingAreaBackground(surroundingBackground);\r\n\t\t}\r\n\t\telse if (this.displayTab.getItem(tabSelectionIndex) instanceof CellVoltageWindow) {\r\n\t\t\tthis.settings.setCellVoltageSurroundingAreaBackground(surroundingBackground);\r\n\t\t\tthis.cellVoltageTabItem.setSurroundingAreaBackground(surroundingBackground);\r\n\t\t}\r\n\t\telse if (this.displayTab.getItem(tabSelectionIndex) instanceof FileCommentWindow) {\r\n\t\t\tthis.settings.setFileCommentSurroundingAreaBackground(surroundingBackground);\r\n\t\t\tthis.fileCommentTabItem.setSurroundingAreaBackground(surroundingBackground);\r\n\t\t}\r\n\t\telse if (this.displayTab.getItem(tabSelectionIndex) instanceof ObjectDescriptionWindow) {\r\n\t\t\tthis.settings.setObjectDescriptionSurroundingAreaBackground(surroundingBackground);\r\n\t\t\tthis.objectDescriptionTabItem.setSurroundingAreaBackground(surroundingBackground);\r\n\t\t}\r\n\t\telse if ((this.displayTab.getItem(tabSelectionIndex) instanceof GraphicsWindow) && this.isRecordSetVisible(GraphicsType.COMPARE)) {\r\n\t\t\tthis.settings.setCompareSurroundingBackground(surroundingBackground);\r\n\t\t\tthis.compareTabItem.setSurroundingBackground(surroundingBackground);\r\n\t\t}\r\n\t\telse if ((this.displayTab.getItem(tabSelectionIndex) instanceof GraphicsWindow) && this.isRecordSetVisible(GraphicsType.UTIL)) {\r\n\t\t\tthis.settings.setUtilitySurroundingBackground(surroundingBackground);\r\n\t\t\tthis.utilGraphicsTabItem.setSurroundingBackground(surroundingBackground);\r\n\t\t}\r\n\t\telse if ((this.displayTab.getItem(tabSelectionIndex) instanceof HistoGraphicsWindow)) {\r\n\t\t\tthis.settings.setUtilitySurroundingBackground(surroundingBackground);\r\n\t\t\tthis.histoGraphicsTabItem.setSurroundingBackground(surroundingBackground);\r\n\t\t}\r\n\t}", "@Override\n void adjust_foil_shape_in_tab () {\n in.toggle_cyl_tab();\n }", "protected void addopqueueonBackground() {\n\t\tlv.setClickable(false);\n\t\tlvx.setClickable(false);\n\t\trefresh.setClickable(false);\n\t\tsearch.setClickable(false);\n\t\tsearch.setEnabled(false);\n\t\tlv.setEnabled(false);\n\t\tlvx.setEnabled(false);\n\t\trefresh.setEnabled(false);\n\t\tcancelButton.setClickable(false);\n\t\tcancelButton.setEnabled(false);\n\t\tlistbackground.setAlpha(0.5f);\n\t\tbackground.setAlpha(0.5f);\n\t}", "@Override\n public void onGenerated(Palette palette) {\n int defaultValue = 0x000000;\n int backgroundLayerAlpha;\n int colorDominant = palette.getDominantColor(defaultValue);\n tabLayoutColor = palette.getVibrantColor(defaultValue);\n\n if (!Helper.isColorDark(colorDominant))\n colorDominant = palette.getDarkVibrantColor(defaultValue);\n backgroundLayersColor = (colorDominant == 0) ? getResources().getColor(R.color.colorAppTheme) : colorDominant;\n tabLayoutColor = (tabLayoutColor == 0) ? backgroundLayersColor : tabLayoutColor;\n\n if (isBackgroundImageAvailable)\n backgroundLayerAlpha = 160;\n else {\n backgroundLayerAlpha = 220;\n tabLayoutColor = backgroundLayersColor;\n }\n\n GradientDrawable gd1 = new GradientDrawable(\n GradientDrawable.Orientation.LEFT_RIGHT,\n new int[]{backgroundLayersColor, ColorUtils.setAlphaComponent(backgroundLayersColor, backgroundLayerAlpha)});\n GradientDrawable gd2 = new GradientDrawable(\n GradientDrawable.Orientation.LEFT_RIGHT,\n new int[]{ColorUtils.setAlphaComponent(backgroundLayersColor, 80), ColorUtils.setAlphaComponent(backgroundLayersColor, 60)});\n GradientDrawable gd3 = new GradientDrawable(\n GradientDrawable.Orientation.LEFT_RIGHT,\n new int[]{backgroundLayersColor, backgroundLayersColor, ColorUtils.setAlphaComponent(backgroundLayersColor, 1)});\n\n binding.gradientLayer1.setBackground(gd1);\n binding.gradientLayer2.setBackground(gd2);\n binding.gradientLayer3.setBackground(gd3);\n\n getWindow().setStatusBarColor(backgroundLayersColor);\n binding.tabLayout.setSelectedTabIndicatorColor(tabLayoutColor);\n binding.tabLayout.setTabTextColors(R.color.colorUnselectedText, tabLayoutColor);\n DrawableCompat.setTint(binding.tabLayout.getTabAt(0).getIcon(), tabLayoutColor);\n }", "private void setTabLayout() {\n View view = LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n TextView title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n ImageView imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.MOVIES);\n imgIcon.setImageResource(R.mipmap.ic_home);\n mTabLayout.getTabAt(0).setCustomView(view);\n\n view =\n LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n count = (TextView) view.findViewById(R.id.item_tablayout_count_txt);\n imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.FAVOURITE);\n imgIcon.setImageResource(R.mipmap.ic_favorite);\n count.setVisibility(View.VISIBLE);\n mTabLayout.getTabAt(1).setCustomView(view);\n\n view =\n LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.SETTINGS);\n imgIcon.setImageResource(R.mipmap.ic_settings);\n mTabLayout.getTabAt(2).setCustomView(view);\n\n view =\n LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.ABOUT);\n imgIcon.setImageResource(R.mipmap.ic_info);\n mTabLayout.getTabAt(3).setCustomView(view);\n }", "public void cancelSelectionBorder(){\n BackgroundImage bgselected= new BackgroundImage(new Image(\"rugbeats/img/Background_selectedhdpi.png\"),BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT,\n new BackgroundSize(1.0, 1.0, true, true, false, false));\n ImgStack.setBackground(new Background(bgselected));\n }", "private int getSelectedTab() {\n String theme = \"default\";\n List<INamedParameters.NamedPair> pairs = getPageParameters().getAllNamed();\n theme = pairs.get(0).getValue();\n if (\"grid\".equals(theme)) {\n return 1;\n } else if (\"skies\".equals(theme)) {\n return 2;\n } else if (\"gray\".equals(theme)) {\n return 3;\n } else if (\"darkblue\".equals(theme)) {\n return 4;\n } else if (\"darkgreen\".equals(theme)) {\n return 5;\n } else {\n return 0;\n }\n }", "public void setActivingColor(){\n this.setBackground(new Color( 213, 228, 242));\n this.forceupdateUI();\n }", "@Override\n public void onTabSelected(TabLayout.Tab tab) {\n Log.e(\"selectedTab\", String.valueOf(tab.getPosition()));\n switch(tab.getPosition()) {\n case 0:\n allCategoryLayout.setVisibility(View.VISIBLE);\n /* basicLayout.setVisibility(View.INVISIBLE);\n liviingLayout.setVisibility(View.INVISIBLE);\n scienceLayout.setVisibility(View.INVISIBLE);\n micsLayout.setVisibility(View.INVISIBLE);*/\n break;\n case 1:\n // allCategoryLayout.setVisibility(View.INVISIBLE);\n basicLayout.setVisibility(View.VISIBLE);\n /*liviingLayout.setVisibility(View.INVISIBLE);\n scienceLayout.setVisibility(View.INVISIBLE);\n micsLayout.setVisibility(View.INVISIBLE);*/\n break;\n case 2:\n /* allCategoryLayout.setVisibility(View.INVISIBLE);\n basicLayout.setVisibility(View.INVISIBLE);*/\n liviingLayout.setVisibility(View.VISIBLE);\n /* scienceLayout.setVisibility(View.INVISIBLE);\n micsLayout.setVisibility(View.INVISIBLE);*/\n break;\n case 3:\n /* allCategoryLayout.setVisibility(View.INVISIBLE);\n basicLayout.setVisibility(View.INVISIBLE);\n liviingLayout.setVisibility(View.INVISIBLE);*/\n scienceLayout.setVisibility(View.VISIBLE);\n// micsLayout.setVisibility(View.INVISIBLE);\n break;\n case 4:\n /* allCategoryLayout.setVisibility(View.INVISIBLE);\n basicLayout.setVisibility(View.INVISIBLE);\n liviingLayout.setVisibility(View.INVISIBLE);\n scienceLayout.setVisibility(View.INVISIBLE);*/\n micsLayout.setVisibility(View.VISIBLE);\n break;\n }\n }", "public void resetListStyles() {\n\t\t\t\t for (int i=0; i<wordsList.getChildCount(); i++) {\n\t\t\t\t\t View child = wordsList.getChildAt(i);\n\t\t\t\t\t child.setBackgroundColor(Color.TRANSPARENT);\n\t\t\t\t }\n\t\t\t }", "public void setBg(){\n this.setBackground(color);\n }", "private void applyBackgroundColor() {\r\n\t\tthis.control.setBackground(PromptSupport.getBackground(this.control));\r\n\t}", "private void updateTabButtons() {\n\t\tif (currentTab == null || currentTab.equals(\"history\")) {\n\t\t\thistory.setDisable(true);\n\t\t\tlanguage.setDisable(false);\n\t\t} else if (currentTab == null || currentTab.equals(\"language\")) {\n\t\t\tlanguage.setDisable(true);\n\t\t\thistory.setDisable(false);\n\t\t}\n\t}", "public void changeColor() {\n linearLayout.setBackgroundColor(currentColor);\n for (int i = 0; i < arrayList.size(); i++) {\n arrayList.get(i).gifImageView.setBackgroundColor(currentColor);\n }\n }", "private void fuenteTab() {\n\n\n View view=LayoutInflater.from(this).inflate(R.layout.vista_pestanias,null);\n TextView tv=(TextView) view.findViewById(R.id.pestanias_txt);\n ImageView imv=(ImageView) view.findViewById(R.id.imagenPestanias);\n imv.setImageResource(R.drawable.detalles);\n tv.setTypeface(fuente2);\n tv.setText(\"Detalles\");\n tabLayout.getTabAt(0).setCustomView(view);\n\n view=LayoutInflater.from(this).inflate(R.layout.vista_pestanias,null);\n tv=(TextView) view.findViewById(R.id.pestanias_txt);\n imv=(ImageView) view.findViewById(R.id.imagenPestanias);\n imv.setImageResource(R.drawable.marciano);\n tv.setTypeface(fuente2);\n tv.setText(\"Juegos\");\n tabLayout.getTabAt(1).setCustomView(view);\n\n view=LayoutInflater.from(this).inflate(R.layout.vista_pestanias,null);\n tv=(TextView) view.findViewById(R.id.pestanias_txt);\n imv=(ImageView) view.findViewById(R.id.imagenPestanias);\n imv.setImageResource(R.drawable.tienda);\n tv.setTypeface(fuente2);\n tv.setText(\"Tienda\");\n tabLayout.getTabAt(2).setCustomView(view);\n\n }", "public void updateUI(final Color foreground) {\n\t\tsetUI(new BasicTabbedPaneUI() {\n\t\t\t@Override\n\t\t\tprotected boolean shouldRotateTabRuns(int i) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tprotected void installDefaults() {\n\t\t\t\tsuper.installDefaults();\n\t\t\t\thighlight = foreground;\n\t\t\t\tlightHighlight = foreground;\n\t\t\t\tshadow = foreground;\n\t\t\t\tdarkShadow = foreground;\n\t\t\t\tfocus = foreground;\n\n\t\t\t\t// Nice 3 pixel border, although it uses ugly blue ):\n\t\t\t\tthis.contentBorderInsets.top = 3;\n\t\t\t\tthis.contentBorderInsets.left = 3;\n\t\t\t\tthis.contentBorderInsets.right = 3;\n\t\t\t\tthis.contentBorderInsets.bottom = 3;\n\t\t\t\t\n\t\t\t\tthis.selectedTabPadInsets.bottom = 0;\n\t\t\t}\n\n\t\t\tBasicStroke underLineStroke = new BasicStroke(2);\n\n\t\t\t@Override\n\t\t\tprotected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h,\n\t\t\t\t\tboolean isSelected) {\n\t\t\t\tsuper.paintTabBorder(g, tabPlacement, tabIndex, x, y, w, h, isSelected);\n\t\t\t\t\n\t\t\t\tif (isSelected) {\n\t\t\t\t\tGraphics2D g2d = (Graphics2D) g.create();\n\t\t\t\t\tsuper.paintTabBorder(g2d, tabPlacement, tabIndex, x, y, w, h, isSelected);\n\t\t\t\t\tg2d.setStroke(underLineStroke);\n\t\t\t\t\tg2d.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1);\n\t\t\t\t\tg2d.dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t}", "protected int getTabListBackgroundColor(Context context) {\n if (TabUiFeatureUtilities.isGridTabSwitcherEnabled(context) && mTabModelSelector != null\n && mTabModelSelector.isIncognitoSelected()) {\n return context.getColor(R.color.default_bg_color_dark);\n }\n return SemanticColorUtils.getDefaultBgColor(context);\n }", "@Override\n\t\tpublic void handle(MouseEvent event) {\n\t\t\tif(event.getEventType().equals(MouseEvent.MOUSE_CLICKED)){\n\t\t\t\ttab_01.setTextFill(Color.BLACK);\n\t\t\t\ttab_02.setTextFill(Color.BLACK);\n\t\t\t\ttab_03.setTextFill(Color.BLACK);\n\t\t\t\ttab_04.setTextFill(Color.BLACK);\n\t\t\t\ttab_05.setTextFill(Color.RED);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}", "@ThreadConfined(type = ThreadConfined.ThreadType.AWT)\n private void resetTabsStatus() {\n for (Component comp : jTabbedPane1.getComponents()) {\n if (comp instanceof DomainArtifactsTabPanel) {\n ((DomainArtifactsTabPanel) comp).setStatus(DomainArtifactsTabPanel.ArtifactRetrievalStatus.UNPOPULATED);\n } else if (comp instanceof MiniTimelinePanel) {\n ((MiniTimelinePanel) comp).setStatus(DomainArtifactsTabPanel.ArtifactRetrievalStatus.UNPOPULATED, domain);\n }\n }\n }", "@Override\n\t\tpublic void handle(MouseEvent event) {\n\t\t\tif(event.getEventType().equals(MouseEvent.MOUSE_CLICKED)){\n\t\t\t\ttab_01.setTextFill(Color.BLACK);\n\t\t\t\ttab_02.setTextFill(Color.BLACK);\n\t\t\t\ttab_03.setTextFill(Color.RED);\n\t\t\t\ttab_04.setTextFill(Color.BLACK);\n\t\t\t\ttab_05.setTextFill(Color.BLACK);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}", "@Override\n\t\tpublic void handle(MouseEvent event) {\n\t\t\tif(event.getEventType().equals(MouseEvent.MOUSE_CLICKED)){\n\t\t\t\ttab_01.setTextFill(Color.BLACK);\n\t\t\t\ttab_02.setTextFill(Color.RED);\n\t\t\t\ttab_03.setTextFill(Color.BLACK);\n\t\t\t\ttab_04.setTextFill(Color.BLACK);\n\t\t\t\ttab_05.setTextFill(Color.BLACK);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}", "@Override\n\t\tpublic void handle(MouseEvent event) {\n\t\t\tif(event.getEventType().equals(MouseEvent.MOUSE_CLICKED)){\n\t\t\t\n\t\t\t\ttab_01.setTextFill(Color.BLACK);\n\t\t\t\ttab_02.setTextFill(Color.BLACK);\n\t\t\t\ttab_03.setTextFill(Color.BLACK);\n\t\t\t\ttab_04.setTextFill(Color.RED);\n\t\t\t\ttab_05.setTextFill(Color.BLACK);\n\t\t\t\t\n\t\t\t}\n\t\t}", "protected void removealphaOpeque() {\n\t\tlistbackground.setAlpha(1f);\n\t\tbackground.setAlpha(1f);\n\t\tlv.setClickable(true);\n\t\tlvx.setClickable(true);\n\t\trefresh.setClickable(true);\n\t\tsearch.setClickable(true);\n\t\tsearch.setEnabled(true);\n\t\tlv.setEnabled(true);\n\t\tlvx.setEnabled(true);\n\t\tcancelButton.setClickable(true);\n\t\tcancelButton.setEnabled(true);\n\t\trefresh.setEnabled(true);\n\t}", "@Override\n public void onTabSelected(TabLayout.Tab tab) {\n if (tab.getIcon() != null)\n tab.getIcon().setColorFilter(getApplicationContext().getResources().getColor(R.color.colorIconSelected), PorterDuff.Mode.SRC_IN);\n\n // set the current page position\n current_page = tab.getPosition();\n\n // if the current page is the ListMatesFragment, remove the searchView\n if(mToolbar_navig_utils!=null){\n if(current_page==2)\n mToolbar_navig_utils.getSearchView().setVisibility(View.GONE);\n else\n mToolbar_navig_utils.getSearchView().setVisibility(View.VISIBLE);\n }\n\n // refresh title toolbar (different according to the page selected)\n if(mToolbar_navig_utils !=null)\n mToolbar_navig_utils.refresh_text_toolbar();\n\n // Disable pull to refresh when mapView is displayed\n if(tab.getPosition()==0)\n swipeRefreshLayout.setEnabled(false);\n else\n swipeRefreshLayout.setEnabled(true);\n }", "private void setColorsByBuildType() {\n if (mBuild.isQueued()) {\n mStatusBarUtils.changeStatusBarColor(mActivity, R.color.queued_status_bar_color);\n setToolBarAndTabLayoutColor(R.color.queued_tool_bar_color);\n mTabLayout.setTabTextColors(\n mActivity.getResources().getColor(R.color.tab_queued_unselected_color),\n mActivity.getResources().getColor(R.color.md_white_1000));\n } else if (mBuild.isRunning()) {\n mStatusBarUtils.changeStatusBarColor(mActivity, R.color.running_status_bar_color);\n setToolBarAndTabLayoutColor(R.color.running_tool_bar_color);\n mTabLayout.setTabTextColors(\n mActivity.getResources().getColor(R.color.tab_running_unselected_color),\n mActivity.getResources().getColor(R.color.md_white_1000));\n } else if (mBuild.isFailed()) {\n mStatusBarUtils.changeStatusBarColor(mActivity, R.color.failed_status_bar_color);\n setToolBarAndTabLayoutColor(R.color.failed_tool_bar_color);\n mTabLayout.setTabTextColors(\n mActivity.getResources().getColor(R.color.tab_failed_unselected_color),\n mActivity.getResources().getColor(R.color.md_white_1000));\n } else if (mBuild.isSuccess()) {\n mStatusBarUtils.changeStatusBarColor(mActivity, R.color.success_status_bar_color);\n setToolBarAndTabLayoutColor(R.color.success_tool_bar_color);\n mTabLayout.setTabTextColors(\n mActivity.getResources().getColor(R.color.tab_success_unselected_color),\n mActivity.getResources().getColor(R.color.md_white_1000));\n } else {\n mStatusBarUtils.changeStatusBarColor(mActivity, R.color.queued_status_bar_color);\n setToolBarAndTabLayoutColor(R.color.queued_tool_bar_color);\n mTabLayout.setTabTextColors(\n mActivity.getResources().getColor(R.color.tab_queued_unselected_color),\n mActivity.getResources().getColor(R.color.md_white_1000));\n }\n }", "@Override\n\t\tpublic void handle(MouseEvent event) {\n\t\t\tif(event.getEventType().equals(MouseEvent.MOUSE_CLICKED)){\n\t\t\ttab_01.setTextFill(Color.RED);\n\t\t\ttab_02.setTextFill(Color.BLACK);\n\t\t\ttab_03.setTextFill(Color.BLACK);\n\t\t\ttab_04.setTextFill(Color.BLACK);\n\t\t\ttab_05.setTextFill(Color.BLACK);\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t}", "@Override\r\n\t\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\tprTab.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.grid_selected_bg));\r\n\t\t\t\t\t\t\t\tif(Constants.connect.isConnectingToInternet(context)){\r\n\t\t\t\t\t\t\t\t\tnew RetrievePRList().execute(\"\");\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tToast.makeText(context, Constants.NO_CONNECTION, Toast.LENGTH_LONG).show();\r\n\t\t\t\t\t\t\t\t\tprTab.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.grid_bg));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}", "public void chooseBackgroundColor(){\n currentBackgroundColor = backgroundColorPicker.getValue();\n draw();\n }", "public static void setActiveTab(Tab tab) {\n\n try {\n controller.tabPane.getTabs().add(controller.appointmentTab);\n controller.tabPane.getTabs().add(controller.bookingTab);\n controller.tabPane.getTabs().add(controller.customerTab);\n controller.tabPane.getTabs().add(controller.employeeTab);\n controller.tabPane.getTabs().add(controller.malfunctionTab);\n controller.tabPane.getTabs().add(controller.statisticTab);\n controller.tabPane.getTabs().add(controller.vehicleTab);\n\n SingleSelectionModel<Tab> selectionModel = controller.tabPane.getSelectionModel();\n\n selectionModel.select(tab);\n } catch (NullPointerException e) {\n e.printStackTrace();\n }\n }", "private void setIconSelected(int selectedContainer) {\n int size = mTabHost.getTabWidget().getChildCount();\n for (int i = 0; i < size; i++) {\n View tabView = mTabHost.getTabWidget().getChildAt(i);\n ImageView tabIcon = ((ImageView)(tabView.findViewById(R.id.tabImage)));\n tabIcon.setImageResource(i == selectedContainer ? tabIconsActive[i]:tabIconsIdle[i]);\n }\n }", "@Override\n public void setBackgroundColor(int backgroundColor) {\n }", "private void clearbackground() {\n\t\tfive_direct_single.setBackgroundResource(0);\r\n\t\tfour_direct_single.setBackgroundResource(0);\r\n\t\ttopthree_group_three_single.setBackgroundResource(0);\r\n\t\ttopthree_group_six_single.setBackgroundResource(0);\r\n\t\ttopthree_direct_single.setBackgroundResource(0);\r\n\t\tbottomthree_direct_single.setBackgroundResource(0);\r\n\t\tbottompthree_group_three_single.setBackgroundResource(0);\r\n\t\tbottompthree_group_six_single.setBackgroundResource(0);\r\n\t\ttwo_direct_toptwo_single.setBackgroundResource(0);\r\n\t\ttwo_group_toptwo_single.setBackgroundResource(0);\r\n\t\ttwo_group_bottomtwo_single.setBackgroundResource(0);\r\n\t\ttwo_direct_bottomtwo_single.setBackgroundResource(0);\r\n\t\ttopthree_mix_group.setBackgroundResource(0);\r\n\t\tbottompthree_mix_group.setBackgroundResource(0);\r\n\t\tfive_direct_double.setBackgroundResource(0);\r\n\t\tfive_group_120.setBackgroundResource(0);\r\n\t\tfive_group_60.setBackgroundResource(0);\r\n\t\tfive_group_30.setBackgroundResource(0);\r\n\t\tfive_group_20.setBackgroundResource(0);\r\n\t\tfive_group_10.setBackgroundResource(0);\r\n\t\tfive_group_5.setBackgroundResource(0);\r\n\t\tfour_direct_double.setBackgroundResource(0);\r\n\t\tfour_group_24.setBackgroundResource(0);\r\n\t\tfour_group_12.setBackgroundResource(0);\r\n\t\ttopthree_direct_double.setBackgroundResource(0);\r\n\t\ttopthree_group_three.setBackgroundResource(0);\r\n\t\ttopthree_group_six.setBackgroundResource(0);\r\n\t\ttopthree_group_sum.setBackgroundResource(0);\r\n\t\ttopthree_group_container.setBackgroundResource(0);\r\n\t\tbottomthree_direct_double.setBackgroundResource(0);\r\n\t\tbottomthree_group_span.setBackgroundResource(0);\r\n\t\tbottomthree_group_three.setBackgroundResource(0);\r\n\t\tbottomthree_group_six.setBackgroundResource(0);\r\n\t\tbottomthree_group_sum.setBackgroundResource(0);\r\n\t\tbottomthree_group_container.setBackgroundResource(0);\r\n\t\ttwo_direct_bottomtwo_double.setBackgroundResource(0);\r\n\t\ttwo_direct_bottomtwo_sum.setBackgroundResource(0);\r\n\t\ttwo_direct_bottomtwo_span.setBackgroundResource(0);\r\n\t\ttwo_direct_toptwo_double.setBackgroundResource(0);\r\n\t\ttwo_direct_toptwo_span.setBackgroundResource(0);\r\n\t\ttwo_group_bottomtwo_double.setBackgroundResource(0);\r\n\t\ttwo_group_toptwo_double.setBackgroundResource(0);\r\n\t\tfixed_position.setBackgroundResource(0);\r\n\t\tthree_bottomthree_one_notposition.setBackgroundResource(0);\r\n\t\tthree_bottomthree_two_notposition.setBackgroundResource(0);\r\n\t\tthree_topthree_one_notposition.setBackgroundResource(0);\r\n\t\tthree_topthree_two_notposition.setBackgroundResource(0);\r\n\t\tfour_bottomfour_two_notposition.setBackgroundResource(0);\r\n\t\tfive_bottomfive_two_notposition.setBackgroundResource(0);\r\n\t\tfive_bottomfive_three_notposition.setBackgroundResource(0);\r\n\t\ttwo_group_toptwo_sum.setBackgroundResource(0);\r\n\t\tfour_group_6.setBackgroundResource(0);\r\n\t\tfour_group_4.setBackgroundResource(0);\r\n\t\tbottomthree_direct_sum.setBackgroundResource(0);\r\n\t\ttopthree_direct_sum.setBackgroundResource(0);\r\n\t\ttopthree_direct_span.setBackgroundResource(0);\r\n\t\ttopthree_sum_end.setBackgroundResource(0);\r\n\t\tbottomthree_sum_end.setBackgroundResource(0);\r\n\t\ttwo_direct_toptwo_sum.setBackgroundResource(0);\r\n\t\ttwo_group_toptwo_container.setBackgroundResource(0);\r\n\t\ttwo_group_bottomtwo_container.setBackgroundResource(0);\r\n\t\ttwo_group_bottomtwo_sum.setBackgroundResource(0);\r\n\t\tfour_bottomfour_one_notposition.setBackgroundResource(0);\r\n\t\tmaxmin_bottomtwo.setBackgroundResource(0);\r\n\t\tmaxmin_bottomthree.setBackgroundResource(0);\r\n\t\tmaxmin_toptwo.setBackgroundResource(0);\r\n\t\tmaxmin_topthree.setBackgroundResource(0);\r\n\t}", "private void enableTabPages() {\n // Disables all tabs except the first (the common for all Net Objects)\n for (int i = jTabbedPane1.getTabCount() - 1; i > 0; i--) {\n int tabIndex = i;\n // Enables specific Net Object tab\n if (!IntStream.of(currentTabIndices).anyMatch(x -> x == tabIndex)) {\n this.jTabbedPane1.remove(i);\n }\n }\n }", "private void setTabIcons() {\n\n tabLayout.getTabAt(0).setIcon(R.drawable.selector_icon_target);\n tabLayout.getTabAt(1).setIcon(R.drawable.selector_icon_activity_trend);\n tabLayout.getTabAt(2).setIcon(R.drawable.selector_icon_graph);\n tabLayout.getTabAt(3).setIcon(R.drawable.selector_icon_current_activity);\n }", "public void resetSelected(){\n\t\tfor(int x =0; x<9; x++){\n\t\t\tClientWindow.retButtons()[x].setBackground(Color.LIGHT_GRAY);\n\t\t}\n\t}", "private void setupTabs() {\n }", "@Override\r\n\t\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\t\tpoTab.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.grid_selected_bg));\r\n\t\t\t\t\t\t\t\tif(Constants.connect.isConnectingToInternet(context)){\r\n\t\t\t\t\t\t\t\t\tnew RetrievePOApproval().execute(\"\");\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tToast.makeText(context, Constants.NO_CONNECTION, Toast.LENGTH_LONG).show();\r\n\t\t\t\t\t\t\t\t\tpoTab.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.grid_bg));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}", "private void getColorBackgroundShared() {\n\t\t // get shared preference\n\t\t SharedPreferences readeShared = getSharedPreferences(\"colorBackground\" , MODE_PRIVATE);\n\n\t\t if ( readeShared != null ) {\n\t\t\t String color = readeShared.getString(\"color\" , null);\n\t\t\t if ( color != null && color.length() > 0 ) {\n\t\t\t\t\tif ( color.equals(\"w\") ) {\n\n\t\t\t\t\t\t setBackgroundColor(getResources().getColor(R.color.white) , getResources().getColor(R.color.b2b2b2));\n\n\t\t\t\t\t} else if ( color.equals(\"b\") ) {\n\n\t\t\t\t\t\t setBackgroundColor(getResources().getColor(R.color.b2b2b2) , getResources().getColor(R.color.white));\n\n\t\t\t\t\t}\n\t\t\t }\n\t\t }\n\t }", "public void setSelectedTab(int arg0) {\n\n\t}", "private void setTab() {\n\t\tTabHost.TabSpec showSpec = host.newTabSpec(ShowFragment.TAG);\r\n\t\tshowSpec.setIndicator(showLayout);\r\n\t\tshowSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(showSpec);\r\n\r\n\t\tTabHost.TabSpec addSpec = host.newTabSpec(AddRecordFrag.TAG);\r\n\t\taddSpec.setIndicator(addLayout);\r\n\t\taddSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(addSpec);\r\n\r\n\t\tTabHost.TabSpec chartSpec = host.newTabSpec(ChartShowFrag.TAG);\r\n\t\tchartSpec.setIndicator(chartLayout);\r\n\t\tchartSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(chartSpec);\r\n\t}", "public void undo() {\n TopsoilTabPane topsoilTabPane = (TopsoilTabPane) topsoilTab.getTabPane();\n topsoilTabPane.getTabs().add(topsoilTab);\n }", "private void applyCurrentTheme() {\n TempestatibusApplicationSettings tempestatibusApplicationSettings = getTempestatibusApplicationSettings();\n tempestatibusApplicationSettings.createSharedPreferenceContext(this);\n String theme = tempestatibusApplicationSettings.getAppThemePreference();\n mRefreshImageView.setBackgroundResource(TempestatibusApplicationSettings.getRefreshId());\n mDegreeImageView.setBackgroundResource(TempestatibusApplicationSettings.getLargeDegreeId(theme));\n mDewValueSmallDegree.setBackgroundResource(TempestatibusApplicationSettings.getSmallDegreeId(theme));\n mApparentTemperatureValueSmallDegree.setBackgroundResource(TempestatibusApplicationSettings.getSmallDegreeId(theme));\n mSettingsImageView.setBackgroundResource(TempestatibusApplicationSettings.getSettingsIconId());\n mHourglassIconImageView.setBackgroundResource(TempestatibusApplicationSettings.getHourglassId());\n mSaveIconImageView.setBackgroundResource(TempestatibusApplicationSettings.getSaveIconId());\n mSearchIconImageView.setBackgroundResource(TempestatibusApplicationSettings.getSearchIconId());\n }", "public final void mo39711K() {\n setBackgroundColor(0);\n }", "void setSelectedIndicatorColors(int... colors) {\n customTabColorizer = null;\n defaultTabColorizer.setIndicatorColors(colors);\n invalidate();\n }", "private void setDirtyFlagToTabTitle(Tab tab) {\n String extension = tab.getAttributeAsString(\"Extension\");\n String tabName = tab.getAttributeAsString(\"TabName\");\n\n final Editor editor = (Editor) tab.getAttributeAsObject(EDITOR);\n if (editor != null && editor.isChanged() && tabName.indexOf('*') == -1) {\n tabName = \"*\" + tabName;\n } else if (editor != null && !editor.isChanged() && tabName.indexOf('*') > -1) {\n tabName = tabName.replace(\"*\", \"\");\n }\n if (!tabName.equals(tab.getAttributeAsString(\"TabName\"))) {\n tab.setAttribute(\"TabName\", tabName);\n editorTabSet.setTabTitle(tab, getTabImgTitle(tabName, Extension.getByCode(extension)));\n editorTabSet.markForRedraw();\n }\n if (tab.getAttributeAsObject(\"FileHistoryEditor\") instanceof FileHistoryEditor) {\n editorTabSet.setTabTitle(tab, getHistoryTabImgTitle(tab.getAttributeAsString(\"TabName\")));\n editorTabSet.markForRedraw();\n }\n }", "@Override\r\n\tpublic void setBackgroundResource(int resid) {\n\t\tsuper.setBackgroundResource(resid);\r\n\t}", "void onTabReselected(int position);", "public void setBackground(int index){\r\n\t\tsuper.setBackground(myBackgrounds.get(index));\r\n\t}", "public void cambiarFondobtnPagoTarjeta(){\n btnPagoTarjeta.setBackgroundResource(R.drawable.btn_met_pgo_seleccion);\n btnPagoBancolo.setChecked(false);\n btnPagoNequi.setChecked(false);\n btnPagoPSE.setChecked(false);\n }", "@Source(\"tab_active_bg_l.jpg\")\n\tpublic DataResource tabActiveBackgroundLeftResource();", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.tab);\n mTabHost = getTabHost();\n final TabWidget tabWidget = mTabHost.getTabWidget();\n tabWidget.setStripEnabled(false);// 圆角边线不启用\n //添加n个tab选项卡,定义他们的tab名,指示名,目标屏对应的类\n mTabHost.addTab(mTabHost.newTabSpec(\"TAG1\").setIndicator(\"0\").setContent(new Intent(this, SearchActivity.class)));\n mTabHost.addTab(mTabHost.newTabSpec(\"TAG2\").setIndicator(\"1\").setContent(new Intent(this, MapActivity.class)));\n mTabHost.addTab(mTabHost.newTabSpec(\"TAG3\").setIndicator(\"2\").setContent(new Intent(this, MyActivity.class)));\n // 视觉上,用单选按钮替代TabWidget\n main_radio = (RadioGroup) findViewById(R.id.main_radio);\n tab_icon_weixin = (RadioButton) findViewById(R.id.tab_icon_weixin);\n tab_icon_address = (RadioButton) findViewById(R.id.tab_icon_address);\n tab_icon_find = (RadioButton) findViewById(R.id.tab_icon_find);\n main_radio.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(RadioGroup group, int id) {\n if (id == tab_icon_weixin.getId()) {\n mTabHost.setCurrentTab(0);\n } else if (id == tab_icon_address.getId()) {\n mTabHost.setCurrentTab(1);\n } else if (id == tab_icon_find.getId()) {\n mTabHost.setCurrentTab(2);\n }\n }\n });\n\n // 设置当前显示哪一个标签\n mTabHost.setCurrentTab(0);\n // 遍历tabWidget每个标签,设置背景图片 无\n for (int i = 0; i < tabWidget.getChildCount(); i++) {\n View vv = tabWidget.getChildAt(i);\n vv.getLayoutParams().height = 45;\n // vv.getLayoutParams().width = 65;\n vv.setBackgroundDrawable(null);\n }\n // findViewById(R.id.tab_icon_brand).setOnClickListener(this);\n }", "public void clean() {\n \tfor(int f=0; f<NUMCARTAS;f++) \n \tfor(int c=0; c<NUMCARTAS;c++) {\n \t\ttablero[f][c].setSelected(false);\n\t \t \t//Devuelve al color original\n\t if(tablero[f][c].getText().length()==2) tablero[f][c].setBackground(colorDiagonal);\n\t else if(tablero[f][c].getText().charAt(2)=='s') tablero[f][c].setBackground(colorSuited);\n\t else tablero[f][c].setBackground(colorOffsuited);\n \t}\n }", "public void setBackgroundToDefault(){\n\t\tcurrentBackgroundImage = defaultBackgroundImage;\n\t\tbackgroundPanel.changeBackground(defaultBackgroundImage);\n\t}", "private void resetBackgrounds(){\n for(int y = 1; y <= rowCount; y++){\n for(int x = 1; x <= columnCount; x++){\n rootView.findViewById(Integer.parseInt(\"10\" + x + \"00\" + y)).findViewById(R.id.third_list_value).setBackgroundResource(R.drawable.white_off_shape);\n }\n }\n }", "@Override\n\tpublic void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n\t\tmViewPager.setCurrentItem(tab.getPosition());\n\t\ttab.setIcon(mAppSectionsPagerAdapter.getPageIconSelected(tab.getPosition()));\n\n\t}", "public void setDefaultTab() {\r\n\t\t\tgetActionBar().selectTab(getActionBar().getTabAt(CLASSIFICATION_TAB_INDEX));\t\r\n\t\t}", "@Override\n\tpublic void onTabChange() {\n\t\tthis.reset();\n\t}", "@SuppressLint(\"NewApi\")\n\tprivate void changeActionBarBackground() {\n\t\tif (AppStartupManager.getTopbarStylingInfoBean() != null) {\n\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\tActionBarStylingInfoBean stylingInfoBean = AppStartupManager.getTopbarStylingInfoBean();\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t// Only the background of the Action bar needs to be set\n\t\t\t\t\t// using\n\t\t\t\t\t// the information in the topbar styling info bean\n\t\t\t\t\tif (stylingInfoBean.getTopbarBgType().equalsIgnoreCase(SmartConstants.TOPBAR_BG_TYPE_COLOR)) {\n\t\t\t\t\t\tactionbar.setBackgroundDrawable(new ColorDrawable(Color.parseColor(stylingInfoBean.getTopbarBgColor())));\n\t\t\t\t\t} else if (stylingInfoBean.getTopbarBgType().equalsIgnoreCase(SmartConstants.TOPBAR_BG_TYPE_IMAGE)) {\n\t\t\t\t\t\t// set the background image for action bar\n\t\t\t\t\t\tactionbar.setBackgroundDrawable(AppUtility.getDrawableForId(AppUtility.getResourseIdByName(getApplicationContext().getPackageName(), \"drawable\",\n\t\t\t\t\t\t\t\tstylingInfoBean.getTopbarBgImage())));\n\t\t\t\t\t} else if (stylingInfoBean.getTopbarBgType().equalsIgnoreCase(SmartConstants.TOPBAR_BG_TYPE_GRADIENT)) {\n\t\t\t\t\t\tactionbar.setBackgroundDrawable(AppUtility.createBgGradient(stylingInfoBean.getTopbarBgGradientType(), stylingInfoBean.getTopbarBgGradient()));\n\t\t\t\t\t}\n\n\t\t\t\t\tLog.d(SmartConstants.APP_NAME, \"SmartViewActivity->changeActionBarBackground->topbar text color:\" + Color.parseColor(stylingInfoBean.getTopbarTextColor()));\n\t\t\t\t\ttopbarTextColor = stylingInfoBean.getTopbarTextColor();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "@Override\n\tpublic Tab getSelectedTab() {\n\t\treturn null;\n\t}", "@Override\n\tpublic WebElement getTabBarUnderline() {\n\t\treturn null;\n\t}", "private void changeTab(int tabIndex) {\n if (tabIndex == 0){\n showNav();\n tabHost.setCurrentTab(0);\n radioGroup.clearCheck();\n }\n else {\n if (tabHost.getCurrentTab() == tabIndex) {\n // dong filter tab -> main tab\n showNav();\n tabHost.setCurrentTab(0);\n radioGroup.clearCheck();\n } else {\n // mo filter tab\n hideNav();\n tabHost.setCurrentTab(tabIndex);\n }\n }\n }", "void putTabLayer(long nativeTabListSceneLayer, TabListSceneLayer caller, int selectedId,\n int toolbarResourceId, int shadowResourceId, int contourResourceId,\n int borderResourceId, int borderInnerShadowResourceId, boolean canUseLiveLayer,\n int tabBackgroundColor, boolean incognito, float x, float y, float width,\n float height, float contentWidth, float contentHeight, float shadowWidth,\n float shadowHeight, float alpha, float borderAlpha, float borderInnerShadowAlpha,\n float contourAlpha, float shadowAlpha, float staticToViewBlend, float borderScale,\n float saturation, boolean showToolbar, int defaultThemeColor,\n int toolbarBackgroundColor, boolean anonymizeToolbar, int toolbarTextBoxResource,\n int toolbarTextBoxBackgroundColor, float toolbarYOffset, float contentOffset);", "public void changeToStandard(){\n drawAttributeManager.toggleStandardView();\n getContentPane().setBackground(DrawAttribute.whiteblue);\n canvas.repaint();\n }", "static void setCurrentSettingTab(int currentIdx) {\n currentSettingTab = currentIdx;\n }", "private void initTab()\n {\n \n }", "@Override\n\tpublic void selectTab(Tab tab) {\n\t\t\n\t}", "@Override\n public GralColor setBackgroundColor(GralColor color)\n {\n return null;\n }", "@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.tab_home:\n setHome();\n break;\n case R.id.tab_store:\n this.mIconHome.setImageResource(R.drawable.home_icon_home);\n this.mIconStore.setImageResource(R.drawable.home_icon_store_press);\n this.mIconCart.setImageResource(R.drawable.home_icon_cart);\n this.mIconMy.setImageResource(R.drawable.home_icon_my);\n this.mHomeText.setTextColor(getResources().getColor(R.color.content_gray));\n this.mStoreText.setTextColor(getResources().getColor(R.color.pink));\n this.mCartText.setTextColor(getResources().getColor(R.color.content_gray));\n this.mMyText.setTextColor(getResources().getColor(R.color.content_gray));\n\n getTabHost().setCurrentTab(1);\n break;\n case R.id.tab_cart_layout:\n setCart();\n break;\n case R.id.tab_my_outer:\n this.mIconHome.setImageResource(R.drawable.home_icon_home);\n this.mIconStore.setImageResource(R.drawable.home_icon_store);\n this.mIconCart.setImageResource(R.drawable.home_icon_cart);\n this.mIconMy.setImageResource(R.drawable.home_icon_my_press);\n this.mHomeText.setTextColor(getResources().getColor(R.color.content_gray));\n this.mStoreText.setTextColor(getResources().getColor(R.color.content_gray));\n this.mCartText.setTextColor(getResources().getColor(R.color.content_gray));\n this.mMyText.setTextColor(getResources().getColor(R.color.pink));\n\n getTabHost().setCurrentTab(3);\n break;\n default:\n break;\n }\n }", "public void tabChange() {\r\n\t}", "private void addTabs() {\n TabsPagerAdapter tabsAdapter = new TabsPagerAdapter(getSupportFragmentManager());\n viewPager = (ViewPager) findViewById(R.id.pager);\n viewPager.setAdapter(tabsAdapter);\n\n TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout);\n tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);\n tabLayout.setupWithViewPager(viewPager);\n\n tabLayout.getTabAt(0).setIcon(R.drawable.connect);\n tabLayout.getTabAt(1).setIcon(R.drawable.speak);\n tabLayout.getTabAt(2).setIcon(R.drawable.walk);\n tabLayout.getTabAt(3).setIcon(R.drawable.camera);\n tabLayout.getTabAt(4).setIcon(R.drawable.moves);\n }", "public void tabSelected();", "@Override\n\tpublic void removeAllTabs() {\n\t\t\n\t}", "private void changeUIToDessert() {\n changeHeaderIcon(false);\n ColorHelper.changeViewColor(mScrimView, ContextCompat.getColor(getActivity(), R.color.colorPrimary), ContextCompat.getColor(getActivity(), R.color.secondaryColor));\n mBottomBar.setBackgroundTint(ContextCompat.getColorStateList(getActivity(), R.color.secondaryColor));\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);\n getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getActivity(), R.color.secondaryDarkColor));\n }\n }", "@Override\n\tpublic JTabbedPane initTabs() {\n\t\treturn null;\n\t}", "private void disableTabs()\n {\n tab_MasterLog.setSelectedIndex(0);\n tab_InventoryLog.setSelectedIndex(0);\n tab_OperationLog.setSelectedIndex(0);\n }", "@Override\n public void onClick(View v) {\n ButtonRectangle btn = (ButtonRectangle) v;\n SharedPreferences sp = getUserPref();\n String currentColor = sp.getString(BaseActivity.SF_THEME_COLOR, \"Teal\");\n if (currentColor.equals(btn.getText()))\n return;\n SharedPreferences.Editor editor = sp.edit();\n editor.putString(BaseActivity.SF_THEME_COLOR, btn.getText());\n editor.apply();\n getActivity().finish();\n startActivity(getActivity().getIntent());\n// android.os.Process.killProcess(android.os.Process.myPid());\n }", "public void setTheme(){\r\n\r\n for (int i = 0; i < 3; i++) {\r\n\r\n buttons[i].setBackground(theme.getButtonTheme()[0][0]);\r\n buttons[i].setForeground(theme.getButtonTheme()[0][1]);\r\n\r\n if(i < 2) {\r\n\r\n panels[i].setBackground(theme.getBackGroundTheme()[0]);\r\n\r\n }\r\n\r\n }\r\n\r\n menuBars[0].setBackground(theme.getInsomniaTheme()[0]);\r\n\r\n menus[0].setForeground(theme.getInsomniaTheme()[1]);\r\n\r\n buttons[0].setIcon(new ImageIcon(theme.getAddressIcons()+\"icons8_list_30px.png\"));\r\n\r\n buttons[1].setIcon(new ImageIcon(theme.getAddressIcons()+\"icons8_sort_down_10px.png\"));\r\n\r\n buttons[2].setIcon(new ImageIcon(theme.getAddressIcons()+\"icons8_sort_down_&&_plus_25px.png\"));\r\n\r\n menus[2].getItem(0).setIcon(new ImageIcon(theme.getAddressIcons()+\"icons8_joyent_15px.png\"));\r\n menus[2].getItem(1).setIcon(new ImageIcon(theme.getAddressIcons()+\"icons8_doctors_folder_15px.png\"));\r\n\r\n filter.setBackground(theme.getTextFieldTheme()[0][0]);\r\n filter.setForeground(theme.getTextFieldTheme()[0][1]);\r\n\r\n }", "protected void hideTabs() {\r\n\t\tif (getPageCount() <= 1) {\r\n\t\t\tsetPageText(0, \"\");\r\n\t\t\tif (getContainer() instanceof CTabFolder) {\r\n\t\t\t\t((CTabFolder) getContainer()).setTabHeight(1);\r\n\t\t\t\tPoint point = getContainer().getSize();\r\n\t\t\t\tgetContainer().setSize(point.x, point.y + 6);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setSelectedTab(int tab) {\n if ((tabbedPane.getTabCount() - 1) >= tab)\n tabbedPane.setSelectedIndex(tab);\n }", "public void setDeffectSection() {\n linearLayoutBottomButtons.setVisibility(View.VISIBLE);\n scroolViewScanner.setVisibility(View.GONE);\n scroolViewDefect.setVisibility(View.VISIBLE);\n linLayOverView.setVisibility(View.GONE);\n scroolViewSharWin.setVisibility(View.GONE);\n\n // set buttons background\n buttonBarScaner.setBackgroundColor(ContextCompat.getColor(ActivityScreans.this, R.color.colorBackgroundGray200));\n buttonBarScaner.setTextColor(ContextCompat.getColor(ActivityScreans.this, R.color.colorBlack));\n buttonBarDefect.setBackgroundColor(ContextCompat.getColor(ActivityScreans.this, R.color.colorPrimaryDarkBlue900));\n buttonBarDefect.setTextColor(ContextCompat.getColor(ActivityScreans.this, R.color.colorWhite));\n buttonBarOverView.setBackgroundColor(ContextCompat.getColor(ActivityScreans.this, R.color.colorBackgroundGray200));\n buttonBarOverView.setTextColor(ContextCompat.getColor(ActivityScreans.this, R.color.colorBlack));\n buttonBarShareWin.setBackgroundColor(ContextCompat.getColor(ActivityScreans.this, R.color.colorBackgroundGray200));\n buttonBarShareWin.setTextColor(ContextCompat.getColor(ActivityScreans.this, R.color.colorBlack));\n }", "private void changesetTabSelection(int i) {\n\t\tif (i == 1)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_direct_double_name));\r\n\t\t}\r\n\t\tif (i == 2)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_group_120_name));\r\n\t\t}\r\n\t\tif (i == 3)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_group_60_name));\r\n\t\t}\r\n\t\tif (i == 4)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_group_30_name));\r\n\t\t}\r\n\t\tif (i == 5)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_group_20_name));\r\n\t\t}\r\n\t\tif (i == 6)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_group_10_name));\r\n\t\t}\r\n\t\tif (i == 7)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_group_5_name));\r\n\t\t}\r\n\t\tif (i == 8)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_direct_double_name));\r\n\t\t}\r\n\t\tif (i == 9)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_group_24_name));\r\n\t\t}\r\n\t\tif (i == 10)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_group_12_name));\r\n\t\t}\r\n\t\tif (i == 11)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_direct_double_name));\r\n\t\t}\r\n\t\tif (i == 12)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_group_three_name));\r\n\t\t}\r\n\t\tif (i == 13)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_group_six_name));\r\n\t\t}\r\n\t\tif (i == 14)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_group_sum_name));\r\n\t\t}\r\n\t\tif (i == 15)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_group_container_name));\r\n\t\t}\r\n\t\tif (i == 16)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_direct_double_name));\r\n\t\t}\r\n\t\tif (i == 17)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_group_span_name));\r\n\t\t}\r\n\t\tif (i == 18)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_group_three_name));\r\n\t\t}\r\n\t\tif (i == 19)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_group_six_name));\r\n\t\t}\r\n\t\tif (i == 20)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_group_sum_name));\r\n\t\t}\r\n\t\tif (i == 21)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_group_container_name));\r\n\t\t}\r\n\t\tif (i == 22)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_bottomtwo_double_name));\r\n\t\t}\r\n\t\tif (i == 23)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_bottomtwo_sum_name));\r\n\t\t}\r\n\t\tif (i == 24)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_bottomtwo_span_name));\r\n\t\t}\r\n\t\tif (i == 25)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_toptwo_double_name));\r\n\t\t}\r\n\t\tif (i == 26)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_toptwo_span_name));\r\n\t\t}\r\n\t\tif (i == 27)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_bottomtwo_double_name));\r\n\t\t}\r\n\t\tif (i == 28)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_toptwo_double_name));\r\n\t\t}\r\n\t\tif (i == 29)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.fixed_position_name));\r\n\t\t}\r\n\t\tif (i == 30)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.three_bottomthree_one_notposition_name));\r\n\t\t}\r\n\t\tif (i == 31)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.three_bottomthree_two_notposition_name));\r\n\t\t}\r\n\t\tif (i == 32)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.three_topthree_one_notposition_name));\r\n\t\t}\r\n\t\tif (i == 33)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.three_topthree_two_notposition_name));\r\n\t\t}\r\n\t\tif (i == 34)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_bottomfour_two_notposition_name));\r\n\t\t}\r\n\t\tif (i == 35)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_bottomfive_two_notposition_name));\r\n\t\t}\r\n\t\tif (i == 36)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_bottomfive_three_notposition_name));\r\n\t\t}\r\n\t\tif (i == 37)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_toptwo_sum_name));\r\n\t\t}\r\n\t\tif (i == 38)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_group_6_name));\r\n\t\t}\r\n\t\tif (i == 39)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_group_4_name));\r\n\t\t}\r\n\t\tif (i == 40)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_direct_sum_name));\r\n\t\t}\r\n\t\tif (i == 41)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_direct_sum_name));\r\n\t\t}\r\n\t\tif (i == 42)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_direct_span_name));\r\n\t\t}\r\n\t\tif (i == 43)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_sum_end_name));\r\n\t\t}\r\n\t\tif (i == 44)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_sum_end_name));\r\n\t\t}\r\n\t\tif (i == 45)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_toptwo_sum_name));\r\n\t\t}\r\n\t\tif (i == 46)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_toptwo_container_name));\r\n\t\t}\r\n\t\tif (i == 47)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_bottomtwo_container_name));\r\n\t\t}\r\n\t\tif (i == 48)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_bottomtwo_sum_name));\r\n\t\t}\r\n\t\tif (i == 49)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_bottomfour_one_notposition_name));\r\n\t\t}\r\n\t\tif (i == 50)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.maxmin_bottomtwo_name));\r\n\t\t}\r\n\t\tif (i == 51)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.maxmin_bottomthree_name));\r\n\t\t}\r\n\t\tif (i == 52)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.maxmin_toptwo_name));\r\n\t\t}\r\n\t\tif (i == 53)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.maxmin_topthree_name));\r\n\t\t}\r\n\t\tif (i == 54)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_direct_single_name));\r\n\t\t}\r\n\t\tif (i == 55)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_direct_single_name));\r\n\t\t}\r\n\t\tif (i == 56)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_group_three_single_name));\r\n\t\t}\r\n\t\tif (i == 57)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_group_six_single_name));\r\n\t\t}\r\n\t\tif (i == 58)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_direct_single_name));\r\n\t\t}\r\n\t\tif (i == 59)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_direct_single_name));\r\n\t\t}\r\n\t\tif (i == 60)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottompthree_group_three_single_name));\r\n\t\t}\r\n\t\tif (i == 61)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottompthree_group_six_single_name));\r\n\t\t}\r\n\t\tif (i == 62)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_toptwo_single_name));\r\n\t\t}\r\n\t\tif (i == 63)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_toptwo_single_name));\r\n\t\t}\r\n\t\tif (i == 64)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_bottomtwo_single_name));\r\n\t\t}\r\n\t\tif (i == 65)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_bottomtwo_single_name));\r\n\t\t}\r\n\t\tif (i == 66)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_mix_group_name));\r\n\t\t}\r\n\t\tif (i == 67)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottompthree_mix_group_name));\r\n\t\t}\r\n\t\twrite(i);\r\n\t}", "private void initBackgroundColorClick() {\n\t\tRadioGroup rgBackgroundColor = (RadioGroup) findViewById(R.id.radioGroup3);\n\t\trgBackgroundColor.setOnCheckedChangeListener(new OnCheckedChangeListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onCheckedChanged(RadioGroup arg0, int arg1) {\n\n\t\t\t\tScrollView sv = (ScrollView) findViewById(R.id.scrollView);\n\n\t\t\t\tswitch (arg1) {\n\t\t\t\t\tcase R.id.radioGreen: {\n\t\t\t\t\t\tgetSharedPreferences(\"MyContactListPreferences\", Context.MODE_PRIVATE).edit().putString(\"bgcolor\", \"green\").commit();\n\t\t\t\t\t\tsv.setBackgroundResource(R.color.green);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase R.id.radioPink: {\n\t\t\t\t\t\tgetSharedPreferences(\"MyContactListPreferences\", Context.MODE_PRIVATE).edit().putString(\"bgcolor\", \"pink\").commit();\n\t\t\t\t\t\tsv.setBackgroundResource(R.color.pink);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase R.id.radioBlue: {\n\t\t\t\t\t\tgetSharedPreferences(\"MyContactListPreferences\", Context.MODE_PRIVATE).edit().putString(\"bgcolor\", \"blue\").commit();\n\t\t\t\t\t\tsv.setBackgroundResource(R.color.blue);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void forceChangeSelectionToWidget(ITabDescriptor tab) {\n\t\tint index = -1;\n\t\tfor (int i = 0; i < elements.size(); i++) {\n\t\t\tif (elements.get(i).getId().equals(tab.getId())) {\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\tAssert.isTrue(index != -1, \"Could not set the selected tab in the tabbed property viewer\");//$NON-NLS-1$\n\t\tlist.select(index);\n\t}" ]
[ "0.69295955", "0.68757236", "0.6849606", "0.6843681", "0.6651098", "0.6532578", "0.6434188", "0.61832696", "0.60960525", "0.6031405", "0.60122013", "0.58684903", "0.58558005", "0.5848347", "0.5838734", "0.57914644", "0.57671887", "0.57455665", "0.5743979", "0.57244617", "0.5722974", "0.5654917", "0.56433094", "0.5632926", "0.5585137", "0.5584605", "0.55721635", "0.55593574", "0.5556567", "0.55464906", "0.5527219", "0.5511416", "0.55070823", "0.55065966", "0.5504548", "0.5499761", "0.5472501", "0.5462411", "0.5460321", "0.54465467", "0.54460937", "0.54312235", "0.54297304", "0.5426432", "0.54249763", "0.54217017", "0.54065186", "0.54032445", "0.5403157", "0.5399963", "0.5385224", "0.5369454", "0.5339675", "0.5338894", "0.53351873", "0.5318388", "0.5288899", "0.5280967", "0.52784735", "0.5271164", "0.52513164", "0.5241102", "0.5240075", "0.5234932", "0.52280426", "0.5225774", "0.52243054", "0.52191156", "0.52139103", "0.5207914", "0.5202609", "0.5199724", "0.519123", "0.51908654", "0.51849425", "0.5160029", "0.5157074", "0.51486135", "0.51460284", "0.51416695", "0.5140332", "0.513314", "0.5131492", "0.5128527", "0.512844", "0.5126174", "0.51245683", "0.5123385", "0.5122551", "0.5122231", "0.5120074", "0.5103007", "0.51003337", "0.50920063", "0.5091309", "0.5089824", "0.5082725", "0.508135", "0.5078857", "0.50753456" ]
0.64763284
6
mapPanel could be null;
protected void initMap(Location location, SimplePanel mapPanel) { GWT.log("initMap"); if (location == null) { mapWidget = new MapWidget(); } else { LatLng latLng = LatLng.newInstance(location.getLatitude(), location.getLongitude()); mapWidget = new MapWidget(latLng, 15); reverseGeocode(latLng, null); Marker marker = new Marker(latLng); mapWidget.addOverlay(marker); } mapWidget.setSize("840px", "600px"); mapWidget.setUIToDefault(); MapUIOptions opts = mapWidget.getDefaultUI(); opts.setDoubleClick(false); mapWidget.setUI(opts); mapWidget.addMapClickHandler(new MapClickHandler() { public void onClick(MapClickEvent e) { Overlay overlay = e.getOverlay(); LatLng point = e.getLatLng(); if (overlay != null && overlay instanceof Marker) { // no point if we click on marker } else { mywebapp.setAutoGps(false); //this is a callback reverseGeocode(point, afterGeocodeCallback); } } }); //mapWidget.checkResize(); //if (mapPanel != null) { mapPanel.setWidget(mapWidget); // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public GridMapPanel() {\n super();\n initialize();\n }", "public PanelMapDrug() {\n initComponents();\n }", "@Override\n public MapLocation getMap() {\n return null;\n }", "public MapPanel() {\r\n\t\tthis(EarthFlat.class);\r\n\t}", "public MapPanel(String map, Object[] toLoad) {\n\t\tthis.setLayout(null);\n\t\tthis.setBackground(Color.white);\n\t\tthis.setPreferredSize(new Dimension(WIDTH, HEIGHT));\n\t\tthis.setSize(this.getPreferredSize());\n\t\tthis.setVisible(true);\n\t\tthis.setFocusable(true);\n\t\tthis.requestFocus();\n\t\ttheMap = new Map(map, 50);\n\t\ttheTrainer = new Trainer(theMap, toLoad);\n\n\t\tinBattle = false;\n\t}", "private void setUpMapIfNeeded() {\n if (map == null) {\n map = fragMap.getMap();\n if (map != null) {\n setUpMap();\n }\n }\n }", "public void onStartup()\n/* 359: */ {\n/* 360:438 */ super.onStartup();\n/* 361: */ \n/* 362:440 */ this.mapPanel.addMouseListener(new MouseAdapter()\n/* 363: */ {\n/* 364: */ public void mouseClicked(MouseEvent e)\n/* 365: */ {\n/* 366:443 */ if (e.getButton() == 1)\n/* 367: */ {\n/* 368:444 */ Point p = e.getPoint();\n/* 369:445 */ if ((TileGIS.this.mapPanel.courtesyBounds != null) && (TileGIS.this.mapPanel.courtesyBounds.contains(p)))\n/* 370: */ {\n/* 371:446 */ TileGIS.this.getPresentation().openWebSite(TileGIS.this.mapPanel.tip.courtesyLnk);\n/* 372: */ }\n/* 373:447 */ else if ((TileGIS.this.mapPanel.courtesyImgBounds != null) && (TileGIS.this.mapPanel.courtesyImgBounds.contains(p)))\n/* 374: */ {\n/* 375:448 */ TileGIS.this.getPresentation().openWebSite(TileGIS.this.mapPanel.tip.courtesyLnk);\n/* 376: */ }\n/* 377: */ else\n/* 378: */ {\n/* 379:451 */ Point mP = TileGIS.this.mapPanel.panelToMap(p);\n/* 380:452 */ double lon = MercatorProj.XtoLon(mP.x, TileGIS.this.mapPanel.zoom);\n/* 381:453 */ double lat = MercatorProj.YtoLat(mP.y, TileGIS.this.mapPanel.zoom);\n/* 382:454 */ TileGIS.this.onClick(lat, lon);\n/* 383: */ }\n/* 384: */ }\n/* 385: */ }\n/* 386:458 */ });\n/* 387:459 */ getPresentation().getPanel().addContainerListener(new ContainerListener()\n/* 388: */ {\n/* 389: */ public void componentAdded(ContainerEvent e)\n/* 390: */ {\n/* 391:461 */ if (e.getChild() == TileGIS.this.placeholder.getJComponent()) {\n/* 392:462 */ TileGIS.this.getPresentation().getPanel().add(TileGIS.this.mapPanel);\n/* 393: */ }\n/* 394: */ }\n/* 395: */ \n/* 396: */ public void componentRemoved(ContainerEvent e)\n/* 397: */ {\n/* 398:467 */ if (e.getChild() == TileGIS.this.placeholder.getJComponent()) {\n/* 399:468 */ TileGIS.this.getPresentation().getPanel().remove(TileGIS.this.mapPanel);\n/* 400: */ }\n/* 401: */ }\n/* 402:472 */ });\n/* 403:473 */ this.placeholder.getJComponent().addComponentListener(new ComponentListener()\n/* 404: */ {\n/* 405: */ public void componentShown(ComponentEvent e) {}\n/* 406: */ \n/* 407: */ public void componentHidden(ComponentEvent e) {}\n/* 408: */ \n/* 409: */ public void componentResized(ComponentEvent e)\n/* 410: */ {\n/* 411:478 */ TileGIS.this.mapPanel.setSize(TileGIS.this.placeholder.getJComponent().getSize());\n/* 412: */ }\n/* 413: */ \n/* 414: */ public void componentMoved(ComponentEvent e)\n/* 415: */ {\n/* 416:482 */ TileGIS.this.mapPanel.setLocation(TileGIS.this.placeholder.getJComponent().getLocation());\n/* 417: */ }\n/* 418: */ });\n/* 419: */ }", "private void setUpMapIfNeeded() {\n \tif (mMap == null) {\r\n \t\t//Instanciamos el objeto mMap a partir del MapFragment definido bajo el Id \"map\"\r\n \t\tmMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();\r\n \t\t// Chequeamos si se ha obtenido correctamente una referencia al objeto GoogleMap\r\n \t\tif (mMap != null) {\r\n \t\t\t// El objeto GoogleMap ha sido referenciado correctamente\r\n \t\t\t//ahora podemos manipular sus propiedades\r\n \t\t\t//Seteamos el tipo de mapa\r\n \t\t\tmMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\r\n \t\t\t//Activamos la capa o layer MyLocation\r\n \t\t\tmMap.setMyLocationEnabled(true);\r\n \t\t\t\r\n \t\t\tAgregarPuntos();\r\n \t\t\t\r\n \t\t\t\r\n \t\t}\r\n \t}\r\n }", "public MapPanel() {\n painter = NONE_PAINTER;\n setBackground(BACKGROUND_COLOR);\n mapBounds = new Rectangle2D.Double(0, 0, MIN_WIDTH, MIN_HEIGHT);\n mouseClick = SwingObservable.mouse(this, SwingObservable.MOUSE_CLICK)\n .toFlowable(BackpressureStrategy.LATEST)\n .filter(ev -> ev.getID() == MouseEvent.MOUSE_CLICKED)\n .map(this::mapMouseEvent);\n logger.atDebug().log(\"Created\");\n }", "public void showMapTypePanel(){\n mapTypePanel.showMapTypePanel();\n if(mapTypePanel.isVisible() && optionsPanel.isVisible()){\n optionsPanel.setVisible(false);\n if(iconPanel.isVisible()) iconPanel.setVisible(false);\n }\n if(routePanel.isVisible()) routePanel.setVisible(false); closeDirectionList();\n canvas.repaint();\n }", "public MAPVIEW() {\n initComponents();\n }", "@Override\n public void onMapLoaded() {\n mMap.animateCamera(cu);\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n\n\n }", "public Container getMapa() {\n\t\treturn panelJuego;\n\t}", "private void setupMap() {\n int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext());\n \t\tif ( status != ConnectionResult.SUCCESS ) {\n \t\t\t// Google Play Services are not available.\n \t\t\tint requestCode = 10;\n \t\t\tGooglePlayServicesUtil.getErrorDialog( status, this, requestCode ).show();\n \t\t} else {\n \t\t\t// Google Play Services are available.\n \t\t\tif ( this.googleMap == null ) {\n \t\t\t\tFragmentManager fragManager = this.getSupportFragmentManager();\n \t\t\t\tSupportMapFragment mapFrag = (SupportMapFragment) fragManager.findFragmentById( R.id.edit_gpsfilter_area_google_map );\n \t\t\t\tthis.googleMap = mapFrag.getMap();\n \n \t\t\t\tif ( this.googleMap != null ) {\n \t\t\t\t\t// The Map is verified. It is now safe to manipulate the map.\n \t\t\t\t\tthis.configMap();\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public void removeAllOverlayObj()\n/* 91: */ {\n/* 92:146 */ this.mapPanel.removeAllOverlayObj();\n/* 93: */ }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap();\n }\n }\n }", "private void setUpMap() {\n mMap.getUiSettings().setZoomControlsEnabled(false);\n \n // Setting an info window adapter allows us to change the both the\n // contents and look of the\n // info window.\n mMap.setInfoWindowAdapter(new CustomInfoWindowAdapter(getLayoutInflater()));\n \n // Add lots of markers to the map.\n addMarkersToMap();\n \n }", "private void setUpMapIfNeeded() {\r\n if (map == null) {\r\n SupportMapFragment smf = null;\r\n smf = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);\r\n\r\n if (smf != null) {\r\n map = smf.getMap();\r\n if (map != null) {\r\n map.setMyLocationEnabled(true);\r\n }\r\n }\r\n }\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n }", "void setMapChanged();", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mapView2))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap( lat, longi, \"ISS/ NUS\");\n }\n }\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\r\n // Try to obtain the map from the SupportMapFragment.\r\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\r\n .getMap();\r\n // Check if we were successful in obtaining the map.\r\n if (mMap != null) {\r\n setUpMap();\r\n }\r\n }\r\n }", "public MapGUI_JPanel() {\n initComponents();\n initComponents1();\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()\n .findFragmentById(R.id.map);\n mapFragment.getMapAsync(this);\n }\n }", "private void setUpMap() {\n mMap.setMyLocationEnabled(true);\n }", "private void setUpMapIfNeeded() {\n if ( googleMap == null) {\r\n\r\n // Try to obtain the map from the SupportMapFragment.\r\n googleMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.routesMap)).getMap();\r\n // Check if we were successful in obtaining the map.\r\n if (googleMap != null) {\r\n setUpMap();\r\n }\r\n }\r\n }", "@Override\n /***** Sets up the map if it is possible to do so *****/\n public boolean setUpMapIfNeeded() {\n super.setUpMapIfNeeded();\n if (mMap != null) {\n //Shows history popover on marker clicks\n mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {\n @Override\n public boolean onMarkerClick(Marker marker) {\n showPopup(getContentFromMarker(marker), marker.getTitle());\n return true;\n }\n });\n return true;\n } else {\n return false;\n }\n }", "public WindowShiftMap() {\n initComponents();\n }", "private void initMap(){\n SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()\n .findFragmentById(R.id.map);\n mapFragment.getMapAsync(this);\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap){\n mMap = googleMap;\n }", "private void initUI() {\t\t\n\t\t\n\t\t/* Get a handle to the Map Fragment and to \n\t\t * the Map object */\t\t\t\t\n\t\tmvMap = ((MapFragment) getFragmentManager()\n\t\t\t\t.findFragmentById(R.id.frMap)).getMap();\n\t\t\n\t\t/* Enables the my-location layer in the map */\n\t\tmvMap.setMyLocationEnabled(true);\n\t\t\n\t\t/* Disable my-location button */\n\t\tmvMap.getUiSettings().setMyLocationButtonEnabled(false);\n\t\t\n\t}", "private void initializeMap() {\n // - Map -\n map = (MapView) this.findViewById(R.id.map);\n //map.setBuiltInZoomControls(true);\n map.setMultiTouchControls(true);\n map.setMinZoomLevel(16);\n // Tiles for the map, can be changed\n map.setTileSource(TileSourceFactory.MAPNIK);\n\n // - Map controller -\n IMapController mapController = map.getController();\n mapController.setZoom(19);\n\n // - Map overlays -\n CustomResourceProxy crp = new CustomResourceProxy(getApplicationContext());\n currentLocationOverlay = new DirectedLocationOverlay(this, crp);\n\n map.getOverlays().add(currentLocationOverlay);\n\n // - Location -\n locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n if(locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER) != null) {\n onLocationChanged(locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER));\n }\n else if (locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER) != null) {\n onLocationChanged(locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER));\n }\n else {\n currentLocationOverlay.setEnabled(false);\n }\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMapFragment = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.fragment_show_place_info_map));\n mMap = mMapFragment.getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap();\n }\n }\n }", "private void buildPanelEast() {\n\r\n }", "private void initViews(){\n map = findViewById(R.id.map);\n }", "private void setUpMapIfNeeded() {\n // Do a null check to confirm that we have not already instantiated the map.\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\n .getMap();\n mMap.setOnMarkerDragListener(this);\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap();\n }\n }\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap();\n }\n }\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap();\n }\n }\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap();\n }\n }\n }", "@Override\n protected void setUpMap() {\n super.setUpMap();\n // For showing a move to my location button and a blue\n // dot to show user's location\n MainActivity mainActivity = (MainActivity) getActivity();\n mMap.setMyLocationEnabled(mainActivity.checkIfGPSEnabled());\n }", "@Override\n public void onMapLoaded() {\n mGoogleMap.animateCamera(cu);\n }", "private void setUpMap() {\n if (points.size()>2) {\n drawCircle();\n }\n\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n googleMap.getUiSettings().setMapToolbarEnabled(false);\n googleMap.getUiSettings().setZoomControlsEnabled(false);\n googleMap.getUiSettings().setCompassEnabled(false);\n googleMap.setPadding(0, 0, 0, ImageCreator.dpToPx(92));\n\n mapController = new GoogleMapController(\n googleMap,\n DependencyInjection.provideSettingsStorageService());\n mapController.addListener(this);\n presenter.onViewReady();\n Log.d(TAG, \"onMapReady: \");\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mMap.getUiSettings().setMapToolbarEnabled(false);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n \tmMap = ((com.google.android.gms.maps.MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();\n \t// Check if we were successful in obtaining the map.\n \tif (mMap != null) {\n \t\tmakeMarkers();\n \t\tloadMarkersFromParse();\n \t}\n }\n \n }", "void configureSupportMapFragment(){\n supportMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n SupportMapFragment mapFragment = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map));\n mapFragment.getMapAsync(this);\n mMap = mapFragment.getMap();\n\n }\n }", "private void setUpMapIfNeeded() {\n\t\tif (mMap == null) {\n\t\t\t// Try to obtain the map from the SupportMapFragment.\n\t\t\tmMap = ((SupportMapFragment) getSupportFragmentManager()\n\t\t\t\t\t.findFragmentById(R.id.map1)).getMap();\n\t\t\t// Check if we were successful in obtaining the map.\n\t\t\tif (mMap != null) {\n\t\t\t\tsetUpMap();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public void mapshow() {\r\n showMap l_showmap = new showMap(d_playerList, d_country);\r\n l_showmap.check();\r\n }", "public final native void setMap(MapJSO map) /*-{\n\t\tthis.setMap(map);\n\t}-*/;", "public void displayMap() {\n MapMenuView mapMenu = new MapMenuView();\r\n mapMenu.display();\r\n \r\n }", "private void setUpMapIfNeeded() {\n\t\tif (mMap == null) {\n\t\t\tlogger.info(\"map is null\");\n\t\t\tlogger.debug(\"maps is null\");\n\t\t\tSystem.out.println(\"map is null\");\n\t\t\t// Try to obtain the map from the SupportMapFragment.\n\t\t\tmMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();\n\t\t\t// Check if we were successful in obtaining the map.\n\t\t\tif (mMap != null) {\n\t\t\t\taddMarker(markerLatLng);\n\t\t\t\t \n\t\t\t}\n\t\t}else\n\t\t{\n\t\t\t\n\t\t\t// Creating an instance of MarkerOptions\n addMarker(markerLatLng);\n \n\t\t\n\t\t}\n\t}", "@Override\n public void onMapReady(GoogleMap googleMap)\n {\n //Enable interactions with the google map\n mMap = googleMap;\n mMap.getUiSettings().setZoomControlsEnabled(true);\n\n if(!partnerLocs) {\n Log.d(\"GO TO INTI :\", \"!!!!\");\n init(); //initialize components\n mMap.setOnMapLongClickListener(this);\n mMap.setOnMarkerDragListener(this);\n\n }\n mMap.setOnMarkerClickListener(this);\n\n if(showMyLoc || partnerLocs){\n loadMarkers();\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(markerClicked.getPosition(), ZOOMLV));\n markerClicked.showInfoWindow();\n }\n else{\n loadMarkers(); //change to loadPartnerMarkers() later\n// mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(markerClicked.getPosition(), ZOOMLV));\n// markerClicked.showInfoWindow();\n }\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n mMap = googleMap;\r\n\r\n }", "private void inicMapComponent() {\n\t\tmapView = ((MapFragment) getFragmentManager()\n\t\t\t\t.findFragmentById(R.id.map)).getMap();\n\t\t\n\n\t\tlocationService = new LocationService(MapPage.this);\n\t\tlocationService.getLocation();\n\t\t\n\t\tmapView.setMyLocationEnabled(true);\n\n\t Location location = mapView.getMyLocation();\n\t LatLng myLocation = null; //new LatLng(44.8167d, 20.4667d);\n\t \n\t\tif (location != null) {\n\t myLocation = new LatLng(location.getLatitude(),\n\t location.getLongitude());\n\t } else {\n\t \tLocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);\n\t\t\tCriteria criteria = new Criteria();\n\t\t\tString provider = service.getBestProvider(criteria, false);\n\t\t\tLocation lastKnownLocation = service.getLastKnownLocation(provider);\n\t\t\tmyLocation = new LatLng(lastKnownLocation.getLatitude(),lastKnownLocation.getLongitude());\n\t }\n\t\t\n\t\tmapView.animateCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 13));\n\t\t\n\t\tmapView.setPadding(0, 0, 0, 80);\n\t\t\n\t\tmapView.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onInfoWindowClick(Marker marker) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t//onMapWindwosClick(marker.getId(),marker.getTitle());\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t\n\t}", "public void setMap2D(FXMap map);", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n }", "@Override\n public void onMapReady(GoogleMap map) {\n mMap = map;\n mUiSettings = mMap.getUiSettings();\n mUiSettings.setCompassEnabled(false);\n mUiSettings.setMapToolbarEnabled(false);\n mUiSettings.setZoomControlsEnabled(false);\n mUiSettings.setScrollGesturesEnabled(false);\n mUiSettings.setTiltGesturesEnabled(false);\n mUiSettings.setRotateGesturesEnabled(false);\n\n // Add a marker in Sydney and move the camera\n final LatLng airport = new LatLng(listAirport.get(index).getLatitude(), listAirport.get(index).getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLng(airport));\n mMap.setMinZoomPreference(10.0f);\n mMap.setMaxZoomPreference(10.0f);\n mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);\n\n map.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n @Override\n public void onMapClick(LatLng latLng) {\n onClick(index, MapsActivity.class);\n }\n });\n\n }", "public MapFragment() {\n // Required empty public constructor\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = mMapFragment.getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n Log.i(TAG, \"Yes, we have a google map...\");\n setUpMap();\n } else {\n // means that Google Service is not available\n form.dispatchErrorOccurredEvent(this, \"setUpMapIfNeeded\",\n ErrorMessages.ERROR_GOOGLE_PLAY_NOT_INSTALLED);\n }\n\n }\n }", "public MapPanel(Class<? extends Globe> globeTypeClass, final Map<String, Boolean> layerNameEnabledMap) {\r\n\t\tsuper(new BorderLayout());\r\n\t\t\r\n\t\t// Curry the layerNameEnabledMap into the layer enabling/disabling process used by the start() method\r\n\t\tlayerEnableCmd = ()->{\r\n\t\t\tSystem.out.println(\"[MapPanel.layerEnableCmd] Enabling/disabling the following layers:\");\r\n\t\t\tgetWWD().getModel().getLayers().forEach((layer)->{\r\n\t\t\t\tlayer.setEnabled(layerNameEnabledMap.computeIfAbsent(layer.getName(), (key)->{return true;}));\t// enable any unknown layers by default\t\r\n\t\t\t\tSystem.out.println(\" layer: \"+layer.getName()+\" (enabled = \"+layer.isEnabled()+\") layer class = \"+layer.getClass().getName());\r\n\t\t\t});\r\n\t\t};\r\n\t\t\r\n\t\t/**\r\n\t\t * The following setPreferredSize(new Dimension(0,0)) is a work around\r\n\t\t * to a known JOGL problem when working with resizeable elements, e.g. JScrollPanes.\r\n\t\t * See http://jogamp.org/jogl/doc/userguide/ and look under the \r\n\t\t * \"Heavyweight and Lightweight Issues\" section.\r\n\t\t * Without this line, if this panel is put into a JScrollPane, when the scroll pane\r\n\t\t * size is _reduced_ and the scroll bars appear, the map will not scroll \r\n\t\t * properly; simply shifting in space on top of other elements. The displayed\r\n\t\t * map is also incorrect, an objects that should be visible on the edges may not \r\n\t\t * be visible. The problem does not appear when the scroll pane size is increased. With the\r\n\t\t * following line, the map will always be the same size of the scroll pane's \r\n\t\t * viewport and thus the scroll bars will never appear.\r\n\t\t */\r\n\t\tsetPreferredSize(new Dimension(0,0)); \r\n\t\tinitconfig(globeTypeClass);\r\n\t\t\r\n\t\t\r\n\t\tsetupAnnotationToggling();\r\n\t}", "private void initilizeMap() {\n\t\tif (googleMap == null) {\n\t\t\tgoogleMap = ((MapFragment) getFragmentManager().findFragmentById(\n\t\t\t\t\tR.id.map)).getMap();\n\n\t\t\tif (googleMap == null) {\n\t\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\"Sorry! unable to create maps\", Toast.LENGTH_SHORT)\n\t\t\t\t\t\t.show();\n\t\t\t}\n\t\t}\n\t}", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n mMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {\n @Override\n public void onMapLoaded() {\n\n setUpMap();\n\n }\n });\n }\n }\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n try {\n setUpMap();\n } catch (JSONException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }", "private boolean setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\n .getMap();\n\n if (mMap == null) {\n Log.e(TAG, \"Can not find map\");\n return false;\n }\n\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap();\n }\n }\n\n if (bCurrentPos!= null)\n bCurrentPos.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n goCurrentLocation(mMap);\n }\n });\n\n return true;\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n myMap = googleMap;\n setMap();\n try{\n myMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lastKnown.getLatitude(), lastKnown.getLongitude()), 18.0f));\n }catch (NullPointerException e){\n\n }\n }", "private MapContainer(MapProvider provider, String htmlApiKey) {\n super(new BorderLayout());\n internalNative = (InternalNativeMaps)NativeLookup.create(InternalNativeMaps.class);\n if(internalNative != null) {\n if(internalNative.isSupported()) {\n currentMapId++;\n mapId = currentMapId;\n PeerComponent p = internalNative.createNativeMap(mapId);\n \n // can happen if Google play services failed or aren't installed on an Android device\n if(p != null) {\n addComponent(BorderLayout.CENTER, p);\n return;\n }\n } \n internalNative = null;\n }\n if(provider != null) {\n internalLightweightCmp = new MapComponent(provider) {\n private boolean drg = false;\n\n @Override\n public void pointerDragged(int x, int y) {\n super.pointerDragged(x, y); \n drg = true;\n }\n\n @Override\n public void pointerDragged(int[] x, int[] y) {\n super.pointerDragged(x, y); \n drg = true;\n }\n\n @Override\n public void pointerReleased(int x, int y) {\n super.pointerReleased(x, y); \n if(!drg) {\n fireTapEvent(x, y);\n }\n drg = false;\n }\n\n };\n addComponent(BorderLayout.CENTER, internalLightweightCmp);\n } else {\n internalBrowser = new BrowserComponent();\n\n internalBrowser.putClientProperty(\"BrowserComponent.fireBug\", Boolean.TRUE);\n\n Location loc = LocationManager.getLocationManager().getLastKnownLocation();\n internalBrowser.setPage(\n \"<!DOCTYPE html>\\n\" +\n \"<html>\\n\" +\n \" <head>\\n\" +\n \" <title>Simple Map</title>\\n\" +\n \" <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0\\\">\\n\" +\n \" <meta charset=\\\"utf-8\\\">\\n\" +\n \" <style>\\n\" +\n \" /* Always set the map height explicitly to define the size of the div\\n\" +\n \" * element that contains the map. */\\n\" +\n \" #map {\\n\" +\n \" height: 100%;\\n\" +\n \" }\\n\" +\n \" /* Optional: Makes the sample page fill the window. */\\n\" +\n \" html, body {\\n\" +\n \" height: 100%;\\n\" +\n \" margin: 0;\\n\" +\n \" padding: 0;\\n\" +\n \" }\\n\" +\n \" </style>\\n\" +\n \" </head>\\n\" +\n \" <body>\\n\" +\n \" <div id=\\\"map\\\"></div>\\n\" +\n \" <script>\\n\" + \n \" var map;\\n\" +\n \" function initMap() {\\n\" +\n \" var origin = {lat: \"+ loc.getLatitude() + \", lng: \" + loc.getLongitude() + \"};\\n\" +\n \" map = new google.maps.Map(document.getElementById('map'), {\\n\" +\n \" center: origin,\\n\" +\n \" zoom: 8\\n\" +\n \" });\\n\" +\n \" var clickHandler = new ClickEventHandler(map, origin);\\n\" +\n \" }\\n\" +\n \" var ClickEventHandler = function(map, origin) {\\n\" +\n \" var self = this;\\n\" +\n \" this.origin = origin;\\n\" +\n \" this.map = map;\\n\" +\n \" //this.directionsService = new google.maps.DirectionsService;\\n\" +\n \" //this.directionsDisplay = new google.maps.DirectionsRenderer;\\n\" +\n \" //this.directionsDisplay.setMap(map);\\n\" +\n \" //this.placesService = new google.maps.places.PlacesService(map);\\n\" +\n \" //this.infowindow = new google.maps.InfoWindow;\\n\" +\n \" //this.infowindowContent = document.getElementById('infowindow-content');\\n\" +\n \" //this.infowindow.setContent(this.infowindowContent);\\n\" +\n \"\\n\" +\n// \" google.maps.event.addListener(this.map, 'click', function(evt) {\\n\" +\n// \" self.handleClick(evt);\\n\" +\n// \" });\" +\n \"this.map.addListener('click', this.handleClick.bind(this));\\n\" +\n \" };\\n\" +\n \" ClickEventHandler.prototype.handleClick = function(event) {\\n\" + \n \" //document.getElementById('map').innerHTML = 'foobar';\\n\" +\n \" cn1OnClickCallback(event);\" +\n \" };\\n\" +\n \" </script>\\n\" +\n \" <script src=\\\"https://maps.googleapis.com/maps/api/js?key=\" + \n htmlApiKey +\n \"&callback=initMap\\\"\\n\" +\n \" async defer></script>\\n\" +\n \" </body>\\n\" +\n \"</html>\", \"/\");\n browserContext = new JavascriptContext(internalBrowser);\n internalBrowser.addWebEventListener(\"onLoad\", new ActionListener() {\n public void actionPerformed(ActionEvent evt) {\n JSObject window = (JSObject)browserContext.get(\"window\");\n window.set(\"cn1OnClickCallback\", new JSFunction() {\n public void apply(JSObject self, Object[] args) {\n Log.p(\"Click\");\n }\n });\n }\n });\n addComponent(BorderLayout.CENTER, internalBrowser);\n }\n setRotateGestureEnabled(true);\n }", "@SuppressLint(\"NewApi\")\n\tprivate GoogleMap setUpMapIfNeeded() {\n\t\tif (googleMap == null) {\n\n\t\t\tgoogleMap = ((SupportMapFragment) getSupportFragmentManager()\n\t\t\t\t\t.findFragmentById(R.id.map)).getMap();\n\t\t\t// Check if we were successful in obtaining the map.\n\t\t\tif (googleMap != null) {\n\t\t\t\t// The Map is verified. It is now safe to manipulate the map.\n\t\t\t}\n\t\t}\n\t\treturn googleMap;\n\t}", "private void setUpMapIfNeeded() {\n // Do a null check to confirm that we have not already instantiated the map.\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap();\n }\n }\n }", "public void showMaps() throws Exception{\r\n MapMaintenanceBaseWindow mapMaintenanceBaseWindow = null;\r\n String unitNumber=mdiForm.getUnitNumber();\r\n \r\n if( ( mapMaintenanceBaseWindow = (MapMaintenanceBaseWindow)mdiForm.getFrame(\r\n CoeusGuiConstants.MAPS_BASE_FRAME_TITLE+\" \"+unitNumber))!= null ){\r\n if( mapMaintenanceBaseWindow.isIcon() ){\r\n mapMaintenanceBaseWindow.setIcon(false);\r\n }\r\n mapMaintenanceBaseWindow.setSelected( true );\r\n return;\r\n }\r\n \r\n MapMaintenanceBaseWindowController mapMaintenanceBaseWindowController = new MapMaintenanceBaseWindowController(unitNumber,false);\r\n mapMaintenanceBaseWindowController.display();\r\n \r\n }", "public boolean getShowMap()\r\n {\r\n return showMap;\r\n }", "public MapContainer() {\n this(new OpenStreetMapProvider());\n }", "@Override\r\n \tpublic void setMap(Map m) {\n \t\t\r\n \t}", "private void setupMapView(){\n Log.d(TAG, \"setupMapView: Started\");\n\n view_stage_map = VIEW_MAP_FULL;\n cycleMapView();\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n try {\n\t\t\t\t\tsetUpMap();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }\n }\n }", "public void setMap(Map map) {\r\n\t\tthis.map = map;\r\n\t\tsmap.setMap(map);\r\n\t}", "private void initilizeMap() {\n SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()\n .findFragmentById(R.id.map);\n mapFragment.getMapAsync(this);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n Log.v(TAG, \"onMapReady\");\n mMap = googleMap;\n\n //Sets zoom and compass controls\n googleMap.getUiSettings().setZoomControlsEnabled(true);\n googleMap.getUiSettings().setCompassEnabled(true);\n }", "public void looser()\n {\n this.mapFrame.looser();\n }", "public MapPanel(MapObject[][] map, int pixels_per_grid) {\n \tthis.map = map.clone();\n \tif (pixels_per_grid == 0)\n \t\tthis.pixels_per_grid = GRID_SIZE;\n \telse\n \t\tthis.pixels_per_grid = pixels_per_grid;\n }", "@Override\n\tpublic void drawMap(Map map) {\n\t\tSystem.out.println(\"Draw map\"+map.getClass().getName()+\"on SD Screen\");\n\t}", "public void showmap() {\n MapForm frame = new MapForm(this.mapLayout);\n frame.setSize(750, 540);\n frame.setLocationRelativeTo(null);\n frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);\n frame.setVisible(true);\n }", "public static void generateNewPanel(boolean newMap) {\r\n\t\tif (MapGPanel.getInstance() != null) {\r\n\t\t\tMapGFrame.getInstance().remove(MapGPanel.getInstance());\r\n\t\t}\r\n\t\tMapGFrame.getInstance().add(MapGPanel.init(15, 15, 64, newMap));\r\n\t}", "public void initMap() {\n\t\tmap = new Map();\n\t\tmap.clear();\n\t\tphase = new Phase();\n\t\tmap.setPhase(phase);\n\t\tmapView = new MapView();\n\t\tphaseView = new PhaseView();\n\t\tworldDomiView = new WorldDominationView();\n\t\tcardExchangeView = new CardExchangeView();\n\t\tphase.addObserver(phaseView);\n\t\tphase.addObserver(cardExchangeView);\n\t\tmap.addObserver(worldDomiView);\n\t\tmap.addObserver(mapView);\n\t}", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n Intent info = getIntent();\n setUpMap(new LatLng(info.getDoubleExtra(\"latitude\", 0), info.getDoubleExtra(\"longitude\", 0)), info.getStringExtra(\"name\"));\n }\n }\n }", "public LookUpPanel() {\n initComponents(); \n }", "private void initializeMapAd()\n {\n mAdView = new NativeExpressAdView(this);\n mAdView.setAdSize(new AdSize(320, 80));\n mAdView.setAdUnitId(mPreferences.getString(RemoteConfigService.AD_UNIT_ID + 1, \"ca-app-pub-9949935976977846/4866656411\"));\n\n RelativeLayout.LayoutParams layoutParams = new RelativeLayout\n .LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,\n RelativeLayout.LayoutParams.WRAP_CONTENT);\n\n layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);\n\n RelativeLayout layout = new RelativeLayout(this);\n layout.setLayoutParams(layoutParams);\n layout.addView(mAdView);\n mMapAdView.addView(layout);\n }", "public MKMapView() {}", "private boolean isMap() {\n if (mMap == null) {\n // Try to obtain the map from the MapFragment.\n mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();\n mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n mMap.setOnMapClickListener(this);\n mMap.setOnMarkerClickListener(this);\n }\n }\n\n return (mMap != null);\n }", "public void MapFragment() {}", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n\n\n }", "private void setUpMap() {\n if (mGoogleMap != null && mParkingField != null) {\n LatLng latLng = new LatLng(mParkingField.getLatitude(), mParkingField.getLongitude());\n mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 16));\n mGoogleMap.addMarker(mMapFactory.createParkingFieldMakerOptions(mParkingField, getContext()));\n }\n }", "private void intializeMap() {\n\n if (googleMap == null) {\n\n SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()\n .findFragmentById(R.id.map);\n mapFragment.getMapAsync(this);\n\n\n // getPlacesMarkers();\n }\n }", "public RadarMap() {\n initComponents();\n }", "@Override\n public void onMapReady(MapboxMap mapboxMap) {\n map = mapboxMap;\n map.addOnMapClickListener(this);\n enableLocation();\n //LatLng point = null;\n //setRoute(point);\n\n }", "public MapTile() {}" ]
[ "0.6929367", "0.66124314", "0.65667325", "0.6487772", "0.6476561", "0.64721274", "0.64579135", "0.6452153", "0.6445826", "0.64220285", "0.63964224", "0.6307694", "0.63037837", "0.63011163", "0.629915", "0.62984544", "0.62885505", "0.6288023", "0.62714267", "0.62442416", "0.62296015", "0.6206538", "0.61978734", "0.61923915", "0.61922175", "0.61804444", "0.6175779", "0.6166217", "0.6153328", "0.61438364", "0.61431795", "0.6134621", "0.6123041", "0.6117906", "0.60979676", "0.6097619", "0.60970694", "0.6096832", "0.60788983", "0.60788983", "0.60788983", "0.60768425", "0.60680515", "0.6065433", "0.6064225", "0.6049994", "0.60487914", "0.60475504", "0.6046367", "0.6041766", "0.6040755", "0.6037414", "0.6022046", "0.6020687", "0.6014846", "0.6005439", "0.59967905", "0.59966946", "0.5996633", "0.5992059", "0.5989456", "0.5986484", "0.59860766", "0.5982533", "0.5981405", "0.59805477", "0.596078", "0.59554666", "0.5949045", "0.5946244", "0.5945709", "0.59332293", "0.5928163", "0.59278536", "0.5917879", "0.59158635", "0.5915779", "0.591373", "0.590882", "0.59037906", "0.58897275", "0.58848965", "0.5883775", "0.58811796", "0.58763915", "0.58755744", "0.5871804", "0.5865455", "0.5853134", "0.58530957", "0.5837822", "0.5835461", "0.58324856", "0.58296597", "0.58244437", "0.5820589", "0.58106285", "0.57968324", "0.5794211", "0.5793961" ]
0.6909925
1
/ the calllback we pass here happens after we do our reverse geocoding
private void reverseGeocode(final LatLng latLng, final AsyncCallback callback) { GWT.log("reverseGeocode"); geocoder.getLocations(latLng, new LocationCallback() { public void onFailure(int statusCode) { getMessagePanel().displayError("Failed to geocode position " + latLng.toString() + ". Status: " + statusCode + " " + StatusCodes.getName(statusCode)); if (callback != null) { callback.onFailure(null); } //but we can still set the location } public void onSuccess(JsArray<Placemark> locations) { GWT.log("reverseGeocode onSuccess " + locations.length()); // for (int i = 0; i < locations.length(); ++i) { //just need to get the very first location! Placemark placemark = locations.get(0); Location location = new Location(); location.setLatitude(placemark.getPoint().getLatitude()); location.setLongitude(placemark.getPoint().getLongitude()); GWT.log("address is " + placemark.getStreet()); location.setAddress1(placemark.getStreet()); location.setCity(placemark.getCity()); location.setState(placemark.getState()); location.setZipcode(placemark.getPostalCode()); location.setCountryCode(placemark.getCountry()); location.setGeocoded(true); //does not fetch data, but will update the top of the app mywebapp.setCurrentLocation(location); if (callback != null) { callback.onSuccess(null); } //we just reverse geocoded, not that we clicked on map // } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void onFinishReverseGeoCoding(String result) {\n }", "private void onFinishReverseGeoCoding(String result) {\n }", "@Override\n\t\t\tpublic void onGetReverseGeoCodeResult(ReverseGeoCodeResult reverseGeoCodeResult) {\n\t\t\t\tif (reverseGeoCodeResult.error == SearchResult.ERRORNO.NO_ERROR) {\n\t\t\t\t\tString coordType = \"bd09ll\";\n\t\t\t\t\tString address = reverseGeoCodeResult.getAddress();\n\t\t\t\t\tLatLng latLng = reverseGeoCodeResult.getLocation();\n\t\t\t\t\tString geoCode_F = \"{\" +\n\t\t\t\t\t\t\t\"long:%f\" +\n\t\t\t\t\t\t\t\",lat:%f\" +\n\t\t\t\t\t\t\t\",addr:'%s'\" +\n\t\t\t\t\t\t\t\",type:'%s'\" +\n\t\t\t\t\t\t\t\"}\";\n\t\t\t\t\tString geoCode = String.format(Locale.ENGLISH, geoCode_F, latLng.longitude, latLng.latitude, address, coordType);\n\t\t\t\t\tJSUtil.execCallback(webview, callBackId, geoCode, JSUtil.OK, true, false);\n\t\t\t\t} else if (reverseGeoCodeResult.error == SearchResult.ERRORNO.NETWORK_ERROR) { // 网络错误\n\t\t\t\t\tString error = DOMException.toJSON(DOMException.CODE_NETWORK_ERROR, DOMException.toString(reverseGeoCodeResult.error.toString(),\"Maps百度地图\", DOMException.MSG_NETWORK_ERROR, BaiduErrorLink.BaiduLink));\n\t\t\t\t\tJSUtil.execCallback(webview, callBackId, error, JSUtil.ERROR, true, false);\n\t\t\t\t} else {\n\t\t\t\t\tString error = DOMException.toJSON(DOMException.CODE_BUSINESS_INTERNAL_ERROR, DOMException.toString(reverseGeoCodeResult.error.toString(),\"Maps百度地图\", reverseGeoCodeResult.error.toString(), BaiduErrorLink.BaiduLink));\n\t\t\t\t\tJSUtil.execCallback(webview, callBackId, error, JSUtil.ERROR, true, false);\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void onGetReverseGeoCodeResult(ReverseGeoCodeResult arg0) {\n\t\t\t}", "private void updateTargetProductGeocoding() {\n }", "@Override\n\t\t\tpublic void onGetReverseGeoCodeResult(ReverseGeoCodeResult arg0) {\n\t\t\t\tif(arg0==null||arg0.error!=SearchResult.ERRORNO.NO_ERROR||arg0.getLocation().latitude==0||arg0.getLocation().longitude==0)\n\t\t\t\t{\n\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\tToastUtil.shortToast(getApplicationContext(), \"百度地图出现错误了,请重写输入地址\");\n\t\t\t\t}\n\t\t\t\tlatitude=arg0.getLocation().latitude;\n\t\t\t\tlongitude=arg0.getLocation().longitude;\n\t\t\t\tLog.e(\"llll\", latitude+\"\");\n\t\t\t\tLog.e(\"1111\", longitude+\"\");\n\t\t\t\tsendEmptyUiMessage(MsgConstants.MSG_01);\n\t\t\t\t\n\t\t\t}", "@Override\n protected Void doInBackground(Void... voids) {\n\n\n Geocoder gc = new Geocoder(MainActivity.this);\n\n Log.d(\"florianBurel\", \"gc - isPresent : \" + (gc.isPresent() ? \"YES\" : \"NO\"));\n\n try {\n List<Address> addresses = gc.getFromLocation(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude(), 1);\n\n Log.d(\"florianBurel\", addresses.size() + \" addresses found\");\n\n //city.setName(addresses.get(0).getLocality());\n\n } catch (IOException e) {\n city.setName(\"Unknown Location\");\n }\n\n\n\n\n return null;\n }", "@Override\n\t\t\tpublic void onGetGeoCodeResult(GeoCodeResult arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onGetGeoCodeResult(GeoCodeResult arg0) {\n\n }", "@Override\r\n public void onScrubGeo(long arg0, long arg1) {\n\r\n }", "@Override\r\n public void onScrubGeo(long arg0, long arg1) {\n\r\n }", "@Override\n\t\tpublic void onGetGeoCodeResult(GeoCodeResult arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onGetReverseGeoCodeResult(ReverseGeoCodeResult result) {\n\t\t\tif (result == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlocation = result.getAddress();//地理位置\n\t\t\tif (location.equals(\"null\")) {\n\t\t\t\tlocation = \"\";\n\t\t\t}\n\t\t\tLocationUtil.stopReverseGeoCode();\n\t\t}", "@Override\r\n\t\t\tpublic void onScrubGeo(long arg0, long arg1) {\n\r\n\t\t\t}", "@Override\n\t\t\tpublic void onGetGeoCodeResult(GeoCodeResult geocode) {\n\t\t\t\tif (geocode.error == SearchResult.ERRORNO.NO_ERROR) {\n\t\t\t\t\tString coordType = \"bd09ll\";\n\t\t\t\t\tString address = geocode.getAddress();\n\t\t\t\t\tLatLng latLng = geocode.getLocation();\n\t\t\t\t\tString geoCode_F = \"{\" +\n\t\t\t\t\t\t\t\"long:%f\" +\n\t\t\t\t\t\t\t\",lat:%f\" +\n\t\t\t\t\t\t\t\",addr:'%s'\" +\n\t\t\t\t\t\t\t\",type:'%s'\" +\n\t\t\t\t\t\t\t\"}\";\n\t\t\t\t\tString geoCode = String.format(Locale.ENGLISH, geoCode_F, latLng.longitude, latLng.latitude, address, coordType);\n\t\t\t\t\tJSUtil.execCallback(webview, callBackId, geoCode, JSUtil.OK, true, false);\n\t\t\t\t} else if (geocode.error == SearchResult.ERRORNO.NETWORK_ERROR) { // 网络错误\n\t\t\t\t\tString error = DOMException.toJSON(DOMException.CODE_NETWORK_ERROR, DOMException.toString(geocode.error.toString(),\"Maps百度地图\", DOMException.MSG_NETWORK_ERROR, BaiduErrorLink.BaiduLink));\n\t\t\t\t\tJSUtil.execCallback(webview, callBackId, error, JSUtil.ERROR, true, false);\n\t\t\t\t} else {\n\t\t\t\t\tString error = DOMException.toJSON(DOMException.CODE_BUSINESS_INTERNAL_ERROR, DOMException.toString(geocode.error.toString(),\"Maps百度地图\", geocode.error.toString(), BaiduErrorLink.BaiduLink));\n\t\t\t\t\tJSUtil.execCallback(webview, callBackId, error, JSUtil.ERROR, true, false);\n\t\t\t\t}\n\t\t\t}", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n\n// GeoCoderUtils.getCountryCode(3.152194, 101.778446, RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n// GeoCoderUtils.getCountryCode(location.getLatitude(), location.getLongitude(), RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n\n GeoCoderUtils.getCountryCode(location.getLatitude(), location.getLongitude(), RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n// GeoCoderUtils.getCountryCode(25.105497, 121.597366, RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n// malasia GeoCoderUtils.getCountryCode(3.152194, 101.778446, RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n @Override\n public void onGetCode(String country_name,String country_code, String stateNamefromeo, String cityNamefrogeo) {\n\n countryName = country_name;\n stateNamefromGeo = stateNamefromeo;\n cityNameFromGeo = cityNamefrogeo;\n CommonUtils.showLog(\"location1\", \"Code is :\" + country_code);\n if (country_code != null) {\n String dialcode = \"\";\n if (countryCode != null && countryList != null) {\n for (int i = 0; i < countryList.size(); i++) {\n if (country_code.equalsIgnoreCase(countryList.get(i).getCountrycode())) {\n CommonUtils.showLog(\"location2\", \"Code is :\" + country_code);\n textViewCountry.setText(\"\" + countryList.get(i).getName());\n countryId = countryList.get(i).getId();\n countryCode = country_code;\n getState();\n textViewDialCode.setText(\"+\" + countryList.get(i).getPhonecode());\n dialCode = countryList.get(i).getPhonecode();\n\n for (int j = 0; j < Country.getAllCountries().size(); j++) {\n {\n if (countryList.get(i).getName().equalsIgnoreCase(Country.getAllCountries().get(j).getName())) {\n imageViewFlag.setImageResource(Country.getAllCountries().get(j).getFlag());\n return;\n }\n }\n }\n return;\n }\n }\n }\n }\n }\n });\n }\n }", "public void onScrubGeo(long arg0, long arg1) { }", "@Override\n\tpublic void onScrubGeo(long arg0, long arg1) \n\t{\n\t}", "@Override\n\t\tpublic void onScrubGeo(long arg0, long arg1) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onScrubGeo(long arg0, long arg1) {\n\t\t\t\n\t\t}", "@Override\n\tpublic void onScrubGeo(long arg0, long arg1) {\n\t\t\n\t}", "@Override\n\t\t\tpublic void onGetGeoCodeResult(GeoCodeResult arg0) {\n\t\t\t\tif(arg0==null||arg0.error!=SearchResult.ERRORNO.NO_ERROR||arg0.getLocation().latitude==0||arg0.getLocation().longitude==0)\n\t\t\t\t{\n\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\tToastUtil.shortToast(getApplicationContext(), \"百度地图出现错误了,请重写输入地址\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlatitude=arg0.getLocation().latitude;\n\t\t\t\tlongitude=arg0.getLocation().longitude;\n\t\t\t\tLog.e(\"llll2\", latitude+\"\");\n\t\t\t\tLog.e(\"11112\", longitude+\"\");\n\t\t\t\tsendEmptyUiMessage(MsgConstants.MSG_01);\n\t\t\t\t\n\t\t\t}", "@Override\n public GeoData reverseEncode(GeoData geoData) {\n String reverseGeoCodeUrl = \"https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=\"+ geoData.getLat() + \"&lon=\" + geoData.getLng() + \"&[email protected]\";\n\n try {\n // Creating an object of URL Class\n URL obj = new URL(reverseGeoCodeUrl);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n // optional default is GET\n con.setRequestMethod(\"GET\");\n\n // add request header\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n\n // Print this response code if you are facing any issues\n int responseCode = con.getResponseCode();\n BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n String inputLine;\n StringBuilder response = new StringBuilder();\n\n while ((inputLine = in.readLine()) != null) {\n response.append(inputLine);\n }\n\n // Getting the response in String\n String jsonobj = response.toString();\n\n JSONParser parser = new NominatimJSONParser();\n geoData.setAddress(parser.parseGeoData(jsonobj));\n in.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return geoData;\n\n }", "@Override\n\t\t\tpublic void onScrubGeo(long arg0, long arg1) {\n\n\t\t\t}", "@Override\n public void onScrubGeo(long arg0, long arg1) {\n }", "public GeocodingGoogle() throws Exception{\n //lisdataFileRead();\n //findLocationNameFromApi();\n lisdataDBReadToGoogleAPIAccess();\n }", "private void searchmap() {\n String location = \"475 Dien bien phu\";\n //lcSearch;\n\n if (location != null && !location.equals(\"\")) {\n List<Address> lstAddress = null;\n try {\n lstAddress = geocoder.getFromLocationName(location, 1);\n System.out.print(lstAddress);\n if (lstAddress != null) {\n double lat = lstAddress.get(0).getLatitude();\n double lng = lstAddress.get(0).getLongitude();\n LatLng latLng = new LatLng(lat, lng);\n goToMaps(latLng);\n } else {\n\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n latitude=String.valueOf(location.getLatitude());\n longitude= String.valueOf(location.getLongitude());\n\n System.out.println(\"asdfgh==\"+latitude);\n\n\n /* Geocoder geocoder;\n List<Address> addresses;\n geocoder = new Geocoder(SafetyActivity.this, Locale.getDefault());\n\n try {\n addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);\n String address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()\n String city = addresses.get(0).getLocality();\n String state = addresses.get(0).getAdminArea();\n String country = addresses.get(0).getCountryName();\n String postalCode = addresses.get(0).getPostalCode();\n String knownName = addresses.get(0).getFeatureName();\n\n System.out.println(\"addresses==\"+address);\n // Here 1 represent max location result to returned, by documents it recommended 1 to 5\n } catch (IOException e) {\n e.printStackTrace();\n }*/\n }", "@Override\n public void onSuccess(Location location) {\n\n if (location != null) {\n // Logic to handle location object\n\n Geocoder gcd = new Geocoder(MainActivity.this, Locale.getDefault());\n List<Address> addresses = null;\n try {\n addresses = gcd.getFromLocation(location.getLatitude(), location.getLongitude(), 1);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (addresses.size() > 0) {\n System.out.println(addresses.get(0).getLocality());\n sp.set(SPConstants.location,addresses.get(0).getLocality()+\", \"+addresses.get(0).getCountryName());\n }\n else {\n sp.set(SPConstants.location,\"\");\n\n // do your stuff\n }\n\n }\n }", "private void onSearchClick(Location loc) {\n\r\n\r\n Log.d(TAG, \"IN ONSEARCHCLICK\");\r\n\r\n String url;\r\n\r\n\r\n url = \"https://geocode-maps.yandex.ru/a1.x/?format=json&geocode=\" + loc.getLongitude() + \",\" + loc.getLatitude();\r\n\r\n Log.d(TAG, url);\r\n RequestQueue queue = Volley.newRequestQueue(this);\r\n JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {\r\n @Override\r\n public void onResponse(JSONObject response) {\r\n Log.d(TAG, response.toString());\r\n //JSONArray jsonArray = response.getJSONObject(\"results\").getString(\"formattedString\");\r\n //String formattedAdress = response.getJSONObject(\"response\").getJSONObject(\"GeoObjectCollection\").getJSONObject(\"metaDataProperty\").getJSONObject(\"GeocoderResponseMetaData\").getString(\"request\");\r\n JSONObject country = null;\r\n JSONObject area = null;\r\n JSONObject city = null;\r\n JSONObject street = null;\r\n JSONObject houseNumber = null;\r\n try {\r\n country = response.getJSONObject(\"response\").getJSONObject(\"GeoObjectCollection\").getJSONArray(\"featureMember\").getJSONObject(0).getJSONObject(\"GeoObject\").getJSONObject(\"metaDataProperty\").getJSONObject(\"GeocoderMetaData\").getJSONObject(\"AddressDetails\").getJSONObject(\"Country\");\r\n } catch (JSONException e) {\r\n country = null;\r\n }\r\n try {\r\n area = response.getJSONObject(\"response\").getJSONObject(\"GeoObjectCollection\").getJSONArray(\"featureMember\").getJSONObject(0).getJSONObject(\"GeoObject\").getJSONObject(\"metaDataProperty\").getJSONObject(\"GeocoderMetaData\").getJSONObject(\"AddressDetails\").getJSONObject(\"Country\").getJSONObject(\"AdministrativeArea\");\r\n } catch (JSONException e) {\r\n area = null;\r\n }\r\n try {\r\n city = response.getJSONObject(\"response\").getJSONObject(\"GeoObjectCollection\").getJSONArray(\"featureMember\").getJSONObject(0).getJSONObject(\"GeoObject\").getJSONObject(\"metaDataProperty\").getJSONObject(\"GeocoderMetaData\").getJSONObject(\"AddressDetails\").getJSONObject(\"Country\").getJSONObject(\"AdministrativeArea\").getJSONObject(\"Locality\");\r\n } catch (JSONException e) {\r\n city = null;\r\n }\r\n try {\r\n street = response.getJSONObject(\"response\").getJSONObject(\"GeoObjectCollection\").getJSONArray(\"featureMember\").getJSONObject(0).getJSONObject(\"GeoObject\").getJSONObject(\"metaDataProperty\").getJSONObject(\"GeocoderMetaData\").getJSONObject(\"AddressDetails\").getJSONObject(\"Country\").getJSONObject(\"AdministrativeArea\").getJSONObject(\"Locality\").getJSONObject(\"Thoroughfare\");\r\n } catch (JSONException e) {\r\n street = null;\r\n }\r\n try {\r\n houseNumber = response.getJSONObject(\"response\").getJSONObject(\"GeoObjectCollection\").getJSONArray(\"featureMember\").getJSONObject(0).getJSONObject(\"GeoObject\").getJSONObject(\"metaDataProperty\").getJSONObject(\"GeocoderMetaData\").getJSONObject(\"AddressDetails\").getJSONObject(\"Country\").getJSONObject(\"AdministrativeArea\").getJSONObject(\"Locality\").getJSONObject(\"Thoroughfare\").getJSONObject(\"Premise\");\r\n } catch (JSONException e) {\r\n houseNumber = null;\r\n }\r\n String text = \"\";\r\n if (country != null) {\r\n// try {\r\n// text += \"Country: \" + country.getString(\"CountryName\") + \"\\n\";\r\n// } catch (JSONException e) {\r\n// }\r\n\r\n// if (area != null) {\r\n// try {\r\n// text += \"Administrative Area: \" + area.getString(\"AdministrativeAreaName\") + \"\\n\";\r\n// } catch (JSONException e) {\r\n// }\r\n\r\n if (city != null) {\r\n try {\r\n text +=city.getString(\"LocalityName\") + \" \";\r\n } catch (JSONException e) {\r\n }\r\n\r\n if (street != null) {\r\n try {\r\n text +=street.getString(\"ThoroughfareName\") + \" \";\r\n } catch (JSONException e) {\r\n }\r\n\r\n if (houseNumber != null) {\r\n try {\r\n text +=houseNumber.getString(\"PremiseNumber\");\r\n } catch (JSONException e) {\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Log.d(TAG, country);\r\n\r\n addressEditText.setText(text);\r\n getPostCode();\r\n\r\n }\r\n }, new Response.ErrorListener() {\r\n @Override\r\n public void onErrorResponse(VolleyError error) {\r\n Log.d(TAG, error.getMessage() + \" ERROR!\");\r\n }\r\n });\r\n\r\n queue.add(request);\r\n\r\n }", "private void geolocate() throws IOException {\n\n\n List<Address> addresses = geocoder.getFromLocationName(bundle.getString(\"starting\"), 1);\n List<Address> addresses1 = geocoder.getFromLocationName(bundle.getString(\"destiny\"), 1);\n\n if (addresses!=null||addresses.size()>0||addresses1!=null||addresses1.size()>0)\n {\n try {\n\n\n Address address=addresses.get(0);\n Address address1=addresses1.get(0);\n\n Double orglat = address.getLatitude();\n Double orglng = address.getLongitude();\n Double dstlat = address1.getLatitude();\n Double dstlng = address1.getLongitude();\n\n origin = new LatLng(orglat, orglng);\n destiny = new LatLng(dstlat, dstlng);\n\n /* Constants.AddrouteOrigin=new LatLng(orglat,orglng);\n Constants.AddrouteDestiny=new LatLng(dstlat,dstlng);*/\n\n\n Log.d(\"origindest\",Constants.AddrouteOrigin+\" \"+Constants.AddrouteDestiny+\"\");\n\n Log.d(\"origindest\",origin+\" \"+destiny+\"\");\n\n }catch (IndexOutOfBoundsException e){\n Toast.makeText(getContext(),e.getMessage(),Toast.LENGTH_LONG).show();\n }\n\n }\n else {\n Toast.makeText(getContext(),\"no address found\",Toast.LENGTH_LONG).show();\n }\n }", "@Test\n public void test3() throws Exception {\n GeoCoder g = new GeoCoder();\n String zip = \"12028\";\n String state = \"New York\";\n String city = \"Buskirk\";\n String address = \"\";\n g = g.geoCoding(address, city, state, zip);\n }", "public void onSuccess(GGeocodeResult result);", "private void searchAddress() {\n CommomUtils.hideKeyboard(MainActivity.this, etAddress);\n\n //Check if the address was informed\n if (etAddress.getText().toString().equals(\"\")) {\n Toast.makeText(MainActivity.this, R.string.activity_main_search_address_validation, Toast.LENGTH_SHORT).show();\n return;\n }\n\n lvResult.setVisibility(View.GONE);\n showProgress();\n\n //Call the api for searching the address\n GoogleMapsService service = ServiceGenerator.createService(GoogleMapsService.class, getString(R.string.google_maps_api_base_url));\n service.getGeocoding(etAddress.getText().toString(), true, new Callback<GeocodingResult>() {\n @Override\n public void success(GeocodingResult googleGeocodingResult, Response response) {\n hideProgress();\n geocodingResult = googleGeocodingResult;\n\n if (geocodingResult.getResults().size() > 0) {\n loadResult();\n } else {\n Toast.makeText(MainActivity.this, R.string.activity_main_search_no_results_found, Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void failure(RetrofitError error) {\n hideProgress();\n Toast.makeText(MainActivity.this, error.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n }", "public String GetAddressFromLatLng(Double latitude,Double longitude)\n {\n //Geocoder geocoder = null;\n List<Address> addresses;\n String address = \"\";\n //Geocoder geocoder = new Geocoder(HomeMapsActivity.this, Locale.getDefault());\n\n// Geocoder geocoder = CustomApplication.geoCoder;\n try {\n addresses = CustomApplication.geoCoder.getFromLocation(latitude, longitude, 1); // Here 1 represent max location result to returned, by documents it recommended 1 to 5\n address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()\n String city = addresses.get(0).getLocality();\n String state = addresses.get(0).getAdminArea();\n String country = addresses.get(0).getCountryName();\n String postalCode = addresses.get(0).getPostalCode();\n String knownName = addresses.get(0).getFeatureName(); // Only if available else return NULL\n } catch (IOException e) {\n e.printStackTrace();\n }\n Log.i(TAG, \"GetAddressFromLatLng: \"+address);\n\n return address;\n }", "private void GetLocation(final String str) {\n AlertUtils.showCustomProgressDialog(LocationSearchActivityNew.this);\n String selectedPlaceKey = DataToPref.getSharedPreferanceData(LocationSearchActivityNew.this, LaoxiConstant.SELECTED_PLACE_ID, LaoxiConstant.SELECTED_PLACE_ID_KEY);\n\n CommonImplementation.getInstance().doGetLocation(null, \"https://maps.googleapis.com/maps/api/place/details/json?placeid=\" + selectedPlaceKey + \"&sensor=false&key=\" + getString(R.string.browser_key) + \"&language=\" + Locale.getDefault().getCountry(), new OnTaskComplete() {\n @Override\n public void onSuccess(Response data, boolean success) {\n AlertUtils.dismissDialog();\n if (data.code() == 200) {\n\n String LAT = \"\";\n String Long = \"\";\n String Location = \"\";\n String City = \"\";\n String State = \"\";\n String postal_code = \"\";\n String country = \"\";\n\n try {\n\n String response = data.body().string();\n JSONObject object = new JSONObject(response);\n\n String status = object.getString(\"status\").toString();\n\n if (object.has(\"result\")) {\n //JSONArray results = object.getJSONArray(\"results\");\n int i = 0;\n //Log.i(\"i\", i + \",\" + results.length());\n JSONObject r = object.getJSONObject(\"result\");\n JSONArray addressComponentsArray = r.getJSONArray(\"address_components\");\n do {\n\n JSONObject addressComponents = addressComponentsArray.getJSONObject(i);\n JSONArray typesArray = addressComponents.getJSONArray(\"types\");\n String types = typesArray.getString(0);\n\n if (types.equalsIgnoreCase(\"sublocality\")) {\n Location = addressComponents.getString(\"short_name\");\n Log.i(\"Locality\", Location);\n\n } else if (types.equalsIgnoreCase(\"locality\")) {\n City = addressComponents.getString(\"long_name\");\n Log.i(\"City\", City);\n\n } else if (types.equalsIgnoreCase(\"administrative_area_level_1\")) {\n State = addressComponents.getString(\"long_name\");\n Log.i(\"State\", State);\n\n } else if (types.equalsIgnoreCase(\"postal_code\")) {\n postal_code = addressComponents.getString(\"long_name\");\n Log.i(\"postal_code\", postal_code);\n } else if (types.equalsIgnoreCase(\"country\")) {\n country = addressComponents.getString(\"long_name\");\n Log.i(\"country\", country);\n }\n\n i++;\n } while (i < addressComponentsArray.length());\n\n\n JSONObject geometry = r.getJSONObject(\"geometry\");\n JSONObject location = geometry.getJSONObject(\"location\");\n\n LAT = location.getString(\"lat\");\n Long = location.getString(\"lng\");\n\n\n /* Log.i(\"JSON Geo Locatoin =>\", currentLocation);\n return currentLocation;*/\n\n String Data = LAT + \",,,\" + Long + \",,,\" + Location + \",,,\" + City + \",,,\" + State + \",,,\" +\n postal_code + \",,,\" + country;\n\n\n Intent returnIntent = new Intent();\n returnIntent.putExtra(\"result\", Data + \",,,\" + str);\n setResult(Activity.RESULT_OK, returnIntent);\n finish();\n }\n } catch (IOException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else if (data.code() == 404) {\n\n }\n }\n\n @Override\n public void onFailure() {\n AlertUtils.dismissDialog();\n }\n });\n }", "@Override\n public void onMapClick(LatLng arg0) {\n try {\n Geocoder geo = new Geocoder(MapsActivity.this, Locale.getDefault());\n List<Address> add = geo.getFromLocation(arg0.latitude, arg0.longitude, 1);\n String selectedCountry;\n if (add.size() > 0) {\n selectedCountry = add.get(0).getCountryName();\n selectedStateOrCountry = selectedCountry;\n\n //Log.d(\"country\", selectedCountry);\n //For usa go with states . All other countries - it gives the capital\n if (selectedCountry.equalsIgnoreCase(\"United States\") ||\n selectedCountry.equalsIgnoreCase(\"US\")) {\n selectedStateOrCountry = add.get(0).getAdminArea();\n }\n //Log.d(\"state\", selectedStateOrCountry);\n ConvertTextToSpeech();\n }\n } catch (Exception e) {\n //Log.e(TAG, \"Failed to initialize map\", e);\n }\n }", "@Test\n public void test2() throws Exception {\n GeoCoder g = new GeoCoder();\n String country = \"Saint Clair\";\n String zip = \"35004\";\n String state = \"Alabama\";\n String city = \"Moody\";\n String address = \"\";\n g.geoCoding(address, city, state, zip);\n }", "protected void streetLoc(LatLng latLng) {\n if (latLng == null) {\n return;\n }\n TencentSearch tencentSearch = new TencentSearch(this);\n //还可以传入其他坐标系的坐标,不过需要用coord_type()指明所用类型\n //这里设置返回周边poi列表,可以在一定程度上满足用户获取指定坐标周边poi的需求\n Geo2AddressParam geo2AddressParam = new Geo2AddressParam(latLng).getPoi(true)\n .setPoiOptions(new Geo2AddressParam.PoiOptions()\n// .setRadius(1000).setCategorys(\"面包\")\n .setPolicy(Geo2AddressParam.PoiOptions.POLICY_O2O));\n tencentSearch.geo2address(geo2AddressParam, new HttpResponseListener<BaseObject>() {\n\n @Override\n public void onSuccess(int arg0, BaseObject arg1) {\n if (arg1 == null) {\n return;\n }\n Geo2AddressResultObject obj = (Geo2AddressResultObject)arg1;\n StringBuilder sb = new StringBuilder();\n sb.append(\"逆地址解析\");\n sb.append(\"\\n地址:\" + obj.result.address);\n sb.append(\"\\npois:\"+obj.result.address_component.province+obj.result.address_component.city+obj.result.address_component.district);\n// provinceMap.put()\n province1 = provinceMap.get(obj.result.address_component.province+obj.result.address_component.city+obj.result.address_component.district);\n if(province1 == null) {\n provinceMap.put(obj.result.address_component.province+obj.result.address_component.city+obj.result.address_component.district,obj.result.address_component.province+obj.result.address_component.city+obj.result.address_component.district);\n getStreet(obj.result.address_component.province, obj.result.address_component.city, obj.result.address_component.district);\n }\n\n// for (Poi poi : obj.result.pois) {\n// sb.append(\"\\n\\t\" + poi.title);\n// tencentMap.addMarker(new MarkerOptions()\n// .position(poi.latLng) //标注的位置\n// .title(poi.title) //标注的InfoWindow的标题\n// .snippet(poi.address) //标注的InfoWindow的内容\n// );\n// }\n// Log.e(\"test\", sb.toString());\n }\n\n @Override\n public void onFailure(int arg0, String arg1, Throwable arg2) {\n Log.e(\"test\", \"error code:\" + arg0 + \", msg:\" + arg1);\n }\n });\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n\n Geocoder gcd = new Geocoder(context, Locale.getDefault());\n List<Address> addresses = null;\n try {\n addresses = gcd.getFromLocation(location.getLatitude(), location.getLongitude(), 1);\n if (addresses.size() > 0) {\n\n city = addresses.get(0).getLocality();\n local.setText(city);\n local.setSelection(local.getText().length());\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n Intent intent = getIntent();\n String postCode = intent.getStringExtra(\"Postcode\");\n\n Geocoder geocoder1 = new Geocoder(this);\n // try {\n\n // List<Address> addresses1 = geocoder1.getFromLocationName(postCode, 1);\n // if (addresses1 != null && !addresses1.isEmpty()) {\n // Address address1 = addresses1.get(0);\n // Use the address as needed\n // latitude_start = address1.getLatitude();\n // longitude_start = address1.getLongitude();\n // String message = \"Latitude: \"+address1.getLatitude()+\", Longitude: \"+address1.getLongitude();\n // Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n//\n\n // } else {\n // Display appropriate message when Geocoder services are not available\n // Toast.makeText(this, \"Unable to geocode zipcode\", Toast.LENGTH_LONG).show();\n // latitude_start = 0;\n // longitude_start = 0;\n // }\n\n // LatLng latLng = new LatLng(latitude_start, longitude_start);\n\n // } catch (IOException e) {\n // // handle exception\n // }\n\n //mMap.addMarker(new MarkerOptions().position(new LatLng(currentLatitude, currentLongitude)).title(\"Current Location\"));\n // MarkerOptions options = new MarkerOptions()\n // .position(latLng)\n // .title(\"I am here!\");\n // mMap.addMarker(options);\n // mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));\n\n // Moving Camera to a Location with animation\n\n // CameraPosition cameraPosition = new CameraPosition.Builder()\n // .target(latLng).zoom(12).build();\n\n // mMap.animateCamera(CameraUpdateFactory\n // .newCameraPosition(cameraPosition));\n\n\n }", "@Override\n\t\tprotected String doInBackground(Location... params) {\n\t\t\t/*\n\t\t\t * Get a new geocoding service instance, set for localized addresses. This example uses\n\t\t\t * android.location.Geocoder, but other geocoders that conform to address standards\n\t\t\t * can also be used.\n\t\t\t */\n\t\t\tGeocoder geocoder = new Geocoder(localContext, Locale.getDefault());\n\n\t\t\t// Get the current location from the input parameter list\n\t\t\tLocation location = params[0];\n\n\t\t\t// Create a list to contain the result address\n\t\t\tList <Address> addresses = null;\n\n\t\t\t// Try to get an address for the current location. Catch IO or network problems.\n\t\t\ttry {\n\n\t\t\t\t/*\n\t\t\t\t * Call the synchronous getFromLocation() method with the latitude and\n\t\t\t\t * longitude of the current location. Return at most 1 address.\n\t\t\t\t */\n\t\t\t\taddresses = geocoder.getFromLocation(location.getLatitude(),\n\t\t\t\t\t\tlocation.getLongitude(), 1\n\t\t\t\t\t\t);\n\n\t\t\t\t// Catch network or other I/O problems.\n\t\t\t} catch (IOException exception1) {\n\n\t\t\t\t// Log an error and return an error message\n\t\t\t\tLog.e(LocationUtils.APPTAG, getString(R.string.IO_Exception_getFromLocation));\n\n\t\t\t\t// print the stack trace\n\t\t\t\texception1.printStackTrace();\n\n\t\t\t\t// Return an error message\n\t\t\t\treturn (getString(R.string.IO_Exception_getFromLocation));\n\n\t\t\t\t// Catch incorrect latitude or longitude values\n\t\t\t} catch (IllegalArgumentException exception2) {\n\n\t\t\t\t// Construct a message containing the invalid arguments\n\t\t\t\tString errorString = getString(\n\t\t\t\t\t\tR.string.illegal_argument_exception,\n\t\t\t\t\t\tlocation.getLatitude(),\n\t\t\t\t\t\tlocation.getLongitude()\n\t\t\t\t\t\t);\n\t\t\t\t// Log the error and print the stack trace\n\t\t\t\tLog.e(LocationUtils.APPTAG, errorString);\n\t\t\t\texception2.printStackTrace();\n\n\t\t\t\t//\n\t\t\t\treturn errorString;\n\t\t\t}\n\t\t\t// If the reverse geocode returned an address\n\t\t\tif (addresses != null && addresses.size() > 0) {\n\n\t\t\t\t// Get the first address\n\t\t\t\tAddress address = addresses.get(0);\n\n\t\t\t\t// Format the first line of address\n\t\t\t\tString addressText = getString(R.string.address_output_string,\n\n\t\t\t\t\t\t// If there's a street address, add it\n\t\t\t\t\t\taddress.getMaxAddressLineIndex() > 0 ?\n\t\t\t\t\t\t\t\taddress.getAddressLine(0) : \"\",\n\n\t\t\t\t\t\t\t\t// Locality is usually a city\n\t\t\t\t\t\t\t\taddress.getLocality(),\n\n\t\t\t\t\t\t\t\t// The country of the address\n\t\t\t\t\t\t\t\taddress.getCountryName()\n\t\t\t\t\t\t);\n\n\t\t\t\t// Return the text\n\t\t\t\treturn addressText;\n\n\t\t\t\t// If there aren't any addresses, post a message\n\t\t\t} else {\n\t\t\t\treturn getString(R.string.no_address_found);\n\t\t\t}\n\t\t}", "@Override\r\n\tprotected RiderLocation doInBackground(RiderLocation... params) {\r\n\t\t/*\r\n\t\t * Get a new geocoding service instance, set for localized addresses.\r\n\t\t * This example uses android.location.Geocoder, but other geocoders that\r\n\t\t * conform to address standards can also be used.\r\n\t\t */\r\n\t\tGeocoder geocoder = new Geocoder(this.localContext, Locale.getDefault());\r\n\r\n\t\t// Get the current location from the input parameter list\r\n\t\tRiderLocation location = params[0];\r\n\r\n\t\t// Create a list to contain the result address\r\n\t\tList<Address> addresses = null;\r\n\r\n\t\t// Try to get an address for the current location. Catch IO or network\r\n\t\t// problems.\r\n\t\ttry {\r\n\r\n\t\t\t/*\r\n\t\t\t * Call the synchronous getFromLocation() method with the latitude\r\n\t\t\t * and longitude of the current location. Return at most 1 address.\r\n\t\t\t */\r\n\t\t\taddresses = geocoder.getFromLocation(location.getLatitude(),\r\n\t\t\t\t\tlocation.getLongitude(), 1);\r\n\r\n\t\t\t// Catch network or other I/O problems.\r\n\t\t} catch (IOException exception1) {\r\n\r\n\t\t\t// Log an error and return an error message\r\n\t\t\tLog.e(\"GetAddressTask \", exception1.getMessage());\r\n\r\n\t\t\t// print the stack trace\r\n\t\t\texception1.printStackTrace();\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t\t// Catch incorrect latitude or longitude values\r\n\t\t} catch (IllegalArgumentException exception2) {\r\n\r\n\t\t\texception2.printStackTrace();\r\n\r\n\t\t\t//\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t// If the reverse geocode returned an address if (addresses != null &&\r\n\t\t// addresses.size() > 0) {\r\n\r\n\t\t// Get the first address\r\n\t\tAddress address = addresses.get(0);\r\n // com.ssinfo.corider.app.models.RiderLocation locationAddress = new com.ssinfo.corider.app.models.RiderLocation();\r\n // locationAddress.setLatitude(location.getLatitude());\r\n //locationAddress.setLongitude(location.getLongitude());\r\n\t\tlocation.setAddress(address.getMaxAddressLineIndex() > 0 ? address.getAddressLine(0):\"\");\r\n\t\tlocation.setCity(address.getSubAdminArea());\r\n\t\tlocation.setCountry(address.getCountryName());\r\n\t\t\r\n return location;\r\n\t}", "@Test\n void getGeoCodingInfoFromAddress() throws URISyntaxException, IOException {\n System.out.println(MapUtils.getGeoCodingInfoFromAddress(\"350 W 88th st, New York, NY\"));\n }", "@Override\n\t\tpublic void onReceiveLocation(BDLocation location) {\n\t\t\t\n\t\t Lng = (float) location.getLatitude();//经度\n\t\t\t Lat = (float) location.getLongitude();//维度\n\t\t\t Log.e(TAG, \"Lng: \" + Lng);\n\t\t\t Log.e(TAG, \"Lat: \" + Lat);\n\t\t\t LocationUtil.stopLocation();\n\t\t\tLocationUtil.startReverseGeoCode(Lng, Lat, getGeoCoderResultListener);\n\t\t\t\n\t\t}", "@Test\n public void testLocation() throws Exception {\n GeoCoder g = new GeoCoder();\n String location = \"Eastern,NY\";\n g.geoCoding(location);\n }", "public interface GGeocodeAdvancedResultListener\r\n{\r\n\t/**\r\n\t * Called when the geocode operation is successful, returns a set of \"matching\" results\r\n\t * @param result\r\n\t */\r\n\tpublic void onSuccess(GGeocodeResult result);\r\n\t\r\n\t/**\r\n\t * Called when the geocode operation fails\r\n\t *\r\n\t */\r\n\tpublic void onFail(int statusCode, String address);\r\n}", "public final void b(com.tencent.mm.modelgeo.Addr r11) {\n /*\n r10 = this;\n r1 = 0;\n r7 = -1;\n r3 = com.tencent.mm.plugin.location.model.a$a.this;\n r0 = r11.tag;\n if (r0 == 0) goto L_0x01a2;\n L_0x0008:\n r0 = r11.tag;\n r0 = r0 instanceof java.lang.Long;\n if (r0 == 0) goto L_0x01a2;\n L_0x000e:\n r0 = r11.tag;\n r0 = (java.lang.Long) r0;\n r4 = r0.longValue();\n r0 = com.tencent.mm.plugin.messenger.foundation.a.i.class;\n r0 = com.tencent.mm.kernel.g.l(r0);\n r0 = (com.tencent.mm.plugin.messenger.foundation.a.i) r0;\n r0 = r0.bcY();\n r4 = r0.dW(r4);\n r0 = r11.dRH;\n r0 = com.tencent.mm.sdk.platformtools.bi.oW(r0);\n if (r0 != 0) goto L_0x01a2;\n L_0x002e:\n r2 = r4.field_content;\n r0 = r4.field_isSend;\n if (r0 != 0) goto L_0x01a3;\n L_0x0034:\n r0 = 1;\n L_0x0035:\n r5 = r4.field_talker;\n r5 = com.tencent.mm.model.s.fq(r5);\n if (r5 == 0) goto L_0x004f;\n L_0x003d:\n if (r0 == 0) goto L_0x004f;\n L_0x003f:\n r6 = com.tencent.mm.model.bd.iA(r2);\n if (r6 == r7) goto L_0x004f;\n L_0x0045:\n r6 = r6 + 1;\n r2 = r2.substring(r6);\n r2 = r2.trim();\n L_0x004f:\n r6 = com.tencent.mm.storage.bd.b.YW(r2);\n r2 = r11.Oy();\n r6.label = r2;\n r2 = \"\";\n if (r5 == 0) goto L_0x01a8;\n L_0x005e:\n if (r0 == 0) goto L_0x01a8;\n L_0x0060:\n r0 = r4.field_content;\n r0 = com.tencent.mm.model.bd.iA(r0);\n if (r0 == r7) goto L_0x01a8;\n L_0x0068:\n r7 = r4.field_content;\n r0 = r7.substring(r1, r0);\n r0 = r0.trim();\n r1 = r0.length();\n if (r1 <= 0) goto L_0x01a8;\n L_0x0078:\n r1 = r6.tbP;\n if (r1 == 0) goto L_0x0087;\n L_0x007c:\n r1 = r6.tbP;\n r2 = \"\";\n r1 = r1.equals(r2);\n if (r1 == 0) goto L_0x008c;\n L_0x0087:\n r1 = \"\";\n r6.tbP = r1;\n L_0x008c:\n r1 = r6.tbO;\n if (r1 == 0) goto L_0x009b;\n L_0x0090:\n r1 = r6.tbO;\n r2 = \"\";\n r1 = r1.equals(r2);\n if (r1 == 0) goto L_0x00a0;\n L_0x009b:\n r1 = \"\";\n r6.tbP = r1;\n L_0x00a0:\n r1 = r6.tbN;\n if (r1 == 0) goto L_0x00af;\n L_0x00a4:\n r1 = r6.tbN;\n r2 = \"\";\n r1 = r1.equals(r2);\n if (r1 == 0) goto L_0x00b4;\n L_0x00af:\n r1 = \"\";\n r6.tbN = r1;\n L_0x00b4:\n r1 = r6.otZ;\n if (r1 == 0) goto L_0x00c3;\n L_0x00b8:\n r1 = r6.otZ;\n r2 = \"\";\n r1 = r1.equals(r2);\n if (r1 == 0) goto L_0x00c8;\n L_0x00c3:\n r1 = \"\";\n r6.otZ = r1;\n L_0x00c8:\n r1 = r6.label;\n if (r1 == 0) goto L_0x00d7;\n L_0x00cc:\n r1 = r6.label;\n r2 = \"\";\n r1 = r1.equals(r2);\n if (r1 == 0) goto L_0x00dc;\n L_0x00d7:\n r1 = \"\";\n r6.label = r1;\n L_0x00dc:\n r1 = r6.tbM;\n if (r1 == 0) goto L_0x00eb;\n L_0x00e0:\n r1 = r6.tbM;\n r2 = \"\";\n r1 = r1.equals(r2);\n if (r1 == 0) goto L_0x00f0;\n L_0x00eb:\n r1 = \"\";\n r6.tbM = r1;\n L_0x00f0:\n r1 = new java.lang.StringBuilder;\n r2 = \"<msg><location x=\\\"\";\n r1.<init>(r2);\n r8 = r6.kCw;\n r1 = r1.append(r8);\n r2 = \"\\\" y=\\\"\";\n r1 = r1.append(r2);\n r8 = r6.kCx;\n r1 = r1.append(r8);\n r2 = \"\\\" scale=\\\"\";\n r1 = r1.append(r2);\n r2 = r6.bSz;\n r1 = r1.append(r2);\n r2 = \"\\\" label=\\\"\";\n r1 = r1.append(r2);\n r2 = r6.label;\n r1 = r1.append(r2);\n r2 = \"\\\" maptype=\\\"\";\n r1 = r1.append(r2);\n r2 = r6.tbM;\n r1 = r1.append(r2);\n r2 = \"\\\" fromusername=\\\"\";\n r1 = r1.append(r2);\n r2 = r6.otZ;\n r1 = r1.append(r2);\n r2 = \"\\\" /></msg>\";\n r1 = r1.append(r2);\n r1 = r1.toString();\n if (r5 == 0) goto L_0x01a6;\n L_0x014c:\n r2 = \"\";\n r2 = r0.equals(r2);\n if (r2 != 0) goto L_0x01a6;\n L_0x0155:\n r2 = new java.lang.StringBuilder;\n r2.<init>();\n r0 = r2.append(r0);\n r2 = \":\\n\";\n r0 = r0.append(r2);\n r0 = r0.append(r1);\n r0 = r0.toString();\n L_0x016d:\n r1 = \"MicroMsg.LocationServer\";\n r2 = new java.lang.StringBuilder;\n r5 = \"xml: \";\n r2.<init>(r5);\n r2 = r2.append(r0);\n r2 = r2.toString();\n com.tencent.mm.sdk.platformtools.x.d(r1, r2);\n r4.setContent(r0);\n r0 = com.tencent.mm.plugin.messenger.foundation.a.i.class;\n r0 = com.tencent.mm.kernel.g.l(r0);\n r0 = (com.tencent.mm.plugin.messenger.foundation.a.i) r0;\n r0 = r0.bcY();\n r6 = r4.field_msgId;\n r0.a(r6, r4);\n r0 = r3.kCD;\n r2 = r4.field_msgId;\n r1 = java.lang.Long.valueOf(r2);\n r0.remove(r1);\n L_0x01a2:\n return;\n L_0x01a3:\n r0 = r1;\n goto L_0x0035;\n L_0x01a6:\n r0 = r1;\n goto L_0x016d;\n L_0x01a8:\n r0 = r2;\n goto L_0x0078;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.mm.plugin.location.model.a.a.1.b(com.tencent.mm.modelgeo.Addr):void\");\n }", "@Override\n protected String doInBackground(Void... params) {\n if (HelperRete.isNetworkAvailable(mMainActivity)) {\n\n String queryFormattata = mQueryGrezza.replaceAll(\" \", \"+\" + \"\");\n mQueryTitolo = mQueryGrezza.substring(0,1).toUpperCase() + mQueryGrezza.substring(1);\n\n // creazione url\n String url = \"https://maps.google.com/maps/api/geocode/json\" +\n \"?address=\" + queryFormattata + \"&key=\" + mMainActivity.getString(R.string.google_geoc_key);\n\n JSONObject response = HelperRete.volleySyncRequest(mMainActivity, url);\n\n // ottieni le coordinate dell'indirizzo tramite la risposta di GoogleApi\n try {\n if (response != null) {\n Log.i(\"jsonresp\", response.toString());\n\n double lng = ((JSONArray) response.get(\"results\")).getJSONObject(0)\n .getJSONObject(\"geometry\").getJSONObject(\"location\")\n .getDouble(\"lng\");\n\n double lat = ((JSONArray) response.get(\"results\")).getJSONObject(0)\n .getJSONObject(\"geometry\").getJSONObject(\"location\")\n .getDouble(\"lat\");\n\n mCoordinateCercate = new LatLng(lat, lng);\n\n return RICERCA_COMPLETATA;\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n } else {\n return NO_INTERNET;\n }\n\n return null;\n }", "public static String getLocationFromAddress(Context context, String strAddress) {\n\n Geocoder coder = new Geocoder(context);\n List<Address> address;\n String data = \"\";\n\n try {\n // address = coder.getFromLocationName(strAddress, 5);\n address = coder.getFromLocationName(strAddress, 15);\n if (address == null || address.size() <= 0) {\n return data;\n }\n Address location = address.get(0);\n\n System.out.println(\"============\" + location.getLatitude() + \"===================\" + location.getLongitude() + \"====================\");\n System.out.println(\"=====Local=======\" + location.getSubLocality());\n System.out.println(\"=====City=======\" + location.getLocality());\n System.out.println(\"=====State=======\" + location.getAdminArea());\n System.out.println(\"=====PinCode=======\" + location.getPostalCode());\n System.out.println(\"=====Country=======\" + location.getCountryName());\n\n data = location.getLatitude() + \",,,\" + location.getLongitude() + \",,,\" + location.getSubLocality() + \",,,\" + location.getLocality() + \",,,\" + location.getAdminArea() + \",,,\" +\n location.getPostalCode() + \",,,\" + location.getCountryName();\n\n\n } catch (Exception ex) {\n\n ex.printStackTrace();\n return data;\n }\n return data;\n\n }", "void getMyCurrentLocation() { \r\n\t\t \r\n\t\t \r\n\t \t // map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lat, lon), 16));\r\n\t\t \r\n\t LocationManager locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\r\n\t try{\r\n\t \t\tgps_enabled=locManager.isProviderEnabled(LocationManager.GPS_PROVIDER);\r\n\t }catch(Exception ex){\r\n\t \t\r\n\t }\r\n\t try{\r\n\t \tnetwork_enabled=locManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\r\n\t }catch(Exception ex){\r\n\t \t\r\n\t }\r\n\r\n\t if(gps_enabled){\r\n\t location=locManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\r\n\r\n\t } \r\n\r\n\t \r\n\t if(network_enabled && location==null) {\r\n\t location=locManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\r\n\r\n\t }\r\n\r\n\t\t if (location != null) { \r\n\t\t \t//accLoc=location.getAccuracy();\r\n\t\t lat = location.getLatitude();\r\n\t\t\t lon= location.getLongitude();\r\n\t\t } \r\n\t \r\n\t try\r\n\t {\r\n\t \t //Getting address based on coordinates.\r\n\t Geocoder geocoder; \r\n\t List<Address> addresses;\r\n\t geocoder = new Geocoder(this, Locale.getDefault());\r\n\t addresses = geocoder.getFromLocation(lat, lon, 1);\r\n\t \r\n\t Address = addresses.get(0).getAddressLine(0);\r\n\t City = addresses.get(0).getAddressLine(1);\r\n\t }\r\n\t catch (Exception e)\r\n\t {\r\n\t e.printStackTrace();\r\n\t }\r\n\r\n\t if (Address != null && !Address.isEmpty()) {\r\n\t\t \t try\r\n\t\t \t {\r\n\t\t \t \t //Getting address based on coordinates.\r\n\t\t \t Geocoder geocoder; \r\n\t\t \t List<Address> addresses;\r\n\t\t \t geocoder = new Geocoder(this, Locale.getDefault());\r\n\t\t \t addresses = geocoder.getFromLocation(lat, lon, 1);\r\n\t\t \t\r\n\t\t \t Address = addresses.get(0).getAddressLine(0);\r\n\t\t \t City = addresses.get(0).getAddressLine(1);\r\n\t\t \t }\r\n\t\t \t catch (Exception e)\r\n\t\t \t {\r\n\t\t \t e.printStackTrace();\r\n\t\t \t }\r\n\t\t \t //mp.position(new LatLng(location.getLatitude(), location.getLongitude()));\r\n\t\t \t //mp.title(\"You are here\");\t\t \t \r\n\t\t \t //map.addMarker(mp).showInfoWindow();\t\r\n\t\t \t //map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(1.3667, 103.8), 10));\r\n\t }\r\n\t else{ \r\n\t /* AlertDialog.Builder builder1 = new AlertDialog.Builder(ArticleLatestMoreDetailActivity.this);\r\n\t builder1.setTitle(\"Service Unavailable\");\r\n\t \t\t builder1.setMessage(\"Unable to get your location, check if your GPS and Network are turned on.\");\r\n\t \t\t builder1.setCancelable(true);\r\n\t builder1.setNegativeButton(\"OK\",new DialogInterface.OnClickListener() {\r\n\t public void onClick(DialogInterface dialog, int id) {\r\n\t \t dialog.cancel();\r\n\t }\r\n\t });\r\n\t AlertDialog alert11 = builder1.create();\r\n\t alert11.show();\r\n\t \r\n\t lat=1.3667;\r\n\t lon=103.8; */ \r\n\t // mp.position(new LatLng(1.3667, 103.8));\r\n\t\t // mp.draggable(true);\r\n\t\t \t // map.addMarker(mp).showInfoWindow();\r\n\t\t \t \r\n\t\t \t //map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(1.3667, 103.8), 10));\r\n\t }\r\n\t \r\n\t \r\n\t \r\n\t Bundle extras = this.getIntent().getExtras();\r\n\t\t double dbLat = extras.getDouble(\"dbLat\");\r\n\t\t double dbLon = extras.getDouble(\"dbLon\");\r\n\t\t artLoc.position(new LatLng(dbLat, dbLon));\r\n\t\t artLoc.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));\r\n\t\t artLoc.title(\"Place of occurrence\");\r\n\t\t map.addMarker(artLoc).showInfoWindow();\r\n\t\t map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(dbLat, dbLon), 18));\r\n\t \r\n\t \r\n\t \r\n\t }", "public void onSearch(View view){\n List<Address> addressList = null;\n EditText location_tf = (EditText) findViewById(R.id.TFaddress);\n String location = location_tf.getText().toString();\n if(location!=null || location.equals(\"\")){\n Geocoder geocoder = new Geocoder(this);\n try {\n addressList = geocoder.getFromLocationName(location, 1);\n } catch (IOException e) {\n e.printStackTrace();\n }\n Address address = addressList.get(0);\n LatLng latLng = new LatLng(address.getLatitude(), address.getLongitude());\n marker = mMap.addMarker(new MarkerOptions().position(latLng).title(\"Marker\"));\n mMap.addMarker(new MarkerOptions().position(latLng).title(\"Marker\"));\n mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng,17));\n\n }\n\n }", "@Override\n\t\tprotected Void doInBackground(Void... params) {\n\t\t\tfetchData();\n\t\t\t// getLatLongFromAddress(from);\n\t\t\treturn null;\n\t\t}", "@Override\n protected String doInBackground(Location... params) {\n\n // Set up geocoder\n Geocoder geocoder = new Geocoder(context, Locale.getDefault());\n\n // Get current location from parameter list\n Location location = params[0];\n\n // Create a list to contain the result address\n List<Address> addresses = null;\n try {\n Log.w(GetAddressTask.class.toString(), \"Started getting address from server\");\n // Get a list of street addresses using the geocoder.\n addresses = geocoder.getFromLocation(location.getLatitude(),\n location.getLongitude(), 1);\n Settings.getSettings().setPickUpCoordinates(location.getLatitude(), location.getLongitude());\n Log.w(GetAddressTask.class.toString(), \"Finished getting address from server\");\n } catch (IOException e1) {\n Log.e(\"GetAddressTask\", \"IO Exception in getFromLocation\");\n e1.printStackTrace();\n } catch (IllegalArgumentException e2) {\n // Make error string\n String errorString = \"Illegal arguments \" + Double.toString(location.getLatitude()) + \" , \" +\n Double.toString(location.getLongitude()) + \" passed to address services\";\n Log.e(\"GetAddressTask\" , errorString);\n e2.printStackTrace();\n return errorString;\n } catch (NullPointerException e3){\n // Waiting for connection\n }\n\n // Check if geocode returned an address\n if (addresses != null && addresses.size() > 0 && (location.getAccuracy() < 100)) {\n // Get first address from list\n Address address = addresses.get(0);\n // Format the address.\n String addressText = String.format(\"%s, %s, %s\", address.getMaxAddressLineIndex() > 0 ?\n address.getAddressLine(0) : \"\", address.getLocality(), address.getCountryName());\n return addressText;\n } else if (location.getAccuracy() >= 100) {\n return \"Your location is not accurate enough\\nTap on the arrow to try again.\";\n } else {\n return \"No address found\\nTru using a different option\";\n }\n }", "private void sendRequestAPI(Double lat,Double lng, String places) {\n\n String origin = String.valueOf(lat) + \",\" + String.valueOf(lng);\n Geocoder geocoder = new Geocoder(getActivity(), Locale.getDefault());\n String destination = \"0,0\";\n String wayPoints = \"0,0\";\n\n switch (places) {\n case \"Family Walk\" :\n destination = formatCoordinates(6);\n wayPoints = formatCoordinates(4) + \"|\" + formatCoordinates(5);\n break;\n\n case \"Retro Tour\" :\n destination = formatCoordinates(9);\n wayPoints =formatCoordinates(7) + \"|\" + formatCoordinates(8);\n break;\n\n case \"Sports Tour\" :\n destination = formatCoordinates(11);\n wayPoints = formatCoordinates(9) + \"|\" + formatCoordinates(8);\n break;\n case \"custom\":\n destination = getActivity().getIntent().getStringExtra(\"destination\");\n wayPoints = getActivity().getIntent().getStringExtra(\"waypoints\");\n break;\n\n }\n //String destination = \"-27.494721,153.014262\";\n //String wayPoints = \"-27.498172, 153.013585\";\n try {\n\n new Directions(this, origin, destination, wayPoints).execute();\n Double latDes= Double.parseDouble(destination.split(\",\")[0]);\n Double lngDes= Double.parseDouble(destination.split(\",\")[1]);\n String [] points = wayPoints.split(Pattern.quote(\"|\")) ;\n\n if(wayPoints.equals(\"\")){\n\n }\n else{\n for(String point : points) {\n Double latPoint = Double.parseDouble((point.split(\",\")[0]));\n Double lngPoint = Double.parseDouble((point.split(\",\")[1]));\n List<Address> addressesPoint = geocoder.getFromLocation(latPoint, lngPoint, 1);\n wayPointsMarkers.add(mMap.addMarker(new MarkerOptions().title(addressesPoint.get(0).getAddressLine(0))\n .position(new LatLng(latPoint, lngPoint))));\n }\n }\n\n\n List<Address> addressesStart = geocoder.getFromLocation(lat, lng, 1);\n List<Address> addressesEnd = geocoder.getFromLocation(latDes,\n lngDes, 1);\n //originMarkers.add(mMap.addMarker(new MarkerOptions().title(addressesStart.get(0).getAddressLine(0))\n //.position(new LatLng(lat, lng))));\n destinationMarkers.add(mMap.addMarker((new MarkerOptions().title(addressesEnd.get(0).getAddressLine(0))\n .position(new LatLng(latDes, lngDes)))));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latDes,\n lngDes), 16));\n\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void getAddress(double lat, double longit) {\n\t\tLocationAddress.getAddressFromLocation(lat, longit, \n cont, new GeocoderHandler());\n// Log.d(\"address\", addr);\n\t\t\n\t}", "public void onMapSearch(View view) {\n\n EditText locationSearch = (EditText) findViewById(R.id.arrival);\n String location = locationSearch.getText().toString();\n List<Address>addressList = null;\n\n if (location != null || !location.equals(\"\")) {\n Geocoder geocoder = new Geocoder(this);\n try {\n addressList = geocoder.getFromLocationName(location, 1);\n\n } catch (IOException e) {\n Toast.makeText(this,\"Destination not found\",Toast.LENGTH_SHORT).show();\n\n }\n Address address = addressList.get(0);\n LatLng latLng = new LatLng(address.getLatitude(), address.getLongitude());\n MarkerPoints.add(latLng);\n Toast.makeText(MapsActivity.this,\"added position 2 \"+MarkerPoints.size(),Toast.LENGTH_SHORT).show();\n\n mMap.addMarker(new MarkerOptions().position(latLng).draggable(true).title(location+\" (\"+address.getLatitude()+\",\"+address.getLongitude()+\")\").icon(BitmapDescriptorFactory.fromResource(R.drawable.flag)));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng,16));\n //listClients.add(new Client(R.drawable.flag,\"Nasser\",\"client2 requesting cab\",100,address.getLatitude(), address.getLongitude()));\n //Toast.makeText(MapsActivity.this,\"client attended at \"+\" (\"+address.getLatitude()+\",\"+address.getLongitude()+\")\",Toast.LENGTH_SHORT).show();\n\n\n\n /* if (MarkerPoints.size() > 2) {\n // MarkerPoints.clear();\n mMap.clear();\n }*/\n\n\n // Checks, whether start and end locations are captured\n if (MarkerPoints.size() >= 2) {\n LatLng origin = MarkerPoints.get(0);\n LatLng dest = MarkerPoints.get(MarkerPoints.size()-1);\n\n // Getting URL to the Google Directions API\n String url = getUrl(origin, dest);\n Log.d(\"onMapClick\", url.toString());\n FetchUrl FetchUrl = new FetchUrl();\n\n // Start downloading json data from Google Directions API\n FetchUrl.execute(url);\n //move map camera\n //mMap.moveCamera(CameraUpdateFactory.newLatLng(origin));\n //mMap.animateCamera(CameraUpdateFactory.zoomTo(11));\n\n build_retrofit_and_get_response(\"driving\");\n\n final View mapView = getSupportFragmentManager().findFragmentById(R.id.map).getView();\n if (mapView.getViewTreeObserver().isAlive()) {\n mapView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {\n @SuppressLint(\"NewApi\")\n @Override\n public void onGlobalLayout() {\n LatLngBounds.Builder bld = new LatLngBounds.Builder();\n for (int i = 0; i < MarkerPoints.size(); i++) {\n LatLng ll = new LatLng(MarkerPoints.get(i).latitude, MarkerPoints.get(i).longitude);\n bld.include(ll);\n }\n LatLngBounds bounds = bld.build();\n mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, 70));\n mapView.getViewTreeObserver().removeGlobalOnLayoutListener(this);\n\n }\n });\n }\n }\n\n }\n }", "public String myLocation(double latitude, double longitude){\n String myCity = \"\";\n Geocoder geocoder = new Geocoder(getActivity(), Locale.getDefault());\n List<Address> addressList ;\n try{\n addressList = geocoder.getFromLocation(latitude,longitude,1);\n\n if(addressList.size()>0){\n myCity = addressList.get(0).getLocality();\n }\n }catch (Exception e){\n e.printStackTrace();\n }\n return myCity;\n }", "@Override\n protected List<Address> doInBackground(String... locationName) {\n Geocoder geocoder = new Geocoder(getBaseContext());\n List<Address> addresses = null;\n \n try {\n // Getting a maximum of 3 Address that matches the input text\n addresses = geocoder.getFromLocationName(locationName[0], 3);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return addresses;\n }", "void mo5802a(LatLng latLng);", "private void createLocationCallback() {\n mLocationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n\n mLastLocation = locationResult.getLastLocation();\n mRequestingLocationUpdate = false;\n\n startAddressLookupService();\n }\n };\n }", "@Override\n public void onComplete(@NonNull Task<Location> task) {\n Log.i(\"profilesActivity\", \"lastLocation: success\");\n\n if (task.isSuccessful()) {\n // Logic to handle location object\n Geocoder geocoder = new Geocoder(Profile_User.this, Locale.getDefault());\n List<Address> addresses = null;\n location = task.getResult();\n if (location == null) {\n Log.i(\"profilesActivity\", \"location null\");\n\n } else {\n Log.i(\"profilesActivity\", \"location not null\");\n try {\n addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);\n String city = addresses.get(0).getLocality();\n current_location.setText(city);\n } catch (IOException e) {\n //e.printStackTrace();\n current_location.setText(\"erreur\");\n }\n }\n } else {\n Log.i(\"profilesActivity\", \"fused provider cant get location\");\n\n }\n\n }", "private void update_private(LatLngBounds bounds) {\n\t\tJSONObject response = null;\n\n\t\ttry {\n\t\t\tStringBuffer result = new StringBuffer();\n\n\t\t\tURL url = new URL(BASE_URL +\n\t\t\t\t\t\"lang=\" + mLang +\n\t\t\t\t\t\"&north=\" + bounds.getNe().getLat() +\n\t\t\t\t\t\"&south=\" + bounds.getSw().getLat() +\n\t\t\t\t\t\"&east=\" + bounds.getNe().getLng() +\n\t\t\t\t\t\"&west=\" + bounds.getSw().getLng() +\n\t\t\t\t\t\"&maxRows=\" + MAX_SEARCH_RESULTS);\n\t\t\tPLog.d(TAG, \"Sending geonames URL... \", url);\n\t\t\tBufferedReader buf = BufferedReaderFactory.openBufferedReader(url);\n\t\t\tfor (String line; (line = buf.readLine()) != null;) {\n\t\t\t\tresult.append(line).append(\"\\n\");\n\t\t\t}\n\t\t\tbuf.close();\n\t\t\tPLog.d(TAG, \"Geonames result received !\");\n\t\t\tresponse = new JSONObject(result.toString());\n\n\t\t\t/*\n\t\t\t * Once the first response is received, we adjust the real\n\t\t\t * amount of possible responses for next sends.\n\t\t\t */\n\n\t\t\tif (response.has(\"status\")) {\n\t\t\t\t/* No results found on first request */\n\t\t\t\tthrow (new Exception(\"Bad response status : \" + response.getJSONObject(\"status\").getString(\"message\")));\n\t\t\t}\n\n\t\t\tupdateMarkers(bounds,response);\n\n\t\t\t// Trigger a refresh of map display\n\t\t\tmController.getHandler().sendEmptyMessage(Controller.MSG_INVALIDATE_DISPLAY);\n\t\t\t\n\t\t} catch (MalformedURLException e) {\n\t\t\tPLog.e(TAG, \"Incorrect URL in search method : \", e.getMessage());\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\tPLog.e(TAG, \"Error while manipulating stream response : \",\n\t\t\t\t\te.getMessage());\n\t\t\te.printStackTrace();\n\t\t} catch (JSONException e) {\n\t\t\tPLog.e(TAG, \"Error JSON while building geonames result : \",\n\t\t\t\t\te.getMessage());\n\t\t\tresponse = null;\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\tPLog.e(TAG, \"Error while building geonames result : \",\n\t\t\t\t\te.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private static void testGetAddress(GeoCoderInterface geoCoder, Double latitude, Double longitude, String language){\n\t\tSystem.out.println(\"--From GPS:\");\n\t\tGeoCoderResult result = geoCoder.getAddress(latitude, longitude, language);\n\t\tprintGeoCoderResult(result);\n\t}", "@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tint wkid = map.getSpatialReference().getID();\n\n\t\t\t\t\t\t\tLocator locator = Locator\n\t\t\t\t\t\t\t\t\t.createOnlineLocator(floorInfo\n\t\t\t\t\t\t\t\t\t\t\t.getLocatorServerPath());\n\t\t\t\t\t\t\t// Create suggestion parameter\n\t\t\t\t\t\t\tLocatorFindParameters params = new LocatorFindParameters(\n\t\t\t\t\t\t\t\t\taddress);\n\n\t\t\t\t\t\t\t// ArrayList<String> outFields = new\n\t\t\t\t\t\t\t// ArrayList<String>();\n\t\t\t\t\t\t\t// outFields.add(\"*\");\n\t\t\t\t\t\t\t// params.setOutFields(outFields);\n\t\t\t\t\t\t\t// Set the location to be used for proximity based\n\t\t\t\t\t\t\t// suggestion\n\t\t\t\t\t\t\t// params.setLocation(map.getCenter(),map.getSpatialReference());\n\t\t\t\t\t\t\t// Set the radial search distance in meters\n\t\t\t\t\t\t\t// params.setDistance(50000.0);\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tlocatorResults = locator.find(params);\n\t\t\t\t\t\t\t\t// HashMap<String, String> params = new\n\t\t\t\t\t\t\t\t// HashMap<String,\n\t\t\t\t\t\t\t\t// String>();\n\t\t\t\t\t\t\t\t// params.put(\"货架编号\", address);\n\t\t\t\t\t\t\t\t// locatorResults = locator.geocode(params,\n\t\t\t\t\t\t\t\t// null,\n\t\t\t\t\t\t\t\t// map.getSpatialReference());\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\tSystem.out.println(\"查找:\" + address + \" 出错:\"\n\t\t\t\t\t\t\t\t\t\t+ e.getMessage());\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (locatorResults != null\n\t\t\t\t\t\t\t\t\t&& locatorResults.size() > 0) {\n\t\t\t\t\t\t\t\t// Add the first result to the map and zoom to\n\t\t\t\t\t\t\t\t// it\n\t\t\t\t\t\t\t\tfor (LocatorGeocodeResult result : locatorResults) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"查找:\" + address + \" 结果:\"\n\t\t\t\t\t\t\t\t\t\t\t+ result.getAddress());\n\n\t\t\t\t\t\t\t\t\tif (result.getAddress() != null\n\t\t\t\t\t\t\t\t\t\t\t&& address.equals(result\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getAddress())) {\n\n\t\t\t\t\t\t\t\t\t\tfloorInfo.getShelfList().add(result);\n\t\t\t\t\t\t\t\t\t\t// shelfList.add(result);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsearchTime++;\n\t\t\t\t\t\t\tSystem.out.println(\"已查找次数:\" + searchTime);\n\t\t\t\t\t\t\tif (searchTime >= mSearchCount) {\n\t\t\t\t\t\t\t\tmHandler.post(mMarkAndRoute);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "@Override\r\n public void onMapClick(LatLng latLng) {\n geocoder1 = new Geocoder(getApplicationContext(), Locale.getDefault());\r\n String State = null;\r\n String City = null;\r\n String Country = null;\r\n try {\r\n\r\n List<Address> Addresses = geocoder1.getFromLocation(latLng.latitude, latLng.longitude, 1);\r\n if (Addresses != null && Addresses.size() > 0) {\r\n\r\n City = Addresses.get(0).getAddressLine(0);\r\n State = Addresses.get(0).getAddressLine(1);\r\n Country = Addresses.get(0).getAddressLine(2);\r\n\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n // Clears the previously touched position\r\n googleMap.clear();\r\n\r\n TextView tvLocation = (TextView) findViewById(R.id.tv_location);\r\n\r\n\r\n // Animating to the touched position\r\n googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 16.0f));\r\n\r\n // Placing a marker on the touched position\r\n googleMap.addMarker(new MarkerOptions().position(latLng).title(City + \",\" + State + \",\" + Country));\r\n\r\n tvLocation.setText(\"Latitude:\" + latitude + \", Longitude:\" + longitude + \"\\n\" + City + \",\" + State + \",\\n\" + Country);\r\n\r\n }", "public interface ReverseGeo {\n //파라미터로 집어넣고 싶은 값들은 {}로 묶어준\n @GET(\"maps/api/geocode/json\")\n // JSON Array를 리턴하므로 List<>가 되었다\n //제이썬 어레이가 되돌아온다, 하나의 제이썬은 객체로 정의, 필요한 정보들을 가져온다\n //인터페이스이므로 몸체가 없는 함수이다 패쓰에 정의된 것은 파라미터들\n //함수 호출시에 매개변수로 집어넣는 것들이 위에 정의한 URL 상의 빈 부분들에 들어간\n Call<ReverseGeoRes> reverseGeo(\n // param 값으로 들어가는 것들이다\n @Query(\"key\") String key,\n @Query(\"language\") String lang,\n @Query(\"latlng\") String latlng);\n}", "private String getCompleteAddressString(double LATITUDE, double LONGITUDE) {\n String strAdd = \"\";\n Geocoder geocoder = new Geocoder(getActivity(), Locale.getDefault());\n try {\n List<Address> addresses = geocoder.getFromLocation(LATITUDE, LONGITUDE, 1);\n if (addresses != null) {\n Address returnedAddress = addresses.get(0);\n StringBuilder strReturnedAddress = new StringBuilder(\"\");\n\n for (int i = 0; i <= returnedAddress.getMaxAddressLineIndex(); i++) {\n strReturnedAddress.append(returnedAddress.getAddressLine(i)).append(\"\\n\");\n }\n strAdd = strReturnedAddress.toString();\n } else {\n Log.e(\"Current loction address\", \"No Address returned!\");\n }\n } catch (Exception e) {\n e.printStackTrace();\n Log.e(\"Current loction address\", \"Canont get Address!\");\n }\n return strAdd;\n }", "@Override\r\n\t\t\tprotected void onPostExecute(String result) {\r\n\r\n\t\t\t\t// Instantiating ParserTask which parses the json data from\r\n\t\t\t\t// Geocoding webservice\r\n\t\t\t\t// in a non-ui thread\r\n\t\t\t\tParserTask1 parserTask = new ParserTask1();\r\n\r\n\t\t\t\t// Start parsing the places in JSON format\r\n\t\t\t\t// Invokes the \"doInBackground()\" method of the class ParseTask\r\n\t\t\t\tparserTask.execute(result);\r\n\t\t\t}", "private void reverseLookupC_Location_ID() throws Exception\r\n\t{\r\n\t\tStringBuilder sql = new StringBuilder();\r\n\t\tString msg = new String();\r\n\t\tint no = 0;\r\n\r\n\t\t//Reverse Loog up C_Location_ID From JP_Location_Label\r\n\t\tmsg = Msg.getMsg(getCtx(), \"Matching\") + \" : \" + Msg.getElement(getCtx(), \"C_Location_ID\")\r\n\t\t+ \" - \" + Msg.getMsg(getCtx(), \"MatchFrom\") + \" : \" + Msg.getElement(getCtx(), \"JP_Location_Label\") ;\r\n\t\tsql = new StringBuilder (\"UPDATE I_LocationJP i \")\r\n\t\t\t\t.append(\"SET C_Location_ID=(SELECT C_Location_ID FROM C_Location p\")\r\n\t\t\t\t.append(\" WHERE i.JP_Location_Label= p.JP_Location_Label AND p.AD_Client_ID=i.AD_Client_ID) \")\r\n\t\t\t\t.append(\" WHERE i.C_Location_ID IS NULL AND JP_Location_Label IS NOT NULL\")\r\n\t\t\t\t.append(\" AND i.I_IsImported='N'\").append(getWhereClause());\r\n\t\ttry {\r\n\t\t\tno = DB.executeUpdateEx(sql.toString(), get_TrxName());\r\n\t\t\tif (log.isLoggable(Level.FINE)) log.fine(msg +\"=\" + no + \":\" + sql);\r\n\t\t}catch(Exception e) {\r\n\t\t\tthrow new Exception(Msg.getMsg(getCtx(), \"Error\") + sql );\r\n\t\t}\r\n\r\n\t}", "public interface GeocodeService {\n\n /**\n * Gets a list of possible {@link org.gbif.geocode.api.model.Location}s for coordinates.\n *\n * @return a list of Locations that fit the provided coordinates in no particular order\n */\n public List<Location> get(Double latitude, Double longitude, Double uncertaintyDegrees, Double uncertaintyMeters);\n\n /**\n * Gets a list of possible {@link org.gbif.geocode.api.model.Location}s for coordinates.\n *\n * @return a list of Locations that fit the provided coordinates in no particular order\n */\n public List<Location> get(Double latitude, Double longitude, Double uncertaintyDegrees, Double uncertaintyMeters, List<String> layers);\n\n /**\n * Gets a PNG bitmap suitable for using as a client-side cache/lookup table.\n */\n public byte[] bitmap();\n}", "@Override\n protected List<Address> doInBackground(String... locationName) {\n Geocoder geocoder = new Geocoder(getBaseContext());\n List<Address> addresses = null;\n\n try {\n // Getting a maximum of 3 Address that matches the input text\n addresses = geocoder.getFromLocationName(locationName[0], 3);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return addresses;\n }", "@Override\n public void getLocation(String name) {\n mCityName = name;\n Geocoder geocoder = new Geocoder(this, Locale.getDefault());\n try {\n\n List<Address> addresses = geocoder.getFromLocationName(name, 1);\n Address obj = addresses.get(0);\n\n mLat = obj.getLatitude();\n mLng = obj.getLongitude();\n Log.d(\"LOCATION_OF_CITY\", \"\\n Address and data: \"\n + \"\\n Name: \" + name\n + \"\\n Latitude: \" + mLat\n + \"\\n Longitude: \" + mLng);\n\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n\n// SharedPreferences.Editor editor = mSharedPreferences.edit();\n// editor.putString(PREFERENCES_CITYNAME, name);\n// editor.putString(PREFERENCES_LONGITUDE, Double.toString(mLng));\n// editor.putString(PREFERENCES_LATITUDE, Double.toString(mLat));\n// editor.apply();\n\n //see city location on google map\n seeLocation();\n\n }", "public void makeLatLong(String address){\n try {\n JSONObject jsonObject = new JSONObject(address);\n JSONObject result = jsonObject.getJSONObject(\"result\");\n JSONArray addressMatches = result.getJSONArray(\"addressMatches\");\n JSONObject firstResult = addressMatches.getJSONObject(0);\n JSONObject coordinates = firstResult.getJSONObject(\"coordinates\");\n latitude = coordinates.getDouble(\"y\");\n longitude = coordinates.getDouble(\"x\");\n\n Log.i(\"CoY \", Double.toString(latitude));\n Log.i(\"CoX\", Double.toString(longitude));\n } catch (JSONException e) {\n Log.i(\"Error\", e.getMessage());\n e.printStackTrace();\n latitude = 39.7392;\n longitude = -104.9903;\n mainActivity.apiFailed(alarmName);\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n Geocoder geocoder = new Geocoder(getApplicationContext(),Locale.getDefault());\n try {\n List<Address> direc = geocoder.getFromLocation(location.getLatitude(),location.getLongitude(),1);\n Coordenadas.setText(direc.get(0).getAddressLine(0) );\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n }", "public static List<Address> getAddressesFromGeoCoder(Context context,double latitude,double longitude,int addressesToReturn) {\n List<Address> listOfAddresses = null;\n Geocoder gc=new Geocoder(context);\n try {\n listOfAddresses = gc.getFromLocation(latitude, longitude, addressesToReturn);\n\n //This is a test of more than one zip code - will give us 10023 & 10024\n //listOfAddresses = gc.getFromLocation(40.782891, -73.983085, addressesToReturn);\n } catch (IOException e) {\n Log.e(new Object() { }.getClass().getEnclosingClass()+\">\",e.getMessage());\n }\n catch (IllegalArgumentException e) {\n Log.e(new Object() { }.getClass().getEnclosingClass()+\">\",e.getMessage());\n }\n //Could be empty or null - we don't want to return null\n if (listOfAddresses==null){\n listOfAddresses=new ArrayList<>();\n }\n return listOfAddresses;\n }", "public void searchPlace(String value)\n\t\t{ \n\t\t Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault()); \n\t\t try {\n\t\t List<Address> addresses = geoCoder.getFromLocationName(\n\t\t value, 5);\t\t \n\t\t if (addresses.size() > 0) {\n\t\t \t\n\t\t \tdouble latitude= 0.0, longtitude= 0.0;\n\t\t \tGeoPoint p = new GeoPoint(\n\t\t (int) (addresses.get(0).getLatitude() * 1E6), \n\t\t (int) (addresses.get(0).getLongitude() * 1E6));\n\t\t \tlatitude=p.getLatitudeE6()/1E6;\n\t\t\t\t\t\tlongtitude=p.getLongitudeE6()/1E6;\t \n\t\t\t\t\t\tlat = String.valueOf(latitude);\n\t\t\t\t\t\tlongi = String.valueOf(longtitude);\n\t\t\t\t\t\torigin = new LatLng(latitude,longtitude);\n\t\t \tmap.moveCamera( CameraUpdateFactory.newLatLngZoom(origin, (float) 14.0) ); \n\t\t } \n\t\t } catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t }\n\n\n\n\t\t \n\n\t\t}", "@Override\n\t\t\tpublic void run() {\n\n\t\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\t\tHttpClient client = new DefaultHttpClient();\n\t\t\t\tString url = \"https://maps.googleapis.com/maps/api/place/autocomplete/json?input=\"\n\t\t\t\t\t\t+ search\n\t\t\t\t\t\t+ \"&types=geocode&key=AIzaSyCUykPstomDep6-PWmMenJ2rUccTsjUGak\";\n\t\t\t\tHttpGet httpGet = new HttpGet(url);\n\t\t\t\ttry {\n\t\t\t\t\tHttpResponse response = client.execute(httpGet);\n\t\t\t\t\tStatusLine statusLine = response.getStatusLine();\n\t\t\t\t\tint statusCode = statusLine.getStatusCode();\n\t\t\t\t\tif (statusCode == 200) {\n\t\t\t\t\t\tHttpEntity entity = response.getEntity();\n\t\t\t\t\t\tInputStream content = entity.getContent();\n\t\t\t\t\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\t\t\t\t\tnew InputStreamReader(content));\n\t\t\t\t\t\tString line;\n\t\t\t\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\t\t\t\tbuilder.append(line);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t}\n\t\t\t\t} catch (ClientProtocolException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tdecodeString(builder.toString());\n\t\t\t}", "@Override\n protected String adjustGpsLookupAddress(String address) {\n if (address.startsWith(\"TWAY \")) return \"TWAY\";\n return null;\n }", "@Override\n protected List<Address> doInBackground(String... locationName) {\n Geocoder geocoder = new Geocoder(BookingActivity.this);\n List<Address> addresses = null;\n\n try {\n // Getting a maximum of 3 Address that matches the input text\n addresses = geocoder.getFromLocationName(locationName[0], 3);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return addresses;\n }", "private void getDeviceLocation(){\n Log.d(TAG,\"get device location currently\");\n mFusedLocationProviderClient= LocationServices.getFusedLocationProviderClient(this);\n try{\n if(mLocationPermissionGranted){\n @SuppressLint(\"MissingPermission\") final Task location = mFusedLocationProviderClient.getLastLocation();\n location.addOnCompleteListener(new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if(task.isSuccessful()){\n Log.d(TAG,\"onComplete: found Location\");\n mLastKnownLocation= (Location) task.getResult();\n moveCamera(new LatLng(mLastKnownLocation.getLatitude(),mLastKnownLocation.getLongitude()),DEFAULT_ZOOM);\n\n Geocoder geocoder;\n List<Address> addresses;\n geocoder = new Geocoder(MapsActivity.this, Locale.getDefault());\n\n try {\n addresses = geocoder.getFromLocation(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude(), 1); // Here 1 represent max location result to returned, by documents it recommended 1 to 5\n LatLng latLng = new LatLng(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude());\n\n address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()\n city = addresses.get(0).getLocality();\n state = addresses.get(0).getAdminArea();\n String country = addresses.get(0).getCountryName();\n postalCode = addresses.get(0).getPostalCode();\n String knownName = addresses.get(0).getFeatureName(); // Only\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n markerOptions.title(address);\n mMap.clear();//Not sure\n mMap.addMarker(markerOptions);\n Marker here = mMap.addMarker(markerOptions.title(address + \", \" + city + \", \" + state + \", \" + country\n + \", \" + postalCode + \", \" + knownName));\n here.showInfoWindow();\n } catch (IOException e) {\n e.printStackTrace();\n } }else {\n Log.d(TAG, \"onComplete: current location is null\");\n Toast.makeText(MapsActivity.this, \"unable to get current location\",Toast.LENGTH_SHORT).show();\n getLocationPermission();\n }\n }\n });\n\n }\n }catch (SecurityException e){\n Log.e(TAG,\"getDeviceLocation: SecurityException: \" + e.getMessage() );\n }\n\n\n\n }", "public void buscarLugar(){\n String lugar= tv_lugar.getText().toString().trim();\n ubicacionEncontrada=false;\n this.geocoder= new Geocoder(getActivity());\n this.lista = new ArrayList<>();\n\n try {\n lista =geocoder.getFromLocationName(lugar,1);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n if(lista.size()>0){\n this.localizacion= lista.get(0);\n\n // Snackbar.make(myView,\"Error al crear la quedada\", Snackbar.LENGTH_SHORT).show();\n ubicacionEncontrada=true;\n Log.i(\"UBICACION A BUSCAR\", localizacion.toString());\n this.latLng = new LatLng(localizacion.getLatitude(), localizacion.getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 12f));\n this.markerOptions = new MarkerOptions().position(latLng).title(localizacion.getAddressLine(0));\n\n mMap.addMarker(markerOptions);\n\n\n }\n\n }", "@Override\r\n public void onCameraChange(CameraPosition cameraPosition)\r\n {\n locationModel.setLatitude(Double.toString(cameraPosition.target.latitude));\r\n locationModel.setLongitude(Double.toString(cameraPosition.target.longitude));\r\n lat=cameraPosition.target.latitude;\r\n lang=cameraPosition.target.longitude;\r\n getAddressFromLatLng();\r\n// LocationAddress.getAddressFromLocation(cameraPosition.target.latitude, cameraPosition.target.longitude,\r\n// getApplicationContext(), new GeocoderHandler());\r\n }", "@Override\n protected MarkerItem doInBackground(MarkerItem... locationName) {\n Geocoder geocoder = new Geocoder(getBaseContext());\n List<Address> addresses = null;\n MarkerItem name = locationName[0];\n try {\n // Getting a maximum of 1 Address that matches the input text\n addresses = geocoder.getFromLocationName(name.getAddress(), 1);\n if (addresses != null && addresses.size() >= 1) {\n name.setPlaceItem(addresses.get(0));\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n return name;\n }", "@Override\n public void onLocationChanged(Location location) {\n Log.i(TAG,\"Location Listener start\");\n if(oneTime==0){\n \tgooglemap.setMyLocationEnabled(true);\n \t\tgooglemap.setMapType(GoogleMap.MAP_TYPE_HYBRID);//set map type this is sattelite map\n \t\t\n \t\n \n \tString coordinates[] = {\"\"+location.getLatitude(), \"\"+location.getLongitude()};\n \tmyLocLat = Double.parseDouble(coordinates[0]);\n \tmyLocLong = Double.parseDouble(coordinates[1]);\n \tLatLng ll=new LatLng(myLocLat, myLocLong);//create latlng object for current location\n \tgooglemap.moveCamera(CameraUpdateFactory.newLatLng(ll));//show current location in google map\n \t\t\tgooglemap.animateCamera(CameraUpdateFactory.zoomTo(15));//zoom in google map value 2-21\n \t\t\t//pos=googlemap.addMarker(new MarkerOptions().position(new LatLng(myLocLat, myLocLong)).snippet(\"latitude: \"+myLocLat+\"longitude: \"+myLocLong).title(\"youe are here\"));\n\t\t\t\t\n \t\t\t Geocoder gcd = new Geocoder(getApplicationContext(), Locale.getDefault());\n \t\t\t List<Address> addresses = null;\n\t\t\t\ttry {\n\t\t\t\t\taddresses = gcd.getFromLocation(location.getLatitude(),location.getLongitude(), 1);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n \t\t\t // String text=(addresses!=null)?\"City : \"+addresses.get(0).getSubLocality()+\"\\n Country : \"+addresses.get(0).getCountryName():\"Unknown Location\";\n\t\t\t\t \n\t\t\t\tString text=(addresses!=null)? addresses.get(0).getAddressLine(2):\"Unknown Location\";\n \t\t\t \n\t\t\t\tlocationCity = text.substring(0,text.indexOf(\",\"));\n \t\t\t\n \t\t\tpos=googlemap.addMarker(new MarkerOptions().position(new LatLng(myLocLat, myLocLong)).snippet(\"latitude: \"+myLocLat+\"longitude: \"+myLocLong).title(\"My location: \"+locationCity));\n \t\t\tpos.showInfoWindow();\n\t\t\t\n \t\n \t\t\toneTime++;\n }\n \t\n\n }", "@Override\n\t\tprotected String doInBackground(String... params) {\n\t\t\tgetLatLongFromAddress(from);\n\t\t\tgetLatLongToAddress(to);\n\t\t\treturn null;\n\t\t}", "@Override\n public void onLocationChanged(Location location) {\n\n try {\n Geocoder geocoder = new Geocoder(getActivity(), Locale.getDefault());\n List<Address> addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);\n address.setText(address.getText() + \"\\n\"+addresses.get(0).getAddressLine(0));\n }catch(Exception e)\n {\n\n }\n\n }", "@Override\n protected void onHandleIntent(Intent intent) {\n Geocoder geocoder = new Geocoder(this, Locale.getDefault());\n if (intent == null) {\n return;\n }\n String errorMessage = \"\";\n\n // Get the location passed to this service through\n Location location = intent.getParcelableExtra(\n Constants.LOCATION_DATA_EXTRA);\n //Get the receiver passed to this service through extra\n receiver = intent.getParcelableExtra(Constants.RECEIVER);\n\n List<Address> addresses = null;\n\n try {\n //Returns one address corresponding to this geographical location\n addresses = geocoder.getFromLocation(\n location.getLatitude(),\n location.getLongitude(),\n 1);\n } catch (IOException ioException) {\n // Catch network or other I/O problems.\n errorMessage = getString(R.string.service_not_available);\n Log.e(TAG, errorMessage, ioException);\n } catch (IllegalArgumentException illegalArgumentException) {\n // Catch invalid latitude or longitude values.\n errorMessage = getString(R.string.invalid_lat_long_used);\n Log.e(TAG, errorMessage + \". \" +\n \"Latitude = \" + location.getLatitude() +\n \", Longitude = \" +\n location.getLongitude(), illegalArgumentException);\n }\n\n // Handle case where no address was found.\n if (addresses == null || addresses.size() == 0) {\n if (errorMessage.isEmpty()) {\n errorMessage = getString(R.string.no_address_found);\n Log.e(TAG, errorMessage);\n }\n deliverResultToReceiver(Constants.FAILURE_RESULT, errorMessage);\n } else {\n Address address = addresses.get(0);\n ArrayList<String> addressFragments = new ArrayList<String>();\n\n // Fetch just the zipcode\n addressFragments.add(address.getPostalCode());\n\n Log.i(TAG, getString(R.string.address_found));\n //Sends results back to LocationActivity\n deliverResultToReceiver(Constants.SUCCESS_RESULT,\n TextUtils.join(System.getProperty(\"line.separator\"),\n addressFragments));\n }\n }", "@Override\n public void run() {\n convertAddresses();\n }", "@Override\n protected void onReceiveResult(int resultCode, Bundle resultData) {\n String mLocality = resultData.getString(Constants.RESULT_DATA_KEY);\n\n // Show a toast message if an address was found.\n if (resultCode == Constants.SUCCESS_RESULT) {\n\n Uri queryUri = LocationsContract.LocationsEntry.CONTENT_URI;\n String[] projection = new String[]{LocationsContract.LocationsEntry.COLUMN_PLACEID};\n String selection = LocationsContract.LocationsEntry.COLUMN_PLACEID + \"=?\";\n String[] selectionArgs = new String[]{UNIQUE_GEOLOCATION_ID};\n\n Cursor locationCursor = getContentResolver().query(queryUri, projection, selection, selectionArgs, null);\n\n if(locationCursor!=null) {\n int isGeolocalityPresent = locationCursor.getCount();\n if (isGeolocalityPresent == 0) {\n SunshineLocationUtils.insertLocation(MainActivity.this, mLocality, mCurrentLocation.getLatitude(),\n mCurrentLocation.getLongitude(), UNIQUE_GEOLOCATION_ID);\n } else {\n SunshineLocationUtils.updateLocation(MainActivity.this, mLocality, mCurrentLocation.getLatitude(),\n mCurrentLocation.getLongitude());\n }\n\n locationCursor.close();\n } else {\n Toast noAddress = Toast.makeText(MainActivity.this, \"\" + getString(R.string.no_address_found), Toast.LENGTH_LONG);\n noAddress.show();\n }\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n this.googleMap = googleMap;\n final String email = getIntent().getStringExtra(Constant.PROFILE_EMAIL);\n\n /**\n * Setup an observable to handle the results of the search\n * query.\n *\n * If a charity was found with the extracted email, attempt to\n * convert their address to a specific latitude and longitude. */\n final MultiObservable<String> charityAddress = new MultiObservable<>();\n charityAddress.addObserver(new Observer() {\n @Override\n public void update(Observable o, Object arg) {\n getLocationFromAddress(getApplicationContext(), (String) arg);\n }\n });\n\n FirebaseFirestore db = FirebaseFirestore.getInstance();\n db.collection(\"users\")\n .get()\n .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {\n @Override\n public void onComplete(@NonNull Task<QuerySnapshot> task) {\n if (task.isSuccessful()) {\n int count = 0;\n for (QueryDocumentSnapshot doc : task.getResult()) {\n if (\n doc.get(\"type\").equals(\"charity\")\n && doc.get(\"email\").equals(email)\n ) {\n String address = String.format(\n \"%s, %s, %s\",\n doc.get(\"address\"), doc.get(\"state\"),\n doc.get(\"postcode\")\n );\n charityAddress.setValue(address);\n\n Log.d(TAG, \"Found charity with email: \" + email);\n Log.d(TAG, \"Charity address: \" + address);\n } else if (++count == task.getResult().size()) {\n Log.d(TAG, \"Failed to find charity with email: \" + email);\n }\n }\n } else {\n Log.w(\n TAG, \"Error getting documents.\",\n task.getException());\n }\n }\n });\n }", "@Override\r\n protected Void doInBackground(Void... arg0) {\n findNearLocation();\r\n return null;\r\n }", "public List<Latlng_data> getLocationFromString(String address)\n {\n\n List<Latlng_data> Ldata = new ArrayList<Latlng_data>();\n\n try\n {\n String URL = \"http://maps.google.com/maps/api/geocode/json?address=\" + URLEncoder.encode(address, \"UTF-8\") + \"&en&sensor=false\";\n\n JSONObject jsonObject = new JSONObject(new WebServiceHelper().performGetCall(URL));\n\n JSONArray results = jsonObject.getJSONArray(\"results\");\n\n Latlng_data l;\n for (int j = 0; j < results.length(); j++)\n {\n\n l = new Latlng_data();\n\n double lng = results.getJSONObject(j).getJSONObject(\"geometry\").getJSONObject(\"location\").getDouble(\"lng\");\n\n double lat = results.getJSONObject(j).getJSONObject(\"geometry\").getJSONObject(\"location\").getDouble(\"lat\");\n String addrsssssName = results.getJSONObject(j).getString(\"formatted_address\");\n l.setAddress(addrsssssName != null ? addrsssssName : \"\");\n\n l.setLat(lng);\n l.setLng(lat);\n\n Ldata.add(l);\n }\n\n }\n catch (Exception e)\n {\n return Ldata;\n }\n catch (Error e)\n {\n return Ldata;\n }\n\n return Ldata;\n }", "@Override\n\t\tpublic boolean onTap(GeoPoint p, MapView mapView) \n\t\t{\n\t\t\tif(p!=null){\n\t longitudes = \"\"+p.getLongitudeE6()/1E6;\n latitudes = \"\"+p.getLatitudeE6()/1E6;\n //MapOverlay mapOverlay = new MapOverlay(p,MapViewActivity.this);\n\t //List<Overlay> listOfOverlays = mapView.getOverlays();\n\t //listOfOverlays.add(mapOverlay);\n\t // mapView.postInvalidate();\n \n \n Handler h = new Handler() {\n\n @Override\n public void handleMessage(Message msg) {\n\n if (msg.what != 1) { // code if not connected\n \t\n \tToast tt=Toast.makeText(MapViewActivity.this, \"Sorry! Network is not Responding\", 3000);\n\t\t\t\t\t\ttt.setGravity(Gravity.CENTER, 0, 15);\n\t\t\t\t\t\ttt.show();\n } else\n { // code if connected\n \tnameValuePairs.add(new BasicNameValuePair(\"latd\",latitudes));\n \t\t\tnameValuePairs.add(new BasicNameValuePair(\"lotd\",longitudes));\n \t\t\tnameValuePairs.add(new BasicNameValuePair(\"id\",LoginId));\n \t\t\tArrayList<NameValuePair> result=db.getServerData(nameValuePairs,\"updatecoordinates.php\");\n \t\t\tnameValuePairs.clear();\n \t\t\tfor(int i=0;i<result.size();i++)\n \t\t\t{\n \t\t\t\ts=result.get(i).getName();\n \t\t\t\tif(s.equals(\"Error\"))\n \t\t\t\t{\n \t\t\t\t\tToast tt=Toast.makeText(MapViewActivity.this, \"Adress Updated\", 3000);\n \t\t\t\t\ttt.setGravity(Gravity.CENTER, 0, 15);\n \t\t\t\t\ttt.show();\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tToast tt=Toast.makeText(MapViewActivity.this, \"Adress Updated Error\", 3000);\n \t\t\t\t\ttt.setGravity(Gravity.CENTER, 0, 15);\n \t\t\t\t\ttt.show();break;\n \t\t\t\t}\n \t\t\t}\n \t\t\tresult.clear();\n }\n\n }\n };\n \t\tisNetworkAvailable(h,5000);\n\t \n\t\t\t\n\t Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault());\n try\n {\n List<Address> addresses = geoCoder.getFromLocation(p.getLatitudeE6() / 1E6, p.getLongitudeE6() / 1E6, 1);\n \n String add = \"\";\n if (addresses.size() > 0) \n {\n for (int i=0; i<addresses.get(0).getMaxAddressLineIndex();i++)\n add += addresses.get(0).getAddressLine(i) + \"\\n\";\n }\n \n Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT).show();\n }\n catch (IOException e)\n { \n e.printStackTrace();\n } \n \n return true;\n\t\t\t}\n else \n return false ; \n\t\t\t\n\t\t}", "private void getLocationFromAddress(Context context, String address) {\n Geocoder coder = new Geocoder(context);\n List<Address> coderResults;\n\n LatLng result = null;\n try {\n coderResults = coder.getFromLocationName(address, 2);\n if (coderResults == null) {\n Log.d(TAG, \"Failed to convert address to LatLng.\");\n Log.d(TAG, \"Address: \" + address);\n return;\n }\n\n Address location = coderResults.get(0);\n initialiseMap(\n new LatLng(location.getLatitude(), location.getLongitude()),\n address\n );\n } catch (IOException e) {\n //\n }\n }", "void beginGeoField();", "private void getLocation() {\n\n }", "@Override\n protected List<Address> doInBackground(String... locationName) {\n Geocoder geocoder = new Geocoder(getBaseContext());\n List<Address> addresses = null;\n\n try {\n // Getting a maximum of 10 Address that matches the input text\n addresses = geocoder.getFromLocationName(locationName[0], 10);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n return addresses;\n }", "public void getAddress() {\n if (mLocation != null) {\n mBusinessAddress = AppUtil.getAddress(getContext(), mLocation);\n } else {\n mLocation = null;\n if (ActivityCompat.checkSelfPermission(getContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getContext(), android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationManager locationManager = (LocationManager) getActivity().getSystemService(LOCATION_SERVICE);\n Criteria criteria = new Criteria();\n Location currLocation = locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, false));\n if (currLocation != null) {\n mBusinessAddress = AppUtil.getAddress(getContext(), new LatLng(currLocation.getLatitude(), currLocation.getLongitude()));\n } else {\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 5, this);\n if (mCurrLocation != null) {\n mBusinessAddress = AppUtil.getAddress(getContext(), new LatLng(mCurrLocation.getLatitude(), mCurrLocation.getLongitude()));\n } else {\n // Default location in case location search doesn't work on first try\n mBusinessAddress = DiscoverConstants.DEFAULT_LOCATION;\n }\n }\n } else {\n mBusinessAddress = null;\n }\n }\n }", "private static Address getOfficialByAddress(String address) throws Exception {\n\t\tString USER_AGENT = \"Mozilla/5.0\";\n\n\t\tString name = \"\", country = \"US\", zip = \"\", city = \"\", state = \"\", line1 = \"\", line2 = \"\";\n\t\tAddress to = null;\n\t\t// Replaces all strings with '%20' for URL completion\n\t\taddress = address.replace(\" \", \"%20\");\n\t\tString urlString = \"https://www.googleapis.com/civicinfo/v2/representatives?key=AIzaSyAEU9J6KzUL_gXPGi-4S6XekJuEC0JRWjA&address=\" + address;\n\t\tURL url = new URL(urlString);\n\t\tHttpURLConnection con = (HttpURLConnection) url.openConnection();\n\t\t// By default it is GET request\n\t\tcon.setRequestMethod(\"GET\");\n\t\t//add request header\n\t\tcon.setRequestProperty(\"User-Agent\", USER_AGENT);\n\t\t\n\t\t// Reading response from input Stream\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t \n\t\tString output;\n\t\tStringBuffer response = new StringBuffer();\n\t\twhile ((output = in.readLine()) != null) {\n\t\t\tresponse.append(output);\t\n\t\t}\n\t\tin.close();\n\t\t\n\t\t// Constructs JSONOBject to parse the response\n\t\tJSONObject object = new JSONObject(response.toString());\n\t\tJSONArray addresses = object.getJSONArray(\"officials\");\n\t\t\n\t\t// Takes array of individuals response and selects last index of it by default (may be optimized for more specific selections)\n\t\tJSONObject person = addresses.getJSONObject(addresses.length()-1);\n\t\tJSONArray fields = person.getJSONArray(\"address\");\n\t\tJSONObject addressTo = fields.getJSONObject(0);\n\t\t\t\t\n\t\tif(person.has(\"name\"))\n\t\t\tname = person.getString(\"name\");\n\t\t\n\t\tif(addressTo.has(\"zip\"))\n\t\t\tzip = addressTo.getString(\"zip\");\n\t\t\n\t\tif(addressTo.has(\"city\"))\n\t\t\tcity = addressTo.getString(\"city\");\n\t\t\n\t\tif(addressTo.has(\"state\"))\n\t\t\tstate = addressTo.getString(\"state\");\n\t\t\n\t\tif(addressTo.has(\"line2\"))\n\t\t\tline2 = addressTo.getString(\"line2\");\n\t\t\n\t\tif(addressTo.has(\"line1\"))\n\t\t\t line1 = addressTo.getString(\"line1\");\n\t\t\n\t\tto = new Address(name, country, zip, city, state, line2, line1);\n\t\t\n\n\t\treturn to;\n\t\t\n\t \n\t }" ]
[ "0.7746191", "0.7746191", "0.70878536", "0.70206577", "0.69852", "0.69613534", "0.69266605", "0.68930775", "0.68605715", "0.68549097", "0.68549097", "0.68244386", "0.68151975", "0.6780102", "0.6759908", "0.67300594", "0.6723069", "0.6704283", "0.6671883", "0.6671883", "0.6671738", "0.6647361", "0.6627813", "0.6621201", "0.66131306", "0.65915465", "0.6477044", "0.6469319", "0.64500934", "0.64477205", "0.6406652", "0.63795537", "0.6344737", "0.6333172", "0.6319798", "0.63150686", "0.6311176", "0.63086605", "0.62910235", "0.62305456", "0.62164664", "0.61635315", "0.61605364", "0.6153421", "0.61178493", "0.611078", "0.6067142", "0.59773886", "0.59697884", "0.5954139", "0.59508604", "0.59437704", "0.59312457", "0.5918463", "0.59152806", "0.591159", "0.58881307", "0.5875054", "0.58683544", "0.5848634", "0.5832355", "0.58264625", "0.5823639", "0.57765394", "0.5766486", "0.57511437", "0.57480836", "0.5736921", "0.57365006", "0.57313937", "0.57296765", "0.5721314", "0.57187635", "0.57163054", "0.57144916", "0.57125115", "0.5711748", "0.56978923", "0.5695957", "0.5688165", "0.5669798", "0.5650443", "0.563669", "0.56291586", "0.56279856", "0.5625138", "0.5623214", "0.56090283", "0.56046486", "0.5602595", "0.56017107", "0.5599318", "0.5595418", "0.5594855", "0.5590282", "0.55869806", "0.5581631", "0.5580747", "0.5578564", "0.5569017" ]
0.77631205
0
this is fine for desktop, but now i have mobile.... / Spot Spot Spot Spot Spot Spot Spot Spot Spot
protected void getPickSpotULPanel(final ULPanel ulPanel ) { //final ULPanel ulPanel = new ULPanel(); SearchParameters searchParameters = new SearchParameters(); searchParameters.setLatitude(mywebapp.getCurrentLocation().getLatitude()); searchParameters.setLongitude(mywebapp.getCurrentLocation().getLongitude()); searchParameters.setLicensePlate(false); ApiServiceAsync myService = mywebapp.getApiServiceAsync(); myService.search(searchParameters, new AsyncCallback() { public void onFailure(Throwable caught) { getMessagePanel().displayMessage("Error:" + caught.getMessage()); } public void onSuccess(Object result) { MobileResponse mobileResponse = (MobileResponse) result; ulPanel.add(addSpotNotHere()); for (LocationResult locationResult : mobileResponse.getLocationResults()) { ListItem listItem = new ListItem(); Anchor anchor = new Anchor(locationResult.getLabel()); listItem.add(anchor); ulPanel.add(listItem); if (locationResult.getSolrDocument() == null) { pickLocationMap.put(anchor, locationResult); anchor.addClickHandler(createSpotFromLocationHandler); } else { Long spotId = locationResult.getSolrDocument().getFirstLong("spotid_l"); String targetHistoryToken = "#" + MyWebApp.LEAVE_SPOT_MARK + spotId; anchor.setHref(targetHistoryToken); } } ulPanel.add(addSpotNotHere()); } }); //return ulPanel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testDesktopNonIphone()\n\t{\n\n\t\tfor (final String ua : desktop_ua)\n\t\t{\n\t\t\tLOG.info(\"Testing :\" + ua);\n\t\t\tassertTrue(\"Api fails to identify as a desktop device: (\" + ua + \")\", detectionService.isDesktop(ua));\n\t\t\tassertFalse(\"Api wrongly identify as a iphone: (\" + ua + \")\", detectionService.isiPhoneCapable(ua,\n\t\t\t\t\tnew ArrayList<String>()));\n\t\t\tassertFalse(\"Api wrongly identify as a mobile device: (\" + ua + \")\", detectionService.isMobileDevice(ua));\n\t\t}\n\n\t}", "private boolean m21865i() {\n TelephonyManager telephonyManager = (TelephonyManager) this.f16409k.getSystemService(\"phone\");\n if (telephonyManager != null) {\n return telephonyManager.getNetworkOperatorName().equalsIgnoreCase(\"android\");\n }\n return false;\n }", "private boolean isXLargeTablet() {\n if (((WindowManager) this.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation() % 180 != 0)\n return true;\n return false;\n }", "public boolean isTablet();", "private String getMobileIP(){\n try {\n for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();\n en.hasMoreElements();) {\n NetworkInterface networkinterface = en.nextElement();\n for (Enumeration<InetAddress> enumIpAddr = networkinterface.getInetAddresses(); enumIpAddr.hasMoreElements();) {\n InetAddress inetAddress = enumIpAddr.nextElement();\n if (!inetAddress.isLoopbackAddress()) {\n return inetAddress.getHostAddress().toString();\n }\n }\n }\n } catch (Exception ex) {\n Log.e(\"Current IP\", ex.toString());\n }\n return null;\n }", "public String getImagePlatformString() {\n\t\tMap<Short, List<DevicePropertyAttrOptionObj>> optionMap = DevicePropertyManage.getInstance().getDeviceModelOptionsMapping(DeviceInfo.SPT_IMAGE_INTERNAL_NAME);\r\n\t\tString imageVerNum = getImageVersionNum();\r\n\t\t\r\n//\t\t//version map\r\n//\t\tIterator<Entry<Short, String>> latestVerItem = latestVerMap.entrySet().iterator();\r\n//\t\twhile(latestVerItem.hasNext()){\r\n//\t\t\tEntry<Short, String> latestVerEntry = latestVerItem.next();\r\n//\t\t\tif(NmsUtil.compareSoftwareVersion(imageVerNum, latestVerEntry.getValue()) < 0){\r\n//\t\t\t\tlatestVerItem.remove();\r\n//\t\t\t}\r\n//\t\t}\r\n\t\t\r\n\t\t//filter platform\r\n\t\tIterator<Entry<Short, List<DevicePropertyAttrOptionObj>>> optionIterator = optionMap.entrySet().iterator();\r\n\t\twhile(optionIterator.hasNext()){\r\n\t\t\tEntry<Short, List<DevicePropertyAttrOptionObj>> optionEntry = optionIterator.next();\r\n//\t\t\tif(!latestVerMap.containsKey(optionEntry.getKey())){\r\n//\t\t\t\toptionIterator.remove();\r\n//\t\t\t\tcontinue;\r\n//\t\t\t}\r\n\t\t\tif(optionEntry.getValue() == null || optionEntry.getValue().isEmpty()){\r\n\t\t\t\toptionIterator.remove();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tboolean pFound = false;\r\n\t\t\tfor(DevicePropertyAttrOptionObj optObj : optionEntry.getValue()){\r\n\t\t\t\tif(optObj.getValue().equals(this.productName)){\r\n\t\t\t\t\tpFound = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!pFound){\r\n\t\t\t\toptionIterator.remove();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tString[] supportVersions = (String[])AhConstantUtil.getEnumValues(Device.SUPPORTED_HIVEOS_VERSIONS, optionEntry.getKey());\r\n\t\t\tif(supportVersions == null){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tpFound = false;\r\n\t\t\tfor(String versionNum : supportVersions){\r\n\t\t\t\tif(NmsUtil.compareSoftwareVersion(versionNum, imageVerNum) == 0){\r\n\t\t\t\t\tpFound = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!pFound){\r\n\t\t\t\toptionIterator.remove();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tString pName = null;\r\n\t\tfor (Short apModel : optionMap.keySet()) {\r\n\t\t\tpName = AhConstantUtil.getString(Device.NAME, apModel);\r\n\t\t\tif(StringUtils.isEmpty(pName) || \"null\".equalsIgnoreCase(pName)){\r\n\t\t\t\tcontinue;\r\n\t\t\t}else if (sb.length() == 0) {\r\n\t\t\t\tsb.append(pName);\r\n\t\t\t} else {\r\n\t\t\t\tsb.append(\", \").append(pName);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn sb.toString();\r\n\t}", "private boolean isSmallTablet(DisplayMetrics metrics) {\n float dpWidth = metrics.widthPixels / metrics.density;\n return (dpWidth >= 600 && dpWidth < 720);\n }", "private boolean m21863g() {\n TelephonyManager telephonyManager = (TelephonyManager) this.f16409k.getSystemService(\"phone\");\n if (telephonyManager != null) {\n String deviceId = telephonyManager.getDeviceId();\n for (String equalsIgnoreCase : f16398b) {\n if (equalsIgnoreCase.equalsIgnoreCase(deviceId)) {\n return true;\n }\n }\n }\n return false;\n }", "public boolean isTablet() { \n\t \tTelephonyManager telephony = (TelephonyManager) activity.getSystemService(Context.TELEPHONY_SERVICE); \n\t \tint type = telephony.getPhoneType();\n\t \tif (type == TelephonyManager.PHONE_TYPE_NONE) { return true;} \n\t \t return false; \n\t }", "@Override\r\npublic boolean isOnScreen() {\nreturn false;\r\n}", "public String deviceType(){\n String deviceType;\n size = driver.manage().window().getSize();\n if((size.getHeight()>800)&&(size.getWidth()>500)){\n return deviceType = \"iPad\";\n } else {\n return deviceType = \"iPhone\";\n }\n }", "@Override\n public boolean workaroundBySurfaceProcessing() {\n return isHuaweiMate20() || isHuaweiMate20Pro() || isHuaweiP40Lite();\n }", "boolean onPhone() {\n\t\treturn ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)\n\t\t\t\t< Configuration.SCREENLAYOUT_SIZE_LARGE);\n\t}", "@Test\n public void testMobileAndroid() {\n try {\n\n System.out.println(\"Running test on Android mobile browser\");\n DeviceDescription description = new DeviceDescription();\n description.setOsType(\"Android\");\n description.setOsVersion(\">=6.0\");\n\n Device device = MobileLab.lockDevice(description);\n Browser browser2 = BrowserFactory.launch(BrowserType.CHROME, device);\n navigateBrowser(browser2);\n Reporter.reportEvent(\"Image of Mobile\", \"Using Chrome on Android\", Status.Passed, browser2.getSnapshot());\n windowsSync(1500);\n\n }\n catch (GeneralLeanFtException glftex) {System.out.println(\"GeneralLeanFtException: \" + glftex.getMessage());}\n catch (InterruptedException iex) {System.out.println(\"InterruptedException: \" + iex.getMessage());}\n catch (ReportException rex){System.out.println(\"ReportException: \" + rex.getMessage());}\n catch (StringIndexOutOfBoundsException soobEx) {System.out.println(\"StringIndexOutOfBoundsException: \" + soobEx.getMessage());}\n }", "private boolean m21857b() {\n return Build.FINGERPRINT.startsWith(\"generic\") || Build.MODEL.contains(\"google_sdk\") || Build.MODEL.toLowerCase().contains(\"droid4x\") || Build.MODEL.contains(\"Emulator\") || Build.MODEL.contains(\"Android SDK built for\") || Build.MANUFACTURER.contains(\"Genymotion\") || Build.HARDWARE.equals(\"goldfish\") || Build.HARDWARE.equals(\"vbox86\") || Build.PRODUCT.equals(\"sdk\") || Build.PRODUCT.equals(\"google_sdk\") || Build.PRODUCT.equals(\"sdk_x86\") || Build.PRODUCT.equals(\"vbox86p\") || Build.BOARD.toLowerCase().contains(\"nox\") || Build.BOOTLOADER.toLowerCase().contains(\"nox\") || Build.HARDWARE.toLowerCase().contains(\"nox\") || Build.PRODUCT.toLowerCase().contains(\"nox\") || Build.SERIAL.toLowerCase().contains(\"nox\") || Build.FINGERPRINT.startsWith(\"unknown\") || Build.FINGERPRINT.contains(\"Andy\") || Build.FINGERPRINT.contains(\"ttVM_Hdragon\") || Build.FINGERPRINT.contains(\"vbox86p\") || Build.HARDWARE.contains(\"ttVM_x86\") || Build.MODEL.equals(\"sdk\") || Build.MODEL.contains(\"Droid4X\") || Build.MODEL.contains(\"TiantianVM\") || Build.MODEL.contains(\"Andy\") || (Build.BRAND.startsWith(\"generic\") && Build.DEVICE.startsWith(\"generic\"));\n }", "private static String m4387a() {\n String str;\n String str2 = \"\";\n try {\n Class cls = Class.forName(\"android.os.SystemProperties\");\n Method method = cls.getMethod(\"get\", new Class[]{String.class});\n if (method != null) {\n if (((String) method.invoke(cls.newInstance(), new Object[]{\"telephony.lteOnCdmaDevice\"})).equals(\"1\")) {\n Method method2 = Class.forName(\"com.huawei.android.hwnv.HWNVFuncation\").getMethod(\"getNVIMEI\", new Class[0]);\n if (method2 == null) {\n return str2;\n }\n method2.setAccessible(true);\n str = (String) method2.invoke(null, new Object[0]);\n return str;\n }\n }\n } catch (Throwable th) {\n }\n str = str2;\n return str;\n }", "private static boolean supportedPlatform() {\n return System.getProperty(\"os.name\").startsWith(\"iPhone\");\n }", "private boolean canReuseScreenNail() {\n\t\treturn false;\n\t}", "private void m76768f() {\n m76770h();\n m76769g();\n }", "String getMobile(String name);", "private boolean isMobileconnected(){\n\t\tConnectivityManager connMgr\n\t\t= (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\tNetworkInfo networkInfo\n\t\t= connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); \n\t\tboolean isMobileConn = networkInfo.isConnected();\n\t\treturn isMobileConn;\n\t}", "public void mo68520e() {\n super.mo68520e();\n C26780aa.m87959a(this.itemView, mo75290r(), this.f77546j);\n C24942al.m81837c(mo75261ab(), this.f89221bo);\n C24958f.m81905a().mo65273b(this.f77546j).mo65266a(\"result_ad\").mo65276b(\"otherclick\").mo65283e(\"video\").mo65270a(mo75261ab());\n }", "private static void m14759c(C8368ah c8368ah) {\n int[] iArr = new int[2];\n c8368ah.view.getLocationOnScreen(iArr);\n c8368ah.values.put(\"android:slide:screenPosition\", iArr);\n }", "private String m81849m() {\n String str;\n if (this.f58083o) {\n str = UrlUtil.m84496b(UrlUtil.m84494a(this.f58071c, C6969H.m41409d(\"G738BEA0FAD3C\")));\n } else {\n str = this.f58070b;\n }\n if (!TextUtils.isEmpty(str)) {\n this.f58072d = Uri.parse(str);\n }\n return str;\n }", "public static void lauchFromPillScreen(AppiumDriver<WebElement> driver,String appName)\t\t\n\t{\t\n\t\tpillScreen_PO pillScreen_PO=new pillScreen_PO((AppiumDriver<WebElement>) driver);\n\t\ttouchAction = new TouchAction(driver);\n\t\tWebDriverWait wait = new WebDriverWait(driver,10);\n\t//\twait = new WebDriverWait(driver,10);\t\t\t\n\t\tsize = driver.manage().window().getSize();\n\t\tSystem.out.println(size);\n\t\tint startx = (int)(size.width * 0.80);\n\t\tint endx = (int)(size.width * 0.20);\n\t\tint starty = size.height/2;\n\t\tint endy = size.height/8;\n\t\tSystem.out.println(\"startx = \" + startx + \" ,endx = \" + endx + \" , starty = \" + starty);\n\t\t//Swipe from left to right\n\t\tSystem.out.println(\"test is failing here \");\n\t\t//touchAction.press(endx,starty).moveTo(startx, starty).release().perform();\n\t\ttouchAction.press(400,510).moveTo(630, 510).release().perform();\n\n\t\tif(appName==\"Cricket\")\n\t\t{\n\t\t\tpillScreen_PO.cricket().click();\n\t\t}\n\t\tif(appName==\"Recharge\")\n\t\t{\n\t\t\tpillScreen_PO.recharge().click();\n\t\t}\n\t\tif(appName==\"Zomato\")\n\t\t{\n\t\t\tpillScreen_PO.zomato().click();\n\t\t}\n\t\tif(appName==\"Bus Tickets\")\n\t\t{\n\t\t\tpillScreen_PO.busTickets().click();\n\t\t}\n\t\tif(appName==\"News\")\n\t\t{\n\t\t\tpillScreen_PO.news().click();\n\t\t}\n\t\tif(appName==\"Rail Info\")\n\t\t{\n\t\t\tpillScreen_PO.railInfo().click();\n\t\t}\n\n\t}", "protected void mo6255a() {\n }", "private static boolean m4017c() {\n String property = System.getProperty(\"java.runtime.name\");\n if (property == null) {\n return false;\n }\n return property.toLowerCase(Locale.US).contains(AlibcMiniTradeCommon.PF_ANDROID);\n }", "public static boolean isSingaporeMobile(String mobilePhone)\n {\n\t\tif (mobilePhone == null)\n\t\t\treturn false;\n\n if(!mobilePhone.startsWith(\"+\"))\n mobilePhone = canonicalizeMobilePhone(mobilePhone);\n\n //local mobile should be >=11;\n if(mobilePhone.startsWith(\"+65\"))\n return true;\n\n return false;\n\t}", "public void enterSiteAsFirstTimeVisitor(){\n if(!browser.browserDriver().browser().isDesktop()) {\n enterSiteWithCleanBrowser();\n if (browser.browserDriver().browser().isTablet() && ((AppiumDriver) browser.driver()).getOrientation() == ScreenOrientation.PORTRAIT) {\n ((AppiumDriver) browser.driver()).rotate(ScreenOrientation.LANDSCAPE);\n }\n } else {\n navigateToHome();\n }\n }", "private static boolean isPhoneTypeLTE() {\n return true;\n }", "public static HashSet<String> m4388a(Context context) {\n int i = 0;\n HashSet<String> hashSet = new HashSet();\n String str = Build.MODEL;\n Build.BRAND.toLowerCase().trim();\n try {\n String deviceId;\n Class cls;\n Field field;\n int parseInt;\n Field field2;\n String trim;\n Class cls2;\n Method method;\n TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(\"phone\");\n if (telephonyManager != null) {\n deviceId = (context.getPackageManager().checkPermission(\"android.permission.READ_PHONE_STATE\", context.getPackageName()) == 0 ? 1 : i) != 0 ? telephonyManager.getDeviceId() : null;\n } else {\n deviceId = null;\n }\n if (deviceId != null && deviceId.indexOf(\"0000000000\") >= 0) {\n deviceId = \"\";\n }\n if (!(deviceId == null || deviceId == \"\")) {\n hashSet.add(deviceId + \"|z1\");\n }\n try {\n int parseInt2;\n telephonyManager = (TelephonyManager) context.getSystemService(\"phone\");\n cls = Class.forName(\"com.android.internal.telephony.Phone\");\n try {\n field = cls.getField(\"GEMINI_SIM_1\");\n field.setAccessible(true);\n parseInt = Integer.parseInt(field.get(null).toString());\n field2 = cls.getField(\"GEMINI_SIM_2\");\n field2.setAccessible(true);\n parseInt2 = Integer.parseInt(field2.get(null).toString());\n } catch (Throwable th) {\n parseInt = i;\n parseInt2 = 1;\n }\n Method declaredMethod = TelephonyManager.class.getDeclaredMethod(\"getDeviceIdGemini\", new Class[]{Integer.TYPE});\n trim = ((String) declaredMethod.invoke(telephonyManager, new Object[]{Integer.valueOf(parseInt)})).trim();\n deviceId = ((String) declaredMethod.invoke(telephonyManager, new Object[]{Integer.valueOf(parseInt2)})).trim();\n if (!(hashSet.contains(trim) || trim == null || trim.indexOf(\"0000000000\") != -1)) {\n hashSet.add(trim + \"|a1\");\n }\n if (!(hashSet.contains(deviceId) || deviceId == null || deviceId.indexOf(\"0000000000\") != -1)) {\n hashSet.add(deviceId + \"|a2\");\n }\n } catch (Throwable th2) {\n }\n try {\n telephonyManager = (TelephonyManager) context.getSystemService(\"phone\");\n cls = Class.forName(\"com.android.internal.telephony.Phone\");\n try {\n field = cls.getField(\"GEMINI_SIM_1\");\n field.setAccessible(true);\n parseInt = Integer.parseInt(field.get(null).toString());\n field2 = cls.getField(\"GEMINI_SIM_2\");\n field2.setAccessible(true);\n i = Integer.parseInt(field2.get(null).toString());\n } catch (Throwable th3) {\n parseInt = i;\n i = 1;\n }\n Method method2 = TelephonyManager.class.getMethod(\"getDefault\", new Class[]{Integer.TYPE});\n TelephonyManager telephonyManager2 = (TelephonyManager) method2.invoke(telephonyManager, new Object[]{Integer.valueOf(parseInt)});\n telephonyManager = (TelephonyManager) method2.invoke(telephonyManager, new Object[]{Integer.valueOf(i)});\n trim = telephonyManager2.getDeviceId().trim();\n deviceId = telephonyManager.getDeviceId().trim();\n if (!(hashSet.contains(trim) || trim == null || trim.indexOf(\"0000000000\") != -1)) {\n hashSet.add(trim + \"|b1\");\n }\n if (!(hashSet.contains(deviceId) || deviceId == null || deviceId.indexOf(\"0000000000\") != -1)) {\n hashSet.add(deviceId + \"|b2\");\n }\n } catch (Throwable th4) {\n }\n try {\n cls2 = Class.forName(\"com.android.internal.telephony.PhoneFactory\");\n deviceId = (String) cls2.getMethod(\"getServiceName\", new Class[]{String.class, Integer.TYPE}).invoke(cls2, new Object[]{\"phone\", Integer.valueOf(1)});\n trim = ((TelephonyManager) context.getSystemService(\"phone\")).getDeviceId().trim();\n deviceId = ((TelephonyManager) context.getSystemService(deviceId)).getDeviceId().trim();\n if (!(hashSet.contains(trim) || trim == null || trim.indexOf(\"0000000000\") != -1)) {\n hashSet.add(trim + \"|c1\");\n }\n if (!(hashSet.contains(deviceId) || deviceId == null || deviceId.indexOf(\"0000000000\") != -1)) {\n hashSet.add(deviceId + \"|c2\");\n }\n } catch (Throwable th5) {\n }\n try {\n cls2 = Class.forName(\"android.telephony.MSimTelephonyManager\");\n Object systemService = context.getSystemService(\"phone_msim\");\n method = cls2.getMethod(\"getDeviceId\", new Class[]{Integer.TYPE});\n String trim2 = ((String) method.invoke(systemService, new Object[]{Integer.valueOf(0)})).trim();\n deviceId = ((String) method.invoke(systemService, new Object[]{Integer.valueOf(1)})).trim();\n if (!(hashSet.contains(trim2) || trim2 == null || trim2.indexOf(\"0000000000\") != -1)) {\n hashSet.add(trim2 + \"|d1\");\n }\n if (!(hashSet.contains(deviceId) || deviceId == null || deviceId.indexOf(\"0000000000\") != -1)) {\n hashSet.add(deviceId + \"|d2\");\n }\n } catch (Throwable th6) {\n }\n try {\n telephonyManager = (TelephonyManager) context.getSystemService(\"phone\");\n method = Class.forName(\"android.telephony.TelephonyManager\").getMethod(\"getDeviceIdDs\", new Class[]{Integer.TYPE});\n if (method != null) {\n trim = (String) method.invoke(telephonyManager, new Object[]{Integer.valueOf(0)});\n deviceId = (String) method.invoke(telephonyManager, new Object[]{Integer.valueOf(1)});\n if (C1618b.m4389a(trim)) {\n hashSet.add(trim + \"|e1\");\n }\n if (C1618b.m4389a(deviceId)) {\n hashSet.add(deviceId + \"|e2\");\n }\n }\n } catch (Throwable th7) {\n }\n try {\n Method method3;\n if (!(str.contains(\"WP-S\") || str.contains(\"D5012T\") || str.contains(\"K-Touch K3\"))) {\n try {\n telephonyManager = (TelephonyManager) context.getSystemService(\"phone\");\n telephonyManager.getPhoneType();\n method = telephonyManager.getClass().getMethod(\"getDeviceId\", new Class[]{Integer.TYPE});\n if (method != null) {\n hashSet.add(((String) method.invoke(telephonyManager, new Object[]{Integer.valueOf(0)})) + \"|f1\");\n hashSet.add(((String) method.invoke(telephonyManager, new Object[]{Integer.valueOf(1)})) + \"|f2\");\n hashSet.add(((String) method.invoke(telephonyManager, new Object[]{Integer.valueOf(2)})) + \"|f3\");\n }\n } catch (Throwable th8) {\n }\n }\n try {\n telephonyManager = (TelephonyManager) context.getSystemService(\"phone2\");\n method3 = context.getSystemService(\"phone2\").getClass().getMethod(\"getImeiInCDMAGSMPhone\", new Class[0]);\n if (method3 != null) {\n deviceId = method3.invoke(telephonyManager, new Object[0]).toString();\n if (C1618b.m4389a(deviceId)) {\n hashSet.add(deviceId + \"|g1\");\n }\n }\n } catch (Throwable th9) {\n }\n try {\n if (SystemProperties.getInt(\"ro.miui.ui.version.code\", 0) < 5) {\n trim = \"\";\n try {\n IBinder iBinder = (IBinder) Class.forName(\"android.os.ServiceManager\").getMethod(\"getService\", new Class[]{String.class}).invoke(null, new Object[]{\"phone\"});\n Object invoke = Class.forName(\"com.android.internal.telephony.ITelephony$Stub\").getMethod(\"asInterface\", new Class[]{IBinder.class}).invoke(null, new Object[]{iBinder});\n deviceId = invoke.getClass().getMethod(\"getMeid\", new Class[0]).invoke(invoke, new Object[0]).toString();\n } catch (Throwable th10) {\n deviceId = trim;\n }\n if (C1618b.m4389a(deviceId)) {\n hashSet.add(deviceId + \"|h1\");\n }\n }\n } catch (Throwable th11) {\n }\n try {\n telephonyManager = (TelephonyManager) context.getSystemService(\"phone\");\n method3 = context.getSystemService(\"phone\").getClass().getMethod(\"getCurrentPhoneType\", new Class[0]);\n if (method3 != null) {\n int intValue = ((Integer) method3.invoke(telephonyManager, new Object[0])).intValue();\n if (intValue != 1 && intValue == 2) {\n deviceId = C1618b.m4387a();\n if (deviceId != null && deviceId.length() > 0) {\n hashSet.add(deviceId + \"|i1\");\n }\n }\n }\n } catch (Throwable th12) {\n }\n try {\n try {\n deviceId = (String) Class.forName(\"com.huawei.android.hwnv.HWNVFuncation\").getMethod(\"getNVMEID\", new Class[0]).invoke(null, new Object[0]);\n } catch (Throwable th13) {\n deviceId = \"\";\n }\n if (!hashSet.contains(deviceId) && deviceId != null && deviceId.length() > 0 && deviceId.indexOf(\"0000000000\") == -1) {\n hashSet.add(deviceId + \"|g1\");\n }\n } catch (Throwable th14) {\n }\n } catch (Throwable th15) {\n }\n } catch (Throwable th16) {\n }\n return hashSet;\n }", "private static float m590o(Context context) {\r\n DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();\r\n Point point = new Point(displayMetrics.widthPixels, displayMetrics.heightPixels);\r\n return ((float) point.y) / ((float) point.x);\r\n }", "public final void m5407c() {\n Point point = new Point();\n WindowManager windowManager = this.f4261e.getWindowManager();\n C3250h.m9053a((Object) windowManager, \"activity.windowManager\");\n windowManager.getDefaultDisplay().getSize(point);\n Rect rect = new Rect();\n this.f4257a.getWindowVisibleDisplayFrame(rect);\n Resources resources = this.f4261e.getResources();\n C3250h.m9053a((Object) resources, \"activity.resources\");\n int i = resources.getConfiguration().orientation;\n int d = (point.y + m5408d()) - rect.bottom;\n C1426b.f4264a.mo6892b(d > 0 ? 1 : 0);\n if (d > 0) {\n C1426b.f4264a.mo6891a(d);\n }\n if (d != this.f4259c) {\n m5403a(d, i);\n }\n this.f4259c = d;\n }", "private void m6585B() {\n this.f5395O = (TelephonyManager) getSystemService(\"phone\");\n this.f5399S = new C1425w(this.f5389I);\n this.f5404X = C1018a.m5416a(this.f5389I);\n }", "private void m11882g() {\n Boolean bool = (Boolean) this.f9673b.getTag(R.id.dp7);\n if (bool == null) {\n bool = Boolean.valueOf(this.f9685n.mo25024a(\"hotsoon.pref.LAST_SET_LANDSCAPE\", true));\n this.f9673b.setTag(R.id.dp7, bool);\n }\n if (!bool.booleanValue()) {\n this.f9676e.setImageResource(R.drawable.cb0);\n this.f9677f.setText(R.string.f49);\n return;\n }\n this.f9676e.setImageResource(R.drawable.caz);\n this.f9677f.setText(R.string.f46);\n }", "private static byte[] m2537c(Context context) {\n Throwable th;\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n byte[] bArr = new byte[0];\n try {\n Utils.m2512a(byteArrayOutputStream, \"1.2.12.5\");\n Utils.m2512a(byteArrayOutputStream, C0820dq.m2443q(context));\n Utils.m2512a(byteArrayOutputStream, C0820dq.m2435i(context));\n Utils.m2512a(byteArrayOutputStream, C0820dq.m2432f(context));\n Utils.m2512a(byteArrayOutputStream, Build.MANUFACTURER);\n Utils.m2512a(byteArrayOutputStream, Build.MODEL);\n Utils.m2512a(byteArrayOutputStream, Build.DEVICE);\n Utils.m2512a(byteArrayOutputStream, C0820dq.m2444r(context));\n Utils.m2512a(byteArrayOutputStream, AppInfo.m2384c(context));\n Utils.m2512a(byteArrayOutputStream, AppInfo.m2385d(context));\n Utils.m2512a(byteArrayOutputStream, AppInfo.m2387f(context));\n byteArrayOutputStream.write(new byte[]{(byte) 0});\n bArr = byteArrayOutputStream.toByteArray();\n try {\n byteArrayOutputStream.close();\n } catch (Throwable th2) {\n th = th2;\n th.printStackTrace();\n return bArr;\n }\n } catch (Throwable th3) {\n th = th3;\n }\n return bArr;\n }", "private void findScreenWidth() {\n DisplayMetrics dm = new DisplayMetrics();\n getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);\n screenWidth = dm.widthPixels;\n }", "private void handle_mode_display() {\n\t\t\t\n\t\t}", "public final boolean isOn3G(Context ctx)\n {\n NetworkInfo info = ((ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE))\n .getActiveNetworkInfo();\n return info != null && info.getTypeName().toLowerCase().equals(\"mobile\");\n }", "public synchronized void mo24424Qv() {\n char c;\n try {\n Context applicationContext = VivaBaseApplication.m8749FZ().getApplicationContext();\n int i = 3 >> 1;\n if (applicationContext == null) {\n String str = \"ort_ebionof_kfcyepr_\";\n if (!AppPreferencesSetting.getInstance().getAppSettingBoolean(\"pref_root_config_key\", false)) {\n C5523b.logException(new C5526d(\" rootconfig firstrun state not work aa!\"));\n }\n this.bEA = true;\n return;\n }\n C4059d.m10105cr(applicationContext);\n if (!ApplicationBase.biq) {\n new C8150d().mo33232R(applicationContext, false);\n }\n String str2 = \"_mhdshbaswesop_o\";\n DataRefreshValidateUtil.recordDataRefreshTime(\"splash_show_mode\");\n if (!this.bEC) {\n C4386g.m11041QJ();\n C4386g.m11042QK();\n if (!TextUtils.isEmpty(BaseSocialNotify.getActiveNetworkName(applicationContext))) {\n DiskLruCache.clearCache(applicationContext, null, 43200000);\n }\n m10993cR(applicationContext);\n m10990a(applicationContext, C4681i.m12184Gp().mo25016Gr());\n if (C3569a.m8772FK()) {\n m10992cQ(applicationContext);\n }\n m10994cS(applicationContext);\n if (C3869e.m9526Hj()) {\n C3869e.m9528by(applicationContext);\n }\n C3742b.m9111II().mo23180K(applicationContext, C8113b.aES());\n m10991bR(C3742b.m9111II().mo23153JU());\n if (C3569a.m8773FL()) {\n String str3 = \"fptli_gtt_ayurponpaye_te_ytkes\";\n if (AppPreferencesSetting.getInstance().getAppSettingInt(\"pref_key_setting_autoplay_type\", -1) == -1) {\n AppPreferencesSetting.getInstance().setAppSettingInt(\"pref_key_setting_autoplay_type\", AppPreferencesSetting.getInstance().getAppSettingBoolean(\"pref_auto_play\", true) ? 1 : 0);\n }\n }\n C8049f.aBf().mo33076A(Boolean.valueOf(C3742b.m9111II().mo23167Jn()));\n }\n this.bEC = true;\n this.bEA = true;\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n }\n }", "public boolean isMobile() {\n return SecurityUtil.isMobile();\n }", "private void m6597N() {\n C0938a.m5002a(\"SR/SoundRecorder\", \"<popClearDialogBox>\");\n String lowerCase = this.f5399S.mo6173f().getAbsolutePath().toLowerCase();\n if (this.f5419h) {\n C1492b.m7431a((Context) this, (CharSequence) getResources().getString(R.string.phone_mtp_space_expired_smartkey), 1).show();\n this.f5419h = false;\n }\n Intent intent = new Intent(\"com.iqoo.secure.LOW_MEMORY_WARNING\");\n intent.addFlags(268435456);\n intent.putExtra(\"require_size\", 5242880);\n intent.putExtra(\"pkg_name\", getPackageName());\n intent.putExtra(\"extra_loc\", 1);\n intent.putExtra(\"tips_title\", getResources().getString(R.string.manager_title));\n intent.putExtra(\"tips_title_all\", getResources().getString(R.string.unable_to_record));\n try {\n startActivity(intent);\n } catch (Exception unused) {\n Intent intent2 = new Intent();\n intent2.putExtra(\"BBKPhoneCardName\", lowerCase);\n intent2.setComponent(new ComponentName(\"com.android.filemanager\", \"com.android.filemanager.FileManagerActivity\"));\n startActivity(intent2);\n }\n }", "public java.lang.String getMobile () {\r\n\t\treturn mobile;\r\n\t}", "public int getMobile() {return mobile;}", "private static boolean isXLargeTablet(Context context)\n {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "public void screenMath(){\r\n\t\t//10.9375 H\r\n\t\t//12.037037037037036 W\r\n\t\tDouble test1 = 0.12 * screenWidth / 2.2;\r\n\t\tDouble test2 = 0.807 * screenHight;\r\n\t\tDouble test3 = screenHight - test2;\r\n\t\tDouble test4 = test3 / 10;\r\n\t\tfor(int i = 0; i < 10; i++){\r\n\r\n\t\t\tArrayList<Double> tempArray = new ArrayList<Double>();\r\n\t\t\t\r\n\t\t\ttempArray.add(screenHight - test3 + (test4 * i));\r\n\t\t\ttempArray.add(test1);\r\n\t\t\tint[] RGBArray = getScreenColor(test1, screenHight - test3 + (test4 * i));\r\n\t\t\t\r\n\t\t\tfor(int x = 0; x < RGBArray.length; x++){\r\n\t\t\t\ttempArray.add((double) (RGBArray[x]));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlifeGlobe.addPosition(tempArray);\r\n\t\t}\r\n\t}", "public void setMobile (java.lang.String mobile) {\r\n\t\tthis.mobile = mobile;\r\n\t}", "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}", "@Override\n\t\t\tpublic boolean onTouch(View view, MotionEvent event) {\n\t\t\t\tif(MotionEvent.ACTION_DOWN == event.getAction()){ \n\t\t\t count++; \n\t\t\t if(count == 1){ \n\t\t\t firClick = System.currentTimeMillis(); \n\t\t\t \n\t\t\t } else if (count == 2){ \n\t\t\t secClick = System.currentTimeMillis(); \n\t\t\t if(secClick - firClick < 500){ \n\t\t\t if(displayflag==1){\n\t\t\t \t\t\t WebSettings contentSetting= post_content.getSettings(); \n\t\t\t \t\tcontentSetting.setUseWideViewPort(true);\n\t\t\t \t\t//contentSetting.setLoadWithOverviewMode(true);\n\t\t\t \t\tcontentSetting.setSupportZoom(true);\n\t\t\t \t\tcontentSetting.setBuiltInZoomControls(true);\n\t\t\t \t\tpost_content.loadDataWithBaseURL(\"http://tsimg.tsurl.cn\", post.getContent(), \"text/html\", \"utf-8\", null);\n\t\t\t \tdisplayflag=2;\n\t\t\t \tToast.makeText(mContext,\"切换到缩放模式\", Toast.LENGTH_SHORT)\n\t\t\t\t\t\t\t\t\t.show();\n\t\t\t }else{\n\t\t\t \tWebSettings contentSetting= post_content.getSettings();\n\t\t\t \t\t//contentSetting.setUseWideViewPort(false);\n\t\t\t \t\t//contentSetting.setLoadWithOverviewMode(false);\n\t\t\t \tcontentSetting.setSupportZoom(false);\n\t\t\t \t\tcontentSetting.setBuiltInZoomControls(false);\n\t\t\t \t\tcontentSetting.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);\n\t\t\t \t\tpost_content.loadDataWithBaseURL(\"http://tsimg.tsurl.cn\", post.getContent(), \"text/html\", \"utf-8\", null);\n\t\t\t \tdisplayflag=1;\n\t\t\t \tToast.makeText(mContext,\"切换到自适应屏幕模式\", Toast.LENGTH_SHORT)\n\t\t\t\t\t\t\t\t\t.show();\n\t\t\t } \n\t\t\t } \n\t\t\t count = 0; \n\t\t\t firClick = 0; \n\t\t\t secClick = 0; \n\t\t\t } \n\t\t\t } \n\t\t\t return true; \n\t\t\t}", "private void m8132a() {\n this.f6227a.setScaleType(ScaleType.FIT_XY);\n addView(this.f6227a, new LayoutParams(-2, -2));\n C2322j.m9044a(this.f6227a, C2322j.INTERNAL_AD_MEDIA);\n }", "public int getWidthScreen(){\n return widthScreen ;\n }", "private boolean m21862f() {\n TelephonyManager telephonyManager = (TelephonyManager) this.f16409k.getSystemService(\"phone\");\n if (telephonyManager != null) {\n String line1Number = telephonyManager.getLine1Number();\n for (String equalsIgnoreCase : f16397a) {\n if (equalsIgnoreCase.equalsIgnoreCase(line1Number)) {\n return true;\n }\n }\n }\n return false;\n }", "public static String m21397c(Context context) {\n if (TextUtils.isEmpty(f16892c)) {\n try {\n f16892c = VERSION.SDK_INT >= 17 ? WebSettings.getDefaultUserAgent(context) : m21385a();\n } catch (Throwable unused) {\n f16892c = m21385a();\n }\n }\n return f16892c;\n }", "private void calc_screen_size(){\r\n \tscn_grid.setFont(scn_font);\r\n \tscn_context = scn_grid.getFontRenderContext();\r\n \t scn_layout = new TextLayout(\"X\",scn_font,scn_context);\r\n scn_char_rect = scn_layout.getBlackBoxBounds(0,1).getBounds();\r\n scn_char_height = (int) (scn_char_rect.getHeight()); // RPI 630 was Width in err, 6 to *1.5\r\n \tscn_char_base = scn_char_height/2+1;\r\n \tscn_char_height = scn_char_height + scn_char_base+2;\r\n scn_char_width = (int) (scn_char_rect.getWidth()); // RPI 630 was Height in err\r\n \tscn_height = scn_rows * scn_char_height; // RPI 408 + 5 \r\n \tscn_width = scn_cols * scn_char_width + 3; // RPI 408 + 5 \r\n \tscn_size = new Dimension(scn_width,scn_height);\r\n \tscn_image = new BufferedImage(scn_width,scn_height,BufferedImage.TYPE_INT_ARGB);\r\n \tscn_grid = scn_image.createGraphics();\r\n \tscn_grid.setFont(scn_font); \r\n scn_grid.setColor(scn_text_color);\r\n \t scn_context = scn_grid.getFontRenderContext();\r\n scn_grid.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r\n RenderingHints.VALUE_ANTIALIAS_ON);\r\n }", "public void mo6082b() {\n if (m14898d()) {\n C3720a.this.StartBrowser();\n }\n }", "private void m81852p() {\n String c = m81844c(C6969H.m41409d(\"G738BEA12B634AE16E80F8677F0E4D1\"));\n if (!TextUtils.isEmpty(c)) {\n if (C6969H.m41409d(\"G6F82D909BA\").equals(c)) {\n this.f58078j = false;\n } else if (C6969H.m41409d(\"G7D91C01F\").equals(c)) {\n this.f58078j = true;\n }\n }\n }", "private static boolean isXLargeTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "private String m81844c(String str) {\n Uri uri;\n String a = UrlUtil.m84494a(this.f58071c, str);\n return (!TextUtils.isEmpty(a) || (uri = this.f58072d) == null) ? a : UrlUtil.m84494a(uri, str);\n }", "String platform();", "private void getphoneinformaition() {\n\t\ttry {\n\t\t\tsoftVersion = this.getPackageManager().getPackageInfo(\n\t\t\t\t\tthis.getPackageName(), 0).versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\tsoftVersion = \"NULL\";\n\t\t}\n\n\t\tif (Build.BRAND != null) {\n\t\t\tphoneBrand = Build.BRAND;\n\t\t}\n\t\tif (Build.MODEL != null) {\n\t\t\tphoneModel = Build.MODEL;\n\t\t}\n\t\tif (Build.VERSION.RELEASE != null) {\n\t\t\tphoneOs = Build.VERSION.RELEASE;\n\t\t}\n\n\t\ttry {\n\t\t\tDisplayMetrics metric = new DisplayMetrics();\n\t\t\tgetWindowManager().getDefaultDisplay().getMetrics(metric);\n\t\t\tint width = metric.widthPixels; // 屏幕宽度(像素)\n\t\t\tint height = metric.heightPixels; // 屏幕高度(像素)\n\t\t\tString w = String.valueOf(width);\n\t\t\tString h = String.valueOf(height);\n\t\t\tStringBuffer s = new StringBuffer();\n\t\t\ts.append(w);\n\t\t\ts.append(\"*\");\n\t\t\ts.append(h);\n\t\t\tphoneResolution = s.toString();\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tphoneResolution = \"NULL\";\n\t\t}\n\n\t\tFileLog.i(TAG, softVersion);\n\t\tFileLog.i(TAG, phoneBrand);\n\t\tFileLog.i(TAG, phoneModel);\n\t\tFileLog.i(TAG, phoneOs);\n\t\tFileLog.i(TAG, phoneResolution);\n\n\t}", "private void findOsVersion() {\n\t\tisGBOrLower = AppUtility.isAndroidGBOrLower();\n\t\tisICSOrHigher = AppUtility.isAndroidICSOrHigher();\n\t}", "public static String getBlackBox()\n\t{\n\t\treturn \"\";//Tongdun.getPhoneInfo();\n\t}", "public static String captureScreenshotOfDesktop() {\n\t\ttry {\n\t\t\tRobot robot = new Robot();\n\t\t\tBufferedImage tmp = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));\n\t\t\tString path = System.getProperty(\"user.dir\") + \"/Screenshots/\" + System.currentTimeMillis() + \".png\";\n\t\t\tImageIO.write(tmp, \"png\", new File(path));\n\t\t\treturn path;\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Some exception occured.\" + e.getMessage());\n\t\t\treturn null;\n\t\t}\n\n\t}", "public String mo38889c() {\n String trim = this.f30736g0.getText().toString().trim();\n return trim.length() == 5 ? trim.substring(3, 5) : \"\";\n }", "public modifyMobile() {\n\t\tsuper();\n\t}", "boolean isSite271(String url) {\n if (url.startsWith(\"http://pay.88vipbet.com/onlinePay\")) {\r\n return true;\r\n }\r\n return false;\r\n }", "void m1477a(String str) {\n if (this.f1377d == C0833a.DISPLAY) {\n this.f1374a.setWebViewClient(new C08311(this));\n this.f1374a.loadData(C0834g.m1475b(str), AudienceNetworkActivity.WEBVIEW_MIME_TYPE, AudienceNetworkActivity.WEBVIEW_ENCODING);\n }\n }", "public static String m573d(Context context) {\r\n if (context == null) {\r\n return null;\r\n }\r\n try {\r\n String b;\r\n SensorManager sensorManager = (SensorManager) context.getSystemService(\"sensor\");\r\n if (sensorManager != null) {\r\n List<Sensor> sensorList = sensorManager.getSensorList(-1);\r\n if (sensorList != null && sensorList.size() > 0) {\r\n StringBuilder stringBuilder = new StringBuilder();\r\n for (Sensor sensor : sensorList) {\r\n stringBuilder.append(sensor.getName());\r\n stringBuilder.append(sensor.getVersion());\r\n stringBuilder.append(sensor.getVendor());\r\n }\r\n b = C0159a.m558b(stringBuilder.toString());\r\n return b;\r\n }\r\n }\r\n b = null;\r\n return b;\r\n } catch (Exception e) {\r\n return null;\r\n }\r\n }", "Desktop getDesktop()\r\n {\r\n return Desktop.getDesktop();\r\n }", "public String mo38887b() {\n String trim = this.f30736g0.getText().toString().trim();\n if (trim.length() < 2) {\n return \"\";\n }\n return trim.substring(0, 2);\n }", "private void m10992cQ(Context context) {\n try {\n String userId = UserServiceProxy.getUserId();\n String dz = C4580b.m11653dz(context);\n if (!TextUtils.isEmpty(dz)) {\n C4041a.m10039MV();\n C4041a.m10041N(dz, userId);\n String countryCode = AppStateModel.getInstance().getCountryCode();\n IEditorService iEditorService = (IEditorService) BizServiceManager.getService(IEditorService.class);\n String str = null;\n if (iEditorService != null) {\n str = iEditorService.getGpuType();\n }\n C4037m.m10029g(countryCode, dz, userId, str);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private float ScreenWidth() {\n RelativeLayout linBoardGame = (RelativeLayout) ((Activity) context).findViewById(R.id.gridContainer);\n Resources r = linBoardGame.getResources();\n DisplayMetrics d = r.getDisplayMetrics();\n return d.widthPixels;\n }", "public void mo61199x() {\n this.f2489d.setWebViewClient(new C4752a(this.f2510k));\n this.f2489d.setWebChromeClient(new WebChromeClient() {\n public boolean onConsoleMessage(ConsoleMessage consoleMessage) {\n String str = \"MraidMode\";\n try {\n if (consoleMessage.messageLevel() == MessageLevel.ERROR) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"WebChromeClient console error: \");\n sb.append(consoleMessage.message());\n C5155g.m3807a(str, 6, sb.toString());\n if (consoleMessage.message().contains(\"mraid\")) {\n C5017f.m3256a(C4748d.this.mo61159b(), C5015d.EXCEPTION, \"MraidMode.ConsoleError\", consoleMessage.message(), \"\");\n }\n } else {\n StringBuilder sb2 = new StringBuilder();\n sb2.append(\"WebChromeClient console log: \");\n sb2.append(consoleMessage.message());\n C5155g.m3807a(str, 3, sb2.toString());\n }\n } catch (Exception e) {\n StringBuilder sb3 = new StringBuilder();\n sb3.append(\"WebChromeClient onConsoleMessage Exception: \");\n sb3.append(e.getMessage());\n C5155g.m3807a(str, 6, sb3.toString());\n }\n return super.onConsoleMessage(consoleMessage);\n }\n });\n }", "private void m34671b(String str, Intent intent) {\n int i;\n AppMethodBeat.m2504i(6294);\n C4990ab.m7416i(\"MicroMsg.JsApiChooseMedia\", \"chooseMediaFromCamera\");\n if (str.equals(\"front\")) {\n i = 16;\n } else {\n i = 256;\n }\n intent.putExtra(\"key_pick_local_pic_capture\", i);\n this.hwd.ifE = this.hvq;\n C25985d.m41453a(this.hwd, \"webview\", \".ui.tools.OpenFileChooserUI\", intent, CdnLogic.kBizGeneric & hashCode(), false);\n AppMethodBeat.m2505o(6294);\n }", "boolean hasMobile(String name);", "public boolean isSmallScreen() {\n \t\treturn m_smallScreenMode;\n \t}", "public static int getMobileWidth(Context context) {\n\t\tDisplayMetrics dm = new DisplayMetrics();\n\t\t((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(dm);\n\t\tint width = dm.widthPixels; // 得到宽度\n\t\treturn width;\n\n\t}", "public static native boolean isMobile() /*-{\r\n\t\treturn $wnd.floatz.browser.isMobile();\r\n\t}-*/;", "private boolean m11885j() {\n IUser a = ((C3592a) C3596c.m13172a(C3592a.class)).user().mo22165a();\n if (!C9290a.f25466a && a != null && a.isEnableShowCommerceSale()) {\n if (this.f9687p == LiveMode.VIDEO) {\n return true;\n }\n LiveMode liveMode = this.f9687p;\n LiveMode liveMode2 = LiveMode.THIRD_PARTY;\n }\n return false;\n }", "private static boolean isXLargeTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "private static boolean isXLargeTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "private static boolean isXLargeTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "private static boolean isXLargeTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "private static boolean isXLargeTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "public void searchProd(){\n\t\t\n\t\t// STEP 4:-\n\t\t// Enter 'mobile' in search bar.\n\t\tWebElement search = driver.findElement(By.name(\"q\"));\n\t\tsearch.sendKeys(\"mobiles\");\n\t\tsearch.sendKeys(Keys.ENTER);\n\t\tSystem.out.println(\"Enter name successfully\");\n\t\t\t\t\t\n\t\t// Click on search icon.\n\t\t//WebElement searchClick = driver.findElement(By.className(\"L0Z3Pu\"));\n\t\t//searchClick.click();\n\t\t//System.out.println(\"clicked search button successfully\");\n\t}", "@Test(priority = 1)\n public void test() throws InterruptedException {\n WebDriverWait webDriverWait = new WebDriverWait(driver, 5);\n WebElement main = webDriverWait.until(new ExpectedCondition<WebElement>() {\n @NullableDecl\n public WebElement apply(@NullableDecl WebDriver driver) {\n return driver.findElement(By.id(\"cn.com.open.mooc:id/lav\"));\n }\n });\n// driver.findElement(By.xpath(\"//*[@text='00']\")).click();\n// driver.findElementByAccessibilityId(\"乘\").click();\n// driver.findElement(By.id(\"digit_6\")).click();\n// driver.findElementByAndroidUIAutomator(\"new UiSelector().text(\\\"2\\\")\").click();\n// driver.findElementById(\"com.coloros.calculator:id/eq\").click();\n\n\n// driver.findElementById(\"cn.com.open.mooc:id/lav\").click();\n int x = driver.manage().window().getSize().width;\n int y = driver.manage().window().getSize().height;\n AndroidTouchAction androidTouchAction = new AndroidTouchAction(driver);\n Thread.sleep(1000);\n System.out.println(x + \"===============\" + y);\n androidTouchAction.press(PointOption.point(x * 9 / 10, y * 2150 / 2163)).release().perform();\n// driver.findElement(By.xpath(\"//*[@text='账号']\")).click();\n Thread.sleep(2000);\n driver.findElementById(\"cn.com.open.mooc:id/tvLoginNow\").click();\n Thread.sleep(2000);\n driver.findElementById(\"cn.com.open.mooc:id/WeiboLogin\").click();\n Thread.sleep(5000);\n Set<String> contexts = driver.getContextHandles();\n for (String context : contexts) {\n System.out.println(\"context:\" + context);\n if (context.contains(\"WEBVIEW\")) {\n driver.context(context);\n }\n }\n WebElement loginName = driver.findElement(By.id(\"loginName\"));\n loginName.click();\n loginName.sendKeys(\"13716812206\");\n Thread.sleep(2000);\n\n WebElement loginPass = driver.findElement(By.id(\"loginPassword\"));\n loginPass.click();\n loginPass.sendKeys(\"123123123\");\n Thread.sleep(2000);\n\n driver.findElement(By.id(\"loginAction\")).click();\n Thread.sleep(5000);\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n protected void screenMode(int mode) {\n\n }", "public void mo6081a() {\n }", "private boolean isScreenFull(){\n for(int i = 0; i < mPixelX.length; i++){\n if(i % 10 == 0 && mPixelX[i] == 0){\n return false;\n }\n }\n for(int i = 0; i < mPixelY.length; i++){\n if(i % 10 == 0 && mPixelY[i] == 0){\n return false;\n }\n }\n return true;\n }", "public static void m5849u() {\n if (f4669a != null) {\n f4669a.m12578a(\"native_ad_displayed\", null);\n }\n Answers.getInstance().logCustom(new CustomEvent(\"native_ad_displayed\"));\n }", "private void getDynamicProfie() {\n getDeviceName();\n }", "private boolean checkPhoneNum() {\n\t\tphoneNum = et_phone.getText().toString().trim();\r\n\t\tif(isMobileNO(phoneNum)){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void mo19854a(Bundle bundle) {\n LollipopFixedWebView lollipopFixedWebView = (LollipopFixedWebView) mo19852a(R.id.web);\n String str = \"web\";\n C8271i.m35382a((Object) lollipopFixedWebView, str);\n lollipopFixedWebView.setWebViewClient(new C3588e(this));\n LollipopFixedWebView lollipopFixedWebView2 = (LollipopFixedWebView) mo19852a(R.id.web);\n C8271i.m35382a((Object) lollipopFixedWebView2, str);\n lollipopFixedWebView2.setWebChromeClient(new C3589f(this));\n LollipopFixedWebView lollipopFixedWebView3 = (LollipopFixedWebView) mo19852a(R.id.web);\n C8271i.m35382a((Object) lollipopFixedWebView3, str);\n WebUtils.m12978a(lollipopFixedWebView3);\n LollipopFixedWebView lollipopFixedWebView4 = (LollipopFixedWebView) mo19852a(R.id.web);\n LollipopFixedWebView lollipopFixedWebView5 = (LollipopFixedWebView) mo19852a(R.id.web);\n C8271i.m35382a((Object) lollipopFixedWebView5, str);\n lollipopFixedWebView4.addJavascriptInterface(new C3591a(lollipopFixedWebView5), \"Travel\");\n ((LollipopFixedWebView) mo19852a(R.id.web)).setDownloadListener(new C3590g(this));\n ((LollipopFixedWebView) mo19852a(R.id.web)).loadUrl(m14966q());\n }", "@Override\n\tpublic boolean isHardware(){\n\t\treturn false;\n\t}" ]
[ "0.548152", "0.53474706", "0.52412987", "0.5240834", "0.523501", "0.5217405", "0.52165776", "0.5169298", "0.51560205", "0.51550835", "0.5141408", "0.51388675", "0.51288885", "0.51153374", "0.5108865", "0.502962", "0.49752977", "0.49548897", "0.4940251", "0.4896738", "0.4879235", "0.48581088", "0.48579618", "0.48539037", "0.48513794", "0.4844636", "0.48435998", "0.48421776", "0.48121744", "0.48026302", "0.47993466", "0.47950578", "0.4790031", "0.47872725", "0.47738776", "0.4772937", "0.47687098", "0.47679108", "0.47555116", "0.4755458", "0.47499445", "0.47464827", "0.4744816", "0.47417477", "0.47376505", "0.4735885", "0.4733248", "0.47197175", "0.4719099", "0.47170606", "0.47133204", "0.47040868", "0.4700285", "0.46976265", "0.4697209", "0.46959782", "0.46909165", "0.46877635", "0.4679434", "0.46781668", "0.467157", "0.46711367", "0.46682566", "0.4666631", "0.46628702", "0.46554258", "0.46523124", "0.4652013", "0.46507767", "0.46418664", "0.46418142", "0.46396795", "0.4633017", "0.46317658", "0.46284884", "0.4627858", "0.46274465", "0.462693", "0.46229735", "0.4622468", "0.4622468", "0.4622468", "0.4622468", "0.4622468", "0.4620401", "0.46182093", "0.4615418", "0.4615418", "0.4615418", "0.4615418", "0.4615418", "0.4615418", "0.4615418", "0.4611014", "0.46071076", "0.46059936", "0.4604557", "0.46028143", "0.4601094", "0.4599626", "0.45994812" ]
0.0
-1
final FlowPanel flowPanel = new FlowPanel();
protected void getPickSpotMobile(final FlowPanel flowPanel) { SearchParameters searchParameters = new SearchParameters(); searchParameters.setLatitude(mywebapp.getCurrentLocation().getLatitude()); searchParameters.setLongitude(mywebapp.getCurrentLocation().getLongitude()); searchParameters.setLicensePlate(false); ApiServiceAsync myService = mywebapp.getApiServiceAsync(); myService.search(searchParameters, new AsyncCallback() { public void onFailure(Throwable caught) { getMessagePanel().displayMessage("Error:" + caught.getMessage()); } public void onSuccess(Object result) { MobileResponse mobileResponse = (MobileResponse) result; // ulPanel.add(addSpotNotHere()); for (LocationResult locationResult : mobileResponse.getLocationResults()) { ListItem listItem = new ListItem(); Anchor anchor = new Anchor(locationResult.getLabel()); flowPanel.add(anchor); //listItem.add(anchor); //ulPanel.add(listItem); if (locationResult.getSolrDocument() == null) { pickLocationMap.put(anchor, locationResult); anchor.addClickHandler(createSpotFromLocationHandler); } else { Long spotId = locationResult.getSolrDocument().getFirstLong("spotid_l"); String targetHistoryToken = "#" + MyWebApp.LEAVE_SPOT_MARK + spotId; anchor.setHref(targetHistoryToken); } } // ulPanel.add(addSpotNotHere()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void setupPanel()\n {\n\n }", "public Panel()\n/* */ {\n/* 56 */ this(new FlowLayout());\n/* */ }", "public FlowPanel(){\r\n setLayout(new FlowLayout());\r\n setBackground(Color.green);\r\n JButton b1 = new JButton(\"Button 1\");\r\n JButton b2 = new JButton(\"Button 2\");\r\n JButton b3 = new JButton(\"Button 3\");\r\n JButton b4 = new JButton(\"Button 4\");\r\n JButton b5 = new JButton(\"Button 5\");\r\n add(b1);\r\n add(b2);\r\n add(b3);\r\n add(b4);\r\n add(b5);\r\n }", "@Override\r\n\tpublic void onPanelOpened(Panel panel) {\n\r\n\t}", "@Override\r\n public void setup(Panel panel) {\n }", "public void setupPanel() {\n\t\tpanel = new JPanel();\n\t\tpanel.setLayout(new ModifiedFlowLayout(FlowLayout.LEFT));\n\t\tpanel.setBackground(Color.BLACK);\n\t\tpanel.setOpaque(true);\n\t}", "public Flow()\n\t{\n\t\tnpanel=new JPanel();\n\t\tspanel=new JPanel();\n\t\tmpanel=new JPanel();\n\t\t\n\t\tbutton=new JButton(\"Summit\");\n\t\tbutton1=new JButton(\"Logout\");\n\t\ttrip=new JButton(\"自动切换账号\");\n\t\texit=new JButton(\"Exit\");\n\t\tsetDefault=new JButton(\"设置为默认账号\");\n\n\t\tla1=new JLabel(\"账号: \",JLabel.RIGHT);\n\t\tla2=new JLabel(\"密码: \",JLabel.RIGHT);\n\t\tla3=new JLabel(\"将当前账号设置为默认登陆账号,以便下次自动登陆轻松上网\",JLabel.CENTER);\n\t\tla3.setFont(new Font(\"宋体\",Font.BOLD,14));\n\t\tla4= new JLabel(\"\",JLabel.CENTER);la4.setFont(new Font(\"宋体\",Font.BOLD,20));\n\t\tla5= new JLabel(\"\",JLabel.CENTER);la5.setFont(new Font(\"宋体\",Font.BOLD,14));\n\t\tla6= new JLabel(\"\",JLabel.CENTER);la6.setFont(new Font(\"宋体\",Font.BOLD,20));\n\t\tla7= new JLabel(\"本机所使用的流量 :\",JLabel.CENTER);la6.setFont(new Font(\"宋体\",Font.BOLD,20));\n\t\t\n\t\t//获取输入历史\n\t\tuser=new JComboBox<String>();\n\t\tuser.setEditable(true);\n\t\tres5=dbc.executeQuery(\"select * from lazer\");\n\t\tuser.addItem(\" \");\n\t\ttry {\n\t\t\twhile (res5.next())\n\t\t\t{\n\t\t\t\tuser.addItem(res5.getString(1));\n\t\t\t}\t\n\t\t} catch (SQLException e) {e.printStackTrace();}\n\n\t\tuser.addFocusListener(this);\n\t\tuser.addItemListener(this);\n\t\tpw=new JPasswordField(10);\n\t\tpw.addFocusListener(this);\n\t\t//\n\t\tl5=new JLabel(\"\",JLabel.CENTER);\n\t\tl5.setBackground(Color.cyan);\n\t\tl6=new JLabel(\"\",JLabel.CENTER);\n\t\tl7=new JLabel(\"800\",JLabel.CENTER);\n\t\tt4=new JTextField(10);\n\t\tt5=new JTextField(10);\n\t\t//设置默认的流量额度\n\t\tt4.setText(\"800\");\n\t\t\n\t\tl1=new JLabel(\"Username:\",JLabel.RIGHT);\n\t\tl2=new JLabel(\" Used(M) :\",JLabel.RIGHT);\n\t\tl3=new JLabel(\" Total(M) :\",JLabel.RIGHT);\n\t\tl4=new JLabel(\"设置额定流量(M) :\",JLabel.RIGHT);\n\t\tinit();\n\t}", "public JavaPanel() {\n\t\tsuper();\n\t}", "public DemoPanel() {\n }", "public LocalPanel() {\r\n\t\tinitComponents();\r\n\t}", "public Panel() {\n initComponents();\n\n\n }", "public StepPanel() {\r\n\t\t\tsetPreferredSize(new Dimension(100, 100));\r\n\t\t}", "public JPanel getPanel(){\n return panel;\n }", "public Panel() {\n }", "Flow createFlow();", "public PreviewPanel() {\n initComponents();\n\n }", "public PrintsPanel() {\n initComponents();\n createPanels();\n\n }", "public FinancialStatementJPanel() {\n initComponents();\n }", "@Override protected JComponent setupPanel()\t{ return null; }", "private static void createAndShowUI(){\n JFrame frame = new JFrame(\"TargetTest\");\n TargetTest test = new TargetTest();\n frame.setLayout(new FlowLayout());\n frame.getContentPane().add(test.getMainPanel());\n //frame.getContentPane().add(test.getControlsPanel());\n\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n frame.pack();\n\n frame.setLocationRelativeTo(null);\n\n frame.setVisible(true);\n}", "public FlowPanel getMainFlowPanel() {\n\t\treturn mainFlowPanel;\n\t}", "public DashBoardPanel() {\n initComponents();\n }", "public NetworkPanel() {\n initComponents();\n }", "public HangingFlowPane() {\n super();\n }", "private void setPanel()\r\n\t{\r\n\t\tpanel = new JPanel();\r\n\t\tpanel.setLayout(new GridLayout(5, 2));\r\n\t\t\r\n\t\tpanel.add(bubbleL);\r\n\t\tpanel.add(bubblePB);\r\n\t\t\r\n\t\tpanel.add(insertionL);\r\n\t\tpanel.add(insertionPB);\r\n\t\t\r\n\t\tpanel.add(mergeL);\r\n\t\tpanel.add(mergePB);\r\n\t\t\r\n\t\tpanel.add(quickL);\r\n\t\tpanel.add(quickPB);\r\n\t\t\r\n\t\tpanel.add(radixL);\r\n\t\tpanel.add(radixPB);\r\n\t}", "public NewJPanel() {\n initComponents();\n }", "public NewJPanel() {\n initComponents();\n }", "public ControlPanel() {\n\t\tpanelName = null;\n\t}", "public void onModuleLoad() {\n\t\t\n\t\tFlowPanel panel = new FlowPanel();\n\t\tpanel.setStyleName(\"Panel\");\n\t\t\n\t\t// Title\n\t\tHTML title = new HTML(\"<h1>NPESDK GWT DEMO PAGE</h1>\");\n\t\tpanel.add(title);\n\t\t\n\t\tGrid grid = new Grid(5, 5);\n\t\tgrid.setStyleName(\"Grid\");\n\t\t\n\t\tint row = 0;\n\t\t\n\t\t// Header\n\t\tsetHeader(grid, row++);\n\t\t/*\n\t\tgrid.setWidget(0, 0, new Label(\"ClassName\"));\n\t\tgrid.setWidget(0, 1, new Label(\"Widget\"));\n\t\tgrid.setWidget(0, 2, new Label(\"Value\"));\n\t\tgrid.setWidget(0, 3, new Label(\"StyleName\"));\n\t\t*/\n\t\t\n\t\t// Range with ChangeEvent\n\t\tfinal Range range = new Range();\n\t\tfinal Label rangeValue = new Label(range.getValue()+\"\");\n\t\trange.addChangeHandler(new ChangeHandler() {\n\t\t\t@Override\n\t\t\tpublic void onChange(ChangeEvent event) {\n\t\t\t\trangeValue.setText(range.getValue()+\"\");\n\t\t\t}\n\t\t});\n\t\tsetWidget(grid, row++, \"Range\", range, rangeValue, \"(none)\", \"Value handling with ChangeHandler\");\n\t\t\n\t\t// Range with InputEvent\n\t\tfinal Range inputRange = new Range();\n\t\tfinal Label inputRangeValue = new Label(inputRange.getValue()+\"\");\n\t\tinputRange.addInputHandler(new InputHandler() {\n\t\t\t@Override\n\t\t\tpublic void onInput(InputEvent event) {\n\t\t\t\tinputRangeValue.setText(inputRange.getValue()+\"\");\n\t\t\t}\n\t\t});\n\t\tsetWidget(grid, row++, \"Range\", inputRange, inputRangeValue, \"(none)\", \"Value handling with InputHandler\");\n\t\t\n\t\t// SliderEditBox\n\t\tSliderEditBox box = new SliderEditBox(50, 0, 100, 1);\n\t\tbox.setStyleName(\"SliderEditBox\");\n\t\tbox.setPostfix(\"%\");\n\t\tfinal Label boxValue = new Label(box.getValue()+\"\");\n\t\tbox.addValueChangeHandler(new ValueChangeHandler<Double>() {\n\t\t\t@Override\n\t\t\tpublic void onValueChange(ValueChangeEvent<Double> event) {\n\t\t\t\tboxValue.setText(event.getValue()+\"\");\n\t\t\t}\n\t\t});\n//\t\tpanel.add(createPanel(\"SliderEditBox\", box, boxValue, \"SliderEditBox\"));\n\t\tgrid.setWidget(row, 0, new Label(\"SliderEditBox\"));\n\t\tgrid.setWidget(row, 1, box);\n\t\tgrid.setWidget(row, 2, boxValue);\n\t\tgrid.setWidget(row, 3, new Label(\"SliderEditBox\"));\n\t\trow++;\n\t\t\n\t\t// Knob\n\t\tfinal Knob knob = new Knob(50, 0, 100, 32);\n\t\tknob.setStyleName(\"Knob\");\n\t\tfinal Label knobValue = new Label(knob.getFormattedValue());\n\t\tknob.addValueChangeHandler(new ValueChangeHandler<Double>() {\n\t\t\t@Override\n\t\t\tpublic void onValueChange(ValueChangeEvent<Double> event) {\n\t\t\t\tknobValue.setText(knob.getFormattedValue());\n\t\t\t}\n\t\t});\n//\t\tpanel.add(createPanel(\"Knob\", knob, knobValue, \"Knob\"));\n\t\tgrid.setWidget(row, 0, new Label(\"Knob\"));\n\t\tgrid.setWidget(row, 1, knob);\n\t\tgrid.setWidget(row, 2, knobValue);\n\t\tgrid.setWidget(row, 3, new Label(\"Knob\"));\n\t\trow++;\n\t\t\n\t\tpanel.add(grid);\n\t\t\n\t\t// CSS Label\n\t\tHTML css = new HTML(\"<em>css is <a href=\\\"npesdk_gwt_sample.css\\\">here</a></em>\");\n\t\tpanel.add(css);\n\t\t\n\t\tRootLayoutPanel.get().add(panel);\n\t\t\n\t}", "public LoggingPanel() {\n initComponents();\n\n }", "private void initPanel() {\n\t\tthis.panel = new JPanel();\n\t\tthis.panel.setBounds(5, 5, 130, 20);\n\t\tthis.panel.setLayout(null); \n\n\t}", "@Override\n\tpublic JPanel obtenerPanel() {\n\t\treturn null;\n\t}", "@Override\n\tpublic JPanel obtenerPanel() {\n\t\treturn null;\n\t}", "public JPanel getPanel()\n {\n return panel;\n }", "public CreateNewEventJPanel() {\n }", "JPanel getPanel();", "@Override\n\tpublic JPanel getPanel()\n\t{\n\t\treturn panel;\n\t}", "void addPanel() {\n \tPanel panel = new Panel();\r\n\r\n panel.setLayout(new GridLayout(4, 1));\r\n jSliderBrightness = makeTitledSilder(\"Helligkeit\", 0, 256, 128); // werte veraendert\r\n jSliderContrast = makeTitledSilder(\"Kontrast\", 0, 10, 5);\r\n jSliderSaturation = makeTitledSilder(\"Sättigung\", 0, 9, 4);\r\n jSliderHue = makeTitledSilder(\"Hue\", 0, 360, 0);\r\n //jSliderContrast = makeTitledSilder(\"Slider2-Wert\", 0, 100, 50);\r\n panel.add(jSliderBrightness);\r\n panel.add(jSliderContrast);\r\n panel.add(jSliderSaturation);\r\n panel.add(jSliderHue);\r\n \r\n add(panel);\r\n \r\n pack();\r\n }", "private void showFlow(VFlow flow, Stage stage, String title) {\n ScalableContentPane canvas = new ScalableContentPane();\r\n\r\n // define it as background (css class)\r\n canvas.getStyleClass().setAll(\"vflow-background\");\r\n\r\n // create skin factory for flow visualization\r\n FXValueSkinFactory fXSkinFactory = new FXValueSkinFactory(canvas.getContentPane());\r\n\r\n // register visualizations for Integer, String and Image\r\n fXSkinFactory.addSkinClassForValueType(Integer.class, IntegerFlowNodeSkin.class);\r\n fXSkinFactory.addSkinClassForValueType(String.class, StringFlowNodeSkin.class);\r\n fXSkinFactory.addSkinClassForValueType(Image.class, ImageFlowNodeSkin.class);\r\n\r\n // generate the ui for the flow\r\n flow.addSkinFactories(fXSkinFactory);\r\n\r\n // the usual application setup\r\n Scene scene = new Scene(canvas, 1024, 600);\r\n\r\n // add css style\r\n scene.getStylesheets().setAll(\r\n \"/eu/mihosoft/vrl/workflow/tutorial05/resources/default.css\");\r\n\r\n stage.setTitle(title);\r\n stage.setScene(scene);\r\n stage.show();\r\n }", "public Panel(LayoutManager paramLayoutManager)\n/* */ {\n/* 65 */ setLayout(paramLayoutManager);\n/* */ }", "public PanelAmigo() {\n initComponents();\n \n }", "@Override\n public void run() {\n panel.start();\n }", "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}", "@Override\n public void newPanelModel() {\n\n }", "@Override\n public void newPanelModel() {\n\n }", "public TMCropperPanel() {\n initComponents();\n this.setBorder(new WorkflowModuleBorder(WorkflowModuleBorder.BLUE_SHADOW));\n }", "private JPanel getJpanelFlowProfile() {\n\t\tif (jpanelFlowProfile == null) {\n\t\t\tjpanelFlowProfile = new JPanel();\n\t\t\tjpanelFlowProfile.setLayout(null);\n\t\t\tjpanelFlowProfile.setPreferredSize(new Dimension(615, 477));\n\t\t\tjpanelFlowProfile.setBorder(BorderFactory.createTitledBorder(null, \"Back-Calculated Uracil Dead Time vs. Eluent Composition\", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font(\"Dialog\", Font.BOLD, 12), new Color(51, 51, 51)));\n\t\t\tjpanelFlowProfile.setBackground(Color.white);\n\t\t\tjpanelFlowProfile.setSize(new Dimension(469, 261));\n\t\t\tjpanelFlowProfile.setLocation(new Point(6, 308));\n\t\t\tjpanelFlowProfile.add(m_GraphControlFlowRate, null);\n\t\t}\n\t\treturn jpanelFlowProfile;\n\t}", "FlowDesignerFactory getFlowDesignerFactory();", "private void buildPanelEast() {\n\r\n }", "private PanelManager(FlowClient frame) {\r\n\t\t// Swing necessities\r\n\t\tlayout = new CardLayout();\r\n\t\tthis.frame = frame;\r\n\t\tthis.setLayout(layout);\r\n\t\tsetBorder(FlowClient.EMPTY_BORDER);\r\n\r\n\t\t// Creates new panels and adds them to the cardlayout stack\r\n\t\teditTabs = new EditTabs();\r\n\r\n\t\tloginPane = new LoginPane(this);\r\n\t\tadd(loginPane, \"loginPane\");\r\n\r\n\t\tCreateAccountPane createAccountPane = new CreateAccountPane(this);\r\n\t\tadd(createAccountPane, \"createPane\");\r\n\r\n\t\teditPane = new EditPane(this);\r\n\t\tadd(editPane, \"editPane\");\r\n\r\n\t\tdebugPane = new DebugPane(this);\r\n\t\tadd(debugPane, \"debugPane\");\r\n\r\n\t\tSettingsPane settingsTabs = new SettingsPane(this);\r\n\t\tadd(settingsTabs, \"settingsPane\");\r\n\r\n\t\thistoryPane = new HistoryPane(this);\r\n\t\tadd(historyPane, \"historyPane\");\r\n\t}", "public ComandaPanel() {\n\n initComponents();\n // comanda = new Comanda();\n }", "public PanelSgamacView1()\n {\n }", "@Override\r\n \tpublic void start(AcceptsOneWidget panel, EventBus eventBus) {\n \t\tpanel.setWidget(view);\t\t\r\n \t}", "private void $$$setupUI$$$() {\n panel1 = new JPanel();\n panel1.setLayout(new BorderLayout(0, 0));\n }", "private void setupPanel()\n\t{\n\t\tthis.setLayout(baseLayout);\n\t\tthis.add(firstButton);\n\t\tthis.add(firstField);\n\t}", "private void setUpPanel() {\n this.panel = new JPanel();\n functions = new JPanel();\n panel.setPreferredSize(new Dimension(Screen.screenWidth, Screen.screenHeight));\n\n int borderBottom = Screen.screenHeight / 8;\n if (Screen.screenHeight > 1400) {\n borderBottom = Screen.screenHeight / 7;\n }\n\n panel.setBorder(BorderFactory.createEmptyBorder(80, Screen.border, borderBottom, Screen.border));\n panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));\n functions.setPreferredSize(new Dimension(600, 500));\n functions.setLayout(cardLayout);\n }", "public static JPanel newPanel() {\n\t\treturn null;\n\t}", "public RepositoryPanel() {\n initComponents();\n }", "@Override\n\tJPanel publishPanel() {\n\t\treturn null;\n\t}", "public TemporizadorPanel() {\n initComponents();\n }", "public AppoinmentPanel() {\n initComponents();\n }", "public MenuPanel() {\n initComponents();\n }", "public WFSLayerPanel()\n {\n initComponents();\n }", "@Override\npublic void rebuildPanel() {\n\t\n}", "public WorkFlowLayout() {\r\n WorkFlowLayout.this.setWidth(100, Unit.PERCENTAGE);\r\n WorkFlowLayout.this.setHeight(100, Unit.PERCENTAGE);\r\n\r\n VerticalLayout content = new VerticalLayout();\r\n content.setHeightUndefined();\r\n content.setWidth(100, Unit.PERCENTAGE);\r\n WorkFlowLayout.this.setContent(content);\r\n WorkFlowLayout.this.setStyleName(\"subframe\");\r\n\r\n content.setSpacing(true);\r\n\r\n Label titleLabel = new Label(\"SearchGUI-PeptideShaker-WorkFlow\");\r\n titleLabel.setStyleName(\"frametitle\");\r\n content.addComponent(titleLabel);\r\n\r\n searchSettingsFileList = new DropDownList(\"Search Settings (Select or Enter New Name)\");\r\n content.addComponent(searchSettingsFileList);\r\n searchSettingsFileList.setFocous();\r\n\r\n HorizontalLayout btnsFrame = new HorizontalLayout();\r\n btnsFrame.setWidthUndefined();\r\n btnsFrame.setSpacing(true);\r\n btnsFrame.setStyleName(\"bottomformlayout\");\r\n content.addComponent(btnsFrame);\r\n\r\n Label addNewSearchSettings = new Label(\"Add\");\r\n addNewSearchSettings.addStyleName(\"windowtitle\");\r\n btnsFrame.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {\r\n @Override\r\n public void layoutClick(LayoutEvents.LayoutClickEvent event) {\r\n Component c = event.getClickedComponent();\r\n if (c != null && c instanceof Label && ((Label) c).getValue().equalsIgnoreCase(\"Add\")) {\r\n String basepath = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath();\r\n File file = new File(basepath + \"/VAADIN/default_searching.par\");\r\n SearchParameters searchParameters;\r\n try {\r\n searchParameters = SearchParameters.getIdentificationParameters(file);\r\n searchParameters.setFastaFile(null);\r\n } catch (IOException | ClassNotFoundException ex) {\r\n\r\n ex.printStackTrace();\r\n return;\r\n }\r\n searchParameters.setDefaultAdvancedSettings();\r\n searchSettingsLayout.updateForms(searchParameters, null);\r\n editSearchOption.setPopupVisible(true);\r\n } else if (c != null && c instanceof Label && ((Label) c).getValue().equalsIgnoreCase(\"Edit\")) {\r\n\r\n try {\r\n File file = searchSettingsMap.get(searchSettingsFileList.getSelectedValue()).getFile();\r\n searchParameters = SearchParameters.getIdentificationParameters(file);\r\n } catch (IOException | ClassNotFoundException ex) {\r\n ex.printStackTrace();\r\n return;\r\n }\r\n searchSettingsLayout.updateForms(searchParameters, searchSettingsFileList.getSelectedValue());\r\n editSearchOption.setPopupVisible(true);\r\n\r\n }\r\n }\r\n });\r\n btnsFrame.addComponent(addNewSearchSettings);\r\n Label editSearchSettings = new Label(\"Edit\");\r\n editSearchSettings.addStyleName(\"windowtitle\");\r\n btnsFrame.addComponent(editSearchSettings);\r\n searchSettingsLayout = new SearchSettingsLayout() {\r\n @Override\r\n public void saveSearchingFile(SearchParameters searchParameters, boolean editMode) {\r\n checkAndSaveSearchSettingsFile(searchParameters, editMode);\r\n editSearchOption.setPopupVisible(false);\r\n }\r\n\r\n @Override\r\n public void cancel() {\r\n editSearchOption.setPopupVisible(false);\r\n }\r\n\r\n };\r\n editSearchOption = new PopupWindow(\"Edit\");\r\n editSearchOption.setContent(searchSettingsLayout);\r\n editSearchOption.setSizeFull();\r\n editSearchOption.addStyleName(\"centerwindow\");\r\n\r\n Label searchSettingInfo = new Label();\r\n searchSettingInfo.setWidth(400, Unit.PIXELS);\r\n searchSettingInfo.setHeight(90, Unit.PIXELS);\r\n searchSettingInfo.setStyleName(\"subpanelframe\");\r\n searchSettingInfo.addStyleName(\"bottomformlayout\");\r\n searchSettingInfo.addStyleName(\"smallfontlongtext\");\r\n content.addComponent(searchSettingInfo);\r\n\r\n mgfFileList = new MultiSelectOptionGroup(\"Spectrum File(s)\", false);\r\n content.addComponent(mgfFileList);\r\n mgfFileList.setRequired(true, \"Select at least 1 MGF file\");\r\n mgfFileList.setViewList(true);\r\n\r\n MultiSelectOptionGroup searchEngines = new MultiSelectOptionGroup(\"Search Engines\", false);\r\n content.addComponent(searchEngines);\r\n searchEngines.setRequired(true, \"Select at least 1 search engine\");\r\n searchEngines.setViewList(true);\r\n\r\n Map<String, String> searchEngienList = new LinkedHashMap<>();\r\n searchEngienList.put(\"X!Tandem\", \"X!Tandem\");\r\n searchEngienList.put(\"MS-GF+\", \"MS-GF+\");\r\n searchEngienList.put(\"OMSSA\", \"OMSSA\");\r\n searchEngienList.put(\"Comet\", \"Comet\");\r\n searchEngienList.put(\"Tide\", \"Tide\");\r\n searchEngienList.put(\"MyriMatch\", \"MyriMatch\");\r\n searchEngienList.put(\"MS_Amanda\", \"MS_Amanda\");\r\n searchEngienList.put(\"DirecTag\", \"DirecTag\");\r\n searchEngienList.put(\"Novor (Select for non-commercial use only)\", \"Novor (Select for non-commercial use only)\");\r\n searchEngines.updateList(searchEngienList);\r\n searchEngines.setSelectedValue(\"X!Tandem\");\r\n searchEngines.setSelectedValue(\"MS-GF+\");\r\n searchEngines.setSelectedValue(\"OMSSA\");\r\n HorizontalLayout bottomLayout = new HorizontalLayout();\r\n bottomLayout.setStyleName(\"bottomformlayout\");\r\n bottomLayout.setWidth(400, Unit.PIXELS);\r\n bottomLayout.setSpacing(true);\r\n content.addComponent(bottomLayout);\r\n\r\n projectNameField = new HorizontalLabelTextField(\"<b>Project Name</b>\", \"New Project Name\", null);\r\n projectNameField.setWidth(100, Unit.PERCENTAGE);\r\n projectNameField.setRequired(true);\r\n bottomLayout.addComponent(projectNameField);\r\n bottomLayout.setExpandRatio(projectNameField, 70);\r\n\r\n Button executeWorkFlow = new Button(\"Execute\");\r\n executeWorkFlow.setStyleName(ValoTheme.BUTTON_SMALL);\r\n executeWorkFlow.addStyleName(ValoTheme.BUTTON_TINY);\r\n bottomLayout.addComponent(executeWorkFlow);\r\n bottomLayout.setComponentAlignment(executeWorkFlow, Alignment.TOP_RIGHT);\r\n bottomLayout.setExpandRatio(executeWorkFlow, 30);\r\n\r\n executeWorkFlow.addClickListener((Button.ClickEvent event) -> {\r\n String fastFileId = searchSettingsLayout.getFastaFileId();\r\n Set<String> spectrumIds = mgfFileList.getSelectedValue();\r\n Set<String> searchEnginesIds = searchEngines.getSelectedValue();\r\n String projectName = projectNameField.getSelectedValue().replace(\" \", \"_\").replace(\"-\", \"_\");\r\n if (!projectNameField.isValid() || fastFileId == null || spectrumIds == null || searchEnginesIds == null) {\r\n return;\r\n }\r\n Map<String, Boolean> selectedSearchEngines = new HashMap<>();\r\n searchEngienList.keySet().forEach((paramId) -> {\r\n selectedSearchEngines.put(paramId, searchEngines.getSelectedValue().contains(paramId));\r\n });\r\n executeWorkFlow(projectName, fastFileId, spectrumIds, searchEnginesIds, searchSettingsLayout.getSearchParameters(), selectedSearchEngines);\r\n });\r\n mgfFileList.setEnabled(false);\r\n searchEngines.setEnabled(false);\r\n projectNameField.setEnabled(false);\r\n editSearchSettings.setEnabled(false);\r\n executeWorkFlow.setEnabled(false);\r\n searchSettingsFileList.addValueChangeListener((Property.ValueChangeEvent event) -> {\r\n if (searchSettingsFileList.getSelectedValue() != null) {\r\n mgfFileList.setEnabled(true);\r\n searchEngines.setEnabled(true);\r\n projectNameField.setEnabled(true);\r\n editSearchSettings.setEnabled(true);\r\n executeWorkFlow.setEnabled(true); \r\n try { \r\n File file = searchSettingsMap.get(searchSettingsFileList.getSelectedValue()).getFile(); \r\n searchParameters = SearchParameters.getIdentificationParameters(file);\r\n String descrip = searchParameters.getShortDescription();\r\n descrip = descrip.replace(searchParameters.getFastaFile().getName(), searchSettingsLayout.getFastaFileName(searchParameters.getFastaFile().getName().split(\"__\")[0]));\r\n searchSettingInfo.setValue(descrip);\r\n } catch (IOException | ClassNotFoundException ex) {\r\n ex.printStackTrace();\r\n return;\r\n }\r\n searchSettingsLayout.updateForms(searchParameters, searchSettingsFileList.getSelectedValue());\r\n\r\n }\r\n });\r\n }", "public DrawPanel() {\n initComponents();\n }", "public DataSetPanel() {\n initComponents();\n }", "SummaryPanel() {\r\n\t\tsetLayout(new GridBagLayout());\r\n\t\tsetBackground(Color.white);\r\n\t\twriteButton.addActionListener(this);\r\n\t\tsetupGui();\r\n\t}", "public PanelFX getPanel() {\n return panel;\n }", "public GraphPanel()\n\t{\n\t\t// instantiates graphArray to hold list of names to graph \n\t\tgraphArray = new ArrayList<NameRecord>();\n\t\t\n\t\t// sets the size of the panel\n\t\tsetPreferredSize(new Dimension(600,600));\n\t}", "public JJPanel() {\n\n\t}", "public LoginJPanel() {\n initComponents();\n }", "private MusicPlayer()\n {\n panel = new JFXPanel();\n }", "public JPanel getJPanel();", "public JPanel getJPanel();", "public RepalyPanel() {\n\t\t\ttry {\n//\t\t\t\tthis.addMouseListener(new MouseAdapter() {\n//\t\t\t\t\t@Override\n//\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n//\t\t\t\t\t\tSystem.out.println(e.getX() + \" \" + e.getY());\n//\t\t\t\t\t}\n//\t\t\t\t});\n\n\t\t\t\tsetLayout(null);\n\n\t\t\t\t// 退出按键\n\t\t\t\tjbRestart = MyButton.makeButton(restart, restart_down,\n\t\t\t\t\t\trestart_hover);\n\t\t\t\tadd(jbRestart);\n\t\t\t\tjbRestart.setBounds(540, 355, 140, 56);\n\t\t\t\tjbRestart.addActionListener(this);\n\n\t\t\t\t// 确认退出按键\n\t\t\t\tjbContinue = MyButton.makeButton(continue_pic, continue_down,\n\t\t\t\t\t\tcontinue_hover);\n\t\t\t\tadd(jbContinue);\n\t\t\t\tjbContinue.setBounds(345, 355, 140, 56);\n\t\t\t\tjbContinue.addActionListener(this);\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public ProcessWorkRequestJPanel() {\n initComponents();\n }", "private void setupPanel()\n\t{\n\t\tsetLayout(numberLayout);\n\t\tsetBorder(new EtchedBorder(EtchedBorder.RAISED, Color.GRAY, Color.DARK_GRAY));\n\t\tsetBackground(Color.LIGHT_GRAY);\n\t\tadd(ans);\n\t\tadd(clear);\n\t\tadd(backspace);\n\t\tadd(divide);\n\t\tadd(seven);\n\t\tadd(eight);\n\t\tadd(nine);\n\t\tadd(multiply);\n\t\tadd(four);\n\t\tadd(five);\n\t\tadd(six);\n\t\tadd(subtract);\n\t\tadd(one);\n\t\tadd(two);\n\t\tadd(three);\n\t\tadd(add);\n\t\tadd(negative);\n\t\tadd(zero);\n\t\tadd(point);\n\t\tadd(equals);\n\t}", "private void addGraphPanel() {\n // Starting\n String S = C + \": addGraphPanel(): \";\n graphPanel.drawGraphPanel(xAxisName,yAxisName,functionList,xLog,yLog,customAxis,TITLE,buttonControlPanel);\n togglePlot();\n }", "public VirtualPanel() {}", "public abstract void createContents(Panel mainPanel);", "private void setPanel(final Panel PANEL)\r\n\t{\r\n\t\tthis.panel = PANEL;\r\n\t}", "public JPanel getPanel() {\n return panel;\n }", "private void setupPanel()\n\t{\n\t\tthis.setLayout(baseLayout);\n\t\tqueryButton = new JButton(\"query\");\n\t\tthis.add(queryButton);\n\t\tthis.add(displayPane);\n\t\tdisplayArea = new JTextArea(10,30);\n\t\tadd(displayArea);\n\t\t\n\t\t\n\t}", "private Panel designPanel() {\n Panel panel = new Panel();\n contentLayout = new FormLayout();\n wrapperLayout = new VerticalLayout();\n numberOfDatasetsBox = new ComboBox<>();\n numberOfReplicatesBox = new ComboBox<>(\"Select number of Replicates\");\n\n\n List<Integer> possibleDatasetNumber =\n IntStream.rangeClosed(1, 100).boxed().collect(Collectors.toList());\n numberOfDatasetsBox.setItems(possibleDatasetNumber);\n\n List<Integer> possibleReplicateNumber =\n IntStream.rangeClosed(1, 100).boxed().collect(Collectors.toList());\n numberOfReplicatesBox.setItems(possibleReplicateNumber);\n\n datasetAccordion = new Accordion();\n datasetAccordion.setWidth(\"100%\");\n\n panel.setContent(wrapperLayout);\n return panel;\n }", "public JPanel createPanel() {\n\t\t\r\n\t\tJPanel mainPanel = new JPanel();\r\n\t\tmainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));\r\n\t\tmainPanel.setBackground(Color.WHITE);\r\n\t\tmainPanel.setBorder(new CompoundBorder(\r\n\t\t\t\tBorderFactory.createLineBorder(new Color(0x3B70A3), 4),\r\n\t\t\t\tnew EmptyBorder(10, 20, 10, 20)));\r\n\r\n\t\t/*\r\n\t\t * Instruction\r\n\t\t */\t\r\n\t\tmainPanel.add(instructionPanel());\r\n\t\t\r\n\t\t\r\n\t\t// TODO: set task order for each group - make first 3 tasks = groups tasks\r\n\t\tmainPanel.add(messagesPanel());\r\n\t\tmainPanel.add(Box.createRigidArea(new Dimension(this.getWidth(), 5)));\r\n\r\n\t\tmainPanel.add(phonePanel());\r\n\t\tmainPanel.add(Box.createRigidArea(new Dimension(this.getWidth(), 5)));\r\n\r\n\t\tmainPanel.add(clockPanel());\r\n\t\tmainPanel.add(Box.createRigidArea(new Dimension(this.getWidth(), 5)));\r\n\r\n\t\tmainPanel.add(cameraPanel());\r\n\t\tmainPanel.add(Box.createRigidArea(new Dimension(this.getWidth(), 5)));\t\r\n\r\n\t\tmainPanel.add(contactPanel());\r\n\t\tmainPanel.add(Box.createRigidArea(new Dimension(this.getWidth(), 5)));\r\n\r\n\t\tmainPanel.add(galleryPanel());\r\n\t\t\r\n\t\treturn mainPanel;\r\n\t}", "@Override\r\n\tpublic void onPanelClosed(Panel panel) {\n\r\n\t}", "public void buildFlow(FlowDO flow) {\n\t}", "public void setFlow(int flow) {\r\n\r\n this.flow = flow;\r\n }", "public DRInitialPlotPanel() {\n initComponents();\n }", "public MundoJuego( JPanel panel ) {\r\n\t\tthis.panel = panel;\r\n\t}", "public FreimapVisualPanel2() {\n initComponents();\n }", "private void setupLayout() {\r\n\t\tgetContentPane().add(panel);\r\n\t}", "public TogglePanel() {\r\n this(\"\");\r\n }", "@Override\n public FlowBuilder getFlowBuilder() {\n return this.flowBuilder;\n }", "public void crearPanel(){\n\n panel = new JPanel();\n this.getContentPane().add(panel);\n panel.setBackground(Color.CYAN);\n panel.setLayout(null);\n }", "public RSPStatusPanel() \n {\n initComponents();\n }", "@Override\r\n\tpublic Panel getUI() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Panel getUI() {\n\t\treturn null;\r\n\t}", "private void createPanelContent() {\n FragmentActivity activity = getActivity();\n if (this.mLayoutView == null) {\n activity.finish();\n }\n ViewGroup.LayoutParams layoutParams = this.mLayoutView.getLayoutParams();\n layoutParams.height = -2;\n this.mLayoutView.setLayoutParams(layoutParams);\n this.mPanelSlices = (RecyclerView) this.mLayoutView.findViewById(C0010R$id.panel_parent_layout);\n this.mSeeMoreButton = (TextView) this.mLayoutView.findViewById(C0010R$id.see_more);\n this.mDoneButton = (TextView) this.mLayoutView.findViewById(C0010R$id.done);\n this.mTitleView = (TextView) this.mLayoutView.findViewById(C0010R$id.panel_title);\n this.mPanelHeader = (LinearLayout) this.mLayoutView.findViewById(C0010R$id.panel_header);\n this.mTitleIcon = (ImageView) this.mLayoutView.findViewById(C0010R$id.title_icon);\n this.mHeaderTitle = (TextView) this.mLayoutView.findViewById(C0010R$id.header_title);\n this.mHeaderSubtitle = (TextView) this.mLayoutView.findViewById(C0010R$id.header_subtitle);\n this.mFooterDivider = this.mLayoutView.findViewById(C0010R$id.footer_divider);\n this.mPanelSlices.setVisibility(8);\n Bundle arguments = getArguments();\n String string = arguments.getString(\"PANEL_CALLING_PACKAGE_NAME\");\n PanelContent panel = FeatureFactory.getFactory(activity).getPanelFeatureProvider().getPanel(activity, arguments);\n this.mPanel = panel;\n if (panel == null) {\n activity.finish();\n }\n this.mPanel.registerCallback(new LocalPanelCallback());\n if (this.mPanel instanceof LifecycleObserver) {\n getLifecycle().addObserver((LifecycleObserver) this.mPanel);\n }\n this.mMetricsProvider = FeatureFactory.getFactory(activity).getMetricsFeatureProvider();\n this.mPanelSlices.setLayoutManager(new LinearLayoutManager(activity));\n this.mLayoutView.getViewTreeObserver().addOnPreDrawListener(this.mOnPreDrawListener);\n loadAllSlices();\n IconCompat icon = this.mPanel.getIcon();\n CharSequence title = this.mPanel.getTitle();\n if (icon == null) {\n this.mTitleView.setVisibility(0);\n this.mPanelHeader.setVisibility(8);\n this.mTitleView.setText(title);\n } else {\n this.mTitleView.setVisibility(8);\n this.mPanelHeader.setVisibility(0);\n this.mPanelHeader.setAccessibilityPaneTitle(title);\n this.mTitleIcon.setImageIcon(icon.toIcon(getContext()));\n this.mHeaderTitle.setText(title);\n this.mHeaderSubtitle.setText(this.mPanel.getSubTitle());\n if (this.mPanel.getHeaderIconIntent() != null) {\n this.mTitleIcon.setOnClickListener(getHeaderIconListener());\n this.mTitleIcon.setLayoutParams(new LinearLayout.LayoutParams(-2, -2));\n } else {\n int dimensionPixelSize = getResources().getDimensionPixelSize(C0007R$dimen.output_switcher_panel_icon_size);\n this.mTitleIcon.setLayoutParams(new LinearLayout.LayoutParams(dimensionPixelSize, dimensionPixelSize));\n }\n }\n if (this.mPanel.getViewType() == 2) {\n this.mFooterDivider.setVisibility(0);\n } else {\n this.mFooterDivider.setVisibility(8);\n }\n this.mSeeMoreButton.setOnClickListener(getSeeMoreListener());\n this.mDoneButton.setOnClickListener(getCloseListener());\n if (this.mPanel.isCustomizedButtonUsed()) {\n CharSequence customizedButtonTitle = this.mPanel.getCustomizedButtonTitle();\n if (TextUtils.isEmpty(customizedButtonTitle)) {\n this.mSeeMoreButton.setVisibility(8);\n } else {\n this.mSeeMoreButton.setVisibility(0);\n this.mSeeMoreButton.setText(customizedButtonTitle);\n }\n } else if (this.mPanel.getSeeMoreIntent() == null) {\n this.mSeeMoreButton.setVisibility(8);\n }\n this.mMetricsProvider.action(0, 1, this.mPanel.getMetricsCategory(), string, 0);\n }", "private org.gwtbootstrap3.client.ui.Panel get_f_Panel75() {\n return build_f_Panel75();\n }" ]
[ "0.7153181", "0.71138865", "0.691021", "0.6691845", "0.66799545", "0.66209203", "0.6613823", "0.65909994", "0.65831804", "0.6527277", "0.6499493", "0.63883865", "0.63863415", "0.6362439", "0.6360537", "0.63266253", "0.6287224", "0.62729347", "0.6264354", "0.6209417", "0.619757", "0.61900026", "0.6186267", "0.6170408", "0.6165992", "0.6160479", "0.6160479", "0.61380523", "0.6136745", "0.6129967", "0.6105486", "0.61050075", "0.61050075", "0.60939866", "0.60899377", "0.60799164", "0.6066563", "0.6065736", "0.6063344", "0.60229325", "0.60199285", "0.6016294", "0.6008426", "0.6003137", "0.6003137", "0.59877765", "0.5981269", "0.59782016", "0.5973214", "0.5966129", "0.5963908", "0.5963556", "0.59550697", "0.59538215", "0.59293616", "0.59143686", "0.5912692", "0.5906678", "0.5906038", "0.5902782", "0.59007746", "0.5899372", "0.5892084", "0.5885806", "0.58814406", "0.58770806", "0.5858036", "0.58500195", "0.5845919", "0.5831227", "0.5830867", "0.5829815", "0.582929", "0.5814282", "0.5814282", "0.5809594", "0.5802983", "0.5800477", "0.5796774", "0.579673", "0.57947564", "0.5794371", "0.579295", "0.57844573", "0.57795763", "0.5778864", "0.57705677", "0.57699776", "0.5764217", "0.576143", "0.57553476", "0.57551706", "0.5751688", "0.57467717", "0.57441586", "0.5741601", "0.57377684", "0.57373685", "0.57373685", "0.573714", "0.5735486" ]
0.0
-1