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
Searches for a persons name and prints the information of all the persons in the database with that name
public String searchPerson(String name){ String string = ""; ArrayList<Person> list = new ArrayList<Person>(); for(Person person: getPersons().values()){ String _name = person.getName(); if(_name.contains(name)){ list.add(person); } } list.sort(Comparator.comparing(Person::getName)); for (int i = 0; i < list.size(); i++){ string += list.get(i).toString(); } return string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void personLookup() {\n\t\tSystem.out.print(\"Person: \");\n\t\tString entryName = getInputForName();\n\t\tphoneList\n\t\t\t.stream()\n\t\t\t.filter(n -> n.getName().equals(entryName))\n\t\t\t.forEach(n -> System.out.println(n));\n\t}", "private void displayStudentByName(String name) {\n\n int falg = 0;\n\n for (Student student : studentDatabase) {\n\n if (student.getName().equals(name)) {\n\n stdOut.println(student.toString());\n\n falg = 1;\n\n break;\n }\n }\n\n if (falg == 0) {\n\n stdOut.println(\"cannot find student\\n\");\n }\n }", "void searchByName(String name) {\n\t\tint i=0;\n\t\t\tfor (Entity entity : Processing.nodeSet) {\n\t\t\t\t\n\t\t\t\t/* if Entity is person */\n\t\t\t\tif(entity instanceof Person) {\n\t\t\t\t\tPerson person=(Person)entity;\n\t\t\t\t\tif(person.getName().equalsIgnoreCase(name)){\n\t\t\t\t\tSystem.out.println(\"the person details are :\");\n\t\t\t\t\tSystem.out.println(\" name : \" + person.getName());\n\t\t\t\t\tSystem.out.println(\" phone : \" + person.getPhone());\n\t\t\t\t\tSystem.out.println(\" email : \" + person.getEmail());\n\t\t\t\t\tSystem.out.println(\" school : \" + person.getSchool());\n\t\t\t\t\tSystem.out.println(\" college : \" + person.getCollege() + \"\\n\");\n\t\t\t\t\t\tfor(String interest:person.getInterests()){\n\t\t\t\t\t\t\tSystem.out.println(\" interest in : \" +interest + \"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/* If entity is organization */\n\t\t\t\telse {\n\t\t\t\t\tOrganization organization=(Organization)entity;\n\t\t\t\t\tif(organization.getName().equalsIgnoreCase(name)){\n\t\t\t\t\t\tSystem.out.println(\"the person details are :\");\n\t\t\t\t\t\tSystem.out.println(\" name : \" + organization.getName());\n\t\t\t\t\t\tSystem.out.println(\" phone : \" + organization.getPhone());\n\t\t\t\t\t\tSystem.out.println(\" email : \" + organization.getEmail());\n\t\t\t\t\t\tfor(String interest:organization.getCourses()){\n\t\t\t\t\t\t\tSystem.out.println(\" courses are : \" +interest + \"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(String interest:organization.getFaculty()){\n\t\t\t\t\t\t\tSystem.out.println(\" Faculties are : \" +interest + \"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(String interest:organization.getPlacements()){\n\t\t\t\t\t\t\tSystem.out.println(\" Placements are : \" +interest + \"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tif(i>=Processing.nodeSet.size()) {//if no such name exist\n\t\t\t\tSystem.out.println(name+\" does not exist\");\n\t\t\t}\n\t}", "private void searchPerson(String searchName){\r\n\r\n textAreaFromSearch.setText(\"\");\r\n try{\r\n Scanner scanner = new Scanner(file);\r\n String info;\r\n\r\n while (scanner.hasNext()){\r\n String line = scanner.nextLine();\r\n String[] components = line.split(separator);\r\n if (searchName.length() == 0){\r\n return;\r\n }\r\n if (components[0].contains(searchName)){\r\n info = \" Name: \" + components[0] + \"\\n\";\r\n info += \" Phone No.: \"+components[1]+\"\\n\";\r\n info += \" Email: \"+components[2]+\"\\n\";\r\n info += \" Address: \"+components[3]+\"\\n\";\r\n textAreaFromSearch.append(info+\"\\n\");\r\n }\r\n }\r\n }catch (IOException e){\r\n fileError();\r\n }\r\n }", "@Override\n\tpublic void searchByName() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Patient's name\").toString().equals(search))\n\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t++count + \" Name:\" + jsnobj.get(\"Patient's name\") + \" ID:\" + jsnobj.get(\"Patient's ID\")\n\t\t\t\t\t\t\t\t+ \" Mobile:\" + jsnobj.get(\"Mobile\") + \" Age:\" + jsnobj.get(\"Age\"));\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t}", "public void searchPerson() {\n\t\tSystem.out.println(\"*****Search a person*****\");\n\t\tSystem.out.println(\"Enter Phone Number to search: \");\n\t\tlong PhoneSearch = sc.nextLong();\n\t\tfor (int i = 0; i < details.length; i++) {\n\t\t\tif (details[i] != null && details[i].getPhoneNo() == PhoneSearch) {\n\t\t\t\tSystem.out.print(\"Firstname \\tLastname \\tAddress \\t\\tCity \\t\\tState \\t\\t\\tZIP \\t\\tPhone \\n\");\n\t\t\t\tSystem.out.println(details[i]);\n\t\t\t}\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\r\n public Collection<Person> findPersonsByName(String name) throws DataAccessException {\r\n return template.find(\"from Person p where p.lastName = ?\", name);\r\n }", "public void findByName() {\n String name = view.input(message_get_name);\n if (name != null){\n try{\n List<Customer> list = model.findByName(name);\n if(list!=null)\n if(list.isEmpty())\n view.showMessage(not_found_name);\n else\n view.showTable(list);\n else\n view.showMessage(not_found_error);\n }catch(Exception e){\n view.showMessage(incorrect_data_error);\n }\n } \n }", "private static void search_by_name() {\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\r\n\t\t\tSystem.out.println(\"Project Name: \");\r\n\t\t\tString project_name = input.nextLine();\r\n\t\t\r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects INNER JOIN project_statuses ON \"\r\n\t\t\t\t\t+ \"projects.project_id = project_statuses.project_id;\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\t\r\n\t\t\tfetch_all_project_info(stmt, project_name, project_rset);\r\n\t\t/**\r\n\t\t * @exception If entered project name cannot be found in the projects table then an SQLException is thrown\r\n\t\t */\t\t\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}", "public void searchByName(String name) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(\"./src/data/contactInfo.text\"));\n\t\t\tString line;\n\t\t\twhile((line = reader.readLine()) != null){\n\t\t\t\tif(line.toLowerCase().contains(name.toLowerCase())) {\n\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t}\n\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void searchPerson() {\r\n\r\n\t/*get values from text filed*/\r\n\tname = tfName.getText();\r\n\r\n\t/*clear contents of arraylist if there are any from previous search*/\r\n\tpersonsList.clear();\r\n\r\n // intialize recordNumber to zero\r\n\trecordNumber = 0;\r\n\r\n\tif(name.equals(\"\"))\r\n\t{\r\n\t\tJOptionPane.showMessageDialog(null,\"Please enter person name to search.\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\t/*get an array list of searched persons using PersonDAO*/\r\n\t\tpersonsList = pDAO.searchPerson(name);\r\n\r\n\t\tif(personsList.size() == 0)\r\n\t\t{\r\n\t\t\tJOptionPane.showMessageDialog(null, \"No record found.\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/*downcast the object from array list to PersonInfo*/\r\n\t\t\tPersonInfo person = (PersonInfo) personsList.get(recordNumber);\r\n\r\n // displaying search record in text fields \r\n\t\t\ttfName.setText(person.getName());\r\n\t\t\ttfAddress.setText(person.getAddress());\r\n\t\t\ttfPhone.setText(\"\"+person.getPhone());\r\n\t\t\ttfEmail.setText(person.getEmail());\r\n\t\t}\r\n\t}\r\n\r\n }", "public static void printLongestNamedPeople(){\n ArrayList<Person> longests = query.getLongestNamed();\n if (longests.size() == 1) {\n System.out.println(\"The person with the longest name is: \");\n } else {\n System.out.println(\"The people with the longest names are: \");\n }\n for (Person p : longests) {\n System.out.println(p);\n }\n }", "private void displayScholarshipByName(String name) {\n\n int falg = 0;\n\n stdOut.println(name + \"\\n\");\n\n for (Scholarship scholarship : scholarshipDatabase) {\n\n stdOut.println(scholarship.getName() + \"\\n\");\n\n if (scholarship.getName().equals(name)) {\n\n stdOut.println(scholarship.toString());\n\n falg = 1;\n\n break;\n }\n }\n\n if (falg == 0) {\n\n stdOut.println(\"cannot find scholarship\\n\");\n\n }\n }", "@RequestMapping(value = \"/search/{name}\", method = RequestMethod.GET)\n\tpublic @ResponseBody List<Person> findByName(@PathVariable final String name) {\n\t\tlogger.info(\"Find person phones by name\");\n\t\treturn this.phoneBookService.findByName(name);\n\t}", "public static ResultSet searchBySurname(String name) {\r\n\t\ttry{\r\n\t\t\tconnection = DriverManager.getConnection(connectionString);\r\n\t\t\tstmt = connection.prepareStatement(\"SELECT * FROM Patient WHERE Surname =?;\");\r\n\t\t\tstmt.setString(1, name);\r\n\t\t\tdata = stmt.executeQuery();\r\n\t\t}\r\n\t\tcatch (SQLException ex){\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\treturn data;\r\n\t}", "public void listBooksByName(String name) {\n String sql = \"SELECT ISBN, BookName, AuthorName, Price \" +\n \"FROM books \" +\n \"WHERE BookName = ?\";\n\n try (Connection conn = this.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n // Set values\n pstmt.setString(1, name);\n\n ResultSet rs = pstmt.executeQuery();\n\n // Print results\n while(rs.next()) {\n System.out.println(rs.getInt(\"ISBN\") + \"\\t\" +\n rs.getString(\"BookName\") + \"\\t\" +\n rs.getString(\"AuthorName\") + \"\\t\" +\n rs.getInt(\"Price\"));\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "ResultSet searchName(String name) {\n \ttry {\n \t\tStatement search = this.conn.createStatement();\n \tString query = \"SELECT * FROM Pokemon WHERE Name = \" + \"'\" + name + \"'\";\n \t\n \treturn search.executeQuery(query);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n }", "public void outputNames(){\n System.out.printf(\"\\n%9s%11s\\n\",\"Last Name\",\"First Name\");\n pw.printf(\"\\n%9s%11s\",\"Last Name\",\"First Name\");\n ObjectListNode p=payroll.getFirstNode();\n while(p!=null){\n ((Employee)p.getInfo()).displayName(pw);\n p=p.getNext();\n }\n System.out.print(\"\\nNumber of Employees: \"+payroll.size()+\"\\n\");\n pw.print(\"\\nNumber of Employees: \"+payroll.size()+\"\\n\");\n }", "static public Person searchPerson(String name) {\n return personMap.get(name);\n }", "public void searchByName() {\n System.out.println(\"enter a name to search\");\n Scanner sc = new Scanner(System.in);\n String fName = sc.nextLine();\n Iterator itr = list.iterator();\n while (itr.hasNext()) {\n Contact person = (Contact) itr.next();\n if (fName.equals(person.getFirstName())) {\n List streamlist = list.stream().\n filter(n -> n.getFirstName().\n contains(fName)).\n collect(Collectors.toList());\n System.out.println(streamlist);\n }\n }\n }", "public void listBooksByAuthor(String name) {\n String sql = \"SELECT ISBN, BookName, AuthorName, Price \" +\n \"FROM books \" +\n \"WHERE AuthorName = ?\";\n\n try (Connection conn = this.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n // Set values\n pstmt.setString(1, name);\n\n ResultSet rs = pstmt.executeQuery();\n\n // Print results\n while(rs.next()) {\n System.out.println(rs.getInt(\"ISBN\") + \"\\t\" +\n rs.getString(\"BookName\") + \"\\t\" +\n rs.getString(\"AuthorName\") + \"\\t\" +\n rs.getInt(\"Price\"));\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public static void showResultPerson( Result<Record> result){\n \t for (Record r : result) {\n// Integer id = r.getValue(PERSON.PERSO_ID);\n String firstName = r.getValue(PERSON.PERSO_FIRSTNAME);\n String lastName = r.getValue(PERSON.PERSO_LASTNAME);\n\n System.out.println(\"Name : \" + firstName + \" \" + lastName);\n }\n }", "public String searchByName(String name){\n for(Thing things: everything){\n if(things.getName().equalsIgnoreCase(name)){\n return things.toString();\n }\n }\n return \"Cannot Find given Name\";\n }", "public synchronized String list(String name) {\n\t\tString result = \"\";\n\t\tboolean found = false;\n\t\tfor (Record r : record) {\n\t\t\tif (r.student.equals(name)) {\n\t\t\t\tfound = true;\n\t\t\t\tresult = result + r.ID + \" \" + r.book + \"*\";\n\t\t\t}\n\t\t}\n\t\tif (!found) {\n\t\t\tresult = \"No record found for \" + name;\n\t\t}\n\t\treturn result;\n\t}", "public void search(String LastName)\n {\n //delare variables to hold file types\n BufferedReader fIn = null;\n \n //try to open the file for reading\n try\n {\n fIn = new BufferedReader(new FileReader(filename)); \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"search: Exception opening the file\");\n }\n \n //try to read each record\n //if the value of the Last_name field equals the value\n /*\n create a counter to count the number of\n matching records\n */\n int counter = 0;\n \n try\n {\n //read the first record\n String line = fIn.readLine();\n \n //while the record is not null\n //split the record into fields\n //test if the field equals the LastName parameter\n //display the record and increment the counter\n //read the next record\n while(line != null)\n {\n String[] info = line.split(\",\");\n String last = info[0];\n if(last.equals(LastName))\n {\n System.out.print(line);\n counter += 1;\n }\n else\n {\n line = fIn.readLine();\n System.out.print(line);\n counter += 1;\n }\n line = fIn.readLine();\n }\n System.out.println(\"\\nTotal matching records found: \" + counter + \"\\n\");\n \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"search: Exception reading the file\");\n }\n\n // try to close the file\n try\n {\n fIn.close(); \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"search: Exception closing the file\");\n }\n \n //dislay a count of the records found\n \n \n }", "private void NameShow(HttpServletRequest request, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString find = request.getParameter(\"find\") == \"\" ? \"^^^^\" : request.getParameter(\"find\");\r\n\t\tSystem.out.println(find);\r\n\t\tint page = request.getParameter(\"page\") == \"\" || request.getParameter(\"page\") == null ? 1\r\n\t\t\t\t: Integer.valueOf(request.getParameter(\"page\"));\r\n\t\tList<Notice> list = service.selectByName(find);\r\n\t\trequest.setAttribute(\"count\", list.size());\r\n\t\trequest.setAttribute(\"list\", list);\r\n\t\trequest.setAttribute(\"nameshow\", \"nameshow\");\r\n\t\trequest.getRequestDispatcher(\"/WEB-INF/jsp/GongGaoGuanLi.jsp\").forward(request, resp);\r\n\t}", "private void filterPerName(EntityManager em) {\n System.out.println(\"Please enter the name: \");\n Scanner sc = new Scanner(System.in);\n //Debug : String name = \"Sel\";\n\n String name = sc.nextLine();\n\n TypedQuery<Permesso> query = em.createQuery(\"select p from com.hamid.entity.Permesso p where p.nome like '%\"+ name\n + \"%'\" , Permesso.class);\n\n List<Permesso> perList = query.getResultList();\n\n for (Permesso p : perList) {\n System.out.println(p.getNome());\n }\n }", "public PageBean<Match> find(String name) {\n\t\tif(name==null||\"\".equals(name.trim())){\r\n\t\t\treturn matchDao.find(\"from Match\");\r\n\t\t}else{\r\n\t\t\treturn matchDao.find(\"from Match where nickname like ? or userName like ?\",\r\n\t\t\t\t\tnew Object[]{\"%\"+name+\"%\",\"%\"+name+\"%\"});\r\n\t\t\t\r\n\t\t}\r\n\t}", "public void llistaArticlesByName(String string) {\n\t\tSystem.out.println(\"\\nArticles anomenats \" + string + \" :\");\n\t\t\n\t\tObjectSet<Article> articles = db.query(new Predicate<Article>() {\n\t\t\tpublic boolean match(Article article) {\n\t\t\t\treturn article.getName().equalsIgnoreCase(string);\n\t\t\t}\n\t\t});\n\t\tarticles.stream()\n\t\t\t\t.forEach(System.out::println);\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\r\n\tpublic Userinfo findbyname(String name) {\n\t\treturn userDAO.searchUserByName(name);\r\n\t}", "public void visPerson(){\r\n System.out.println(\"Hvilken person vil du se?\");\r\n String person = scan.nextLine().toLowerCase();\r\n if(person.equals(\"*\")) {\r\n for(Person sample : personListe.values()) {\r\n sample.visInfo();\r\n }\r\n }\r\n if (personListe.containsKey(person)) {\r\n personListe.get(person).visInfo();\r\n }\r\n\r\n else {\r\n System.out.println(\"Den personen finnes ikke\");\r\n }\r\n\r\n\r\n }", "private static String showDetails (String name){\n\t\t//We find the user\n\t\tint position = findContact(name);\n\t\t//If not found, we return null\n\t\tif (position==-1)\n\t\t\treturn null;\n\t\t//We return the details invoking the toString method\n\t\telse\n\t\t\treturn contacts[position].toString();\n\t}", "public String returnPerson(String person)\n\t{\n\t\tfor(int i = 0; i < peopleList.size(); i++)\n\t\t{\n\t\t\t// getSurname is a method defined in the Person class and return a persons last name\n\t\t\t// Compares the last name you typed in with the last name of each person in the peopleList list\n\t\t\t// if the last names are equal then return the person with the appropriate toString method\n\t\t\tif(person.equalsIgnoreCase(peopleList.get(i).getSurname())) \n\t\t\t{\n\t\t\t\treturn(peopleList.get(i).toString());\n\t\t\t}\n\t\t}\n\t\t// If the person looked for is not in the \"peopleList\" list; return the string \"notFound\" that is defined above\n\t\treturn notFound;\n\t}", "public void display_names()\n {\n //delare variables to hold file types\n BufferedReader br = null;\n \n \n //try to open the file for reading\n try\n {\n br = new BufferedReader(new FileReader(filename)); \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"display_names: Exception opening the file\");\n }\n /*\n try to read each record and display the field values.\n a) display all the lastName, firstName paired fields in the file; \n display with the format lastName, firstName\n count each record that is read \n */\n int counter = 0; //record counter\n try\n {\n //read the first record\n String line = br.readLine();\n //while the record is not null, display the record, count the record\n while(line != null)\n {\n System.out.print(\"\\n\" + line);\n counter += 1;\n line = br.readLine();\n }\n System.out.println(\"\\n\\nTotal records read: \" + counter);\n \n \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"display_names: Exception reading the file\");\n }\n \n //try to close the file\n try\n {\n br.close(); \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"display_names: Exception closing the file\");\n }\n //dislay a count of the records read\n \n }", "public void showBookingsByName(JTextArea output, String firstName, String lastName)\r\n {\r\n output.setText(\"Bookinger på \" + firstName + \" \" + lastName + \"\\n\\n\");\r\n \r\n Iterator<Booking> iter = bookings.iterator();\r\n \r\n while(iter.hasNext())\r\n {\r\n Booking booking = iter.next();\r\n \r\n if(booking.getGuest().getFirstname().equals(firstName) || \r\n booking.getGuest().getLastname().equals(lastName))\r\n {\r\n output.append(booking.toString() \r\n + \"\\n*******************************************************\\n\");\r\n }//End of if\r\n }// End of while\r\n }", "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\n\t\tPerson P1 = new Person(\"18\",\"Jose\",\"SoftDev\");\n\t\tPerson P2 = new Person(\"20\",\"Kiki\",\"Cleaner\");\n\t\t\n\t\t\n\t\t//print results using the tostring method\n\t\t//System.out.println(P1.toString()) ;\n\t\t//System.out.println(P2.toString()) ; //no longer needed\n\t\t\n\t\t\n\t\t//add to arraylist\n//\t\tPerson.peopleinfo.add(P1); //no longer needed as its incorporated in person class\n//\t\tPerson.peopleinfo.add(P2);\n\t\t\n\t\t//using for loop to output people:\n\t\t\n\t\tfor(Person person:Person.peopleinfo) {// Person = data type, person: ref var (placeholder), \n\t\t\tSystem.out.println(person);// person.name if u onl want name\n\t\t}\n\n\t\t// no need for static methods\n\t\tRunner_Person l = new Runner_Person();// you do this to create an instance of search within the main so that static is not reqd\n\t\tSystem.out.println(l.search(\"Jose\"));\n\n\t}", "@Override\n public boolean containsNameProfesor(String Name) {\n try {\n Entity retValue = null; \n Connection c = null;\n PreparedStatement pstmt = null;\n ResultSet rs = null;\n c = DBUtils.getConnection();\n pstmt = c.prepareStatement(\"SELECT * FROM persona where nombre = ?\");\n\n pstmt.setString(1, Name);\n\n rs = pstmt.executeQuery();\n\n if (rs.next()) {\n return true; \n } \n \n } catch (SQLException ex) {\n Logger.getLogger(JdbcCursoRepository.class.getName()).log(Level.SEVERE, null, ex);\n }\n return false;\n }", "public void getName(ArrayList<String> document) {\r\n name = \"\";\r\n int atIndex = address.indexOf('@');\r\n String username = address.substring(0, atIndex);\r\n for(int i = 0; i < document.size(); i++)\r\n {\r\n String[] words = document.get(i).split(\" \");\r\n for(int j = 0; j < words.length; j++)\r\n {\r\n if(username.contains(words[j].toLowerCase()))\r\n {\r\n name = document.get(i);\r\n break;\r\n }\r\n }\r\n if(!name.equals(\"\"))\r\n {\r\n break;\r\n }\r\n } \r\n }", "public void print() {\n System.out.println(\"Person of name \" + name);\n }", "@Override\n\tpublic void searchByID() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Patient's ID\").toString().equals(search))\n\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t++count + \" Name:\" + jsnobj.get(\"Patient's name\") + \" ID:\" + jsnobj.get(\"Patient's ID\")\n\t\t\t\t\t\t\t\t+ \" Mobile:\" + jsnobj.get(\"Mobile\") + \" Age:\" + jsnobj.get(\"Age\"));\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "MongoCursor<Document> findByPersonName(String personName);", "public static ArrayList<Member> findByName(String usr){\n setConnection();\n \n ArrayList<Member> members = new ArrayList<>();\n \n try{\n Statement statement = con.createStatement();\n \n //Query statement\n String query = \"SELECT * FROM member WHERE name LIKE ?\";\n\n //Create mysql prepared statement\n PreparedStatement preparedStatement = con.prepareStatement(query);\n preparedStatement.setString(1, \"%\"+usr+\"%\");\n \n //Execute the prepared statement\n ResultSet result = preparedStatement.executeQuery();\n \n while(result.next()){\n int memberId = result.getInt(1);\n String name = result.getString(2);\n String email = result.getString(3);\n String phone = result.getString(4);\n String address = result.getString(5);\n String dob = result.getString(6);\n \n members.add(new Member(memberId, name, email, phone, address, dob));\n }\n\n con.close();\n } catch (SQLException e){\n System.out.println(e.getMessage());\n }\n \n return members;\n }", "@Override\n public List<Doctor> searchByName(String name) throws IOException, ClassNotFoundException {\n doctorList = FileSystem.readFile(file, Doctor.class);\n List<Doctor> searchList = search(doctorList, Doctor::getName, name);\n return searchList;\n }", "Person findPerson(String name);", "public List<Customer> findByName(String n) {\n\n Connection conn = ConnectionFactory.getConnection();\n PreparedStatement ppst = null;\n ResultSet rest = null;\n List<Customer> customers = new ArrayList<>();\n\n try {\n ppst = conn.prepareStatement(\"SELECT * FROM customer WHERE LOWER(name) LIKE LOWER(?)\");\n ppst.setString(1, \"%\" + n + \"%\");\n rest = ppst.executeQuery();\n\n while (rest.next()) {\n Customer c = new Customer(\n rest.getInt(\"customer_key\"),\n rest.getString(\"name\"),\n rest.getString(\"id\"),\n rest.getString(\"phone\")\n );\n customers.add(c);\n }\n } catch (SQLException e) {\n throw new RuntimeException(\"Query error: \", e);\n } finally {\n ConnectionFactory.closeConnection(conn, ppst, rest);\n }\n return customers;\n }", "@Query(\"spouse.name = ?\")\n List<PersonDocument> findBySpouseName(String name);", "public List<Plant> findByName(String name) throws SQLException {\n\t\t// Declaring our variables\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\tList<Plant> pl = new ArrayList<Plant>();\n\n\t\t// Lets start the connection\n\t\ttry {\n\t\t\tconn = getConnection();\n\t\t\t// We will add LOWER and then toLower case so it wont be case sensitive\n\t\t\tstmt = conn.prepareStatement(\"SELECT * FROM garden WHERE LOWER(plant) LIKE ?\");\n\t\t\t// Here we going to add \"%\"'s in case of the name be between other words\n\t\t\tstmt.setString(1, \"%\" + name.toLowerCase() + \"%\");\n\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\t// Now we may have more than one result, so lets pass with a while\n\t\t\t// using method next on the result\n\t\t\twhile (rs.next()) {\n\t\t\t\t// The result wont return a Plant Object, so we first make it happen\n\t\t\t\tPlant p = createPlant(rs);\n\t\t\t\t// Now we can pass the resulting plant in his object format\n\t\t\t\tpl.add(p);\n\t\t\t}\n\t\t\trs.close();\n\t\t} finally {\n\t\t\t// If the Statement or the Connection, hasn't been closed, we close it\n\t\t\tif (conn != null) {\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t\tif (stmt != null) {\n\t\t\t\tstmt.close();\n\t\t\t}\n\t\t}\n\t\treturn pl;\n\t}", "public static String findStudent(String name) throws SQLException\n\t{\n\t\tString[] split = name.split(\"\\\\s+\");\n\t\tResultSet student_id;\n\t\tList<String> id;\n\t\tstudent_id = test.readDatabase(\"select distinct Banner_id from class_2016 where First_name = '\"+split[0]+\"' and Middle_name = '\"+split[1]+\"' and Last_name = '\"+split[2]+\"'\");\n\t\tid = test.writeResultSet(student_id,\"Banner_id\");\n\t\treturn id.get(0); \n\t}", "public PersonaBean getPerson(String searched) {\r\n\t\ttry {\r\n\t\t\tConnectionUtils connectionUtils = new ConnectionUtils();\r\n\t\t\tConnection connection = connectionUtils.openConnection();\r\n\t\t\tPreparedStatement ps = connection.prepareStatement(\"select phone_number from person where name = ?\");\r\n\t\t\tps.setString(1, searched);\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\tPersonaBean person = null;\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\tperson = new PersonaBean(searched, rs.getString(\"phone_number\"));\r\n\t\t\t}\r\n\t\t\treturn person;\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "private static Person findPersonByNameWithAllDogs(EntityManager em, String name) {\n\t\tQuery query = em.createQuery(\"select p from Person p join fetch p.dogs where p.name = :name\", Person.class);\n\t\tquery.setParameter(\"name\", name);\n\t\treturn (Person) query.getSingleResult();\n\t}", "public List<Student> searchStudent(String name) {\n List<Student> studentList = new ArrayList<>();\n Cursor cursor = sqLiteDatabase.rawQuery(\"SELECT * FROM Students WHERE name = ? \", new String[]{name});\n while (cursor.moveToNext()) {\n Student student = new Student(cursor.getString(cursor.getColumnIndex(DatabaseHelper.STUDENT_NAME)),\n cursor.getString(cursor.getColumnIndex(DatabaseHelper.STUDENT_ADDRESS)),\n cursor.getInt(cursor.getColumnIndex(DatabaseHelper.ID)));\n studentList.add(student);\n }\n return studentList;\n }", "public static void searchFriends(String name) {\n\t\tScanner reader = new Scanner(System.in);\t\n\t\tSystem.out.println(\"Please Enter the Profile Name of the Person you need to Search\");\n\t\tString profilename = reader.nextLine();\n\t\t\n\t\t\n\t\tif(profiles.get(index.indexOf(name)).searchFriends(profilename)) {\n\t\t\tSystem.out.println(\"Yes \" + name + \" is a friend of \"+ profilename);\t\n\t\t}else {\n\t\t\tSystem.out.println(\"No \" + name + \" is not a friend of \"+ profilename);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Click Enter to go back to Menu\");\n\t\t\n\t\tString input = reader.nextLine();\n\n\t\t\t\n\t\n\t}", "public List <Person> getDetails(List <Person> listOfPerson)\n\t{\n\t\tSystem.out.println(\"Enter the First Name of the Person you want the details of:\");\n\t\tString name = Utility.inputString();\t\n\t\tfor(int i = 0; i < listOfPerson.size(); i++)\n\t\t{\n\t\t\tif(listOfPerson.get(i).getFname().equals(name))\n\t\t\t{\n\t\t\t\tPerson temp = listOfPerson.get(i);\n\t\t\t\tSystem.out.println(temp.toString());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Person not found\");\n\t\t\t}\n\t\t}\n\t\treturn listOfPerson;\n\t}", "@Override\r\n\tpublic void findByname(List<Student> list, Scanner sc) {\n\t\tSystem.out.println(\"请输入要查询的学生姓名\");\r\n\t\tString name=sc.next();\r\n\t\tfor(Student i:list){\r\n\t\t\tif(name.equals(i.getName())){\r\n\t\t\t\ti.info();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void printPersonStats(String fullName)\n\t{\n\t\tSystem.out.println(\"\\n\"+fullName);\n\t\t\n\t\t//assuming person exists in graph\n\t\tfor(String relationship: personMap.get(fullName).inRelationships.keySet())\n\t\t\tSystem.out.println(\"-\"+relationship+\" to \"+personMap.get(fullName).inRelationships.get(relationship));\n\t\t\n\t\tfor(String relationship: personMap.get(fullName).outRelationships.keySet())\n\t\t\tSystem.out.println(\"-\"+personMap.get(fullName).outRelationships.get(relationship)+\" is the \"+relationship);\n\t}", "public List<BookData> searchBookbyTitle (String name) throws SQLException{\n\t\tList<BookData> list = new ArrayList<>();\n\t\t\n\t\tPreparedStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tmyStmt = myConn.prepareStatement(\"select title, author_name, publisher_name, book_id from books natural join book_authors where title = ?\");\n\t\t\tmyStmt.setString(1, name);\n\t\t\tmyRs = myStmt.executeQuery();\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\n\t\t}\n\t\t\n\t}", "public void printName()\n\t{\t\t\n\t\t//check if we know the name of the professor\n\t\tif(this.firstName == null || this.surname == null ||\n\t\t\tthis.firstName.isEmpty() || this.surname.isEmpty())\n\t\t{\n\t\t\t//We haven't learned exception throwing yet, so let's just output something and return :'(\n\t\t\tSystem.out.println(\"Error: This Professor is nameless, I'm sorry :(\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(String.format(\"\", this.firstName, this.surname));\n\t}", "public void llistaCustomerByName(String string) {\n\t\tSystem.out.println(\"\\nCustomers anomenats \" + string + \" :\");\n\t\t\n\t\tObjectSet<Customer> customers = db.query(new Predicate<Customer>() {\n\t\t\tpublic boolean match(Customer customer) {\n\t\t\t\treturn customer.getName().equalsIgnoreCase(string);\n\t\t\t}\n\t\t});\n\t\t\n\t\tcustomers.stream()\n\t\t\t.forEach(System.out::println);\n\t}", "public static void showD(String name){\n\t\tfor(int i = 0; i<tables.size();i++){\r\n\t\t\tif(tables.get(i).title.equals(name)){\r\n\t\t\t\ttables.get(i).tablePrint();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public String getPersonName(int id) throws SQLException {\n\t\tquery = \"SELECT name FROM person WHERE id=\" + id;\n\t\treturn stmt.executeQuery(query).getString(\"name\");\n\t}", "private static void showStudentDB () {\n for (Student s : studentDB) {\n System.out.println(\"ID: \" + s.getID() + \"\\n\" + \"Student: \" + s.getName());\n }\n }", "private static void searchStaffByName(){\n\t\tshowMessage(\"type the name you are looking for: \\n\");\n\t\tString name = getUserTextTyped();\n\t\tToScreen.listEmployee(EmployeeSearch.employee(employee.getAllEmployee(),name), true);\n\t\t\n\t\t//condition to do another search by name or go back to the main menu\n //if the user decide for doing another search the method is called again, otherwise it will go back to the main menu\n\t\tint tryAgain = askForGoMainMenu(\"Would you like to search for another name or go back to main menu?\\n Type 1 to search someone else \\n Type 0 to go to menu. \\n Choice: \");\n\t\tif(tryAgain == 1){\n\t\t\tsearchStaffByName();\n\t\t} else {\n\t\t\tmain();\n\t\t}\n\t}", "List<Person> findByIdAndName(int id,String name);", "Name findNameByPersonPrimary(int idPerson);", "public void printByLastName() {\r\n\t\tif ( size == 0 ) {\r\n\t\t\tSystem.out.println(\"Database is empty.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tsortByLastName(); \r\n\t\tSystem.out.println(\"--Printing statements by last name--\");\r\n\t\tfor ( int i = 0; i < accounts.length; i++) {\r\n\t\t\tif ( accounts[i] != null ) {\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tSystem.out.println(accounts[i].toString());\r\n\t\t\t\tSystem.out.println(\"-interest: $ \" + String.format(\"%.2f\", accounts[i].monthlyInterest()));\r\n\t\t\t\tSystem.out.println(\"-fee: $ \" + String.format(\"%.2f\", accounts[i].monthlyFee()));\r\n\t\t\t\tdouble totalBalance = (accounts[i].getBalance() + accounts[i].monthlyInterest()) - accounts[i].monthlyFee();\r\n\t\t\t\t\r\n\t\t\t\t//update the total balance\r\n\t\t\t\taccounts[i].setBalance(totalBalance);\r\n\t\t\t\tSystem.out.println(\"-new balance: $ \" + String.format(\"%.2f\", totalBalance));\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"--end of printing--\");\r\n\t\tSystem.out.println();\r\n\t\treturn;\r\n\t}", "private void ShowPatientsActionPerformed(java.awt.event.ActionEvent evt) {\n String s = \"\";\n int c = 0;\n try {\n while (c < doc.length) {\n if (docNameBox.getText().equalsIgnoreCase(doc[c].name)) {\n s = doc[c].name + \" has these patients under him/her: \\n\" + doc[c].printPatientName(frame);\n break;\n } else {\n c++;\n }\n }\n } catch (NullPointerException e) {\n s = \"Doctor name not found, please add name\";\n }\n JOptionPane.showMessageDialog(null, s);\n }", "public void displayNames()\r\n {\r\n // ensure there is at least one Cat in the collection\r\n if (catCollection.size() > 0) {\r\n System.out.println(\"The current guests in \"+businessName);\r\n for (Cat eachCat : catCollection) {\r\n System.out.println(eachCat.getName());\r\n }\r\n }\r\n else {\r\n System.out.println(businessName + \" is empty!\");\r\n }\r\n }", "@Query(\"name = ?\")\n List<PersonDocument> findByName(String name);", "public String searchName(String username) {\n\n db = this.getReadableDatabase();\n String query = \"select username, name from \"+ TABLE_NAME;\n Cursor cursor = db.rawQuery(query, null);\n\n String uname, name;\n name = \"not found\";\n\n if (cursor.moveToFirst()) {\n\n do {\n uname = cursor.getString(0);\n if (uname.equals(username)) {\n name = cursor.getString(1);\n break;\n }\n } while (cursor.moveToNext());\n }\n\n return name;\n }", "public void voteFor (String name)\n {\n boolean searching = true;\n int index = 0;\n\n while(searching)\n {\n if(index < pList.size())\n {\n Personality objectHolder = pList.get(index);\n String personalityName = objectHolder.getName();\n\n if(name.equals(personalityName))\n {\n objectHolder.increaseVotes(1);\n searching = false;\n }\n }\n else\n {\n System.out.println(\"No personality found with the name : \" + name);\n searching = false;\n }\n\n index++;\n }\n }", "private static void queryBooksByAuthor(){\n\t\tSystem.out.println(\"===Query Books By Author===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter First Name of Author to Query Books by: \");\n\t\tString author_firstname = string_input.next();\n\t\t\n\t\tSystem.out.println(\"Enter Middle Name of Author to Query Books by (Type 'null' if Author has no middlename): \");\n\t\tString author_middlename = string_input.next();\n\t\tif(author_middlename.equalsIgnoreCase(\"null\"))\n\t\t\tauthor_middlename = \"\";\n\t\t\n\t\tSystem.out.println(\"Enter Last Name of Author to Query Books by: \");\n\t\tString author_lastname = string_input.next();\n\t\t\n\t\tString author_fullname = author_firstname + \" \" + author_middlename + \" \" + author_lastname;\n\t\t\n\t\tif(ALL_AUTHORS.containsKey(author_fullname)){//if author_full_name exists in the Hashtable then print out all of the author's book titles\n\t\t\tSystem.out.println(\"Author found!\");\n\t\t\tSystem.out.println(author_fullname + \"'s list of book titles are: \"); \n\t\t\tIterator<String> iter = ALL_AUTHORS.get(author_fullname).iterator();\n\t\t\tprintAllElements(iter);\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"Sorry Author name entered does not exist in our records\");\n\t}", "private void handleFindByName(String[] args) {\n if (args.length < 3) {\n String requiredArgs = \"<name>\";\n Messages.badNumberOfArgsMessage(args.length, FIND_BY_NAME_OPERATION, requiredArgs);\n System.exit(1);\n }\n String name = args[2];\n\n Client client = ClientBuilder.newBuilder().build();\n WebTarget webTarget = client.target(\"http://localhost:8080/pa165/rest/bricks\").queryParam(\"name\", name);\n webTarget.register(auth);\n Invocation.Builder invocationBuilder = webTarget.request();\n invocationBuilder.header(\"accept\", MediaType.APPLICATION_JSON);\n\n Response response = invocationBuilder.get();\n\n if (response.getStatus() == Response.Status.OK.getStatusCode()) {\n // return list\n List<BrickDto> brickDtoList = response.readEntity(new GenericType<List<BrickDto>>() {\n });\n System.out.println(\"Number of bricks returned: \" + brickDtoList.size());\n\n for (BrickDto b : brickDtoList) {\n System.out.println(b);\n }\n } else {\n // server error\n System.out.println(\"Error on server, server returned \" + response.getStatus());\n }\n }", "public void printName()\n\t{\n\t\tArrayList<Robot> ar=new ArrayList<Robot>();\n\t\tIterator<Robot> it;\n\t\tint i=1;//started index\n\t\t\n\t\tar.addAll(robotHM.values());//adding all\n\t\tCollections.sort(ar);//sort by names\n\t\tit=ar.iterator();\n\t\twhile (it.hasNext())\n\t\t{\n\t\t\tSystem.out.println(i+\". \"+it.next().getName());\n\t\t\ti++;\n\t\t}\n\t}", "private static Person findPersonByName(EntityManager em, String name) {\n\t\tQuery query = em.createQuery(\"select p from Person p where name = :name\", Person.class);\n\t\tquery.setParameter(\"name\", name);\n\t\treturn (Person) query.getSingleResult();\n\t}", "@Override\n\t@Transactional\n\tpublic List<IoMember> searchMember(String name) {\n\t\treturn memberDao.searchMember(name);\n\t}", "public static void searchName(Contact[] myContacts, String find)\n {\n int high = myContacts.length;\n int low = -1;\n int probe;\n while(high - low > 1)\n {\n probe = (high+low)/2;\n if(myContacts[probe].getName().compareTo(find) > 0)\n {\n high = probe;\n }\n else\n {\n low = probe;\n if(myContacts[probe].getName().compareTo(find) == 0)\n {\n break;\n }\n }\n }\n System.out.println(\"Find results: \");\n if((low>=0)&&(myContacts[low].getName().compareTo(find) == 0))\n {\n findMoreNames(myContacts, low, find);\n }\n else\n {\n System.out.println(\"There are no listings for \"+find);\n }\n }", "@Override\n public void search(String firstName,String lastName,String fileName){\n int Pointer;\n ArrayList<String> lineKeeper = saveText();\n /* Search into the list to find the firstname, if it founds\n * old information and then rewrite new inforamtion\n * Search and remove*/\n if(lineKeeper.contains(firstName)){\n Pointer=lineKeeper.indexOf(firstName);\n if(lineKeeper.get(Pointer+1).equals(lastName)){\n this.load(lineKeeper.get(Pointer-3),fileName);\n }\n }\n }", "public void test_findByNamedOfQuery() {\r\n\t\t// step 1:\r\n\t\tList personList = this.persistenceService.findByNamedOfQuery(FIND_ALL_PERSON);\r\n\t\tassertNotNull(personList);\r\n\t\tassertEquals(ALL_PERSON_COUNT, personList.size());\r\n\t\t\r\n\t\t// init again\r\n\t\tpersonList = null;\r\n\t\t// step 2:\r\n\t\tpersonList = this.persistenceService.findByNamedOfQuery(FIND_PERSON_BY_NAME_EXT, NAME_PARAM[0]);\r\n\t\tassertForFindGoingmm(personList);\r\n\t\t\r\n\t\t// init again\r\n\t\tpersonList = null;\r\n\t\t// step 3:\r\n\t\tpersonList = this.persistenceService.findByNamedOfQuery(FIND_PERSON_BY_NAME, getParamMap(1));\r\n\t\tassertForFindGoogle(personList);\r\n\t}", "public List<Contact> getAllContactsByName(String searchByName);", "public ArrayList<Person> getPeople(String descendant) {\n String sql = \"SELECT firstName, lastName, personId, AssociatedUsername,gender,father,mother,spouse FROM Person WHERE AssociatedUsername = ?\";\n Person output = null;\n ArrayList<Person> people = null;\n\n try {\n PreparedStatement pstmt = conn.prepareStatement(sql);\n pstmt.setString(1, descendant);\n ResultSet rs = pstmt.executeQuery();\n\n //input the data into model\n while (rs.next()) {\n output = new Person(rs.getString(\"personId\"), rs.getString(\"AssociatedUsername\"),\n rs.getString(\"firstName\"), rs.getString(\"lastName\"), rs.getString(\"gender\"),\n rs.getString(\"father\"), rs.getString(\"mother\"), rs.getString(\"spouse\"));\n\n\n if (people == null)\n people = new ArrayList<>();\n people.add(output);\n }\n\n rs.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return people;\n }", "@Override\n\tpublic List<Patient> query_Name() {\n\t\tList<Patient> list = dd.query_Name();\n\t\tsqlSession.close();\n\t\treturn list;\n\t}", "public static String[] getAllNames(){\n int size = getCountofPeople();\n String[] names = new String[size];\n\n try (Connection con = DriverManager.getConnection(url, user, password)){\n String query = \"SELECT name FROM \"+DATABASE_NAME+\".People;\";\n Statement st = con.createStatement();\n ResultSet rs = st.executeQuery(query);\n int i = 0;\n\n while (rs.next()) {\n names[i] = rs.getString(1);\n i++;\n }\n \n con.close();\n }catch (SQLException ex) {\n ex.printStackTrace();\n } \n\n return names;\n }", "public static void findName(String searchedWord, ArrayList<Recipe> recipes) {\n System.out.println();\n System.out.println(\"Recipes:\");\n for (Recipe recipe: recipes) {\n if (recipe.getName().contains(searchedWord)) {\n System.out.println(recipe);\n }\n }\n System.out.println();\n }", "public String showAllPersons() {\n String string = \"\";\n for(Person person: getPersons().values()){\n string += person.toString();\n }\n return string;\n }", "@Override\r\n\tpublic List<User> search(String name) {\n\t\treturn null;\r\n\t}", "public static void nameAndAddress () {\n\t\tSystem.out.println(\"Andrew Meiling\");\n\t\tSystem.out.println(\"224 South Dennis Ave\");\n\t\tSystem.out.println(\"Republic, MO 65738\");\n\t}", "@Override\n\tpublic Set<Person> getfindByName(String name) {\n\t\treturn null;\n\t}", "public void displayRecord(String companyName) {\n try {\n RandomAccessFile din = new RandomAccessFile(this.databaseName + \".data\", \"rws\");\n RandomAccessFile oin = new RandomAccessFile(this.databaseName + \".overflow\", \"rws\");\n int record = this.binarySearch(din, companyName.trim().toUpperCase());\n String recordLocation = \"normal\";\n\n if (record == -1) {\n int numOverflowRecords = Integer.parseInt(getNumberOfRecords(\"overflow\"));\n\n for (int i = 0; i < numOverflowRecords; i++) {\n String overflowRecord = getRecord(\"overflow\", oin, i);\n String recordName = overflowRecord.substring(5,45);\n recordName = recordName.trim();\n\n if (companyName.toUpperCase().equals(recordName)) {\n record = i;\n recordLocation = \"overflow\";\n break;\n }\n }\n }\n\n //if company is found display the company\n if(record != -1){\n if (recordLocation.equals(\"normal\")) {\n record = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n System.out.println(HelperFunctions.displayReadableRecord(this.getRecord(\"normal\", din, record)));\n } else {\n System.out.println(HelperFunctions.displayReadableRecord(this.getRecord(\"overflow\", oin, record)));\n }\n } \n //if not, let the user know\n else {\n System.out.println(\"NOT FOUND\");\n }\n \n din.close();\n oin.close();\n \n\n } catch (IOException ex) {\n ex.printStackTrace();\n } \n }", "public static void main(String[] args) {\n\n\t\tPerson krishna = new Person(101, \"Krisha\", \"TX\");\n\t\tPerson chani = new Person(111, \"Chani\", \"CA\");\n\t\tPerson boni = new Person(121, \"Boni\", \"FL\");\n\t\tPerson gopi = new Person(91, \"Gopi\", \"NC\");\n\t\tPerson suss = new Person(101, \"Suss\", \"ML\");\n\n\t\t// Add to array\n\n\t\tList<Person> personlist = new ArrayList<Person>();\n\n\t\tpersonlist.add(suss);\n\t\tpersonlist.add(gopi);\n\t\tpersonlist.add(boni);\n\t\tpersonlist.add(chani);\n\t\tpersonlist.add(krishna);\n\n\t\tSystem.out.println(\"Print the person names: \" + personlist);\n\n\t\t// By using for each loop to print person names\n\n\t\tfor (Person person : personlist) {\n\t\t\tSystem.out.println(person);\n\t\t}\n\n\t\tSystem.out.println(\"*******************\");\n\n\t\tMap<Integer, String> personsmap = new HashMap<Integer, String>();\n\n\t\t// put every value list to Map\n\t\tfor (Person person : personlist) {\n\t\t\tpersonsmap.put(person.getId(), person.getName());\n\t\t\tSystem.out.println(person);\n\t\t}\n\n\t\t// Streams\n\t\tSystem.out.println(\" *********** Strems ***********\");\n\t\t Map<Integer, String>\n map = personlist.stream()\n .collect(\n Collectors\n .toMap(\n Person::getId,\n Person::getName,\n (id, name)\n -> id + \", \" + name,\n HashMap::new));\n\t\t \n\t\t// print map\n\t map.forEach(\n\t (id, name) -> System.out.println(id + \"=\" + name));\n\n\t}", "@Override\r\n\tpublic List<BIrd> searchByName(String birdName) throws Exception {\n\t\tList<BIrd> list=new ArrayList<BIrd>();\r\n\t\ttry{\r\n\t\tsession=sessionfactory.openSession();\r\n\t\ttransaction = session.beginTransaction();\r\n\t\tString sql=\"SELECT * FROM tbl_bird WHERE BirdName LIKE '%\"+birdName+\"%'\";\r\n\t\tSQLQuery query=session.createSQLQuery(sql);\r\n\t\tquery.addEntity(BIrd.class);\r\n\t\tlist=query.list();\r\n\t\tSystem.out.println(list.size());\r\n\t\t} catch (Exception e) {\r\n\t\t\ttransaction.rollback();\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\tsession.close();\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "public Person searchPerson(String k, char c) {\n\t\t\n\t\tPerson personR ;\n\n\t\tif(c == DataBase.TREE_NAME) {\n\t\t\tpersonR = treeName.searchE(k);\n\t\t}else if(c == DataBase.TREE_LASTNAME) {\n\t\t\tpersonR = treeLastname.searchE(k);\n\t\t}else if(c == DataBase.TREE_FULLNAME) {\n\t\t\tpersonR = treeFullName.searchE(k);\n\t\t}else {\n\t\t\tpersonR = treeCode.searchE(k);\n\t\t}\n\t\t\n\t\treturn personR;\n\t\t\n\t}", "private static String findAddressNameOfPerson(EntityManager em, String name) {\n\t\tQuery query = em.createQuery(\"select p.address.streetName from Person p where p.name = :name\");\n\t\tquery.setParameter(\"name\", name);\n\t\treturn (String) query.getSingleResult();\n\t}", "public static void search(Connection connection) throws SQLException {\r\n\r\n //search for toy by giving only the name of the toy\r\n System.out.println(\"SEARCH FOR ITEM\\nFormat (Toy) example: Barbie\");\r\n Scanner scan = new Scanner(System.in);\r\n Statement statement = connection.createStatement();\r\n\r\n //store toy from user as a string\r\n String toy = scan.nextLine();\r\n\r\n //result is where the toy is = to the same name in MySQL database\r\n ResultSet results = statement.executeQuery(\"SELECT id, toy, company, qty FROM toy_stock WHERE toy='\" + toy + \"'\");\r\n\r\n //print the entry of that given toy from the MySQL database\r\n if (results.next()) {\r\n System.out.println(results.getInt(\"id\") + \", \"\r\n + results.getString(\"toy\") + \", \"\r\n + results.getString(\"company\") + \", \"\r\n + results.getInt(\"qty\"));\r\n } else {\r\n //else the toy the user search for is not in the database\r\n System.out.println(\"'\" + toy + \"' unfortunately doesn't exist in the Database\\n\");\r\n }\r\n //return to main menu\r\n menu(connection);\r\n }", "public List<Service> list(String name){\r\n \tCriteria criteria = session.createCriteria(Service.class);\r\n \tcriteria.add(Restrictions.like(\"name\",\"%\"+name+\"%\"));\r\n \treturn criteria.list();\r\n }", "@GetMapping(\"/api/findByName/{perNombre}\")\n\t\tpublic ResponseEntity<List<Persona>> listByName(@PathVariable(\"perNombre\") String perNombre){\n\t\tList<Persona> list = personaService.listByName(perNombre);\n\t\treturn ResponseEntity.ok(list);\t\t\n\t}", "Expertise findByName(String name);", "private void displayUserInfo(String name) {\n\t\tString username = null;\n\t\tPattern p = Pattern.compile(\"\\\\[(.*?)\\\\]\");\n\t\tMatcher m = p.matcher(name);\n\t\tif (m.find())\n\t\t{\n\t\t username = m.group(1);\n\t\t lastClickedUser = username;\n\t\t}\n\t\tUser u = jdbc.get_user(username);\n\t\ttextFirstName.setText(u.get_firstname());\n\t\ttextLastName.setText(u.get_lastname());\n\t\ttextUsername.setText(u.get_username());\n\t\tif (u.get_usertype() == 1) {\n\t\t\trdbtnAdminDetails.setSelected(true);\n\t\t} else if (u.get_usertype() == 2) {\n\t\t\trdbtnManagerDetails.setSelected(true);\n\t\t} else {\n\t\t\trdbtnWorkerDetails.setSelected(true);\n\t\t}\n\t\tif (u.get_email() != null) {textEmail.setText(u.get_email());} else {textEmail.setText(\"No Email Address in Database.\");}\n\t\tif (u.get_phone() != null) {textPhone.setText(u.get_phone());} else {textPhone.setText(\"No Phone Number in Database.\");}\t\t\t\t\n\t\tcreateQualLists(u.get_userID());\n\t}", "void getPeople();" ]
[ "0.74414086", "0.73737884", "0.7236648", "0.7078298", "0.7013578", "0.6869321", "0.6861458", "0.67785096", "0.67690295", "0.6660008", "0.66326183", "0.6582452", "0.657666", "0.63990045", "0.63890135", "0.6388567", "0.63406485", "0.63124466", "0.6250413", "0.6243577", "0.62282187", "0.6209943", "0.62066144", "0.6166584", "0.61462706", "0.6138184", "0.6131876", "0.6080846", "0.607476", "0.6074423", "0.60464156", "0.6013051", "0.5985487", "0.5977542", "0.5954218", "0.5950816", "0.5925198", "0.59230715", "0.58893853", "0.58696175", "0.5854522", "0.5852765", "0.5850444", "0.58495575", "0.5844799", "0.58202946", "0.5816385", "0.5805317", "0.58030754", "0.5795723", "0.5792163", "0.57884717", "0.5781221", "0.57807", "0.5770379", "0.5740447", "0.57306385", "0.5720072", "0.5717296", "0.5716462", "0.5713804", "0.5710918", "0.57094944", "0.570855", "0.5706872", "0.5703432", "0.56999385", "0.5683171", "0.5682648", "0.56800133", "0.56704116", "0.56701756", "0.5666248", "0.56447905", "0.56417614", "0.5641599", "0.5638946", "0.56346756", "0.5631663", "0.5630754", "0.5623325", "0.56147444", "0.5605891", "0.5603118", "0.5599771", "0.559782", "0.5596937", "0.5590268", "0.5589056", "0.55869186", "0.5574055", "0.55708057", "0.556272", "0.55626047", "0.5560185", "0.55452013", "0.5539592", "0.5533857", "0.5531045", "0.5516594" ]
0.6786663
7
/============================PORTAL DO DOCENTE=============================== Creates a project of the discipline with the name that was given by the professor
public void createProject(String nameProject, String nameDiscipline) throws InvalidDisciplineException,InvalidProjectException{ int id = _person.getId(); Professor _professor = getProfessors().get(id); _professor.createProject(nameProject, nameDiscipline); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Project createProject() throws ParseException {\n System.out.println(\"Please enter the project number: \");\n int projNum = input.nextInt();\n input.nextLine();\n\n System.out.println(\"Please enter the project name: \");\n String projName = input.nextLine();\n\n System.out.println(\"Please enter the type of building: \");\n String buildingType = input.nextLine();\n\n System.out.println(\"Please enter the physical address for the project: \");\n String address = input.nextLine();\n\n System.out.println(\"Please enter the ERF number: \");\n String erfNum = input.nextLine();\n\n System.out.println(\"Please enter the total fee for the project: \");\n int totalFee = input.nextInt();\n input.nextLine();\n\n System.out.println(\"Please enter the total amount paid to date: \");\n int amountPaid = input.nextInt();\n input.nextLine();\n\n System.out.println(\"Please enter the deadline for the project (dd/MM/yyyy): \");\n String sdeadline = input.nextLine();\n Date deadline = dateformat.parse(sdeadline);\n\n Person architect = createPerson(\"architect\", input);\n Person contractor = createPerson(\"contractor\", input);\n Person client = createPerson(\"client\", input);\n\n // If the user did not enter a name for the project, then the program will\n // concatenate the building type and the client's surname as the new project\n // name.\n\n if (projName == \"\") {\n String[] clientname = client.name.split(\" \");\n String lastname = clientname[clientname.length - 1];\n projName = buildingType + \" \" + lastname;\n }\n\n return new Project(projNum, projName, buildingType, address, erfNum, totalFee, amountPaid, deadline, contractor,\n architect, client);\n\n }", "public void createProject(String name) {\n Project project = new Project(name);\n Leader leader = new Leader(this, project);\n project.addLeader(leader);\n }", "public void createProject(Project newProject);", "private void newProject()\n\t{\n\t\tnew FenetreCreationProjet();\n\t}", "public Project() {\n this.name = \"Paper plane\";\n this.description = \" It's made of paper.\";\n }", "private static void add_project() {\r\n\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t\r\n\t\t\t//List of building types\r\n\t\t\tString[] building_types = new String[] {\"House\", \"Apartment Block\", \"Commercial Property\", \"Industrial Property\", \"Agricultural Building\"};\r\n\t\t\t\r\n\t\t\t// Variables that are needed\r\n\t\t\tint project_id = 0;\r\n\t\t\tString project_name = \"\";\r\n\t\t\tString building_type = \"\";\r\n\t\t\tString physical_address = \"\";\r\n\t\t\tint erf_num = 0;\r\n\t\t\tString cust_surname = \"\";\r\n\t\t\tDate deadline_date = null;\r\n\t\t\tint charged = 0;\r\n\t\t\t\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\t//So first we need to select the correct customer\r\n\t\t\tString strSelect = \"SELECT * FROM people WHERE type = 'Customer'\";\r\n\t\t\tResultSet rset = stmt . executeQuery ( strSelect );\r\n\t\t\t\r\n\t\t\t// Loops through available customers from the people table so that the user can select one\r\n\t\t\tSystem.out.println(\"\\nSelect a customer for the project by typing the customers number.\");\r\n\t\t\t// This creates a list of customer ids to check that the user only selects an available one\r\n\t\t\tArrayList<Integer> cust_id_list = new ArrayList<Integer>(); \r\n\t\t\twhile (rset.next()) {\r\n\t\t\t\tSystem.out.println ( \r\n\t\t\t\t\t\t\"Customer Num: \" + rset.getInt(\"person_id\") + \", Fullname: \" + rset.getString(\"name\") + \" \" + rset.getString(\"surname\"));\r\n\t\t\t\tcust_id_list.add(rset.getInt(\"person_id\"));\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to select a customer\r\n\t\t\tBoolean select_cust = true;\r\n\t\t\tint customer_id = 0;\r\n\t\t\twhile (select_cust == true) {\r\n\t\t\t\tSystem.out.println(\"Customer No: \");\r\n\t\t\t\tString customer_id_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcustomer_id = Integer.parseInt(customer_id_str);\r\n\t\t\t\t\tfor (int i = 0; i < cust_id_list.size(); i ++) {\r\n\t\t\t\t\t\tif (customer_id == cust_id_list.get(i)) { \r\n\t\t\t\t\t\t\tselect_cust = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (select_cust == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available customer id.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for customer id is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The customer number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Prints out all available building types form the building type list\r\n\t\t\tSystem.out.print(\"Select a building type by typing the number: \\n\");\r\n\t\t\tfor (int i=0; i < 5; i ++) {\r\n\t\t\t\tSystem.out.println((i + 1) + \": \" + building_types[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to select a building type\r\n\t\t\tBoolean select_building = true;\r\n\t\t\tint building_index = 0;\r\n\t\t\twhile (select_building == true) {\r\n\t\t\t\tSystem.out.println(\"Building type no: \");\r\n\t\t\t\tString building_type_select_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tbuilding_index = Integer.parseInt(building_type_select_str) - 1;\r\n\t\t\t\t\tbuilding_type = building_types[building_index];\r\n\t\t\t\t\tselect_building = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for building type is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The building type number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// User gets to decide whether they want an automatically generated name.\r\n\t\t\tBoolean select_project_name = true;\r\n\t\t\twhile (select_project_name == true) {\r\n\t\t\t\tSystem.out.println(\"Would you like to have the project automatically named (y or n)?\");\r\n\t\t\t\tString customer_project_name_choice = input.nextLine();\r\n\t\t\t\tif (customer_project_name_choice.equals(\"y\")){\r\n\t\t\t\t\t// Gets the customers surname for the project name\r\n\t\t\t\t\tString strSelectCustSurname = String.format(\"SELECT surname FROM people WHERE person_id = '%s'\", customer_id);\r\n\t\t\t\t\tResultSet cust_surname_rset = stmt . executeQuery ( strSelectCustSurname );\r\n\t\t\t\t\twhile (cust_surname_rset.next()) {\r\n\t\t\t\t\t\tcust_surname = cust_surname_rset.getString(\"surname\");\r\n\t\t\t\t\t\tproject_name = building_type + \" \" + cust_surname;\r\n\t\t\t\t\t\tSystem.out.println(\"Project name: \" + project_name);\r\n\t\t\t\t\t\tselect_project_name = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (customer_project_name_choice.equals(\"n\")) {\r\n\t\t\t\t\tSystem.out.println(\"Provide project name: \");\r\n\t\t\t\t\tproject_name = input.nextLine();\r\n\t\t\t\t\tselect_project_name = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!customer_project_name_choice.equals(\"y\") && !customer_project_name_choice.equals(\"n\")){\r\n\t\t\t\t\tSystem.out.println(\"You can only select either y or n. Please try again\");\r\n\t\t\t\t\tselect_project_name = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to enter an erf number\r\n\t\t\tBoolean select_erf_num = true;\r\n\t\t\twhile (select_erf_num == true) {\r\n\t\t\t\tSystem.out.print(\"ERF number: \");\r\n\t\t\t\tString erf_num_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\terf_num = Integer.parseInt(erf_num_str);\r\n\t\t\t\t\tselect_erf_num = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for erf number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The erf number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows the user to enter a physical address\r\n\t\t\tSystem.out.print(\"Physical Address: \");\r\n\t\t\tphysical_address = input.nextLine();\r\n\t\t\t\r\n\t\t\t// Allows the user to enter a date\r\n\t\t\tBoolean select_deadline_date = true;\r\n\t\t\twhile (select_deadline_date == true) {\r\n\t\t\t\tSystem.out.print(\"Deadline Date (YYYY-MM-DD): \");\r\n\t\t\t\tString deadline_date_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdeadline_date= Date.valueOf(deadline_date_str);\r\n\t\t\t\t\tselect_deadline_date = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for deadline date is not in the correct format\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The date must be in the format YYYY-MM-DD (eg. 2013-01-13). Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to enter a charged amount \r\n\t\t\tBoolean select_charged = true;\r\n\t\t\twhile (select_charged == true) {\r\n\t\t\t\tSystem.out.print(\"Total Cost: R \");\r\n\t\t\t\tString charged_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcharged = Integer.parseInt(charged_str);\r\n\t\t\t\t\tselect_charged = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for the charged amount is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The charged amount cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\t// This adds all the values to a prepared statement to update the projects table\r\n PreparedStatement ps = conn.prepareStatement(\"INSERT INTO projects (project_name , building_type, physical_address, erf_num) VALUES(?,?,?,?)\");\r\n ps.setString(1, project_name);\r\n ps.setString(2, building_type);\r\n ps.setString(3, physical_address);\r\n ps.setInt(4, erf_num);\r\n \r\n // Executes the statement\r\n ps.executeUpdate();\r\n \r\n // This gets the created project's table id to use to update the people and project_statuses tables \r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects WHERE project_name = '%s'\", project_name);\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tproject_id = project_rset.getInt(\"project_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This adds all the values to a prepared statement to update the people table\r\n\t\t\tPreparedStatement ps_customer = conn.prepareStatement(\r\n\t\t\t\t\t\"UPDATE people SET projects = ? WHERE person_id = ?;\");\r\n\t\t\tps_customer.setInt(1, project_id);\r\n\t\t\tps_customer.setInt(2, customer_id);\r\n\t\t\tps_customer.executeUpdate();\r\n \r\n\t\t\t// This adds all the values to a prepared statement to update the project_statuses table\r\n PreparedStatement ps_status = conn.prepareStatement(\"INSERT INTO project_statuses (charged , deadline_date, project_id) VALUES(?,?,?)\");\r\n ps_status.setInt(1, charged);\r\n ps_status.setDate(2, deadline_date);\r\n ps_status.setInt(3, project_id);\r\n ps_status.executeUpdate();\r\n\r\n // Once everything has been added to the tables the project that has been added gets printed out\r\n\t\t\tResultSet project_added_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_added_rset.next()){\r\n\t\t\t\tSystem.out.println(\r\n\t\t\t\t\t\t\"\\nProjects Added: \\n\" +\r\n\t\t\t\t\t\t\"Project Sys ID: \" + project_added_rset.getInt(\"project_id\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Project Name: \" + project_added_rset.getString(\"project_name\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Building Type: \" + project_added_rset.getString(\"building_type\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Physical Address: \" + project_added_rset.getString(\"physical_address\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Erf Number: \" + project_added_rset.getInt(\"erf_num\") + \"\\n\");\r\n\t\t\t}\r\n\t\t/**\r\n\t\t * @exception If any of the table entries cannot be created due to database constrains then the SQLException is thrown\r\n\t\t */\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}", "void createProjectForExercise(ProgrammingExercise programmingExercise) throws VersionControlException;", "Project createProject();", "Project createProject();", "Project createProject();", "LectureProject createLectureProject();", "public Project(String name){\n\t\tthis.pName = name;\n\t}", "public static Project creer(String name){\n\t\treturn new Project(name);\n\t}", "public void saveNewProject(){\n String pn = tGUI.ProjectTextField2.getText();\n String pd = tGUI.ProjectTextArea1.getText();\n String statusID = tGUI.StatusComboBox.getSelectedItem().toString();\n String customerID = tGUI.CustomerComboBox.getSelectedItem().toString();\n\n int sstatusID = getStatusID(statusID);\n int ccustomerID = getCustomerID(customerID);\n\n try {\n pstat = cn.prepareStatement (\"insert into projects (project_name, project_description, project_status_id, customer_id) VALUES (?,?,?,?)\");\n pstat.setString(1, pn);\n pstat.setString(2,pd);\n pstat.setInt(3, sstatusID);\n pstat.setInt(4, ccustomerID);\n pstat.executeUpdate();\n\n }catch (SQLException ex) {\n Logger.getLogger(ProjectMethods.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public CreateProject() {\n\t\tsuper();\n\t}", "private void setProject()\n\t{\n\t\tproject.setName(tf0.getValue().toString());\n \t\tproject.setDescription(tf8.getValue().toString());\n \t\tproject.setEndDate(df4.getValue());\n \t\tif (sf6.getValue().toString().equals(\"yes\"))project.setActive(true);\n \t\telse project.setActive(false);\n \t\tif (!tf7.getValue().toString().equals(\"\"))project.setBudget(Float.parseFloat(tf7.getValue().toString()));\n \t\telse project.setBudget(-1);\n \t\tproject.setNextDeadline(df5.getValue());\n \t\tproject.setStartDate(df3.getValue());\n \t\ttry \n \t\t{\n \t\t\t\tif (sf1.getValue()!=null)\n\t\t\t\tproject.setCustomerID(db.selectCustomerforName( sf1.getValue().toString()));\n\t\t}\n \t\tcatch (SQLException|java.lang.NullPointerException e) \n \t\t{\n \t\t\tErrorWindow wind = new ErrorWindow(e); \n \t UI.getCurrent().addWindow(wind);\t\t\n \t e.printStackTrace();\n\t\t\t}\n \t\tproject.setInserted_by(\"Grigoris\");\n \t\tproject.setModified_by(\"Grigoris\");\n \t\tproject.setRowversion(1);\n \t\tif (sf2.getValue()!=null)project.setProjectType(sf2.getValue().toString());\n \t\telse project.setProjectType(null);\n\t }", "@Override\n public void onClick(View view) {\n String projectName = etProjectName.getText().toString();\n String projectOwner = etProjectOwner.getText().toString();\n String projectDescription = etProjectDescription.getText().toString();\n long projectId = 0; // This is just to give some value. Not used when saving new project because auto-increment in DB for this value.\n\n\n // USerid and projectname are mandatory parameters\n if( userId != 0 && projectName != null) {\n newProject = new Project(projectId, userId, projectName, projectOwner, projectDescription);\n dbHelper.saveProject(newProject);\n// showToast(\"NewprojectId:\" + newProject.projectId+ \"-->UserId: \"+ userId + \"--> ProjectName\" + newProject.projectName +\"->Owner\"+newProject.projectOwner);\n dbHelper.close();\n\n // SIIRRYTÄÄN PROJEKTILISTAUKSEEN\n Intent newProjectList = new Intent( NewProject.this, ProjectListActivity.class);\n newProjectList.putExtra(\"userId\", userId);\n startActivity(newProjectList);\n }\n\n }", "public Project createProjectFromPRJ() {\n\n\t\tSystem.out.println(\"Trying to load prj file with : \" + data_path + \" \" + projectName + \" \" + conceptName + \" \");\n\n\t\tProject project = null;\n\n\t\ttry {\n\n\t\t\tproject = new Project(data_path + projectName);\n\n\t\t\t// Sehr wichtig hier das Warten einzubauen, sonst gibts leere\n\t\t\t// Retrieval Results, weil die Faelle noch nicht geladen sind wenn\n\t\t\t// das\n\t\t\t// Erste Retrieval laueft\n\t\t\twhile (project.isImporting()) {\n\t\t\t\tThread.sleep(1000);\n\t\t\t\tSystem.out.print(\".\");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\"); // console pretty print\n\t\t} catch (Exception ex) {\n\n\t\t\tSystem.out.println(\"Error when loading the project\");\n\t\t}\n\t\treturn project;\n\t}", "private static void assign_project() {\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\t//Print out all projects\r\n\t\t System.out.println(\"Choose a project to assign to a person\");\r\n\t\t\tString strSelectProject = String.format(\"SELECT * from projects;\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tSystem.out.println(\"Project ID: \" + project_rset.getInt(\"project_id\") + \r\n\t\t\t\t\t\t\"\\nProject Name: \" + project_rset.getString(\"project_name\") + \"\\n\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Runs until a project is chosen and the input can be parsed to an int\r\n\t\t\tBoolean project_chosen = true;\r\n\t\t\tint project_choice = 0;\r\n\t\t\twhile (project_chosen == true) {\r\n\t\t\t\tSystem.out.println(\"Project No: \");\r\n\t\t\t\tString project_choice_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tproject_choice = Integer.parseInt(project_choice_str);\r\n\t\t\t\t\tproject_chosen = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for project number is not an integer\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The project id cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Prints out all people types\r\n\t\t\tString[] people_types = new String[] {\"Customer\", \"Contractor\", \"Architect\", \"Project Manager\"};\r\n\t\t\tfor (int i = 0; i < people_types.length; i ++) {\r\n\t\t\t\tSystem.out.println((i + 1) + \". \" + people_types[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows user to select a person type and runs until the selected person type number can be parsed to an integer\r\n\t\t\tBoolean select_person_type = true;\r\n\t\t\tint person_type = 0;\r\n\t\t\tString person_type_str = \"\";\r\n\t\t\twhile (select_person_type == true) {\r\n\t\t\t\tSystem.out.println(\"Select a number for the person type you wish to assign the project to:\");\r\n\t\t\t\tperson_type_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tperson_type = Integer.parseInt(person_type_str);\r\n\t\t\t\t\tfor (int i = 1; i < people_types.length + 1; i ++) {\r\n\t\t\t\t\t\tif (person_type == i) { \r\n\t\t\t\t\t\t\tperson_type_str = people_types[i-1]; \r\n\t\t\t\t\t\t\tselect_person_type = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// If user selected a number that was not displayed\r\n\t\t\t\t\tif (select_person_type == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available person type number.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for project number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The person type number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Prints out all people of selected type\r\n\t\t\t\tString strSelectPeople = String.format(\"SELECT * FROM people WHERE type = '%s';\", person_type_str);\r\n\t\t\t\tResultSet people_rset = stmt.executeQuery(strSelectPeople);\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(person_type_str + \":\");\r\n\t\t\t\t\r\n\t\t\t\twhile (people_rset.next()) {\r\n\t\t\t\t\tSystem.out.println(\"System ID: \" + people_rset.getInt(\"person_id\") + \", Name: \" + people_rset.getString(\"name\") + \" \" + people_rset.getString(\"surname\"));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Allows user to select a person to assign the project to\r\n\t\t\t\tBoolean person_chosen = true;\r\n\t\t\t\tint person_choice = 0;\r\n\t\t\t\twhile (person_chosen == true) {\r\n\t\t\t\t\tSystem.out.println(\"Person No: \");\r\n\t\t\t\t\tString person_choice_str = input.nextLine();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tperson_choice = Integer.parseInt(person_choice_str);\r\n\t\t\t\t\t\tperson_chosen = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * @exception Throws exception if the users input for person_number is not a number\r\n\t\t\t\t\t */\r\n\t\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t\t System.out.println(\"The person id cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Updates the table\r\n\t\t\t\tPreparedStatement ps_assign = conn.prepareStatement(\r\n\t\t\t\t\t\t\"UPDATE people SET projects = ? WHERE person_id = ?;\");\r\n\t\t\t\tps_assign.setInt(1, project_choice);\r\n\t\t\t\tps_assign.setInt(2, person_choice);\r\n\t\t\t\tps_assign.executeUpdate();\r\n\t\t\t\tSystem.out.println(\"\\nAssigned Project\");\r\n\r\n\t\t/**\r\n\t\t * @exception When something cannot be retrieved from the database then an SQLException is thrown\t\r\n\t\t */\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testCreate() throws Exception {\n\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\t\tDate startDate = new Date();\n\t\tCalendar calendar = new GregorianCalendar();\n\t\tcalendar.setTime(startDate);\n\t\tcalendar.add(Calendar.MONTH, 2);\n\t\t//\"name\":\"mizehau\",\"introduction\":\"dkelwfjw\",\"validityStartTime\":\"2015-12-08 15:06:21\",\"validityEndTime\":\"2015-12-10 \n\n\t\t//15:06:24\",\"cycle\":\"12\",\"industry\":\"1202\",\"area\":\"2897\",\"remuneration\":\"1200\",\"taskId\":\"TVRRME9UVTFPRE0zT0RBeU1EQXdNRFkyTVRnMU9EQTU=\"\n\t\tProject a = new Project();\n\t\tDate endDate = calendar.getTime();\n\t\tString name = \"mizehau\";\n\t\tString introduction = \"dkelwfjw\";\n\t\tString industry = \"1202\";\n\t\tString area = \"test闫伟旗创建项目\";\n\t\t//String document = \"test闫伟旗创建项目\";\n\t\tint cycle = 12;\n\t\tString taskId = \"TVRRME9UVTFPRE0zT0RBeU1EQXdNRFkyTVRnMU9EQTU=\";\n\t\tdouble remuneration = 1200;\n\t\tTimestamp validityStartTime = Timestamp.valueOf(sdf.format(startDate));\n\t\tTimestamp validityEndTime = Timestamp.valueOf(sdf.format(endDate));\n\t\ta.setArea(area);\n\t\ta.setName(name);\n\t\ta.setIntroduction(introduction);\n\t\ta.setValidityStartTime(validityStartTime);\n\t\ta.setValidityEndTime(validityEndTime);\n\t\ta.setCycle(cycle);\n\t\ta.setIndustry(industry);\n\t\ta.setRemuneration(remuneration);\n\t\ta.setDocument(taskId);\n\t\tProject p = projectService.create(a);\n\t\tSystem.out.println(p);\n\t}", "public Project(String name, String description){\n this.name = name;\n this.description = description; \n }", "private IProject createNewProject() {\r\n\t\tif (newProject != null) {\r\n\t\t\treturn newProject;\r\n\t\t}\r\n\r\n\t\t// get a project handle\r\n\t\tfinal IProject newProjectHandle = mainPage.getProjectHandle();\r\n\r\n\t\t// get a project descriptor\r\n\t\tURI location = mainPage.getLocationURI();\r\n\r\n\t\tIWorkspace workspace = ResourcesPlugin.getWorkspace();\r\n\t\tfinal IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());\r\n\t\tdescription.setLocationURI(location);\r\n\r\n\t\tlog.info(\"Project name: \" + newProjectHandle.getName());\r\n\t\t//log.info(\"Location: \" + location.toString());\r\n\t\t\r\n\t\t// create the new project operation\r\n\t\tIRunnableWithProgress op = new IRunnableWithProgress() {\r\n\t\t\tpublic void run(IProgressMonitor monitor)\r\n\t\t\t\t\tthrows InvocationTargetException {\r\n\t\t\t\tCreateProjectOperation op = new CreateProjectOperation(description, ResourceMessages.NewProject_windowTitle);\r\n\t\t\t\ttry {\r\n\t\t\t\t\top.execute(monitor, WorkspaceUndoUtil.getUIInfoAdapter(getShell()));\r\n\t\t\t\t} catch (ExecutionException e) {\r\n\t\t\t\t\tthrow new InvocationTargetException(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// run the new project creation operation\r\n\t\ttry {\r\n\t\t\tgetContainer().run(true, true, op);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tlog.error(\"Project creation failed.\");\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t} catch (InvocationTargetException e) {\r\n\t\t\tlog.error(\"Project creation failed.\");\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tnewProject = newProjectHandle;\r\n\r\n\t\treturn newProject;\r\n\t}", "@Test (groups = {\"Functional\"})\n public void testAddProject() {\n //When\n CreateProject createProject = dashboard.clickCreateProjectButton();\n String projectName = \"TestProject\";\n String testAccount = \"Account1\";\n createProject.setProjectName(projectName);\n createProject.clickPublicProjectPrivacy();\n createProject.setAccountDropDown(testAccount);\n project = createProject.clickCreateProject();\n\n //Then\n assertEquals(PROJECT_NAME, project.getTitle());\n }", "@RequestMapping(value = \"/create/project/{projectId}\", method = RequestMethod.GET)\r\n public ModelAndView create(@PathVariable(\"projectId\") String projectId) {\r\n ModelAndView mav = new ModelAndView(\"creates2\");\r\n int pid = -1;\r\n try {\r\n pid = Integer.parseInt(projectId);\r\n } catch (Exception e) {\r\n LOG.error(e);\r\n }\r\n User loggedIn = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n User user = hibernateTemplate.get(User.class, loggedIn.getUsername());\r\n Project project = hibernateTemplate.get(Project.class, pid);\r\n if (!dataAccessService.isProjectAvailableToUser(project, user)) {\r\n return accessdenied();\r\n }\r\n List<SubProject> subProjects = dataAccessService.getResearcherSubProjectsForUserInProject(user, project);\r\n mav.addObject(\"projectId\", projectId);\r\n mav.addObject(\"methods\", project.getMethods());\r\n mav.addObject(\"subProjects\", subProjects);\r\n return mav;\r\n }", "public static Project exampleProject() throws ParseException {\n Person willem = new Person(\"Contractor\", \"Willem du Plessis\", \"074 856 4561\", \"[email protected]\",\n \"452 Tugela Avenue\");\n Person rene = new Person(\"Architect\", \"Rene Malan\", \"074 856 4561\", \"rene@malan\", \"452 Tugela Avenue\");\n Person tish = new Person(\"Client\", \"Tish du Plessis\", \"074 856 4561\", \"[email protected]\", \"452 Tugela Avenue\");\n Date deadline = dateformat.parse(\"30/03/2021\");\n Project housePlessis = new Project(789, \"House Plessis\", \"House\", \"102 Jasper Avenue\", \"1025\", 20000, 5000,\n deadline, willem, rene, tish);\n ProjectList.add(housePlessis);\n\n return housePlessis;\n }", "public void createProject(\n String projectName,\n int teamId,\n String assigneeName,\n LocalDate deadline,\n String description,\n Project.Importance importance)\n throws NoSignedInUserException, SQLException, InexistentUserException,\n InexistentTeamException, DuplicateProjectNameException, InexistentDatabaseEntityException,\n EmptyFieldsException, InvalidDeadlineException {\n if (isMissingProjectData(projectName, assigneeName, deadline)) {\n throw new EmptyFieldsException();\n }\n User currentUser = getMandatoryCurrentUser();\n User assignee = getMandatoryUser(assigneeName);\n Team team = getMandatoryTeam(teamId);\n // check that there is no other project with the same name\n if (projectRepository.getProject(teamId, projectName).isPresent()) {\n throw new DuplicateProjectNameException(projectName, team.getName());\n }\n // check if the new deadline of project is outdated (before the current date)\n if (isOutdatedDate(deadline)) {\n throw new InvalidDeadlineException();\n }\n // save project\n Project.SavableProject project =\n new Project.SavableProject(\n projectName, teamId, deadline, currentUser.getId(), assignee.getId(), importance);\n project.setDescription(description);\n projectRepository.saveProject(project);\n support.firePropertyChange(\n ProjectChangeablePropertyName.CREATE_PROJECT.toString(), OLD_VALUE, NEW_VALUE);\n }", "public void deliverProject(String disciplineName, String nameProject, \n String deliveryMessage) throws InvalidDisciplineException, InvalidProjectException{\n int id = _person.getId();\n Student _student = getStudents().get(id);\n _student.deliverProject(disciplineName, nameProject, deliveryMessage, id);\n }", "public void newProject(View V){\n Intent i = new Intent(this, NewProject.class);\n i.putExtra(\"course title\",courseTitle);\n startActivity(i);\n }", "private void addProjectTask(ActionEvent e) {\n Calendar dueDate = dueDateModel.getValue();\n String title = titleEntry.getText();\n String description = descriptionEntry.getText();\n Project parent = (Project) parentEntry.getSelectedItem();\n addProjectTask(title, description, parent, dueDate);\n }", "public Project(String name) {\n this.name = name;\n }", "private Project compileProject() {\n\t\t\tProject p = null;\n\t\t\t\n\t\t\tif(pType.equals(\"o\")) {\n\t\t\t\ttry {\n\t\t\t\t\tp = new OngoingProject(pCode.getText(), pName.getText(), dateFormat.parse(pSDate.getText()),pClient.getText(), dateFormat.parse(pDeadline.getText()), Double.parseDouble(pBudget.getText()), Integer.parseInt(pCompletion.getText()));\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t} else if(pType.equals(\"f\")) {\n\t\t\t\ttry {\n\t\t\t\t\tp = new FinishedProject(pCode.getText(), pName.getText(), dateFormat.parse(pSDate.getText()),pClient.getText(), dateFormat.parse(pEndDate.getText()), Double.parseDouble(pTotalCost.getText()));\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t\treturn p;\n\t\t}", "public void addProj() {\n\t\tbtnAdd.click();\n\t}", "public int DSAddProject(String ProjectName, String ProjectLocation);", "@When(\"I click on the Create new Project\")\n public void i_click_on_the_create_new_project(){\n\n i_click_on_create_a_new_project();\n }", "public void closeProject(String nameProject, String nameDiscipline) throws \n InvalidDisciplineException, InvalidProjectException, OpenSurveyException{\n Professor _professor = getProfessor();\n _professor.closeProject(nameProject, nameDiscipline);\n }", "public Long createProject(ProjectTo projectTo) {\n\t\tprojectTo = new ProjectTo();\n\t\tprojectTo.setOrg_id(1L);\n\t\tprojectTo.setOrg_name(\"AP\");\n\t\tprojectTo.setName(\"Menlo\");\n\t\tprojectTo.setShort_name(\"Pioneer Towers\");\n\t\tprojectTo.setOwner_username(\"Madhapur\");\n\n\t\ttry {\n\t\t\tWebResource webResource = getJerseyClient(userOptixURL + \"CreateProject\");\n\t\t\tprojectTo = webResource.type(MediaType.APPLICATION_JSON).post(ProjectTo.class, projectTo);\n\t\t\tif(projectTo != null && projectTo.getProject_id() != null) {\n\t\t\t\treturn projectTo.getProject_id() ;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in getting the response from REST call CreateProject : \"+e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public String projectSubmissions(String nameDiscipline, String nameProject)\n throws InvalidDisciplineException, InvalidProjectException{\n Professor _professor = getProfessor();\n return _professor.projectSubmissions(nameDiscipline, nameProject);\n }", "public AddProject() {\n try\n {\n infDB = new InfDB(\"\\\\Users\\\\Oliver\\\\Documents\\\\Skola\\\\Mini_sup\\\\Realisering\\\\MICEDB.FDB\");\n System.out.println(\"Uppkopplingen lyckades\");\n }\n catch(InfException e)\n {\n System.out.println(e.getMessage());\n }\n \n try\n {\n infDB = new InfDB(\"C:\\\\Users\\\\TP300LA-C4034\\\\Desktop\\\\Delkurs 4, Lill-supen\\\\InformatikDB\\\\MICEDB.FDB\");\n System.out.println(\"Uppkopplingen lyckades\");\n }\n catch(InfException e)\n {\n System.out.println(e.getMessage());\n }\n getPlatforms();\n initComponents();\n setLocationRelativeTo(null);\n \n }", "private void newProject(ActionEvent x) {\n\t\tthis.controller.newProject();\n\t}", "public void testGetProjectByNameWebService() throws Exception {\r\n ProjectService projectService = lookupProjectServiceWSClientWithUserRole();\r\n\r\n ProjectData projectData = new ProjectData();\r\n projectData.setName(\"project3\");\r\n projectData.setDescription(\"Hello\");\r\n\r\n projectService.createProject(projectData);\r\n\r\n // 1 is the user id\r\n ProjectData pd = projectService.getProjectByName(\"project3\", 1);\r\n\r\n assertNotNull(\"null project data received\", pd);\r\n }", "public Project(String name, String nick, Calendar startDate, int duration, Teacher mainTeacher) {\n Calendar endDate = (Calendar) startDate.clone();\n endDate.add(Calendar.MONTH, duration);\n this.name = name;\n this.nick = nick;\n this.startDate = startDate;\n this.estimatedEnd = endDate;\n this.mainTeacher = mainTeacher;\n this.endDate = null;\n this.teachers = new ArrayList<>();\n this.scholars = new ArrayList<>();\n this.tasks = new ArrayList<>();\n this.finished = false;\n }", "private static void finalise_project() {\r\n\t\tDate deadline_date = null;\r\n\t\tint paid = 0;\r\n\t\tint charged = 0;\r\n\t\tString project_name = \"\";\r\n\t\tString email = \"\";\r\n\t\tString number = \"\";\r\n\t\tString full_name = \"\";\r\n\t\tString address = \"\";\r\n\t\tDate completion_date = null;\r\n\t\t\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Select a project ID to modify it.\");\r\n\t\t\t\r\n\t\t\t// Prints out all project ids and names that are not complete:\r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects INNER JOIN project_statuses ON \"\r\n\t\t\t\t\t+ \"projects.project_id = project_statuses.project_id INNER JOIN people ON projects.project_id = people.projects \"\r\n\t\t\t\t\t+ \"WHERE project_statuses.status <>'Complete';\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\t// This creates a list of project ids to check that the user only selects an available one\r\n\t\t\tArrayList<Integer> project_id_list = new ArrayList<Integer>(); \r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tSystem.out.println(\"ID: \" + project_rset.getInt(\"project_id\") + \", Name:\" + project_rset.getString(\"project_name\"));\r\n\t\t\t\tproject_id_list.add(project_rset.getInt(\"project_id\"));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows user to select a project to finalize \r\n\t\t\tBoolean select_project = true;\r\n\t\t\tint project_id = 0;\r\n\t\t\twhile (select_project == true) {\r\n\t\t\t\tSystem.out.println(\"Project ID: \");\r\n\t\t\t\tString project_id_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tproject_id = Integer.parseInt(project_id_str);\r\n\t\t\t\t\tfor (int i = 0; i < project_id_list.size(); i ++) {\r\n\t\t\t\t\t\tif (project_id == project_id_list.get(i)) { \r\n\t\t\t\t\t\t\tselect_project = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (select_project == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available project id.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for project number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The project number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Gets values needed from the selected project\r\n\t\t\tResultSet project_select_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_select_rset.next()) {\r\n\t\t\t\tif (project_select_rset.getInt(\"project_id\") == project_id) {\r\n\t\t\t\t\tproject_id = project_select_rset.getInt(\"project_id\");\r\n\t\t\t\t\tproject_name = project_select_rset.getString(\"project_name\");\r\n\t\t\t\t\tdeadline_date = project_select_rset.getDate(\"deadline_date\");\r\n\t\t\t\t\tpaid = project_select_rset.getInt(\"paid\");\r\n\t\t\t\t\tcharged = project_select_rset.getInt(\"charged\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Gets values needed from related customer\r\n // This gets the created project's table id to use to update the people and project_statuses tables \r\n\t\t\tString strSelectCustomer = String.format(\"SELECT * FROM people WHERE projects = '%s'\", project_id);\r\n\t\t\tResultSet customer_rset = stmt.executeQuery(strSelectCustomer);\r\n\t\t\twhile (customer_rset.next()) {\r\n\t\t\t\tfull_name = customer_rset.getString(\"name\") + \" \" + customer_rset.getString(\"surname\");\r\n\t\t\t\taddress = customer_rset.getString(\"address\");\r\n\t\t\t\temail = customer_rset.getString(\"email_address\");\r\n\t\t\t\tnumber = customer_rset.getString(\"telephone_number\");\r\n\t\t\t}\r\n\r\n\t\t\t// This updates the completion date\r\n\t\t\tBoolean update_completion_date = true;\r\n\t\t\twhile (update_completion_date == true) {\r\n\t\t\t\tSystem.out.print(\"Date Complete (YYYY-MM-DD): \");\r\n\t\t\t\tString completion_date_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcompletion_date = Date.valueOf(completion_date_str);\r\n\t\t\t\t\tupdate_completion_date = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for the completion date is in the wrong format\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The date must be in the format YYYY-MM-DD (eg. 2013-01-13). Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Updates the value\r\n\t\t\tPreparedStatement ps_finalise = conn.prepareStatement(\r\n\t\t\t\t\t\"UPDATE project_statuses SET completion_date = ?, status = ? WHERE project_id = ?;\");\r\n\t\t\tps_finalise.setDate(1, completion_date);\r\n\t\t\tps_finalise.setString(2, \"Complete\");\r\n\t\t\tps_finalise.setInt(3, project_id);\r\n\t\t\tps_finalise.executeUpdate();\r\n\t\t\tSystem.out.println(\"\\nUpdated completion date to \" + completion_date + \".\\n\");\r\n\t\t}\t\r\n\t\t/**\r\n\t\t * @exception If the project status table cannot be updated because of field constraints then an SQLException is thrown\r\n\t\t */\t\t\r\n\t\tcatch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t\t// Calculates the amount due and prints out an invoice\r\n\t\tint due = charged - paid;\r\n\t\tif (due > 0) {\r\n\t\t\tString content = \"\\t\\t\\t\\tInvoice\\n\" + \r\n\t\t\t\t\t\"\\nDate: \" + completion_date +\r\n\t\t\t\t\t\"\\n\\nName: \" + full_name +\r\n\t\t\t\t\t\"\\nContact Details: \" + email + \"\\n\" + number + \r\n\t\t\t\t\t\"\\nAddress: \" + address + \r\n\t\t\t\t\t\"\\n\\nAmount due for \" + project_name + \r\n\t\t\t\t\t\":\\nTotal Cost:\\t\\t\\t\\t\\t\\t\\tR \" + charged + \r\n\t\t\t\t\t\"\\nPaid: \\t\\t\\t\\t\\t\\t\\tR \" + paid +\r\n\t\t\t\t\t\"\\n\\n\\nDue: \\t\\t\\t\\t\\t\\t\\tR \" + due;\r\n\t\t\tCreateFile(project_name);\r\n\t\t\tWriteToFile(project_name, content);\r\n\t\t}\r\n\t}", "public Project procreate(Project pud) throws IOException {\n\t\tString ur = url + \"/procreate\";\n\t\tProject us = restTemplate().postForObject(ur, pud, Project.class);\n\t\tSystem.out.println(us.toString());\n\t\t//UserDetails user = om.readValue(us,UserDetails.class);\n\t\treturn us;\n\t}", "@ApiMethod(\n \t\tname = \"createProject\", \n \t\tpath = \"createProject\", \n \t\thttpMethod = HttpMethod.POST)\n public Project createProject(final ProjectForm projectForm) {\n\n final Key<Project> projectKey = factory().allocateId(Project.class);\n final long projectId = projectKey.getId();\n final Queue queue = QueueFactory.getDefaultQueue();\n \n // Start transactions\n Project project = ofy().transact(new Work<Project>(){\n \t@Override\n \tpublic Project run(){\n \t\tProject project = new Project(projectId, projectForm);\n ofy().save().entities(project).now();\n \n return project;\n \t}\n }); \n return project;\n }", "public ProyectoInfraestructura crearProyectoInfraestructura(Proponente p,String nombre, String descrL, String descC , double cost,String croquis ,String imagen,HashSet<String> distritos){\r\n\t\tProyectoInfraestructura proyecto;\r\n\t\t\r\n\t\tif(p.getClass().getSimpleName().equals(\"Colectivo\")) {\r\n\t\t\tColectivo c = (Colectivo) p;\r\n\t\t\tproyecto = new ProyectoInfraestructura(p,c.getUsuarioRepresentanteDeColectivo() , nombre, descrL, descC , cost , croquis , imagen,distritos);\r\n\t\t\t\r\n\t\t}else {//Usuario\r\n\t\t\tUsuario u = (Usuario) p;\r\n\t\t\tproyecto = new ProyectoInfraestructura(u,u , nombre, descrL, descC , cost , croquis , imagen,distritos);\t\t\t\r\n\t\t}\r\n\t\tp.proponerProyecto(proyecto);\r\n\t\t\r\n\t\tthis.proyectos.add(proyecto);\r\n\t\tthis.lastProjectUniqueID++;\r\n\t\treturn proyecto;\r\n\t\t\r\n\t}", "public void createCourse(String courseName, int courseCode){}", "private void actionNewProject ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDataController.scenarioNewProject();\r\n\r\n\t\t\thelperDisplayProjectFiles();\r\n\r\n\t\t\t//---- Change button icon\r\n\t\t\tImageIcon iconButton = FormUtils.getIconResource(FormStyle.RESOURCE_PATH_ICO_VIEW_SAMPLES);\r\n\r\n\t\t\tmainFormLink.getComponentToolbar().getComponentButtonViewSamples().setIcon(iconButton);\r\n\t\t\tmainFormLink.getComponentToolbar().getComponentButtonViewSamples().setActionCommand(FormMainHandlerCommands.AC_VIEW_SAMPLES_ON);\r\n\t\t\tmainFormLink.getComponentToolbar().getComponentButtonViewSamples().setToolTipText(\"View detected samples\");\r\n\r\n\t\t\tmainFormLink.reset();\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\t}", "void createPortFolio(String portfolioName);", "private boolean createProject() {\r\n ProjectOverviewerApplication app = (ProjectOverviewerApplication)getApplication();\r\n Projects projects = app.getProjects();\r\n String userHome = System.getProperty(\"user.home\");\r\n // master file for projects management\r\n File projectsFile = new File(userHome + \"/.hackystat/projectoverviewer/projects.xml\");\r\n \r\n // create new project and add it to the projects\r\n Project project = new Project();\r\n project.setProjectName(this.projectName);\r\n project.setOwner(this.ownerName);\r\n project.setPassword(this.password);\r\n project.setSvnUrl(this.svnUrl);\r\n for (Project existingProject : projects.getProject()) {\r\n if (existingProject.getProjectName().equalsIgnoreCase(this.projectName)) {\r\n return false;\r\n }\r\n }\r\n projects.getProject().add(project);\r\n \r\n try {\r\n // create the specific tm3 file and xml file for the new project\r\n File tm3File = new File(userHome + \r\n \"/.hackystat/projectoverviewer/\" + this.projectName + \".tm3\");\r\n File xmlFile = new File(userHome + \r\n \"/.hackystat/projectoverviewer/\" + this.projectName + \".xml\");\r\n tm3File.createNewFile();\r\n \r\n // initialize the data for the file\r\n SensorDataCollector collector = new SensorDataCollector(app.getSensorBaseHost(), \r\n this.ownerName, \r\n this.password);\r\n collector.getRepository(this.svnUrl, this.projectName);\r\n collector.write(tm3File, xmlFile);\r\n } \r\n catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n // write the projects.xml file with the new project added\r\n String packageName = \"org.hackystat.iw.projectoverviewer.jaxb.projects\";\r\n return XmlConverter.objectToXml(projects, projectsFile, packageName);\r\n }", "ProjetoRN createProjetoRN();", "private void createProjectGroup(Composite parent) {\n int col = 0;\n\n // project name\n String tooltip = \"The Android Project where the new resource file will be created.\";\n Label label = new Label(parent, SWT.NONE);\n label.setText(\"Project\");\n label.setToolTipText(tooltip);\n ++col;\n\n mProjectTextField = new Text(parent, SWT.BORDER);\n mProjectTextField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n mProjectTextField.setToolTipText(tooltip);\n mProjectTextField.addModifyListener(new ModifyListener() {\n public void modifyText(ModifyEvent e) {\n onProjectFieldUpdated();\n }\n });\n ++col;\n\n mProjectBrowseButton = new Button(parent, SWT.NONE);\n mProjectBrowseButton.setText(\"Browse...\");\n mProjectBrowseButton.setToolTipText(\"Allows you to select the Android project to modify.\");\n mProjectBrowseButton.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent e) {\n onProjectBrowse();\n }\n });\n mProjectChooserHelper = new ProjectChooserHelper(parent.getShell(), null /*filter*/);\n ++col;\n\n col = padWithEmptyCells(parent, col);\n\n // file name\n tooltip = \"The name of the resource file to create.\";\n label = new Label(parent, SWT.NONE);\n label.setText(\"File\");\n label.setToolTipText(tooltip);\n ++col;\n\n mFileNameTextField = new Text(parent, SWT.BORDER);\n mFileNameTextField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n mFileNameTextField.setToolTipText(tooltip);\n mFileNameTextField.addModifyListener(new ModifyListener() {\n public void modifyText(ModifyEvent e) {\n validatePage();\n }\n });\n ++col;\n\n padWithEmptyCells(parent, col);\n }", "public NewProjectDialog(String pt) {\n\t\t\t\n\t\t\tsuper(frame, \"Add new project\");\n\t\t\tresetFields();\n\t\t\tpType = pt;\n\t\t\t\n\t\t\tfinal JDialog npd = this;\n\t\t\t\n\t\t\tpSDate.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\t\tpDeadline.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\t\tpEndDate.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\t\tpBudget.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\t\tpTotalCost.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\t\tpCompletion.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\t\t\n\t\t\tint x = frame.getLocation().x;\n\t\t\tint y = frame.getLocation().y;\n\t\t\t\n\t\t\tint pWidth = frame.getSize().width;\n\t\t\tint pHeight = frame.getSize().height;\n\t\t\t\n\t\t\tgetContentPane().setLayout(new BorderLayout());\n\t\t\t\n\t\t\tfinal JPanel fieldPanel = new JPanel();\n\t\t\t\n\t\t\tpCode.setText(portfolio.getNewCode());\n\t\t\tpCode.setEditable(false);\n\t\t\t\n\t\t\tif(pType.equals(\"o\")) {\n\t\t\t\tfieldPanel.setLayout(new GridLayout(7,3));\n\t\t\t\tSystem.out.println(\"ongoing\");\n\t\t\t\tthis.setPreferredSize(new Dimension(600,230));\n\t\t\t} else if(pType.equals(\"f\")) {\n\t\t\t\tfieldPanel.setLayout(new GridLayout(6,3));\n\t\t\t\tSystem.out.println(\"finished\");\n\t\t\t\tthis.setPreferredSize(new Dimension(600,200));\n\t\t\t}\n\t\t\tfieldPanel.add(new JLabel(\"Project Code :\"));\n\t\t\tfieldPanel.add(pCode);\n\t\t\tfieldPanel.add(msgCode);\t\t\n\t\t\tfieldPanel.add(new JLabel(\"Project Name :\"));\n\t\t\tfieldPanel.add(pName);\n\t\t\tfieldPanel.add(msgName);\n\t\t\tfieldPanel.add(new JLabel(\"Client :\"));\n\t\t\tfieldPanel.add(pClient);\n\t\t\tfieldPanel.add(msgClient);\n\t\t\tfieldPanel.add(new JLabel(\"Start date: \"));\n\t\t\tfieldPanel.add(pSDate);\n\t\t\tfieldPanel.add(msgSDate);\n\t\t\tmsgSDate.setText(DATE_FORMAT);\n\t\t\t\n\t\t\tif(pType.equals(\"o\")) {\n\t\t\t\tfieldPanel.add(new JLabel(\"Deadline :\"));\n\t\t\t\tfieldPanel.add(pDeadline);\n\t\t\t\tfieldPanel.add(msgDeadline);\n\t\t\t\tmsgDeadline.setText(DATE_FORMAT);\n\t\t\t\tfieldPanel.add(new JLabel(\"Budget :\"));\n\t\t\t\tfieldPanel.add(pBudget);\n\t\t\t\tfieldPanel.add(msgBudget);\n\t\t\t\tfieldPanel.add(new JLabel(\"Completion :\"));\n\t\t\t\tfieldPanel.add(pCompletion);\t\t\t\n\t\t\t\tfieldPanel.add(msgCompletion);\n\t\t\t\t\n\t\t\t} else if(pType.equals(\"f\")) {\n\t\t\t\tfieldPanel.add(new JLabel(\"End Date :\"));\n\t\t\t\tfieldPanel.add(pEndDate);\n\t\t\t\tfieldPanel.add(msgEndDate);\n\t\t\t\tmsgEndDate.setText(DATE_FORMAT);\n\t\t\t\tfieldPanel.add(new JLabel(\"Total Cost :\"));\n\t\t\t\tfieldPanel.add(pTotalCost);\n\t\t\t\tfieldPanel.add(msgTotalCost);\n\t\t\t}\n\t\t\t\n\t\t\tJPanel optionButtons = new JPanel();\n\t\t\toptionButtons.setLayout(new FlowLayout());\n\t\t\t\n\t\t\tJButton btnAdd = new JButton(\"Add\");\n\t\t\tbtnAdd.addActionListener(new ActionListener() {\n\n\t\t\t\t/**\n\t\t\t\t * Validates the information entered by the user and adds the project to the\n\t\t\t\t * Portfolio object if data is valid.\n\t\t\t\t */\n\t\t\t\t@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\n\t\t\t\t\tif(validateForm()) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tProject prj = compileProject();\n\t\t\t\t\t\tportfolio.add(prj,config.isUpdateDB());\n\t\t\t\t\t\tif(prj instanceof OngoingProject) {\n\t\t\t\t\t\t\tProjectTableModel tm = (ProjectTableModel) opTable.getModel();\n\t\t\t\t\t\t\ttm.addRow(prj.toTable());\n\t\t\t\t\t\t\topTable.setModel(tm);\n\t\t\t\t\t\t\tupdateCounters();\n\t\t\t\t\t\t\ttoggleSaved(false);\n\t\t\t\t\t\t\tsel.add(pCode.getText());\n\t\t\t\t\t\t} else if (prj instanceof FinishedProject) {\n\t\t\t\t\t\t\tProjectTableModel tm = (ProjectTableModel) fpTable.getModel();\n\t\t\t\t\t\t\ttm.addRow(prj.toTable());\n\t\t\t\t\t\t\tfpTable.setModel(tm);\n\t\t\t\t\t\t\tupdateCounters();\n\t\t\t\t\t\t\ttoggleSaved(false);\n\t\t\t\t\t\t\tsel.add(pCode.getText());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnpd.dispose();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t\toptionButtons.add(btnAdd);\n\t\t\t\n\t\t\tJButton btnClose = new JButton(\"Close\");\n\t\t\tbtnClose.addActionListener(new ActionListener() {\n\n\t\t\t\t/* Closes the NewProjectDialog window. */\n\t\t\t\t@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tnpd.dispose();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t\toptionButtons.add(btnClose);\n\t\t\tgetContentPane().add(new JLabel(\"Enter the data for your new \" + getPType(pType) + \" project:\"), BorderLayout.PAGE_START);\n\t\t\tthis.add(fieldPanel, BorderLayout.CENTER);\n\t\t\tthis.add(optionButtons, BorderLayout.PAGE_END);\n\n\t\t\tthis.pack();\n\t\t\t\t\t\n\t\t\tint width = this.getSize().width;\n\t\t\tint height = this.getSize().height;\n\t\t\t\n\t\t\tthis.setLocation(new Point((x+pWidth/2-width/2),(y+pHeight/2-height/2)));\n\t\t\tthis.setVisible(true);\n\t\t}", "@Test\n \tpublic void testCreateMindProject() throws Exception {\n \t\tString name = \"Test\" ; //call a generator which compute a new name\n \t\tGTMenu.clickItem(\"File\", \"New\", FRACTAL_MIND_PROJECT);\n \t\tGTShell shell = new GTShell(Messages.MindProjectWizard_window_title);\n \t\t//shell.findTree().selectNode(\"Mind\",FRACTAL_MIND_PROJECT);\n \t\t//shell.findButton(\"Next >\").click();\n \t\tshell.findTextWithLabel(\"Project name:\").typeText(name);\n \t\tshell.close();\n \t\t\n \t\tTestMindProject.assertMindProject(name);\t\t\n \t}", "public ProjectsPage() {\n\t\tthis.driver = DriverManager.getDriver();\n\t\tElementFactory.initElements(driver, this);\n\t\t// sets the name of the project to add, with a random integer ending for slight\n\t\t// ease on multiple test runs\n\t\tnameOfProject = \"testz2018\" + (int) Math.random() * 500;\n\t}", "public boolean addProject(Project p) {\n try {\n String insert = \"INSERT INTO PROJECTS\"\n + \"(CLIENT,DESCRIPTION,HOURS,STARTDATE,DUEDATE,INVOICESENT,CLIENT_ID,PROJECT_ID) \"\n + \"VALUES(?,?,?,?,?,?,?,PROJECTS_SEQ.NEXTVAL)\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(insert);\n ps.setString(1, p.getClientId());\n ps.setString(2, p.getDescription());\n ps.setString(3, p.getHours());\n ps.setString(4, p.getStartdate());\n ps.setString(5, p.getDuedate());\n ps.setString(6, p.getInvoicesent());\n ps.setString(7, p.getClientId());\n\n ps.executeUpdate();\n ps.close();\n return true;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return false;\n }\n }", "public com.ms3.training.services.model.Course create(java.lang.String title);", "@PostMapping(\"/projects\")\n @Timed\n public ResponseEntity<ProjectDTO> createProject(@Valid @RequestBody ProjectDTO projectDto)\n throws URISyntaxException, NotAuthorizedException {\n log.debug(\"REST request to save Project : {}\", projectDto);\n var org = projectDto.getOrganization();\n if (org == null || org.getName() == null) {\n throw new BadRequestException(\"Organization must be provided\",\n ENTITY_NAME, ERR_VALIDATION);\n }\n checkPermissionOnOrganization(token, PROJECT_CREATE, org.getName());\n\n if (projectDto.getId() != null) {\n return ResponseEntity.badRequest()\n .headers(HeaderUtil.createFailureAlert(\n ENTITY_NAME, \"idexists\", \"A new project cannot already have an ID\"))\n .body(null);\n }\n if (projectRepository.findOneWithEagerRelationshipsByName(projectDto.getProjectName())\n .isPresent()) {\n return ResponseEntity.badRequest()\n .headers(HeaderUtil.createFailureAlert(\n ENTITY_NAME, \"nameexists\", \"A project with this name already exists\"))\n .body(null);\n }\n ProjectDTO result = projectService.save(projectDto);\n return ResponseEntity.created(ResourceUriService.getUri(result))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getProjectName()))\n .body(result);\n }", "public Professor(String name, int id)\r\n {\r\n this.name = name;\r\n this.id = id;\r\n }", "public ProyectoSocial crearProyectoSocial(Proponente p,String nombre, String descrL, String descC , double cost ,String gSocial, Boolean nac){\r\n\t\t\r\n\t\tProyectoSocial proyecto;\r\n\t\t\r\n\t\tif(p.getClass().getSimpleName().equals(\"Colectivo\")) {\r\n\t\t\tColectivo c = (Colectivo) p;\r\n\t\t\tproyecto = new ProyectoSocial(p,c.getUsuarioRepresentanteDeColectivo() ,nombre,descrL, descC, cost,gSocial, nac);\r\n\t\t\t\r\n\t\t}else {//Usuario\r\n\t\t\tUsuario u = (Usuario) p;\r\n\t\t\tproyecto = new ProyectoSocial(u,u,nombre,descrL, descC, cost,gSocial, nac);\r\n\t\t\t\r\n\t\t}\r\n\t\tp.proponerProyecto(proyecto);\r\n\t\t\r\n\t\tthis.proyectos.add(proyecto);\r\n\t\tthis.lastProjectUniqueID++;\r\n\t\treturn proyecto;\r\n\t\t\r\n\t}", "private static boolean addNewProject() {\n\t\tString[] options = new String[] {\"Ongoing\",\"Finished\",\"Cancel\"};\n\t\tint choice = JOptionPane.showOptionDialog(frame, \"Select new project type\" , \"Add new Project\", \n\t\t\t\tJOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[2]);\n\t\t\n\t\tNewProjectDialog dialog;\n\t\t\n\t\tswitch(choice) {\n\t\tcase 0:\n\t\t\tdialog = new NewProjectDialog(\"o\");\n\t\t\tdialog.setVisible(true);\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tdialog = new NewProjectDialog(\"f\");\n\t\t\tdialog.setVisible(true);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "@PostMapping\n public ResponseEntity<Project> createNewProject(@Valid @RequestBody Project project) {\n\n Project project1 = projectService.saveOrUpdateProject(project);\n return new ResponseEntity<Project>(project1, HttpStatus.CREATED);\n }", "public Project_Create() {\n initComponents();\n }", "private void createRoutine() {\n String s = (String) JOptionPane.showInputDialog(\n this,\n \"Name the new routine:\",\n \"Create new\",\n JOptionPane.PLAIN_MESSAGE,\n null, null, null);\n\n if (s != null) {\n Routine r = new Routine(s);\n collection.add(r);\n listModel.addElement(r);\n list.setSelectedValue(r, true);\n new WorkoutsFrame(r);\n }\n }", "@Override\n protected Professional generateCreateRequest() {\n return new Professional().withId(FIRST_ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME)\n .withCompanyName(COMPANY_NAME);\n }", "public Project(String name, String nick, Calendar startDate, int duration, Calendar finishedDate, Teacher mainTeacher, ArrayList<Teacher> teachers, ArrayList<Scholar> scholars, ArrayList<Task> tasks) {\n Calendar endDate = (Calendar) startDate.clone();\n endDate.add(Calendar.MONTH, duration);\n this.name = name;\n this.nick = nick;\n this.startDate = startDate;\n this.estimatedEnd = endDate;\n this.mainTeacher = mainTeacher;\n this.teachers = teachers;\n this.scholars = scholars;\n this.tasks = tasks;\n this.finished = true;\n this.endDate = finishedDate;\n }", "public Project(String name, String nick, Calendar startDate, int duration, Teacher mainTeacher, ArrayList<Teacher> teachers, ArrayList<Scholar> scholars, ArrayList<Task> tasks) {\n Calendar endDate = (Calendar) startDate.clone();\n endDate.add(Calendar.MONTH, duration);\n this.name = name;\n this.nick = nick;\n this.startDate = startDate;\n this.estimatedEnd = endDate;\n this.mainTeacher = mainTeacher;\n this.teachers = teachers;\n this.scholars = scholars;\n this.tasks = tasks;\n this.finished = false;\n this.endDate = null;\n }", "public Competition(Integer CompetitionID, String Name, String StartDate, String FinishDate, Integer Level, String Supervision, String Address)\n {\n this.CompetitionID = new SimpleIntegerProperty(CompetitionID);\n this.Name = new SimpleStringProperty(Name);\n this.StartDate = new SimpleStringProperty(StartDate);\n this.FinishDate = new SimpleStringProperty(FinishDate);\n this.Level = new SimpleIntegerProperty(Level);\n this.Supervision = new SimpleStringProperty(Supervision);\n this.Address = new SimpleStringProperty(Address);\n\n }", "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 void testGetProjectByNameUserRole() throws Exception {\r\n ProjectServiceRemote projectService = lookupProjectServiceRemoteWithUserRole();\r\n\r\n ProjectData projectData = new ProjectData();\r\n projectData.setName(\"project1\");\r\n projectData.setDescription(\"Hello\");\r\n\r\n projectService.createProject(projectData);\r\n\r\n // 1 is the user id\r\n ProjectData pd = projectService.getProjectByName(\"project1\", 1);\r\n\r\n assertNotNull(\"null project data received\", pd);\r\n }", "public static void newProject() {\n\n //create the arena representation\n //populateBlocks();\n //populateSensors();\n }", "@Test\n public void testSetName_1()\n throws Exception {\n Project fixture = new Project();\n fixture.setWorkloadNames(\"\");\n fixture.setName(\"\");\n fixture.setScriptDriver(ScriptDriver.SilkPerformer);\n fixture.setWorkloads(new LinkedList());\n fixture.setComments(\"\");\n fixture.setProductName(\"\");\n String name = \"\";\n\n fixture.setName(name);\n\n }", "public PanelNewProject getNewProject(){\n return nuevoProyecto;\n }", "@Test\n @org.junit.Ignore\n public void testProject_1()\n throws Exception {\n\n Project result = new Project();\n\n assertNotNull(result);\n assertEquals(null, result.getName());\n assertEquals(null, result.getWorkloadNames());\n assertEquals(null, result.getProductName());\n assertEquals(null, result.getComments());\n assertEquals(null, result.getCreator());\n assertEquals(0, result.getId());\n assertEquals(null, result.getModified());\n assertEquals(null, result.getCreated());\n }", "@RequestMapping(\"/new\")\n\tpublic String displayProjectForm(Model model) {\n\t\tProject aproject = new Project();\n\t//Iterable<Employee> employees = \tpro.getall();\n\t\n\t\tmodel.addAttribute(\"project\", aproject);\n\n\t\t//model.addAttribute(\"allEmployees\", employees);\n\t\t\n\t\t\n\t\treturn \"newproject\";\n\t\t\n\t}", "@Override\n\tpublic void createProjects(Projects proj) {\n\t\tString sql = \"INSERT INTO projects VALUES (?,?,?,?,?,?,now(),now(),?)\";\n\t\t\n\t\tthis.getJdbcTemplate().update(sql, new Object[] { \n\t\t\t\tproj.getProj_id(),\n\t\t\t\tproj.getProj_name(),\n\t\t\t\tproj.getProj_desc(),\n\t\t\t\tproj.getFile_id(),\n\t\t\t\tproj.getCus_id(),\n\t\t\t\tproj.getCretd_usr(),\n\t\t\t\tproj.getProj_currency()\n\t\t});\n\t\t\n\t\tUserDetailsApp user = UserLoginDetail.getUser();\n\t\t\n\t\tCustomer cus = new Customer();\n\t\tcus = getJdbcTemplate().queryForObject(\"select * from customer where cus_id=\"+proj.getCus_id(), new BeanPropertyRowMapper<Customer>(Customer.class));\n\t\tString file_name = \"\";\n\t\tif(proj.getFile_id() != 0){\n\t\t\tFileModel myFile = new FileModel();\n\t\t\tmyFile = getJdbcTemplate().queryForObject(\"select * from file where file_id=\"+proj.getFile_id(), new BeanPropertyRowMapper<FileModel>(FileModel.class));\n\t\t\tfile_name = myFile.getFile_name();\n\t\t}\n\t\t\n\t\tString audit = \"INSERT INTO audit_logging (aud_id,parent_id,parent_object,commit_by,commit_date,commit_desc,parent_ref) VALUES (default,?,?,?,now(),?,?)\";\n\t\tthis.getJdbcTemplate().update(audit, new Object[]{\n\t\t\t\t\n\t\t\t\tproj.getProj_id(),\n\t\t\t\t\"Projects\",\n\t\t\t\tuser.getUserModel().getUsr_name(),\n\t\t\t\t\"Created row on Projects name=\"+proj.getProj_name()+\", desc=\"+proj.getProj_desc()+\", file_name=\"+file_name\n\t\t\t\t+\", customer=\"+cus.getCus_code()+\", proj_currency=\"+proj.getProj_currency(),\n\t\t\t\tproj.getProj_name()\n\t\t});\n\t}", "@Override\n\tpublic void run(String... args) throws Exception {\n\n\t\tiProjectService.save(new Project(1L, \"Training Allocation to New Joinees\", \n\t\t\t\tLocalDate.of(2021, Month.JANUARY, 25)));\n\t\t\n\t\tiProjectService.save(new Project(2L, \"Machine Allocations and Transport\", \n\t\t\t\tLocalDate.of(2021, Month.JANUARY, 10)));\n\t\t\n\t\tOptional<Project> optional = iProjectService.findById(1L);\n\t\t\n\t\t if(optional.isPresent()) {\n\t\t\t Project project = optional.get();\n\t\t\t System.out.println(\"Project Details - \" + project.getId() + \" \" + project.getName());\n\t \t \n\t\t }\n\n\t}", "@Test(alwaysRun=true)\n public void addProject() {\n driver.findElement(By.xpath(\"//ul[contains(@class, 'nav-tabs')]//li[3]\")).click();\n assertThat(driver.getTitle(), equalTo(\"Manage Projects - MantisBT\"));\n //Click \"Create New Projects\" button\n driver.findElement(By.xpath(\"//form//button[contains(@class, 'btn-primary')]\")).click();\n //Check fields on the \"Add Project\" view\t\"Project Name Status Inherit Global Categories View Status Description\"\n List<String> expCategory = Arrays.asList(new String[]{\"* Project Name\", \"Status\", \"Inherit Global Categories\",\n \"View Status\", \"Description\"});\n List<WebElement> category = driver.findElements(By.className(\"category\"));\n List<String> actCategory = new ArrayList<>();\n for (WebElement categories : category) {\n actCategory.add(categories.getText());\n }\n assertThat(actCategory, equalTo(expCategory));\n //Fill Project inforamtion\n driver.findElement(By.id(\"project-name\")).sendKeys(\"SB\");\n driver.findElement(By.id(\"project-description\")).sendKeys(\"new one\");\n //Add project\n driver.findElement(By.xpath(\"//input[@value='Add Project']\")).click();\n //delete Created class\n driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n driver.findElement(By.xpath(\"//tr//a[contains(text(),'SB')]\")).click();\n driver.findElement(By.xpath(\"//input[@value ='Delete Project']\")).click();\n driver.findElement(By.xpath(\"//input[@value ='Delete Project']\")).click();\n }", "public NewProjectForm(String id, PageParameters param) {\r\n super(id);\r\n\r\n setModel(new CompoundPropertyModel(this));\r\n add(new TextField(\"projectName\"));\r\n add(new TextField(\"ownerName\"));\r\n add(new PasswordTextField(\"password\"));\r\n add(new TextField(\"svnUrl\"));\r\n add(new FeedbackPanel(\"errors\"));\r\n \r\n if (param.getBoolean(\"NoProject\")) {\r\n error(\"No project exists, please create one first.\");\r\n }\r\n }", "public void newProjectAction() throws IOException {\n\t\tfinal FXMLSpringLoader loader = new FXMLSpringLoader(appContext);\n\t\tfinal Dialog<Project> dialog = loader.load(\"classpath:view/Home_NewProjectDialog.fxml\");\n\t\tdialog.initOwner(newProject.getScene().getWindow());\n\t\tfinal Optional<Project> result = dialog.showAndWait();\n\t\tif (result.isPresent()) {\n\t\t\tlogger.trace(\"dialog 'new project' result: {}\", result::get);\n\t\t\tprojectsObservable.add(result.get());\n\t\t}\n\t}", "@Override\r\n\tpublic int insertProject(Project p) throws MyException {\n\t\tlogger.debug(\"프로젝트 생성전no:\"+p.getProjectNo());\r\n\t\tint result=dao.insertProject(session, p);\r\n\t\tif(result==0) {\r\n\t\t\tthrow new MyException(\"프로젝트 삽입에러\");\r\n\t\t}\r\n\t\tlogger.debug(\"프로젝트 생성후no:\"+p.getProjectNo());\r\n\t\t\r\n\t\tp.setProjectNo(p.getProjectNo());\r\n\t\tresult=dao.insertProjectMember(session,p);\r\n\t\t\r\n\t\tif(result==0){\r\n\t\t\tthrow new MyException(\"프로젝트멤버 삽입에러\");\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "void createProject(IProjectDescription description, IProject proj,\n\t\t\tIProgressMonitor monitor) throws CoreException,\n\t\t\tOperationCanceledException {\n\t\ttry {\n\n\t\t\tmonitor.beginTask(\"\", 2000);\n\n\t\t\tproj.create(description, new SubProgressMonitor(monitor, 1000));\n\n\t\t\tif (monitor.isCanceled()) {\n\t\t\t\tthrow new OperationCanceledException();\n\t\t\t}\n\n\t\t\tproj.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(\n\t\t\t\t\tmonitor, 1000));\n\n\t\t\t/*\n\t\t\t * Okay, now we have the project and we can do more things with it\n\t\t\t * before updating the perspective.\n\t\t\t */\n\t\t\tIContainer container = (IContainer) proj;\n\n\t\t\t/* Add an XHTML file */\n\t\t\t/*addFileToProject(container, new Path(\"index.html\"),\n\t\t\t\t\tJ15NewModel.openContentStream(\"Welcome to \"\n\t\t\t\t\t\t\t+ proj.getName(),\"5\"),monitor);*/\n\n\t\t\t/* Create the admin folder */\n\t\t\tfinal IFolder adminFolder = container.getFolder(new Path(\"admin\"));\n\t\t\tadminFolder.create(true, true, monitor);\n\t\t\t\n\t\t\tfinal IFolder adminModels = adminFolder.getFolder(new Path(\"models\"));\n\t\t\tadminModels.create(true, true, monitor);\n\t\t\t\n\t\t\tfinal IFolder adminControllers = adminFolder.getFolder(new Path(\"controllers\"));\n\t\t\tadminControllers.create(true, true, monitor);\n\t\t\t\n\t\t\tfinal IFolder adminViews = adminFolder.getFolder(new Path(\"views\"));\n\t\t\tadminViews.create(true, true, monitor);\n\t\t\t\n\t\t\tfinal IFolder adminTables = adminFolder.getFolder(new Path(\"tables\"));\n\t\t\tadminTables.create(true, true, monitor);\n\t\t\t\n\t\t\t/* Create the site folder */\n\t\t\tfinal IFolder siteFolder = container.getFolder(new Path(\"site\"));\n\t\t\tsiteFolder.create(true, true, monitor);\n\t\t\t\n\t\t\tfinal IFolder siteModels = siteFolder.getFolder(new Path(\"models\"));\n\t\t\tsiteModels.create(true, true, monitor);\n\t\t\t\n\t\t\tfinal IFolder siteViews = siteFolder.getFolder(new Path(\"views\"));\n\t\t\tsiteViews.create(true, true, monitor);\n\n\t\t\tInputStream resourceStream = this.getClass().getResourceAsStream(\n\t\t\t\t\t\"templates/blank-html.template\");\n\n\t\t\t/* Add blank HTML Files */\n\t\t\t\n\t\t\t/* Admin Folders first */\n\t\t\taddFileToProject(container, new Path(adminFolder.getName()\n\t\t\t\t\t+ Path.SEPARATOR + \"index.html\"),\n\t\t\t\t\tresourceStream, monitor);\n\t\t\t\n\t\t\tresourceStream.close();\n\t\t\tresourceStream = this.getClass().getResourceAsStream(\n\t\t\t\t\"templates/blank-html.template\");\n\t\t\t\n\t\t\taddFileToProject(container, new Path(adminFolder.getName()\n\t\t\t\t\t+ Path.SEPARATOR + adminModels.getName()\n\t\t\t\t\t+ Path.SEPARATOR + \"index.html\"),\n\t\t\t\t\tresourceStream, monitor);\n\t\t\t\n\t\t\tresourceStream.close();\n\t\t\tresourceStream = this.getClass().getResourceAsStream(\n\t\t\t\t\"templates/blank-html.template\");\n\t\t\t\n\t\t\taddFileToProject(container, new Path(adminFolder.getName()\n\t\t\t\t\t+ Path.SEPARATOR + adminControllers.getName()\n\t\t\t\t\t+ Path.SEPARATOR + \"index.html\"),\n\t\t\t\t\tresourceStream, monitor);\n\t\t\t\n\t\t\tresourceStream.close();\n\t\t\tresourceStream = this.getClass().getResourceAsStream(\n\t\t\t\t\"templates/blank-html.template\");\n\t\t\t\n\t\t\taddFileToProject(container, new Path(adminFolder.getName()\n\t\t\t\t\t+ Path.SEPARATOR + adminViews.getName()\n\t\t\t\t\t+ Path.SEPARATOR + \"index.html\"),\n\t\t\t\t\tresourceStream, monitor);\n\t\t\t\n\t\t\tresourceStream.close();\n\t\t\tresourceStream = this.getClass().getResourceAsStream(\n\t\t\t\t\"templates/blank-html.template\");\n\t\t\t\n\t\t\taddFileToProject(container, new Path(adminFolder.getName()\n\t\t\t\t\t+ Path.SEPARATOR + adminTables.getName()\n\t\t\t\t\t+ Path.SEPARATOR + \"index.html\"),\n\t\t\t\t\tresourceStream, monitor);\n\t\t\t\n\t\t\tresourceStream.close();\n\t\t\tresourceStream = this.getClass().getResourceAsStream(\n\t\t\t\t\"templates/blank-html.template\");\n\t\t\t\n\t\t\t/* Now the site folders */\n\t\t\taddFileToProject(container, new Path(siteFolder.getName()\n\t\t\t\t\t+ Path.SEPARATOR + \"index.html\"),\n\t\t\t\t\tresourceStream, monitor);\n\t\t\t\n\t\t\tresourceStream.close();\n\t\t\tresourceStream = this.getClass().getResourceAsStream(\n\t\t\t\t\"templates/blank-html.template\");\n\t\t\t\n\t\t\taddFileToProject(container, new Path(siteFolder.getName()\n\t\t\t\t\t+ Path.SEPARATOR + siteModels.getName()\n\t\t\t\t\t+ Path.SEPARATOR + \"index.html\"),\n\t\t\t\t\tresourceStream, monitor);\n\t\t\t\n\t\t\tresourceStream.close();\n\t\t\tresourceStream = this.getClass().getResourceAsStream(\n\t\t\t\t\"templates/blank-html.template\");\n\n\t\t\taddFileToProject(container, new Path(siteFolder.getName()\n\t\t\t\t\t+ Path.SEPARATOR + siteViews.getName()\n\t\t\t\t\t+ Path.SEPARATOR + \"index.html\"),\n\t\t\t\t\tresourceStream, monitor);\n\t\t\t\n\t\t\tresourceStream.close();\n\n\t\t\t/* All over! */\n\t\t} catch (IOException ioe) {\n\t\t\tIStatus status = new Status(IStatus.ERROR, \"J15Wizard\", IStatus.OK,\n\t\t\t\t\tioe.getLocalizedMessage(), null);\n\t\t\tthrow new CoreException(status);\n\t\t} finally {\n\t\t\tmonitor.done();\n\t\t}\n\t}", "private int createTask() {\n Calendar cal = Calendar.getInstance();\n String taskName = \"Task-\" + cal.getTimeInMillis();\n\n return TaskServiceClient.createTask(\n projObjKey, // projObjKey-新建立工作項目所在的專案key值\n parentObjKey, // parentObjKey-新建立工作項目所屬的子專案/專案key值\n \"工作敘述永不變\", // taskDesc-工作Memo區,\n 100, // taskOwnerKey-工作項目負責人, 填入使用者Key值 ,\n 0, // udaSet-在何組工作之下\n 0, // sdaSet-套用哪一組預設欄位,填0即可\n \"\", // sda0-系統預設欄位\n \"\", // sda1-系統預設欄位\n \"\", // sda2-系統預設欄位\n \"\", // sda3-系統預設欄位\n \"\", // sda4-系統預設欄位\n \"\", // sda5-系統預設欄位\n \"\", // sda6-系統預設欄位\n \"\", // sda7-系統預設欄位\n \"\", // sda8-系統預設欄位\n taskName, // sda9-系統預設欄位\n \"\", // sda10-系統預設欄位\n \"\", // sda11-系統預設欄位\n \"\", // sda12-系統預設欄位\n \"\", // sda13-系統預設欄位\n \"\", // sda14-系統預設欄位\n \"\", // sda15-系統預設欄位\n \"\", // sda16-系統預設欄位\n \"\", // sda17-系統預設欄位\n \"\", // sda18-系統預設欄位\n \"\", // sda19-系統預設欄位\n \"\", // uda0-自定欄位\n \"\", // uda1-自定欄位\n \"\", // uda2-自定欄位\n \"\", // uda3-自定欄位\n \"\", // uda4-自定欄位\n \"\", // uda5-自定欄位\n \"\", // uda6-自定欄位\n \"\", // uda7-自定欄位\n \"\", // uda8-自定欄位\n \"\", // uda9-自定欄位\n \"\", // uda10-自定欄位\n \"\", // uda11-自定欄位\n \"\", // uda12-自定欄位\n \"\", // uda13-自定欄位\n \"\", // uda14-自定欄位\n \"\", // uda15-自定欄位\n \"\", // uda16-自定欄位\n \"\", // uda17-自定欄位\n \"\", // uda18-自定欄位\n \"\", // uda19-自定欄位\n \"\", // uda60-自定欄位\n \"\", // uda61-自定欄位\n \"\", // uda62-自定欄位\n \"\", // uda63-自定欄位\n \"\", // uda64-自定欄位\n \"\", // uda65-自定欄位\n \"\", // uda66-自定欄位\n \"\", // uda67-自定欄位\n \"\", // uda68-自定欄位\n \"\", // uda69-自定欄位\n \"\", // uda70-自定欄位\n \"\", // uda71-自定欄位\n \"\", // uda72-自定欄位\n \"\", // uda73-自定欄位\n \"\", // uda74-自定欄位\n \"\", // uda75-自定欄位\n \"\", // uda76-自定欄位\n \"\", // uda77-自定欄位\n \"\", // uda78-自定欄位\n \"\", // uda79-自定欄位\n \"\", // accessList-存取成員,(userID,userID,userID)\n \"\", // userGroupAccessList-存取群組, (群組ID,群組ID)\n \"\", // subTeamAccessList-存取子團隊,(subTeamObjKey,subTeamObjKey)\n \"N\", // isMilestoneFlag-里程碑 (Y/N)\n 999999, // seqNO-序列編號\n \"admin\" // userID-建立者ID\n );\n }", "public void setProjectName(String name) {\r\n this.projectName = name;\r\n }", "public Professor(Professor prof)\r\n {\r\n this.name = prof.name;\r\n this.id = prof.id;\r\n }", "public String handleAdd() \n throws HttpPresentationException, webschedulePresentationException\n { \n\t try {\n\t Project project = new Project();\n saveProject(project);\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n\t } catch(Exception ex) {\n return showAddPage(\"You must fill out all fields to add this project\");\n }\n }", "@Test\n\tpublic void saveProjects() throws ParseException {\n\t\tproject.setEstimates(5);\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyyMMdd\");\n\t\tDate parsed = format.parse(\"20110210\");\n\t\tjava.sql.Date sql = new java.sql.Date(parsed.getTime());\n\t\tproject.setdRequested(sql);\n\t\tproject.setdRequired(sql);\n\t\tproject.setCritical(true);\n\t\tproject.setType(\"DOCSMANAGE\");\n\t\tProjectKeyContacts contacts = new ProjectKeyContacts();\n\t\tcontacts.setEmail(\"assdasd.gmail.com\");\n\t\tcontacts.setFname(\"sdsd\");\n\t\tcontacts.setLname(\"asdasd\");\n\t\tcontacts.setPhone(\"asd\");\n\t\tcontacts.setRole(\"asda\");\n\t\tcontacts.setTeam(\"saad\");\n\t\tproject.setContacts(contacts);\n\t\tProjectDetails det = new ProjectDetails();\n\t\tdet.setDescription(\"asdsd\");\n\t\tdet.setName(\"asd\");\n\t\tdet.setName(\"asdad\");\n\t\tdet.setSummary(\"asdd\");\n\t\tproject.setProjectDetails(det);\n\t\tproject.setType(\"DOCSMANAGE\");\n\t\tassertEquals(controller.saveProject(project).getStatusCode(), HttpStatus.CREATED);\n\t}", "public static void main(String[] args) {\n\n Project project = new Project();\n project.setId(2L);\n project.setTitle(\"Title\");\n System.out.println(project);\n }", "public void testGetProjectByName() throws Exception {\r\n ProjectData projectData = new ProjectData();\r\n projectData.setName(\"project1\");\r\n projectData.setDescription(\"des\");\r\n\r\n projectService.createProject(projectData);\r\n\r\n\t\tlong start = System.currentTimeMillis();\r\n\t\tProjectData pd = null;\r\n\t\tfor (int i = 0; i < 100; i++) {\r\n\t pd = projectService.getProjectByName(\"project1\", 1);\r\n\t\t}\r\n\t\tlong end = System.currentTimeMillis();\r\n\t\tSystem.out.println(\"Run getProjectByName used \" + (end - start) + \"ms\");\r\n\r\n assertEquals(\"The project data is wrong.\", pd.getDescription(), projectData.getDescription());\r\n assertEquals(\"The project data is wrong.\", pd.getName(), projectData.getName());\r\n }", "public int createProject(Map<File, String> classes, boolean isSource) {\n try {\n projectData = projectLoader.createProject(classes, isSource);\n } catch (FileNotFoundException ex) {\n Logger.getLogger(ProjectManager.class.getName()).log(Level.SEVERE, null, ex);\n } catch (Exception ex) {\n try {\n \n projectData = projectLoader.createProject(classes, isSource);\n } catch (FileNotFoundException ex1) {\n Logger.getLogger(ProjectManager.class.getName()).log(Level.SEVERE, null, ex1);\n } catch (Exception ex1) {\n ex1.printStackTrace();\n JOptionPane.showMessageDialog(master, \"Cannot open file \\nTry it again, please\");\n }\n }\n return 0;\n }", "public void crearDisco( ){\r\n boolean parameter = true;\r\n String artista = panelDatos.darArtista( );\r\n String titulo = panelDatos.darTitulo( );\r\n String genero = panelDatos.darGenero( );\r\n String imagen = panelDatos.darImagen( );\r\n\r\n if( ( artista.equals( \"\" ) || titulo.equals( \"\" ) ) || ( genero.equals( \"\" ) || imagen.equals( \"\" ) ) ) {\r\n parameter = false;\r\n JOptionPane.showMessageDialog( this, \"Todos los campos deben ser llenados para crear el disco\" );\r\n }\r\n if( parameter){\r\n boolean ok = principal.crearDisco( titulo, artista, genero, imagen );\r\n if( ok )\r\n dispose( );\r\n }\r\n }", "private void insertProjectTable() {\n name.setCellValueFactory(new PropertyValueFactory<>(\"nameId\"));\n dateStart.setCellValueFactory(new PropertyValueFactory<>(\"dateStart\"));\n dateFinish.setCellValueFactory(new PropertyValueFactory<>(\"dateFinish\"));\n place.setCellValueFactory(new PropertyValueFactory<>(\"place\"));\n car.setCellValueFactory(new PropertyValueFactory<>(\"cars\"));\n instructors.setCellValueFactory(new PropertyValueFactory<>(\"instructors\"));\n description.setCellValueFactory(new PropertyValueFactory<>(\"description\"));\n author.setCellValueFactory(new PropertyValueFactory<>(\"author\"));\n }", "@Override\n\tpublic Integer addProject(ProjectInfo project) {\n\t\treturn sqlSession.insert(\"cn.sep.samp2.project.addProject\", project);\n\t}", "Mission createMission();", "@Test\n public void test_create_scenario() {\n try {\n TestData X = new TestData(\"project2.opt\");\n String new_name = \"new_scenario\";\n X.project.create_scenario(new_name);\n assertNotNull(X.project.get_scenario_with_name(new_name));\n } catch (Exception e) {\n fail(e.getMessage());\n }\n }", "Team createTeam();", "public CreateProjectPanel() {\n isFinished = true;\n }", "private void DataCreator() {\n\t\t// Creation of employees\n\t\tEmployee emp1 = new Employee(\"Akos\", \"Toth\", true);\n\t\tEmployee emp2 = new Employee(\"Gabor\", \"Kovacs\", true);\n\t\tEmployee emp3 = new Employee(\"Adam\", \"Ciceri\", true);\n\n\t\tempRep.save(emp1);\n\t\tempRep.save(emp2);\n\t\tempRep.save(emp3);\n\t\tLOGGER.info(\"TEST DATA: Employees saved!\");\n\n\t\t// creation of tasks\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t\n\t\ttry {\n\t\t\tTaskStates task1State = new TaskStates(\"CLOSED\");\n\t\t\tProjectTask task1 = new ProjectTask(\n\t\t\t\t\t\"Modelling of system\",\n\t\t\t\t\t\"Engineering Systems Analyst\",\n\t\t\t\t\t\"Engineering Systems Analyst Dorking Surrey Salary ****K Our client is located in Dorking, Surrey and are looking for Engineering Systems Analyst our client provides specialist software development Keywords Mathematical Modelling, Risk Analysis, System Modelling, Optimisation, MISER, PIONEEER Engineering Systems Analyst Dorking Surrey Salary ****K\",\n\t\t\t\t\ttask1State,\n\t\t\t\t\tsdf.parse(\"20-01-2015\"),\n\t\t\t\t\tsdf.parse(\"25-01-2015\"),\n\t\t\t\t\t0.9);\n\t\t\tTaskStates task2State = new TaskStates(\"OPEN\");\n\t\t\tProjectTask task2 = new ProjectTask(\n\t\t\t\t\t\"Material performance design\",\n\t\t\t\t\t\"Stress Engineer Glasgow\",\n\t\t\t\t\t\"Stress Engineer Glasgow Salary **** to **** We re currently looking for talented engineers to join our growing Glasgow team at a variety of levels. The roles are ideally suited to high calibre engineering graduates with any level of appropriate experience, so that we can give you the opportunity to use your technical skills to provide high quality input to our aerospace projects, spanning both aerostructures and aeroengines. In return, you can expect good career opportunities and the chance for advancement and personal and professional development, support while you gain Chartership and some opportunities to possibly travel or work in other offices, in or outside of the UK. The Requirements You will need to have a good engineering degree that includes structural analysis (such as aeronautical, mechanical, automotive, civil) with some experience in a professional engineering environment relevant to (but not limited to) the aerospace sector. You will need to demonstrate experience in at least one or more of the following areas: Structural/stress analysis Composite stress analysis (any industry) Linear and nonlinear finite element analysis Fatigue and damage tolerance Structural dynamics Thermal analysis Aerostructures experience You will also be expected to demonstrate the following qualities: A strong desire to progress quickly to a position of leadership Professional approach Strong communication skills, written and verbal Commercial awareness Team working, being comfortable working in international teams and self managing PLEASE NOTE SECURITY CLEARANCE IS REQUIRED FOR THIS ROLE Stress Engineer Glasgow Salary **** to ****\",\n\t\t\t\t\ttask2State,\n\t\t\t\t\tsdf.parse(\"20-06-2015\"),\n\t\t\t\t\tnull,\n\t\t\t\t\t0.0);\n\t\t\tTaskStates task3State = new TaskStates(\"IN_PROGRESS\");\n\t\t\tProjectTask task3 = new ProjectTask(\n\t\t\t\t\t\"Implementation embedded system\",\n\t\t\t\t\t\"CNC Programmer\",\n\t\t\t\t\t\"Working within a small but busy sub contract ISO accredited sub contract machine shop. Must be able to programme straight from drawings programming and operating a Bridgeport VMC or a Haas VMC with Heidenhain controls. Machining 1 off,s to small batch work. Hours of work are Mon Thurs 8am 5.00pm and 3.00pm finish on a Friday\",\n\t\t\t\t\ttask3State,\n\t\t\t\t\tsdf.parse(\"20-03-2015\"),\n\t\t\t\t\tnull,\n\t\t\t\t\t0.0);\n\n\t\t\ttaskStatesRep.save(task1State);\n\t\t\ttaskStatesRep.save(task2State);\n\t\t\ttaskStatesRep.save(task3State);\n\t\t\t\n\t\t\tprjTaskRep.save(task1);\n\t\t\tprjTaskRep.save(task2);\n\t\t\tprjTaskRep.save(task3);\n\t\t\tLOGGER.info(\"TEST DATA: Tasks and task statuses saved!\");\n\t\t\t\n\t\t\t// creation of project\n\t\t\tProject prj1 = new Project(\"Building modernization\", sdf.parse(\"01-01-2015\"), sdf.parse(\"01-09-2015\"), 0.9, 0.1, true);\n\t\t\tTaskSet tskSet1 = prj1.assignTaskToEmployee(emp1, task1);\n\t\t\tTaskSet tskSet2 = prj1.assignTaskToEmployee(emp2, task2);\n\t\t\tTaskSet tskSet3 = prj1.assignTaskToEmployee(emp3, task3);\n\t\n\t\t\ttaskSetRep.save(tskSet1);\n\t\t\ttaskSetRep.save(tskSet2);\n\t\t\ttaskSetRep.save(tskSet3);\n\t\t\tLOGGER.info(\"TEST DATA: Task sets are saved!\");\n\t\n\t\t\tprjRep.save(prj1);\n\t\t\tLOGGER.info(\"TEST DATA: Projects are saved!\");\n\t\t\t\n\t\t\t//creation of Performance statistics\n\t\t\tPerfStat emp1PerfStat = new PerfStat(prj1, emp1, 10, 5, 0, 100);\n\t\t\tPerfStat emp2PerfStat = new PerfStat(prj1, emp2, 5, 15, 6, 170);\n\t\t\tPerfStat emp3PerfStat = new PerfStat(prj1, emp3, 0, 6, 3, 20);\n\t\t\t\n\t\t\tperfStatRep.save(emp1PerfStat);\n\t\t\tperfStatRep.save(emp2PerfStat);\n\t\t\tperfStatRep.save(emp3PerfStat);\n\t\t\tLOGGER.info(\"TEST DATA: Project and employee assignments are saved!\");\n\n\t\t\t\n\t\t\tLOGGER.info(\"TEST DATA: Upload of TEST employee, task and project data is FINISHED!\");\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Professor()\n\t{\n\t\t//stuff\n\t}", "public boolean createProject(String name, String key) {\n List<NameValuePair> param = new ArrayList<>();\n param.add(new BasicNameValuePair(\"name\", name));\n param.add(new BasicNameValuePair(\"key\", key));\n Map<String, String> props = new HashMap<>();\n props.put(\"Authorization\", Authentication.getBasicAuth(\"sonar\"));\n String url = Host.getSonar() + \"api/projects/create\";\n try {\n Object[] response = HttpUtils.sendPost(url, param, props);\n if (Integer.parseInt(response[0].toString()) == 200) return true;\n } catch (Exception e) {\n logger.error(\"Create sonar project: POST request error.\", e);\n }\n return false;\n }", "public Project()\n {\n\n }" ]
[ "0.7169876", "0.6902751", "0.67610735", "0.6719557", "0.6702804", "0.6644207", "0.65906274", "0.6492408", "0.6492408", "0.6492408", "0.64522696", "0.64090014", "0.63972855", "0.63772106", "0.63440543", "0.6207597", "0.61878824", "0.61837536", "0.61806554", "0.61551154", "0.6150441", "0.6142133", "0.613517", "0.61238164", "0.61020756", "0.6094438", "0.6074831", "0.6051354", "0.6036141", "0.6028856", "0.6004518", "0.60023963", "0.599987", "0.59861416", "0.5960547", "0.596044", "0.5957545", "0.5948383", "0.5931911", "0.5902803", "0.5897465", "0.588751", "0.58738786", "0.58513474", "0.58414507", "0.5838826", "0.5823778", "0.5818596", "0.5811799", "0.5803527", "0.5800108", "0.5800032", "0.57805187", "0.577851", "0.5774632", "0.57409376", "0.57301825", "0.57269025", "0.5701638", "0.5690719", "0.5672565", "0.5655131", "0.5650064", "0.5643876", "0.56412846", "0.563605", "0.5634713", "0.5628741", "0.56241924", "0.56209105", "0.5616786", "0.56039715", "0.56035507", "0.56015027", "0.5600335", "0.5595011", "0.5593189", "0.55904853", "0.55822164", "0.55752265", "0.55733114", "0.55707824", "0.55646026", "0.55508286", "0.55439943", "0.55360234", "0.5531196", "0.5524246", "0.55112857", "0.5510938", "0.54918206", "0.54889846", "0.5483205", "0.5480283", "0.5464771", "0.54645836", "0.54418075", "0.54378635", "0.5434435", "0.54320586" ]
0.8441193
0
Closes a project of the discipline with the name that was given by the professor
public void closeProject(String nameProject, String nameDiscipline) throws InvalidDisciplineException, InvalidProjectException, OpenSurveyException{ Professor _professor = getProfessor(); _professor.closeProject(nameProject, nameDiscipline); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void closeCashDrawer(String campusCode);", "public void doProjectClose() {\r\n\t\tthis.observerList.notifyObservers(GNotification.PROJECT_CLOSE, null);\r\n\t}", "private void close() {\r\n this.dispose();\r\n MainClass.gamesPlayed++;\r\n Examples2018.menu();\r\n }", "@Action\n public void Close() {\n // just close the Frame\n // This will cause setVisible() in the constructor to return\n setVisible(false);\n \n // show reminder to reference my paper\n String str = \"If you like this program, please cite:\\n\"\n + \"K. P. Pernstich\\n\"\n + \"Instrument Control (iC) – An Open-Source Software to Automate Test Equipment\\n\"\n + \"Journal of Research of the National Institute of Standards and Technology\\n\"\n + \"Volume 117 (2012) http://dx.doi.org/10.6028/jres.117.010\";\n \n JOptionPane.showMessageDialog(null, str,\n \"Humble request\", JOptionPane.INFORMATION_MESSAGE, m_iC_Properties.getLogoSmall());\n }", "private void closeProgram()\n {\n window.close();\n }", "private void closeProgram(){\n boolean answer = ConfirmBox.display(\"Title\", \"Sure you want to exit?\");\n if(answer==true){\n window.close();\n }\n }", "private static void finalise_project() {\r\n\t\tDate deadline_date = null;\r\n\t\tint paid = 0;\r\n\t\tint charged = 0;\r\n\t\tString project_name = \"\";\r\n\t\tString email = \"\";\r\n\t\tString number = \"\";\r\n\t\tString full_name = \"\";\r\n\t\tString address = \"\";\r\n\t\tDate completion_date = null;\r\n\t\t\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Select a project ID to modify it.\");\r\n\t\t\t\r\n\t\t\t// Prints out all project ids and names that are not complete:\r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects INNER JOIN project_statuses ON \"\r\n\t\t\t\t\t+ \"projects.project_id = project_statuses.project_id INNER JOIN people ON projects.project_id = people.projects \"\r\n\t\t\t\t\t+ \"WHERE project_statuses.status <>'Complete';\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\t// This creates a list of project ids to check that the user only selects an available one\r\n\t\t\tArrayList<Integer> project_id_list = new ArrayList<Integer>(); \r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tSystem.out.println(\"ID: \" + project_rset.getInt(\"project_id\") + \", Name:\" + project_rset.getString(\"project_name\"));\r\n\t\t\t\tproject_id_list.add(project_rset.getInt(\"project_id\"));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows user to select a project to finalize \r\n\t\t\tBoolean select_project = true;\r\n\t\t\tint project_id = 0;\r\n\t\t\twhile (select_project == true) {\r\n\t\t\t\tSystem.out.println(\"Project ID: \");\r\n\t\t\t\tString project_id_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tproject_id = Integer.parseInt(project_id_str);\r\n\t\t\t\t\tfor (int i = 0; i < project_id_list.size(); i ++) {\r\n\t\t\t\t\t\tif (project_id == project_id_list.get(i)) { \r\n\t\t\t\t\t\t\tselect_project = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (select_project == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available project id.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for project number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The project number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Gets values needed from the selected project\r\n\t\t\tResultSet project_select_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_select_rset.next()) {\r\n\t\t\t\tif (project_select_rset.getInt(\"project_id\") == project_id) {\r\n\t\t\t\t\tproject_id = project_select_rset.getInt(\"project_id\");\r\n\t\t\t\t\tproject_name = project_select_rset.getString(\"project_name\");\r\n\t\t\t\t\tdeadline_date = project_select_rset.getDate(\"deadline_date\");\r\n\t\t\t\t\tpaid = project_select_rset.getInt(\"paid\");\r\n\t\t\t\t\tcharged = project_select_rset.getInt(\"charged\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Gets values needed from related customer\r\n // This gets the created project's table id to use to update the people and project_statuses tables \r\n\t\t\tString strSelectCustomer = String.format(\"SELECT * FROM people WHERE projects = '%s'\", project_id);\r\n\t\t\tResultSet customer_rset = stmt.executeQuery(strSelectCustomer);\r\n\t\t\twhile (customer_rset.next()) {\r\n\t\t\t\tfull_name = customer_rset.getString(\"name\") + \" \" + customer_rset.getString(\"surname\");\r\n\t\t\t\taddress = customer_rset.getString(\"address\");\r\n\t\t\t\temail = customer_rset.getString(\"email_address\");\r\n\t\t\t\tnumber = customer_rset.getString(\"telephone_number\");\r\n\t\t\t}\r\n\r\n\t\t\t// This updates the completion date\r\n\t\t\tBoolean update_completion_date = true;\r\n\t\t\twhile (update_completion_date == true) {\r\n\t\t\t\tSystem.out.print(\"Date Complete (YYYY-MM-DD): \");\r\n\t\t\t\tString completion_date_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcompletion_date = Date.valueOf(completion_date_str);\r\n\t\t\t\t\tupdate_completion_date = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for the completion date is in the wrong format\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The date must be in the format YYYY-MM-DD (eg. 2013-01-13). Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Updates the value\r\n\t\t\tPreparedStatement ps_finalise = conn.prepareStatement(\r\n\t\t\t\t\t\"UPDATE project_statuses SET completion_date = ?, status = ? WHERE project_id = ?;\");\r\n\t\t\tps_finalise.setDate(1, completion_date);\r\n\t\t\tps_finalise.setString(2, \"Complete\");\r\n\t\t\tps_finalise.setInt(3, project_id);\r\n\t\t\tps_finalise.executeUpdate();\r\n\t\t\tSystem.out.println(\"\\nUpdated completion date to \" + completion_date + \".\\n\");\r\n\t\t}\t\r\n\t\t/**\r\n\t\t * @exception If the project status table cannot be updated because of field constraints then an SQLException is thrown\r\n\t\t */\t\t\r\n\t\tcatch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t\t// Calculates the amount due and prints out an invoice\r\n\t\tint due = charged - paid;\r\n\t\tif (due > 0) {\r\n\t\t\tString content = \"\\t\\t\\t\\tInvoice\\n\" + \r\n\t\t\t\t\t\"\\nDate: \" + completion_date +\r\n\t\t\t\t\t\"\\n\\nName: \" + full_name +\r\n\t\t\t\t\t\"\\nContact Details: \" + email + \"\\n\" + number + \r\n\t\t\t\t\t\"\\nAddress: \" + address + \r\n\t\t\t\t\t\"\\n\\nAmount due for \" + project_name + \r\n\t\t\t\t\t\":\\nTotal Cost:\\t\\t\\t\\t\\t\\t\\tR \" + charged + \r\n\t\t\t\t\t\"\\nPaid: \\t\\t\\t\\t\\t\\t\\tR \" + paid +\r\n\t\t\t\t\t\"\\n\\n\\nDue: \\t\\t\\t\\t\\t\\t\\tR \" + due;\r\n\t\t\tCreateFile(project_name);\r\n\t\t\tWriteToFile(project_name, content);\r\n\t\t}\r\n\t}", "private void closeProgram() {\n\t\tSystem.out.println(\"Cancel Button clicked\");\n\t\tif (ConfirmBox.display( \"Exit\", \"Are you sure you want to exit?\")) {\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void projectClosed() {\n finaliseToolWindow();\n this.project = null;\n }", "public void close() throws PropertyVetoException {\r\n if(saving) throw new PropertyVetoException(EMPTY_STRING,null);\r\n if(getFunctionType() != TypeConstants.DISPLAY_MODE) {\r\n if(saveRequired) {\r\n int optionSelected = CoeusOptionPane.showQuestionDialog(coeusMessageResources.parseMessageKey(\"maintainSponsorHierarchy_exceptionCode.1258\"), \r\n CoeusOptionPane.OPTION_YES_NO_CANCEL, CoeusOptionPane.DEFAULT_NO);\r\n if(optionSelected == CoeusOptionPane.SELECTION_YES) {\r\n try {\r\n //Case 2427 \r\n if(findEmptyGroup()){ \r\n showSavingForm();\r\n }\r\n canClose = false;\r\n throw new PropertyVetoException(EMPTY_STRING,null);\r\n } catch (CoeusUIException coeusUIException) {\r\n throw new PropertyVetoException(EMPTY_STRING,null);\r\n }\r\n }else if(optionSelected == CoeusOptionPane.SELECTION_CANCEL) {\r\n throw new PropertyVetoException(EMPTY_STRING,null);\r\n }\r\n } \r\n }\r\n mdiForm.removeFrame(CoeusGuiConstants.SPONSORHIERARCHY_BASE_WINDOW);\r\n queryEngine.removeDataCollection(queryKey);\r\n cleanUp();\r\n closed = true; \r\n }", "public void closeProject(AbstractProject project) {\n\t\tsetActiveValue(project.getId(), \"0\"); //$NON-NLS-1$\n\t}", "private void close(){\r\n boolean saveRequired = false;\r\n String messageKey = null;\r\n updateComments();\r\n if(getFunctionType() != TypeConstants.DISPLAY_MODE && isSaveRequired()) {\r\n saveRequired = true;\r\n if(xmlGenerationRequired()){\r\n messageKey = XML_OUT_OF_SYNC;\r\n }else{\r\n messageKey = WANT_TO_SAVE_CHANGES;\r\n }\r\n }else if(getFunctionType() != TypeConstants.DISPLAY_MODE && xmlGenerationRequired()) {\r\n saveRequired = true;\r\n messageKey = XML_OUT_OF_SYNC;\r\n }\r\n \r\n if(saveRequired) {\r\n int selection = CoeusOptionPane.showQuestionDialog(coeusMessageResources.parseMessageKey(messageKey), CoeusOptionPane.OPTION_YES_NO_CANCEL, CoeusOptionPane.DEFAULT_YES);\r\n if(selection == CoeusOptionPane.SELECTION_YES){\r\n save(true);\r\n }else if(selection == CoeusOptionPane.SELECTION_NO) {\r\n subAwardDlgWindow.dispose();\r\n }\r\n }else{\r\n subAwardDlgWindow.dispose();\r\n }\r\n }", "public void close(){\n this.boardController.close();\n }", "private void closeProgram(){\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION, \"Are you sure you want to quit?\", ButtonType.YES, ButtonType.NO, ButtonType.CANCEL);\n alert.setTitle(\"Exit\");\n alert.setHeaderText(null);\n\n alert.showAndWait();\n\n if (alert.getResult() == ButtonType.YES){\n try {\n db.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n window.close();\n System.exit(0);\n }\n }", "@Nullable\n IdeaProject close(Module module);", "@Override\n\tpublic void windowClosing(WindowEvent we) \n\t{\n\t\tif(modelProject.readStateProject()[1])\n\t\t{\n\t\t\tif(viewProject.saveProjectDialog() == 0)\n\t\t\t{\n\t\t\t\tif(modelProject.readStateProject()[0])\n\t\t\t\t\tmodelProject.deleteProject();\n\t\t\t}\n\t\t\telse\n\t\t\t\tmodelProject.saveProject();\n\t\t}\n\t\tviewProject.closeProject();\n\t}", "public void terminateOK()\n {\n \t\t\tProject.projectDB = pdb;\n \n \t\t\t// update explorer tree\n \t\t\tWindowFrame.wantToRedoLibraryTree();\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) \n\t{\n\t\tjoinDia.dispose();\n\t}", "public void createProject(String nameProject, String nameDiscipline) throws \n InvalidDisciplineException,InvalidProjectException{\n int id = _person.getId();\n Professor _professor = getProfessors().get(id);\n _professor.createProject(nameProject, nameDiscipline);\n }", "public void actionPerformed (AnActionEvent e)\n {\n Project project = DataKeys.PROJECT.getData (e.getDataContext ());\n UMLDiagramsPanel diagrams = ProjectUtils.get (project, UMLDiagramsPanel.class);\n if (diagrams != null)\n {\n UMLDiagram umlDiagram = diagrams.getCurrentDiagram ();\n if (umlDiagram != null && project != null)\n {\n int answer = Messages.showYesNoDialog (project, \"Contents will be lost! Really close diagram?\",\n \"Confirm close diagram\", Messages.getWarningIcon ());\n if (answer == 0)\n {\n diagrams.closeDiagram (umlDiagram);\n }\n }\n }\n }", "@Override\r\n\t\tpublic void windowClosing(WindowEvent arg0) {\n\t\t\tjdbcoperate.closeJDBCOperate();\r\n\t\t\tstudent.dispose();\r\n\t\t\tjf.setVisible(true);\r\n\t\t}", "private void close() {\n this.frame.setVisible(false);\n this.frame.remove(this);\n this.frame.setTitle(null);\n this.frame.add(this.controller);\n this.frame.revalidate();\n this.frame.pack();\n this.frame.setLocationRelativeTo(null);\n this.frame.setVisible(true);\n }", "public void projectClosed() { }", "public void projectClosed() { }", "void close() {\n boolean closeable = true;\n if (progressPanel.getStatus() != ReportStatus.CANCELED && progressPanel.getStatus() != ReportStatus.COMPLETE && progressPanel.getStatus() != ReportStatus.ERROR) {\n closeable = false;\n }\n if (closeable) {\n actionListener.actionPerformed(null);\n } else {\n int result = JOptionPane.showConfirmDialog(this,\n NbBundle.getMessage(this.getClass(),\n \"ReportGenerationPanel.confDlg.sureToClose.msg\"),\n NbBundle.getMessage(this.getClass(),\n \"ReportGenerationPanel.confDlg.title.closing\"),\n JOptionPane.YES_NO_OPTION);\n if (result == 0) {\n progressPanel.cancel();\n actionListener.actionPerformed(null);\n }\n }\n }", "public void onCloseMeeting() {\n controller.closeMeeting();\n }", "public static void closeD(String name){\n\t\r\n\t\tfor(int i = 0; i<tables.size();i++){\r\n\t\t\tif(tables.get(i).title.equals(name)){\r\n\t\t\t\ttables.get(i).printToFile();\r\n\t\t\t\ttables.remove(i);\t\t\t\t\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public void close()\n {\n setVisible (false);\n dispose();\n }", "public void close() {\n getCloseButton().click();\n }", "private void close() {\n\t\t\t\t// name.getScene().getWindow().hide();\n\t\t\t\tdialogStage.fireEvent(new WindowEvent(dialogStage,WindowEvent.WINDOW_CLOSE_REQUEST));\n\t\t\t}", "public static void finalise() throws IOException {\r\n //Openeing the file and creating a scanner object\r\n File inFile = new File(\"output.txt\");\r\n Scanner sc = new Scanner(inFile);\r\n //Creating empty string to append lines of text file to with a while loop.\r\n String lines = \"\";\r\n while (sc.hasNext()) {\r\n lines += sc.nextLine();\r\n }\r\n //Creating a counter to number the projects printed\r\n int indexCount = 0;\r\n //Creating an array by splitting string by \"#\" which will be written to the text file when a new project is added\r\n String[] lineArr = lines.split(\"#\");\r\n //For loop to print the projects with a counter, which the user will use to select a project to finalise\r\n for (int i = 0; i < lineArr.length; i++) {\r\n indexCount += 1;\r\n String[] projectInfo = lineArr[i].split(\", \");\r\n System.out.println(\"Index number: \" + indexCount);\r\n System.out.println(\"Project name: \" + projectInfo[0]);\r\n System.out.println(\"Project number: \" + projectInfo[1]);\r\n System.out.println(\"Build type: \" + projectInfo[2]);\r\n System.out.println(\"Address: \" + projectInfo[3]);\r\n System.out.println(\"ERF number: \" + projectInfo[4]);\r\n System.out.println(\"Fee: \" + projectInfo[5]);\r\n System.out.println(\"Paid to date: \" + projectInfo[6]);\r\n System.out.println(\"Due date: \" + projectInfo[7] + \"\\n\");\r\n }\r\n sc.close();\r\n finaliseEdit();\r\n }", "@Test\r\n\tpublic void testClosePatientFile() {\r\n\t\tsessionController.login(testC1Doctor1, getCampus(0));\r\n\t\tdoctorController.consultPatientFile(testPatient5);\r\n\t\tassertEquals(doctorController.getSelectedPatient(), testPatient5);\r\n\t\tassertEquals(testPatient5.getPatientFile().isClosed(), false);\r\n\t\tdoctorController.closePatientFile();\r\n\t\tassertEquals(testPatient5.getPatientFile().isClosed(), true);\r\n\t\tassertEquals(doctorController.getSelectedPatient(), null);\r\n\t}", "public void close() {\t\t\n\t}", "public void close() \r\n {\r\n ((GrantsByPIForm) getControlledUI()).setVisible(false);\r\n }", "public void terminarDiaLaboral() {\n\t\ttry {this.turnoPuestoDeInforme.acquire();} catch (InterruptedException e) {}\n\t\tSystem.out.println(\"AEROPUERTO: Todo el personal va a dormir luego de una larga jornada laboral\");\n\t\t}", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "public void closePM(String player) {\n\n }", "public void closeGame(int gameID){\n\t}", "public void testClose() {\n System.out.println(\"close\");\n int code = 0;\n Wizard instance = new Wizard();\n instance.close(code);\n }", "public void close(){\n \tisClosed = true;\n \tClawAct.set(true);\n\t\tRobot.oi.armRumble(RUMBLE_DURATION);\n }", "public void cancel ()\r\n\t{\r\n\t\tmyFrame.dispose();\r\n\t}", "@Override\n\tpublic void close() {\n\t\tframe = null;\n\t\tclassic = null;\n\t\trace = null;\n\t\tbuild = null;\n\t\tbt_classic = null;\n\t\tbt_race = null;\n\t\tbt_build = null;\n\t\tGameView.VIEW.removeDialog();\n\t}", "public void closeTestGenerator() {\n\t\ttry {\n\t\t\ttutorControlFrame.dispose();\n\t\t\tTutorControlGui tutorControl = new TutorControlGui();\n\t\t\ttutorControl.showDatabase();\n\t\t} catch(Exception e) {\n\t\t\tshowMessage(\"Could not update Databases.\");\n\t\t}\n\t}", "private void ChatLeave() {\n\t\t\r\n\t\tClose();\r\n\t}", "public String handleDelete()\n throws HttpPresentationException, webschedulePresentationException\n {\n String projectID = this.getComms().request.getParameter(PROJ_ID);\n System.out.println(\" trying to delete a project \"+ projectID);\n \n\t try {\n\t Project project = ProjectFactory.findProjectByID(projectID);\n String title = project.getProj_name();\n project.delete();\n this.getSessionData().setUserMessage(\"The project, \" + title +\n \", was deleted\");\n // Catch any possible database exception as well as the null pointer\n // exception if the project is not found and is null after findProjectByID\n\t } catch(Exception ex) {\n this.getSessionData().setUserMessage(projectID + \" Please choose a valid project to delete\");\n }\n // Redirect to the catalog page which will display the error message,\n // if there was one set by the above exception\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n }", "public static void closeMe() {\n window.close();\n }", "void close() {\n\t\t\n\t\tthis.frame.setVisible(false);\n\t\tthis.frame.dispose();\n\t\t\n\t}", "protected void end() {\n \t//claw.close();\n }", "@Override\n public void projectClosed() {\n ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);\n toolWindowManager.unregisterToolWindow(TOOL_WINDOW_ID);\n }", "public void close(){\n this.println(\"Library has been closed! See you tomorrow morning!!\");\n this.openOrNot = false;\n this.searchOrNot = false;\n this.serveOrNot = false;\n }", "private void endingAction() {\n this.detectChanges();\n if (this.isModifed) {\n //System.out.println(JOptionPane.showConfirmDialog(null, \"Do you want to save unsaved changes?\", \"Hey User!\", JOptionPane.YES_NO_CANCEL_OPTION));\n switch (JOptionPane.showConfirmDialog(null, \"Do you want to save current data?\", \"Hey User!\", JOptionPane.YES_NO_CANCEL_OPTION)) {\n case 0: {\n if (this.file != null) {\n INSTANCE.saveData();\n INSTANCE.dispose();\n System.exit(0);\n break;\n }\n }\n\n case 1: {\n INSTANCE.dispose();\n System.exit(0);\n break;\n }\n }\n\n //cancel op 2\n //no op 1\n //yes op 0\n } else {\n INSTANCE.dispose();\n System.exit(0);\n }\n }", "private void close(){\n this.dispose();\n }", "public abstract void closeScoreboard(Player player);", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();" ]
[ "0.60836977", "0.6055387", "0.5964324", "0.5869089", "0.5851034", "0.5800409", "0.5799073", "0.5786119", "0.5773496", "0.5734516", "0.56675243", "0.5630896", "0.55574054", "0.5555255", "0.5530214", "0.54888785", "0.5486693", "0.5451803", "0.5417825", "0.54154027", "0.53818023", "0.5368482", "0.53433514", "0.53433514", "0.5310139", "0.53060967", "0.52935505", "0.5282754", "0.5270325", "0.5268922", "0.5261146", "0.5261071", "0.5258589", "0.525754", "0.524204", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52350634", "0.52346724", "0.5216771", "0.5210633", "0.52097756", "0.52031225", "0.51948017", "0.5184763", "0.5181153", "0.51625824", "0.5158012", "0.5150676", "0.514062", "0.5130823", "0.5117696", "0.5116667", "0.51126915", "0.5111638", "0.5110462", "0.5110462", "0.5110462", "0.5110462", "0.5110462", "0.5110462", "0.5110462", "0.5110462", "0.5110462", "0.5110462", "0.5110462", "0.5110462", "0.5110462" ]
0.7801469
0
Shows the results of the survey of the project of the corresponding discipline given by the professor
public String surveyResults(String nameDiscipline, String nameProject) throws InvalidDisciplineException, InvalidProjectException, NoSuchSurveyException{ Professor _professor = getProfessor(); return _professor.surveyResults(nameDiscipline, nameProject); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void viewStudents(Professor professor);", "public void displayData(Solution solution);", "public void displaySolution() {\r\n Problem pb = new Problem(sources, destinations, costMatrix);\r\n pb.printProblem();\r\n Solution sol = new Solution(pb);\r\n sol.computeCost();\r\n }", "public results() {\n initComponents();\n loginlbl.setText(user.username);\n conn=mysqlconnect.ConnectDB();\n String sql=\"select idea_subject from final_results\";\n \n try{\n pat=conn.prepareStatement(sql);\n \n rs=pat.executeQuery();\n while(rs.next()){\n ideacb.addItem(rs.getString(1));\n }\n \n }catch(Exception e){\n JOptionPane.showMessageDialog(null, e);\n \n }\n }", "public void askCourseDetails() {\n\t\t\n\t\tString courseCode, courseName, facultyName;\n\t\tint courseVacancy = 10;\n\t\n\t\t\n\t\tSystem.out.println(\"-------The current faculties are-------\");\n\t\tfacultyNameList = acadCtrl.getFacultyNameList();\n\t\tfor(String fName : facultyNameList) {\n\t\t\tSystem.out.println(fName);\n\t\t}\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Enter faculty name: \");\n\t\t\tfacultyName = sc.nextLine().toUpperCase();\n\t\t\t\n\t\t\t//check if input data of faculty is correct\n\t\t\tif(checkFacName(facultyName)) {\n\t\t\t\tfacultyNameList.add(facultyName);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse System.out.println(\"Wrong faculty Name\");\n\t\t}\n\t\t\n\t\t\n\t\tcourseCodeList = acadCtrl.getCourseCodeList(facultyName);\n\t\tSystem.out.println(\"The current course codes are \");\n\t\tfor(String code : courseCodeList) {\n\t\t\tSystem.out.println(code);\n\t\t}\n\t\tSystem.out.println(\"Enter course code: \");\n\t\tcourseCode = sc.nextLine().toUpperCase();\n\t\t\n\t\t\n\t\tif(checkCourseCode(courseCode)) {\n\t\t\tSystem.out.println(\"Course code already exists. \\n Please try again\");\n\t\t\tcourseCode = sc.nextLine().toUpperCase();\n\t\t\tcourseCodeList.add(courseCode);\n\t\t}else courseCodeList.add(courseCode);\n\t\t\n\t\t\n\t\tcourseNameList = acadCtrl.getCourseNameList(facultyName);\n\t\tSystem.out.println(\"The current course names are \");\n\t\tfor(String name : courseNameList) {\n\t\t\tSystem.out.println(name);\n\t\t}\n\t\tSystem.out.println(\"Enter course name: \");\n\t\t\n\t\tcourseName = sc.nextLine().toUpperCase();\n\t\t\n\t\tif(checkCourseName(courseName)) {\n\t\t\tSystem.out.println(\"Course name already exists. \\n Please try again\");\n\t\t}else courseNameList.add(courseName);\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Choose your available professors\");\n\t\tprofNameList = acadCtrl.getProfessorNameList(facultyName);\n\t\tfor(String p : profNameList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\tSystem.out.println(\"Enter the professor's staff name\"); //input validation\n\t\tString ProfName = sc.nextLine();\n\t\t\n\t\tif(!CheckProfName(ProfName)) {\n\t\t\tSystem.out.println(\"Enter correct professor's name\");\n\t\t\tProfName = sc.nextLine();\n\t\t}\n\t\t\n\t\t// want to add if he's the coordinator?\n\t\t// input who is the coordinator\n\t\tSystem.out.println(\"Is he the course coordinator? Y for Yes / N for No\");\n\t\tchar yn = sc.nextLine().charAt(0);\n\n\t\tif(yn == 'Y' || yn == 'y') {\n\t\t\t// set ProfName to course coord\n\t\t\tacadCtrl.getProfessor(facultyName, ProfName).setCourseCoordinator(true);\n\t\t\tcourseCoordList.add(ProfName);\n\t\t}\n\t\telse if (yn == 'N' || yn == 'n') {\n\t\t\tSystem.out.println(\"Who is the course coordinator for the course?\");\n\t\t\tSystem.out.println();\n\t\t\tfor(String p : profNameList) {\n\t\t\t\tSystem.out.println(p);\n\t\t\t}\n\t\t\t// for course coord\n\t\t\tSystem.out.println(\"Enter the professor's staff name\"); //input validation\n\t\t\tString profNameCoord = sc.nextLine();\n\t\t\t\n\t\t\tif(!CheckProfName(profNameCoord)) {\n\t\t\t\tSystem.out.println(\"Enter correct professor's name\");\n\t\t\t\tprofNameCoord = sc.nextLine();\n\t\t\t\tacadCtrl.getProfessor(facultyName, profNameCoord).setCourseCoordinator(true);\n\t\t\t\tcourseCoordList.add(profNameCoord);\n\t\t\t}\n\t\t\tacadCtrl.getProfessor(facultyName, profNameCoord).setCourseCoordinator(true);\n\t\t\tcourseCoordList.add(profNameCoord);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Enter course Vacancy\");\n\t\tif(sc.hasNextInt()) {\n\t\t\tcourseVacancy = sc.nextInt();\n\t\t}else System.out.println(\"Enter only integers\");\n\t\t\n\t\tString dummy = sc.nextLine(); // dummy scan changes from sc int to string\n\t\t\n\t\tSystem.out.println(\"Lectures only? Y for Yes / N for No\");\n\t\tchar input = sc.nextLine().charAt(0);\n\n\t\tif(input == 'Y' || input == 'y') {\n\t\t\t// creation of course object, by default only exam, only 1 lecture\n\t\t\tacadCtrl.passCourseDetails(courseCode, courseName, facultyName, courseVacancy, ProfName); \n\t\t}\n\t\telse if (input == 'N' || input == 'n') {\n\t\t\t\n\t\t\tint tutVacancy = 0;\n\t\t\t\n\t\t\tSystem.out.println(\"Is there tutorial? Y for Yes / N for No\");\n\t\t\tinput = sc.nextLine().charAt(0);\n\t\t\t\n\t\t\tif (input == 'Y'|| input == 'y') {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"What is the class vacancy for each group?\");\t\n\t\t\t\tif(sc.hasNextInt()) {\n\t\t\t\t\ttutVacancy = sc.nextInt(); // total tutorial vacancy > lecture size OK!\n\t\t\t\t}\n\t\t\t\ttutGroups = addTutorial(tutVacancy);\n\t\t\t\n\t\t\t\tdummy = sc.nextLine();\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Is there Lab? Y for Yes / N for No\");\n\t\t\t\tinput = sc.nextLine().charAt(0);\n\t\t\t\t\n\t\t\t\tif(input == 'Y'|| input == 'y') {\n\t\t\t\t\tSystem.out.println(\"Lab group is same as Lecture group\");\n\t\t\t\t\t// creation of course object, with tutorials and lab group\n\t\t\t\t\tacadCtrl.passCourseDetailsWithTutorial(courseCode, courseName, facultyName, courseVacancy, ProfName, tutGroups, true, tutVacancy);\n\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(input == 'N'|| input == 'n') {\n\t\t\t\t\t// creation of course object, with tutorials only\n\t\t\t\t\tacadCtrl.passCourseDetailsWithTutorial(courseCode, courseName, facultyName, courseVacancy, ProfName, tutGroups, false, tutVacancy);\n\t\t\t\t}\n\t\t\t\telse System.out.println(\"Please Enter Y or N only\");\n\t\t\t}\n\t\t}else System.out.println(\"Please Enter Y or N only\");\n\t\t\n\t\t//done and print\n\t\t\n\t\tSystem.out.println(\"Course added to System!\");\n\t\tSystem.out.println(\"The current Lists of courses in \"+ facultyName + \" is: \");\n\t\tprintCourses();\n\t\tSystem.out.println(\"To add sub components into Course Work use function 6 \");\n\t\tSystem.out.println();\n\t}", "private void bValiderActionPerformed(final ActionEvent evt) {\n\t\tString resultat = \"\";\n\t\tint n = 1;\n\t\tfor (QuestionJPanel question : panelList) {\n\t\t\tfloat score = question.compute() * SCORE_PERCENTAGE;\n\t\t\tresultat = resultat.concat(\"- Question \");\n\t\t\tInteger i;\n\t\t\ti = Integer.valueOf(n);\n\t\t\tresultat = resultat.concat(i.toString());\n\t\t\tresultat = resultat.concat(\" -> \");\n\t\t\tDouble d = new Double(score);\n\t\t\tresultat = resultat.concat(d.toString());\n\t\t\tresultat = resultat.concat(\" %\\n\");\n\t\t\tn++;\n\t\t}\n\t\tinformation.append(resultat);\n\t}", "public static void main(String[] args) {\n\t\tStudent s = new Student(\"Bora\", \"Boric\", 1989, 39998, 3, 7.59);\r\n\t\tStudent s1 = new Student(\"Mika\", \"Mikic\", 1998, 39322, 1, 8.59);\r\n\t\tStudent s2 = new Student(\"Kasa\", \"Kasic\", 1991, 39299, 2, 8.94);\r\n\t\tProfesor p = new Profesor(\"Stanko\", \"Stanic\", 1980, \"Predavac\");\r\n\t\tProfesor p1 = new Profesor(\"Sasa\", \"Sasic\", 1984, \"Asistent\");\r\n\t\tp.dodajPredmet(\"Statistika\");\r\n\t\tp.dodajPredmet(\"Matematika\");\r\n\t\tp1.dodajPredmet(\"Teorija cena\");\r\n\t\tp1.dodajPredmet(\"Makroekonomija\");\r\n\t\tSystem.out.println(s.ispis());\r\n\t\tSystem.out.println(s1.ispis());\r\n\t\tSystem.out.println(s2.ispis());\r\n\t\tSystem.out.println(p.ispisi());\r\n\t\tSystem.out.println(p1.ispisi());\r\n\r\n\t}", "@Override\r\n public String toString()\r\n {\r\n return \"Professor: name=\" + name + \" and id=\" + id;\r\n }", "public String projectSubmissions(String nameDiscipline, String nameProject)\n throws InvalidDisciplineException, InvalidProjectException{\n Professor _professor = getProfessor();\n return _professor.projectSubmissions(nameDiscipline, nameProject);\n }", "private void printAnswerResults(){\n\t\tSystem.out.print(\"\\nCorrect Answer Set: \" + q.getCorrectAnswers().toString());\n\t\tSystem.out.print(\"\\nCorrect Answers: \"+correctAnswers+\n\t\t\t\t\t\t \"\\nWrong Answers: \"+wrongAnswers);\n\t}", "public void printReport(){\n\t\tSystem.out.println(\"This is \" + name + \", UPENN \" + graduationYear);\n\t\tSystem.out.println(\"Their GPA is \" + GPA);\n\t\tString numCoursesString = \"\";\n\t\tif (numCoursesCompleted == 1){\n\t\t\tnumCoursesString=\"course\";\t//if the student has only taken one course, just print course\n\t\t}\n\t\telse{\n\t\t\tnumCoursesString=\"courses\"; //if the student has taken more than one course, print courses when called\n\t\t}\n\t\tSystem.out.println(\"They have taken \" + numCoursesCompleted + \" \" + numCoursesString); \n\t}", "ArrayList<Professor> professoresFormPend();", "private void showResults() {\n if (!sent) {\n if(checkAnswerOne()) {\n nbOfCorrectAnswers++;\n }\n if(checkAnswerTwo()) {\n nbOfCorrectAnswers++;\n }\n if(checkAnswerThree()) {\n nbOfCorrectAnswers++;\n }\n if(checkAnswerFour()) {\n nbOfCorrectAnswers++;\n }\n\n showResultAsToast(nbOfCorrectAnswers);\n\n } else {\n showResultAsToast(nbOfCorrectAnswers);\n }\n }", "public static boolean displayResult() {\r\n Counseling counseling = new Counseling();\r\n List<Student> studentList = counseling.getStudentList();\r\n\r\n try {\r\n \t//If everything goes correct then a new file is created at this location with the result of counseling in it\r\n PrintWriter writer = new PrintWriter\r\n (\"C:/Users/Aakanksha/workspace/DS2/src/counseling/Result.txt\", \"UTF-8\");\r\n for(Student student: studentList) {\r\n writer.println(student.getId() + \"\\t\" +\r\n student.getName() + \"\\t\" +\r\n student.getProgramAllocated());\r\n }\r\n writer.close();\r\n return true;\r\n }\r\n catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n } \r\n }", "private void displayQuestion(Question question) {\n String query = question.getQuery();\n TextView queryTextView = getTextViewById(\"quiz_query\");\n queryTextView.setText(query);\n\n //Setting text for quiz options\n Iterator<String> options = question.getOptions().iterator();\n RadioButton A = getRadioButtonById(\"optionA\");\n RadioButton B = getRadioButtonById(\"optionB\");\n RadioButton C = getRadioButtonById(\"optionC\");\n RadioButton D = getRadioButtonById(\"optionD\");\n A.setText(options.next());\n B.setText(options.next());\n C.setText(options.next());\n D.setText(options.next());\n }", "public static void display_student() {\n\t\t\n\n \n\t\n\ttry {\n\t\t//jdbc code\n\t\tConnection connection=Connection_Provider.creatC();\t\t\n\n\t\tString q=\"select * from students\";\n\t\t// Create Statement\n\t\tStatement stmt=connection.createStatement();\n\t\tResultSet result=stmt.executeQuery(q);\n\t\twhile (result.next()) {\n\t\t\tSystem.out.println(\"Student id \"+result.getInt(1));\n\t\t\tSystem.out.println(\"Student Name \"+result.getString(2));\n\t\t\tSystem.out.println(\"Student Phone No \"+result.getInt(3));\n\t\t\tSystem.out.println(\"Student City \"+result.getString(4));\n\t\t\tSystem.out.println(\"=========================================\");\n\t\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} catch (SQLException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\t\n\t\t\n\t}", "void display() {\n for (int i = 0; i < this.questions.size(); i++)\n this.questions.get(i).display(i, gradeable());\n }", "public void showResults(){\n customerCount = simulation.getCustomerCount();\n phoneCount = simulation.getPhoneCount();\n doorCount = simulation.getDoorCount();\n unhelpedCount = simulation.getUnhelped();\n totalCus.setText(\"Total number of Customers: \"+customerCount+\"\\t\\t\");\n doorCus.setText(\"Number of Door Customers: \"+doorCount+\"\\t\\t\");\n phoneCus.setText(\"Number of Phone Customers: \"+phoneCount+\"\\t\\t\");\n unhelped.setText(\"Number of Customers left unhelped at the end: \"+unhelpedCount);\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n JButton b = (JButton)e.getSource();\n String output = \"\";\n //For each type of question, append to output\n try{\n if(b.getText().equals(\"Question 1\")){\n String prodCompany = q1Field.getText();\n ArrayList<MovieInfo> info = movies.question1(prodCompany);\n for(MovieInfo movie:info){\n output += movie.toString();\n }\n }\n else if(b.getText().equals(\"Question 2\")){\n String movieTitle = q2Field.getText();\n ArrayList<PersonInfo> writers = movies.question2(movieTitle);\n for(PersonInfo person:writers)\n output+=person.toString();\n }\n else if(b.getText().equals(\"Question 3\")){\n String role = q3Field.getText(); \n ArrayList<PersonInfo> actors = movies.question3(role);\n for(PersonInfo person:actors)\n output+=person.toString();\n }\n else if(b.getText().equals(\"Question 4\")){\n int year = 0;\n try{\n year = Integer.parseInt(q4Field.getText()); \n }\n catch(NumberFormatException exc){\n outputArea.setText(\"Year must be formatted properly\");\n }\n ArrayList<PersonInfo> actresses = movies.question4(year);\n for(PersonInfo person:actresses)\n output+=person.toString();\n }\n else if(b.getText().equals(\"Question 5\")){\n int awardCount = 0;\n try{\n awardCount = Integer.parseInt(q5Field.getText()); \n }\n catch(NumberFormatException exc){\n outputArea.setText(\"Number must be formatted properly\");\n }\n ArrayList<PersonInfo> directors = movies.question5(awardCount);\n for(PersonInfo person:directors)\n output+=person.toString();\n }\n else if(b.getText().equals(\"Question 6\")){\n PersonInfo country = movies.question6();\n output+=country.toString();\n }\n else if(b.getText().equals(\"Question 7\")){\n String awardType = q7AField.getText();\n String starringActor = q7BField.getText();\n ArrayList<MovieInfo> films = movies.question7(awardType, starringActor);\n for(MovieInfo movie:films)\n output+=movie.toString();\n }\n else if(b.getText().equals(\"Question 8\")){\n ArrayList<MovieInfo> films = movies.question8();\n for(MovieInfo movie:films)\n output+=movie.toString() + \"\\n\";\n }\n else if(b.getText().equals(\"Question 9\")){\n String actress = q9Field.getText();\n PersonInfo act = movies.question9(actress);\n output += act.toString();\n }\n else if(b.getText().equals(\"Question 10\")){\n int year = 0;\n MovieInfo film = null;\n try{//Need year to be formatted properly\n year = Integer.parseInt(q10Field.getText());\n film = movies.question10(year);\n }\n catch(NumberFormatException exc){\n outputArea.setText(\"Year must be formatted properly\");\n }\n output+=film.toString();\n }\n }\n catch(IOException exc){\n //If the web page was not accessed properly\n exc.printStackTrace();\n }\n \n //User input was invalid\n if(output.equals(\"\"))\n output += \"Your input did not return any results\";\n \n outputArea.setText(output);\n }", "public void quiz() {\n\t\t\t\t\tcorrectans = 0;\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tint M = 0;\n\t\t\t\t\tj = readDifficulty();\n\t\t\t\t\tM = readProblemType();\n\t\t\t\t\t//ask the student to solve 10 different problems, as determined by the problem type\n\t\t\t for(int i = 0; i < 10; i++ ) {\n\t\t\t \t//contain two numbers sampled from a uniform random distribution with bounds determined by the problem difficulty\n\t\t\t \tint x = rand.nextInt(j); \n\t\t\t\t int y = rand.nextInt(j);\n\t\t\t\t int O = askquestion(j, M,x,y);\n\t\t\t\t if(M == 4) {\n\t\t\t\t \t float floatans = readdivision();\n\t\t\t\t \tk = divisionsol(floatans, x, y);\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t int userin = readResponse();\n\t\t\t k = isnanswercorrect(O , userin);\n\t\t\t }\n\t\t\t if(k == 1) {\n\t\t\t \t correctans++;\n\t\t\t }\n\t\t\t }\n\t\t\t int L = 0;\n\t\t\t L = displayCompletionMessage(correctans);\n\t\t\t if ( L == 1) {\n\t\t\t \tquiz();\n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn;\n\t\t\t }\n\t\t\t \n\t\t\t\t}", "private int showProblem(Connection conn, int classId, int probId, String testType,PrePostProblemDefn p) throws SQLException {\n String host= Settings.prePostProblemURI;\r\n String url = host + p.getUrl();\r\n if (url != null)\r\n this.src.append(\"<img src=\\\"\" + url +\"\\\" /><p/>\\n\");\r\n String descr = p.getDescr();\r\n this.src.append(descr + \"<p/>\\n\");\r\n int ansType = p.getAnsType();\r\n if (ansType == PrePostProblemDefn.MULTIPLE_CHOICE) {\r\n String ansA,ansB,ansC,ansD,ansE;\r\n String ansAURL,ansBURL,ansCURL,ansDURL,ansEURL;\r\n ansA= p.getaAns();\r\n if (ansA == null) {\r\n ansAURL = p.getaURL();\r\n if (ansAURL != null)\r\n this.src.append(\"a: <img src=\\\"\" + host +ansAURL + \"\\\"><br/>\\n\");\r\n }\r\n else this.src.append(\"a: \" + ansA + \"<br/>\\n\");\r\n ansB= p.getbAns();\r\n if (ansB == null) {\r\n ansBURL = p.getbURL();\r\n if (ansBURL != null)\r\n this.src.append(\"b: <img src=\\\"\" + host +ansBURL + \"\\\"><br/>\\n\");\r\n }\r\n else this.src.append(\"b: \" + ansB + \"<br/>\\n\");\r\n ansC= p.getcAns();\r\n if (ansC == null) {\r\n ansCURL = p.getcURL();\r\n if (ansCURL != null)\r\n this.src.append(\"c: <img src=\\\"\" + host +ansCURL + \"\\\"><br/>\\n\");\r\n }\r\n else this.src.append(\"c: \" + ansC + \"<br/>\\n\");\r\n ansD= p.getdAns();\r\n if (ansD == null) {\r\n ansDURL = p.getdURL();\r\n if (ansDURL != null)\r\n this.src.append(\"d: <img src=\\\"\" + host + ansDURL + \"\\\"><br/>\\n\");\r\n }\r\n else if (ansD != null) this.src.append(\"d: \" + ansD + \"<br/>\\n\");\r\n ansE= p.geteAns();\r\n if (ansE == null) {\r\n ansEURL = p.geteURL();\r\n if (ansEURL != null)\r\n this.src.append(\"e: <img src=\\\"\" + host +ansEURL + \"\\\"><br/>\\n\");\r\n }\r\n else if (ansE != null) this.src.append(\"e: \" + ansE + \"<br/>\\n\");\r\n\r\n }\r\n return ansType;\r\n }", "private void showResult() {\n int i = 0;\n matchList.forEach(match -> match.proceed());\n for (Match match : matchList) {\n setTextInlabels(match.showTeamWithResult(), i);\n i++;\n }\n }", "public void survey()\n {\n }", "public String completePractice() {\n\t\tlogger.info(\"completePractice: START\");\n\n\t\treturn resultView;\n\t}", "private void _generateAnAssistantProfessor(int index) {\n String id = _getId(CS_C_ASSTPROF, index);\n writer_.startSection(CS_C_ASSTPROF, id);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, RDF.type.getURI(), ontology+\"#AssistantProfessor\", true); \t\n }\n _generateAProf_a(CS_C_ASSTPROF, index, id);\n writer_.endSection(CS_C_ASSTPROF);\n _assignFacultyPublications(id, ASSTPROF_PUB_MIN, ASSTPROF_PUB_MAX);\n }", "private void doResearch() {\n\t\tSystem.out.println(\"Students must do research\");\n\t}", "public List<Models.Programme> showProgrammes() {\n List<Models.Programme> results = em.createNativeQuery(\"select pg.* from programme pg, programmeparticipant ppa, participant p where pg.programmecode = ppa.programmecode and ppa.participantid = p.participantid and p.userid = ?\", Models.Programme.class).setParameter(1, user.getUserid()).getResultList();\n\n // Display the output\n String output = \"\";\n\n output = addChat(results.size() + \" programmes were found.\");\n\n for (Models.Programme programme : results) {\n output += \"<div class='result display' onclick=\\\"window.location.href='Programme?id=\" + programme.getProgrammecode() + \"'\\\">\\n\"\n + \" <div class='top'>\\n\"\n + \" <img class='icon' src='https://www.flaticon.com/svg/static/icons/svg/717/717874.svg'>\\n\"\n + \" <div class='text'>\\n\"\n + \" <a class='type'>PROGRAMME</a>\\n\"\n + \" <a class='name'>\" + programme.getTitle() + \"</a>\\n\"\n + \" <a class='subname'>\" + programme.getProgrammecode() + \"</a>\\n\"\n + \" </div>\\n\"\n + \" </div>\\n\"\n + \" </div>\";\n }\n\n servlet.putInJsp(\"result\", output);\n return results;\n }", "public void finalDisplay2()\n\t{\n\t\tString s1=null;\n\t\tint sum=0;\n\t\tint j;\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tj=rowLabel[i];\t\t\t\n\t\t\tsum+=temp[i][j];\t\n\t\t}\n\t\ts1=\"There are multiple solutions with the cost of \"+sum;\n\t\tJTable t = new JTable();\n testTableMultiple(t,(2*noOfPeople)+2);\n JScrollPane scrollPane = new JScrollPane(t); \n JOptionPane.showMessageDialog(null,scrollPane, s1, JOptionPane.INFORMATION_MESSAGE);\n\t}", "protected void firstStep() {\n if (!condition.equals(\"fm\") && !condition.equals(\"cfs\")) throw new RuntimeException(\"Unknown condition: \"\r\n + condition);\r\n if (rating.condition == null || rating.condition.length() == 0) ratingUpdateString(\"condition\", condition);\r\n\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(new InlineHTML(\"Web site:\"));\r\n panel.add(textInput(\"webSite\"));\r\n panel.add(new HTML(\"If you know the web site of the \" + rating._doctor.firstName + \" \"\r\n + rating._doctor.lastName + \", please enter it here.\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n\r\n panel.add(new HTML(\"TYPE OF HEALTH PROFESSIONAL\"));\r\n panel.add(ratingBox(\"type\", \"Family Physician / Internist\",\r\n \"Family Physician / General Internal Medicine\"));\r\n// for (String title : Arrays.asList(\"Family Physician\", \"General Internal Medicine\")) {\r\n// panel.add(ratingBox(\"type\", title, null));\r\n// panel.add(new InlineHTML(\"<br/>\"));\r\n// }\r\n panel.add(h2(new HTML(\r\n \"<b>SPECIALISTS</b>: These doctors often require a physician's recommendation to be seen.\")));\r\n for (String title : Arrays.asList(\"Allergist\", \"Cardiologist\", \"Dentist\", \"Endocrinologist\",\r\n \"Gastroenterologist\", \"Gynecologist\", \"Immunologist\", \"Infectious Disease Specialist\", \"Neurologist\",\r\n \"Orthopedist\", \"Ear, Nose and Throat Physician\", \"Pain Management Specialist\", \"Pediatrician\",\r\n \"Physical Therapist and Rehabilitation Specialist\",\r\n \"Psychological Counselor (psychiatrist, psychologist, social worker, etc.)\", \"Rheumatologist\",\r\n \"Sleep Specialist\", \"Sports Medicine Doctor\", \"Not Sure\")) {\r\n panel.add(ratingBox(\"type\", title, null));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n }\r\n\r\n panel.add(new InlineHTML(\"Other \"));\r\n panel.add(textInput(\"typeSpecialistOther\"));\r\n\r\n panel.add(h2(new HTML(\"<b>ALTERNATIVE HEALTH PRACTITIONERS</b>\")));\r\n for (String title : Arrays.asList(\"MD with an Alternative Focus\", \"Acupressurist\", \"Acupuncturist\",\r\n \"Alexander Technique Practitioner\", \"Amygdala Retrainer\", \"Aromatherapist\", \"Aryuveda practitioner\",\r\n \"Bach Flower\", \"Chinese Medicine Specialist\", \"Chiropracter\", \"Colon/Hydrotherapist\",\r\n \"Cranio-sacral Therapist\", \"Emotional Freedom Technique (EFT) Practitioner\",\r\n \"Energy Healing Practitioner\", \"Environmental Medicine\", \"Feldenkrais Practitioner\", \"Herbalist\",\r\n \"Homeopathist\", \"Hypnotherapist\", \"Kinesiologist\", \"Lightning Process Practitioner\",\r\n \"Macrobiotic Practitioner\", \"Massage Therapist\",\r\n \"Mindfulness Based Stress Reduction (MBSR) Practitioner\", \"Naturopathist\",\r\n \"Nambudripad Allergy Technique (NAET) Practitioner\", \"Neuro-linguistic Programmer\", \"Nutritionist\",\r\n \"Orthomolecular Medicine\", \"Osteopath\", \"Qigong Practitioner\", \"Reiki Practitioner\", \"Reflexologist\",\r\n \"Spiritual Healer\", \"Rolfer\")) {\r\n panel.add(ratingBox(\"type\", title, null));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n }\r\n\r\n panel.add(new InlineHTML(\"Other \"));\r\n panel.add(textInput(\"typeAlternativeOther\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n\r\n panel.add(wizardNavigation(null));\r\n }", "@Override\n public void show(ResultComponent results) throws TrecEvalOOException {\n System.out.println(\"************************************************\");\n System.out.println(\"*************** Topic \" + topicId + \" output ****************\");\n System.out.println(\"************************************************\");\n\n if (results.getType() == ResultComponent.Type.GENERAL) {\n\n for (ResultComponent runResult : results.getResults()) {\n\n List<Result> resultList = runResult.getResultsByIdTopic(topicId);\n\n System.out.println(\"\\nResults for run: \" + runResult.getRunName());\n if (resultList.isEmpty()) {\n System.out.println(\"No results for topic \" + topicId);\n }\n\n for (Result result : resultList) {\n System.out.print(result.toString());\n }\n }\n }\n }", "public static void displayScore(final Quiz quiz) {\n // write your code here\n // to display the score\n // report using quiz object.\n if (getflag()) {\n return;\n }\n System.out.println(quiz.showReport());\n }", "private void study(String studyToolId) {\n String[][] questionsAndAnswers = studyToolManager.fetchQuestionsAndAnswers(studyToolId);\n String templateId = studyToolManager.getStudyToolTemplateId(studyToolId);\n TemplateManager.TemplateType templateType = templateManager.getTemplateType(Integer.parseInt(templateId));\n List<Object> timeInfo = templateManager.getTimeInfo(templateId);\n boolean isTimed = (Boolean) timeInfo.get(0);\n boolean isTimedPerQuestion = (Boolean) timeInfo.get(1);\n long timeLimitInMS = 1000 * (Integer) timeInfo.get(2);\n long quizStartTime = System.currentTimeMillis();\n int total_score = questionsAndAnswers.length;\n int curr_score = 0;\n Queue<String[]> questionsToRepeat = new LinkedList<>();\n AnswerChecker answerChecker = studyToolManager.getAnswerChecker(studyToolId);\n for (String[] qa : questionsAndAnswers) {\n long questionStartTime = System.currentTimeMillis();\n studyToolDisplayer.displayAQuestion(qa);\n regularPresenter.getAnswerPrompter(templateType);\n String answer = scanner.nextLine();\n boolean correctness = answerChecker.isCorrectAnswer(answer, qa[1]);\n if (templateType.equals(TemplateManager.TemplateType.FC) && !correctness) {\n // TODO: make this depend on template's configuration\n questionsToRepeat.add(qa);\n }\n long questionTimeElapsed = System.currentTimeMillis() - questionStartTime;\n if (isTimed && isTimedPerQuestion && (questionTimeElapsed >= timeLimitInMS)) {\n regularPresenter.ranOutOfTimeReporter();\n } else {\n curr_score += (correctness ? 1 : 0);\n regularPresenter.correctnessReporter(correctness);\n }\n regularPresenter.pressEnterToShowAnswer();\n scanner.nextLine();\n studyToolDisplayer.displayAnAnswer(qa);\n }\n //FC only, for repeating wrong questions until all is memorized\n while (!questionsToRepeat.isEmpty()) {\n String[] qa = questionsToRepeat.poll();\n studyToolDisplayer.displayAQuestion(qa);\n regularPresenter.getAnswerPrompter(templateType);\n String answer = scanner.nextLine();\n boolean correctness = answerChecker.isCorrectAnswer(answer, qa[1]);\n if (!correctness) {\n questionsToRepeat.add(qa);\n }\n regularPresenter.correctnessReporter(correctness);\n regularPresenter.pressEnterToShowAnswer();\n studyToolDisplayer.displayAnAnswer(qa);\n }\n long quizTimeElapsed = System.currentTimeMillis() - quizStartTime;\n if (isTimed && !isTimedPerQuestion && (quizTimeElapsed >= timeLimitInMS)){\n regularPresenter.ranOutOfTimeReporter();\n }\n else if (templateManager.isTemplateScored(templateId)) {\n String score = curr_score + \"/\" + total_score;\n regularPresenter.studySessionEndedReporter(score);\n }\n }", "public void ExperimentResults() {\n\t\t/*\n\t\t * Creating a ScreenPresenter. To create other ResultsPresenter, the\n\t\t * better idea is to create a Factory.\n\t\t */\n\t\tResultPresenter presenter = new ScreenPresenter();\n\t\tpresenter.setText(evaluator.evalResults.resultsInText());\n\n\t}", "public void showQuestion()\n\t{\n\t\tSystem.out.println(ans);\n\t\tfor(int k = 0; k<numAns; k++)\n\t\t{\n\t\t\tSystem.out.println(k+\". \"+answers[k]);\n\t\t}\n\t}", "public static void displayQuestions() {\n System.out.println(\"1. Is your character male?\");\n System.out.println(\"2. Is your character female?\");\n System.out.println(\"3. Does your character have brown hair?\");\n System.out.println(\"4. Does your character have red hair?\");\n System.out.println(\"5. Does your character have blonde hair?\");\n System.out.println(\"6. Does your character have green eyes?\");\n System.out.println(\"7. Does your character have blue eyes?\");\n System.out.println(\"8. Does your character have brown eyes?\");\n System.out.println(\"9. Is your character wearing a green shirt?\");\n System.out.println(\"10. Is your character wearing a blue shirt?\");\n System.out.println(\"11. Is your character wearing a red shirt?\");\n }", "public void lectureDetails() {\n\n try {\n String sql = \"SELECT eid as 'Employee ID', lectur_name as 'Lecturer Name', faculty as 'Faculty', department as 'Department', center as 'Center', building as 'Building', lec_level as 'Level', lec_rank as 'Rank' FROM lecturer\";\n pst = con.prepareStatement(sql);\n res = pst.executeQuery();\n\n lectDetails.setModel(DbUtils.resultSetToTableModel(res));\n\n } catch (SQLException ex) {\n Logger.getLogger(lecturers_mgmt.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public static void showResualt() throws InterruptedException\n {\n for (int i = 0; i < allScores.length; i++) {\n System.out.println(allScores[i]);\n }\n JOptionPane.showMessageDialog(new JFrame(), allScores, \"Champions league Finished : \" , JOptionPane.INFORMATION_MESSAGE);\n }", "public void printInfo() {\n System.out.println(\"\\n\\n---------------------BASIC RESULTS-----------------------\\n\");\n System.out.println(\"Most positive article: \" + mostPositiveDoc + \"\\nwith positivity \" + mostPositive + \"\\n\");\n System.out.println(\"Most negative article: \" + mostNegativeDoc + \"\\nwith negativity \" + mostNegative + \"\\n\");\n if (biggestDifference >= 0) {\n System.out.println(\"Biggest difference: \" + biggestDifferenceDoc + \"\\nwith more positivity by \" + biggestDifference);\n } else {\n System.out.println(\"Biggest difference: \" + biggestDifferenceDoc + \"\\nwith more negativity by \" + Math.abs(biggestDifference));\n }\n \n System.out.println(\"\\nAverage positivity: \" + avgPositive);\n System.out.println(\"Average negativity: \" + avgNegative);\n System.out.println(\"\\n-----------------------------------------------------------\\n\");\n System.out.println(\"\\n---------------------ADVANCED RESULTS----------------------\");\n \n System.out.println(\"\\nAverage positivity for PUBLISHERS:\");\n for (String s : publisherOptimism.keySet()) {\n LinkedList<Double> positives = publisherOptimism.get(s);\n int size = positives.size();\n double total = 0;\n for (double d : positives) {\n total += d;\n }\n System.out.println(s + \", positivity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage negativity for PUBLISHERS:\");\n for (String s : publisherPessimism.keySet()) {\n LinkedList<Double> negatives = publisherPessimism.get(s);\n int size = negatives.size();\n double total = 0;\n for (double d : negatives) {\n total += d;\n }\n System.out.println(s + \", negativity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage positivity for REGIONS:\");\n for (String s : regionOptimism.keySet()) {\n LinkedList<Double> positives = regionOptimism.get(s);\n int size = positives.size();\n double total = 0;\n for (double d : positives) {\n total += d;\n }\n System.out.println(s + \", positivity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage negativity for REGIONS:\");\n for (String s : regionPessimism.keySet()) {\n LinkedList<Double> negatives = regionPessimism.get(s);\n int size = negatives.size();\n double total = 0;\n for (double d : negatives) {\n total += d;\n }\n System.out.println(s + \", negativity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage positivity for DATES:\");\n for (LocalDate s : dayOptimism.keySet()) {\n LinkedList<Double> positives = dayOptimism.get(s);\n int size = positives.size();\n double total = 0;\n for (double d : positives) {\n total += d;\n }\n System.out.println(s + \", positivity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage negativity for DATES:\");\n for (LocalDate s : dayPessimism.keySet()) {\n LinkedList<Double> negatives = dayPessimism.get(s);\n int size = negatives.size();\n double total = 0;\n for (double d : negatives) {\n total += d;\n }\n System.out.println(s + \", negativity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage positivity for WEEKDAYS:\");\n for (DayOfWeek s : weekdayOptimism.keySet()) {\n LinkedList<Double> positives = weekdayOptimism.get(s);\n int size = positives.size();\n double total = 0;\n for (double d : positives) {\n total += d;\n }\n System.out.println(s + \", positivity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage negativity for WEEKDAYS:\");\n for (DayOfWeek s : weekdayPessimism.keySet()) {\n LinkedList<Double> negatives = weekdayPessimism.get(s);\n int size = negatives.size();\n double total = 0;\n for (double d : negatives) {\n total += d;\n }\n System.out.println(s + \", negativity = \" + total / size);\n }\n \n System.out.println(\"\\n-----------------------------------------------------------\\n\");\n \n }", "public void result() {\n JLabel header = new JLabel(\"Finish!!\");\n header.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 28));\n gui.getConstraints().gridx = 0;\n gui.getConstraints().gridy = 0;\n gui.getConstraints().insets = new Insets(10,10,50,10);\n gui.getPanel().add(header, gui.getConstraints());\n\n String outcomeText = String.format(\"You answer correctly %d / %d.\",\n totalCorrect, VocabularyQuizList.MAX_NUMBER_QUIZ);\n JTextArea outcome = new JTextArea(outcomeText);\n outcome.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 20));\n outcome.setEditable(false);\n gui.getConstraints().gridy = 1;\n gui.getConstraints().insets = new Insets(10,10,30,10);\n gui.getPanel().add(outcome, gui.getConstraints());\n\n JButton b = new JButton(\"home\");\n gui.getGuiAssist().homeListener(b);\n gui.getConstraints().gridy = 2;\n gui.getConstraints().insets = new Insets(10,200,10,200);\n gui.getPanel().add(b, gui.getConstraints());\n\n b = new JButton(\"start again\");\n startQuestionListener(b);\n gui.getConstraints().gridy = 3;\n gui.getPanel().add(b, gui.getConstraints());\n }", "private void printResults() {\n\t\tdouble percentCorrect = (double)(correctAnswers/numberAmt) * 100;\n\t\tSystem.out.println(\"Amount of number memorized: \" + numberAmt +\n\t\t\t\t \"\\n\" + \"Amount correctly answered: \" + correctAnswers +\n\t\t\t\t \"\\n\" + \"Percent correct: \" + (int)percentCorrect);\n\t}", "public double people(double precis,double plagiarism,double poster,double video,double presentation,double portfolio,double reflection,double examination,double killerRobot)\n {\n double a = ((4%100)*precis)/100;\n double b = ((8%100)*plagiarism)/100;\n double c = ((12%100)*poster)/100;\n double d = ((16%100)*video)/100;\n double e = ((12%100)*presentation)/100;\n double f = ((10%100)*portfolio)/100;\n double g = ((10%100)*reflection)/100;\n double h = ((16%100)*examination)/100;\n double i = ((12%100)*killerRobot)/100;\n double grade = ((a+b+c+d+e+f+g+h+i)/8);//*100;\n return grade;\n }", "public void showDisplaySolution(Solution<Position> solution);", "@Override\n public void executeAction() throws Exception {\n ContestServiceFacade contestServiceFacade = getContestServiceFacade();\n TCSubject currentUser = DirectStrutsActionsHelper.getTCSubjectFromSession();\n\n // get contest data and phases\n long contestId = getProjectId();\n SoftwareCompetition softwareCompetition \n = contestServiceFacade.getSoftwareContestByProjectId(currentUser, contestId);\n\n // set dashboard data etc. for the data above the final-fix tab\n DirectUtils.setDashboardData(currentUser, getProjectId(), viewData,\n getContestServiceFacade(), !DirectUtils.isStudio(softwareCompetition));\n ContestStatsDTO contestStats = DirectUtils.getContestStats(currentUser, getProjectId(), softwareCompetition);\n this.viewData.setContestStats(contestStats);\n\n this.viewData.setContestId(getProjectId());\n\n // Prepare the data for final fixes\n Phase[] phases = softwareCompetition.getProjectPhases().getAllPhases();\n Phase lastPhase = phases[phases.length - 1];\n\n // get final fix status\n boolean isApproval = lastPhase.getPhaseType().getId() == PhaseType.APPROVAL_PHASE.getId();\n boolean isFinalReview = lastPhase.getPhaseType().getId() == PhaseType.FINAL_REVIEW_PHASE.getId();\n \n // Get the winning submission\n Submission winningSubmission = null;\n List<Submission> submissions = DirectUtils.getStudioContestSubmissions(contestId,\n ContestRoundType.FINAL, currentUser, getContestServiceFacade());\n for (Submission submission : submissions) {\n if (submission.getPlacement() != null && submission.getPlacement() == 1) {\n winningSubmission = submission;\n }\n }\n\n if (isApproval) {\n boolean isApprovalRejected = false;\n Review[] reviewsByPhase =\n getProjectServices().getReviewsByPhase(contestId, lastPhase.getId());\n if (reviewsByPhase.length == 0) {\n this.viewData.setDataUnavailable(true);\n return;\n }\n Review approvalReview = reviewsByPhase[0];\n Comment approvalComment = DirectUtils\n .getReviewCommentByTypeId(CommentType.COMMENT_TYPE_APPROVAL_REVIEW.getId(), approvalReview);\n if (approvalComment != null) {\n isApprovalRejected = \"Rejected\".equalsIgnoreCase(String.valueOf(approvalComment.getExtraInfo()));\n }\n if (isApprovalRejected) {\n if (approvalReview.isCommitted()) {\n this.viewData.setFinalFixStatus(FinalFixStatus.IN_PROGRESS);\n } else {\n this.viewData.setFinalFixStatus(FinalFixStatus.NOT_STARTED);\n \n // Bind the Final Fix details based on approval review to view\n StudioFinalFix finalFix = new StudioFinalFix();\n Item[] approvalReviewItems = approvalReview.getAllItems();\n List<com.topcoder.direct.services.view.dto.contest.studio.Comment> finalFixComments \n = new ArrayList<com.topcoder.direct.services.view.dto.contest.studio.Comment>();\n for (Item item : approvalReviewItems) {\n Comment[] itemComments = item.getAllComments();\n for (Comment itemComment : itemComments) {\n com.topcoder.direct.services.view.dto.contest.studio.Comment com\n = new com.topcoder.direct.services.view.dto.contest.studio.Comment();\n com.setComment(itemComment.getComment());\n finalFixComments.add(com);\n }\n }\n finalFix.setComments(finalFixComments);\n finalFix.setSubmission(winningSubmission);\n this.viewData.setFinalFixes(Arrays.asList(finalFix));\n \n // Get the details for winning submitter\n if (winningSubmission != null) {\n Resource[] resources = softwareCompetition.getResources();\n for (int i = 0; i < resources.length; i++) {\n Resource resource = resources[i];\n if (resource.getId() == winningSubmission.getUpload().getOwner()) {\n this.viewData.setWinnerResource(resource);\n }\n }\n }\n }\n } else {\n throw new DirectException(\"The submission is already approved\");\n }\n } else if (isFinalReview) {\n Phase precedingPhase = phases[phases.length - 2];\n boolean isFinalFixPreceding = precedingPhase.getPhaseType().getId() == PhaseType.FINAL_FIX_PHASE.getId();\n boolean isPrecedingPhaseOpen = (precedingPhase.getPhaseStatus().getId() == PhaseStatus.OPEN.getId());\n boolean isPrecedingPhaseClosed = (precedingPhase.getPhaseStatus().getId() == PhaseStatus.CLOSED.getId());\n \n if (isFinalFixPreceding) {\n if (isPrecedingPhaseOpen) {\n this.viewData.setFinalFixStatus(FinalFixStatus.IN_PROGRESS);\n } else if (isPrecedingPhaseClosed) {\n Review[] reviewsByPhase =\n getProjectServices().getReviewsByPhase(contestId, lastPhase.getId());\n if (reviewsByPhase.length == 0) {\n this.viewData.setDataUnavailable(true);\n return;\n }\n Review finalReview = reviewsByPhase[0];\n \n Comment finalReviewComment = DirectUtils.getReviewCommentByTypeId(\n CommentType.COMMENT_TYPE_FINAL_REVIEW.getId(), finalReview);\n if (finalReviewComment == null) {\n this.viewData.setFinalFixStatus(FinalFixStatus.REVIEW);\n } else if (\"Rejected\".equalsIgnoreCase(String.valueOf(finalReviewComment.getExtraInfo()))) {\n if (finalReview.isCommitted()) {\n this.viewData.setFinalFixStatus(FinalFixStatus.IN_PROGRESS);\n } else {\n this.viewData.setFinalFixStatus(FinalFixStatus.REVIEW);\n }\n } else if (\"Approved\".equalsIgnoreCase(String.valueOf(finalReviewComment.getExtraInfo()))) {\n this.viewData.setFinalFixStatus(FinalFixStatus.COMPLETED);\n }\n }\n }\n\n // Bind data for all existing final fixes to view \n if (this.viewData.getFinalFixStatus() != FinalFixStatus.NOT_STARTED) {\n // Get the Final Fix submissions and convert them into map per project phase for faster lookup\n List<Submission> finalFixSubmissions = DirectUtils.getStudioContestSubmissions(contestId,\n ContestRoundType.STUDIO_FINAL_FIX_SUBMISSION, currentUser, getContestServiceFacade());\n Map<Long, Submission> finalFixSubmissionsMap = new HashMap<Long, Submission>();\n for (Submission finalFixSubmission : finalFixSubmissions) {\n finalFixSubmissionsMap.put(finalFixSubmission.getUpload().getProjectPhase(), finalFixSubmission);\n }\n\n List<StudioFinalFix> finalFixes = new ArrayList<StudioFinalFix>();\n for (int i = 0; i < phases.length; i++) {\n Phase phase = phases[i];\n if (phase.getPhaseType().getId() == PhaseType.FINAL_FIX_PHASE.getId()) {\n Review[] reviewsByPhase =\n getProjectServices().getReviewsByPhase(contestId, phases[i + 1].getId());\n if (reviewsByPhase.length == 0) {\n this.viewData.setDataUnavailable(true);\n return;\n }\n Review finalReview = reviewsByPhase[0];\n StudioFinalFix finalFix = new StudioFinalFix();\n Item[] finalReviewItems = finalReview.getAllItems();\n List<com.topcoder.direct.services.view.dto.contest.studio.Comment> finalFixComments\n = new ArrayList<com.topcoder.direct.services.view.dto.contest.studio.Comment>();\n Comment finalReviewAdditionalComment = null;\n for (Item item : finalReviewItems) {\n Comment[] itemComments = item.getAllComments();\n for (Comment itemComment : itemComments) {\n if (itemComment.getCommentType().getId() == CommentType.COMMENT_TYPE_REQUIRED.getId()) {\n com.topcoder.direct.services.view.dto.contest.studio.Comment com\n = new com.topcoder.direct.services.view.dto.contest.studio.Comment();\n com.setComment(itemComment.getComment());\n if (itemComment.getExtraInfo() != null) {\n com.setFixed(\"Fixed\".equalsIgnoreCase(String.valueOf(itemComment.getExtraInfo())));\n }\n finalFixComments.add(com);\n } else if (itemComment.getCommentType().getId() ==\n CommentType.COMMENT_TYPE_FINAL_REVIEW.getId()) {\n finalReviewAdditionalComment = itemComment;\n }\n }\n }\n finalFix.setComments(finalFixComments);\n if (finalReviewAdditionalComment != null) {\n finalFix.setAdditionalComment(finalReviewAdditionalComment.getComment());\n }\n finalFix.setSubmission(finalFixSubmissionsMap.get(phase.getId()));\n finalFix.setCommitted(finalReview.isCommitted());\n finalFixes.add(finalFix);\n }\n }\n this.viewData.setFinalFixes(finalFixes);\n }\n }\n }", "public static void acceptRecord( int choice, Project project) throws ParseException\n\t{\n\t\tif(choice == 3 || choice == 1){\n\t\t\tif(choice == 1){\n\t\t\t\tSystem.out.println(\"StudentID :\");\n\t\t\t\tproject.setStudentId(sc.nextInt());\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\tSystem.out.print(\" ID\t:\t\");\n\t\tproject.setID(sc.nextInt());\n\t\t\t}\n\t\t}\n\t\t\n\t\telse{\n\t\tSystem.out.print(\"ID\t:\t\");\n\t\tproject.setID(sc.nextInt());\n\t\t//System.out.print(\"StudentID \"\t);\n\t\t//sc.nextLine();\n\t\t//extracur.setStudentId(sc.nextInt());\n\t\tSystem.out.print(\"Team Size: \");\n\t\tproject.setTeamSize(sc.nextInt());\n\t\tSystem.out.print(\"Duration : \");\n\t\tproject.setDuration(sc.next());\n\t\tSystem.out.print(\"Technology: \");\n\t\tproject.setTechnology(sc.next());\n\t\tSystem.out.println(\"Title: \");\n\t\tproject.setTitle(sc.next());\n\t\tSystem.out.println(\"Descriptions: \");\n\t\tproject.setDescription(sc.next());\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t}\n\t\t}", "protected void screeningProcessing() throws TCWebException {\n try {\n DataAccessInt dAccess = Util.getDataAccess(Constants.DW_DATA_SOURCE, true);\n\n Request dr = new Request();\n dr.setContentHandle(\"coderProblemInfo\");\n dr.setProperty(\"cr\", getRequest().getParameter(Constants.USER_ID));\n dr.setProperty(\"rd\", getRequest().getParameter(Constants.ROUND_ID));\n dr.setProperty(\"pm\", getRequest().getParameter(Constants.PROBLEM_ID));\n\n Map map = dAccess.getData(dr);\n if (map == null)\n throw new ScreeningException(\"getData failed!\");\n\n ResultSetContainer result =\n (ResultSetContainer) map.get(\"coderProblemSolution\");\n if (result.getRowCount() == 0) {\n throw new ScreeningException(\"Error retrieving code submission.\");\n }\n\n SubmissionInfo sinfo = new SubmissionInfo();\n sinfo.setCode(result.getItem(0, \"submission_text\").toString());\n sinfo.setTestResults((ResultSetContainer) map.get(\"coderProblemTestResults\"));\n getRequest().setAttribute(\"submissionInfo\", sinfo);\n } catch (TCWebException e) {\n throw e;\n } catch (Exception e) {\n throw(new TCWebException(e));\n }\n\n setNextPage(Constants.TC_PROBLEM_RESULT_PAGE);\n setIsNextPageInContext(true);\n }", "public static void updateQuestionnaire() {\n\t\t\tint a = 1;\n\t\t\tJOptionPane.showMessageDialog(null,\"1.Gender\\n2.Last Name\\n3.First Name\\n 4.Father's Name\\n5.Year of Birth\\n6.Place of Birth\\n7.Profession\\n8.ID Number\\n9.Address\\n\"\n\t\t \t\t+ \" 10.PostCode\\n11.City\\n12.Phone Number\\n13.Have you ever gave blood before\\n14.When was the last time you gave blood?\\n\"\n\t\t \t\t+ \"15.excluded from a blood donation?\\n16.dangerous profession or hobby?\\n17.previous health problems?\\n\"\n\t\t \t\t+ \"18.jaundice or hepatitis\\n19.syphilis\\n20.malaria\\n21.tuberculosis\\n22.rheumatoid arthritis\\n23.heart disease\\n24.precardiac pan\\n25.hypertension\\n\"\n\t\t \t\t+ \"26.convulsions(as an adult)\\n27.fainting\\n28.stomach aliments\\n29.ulcer\\n30.other surgeries\\n31.kidney diseasea\\n32.diabetes\\n33.allergies\\n\"\n\t\t \t\t+ \"34.anemia\\n35.other diseasess\\n36.contagious diseases in your envirnment?\\n37.taken medicine?\\n\"\n\t\t \t\t+ \"38.take aspirin?\\n39.born or lived or traveled aboard?\\n40.lost weight, had fever or swollen tonsils?\\n\"\n\t\t \t\t+ \"41.cornea or scar implant in your eye?\\n42.Creutzfeldt-Jakob disease?\\n43.growth hormones?\\n\"\n\t\t \t\t+ \"44. tooth extraction or treatment the past week?\\n45.vaccines the past week?\\n46.surgery or medical examinations the past year?\\n\"\n\t\t\t\t+\"47.transfusion of blood or blood producers?\\n48.tattoo or ear piercing or acupuncture?\\n\"\n\t\t \t\t+ \"49.pierced by a syringe needle\\n50.any skin wounds or scratches that came in contact with foreign blood?\\n\"\n\t\t \t\t+ \"51.were you pregnant the past year?\\n\");\n\t\t\tboolean g = true;\n\t\t\tdo {\n\t\t\t\ttry {\n\t\t\t\t\ta = Integer.parseInt(JOptionPane.showInputDialog(\"If you want to change a question press the number of the question or else press 0\"));\n\t \t \t\tif (a >= 1 && a <= 51) {\n\t \t\t \t\tg = false;\n\t \t\t \t\tchangeQuestion(a, username);\n\t \t \t\t} else if (a == 0) {\n\t \t\t \t\tg = true;\n\t \t\t \t\tHomeMenu.donorSecondMenu(username);\n\t \t\t \t} else {\n\t \t\t \t\tJOptionPane.showMessageDialog(null, \"Please enter a valid question number\",\"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t \t \t\t}\n\t \t \t} catch (NumberFormatException e) {\n\t \t\tJOptionPane.showMessageDialog(null, \"Please enter a number\",\"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t \t\tg = true;\n\t \t\t}\n\t\t\t} while (g);\t \n\t\t}", "public static void main(String[] args) throws SQLException {\n\t\tQuestionPaper qp1= new QuestionPaper();\n\t\t//\tSystem.out.println(\"Questions in database\"); \n\t\t//\tqp1.readDatabase();\n\t\t//\tSystem.out.println(\"********************************************************\");\n\t\t\t\t\n\t\tArrayList<String> questionSet1 = new ArrayList<String>(1);\n\t \tquestionSet1= qp1.getQuestionPaper(10);\n\t \tSystem.out.println(\"QuestionSet1\");\n\t System.out.println(questionSet1);\n\t System.out.println(\"********************************************************\");\n\t QuestionPaper qp2= new QuestionPaper();\n\t\tArrayList<ArrayList<String>> questionSet2 = new ArrayList<ArrayList<String>>(2);\n\t\tquestionSet2 = qp2.getQuestionSet(20,2);\n\t\tSystem.out.println(\"QuestionSet2\");\n\t\tfor (ArrayList<String> s:questionSet2) {\n\t\t\tSystem.out.println(s);}\n\t\tSystem.out.println(\"********************************************************\");\n\t QuestionPaper qp3= new QuestionPaper();\n\t ArrayList<ArrayList<String>> questionSet3 = new ArrayList<ArrayList<String>>(3);\n\t\tquestionSet3 = qp3.getQuestionSet(30,3);\n\t\tSystem.out.println(\"QuestionSet3\");\n\t\tfor (ArrayList<String> s:questionSet3) {\n \t \t System.out.println(s);\n\t }\n\t\n\t}", "private void displayTeams() {\n SwapTeamMembersController.calculateTeamConstraints();\n System.out.println(\"\\nTeams formed are:\");\n for (Team team: Team.allTeams) {\n System.out.println(Constraint.ANSI_GREEN + \"\\nThe team ID\\t\\t\\t\\t: \" + team.getTeamID() + Constraint.ANSI_RESET +\n \"\\nThe Project Assigned\\t: \" + team.getProjectAssigned().getProjectId() + \": \" + team.getProjectAssigned().getProjectTitle() +\n \"\\nThe team's fitness is\\t: \" + team.getTeamFitness());\n System.out.print(\"\\nThe Students IDs of students in this team are: \\n\");\n for (Student student: team.getStudentsInTeam()) {\n System.out.print(student.getId() + \"\\tName: \" + student.getFirstName() + \"\\t\\tGender : \" + student.getGender() + \"\\t\\tExperience : \" + student.getExperience() + \" years\\n\");\n }\n int j = 1;\n System.out.println(\"\\nConstraints met are (with weightage):\");\n for (Constraint c: team.getConstraintsMet()) {\n System.out.println(j + \". \" + c.getConstraintDescription() + \"\\t: \" + c.getWeightAge());\n j++;\n }\n }\n }", "public void display(){\n\t\tSystem.out.print(programGrade + \" \" + examGrade );\n\t\t\n\t\t\n\t}", "private void ShowPatientsActionPerformed(java.awt.event.ActionEvent evt) {\n String s = \"\";\n int c = 0;\n try {\n while (c < doc.length) {\n if (docNameBox.getText().equalsIgnoreCase(doc[c].name)) {\n s = doc[c].name + \" has these patients under him/her: \\n\" + doc[c].printPatientName(frame);\n break;\n } else {\n c++;\n }\n }\n } catch (NullPointerException e) {\n s = \"Doctor name not found, please add name\";\n }\n JOptionPane.showMessageDialog(null, s);\n }", "private void showStudentCourses()\r\n {\r\n \tString courseResponse = \"\";\r\n \tfor(Course course : this.getDBManager().getStudentCourses(this.studentId))\r\n \t{\r\n \t\tcourseResponse += \"Course Faculty: \" + course.getCourseName() + \", Course Number: \" + String.valueOf(course.getCourseNum()) + \"\\n\";\r\n \t}\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseResponse);\r\n \tthis.getClientOut().flush();\r\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\n\t\t\n\t ICCChamp2017();\n\t System.out.println(\"England\");\n\t FinalIndVsPAk();\n\t System.out.println(\"Finals India Lifted ICC 2017\");\n\t \n\t\tFirstUmpieRevire();\n\t\tSystem.out.println(\"Simon Taufel First Umpier Reviews the Score Board\");\n\t SecondUmpireReview();\n\t System.out.println(\"Billy Bowden Second Umpier Reviews the Score Board\");\n\t ThridUmpireReview();\n\t System.out.println(\"David Shepard Thrid Umpier Reviews the Score Board\");\n\t \n\t \n\t Firstcommentary();\n\t System.out.println(\"Ravi is the commentary\");\n\t Secondcommentary();\n\t System.out.println(\"Gavaskar is the commentary\");\n\t \n\t \n\t \n\t \n\t\t\n\t\t\n\t\tint Dhoni, Rahul, Sachin,Kholi;\n\t System.out.println(\"Enter four Batsman Score Display the Mini Score Of the Batsman \");\n\t in = new Scanner(System.in);\n\t \n\t \n\t \n\t \n\t Dhoni = in.nextInt();\n\t Kholi = in.nextInt();\n\t Rahul = in.nextInt();\n\t Sachin = in.nextInt();\n\t \n\t if ( Dhoni <= Kholi && Dhoni <= Rahul && Dhoni <= Sachin )\n\t System.out.println(\"Dhoni is the Mini Scored Btsmans.\");\n\t else\n\t \t if ( Kholi <= Dhoni && Kholi <= Rahul && Kholi <= Sachin )\n\t System.out.println(\"Kholi is the Min Scored Batsmans .\");\n\t else if ( Rahul <= Dhoni && Rahul <= Kholi && Rahul <= Sachin )\n\t System.out.println(\"Rahul is the Min Scored Batsmans.\");\n\t else if ( Sachin <= Dhoni && Sachin <= Kholi && Sachin <= Rahul ) \n\t \t System.out.println(\"Sachin is the Min Scored Batsmans.\"); \n\t else \n\t System.out.println(\"Every one Scored 0 Duck\");\n\t \n\t \n\t int Sami,Irfan, Jaffar,Imran;\n\t System.out.println(\"Enter four Blowers Who Taken Wickets Display the Mini Wickets Of the Match\");\n\t \n\t \n\t \n\t \n\t \n\t Sami = in.nextInt();\n\t Irfan = in.nextInt();\n\t Jaffar = in.nextInt();\n\t Imran = in.nextInt();\n\t \n\t if ( Sami <= Irfan && Sami <= Jaffar && Sami <= Imran )\n\t System.out.println(\"Sami is the Mini Scored Btsmans.\");\n\t else\n\t \t if ( Imran <= Irfan && Imran <= Jaffar && Imran <= Sami )\n\t System.out.println(\"Imran is the Min Scored Batsmans .\");\n\t else if ( Irfan <= Sami && Irfan <= Jaffar && Irfan <= Imran )\n\t System.out.println(\"Irfan is the Min Scored Batsmans.\");\n\t else if (Jaffar <= Irfan && Jaffar <= Jaffar &&Jaffar <= Imran ) \n\t \t System.out.println(\"Jaffar is the Min Scored Batsmans.\"); \n\t else \n\t System.out.println(\"No on Taken Wickets\");\n\t \n\t \n\t \n\t \n\t\t \n\t}", "public void displayCorrect(){\n textPane1.setText(\"\");\r\n generatePlayerName();\r\n textPane1.setText(\"GOOD JOB! That was the correct answer.\\n\"\r\n + atBatPlayer + \" got a hit!\\n\" +\r\n \"Press Next Question, or hit ENTER, to continue.\");\r\n SWINGButton.setText(\"Next Question\");\r\n formattedTextField1.setText(\"\");\r\n formattedTextField1.setText(\"Score: \" + score);\r\n }", "@Override\n\tpublic List<DisplayCriterion> displayDoc(List<Paragraph> ps) {\n\t\tList<DisplayCriterion> displaycriteria = new ArrayList<DisplayCriterion>();\n\t\tint i = 1;\n\t\tfor (Paragraph p : ps) {\n\t\t\tboolean ehrstatus = false;\n\t\t\tDisplayCriterion d = new DisplayCriterion();\n\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\tfor (Sentence s : p.getSents()) {\n\t\t\t\tsb.append(s.getDisplay());\n\t\t\t\tfor (Term t : s.getTerms()) {\n\t\t\t\t\tif (Arrays.asList(GlobalSetting.primaryEntities).contains(t.getCategorey())) {\n\t\t\t\t\t\tehrstatus = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\td.setCriterion(sb.toString());\n\t\t\td.setId(i++);\n\t\t\td.setEhrstatus(ehrstatus);\n\t\t\tdisplaycriteria.add(d);\n\t\t}\n\t\treturn displaycriteria;\n\t}", "public Professor professor() {\n ////\n return professor;\n }", "public static void main(String[] args) {\n\t\tint passes = 0;\t//通过人数\r\n\t\tint failuress = 0;\t//未通过人数\r\n\t\tint studentCounter = 1;\t//学生人数的计数器\r\n\t\tint result;\t//考试结果(1代表通过,2代表未通过)\r\n\t\t\r\n\t\tString input;\t//定义 接收用户输入的考试结果 的变量\r\n\t\tString output;\t//定义 输出最终分析结果 的变量\r\n\t\t\r\n\t\twhile (studentCounter <= 10) {\t//循环,学生人数不大于10时进入循环;否则退出循环\r\n\t\t\t\r\n\t\t\tinput = JOptionPane.showInputDialog(\"Enter result (1 = pass, 2 = fail)\");\t//在弹出框中输入考试结果,并赋值给input\r\n\t\t\t\r\n\t\t\tresult = Integer.parseInt(input);\t//将String类型的考试结果转换为int型,并赋值给result\r\n\t\t\t\r\n\t\t\tif (result == 1) { //if-else条件判断,result为1时执行if语句\r\n\t\t\t\tpasses = passes + 1;\t//通过考试的人数加1\r\n\t\t\t} else { //result不为1时执行else语句\r\n\t\t\t\tfailuress = failuress + 1;\t//未通过考试的人数加1\r\n\t\t\t}\t//if-else结束\r\n\t\t\t\r\n\t\t\tstudentCounter = studentCounter + 1;\t//学生人数值加1\r\n\t\t}\t//while结束\r\n\t\t\r\n\t\toutput = \" Passed:\" + passes + \"\\nFailed:\" + failuress;\t//给output变量赋值\r\n\t\t\r\n\t\tif (passes > 8) {\t//若通过考试的人数大于8执行if语句;否则不执行\r\n\t\t\toutput = output + \"\\nRaise Tuition\";\t//在output字符串后添加上“提高学费”\r\n\t\t\t\r\n\t\t}\t//if结束\r\n\t\t\r\n\t\tJOptionPane.showMessageDialog(null, output, \"Analysis of Examination Reults\", \r\n\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\t//在提示框中显示:通过考试的人数,未通过考试的人数,若通过人数超过8还要显示“提高学费”\r\n\t\t\r\n\t\tSystem.exit(0);\t//程序退出\r\n\t}", "public void finalDisplay()\n\t{\n\t\tString s1=null;\n\t\tif(!yes)\n\t\t{\n\t\t\tint sum=0;\n\t\t\tint j;\n\t\t\tSystem.out.println(\"Final Display algo1\");\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t{\n\t\t\t\tj=rowLabel[i];\t\t\t\n\t\t\t\tSystem.out.println(j);\n\t\t\t\tsum+=temp[i][j];\t\n\t\t\t}\n\t\t\ts1=\"Total Cost is: \"+sum;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint sum=0;\n\t\t\tSystem.out.println(\"Final Display algo2\");\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t{\n\t\t\t\tfor(int j=0;j<n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(matrix[i][j]==1)\n\t\t\t\t\t{\n\t\t\t\t\t\tsum+=temp[i][j];\n\t\t\t\t\t\trowLabel[i]=j;\n\t\t\t\t\t\tSystem.out.println(rowLabel[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ts1=\"Total Cost is: \"+sum;\n\t\t}\n\t\t\n\t\tJTable t = new JTable();\n testTable(t,noOfPeople+1);\n JScrollPane scrollPane = new JScrollPane(t); \n JOptionPane.showMessageDialog(null,scrollPane, s1, JOptionPane.INFORMATION_MESSAGE);\n\t}", "@Override\n public void display()\n {\n // Display the question text\n super.display();\n int choiceNumber = 0;\n // Display the answer choices\n for (int i = 0; i < m_choices.size(); i++) {\n choiceNumber = i + 1;\n System.out.println(choiceNumber + \": \" + m_choices.get(i));\n }\n }", "public static void facultyText(){\n\t\tSystem.out.println(\"Enter: 1.'EXIT' 2.'ADD' 3.'REMOVE' 4.'FIND' 5.'SCHEDULE' 6.'GRANTS' 7.'MORE' -for more detail about options\");\n\t}", "private static void assign_project() {\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\t//Print out all projects\r\n\t\t System.out.println(\"Choose a project to assign to a person\");\r\n\t\t\tString strSelectProject = String.format(\"SELECT * from projects;\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tSystem.out.println(\"Project ID: \" + project_rset.getInt(\"project_id\") + \r\n\t\t\t\t\t\t\"\\nProject Name: \" + project_rset.getString(\"project_name\") + \"\\n\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Runs until a project is chosen and the input can be parsed to an int\r\n\t\t\tBoolean project_chosen = true;\r\n\t\t\tint project_choice = 0;\r\n\t\t\twhile (project_chosen == true) {\r\n\t\t\t\tSystem.out.println(\"Project No: \");\r\n\t\t\t\tString project_choice_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tproject_choice = Integer.parseInt(project_choice_str);\r\n\t\t\t\t\tproject_chosen = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for project number is not an integer\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The project id cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Prints out all people types\r\n\t\t\tString[] people_types = new String[] {\"Customer\", \"Contractor\", \"Architect\", \"Project Manager\"};\r\n\t\t\tfor (int i = 0; i < people_types.length; i ++) {\r\n\t\t\t\tSystem.out.println((i + 1) + \". \" + people_types[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows user to select a person type and runs until the selected person type number can be parsed to an integer\r\n\t\t\tBoolean select_person_type = true;\r\n\t\t\tint person_type = 0;\r\n\t\t\tString person_type_str = \"\";\r\n\t\t\twhile (select_person_type == true) {\r\n\t\t\t\tSystem.out.println(\"Select a number for the person type you wish to assign the project to:\");\r\n\t\t\t\tperson_type_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tperson_type = Integer.parseInt(person_type_str);\r\n\t\t\t\t\tfor (int i = 1; i < people_types.length + 1; i ++) {\r\n\t\t\t\t\t\tif (person_type == i) { \r\n\t\t\t\t\t\t\tperson_type_str = people_types[i-1]; \r\n\t\t\t\t\t\t\tselect_person_type = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// If user selected a number that was not displayed\r\n\t\t\t\t\tif (select_person_type == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available person type number.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for project number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The person type number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Prints out all people of selected type\r\n\t\t\t\tString strSelectPeople = String.format(\"SELECT * FROM people WHERE type = '%s';\", person_type_str);\r\n\t\t\t\tResultSet people_rset = stmt.executeQuery(strSelectPeople);\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(person_type_str + \":\");\r\n\t\t\t\t\r\n\t\t\t\twhile (people_rset.next()) {\r\n\t\t\t\t\tSystem.out.println(\"System ID: \" + people_rset.getInt(\"person_id\") + \", Name: \" + people_rset.getString(\"name\") + \" \" + people_rset.getString(\"surname\"));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Allows user to select a person to assign the project to\r\n\t\t\t\tBoolean person_chosen = true;\r\n\t\t\t\tint person_choice = 0;\r\n\t\t\t\twhile (person_chosen == true) {\r\n\t\t\t\t\tSystem.out.println(\"Person No: \");\r\n\t\t\t\t\tString person_choice_str = input.nextLine();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tperson_choice = Integer.parseInt(person_choice_str);\r\n\t\t\t\t\t\tperson_chosen = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * @exception Throws exception if the users input for person_number is not a number\r\n\t\t\t\t\t */\r\n\t\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t\t System.out.println(\"The person id cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Updates the table\r\n\t\t\t\tPreparedStatement ps_assign = conn.prepareStatement(\r\n\t\t\t\t\t\t\"UPDATE people SET projects = ? WHERE person_id = ?;\");\r\n\t\t\t\tps_assign.setInt(1, project_choice);\r\n\t\t\t\tps_assign.setInt(2, person_choice);\r\n\t\t\t\tps_assign.executeUpdate();\r\n\t\t\t\tSystem.out.println(\"\\nAssigned Project\");\r\n\r\n\t\t/**\r\n\t\t * @exception When something cannot be retrieved from the database then an SQLException is thrown\t\r\n\t\t */\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}", "public void showRules(Application app){\n System.out.println(\"Here are your rules: \\n • GPA >= \" + app.getStand().getReqGPA() + \"\\n • SAT >= \" + app.getStand().getReqSAT() + \"\\n • A valid intended major, either aligned towards STEM or Humanities.\" + \"\\n • Three valid extracurriculars. \\n \\t • A valid extracurricular is defined as a productive use of time and/or a standout accomplishment. \\n \\t • It must align with the student's STEM or Humanities focus. \\n \\t • All three extracurriculars must be valid. \\n • A statement of purpose without spelling errors.\");\n System.out.println(\" • Students admitted to Harvard must have a passion for Humanities. Students admitted to MIT must have a passion for STEM. This can be determined through their intended major and extracurriculars, assuming both are valid.\");\n System.out.println(\" • All students with errors in their applications should be admitted to Greendale Community College.\");\n System.out.println();\n System.out.println(\"Good luck!\");\n }", "public static void main(String[] args){\n\t\tPersonalData data1= new PersonalData(1982,01,11,234567890);\n\t\tPersonalData data2= new PersonalData(1992,10,19,876543210);\n\t\tPersonalData data3= new PersonalData(1989,04,27,928374650);\n\t\tPersonalData data4= new PersonalData(1993,07,05,819463750);\n\t\tPersonalData data5= new PersonalData(1990,11,03,321678950);\n\t\tPersonalData data6= new PersonalData(1991,11,11,463728190);\n\t\tStudent student1=new Student(\"Ali Cantolu\",5005,50,data1);\n\t\tStudent student2=new Student(\"Merve Alaca\",1234,60,data2);\n\t\tStudent student3=new Student(\"Gizem Kanca\",5678,70,data3);\n\t\tStudent student4=new Student(\"Emel Bozdere\",8902,70,data4);\n\t\tStudent student5=new Student(\"Merter Kazan\",3458,80,data5);\n\n\t\t//A course (let us call it CSE141) with a capacity of 3 is created\n\t\tCourse CSE141=new Course(\"CSE141\",3);\n\n\t\t//Any 4 of the students is added to CSE141.\n\t\tif (!CSE141.addStudent(student1)) System.out.println(student1.toString()+ \" is not added\");\n\t\tif (!CSE141.addStudent(student2)) System.out.println(student2.toString()+ \" is not added\");\n\t\tif (!CSE141.addStudent(student3)) System.out.println(student3.toString()+ \" is not added\");\n\t\tif (!CSE141.addStudent(student4)) System.out.println(student4.toString()+ \" is not added\");\n\n\n\t\t//All students of CSE141 are printed on the screen.\n System.out.println(\"\\nAll students of \"+CSE141.getCourseName()+\": \");\n CSE141.list();\n\n //The capacity of CSE141 is increased.\n CSE141.increaseCapacity();\n\n //Remaining 2 students are added to CSE141.\n\t \tCSE141.addStudent(student4);\n\t \tCSE141.addStudent(student5);\n\n\t \t//All students of CSE141 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE141.getCourseName()+\": \");\n\t \tCSE141.list();\n\n\t \t//Student with ID 5005 is dropped from CSE141.\n\t \tCSE141.dropStudent(student1);\n\n\t \t//All students of CSE141 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE141.getCourseName()+\": \");\n\t \tCSE141.list();\n\n\t \t//Number of students enrolled to CSE141 is printed.\n\t \tSystem.out.println(\"\\nNumber of students enrolled to \"+CSE141.getCourseName()+\": \" + CSE141.getNumberOfStudents());\n\n\t \t//Birth year of best student of CSE141 is printed on the screen. (You should use getYear() method of java.util.Date class.)\n\t \tSystem.out.println(\"\\nBirth year of best student of CSE141 is \"+CSE141.getBestStudent().getPersonalData().getBirthDate().getYear());\n\n\t \t//A new course (let us call it CSE142) is created.\n\t \tCourse CSE142=new Course(\"CSE142\");\n\n\t \t//All students currently enrolled in CSE141 are added to CSE142. (You should use getStudents() method).\n\t \tStudent[] students = CSE141.getStudents();\n\t \tfor(int i=0;i<CSE141.getNumberOfStudents();i++)\n\t \t\tCSE142.addStudent(students[i]);\n\n\t \t//All students of CSE141 are removed from the course.\n\t \tCSE141.clear();\n\n\t \t//Student with ID 5005 is dropped from CSE141 and result of the operation is printed on the screen.\n\t \tSystem.out.println(\"\\nThe result of the operation 'Student with ID 5005 is dropped from \"+CSE141.getCourseName()+\"' is: \"+CSE141.dropStudent(student1));\n\n\t \t//All students of CSE142 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE142.getCourseName()+\": \");\n\t \tCSE142.list();\n\n\t \t//Best student of CSE142 is dropped from CSE142.\n\t \tCSE142.dropStudent(CSE142.getBestStudent());\n\n\t \t//All students of CSE142 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE142.getCourseName()+\": \");\n\t \tCSE142.list();\n\n\t \t//GPA of youngest student of CSE142 is printed on the screen.\n\t\tSystem.out.println(\"\\nThe Youngest Student's (\"+CSE142.getYoungestStudent()+\") GPA is \"+CSE142.getYoungestStudent().GPA());\n\n\t \t//Courses CSE141 and CSE142 are printed on the screen.\n\t \tSystem.out.println(\"\\nCourse Information for \"+CSE141.getCourseName()+\":\\n\" + CSE141.toString());\n\t \tSystem.out.println(\"\\nCourse Information for \"+CSE142.getCourseName()+\":\\n\" + CSE142.toString());\n\t }", "public void searchAndDisplay(Connection con) throws SQLException, NumberFormatException {\r\n //Declare and initialize all the variables\r\n //Get all the data from the fields and edit format with helper method\r\n String strCourseName = SearchHelper.searchHelper(getName());\r\n String strCourseTitle = SearchHelper.searchHelper(getTitle());\r\n String strCourseDepartment = SearchHelper.searchHelper(getDepartment());\r\n int intSID = getSID();\r\n String strSchoolName = SearchHelper.searchHelper(getSchoolName());\r\n\r\n ResultSet rsResults;\r\n JTable jtbResult;\r\n int intWidth;\r\n\r\n if (intSID == 0) {\r\n rsResults = Queries.searchCourse(con, strCourseName, strCourseTitle, strCourseDepartment, strSchoolName);\r\n jtbResult = Queries.ResultSetToJTable(rsResults);\r\n jtbResult.getColumnModel().getColumn(0).setPreferredWidth(50);\r\n jtbResult.getColumnModel().getColumn(1).setPreferredWidth(75);\r\n jtbResult.getColumnModel().getColumn(2).setPreferredWidth(100);\r\n jtbResult.getColumnModel().getColumn(3).setPreferredWidth(100);\r\n jtbResult.getColumnModel().getColumn(4).setPreferredWidth(50);\r\n jtbResult.getColumnModel().getColumn(5).setPreferredWidth(100);\r\n jtbResult.getColumnModel().getColumn(6).setPreferredWidth(100);\r\n jtbResult.getColumnModel().getColumn(7).setPreferredWidth(100);\r\n jtbResult.getColumnModel().getColumn(8).setPreferredWidth(100);\r\n jtbResult.getColumnModel().getColumn(9).setPreferredWidth(150);\r\n jtbResult.getColumnModel().getColumn(10).setPreferredWidth(50);\r\n intWidth = 975;\r\n } else {\r\n rsResults = Queries.searchCourseWithSID(con, strCourseName, strCourseTitle, strCourseDepartment, intSID);\r\n jtbResult = Queries.ResultSetToJTable(rsResults);\r\n jtbResult.getColumnModel().getColumn(0).setPreferredWidth(50);\r\n jtbResult.getColumnModel().getColumn(1).setPreferredWidth(75);\r\n jtbResult.getColumnModel().getColumn(2).setPreferredWidth(100);\r\n jtbResult.getColumnModel().getColumn(3).setPreferredWidth(100);\r\n jtbResult.getColumnModel().getColumn(4).setPreferredWidth(50);\r\n jtbResult.getColumnModel().getColumn(5).setPreferredWidth(100);\r\n jtbResult.getColumnModel().getColumn(6).setPreferredWidth(100);\r\n jtbResult.getColumnModel().getColumn(7).setPreferredWidth(100);\r\n jtbResult.getColumnModel().getColumn(8).setPreferredWidth(100);\r\n jtbResult.getColumnModel().getColumn(9).setPreferredWidth(50);\r\n intWidth = 825;\r\n }\r\n new PopUp(new JScrollPane(jtbResult), \"Results\", intWidth, 300);\r\n }", "public static void show() \r\n\t{\r\n\t\tJPanel panel = Window.getCleanContentPane();\r\n\t\t\r\n\t\tJPanel panel_1 = new JPanel();\r\n\t\tpanel_1.setBackground(SystemColor.inactiveCaption);\r\n\t\tpanel_1.setBounds(-11, 0, 795, 36);\r\n\t\tpanel.add(panel_1);\r\n\t\t\r\n\t\tJLabel lblNewLabel = new JLabel(\"Over Surgery System\");\r\n\t\tpanel_1.add(lblNewLabel);\r\n\t\tlblNewLabel.setFont(new Font(\"Tahoma\", Font.PLAIN, 20));\r\n\t\t\r\n\t\tJTable table = new JTable();\r\n\t\ttable.setBounds(25, 130, 726, 120);\r\n\t\tpanel.add(table);\r\n\t\t\r\n\t\tJLabel lblNewLabel1 = new JLabel(\"General Practictioner ID:\");\r\n\t\tlblNewLabel1.setBounds(25, 73, 145, 34);\r\n\t\tpanel.add(lblNewLabel1);\r\n\t\t\r\n\t\tJTextField textField = new JTextField();\r\n\t\ttextField.setBounds(218, 77, 172, 27);\r\n\t\tpanel.add(textField);\r\n\t\ttextField.setColumns(10);\r\n\t\t\r\n\t\tJButton btnNewButton = new JButton(\"Ok\");\r\n\t\tbtnNewButton.setBounds(440, 79, 57, 23);\r\n\t\tpanel.add(btnNewButton);\r\n\t\t\r\n\t\tJLabel lblNurseAvability = new JLabel(\"Nurse ID:\");\r\n\t\tlblNurseAvability.setBounds(25, 326, 112, 14);\r\n\t\tpanel.add(lblNurseAvability);\r\n\t\t\r\n\t\tJTextField textField_1 = new JTextField();\r\n\t\ttextField_1.setColumns(10);\r\n\t\ttextField_1.setBounds(233, 326, 172, 27);\r\n\t\tpanel.add(textField_1);\r\n\t\t\r\n\t\t\r\n\t\tJButton button = new JButton(\"Ok\");\r\n\t\tbutton.setBounds(440, 328, 57, 23);\r\n\t\tpanel.add(button);\r\n\t\t\r\n\t\tJTable table_1 = new JTable();\r\n\t\ttable_1.setBounds(25, 388, 726, 120);\r\n\t\tpanel.add(table_1);\r\n\t}", "public void printCourseDetails()\n {\n // put your code here\n System.out.println(\"Course \" + codeNo + \" - \" + title);\n }", "public static void Display (int Table_num) throws SQLException\n\t {\n\t\t try{\t\t\n\t\t\t//Declarations\n\t\t\tint flag =0; //to check if data is found or not\n\t\t\tString query = new String();\n\t\t\t\n \n\t\t\tif (Table_num ==1) \n\t \t\tquery = \"begin StudRegSys.show_students(:1); end;\" ;\n\t \telse if (Table_num == 2)\n\t \t\tquery = \"begin StudRegSys.show_classes(:1); end;\" ;\n\t \telse if (Table_num == 3)\n\t \t\tquery = \"begin StudRegSys.show_prerequisites(:1); end;\" ;\n\t\t\telse if (Table_num == 4)\n query = \"begin StudRegSys.show_enrollments(:1); end;\" ;\n else if (Table_num == 5)\n query = \"begin StudRegSys.show_courses(:1); end;\" ;\n\t \telse if (Table_num == 6)\n\t \t\tquery = \"begin StudRegSys.show_logs(:1); end;\" ;\n\t\t\telse if\t(Table_num == 7)\n\t\t\t\t{\n\t\t\t\t\tsearch_prerequisites();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\telse if\t(Table_num == 8)\n\t\t\t\t{\n\t\t\t\t \tstudents_info();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t/*else if (Table_num == 8)\n\t\t\t\tquery = \"begin StudRegSys.student_info(:1,:2,:3);end;\" ;*/\n\n//Connection to Oracle server\n OracleDataSource ds = new oracle.jdbc.pool.OracleDataSource();\n ds.setURL(\"jdbc:oracle:thin:@grouchoIII.cc.binghamton.edu:1521:ACAD111\");\n Connection conn = ds.getConnection(\"vbobhat1\", \"BingData\");\nCallableStatement cs = conn.prepareCall (query);\n\t \n\t \tcs.registerOutParameter(1,OracleTypes.CURSOR);\n\t \n\t \t//execute and retrieve the result set\n\t \tcs.execute();\n\t \tResultSet rs;\n\t\t\n\t \trs = (ResultSet)cs.getObject(1);\n\t \n\t \t// print the results for Show_students\n\t \tif(Table_num == 1){ \n\t\t\t\tSystem.out.println(\"SID\" + \"\\t\" + \"FIRSTNAME\" + \"\\t\" + \"LASTNAME\" + \"\\t\" + \"STATUS\" + \"\\t\" + \"\\t\" + \"GPA\" + \"\\t\" + \"\\t\" + \"EMAIL\");\n\t \t\tSystem.out.println(\"---\" + \"\\t\" + \"---------\" + \"\\t\" + \"--------\" + \"\\t\" + \"------\" + \"\\t\" + \"\\t\" + \"---\" + \"\\t\" + \"\\t\" + \"-----\");\n\t \t\twhile (rs.next()){\n\t \t\tflag=1; //indicates data found\n\t\t\t\tSystem.out.println(rs.getString(1) + \"\\t\" + rs.getString(2) + \"\\t\" + \"\\t\" + rs.getString(3) + \"\\t\" + \"\\t\" + rs.getString(4) + \"\\t\" + \"\\t\" \n+ rs.getFloat(5) + \"\\t\" + \"\\t\" + rs.getString(6));\n\t \t\t}\n\t \t}\n// print the results for Show_classes \n\t \telse if(Table_num == 2){ \n\t\t\t\tSystem.out.println(\"CLASSID\" + \"\\t\" + \"DEPT_CODE\" + \"\\t\" + \"COURSE#\" + \"\\t\" + \"SECT#\" + \"\\t\" + \"YEAR\" + \"\\t\" +\n\t \t\t\"SEMESTER\" + \"\\t\" + \"LIMIT\" + \"\\t\" + \"CLASS_SIZE\" );\n\t \t\tSystem.out.println(\"---\" + \"\\t\" + \"---------\" + \"\\t\" + \"-------\" + \"\\t\" + \"-----\" + \"\\t\" + \"----\" + \"\\t\" + \n\t\t\t\t\"--------\" + \"\\t\" + \"-----\" + \"\\t\" + \"----------\" );\n\t \t\t\t\n\t \t\twhile (rs.next())\n\t \t\t{\n\t \t\t\tflag=1; //indicates data found\n\t \t\t\tSystem.out.println(rs.getString(1) + \"\\t\" + rs.getString(2) + \"\\t\" + \"\\t\" + rs.getInt(3) + \"\\t\" + rs.getInt(4) + \"\\t\"+ rs.getInt(5) + \"\\t\" + rs.getString(6) + \"\\t\" +\"\\t\" + rs.getInt(7) + \"\\t\" + \"\\t\" + rs.getInt(8) ); \n\t \t\t}\n\t \t}\n\t\t\t// print the results for Show_Prerequities\n else if(Table_num == 3){\n System.out.println(\"DEPT_CODE\" + \"\\t\" + \"COURSE#\" + \"\\t\" + \"PRE_DEPT_CODE\" + \"\\t\" + \"PRE_COURSE#\");\n System.out.println(\"---------\" + \"\\t\" + \"-------\" + \"\\t\" + \"-------------\" + \"\\t\" + \"-----------\");\n while (rs.next())\n {\n flag=1; //indicates data found\n System.out.println(rs.getString(1) + \"\\t\" + \"\\t\" + rs.getInt(2) + \"\\t\" + rs.getString(3) + \"\\t\" + \"\\t\" + rs.getInt(4));\n }\n }\n\t \t// print the results for Show_enrollment\n\t \telse if(Table_num == 4){ \n\t\t\t\tSystem.out.println(\"SID\" + \"\\t\" + \"CLASSID\" + \"\\t\" + \"LGRADE\");\n\t \t\tSystem.out.println(\"---\" + \"\\t\" + \"-------\" + \"\\t\" + \"------\");\n\t \t\twhile (rs.next())\n\t \t\t{\n\t \t\t\tflag=1; //indicates data found\n\t \t\t\tSystem.out.println(rs.getString(1) + \"\\t\" + rs.getString(2)+ \"\\t\" + rs.getString(3));\n\t \t\t}\n\t \t}\n\t\t\t// print the results for Show_courses\n else if(Table_num == 5){\n System.out.println(\"DEPT_CODE\" + \"\\t\" + \"COURSE#\" + \"\\t\" + \"\\t\" + \"TITLE\" );\n System.out.println(\"---------\" + \"\\t\" + \"-------\" + \"\\t\" + \"\\t\" + \"-----\" );\n while (rs.next())\n {\n flag=1; //indicates data found\n System.out.println(rs.getString(1) + \"\\t\" + \"\\t\" + rs.getInt(2)+ \"\\t\" + \"\\t\" + rs.getString(3));\n }\n }\n\t \t// print the results for Show_logs\n\t \telse if(Table_num == 6){ \t\n\t\t\t\tSystem.out.println(\"LOGID\" + \"\\t\" + \"WHO\" + \"\\t\" + \"\\t\" + \"TIME\" + \"\\t\" + \"\\t\" + \"TABLE_NAME\" +\"\\t\" + \"OPERATION\" + \"\\t\" + \"KEY_VALUE\" );\n\t \t\tSystem.out.println(\"-----\" + \"\\t\" + \"---\" + \"\\t\" + \"\\t\" + \"----\" + \"\\t\" + \"\\t\" + \"----------\" + \"\\t\" + \"---------\" + \"\\t\" + \"---------\");\n\t \t\twhile (rs.next()){\n\t \t\t\tflag=1; //indicates data found\n System.out.println(rs.getInt(1) + \"\\t\" + rs.getString(2) +\"\\t\" + rs.getTime(3)+ \"\\t\" + rs.getString(4) + \"\\t\"+ rs.getString(5)+ \"\\t\" + \"\\t\" + rs.getString(6));\n\t \n\t \t\t}\n\t\t\t} \n\t\t\n\n\t \n\t\t\t//Indicates that no data was found\n\t\t\tif (flag== 0) \n\t\t\t\tSystem.out.println (\"No data found\");\n\t\t\n\t \t//close the result set, statement, and the connection\n\t \trs.close();\n\t \tcs.close();\n\t \tconn.close();\n\t \n\t \t System.out.println(\"\\n\\n\");\n\n\t }\ncatch (SQLException ex) { System.out.println (\"\\n*** SQLException caught ***\\n\" + ex.getMessage());}\n catch (Exception e) {System.out.println (\"\\n*** other Exception caught ***\\n\");}\n }", "protected void secondStep() {\r\n panel.add(h3(new InlineHTML(\"EXPERIENCE:\")));\r\n panel.add(new InlineHTML(\"Please provide your assessment\"\r\n + \" of your health professional's experience level at treating this disease.\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"experience\", null, \"<br/>\",//\r\n \"Specialist\", \"<b>Specialist</b> - This person specializes in treating ME/CFS;\"\r\n + \" most of her/his patients have chronic fatigue syndrome.\",//\r\n \"Knowledgeable\", \"<b>Knowledgeable</b> - The 'Knowledgeable' may not specialize\"\r\n + \" in chronic fatigue syndrome (ME/CFS)\"\r\n + \" but these patients make up a significant portion of her/his practice.\",//\r\n \"Informed\", \"<b>Informed</b> - Chronic fatigue syndrome (ME/CFS)\"\r\n + \" is not a major part of this person's practice\"\r\n + \" but they appear to be knowledgeable about the disease and its treatment options.\",//\r\n \"Learner\", \"<b>Learner</b> - The 'Learner' does not treat\"\r\n + \" many chronic fatigue syndrome (ME/CFS) patients\"\r\n + \" but is willing to learn and listen to and review patient suggestions.\",//\r\n \"Uninformed\", \"<b>Uninformed</b> - The 'Uninformed' practitioner\"\r\n + \" doesn't know much about the disease and is not interested.\",//\r\n \"Skeptic\", \"<b>Skeptic</b> - The 'Skeptic' practitioner\" + \" does not believe ME/CFS exists\"\r\n + \" and appears to take its existence as a personal affront.\",//\r\n \"-\", \"<b>I don't know</b>\"));\r\n\r\n panel.add(h3(new InlineHTML(\"INITIAL COST:\")));\r\n panel.add(new InlineHTML(\r\n \"Since costs can vary greatly even for patients seeing the same health professional\"\r\n + \" - depending on the treatment regimen -\"\r\n + \" we'd like to know the approximate initial costs of seeing your health professional.\"\r\n + \" This includes the approximate fees for the first two visits;\"\r\n + \" the costs of the laboratory workup and whatever medications were prescribed.\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"initialCost\", null, \"<br/>\", \"<$100\", \"Less than $100\", \"$100-$500\", \"$100-$500\",\r\n \"$500-$1000\", \"$500-$1,000\", \"$1000-$2000\", \"$1.000-$2.000\", \"$2000-$5000\", \"$2,000-$5,000\",\r\n \">$5000\", \"&gt;$5,000\", \"NotSure\", \"Not Sure\"));\r\n\r\n panel.add(h3(new InlineHTML(\"COST:\")));\r\n panel\r\n .add(new InlineHTML(\"Average 6 months cost\"\r\n + \" - please include doctor's visits, tests and treatment program.\"\r\n + \" Please do not include travel\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"averageCost\", null, \"<br/>\", //\r\n \"<600\", \"Less than $600 (>$100/month)\", //\r\n \"600-1200\", \"$600-$1200 ($100-$200/month)\", //\r\n \"1200-2400\", \"$1200-$2400 ($200-400/month)\", //\r\n \"2400-4800\", \"$2400-$4800 ($400-$800/month)\", //\r\n \">4800\", \">$4800 (>$800/month)\"));\r\n\r\n panel.add(h3(new InlineHTML(\"ACCEPTS INSURANCE?\")));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"insurance\", \"-\", \"<br/>\", \"Yes\", \"Yes\", \"No\", \"No\", \"-\", \"Don't Know\"));\r\n\r\n panel.add(h3(new InlineHTML(\"AVERAGE LENGTH OF VISIT (not including the first two sessions):\")));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"visitLength\", null, \"<br/>\", \"<15m\", \"Less than 15 minutes\", \"15m-30m\",\r\n \"15 to 30 minutes\", \"30m-1h\", \"30 minutes to an hour\", \">1h\", \"Greater than an hour\"));\r\n\r\n panel.add(h3(new InlineHTML(\"About how many times do you physically see this practitioner a year?\")));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"visitFrequency\", null, \"<br/>\", //\r\n \"1\", \"1\", //\r\n \"2\", \"2\", //\r\n \"3-7\", \"3-7\", //\r\n \"7-12\", \"7-12\", //\r\n \">12\", \">12 times a year\"));\r\n\r\n panel.add(h3(new InlineHTML(\"TREATMENT BREADTH -\")));\r\n panel.add(new InlineHTML(\"This practitioner provides <b>significant</b> information on:\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(ratingBox(\"treatmentBreadth\", \"drugs\", \"Pharmaceutical Drugs\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(ratingBox(\"treatmentBreadth\", \"alternativeTreatments\",\r\n \"Alternative Treatments (vitamins, neutraceuticals, etc.)\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(ratingBox(\"treatmentBreadth\", \"lifestyle\",\r\n \"Lifestyle Management (envelope therapy, pacing, sleep hygiene, behavioral therapies, etc.)\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n\r\n panel.add(h3(new InlineHTML(\"MEDICATION PURCHASING\")));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"ripoff\", \"No\", \"<br/>\", \"Yes\",\r\n \"Practitioner requires that patients buy alternative medications/neutraceuticals from her/him\", \"No\",\r\n \"Practitioner allows patients to buy alternative medications/neutraceuticals from outside sources\"));\r\n\r\n panel.add(h3(new InlineHTML(\"OFFICE MANAGEMENT AND ORGANIZATION\")));\r\n panel.add(new HTML(\"Please rate on scale from 1-5 how well organized this practitioners office was\"\r\n + \" (1 = chaotic, 5 = humming like a well-oiled machine).\"\r\n + \" This applies to such things as scheduling, receiving test results on time,\"\r\n + \" getting documents to and from the practitioner, etc.\"));\r\n panel.add(radioNumeric(\"organization\", 1, 5));\r\n\r\n panel.add(h3(new InlineHTML(\"AVAILABILITY\")));\r\n panel\r\n .add(new HTML(\r\n \"Please rate on a scale from 1-5 how available was the practitioner to you\"\r\n + \" (1= not available outside of office visits, 5= quick response)?\"\r\n + \" Did they respond in a timely manner to request and questions or did you have to wait, wait, wait....?\"));\r\n panel.add(radioNumeric(\"availability\", 1, 5));\r\n\r\n final Command verifier = new Command() {\r\n @Override public void execute() {\r\n if (rating.getField(\"experience\") == null) {\r\n final HTML html = new HTML(\r\n \"<span style='color: red; font-size: larger'>Please assess the experience level! Thanks.</span>\");\r\n panel.add(html);\r\n Document.get().setScrollTop(\r\n html.getAbsoluteTop() + html.getOffsetHeight() - Window.getClientHeight());\r\n throw new CommandCanceledException(this);\r\n }\r\n }\r\n };\r\n panel.add(wizardNavigation(verifier));\r\n }", "public void display() {\r\n String kind;\r\n if (profit == true) {\r\n kind = \"profit\";\r\n }\r\n\r\n else kind = \"non-profit\";\r\n System.out.println(name + \" is a \" + kind + \" organization that has\" + \" \" + revenue + \" dollars in revenue\" );\r\n }", "public String reviewProjectSubmissionQuery(String pID) \r\n\t{\r\n\t\tString query = \"SELECT * FROM SubmittedProject WHERE ProjectID=\\\"\"+pID+\"\\\"\";\r\n\t\tSystem.out.println(query);\r\n\t\treturn query;\r\n\t}", "public void fillSurvey(String disciplineName, String projectName, int hours, \n String comment) throws NoSubmissionException, NoSuchSurveyException {\n Student _student = getStudent();\n _student.fillSurvey(disciplineName, projectName, hours, comment); \n }", "private void displaySchalorship() {\n\n for (Scholarship scholarship : scholarshipDatabase) {\n\n stdOut.println(scholarship.toString() + \"\\n\");\n\n }\n }", "public void myresult(Admin admin, Teacher teacher) {\n\t\tsubject_list = admin.subject();\n\t\tmap = teacher.getStmarks();\n\t\tSystem.out.println(\" Enter your id:\");\n\n\t\ttry {\n\n\t\t\tid = student_input.nextInt(); // to get student id\n\n\t\t\tString value = map.get(id).toString(); /*\n\t\t\t\t\t\t\t\t\t\t\t\t\t * to remove braces [] because it prints direct list object\n\t\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\tvalue = value.substring(1, value.length() - 1);\n\t\t\tSystem.out.println();\n\n\t\t\tfor (int i = 0; i < subject_list.size(); i++) {\n\n\t\t\t\tSystem.out.print(subject_list.get(i) + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(value); // prints the marks in different subjects\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"problem with student result..\" + e); // for runtime exception\n\t\t}\n\t}", "public void showQuestion(int i) {\n i--;\n VocabularyQuiz question = gui.getQuiz().viewQuiz(i);\n JLabel header = new JLabel(\"Question\" + (i + 1));\n gui.getConstraints().insets = new Insets(10, 10,40,10);\n header.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 28));\n gui.getConstraints().gridx = 0;\n gui.getConstraints().gridy = 0;\n gui.getPanel().add(header, gui.getConstraints());\n JTextArea description = new JTextArea(\"What is meaning of \\\"\" + question.getVocabulary().getVocab() + \"\\\"?\");\n description.setEditable(false);\n description.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 18));\n gui.getConstraints().gridy = 1;\n gui.getPanel().add(description, gui.getConstraints());\n showChoices(question);\n }", "public void displayResults() {\n\t\tcreateCluster();\n\t\tassignClusterID();\n\t\tSystem.out.println(iterations);\n\t\tWriter writer;\n\t\ttry {\n\t\t\twriter = new FileWriter(\"/Users/saikalyan/Documents/ClusterResult_kmeans.txt\");\n\t\t\tfor (int key : labelsMap.keySet()) {\n\t\t\t\tclusterResultsList.add(clusterIdMap.get(labelsMap.get(key)));\n\t\t\t\twriter.write(String.valueOf(clusterIdMap.get(labelsMap.get(key))));\n\t\t\t\twriter.write(\"\\r\\n\");\n\t\t\t\tSystem.out.println(key + \" : \" + clusterIdMap.get(labelsMap.get(key)));\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tExternalValidator extValidation = new ExternalValidator(count, groundTruthList, clusterResultsList);\n\n\t\tfloat res = extValidation.getCoefficient();\n\t\tSystem.out.println(\"Rand Index------------\" + res);\n\n\t\tfloat jaccard = extValidation.getJaccardCoeff();\n\t\tSystem.out.println(\"Jaccard co-efficient------------\" + jaccard);\n\n\t}", "public String studentsDiscipline(String discipline) throws InvalidDisciplineException{ \n int id = _person.getId();\n Professor _professor = getProfessors().get(id);\n\n return _professor.studentsDiscipline(discipline);\n }", "public String printResults(Athletes competitor, Game gam){\n\t\tAthletes winner1 = gam.getWinner1();\n\t\tAthletes winner2 = gam.getWinner2();\n\t\tAthletes winner3 = gam.getWinner3();\n\t\t\n\t\t\t\tif(competitor == winner1){\n\t\t\t\t\tString data = (String.format(\n\t\t\t\t\t\t\t\"ID: %-15s \\t Name: %-25s \\t Time: %-4d seconds \\t Points earned: 5\", competitor.getID(),\n\t\t\t\t\t\t\tcompetitor.getName(), competitor.getTime()));\n\t\t\t\t\treturn data;\n\t\t\t\t}else if(competitor == winner2){\n\t\t\t\t\tString data = (String.format(\n\t\t\t\t\t\t\t\"ID: %-15s \\t Name: %-25s \\t Time: %-4d seconds \\t Points earned: 3\", competitor.getID(),\n\t\t\t\t\t\t\tcompetitor.getName(), competitor.getTime()));\n\t\t\t\t\treturn data;\n\t\t\t\t}else if(competitor == winner3){\n\t\t\t\t\tString data = (String.format(\n\t\t\t\t\t\t\t\"ID: %-15s \\t Name: %-25s \\t Time: %-4d seconds \\t Points earned: 1\", competitor.getID(),\n\t\t\t\t\t\t\tcompetitor.getName(), competitor.getTime()));\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t\t\tString data = (String.format(\n\t\t\t\t\t\t\t\"ID: %-15s \\t Name: %-25s \\t Time: %-4d seconds \\t Points earned: 0\", competitor.getID(),\n\t\t\t\t\t\t\tcompetitor.getName(), competitor.getTime()));\n\t\t\t\t\treturn data;\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public String getResult(){\n \tString result = \"OK\";\n System.out.print(this.mainQuery);\n Query query = QueryFactory.create(this.mainQuery);\n Query querycount = QueryFactory.create(this.countQuery);\n //System.out.println(this.countQuery);\n QueryExecution qexecCount = QueryExecutionFactory.create(querycount, Initialisation.getModel());\n QueryExecution qexec = QueryExecutionFactory.create(query, Initialisation.getModel());\n try{\n \torg.apache.jena.query.ResultSet results = qexec.execSelect();\n //////////////////////////\n org.apache.jena.query.ResultSet resultsCount = qexecCount.execSelect();\n \tint compteur = 0;\n while (resultsCount.hasNext()){\n QuerySolution soln = resultsCount.nextSolution();\n compteur = soln.getLiteral(\"count\").getInt();\n }\n //System.out.println(\"Compteur = \"+compteur );\n if(compteur>1){\n return \"NONE\";\n }\n else if (compteur==0){\n return \"NF\";\n }\n /////////////////////////\n \twhile (results.hasNext()){\n \t\tcompteur++;\n \t\tQuerySolution soln = results.nextSolution();\n \t\tLiteral title = soln.getLiteral(\"label\");\n \t\tLiteral comment = soln.getLiteral(\"comment\");\n \t\tthis.title = title.getString().replace(\"-\",\" \");\n \t\ttry{\n \t\tthis.comment = comment.getString();\n \t\t}\n \t\tcatch(NullPointerException e){\n \t\t\tthis.comment = \"There is not any summary available for this film.\";\n \t\t}\n \t}\n\n }\n finally{\n \tqexec.close();\n }\n \n return result;\n }", "public ArrayList<University> takeQuiz(String location, String characteristic, String control, String[] emphasis) {\n\t\tArrayList<University> personalMatches = new ArrayList<University>();\n\n\t\tif (location.equals(\"\") || control.equals(\"\") || characteristic.equals(\"\")) {\n\t\t\tthrow new IllegalArgumentException(\"Sorry, you must answer all questions\");\n\t\t} else {\n\t\t\tif (characteristic.equals(\"academic\")) {\n\n\t\t\t\tpersonalMatches = sfCon.search(\"\", \"-1\", location, -1, -1, (float) -1.0, (float) -1.0, -1, -1, -1, -1,\n\t\t\t\t\t\t-1, -1, (float) -1.0, (float) -1.0, -1, -1, (float) -1.0, (float) -1.0, (float) -1.0,\n\t\t\t\t\t\t(float) -1.0, 3, -1, -1, -1, -1, -1, emphasis, control);\n\t\t\t} else if (characteristic.equals(\"social\")) {\n\t\t\t\tpersonalMatches = sfCon.search(\"\", \"-1\", location, -1, -1, (float) -1.0, (float) -1.0, -1, -1, -1, -1,\n\t\t\t\t\t\t-1, -1, (float) -1.0, (float) -1.0, -1, -1, (float) -1.0, (float) -1.0, (float) -1.0,\n\t\t\t\t\t\t(float) -1.0, -1, -1, 3, -1, -1, -1, emphasis, control);\n\t\t\t} else if (characteristic.equals(\"qualityOfLife\")) {\n\t\t\t\tpersonalMatches = sfCon.search(\"\", \"-1\", location, -1, -1, (float) -1.0, (float) -1.0, -1, -1, -1, -1,\n\t\t\t\t\t\t-1, -1, (float) -1.0, (float) -1.0, -1, -1, (float) -1.0, (float) -1.0, (float) -1.0,\n\t\t\t\t\t\t(float) -1.0, -1, -1, -1, -1, 3, -1, emphasis, control);\n\t\t\t}\n\n\t\t}\n\n\t\tfor (int i = 0; i < personalMatches.size(); i++) {\n\t\t\tSystem.out.println(\"Match: \" + personalMatches.get(i).getName());\n\n\t\t}\n\t\treturn personalMatches;\n\t}", "public void showPortfolio(){\n System.out.println(\"PORTFOLIO CONTENTS\");\n for(int i = 0; i < this.projects.size(); i++){\n System.out.println(this.projects.get(i).elevatorPitch());\n }\n System.out.println(\"Total Portfolio Cost: $\" + this.getPortfolioCost());\n }", "private void showSponsorSearch(){\r\n String sponsorCode;\r\n// boolean replaceInfo = false;\r\n try{\r\n edu.mit.coeus.search.gui.CoeusSearch coeusSearch =\r\n new edu.mit.coeus.search.gui.CoeusSearch(dlgWindow,\r\n \"sponsorSearch\",1);\r\n coeusSearch.showSearchWindow();\r\n edu.mit.coeus.search.gui.SearchResultWindow resWindow =\r\n coeusSearch.getResultWindow();\r\n if (!coeusSearch.getSelectedValue().equals(null) ){\r\n txtSponsorCode.setText(coeusSearch.getSelectedValue());\r\n txtSponsorCode.requestFocusInWindow();\r\n sponsorCode = txtSponsorCode.getText();\r\n getSponsorInfo(sponsorCode);\r\n }\r\n }catch(Exception e) {\r\n }\r\n }", "private void scoreDialog() {\n JPanel jp = new JPanel();\n \n Box verticalBox = Box.createVerticalBox();\n \n JLabel scoreTitle = new JLabel(\"<html><font size=13><center>Score: \" + challengeModel.getChallenge().getScore().getScorePoints() + \"</center></font></html>\");\n scoreTitle.setAlignmentX(CENTER_ALIGNMENT);\n verticalBox.add(scoreTitle);\n \n Box horizontalBox = Box.createHorizontalBox();\n String scoreResult = \"\" + challengeModel.getChallenge().getScore().getGold() + challengeModel.getChallenge().getScore().getSilver() + challengeModel.getChallenge().getScore().getBronze();\n switch(Integer.parseInt(scoreResult)) {\n case 111: // Gold, Silver, Bronze\n horizontalBox.add(new JLabel(Resources.getImageMedalGold()));\n case 11: // Silver, Bronze\n horizontalBox.add(new JLabel(Resources.getImageMedalSilver()));\n case 1: // Bronze\n horizontalBox.add(new JLabel(Resources.getImageMedalBronze()));\n break;\n default:\n break;\n }\n \n verticalBox.add(horizontalBox);\n \n jp.add(verticalBox);\n \n int value = JOptionPane.showOptionDialog(null, jp, \"Fim do desafio\", JOptionPane.NO_OPTION, JOptionPane.PLAIN_MESSAGE, null, new String[] {\"Novo Desafio\"}, 1);\n \n hideAnswerResult(false);\n \n if (value == 0)\n challengeModel.newGame();\n }", "public static void showSportsman(Runner[] runners, int numberOfRunners) {\n\n System.out.println(\"спорстмены, результаты которых выше средней скорости по спортшколе\");\n for (int i = 0; i < numberOfRunners; i++) {\n if (runners[i].getAverageRun() > countAllAverage(runners, numberOfRunners)) {\n System.out.println(runners[i].toString());\n }\n\n }\n\n System.out.println(\"спорстмены, результаты которых ниже средней скорости по спортшколе\");\n\n for (int i = 0; i < numberOfRunners; i++) {\n if (runners[i].getAverageRun() <= countAllAverage(runners, numberOfRunners)) {\n System.out.println(runners[i].toString());\n }\n\n }\n\n\n }", "public static void main(String[] args){\n\t\tInterview interview = new Interview();\r\n\t\tinterview.loadCandidates();\r\n\t\tinterview.setupAndPrintCandidateData();\r\n\t\t\r\n\t\t// Test the Social Media Challenge\r\n\t\tMember m1 = new Member(\"A\",\"[email protected]\");\r\n\t\tMember m2 = new Member(\"B1\",\"[email protected]\");\r\n\t\tMember m3 = new Member(\"C1\",\"[email protected]\");\r\n\t\tMember m4 = new Member(\"D1\", \"[email protected]\");\r\n\t\tMember m5 = new Member(\"E2\",\"[email protected]\");\r\n\t\tMember m6 = new Member(\"F2\", \"[email protected]\");\r\n\t\tMember m7 = new Member(\"G2\", \"[email protected]\");\r\n\t\tMember m8 = new Member(\"H2\", \"[email protected]\");\r\n\t\tMember m9 = new Member(\"I2\", \"[email protected]\");\r\n\t\tMember m10 = new Member(\"J2\", \"[email protected]\");\r\n\t\tMember m11 = new Member(\"K2\", \"[email protected]\");\r\n\t\tMember m12 = new Member(\"L2\", \"[email protected]\");\r\n\t\tMember m13 = new Member(\"M2\", \"M2gmail.com\");\r\n\t\tMember m14 = new Member(\"N3\", \"[email protected]\");\r\n\t\tMember m15 = new Member(\"O3\", \"[email protected]\");\r\n\t\tMember m16 = new Member(\"P3\", \"[email protected]\");\r\n\t\tMember m17 = new Member(\"Q3\", \"[email protected]\");\r\n\t\tMember m18 = new Member(\"R3\", \"[email protected]\");\r\n\t\t \r\n\t\t// Add friends of M1.\r\n\t\tm1.AddFriend(m2);\r\n\t\tm1.AddFriend(m3);\r\n\t\tm1.AddFriend(m4);\r\n\t\t\r\n\t\t// Add m2 friends\r\n\t\tm2.AddFriend(m5);\r\n\t\tm2.AddFriend(m6);\r\n\t\tm2.AddFriend(m7);\r\n\t\t \r\n\t\t// Add m3 friends\r\n\t\tm3.AddFriend(m8);\r\n\t\tm3.AddFriend(m9);\r\n\t\tm3.AddFriend(m10);\r\n\t\t\r\n\t\t// Add m4 friends\r\n\t\tm4.AddFriend(m11);\r\n\t\tm4.AddFriend(m12);\r\n\t\tm4.AddFriend(m13);\r\n\t\t\r\n\t\t// Add m5 friends\r\n\t\tm5.AddFriend(m14);\r\n\t\tm5.AddFriend(m15);\r\n\t\tm5.AddFriend(m16);\r\n\t\t\r\n\t\t// Add m6 friends\r\n\t\tm6.AddFriend(m17);\r\n\t\tm6.AddFriend(m18);\r\n\t\t \r\n\t\tSocialMedia.printFriends(m1);\r\n\t}", "public ResultBoard() {\n initComponents();\n this.setTitle(\"Result Board\");\n this.setLocationRelativeTo(null);\n \n try{\n Connection con;\n Statement stmt;\n ResultSet rs;\n Class.forName(\"org.apache.derby.jdbc.ClientDriver\");\n con=DriverManager.getConnection(\"jdbc:derby://localhost:1527/C:/Users/Mashuk/.netbeans-derby/QUIZ\",\"quiz\",\"123\");\n stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);\n \n rs=stmt.executeQuery(\"select profile,correctanswer,wronganswer from APP.MARK\");\n int i = 0;\n String name[] = new String[100];\n int cAns[] = new int[100];\n int wAns[] = new int[100];\n \n while(rs.next()){\n name[i] = rs.getString(1);\n cAns[i] = Integer.parseInt(rs.getString(2));\n wAns[i] = Integer.parseInt(rs.getString(3));\n \n i++;\n }\n \n resultBoard.setText(\" Name\\tCorrect\\tWrong\\n\"\n + \" ------------------ ------------------- ----------------------\\n\");\n \n rs=stmt.executeQuery(\"select quizid from APP.QUIZ\");\n rs.last();\n int sum = Integer.parseInt(rs.getString(1));\n int n = 0;\n while(name[n]!=null){\n String total = \" \"+name[n]+\"\\t\"+cAns[n]+\"\\t\"+wAns[n]+\"\\n\";\n resultBoard.setText(resultBoard.getText()+total);\n n++;\n }\n }\n catch(Exception px)\n {\n// JOptionPane.showMessageDialog(null,px.getMessage());\n }\n }", "@Override\n\tpublic void printStudent() {\n\t\tSystem.out.print(\"학번\\t국어\\t영어\\t수학\\n\");\n\t\tSystem.out.println(\"=\".repeat(60));\n\t\tint nSize = scoreList.size();\n\t\tfor(int i = 0 ; i < nSize ; i++) {\n\t\t\tScoreVO vo = new ScoreVO();\n\t\t\tSystem.out.print(vo.getNum() + \"\\t\");\n\t\t\tSystem.out.print(vo.getKor() + \"\\t\");\n\t\t\tSystem.out.print(vo.getEng() + \"\\t\");\n\t\t\tSystem.out.print(vo.getMath() + \"\\n\");\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "private String displayResults(PetriNetView sourceDataLayer, File rgfile,\n\t\t\tdouble[] pi) {\n\t\tStateList tangiblestates; // This will hold all the tangible states\n\n\t\tStringBuilder s = new StringBuilder();\n\t\t// If there are greater than MAXSTATESTODISPLAY tangible state,\n\t\t// the results will be summarised\n\t\tfinal boolean FULLMODE = false; // Indicates that all results will be\n\t\t\t\t\t\t\t\t\t\t// displayed\n\t\tfinal boolean SUMMARYMODE = true; // Indicates that only a summary of\n\t\t\t\t\t\t\t\t\t\t\t// the results should be displayed\n\t\tfinal int MAXSTATESTODISPLAY = 100;\n\t\tboolean mode = FULLMODE;\n\n\t\t// First load all the tangible states into memory\n\t\ttry {\n\t\t\ttangiblestates = new StateList(rgfile, false);\n\t\t} catch (IOException e) {\n\t\t\t// s += e.getMessage();\n\t\t\ts.append(e.getMessage());\n\t\t\treturn s.toString();\n\t\t} catch (StateSpaceTooBigException e) {\n\t\t\t// s += e.getMessage();\n\t\t\ts.append(e.getMessage());\n\t\t\treturn s.toString();\n\t\t}\n\t\t// Now decide whether to summarise the results\n\n\t\tif (tangiblestates.size() > MAXSTATESTODISPLAY) {\n\t\t\tmode = SUMMARYMODE;\n\t\t}\n\n\t\ttry {\n\n\t\t\tFileWriter outFile = new FileWriter(output);\n\t\t\tPrintWriter out = new PrintWriter(outFile);\n\t\t\t/*\n\t\t\t * FileWriter fw = new FileWriter(\"someFile.txt\"); BufferedWriter bw\n\t\t\t * = new BufferedWriter(fw); PrintWriter pw = new PrintWriter(bw);\n\t\t\t */\n\t\t\tout.println(\"<html><head>\" + ResultsHTMLPane.HTML_STYLE\n\t\t\t\t\t+ \"</head><body>\");\n\t\t\tout.println(\"<h2>GSPN Steady State Analysis Results</h2><br>\");\n\n\t\t\tif (mode) {\n\t\t\t\tString states = \"<br>\" + \"There are \" + tangiblestates.size()\n\t\t\t\t\t\t+ \" tangible states. \";\n\t\t\t\ts.append(states);\n\t\t\t\tout.println(states);\n\t\t\t\ts.append(\"Only a summary of the results will be displayed.\");\n\t\t\t\ts.append(\"<br> For complete results see \").append(\n\t\t\t\t\t\toutput.getAbsolutePath());\n\t\t\t\ts.append(\"<br>\");\n\t\t\t}\n\n\t\t\tif (mode) {\n\t\t\t\trenderTangibleStates(sourceDataLayer, tangiblestates, out);\n\t\t\t\trenderPi(pi, tangiblestates, out);\n\t\t\t} else {\n\t\t\t\tString tangibles = renderTangibleStates(sourceDataLayer,\n\t\t\t\t\t\ttangiblestates);\n\t\t\t\ts.append(tangibles);\n\t\t\t\tout.println(tangibles);\n\t\t\t\tString p = renderPi(pi, tangiblestates);\n\t\t\t\ts.append(\"<br>\").append(p);\n\t\t\t\tout.println(\"<br>\" + p);\n\t\t\t}\n\n\t\t\tdouble[] averages = averageTokens(pi, tangiblestates);\n\t\t\tif (averages != null) {\n\t\t\t\tString avrgs = renderAverages(sourceDataLayer, averages);\n\t\t\t\ts.append(\"<br>\").append(avrgs);\n\t\t\t\tout.println(\"<br>\" + avrgs);\n\t\t\t}\n\n\t\t\tdouble[][] tokendist = tokenDistribution(pi, tangiblestates);\n\t\t\tif (tokendist != null) {\n\t\t\t\tString distribution = renderTokenDistribution(sourceDataLayer,\n\t\t\t\t\t\ttokendist);\n\t\t\t\ts.append(\"<br>\").append(distribution);\n\t\t\t\tout.println(\"<br>\" + distribution);\n\t\t\t}\n\n\t\t\tdouble[] throughput = getFastTransitionThroughput(sourceDataLayer,\n\t\t\t\t\ttangiblestates, pi);\n\t\t\tif (throughput != null) {\n\t\t\t\tString tThroughput = renderTimedTransitionThroughput(\n\t\t\t\t\t\tsourceDataLayer, throughput);\n\t\t\t\ts.append(\"<br>\").append(tThroughput);\n\t\t\t\tout.println(\"<br>\" + tThroughput);\n\t\t\t}\n\n\t\t\tdouble[] sojournTimes = calcSojournTime(sourceDataLayer,\n\t\t\t\t\ttangiblestates);\n\t\t\tif (sojournTimes != null) {\n\t\t\t\tif (mode) {\n\t\t\t\t\trenderSojournTimes(sojournTimes, tangiblestates, out);\n\t\t\t\t} else {\n\t\t\t\t\tString sTimes = renderSojournTimes(sojournTimes,\n\t\t\t\t\t\t\ttangiblestates);\n\t\t\t\t\ts.append(\"<br>\").append(sTimes);\n\t\t\t\t\tout.println(\"<br>\" + sTimes);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tout.println(\"</body></html>\");\n\t\t\tout.flush();\n\t\t\tout.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error writing to file\");\n\t\t}\n\n\t\treturn s.toString();\n\t}", "@Override\r\n\tpublic void showlist() {\n int studentid = 0;\r\n System.out.println(\"请输入学生学号:\");\r\n studentid = input.nextInt();\r\n StudentDAO dao = new StudentDAOimpl();\r\n List<Course> list = dao.showlist(studentid);\r\n System.out.println(\"课程编号\\t课程名称\\t教师编号\\t课程课时\");\r\n for(Course c : list) {\r\n System.out.println(c.getCourseid()+\"\\t\"+c.getCoursename()+\"\\t\"+c.getTeacherid()+\"\\t\"+c.getCoursetime());\r\n }\r\n \r\n\t}", "public static void main(String[] args){\n int studentId = promptUserForInt(\"Please enter your Student EMPLID (0 - 999999): \");\n double quiz1Percent = promptUserForDouble(\"Please enter your quiz1 percentage score(0.0 - 100.0): \");\n double quiz2Percent = promptUserForDouble(\"Please enter your quiz2 percentage score(0.0 - 100.0): \");\n double quiz3Percent = promptUserForDouble(\"Please enter your quiz3 percentage score(0.0 - 100.0): \");\n int ageInMonths = promptUserForInt(\"Please enter your age in months (0 - 1440): \");\n double tempC = promptUserForDouble(\"Please enter the current temperature in degrees Celsius: \");\n\n // Output results\n System.out.println(\"\\n\");\n System.out.println(\"*** Thank You ***\");\n System.out.println(\"Student EMPLID: \" + studentId);\n System.out.println(\"Quiz 1 Score: \" + quiz1Percent);\n System.out.println(\"Quiz 2 Score: \" + quiz2Percent);\n System.out.println(\"Quiz 3 Score: \" + quiz3Percent);\n System.out.println(\"Average Quiz Score: \" + averageQuizScore(quiz1Percent, quiz2Percent, quiz3Percent));\n System.out.println(\"Age in Months: \" + ageInMonths);\n System.out.println(\"Age in years: \" + convertAgeToYears(ageInMonths));\n System.out.println(\"Temperature in Celsius \" + tempC + \"\\u00b0\");\n System.out.println(\"Temperature in Fahrenheit \" + convertCelcToFahr(tempC) + \"\\u00b0\");\n\n }", "public void showChoices(VocabularyQuiz q) {\n ButtonGroup bg = new ButtonGroup();\n HashMap<String, Integer> choiceTable = new HashMap<String, Integer>();\n JPanel buttonArea = new JPanel(new GridBagLayout());\n gui.getConstraints().insets = new Insets(10,10,10,10);\n for (int i = 0; i < VocabularyQuiz.NUM_SELECT; i++) {\n String choice = q.getSelections().get(i);\n JRadioButton rb = new JRadioButton(choice);\n rb.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 13));\n rb.setBackground(Color.white);\n gui.getConstraints().gridy = i;\n buttonArea.add(rb, gui.getConstraints());\n rb.setActionCommand(choice);\n bg.add(rb);\n choiceTable.put(choice, i);\n }\n gui.getConstraints().gridy = 2;\n gui.getPanel().add(buttonArea, gui.getConstraints());\n JButton b = new JButton(\"submit\");\n gui.getConstraints().gridy = 3;\n gui.getConstraints().insets = new Insets(10,200,10,200);\n gui.getPanel().add(b, gui.getConstraints());\n QuizCheckerTool checker = new QuizCheckerTool(q.getAnswer());\n submitAnswerListener(b, choiceTable, bg, checker, q);\n }", "public String printChiSquareAnalysisPairedActivity()\n\t{\n\t\tStringBuilder toReturn = new StringBuilder();\n\n\t\ttoReturn.append(\"CHI-SQUARE ANALYSIS OF PAIRED ACTIVITY PATTERNS\\n\");\n\t\ttoReturn.append(\" H0: Species A and B have similar activity patterns at 95%\\n\");\n\t\ttoReturn.append(\" Significant = X, Not significant = Blank\\n\");\n\t\ttoReturn.append(\" Consider only species with >= 25 pictures\\n\");\n\n\t\ttoReturn.append(\" \");\n\t\tfor (Species species : analysis.getAllImageSpecies())\n\t\t{\n\t\t\ttoReturn.append(String.format(\"%-8s \", StringUtils.left(species.getName(), 8)));\n\t\t}\n\n\t\ttoReturn.append(\"\\n\");\n\n\t\tfor (Species species : analysis.getAllImageSpecies())\n\t\t{\n\t\t\tList<ImageEntry> imagesWithSpecies = new ImageQuery().speciesOnly(species).query(images);\n\t\t\tint totalImages = imagesWithSpecies.size();\n\t\t\tif (totalImages >= 25)\n\t\t\t{\n\t\t\t\ttoReturn.append(String.format(\"%-28s\", species.getName()));\n\t\t\t\tfor (Species other : analysis.getAllImageSpecies())\n\t\t\t\t{\n\t\t\t\t\tList<ImageEntry> imagesWithSpeciesOther = new ImageQuery().speciesOnly(other).query(images);\n\t\t\t\t\tint totalImagesOther = imagesWithSpeciesOther.size();\n\t\t\t\t\tdouble activitySimilarity = 0;\n\n\t\t\t\t\t// 24 hrs\n\t\t\t\t\tfor (int i = 0; i < 24; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tList<ImageEntry> imagesWithSpeciesAtTime = new ImageQuery().timeFrame(i, i + 1).query(imagesWithSpecies);\n\t\t\t\t\t\tList<ImageEntry> imagesWithSpeciesAtTimeOther = new ImageQuery().timeFrame(i, i + 1).query(imagesWithSpeciesOther);\n\t\t\t\t\t\tdouble numImages = imagesWithSpeciesAtTime.size();\n\t\t\t\t\t\tdouble numImagesOther = imagesWithSpeciesAtTimeOther.size();\n\t\t\t\t\t\tdouble frequency = numImages / totalImages;\n\t\t\t\t\t\tdouble frequencyOther = numImagesOther / totalImagesOther;\n\t\t\t\t\t\tdouble difference = frequency - frequencyOther;\n\t\t\t\t\t\t// Frequency squared\n\t\t\t\t\t\tactivitySimilarity = activitySimilarity + difference * difference;\n\t\t\t\t\t}\n\n\t\t\t\t\tdouble chiSquare = (1 - activitySimilarity) / 1.0;\n\n\t\t\t\t\tif (chiSquare >= 0.95 && imagesWithSpeciesOther.size() >= 25)\n\t\t\t\t\t\ttoReturn.append(\" X \");\n\t\t\t\t\telse\n\t\t\t\t\t\ttoReturn.append(\" \");\n\t\t\t\t}\n\t\t\t\ttoReturn.append(\"\\n\");\n\t\t\t}\n\t\t}\n\n\t\ttoReturn.append(\"\\n\");\n\n\t\treturn toReturn.toString();\n\t}", "private static void printResultsToConsole (List<Supplier> supplierData, ConsumerQuery query, Map<Supplier, Double> supplierScores, int numResults) throws IOException {\n\n\t\tMap<Supplier, Double> rankedResults = sortDescending(supplierScores);\n\n\t\tIterable<Entry<Supplier, Double>> firstEntries =\n\t\t\t\tIterables.limit(rankedResults.entrySet(), numResults);\n\n\t\t//below code is used for testing purposes\n\t\tSystem.out.println(\"Consumer query:\");\n\t\tint n = 1;\n\t\tfor (Process p : query.getProcesses()) {\n\t\t\tSystem.out.println(\"Process \" + n + \": \" + p.getName());\n\t\t\t\n\t\t\t//check if the query includes materials\n\t\t\tif (p.getMaterials() == null || p.getMaterials().isEmpty()) {\n\t\t\t\t//System.err.println(\"Note: No materials specified in the query!\");\n\t\t\t} else {\n\t\t\tfor (Material m : p.getMaterials()) {\n\t\t\t\tSystem.out.println(\" - Material: \" + m.getName());\n\t\t\t}\n\t\t\t}\n\t\t\tn++;\n\t\t}\n\t\t\n\t\t//check if the query includes certifications\n\t\tif (query.getCertifications() == null || query.getCertifications().isEmpty()) {\n\t\t\t//System.err.println(\"Note: No certifications specified in the query!\");\n\t\t} else {\n\t\tSystem.out.println(\"Certifications: \");\n\t\tfor (Certification c : query.getCertifications()) {\n\t\t\tSystem.out.println(c.getId());\t\t\t\n\t\t}\n\t\t}\n\n\t\t//get all processes for the suppliers included in the ranked list\n\t\tList<String> rankedSuppliers = new ArrayList<String>();\n\t\tfor (Entry<Supplier, Double> e : firstEntries) {\n\t\t\trankedSuppliers.add(e.getKey().getId());\n\t\t}\n\n\n\t\tSystem.out.println(\"\\nRanked results from semantic matching\");\n\t\tint ranking = 0;\n\n\n\t\tfor (Entry<Supplier, Double> e : firstEntries) {\n\t\t\tranking++;\n\t\t\tSystem.out.println(\"\\n\" + ranking + \"; Supplier ID: \" + e.getKey().getId() + \"; Sim score: \" + \"(\" + MathUtils.round(e.getValue(),4) + \")\");\n\n\t\t\tfor (Supplier sup : supplierData) {\n\t\t\t\tif (e.getKey().getId().equals(sup.getId())) {\n\n\t\t\t\t\tSystem.out.println(\"Processes:\");\n\t\t\t\t\tfor (Process pro : sup.getProcesses()) {\n\t\t\t\t\t\tSystem.out.println(pro.toString());\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(\"\\nCertifications:\");\n\t\t\t\t\tSet<String> certificationNames = new HashSet<String>();\n\t\t\t\t\tfor (Certification cert : sup.getCertifications()) {\n\t\t\t\t\t\tcertificationNames.add(cert.getId());\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(StringUtilities.printSetItems(certificationNames));\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\n\");\n\n\t\t}\n\n\t}", "public static void main(String[] args){\r\n String[] prompts = {\"Do you want to take a survey?\",\r\n \"Do you like yes or no questions?\",\r\n \"Will you continue answering these?\",\r\n \"Are you some kind of robot?\",\r\n \"Do you have special powers?\",\r\n \"Do you use them for good or for awesome?\",\r\n \"Will you use them on me?\"};\r\n int i;\r\n for (i = 0; i <= QUESTIONS && yesNoQuestion(prompts[i]); i++); \r\n if (i < 3) System.out.println(\"You are lame.\");\r\n else System.out.println(\"You are mildly cool.\");\r\n if (i >= 4) System.out.println(\"Actually, you're a cool robot.\");\r\n if (i >= 5) System.out.println(\"...with cool powers.\");\r\n if (i >= 6) System.out.println(\"Please use your powers on me!\");\r\n if (i >= 7) System.out.println(\"Ooh, that feels good.\");\r\n }", "public void finalDisplay1()\n\t{\n\t\tString s1=null;\n\t\tif(!yes)\n\t\t{\n\t\t\tint sum=0;\n\t\t\tint j;\n\t\t\tSystem.out.println(\"Final Display1 algo1\");\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t{\n\t\t\t\tj=rowLabel[i];\t\t\t\n\t\t\t\tsum+=temp[i][j];\t\n\t\t\t\tSystem.out.println(j);\n\t\t\t}\n\t\t\ts1=\"Total Cost is: \"+sum;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint sum=0;\n\t\t\tSystem.out.println(\"Final Display algo2\");\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t{\n\t\t\t\tfor(int j=0;j<n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(matrix[i][j]==1)\n\t\t\t\t\t{\n\t\t\t\t\t\tsum+=temp[i][j];\n\t\t\t\t\t\trowLabel[i]=j;\n\t\t\t\t\t\tSystem.out.println(rowLabel[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ts1=\"Total Cost is: \"+sum;\n\t\t}\n\t\t\n\t\tJTable t = new JTable();\n testTable(t,noOfPeople+1);\n JScrollPane scrollPane = new JScrollPane(t); \n JOptionPane.showMessageDialog(null,scrollPane, s1, JOptionPane.INFORMATION_MESSAGE);\n\t}", "public static void main(String[] args) {\n\t\tStudent ivan = new Student(\"Ivan Petrov\", \"Computer Science\");\n\t\tivan.grade=5.5;\n\t\tivan.yearInCollege=2;\n\t\tivan.money=500;\n\t\tivan.age=19;\n\t\t\n\t\tStudent teodor = new Student(\"Teodor Alexiev\", \"Computer Science\");\n\t\tteodor.grade=5.25;\n\t\tteodor.yearInCollege=3;\n\t\tteodor.money=300;\n\t\tteodor.age=20;\n\t\t\n\t\tStudent irina = new Student(\"Irina Paraskelova\", \"Computer Science\");\n\t\tirina.grade = 5.65;\n\t\tirina.money=400;\n\t\tirina.age=18;\n\t\t\n\t\tStudent vasilena = new Student (\"Vasilena Kremenlieva\", \"Computer Science\");\n\t\tvasilena.grade = 5.0;\n\t\tvasilena.money=1000;\n\t\tvasilena.age=18;\n\t\t\n\t\tStudent trifon = new Student(\"Trifon Stoimenov\", \"Computer Science\");\n\t\ttrifon.grade = 5.70;\n\t\ttrifon.yearInCollege=3;\n\t\ttrifon.money = 800;\n\t\ttrifon.age=21;\n\t\t\n\t\tStudent alexander = new Student (\"Alexander Dobrikov\", \"Finance\");\n\t\talexander.grade = 4.75;\n\t\talexander.yearInCollege = 2;\n\t\talexander.money = 600;\n\t\talexander.age = 20;\n\t\t\n\t\tStudent mirela = new Student (\"Mirela Kostadinova\", \"Finance\");\n\t\tmirela.grade = 5.5;\n\t\tmirela.yearInCollege=1;\n\t\tmirela.money=100;\n\t\tmirela.age=19;\n\t\t\n\t\tStudent velizar = new Student(\"Velizar Stoyanov\", \"Finance\");\n\t\tvelizar.grade = 6.0;\n\t\tvelizar.yearInCollege = 3;\n\t\tvelizar.money = 500;\n\t\tvelizar.age = 22;\n\t\t\n\t\tStudent antoaneta = new Student(\"Antoaneta Borisova\", \"Finance\");\n\t\tantoaneta.grade = 5.30;\n\t\tantoaneta.yearInCollege = 2;\n\t\tantoaneta.money = 750;\n\t\tantoaneta.age = 19;\n\t\t\n\t\tirina.upYear();\n\t\tSystem.out.println(\"Irina is in year \"+irina.yearInCollege+\" of college.\");\n\t\t\n\t\tvasilena.receiveScholarship(5.0, 350);\n\t\tSystem.out.println(vasilena.money);\n\t\t\n\t\tStudentGroup cs1 = new StudentGroup(\"Computer Science\");\n\t\tcs1.addStudent(ivan);\n\t\tcs1.addStudent(teodor);\n\t\tcs1.addStudent(irina);\n\t\tcs1.addStudent(vasilena);\n\t\tcs1.addStudent(trifon);\n\t\tteodor.upYear();\n\t\tSystem.out.println(teodor.isDegree);\n\t\t\n\t\tcs1.addStudent(velizar);\n\t\t\n\t\tcs1.printStudentsInGroup();\n\t\tSystem.out.println(cs1.theBestStudent());\n\t\t\n\t\tcs1.emptyGroup();\n\t\tcs1.printStudentsInGroup();\n\t\t\n\t\tStudentGroup fin1 = new StudentGroup(\"Finance\");\n\t\t\n\t\tfin1.addStudent(alexander);\n\t\tfin1.addStudent(mirela);\n\t\tfin1.addStudent(velizar);\n\t\tfin1.addStudent(antoaneta);\n\t\t\n\t\tfin1.printStudentsInGroup();\n\t\t\t\n\t\t\n\t}", "public void onDetailedInstructionsClicked(View view) {\n if (currentExerciseIndex >= 0 && currentExerciseIndex < workout.size()) {\n final Exercise exercise = workout.get(currentExerciseIndex);\n if (exercise != null) {\n StringBuilder sb = new StringBuilder();\n // first string in description is the title so start at 1\n for (int ii = 1; ii < exercise.description.length; ++ii) {\n sb.append(exercise.description[ii]);\n sb.append('\\n');\n }\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(exercise.description[0]);\n builder.setMessage(sb.toString());\n builder.create();\n builder.show();\n }\n }\n }", "private void displayCriteria(ArrayList<Criteria> criteria, State s) {\n\t\t// Removes all components\n\t\tfor (Component c : panelCriteria.getComponents())\n\t\t\tpanelCriteria.remove(c);\n\n\t\t// Sets the layout\n\t\tpCriteriaLayout = new BoxLayout(panelCriteria, BoxLayout.Y_AXIS);\n\t\tpanelCriteria.setLayout(pCriteriaLayout);\n\n\t\t/*\n\t\t * If the state is CLASS_COURSE_STUDENT_TASK it will show all the GUI buttons\n\t\t * and you can update the different grades in the different criteria, but if\n\t\t * it's the view with no assignment selected (s = CLASS_COURSE_STUDENT) then it\n\t\t * will just list the grades with out being able to change the grades.\n\t\t */\n\t\tif (s.equals(State.CLASS_COURSE_STUDENT_TASK)) {\n\t\t\t// Loops through the criteria.\n\t\t\tfor (var i = 0; i < criteria.size(); i++) {\n\t\t\t\t// Adds the action listeners\n\t\t\t\tJButton[] gradeBtns = criteria.get(i).getGradeBtns();\n\n\t\t\t\t// Removes old action listeners\n\t\t\t\tfor (var j = 0; j < gradeBtns.length; j++) {\n\t\t\t\t\t// If it's null print message to the console.\n\t\t\t\t\ttry {\n\t\t\t\t\t\tgradeBtns[j].removeActionListener(gradeBtns[j].getActionListeners()[0]);\n\t\t\t\t\t} catch (IndexOutOfBoundsException e) {\n\t\t\t\t\t\tSystem.out.println(\"[\" + LocalTime.now().getHour() + \":\" + LocalTime.now().getMinute() + \":\"\n\t\t\t\t\t\t\t\t+ ((LocalTime.now().getSecond() < 10) ? \"0\" + LocalTime.now().getSecond()\n\t\t\t\t\t\t\t\t\t\t: LocalTime.now().getSecond())\n\t\t\t\t\t\t\t\t+ \"] Skipped gradebtn -> IndexOutOfBounds: no action listeners attached\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Since it needs to be final or effectively final in lambda\n\t\t\t\tfinal int i2 = i;\n\n\t\t\t\t// Adds the action listeners\n\t\t\t\tgradeBtns[0].addActionListener((e) -> {\n\t\t\t\t\tbtnClicked(Grade.F, criteria.get(i2));\n\t\t\t\t});\n\n\t\t\t\tgradeBtns[1].addActionListener((e) -> {\n\t\t\t\t\tbtnClicked(Grade.E, criteria.get(i2));\n\t\t\t\t});\n\n\t\t\t\tgradeBtns[2].addActionListener((e) -> {\n\t\t\t\t\tbtnClicked(Grade.C, criteria.get(i2));\n\t\t\t\t});\n\n\t\t\t\tgradeBtns[3].addActionListener((e) -> {\n\t\t\t\t\tbtnClicked(Grade.A, criteria.get(i2));\n\t\t\t\t});\n\n\t\t\t\t// Adds the panel\n\t\t\t\tpanelCriteria.add(criteria.get(i).getPanelCriteria());\n\t\t\t}\n\t\t} else {\n\t\t\t// Adds the label\n\t\t\tpanelCriteria.add(lblNoTaskSelected);\n\n\t\t\t// Sets the font\n\t\t\tlblNoTaskSelected.setFont(new Font(\"DIALOG\", Font.BOLD, 30));\n\n\t\t\t// Clears the text of the label\n\t\t\t// And setup for the HTML formatting\n\t\t\tlblNoTaskSelected.setText(\"<html><table>\");\n\n\t\t\t// Loops through the list and appends the information.\n\t\t\tfor (int i = 0; i < criteria.size(); i++) {\n\t\t\t\t// Defines a table row\n\t\t\t\tString thisGrade = \"<tr>\";\n\n\t\t\t\t// Adds a new item to the table, which is the name of the criteria.\n\t\t\t\t// &emsp; adds some spacing (4 whitespaces)\n\t\t\t\tthisGrade += \"<td>&emsp;&emsp;\" + criteria.get(i).toString() + \":&emsp;</td>\";\n\n\t\t\t\t/*\n\t\t\t\t * Adds the grade in the specific criteria to the string, as a new item in the\n\t\t\t\t * table.\n\t\t\t\t *\n\t\t\t\t * <td> defines a new table item\n\t\t\t\t * \n\t\t\t\t * <span> makes a part of the text which should have special properties.\n\t\t\t\t * \n\t\t\t\t * <font color=aColor> sets the text color of this segement of code.\n\t\t\t\t *\n\t\t\t\t * ((criteria.get(i).getGrade().ordinal() == 0) ? \"red\" : \"lime\") decides which\n\t\t\t\t * color it is. If the ordinal of the grade is = 0 (Grade.F) has got that\n\t\t\t\t * ordinal, then it will append red to the string else it will append lime to\n\t\t\t\t * the string and therefore the letter will be lime when the grade is above F\n\t\t\t\t * else it will be red.\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\tthisGrade += \"<td><span><font color=\" + ((criteria.get(i).getGrade().ordinal() == 0) ? \"red\" : \"lime\")\n\t\t\t\t\t\t+ \">\" + criteria.get(i).getGrade().toString() + \"</font></span></td>\";\n\n\t\t\t\t/*\n\t\t\t\t * Adds some spacing between the lines.\n\t\t\t\t * \n\t\t\t\t * <br> is a line break\n\t\t\t\t */\n\t\t\t\tthisGrade += \"<br><br></tr>\";\n\n\t\t\t\t/*\n\t\t\t\t * It appends the information for the current grade to the string, by getting\n\t\t\t\t * the old text and setting the new text to the old text + the new text.\n\t\t\t\t */\n\t\t\t\tlblNoTaskSelected.setText(lblNoTaskSelected.getText() + thisGrade);\n\t\t\t}\n\n\t\t\t// Closes the HTML-tags\n\t\t\tlblNoTaskSelected.setText(lblNoTaskSelected.getText() + \"</table></html>\");\n\t\t}\n\n\t\t// Sets the layout\n\t\tpanel.setLayout(pLayout);\n\n\t\t// Adds the components\n\t\tpanel.add(panelCriteria);\n\n\t\t// Updates the GUI for every criteria.\n\t\tcriteria.forEach(Criteria::updateGUI);\n\n\t\tif (isListMode) {\n\t\t\t// Updates the sidebar\n\t\t\tupdateSidebar(this.s, this.t, criteria, this.state);\n\t\t} else {\n\t\t\t// Updates the sidebar.\n\t\t\tupdateSidebar(students.get(mf.getCurrentlySelectedStudentIndex()),\n\t\t\t\t\ttasks.get(mf.getCurrentlySelectedAssignmentIndex()), criteria, this.state);\n\t\t}\n\n\t\t// Updates the panel.\n\t\tthis.revalidate();\n\t\tthis.repaint();\n\t}", "void displayData(SchoolDetailResponse schoolDetailResponse);", "public List<Models.Programme> showProgrammes(String from) {\n // Get from all levels\n List<Models.Programme> results = em.createNativeQuery(\"select pg.* from programme pg, institution i, institutionparticipant ipa, participant p where pg.institutioncode = i.institutioncode and ipa.institutioncode = i.institutioncode and ipa.participantid = p.participantid and p.userid = ? and i.institutioncode = ?\", Models.Programme.class).setParameter(1, user.getUserid()).setParameter(2, from).getResultList();\n\n // Display the output\n String output = \"\";\n\n output = addChat(results.size() + \" programmes were found.\");\n\n for (Models.Programme programme : results) {\n output += \"<div class='result display' onclick=\\\"window.location.href='Programme?id=\" + programme.getProgrammecode() + \"'\\\">\\n\"\n + \" <div class='top'>\\n\"\n + \" <img class='icon' src='https://www.flaticon.com/svg/static/icons/svg/717/717874.svg'>\\n\"\n + \" <div class='text'>\\n\"\n + \" <a class='type'>PROGRAMME</a>\\n\"\n + \" <a class='name'>\" + programme.getTitle() + \"</a>\\n\"\n + \" <a class='subname'>\" + programme.getProgrammecode() + \"</a>\\n\"\n + \" </div>\\n\"\n + \" </div>\\n\"\n + \" </div>\";\n }\n\n servlet.putInJsp(\"result\", output);\n return results;\n }", "boolean contemProfessor(Professor p);", "public Professor getProfessor() {\r\n\t\treturn prof;\r\n\t}" ]
[ "0.6547866", "0.57404846", "0.56665933", "0.5651493", "0.5544259", "0.5543605", "0.5524573", "0.5473171", "0.5459851", "0.5452135", "0.54440606", "0.5433111", "0.5425562", "0.5421386", "0.5390738", "0.53676987", "0.5359882", "0.5356862", "0.535669", "0.5350741", "0.53466237", "0.5338792", "0.53352827", "0.5327794", "0.5325337", "0.5314295", "0.5310937", "0.5271534", "0.5269262", "0.5264726", "0.5262783", "0.52448297", "0.5240112", "0.52287596", "0.5215777", "0.520831", "0.5203548", "0.5198193", "0.5194829", "0.5187688", "0.5186139", "0.5181644", "0.5175566", "0.51716167", "0.51693803", "0.51669145", "0.51609486", "0.5160796", "0.515731", "0.5155493", "0.5153032", "0.5146997", "0.5140387", "0.51295716", "0.512559", "0.51244205", "0.51218516", "0.51213896", "0.510987", "0.51039135", "0.5098286", "0.5095678", "0.50939775", "0.5091571", "0.50892025", "0.50857", "0.50834346", "0.508216", "0.5080151", "0.50790864", "0.5075372", "0.50752956", "0.5068006", "0.5064689", "0.5063782", "0.5057511", "0.50544125", "0.50365216", "0.503236", "0.50275093", "0.50274533", "0.50155485", "0.5014755", "0.5013437", "0.50109744", "0.5006462", "0.5000134", "0.49971426", "0.49952388", "0.49892825", "0.49858677", "0.4981462", "0.49788186", "0.4970995", "0.4969533", "0.49684697", "0.49658442", "0.49636796", "0.49630845", "0.49629894" ]
0.67828745
0
Shows the submissions of the given project
public String projectSubmissions(String nameDiscipline, String nameProject) throws InvalidDisciplineException, InvalidProjectException{ Professor _professor = getProfessor(); return _professor.projectSubmissions(nameDiscipline, nameProject); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void onSubmit() {\r\n ProjectOverviewerApplication app = (ProjectOverviewerApplication)getApplication();\r\n \r\n // check if any field is missing\r\n boolean hasAllFields = true;\r\n if (this.projectName == null) {\r\n hasAllFields = false;\r\n error(\"Project name is required.\");\r\n }\r\n if (this.ownerName == null) {\r\n hasAllFields = false;\r\n error(\"Owner name is required.\");\r\n }\r\n if (this.password == null) {\r\n hasAllFields = false;\r\n error(\"Password is required.\");\r\n }\r\n if (this.svnUrl == null) {\r\n hasAllFields = false;\r\n error(\"The repository URL is required.\");\r\n }\r\n \r\n if (hasAllFields) {\r\n try {\r\n // check if the owner is a valid hackystat user\r\n String host = app.getSensorBaseHost();\r\n SensorBaseClient client = new SensorBaseClient(host, this.ownerName, this.password);\r\n client.authenticate();\r\n }\r\n catch (SensorBaseClientException e) {\r\n error(\"Owner is not valid Hackystat user or password does not match.\");\r\n }\r\n \r\n try {\r\n // check if the svn url is a valid google host url\r\n WebConversation wc = new WebConversation();\r\n WebResponse response = wc.getResponse(this.svnUrl);\r\n if (!response.getTitle().contains(\"Revision\")) {\r\n error(\"The repository URL is not a valid Google host repository URL.\");\r\n }\r\n }\r\n catch (Exception e) {\r\n error(\"Cannot connect to the repository URL.\");\r\n }\r\n \r\n // if there is no error, create the project and go back to the home page\r\n if (!hasError() && createProject()) {\r\n // redirect to the projects page\r\n setResponsePage(ProjectsPage.class);\r\n }\r\n else {\r\n error(\"The project cannot be created. \" +\r\n \"A project with the same name already exists, or some information are invalid.\");\r\n }\r\n }\r\n \r\n }", "@Override\r\n protected void executeAction() throws Exception {\r\n // get the submission of the project\r\n Submission[] submissions = getContestServiceFacade().getSoftwareProjectSubmissions(getCurrentUser(), projectId);\r\n // check whether the project contains the submission the user want to download\r\n for (Submission sub : submissions) {\r\n if (sub.getUpload() != null && sub.getId() == submissionId) {\r\n submission = sub;\r\n break;\r\n }\r\n }\r\n\r\n if (submission == null) {\r\n // the user can't download the upload which is not belongs to the project\r\n throw new Exception(\"Cannot find submission \" + submissionId + \" in project \" + projectId);\r\n }\r\n\r\n contest = getContestServiceFacade().getSoftwareContestByProjectId(getCurrentUser(), projectId);\r\n\r\n if (submission.getUpload().getUrl() == null) {\r\n if (DirectUtils.isStudio(contest)) {\r\n Long userId = null;\r\n String handle = null;\r\n for (Resource r : contest.getResources()) {\r\n if (r.getId() == submission.getUpload().getOwner()) {\r\n userId = r.getUserId();\r\n handle = r.getProperty(RESOURCE_PROPERTY_HANDLE);\r\n }\r\n }\r\n\r\n uploadedFile = studioFileUpload.getUploadedFile(DirectUtils.createStudioLocalFilePath(contest.getId(), userId, handle,\r\n submission.getUpload().getParameter()));\r\n } else {\r\n uploadedFile = fileUpload.getUploadedFile(submission.getUpload().getParameter());\r\n }\r\n } else {\r\n externalUrl = submission.getUpload().getUrl();\r\n }\r\n\r\n }", "public String reviewProjectSubmissionQuery(String pID) \r\n\t{\r\n\t\tString query = \"SELECT * FROM SubmittedProject WHERE ProjectID=\\\"\"+pID+\"\\\"\";\r\n\t\tSystem.out.println(query);\r\n\t\treturn query;\r\n\t}", "public abstract String enableSubmission(ISubmissionProject project);", "private void displayAllProjects() {\n for(Project projects: Project.totalProjects){\n projects.displayProject();\n System.out.println(\"Popularity\\t\\t: \" + projects.getPopularityCounter());\n }\n }", "@Override\n\t\t\tpublic void onClick()\n\t\t\t{\n\t\t\t\tretrieveProjectAndObject(dccdHit);\n\t\t\t\t// Note: could also give selected entity object!\n\t\t\t\tString selectedEntityId = object.getId();\n\n\t\t\t\tsetResponsePage(new ProjectViewPage(project, selectedEntityId));\n\t\t\t}", "@Override\n\t\t\tpublic void onClick()\n\t\t\t{\n\t\t\t\tretrieveProjectAndObject(dccdHit);\n\t\t\t\t// Note: could also give selected entity object!\n\t\t\t\tString selectedEntityId = object.getId();\n\n\t\t\t\tsetResponsePage(new ProjectViewPage(project, selectedEntityId));\n\t\t\t}", "public void displayProject(Project project) {\n\t\tSystem.out.println(project.getID() + \" \"\n\t\t\t\t+ project.getProjectName() + \" \"\n\t\t\t\t+ project.getStartDate() + \" \"\n\t\t\t\t+ project.getEndDate() + \" \"\n\t\t\t\t+ project.getPriority());\n\t}", "public ProjectViewController(){\n InputStream request = appController.httpRequest(\"http://localhost:8080/project/getProject\", \"GET\");\n try {\n String result = IOUtils.toString(request, StandardCharsets.UTF_8);\n Gson gson = new Gson();\n this.projectModel = gson.fromJson(result, ProjectModel.class);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic String getSubmissionText() {\n\t\treturn model.getSubmissionText();\n\t}", "@Override\n public void executeAction() throws Exception {\n ContestServiceFacade contestServiceFacade = getContestServiceFacade();\n TCSubject currentUser = DirectStrutsActionsHelper.getTCSubjectFromSession();\n\n // get contest data and phases\n long contestId = getProjectId();\n SoftwareCompetition softwareCompetition \n = contestServiceFacade.getSoftwareContestByProjectId(currentUser, contestId);\n\n // set dashboard data etc. for the data above the final-fix tab\n DirectUtils.setDashboardData(currentUser, getProjectId(), viewData,\n getContestServiceFacade(), !DirectUtils.isStudio(softwareCompetition));\n ContestStatsDTO contestStats = DirectUtils.getContestStats(currentUser, getProjectId(), softwareCompetition);\n this.viewData.setContestStats(contestStats);\n\n this.viewData.setContestId(getProjectId());\n\n // Prepare the data for final fixes\n Phase[] phases = softwareCompetition.getProjectPhases().getAllPhases();\n Phase lastPhase = phases[phases.length - 1];\n\n // get final fix status\n boolean isApproval = lastPhase.getPhaseType().getId() == PhaseType.APPROVAL_PHASE.getId();\n boolean isFinalReview = lastPhase.getPhaseType().getId() == PhaseType.FINAL_REVIEW_PHASE.getId();\n \n // Get the winning submission\n Submission winningSubmission = null;\n List<Submission> submissions = DirectUtils.getStudioContestSubmissions(contestId,\n ContestRoundType.FINAL, currentUser, getContestServiceFacade());\n for (Submission submission : submissions) {\n if (submission.getPlacement() != null && submission.getPlacement() == 1) {\n winningSubmission = submission;\n }\n }\n\n if (isApproval) {\n boolean isApprovalRejected = false;\n Review[] reviewsByPhase =\n getProjectServices().getReviewsByPhase(contestId, lastPhase.getId());\n if (reviewsByPhase.length == 0) {\n this.viewData.setDataUnavailable(true);\n return;\n }\n Review approvalReview = reviewsByPhase[0];\n Comment approvalComment = DirectUtils\n .getReviewCommentByTypeId(CommentType.COMMENT_TYPE_APPROVAL_REVIEW.getId(), approvalReview);\n if (approvalComment != null) {\n isApprovalRejected = \"Rejected\".equalsIgnoreCase(String.valueOf(approvalComment.getExtraInfo()));\n }\n if (isApprovalRejected) {\n if (approvalReview.isCommitted()) {\n this.viewData.setFinalFixStatus(FinalFixStatus.IN_PROGRESS);\n } else {\n this.viewData.setFinalFixStatus(FinalFixStatus.NOT_STARTED);\n \n // Bind the Final Fix details based on approval review to view\n StudioFinalFix finalFix = new StudioFinalFix();\n Item[] approvalReviewItems = approvalReview.getAllItems();\n List<com.topcoder.direct.services.view.dto.contest.studio.Comment> finalFixComments \n = new ArrayList<com.topcoder.direct.services.view.dto.contest.studio.Comment>();\n for (Item item : approvalReviewItems) {\n Comment[] itemComments = item.getAllComments();\n for (Comment itemComment : itemComments) {\n com.topcoder.direct.services.view.dto.contest.studio.Comment com\n = new com.topcoder.direct.services.view.dto.contest.studio.Comment();\n com.setComment(itemComment.getComment());\n finalFixComments.add(com);\n }\n }\n finalFix.setComments(finalFixComments);\n finalFix.setSubmission(winningSubmission);\n this.viewData.setFinalFixes(Arrays.asList(finalFix));\n \n // Get the details for winning submitter\n if (winningSubmission != null) {\n Resource[] resources = softwareCompetition.getResources();\n for (int i = 0; i < resources.length; i++) {\n Resource resource = resources[i];\n if (resource.getId() == winningSubmission.getUpload().getOwner()) {\n this.viewData.setWinnerResource(resource);\n }\n }\n }\n }\n } else {\n throw new DirectException(\"The submission is already approved\");\n }\n } else if (isFinalReview) {\n Phase precedingPhase = phases[phases.length - 2];\n boolean isFinalFixPreceding = precedingPhase.getPhaseType().getId() == PhaseType.FINAL_FIX_PHASE.getId();\n boolean isPrecedingPhaseOpen = (precedingPhase.getPhaseStatus().getId() == PhaseStatus.OPEN.getId());\n boolean isPrecedingPhaseClosed = (precedingPhase.getPhaseStatus().getId() == PhaseStatus.CLOSED.getId());\n \n if (isFinalFixPreceding) {\n if (isPrecedingPhaseOpen) {\n this.viewData.setFinalFixStatus(FinalFixStatus.IN_PROGRESS);\n } else if (isPrecedingPhaseClosed) {\n Review[] reviewsByPhase =\n getProjectServices().getReviewsByPhase(contestId, lastPhase.getId());\n if (reviewsByPhase.length == 0) {\n this.viewData.setDataUnavailable(true);\n return;\n }\n Review finalReview = reviewsByPhase[0];\n \n Comment finalReviewComment = DirectUtils.getReviewCommentByTypeId(\n CommentType.COMMENT_TYPE_FINAL_REVIEW.getId(), finalReview);\n if (finalReviewComment == null) {\n this.viewData.setFinalFixStatus(FinalFixStatus.REVIEW);\n } else if (\"Rejected\".equalsIgnoreCase(String.valueOf(finalReviewComment.getExtraInfo()))) {\n if (finalReview.isCommitted()) {\n this.viewData.setFinalFixStatus(FinalFixStatus.IN_PROGRESS);\n } else {\n this.viewData.setFinalFixStatus(FinalFixStatus.REVIEW);\n }\n } else if (\"Approved\".equalsIgnoreCase(String.valueOf(finalReviewComment.getExtraInfo()))) {\n this.viewData.setFinalFixStatus(FinalFixStatus.COMPLETED);\n }\n }\n }\n\n // Bind data for all existing final fixes to view \n if (this.viewData.getFinalFixStatus() != FinalFixStatus.NOT_STARTED) {\n // Get the Final Fix submissions and convert them into map per project phase for faster lookup\n List<Submission> finalFixSubmissions = DirectUtils.getStudioContestSubmissions(contestId,\n ContestRoundType.STUDIO_FINAL_FIX_SUBMISSION, currentUser, getContestServiceFacade());\n Map<Long, Submission> finalFixSubmissionsMap = new HashMap<Long, Submission>();\n for (Submission finalFixSubmission : finalFixSubmissions) {\n finalFixSubmissionsMap.put(finalFixSubmission.getUpload().getProjectPhase(), finalFixSubmission);\n }\n\n List<StudioFinalFix> finalFixes = new ArrayList<StudioFinalFix>();\n for (int i = 0; i < phases.length; i++) {\n Phase phase = phases[i];\n if (phase.getPhaseType().getId() == PhaseType.FINAL_FIX_PHASE.getId()) {\n Review[] reviewsByPhase =\n getProjectServices().getReviewsByPhase(contestId, phases[i + 1].getId());\n if (reviewsByPhase.length == 0) {\n this.viewData.setDataUnavailable(true);\n return;\n }\n Review finalReview = reviewsByPhase[0];\n StudioFinalFix finalFix = new StudioFinalFix();\n Item[] finalReviewItems = finalReview.getAllItems();\n List<com.topcoder.direct.services.view.dto.contest.studio.Comment> finalFixComments\n = new ArrayList<com.topcoder.direct.services.view.dto.contest.studio.Comment>();\n Comment finalReviewAdditionalComment = null;\n for (Item item : finalReviewItems) {\n Comment[] itemComments = item.getAllComments();\n for (Comment itemComment : itemComments) {\n if (itemComment.getCommentType().getId() == CommentType.COMMENT_TYPE_REQUIRED.getId()) {\n com.topcoder.direct.services.view.dto.contest.studio.Comment com\n = new com.topcoder.direct.services.view.dto.contest.studio.Comment();\n com.setComment(itemComment.getComment());\n if (itemComment.getExtraInfo() != null) {\n com.setFixed(\"Fixed\".equalsIgnoreCase(String.valueOf(itemComment.getExtraInfo())));\n }\n finalFixComments.add(com);\n } else if (itemComment.getCommentType().getId() ==\n CommentType.COMMENT_TYPE_FINAL_REVIEW.getId()) {\n finalReviewAdditionalComment = itemComment;\n }\n }\n }\n finalFix.setComments(finalFixComments);\n if (finalReviewAdditionalComment != null) {\n finalFix.setAdditionalComment(finalReviewAdditionalComment.getComment());\n }\n finalFix.setSubmission(finalFixSubmissionsMap.get(phase.getId()));\n finalFix.setCommitted(finalReview.isCommitted());\n finalFixes.add(finalFix);\n }\n }\n this.viewData.setFinalFixes(finalFixes);\n }\n }\n }", "@RequestMapping(\"/new\")\n\tpublic String displayProjectForm(Model model) {\n\t\tProject aproject = new Project();\n\t//Iterable<Employee> employees = \tpro.getall();\n\t\n\t\tmodel.addAttribute(\"project\", aproject);\n\n\t\t//model.addAttribute(\"allEmployees\", employees);\n\t\t\n\t\t\n\t\treturn \"newproject\";\n\t\t\n\t}", "public String toString() {\n return \"submission\";\n }", "public void displayResourcesAssignedToProject(Project project) {\n\n\t\tboolean done;\n\t\tResource resource;\n\n\t\tSystem.out.println(\"\\nResources assigned to: \" + \" \"\n\t\t\t\t+ project.getID() + \" \" + project.getProjectName() + \" :\");\n\t\tlineCheck(1);\n\n\t\tSystem.out\n\t\t\t\t.println(\"===========================================================\");\n\t\tlineCheck(1);\n\n\t\tproject.getResourcesAssigned().goToFrontOfList();\n\t\tdone = false;\n\n\t\twhile (!done) {\n\n\t\t\tresource = project.getResourcesAssigned().getNextResource();\n\n\t\t\tif (resource == null) {\n\n\t\t\t\tdone = true;\n\n\t\t\t} else {\n\n\t\t\t\tdisplayResource(resource);\n\n\t\t\t} // if\n\n\t\t} // while\n\n\t}", "public int getNumberSubmissions() {\n\t\treturn submissions.size();\n\t}", "@GetMapping(\"/showme/{name}\")\n\t@ResponseBody\n\tpublic Optional<Project> retrieveProjectsByName(@PathVariable(\"name\") String name){\n\t\tOptional<Project> t = projectrepository.findProjectByName(name);\n\t\treturn t;\n\t}", "List <ProjectAssignment> findAssignmentsByProject (int projectId);", "public List<ModelingSubmission> modelingSubmissionsForComparison(ModelingExercise exerciseWithParticipationsAndSubmissions) {\n return exerciseWithParticipationsAndSubmissions.getStudentParticipations().parallelStream().map(Participation::findLatestSubmission).filter(Optional::isPresent)\n .map(Optional::get).filter(submission -> submission instanceof ModelingSubmission).map(submission -> (ModelingSubmission) submission).collect(toUnmodifiableList());\n }", "@GetMapping(value=\"/getProjectDetails/completed\")\n\tpublic List<Project> getAllProjectDetails()\n\t{\n\t\treturn integrationClient.getProjectDetiails();\n\t}", "public String retrieveSubmittedProjectQuery(String username) \r\n\t{\r\n\t\tString query = \"SELECT * FROM SubmittedProject WHERE username=\\\"\"+username+\"\\\"\";\r\n\t\tSystem.out.println(query);\r\n\t\treturn query;\r\n\t}", "@GetMapping(\"/byName\")\r\n\tpublic List<Project> getProject(Principal principal) {\r\n\t\treturn persistenceService.getProject(AppBuilderUtil.getLoggedInUserId());\r\n\t}", "public String retrieveSubmittedProjectQuery(String username) \n\t{\n\t\tString query = \"SELECT * FROM SubmittedProject WHERE username=\\\"\"+username+\"\\\"\";\n\t\tSystem.out.println(query);\n\t\treturn query;\n\t}", "@GetMapping(\"/project\")\n public Object doGet(){\n return service.getAllProjects();\n }", "@GetMapping(path = \"/detail/\")\n\tpublic String viewProjectDetail() {\n\t\treturn \"sprint-detail\";\n\t}", "public Action getIndexApiAction() {\n Thing object = new Thing.Builder()\n .setName(\"TaskList Page\") // TODO: Define a title for the content shown.\n // TODO: Make sure this auto-generated URL is correct.\n .setUrl(Uri.parse(\"http://[ENTER-YOUR-URL-HERE]\"))\n .build();\n return new Action.Builder(Action.TYPE_VIEW)\n .setObject(object)\n .setActionStatus(Action.STATUS_TYPE_COMPLETED)\n .build();\n }", "public static void main(String[] args) {\n\r\n\t\tSystem.out.println(\"Submitted Fourth project -branch 2 shelve\");\r\n\t}", "public String getSubmitted() {\n return submitted;\n }", "@Then(\"^Validate project table against pivotal project$\")\n public void allInformationOfPivotalTrackerProjectsShouldBeDisplayedInProjectTableWidgetOfMach() {\n JsonPath jsonPath = resources.getResponse().jsonPath();\n// assertEquals(jsonPath.get(\"name\"), tableProjectValues.get(\"name\"));\n// assertEquals(jsonPath.get(\"current_iteration_number\"), tableProjectValues.get(\"current_iteration\"));\n// assertEquals(jsonPath.get(\"week_start_day\"), tableProjectValues.get(\"week_start_date\"));\n assertEquals(jsonPath.get(\"name\"), \"AT01 project-01\");\n assertEquals(jsonPath.get(\"week_start_day\"), \"Monday\");\n }", "public static Result index(Long project) {\n if(Secured.isMemberOf(project)) {\n return ok(\n index.render(\n Project.find.byId(project)\n )\n );\n } else {\n return forbidden();\n }\n }", "public String handleEdit()\n throws webschedulePresentationException, HttpPresentationException\n {\t\t \n \n Project project = null;\n\n \n \n // Try to get the proj by its ID\n try {\n\t project = ProjectFactory.findProjectByID(this.getProjectID());\n\t \n\t String title = project.getProj_name();\n\t System.out.println(\"project title: \"+title);\n\t\n } catch(Exception ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid PROJECT to edit\");\n throw new ClientPageRedirectException(UCSDPROJECTSEDIT_PAGE);\n }\n \n // If we got a valid project then try to save it\n // If any fields were missing then redisplay the edit page, \n // otherwise redirect to the project catalog page\n try {\n saveProject(project);\n throw new ClientPageRedirectException(UCSDPROJECTSEDIT_PAGE);\n } catch(Exception ex) {\n return showPage(\"You must fill out all fields to edit this project\");\n } \n }", "private void actionNewProject ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDataController.scenarioNewProject();\r\n\r\n\t\t\thelperDisplayProjectFiles();\r\n\r\n\t\t\t//---- Change button icon\r\n\t\t\tImageIcon iconButton = FormUtils.getIconResource(FormStyle.RESOURCE_PATH_ICO_VIEW_SAMPLES);\r\n\r\n\t\t\tmainFormLink.getComponentToolbar().getComponentButtonViewSamples().setIcon(iconButton);\r\n\t\t\tmainFormLink.getComponentToolbar().getComponentButtonViewSamples().setActionCommand(FormMainHandlerCommands.AC_VIEW_SAMPLES_ON);\r\n\t\t\tmainFormLink.getComponentToolbar().getComponentButtonViewSamples().setToolTipText(\"View detected samples\");\r\n\r\n\t\t\tmainFormLink.reset();\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\t}", "public SubmitPage(final PageParameters parameters) {\n\n Form form = new Form(\"form\");\n orgLabel = new TextField<String>(\"orgLabel\", new Model<String>(\"\"));\n message = new TextArea<String>(\"message\", new Model<String>(\"\"));\n form.add(orgLabel);\n form.add(message);\n form.add(new Button(\"button\")\n {\n @Override\n public void onSubmit()\n {\n String orgLabelString = orgLabel.getModelObject();\n String messageString = message.getModelObject();\n \n SessionFactory factory = OrganizationManager.getSessionFactory();\n Session session = factory.openSession();\n Transaction tx = session.beginTransaction();\n Query query = session.createQuery(\"from Organization where orgLabel = ?\");\n query.setParameter(0, orgLabelString);\n List<Organization> organizations = query.list();\n Organization organization;\n if (organizations.size() == 0)\n {\n organization = new Organization();\n organization.setParentOrganization((Organization)session.get(Organization.class, 1));\n organization.setOrgLabel(orgLabelString);\n session.save(organization);\n }\n else\n {\n organization = organizations.get(0);\n }\n SubmitterProfile submitterProfile = organization.getPrimaryProfile();\n if (submitterProfile == null)\n {\n submitterProfile = new SubmitterProfile();\n submitterProfile.setProfileLabel(\"HL7\");\n submitterProfile.setProfileStatus(SubmitterProfile.PROFILE_STATUS_TEST);\n submitterProfile.setOrganization(organization);\n submitterProfile.setDataFormat(SubmitterProfile.DATA_FORMAT_HL7V2);\n submitterProfile.setTransferPriority(SubmitterProfile.TRANSFER_PRIORITY_NORMAL);\n session.save(submitterProfile);\n organization.setPrimaryProfile(submitterProfile);\n }\n tx.commit();\n StringWriter stringWriter = new StringWriter();\n PrintWriter out = new PrintWriter(stringWriter);\n try \n {\n // TODO IncomingServlet.processStream(false, out, session, submitterProfile, messageString);\n }\n catch (Exception e)\n {\n e.printStackTrace(out);\n }\n out.close();\n results = stringWriter.toString();\n }\n });\n add(new Label(\"results\"));\n add(form);\n }", "public void showProjectContext(@NonNull final Project project) {\n Picasso.with(getApplicationContext()).load(project.photo().full())\n .into(projectPhotoImageView);\n projectNameTextView.setText(project.name());\n creatorNameTextView.setText(project.creator().name());\n }", "@GetMapping(value = \"/project\")\n\tpublic String project(final Model model) {\n\t\tfinal Flux<Project> projectStream = this.projectRepository.findAll().log();\n\t\t\n\t\t// No need to fully resolve the Publisher! We will just let it drive (the \"projects\" variable can be a Publisher<X>, in which case it will drive the execution of the engine and Thymeleaf will be executed as a part of the data flow)\n // Create a data-driver context variable that sets Thymeleaf in data-driven mode,\n // rendering HTML (iterations) as items are produced in a reactive-friendly manner.\n // This object also works as wrapper that avoids Spring WebFlux trying to resolve\n // it completely before rendering the HTML.\n\t\tmodel.addAttribute(\"projects\", new ReactiveDataDriverContextVariable(projectStream, 1000));\n\n\t\t// Will use the same \"sse\" template, but only a fragment: #projectTableBody\n\t\treturn \"sse :: #projectTableBody\";\n\t}", "@RequestMapping(value = \"/projectreleasesprints\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Projectreleasesprint> getAllProjectreleasesprints() {\n log.debug(\"REST request to get all Projectreleasesprints\");\n List<Projectreleasesprint> projectreleasesprints = projectreleasesprintRepository.findAll();\n return projectreleasesprints;\n }", "public List<Project> getAllProjects();", "@RequestMapping(\"/indexProjectAppMajor\")\n\tpublic ModelAndView listProjectAppMajors() {\n\t\tModelAndView mav = new ModelAndView();\n\n\t\tmav.addObject(\"projectappmajors\", projectAppMajorService.loadProjectAppMajors());\n\n\t\tmav.setViewName(\"projectappmajor/listProjectAppMajors.jsp\");\n\n\t\treturn mav;\n\t}", "@RequestMapping(value= {\"/projects/{projectId}\"}, method= RequestMethod.GET)\r\n\tpublic String project(Model model, @PathVariable Long projectId) {\r\n\t\tProject project = projectService.getProject(projectId);\r\n\t\tif(project==null) { return \"redirect:/projects\"; }\r\n\t\t\r\n\t\tUser loggedUser= sessionData.getLoggedUser();\r\n\t\t\r\n\t\tList<User> members = userService.getMembers(project);\r\n\t\tList<Credentials> credentialsMembers = this.credentialsService.getCredentialsByUsers(members);\r\n\t\t\r\n\t\tif(!project.getOwner().equals(loggedUser) && !members.contains(loggedUser)) {\r\n\t\t\treturn \"redirect:/projects\";\r\n\t\t}\r\n\t\t\r\n\t\tmodel.addAttribute(\"credentialsService\", this.credentialsService);\r\n\t\tmodel.addAttribute(\"credentialsMembers\", credentialsMembers);\r\n\t\tmodel.addAttribute(\"ownerCredentials\", this.credentialsService.getCredentialsByUserId(project.getOwner().getId()));\r\n\t\tmodel.addAttribute(\"loggedCredentials\", sessionData.getLoggedCredentials());\r\n\t\tmodel.addAttribute(\"loggedUser\", loggedUser);\r\n\t\tmodel.addAttribute(\"project\", project);\r\n\t\t\r\n\t\treturn \"project\";\r\n\t}", "void displayPostWithId(String id);", "protected void screeningProcessing() throws TCWebException {\n try {\n DataAccessInt dAccess = Util.getDataAccess(Constants.DW_DATA_SOURCE, true);\n\n Request dr = new Request();\n dr.setContentHandle(\"coderProblemInfo\");\n dr.setProperty(\"cr\", getRequest().getParameter(Constants.USER_ID));\n dr.setProperty(\"rd\", getRequest().getParameter(Constants.ROUND_ID));\n dr.setProperty(\"pm\", getRequest().getParameter(Constants.PROBLEM_ID));\n\n Map map = dAccess.getData(dr);\n if (map == null)\n throw new ScreeningException(\"getData failed!\");\n\n ResultSetContainer result =\n (ResultSetContainer) map.get(\"coderProblemSolution\");\n if (result.getRowCount() == 0) {\n throw new ScreeningException(\"Error retrieving code submission.\");\n }\n\n SubmissionInfo sinfo = new SubmissionInfo();\n sinfo.setCode(result.getItem(0, \"submission_text\").toString());\n sinfo.setTestResults((ResultSetContainer) map.get(\"coderProblemTestResults\"));\n getRequest().setAttribute(\"submissionInfo\", sinfo);\n } catch (TCWebException e) {\n throw e;\n } catch (Exception e) {\n throw(new TCWebException(e));\n }\n\n setNextPage(Constants.TC_PROBLEM_RESULT_PAGE);\n setIsNextPageInContext(true);\n }", "public static void main(String[] args) {\n\n Project project = new Project();\n project.setId(2L);\n project.setTitle(\"Title\");\n System.out.println(project);\n }", "private void submissionGUIsetup()\n\t\t\t{\n\t\t\t\tif(list.getSelectedValue()!= null)\n\t\t\t\t{\t\n\t\t\t\t\tsubmissionGUI = new SubmissionGUI((Assignment)courseGUI.getSelectedValue());\n\t\t\t\t\tVector<Submission> list = client.getSubmissions(submissionGUI.getAssignment());\n\t\t\t\t\tsubmissionGUI.setList(list);\n\t\t\t\t\tsubmissionGUI.setListeners(new SubmissionListener());\n\t\t\t\t\t\n\t\t\t\t\tframeHolder.setVisible(false);\n\t\t\t\t\tframeHolder = submissionGUI.returnFrame();\n\t\t\t\t\tframeHolder.setVisible(true);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}", "public void displayProjectsAssignedToResource(Resource resource) {\n\n\t\tboolean done;\n\t\tProject project;\n\n\t\tSystem.out.println(\"\\nProjects assigned (in this session) to : \"\n\t\t\t\t+ resource.getFirstName() + \" \" + resource.getLastName() + \" \"\n\t\t\t\t+ resource.getID());\n\t\tlineCheck(2);\n\t\tSystem.out\n\t\t\t\t.println(\"========================================================= \");\n\t\tlineCheck(1);\n\n\t\tresource.getProjectsAssigned().goToFrontOfList();\n\t\tdone = false;\n\n\t\twhile (!done) {\n\n\t\t\tproject = resource.getProjectsAssigned().getNextProject();\n\n\t\t\tif (project == null) {\n\n\t\t\t\tdone = true;\n\n\t\t\t} else {\n\n\t\t\t\tdisplayProject(project);\n\t\t\t\tlineCheck(2);\n\n\t\t\t} // if\n\n\t\t} // while\n\n\t}", "@Override\n public void onClick(View view) {\n Intent intent1 = new Intent(ProjectActivity.this, TaskActivityWriter.class);\n intent1.putExtra(\"project\", project);\n startActivity(intent1);\n }", "public List<Issue> getUserProjectActiveIssue(User user, Project project);", "@RequestMapping(value = \"/create/project/{projectId}\", method = RequestMethod.GET)\r\n public ModelAndView create(@PathVariable(\"projectId\") String projectId) {\r\n ModelAndView mav = new ModelAndView(\"creates2\");\r\n int pid = -1;\r\n try {\r\n pid = Integer.parseInt(projectId);\r\n } catch (Exception e) {\r\n LOG.error(e);\r\n }\r\n User loggedIn = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n User user = hibernateTemplate.get(User.class, loggedIn.getUsername());\r\n Project project = hibernateTemplate.get(Project.class, pid);\r\n if (!dataAccessService.isProjectAvailableToUser(project, user)) {\r\n return accessdenied();\r\n }\r\n List<SubProject> subProjects = dataAccessService.getResearcherSubProjectsForUserInProject(user, project);\r\n mav.addObject(\"projectId\", projectId);\r\n mav.addObject(\"methods\", project.getMethods());\r\n mav.addObject(\"subProjects\", subProjects);\r\n return mav;\r\n }", "public static Project getProject() {\n if (ProjectList.size() == 0) {\n System.out.print(\"No Projects were found.\");\n return null;\n }\n\n System.out.print(\"\\nPlease enter the project number: \");\n int projNum = input.nextInt();\n input.nextLine();\n\n for (Project proj : ProjectList) {\n if (proj.projNum == projNum) {\n return proj;\n }\n }\n\n System.out.print(\"\\nProject was not found. Please try again.\");\n return getProject();\n }", "@RequestMapping(\"/save\")\n\tpublic String createProjectForm(Project project, Model model) {\n\t\t\n\tproRep.save(project);\n\tList<Project> getall = (List<Project>) proRep.getAll();\n\tmodel.addAttribute(\"projects\", getall);\n\t\n\treturn \"listproject\";\n\t\t\n\t}", "public long getSubmissionId() {\r\n return submissionId;\r\n }", "public boolean checkShowSubmitPolicy(Integer ctId,Integer snId){\n\n //check if participator first\n String handle = (String)httpSession.getAttribute(Constants.CURRENT_LOGIN_USER_HANDLE);\n boolean flag = false;\n List<AuthorityDTO> lstAuthority = authorityMapper.getContestAuthority(ctId, handle);\n for (AuthorityDTO curAuth : lstAuthority) {\n if (curAuth.getId().equals(Constants.AUTH_VIEW_CONTEST_ID)) {\n return true;\n }\n if (curAuth.getId().equals(Constants.AUTH_PARTICIPATE_CONTEST_ID)) {\n flag = true;\n }\n }\n if (!flag){\n return false;\n }\n\n //then check policy\n ContestEntity contestEntity = getContestById(ctId);\n if (contestEntity.getShowSubmit().equals(Constants.SHOW_SUBMIT_ALL)){\n return true;\n }\n\n SubmissionEntity submissionEntity = new SubmissionEntity();\n submissionEntity.setId(snId);\n List<SubmissionEntity> lstSubmission = submissionMapper.selectWithExample(submissionEntity);\n if (lstSubmission.size() != 1){\n throw new NoSuchPageException(\"Submission not found!\");\n }\n\n //check if submission is from current user\n submissionEntity = lstSubmission.get(0);\n Integer currentUserId = (Integer)httpSession.getAttribute(Constants.CURRENT_LOGIN_USER_ID);\n if (submissionEntity.getUrId().equals(currentUserId)){\n return true;\n }\n\n //else check current user has solved this problem and this contests allow to view solved problem's solutions\n if (contestEntity.getShowSubmit().equals(Constants.SHOW_SUBMIT_SOLVED)){\n Integer solveCnt = submissionMapper.checkSolvedStatusInContest(ctId,submissionEntity.getPmId(),submissionEntity.getUrId());\n return solveCnt > 0;\n }\n return false;\n }", "public Project getTasks(String projectId) {\n try {\n\n String selectProject = \"select * from PROJECTS where PROJECT_ID = ?\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(selectProject);\n ps.setString(1, projectId);\n ResultSet rs = ps.executeQuery();\n if (rs.next()) {\n String startdate = rs.getString(\"STARTDATE\");\n String invoicesent = rs.getString(\"INVOICESENT\");\n String hours = rs.getString(\"HOURS\");\n String client = \"\";\n String duedate = rs.getString(\"DUEDATE\");\n String description = rs.getString(\"DESCRIPTION\");\n Project p = new Project(client, description, projectId,\n duedate, startdate, hours, duedate, duedate,\n invoicesent, invoicesent);\n rs.close();\n ps.close();\n return p;\n } else {\n return null;\n }\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return null;\n }\n }", "public ArrayList<Project> selectProject(String projectId) {\n\n try {\n ArrayList<Project> tasks = new ArrayList<Project>();\n\n String query = \"SELECT * FROM TASKS where PROJECT_ID = ?\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(query);\n ps.setString(1, projectId);\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n String hours = rs.getString(\"HOURS\");\n String hoursadded = rs.getString(\"HOURS_ADDED\");\n String description = rs.getString(\"DESCRIPTION\");\n Project p = new Project(description, hours, hoursadded,\n projectId);\n tasks.add(p);\n }\n rs.close();\n ps.close();\n return tasks;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return null;\n }\n }", "public String showEditPage(String errorMsg) \n throws HttpPresentationException, webschedulePresentationException\n { \n String proj_name = this.getComms().request.getParameter(PROJ_NAME);\n String personID = this.getComms().request.getParameter(PERSONID);\n String discrib = this.getComms().request.getParameter(DISCRIB);\n String indexnum = this.getComms().request.getParameter(INDEXNUM);\n String thours = this.getComms().request.getParameter(THOURS);\n String dhours = this.getComms().request.getParameter(DHOURS);\n String projectID = this.getComms().request.getParameter(PROJ_ID);\n String password = this.getComms().request.getParameter(PASSWORD);\n String codeofpay = this.getComms().request.getParameter(CODEOFPAY);\n String contactname = this.getComms().request.getParameter(CONTACTNAME);\n String contactphone = this.getComms().request.getParameter(CONTACTPHONE);\n String billaddr1 = this.getComms().request.getParameter(BILLADDR1);\n String billaddr2 = this.getComms().request.getParameter(BILLADDR2);\n String billaddr3 = this.getComms().request.getParameter(BILLADDR3);\n String city = this.getComms().request.getParameter(CITY);\n String state = this.getComms().request.getParameter(STATE);\n String zip = this.getComms().request.getParameter(ZIP);\n String accountid = this.getComms().request.getParameter(ACCOUNTID);\n String outside = this.getComms().request.getParameter(OUTSIDE);\n String exp = this.getComms().request.getParameter(EXP);\n String expday = this.getComms().request.getParameter(EXPDAY);\n String expmonth = this.getComms().request.getParameter(EXPMONTH);\n String expyear = this.getComms().request.getParameter(EXPYEAR);\n String notifycontact = this.getComms().request.getParameter(NOTIFYCONTACT);\n\t\n\t // Instantiate the page object\n\t EditHTML page = new EditHTML();\n Project project = null;\n\tString userID = null;\n\n System.out.println(\"project Id at show edit page \"+projectID);\n try {\n project = ProjectFactory.findProjectByID(projectID);\n\t userID = project.getUserID();\n // Catch any possible database exception in findProjectByID()\n } catch(webscheduleBusinessException ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid project to edit\");\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n }\n \n try {\n // If we received a valid projectID then try to show the project's contents,\n // otherwise try to use the HTML input parameters\n page.getElementProjID().setValue(project.getHandle());\n\n if(null != proj_name && proj_name.length() != 0) {\n page.getElementProj_name().setValue(proj_name);\n } else {\n page.getElementProj_name().setValue(project.getProj_name());\n }\n\n HTMLOptionElement templateOption = page.getElementTemplateOption();\n Node PersonSelect = templateOption.getParentNode();\n templateOption.removeAttribute(\"id\");\n templateOption.removeChild(templateOption.getFirstChild());\n\n\n try {\n \tPerson[] PersonList = PersonFactory.getPersonsList();\n \tfor (int numPersons = 0; numPersons < PersonList.length; numPersons++) {\n \t Person currentPerson = PersonList[numPersons] ;\n \t HTMLOptionElement clonedOption = (HTMLOptionElement) templateOption.cloneNode(true);\n clonedOption.setValue(currentPerson.getHandle());\n Node optionTextNode = clonedOption.getOwnerDocument().\n createTextNode(currentPerson.getFirstname() + \" \" +\n currentPerson.getLastname());\n\t\t\tif ((currentPerson.getHandle()).equals(userID))\n\t\t\t clonedOption.setSelected(true);\n\t\t\t else \n\t\t\t clonedOption.setSelected(false);\t\t\n\t\t\t \n clonedOption.appendChild(optionTextNode);\n // Do only a shallow copy of the option as we don't want the text child\n // of the node option\n PersonSelect.appendChild(clonedOption);\n // Alternative way to insert nodes below\n // insertBefore(newNode, oldNode);\n // ProjSelect.insertBefore(clonedOption, templateOption);\n\t }\n\t } catch(Exception ex) {\n\t this.writeDebugMsg(\"Error populating Persons List: \" + ex);\n throw new webschedulePresentationException(\"Error getting Persons List: \", ex);\n\t }\n\t\n templateOption.getParentNode().removeChild(templateOption);\n\n /* if (personID.equals(INVALID_ID)){\n \tpage.getElementPersonList().setValue(project.getUserID());\n \t\n }else {\n \tpage.getElementPersonList().setValue(personID);\n }\t\t*/\n\n if(null != password && password.length() != 0) {\n page.getElementPassword().setValue(password);\n } else {\n page.getElementPassword().setValue(project.getPassword());\n }\n\n if(null != discrib && discrib.length() != 0) {\n page.getElementDiscrib().setValue(discrib);\n } else {\n page.getElementDiscrib().setValue(project.getDescription());\n }\n \n if(null != indexnum && indexnum.length() != 0) {\n page.getElementIndexnum().setValue(indexnum);\n } else {\n page.getElementIndexnum().setValue(project.getIndexnum());\n }\n\n if(null != thours && thours.length() != 0) {\n page.getElementThours().setValue(thours);\n } else {\n page.getElementThours().setValue(Double.toString(project.getTotalhours()));\n }\n\n if(null != dhours && dhours.length() != 0) {\n page.getElementDhours().setValue(dhours);\n } else {\n page.getElementDhours().setValue(Double.toString(project.getDonehours()));\n }\n if(null != codeofpay && codeofpay.length() != 0) {\n page.getElementCodeofpay().setValue(codeofpay);\n } else {\n page.getElementCodeofpay().setValue(Integer.toString(project.getCodeofpay()));\n }\n\n \n\t\n\t if(null != contactname && contactname.length() != 0) {\n page.getElementContactname().setValue(contactname);\n } else {\n page.getElementContactname().setValue(project.getContactname());\n }\n\n\t if(null != billaddr1 && billaddr1.length() != 0) {\n page.getElementBilladdr1().setValue(billaddr1);\n } else {\n page.getElementBilladdr1().setValue(project.getBilladdr1());\n }\n\n\n\t if(null != billaddr2 && billaddr2.length() != 0) {\n page.getElementBilladdr2().setValue(billaddr2);\n } else {\n page.getElementBilladdr2().setValue(project.getBilladdr2());\n }\n\n\t\n\t if(null != billaddr3 && billaddr3.length() != 0) {\n page.getElementBilladdr3().setValue(billaddr3);\n } else {\n page.getElementBilladdr3().setValue(project.getBilladdr3());\n }\n\n\n if(null != city && city.length() != 0) {\n page.getElementCity().setValue(city);\n } else {\n page.getElementCity().setValue(project.getCity());\n }\n\n\t if(null != state && state.length() != 0) {\n page.getElementState().setValue(state);\n } else {\n page.getElementState().setValue(project.getState());\n }\n\n if(null != zip && zip.length() != 0) {\n page.getElementZip().setValue(zip);\n } else {\n page.getElementZip().setValue(project.getZip());\n }\n\nif(null != accountid && accountid.length() != 0) {\n page.getElementAccountid().setValue(accountid);\n } else {\n page.getElementAccountid().setValue(project.getAccountid());\n }\n\n\t\n\tif(null != this.getComms().request.getParameter(OUTSIDE)) {\n page.getElementOutsideBox().setChecked(true);\n } else {\n page.getElementOutsideBox().setChecked(project.isOutside());\n }\n\t\n\t\n\tif(null != this.getComms().request.getParameter(EXP)) {\n page.getElementExpBox().setChecked(true);\n } else {\n page.getElementExpBox().setChecked(project.isExp());\n }\n\n if(null != expday && expday.length() != 0) {\n page.getElementExpday().setValue(expday);\n } else {\n page.getElementExpday().setValue(Integer.toString(project.getExpday()));\n }\n \n\n\nif(null != expmonth && expmonth.length() != 0) {\n page.getElementExpmonth().setValue(expmonth);\n } else {\n page.getElementExpmonth().setValue(Integer.toString(project.getExpmonth()));\n }\n \nif(null != expyear && expyear.length() != 0) {\n page.getElementExpyear().setValue(expyear);\n } else {\n page.getElementExpyear().setValue(Integer.toString(project.getExpyear())); \t \n}\n\n\n\t if(null != notifycontact && notifycontact.length() != 0) {\n page.getElementNotifycontact().setValue(notifycontact);\n } else {\n page.getElementNotifycontact().setValue(project.getNotifycontact());\n }\n\n\n\n if(null == errorMsg) {\n\n page.getElementErrorText().getParentNode().removeChild(page.getElementErrorText());\n\t } else {\n page.setTextErrorText(errorMsg);\n }\n } catch(webscheduleBusinessException ex) {\n throw new webschedulePresentationException(\"Error populating page for project editing\", ex);\n }\n \n page.getElementEventValue().setValue(EDIT_COMMAND);\n\t return page.toDocument();\n }", "public static void main(String[] args) {\n\t\tProject project=new Project();\n\t\tproject.id=100;\n\t\tproject.name=\"Java_Training\";\n\t\t\n\t\tArrayList<Employee>empList=new ArrayList<Employee>();\n\t\tScanner sc=new Scanner(System.in);\t\t\n\t\tSystem.out.println(\"Enter the no of employees\");\n\t\t\n\t\tint limit=sc.nextInt();\n\t\t\n\t\tSystem.out.println(\"Enter Id,Name\");\n\t\tfor(int i=0;i<limit;i++){\n\t\t\tEmployee emp=new Employee();\t\t\n\t\temp.id=sc.nextInt();\n\t\temp.name=sc.next();\n \n empList.add(emp); \n\t\t}\n project.employees=empList;\n \n System.out.println(project.id+\"\\n\"+project.name);\n for(Employee temp:project.employees){\n System.out.println(temp.id);\n System.out.println(temp.name);\n }\n\t}", "void viewStudents(Professor professor);", "public String handleEdit()\n throws webschedulePresentationException, HttpPresentationException\n {\t\t \n String projID = this.getComms().request.getParameter(PROJ_ID);\n Project project = null;\n\n System.out.println(\" trying to edit a project \"+ projID);\n \n // Try to get the proj by its ID\n try {\n\t project = ProjectFactory.findProjectByID(projID);\n\t System.out.println(\" trying to edit a project 2\"+ projID);\n\t String title = project.getProj_name();\n\t System.out.println(\"project title: \"+title);\n\t\n } catch(Exception ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid PROJECT to edit\");\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n }\n \n // If we got a valid project then try to save it\n // If any fields were missing then redisplay the edit page, \n // otherwise redirect to the project catalog page\n try {\n saveProject(project);\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n } catch(Exception ex) {\n return showEditPage(\"You must fill out all fields to edit this project\");\n } \n }", "public Action getIndexApiAction() {\n Thing object = new Thing.Builder()\n .setName(\"PlayWorkout Page\") // TODO: Define a title for the content shown.\n // TODO: Make sure this auto-generated URL is correct.\n .setUrl(Uri.parse(\"http://[ENTER-YOUR-URL-HERE]\"))\n .build();\n return new Action.Builder(Action.TYPE_VIEW)\n .setObject(object)\n .setActionStatus(Action.STATUS_TYPE_COMPLETED)\n .build();\n }", "@GetMapping(\"startPublishProccess\")\n\tpublic ResponseEntity startPaperSubmissionProcess() {\n\t\tString username = this.tokenUtils.getUsernameFromToken(this.httpServletRequest.getHeader(\"X-Auth-Token\"));\n\t\tSystem.out.println(\"zapocinjem proces objave rada za korisnika: \" + username);\n\t\tMap<String, VariableValueDto> variables = new HashMap<>();\n\t\tVariableValueDto variableValueDto = new VariableValueDto();\n\t\tvariableValueDto.setValue(username);\n\t\tvariables.put(\"author\", variableValueDto);\n\t\tString processId = rspe.startProcess(\"procesObjaveRada\", variables);\n\t\treturn ResponseEntity.ok().build();\n\t}", "@Override\n\tpublic long getSubmissionId() {\n\t\treturn model.getSubmissionId();\n\t}", "@GetMapping(\"/api/getLatest\")\n\tpublic List<Project> findlatestProject()\n\t{\n\t\treturn this.integrationClient.findlatestProject();\n\t}", "public ViewSprintCommand(Hashtable<String, String> parameters, ProjectManager projectList) {\n super(parameters, projectList, false);\n }", "@RequestMapping(value = \"/events/subproject/{subProjectId}\", method = RequestMethod.GET)\r\n public ModelAndView showEventsSubProject(@PathVariable(\"subProjectId\") String subProjectId) {\r\n int pid = -1;\r\n try {\r\n pid = Integer.parseInt(subProjectId);\r\n } catch (Exception e) {\r\n LOG.error(e);\r\n }\r\n if (pid >= 0) {\r\n ModelAndView mav = new ModelAndView(\"events\");\r\n User loggedIn = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n User user = hibernateTemplate.get(User.class, loggedIn.getUsername());\r\n SubProject sp = hibernateTemplate.get(SubProject.class, pid);\r\n if (!dataAccessService.isSubProjectAvailableToUser(sp, user)) {\r\n return accessdenied();\r\n }\r\n List<Event> events = dataAccessService.getEventsForSubProject(sp, null);\r\n mav.addObject(\"events\", events);\r\n return mav;\r\n }\r\n return handleRequest();\r\n }", "public void getProject(){\n\t\n\t String getList[] = clientFacade.GetProjects().split(\"\\n\");\n\t DefaultComboBoxModel addPro = new DefaultComboBoxModel();\n\t\tfor(int i=1; i<getList.length; i+=2) \n\t\t\t addPro.addElement(getList[i]);\n\t\t\t \n\t\tcPro.setModel(addPro);\t\n\t}", "@Test\n public void getAppSubmissionFormTest() throws ApiException {\n String appId = null;\n String naked = null;\n // String response = api.getAppSubmissionForm(appId, naked);\n\n // TODO: test validations\n }", "private void addProjectTask(ActionEvent e) {\n Calendar dueDate = dueDateModel.getValue();\n String title = titleEntry.getText();\n String description = descriptionEntry.getText();\n Project parent = (Project) parentEntry.getSelectedItem();\n addProjectTask(title, description, parent, dueDate);\n }", "public static void main(String[] args) {\n AddNewProject addNewProject = new AddNewProject();\n addNewProject.setVisible(true);\n }", "@RequestMapping(value = \"/*\", method = RequestMethod.GET)\r\n public ModelAndView handleRequest() {\r\n User loggedIn = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n User user = hibernateTemplate.get(User.class, loggedIn.getUsername());\r\n ModelAndView mav = new ModelAndView(\"home\");\r\n List<Project> projs = hibernateTemplate.find(\"from Project\");\r\n mav.addObject(\"projs\", projs);\r\n List<Event> events = dataAccessService.getEventsForUser(user, 10);\r\n Map<String, Integer> stats = dataAccessService.getStatistics();\r\n List<SubProject> followedProjects = dataAccessService.getFollowedSubProjectsForUser(user);\r\n Collections.sort(followedProjects, new Comparator<SubProject>() {\r\n\r\n @Override\r\n public int compare(SubProject o1, SubProject o2) {\r\n Integer into1 = o1.getParent().getId();\r\n Integer into2 = o2.getParent().getId();\r\n return into1.compareTo(into2);\r\n }\r\n });\r\n mav.addObject(\"followProjects\", followedProjects);\r\n mav.addObject(\"events\", events);\r\n mav.addObject(\"projects\", stats.get(\"projects\"));\r\n mav.addObject(\"users\", stats.get(\"users\"));\r\n mav.addObject(\"subprojects\", stats.get(\"subprojects\"));\r\n mav.addObject(\"methods\", stats.get(\"methods\"));\r\n mav.addObject(\"results\", stats.get(\"results\"));\r\n mav.addObject(\"comments\", stats.get(\"comments\"));\r\n mav.addObject(\"eventstat\", stats.get(\"events\"));\r\n mav.addObject(\"data\", stats.get(\"data\"));\r\n return mav;\r\n }", "public ActionForward execute( ActionMapping mapping,\n ActionForm form,\n HttpServletRequest request,\n HttpServletResponse response )\n throws Exception {\n User user = UserUtils.getUser(request);\n if (user == null) {\n ActionErrors errors = new ActionErrors();\n errors.add(\"username\", new ActionMessage(\"error.login.notloggedin\"));\n saveErrors( request, errors );\n return mapping.findForward(\"authenticate\");\n }\n\n \n int projectId = 0;\n try {\n \tif(request.getParameter(\"projectId\") != null) {\n \t\tprojectId = Integer.parseInt(request.getParameter(\"projectId\"));\n \t}\n }\n catch(NumberFormatException e) {}\n \t\n\n // Get a list of the user's projects (all projects to which user has READ access)\n // if the user is an admin get ALL projects\n ProjectsSearcher projSearcher = new ProjectsSearcher();\n projSearcher.setResearcher(user.getResearcher());\n List<Project> allReadableProjects = projSearcher.search();\n \n List<Project> userProjects = new ArrayList<Project>();\n for(Project project: allReadableProjects) {\n \n \t// Add only projects on which user is listed as a researcher\n if(!project.checkAccess(user.getResearcher()))\n \tcontinue;\n \n userProjects.add(project);\n \n }\n \n request.setAttribute(\"userProjects\", userProjects);\n request.setAttribute(\"projectId\", projectId);\n // If a protein inference run id was sent with the request get it now\n String idStr = request.getParameter(\"piRunIds\");\n if(idStr == null)\n \trequest.setAttribute(\"piRunIds\", \"\");\n else\n \trequest.setAttribute(\"piRunIds\", idStr);\n \n // Don't add to history\n request.setAttribute(HistoryTag.NO_HISTORY_ATTRIB, true); // We don't want this added to history.\n return mapping.findForward(\"Success\");\n \n }", "private static void assign_project() {\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\t//Print out all projects\r\n\t\t System.out.println(\"Choose a project to assign to a person\");\r\n\t\t\tString strSelectProject = String.format(\"SELECT * from projects;\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tSystem.out.println(\"Project ID: \" + project_rset.getInt(\"project_id\") + \r\n\t\t\t\t\t\t\"\\nProject Name: \" + project_rset.getString(\"project_name\") + \"\\n\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Runs until a project is chosen and the input can be parsed to an int\r\n\t\t\tBoolean project_chosen = true;\r\n\t\t\tint project_choice = 0;\r\n\t\t\twhile (project_chosen == true) {\r\n\t\t\t\tSystem.out.println(\"Project No: \");\r\n\t\t\t\tString project_choice_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tproject_choice = Integer.parseInt(project_choice_str);\r\n\t\t\t\t\tproject_chosen = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for project number is not an integer\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The project id cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Prints out all people types\r\n\t\t\tString[] people_types = new String[] {\"Customer\", \"Contractor\", \"Architect\", \"Project Manager\"};\r\n\t\t\tfor (int i = 0; i < people_types.length; i ++) {\r\n\t\t\t\tSystem.out.println((i + 1) + \". \" + people_types[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows user to select a person type and runs until the selected person type number can be parsed to an integer\r\n\t\t\tBoolean select_person_type = true;\r\n\t\t\tint person_type = 0;\r\n\t\t\tString person_type_str = \"\";\r\n\t\t\twhile (select_person_type == true) {\r\n\t\t\t\tSystem.out.println(\"Select a number for the person type you wish to assign the project to:\");\r\n\t\t\t\tperson_type_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tperson_type = Integer.parseInt(person_type_str);\r\n\t\t\t\t\tfor (int i = 1; i < people_types.length + 1; i ++) {\r\n\t\t\t\t\t\tif (person_type == i) { \r\n\t\t\t\t\t\t\tperson_type_str = people_types[i-1]; \r\n\t\t\t\t\t\t\tselect_person_type = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// If user selected a number that was not displayed\r\n\t\t\t\t\tif (select_person_type == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available person type number.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for project number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The person type number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Prints out all people of selected type\r\n\t\t\t\tString strSelectPeople = String.format(\"SELECT * FROM people WHERE type = '%s';\", person_type_str);\r\n\t\t\t\tResultSet people_rset = stmt.executeQuery(strSelectPeople);\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(person_type_str + \":\");\r\n\t\t\t\t\r\n\t\t\t\twhile (people_rset.next()) {\r\n\t\t\t\t\tSystem.out.println(\"System ID: \" + people_rset.getInt(\"person_id\") + \", Name: \" + people_rset.getString(\"name\") + \" \" + people_rset.getString(\"surname\"));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Allows user to select a person to assign the project to\r\n\t\t\t\tBoolean person_chosen = true;\r\n\t\t\t\tint person_choice = 0;\r\n\t\t\t\twhile (person_chosen == true) {\r\n\t\t\t\t\tSystem.out.println(\"Person No: \");\r\n\t\t\t\t\tString person_choice_str = input.nextLine();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tperson_choice = Integer.parseInt(person_choice_str);\r\n\t\t\t\t\t\tperson_chosen = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * @exception Throws exception if the users input for person_number is not a number\r\n\t\t\t\t\t */\r\n\t\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t\t System.out.println(\"The person id cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Updates the table\r\n\t\t\t\tPreparedStatement ps_assign = conn.prepareStatement(\r\n\t\t\t\t\t\t\"UPDATE people SET projects = ? WHERE person_id = ?;\");\r\n\t\t\t\tps_assign.setInt(1, project_choice);\r\n\t\t\t\tps_assign.setInt(2, person_choice);\r\n\t\t\t\tps_assign.executeUpdate();\r\n\t\t\t\tSystem.out.println(\"\\nAssigned Project\");\r\n\r\n\t\t/**\r\n\t\t * @exception When something cannot be retrieved from the database then an SQLException is thrown\t\r\n\t\t */\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}", "@GetMapping(value = \"/projectslist\", produces = \"application/json\")\n public ResponseEntity<?> findAllProjectsWithProblemName()\n {\n List<ProblemListGroupedByProject> projectList = projectService.findAllProjectsWithProblemName();\n\n return new ResponseEntity<>(projectList, HttpStatus.OK);\n }", "List<Bug> getAllBugsByProject(int projectId);", "@GetMapping(\"\")\n\t@CrossOrigin(origins = \"http://localhost:3000\")\n\tpublic List<Project> getProjects()\n\t{\n\t\treturn projectService.findAll();\n\t}", "public String getProjectName(){\n return projectModel.getProjectName();\n }", "@SuppressWarnings(\"serial\")\n\tpublic ProjectPage() {\n\t\tagregarForm();\n\t}", "@ApiMethod(\n name = \"getProjects\",\n path = \"getProjects\",\n httpMethod = HttpMethod.POST\n )\n public List<Project> getProjects(){\n \tQuery<Project> query = ofy().load().type(Project.class);\n \treturn query.list();\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t\tString line = request.getParameter(\"line\");\r\n\t\tString content = request.getParameter(\"content\");\r\n\t\tint Fid = Integer.parseInt(request.getParameter(\"Fid\"));\r\n\t\tint Uid = Integer.parseInt(request.getParameter(\"Uid\"));\r\n\r\n\t\tProject project = (Project) request.getSession()\r\n\t\t\t\t.getAttribute(\"project\");\r\n\r\n\t\tif (project == null) {\r\n\t\t\trequest.setAttribute(\"message\", \"please choose a project first\");\r\n\t\t\tRequestDispatcher dispatcher = request\r\n\t\t\t\t\t.getRequestDispatcher(\"/showMessage.jsp\");\r\n\t\t\tdispatcher.forward(request, response);\r\n\t\t} else {\r\n\t\t\tFile file = new File(project.getProjectItem(Fid).getPath());\r\n\t\t\tif (file.exists()) {\r\n\t\t\t\tfile.delete();\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tOutputStream out = new FileOutputStream(file);\r\n\t\t\t\tBufferedWriter rd = new BufferedWriter(new OutputStreamWriter(\r\n\t\t\t\t\t\tout, \"utf-8\"));\r\n\t\t\t\trd.write(content);\r\n\t\t\t\trd.close();\r\n\t\t\t\tout.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tRequestDispatcher dispatcher = request\r\n\t\t\t\t\t.getRequestDispatcher(\"/ProjectDetail.do?Pid=\"\r\n\t\t\t\t\t\t\t+ project.getId());\r\n\t\t\tdispatcher.forward(request, response);\r\n\t\t}\r\n\t}", "public void showReport(Project project) {\n CoverageProvider provider = getProvider(project);\n if (provider != null) {\n List<FileCoverageSummary> results = provider.getResults();\n\n CoverageReportTopComponent report = showingReports.get(project);\n if (report == null) {\n report = new CoverageReportTopComponent(project, results);\n showingReports.put(project, report);\n report.open();\n }\n report.toFront();\n report.requestVisible();\n }\n }", "public TeacherPage submit() {\n clickSaveButton();\n return this;\n }", "@Given(\"I am on the Project Contact Details Page\")\n public void i_am_on_the_project_contact_details_page(){\n i_logged_into_Tenant_Manager_Project_list_page();\n i_click_on_create_a_new_project();\n\n }", "@Override\n\tpublic String getSubmitId() {\n\t\treturn model.getSubmitId();\n\t}", "List<String> viewPendingApprovals();", "@GET\n\t@Path(\"/\") \n\t@Produces(MediaType.TEXT_HTML) \n\tpublic String readItems() \n\t { \n\t return itemObj.readProjects(); \n\t }", "void getAllProjectList(int id);", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tpnlReportGeneration.setVisible(true);\n\t\t\t\tloadProjects();\n\t\t\t}", "public void showPortfolio(){\n System.out.println(\"PORTFOLIO CONTENTS\");\n for(int i = 0; i < this.projects.size(); i++){\n System.out.println(this.projects.get(i).elevatorPitch());\n }\n System.out.println(\"Total Portfolio Cost: $\" + this.getPortfolioCost());\n }", "@GetMapping(\"/getAll\")\r\n\tpublic List<Project> getAllProjects() {\r\n\t\treturn persistenceService.getAllProjects();\r\n\t}", "@RequestMapping(value = \"/figureAssignment\", method = RequestMethod.GET)\n public ModelAndView getFigureAssignment(@RequestParam(\"ctype\") String ctype, HttpServletRequest req, HttpServletResponse resp) {\n\n List<CourseEntity> courses = userDao.findAllCourse();\n List<AssignmentEntity> assignments = new ArrayList<>();\n if (ctype == null) {\n// System.out.println(\"ctype now is : \" + ctype);\n ctype = courses.get(0).getCtype();\n assignments = userDao.findAllAssignment(ctype);\n } else {\n// System.out.println(\"ctype now is : \" + ctype);\n assignments = userDao.findAllAssignment(ctype);\n }\n List<AssignmentEntity> assignmentsPublished = new ArrayList<>();\n List<AssignmentEntity> assignmentsEnd = new ArrayList<>();\n List<AssignmentEntity> assignmentsFinished = new ArrayList<>();\n List<AssignmentEntity> assignmentsScoring = new ArrayList<>();\n List<AssignmentEntity> assignmentsScored = new ArrayList<>();\n for (int i = 0; i < assignments.size(); i++) {\n switch (assignments.get(i).getState()) {\n case \"Published\":\n assignmentsPublished.add(assignments.get(i));\n break;\n case \"End\":\n assignmentsEnd.add(assignments.get(i));\n break;\n case \"Finished\":\n assignmentsFinished.add(assignments.get(i));\n break;\n case \"Scoring\":\n assignmentsScoring.add(assignments.get(i));\n break;\n case \"Scored\":\n assignmentsScored.add(assignments.get(i));\n break;\n }\n }\n\n ModelAndView mv = new ModelAndView(\"/root/figureAssignment\");\n mv.addObject(\"sid\", \"root\");\n mv.addObject(\"courses\", courses);\n mv.addObject(\"ctype\", ctype);\n mv.addObject(\"assignments\", assignments);\n mv.addObject(\"assignmentsPublished\", assignmentsPublished);\n mv.addObject(\"assignmentsEnd\", assignmentsEnd);\n mv.addObject(\"assignmentsFinished\", assignmentsFinished);\n mv.addObject(\"assignmentsScoring\", assignmentsScoring);\n mv.addObject(\"assignmentsScored\", assignmentsScored);\n\n\n System.out.println(\"TEST*******************\");\n\n return mv;\n }", "public void displayData(Solution solution);", "public PanelRegisteredProjects() {\n\t\tthis.controller = new ControllerProject(this);\n\t\tthis.setLayout(new BorderLayout());\n\n\t\tthis.scrollProjects = new JScrollPane(this.list);\n\n\t\tupdate();\n\n\t\tlist.addListSelectionListener(x -> selected(x));\n\t\tlist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\t\tlist.setCellRenderer(new ProjectCellRenderer());\n\n\t\tinfo = new JTextArea(2, 20);\n\t\tinfo.setText(\"Description: \");\n\t\tinfo.setWrapStyleWord(true);\n\t\tinfo.setLineWrap(true);\n\t\tinfo.setEditable(false);\n\t\tinfo.setBackground(this.getBackground());\n\n\t\tJPanel buttons = new JPanel(new FlowLayout());\n\t\tbuttons.add(bCreate);\n\t\tbuttons.add(bVote);\n\t\tbuttons.add(bInfo);\n\n\t\tJPanel pn2 = new JPanel();\n\t\tpn2.setLayout(new GridLayout(2, 0));\n\t\tpn2.add(info);\n\t\tpn2.add(buttons);\n\n\t\tcombobox.addActionListener(x -> comboselection(x));\n\t\tbCreate.addActionListener(x -> newProject(x));\n\t\tbVote.addActionListener(x -> vote(x));\n\t\tbInfo.addActionListener(x -> info(x));\n\t\tbSearch.addActionListener(x -> search(x));\n\n\t\tJPanel psearch = new JPanel();\n\t\tpsearch.setLayout(new GridLayout(1, 2));\n\t\tpsearch.add(searchText);\n\t\tpsearch.add(bSearch);\n\n\t\tthis.field1 = new JPanel();\n\t\tthis.field1.setLayout(new BoxLayout(this.field1, BoxLayout.Y_AXIS));\n\n\t\tthis.field1.add(psearch);\n\t\tthis.field1.add(scrollProjects);\n\t\tthis.field1.add(pn2);\n\n\t\tthis.add(combobox, BorderLayout.NORTH);\n\t\tthis.add(field1, BorderLayout.CENTER);\n\n\t}", "public void submitBugPopUp() {\n\t\tJPanel bugPanel = new JPanel();\n\n\t\tHintTextField title = new HintTextField(\"Enter a bug title here\");\n\n\t\tJTextArea description = new JTextArea();\n\t\tdescription.setPreferredSize(new Dimension(500, 250));\n\t\tdescription.setBorder(BorderFactory.createEtchedBorder());\n\t\tdescription.setLineWrap(true);\n\n\t\t// Fill a dropdown menu with all the products\n\t\tDefaultComboBoxModel<String> productModel = new DefaultComboBoxModel<String>();\n\t\tDefaultListModel<String> model = (DefaultListModel<String>) productlist.getModel();\n\n\t\t// Fill combobox with only product names\n\t\tfor (int i = 0; i < model.size(); i++)\n\t\t\tproductModel.addElement(model.getElementAt(i).split(\" \")[1]);\n\t\tJComboBox<String> products = new JComboBox<String>(productModel);\n\n\t\tBox vBox = Box.createVerticalBox();\n\t\tvBox.add(products);\n\t\tvBox.add(Box.createVerticalStrut(20));\n\t\tvBox.add(title);\n\t\tvBox.add(Box.createVerticalStrut(20));\n\t\tvBox.add(description);\n\t\tvBox.add(Box.createVerticalStrut(20));\n\n\t\tbugPanel.add(vBox);\n\n\t\tObject options[] = { \"Submit Bug\", \"Cancel\" };\n\t\tint selection = JOptionPane.showOptionDialog(null, bugPanel, \"New Bug\", JOptionPane.OK_CANCEL_OPTION,\n\t\t\t\tJOptionPane.PLAIN_MESSAGE, null, options, options[0]);\n\n\t\tif (selection == JOptionPane.OK_OPTION) {\n\t\t\t// Get selected product ID\n\t\t\tString selectedProduct = model.getElementAt(products.getSelectedIndex());\n\t\t\tint productID = Integer.parseInt(selectedProduct.split(\" \")[0]);\n\n\t\t\t// Create the new bug\n\t\t\tBug b = new Bug();\n\t\t\tb.setBugId_(uiController_.BrowseBugs().size() + 101);\n\t\t\tb.setBugTitle_(title.getText());\n\t\t\tb.setDescription_(description.getText());\n\t\t\tb.setProductId_(productID);\n\t\t\tb.setState_(Bug.State.PENDING_APPROVAL);\n\t\t\tuiController_.SubmitBug(b);\n\t\t}\n\t}", "@Override\n\tpublic void execute() {\n\t\tProjectOpenAllPrompt prompt = new ProjectOpenAllPrompt();\n\t\tprompt.setProceedEvent(ee -> {\n\t\t\tprompt.close();\n\t\t\tString name = ((Button) ee.getSource()).getId();\n\t\t\tIGameRunner gameRunner = new GameRunner();\n\t gameRunner.playGame(name);\n\t\t});\n\t\tprompt.show();\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnew ProjectView().init();\r\n\t\t\t}", "@Override\n public int getItemCount() {\n return projects.size();\n }", "@GetMapping(\"/my_projects\")\n public ResponseEntity<List<ProjectDto>> getMyProjects(){\n\n Authentication authentication = SecurityContextHolder.getContext().getAuthentication();\n String currentUserName = authentication.getName();\n User currentUser = userService.findByEmail(currentUserName).orElseThrow(\n () -> {throw new MyNotFoundException(\"User not found\");}\n );\n\n List<String> projects = Arrays.asList(currentUser.getProjects().split(\"#\"));\n\n List<ProjectDto> projectDtos = new ArrayList<>();\n for(String project : projects){\n if (projectService.findByName(project).isPresent()){\n Project temp = projectService.findByName(project).get();\n projectDtos.add(new ProjectDto(temp.getId(), temp.getName(), new CompanyDto(temp.getCompany()), temp.getStart_date(), temp.getStatus()));\n }\n }\n return ResponseEntity.ok(projectDtos);\n }", "TrackerProjects getTrackerProjects(final Integer id);", "@GetMapping(\"/showNewTeamForm\")\n public String showNewTeamForm(Model model) {\n\n Page<Employee> page = employeeService.findPaginated(1, 5,\"firstName\", \"asc\");\n List<Employee> listEmployees = page.getContent();\n\n Team team= new Team();\n model.addAttribute(\"team\", team);\n model.addAttribute(\"listEmployees\", listEmployees);\n model.addAttribute(\"listEmployeesFromTeam\", team.getEmployeeList());\n return \"new_team\";\n }", "public ProjectsPage() {\n\t\tthis.driver = DriverManager.getDriver();\n\t\tElementFactory.initElements(driver, this);\n\t\t// sets the name of the project to add, with a random integer ending for slight\n\t\t// ease on multiple test runs\n\t\tnameOfProject = \"testz2018\" + (int) Math.random() * 500;\n\t}", "@RequestMapping(value = \"/project\", method = RequestMethod.GET)\n\tpublic Response getProjects() {\n\t\tResponse response = new Response();\n\t\ttry {\n\t\t\tList<Project> projects = projectService.getAllProjects();\n\t\t\tif (!projects.isEmpty()) {\n\t\t\t\tresponse.setCode(CustomResponse.SUCCESS.getCode());\n\t\t\t\tresponse.setMessage(CustomResponse.SUCCESS.getMessage());\n\t\t\t\tresponse.setData(transformProjectToPojectDto(projects));\n\t\t\t} else {\n\t\t\t\tresponse.setCode(CustomResponse.ERROR.getCode());\n\t\t\t\tresponse.setMessage(CustomResponse.ERROR.getMessage());\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tresponse.setCode(CustomResponse.ERROR.getCode());\n\t\t\tresponse.setMessage(CustomResponse.ERROR.getMessage());\n\t\t\tlogger.error(\"get all project Failed \", e);\n\t\t}\n\t\treturn response;\n\t}", "@GET\r\n @Produces(MediaType.TEXT_HTML)\r\n public ModelAndView viewAll() {\n \tList<Build> builds = buildService.getAll();\r\n \tif(builds!=null && builds.size()>0){\r\n \t\tlogger.debug(\"builds.size()=\"+builds.size());\r\n \t}else{\r\n \t\tlogger.debug(\"builds==null\");\r\n \t}\r\n \t\r\n return new ModelAndView(\"authviews/build/list\", \"builds\", builds);\r\n }", "private void displayList(Ticket[] tickets){\n clrscr();\n System.out.println(\"Welcome to Zendesk Tickets Viewer!\\n\");\n System.out.println(\"Displaying PAGE \" + pageNumber + \"\\n\");\n System.out.printf(\"%-6s%-60s%-14s\\n\", \"ID\", \"Subject\", \"Date Created\");\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\");\n\n // Handles if API is unavailable\n if(tickets != null){\n for (Ticket t: tickets) {\n String s = t.getSubject();\n if(s.length() > 60){\n s = s.substring(0,58);\n s += \"..\";\n }\n System.out.printf(\"%-6s%-60s%-14s\\n\", t.getId(), s, sdf.format(t.getCreated_at()));\n }\n } else {\n System.out.println(\"Sorry! Failed to retrieve tickets. The API might be unavailable or Username / Token is incorrect\");\n }\n\n if(pageNumber > 1){\n System.out.print(\"<-- Previous Page (P) | \");\n }\n if(hasMore){\n System.out.println(\"Next Page (N) -->\");\n }\n System.out.println(\"\");\n System.out.println(\"View Ticket Details (-Enter ID Number-) | Quit (Q)\");\n System.out.println(\"\");\n if (hasMore && pageNumber > 1) {\n System.out.println(\"What would you like to do? ( P / N / Q / #ID )\");\n } else if (pageNumber > 1 && !hasMore){\n System.out.println(\"What would you like to do? ( P / Q / #ID )\");\n } else if (pageNumber == 1 && hasMore){\n System.out.println(\"What would you like to do? ( N / Q / #ID )\");\n } else {\n System.out.println(\"What would you like to do? ( Q / #ID )\");\n }\n }" ]
[ "0.54720247", "0.53888774", "0.5372486", "0.5335534", "0.5277416", "0.5273863", "0.5273863", "0.5252821", "0.52105707", "0.5187882", "0.5175594", "0.51512766", "0.5144125", "0.5100566", "0.5073925", "0.50476664", "0.5029838", "0.5009994", "0.4963601", "0.49522611", "0.4950948", "0.49253434", "0.48697683", "0.486917", "0.48639393", "0.48555964", "0.48449123", "0.48421034", "0.48392856", "0.4824835", "0.48200372", "0.48130915", "0.48085168", "0.4806056", "0.47904676", "0.47874206", "0.47662276", "0.47576433", "0.47484323", "0.47403902", "0.47325802", "0.47306687", "0.4729066", "0.47202846", "0.47050342", "0.4697671", "0.46945107", "0.46925256", "0.46880528", "0.468641", "0.46840858", "0.46778867", "0.46756408", "0.4651901", "0.46506855", "0.46461394", "0.46460226", "0.46406445", "0.46372053", "0.46272913", "0.46135855", "0.4611116", "0.4602547", "0.46015084", "0.45993033", "0.45863774", "0.45732087", "0.45731595", "0.45715097", "0.4571432", "0.4567103", "0.45627552", "0.45622632", "0.45589942", "0.4550158", "0.4544635", "0.45398688", "0.4538499", "0.45354193", "0.45336652", "0.45314285", "0.45238265", "0.45168355", "0.451652", "0.4515481", "0.45136198", "0.45125356", "0.4506537", "0.4503701", "0.45030022", "0.4502104", "0.44967398", "0.44843218", "0.44784415", "0.44720495", "0.4470052", "0.446999", "0.44665828", "0.44654453", "0.4463199" ]
0.608412
0
Prints the students in a discipline
public String studentsDiscipline(String discipline) throws InvalidDisciplineException{ int id = _person.getId(); Professor _professor = getProfessors().get(id); return _professor.studentsDiscipline(discipline); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printStudents()\n {\n for(Student s : students)\n System.out.println(s);\n }", "public void printStudentList()\n {\n for(int i = 0; i < students.size(); i++)\n System.out.println( (i + 1) + \". \" + students.get(i).getName());\n }", "public void showstudents(){\n for (int i=0; i<slist.size(); i++){\n System.out.println(slist.get(i).getStudent());\n }\n }", "public void printStudentInfo(){\r\n System.out.println(\"Name: \" + getName());\r\n System.out.println(\"Student Id: \" + getId());\r\n printMarks();\r\n System.out.println(\"\\nAverage \" + getAverage() + \"%\");\r\n printNumberOfCoursesInEachLetterGradeCategory();\r\n }", "public String DisplayStudents()\n\t{\t\n\t\tString studentList= \"\";\n\t\tint i=1; //the leading number that is interated for each student\n\t\tfor(Student b : classRoll)\n\t\t{\n\t\t\tstudentList += i + \". \" + b.getStrNameFirst ( ) + \" \" + b.getStrNameLast () +\"\\n\";\n\t\t\ti++;\n\t\t}\n\t\treturn studentList= getCourseName() +\"\\n\" + getCourseNumber()+\"\\n\" + getInstructor()+ \"\\n\" + studentList;\n\t}", "public String printStudentCourses() {\r\n String s = \"Completed courses: \\n\";\r\n for (Registration r : completeCourses) {\r\n s += r.toString();\r\n }\r\n s += \"Current courses: \\n\";\r\n for (Registration r : studentRegList) {\r\n s += r.toString();\r\n }\r\n s += \"\\0\";\r\n return s;\r\n }", "public void printList() {\n System.out.println(\"Disciplina \" + horario);\n System.out.println(\"Professor: \" + professor + \" sala: \" + sala);\n System.out.println(\"Lista de Estudantes:\");\n Iterator i = estudantes.iterator();\n while(i.hasNext()) {\n Estudante student = (Estudante)i.next();\n student.print();\n }\n System.out.println(\"Número de estudantes: \" + numberOfStudents());\n }", "public static void printStudentInfo() {\n\t\tfor (Student student : StudentList)\n\t\t\tSystem.out.println(\"Name: \" + student.getName() + \" Matric Number: \" + student.getMatricNo() + \" Degree:\"\n\t\t\t\t\t+ student.getDegree());\n\t}", "@Override\n\tpublic void printStudent() {\n\t\tSystem.out.print(\"학번\\t국어\\t영어\\t수학\\n\");\n\t\tSystem.out.println(\"=\".repeat(60));\n\t\tint nSize = scoreList.size();\n\t\tfor(int i = 0 ; i < nSize ; i++) {\n\t\t\tScoreVO vo = new ScoreVO();\n\t\t\tSystem.out.print(vo.getNum() + \"\\t\");\n\t\t\tSystem.out.print(vo.getKor() + \"\\t\");\n\t\t\tSystem.out.print(vo.getEng() + \"\\t\");\n\t\t\tSystem.out.print(vo.getMath() + \"\\n\");\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "public void print() {\n\t\tfor(String subj : subjects) {\n\t\t\tSystem.out.println(subj);\n\t\t}\n\t\tSystem.out.println(\"==========\");\n\t\t\n\t\tfor(StudentMarks ssm : studMarks) {\n\t\t\tSystem.out.println(ssm.student);\n\t\t\tfor(Byte m : ssm.marks) {\n\t\t\t\tSystem.out.print(m + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void showStudentCourses()\r\n {\r\n \tString courseResponse = \"\";\r\n \tfor(Course course : this.getDBManager().getStudentCourses(this.studentId))\r\n \t{\r\n \t\tcourseResponse += \"Course Faculty: \" + course.getCourseName() + \", Course Number: \" + String.valueOf(course.getCourseNum()) + \"\\n\";\r\n \t}\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseResponse);\r\n \tthis.getClientOut().flush();\r\n }", "public static void display_student() {\n\t\t\n\n \n\t\n\ttry {\n\t\t//jdbc code\n\t\tConnection connection=Connection_Provider.creatC();\t\t\n\n\t\tString q=\"select * from students\";\n\t\t// Create Statement\n\t\tStatement stmt=connection.createStatement();\n\t\tResultSet result=stmt.executeQuery(q);\n\t\twhile (result.next()) {\n\t\t\tSystem.out.println(\"Student id \"+result.getInt(1));\n\t\t\tSystem.out.println(\"Student Name \"+result.getString(2));\n\t\t\tSystem.out.println(\"Student Phone No \"+result.getInt(3));\n\t\t\tSystem.out.println(\"Student City \"+result.getString(4));\n\t\t\tSystem.out.println(\"=========================================\");\n\t\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} catch (SQLException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\t\n\t\t\n\t}", "void display()\n\t {\n\t\t System.out.println(\"Student ID: \"+id);\n\t\t System.out.println(\"Student Name: \"+name);\n\t\t System.out.println();\n\t }", "public String getStudentsInCourse() {\n String output = \"\"; \n for (Student student : students) { // enhanced for\n output += student.toString() + \"\\n\";\n } // end for\n return output;\n }", "@Override\r\n\tpublic void showlist() {\n int studentid = 0;\r\n System.out.println(\"请输入学生学号:\");\r\n studentid = input.nextInt();\r\n StudentDAO dao = new StudentDAOimpl();\r\n List<Course> list = dao.showlist(studentid);\r\n System.out.println(\"课程编号\\t课程名称\\t教师编号\\t课程课时\");\r\n for(Course c : list) {\r\n System.out.println(c.getCourseid()+\"\\t\"+c.getCoursename()+\"\\t\"+c.getTeacherid()+\"\\t\"+c.getCoursetime());\r\n }\r\n \r\n\t}", "private static void printList(Student[] students)\r\n {\r\n for(int index = 0; index < students.length; index++)\r\n {\r\n System.out.println(students[index].toString());\r\n }\r\n }", "public String getStudentList()\n\t{\n\t\tString courseOutput = \"\";\n\t\tint studentNum = 1;\n\t\t\n\t\tfor(Student student: classRoll)\n\t\t{\n\t\t\tcourseOutput += studentNum + \". \" + student + \"\\n\";\t\n\t\t\t\t//adds a Student to the already created string one student at a time\n\t\t\tstudentNum++;\n\t\t}\n\t\t\n\t\tcourseOutput = getCourseName() + getCourseNumber() + getInstructor() + courseOutput;\n\t\treturn courseOutput;\n\t}", "private void printStudListByCourse() throws Exception {\n String courseID = null;\n ArrayList<Student> studentList = new ArrayList<Student>();\n\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"\\nPlease enter course ID\");\n courseID = sc.nextLine();\n while(!courseID.matches(\"^[a-zA-Z]{2}[0-9]{4}$\")){\n System.out.println(\"Invalid input! Please enter a valid index number!\");\n courseID = sc.nextLine();\n }\n\n studentList= this.adminManager.getStudentByCourse(courseID);\n if(studentList == null){\n System.out.println(\"\\nThere is no such a course index\\n\\n\");\n System.exit(1);\n }\n if (studentList.isEmpty()){\n System.out.println(\"\\nThere is no student registered for this course ID\\n\\n\");\n return;\n }\n else{\n System.out.println(\"Hang on a moment while we load database.\\n\\n\");\n System.out.println(\"------------------------------------------------------\");\n System.out.println(\" STUDENT NAME GENDER NATIONALITY\");\n System.out.println(\"------------------------------------------------------\");\n //\n for(Student student:studentList){\n System.out.println(String.format(\"%20s %6s %s\",student.getName(),student.getGender(),student.getNationality()));\n }\n\n System.out.println(\"------------------------------------------------------\\n\");\n }\n }", "@Override\n public void display(){\n System.out.println(\"Student id: \"+getStudentId()+\"\\nName is: \"+getName()+\"\\nAge :\"+getAge()+\"\\nAcademic year: \"+getSchoolYear()\n +\"\\nNationality :\"+getNationality());\n }", "@Override\n\tpublic String toString() {\n\t\tStringBuilder stud = new StringBuilder();\n\t\tfor (Student s : students) {\n\t\t\tstud.append(\"; \" + s.getBrojIndeksa());\n\t\t}\n\t\t\n\t\tif (professor != null)\n\t\t\treturn code + \"; \" + name + \"; \" + semester + \"; \"\n\t\t\t\t\t+ yearOfStuding + \"; \" + professor.getIdNumber() + stud;\n\t\telse\n\t\t\treturn code + \"; \" + name + \"; \" + semester + \"; \"\n\t\t\t+ yearOfStuding + \"; \" + stud;\n\t}", "public static void show(Student[] student){\n for(int i=0;i<student.length;i++){\n System.out.printf(\"First Name: %s Last Name: %s Gender: %s Student ID: %d GPA: %,.2f Department: %s Midterm Grade: %d Final Grade: %d %n\",student[i].getFirstName(),student[i].getLastName(),student[i].getGender(),student[i].getStudentID(),student[i].getGPA(),student[i].getDepartment(),student[i].getExamGrade().getMidtermExamGrade(),student[i].getExamGrade().getFinalExamGrade());\n }\n }", "public static void display(Student[] students) {\n System.out.print(\"\\nPrint Graph:\\n |\");\n for (int i = 0; i < students.length; i++) {\n System.out.printf(\"#%-2d|\", students[i].id);//column label\n }\n for (int i = 0; i < students.length; i++) {\n //grid\n System.out.println();\n for (int j = 0; j < 10; j++) {\n System.out.print(\"---|\");\n }\n System.out.println();\n\n //row label\n System.out.printf(\"#%-2d|\", students[i].id);\n for (int j = 0; j < students.length; j++) {\n int r = students[i].getFriendRep(students[j]);\n String rep = (r == 0) ? \" \" : String.valueOf(r); \n System.out.printf(\"%-3s|\", rep);\n }\n }\n }", "public void viewStudents(List<Student> studentList) {\n\t\tfor (Student student : studentList) {\n\t\t\tSystem.out.format(\"%5d | \", student.getId());\n\t\t\tSystem.out.format(\"%20s | \", student.getName());\n\t\t\tSystem.out.format(\"%5d | \", student.getAge());\n\t\t\tSystem.out.format(\"%20s | \", student.getAddress());\n\t\t\tSystem.out.format(\"%10.1f%n\", student.getGpa());\n\t\t}\n\t}", "private void displayStudentByName(String name) {\n\n int falg = 0;\n\n for (Student student : studentDatabase) {\n\n if (student.getName().equals(name)) {\n\n stdOut.println(student.toString());\n\n falg = 1;\n\n break;\n }\n }\n\n if (falg == 0) {\n\n stdOut.println(\"cannot find student\\n\");\n }\n }", "public void printModuleStudentInfo() {\t\r\n\tfor(int i =0; i<(StudentList.size()); i++) {\r\n\t\tStudent temp =StudentList.get(i);\r\n\t\tSystem.out.println(temp.getUserName());\r\n\t}\t\r\n}", "public static void printStudents(List<Student> students) {\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tList<Student> stds = Arrays.asList( \r\n\t\t\t\tnew Student (\"Jessy\", \"Java ME\", \"Chicago\"), \r\n\t\t\t\tnew Student (\"Helen\", \"Java EE\", \"Houston\"), \r\n\t\t\t\tnew Student (\"Mark\", \"Java ME\", \"Chicago\")); \r\n\t\t\r\n\t\tstds.stream()\r\n\t\t\t.collect(Collector.groupingBy(Student::getCourse))\r\n\t\t\t.forEach((src, res) -> System.out.println(scr));\r\n\r\n\t}", "private void displaySchalorship() {\n\n for (Scholarship scholarship : scholarshipDatabase) {\n\n stdOut.println(scholarship.toString() + \"\\n\");\n\n }\n }", "public void printCourseDetails()\n {\n // put your code here\n System.out.println(\"Course \" + codeNo + \" - \" + title);\n }", "public static void displayStudentRecords() {\n\t\tSystem.out.println(\"Student records in the database are:\");\n\t\tSelectStudentRecords records = new SelectStudentRecords();\n\t\ttry {\n\t\t\tList<Student> studentList = records.selectStudentRecords();\n\t\t\tstudentList.forEach(System.out::println);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "private void viewStudent() {\n //Lesen wir die ID\n Scanner sc = new Scanner(System.in);\n System.out.print(\"ID of the student to be viewed: \");\n long ID = sc.nextLong();\n\n Student s = ctrl.getStudent(ID);\n if (s != null)\n System.out.println(s.toString()); //wir zeigen die Student\n else\n System.out.println(\"Student with this ID doesn't exist!\");\n }", "public void display() {\n\tSystem.out.println(\"student id is \"+studentid+\"\\t\"+\"student name is \"+studentName+\"\\t\"+\"marks is \"+marks);\r\n}", "@Override\n\tpublic void print() {\n\t\tSystem.out.print(\"\\nMSc. student:\\n\");\n\t\tsuper.print();\n\t}", "public void printGrades() {\r\n for(String course : courses.keySet()) {\r\n \t System.out.printf(\"Student with facN: %s has taken course %s with grade of %.2f\\n\\n\",\r\n \t\t\t this.facultyNumber, course, courses.get(course));\r\n }\r\n }", "private void detailedCoursePrint(Course course) {\n System.out.println(\"Name: \" + course.getName());\n for (String subCourse : course.getSubClassNames()) {\n printNameWithTimes(course, subCourse, \"Section\");\n }\n for (String lab : course.getLabNames()) {\n printNameWithTimes(course, lab, \"Lab\");\n }\n for (String tutorial : course.getTutorialNames()) {\n printNameWithTimes(course, tutorial, \"Tutorial\");\n }\n }", "public static void printListOfStudentsPerCourse() {\n Scanner input = new Scanner(System.in);\n System.out.println(\"~~~~~~~~~Please select a course to see the Students~~~~~~~~~\");\n boolean caseCheck = false;\n String flag = \"Y\";\n do {\n if (flag.equalsIgnoreCase(\"Y\")) {\n SchoolCourse chosenSchoolCourse = schoolCourseSelection();\n for (int i = 0; i < chosenSchoolCourse.getListOfStudentsPerCourse().size(); i++) {\n System.out.println((i + 1) + \") \" + chosenSchoolCourse.getListOfStudentsPerCourse().get(i));\n System.out.println(\"\");\n }\n } else if (flag.equalsIgnoreCase(\"N\")) {\n\n return;\n\n } else {\n\n System.err.println(\"Invalid Answer, type: Y or N\");\n\n }\n System.out.println(\"Do you want to check another Course? (Y / N)\");\n flag = input.nextLine();\n } while (caseCheck == false);\n }", "public String toString() {\n String s = \"Computer Science Courses for \" + semester + \":\\n\";\n for (int i = 0; i < courseList.size(); i++) {\n s += courseList.get(i) + \"\\n\";\n }\n return s;\n }", "private static void showStudentDB () {\n for (Student s : studentDB) {\n System.out.println(\"ID: \" + s.getID() + \"\\n\" + \"Student: \" + s.getName());\n }\n }", "private void displayStudentByGrade() {\n\n studentDatabase.sortArrayList();\n\n for (Student student : studentDatabase) {\n\n stdOut.println(student.toStringsort() + \"\\n\");\n }\n }", "void viewStudents(Professor professor);", "public static void printListOfAssignmentsPerStudentPerCourse() {\n Scanner input = new Scanner(System.in);\n System.out.println(\"~~~~~~~~~Select the student to see the Assignments~~~~~~~~~\");\n boolean caseCheck = false;\n String flag = \"Y\";\n do {\n if (flag.equalsIgnoreCase(\"Y\")) {\n Student chosenStudent = studentSelection();\n for (int i = 0; i < chosenStudent.getListOfAssignmentsPerStudentPerCourse().size(); i++) {\n System.out.println((i + 1) + \") \" + chosenStudent.getListOfAssignmentsPerStudentPerCourse().get(i));\n System.out.println(\"\");\n }\n } else if (flag.equalsIgnoreCase(\"N\")) {\n return;\n } else {\n\n System.err.println(\"Invalid Answer, type: Y or N\");\n\n }\n System.out.println(\"Do you want to check another Student? (Y / N)\");\n flag = input.nextLine();\n } while (caseCheck == false);\n }", "public void printAllcourses() {\n\t\tfor (int i = 0; i < CourseManager.courses.size(); i++) {\n\t\t\tSystem.out.println(i + 1 + \". \" + CourseManager.courses.get(i).getName() + \", Section: \" + CourseManager.courses.get(i).getSection());\n\t\t}\n\t}", "public void display () {\n System.out.println(rollNo + \" \" + name + \" \" + college );\n }", "public String toString() {\r\n String string; //a string is created to hold the information about the student\r\n string = \"Name: \" + getName(); //the name is added to the string\r\n string = string + \", Gender: \" + getGender(); //gender is added\r\n string = string + \", Age: \" + getAge(); //age is added\r\n string = string + \", Courses enroled: \";\r\n if (getCourse().length == 0) {\r\n string = string + \"None\"; //returns none if the student is not enroled into a course\r\n } else {\r\n for (Course course : getCourse())\r\n string = string + course.getSubject().getDescription() + \" \"; //adds the subject description if theyre in a course\r\n }\r\n string = string + \", Certificates: \";\r\n if (getCertificates().size() == 0) {\r\n string = string + \"None\"; //displays none if the student has no certificates\r\n }\r\n for (Integer id : getCertificates().toArray(new Integer[getCertificates().size()])) {\r\n string = string + id + \" \"; //adds each id of each course completed\r\n }\r\n return string + \"\\n\";\r\n }", "public String print() {\r\n\t\t\r\n\t\tString printString = new String();\r\n\t\t\r\n\t\tif(numStudents == 0) {\r\n\t\t\tSystem.out.println(\"List is empty\");\r\n\t\t\tprintString = printString + \"List is empty\";\r\n\t\t\treturn printString;\r\n\t\t}\r\n \r\n\t\tSystem.out.println(\"\\nWe have the following Students:\\n\");\r\n\t\tprintString = printString + \"\\nWe have the following Students:\\n\";\r\n\r\n\t\tfor(int i = 0; i < numStudents; i++) {\r\n\t\t\t \r\n\t\t\tString student = ((Student)list[i]).toString();\r\n\t\t\tint tuitionDue = ((Student)list[i]).tuitionDue(); \r\n\t\t\t \r\n\t\t\t System.out.println(student + \" \" + \"tuition due: \" + tuitionDue);\r\n\t\t\t printString = printString + student + \" \" + \"tuition due: \" + tuitionDue + \"\\n\";\r\n\t\t }\r\n\t\t\r\n\t\tSystem.out.println(\"--End of List--\"); \r\n\t\tprintString = printString + \"--End of List--\";\r\n\t\t\r\n\t\treturn printString;\r\n\t}", "private static void printFinedStudents(){\n\t\tSet<Integer> keys = FINED_STUDENTS.keySet(); //returns list of all keys in FINED_STUDENTS\n\t\tint count = 0;\n\t\tSystem.out.println(\"Fined Students are: \");\n\t\tfor(int k : keys){\n\t\t\tcount ++;\n\t\t\tSystem.out.println(count + \". \" + FINED_STUDENTS.get(k));\n\t\t}\n\t\t\n\t\tif(keys.size() == 0)\n\t\t\tSystem.out.println(\"Empty! No Students have been fined\");\n\t}", "public String toString() {\n\t\treturn \"Student's name is \" + getname() + \".\" + System.lineSeparator() + \"Their Student ID number is \" \n\t\t\t\t+ getid() + \" while their course is \"+ getcourse() + System.lineSeparator();\n\t}", "public static void printRecord(int i) {\r\n\t\ttry {\r\n\t\t\tStudent tempRecord = studRecs.get(i);\r\n\t\t\tSystem.out.println(\"Printing information for student \" + i);\r\n\t\t\tSystem.out.println(\"Student ID: \" + tempRecord.getStudentID());\r\n\t\t\tSystem.out.println(\"First Name: \" + tempRecord.getFirstName());\r\n\t\t\tSystem.out.println(\"Last Name: \" + tempRecord.getLastName());\r\n\t\t\tSystem.out.println(\"Street Address: \" + tempRecord.getStreetAddress());\r\n\t\t\tSystem.out.println(\"City: \" + tempRecord.getCity());\r\n\t\t\tSystem.out.println(\"Province: \" + tempRecord.getProvince());\r\n\t\t\tSystem.out.println(\"Postal Code: \" + tempRecord.getPostalCode());\r\n\t\t\tSystem.out.println(\"Phone Number: \" + tempRecord.getPhoneNumber());\r\n\t\t\tSystem.out.println(\"Birth Date: \" + tempRecord.getBirthDate());\r\n\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\tSystem.out.println(\"Invalid student!\");\r\n\t\t}\r\n\t}", "public void printReport(){\n\t\tSystem.out.println(\"This is \" + name + \", UPENN \" + graduationYear);\n\t\tSystem.out.println(\"Their GPA is \" + GPA);\n\t\tString numCoursesString = \"\";\n\t\tif (numCoursesCompleted == 1){\n\t\t\tnumCoursesString=\"course\";\t//if the student has only taken one course, just print course\n\t\t}\n\t\telse{\n\t\t\tnumCoursesString=\"courses\"; //if the student has taken more than one course, print courses when called\n\t\t}\n\t\tSystem.out.println(\"They have taken \" + numCoursesCompleted + \" \" + numCoursesString); \n\t}", "public static void printListOfCourses() {\n for (Course x : listOfCourses) {\n System.out.println((listOfCourses.indexOf(x) + 1) + \")\" + x);\n System.out.println();\n }\n }", "public String toString() {\n\t\treturn \" Student: \" + getName() + \"\\t ID: \" + getIDnumber();\t\n\t}", "public static void main(String[] args) {\n Group aco21 = new Group();\n System.out.print(\"1. Create Student \\n 2. Show students \\n 3. Find by id\");\n Scanner sc = new Scanner(System.in);\n int choice1 = sc.nextInt();\n if (choice1 == 1)\n {\n\n System.out.print(\"input name, phone and birthyear on different lines \\n\");\n String n = sc.nextLine();\n String p = sc.nextLine();\n int y = sc.nextInt();\n Student k = new Student();\n k.init(n,p, y, aco21.listStud.size()+1);\n aco21.listStud.add(k);\n clearScreen();\n System.out.print(\"1. Create Student \\n 2. Show students \\n 3. Find by id\");\n choice1 = sc.nextInt();\n }\n if (choice1 == 2)\n {\n for (int i = 0; i<aco21.listStud.size(); i++)\n {\n String l = String.format(\"Name %s Number %s birthyear %d\", aco21.listStud.get(i).name, aco21.listStud.get(i).phone, aco21.listStud.get(i).birthYear);\n System.out.print(l);\n }\n clearScreen();\n System.out.print(\"1. Create Student \\n 2. Show students \\n 3. Find by id\");\n choice1 = sc.nextInt();\n }\n }", "public void outputGrades(){\n System.out.println(\"The grades are: \\n\");\n \n //gera a saida da nota de cada aluno\n for (int student = 0; student < grades.length; student++) {\n System.out.printf(\"Student %2d: %3d\\n\", student + 1, grades[ student ]);\n }\n }", "@Override\n\tpublic void print() {\n\t\tsuper.print();\n\t\tSystem.out.println(subjects);\n\t}", "public void getStudentNameStudentDsc()\n\t{\n\t\tDatabaseHandler db = new DatabaseHandler(getApplicationContext());\n\n\t\tstudent_name_list_studname_dsc = db.getStudentNameAllEnquiryStudentDsc();\n\t\tIterator itr = student_name_list_studname_dsc.iterator();\n\t\twhile(itr.hasNext())\n\t\t{\n\t\t\tSystem.out.println(itr.next());\n\t\t}\n\t}", "private void printMarks() {\r\n\r\n System.out.println(\"Marks: \");\r\n for(int i = 0; i < numberOfCourses; i++)\r\n System.out.println(marks[i] + \"%\\t\" + letterGrades[i]);\r\n }", "public static void studentText(){\n\t\tSystem.out.println(\"Enter: 1.'EXIT' 2.'ADD' 3.'REMOVE' 4.'FIND 5.'ENROLL' 6.'WITHDRAW' 7.'SCHEDULE' 8.'MORE' -for more detail about options\");\n\t}", "public void listOfCourses() {//admin cagirisa bulunna kurslarin hepsi\n if (Courses.size() != 0) {\n System.out.printf(\"%s kullanicisinin dersleri\\n\", this.getUsername());\n for (int i = 0; i < this.Courses.size(); ++i) {\n System.out.printf(\"%d-%s\\n\", i, Courses.get(i));\n }\n } else {\n System.out.printf(\"%s kullanicinin dersi yok\\n\", this.getUsername());\n }\n }", "public void printt() {\n for (int i=0 ; i<number ; i++) {\n System.out.println(\"LAB\" + (i+1) + \" ON \" + labs[i].getDay() + \" TEACHING BY: \" + labs[i].getTeacher());\n for (int j=0 ; j<labs[i].getCurrentSize() ; j++) {\n System.out.println(labs[i].getStudents()[j].getFirstName() + \" \" + labs[i].getStudents()[j].getLastName() + \" \" + labs[i].getStudents()[j].getId() + \" \" +labs[i].getStudents()[j].getGrade());\n }\n System.out.println(\"THE CAPACITY OF THE LAB IS: \" + labs[i].getCapacity());\n System.out.println(\"THE AVERAGE IS : \" + labs[i].getAvg());\n System.out.println();\n }\n }", "public String toString(Student s){\r\n\r\n\r\n\t\treturn \"******************************************************\\n*\"+ \r\n\r\n\t\t\t\t\t\" Name #\"+\" \"+s.getName()+\"\\n*\"+\r\n\t\t\t\t\t\" id number # \"+s.getId()+ \"\\n*\"+\r\n\t\t\t\t\t\" Grades # \"+s.getGrade(0)+\" |\"+ s.getGrade(1)+\" |\"+s.getGrade(2)+\"\\n*\"+\r\n\t\t\t\t\t\" Grade Average# \"+ s.getAverage()+\"\\n*\"+\r\n\t\t\t\t\t\" Letter Grade # \"+ s.getLetterGrade(s.getAverage())+\r\n\t\t\t\t\t\"\\n******************************************************\\n\";\r\n\r\n\r\n\t}", "public static void userDisplay() {\n\n String nameList = \" | \";\n for (String username : students.keySet()) {\n nameList += \" \" + username + \" | \";\n\n\n }\n System.out.println(nameList);\n// System.out.println(students.get(nameList).getGrades());\n\n }", "public static void main(String[] args){\n\t\tPersonalData data1= new PersonalData(1982,01,11,234567890);\n\t\tPersonalData data2= new PersonalData(1992,10,19,876543210);\n\t\tPersonalData data3= new PersonalData(1989,04,27,928374650);\n\t\tPersonalData data4= new PersonalData(1993,07,05,819463750);\n\t\tPersonalData data5= new PersonalData(1990,11,03,321678950);\n\t\tPersonalData data6= new PersonalData(1991,11,11,463728190);\n\t\tStudent student1=new Student(\"Ali Cantolu\",5005,50,data1);\n\t\tStudent student2=new Student(\"Merve Alaca\",1234,60,data2);\n\t\tStudent student3=new Student(\"Gizem Kanca\",5678,70,data3);\n\t\tStudent student4=new Student(\"Emel Bozdere\",8902,70,data4);\n\t\tStudent student5=new Student(\"Merter Kazan\",3458,80,data5);\n\n\t\t//A course (let us call it CSE141) with a capacity of 3 is created\n\t\tCourse CSE141=new Course(\"CSE141\",3);\n\n\t\t//Any 4 of the students is added to CSE141.\n\t\tif (!CSE141.addStudent(student1)) System.out.println(student1.toString()+ \" is not added\");\n\t\tif (!CSE141.addStudent(student2)) System.out.println(student2.toString()+ \" is not added\");\n\t\tif (!CSE141.addStudent(student3)) System.out.println(student3.toString()+ \" is not added\");\n\t\tif (!CSE141.addStudent(student4)) System.out.println(student4.toString()+ \" is not added\");\n\n\n\t\t//All students of CSE141 are printed on the screen.\n System.out.println(\"\\nAll students of \"+CSE141.getCourseName()+\": \");\n CSE141.list();\n\n //The capacity of CSE141 is increased.\n CSE141.increaseCapacity();\n\n //Remaining 2 students are added to CSE141.\n\t \tCSE141.addStudent(student4);\n\t \tCSE141.addStudent(student5);\n\n\t \t//All students of CSE141 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE141.getCourseName()+\": \");\n\t \tCSE141.list();\n\n\t \t//Student with ID 5005 is dropped from CSE141.\n\t \tCSE141.dropStudent(student1);\n\n\t \t//All students of CSE141 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE141.getCourseName()+\": \");\n\t \tCSE141.list();\n\n\t \t//Number of students enrolled to CSE141 is printed.\n\t \tSystem.out.println(\"\\nNumber of students enrolled to \"+CSE141.getCourseName()+\": \" + CSE141.getNumberOfStudents());\n\n\t \t//Birth year of best student of CSE141 is printed on the screen. (You should use getYear() method of java.util.Date class.)\n\t \tSystem.out.println(\"\\nBirth year of best student of CSE141 is \"+CSE141.getBestStudent().getPersonalData().getBirthDate().getYear());\n\n\t \t//A new course (let us call it CSE142) is created.\n\t \tCourse CSE142=new Course(\"CSE142\");\n\n\t \t//All students currently enrolled in CSE141 are added to CSE142. (You should use getStudents() method).\n\t \tStudent[] students = CSE141.getStudents();\n\t \tfor(int i=0;i<CSE141.getNumberOfStudents();i++)\n\t \t\tCSE142.addStudent(students[i]);\n\n\t \t//All students of CSE141 are removed from the course.\n\t \tCSE141.clear();\n\n\t \t//Student with ID 5005 is dropped from CSE141 and result of the operation is printed on the screen.\n\t \tSystem.out.println(\"\\nThe result of the operation 'Student with ID 5005 is dropped from \"+CSE141.getCourseName()+\"' is: \"+CSE141.dropStudent(student1));\n\n\t \t//All students of CSE142 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE142.getCourseName()+\": \");\n\t \tCSE142.list();\n\n\t \t//Best student of CSE142 is dropped from CSE142.\n\t \tCSE142.dropStudent(CSE142.getBestStudent());\n\n\t \t//All students of CSE142 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE142.getCourseName()+\": \");\n\t \tCSE142.list();\n\n\t \t//GPA of youngest student of CSE142 is printed on the screen.\n\t\tSystem.out.println(\"\\nThe Youngest Student's (\"+CSE142.getYoungestStudent()+\") GPA is \"+CSE142.getYoungestStudent().GPA());\n\n\t \t//Courses CSE141 and CSE142 are printed on the screen.\n\t \tSystem.out.println(\"\\nCourse Information for \"+CSE141.getCourseName()+\":\\n\" + CSE141.toString());\n\t \tSystem.out.println(\"\\nCourse Information for \"+CSE142.getCourseName()+\":\\n\" + CSE142.toString());\n\t }", "@Override\n\tpublic String toString() {\n\t\treturn \" \" + getStudentId() + \":\" + getStudentName();\n\t}", "public static void printSchoolName(){\n System.out.println(\"School name is \"+school);\n }", "void display(){\n\t \t\r\n\t \t\r\n\t \tSystem.out.println(\"Student id :\" +id);\r\n\t \t //system : system is a class in java language.lang package\r\n\t\t \t//out : out is the static member of system class.It's type PrintStream\r\n\t\t \t//println: which is used to print the output.\r\n\t \tSystem.out.println(\"Student name: \" +name);\r\n\t \t //system : system is a class in java language.lang package\r\n\t\t \t//out : out is the static member of system class.It's type PrintStream\r\n\t\t \t//println: which is used to print the output.\r\n\t \tSystem.out.println(\"Student marks: \" +marks);\r\n\t \t //system : system is a class in java language.lang package\r\n\t\t \t//out : out is the static member of system class.It's type PrintStream\r\n\t\t \t//println: which is used to print the output.\r\n\t \t\r\n\t \t}", "public void printInOrder() {\n\t\tCollections.sort(students);\n\t\tSystem.out.println(\"Student Score List\");\n\t\tfor(Student student : students) {\n\t\t\tSystem.out.println(student);\n\t\t}\n\t\tSystem.out.println();\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"student ID --> \"+this.studentID+\", Name --> \"+this.studentName;\n\t}", "public void print() {\r\n\t\tint size = list.size();\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"┌───────────────────────────┐\");\r\n\t\tSystem.out.println(\"│ \t\t\t성적 출력 \t\t │\");\r\n\t\tSystem.out.println(\"└───────────────────────────┘\");\r\n\r\n\t\tfor (int i = 0; i < size; i++) {\r\n\r\n\t\t\tExam exam = list.get(i);\r\n\t\t\tint kor = exam.getKor();\r\n\t\t\tint eng = exam.getEng();\r\n\t\t\tint math = exam.getMath();\r\n\r\n\t\t\tint total = exam.total();// kor + eng + math;\r\n\t\t\tfloat avg = exam.avg();// total / 3.0f;\r\n\t\t\tSystem.out.printf(\"성적%d > 국어:%d, 영어:%d, 수학:%d\", i + 1, kor, eng, math);\r\n\t\t\tonPrint(exam);\r\n\t\t\tSystem.out.printf(\"총점:%d, 평균:%.4f\\n\", total, avg);\r\n\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"─────────────────────────────\");\r\n\r\n\t}", "public String studentInfo()\n\t{\n\t\tString strStudentInfo;\n\t\tDecimalFormat percent = new DecimalFormat(\"0.0%\");\n\t\tdouble dRoundedCourseAverage;\n\t\tdouble dCourseAverage;\n\t\tdCourseAverage= courseAverage();\n\t\t\t\n\t\tdRoundedCourseAverage= Math.round(dCourseAverage);\n\t\tstrStudentInfo =\n\t\t(\"\\nName: \" + name +\n\t\t\"\\nCourse: \" + courseDesc +\n\t\t\"\\nNumber: \" + courseNum +\n\t\t\"\\nInstructor:\" + instructor +\n\t\t\"\\nGrades:\" +\n\t\t\"\\nTest: \\tAverage: \"+ average('t') +\"\\tPercent: \" + pctT +\n\t\t\"\\nQuizzes: \\tAverage: \"+ average('q') +\"\\tPercent: \" + pctQ +\n\t\t\"\\nProject: \\tAverage: \"+ average('p') +\"\\tPercent: \" + pctP +\n\t\t\"\\nCourse Average: \" + dCourseAverage + \"(or \"+\n\t\t\tpercent.format(dRoundedCourseAverage/100) + \")\");\n\t\treturn strStudentInfo;\n\t}", "public void prettyPrint() {\n\t\tArrayList<Course> mondayClasses = new ArrayList<Course>();\n\t\tArrayList<Course> tuesdayClasses = new ArrayList<Course>();\n\t\tArrayList<Course> wednesdayClasses = new ArrayList<Course>();\n\t\tArrayList<Course> thursdayClasses = new ArrayList<Course>();\n\t\tArrayList<Course> fridayClasses = new ArrayList<Course>();\n\n\t\tfor (Course c : this.courses) {\n\t\t\tif (c.days.get(0)) {\n\t\t\t\tmondayClasses.add(c);\n\t\t\t}\n\t\t\tif (c.days.get(1)) {\n\t\t\t\ttuesdayClasses.add(c);\n\t\t\t}\n\t\t\tif (c.days.get(2)) {\n\t\t\t\twednesdayClasses.add(c);\n\t\t\t}\n\t\t\tif (c.days.get(3)) {\n\t\t\t\tthursdayClasses.add(c);\n\t\t\t}\n\t\t\tif (c.days.get(4)) {\n\t\t\t\tfridayClasses.add(c);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"----Monday----\");\n\t\tfor (Course c : mondayClasses) {\n\t\t\tSystem.out.println(c.inDay(0));\n\t\t}\n\t\tSystem.out.println(\"----Tuesday----\");\n\t\tfor (Course c : tuesdayClasses) {\n\t\t\tSystem.out.println(c.inDay(1));\n\t\t}\n\t\tSystem.out.println(\"----Wednesday----\");\n\t\tfor (Course c : wednesdayClasses) {\n\t\t\tSystem.out.println(c.inDay(2));\n\t\t}\n\t\tSystem.out.println(\"----Thursday----\");\n\t\tfor (Course c : thursdayClasses) {\n\t\t\tSystem.out.println(c.inDay(3));\n\t\t}\n\t\tSystem.out.println(\"----Friday----\");\n\t\tfor (Course c : fridayClasses) {\n\t\t\tSystem.out.println(c.inDay(4));\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(this.toString());\n\t}", "public void printAllStudent(Student st[], int index) {\n\t\tSystem.out.println(\"\\n--- 전제 학생 정보 출력---\");\n\t\tSystem.out.println(\"이름\\t나이\\t주소\");\n\t\tfor(int i=0;i<index;i++) {\n\t\t\tSystem.out.println(st[i].getName()+\"\\t\"+st[i].getAge()+\"\\t\"+st[i].getAddr());\n\t\t}\n\t}", "private void printAllStudentInDB(){\n ArrayList studentInformation = AdminManager.loadDBStudentInformation();\n System.out.println(\"--------------------------------------------------------------------------------------\");\n System.out.println(\"USERNAME STUDENT NAME MATRIC NUMBER GENDER NATIONALITY\");\n System.out.println(\"--------------------------------------------------------------------------------------\");\n\n for(int i=0; i<studentInformation.size();i++){\n String st = (String)studentInformation.get(i);\n StringTokenizer star = new StringTokenizer(st, \",\");\n System.out.print(String.format(\"%7s \",star.nextToken().trim()));\n String printPassword = star.nextToken().trim();\n System.out.println(String.format(\"%20s %9s %6s %s\",star.nextToken().trim(),star.nextToken().trim(),star.nextToken().trim(),star.nextToken().trim()));\n }\n System.out.println(\"--------------------------------------------------------------------------------------\\n\");\n }", "private void viewAllStudents() {\n Iterable<Student> students = ctrl.getStudentRepo().findAll();\n students.forEach(System.out::println);\n }", "private void retrieveStudentsEnrolledForACourse() {\n Scanner sc = new Scanner(System.in);\n Course c;\n while (true) {//Der Kursname sollte existieren\n System.out.print(\"Course ID: \");\n Long id = Long.parseLong(sc.next());\n c = ctrl.getCourse(id);\n if (c == null)\n System.out.println(\"Course with this ID doesn't exist! Please try again!\");\n else\n break;\n }\n\n //Wir rufen die eingeschriebenen Studenten Funktion von dem Controller\n System.out.println(\"Students enrolled for the course: \");\n ctrl.retrieveStudentsEnrolledForACourse(c);\n }", "public void display(){\n\t\tSystem.out.print(programGrade + \" \" + examGrade );\n\t\t\n\t\t\n\t}", "public static void print(ArrayList<Course> list) {\r\n\r\n\t\tif (list.isEmpty()) {\r\n\t\t\tSystem.out.println(\"Your Course list is empty :( \");\r\n\t\t}\r\n\r\n\t\tfor (Course course : list) {\r\n\t\t\tSystem.out.println(course.numberOfStudents + \" \" + course.courseName + \" \" + course.courseLecturer + \" \");\r\n\t\t}\r\n\t}", "public void printGrades() {\n System.out.print(this);\n for (int i = 0; i < numCourses; ++i) {\n System.out.print(\" \" + courses[i] + \":\" + grades[i]);\n }\n System.out.println();\n }", "@Override\npublic ArrayList<String> courses() {\n\tArrayList<String> studentCourses = new ArrayList<String>();\n\tstudentCourses.add(\"CMPE - 273\");\n\tstudentCourses.add(\"CMPE - 206\");\n\tstudentCourses.add(\"CMPE - 277\");\n\tSystem.out.println(this.name+\" has take these courses\");\n\tfor(int i = 0 ; i < studentCourses.size() ; i++){\n\t\tSystem.out.println( studentCourses.get(i));\n\t}\n\treturn null;\n}", "public void study() {\n\t\tSystem.out.println(\"I'm a good student.\");\n\t}", "public void mostrarSocios()\n\t{\n\t\t//titulo libro, autor\n\t\tIterator<Socio> it=socios.iterator();\n\t\t\n\t\tSystem.out.println(\"***********SOCIOS***********\");\n\t\tSystem.out.printf(\"\\n%-40s%-40s\", \"NOMBRE\" , \"APELLIDO\");\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tSocio socio=(Socio)it.next();\n\t\t\tSystem.out.printf(\"\\n%-40s%-40s\\n\",socio.getNombre(),socio.getApellidos());\n\t\t}\n\t}", "public String toString(){\n\t\t \n\t\treturn this.scholarship + \": \" + this.student + \", Date Submitted: \" + this.date + \", GPA: \" + this.gpa + \", Education Level: \" + this.edulvl + \", Priority: \" + this.priority + \", Status: \" + this.status;\n\t}", "public static void studentExtended(){\n\t\tSystem.out.println(\"Enter 'EXIT' to exit to the Main Menu\");\n\t\tSystem.out.println(\"Enter 'ADD' followed by: studentID, studentName, major, class, and GPA to add a student record\");\n\t\tSystem.out.println(\"Enter 'REMOVE' followed by a studentID to remove a student\");\n\t\tSystem.out.println(\"Enter 'FIND' followed by a studentID or studentName to pull up student's information\");\n\t\tSystem.out.println(\"Enter 'ENROLL' followed by a studentID, deptID and course_Number to enroll a student\");\n\t\tSystem.out.println(\"Enter 'WITHDRAW' followed by a studentID, deptID and course_Number to withdraw a student in a course\");\n\t\tSystem.out.println(\"Enter 'SCHEDULE' followed by a studentID or studentName to list all courses student is enrolled in.\");\n\t}", "public String toString() {\n String o = \"\";\n for (Student v : students) {\n boolean first = true;\n o += \"Student \";\n o += v.getName();\n o += \" has neighbors \";\n ArrayList<Student> ngbr = v.getNeighbors();\n for (Student n : ngbr) {\n o += first ? n.getName() : \", \" + n.getName();\n first = false;\n }\n first = true;\n o += \" with prices \";\n ArrayList<Integer> wght = v.getPrices();\n for (Integer i : wght) {\n o += first ? i : \", \" + i;\n first = false;\n }\n o += System.getProperty(\"line.separator\");\n\n }\n\n return o;\n }", "abstract public void showAllStudents();", "public String displayCourse(){\n return \"\\tCourse Id: \" + id + \"\\n\" +\n \"\\tCourse Name: \" + name + \"\\n\" +\n \"\\tCourse Description: \" + description + \"\\n\" +\n \"\\tCourse Teacher(s): \" + teacherString() + \"\\n\";\n }", "public void show()\n {\n System.out.println( getFullName() + \", \" +\n String.format(Locale.ENGLISH, \"%.1f\", getAcademicPerformance()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getSocialActivity()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getCommunicability()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getInitiative()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getOrganizationalAbilities())\n );\n }", "public static void main (String [] args) {\n Address school = new Address(\"800 Lancaster Ave.\", \"Villanova\",\n \"PA\", 19085);\n //create home address objects for a number of students\n Address home1 = new Address(\"21 Jump Street\", \"Blacksburg\",\n \"VA\", 24551);\n Address home2 = new Address(\"123 Main Street\", \"Euclid\", \"OH\", \n 44132);\n Address home3 = new Address(\"5248 Fortress Circle\", \"Valdosta\",\n \"GA\", 31605);\n Address home4 = new Address(\"505 Cedar Drive\", \"Nashville\",\n \"GA\", 31639);\n //create students\n Student student1 = new Student(\"Rick\",\"Sanchez\",home1,school,99,100,97,94);\n Student student2 = new Student(\"Morty\",\"Smith\" ,home2,school,14,28,37,55); \n Student student3 = new Student(\"Zach\",\"Spencer\",home3,school,98,89,86,95);\n Student student4 = new Student(\"Arron\",\"Croft\" ,home4,school,84,99,90,75);\n //create a CS1301 A course\n Course cs1301A = new Course(\"CS1301 A\");\n //create a CS1301 B course\n Course cs1301B = new Course(\"CS1301 B\"); \n //assign some students to CS1301 A\n cs1301A.addStudent(student1);\n cs1301A.addStudent(student2);\n //assign some students to CS1301 B\n cs1301B.addStudent(student3); \n cs1301B.addStudent(student4);\n //get the averages of the 2 courses\n System.out.println(\"*** Averages of CS1301 Courses ***\");\n System.out.println(\"CS1301 A: \"+cs1301A.average());\n System.out.println(\"CS1301 B: \"+cs1301B.average());\n //display the roll for the 2 courses\n System.out.println(\"\\n*** Roll Call ***\");\n cs1301A.roll();\n cs1301B.roll(); \n }", "public String toString() {\r\n\t\treturn \"Student ID: \" + this.studentID + \"\\n\" + \r\n\t\t\t\t\"Name and surname: \" + this.name + \"\\n\" + \r\n\t\t\t\t\"Date of birth: \" + this.dateOfBirth + \"\\n\" + \r\n\t\t\t\t\"University:\" + this.universityName + \"\\n\" + \r\n\t\t\t\t\"Department code: \" + this.departmentCode + \"\\n\" + \r\n\t\t\t\t\"Department: \" + this.departmentName + \"\\n\" +\r\n\t\t\t\t\"Year of enrolment: \" + this.yearOfEnrolment;\r\n\t}", "public void print()\n {\n System.out.println(\"Course: \" + title + \" \" + codeNumber);\n \n module1.print();\n module2.print();\n module3.print();\n module4.print();\n \n System.out.println(\"Final mark: \" + finalMark + \".\");\n }", "public String toString() {\r\n\t\treturn \"Student \" + imePrezime + \" studira \" + fakultet + \" fakultet \" + \r\n\t\t\t\t\"i trenutno je na \" + godina + \". godini\";\r\n\t}", "@Override\r\n public String toString() \r\n {\r\n return (String.format(\"#%d\\t %-20s\\t %-10s\\n\", this.studentId, this.studentName, this.studentMajor));\r\n }", "private void printAllCourseInDB(){\n\n System.out.println(\"--------------------------------------------------------------------------------------\");\n System.out.println(\"COURSE SCHOOL AU INDEX SLOT TYPE DAY TIME\");\n System.out.println(\"--------------------------------------------------------------------------------------\");\n ArrayList<String> courseIDList = courseMgr.readAllCourseIDFromDB();\n for(String courseID: courseIDList){\n System.out.print(String.format(\"%6s \", courseID));\n Course course = courseMgr.readCourseByID(courseID);\n System.out.print(String.format(\"%5s \", course.getSchool()));\n int j = 0;\n for(CourseIndex courseIndex:course.getCourseIndices()){\n if (j==0)\n System.out.print(String.format(\" %d \", courseIndex.getAu()));\n else\n System.out.print(String.format(\" \", courseIndex.getAu()));\n System.out.print(String.format(\"%6s \", courseIndex.getIndex()));\n System.out.print(String.format(\"%3d \", courseIndex.getSlot()));\n int i = 0;\n for (CourseCompo courseCompo : courseIndex.getCourseCompos()){\n if(i==0){\n System.out.print(String.format(\"%3s \", courseCompo.getCompoType()));\n System.out.print(String.format(\"%3s \", courseCompo.getDay()));\n System.out.println(String.format(\"%3s \", courseCompo.getTimeSlot()));\n }\n else{\n System.out.print(String.format(\" %3s \", courseCompo.getCompoType()));\n System.out.print(String.format(\"%3s \", courseCompo.getDay()));\n System.out.println(String.format(\"%3s \", courseCompo.getTimeSlot()));\n }\n i++;\n }\n j++;\n System.out.println(\"\");\n }\n }\n\n System.out.println(\"--------------------------------------------------------------------------------------\\n\");\n }", "public String getStudents(){\n\t\treturn this.students;\n\t}", "public String toString()\n\t{\n\t\tString str = \"\";\n\t\tfor (int i = 0; i < numStudents; i++)\n\t\t\tstr += students[i].toString() + '\\n';\n\t\treturn str;\n\t}", "public static void main(String[] args) {\n\t\tStudent s = new Student(\"Bora\", \"Boric\", 1989, 39998, 3, 7.59);\r\n\t\tStudent s1 = new Student(\"Mika\", \"Mikic\", 1998, 39322, 1, 8.59);\r\n\t\tStudent s2 = new Student(\"Kasa\", \"Kasic\", 1991, 39299, 2, 8.94);\r\n\t\tProfesor p = new Profesor(\"Stanko\", \"Stanic\", 1980, \"Predavac\");\r\n\t\tProfesor p1 = new Profesor(\"Sasa\", \"Sasic\", 1984, \"Asistent\");\r\n\t\tp.dodajPredmet(\"Statistika\");\r\n\t\tp.dodajPredmet(\"Matematika\");\r\n\t\tp1.dodajPredmet(\"Teorija cena\");\r\n\t\tp1.dodajPredmet(\"Makroekonomija\");\r\n\t\tSystem.out.println(s.ispis());\r\n\t\tSystem.out.println(s1.ispis());\r\n\t\tSystem.out.println(s2.ispis());\r\n\t\tSystem.out.println(p.ispisi());\r\n\t\tSystem.out.println(p1.ispisi());\r\n\r\n\t}", "public void PrintDepartmentStudentsInfo(String depName) {\n\t\tdNode search = FindByName(depName);\n\t\tif (search != null)\n\t\t\tsearch.data.PrintDepartmentStudents();\n\t\telse\n\t\t\tSystem.out.println(\"Could not find Department @ Print Departments Studenent Info Function\");\n\t}", "public String toString()\n {\n\t\t //Local Constants\n\n\t\t //Local Variables\n DecimalFormat fmt = new DecimalFormat(\"0.00\");\n\n //creates a string and stores it in strDisplay\n\t\tsemDisplay = Util.setLeft(14, sTerm) + \"\\n\";\n\t\tsemDisplay += Util.setLeft(15, \" Name \\t\" + \" Grade \\t\" + \" Credit Hours \\t\" + \" Grade Points \\t\") + \"\\n\";\n\n\n\n for(int i = 0; i<courseCount; i++)\n {\n\t\t semDisplay += courses[i].toString() + \"\\n\";\n\t }\n\n\t semDisplay += \"\\n\";\n\n\t //semDisplay += Util.setLeft(15, \" Total Hours \\t\" + \" Total Grade Points \\t\" + \" Semester GPA\") + \"\\n\";\n\n\t semDisplay += Util.setLeft(16,\"ttlCrHrs : \" +tlHours ) + Util.setLeft(3,\"ttlGrdPts : \" +\n\t fmt.format(grPts) + Util.setLeft(4,\"GPA: \"+ fmt.format(sGpa)));\n\n\t //semDisplay += Util.setLeft(16,\"ttlGrdPts : \" + fmt.format(grPts));\n\t //semDisplay += Util.setLeft(16,\"GPA: \"+ fmt.format(sGpa));\n\n\t //returns strDisplay\n return semDisplay;\n\n }", "public void firstSem4() {\n chapter = \"firstSem4\";\n String firstSem4 = \"You're sitting at your computer - you can't sleep, and your only companions are \"+student.getRmName()+\"'s \" +\n \"snoring and Dave Grohl, whose kind face looks down at you from your poster. Your head is buzzing with everything you've \" +\n \"seen today.\\tA gentle 'ding' sounds from your computer, and you click your email tab. It's a campus-wide message \" +\n \"from the president, all caps, and it reads as follows:\\n\\t\" +\n \"DEAR STUDENTS,\\n\" +\n \"AS YOU MAY HAVE HEARD, THERE HAVE BEEN SEVERAL CONFIRMED INTERACTIONS WITH THE CAMPUS BEAST. THESE INTERACTIONS\" +\n \" RANGE FROM SIGHTINGS (17) TO KILLINGS (6). BE THIS AS IT MAY, REST ASSURED THAT WE ARE TAKING EVERY NECESSARY \" +\n \"PRECAUTION TO ENSURE STUDENT WELL-BEING. WE ARE ALL DEDICATED TO MAKING \"+(student.getCollege().getName()).toUpperCase()+\n \" A SAFE, INCLUSIVE ENVIRONMENT FOR ALL. TO CONTRIBUTE, I ASK THAT YOU DO YOUR PART, AND REPORT ANY SIGHTINGS, MAIMINGS,\" +\n \" OR KILLINGS TO PUBLIC SAFETY WITHIN A REASONABLE AMOUNT OF TIME. ENJOY YOUR STUDIES!\\nTOODOLOO,\\nPRESIDENT DOUG\";\n getTextIn(firstSem4);\n }", "public String toString () {\r\n String display = courseCode;\r\n display += \"\\nDepartment: \" + department;\r\n display += \"\\nGrade: \" + grade;\r\n return display;\r\n }", "public String DisplayStudentsGPA()\n\t{\t\n\t\tString studentList= \"\";\n\t\tint i=1; //iterates the leading number for each student on the list\n\t\tfor(Student b : classRoll) //loops through classRoll adding students to the list\n\t\t{\n\t\t\tstudentList += i + \". \" + b.getStrNameFirst ( ) + \" \" + b.getStrNameLast ( ) + \" \" + b.getfGPA ( ) +\"\\n\";\n\t\t\ti++;\n\t\t}\n\t\treturn studentList= getCourseName() +\"\\n\" + getCourseNumber()+\"\\n\" + getInstructor()+ \"\\n\" + studentList;\n\t}" ]
[ "0.72335696", "0.7221305", "0.7172286", "0.71580696", "0.7157518", "0.7124103", "0.7059742", "0.6949251", "0.6763683", "0.6743081", "0.66763175", "0.6656039", "0.6628121", "0.6578053", "0.65361005", "0.6528693", "0.6512984", "0.6497485", "0.64806265", "0.64659995", "0.64572567", "0.6429288", "0.6392734", "0.635272", "0.6352249", "0.6348639", "0.63245374", "0.63032746", "0.6291315", "0.6269501", "0.6262065", "0.62521255", "0.62513626", "0.6243512", "0.6240106", "0.62387735", "0.623583", "0.6233893", "0.6230391", "0.6191628", "0.6153636", "0.6151619", "0.6145561", "0.6145359", "0.614152", "0.6128573", "0.6091306", "0.6079247", "0.60771227", "0.60724074", "0.60701513", "0.6047507", "0.60374993", "0.60202366", "0.60126907", "0.60027355", "0.59958535", "0.59931546", "0.5963917", "0.596207", "0.5956852", "0.59313715", "0.5925488", "0.5900244", "0.5896848", "0.58942634", "0.589187", "0.5889413", "0.5887494", "0.5884693", "0.58829015", "0.58731025", "0.58664286", "0.58627903", "0.5838754", "0.58378595", "0.58294266", "0.582465", "0.58184224", "0.58060694", "0.5800659", "0.57925314", "0.5790527", "0.5785644", "0.57803005", "0.5780245", "0.5777758", "0.5777054", "0.5776171", "0.5772279", "0.5770436", "0.5766359", "0.5752901", "0.5748687", "0.57453096", "0.5742175", "0.5724157", "0.5709879", "0.570829", "0.56969976" ]
0.705727
7
/==========================PORTAL DO ESTUDANTE=============================== Delivers a project of the given discipline
public void deliverProject(String disciplineName, String nameProject, String deliveryMessage) throws InvalidDisciplineException, InvalidProjectException{ int id = _person.getId(); Student _student = getStudents().get(id); _student.deliverProject(disciplineName, nameProject, deliveryMessage, id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createProject(String nameProject, String nameDiscipline) throws \n InvalidDisciplineException,InvalidProjectException{\n int id = _person.getId();\n Professor _professor = getProfessors().get(id);\n _professor.createProject(nameProject, nameDiscipline);\n }", "private static void finalise_project() {\r\n\t\tDate deadline_date = null;\r\n\t\tint paid = 0;\r\n\t\tint charged = 0;\r\n\t\tString project_name = \"\";\r\n\t\tString email = \"\";\r\n\t\tString number = \"\";\r\n\t\tString full_name = \"\";\r\n\t\tString address = \"\";\r\n\t\tDate completion_date = null;\r\n\t\t\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Select a project ID to modify it.\");\r\n\t\t\t\r\n\t\t\t// Prints out all project ids and names that are not complete:\r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects INNER JOIN project_statuses ON \"\r\n\t\t\t\t\t+ \"projects.project_id = project_statuses.project_id INNER JOIN people ON projects.project_id = people.projects \"\r\n\t\t\t\t\t+ \"WHERE project_statuses.status <>'Complete';\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\t// This creates a list of project ids to check that the user only selects an available one\r\n\t\t\tArrayList<Integer> project_id_list = new ArrayList<Integer>(); \r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tSystem.out.println(\"ID: \" + project_rset.getInt(\"project_id\") + \", Name:\" + project_rset.getString(\"project_name\"));\r\n\t\t\t\tproject_id_list.add(project_rset.getInt(\"project_id\"));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows user to select a project to finalize \r\n\t\t\tBoolean select_project = true;\r\n\t\t\tint project_id = 0;\r\n\t\t\twhile (select_project == true) {\r\n\t\t\t\tSystem.out.println(\"Project ID: \");\r\n\t\t\t\tString project_id_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tproject_id = Integer.parseInt(project_id_str);\r\n\t\t\t\t\tfor (int i = 0; i < project_id_list.size(); i ++) {\r\n\t\t\t\t\t\tif (project_id == project_id_list.get(i)) { \r\n\t\t\t\t\t\t\tselect_project = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (select_project == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available project id.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for project number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The project number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Gets values needed from the selected project\r\n\t\t\tResultSet project_select_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_select_rset.next()) {\r\n\t\t\t\tif (project_select_rset.getInt(\"project_id\") == project_id) {\r\n\t\t\t\t\tproject_id = project_select_rset.getInt(\"project_id\");\r\n\t\t\t\t\tproject_name = project_select_rset.getString(\"project_name\");\r\n\t\t\t\t\tdeadline_date = project_select_rset.getDate(\"deadline_date\");\r\n\t\t\t\t\tpaid = project_select_rset.getInt(\"paid\");\r\n\t\t\t\t\tcharged = project_select_rset.getInt(\"charged\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Gets values needed from related customer\r\n // This gets the created project's table id to use to update the people and project_statuses tables \r\n\t\t\tString strSelectCustomer = String.format(\"SELECT * FROM people WHERE projects = '%s'\", project_id);\r\n\t\t\tResultSet customer_rset = stmt.executeQuery(strSelectCustomer);\r\n\t\t\twhile (customer_rset.next()) {\r\n\t\t\t\tfull_name = customer_rset.getString(\"name\") + \" \" + customer_rset.getString(\"surname\");\r\n\t\t\t\taddress = customer_rset.getString(\"address\");\r\n\t\t\t\temail = customer_rset.getString(\"email_address\");\r\n\t\t\t\tnumber = customer_rset.getString(\"telephone_number\");\r\n\t\t\t}\r\n\r\n\t\t\t// This updates the completion date\r\n\t\t\tBoolean update_completion_date = true;\r\n\t\t\twhile (update_completion_date == true) {\r\n\t\t\t\tSystem.out.print(\"Date Complete (YYYY-MM-DD): \");\r\n\t\t\t\tString completion_date_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcompletion_date = Date.valueOf(completion_date_str);\r\n\t\t\t\t\tupdate_completion_date = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for the completion date is in the wrong format\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The date must be in the format YYYY-MM-DD (eg. 2013-01-13). Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Updates the value\r\n\t\t\tPreparedStatement ps_finalise = conn.prepareStatement(\r\n\t\t\t\t\t\"UPDATE project_statuses SET completion_date = ?, status = ? WHERE project_id = ?;\");\r\n\t\t\tps_finalise.setDate(1, completion_date);\r\n\t\t\tps_finalise.setString(2, \"Complete\");\r\n\t\t\tps_finalise.setInt(3, project_id);\r\n\t\t\tps_finalise.executeUpdate();\r\n\t\t\tSystem.out.println(\"\\nUpdated completion date to \" + completion_date + \".\\n\");\r\n\t\t}\t\r\n\t\t/**\r\n\t\t * @exception If the project status table cannot be updated because of field constraints then an SQLException is thrown\r\n\t\t */\t\t\r\n\t\tcatch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t\t// Calculates the amount due and prints out an invoice\r\n\t\tint due = charged - paid;\r\n\t\tif (due > 0) {\r\n\t\t\tString content = \"\\t\\t\\t\\tInvoice\\n\" + \r\n\t\t\t\t\t\"\\nDate: \" + completion_date +\r\n\t\t\t\t\t\"\\n\\nName: \" + full_name +\r\n\t\t\t\t\t\"\\nContact Details: \" + email + \"\\n\" + number + \r\n\t\t\t\t\t\"\\nAddress: \" + address + \r\n\t\t\t\t\t\"\\n\\nAmount due for \" + project_name + \r\n\t\t\t\t\t\":\\nTotal Cost:\\t\\t\\t\\t\\t\\t\\tR \" + charged + \r\n\t\t\t\t\t\"\\nPaid: \\t\\t\\t\\t\\t\\t\\tR \" + paid +\r\n\t\t\t\t\t\"\\n\\n\\nDue: \\t\\t\\t\\t\\t\\t\\tR \" + due;\r\n\t\t\tCreateFile(project_name);\r\n\t\t\tWriteToFile(project_name, content);\r\n\t\t}\r\n\t}", "private static void add_project() {\r\n\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t\r\n\t\t\t//List of building types\r\n\t\t\tString[] building_types = new String[] {\"House\", \"Apartment Block\", \"Commercial Property\", \"Industrial Property\", \"Agricultural Building\"};\r\n\t\t\t\r\n\t\t\t// Variables that are needed\r\n\t\t\tint project_id = 0;\r\n\t\t\tString project_name = \"\";\r\n\t\t\tString building_type = \"\";\r\n\t\t\tString physical_address = \"\";\r\n\t\t\tint erf_num = 0;\r\n\t\t\tString cust_surname = \"\";\r\n\t\t\tDate deadline_date = null;\r\n\t\t\tint charged = 0;\r\n\t\t\t\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\t//So first we need to select the correct customer\r\n\t\t\tString strSelect = \"SELECT * FROM people WHERE type = 'Customer'\";\r\n\t\t\tResultSet rset = stmt . executeQuery ( strSelect );\r\n\t\t\t\r\n\t\t\t// Loops through available customers from the people table so that the user can select one\r\n\t\t\tSystem.out.println(\"\\nSelect a customer for the project by typing the customers number.\");\r\n\t\t\t// This creates a list of customer ids to check that the user only selects an available one\r\n\t\t\tArrayList<Integer> cust_id_list = new ArrayList<Integer>(); \r\n\t\t\twhile (rset.next()) {\r\n\t\t\t\tSystem.out.println ( \r\n\t\t\t\t\t\t\"Customer Num: \" + rset.getInt(\"person_id\") + \", Fullname: \" + rset.getString(\"name\") + \" \" + rset.getString(\"surname\"));\r\n\t\t\t\tcust_id_list.add(rset.getInt(\"person_id\"));\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to select a customer\r\n\t\t\tBoolean select_cust = true;\r\n\t\t\tint customer_id = 0;\r\n\t\t\twhile (select_cust == true) {\r\n\t\t\t\tSystem.out.println(\"Customer No: \");\r\n\t\t\t\tString customer_id_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcustomer_id = Integer.parseInt(customer_id_str);\r\n\t\t\t\t\tfor (int i = 0; i < cust_id_list.size(); i ++) {\r\n\t\t\t\t\t\tif (customer_id == cust_id_list.get(i)) { \r\n\t\t\t\t\t\t\tselect_cust = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (select_cust == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available customer id.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for customer id is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The customer number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Prints out all available building types form the building type list\r\n\t\t\tSystem.out.print(\"Select a building type by typing the number: \\n\");\r\n\t\t\tfor (int i=0; i < 5; i ++) {\r\n\t\t\t\tSystem.out.println((i + 1) + \": \" + building_types[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to select a building type\r\n\t\t\tBoolean select_building = true;\r\n\t\t\tint building_index = 0;\r\n\t\t\twhile (select_building == true) {\r\n\t\t\t\tSystem.out.println(\"Building type no: \");\r\n\t\t\t\tString building_type_select_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tbuilding_index = Integer.parseInt(building_type_select_str) - 1;\r\n\t\t\t\t\tbuilding_type = building_types[building_index];\r\n\t\t\t\t\tselect_building = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for building type is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The building type number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// User gets to decide whether they want an automatically generated name.\r\n\t\t\tBoolean select_project_name = true;\r\n\t\t\twhile (select_project_name == true) {\r\n\t\t\t\tSystem.out.println(\"Would you like to have the project automatically named (y or n)?\");\r\n\t\t\t\tString customer_project_name_choice = input.nextLine();\r\n\t\t\t\tif (customer_project_name_choice.equals(\"y\")){\r\n\t\t\t\t\t// Gets the customers surname for the project name\r\n\t\t\t\t\tString strSelectCustSurname = String.format(\"SELECT surname FROM people WHERE person_id = '%s'\", customer_id);\r\n\t\t\t\t\tResultSet cust_surname_rset = stmt . executeQuery ( strSelectCustSurname );\r\n\t\t\t\t\twhile (cust_surname_rset.next()) {\r\n\t\t\t\t\t\tcust_surname = cust_surname_rset.getString(\"surname\");\r\n\t\t\t\t\t\tproject_name = building_type + \" \" + cust_surname;\r\n\t\t\t\t\t\tSystem.out.println(\"Project name: \" + project_name);\r\n\t\t\t\t\t\tselect_project_name = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (customer_project_name_choice.equals(\"n\")) {\r\n\t\t\t\t\tSystem.out.println(\"Provide project name: \");\r\n\t\t\t\t\tproject_name = input.nextLine();\r\n\t\t\t\t\tselect_project_name = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!customer_project_name_choice.equals(\"y\") && !customer_project_name_choice.equals(\"n\")){\r\n\t\t\t\t\tSystem.out.println(\"You can only select either y or n. Please try again\");\r\n\t\t\t\t\tselect_project_name = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to enter an erf number\r\n\t\t\tBoolean select_erf_num = true;\r\n\t\t\twhile (select_erf_num == true) {\r\n\t\t\t\tSystem.out.print(\"ERF number: \");\r\n\t\t\t\tString erf_num_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\terf_num = Integer.parseInt(erf_num_str);\r\n\t\t\t\t\tselect_erf_num = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for erf number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The erf number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows the user to enter a physical address\r\n\t\t\tSystem.out.print(\"Physical Address: \");\r\n\t\t\tphysical_address = input.nextLine();\r\n\t\t\t\r\n\t\t\t// Allows the user to enter a date\r\n\t\t\tBoolean select_deadline_date = true;\r\n\t\t\twhile (select_deadline_date == true) {\r\n\t\t\t\tSystem.out.print(\"Deadline Date (YYYY-MM-DD): \");\r\n\t\t\t\tString deadline_date_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdeadline_date= Date.valueOf(deadline_date_str);\r\n\t\t\t\t\tselect_deadline_date = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for deadline date is not in the correct format\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The date must be in the format YYYY-MM-DD (eg. 2013-01-13). Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to enter a charged amount \r\n\t\t\tBoolean select_charged = true;\r\n\t\t\twhile (select_charged == true) {\r\n\t\t\t\tSystem.out.print(\"Total Cost: R \");\r\n\t\t\t\tString charged_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcharged = Integer.parseInt(charged_str);\r\n\t\t\t\t\tselect_charged = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for the charged amount is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The charged amount cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\t// This adds all the values to a prepared statement to update the projects table\r\n PreparedStatement ps = conn.prepareStatement(\"INSERT INTO projects (project_name , building_type, physical_address, erf_num) VALUES(?,?,?,?)\");\r\n ps.setString(1, project_name);\r\n ps.setString(2, building_type);\r\n ps.setString(3, physical_address);\r\n ps.setInt(4, erf_num);\r\n \r\n // Executes the statement\r\n ps.executeUpdate();\r\n \r\n // This gets the created project's table id to use to update the people and project_statuses tables \r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects WHERE project_name = '%s'\", project_name);\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tproject_id = project_rset.getInt(\"project_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This adds all the values to a prepared statement to update the people table\r\n\t\t\tPreparedStatement ps_customer = conn.prepareStatement(\r\n\t\t\t\t\t\"UPDATE people SET projects = ? WHERE person_id = ?;\");\r\n\t\t\tps_customer.setInt(1, project_id);\r\n\t\t\tps_customer.setInt(2, customer_id);\r\n\t\t\tps_customer.executeUpdate();\r\n \r\n\t\t\t// This adds all the values to a prepared statement to update the project_statuses table\r\n PreparedStatement ps_status = conn.prepareStatement(\"INSERT INTO project_statuses (charged , deadline_date, project_id) VALUES(?,?,?)\");\r\n ps_status.setInt(1, charged);\r\n ps_status.setDate(2, deadline_date);\r\n ps_status.setInt(3, project_id);\r\n ps_status.executeUpdate();\r\n\r\n // Once everything has been added to the tables the project that has been added gets printed out\r\n\t\t\tResultSet project_added_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_added_rset.next()){\r\n\t\t\t\tSystem.out.println(\r\n\t\t\t\t\t\t\"\\nProjects Added: \\n\" +\r\n\t\t\t\t\t\t\"Project Sys ID: \" + project_added_rset.getInt(\"project_id\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Project Name: \" + project_added_rset.getString(\"project_name\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Building Type: \" + project_added_rset.getString(\"building_type\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Physical Address: \" + project_added_rset.getString(\"physical_address\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Erf Number: \" + project_added_rset.getInt(\"erf_num\") + \"\\n\");\r\n\t\t\t}\r\n\t\t/**\r\n\t\t * @exception If any of the table entries cannot be created due to database constrains then the SQLException is thrown\r\n\t\t */\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}", "public Project getTasks(String projectId) {\n try {\n\n String selectProject = \"select * from PROJECTS where PROJECT_ID = ?\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(selectProject);\n ps.setString(1, projectId);\n ResultSet rs = ps.executeQuery();\n if (rs.next()) {\n String startdate = rs.getString(\"STARTDATE\");\n String invoicesent = rs.getString(\"INVOICESENT\");\n String hours = rs.getString(\"HOURS\");\n String client = \"\";\n String duedate = rs.getString(\"DUEDATE\");\n String description = rs.getString(\"DESCRIPTION\");\n Project p = new Project(client, description, projectId,\n duedate, startdate, hours, duedate, duedate,\n invoicesent, invoicesent);\n rs.close();\n ps.close();\n return p;\n } else {\n return null;\n }\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return null;\n }\n }", "private Project compileProject() {\n\t\t\tProject p = null;\n\t\t\t\n\t\t\tif(pType.equals(\"o\")) {\n\t\t\t\ttry {\n\t\t\t\t\tp = new OngoingProject(pCode.getText(), pName.getText(), dateFormat.parse(pSDate.getText()),pClient.getText(), dateFormat.parse(pDeadline.getText()), Double.parseDouble(pBudget.getText()), Integer.parseInt(pCompletion.getText()));\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t} else if(pType.equals(\"f\")) {\n\t\t\t\ttry {\n\t\t\t\t\tp = new FinishedProject(pCode.getText(), pName.getText(), dateFormat.parse(pSDate.getText()),pClient.getText(), dateFormat.parse(pEndDate.getText()), Double.parseDouble(pTotalCost.getText()));\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t\treturn p;\n\t\t}", "@Override\n public void executeAction() throws Exception {\n ContestServiceFacade contestServiceFacade = getContestServiceFacade();\n TCSubject currentUser = DirectStrutsActionsHelper.getTCSubjectFromSession();\n\n // get contest data and phases\n long contestId = getProjectId();\n SoftwareCompetition softwareCompetition \n = contestServiceFacade.getSoftwareContestByProjectId(currentUser, contestId);\n\n // set dashboard data etc. for the data above the final-fix tab\n DirectUtils.setDashboardData(currentUser, getProjectId(), viewData,\n getContestServiceFacade(), !DirectUtils.isStudio(softwareCompetition));\n ContestStatsDTO contestStats = DirectUtils.getContestStats(currentUser, getProjectId(), softwareCompetition);\n this.viewData.setContestStats(contestStats);\n\n this.viewData.setContestId(getProjectId());\n\n // Prepare the data for final fixes\n Phase[] phases = softwareCompetition.getProjectPhases().getAllPhases();\n Phase lastPhase = phases[phases.length - 1];\n\n // get final fix status\n boolean isApproval = lastPhase.getPhaseType().getId() == PhaseType.APPROVAL_PHASE.getId();\n boolean isFinalReview = lastPhase.getPhaseType().getId() == PhaseType.FINAL_REVIEW_PHASE.getId();\n \n // Get the winning submission\n Submission winningSubmission = null;\n List<Submission> submissions = DirectUtils.getStudioContestSubmissions(contestId,\n ContestRoundType.FINAL, currentUser, getContestServiceFacade());\n for (Submission submission : submissions) {\n if (submission.getPlacement() != null && submission.getPlacement() == 1) {\n winningSubmission = submission;\n }\n }\n\n if (isApproval) {\n boolean isApprovalRejected = false;\n Review[] reviewsByPhase =\n getProjectServices().getReviewsByPhase(contestId, lastPhase.getId());\n if (reviewsByPhase.length == 0) {\n this.viewData.setDataUnavailable(true);\n return;\n }\n Review approvalReview = reviewsByPhase[0];\n Comment approvalComment = DirectUtils\n .getReviewCommentByTypeId(CommentType.COMMENT_TYPE_APPROVAL_REVIEW.getId(), approvalReview);\n if (approvalComment != null) {\n isApprovalRejected = \"Rejected\".equalsIgnoreCase(String.valueOf(approvalComment.getExtraInfo()));\n }\n if (isApprovalRejected) {\n if (approvalReview.isCommitted()) {\n this.viewData.setFinalFixStatus(FinalFixStatus.IN_PROGRESS);\n } else {\n this.viewData.setFinalFixStatus(FinalFixStatus.NOT_STARTED);\n \n // Bind the Final Fix details based on approval review to view\n StudioFinalFix finalFix = new StudioFinalFix();\n Item[] approvalReviewItems = approvalReview.getAllItems();\n List<com.topcoder.direct.services.view.dto.contest.studio.Comment> finalFixComments \n = new ArrayList<com.topcoder.direct.services.view.dto.contest.studio.Comment>();\n for (Item item : approvalReviewItems) {\n Comment[] itemComments = item.getAllComments();\n for (Comment itemComment : itemComments) {\n com.topcoder.direct.services.view.dto.contest.studio.Comment com\n = new com.topcoder.direct.services.view.dto.contest.studio.Comment();\n com.setComment(itemComment.getComment());\n finalFixComments.add(com);\n }\n }\n finalFix.setComments(finalFixComments);\n finalFix.setSubmission(winningSubmission);\n this.viewData.setFinalFixes(Arrays.asList(finalFix));\n \n // Get the details for winning submitter\n if (winningSubmission != null) {\n Resource[] resources = softwareCompetition.getResources();\n for (int i = 0; i < resources.length; i++) {\n Resource resource = resources[i];\n if (resource.getId() == winningSubmission.getUpload().getOwner()) {\n this.viewData.setWinnerResource(resource);\n }\n }\n }\n }\n } else {\n throw new DirectException(\"The submission is already approved\");\n }\n } else if (isFinalReview) {\n Phase precedingPhase = phases[phases.length - 2];\n boolean isFinalFixPreceding = precedingPhase.getPhaseType().getId() == PhaseType.FINAL_FIX_PHASE.getId();\n boolean isPrecedingPhaseOpen = (precedingPhase.getPhaseStatus().getId() == PhaseStatus.OPEN.getId());\n boolean isPrecedingPhaseClosed = (precedingPhase.getPhaseStatus().getId() == PhaseStatus.CLOSED.getId());\n \n if (isFinalFixPreceding) {\n if (isPrecedingPhaseOpen) {\n this.viewData.setFinalFixStatus(FinalFixStatus.IN_PROGRESS);\n } else if (isPrecedingPhaseClosed) {\n Review[] reviewsByPhase =\n getProjectServices().getReviewsByPhase(contestId, lastPhase.getId());\n if (reviewsByPhase.length == 0) {\n this.viewData.setDataUnavailable(true);\n return;\n }\n Review finalReview = reviewsByPhase[0];\n \n Comment finalReviewComment = DirectUtils.getReviewCommentByTypeId(\n CommentType.COMMENT_TYPE_FINAL_REVIEW.getId(), finalReview);\n if (finalReviewComment == null) {\n this.viewData.setFinalFixStatus(FinalFixStatus.REVIEW);\n } else if (\"Rejected\".equalsIgnoreCase(String.valueOf(finalReviewComment.getExtraInfo()))) {\n if (finalReview.isCommitted()) {\n this.viewData.setFinalFixStatus(FinalFixStatus.IN_PROGRESS);\n } else {\n this.viewData.setFinalFixStatus(FinalFixStatus.REVIEW);\n }\n } else if (\"Approved\".equalsIgnoreCase(String.valueOf(finalReviewComment.getExtraInfo()))) {\n this.viewData.setFinalFixStatus(FinalFixStatus.COMPLETED);\n }\n }\n }\n\n // Bind data for all existing final fixes to view \n if (this.viewData.getFinalFixStatus() != FinalFixStatus.NOT_STARTED) {\n // Get the Final Fix submissions and convert them into map per project phase for faster lookup\n List<Submission> finalFixSubmissions = DirectUtils.getStudioContestSubmissions(contestId,\n ContestRoundType.STUDIO_FINAL_FIX_SUBMISSION, currentUser, getContestServiceFacade());\n Map<Long, Submission> finalFixSubmissionsMap = new HashMap<Long, Submission>();\n for (Submission finalFixSubmission : finalFixSubmissions) {\n finalFixSubmissionsMap.put(finalFixSubmission.getUpload().getProjectPhase(), finalFixSubmission);\n }\n\n List<StudioFinalFix> finalFixes = new ArrayList<StudioFinalFix>();\n for (int i = 0; i < phases.length; i++) {\n Phase phase = phases[i];\n if (phase.getPhaseType().getId() == PhaseType.FINAL_FIX_PHASE.getId()) {\n Review[] reviewsByPhase =\n getProjectServices().getReviewsByPhase(contestId, phases[i + 1].getId());\n if (reviewsByPhase.length == 0) {\n this.viewData.setDataUnavailable(true);\n return;\n }\n Review finalReview = reviewsByPhase[0];\n StudioFinalFix finalFix = new StudioFinalFix();\n Item[] finalReviewItems = finalReview.getAllItems();\n List<com.topcoder.direct.services.view.dto.contest.studio.Comment> finalFixComments\n = new ArrayList<com.topcoder.direct.services.view.dto.contest.studio.Comment>();\n Comment finalReviewAdditionalComment = null;\n for (Item item : finalReviewItems) {\n Comment[] itemComments = item.getAllComments();\n for (Comment itemComment : itemComments) {\n if (itemComment.getCommentType().getId() == CommentType.COMMENT_TYPE_REQUIRED.getId()) {\n com.topcoder.direct.services.view.dto.contest.studio.Comment com\n = new com.topcoder.direct.services.view.dto.contest.studio.Comment();\n com.setComment(itemComment.getComment());\n if (itemComment.getExtraInfo() != null) {\n com.setFixed(\"Fixed\".equalsIgnoreCase(String.valueOf(itemComment.getExtraInfo())));\n }\n finalFixComments.add(com);\n } else if (itemComment.getCommentType().getId() ==\n CommentType.COMMENT_TYPE_FINAL_REVIEW.getId()) {\n finalReviewAdditionalComment = itemComment;\n }\n }\n }\n finalFix.setComments(finalFixComments);\n if (finalReviewAdditionalComment != null) {\n finalFix.setAdditionalComment(finalReviewAdditionalComment.getComment());\n }\n finalFix.setSubmission(finalFixSubmissionsMap.get(phase.getId()));\n finalFix.setCommitted(finalReview.isCommitted());\n finalFixes.add(finalFix);\n }\n }\n this.viewData.setFinalFixes(finalFixes);\n }\n }\n }", "LectureProject createLectureProject();", "public String projectSubmissions(String nameDiscipline, String nameProject)\n throws InvalidDisciplineException, InvalidProjectException{\n Professor _professor = getProfessor();\n return _professor.projectSubmissions(nameDiscipline, nameProject);\n }", "private void setupProjectIncompleteDripFlow() {\n List<DProjects> projects = AppConfig.getInstance().getdProjectsDAO().findAllInternal();\n if (projects == null || projects.isEmpty()) return;\n\n // 5 days old project created\n Date recentEnoughProjectAccessed = new Date(lastRunDate.getTime() - 5*ONE_DAY_MILISEC);\n\n //3 days old login.\n Date recentEnoughLoginTime = new Date(lastRunDate.getTime() - 3*ONE_DAY_MILISEC);\n\n // one notification per user is enough.\n Map<DUsers, DProjects> userProjectMap = new HashMap<>();\n // find projects which are not complete.\n for (DProjects project : projects) {\n\n // ignore old projects (accessed older than 5 days), they may be already in the flow.\n if (lastAccessTime(project).before(recentEnoughProjectAccessed)) {\n continue;\n }\n\n ProjectDetails details = Controlcenter.getProjectSummary(project);\n long totalDone = details.getTotalHitsDone() + details.getTotalHitsSkipped();\n // if > 70% done, then ignore.\n if (details.getTotalHits() == 0 || (totalDone/(double)details.getTotalHits()) < .70) {\n // Find all the project users.\n List<DProjectUsers> projectUsers = AppConfig.getInstance().getdProjectUsersDAO().findAllByProjectIdInternal(project.getId());\n if (projectUsers == null || projectUsers.isEmpty()) break;\n\n for (DProjectUsers projectUser : projectUsers) {\n //not sending to contributors as we add everyone to default projects,\n // would be sad to send them mail asking them to finish Default projects.\n if (projectUser.getRole() == DTypes.Project_User_Role.OWNER) {\n DUsers user = AppConfig.getInstance().getdUsersDAO().findByIdInternal(projectUser.getUserId());\n //if the user has not logged in anytime soon.\n if (user != null && user.getUpdated_timestamp().before(recentEnoughLoginTime)) {\n userProjectMap.put(user, project);\n }\n }\n }\n }\n }\n LOG.info(\"setupProjectIncompleteDripFlow userProjectMap = \" + userProjectMap.size());\n DripFlows.addToProjectIncompleteFlow(userProjectMap);\n\n }", "protected void saveProject(Project theProject)\n throws HttpPresentationException, webschedulePresentationException\n { \n\n String proj_name = this.getComms().request.getParameter(PROJ_NAME);\n String personID = this.getComms().request.getParameter(PERSONID);\n String password = this.getComms().request.getParameter(PASSWORD);\n String discrib = this.getComms().request.getParameter(DISCRIB);\n String indexnum = this.getComms().request.getParameter(INDEXNUM);\n String thours = this.getComms().request.getParameter(THOURS);\n String dhours = this.getComms().request.getParameter(DHOURS);\n String codeofpay = this.getComms().request.getParameter(CODEOFPAY);\n\nString contactname = this.getComms().request.getParameter(CONTACTNAME);\n\tString contactphone = this.getComms().request.getParameter(CONTACTPHONE);\n\tString contactemail = this.getComms().request.getParameter(CONTACTEMAIL);\n\tString billaddr1 = this.getComms().request.getParameter(BILLADDR1);\n\tString billaddr2 = this.getComms().request.getParameter(BILLADDR2);\n\tString billaddr3 = this.getComms().request.getParameter(BILLADDR3);\n\tString city = this.getComms().request.getParameter(CITY);\n\tString state = this.getComms().request.getParameter(STATE);\n\tString zip = this.getComms().request.getParameter(ZIP);\n\t//String accountid = this.getComms().request.getParameter(ACCOUNTID);\n\t//String isoutside = this.getComms().request.getParameter(OUTSIDE);\n\t//String exp = this.getComms().request.getParameter(EXP);\n\tString expday = this.getComms().request.getParameter(EXPDAY);\n\tString expmonth = this.getComms().request.getParameter(EXPMONTH);\n\tString expyear = this.getComms().request.getParameter(EXPYEAR);\n\t\n\tString iexpday = this.getComms().request.getParameter(IEXPDAY);\n\tString iexpmonth = this.getComms().request.getParameter(IEXPMONTH);\n\tString iexpyear = this.getComms().request.getParameter(IEXPYEAR);\n\t\n\tString notes = this.getComms().request.getParameter(NOTES);\n\n String irbnum = this.getComms().request.getParameter(IRBNUM);\n\n System.out.println(\" Notes off save module \"+ notes);\n\nString notifycontact = this.getComms().request.getParameter(NOTIFYCONTACT);\n\n\njava.sql.Date moddatesql;\n //calculation for the time right now\n \tCalendar cancelinfo = Calendar.getInstance();\n \tint todaydate = cancelinfo.get(cancelinfo.DAY_OF_MONTH);\n \tint todaymonth = cancelinfo.get(cancelinfo.MONTH);\n\ttodaymonth= todaymonth+1;\n \tint todayyear = cancelinfo.get(cancelinfo.YEAR);\n\tString tempmod = todayyear+\"-\"+todaymonth+\"-\"+todaydate;\nmoddatesql=java.sql.Date.valueOf(tempmod);\n\njava.sql.Date iacucsql,didate;\n\nString tempiacuc = iexpyear+\"-\"+iexpmonth+\"-\"+iexpday;\niacucsql=java.sql.Date.valueOf(tempiacuc);\n//get old project information\n// Write to the modification file, format Date, Scanner, Who\n//Which project Header, Proj_name,Description, \n// Old project record\n//New project record\n\ndouble dthours;\n\n String dproj_name,dindex,dcname, dcphone, dfemail, dbilladdr1, dbilladdr3,dcity,dstate, dzip,dnemail;\nint dcode, dexpday, dexpmonth,dexpyear;\n\n\n//f.close(); \n try {\n dproj_name=theProject.getProj_name();\n \t dindex=theProject.getIndexnum();\n\t dthours=theProject.getTotalhours();\n\t dcode=theProject.getCodeofpay();\n\t dcname=theProject.getContactname();\n\t dcphone=theProject.getContactphone();\n\t dfemail=theProject.getFpemail();\n\t dbilladdr1=theProject.getBilladdr1();\n // theProject.setBilladdr2(theProject.getBilladdr2());\n dbilladdr3=theProject.getBilladdr3();\n \n dcity=theProject.getCity();\n dstate=theProject.getState();\n dzip=theProject.getZip();\n //theProject.setAccountid(theProject.getAccountid());\n dnemail=theProject.getNotifycontact();\n\t dexpday=theProject.getExpday();\n\t dexpmonth=\ttheProject.getExpmonth();\t\t\t \n\tdexpyear = theProject.getExpyear();\t\t\t\t \n\n\n\t \ndidate= theProject.getIACUCDate();\n\n } catch(Exception ex) {\n throw new webschedulePresentationException(\"Error adding project\", ex);\n } \n\n\n\nString s = \"\\n proj_name,TotalHours,SchEmail,Code,FCName,FCPhone,FCEmail,BillingAddress,Index,ExpDate,IRBDate\";\n\ntry {\nFileOutputStream f = new FileOutputStream (\"/home/emang/webschlog/projmodlog.txt\",true);\nfor (int i = 0; i < s.length(); ++i)\nf.write(s.charAt(i));\nString s2=\"\\n\"+dproj_name+\",\"+Double.toString(dthours)+\",\"+dnemail+\",\"+Integer.toString(dcode)+\",\"+dcname+\",\"+dcphone+\",\"+dfemail+\",\"+dbilladdr1+\" \"+dbilladdr3+\" \"+dcity+\" \"+dstate+\" \"+dzip+\",\"+dindex+\",\"+\",\";\nfor (int j = 0; j < s2.length(); ++j)\nf.write(s2.charAt(j));\nf.close();\n} catch (IOException ioe) {\n\tSystem.out.println(\"IO Exception\");\n\t}\n\t\n try {\n\tSystem.out.println(\" trying to saving a project one \"+ proj_name);\n theProject.setProj_name(proj_name);\n System.out.println(\" trying to saving a project one \"+ proj_name);\n theProject.setPassword( theProject.getPassword());\n\t theProject.setDescription(discrib);\n\t theProject.setIndexnum(indexnum);\n\t theProject.setTotalhours(Double.parseDouble(thours));\n\t theProject.setDonehours( theProject.getDonehours());\n theProject.setCodeofpay(Integer.parseInt(codeofpay));\n\t\n\t theProject.setContactname(contactname);\n\t theProject.setContactphone(contactphone);\n\t theProject.setFpemail(contactemail);\n\t theProject.setBilladdr1(billaddr1);\n theProject.setBilladdr2(theProject.getBilladdr2());\n\n theProject.setBilladdr3(billaddr3);\n theProject.setCity(city);\n theProject.setState(state);\n theProject.setZip(zip);\n theProject.setAccountid(theProject.getAccountid());\n theProject.setNotifycontact(notifycontact);\n\t theProject.setOutside(false);\n\t theProject.setExp(false);\n\t theProject.setInstitute(\"UCSD\");\n\t theProject.setNotes(notes);\ntheProject.setIRBnum(irbnum);\n\n//theProject.setCancredit(theProject.getCancredit());\n/*\t if(null != this.getComms().request.getParameter(OUTSIDE)) {\n \ttheProject.setOutside(true);\n \t } else {\n \ttheProject.setOutside(false);\n \t }\n if(null != this.getComms().request.getParameter(EXP)) {\n \ttheProject.setExp(true);\n \t } else {\n \ttheProject.setExp(false);\n\t\t\t \t }*/\n\t\t\t\t\t \n\t\t\t\t\t \ntheProject.setExpday(Integer.parseInt(expday));\ntheProject.setExpmonth(Integer.parseInt(expmonth));\ntheProject.setExpyear(Integer.parseInt(expyear));\n\n\t personID = theProject.getOwner().getHandle(); \n\t\ttheProject.setOwner(PersonFactory.findPersonByID(personID));\n\t\t\n//theProject.setOwner(theProject.getOwner());\n\n\ntheProject.setModDate(moddatesql);\n\ntheProject.setIACUCDate(iacucsql);\ntheProject.setModifiedby(this.getUser().getLastname());\n\n\n\nSystem.out.println(\" trying to saving a project two \"+ proj_name);\n\t theProject.save();\t\nSystem.out.println(\" trying to saving a project three \"+ proj_name);\n\t } catch(Exception ex) {\n throw new webschedulePresentationException(\"Error adding project\", ex);\n } \n }", "public ProjectBean getProject2(String projectIdentifier) {\n List<Experiment> experiments =\n this.getOpenBisClient().getExperimentsForProject3(projectIdentifier);// TODO changed this\n // from\n // getExperimentsForProject2\n\n float projectStatus = this.getOpenBisClient().computeProjectStatus(experiments);\n\n Project project = getOpenbisDtoProject(projectIdentifier);\n if (project == null) {\n project = getOpenBisClient().getProjectByIdentifier(projectIdentifier);\n addOpenbisDtoProject(project);\n }\n ProjectBean newProjectBean = new ProjectBean();\n\n ProgressBar progressBar = new ProgressBar();\n progressBar.setValue(projectStatus);\n\n Date registrationDate = project.getRegistrationDetails().getRegistrationDate();\n\n String pi = getDatabaseManager().getPersonDetailsForProject(project.getIdentifier(), \"PI\");\n String cp = getDatabaseManager().getPersonDetailsForProject(project.getIdentifier(), \"Contact\");\n String manager =\n getDatabaseManager().getPersonDetailsForProject(project.getIdentifier(), \"Manager\");\n\n String longDesc = getDatabaseManager().getLongProjectDescription(project.getIdentifier());\n\n if (pi.equals(\"\")) {\n newProjectBean.setPrincipalInvestigator(\"n/a\");\n } else {\n newProjectBean.setPrincipalInvestigator(pi);\n }\n\n if (cp.equals(\"\")) {\n newProjectBean.setContactPerson(\"n/a\");\n } else {\n newProjectBean.setContactPerson(cp);\n }\n\n if (manager.equals(\"\")) {\n newProjectBean.setProjectManager(\"n/a\");\n } else {\n newProjectBean.setProjectManager(manager);\n }\n\n if (longDesc == null)\n longDesc = \"\";\n\n newProjectBean.setLongDescription(longDesc);\n\n newProjectBean.setId(project.getIdentifier());\n newProjectBean.setCode(project.getCode());\n String desc = project.getDescription();\n if (desc == null)\n desc = \"\";\n newProjectBean.setDescription(desc);\n newProjectBean.setRegistrationDate(registrationDate);\n newProjectBean.setProgress(progressBar);\n newProjectBean.setRegistrator(project.getRegistrationDetails().getUserId());\n newProjectBean.setContact(project.getRegistrationDetails().getUserEmail());\n\n // Create sample Beans (or fetch them) for samples of experiments\n List<Sample> allSamples = this.getOpenBisClient()\n .getSamplesWithParentsAndChildrenOfProjectBySearchService(projectIdentifier);\n\n BeanItemContainer<ExperimentBean> experimentBeans =\n new BeanItemContainer<ExperimentBean>(ExperimentBean.class);\n\n AlternativeSecondaryNameCreator altNameCreator = new AlternativeSecondaryNameCreator(\n openBisClient.getVocabCodesAndLabelsForVocab(\"Q_NCBI_TAXONOMY\"));\n for (Experiment experiment : experiments) {\n ExperimentBean newExperimentBean = new ExperimentBean();\n\n // TODO doesn't work with getExperimentsForProject2\n Map<String, String> assignedProperties = experiment.getProperties();\n\n String status = \"\";\n\n if (assignedProperties.keySet().contains(\"Q_CURRENT_STATUS\")) {\n status = assignedProperties.get(\"Q_CURRENT_STATUS\");\n }\n\n else if (assignedProperties.keySet().contains(\"Q_WF_STATUS\")) {\n status = assignedProperties.get(\"Q_WF_STATUS\");\n }\n\n List<Sample> samples = new ArrayList<Sample>();\n for (Sample s : allSamples) {\n if (s.getExperimentIdentifierOrNull().equals(experiment.getIdentifier()))\n samples.add(s);\n }\n BeanItemContainer<SampleBean> sampleBeans =\n new BeanItemContainer<SampleBean>(SampleBean.class);\n for (Sample sample : samples) {\n SampleBean sbean = new SampleBean();\n sbean.setId(sample.getIdentifier());\n sbean.setCode(sample.getCode());\n sbean.setType(sample.getSampleTypeCode());\n sbean.setProperties(sample.getProperties());\n sbean.setParents(this.getOpenBisClient().getParentsBySearchService(sample.getCode())); //changed by cfh \n sampleBeans.addBean(sbean);\n }\n newExperimentBean.setSamples(sampleBeans);\n\n newExperimentBean.setAltNameCreator(altNameCreator);\n newExperimentBean.setProperties(assignedProperties);\n newExperimentBean.setSecondaryName(assignedProperties.get(\"Q_SECONDARY_NAME\"));\n newExperimentBean.setId(experiment.getIdentifier());\n newExperimentBean.setCode(experiment.getCode());\n newExperimentBean.setType(experiment.getExperimentTypeCode());\n newExperimentBean.setRegistrator(experiment.getRegistrationDetails().getUserId());\n newExperimentBean\n .setRegistrationDate(experiment.getRegistrationDetails().getRegistrationDate());\n newExperimentBean.setStatus(status);\n experimentBeans.addBean(newExperimentBean);\n }\n\n List<ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSet> projectData = this\n .getOpenBisClient().getDataSetsOfProjectByIdentifierWithSearchCriteria(projectIdentifier);\n\n Boolean containsData = false;\n Boolean containsResults = false;\n Boolean attachmentResult = false;\n // Boolean containsAttachments = false;\n\n for (ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSet ds : projectData) {\n attachmentResult = false;\n if (ds.getDataSetTypeCode().equals(\"Q_PROJECT_DATA\")) {\n attachmentResult = ds.getProperties().get(\"Q_ATTACHMENT_TYPE\").equals(\"RESULT\");\n }\n\n if (!(ds.getDataSetTypeCode().equals(\"Q_PROJECT_DATA\"))\n && !(ds.getDataSetTypeCode().contains(\"RESULTS\"))) {\n containsData = true;\n } else if (ds.getDataSetTypeCode().contains(\"RESULTS\") || attachmentResult) {\n containsResults = true;\n } // else if (ds.getDataSetTypeCode() == \"Q_PROJECT_DATA\") {\n // containsAttachments = true;\n // }\n }\n\n newProjectBean.setContainsData(containsData);\n newProjectBean.setContainsResults(containsResults);\n // newProjectBean.setContainsAttachments(containsAttachments);\n\n newProjectBean.setExperiments(experimentBeans);\n newProjectBean.setMembers(new HashSet<String>());\n\n String secondaryName = getDatabaseManager().getProjectName(projectIdentifier);\n if (secondaryName == null || secondaryName.isEmpty())\n secondaryName = \"n/a\";\n\n newProjectBean.setSecondaryName(secondaryName);\n return newProjectBean;\n }", "public void copyProjectsAction(){\n\t\t\tAsyncCallback<BmUpdateResult> callback = new AsyncCallback<BmUpdateResult>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\tstopLoading();\n\t\t\t\t\tif (caught instanceof StatusCodeException && ((StatusCodeException) caught).getStatusCode() == 0) {\n\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tshowErrorMessage(this.getClass().getName() + \"-copyProject() ERROR: \" + caught.toString());\n\t\t\t\t\t\tcopyProjectDialog();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onSuccess(BmUpdateResult result) {\n\t\t\t\t\tif(!result.hasErrors()) {\n\t\t\t\t\t\tstopLoading();\n\t\t\t\t\t\tdialogClose();\n\t\t\t\t\t\tBmoProject bmoProject = (BmoProject) result.getBmObject();\n\t\t\t\t\t\tUiProjectDetail uiProjectDetail = new UiProjectDetail(getUiParams(),\n\t\t\t\t\t\t\t\tbmoProject.getId());\n\t\t\t\t\t\tuiProjectDetail.show();\n\n\t\t\t\t\t\tgetUiParams().getUiTemplate().hideEastPanel();\n\t\t\t\t\t\tUiProject uiProject = new UiProject(getUiParams());\n\t\t\t\t\t\tuiProject.edit(bmoProject);\n\t\t\t\t\t\tshowSystemMessage(\"Copia Exitosa.\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstopLoading();\n\t\t\t\t\t\tcopyProjectDialog();\n\t\t\t\t\t\tshowSystemMessage(result.getBmErrorList().get(0).getMsg());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Llamada al servicio RPC\n\t\t\ttry {\n\t\t\t\tif (!isLoading()) {\n\t\t\t\t\tstartLoading();\n\t\t\t\t\tif(copyProjectSuggestBox.getSelectedId() > 0) {\n\t\t\t\t\t\tbmoProject.setId(copyProjectSuggestBox.getSelectedId());\n\t\t\t\t\t\tgetUiParams().getBmObjectServiceAsync().action(bmoProject.getPmClass(), bmoProject, BmoProject.ACCESS_COPYPROJECT, \"\" + customerSuggestBox.getSelectedId(), callback);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstopLoading();\n\t\t\t\t\t\tshowErrorMessage(this.getClass().getName() + \" ERROR: \" + \"Debe seleccionar Projecto\");\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} catch (SFException e) {\n\t\t\t\tstopLoading();\t\t\t\t\n\t\t\t\tshowErrorMessage(this.getClass().getName() + \"-action() ERROR: \" + e.toString());\n\t\t\t}\n\t\t}", "public static Project createProject() throws ParseException {\n System.out.println(\"Please enter the project number: \");\n int projNum = input.nextInt();\n input.nextLine();\n\n System.out.println(\"Please enter the project name: \");\n String projName = input.nextLine();\n\n System.out.println(\"Please enter the type of building: \");\n String buildingType = input.nextLine();\n\n System.out.println(\"Please enter the physical address for the project: \");\n String address = input.nextLine();\n\n System.out.println(\"Please enter the ERF number: \");\n String erfNum = input.nextLine();\n\n System.out.println(\"Please enter the total fee for the project: \");\n int totalFee = input.nextInt();\n input.nextLine();\n\n System.out.println(\"Please enter the total amount paid to date: \");\n int amountPaid = input.nextInt();\n input.nextLine();\n\n System.out.println(\"Please enter the deadline for the project (dd/MM/yyyy): \");\n String sdeadline = input.nextLine();\n Date deadline = dateformat.parse(sdeadline);\n\n Person architect = createPerson(\"architect\", input);\n Person contractor = createPerson(\"contractor\", input);\n Person client = createPerson(\"client\", input);\n\n // If the user did not enter a name for the project, then the program will\n // concatenate the building type and the client's surname as the new project\n // name.\n\n if (projName == \"\") {\n String[] clientname = client.name.split(\" \");\n String lastname = clientname[clientname.length - 1];\n projName = buildingType + \" \" + lastname;\n }\n\n return new Project(projNum, projName, buildingType, address, erfNum, totalFee, amountPaid, deadline, contractor,\n architect, client);\n\n }", "public Project getProject(Long projectId);", "public void Found_project_from_DATABASE(int id){\n print_pro();\n// return project;\n }", "private static void assign_project() {\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\t//Print out all projects\r\n\t\t System.out.println(\"Choose a project to assign to a person\");\r\n\t\t\tString strSelectProject = String.format(\"SELECT * from projects;\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tSystem.out.println(\"Project ID: \" + project_rset.getInt(\"project_id\") + \r\n\t\t\t\t\t\t\"\\nProject Name: \" + project_rset.getString(\"project_name\") + \"\\n\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Runs until a project is chosen and the input can be parsed to an int\r\n\t\t\tBoolean project_chosen = true;\r\n\t\t\tint project_choice = 0;\r\n\t\t\twhile (project_chosen == true) {\r\n\t\t\t\tSystem.out.println(\"Project No: \");\r\n\t\t\t\tString project_choice_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tproject_choice = Integer.parseInt(project_choice_str);\r\n\t\t\t\t\tproject_chosen = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for project number is not an integer\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The project id cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Prints out all people types\r\n\t\t\tString[] people_types = new String[] {\"Customer\", \"Contractor\", \"Architect\", \"Project Manager\"};\r\n\t\t\tfor (int i = 0; i < people_types.length; i ++) {\r\n\t\t\t\tSystem.out.println((i + 1) + \". \" + people_types[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows user to select a person type and runs until the selected person type number can be parsed to an integer\r\n\t\t\tBoolean select_person_type = true;\r\n\t\t\tint person_type = 0;\r\n\t\t\tString person_type_str = \"\";\r\n\t\t\twhile (select_person_type == true) {\r\n\t\t\t\tSystem.out.println(\"Select a number for the person type you wish to assign the project to:\");\r\n\t\t\t\tperson_type_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tperson_type = Integer.parseInt(person_type_str);\r\n\t\t\t\t\tfor (int i = 1; i < people_types.length + 1; i ++) {\r\n\t\t\t\t\t\tif (person_type == i) { \r\n\t\t\t\t\t\t\tperson_type_str = people_types[i-1]; \r\n\t\t\t\t\t\t\tselect_person_type = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// If user selected a number that was not displayed\r\n\t\t\t\t\tif (select_person_type == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available person type number.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for project number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The person type number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Prints out all people of selected type\r\n\t\t\t\tString strSelectPeople = String.format(\"SELECT * FROM people WHERE type = '%s';\", person_type_str);\r\n\t\t\t\tResultSet people_rset = stmt.executeQuery(strSelectPeople);\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(person_type_str + \":\");\r\n\t\t\t\t\r\n\t\t\t\twhile (people_rset.next()) {\r\n\t\t\t\t\tSystem.out.println(\"System ID: \" + people_rset.getInt(\"person_id\") + \", Name: \" + people_rset.getString(\"name\") + \" \" + people_rset.getString(\"surname\"));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Allows user to select a person to assign the project to\r\n\t\t\t\tBoolean person_chosen = true;\r\n\t\t\t\tint person_choice = 0;\r\n\t\t\t\twhile (person_chosen == true) {\r\n\t\t\t\t\tSystem.out.println(\"Person No: \");\r\n\t\t\t\t\tString person_choice_str = input.nextLine();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tperson_choice = Integer.parseInt(person_choice_str);\r\n\t\t\t\t\t\tperson_chosen = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * @exception Throws exception if the users input for person_number is not a number\r\n\t\t\t\t\t */\r\n\t\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t\t System.out.println(\"The person id cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Updates the table\r\n\t\t\t\tPreparedStatement ps_assign = conn.prepareStatement(\r\n\t\t\t\t\t\t\"UPDATE people SET projects = ? WHERE person_id = ?;\");\r\n\t\t\t\tps_assign.setInt(1, project_choice);\r\n\t\t\t\tps_assign.setInt(2, person_choice);\r\n\t\t\t\tps_assign.executeUpdate();\r\n\t\t\t\tSystem.out.println(\"\\nAssigned Project\");\r\n\r\n\t\t/**\r\n\t\t * @exception When something cannot be retrieved from the database then an SQLException is thrown\t\r\n\t\t */\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}", "private Project getProject(ActivityDTO dto) {\n\t\treturn projectDAO.findById(dto.getProjectId()).get();\n//\t\treturn projectDAO.getOne(dto.getProjectId());\n\t}", "public void querySubProjects() {\r\n\t\t// Create a task\r\n\t\tProject master = new Project();\r\n\t\tmaster.setName(\"INFRASTRUCTURE\");\r\n\t\tmaster.setDisplayName(\"Infrastructure\");\r\n\t\tmaster.setDescription(\"Project to setup the new infrastructure\");\r\n\t\tmaster = (Project) aggregateService.create(master, new Settings());\t\r\n\r\n\t\t// Create 2 dependents\r\n\t\tProject A = new Project();\r\n\t\tA.setName(\"SETUP_NETWORK\");\r\n\t\tA.setDisplayName(\"Setup network\");\r\n\t\tA.setDescription(\"Project to lay the network cables and connect to routers\");\r\n\t\tA = (Project) aggregateService.create(A, new Settings());\r\n\r\n\t\tProject B = new Project();\r\n\t\tB.setName(\"SETUP_TELEPHONE\");\r\n\t\tB.setDisplayName(\"Setup telephone\");\r\n\t\tB.setDescription(\"Setup the telephone at each employee desk\");\r\n\t\tB = (Project) aggregateService.create(B, new Settings());\r\n\r\n\t\tMap<String, Project> subProjects = new HashMap<String, Project>();\r\n\t\tsubProjects.put(A.getName(), A);\r\n\t\tsubProjects.put(B.getName(), B);\r\n\t\tmaster.setSubProjects(subProjects);\r\n\t\tmaster = (Project) aggregateService.read(master, getSettings());\t\t\r\n\r\n\t\t// query the task object\r\n\t\tSettings settings = new Settings();\r\n\t\tsettings.setView(aggregateService.getView(\"SUBPROJECTS\"));\t\t\r\n\t\tList<?> toList = aggregateService.query(master, settings);\r\n\r\n\t\tassert(toList.size() == 1);\t\t\r\n\r\n\t\tObject obj = toList.get(0);\r\n\t\tassert(Project.class.isAssignableFrom(obj.getClass()));\r\n\r\n\t\tProject root = (Project) obj;\r\n\t\tassert(root.getSubProjects() != null && root.getSubProjects().size() == 2);\r\n\t\tassert(root.getSubProjects().get(\"SETUP_NETWORK\").getName().equals(\"SETUP_NETWORK\"));\r\n\t\tassert(root.getSubProjects().get(\"SETUP_TELEPHONE\").getName().equals(\"SETUP_TELEPHONE\"));\t\t\r\n\t}", "public void createProject(Project newProject);", "public Project createProjectFromPRJ() {\n\n\t\tSystem.out.println(\"Trying to load prj file with : \" + data_path + \" \" + projectName + \" \" + conceptName + \" \");\n\n\t\tProject project = null;\n\n\t\ttry {\n\n\t\t\tproject = new Project(data_path + projectName);\n\n\t\t\t// Sehr wichtig hier das Warten einzubauen, sonst gibts leere\n\t\t\t// Retrieval Results, weil die Faelle noch nicht geladen sind wenn\n\t\t\t// das\n\t\t\t// Erste Retrieval laueft\n\t\t\twhile (project.isImporting()) {\n\t\t\t\tThread.sleep(1000);\n\t\t\t\tSystem.out.print(\".\");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\"); // console pretty print\n\t\t} catch (Exception ex) {\n\n\t\t\tSystem.out.println(\"Error when loading the project\");\n\t\t}\n\t\treturn project;\n\t}", "public void closeProject(String nameProject, String nameDiscipline) throws \n InvalidDisciplineException, InvalidProjectException, OpenSurveyException{\n Professor _professor = getProfessor();\n _professor.closeProject(nameProject, nameDiscipline);\n }", "public void testDemo() throws Exception {\n // prepare data\n Client client = createClient(200);\n Project project = createProjectWithClient(100, client);\n createProjectWithClient(101, client);\n createProjectWithClient(102, client);\n createProjectWithClient(103, client);\n getEntityManager().getTransaction().commit();\n\n // retrieve bean\n InitialContext ctx = new InitialContext();\n ProjectDAORemote bean = (ProjectDAORemote) ctx.lookup(\"client_project_entities_dao/ProjectDAOBean/remote\");\n\n Filter filter = new EqualToFilter(\"projectStatus\", project.getProjectStatus().getId());\n\n List<Project> projects;\n\n // get project for corresponding id\n Project tempProject = bean.retrieveById(100L);\n\n // get all projects\n projects = bean.retrieveAll();\n\n // get all projects with the name \"name\"\n projects = bean.searchByName(\"name\");\n\n // get all that match the given filter\n projects = bean.search(filter);\n\n // save or update a project\n bean.save(project);\n\n // delete the project\n bean.delete(project);\n\n // get project for corresponding id without projectChildren\n tempProject = bean.retrieveById(100L, false);\n\n // get project for corresponding id with projectChildren\n tempProject = bean.retrieveById(100L, true);\n\n // get all projects without projectChildrens\n projects = bean.retrieveAll(false);\n\n // get all projects with projectChildrens\n projects = bean.retrieveAll(true);\n\n // get projects by user\n projects = bean.getProjectsByUser(\"username\");\n\n // get all projects only\n projects = bean.retrieveAllProjectsOnly();\n\n // search projects by project name\n projects = bean.searchProjectsByProjectName(\"projectname\");\n\n // search projects by client name\n projects = bean.searchProjectsByClientName(\"clientname\");\n\n // get contest fees by project\n List<ProjectContestFee> fees = bean.getContestFeesByProject(100L);\n\n // save contest fees\n bean.saveContestFees(fees, 100L);\n\n // check client project permission\n boolean clientProjectPermission = bean.checkClientProjectPermission(\"username\", 100L);\n\n // check po number permission\n boolean poNumberPermission = bean.checkPoNumberPermission(\"username\", \"123456A\");\n\n // add user to billing projects.\n bean.addUserToBillingProjects(\"username\", new long[] {100, 101, 102});\n\n // remove user from billing projects.\n bean.removeUserFromBillingProjects(\"ivern\", new long[] {100, 201});\n\n // get the projects by the given client id.\n projects = bean.getProjectsByClientId(200);\n }", "int modifyProject(Project project) throws WrongIDException, WrongDurationException;", "public PanelNewProject getNewProject(){\n return nuevoProyecto;\n }", "Mission createMission();", "public Project getProject(int projectId) throws EmployeeManagementException;", "protected void saveProject(Project theProject)\n throws HttpPresentationException, webschedulePresentationException\n { \n\n String proj_name = this.getComms().request.getParameter(PROJ_NAME);\n String personID = this.getComms().request.getParameter(PERSONID);\n String password = this.getComms().request.getParameter(PASSWORD);\n String discrib = this.getComms().request.getParameter(DISCRIB);\n String indexnum = this.getComms().request.getParameter(INDEXNUM);\n String thours = this.getComms().request.getParameter(THOURS);\n String dhours = this.getComms().request.getParameter(DHOURS);\n String codeofpay = this.getComms().request.getParameter(CODEOFPAY);\n\nString contactname = this.getComms().request.getParameter(CONTACTNAME);\n\tString contactphone = this.getComms().request.getParameter(CONTACTPHONE);\n\tString billaddr1 = this.getComms().request.getParameter(BILLADDR1);\n\tString billaddr2 = this.getComms().request.getParameter(BILLADDR2);\n\tString billaddr3 = this.getComms().request.getParameter(BILLADDR3);\n\tString city = this.getComms().request.getParameter(CITY);\n\tString state = this.getComms().request.getParameter(STATE);\n\tString zip = this.getComms().request.getParameter(ZIP);\n\tString accountid = this.getComms().request.getParameter(ACCOUNTID);\n\tString isoutside = this.getComms().request.getParameter(OUTSIDE);\n\tString exp = this.getComms().request.getParameter(EXP);\n\tString expday = this.getComms().request.getParameter(EXPDAY);\n\nString expmonth = this.getComms().request.getParameter(EXPMONTH);\nString expyear = this.getComms().request.getParameter(EXPYEAR);\n\nString notifycontact = this.getComms().request.getParameter(NOTIFYCONTACT);\n\n try {\n\tSystem.out.println(\" trying to saving a project one \"+ proj_name);\n theProject.setProj_name(proj_name);\nSystem.out.println(\" trying to saving a project one \"+ proj_name);\n theProject.setPassword(password);\n\t theProject.setDescription(discrib);\n\t theProject.setIndexnum(indexnum);\n\t theProject.setTotalhours(Double.parseDouble(thours));\n\t theProject.setDonehours(Double.parseDouble(dhours));\n theProject.setCodeofpay(Integer.parseInt(codeofpay));\n\t\n\t theProject.setContactname(contactname);\n\t theProject.setContactphone(contactphone);\n\t theProject.setBilladdr1(billaddr1);\n theProject.setBilladdr2(billaddr2);\n\ntheProject.setBilladdr3(billaddr3);\ntheProject.setCity(city);\ntheProject.setState(state);\ntheProject.setZip(zip);\ntheProject.setAccountid(accountid);\ntheProject.setNotifycontact(notifycontact);\n\n\t if(null != this.getComms().request.getParameter(OUTSIDE)) {\n \ttheProject.setOutside(true);\n \t } else {\n \ttheProject.setOutside(false);\n \t }\n if(null != this.getComms().request.getParameter(EXP)) {\n \ttheProject.setExp(true);\n \t } else {\n \ttheProject.setExp(false);\n \t }\ntheProject.setExpday(Integer.parseInt(expday));\ntheProject.setExpmonth(Integer.parseInt(expmonth));\ntheProject.setExpyear(Integer.parseInt(expyear));\n\n\t theProject.setOwner(PersonFactory.findPersonByID(personID));\n\n\ntheProject.setInstitute(\"UCSD\");\ntheProject.setFpemail(\" \");\ntheProject.setPOnum(\"0\");\ntheProject.setPOexpdate(java.sql.Date.valueOf(\"2010-09-31\"));\ntheProject.setPOhours(0);\ntheProject.setIACUCDate(java.sql.Date.valueOf(\"2010-01-01\"));\ntheProject.setModifiedby(\"Ghobrial\");\ntheProject.setModDate(java.sql.Date.valueOf(\"2010-04-30\"));\ntheProject.setNotes(\"*\");\ntheProject.setIRBnum(\"0\");\n\n//theProject.set();\n\nSystem.out.println(\" Person ID \"+ personID);\nSystem.out.println(\" contactname \"+ contactname);\nSystem.out.println(\" contact phone\"+ contactphone);\nSystem.out.println(\" isoutside \"+ isoutside);\nSystem.out.println(\" exp day \"+expday);\nSystem.out.println(\" exp month \"+ expmonth);\nSystem.out.println(\" expyear \"+ expyear);\n\n\n\n\n\nSystem.out.println(\" trying to saving a project two \"+ proj_name);\n\t theProject.save();\t\nSystem.out.println(\" trying to saving a project three \"+ proj_name);\n\t } catch(Exception ex) {\n throw new webschedulePresentationException(\"Error adding project\", ex);\n } \n }", "public Subproject drawProject() {\n\t\tSubproject result=projectsAvailable.get(0);\n\t\tprojectsAvailable.remove(result);\n\t\tprojectsActive.add(result);\n\t\treturn result;\n\t}", "private void modifyProjectTask(ActionEvent actionEvent) {\n Calendar dueDate = dueDateModel.getValue();\n String title = titleEntry.getText();\n String description = descriptionEntry.getText();\n Project parent = (Project) parentEntry.getSelectedItem();\n modifyProjectTask(title, description, parent, dueDate);\n }", "@Override\n\t\t\tpublic void onClick()\n\t\t\t{\n\t\t\t\tretrieveProjectAndObject(dccdHit);\n\t\t\t\t// Note: could also give selected entity object!\n\t\t\t\tString selectedEntityId = object.getId();\n\n\t\t\t\tsetResponsePage(new ProjectViewPage(project, selectedEntityId));\n\t\t\t}", "@Override\n\t\t\tpublic void onClick()\n\t\t\t{\n\t\t\t\tretrieveProjectAndObject(dccdHit);\n\t\t\t\t// Note: could also give selected entity object!\n\t\t\t\tString selectedEntityId = object.getId();\n\n\t\t\t\tsetResponsePage(new ProjectViewPage(project, selectedEntityId));\n\t\t\t}", "public boolean addProject(Project p) {\n try {\n String insert = \"INSERT INTO PROJECTS\"\n + \"(CLIENT,DESCRIPTION,HOURS,STARTDATE,DUEDATE,INVOICESENT,CLIENT_ID,PROJECT_ID) \"\n + \"VALUES(?,?,?,?,?,?,?,PROJECTS_SEQ.NEXTVAL)\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(insert);\n ps.setString(1, p.getClientId());\n ps.setString(2, p.getDescription());\n ps.setString(3, p.getHours());\n ps.setString(4, p.getStartdate());\n ps.setString(5, p.getDuedate());\n ps.setString(6, p.getInvoicesent());\n ps.setString(7, p.getClientId());\n\n ps.executeUpdate();\n ps.close();\n return true;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return false;\n }\n }", "private void GetParticipatedContest() {\n\n\t\ttry {\n\n\t\t\tArrayList<String> asName = new ArrayList<String>();\n\t\t\tasName.add(\"userid\");\n\t\t\tasName.add(\"timezone\");\n\n\t\t\tLocalData data = new LocalData(context);\n\n\t\t\tArrayList<String> asValue = new ArrayList<String>();\n\t\t\tasValue.add(data.GetS(\"userid\"));\n\t\t\tasValue.add(Main.GetTimeZone());\n\n\t\t\tString sUrl = StringURLs.PARTICIPATED_CONTEST;\n\n\t\t\tsUrl = StringURLs.getQuery(sUrl, asName, asValue);\n\n\t\t\tConnectServer connectServer = new ConnectServer();\n\t\t\tconnectServer.setContext(context);\n\t\t\tconnectServer.setMode(ConnectServer.MODE_POST);\n\t\t\tconnectServer.setListener(new ConnectServerListener() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onServerResponse(String sJSON, JSONObject jsonObject) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (sJSON.length() == 0) {\n\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(context,\n\t\t\t\t\t\t\t\t\t\t\t\"c100\"), Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tShowContestDeatails(sJSON, \"participatedcontest\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (Exception exp) {\n\n\t\t\t\t\t\tToast.makeText(context,\n\t\t\t\t\t\t\t\tMain.getStringResourceByName(context, \"c100\"),\n\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconnectServer.execute(sUrl);\n\n\t\t} catch (Exception exp) {\n\n\t\t}\n\t}", "private void newProject()\n\t{\n\t\tnew FenetreCreationProjet();\n\t}", "List <ProjectAssignment> findAssignmentsByProject (int projectId);", "@Override\n public void onClick(View view) {\n Intent intent1 = new Intent(ProjectActivity.this, TaskActivityWriter.class);\n intent1.putExtra(\"project\", project);\n startActivity(intent1);\n }", "@Test\n public void canGetProjectsForOrganisation() {\n Long orgID = 709814L; //existing vertec Organisation\n String uri = baseURI + \"/organisation/\" + orgID + \"/projects\";\n\n ProjectsForAddressEntry pfo = getFromVertec(uri, ProjectsForAddressEntry.class).getBody();\n assertEquals(\"Got wrong organisation\", orgID, pfo.getOrganisationId());\n assertTrue(\"Deutsche Telekom\".equals(pfo.getOrganisationName()));\n\n assertTrue(2 <= pfo.getProjects().size());\n assertEquals(pfo.getProjects().get(0).getV_id().longValue(), 2073414L);\n assertEquals(pfo.getProjects().get(1).getV_id().longValue(), 16909140L);\n\n List<JSONPhase> phasesForProj1 = pfo.getProjects().get(0).getPhases();\n List<JSONPhase> phasesForProj2 = pfo.getProjects().get(1).getPhases();\n\n assertEquals(\"Wrong phases gotten\", phasesForProj1.size(), 2); //project inactve so should not change in the future,\n assertEquals(\"Wrong phases gotten\", phasesForProj2.size(), 3); //but if these assertions fail check on vertec how many phases the project has\n\n\n assertEquals(2073433L, phasesForProj1.get(0).getV_id().longValue());\n assertEquals(2073471L, phasesForProj1.get(1).getV_id().longValue());\n\n assertEquals(16909162L, phasesForProj2.get(0).getV_id().longValue());\n assertEquals(17092562L, phasesForProj2.get(1).getV_id().longValue());\n assertEquals(17093158L, phasesForProj2.get(2).getV_id().longValue());\n\n assertTrue(pfo.getProjects().get(0).getTitle().equals(\"T-Mobile, Internet Architect\"));\n assertFalse(pfo.getProjects().get(0).getActive());\n assertTrue(pfo.getProjects().get(0).getCode().equals(\"C11583\"));\n assertEquals(pfo.getProjects().get(0).getClientRef().longValue(), 709814L);\n assertEquals(pfo.getProjects().get(0).getCustomerId(), null);\n assertEquals(pfo.getProjects().get(0).getLeader_ref().longValue(), 504354L);\n //type not uses\n //currency not used\n assertTrue(pfo.getProjects().get(0).getCreationDate().equals(\"2008-08-27T14:22:47\"));\n //modifiedDate will change so check is not very useful here\n\n //phases\n JSONPhase phase = phasesForProj1.get(1);\n assertFalse(phase.getActive());\n assertTrue(phase.getDescription().equals(\"Proposal\"));\n assertTrue(phase.getCode().equals(\"10_PROPOSAL\"));\n assertEquals(3, phase.getStatus());\n assertTrue(phase.getSalesStatus().contains(\"30\"));\n assertTrue(phase.getExternalValue().equals(\"96,000.00\"));\n assertTrue(phase.getStartDate().equals(\"\"));\n assertTrue(phase.getEndDate().equals(\"\"));\n assertTrue(phase.getOfferedDate().equals(\"2008-08-27\"));\n assertTrue(phase.getCompletionDate().equals(\"\"));\n assertTrue(phase.getLostReason().contains(\"suitable resource\"));\n assertTrue(phase.getCreationDate().equals(\"2008-08-27T14:25:38\"));\n assertTrue(phase.getRejectionDate().equals(\"2008-10-31\"));\n\n assertEquals(504354, phase.getPersonResponsible().longValue());\n }", "public ProjectViewController(){\n InputStream request = appController.httpRequest(\"http://localhost:8080/project/getProject\", \"GET\");\n try {\n String result = IOUtils.toString(request, StandardCharsets.UTF_8);\n Gson gson = new Gson();\n this.projectModel = gson.fromJson(result, ProjectModel.class);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\n\t\t\t\t\tif(validateForm()) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tProject prj = compileProject();\n\t\t\t\t\t\tportfolio.add(prj,config.isUpdateDB());\n\t\t\t\t\t\tif(prj instanceof OngoingProject) {\n\t\t\t\t\t\t\tProjectTableModel tm = (ProjectTableModel) opTable.getModel();\n\t\t\t\t\t\t\ttm.addRow(prj.toTable());\n\t\t\t\t\t\t\topTable.setModel(tm);\n\t\t\t\t\t\t\tupdateCounters();\n\t\t\t\t\t\t\ttoggleSaved(false);\n\t\t\t\t\t\t\tsel.add(pCode.getText());\n\t\t\t\t\t\t} else if (prj instanceof FinishedProject) {\n\t\t\t\t\t\t\tProjectTableModel tm = (ProjectTableModel) fpTable.getModel();\n\t\t\t\t\t\t\ttm.addRow(prj.toTable());\n\t\t\t\t\t\t\tfpTable.setModel(tm);\n\t\t\t\t\t\t\tupdateCounters();\n\t\t\t\t\t\t\ttoggleSaved(false);\n\t\t\t\t\t\t\tsel.add(pCode.getText());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnpd.dispose();\n\t\t\t\t\t}\n\t\t\t\t}", "@Override\n public void onClick(View view) {\n String projectName = etProjectName.getText().toString();\n String projectOwner = etProjectOwner.getText().toString();\n String projectDescription = etProjectDescription.getText().toString();\n long projectId = 0; // This is just to give some value. Not used when saving new project because auto-increment in DB for this value.\n\n\n // USerid and projectname are mandatory parameters\n if( userId != 0 && projectName != null) {\n newProject = new Project(projectId, userId, projectName, projectOwner, projectDescription);\n dbHelper.saveProject(newProject);\n// showToast(\"NewprojectId:\" + newProject.projectId+ \"-->UserId: \"+ userId + \"--> ProjectName\" + newProject.projectName +\"->Owner\"+newProject.projectOwner);\n dbHelper.close();\n\n // SIIRRYTÄÄN PROJEKTILISTAUKSEEN\n Intent newProjectList = new Intent( NewProject.this, ProjectListActivity.class);\n newProjectList.putExtra(\"userId\", userId);\n startActivity(newProjectList);\n }\n\n }", "Project findProjectById(String projectId);", "public List<GLJournalApprovalVO> getProject(String OrgId, String ClientId, String projectId) {\n String sqlQuery = \"\";\n PreparedStatement st = null;\n ResultSet rs = null;\n List<GLJournalApprovalVO> list = null;\n try {\n list = new ArrayList<GLJournalApprovalVO>();\n sqlQuery = \" SELECT C_PROJECT.C_PROJECT_ID AS ID,C_PROJECT.NAME FROM C_PROJECT WHERE AD_ORG_ID IN (\"\n + OrgId + \") \" + \" AND AD_CLIENT_ID IN (\" + ClientId + \") AND C_PROJECT_ID IN (\"\n + projectId + \") \";\n st = conn.prepareStatement(sqlQuery);\n rs = st.executeQuery();\n while (rs.next()) {\n GLJournalApprovalVO VO = new GLJournalApprovalVO();\n VO.setId(rs.getString(1));\n VO.setName(rs.getString(2));\n list.add(VO);\n\n }\n } catch (Exception e) {\n log4j.error(\"Exception in getOrgs()\", e);\n }\n return list;\n }", "void projectFound( String key ){\n projectInProgress = new Project();\n }", "public static Project exampleProject() throws ParseException {\n Person willem = new Person(\"Contractor\", \"Willem du Plessis\", \"074 856 4561\", \"[email protected]\",\n \"452 Tugela Avenue\");\n Person rene = new Person(\"Architect\", \"Rene Malan\", \"074 856 4561\", \"rene@malan\", \"452 Tugela Avenue\");\n Person tish = new Person(\"Client\", \"Tish du Plessis\", \"074 856 4561\", \"[email protected]\", \"452 Tugela Avenue\");\n Date deadline = dateformat.parse(\"30/03/2021\");\n Project housePlessis = new Project(789, \"House Plessis\", \"House\", \"102 Jasper Avenue\", \"1025\", 20000, 5000,\n deadline, willem, rene, tish);\n ProjectList.add(housePlessis);\n\n return housePlessis;\n }", "public Issue(Projeto proj, String titulo, String desc, String dinicial,\r\n\t\t\tint critici, int tipo) {\r\n\t\tsuper();\r\n\t\tthis.proj = proj;\r\n\t\tthis.titulo = titulo;\r\n\t\tthis.desc = desc;\r\n\t\tDinicial = dinicial;\r\n\t\tthis.critici = critici;\r\n\t\tthis.tipo = tipo;\r\n\t\tstatus = 1;\r\n\t}", "public String handleEdit()\n throws webschedulePresentationException, HttpPresentationException\n {\t\t \n String projID = this.getComms().request.getParameter(PROJ_ID);\n Project project = null;\n\n System.out.println(\" trying to edit a project \"+ projID);\n \n // Try to get the proj by its ID\n try {\n\t project = ProjectFactory.findProjectByID(projID);\n\t System.out.println(\" trying to edit a project 2\"+ projID);\n\t String title = project.getProj_name();\n\t System.out.println(\"project title: \"+title);\n\t\n } catch(Exception ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid PROJECT to edit\");\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n }\n \n // If we got a valid project then try to save it\n // If any fields were missing then redisplay the edit page, \n // otherwise redirect to the project catalog page\n try {\n saveProject(project);\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n } catch(Exception ex) {\n return showEditPage(\"You must fill out all fields to edit this project\");\n } \n }", "@Test\n public void testGetSelectedProject() {\n System.out.println(\"getSelectedProject\");\n ProjectEditController instance = new ProjectEditController();\n Project expResult = new Project();\n instance.prepareEditProject(expResult);\n Project result = instance.getSelectedProject();\n assertEquals(expResult, result);\n\n }", "public void newProject(View V){\n Intent i = new Intent(this, NewProject.class);\n i.putExtra(\"course title\",courseTitle);\n startActivity(i);\n }", "private void addProjectTask(ActionEvent e) {\n Calendar dueDate = dueDateModel.getValue();\n String title = titleEntry.getText();\n String description = descriptionEntry.getText();\n Project parent = (Project) parentEntry.getSelectedItem();\n addProjectTask(title, description, parent, dueDate);\n }", "public ActionForward execute(ActionMapping mapping,\n\t\t\t\t ActionForm form,\n\t\t\t\t HttpServletRequest request,\n\t\t\t\t HttpServletResponse response)\n\tthrows Exception {\n\n\t// Extract attributes we will need\n\tMessageResources messages = getResources(request);\t\n\n\t// save errors\n\tActionMessages errors = new ActionMessages();\n \n //START check for login (security)\n if(!SecurityService.getInstance().checkForLogin(request.getSession(false))) { \n return (mapping.findForward(\"welcome\"));\n }\n //END check for login (security)\n\t \n //START get id of current project from either request, attribute, or cookie \n //id of project from request\n\tString projectId = null;\n\tprojectId = request.getParameter(\"projectViewId\");\n \n //check attribute in request\n if(projectId == null) {\n projectId = (String) request.getAttribute(\"projectViewId\");\n }\n \n //id of project from cookie\n if(projectId == null) { \n projectId = StandardCode.getInstance().getCookie(\"projectViewId\", request.getCookies());\n }\n\n //default project to last if not in request or cookie\n if(projectId == null) {\n java.util.List results = ProjectService.getInstance().getProjectList();\n \n ListIterator iterScroll = null;\n for(iterScroll = results.listIterator(); iterScroll.hasNext(); iterScroll.next()) {}\n iterScroll.previous();\n Project p = (Project) iterScroll.next(); \n projectId = String.valueOf(p.getProjectId());\n } \n \n Integer id = Integer.valueOf(projectId);\n \n //END get id of current project from either request, attribute, or cookie \n \n //get project\n Project p = ProjectService.getInstance().getSingleProject(id); \n \n //get task to create po\n String linId = null;\n String engId = null;\n String dtpId = null;\n String othId = null;\n \n linId = request.getParameter(\"linId\");\n if(linId == null) {\n engId = request.getParameter(\"engId\");\n if(engId == null) {\n dtpId = request.getParameter(\"dtpId\");\n if(dtpId == null) {\n othId = request.getParameter(\"othId\");\n }\n } \n } \n \n //get the next po number for this project\n String poNumber = ProjectService.getInstance().getNewPoNumber(p);\n \n if(linId != null) { //generate lin PO\n LinTask lt = (LinTask) ProjectService.getInstance().getSingleLinTask(Integer.valueOf(linId));\n \n //allow blank po\n Resource r = new Resource();\n if(lt.getPersonName() != null && lt.getPersonName().length() > 0) {\n //get resource\n r = ResourceService.getInstance().getSingleResource(Integer.valueOf(lt.getPersonName()));\n \n //Add default score of \"0\"for this resource\n lt.setScore(new Integer(0));\n lt.setPoNumber(poNumber);\n }\n \n ProjectService.getInstance().updateLinTask(lt);\n \n //get user (project manager)\n User u = UserService.getInstance().getSingleUserRealName(StandardCode.getInstance().getFirstName(p.getPm()), StandardCode.getInstance().getLastName(p.getPm()));\n String targetLang = \"\";\n //START process pdf\n try {\n PdfReader reader = new PdfReader(\"C:/templates/LI01_thru_LI04.pdf\"); //the template\n \n //save the pdf in memory\n ByteArrayOutputStream pdfStream = new ByteArrayOutputStream();\n \n //the filled-in pdf\n PdfStamper stamp = new PdfStamper(reader, pdfStream);\n \n //stamp.setEncryption(true, \"pass\", \"pass\", PdfWriter.AllowCopy | PdfWriter.AllowPrinting);\n AcroFields form1 = stamp.getAcroFields();\n\n //set the field values in the pdf form\n if((r.getFirstName() != null && r.getFirstName().length() >= 1) && (r.getLastName() != null && r.getLastName().length() >= 1)) {\n form1.setField(\"contractor\", StandardCode.getInstance().noNull(r.getFirstName()) + \" \" + StandardCode.getInstance().noNull(r.getLastName()));\n }\n else {\n form1.setField(\"contractor\", StandardCode.getInstance().noNull(r.getCompanyName()));\n }\n form1.setField(\"Project\", p.getNumber() + p.getCompany().getCompany_code());\n form1.setField(\"PO\", p.getNumber() + p.getCompany().getCompany_code() + \"-PO-\" + lt.getPoNumber());\n form1.setField(\"Currency\", lt.getInternalCurrency());\n if(lt.getWordNew4() != null) {\n form1.setField(\"Volume_new\", String.valueOf(lt.getWordNew4()));\n }\n if(lt.getWord100() != null) {\n form1.setField(\"Volume_100\", String.valueOf(lt.getWord100()));\n }\n if(lt.getWordRep() != null) {\n form1.setField(\"Volume_rep\", String.valueOf(lt.getWordRep()));\n }\n if(lt.getWord8599() != null) {\n form1.setField(\"Volume_8599\", String.valueOf(lt.getWord8599()));\n }\n if(lt.getWordTotal() != null) {\n form1.setField(\"Volume_total\", String.valueOf(lt.getWordTotal().intValue()));\n }\n //rate and cost\n if(lt.getInternalRate() != null && lt.getInternalRate().length() > 0) {\n double rateNew = new Double(lt.getInternalRate()).doubleValue();\n double rate100 = new Double(lt.getInternalRate()).doubleValue() * .25;\n double rateRep = new Double(lt.getInternalRate()).doubleValue() * .25;\n double rate8599 = new Double(lt.getInternalRate()).doubleValue() * .5; \n //form1.setField(\"Rate_new\",StandardCode.getInstance().formatDouble4(new Double(rateNew)));\n //form1.setField(\"Rate_100\",StandardCode.getInstance().formatDouble4(new Double(rate100)));\n //form1.setField(\"Rate_rep\",StandardCode.getInstance().formatDouble4(new Double(rateRep)));\n //form1.setField(\"Rate_8599\",StandardCode.getInstance().formatDouble4(new Double(rate8599)));\n form1.setField(\"Rate_new\", String.valueOf(rateNew));\n form1.setField(\"Rate_100\", String.valueOf(rate100));\n form1.setField(\"Rate_rep\", String.valueOf(rateRep));\n form1.setField(\"Rate_8599\", String.valueOf(rate8599));\n double costNew = lt.getWordNew4().doubleValue() * rateNew;\n double cost100 = lt.getWord100().doubleValue() * rate100;\n double costRep = lt.getWordRep().doubleValue() * rateRep;\n double cost8599 = lt.getWord8599().doubleValue() * rate8599; \n /*form1.setField(\"Cost_new\", StandardCode.getInstance().formatDouble(new Double(costNew)));\n form1.setField(\"Cost_100\", StandardCode.getInstance().formatDouble(new Double(cost100)));\n form1.setField(\"Cost_rep\", StandardCode.getInstance().formatDouble(new Double(costRep)));\n form1.setField(\"Cost_8599\", StandardCode.getInstance().formatDouble(new Double(cost8599)));\n form1.setField(\"Cost_total\", StandardCode.getInstance().formatDouble(new Double(costNew + cost100 + costRep + cost8599)));*/\n \n form1.setField(\"Cost_new\", StandardCode.getInstance().formatDouble(new Double(costNew)));\n form1.setField(\"Cost_100\", StandardCode.getInstance().formatDouble(new Double(cost100)));\n form1.setField(\"Cost_rep\", StandardCode.getInstance().formatDouble(new Double(costRep)));\n form1.setField(\"Cost_8599\", StandardCode.getInstance().formatDouble(new Double(cost8599)));\n double costTotal = costNew + cost100 + costRep + cost8599;\n form1.setField(\"Cost_total\", StandardCode.getInstance().formatDouble(new Double(costTotal)));\n }\n \n form1.setField(\"Language\", lt.getTargetLanguage());\n targetLang = lt.getTargetLanguage();\n form1.setField(\"Task1\", lt.getTaskName());\n \n if(lt.getDueDateDate() != null) {\n form1.setField(\"Deadline\", DateFormat.getDateInstance(DateFormat.SHORT).format(lt.getDueDateDate()));\n }\n \n form1.setField(\"PM\", p.getPm()); \n form1.setField(\"date\", DateFormat.getDateInstance(DateFormat.SHORT).format(new Date()));\n form1.setField(\"Email\", u.getWorkEmail1());\n if(u.getWorkPhoneEx() != null && u.getWorkPhoneEx().length() > 0) { //ext present\n form1.setField(\"Phone\", StandardCode.getInstance().noNull(u.getWorkPhone()) + \" ext \" + StandardCode.getInstance().noNull(u.getWorkPhoneEx()));\n }\n else { //no ext present\n form1.setField(\"Phone\", StandardCode.getInstance().noNull(u.getWorkPhone()));\n }\n form1.setField(\"Fax\", StandardCode.getInstance().noNull(u.getLocation().getFax_number()));\n form1.setField(\"Address\", StandardCode.getInstance().printLocation(u.getLocation()));\n \n //START add images\n if(u.getPicture() != null && u.getPicture().length() > 0) {\n PdfContentByte over;\n Image img = Image.getInstance(\"C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/logo/images/\" + u.getPicture());\n img.setAbsolutePosition(200, 200);\n over = stamp.getOverContent(1);\n over.addImage(img, 45, 0,0, 45, 300,100);\n }\n //END add images\n \n //stamp.setFormFlattening(true);\n stamp.close();\n \n //write to client (web browser)\n //project number + sequential PO number + abbreviation of target language \n // Example: 007941therm-002-DE.pdf \nresponse.setHeader(\"Content-disposition\", \"attachment; filename=\" + p.getNumber() + p.getCompany().getCompany_code() + \"-\" + lt.getPoNumber() +\"-\"+targetLang+ \".pdf\");\n // //System.out.println(\"att:\"+p.getNumber() + p.getCompany().getCompany_code() + \"-\" + lt.getPoNumber() +\"-\"+targetLang);\n//response.setHeader(\"Content-disposition\", \"attachment; filename=\\\"test.pdf\\\"\");\n\n //response.setHeader(\"Content-disposition\", \"attachment; filename=\" + p.getNumber() + p.getCompany().getCompany_code() + \"-PO-\" + lt.getPoNumber() + \".pdf\");\n OutputStream os = response.getOutputStream();\n pdfStream.writeTo(os);\n os.flush();\n } \n catch(Exception e) {\n System.err.println(\"PDF Exception:\" + e.getMessage());\n\t\tthrow new RuntimeException(e);\n }\n //END process pdf\n }\n if(engId != null) { //generate eng PO\n EngTask et = (EngTask) ProjectService.getInstance().getSingleEngTask(Integer.valueOf(engId));\n \n //allow blank po\n Resource r = new Resource();\n if(et.getPersonName() != null && et.getPersonName().length() > 0) {\n //get resource\n r = ResourceService.getInstance().getSingleResource(Integer.valueOf(et.getPersonName()));\n //Add default score of \"0\"for this resource\n et.setScore(new Integer(0));\n et.setPoNumber(poNumber);\n }\n \n ProjectService.getInstance().updateEngTask(et);\n \n //get user (project manager)\n User u = UserService.getInstance().getSingleUserRealName(StandardCode.getInstance().getFirstName(p.getPm()), StandardCode.getInstance().getLastName(p.getPm()));\n \n //START process pdf\n try {\n PdfReader reader = new PdfReader(\"C:/templates/LI01_thru_LI04.pdf\"); //the template\n \n //save the pdf in memory\n ByteArrayOutputStream pdfStream = new ByteArrayOutputStream();\n \n //the filled-in pdf\n PdfStamper stamp = new PdfStamper(reader, pdfStream);\n \n //stamp.setEncryption(true, \"pass\", \"pass\", PdfWriter.AllowCopy | PdfWriter.AllowPrinting);\n AcroFields form1 = stamp.getAcroFields();\n\n //set the field values in the pdf form\n if((r.getFirstName() != null && r.getFirstName().length() >= 1) && (r.getLastName() != null && r.getLastName().length() >= 1)) {\n form1.setField(\"contractor\", StandardCode.getInstance().noNull(r.getFirstName()) + \" \" + StandardCode.getInstance().noNull(r.getLastName()));\n }\n else {\n form1.setField(\"contractor\", StandardCode.getInstance().noNull(r.getCompanyName()));\n }\n form1.setField(\"Project\", p.getNumber() + p.getCompany().getCompany_code());\n form1.setField(\"PO\", p.getNumber() + p.getCompany().getCompany_code() + \"-PO-\" + et.getPoNumber());\n form1.setField(\"Currency\", et.getInternalCurrency());\n if(et.getTotal() != null) {\n form1.setField(\"Volume_total\", String.valueOf(et.getTotal()));\n }\n \n //rate and cost\n if(et.getInternalRate() != null) {\n double rateNew = new Double(et.getInternalRate()).doubleValue();\n form1.setField(\"Rate_new\",String.valueOf(rateNew));\n double costNew = et.getTotal().doubleValue() * rateNew;\n form1.setField(\"Cost_new\", String.valueOf(costNew));\n form1.setField(\"Cost_total\", String.valueOf(costNew));\n }\n String targetLang = et.getTargetLanguage();\n form1.setField(\"Language\", et.getTargetLanguage());\n form1.setField(\"Task1\", et.getTaskName());\n \n if(et.getDueDateDate() != null) {\n form1.setField(\"Deadline\", DateFormat.getDateInstance(DateFormat.SHORT).format(et.getDueDateDate()));\n }\n \n form1.setField(\"PM\", p.getPm()); \n form1.setField(\"date\", DateFormat.getDateInstance(DateFormat.SHORT).format(new Date()));\n form1.setField(\"Email\", u.getWorkEmail1());\n if(u.getWorkPhoneEx() != null && u.getWorkPhoneEx().length() > 0) { //ext present\n form1.setField(\"Phone\", StandardCode.getInstance().noNull(u.getWorkPhone()) + \" ext \" + StandardCode.getInstance().noNull(u.getWorkPhoneEx()));\n }\n else { //no ext present\n form1.setField(\"Phone\", StandardCode.getInstance().noNull(u.getWorkPhone()));\n }\n form1.setField(\"Fax\", StandardCode.getInstance().noNull(u.getLocation().getFax_number()));\n form1.setField(\"Address\", StandardCode.getInstance().printLocation(u.getLocation()));\n \n //START add images\n if(u.getPicture() != null && u.getPicture().length() > 0) {\n PdfContentByte over;\n Image img = Image.getInstance(\"C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/logo/images/\" + u.getPicture());\n img.setAbsolutePosition(200, 200);\n over = stamp.getOverContent(1);\n over.addImage(img, 45, 0,0, 45, 300,100);\n }\n //END add images\n \n //stamp.setFormFlattening(true);\n stamp.close();\n \n //write to client (web browser)\n response.setHeader(\"Content-disposition\", \"attachment; filename=\" + p.getNumber() + p.getCompany().getCompany_code() + \"-\" + et.getPoNumber() +\"-\"+targetLang+ \".pdf\");\n\n // response.setHeader(\"Content-disposition\", \"attachment; filename=\" + p.getNumber() + p.getCompany().getCompany_code() + \"-PO-\" + et.getPoNumber() + \".pdf\");\n OutputStream os;\n os = response.getOutputStream();\n pdfStream.writeTo(os);\n os.flush();\n } \n catch(Exception e) {\n System.err.println(\"PDF Exception:\" + e.getMessage());\n\t\tthrow new RuntimeException(e);\n }\n //END process pdf\n }\n if(dtpId != null) { //generate dtp PO\n DtpTask dt = (DtpTask) ProjectService.getInstance().getSingleDtpTask(Integer.valueOf(dtpId));\n \n //allow blank po\n Resource r = new Resource();\n if(dt.getPersonName() != null && dt.getPersonName().length() > 0) {\n //get resource\n r = ResourceService.getInstance().getSingleResource(Integer.valueOf(dt.getPersonName()));\n //Add default score of \"0\"for this resource\n dt.setScore(new Integer(0));\n dt.setPoNumber(poNumber);\n }\n \n ProjectService.getInstance().updateDtpTask(dt);\n \n //get user (project manager)\n User u = UserService.getInstance().getSingleUserRealName(StandardCode.getInstance().getFirstName(p.getPm()), StandardCode.getInstance().getLastName(p.getPm()));\n \n //START process pdf\n try {\n PdfReader reader = new PdfReader(\"C:/templates/LI01_thru_LI04.pdf\"); //the template\n \n //save the pdf in memory\n ByteArrayOutputStream pdfStream = new ByteArrayOutputStream();\n \n //the filled-in pdf\n PdfStamper stamp = new PdfStamper(reader, pdfStream);\n \n //stamp.setEncryption(true, \"pass\", \"pass\", PdfWriter.AllowCopy | PdfWriter.AllowPrinting);\n AcroFields form1 = stamp.getAcroFields();\n\n //set the field values in the pdf form\n if((r.getFirstName() != null && r.getFirstName().length() >= 1) && (r.getLastName() != null && r.getLastName().length() >= 1)) {\n form1.setField(\"contractor\", StandardCode.getInstance().noNull(r.getFirstName()) + \" \" + StandardCode.getInstance().noNull(r.getLastName()));\n }\n else {\n form1.setField(\"contractor\", StandardCode.getInstance().noNull(r.getCompanyName()));\n }\n form1.setField(\"Project\", p.getNumber() + p.getCompany().getCompany_code());\n form1.setField(\"PO\", p.getNumber() + p.getCompany().getCompany_code() + \"-PO-\" + dt.getPoNumber());\n form1.setField(\"Currency\", dt.getInternalCurrency());\n if(dt.getTotal() != null) {\n form1.setField(\"Volume_total\", String.valueOf(dt.getTotal()));\n }\n \n //rate and cost\n if(dt.getInternalRate() != null) {\n double rateNew = new Double(dt.getInternalRate()).doubleValue();\n form1.setField(\"Rate_new\",StandardCode.getInstance().formatDouble3(new Double(rateNew)));\n double costNew = dt.getTotal().doubleValue() * rateNew;\n form1.setField(\"Cost_new\", StandardCode.getInstance().formatDouble(new Double(costNew)));\n form1.setField(\"Cost_total\", StandardCode.getInstance().formatDouble(new Double(costNew)));\n }\n \n form1.setField(\"Language\", dt.getTargetLanguage());\n form1.setField(\"Task1\", dt.getTaskName());\n \n if(dt.getDueDateDate() != null) {\n form1.setField(\"Deadline\", DateFormat.getDateInstance(DateFormat.SHORT).format(dt.getDueDateDate()));\n }\n \n form1.setField(\"PM\", p.getPm()); \n form1.setField(\"date\", DateFormat.getDateInstance(DateFormat.SHORT).format(new Date()));\n form1.setField(\"Email\", u.getWorkEmail1());\n if(u.getWorkPhoneEx() != null && u.getWorkPhoneEx().length() > 0) { //ext present\n form1.setField(\"Phone\", StandardCode.getInstance().noNull(u.getWorkPhone()) + \" ext \" + StandardCode.getInstance().noNull(u.getWorkPhoneEx()));\n }\n else { //no ext present\n form1.setField(\"Phone\", StandardCode.getInstance().noNull(u.getWorkPhone()));\n }\n form1.setField(\"Fax\", StandardCode.getInstance().noNull(u.getLocation().getFax_number()));\n form1.setField(\"Address\", StandardCode.getInstance().printLocation(u.getLocation()));\n \n //START add images\n if(u.getPicture() != null && u.getPicture().length() > 0) {\n PdfContentByte over;\n Image img = Image.getInstance(\"C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/logo/images/\" + u.getPicture());\n img.setAbsolutePosition(200, 200);\n over = stamp.getOverContent(1);\n over.addImage(img, 45, 0,0, 45, 300,100);\n }\n //END add images\n \n //stamp.setFormFlattening(true);\n stamp.close();\n \n //write to client (web browser)\n response.setHeader(\"Content-disposition\", \"attachment; filename=\" + p.getNumber() + p.getCompany().getCompany_code() + \"-\" + dt.getPoNumber() +\"-\"+dt.getTargetLanguage()+ \".pdf\");\n \n // response.setHeader(\"Content-disposition\", \"attachment; filename=\" + p.getNumber() + p.getCompany().getCompany_code() + \"-PO-\" + dt.getPoNumber() + \".pdf\");\n OutputStream os;\n os = response.getOutputStream();\n pdfStream.writeTo(os);\n os.flush();\n } \n catch(Exception e) {\n System.err.println(\"PDF Exception:\" + e.getMessage());\n\t\tthrow new RuntimeException(e);\n }\n //END process pdf\n }\n if(othId != null) { //generate oth PO\n OthTask ot = (OthTask) ProjectService.getInstance().getSingleOthTask(Integer.valueOf(othId));\n \n //allow blank po\n Resource r = new Resource();\n if(ot.getPersonName() != null && ot.getPersonName().length() > 0) {\n //get resource\n r = ResourceService.getInstance().getSingleResource(Integer.valueOf(ot.getPersonName()));\n //Add default score of \"0\"for this resource\n ot.setScore(new Integer(0));\n ot.setPoNumber(poNumber);\n }\n \n ProjectService.getInstance().updateOthTask(ot);\n \n //get user (project manager)\n User u = UserService.getInstance().getSingleUserRealName(StandardCode.getInstance().getFirstName(p.getPm()), StandardCode.getInstance().getLastName(p.getPm()));\n \n //START process pdf\n try {\n PdfReader reader = new PdfReader(\"C:/templates/LI01_thru_LI04.pdf\"); //the template\n \n //save the pdf in memory\n ByteArrayOutputStream pdfStream = new ByteArrayOutputStream();\n \n //the filled-in pdf\n PdfStamper stamp = new PdfStamper(reader, pdfStream);\n \n //stamp.setEncryption(true, \"pass\", \"pass\", PdfWriter.AllowCopy | PdfWriter.AllowPrinting);\n AcroFields form1 = stamp.getAcroFields();\n\n //set the field values in the pdf form\n if((r.getFirstName() != null && r.getFirstName().length() >= 1) && (r.getLastName() != null && r.getLastName().length() >= 1)) {\n form1.setField(\"contractor\", StandardCode.getInstance().noNull(r.getFirstName()) + \" \" + StandardCode.getInstance().noNull(r.getLastName()));\n }\n else {\n form1.setField(\"contractor\", StandardCode.getInstance().noNull(r.getCompanyName()));\n }\n form1.setField(\"Project\", p.getNumber() + p.getCompany().getCompany_code());\n form1.setField(\"PO\", p.getNumber() + p.getCompany().getCompany_code() + \"-PO-\" + ot.getPoNumber());\n form1.setField(\"Currency\", ot.getInternalCurrency());\n if(ot.getTotal() != null) {\n form1.setField(\"Volume_total\", String.valueOf(ot.getTotal()));\n }\n \n //rate and cost\n if(ot.getInternalRate() != null) {\n double rateNew = new Double(ot.getInternalRate()).doubleValue();\n form1.setField(\"Rate_new\",StandardCode.getInstance().formatDouble3(new Double(rateNew)));\n double costNew = ot.getTotal().doubleValue() * rateNew;\n form1.setField(\"Cost_new\", StandardCode.getInstance().formatDouble(new Double(costNew)));\n form1.setField(\"Cost_total\", StandardCode.getInstance().formatDouble(new Double(costNew)));\n }\n \n form1.setField(\"Language\", ot.getTargetLanguage());\n form1.setField(\"Task1\", ot.getTaskName());\n \n if(ot.getDueDateDate() != null) {\n form1.setField(\"Deadline\", DateFormat.getDateInstance(DateFormat.SHORT).format(ot.getDueDateDate()));\n }\n \n form1.setField(\"PM\", p.getPm()); \n form1.setField(\"date\", DateFormat.getDateInstance(DateFormat.SHORT).format(new Date()));\n form1.setField(\"Email\", u.getWorkEmail1());\n if(u.getWorkPhoneEx() != null && u.getWorkPhoneEx().length() > 0) { //ext present\n form1.setField(\"Phone\", StandardCode.getInstance().noNull(u.getWorkPhone()) + \" ext \" + StandardCode.getInstance().noNull(u.getWorkPhoneEx()));\n }\n else { //no ext present\n form1.setField(\"Phone\", StandardCode.getInstance().noNull(u.getWorkPhone()));\n }\n form1.setField(\"Fax\", StandardCode.getInstance().noNull(u.getLocation().getFax_number()));\n form1.setField(\"Address\", StandardCode.getInstance().printLocation(u.getLocation()));\n \n //START add images\n if(u.getPicture() != null && u.getPicture().length() > 0) {\n PdfContentByte over;\n Image img = Image.getInstance(\"C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/logo/images/\" + u.getPicture());\n img.setAbsolutePosition(200, 200);\n over = stamp.getOverContent(1);\n over.addImage(img, 45, 0,0, 45, 300,100);\n }\n //END add images\n \n //stamp.setFormFlattening(true);\n stamp.close();\n \n //write to client (web browser)\n //response.setHeader(\"Content-disposition\", \"attachment; filename=\" + p.getNumber() + p.getCompany().getCompany_code() + \"-PO-\" + ot.getPoNumber() + \".pdf\");\n response.setHeader(\"Content-disposition\", \"attachment; filename=\" + p.getNumber() + p.getCompany().getCompany_code() + \"-\" + ot.getPoNumber() +\"-\"+ot.getTargetLanguage()+ \".pdf\");\n \n OutputStream os;\n os = response.getOutputStream();\n pdfStream.writeTo(os);\n os.flush();\n } \n catch(Exception e) {\n System.err.println(\"PDF Exception:\" + e.getMessage());\n\t\tthrow new RuntimeException(e);\n }\n //END process pdf\n }\n \n // Forward control to the specified success URI\n\treturn (mapping.findForward(\"Success\"));\n }", "void createProjectForExercise(ProgrammingExercise programmingExercise) throws VersionControlException;", "public String handleEdit()\n throws webschedulePresentationException, HttpPresentationException\n {\t\t \n \n Project project = null;\n\n \n \n // Try to get the proj by its ID\n try {\n\t project = ProjectFactory.findProjectByID(this.getProjectID());\n\t \n\t String title = project.getProj_name();\n\t System.out.println(\"project title: \"+title);\n\t\n } catch(Exception ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid PROJECT to edit\");\n throw new ClientPageRedirectException(UCSDPROJECTSEDIT_PAGE);\n }\n \n // If we got a valid project then try to save it\n // If any fields were missing then redisplay the edit page, \n // otherwise redirect to the project catalog page\n try {\n saveProject(project);\n throw new ClientPageRedirectException(UCSDPROJECTSEDIT_PAGE);\n } catch(Exception ex) {\n return showPage(\"You must fill out all fields to edit this project\");\n } \n }", "Project createProject();", "Project createProject();", "Project createProject();", "Project getByPrjNumber(Integer num);", "public void setProjectID(Integer projectID) { this.projectID = projectID; }", "public ArrayList<Project> selectProject(String projectId) {\n\n try {\n ArrayList<Project> tasks = new ArrayList<Project>();\n\n String query = \"SELECT * FROM TASKS where PROJECT_ID = ?\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(query);\n ps.setString(1, projectId);\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n String hours = rs.getString(\"HOURS\");\n String hoursadded = rs.getString(\"HOURS_ADDED\");\n String description = rs.getString(\"DESCRIPTION\");\n Project p = new Project(description, hours, hoursadded,\n projectId);\n tasks.add(p);\n }\n rs.close();\n ps.close();\n return tasks;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return null;\n }\n }", "int getReprojectedEtoId(String project, DataDate date) throws SQLException;", "HibProject getProject(InternalActionContext ac);", "@RequestMapping(value = \"/create/project/{projectId}\", method = RequestMethod.GET)\r\n public ModelAndView create(@PathVariable(\"projectId\") String projectId) {\r\n ModelAndView mav = new ModelAndView(\"creates2\");\r\n int pid = -1;\r\n try {\r\n pid = Integer.parseInt(projectId);\r\n } catch (Exception e) {\r\n LOG.error(e);\r\n }\r\n User loggedIn = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n User user = hibernateTemplate.get(User.class, loggedIn.getUsername());\r\n Project project = hibernateTemplate.get(Project.class, pid);\r\n if (!dataAccessService.isProjectAvailableToUser(project, user)) {\r\n return accessdenied();\r\n }\r\n List<SubProject> subProjects = dataAccessService.getResearcherSubProjectsForUserInProject(user, project);\r\n mav.addObject(\"projectId\", projectId);\r\n mav.addObject(\"methods\", project.getMethods());\r\n mav.addObject(\"subProjects\", subProjects);\r\n return mav;\r\n }", "public Project procreate(Project pud) throws IOException {\n\t\tString ur = url + \"/procreate\";\n\t\tProject us = restTemplate().postForObject(ur, pud, Project.class);\n\t\tSystem.out.println(us.toString());\n\t\t//UserDetails user = om.readValue(us,UserDetails.class);\n\t\treturn us;\n\t}", "public void commissionRunway(String id);", "public ProjectBean getProjectFromDB(String projectIdentifier) {\n List<Experiment> experiments =\n this.getOpenBisClient().getExperimentsForProject2(projectIdentifier);\n\n float projectStatus = this.getOpenBisClient().computeProjectStatus(experiments);\n\n Project project = getOpenBisClient().getProjectByIdentifier(projectIdentifier);\n dtoProjects.put(projectIdentifier, project);\n\n ProjectBean newProjectBean = new ProjectBean();\n\n ProgressBar progressBar = new ProgressBar();\n progressBar.setValue(projectStatus);\n\n Date registrationDate = project.getRegistrationDetails().getRegistrationDate();\n\n String pi = getDatabaseManager().getPersonDetailsForProject(project.getIdentifier(), \"PI\");\n String cp = getDatabaseManager().getPersonDetailsForProject(project.getIdentifier(), \"Contact\");\n String manager = getDatabaseManager().getPersonDetailsForProject(project.getIdentifier(), \"Manager\"); \n String longDesc = getDatabaseManager().getLongProjectDescription(project.getIdentifier());\n\n if (pi.equals(\"\")) {\n newProjectBean.setPrincipalInvestigator(\"n/a\");\n } else {\n newProjectBean.setPrincipalInvestigator(pi);\n }\n\n if (cp.equals(\"\")) {\n newProjectBean.setContactPerson(\"n/a\");\n } else {\n newProjectBean.setContactPerson(cp);\n }\n\n if (manager.equals(\"\")) {\n newProjectBean.setProjectManager(\"n/a\");\n } else {\n newProjectBean.setProjectManager(manager);\n }\n\n String secondaryName = getDatabaseManager().getProjectName(projectIdentifier);\n if (secondaryName == null || secondaryName.isEmpty())\n secondaryName = \"n/a\";\n newProjectBean.setSecondaryName(secondaryName);\n\n if (longDesc == null)\n longDesc = \"\";\n\n newProjectBean.setId(project.getIdentifier());\n newProjectBean.setCode(project.getCode());\n String desc = project.getDescription();\n if (desc == null)\n desc = \"\";\n newProjectBean.setDescription(desc);\n newProjectBean.setRegistrationDate(registrationDate);\n newProjectBean.setProgress(progressBar);\n newProjectBean.setRegistrator(project.getRegistrationDetails().getUserId());\n newProjectBean.setContact(project.getRegistrationDetails().getUserEmail());\n\n BeanItemContainer<ExperimentBean> experimentBeans =\n new BeanItemContainer<ExperimentBean>(ExperimentBean.class);\n\n for (Experiment experiment : experiments) {\n ExperimentBean newExperimentBean = new ExperimentBean();\n String status = \"\";\n\n Map<String, String> assignedProperties = experiment.getProperties();\n\n if (assignedProperties.keySet().contains(\"Q_CURRENT_STATUS\")) {\n status = assignedProperties.get(\"Q_CURRENT_STATUS\");\n }\n\n else if (assignedProperties.keySet().contains(\"Q_WF_STATUS\")) {\n status = assignedProperties.get(\"Q_WF_STATUS\");\n }\n\n // Image statusColor = new Image(status, this.setExperimentStatusColor(status));\n // statusColor.setWidth(\"15px\");\n // statusColor.setHeight(\"15px\");\n // statusColor.setCaption(status);\n\n newExperimentBean.setId(experiment.getIdentifier());\n newExperimentBean.setCode(experiment.getCode());\n newExperimentBean.setType(experiment.getExperimentTypeCode());\n newExperimentBean.setStatus(status);\n newExperimentBean.setRegistrator(experiment.getRegistrationDetails().getUserId());\n newExperimentBean\n .setRegistrationDate(experiment.getRegistrationDetails().getRegistrationDate());\n experimentBeans.addBean(newExperimentBean);\n }\n\n newProjectBean.setLongDescription(longDesc);\n\n List<ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSet> projectData = this\n .getOpenBisClient().getDataSetsOfProjectByIdentifierWithSearchCriteria(projectIdentifier);\n\n Boolean containsData = false;\n Boolean containsResults = false;\n Boolean attachmentResult = false;\n // Boolean containsAttachments = false;\n\n for (ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSet ds : projectData) {\n attachmentResult = false;\n if (ds.getDataSetTypeCode().equals(\"Q_PROJECT_DATA\")) {\n attachmentResult = ds.getProperties().get(\"Q_ATTACHMENT_TYPE\").equals(\"RESULT\");\n }\n\n if (!(ds.getDataSetTypeCode().equals(\"Q_PROJECT_DATA\"))\n && !(ds.getDataSetTypeCode().contains(\"RESULTS\"))) {\n containsData = true;\n } else if (ds.getDataSetTypeCode().contains(\"RESULTS\") || attachmentResult) {\n containsResults = true;\n } // else if (ds.getDataSetTypeCode() == \"Q_PROJECT_DATA\") {\n // containsAttachments = true;\n // }\n }\n\n newProjectBean.setContainsData(containsData);\n newProjectBean.setContainsResults(containsResults);\n\n newProjectBean.setExperiments(experimentBeans);\n newProjectBean.setMembers(new HashSet<String>());\n return newProjectBean;\n }", "public abstract KenaiProject[] getDashboardProjects(boolean onlyOpened);", "public Long createProject(ProjectTo projectTo) {\n\t\tprojectTo = new ProjectTo();\n\t\tprojectTo.setOrg_id(1L);\n\t\tprojectTo.setOrg_name(\"AP\");\n\t\tprojectTo.setName(\"Menlo\");\n\t\tprojectTo.setShort_name(\"Pioneer Towers\");\n\t\tprojectTo.setOwner_username(\"Madhapur\");\n\n\t\ttry {\n\t\t\tWebResource webResource = getJerseyClient(userOptixURL + \"CreateProject\");\n\t\t\tprojectTo = webResource.type(MediaType.APPLICATION_JSON).post(ProjectTo.class, projectTo);\n\t\t\tif(projectTo != null && projectTo.getProject_id() != null) {\n\t\t\t\treturn projectTo.getProject_id() ;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in getting the response from REST call CreateProject : \"+e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "protected Project createProjectWithClient(long id, Client client) {\n Project project = new Project();\n setAuditableEntity(project);\n project.setActive(true);\n project.setClient(client);\n ProjectStatus projectStatus = createProjectStatus(100000);\n project.setProjectStatus(projectStatus);\n project.setId(id);\n project.setCompany(client.getCompany());\n\n // persist object\n Query query = entityManager\n .createNativeQuery(\"insert into project (project_id, project_status_id, client_id, \"\n + \"company_id,name,active,sales_tax,po_box_number,payment_terms_id,\"\n + \"description,creation_date,creation_user,modification_date,\"\n + \"modification_user,is_deleted,is_manual_prize_setting)\"\n + \" values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\");\n int idx = 1;\n query.setParameter(idx++, project.getId());\n query.setParameter(idx++, project.getProjectStatus().getId());\n query.setParameter(idx++, project.getClient().getId());\n query.setParameter(idx++, project.getCompany().getId());\n query.setParameter(idx++, project.getName());\n query.setParameter(idx++, project.isActive());\n query.setParameter(idx++, project.getSalesTax());\n query.setParameter(idx++, project.getPOBoxNumber());\n query.setParameter(idx++, project.getPaymentTermsId());\n query.setParameter(idx++, project.getDescription());\n query.setParameter(idx++, project.getCreateDate());\n query.setParameter(idx++, project.getCreateUsername());\n query.setParameter(idx++, project.getModifyDate());\n query.setParameter(idx++, project.getModifyUsername());\n query.setParameter(idx++, 0);\n query.setParameter(idx++, 0);\n query.executeUpdate();\n\n query = entityManager\n .createNativeQuery(\"insert into client_project (project_id, client_id) values (?,?)\");\n idx = 1;\n query.setParameter(idx++, project.getId());\n query.setParameter(idx++, project.getClient().getId());\n query.executeUpdate();\n \n return project;\n }", "public ProjectIdea getProjectIdea(int id){\n //String sql = \"SELECT * FROM project_idea WHERE idea_id = ?\";\n try{\n ProjectIdea result = super.queryForId(id);\n return result;\n } catch(SQLException e){\n System.out.println(e.getMessage());\n }\n return null;\n }", "public boolean addClient(Project p) {\n try {\n String insert = \"INSERT INTO CLIENTS\" + \"(NAME,ADDRESS,CLIENT_ID) \"\n + \"VALUES(?,?,PROJECTS_SEQ.NEXTVAL)\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(insert);\n ps.setString(1, p.getName());\n ps.setString(2, p.getAddress());\n\n ps.executeUpdate();\n ps.close();\n return true;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return false;\n }\n }", "public void testProjectsView() {\n ProjectsTabOperator.invoke();\n // needed for slower machines\n JemmyProperties.setCurrentTimeout(\"JTreeOperator.WaitNextNodeTimeout\", 30000); // NOI18N\n SourcePackagesNode sourcePackagesNode = new SourcePackagesNode(SAMPLE_PROJECT_NAME);\n Node sample1Node = new Node(sourcePackagesNode, SAMPLE1_PACKAGE_NAME);\n Node sampleClass1Node = new Node(sample1Node, SAMPLE1_FILE_NAME);\n // test pop-up menu actions\n // \"Copy\"\n CopyAction copyAction = new CopyAction();\n copyAction.perform(sampleClass1Node);\n // \"Paste\"\n PasteAction pasteAction = new PasteAction();\n // \"Refactor\"\n String refactorItem = Bundle.getStringTrimmed(\"org.netbeans.modules.refactoring.spi.impl.Bundle\", \"LBL_Action\");\n // \"Copy...\"\n String copyItem = Bundle.getStringTrimmed(\"org.netbeans.modules.refactoring.spi.impl.Bundle\", \"LBL_CopyAction\");\n new ActionNoBlock(null, pasteAction.getPopupPath() + \"|\" + refactorItem + \" \" + copyItem).perform(sample1Node);\n\n String copyClassTitle = Bundle.getString(\"org.netbeans.modules.refactoring.java.ui.Bundle\", \"LBL_CopyClass\");\n NbDialogOperator copyClassDialog = new NbDialogOperator(copyClassTitle);\n // \"Refactor\"\n String refactorLabel = Bundle.getStringTrimmed(\"org.netbeans.modules.refactoring.spi.impl.Bundle\", \"CTL_Finish\");\n new JButtonOperator(copyClassDialog, refactorLabel).push();\n // refactoring is done asynchronously => need to wait until dialog dismisses\n copyClassDialog.waitClosed();\n\n Node newClassNode = new Node(sample1Node, \"SampleClass11\"); // NOI18N\n // \"Cut\"\n CutAction cutAction = new CutAction();\n cutAction.perform(newClassNode);\n // package created by default when the sample project was created\n Node sampleProjectPackage = new Node(sourcePackagesNode, SAMPLE_PROJECT_NAME.toLowerCase());\n // \"Move...\"\n String moveItem = Bundle.getStringTrimmed(\"org.netbeans.modules.refactoring.spi.impl.Bundle\", \"LBL_MoveAction\");\n new ActionNoBlock(null, pasteAction.getPopupPath() + \"|\" + refactorItem + \" \" + moveItem).perform(sampleProjectPackage);\n new EventTool().waitNoEvent(1000);\n // confirm refactoring\n // \"Move Class\"\n String moveClassTitle = Bundle.getString(\"org.netbeans.modules.refactoring.java.ui.Bundle\", \"LBL_MoveClass\");\n NbDialogOperator moveClassDialog = new NbDialogOperator(moveClassTitle);\n new JButtonOperator(moveClassDialog, refactorLabel).push();\n // refactoring is done asynchronously => need to wait until dialog dismisses\n try {\n moveClassDialog.waitClosed();\n } catch (TimeoutExpiredException e) {\n // try it once more\n moveClassDialog = new NbDialogOperator(moveClassTitle);\n new JButtonOperator(moveClassDialog, refactorLabel).push();\n }\n // \"Delete\"\n newClassNode = new Node(sampleProjectPackage, \"SampleClass11\"); // NOI18N\n new EventTool().waitNoEvent(2000);\n new DeleteAction().perform(newClassNode);\n DeleteAction.confirmDeletion();\n }", "public void getProject(){\n\t\n\t String getList[] = clientFacade.GetProjects().split(\"\\n\");\n\t DefaultComboBoxModel addPro = new DefaultComboBoxModel();\n\t\tfor(int i=1; i<getList.length; i+=2) \n\t\t\t addPro.addElement(getList[i]);\n\t\t\t \n\t\tcPro.setModel(addPro);\t\n\t}", "public Model invoke(Model result) {\n if (result instanceof Project) {\n final Project project = (Project) result;\n YamlModelLoader.loadModels(\"project-data.yml\", new YamlModelLoader.Callback<Model>() {\n public Model invoke(Model result) {\n ProjectModel projectModel = (ProjectModel) result;\n projectModel.project = project;\n projectModel.account = project.account;\n return projectModel;\n }\n }, new YamlModelLoader.Callback<Model>() {\n public Model invoke(Model result) {\n // put template DefectStatus entities in the cache so we can use them later on\n if (result instanceof DefectStatus) {\n addCacheEntry(result.getClass().getName(), ((ProjectModel) result).project, result, templateDataCache);\n }\n return result;\n }\n }\n );\n \n return project;\n }\n return result;\n }", "@Override\r\n protected void executeAction() throws Exception {\r\n // get the submission of the project\r\n Submission[] submissions = getContestServiceFacade().getSoftwareProjectSubmissions(getCurrentUser(), projectId);\r\n // check whether the project contains the submission the user want to download\r\n for (Submission sub : submissions) {\r\n if (sub.getUpload() != null && sub.getId() == submissionId) {\r\n submission = sub;\r\n break;\r\n }\r\n }\r\n\r\n if (submission == null) {\r\n // the user can't download the upload which is not belongs to the project\r\n throw new Exception(\"Cannot find submission \" + submissionId + \" in project \" + projectId);\r\n }\r\n\r\n contest = getContestServiceFacade().getSoftwareContestByProjectId(getCurrentUser(), projectId);\r\n\r\n if (submission.getUpload().getUrl() == null) {\r\n if (DirectUtils.isStudio(contest)) {\r\n Long userId = null;\r\n String handle = null;\r\n for (Resource r : contest.getResources()) {\r\n if (r.getId() == submission.getUpload().getOwner()) {\r\n userId = r.getUserId();\r\n handle = r.getProperty(RESOURCE_PROPERTY_HANDLE);\r\n }\r\n }\r\n\r\n uploadedFile = studioFileUpload.getUploadedFile(DirectUtils.createStudioLocalFilePath(contest.getId(), userId, handle,\r\n submission.getUpload().getParameter()));\r\n } else {\r\n uploadedFile = fileUpload.getUploadedFile(submission.getUpload().getParameter());\r\n }\r\n } else {\r\n externalUrl = submission.getUpload().getUrl();\r\n }\r\n\r\n }", "public boolean updateProject(Project project);", "private void newProject(ActionEvent x) {\n\t\tthis.controller.newProject();\n\t}", "List<CliStaffProject> selectByExample(CliStaffProjectExample example);", "public Project getProjectDetails(String id) {\n\t\tProject pro;\n\t\tObject name = null;\n\t\tPreparedStatement st = null;\n\t\tResultSet res = null;\n\t\tpro = null;\n\t\ttry {\n\t\t\ttry {\n\t\t\t\tcon = DBUtility.getConnection();\n\t\t\t\tString sql = \"select * from project_master where project_id='\"\n\t\t\t\t\t\t+ id + \"'\";\n\t\t\t\tst = con.prepareStatement(sql);\n\t\t\t\tres = st.executeQuery(sql);\n\t\t\t\tif (res.next()) {\n\t\t\t\t\tpro = new Project();\n\t\t\t\t\tpro.setPro_name(res.getString(\"project_name\"));\n\t\t\t\t\tpro.setSite_addr(res.getString(\"project_location\"));\n\t\t\t\t\tpro.setC_name(res.getString(\"client_name\"));\n\t\t\t\t\tpro.setDate(res.getString(\"project_date\"));\n\t\t\t\t\tpro.setSite_details(res.getString(\"project_details\"));\n\t\t\t\t\tpro.setSite_no_floors(res.getString(\"project_no_floor\"));\n\t\t\t\t\tpro.setSite_no_units(res.getString(\"project_no_unit\"));\n\t\t\t\t\tpro.setGar_name(res.getString(\"gar_name\"));\n\t\t\t\t\tpro.setGar_rel(res.getString(\"gar_rel\"));\n\t\t\t\t\tpro.setMunicipality(res.getString(\"municipality\"));\n\t\t\t\t\tpro.setWord_no(res.getString(\"word_no\"));\n\t\t\t\t\tpro.setPro_typ(res.getString(\"project_type\"));\n\t\t\t\t\tpro.setContact1(res.getString(\"Contact1\"));\n\t\t\t\t\tpro.setContact2(res.getString(\"Contact2\"));\n\t\t\t\t\tpro.setEmail1(res.getString(\"Email1\"));\n\t\t\t\t\tpro.setEmail2(res.getString(\"Email2\"));\n\t\t\t\t}\n\t\t\t} catch (SQLException s) {\n\t\t\t\ts.printStackTrace();\n\t\t\t\tDBUtility.closeConnection(con, st, res);\n\t\t\t\treturn null;\n\t\t\t} catch (NamingException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tDBUtility.closeConnection(con, st, res);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tDBUtility.closeConnection(con, st, res);\n\t\t\t}\n\t\t} finally {\n\t\t\tDBUtility.closeConnection(con, st, res);\n\t\t}\n\t\treturn pro;\n\t}", "public static void updateContractor(){\n projectChosen = getQuestionInput();\r\n try {\r\n Connection myConn = DriverManager.getConnection(url, user, password);\r\n\r\n String sqlInsert = \"UPDATE projects\" +\r\n \" SET contract_name = ?, contract_tel = ?, contract_email = ?, contract_address = ?\" +\r\n \"WHERE project_num = \" +projectChosen;\r\n\r\n PreparedStatement pstmt = myConn.prepareStatement(sqlInsert);\r\n pstmt.setString(1, NewProject.contract_name);\r\n pstmt.setString(2, NewProject.contract_tel);\r\n pstmt.setString(3, NewProject.contract_email);\r\n pstmt.setString(4, NewProject.contract_address);\r\n pstmt.executeUpdate(); //Execute update of database.\r\n pstmt.close();\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public String reviewProjectSubmissionQuery(String pID) \r\n\t{\r\n\t\tString query = \"SELECT * FROM SubmittedProject WHERE ProjectID=\\\"\"+pID+\"\\\"\";\r\n\t\tSystem.out.println(query);\r\n\t\treturn query;\r\n\t}", "public Project(String name, String nick, Calendar startDate, int duration, Teacher mainTeacher) {\n Calendar endDate = (Calendar) startDate.clone();\n endDate.add(Calendar.MONTH, duration);\n this.name = name;\n this.nick = nick;\n this.startDate = startDate;\n this.estimatedEnd = endDate;\n this.mainTeacher = mainTeacher;\n this.endDate = null;\n this.teachers = new ArrayList<>();\n this.scholars = new ArrayList<>();\n this.tasks = new ArrayList<>();\n this.finished = false;\n }", "public static Project getProject() {\n if (ProjectList.size() == 0) {\n System.out.print(\"No Projects were found.\");\n return null;\n }\n\n System.out.print(\"\\nPlease enter the project number: \");\n int projNum = input.nextInt();\n input.nextLine();\n\n for (Project proj : ProjectList) {\n if (proj.projNum == projNum) {\n return proj;\n }\n }\n\n System.out.print(\"\\nProject was not found. Please try again.\");\n return getProject();\n }", "public Project getProjectWithEmployee(int projectId) throws EmployeeManagementException;", "public ProyectoInfraestructura crearProyectoInfraestructura(Proponente p,String nombre, String descrL, String descC , double cost,String croquis ,String imagen,HashSet<String> distritos){\r\n\t\tProyectoInfraestructura proyecto;\r\n\t\t\r\n\t\tif(p.getClass().getSimpleName().equals(\"Colectivo\")) {\r\n\t\t\tColectivo c = (Colectivo) p;\r\n\t\t\tproyecto = new ProyectoInfraestructura(p,c.getUsuarioRepresentanteDeColectivo() , nombre, descrL, descC , cost , croquis , imagen,distritos);\r\n\t\t\t\r\n\t\t}else {//Usuario\r\n\t\t\tUsuario u = (Usuario) p;\r\n\t\t\tproyecto = new ProyectoInfraestructura(u,u , nombre, descrL, descC , cost , croquis , imagen,distritos);\t\t\t\r\n\t\t}\r\n\t\tp.proponerProyecto(proyecto);\r\n\t\t\r\n\t\tthis.proyectos.add(proyecto);\r\n\t\tthis.lastProjectUniqueID++;\r\n\t\treturn proyecto;\r\n\t\t\r\n\t}", "public void execute(HttpServletRequest request, HttpServletResponse response) {\n\t\t\r\n\t\tHttpSession session = request.getSession();\r\n\t\tString currentUser = (String)session.getAttribute(\"sessionID\");\r\n\t\tString nFrom = (String)session.getAttribute(\"currentProject\");\r\n\t\tint subpId = Integer.parseInt(request.getParameter(\"subpId\"));\r\n\t\t\r\n\t\t\r\n\t\tSubProjectDAO subProjectdao = new SubProjectDAO();\r\n\t\tSubProjectDO subProject = subProjectdao.readSubProject(subpId);\r\n\t\t\r\n\t\tSimpleDateFormat dateformat = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n\t\t\r\n\t\trequest.setAttribute(\"subProject\",subProject);\r\n\t\t\t\t\r\n\t\t//request.setAttribute(\"curProject\", nFrom);\r\n\t}", "String makePlanCommunityParticipationUrl();", "public Project processReconcilliationForm(Project project, ReconciliationForm form) {\r\n\r\n project.setMark(form.getMark());\r\n String originalStatus = project.getStatus();\r\n\r\n if (originalStatus.equals(\"R1A\") || originalStatus.equals(\"SM\")) {\r\n project.setStatus(\"R1M\");\r\n } else if (originalStatus.equals(\"R2C\")) {\r\n project.setStatus(\"R2M\");\r\n } else if (originalStatus.equals(\"R3C\")) {\r\n project.setStatus(\"R3M\");\r\n }\r\n project.addReconComments(\"[Reconciliation \" + project.getStatus() + \" reason]:\\n\" + form.getReason());\r\n return project;\r\n }", "public Project() {\n this.name = \"Paper plane\";\n this.description = \" It's made of paper.\";\n }", "ProjectDTO findProjectById(Long id);", "public static void updateArchitect(){\n projectChosen = getQuestionInput();\r\n try {\r\n Connection myConn = DriverManager.getConnection(url, user, password);\r\n\r\n String sqlInsert = \"UPDATE projects \" +\r\n \" SET architect_name = ?, architect_tel = ?, architect_email = ?, architect_address = ?\" +\r\n \"WHERE project_num = \" +projectChosen;\r\n\r\n PreparedStatement pstmt = myConn.prepareStatement(sqlInsert);\r\n pstmt.setString(1, NewProject.architect_name);\r\n pstmt.setString(2, NewProject.architect_tel);\r\n pstmt.setString(3, NewProject.architect_email);\r\n pstmt.setString(4, NewProject.architect_address);\r\n pstmt.executeUpdate(); //Execute update of database.\r\n pstmt.close();\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }", "UserOperateProject selectByPrimaryKey(String userOperateProjectId);", "public void saveNewProject(){\n String pn = tGUI.ProjectTextField2.getText();\n String pd = tGUI.ProjectTextArea1.getText();\n String statusID = tGUI.StatusComboBox.getSelectedItem().toString();\n String customerID = tGUI.CustomerComboBox.getSelectedItem().toString();\n\n int sstatusID = getStatusID(statusID);\n int ccustomerID = getCustomerID(customerID);\n\n try {\n pstat = cn.prepareStatement (\"insert into projects (project_name, project_description, project_status_id, customer_id) VALUES (?,?,?,?)\");\n pstat.setString(1, pn);\n pstat.setString(2,pd);\n pstat.setInt(3, sstatusID);\n pstat.setInt(4, ccustomerID);\n pstat.executeUpdate();\n\n }catch (SQLException ex) {\n Logger.getLogger(ProjectMethods.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "URL getRepositoryWebUrl(ProgrammingExerciseParticipation participation);", "List<UserOperateProject> selectByExample(UserOperateProjectExample example);", "public PioneeringMission(AIMain aiMain, AIUnit aiUnit) {\n super(aiMain, aiUnit);\n\n if (!hasTools()) colonyWithTools = findColonyWithTools(aiUnit);\n tileImprovementPlan = findTileImprovementPlan(aiUnit);\n tileImprovementPlan.setPioneer(aiUnit);\n logger.finest(\"AI pioneer starts with plan \"\n + tileImprovementPlan + \"/\" + tileImprovementPlan.getTarget()\n + \": \" + aiUnit.getUnit());\n }", "public void changeCurrProject(ProjectModel p) {\n \tprojects.remove(p);\n \tprojects.add(0, p);\n }", "public abstract String enableSubmission(ISubmissionProject project);", "@ProcessAction(name = \"consultarProyecto\")\r\n\t\tpublic void consultarProyecto(ActionRequest actionRequest, ActionResponse actionResponse)\r\n\t\t\t\tthrows IOException, PortletException {\r\n\t\t\tLOGGER.info(\"ID Proyecto \" + ParamUtil.getString(actionRequest, \"projectID\"));\r\n\r\n\t\t\tString projectID = ParamUtil.getString(actionRequest, \"projectID\");\r\n\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// Hacer campos visibles en jsp\r\n\t\t\tactionRequest.setAttribute(\"projectID\", projectID);\r\n\t\t}", "public Camino dijkstra(Nodo destino, Exclusividad exclusividad,\r\n\t\t\tboolean restrictivo) {\r\n\r\n\t\tPriorityQueue<NodoDijkstra> aVisitar = new PriorityQueue<NodoDijkstra>();\r\n\t\tHashMap<Nodo, Integer> distancias = new HashMap<Nodo, Integer>();\r\n\t\tHashSet<Nodo> visitados = new HashSet<Nodo>();\r\n\r\n\t\tNodoDijkstra nodoOrigen = new NodoDijkstra(this, 0);\r\n\t\tnodoOrigen.setCamino(new Camino(this));\r\n\t\taVisitar.add(nodoOrigen);\r\n\t\tdistancias.put(this, new Integer(0));\r\n\r\n\t\twhile (!aVisitar.isEmpty()) {\r\n\t\t\tNodoDijkstra dNodo = aVisitar.poll();\r\n\t\t\tNodo actual = dNodo.getNodo();\r\n\t\t\tCamino camino = dNodo.getCamino();\r\n\r\n\t\t\tif (actual.equals(destino)) {\r\n\t\t\t\treturn camino;\r\n\t\t\t}\r\n\r\n\t\t\tif (visitados.contains(actual))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvisitados.add(actual);\r\n\r\n\t\t\tfor (CanalOptico canal : actual.canales) {\r\n\t\t\t\tNodo vecino = canal.getOtroExtremo(actual);\r\n\t\t\t\tint costo = canal.getCosto();\r\n\r\n\t\t\t\t/* Restriccion del Dijkstra */\r\n\t\t\t\tif (visitados.contains(vecino))\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t/* Restricciones del problema de Calidad de Proteccion */\r\n\t\t\t\tif (restrictivo) {\r\n\t\t\t\t\tif (!canal.libreSegunExclusividad(exclusividad))\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (canal.estaBloqueado())\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\tif (vecino.estaBloqueado())\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\tif (distancias.containsKey(vecino)) {\r\n\t\t\t\t\tint dActual = distancias.get(vecino);\r\n\r\n\t\t\t\t\tif (dActual <= dNodo.getDistancia() + costo)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\taVisitar.remove(vecino);\r\n\t\t\t\t\t\tdistancias.remove(vecino);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tNodoDijkstra nuevoNodo = new NodoDijkstra(vecino,\r\n\t\t\t\t\t\tdNodo.getDistancia() + costo);\r\n\t\t\t\tCamino caminoNuevo = new Camino(camino);\r\n\t\t\t\tcaminoNuevo.addSalto(new Salto(camino.getSaltos().size() + 1,\r\n\t\t\t\t\t\tcanal));\r\n\t\t\t\tnuevoNodo.setCamino(caminoNuevo);\r\n\t\t\t\taVisitar.add(nuevoNodo);\r\n\t\t\t\tdistancias.put(nuevoNodo.getNodo(), nuevoNodo.getDistancia());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "NFRSoftgoal createNFRSoftgoal();", "public static void makePayment(Project proj) {\n System.out.print(\"Add client's next payment: \");\n int newAmmount = input.nextInt();\n input.nextLine();\n proj.addAmount(newAmmount);\n }" ]
[ "0.5886299", "0.5847346", "0.5554482", "0.5541779", "0.5512264", "0.5490172", "0.5444942", "0.54240954", "0.54096717", "0.53930634", "0.53853875", "0.53711516", "0.53622544", "0.5359591", "0.53505415", "0.53156793", "0.5301213", "0.52939147", "0.5271658", "0.5263357", "0.52402395", "0.5224407", "0.5218514", "0.51966506", "0.51761264", "0.5172789", "0.51464164", "0.5131402", "0.5121544", "0.5113191", "0.5113191", "0.5107409", "0.5106816", "0.51002854", "0.5098748", "0.50957453", "0.50926626", "0.5087587", "0.50842446", "0.5083556", "0.50784546", "0.507679", "0.50690365", "0.5061847", "0.5049195", "0.5044389", "0.5034766", "0.5034719", "0.5033632", "0.50272685", "0.5021257", "0.50207335", "0.5019347", "0.5019347", "0.5019347", "0.5001041", "0.49904236", "0.4987653", "0.49828705", "0.49755576", "0.496469", "0.49543855", "0.49417862", "0.49400082", "0.49393034", "0.4931227", "0.49272043", "0.4926992", "0.49256703", "0.49252427", "0.49220452", "0.49138808", "0.49110037", "0.49033797", "0.4902851", "0.48901933", "0.48885062", "0.48845828", "0.4883127", "0.48792353", "0.48790166", "0.48773983", "0.48740155", "0.4874001", "0.4864638", "0.48603487", "0.48548523", "0.48544842", "0.48506537", "0.48489738", "0.4847842", "0.48443884", "0.4840853", "0.48387688", "0.48369166", "0.48343787", "0.48335555", "0.48316962", "0.48309895", "0.48301378" ]
0.61926717
0
Fills a survey of the given discipline
public void fillSurvey(String disciplineName, String projectName, int hours, String comment) throws NoSubmissionException, NoSuchSurveyException { Student _student = getStudent(); _student.fillSurvey(disciplineName, projectName, hours, comment); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void survey()\n {\n }", "@Override\n\tpublic void setSurvey(int id, int survey) {\n\t\t\n\t}", "public void createSurvey(int tid);", "public void configSurvey() {\n if (isTest) {\n this.o.setDisplay(\"Please enter name for test: \");\n } else {\n this.o.setDisplay(\"Please enter name for survey \");\n }\n this.o.getDisplay();\n this.survey.setName(this.in.getUserInput());\n }", "public void testAllMedicalQuestionParametersPopulated() {\n final String QUESTION_ID = \"hypoglycaemia-blood-sugar\";\n\n Map<String, MedicalCondition> conditions = cache.getConditions(Service.NOTIFY);\n MedicalCondition condition = conditions.get(DIABETES_CONDITION);\n\n assertNotNull(condition);\n\n MedicalQuestion question = condition.getQuestions().get(QUESTION_ID);\n assertNotNull(question);\n\n assertEquals(QUESTION_ID, question.getID());\n assertEquals(\"22\", question.getStep());\n assertEquals(Page.VERIFIED.getName(), question.getPage());\n assertEquals(9, question.getOrder().intValue());\n assertEquals(Format.RADIO.getName(), question.getType());\n assertEquals(Boolean.TRUE, question.getValidate());\n assertEquals(Boolean.FALSE, question.getLogout());\n assertEquals(EMPTY, question.getOptions());\n\n assertNotNull(question.getAnswers());\n assertEquals(question.getAnswers().size(), 0);\n\n assertNotNull(question.getConfiguration());\n assertTrue(question.getConfiguration().trim().length() > 0);\n\n assertNotNull(question.toString());\n }", "public Survey() {\n\t\tthis.questions = new TreeSet<Ordered_question>( new Comparator<Ordered_question>() {\n\t\t public int compare(Ordered_question q1, Ordered_question q2) {\n\t\t \treturn Integer.compare(q1.getOrder(), q2.getOrder());\n\t\t }\n\t\t}) ;\n\t}", "private void fillQuestionsTable() {\n Question q1 = new Question(\"Who is NOT a Master on the Jedi council?\", \"Anakin Skywalker\", \"Obi Wan Kenobi\", \"Mace Windu\", \"Yoda\", 1);\n Question q2 = new Question(\"Who was Anakin Skywalker's padawan?\", \"Kit Fisto\", \"Ashoka Tano\", \"Barris Ofee\", \"Jacen Solo\",2);\n Question q3 = new Question(\"What Separatist leader liked to make find additions to his collection?\", \"Pong Krell\", \"Count Dooku\", \"General Grevious\", \"Darth Bane\", 3);\n Question q4 = new Question(\"Choose the correct Response:\\n Hello There!\", \"General Kenobi!\", \"You are a bold one!\", \"You never should have come here!\", \"You turned her against me!\", 1);\n Question q5 = new Question(\"What ancient combat technique did Master Obi Wan Kenobi use to his advantage throughout the Clone Wars?\", \"Kendo arts\", \"The High ground\", \"Lightsaber Form VIII\", \"Force healing\", 2);\n Question q6 = new Question(\"What was the only surviving member of Domino squad?\", \"Fives\", \"Heavy\", \"Echo\", \"Jesse\", 3);\n Question q7 = new Question(\"What Jedi brutally murdered children as a part of his descent to become a Sith?\", \"Quinlan Vos\", \"Plo Koon\", \"Kit Fisto\", \"Anakin Skywalker\", 4);\n Question q8 = new Question(\"What Sith was the first to reveal himself to the Jedi after a millenia and was subsquently cut in half shortly after?\", \"Darth Plagieus\", \"Darth Maul\", \"Darth Bane\", \"Darth Cadeus\", 2);\n Question q9 = new Question(\"What 4 armed creature operates a diner on the upper levels of Coruscant?\", \"Dexter Jettster\", \"Cad Bane\", \"Aurua Sing\", \"Dorme Amidala\", 1);\n Question q10 = new Question(\"What ruler fell in love with an underage boy and subsequently married him once he became a Jedi?\", \"Aurua Sing\", \"Duttchess Satine\", \"Mara Jade\", \"Padme Amidala\", 4);\n\n // adds them to the list\n addQuestion(q1);\n addQuestion(q2);\n addQuestion(q3);\n addQuestion(q4);\n addQuestion(q5);\n addQuestion(q6);\n addQuestion(q7);\n addQuestion(q8);\n addQuestion(q9);\n addQuestion(q10);\n }", "public void fillCourse(Group group);", "private void setFAQs () {\n\n QuestionDataModel question1 = new QuestionDataModel(\n \"What is Psychiatry?\", \"Psychiatry deals with more extreme mental disorders such as Schizophrenia, where a chemical imbalance plays into an individual’s mental disorder. Issues coming from the “inside” to “out”\\n\");\n QuestionDataModel question2 = new QuestionDataModel(\n \"What Treatments Do Psychiatrists Use?\", \"Psychiatrists use a variety of treatments – including various forms of psychotherapy, medications, psychosocial interventions, and other treatments (such as electroconvulsive therapy or ECT), depending on the needs of each patient.\");\n QuestionDataModel question3 = new QuestionDataModel(\n \"What is the difference between psychiatrists and psychologists?\", \"A psychiatrist is a medical doctor (completed medical school and residency) with special training in psychiatry. A psychologist usually has an advanced degree, most commonly in clinical psychology, and often has extensive training in research or clinical practice.\");\n QuestionDataModel question4 = new QuestionDataModel(\n \"What is Psychology ?\", \"Psychology is the scientific study of the mind and behavior, according to the American Psychological Association. Psychology is a multifaceted discipline and includes many sub-fields of study such areas as human development, sports, health, clinical, social behavior, and cognitive processes.\");\n QuestionDataModel question5 = new QuestionDataModel(\n \"What is psychologists goal?\", \"Those with issues coming from the “outside” “in” (i.e. lost job and partner so feeling depressed) are better suited with psychologists, they offer guiding you into alternative and healthier perspectives in tackling daily life during ‘talk therapy’\");\n QuestionDataModel question6 = new QuestionDataModel(\n \"What is the difference between psychiatrists and psychologists?\", \"Psychiatrists can prescribe and psychologists cannot, they may be able to build a report and suggest medications to a psychiatrist but it is the psychiatrist that has the final say.\");\n QuestionDataModel question7 = new QuestionDataModel(\n \"What is a behavioural therapist?\", \"A behavioural therapist such as an ABA (“Applied Behavioural Analysis”) therapist or an occupational therapist focuses not on the psychological but rather the behavioural aspects of an issue. In a sense, it can be considered a “band-aid” fix, however, it has consistently shown to be an extremely effective method in turning maladaptive behaviours with adaptive behaviours.\");\n QuestionDataModel question8 = new QuestionDataModel(\n \"Why behavioral therapy?\", \"Cognitive-behavioral therapy is used to treat a wide range of issues. It's often the preferred type of psychotherapy because it can quickly help you identify and cope with specific challenges. It generally requires fewer sessions than other types of therapy and is done in a structured way.\");\n QuestionDataModel question9 = new QuestionDataModel(\n \"Is behavioral therapy beneficial?\", \"Psychiatrists can prescribe and psychologists cannot, they may be able to build a report and suggest medications to a psychiatrist but it is the psychiatrist that has the final say.\");\n QuestionDataModel question10 = new QuestionDataModel(\n \"What is alternative therapy?\", \"Complementary and alternative therapies typically take a holistic approach to your physical and mental health.\");\n QuestionDataModel question11 = new QuestionDataModel(\n \"Can they treat mental health problems?\", \"Complementary and alternative therapies can be used as a treatment for both physical and mental health problems. The particular problems that they can help will depend on the specific therapy that you are interested in, but many can help to reduce feelings of depression and anxiety. Some people also find they can help with sleep problems, relaxation, and feelings of stress.\");\n QuestionDataModel question12 = new QuestionDataModel(\n \"What else should I consider before starting therapy?\", \"Only you can decide whether a type of treatment feels right for you, But it might help you to think about: What do I want to get out of it? Could this therapy be adapted to meet my needs?\");\n\n ArrayList<QuestionDataModel> faqs1 = new ArrayList<>();\n ArrayList<QuestionDataModel> faqs2 = new ArrayList<>();\n ArrayList<QuestionDataModel> faqs3 = new ArrayList<>();\n ArrayList<QuestionDataModel> faqs4 = new ArrayList<>();\n faqs1.add(question1);\n faqs1.add(question2);\n faqs1.add(question3);\n faqs2.add(question4);\n faqs2.add(question5);\n faqs2.add(question6);\n faqs3.add(question7);\n faqs3.add(question8);\n faqs3.add(question9);\n faqs4.add(question10);\n faqs4.add(question11);\n faqs4.add(question12);\n\n\n CategoryDataModel category1 = new CategoryDataModel(R.drawable.psychaitry,\n \"Psychiatry\",\n \"Psychiatry is the medical specialty devoted to the diagnosis, prevention, and treatment of mental disorders.\",\n R.drawable.psychiatry_q);\n\n CategoryDataModel category2 = new CategoryDataModel(R.drawable.psychology,\n \"Psychology\",\n \"Psychology is the science of behavior and mind which includes the study of conscious and unconscious phenomena.\",\n R.drawable.psychology_q);\n\n CategoryDataModel category3 = new CategoryDataModel(R.drawable.behavioral_therapy,\n \"Behavioral Therapy\",\n \"Behavior therapy is a broad term referring to clinical psychotherapy that uses techniques derived from behaviorism\",\n R.drawable.behaviour_therapy_q);\n CategoryDataModel category4 = new CategoryDataModel(R.drawable.alternative_healing,\n \"Alternative Therapy\",\n \"Complementary and alternative therapies typically take a holistic approach to your physical and mental health.\",\n R.drawable.alternative_therapy_q);\n\n String FAQ1 = \"What is Psychiatry?\";\n String FAQ2 = \"What is Psychology?\";\n String FAQ3 = \"What is Behavioral Therapy?\";\n String FAQ4 = \"What is Alternative Therapy?\";\n String FAQ5 = \"Report a problem\";\n\n FAQsDataModel FAQsDataModel1 = new FAQsDataModel(FAQ1, category1,faqs1);\n FAQsDataModel FAQsDataModel2 = new FAQsDataModel(FAQ2, category2,faqs2);\n FAQsDataModel FAQsDataModel3 = new FAQsDataModel(FAQ3, category3,faqs3);\n FAQsDataModel FAQsDataModel4 = new FAQsDataModel(FAQ4, category4,faqs4);\n FAQsDataModel FAQsDataModel5 = new FAQsDataModel(FAQ5, category4,faqs4);\n\n\n\n if (mFAQs.isEmpty()) {\n\n mFAQs.add(FAQsDataModel1);\n mFAQs.add(FAQsDataModel2);\n mFAQs.add(FAQsDataModel3);\n mFAQs.add(FAQsDataModel4);\n mFAQs.add(FAQsDataModel5);\n\n\n }\n }", "private void study(String studyToolId) {\n String[][] questionsAndAnswers = studyToolManager.fetchQuestionsAndAnswers(studyToolId);\n String templateId = studyToolManager.getStudyToolTemplateId(studyToolId);\n TemplateManager.TemplateType templateType = templateManager.getTemplateType(Integer.parseInt(templateId));\n List<Object> timeInfo = templateManager.getTimeInfo(templateId);\n boolean isTimed = (Boolean) timeInfo.get(0);\n boolean isTimedPerQuestion = (Boolean) timeInfo.get(1);\n long timeLimitInMS = 1000 * (Integer) timeInfo.get(2);\n long quizStartTime = System.currentTimeMillis();\n int total_score = questionsAndAnswers.length;\n int curr_score = 0;\n Queue<String[]> questionsToRepeat = new LinkedList<>();\n AnswerChecker answerChecker = studyToolManager.getAnswerChecker(studyToolId);\n for (String[] qa : questionsAndAnswers) {\n long questionStartTime = System.currentTimeMillis();\n studyToolDisplayer.displayAQuestion(qa);\n regularPresenter.getAnswerPrompter(templateType);\n String answer = scanner.nextLine();\n boolean correctness = answerChecker.isCorrectAnswer(answer, qa[1]);\n if (templateType.equals(TemplateManager.TemplateType.FC) && !correctness) {\n // TODO: make this depend on template's configuration\n questionsToRepeat.add(qa);\n }\n long questionTimeElapsed = System.currentTimeMillis() - questionStartTime;\n if (isTimed && isTimedPerQuestion && (questionTimeElapsed >= timeLimitInMS)) {\n regularPresenter.ranOutOfTimeReporter();\n } else {\n curr_score += (correctness ? 1 : 0);\n regularPresenter.correctnessReporter(correctness);\n }\n regularPresenter.pressEnterToShowAnswer();\n scanner.nextLine();\n studyToolDisplayer.displayAnAnswer(qa);\n }\n //FC only, for repeating wrong questions until all is memorized\n while (!questionsToRepeat.isEmpty()) {\n String[] qa = questionsToRepeat.poll();\n studyToolDisplayer.displayAQuestion(qa);\n regularPresenter.getAnswerPrompter(templateType);\n String answer = scanner.nextLine();\n boolean correctness = answerChecker.isCorrectAnswer(answer, qa[1]);\n if (!correctness) {\n questionsToRepeat.add(qa);\n }\n regularPresenter.correctnessReporter(correctness);\n regularPresenter.pressEnterToShowAnswer();\n studyToolDisplayer.displayAnAnswer(qa);\n }\n long quizTimeElapsed = System.currentTimeMillis() - quizStartTime;\n if (isTimed && !isTimedPerQuestion && (quizTimeElapsed >= timeLimitInMS)){\n regularPresenter.ranOutOfTimeReporter();\n }\n else if (templateManager.isTemplateScored(templateId)) {\n String score = curr_score + \"/\" + total_score;\n regularPresenter.studySessionEndedReporter(score);\n }\n }", "public void setQuestion(){\n\n\n triggerReport(); //Check if max questions are displayed, if yes then show report\n\n MyDatabase db = new MyDatabase(QuizCorner.this);\n Cursor words = db.getQuizQuestion();\n TextView question_text = (TextView) findViewById(R.id.question_text);\n RadioButton rb;\n resetOptions();\n disableCheck();\n enableRadioButtons();\n hideAnswer();\n words.moveToFirst();\n word = words.getString(words.getColumnIndex(\"word\"));\n correct_answer = words.getString(words.getColumnIndex(\"meaning\"));\n question_text.setText(word + \" means:\");\n for (int i = 0; i < 4; i++){\n answers[i] = words.getString(words.getColumnIndex(\"meaning\"));\n words.moveToNext();\n }\n answers = randomizeArray(answers);\n for (int i = 0; i < 4; i++){\n rb = (RadioButton) findViewById(options[i]);\n rb.setText(answers[i]);\n }\n question_displayed_count++;\n }", "public void setSurveyid(Integer surveyid) {\n this.surveyid = surveyid;\n }", "public void fillQuestionsTable() {\n\n //Hard Questions\n Questions q1 = new Questions(\"The redshift of a distant galaxy is 0·014. According to Hubble’s law, the distance of the galaxy from Earth is? \", \" 9·66 × 10e-12 m\", \" 9·32 × 10e27 m\", \"1·83 × 10e24 m\", \"1·30 × 10e26 m \", 3);\n addQuestion(q1);\n Questions q2 = new Questions(\"A ray of monochromatic light passes from air into water. The wavelength of this light in air is 589 nm. The speed of this light in water is? \", \" 2·56 × 10e2 m/s \", \"4·52 × 10e2 m/s\", \"4·78 × 10e2 m/s\", \"1·52 × 10e2 m/s\", 2);\n addQuestion(q2);\n Questions q3 = new Questions(\"A car is moving at a speed of 2·0 m s−1. The car now accelerates at 4·0 m s−2 until it reaches a speed of 14 m s−1. The distance travelled by the car during this acceleration is\", \"1.5m\", \"18m\", \"24m\", \"25m\", 3);\n addQuestion(q3);\n Questions q4 = new Questions(\"A spacecraft is travelling at 0·10c relative to a star. \\nAn observer on the spacecraft measures the speed of light emitted by the star to be?\", \"0.90c\", \"1.00c\", \"1.01c\", \"0.99c\", 2);\n addQuestion(q4);\n Questions q5 = new Questions(\"Measurements of the expansion rate of the Universe lead to the conclusion that the rate of expansion is increasing. Present theory proposes that this is due to? \", \"Redshift\", \"Dark Matter\", \"Dark Energy\", \"Gravity\", 3);\n addQuestion(q5);\n Questions q6 = new Questions(\"A block of wood slides with a constant velocity down a slope. The slope makes an angle of 30º with the horizontal axis. The mass of the block is 2·0 kg. The magnitude of the force of friction acting on the block is?\" , \"1.0N\", \"2.0N\", \"9.0N\", \"9.8N\", 4);\n addQuestion(q6);\n Questions q7 = new Questions(\"A planet orbits a star at a distance of 3·0 × 10e9 m. The star exerts a gravitational force of 1·6 × 10e27 N on the planet. The mass of the star is 6·0 × 10e30 kg. The mass of the planet is? \", \"2.4 x 10e14 kg\", \"3.6 x 10e25 kg\", \"1.2 x 10e16 kg\", \"1.6 x 10e26 kg\", 2);\n addQuestion(q7);\n Questions q8 = new Questions(\"Radiation of frequency 9·00 × 10e15 Hz is incident on a clean metal surface. The maximum kinetic energy of a photoelectron ejected from this surface is 5·70 × 10e−18 J. The work function of the metal is?\", \"2.67 x 10e-19 J\", \"9.10 x 10e-1 J\", \"1.60 x 10e-18 J\", \"4.80 x 10e-2 J\", 1);\n addQuestion(q8);\n Questions q9 = new Questions(\"The irradiance of light from a point source is 32 W m−2 at a distance of 4·0 m from the source. The irradiance of the light at a distance of 16 m from the source is? \", \"1.0 W m-2\", \"8.0 W m-2\", \"4.0 W m-2\", \"2.0 W m-2\", 4);\n addQuestion(q9);\n Questions q10 = new Questions(\"A person stands on a weighing machine in a lift. When the lift is at rest, the reading on the weighing machine is 700 N. The lift now descends and its speed increases at a constant rate. The reading on the weighing machine...\", \"Is a constant value higher than 700N. \", \"Is a constant value lower than 700N. \", \"Continually increases from 700 N. \", \"Continually decreases from 700 N. \", 2);\n addQuestion(q10);\n\n //Medium Questions\n Questions q11 = new Questions(\"What is Newtons Second Law of Motion?\", \"F = ma\", \"m = Fa\", \"F = a/m\", \"Every action has an equal and opposite reaction\", 1);\n addQuestion(q11);\n Questions q12 = new Questions(\"In s = vt, what does s stand for?\", \"Distance\", \"Speed\", \"Sin\", \"Displacement\", 4);\n addQuestion(q12);\n Questions q13 = new Questions(\"An object reaches terminal velocity when...\", \"Forward force is greater than the frictional force.\", \"All forces acting on that object are equal.\", \"Acceleration starts decreasing.\", \"Acceleration is greater than 0\", 2);\n addQuestion(q13);\n Questions q14 = new Questions(\"An Elastic Collision is where?\", \"There is no loss of Kinetic Energy.\", \"There is a small loss in Kinetic Energy.\", \"There is an increase in Kinetic Energy.\", \"Some Kinetic Energy is transferred to another type.\", 1);\n addQuestion(q14);\n Questions q15 = new Questions(\"The speed of light is?\", \"Different for all observers.\", \"The same for all observers. \", \"The same speed regardless of the medium it is travelling through. \", \"Equal to the speed of sound.\", 2);\n addQuestion(q15);\n Questions q16 = new Questions(\"What is redshift?\", \"Light moving to us, shifting to red. \", \"A dodgy gear change. \", \"Light moving away from us shifting to longer wavelengths.\", \"Another word for dark energy. \", 3);\n addQuestion(q16);\n Questions q17 = new Questions(\"Which law allows us to estimate the age of the universe?\", \"Newtons 3rd Law \", \"The Hubble-Lemaitre Law \", \"Planck's Law \", \"Wien's Law \", 2);\n addQuestion(q17);\n Questions q18 = new Questions(\"The standard model...\", \"Models how time interacts with space. \", \"Describes how entropy works. \", \"Is the 2nd Law of Thermodynamics. \", \"Describes the fundamental particles of the universe and how they interact\", 4);\n addQuestion(q18);\n Questions q19 = new Questions(\"The photoelectric effect gives evidence for?\", \"The wave model of light. \", \"The particle model of light. \", \"The speed of light. \", \"The frequency of light. \", 2);\n addQuestion(q19);\n Questions q20 = new Questions(\"AC is a current which...\", \"Doesn't change direction. \", \"Is often called variable current. \", \"Is sneaky. \", \"Changes direction and instantaneous value with time. \", 4);\n addQuestion(q20);\n\n //Easy Questions\n Questions q21 = new Questions(\"What properties does light display?\", \"Wave\", \"Particle\", \"Both\", \"Neither\", 3);\n addQuestion(q21);\n Questions q22 = new Questions(\"In V = IR, what does V stand for?\", \"Velocity\", \"Voltage\", \"Viscosity\", \"Volume\", 2);\n addQuestion(q22);\n Questions q23 = new Questions(\"The abbreviation rms typically stands for?\", \"Round mean sandwich. \", \"Random manic speed. \", \"Root manic speed. \", \"Root mean squared. \", 4);\n addQuestion(q23);\n Questions q24 = new Questions(\"Path Difference = \", \"= (m/λ) or (m + ½)/λ where m = 0,1,2…\", \"= mλ or (m + ½) λ where m = 0,1,2…\", \"= λ / m or (λ + ½) / m where m = 0,1,2…\", \" = mλ or (m + ½) λ where m = 0.5,1.5,2.5,…\", 2);\n addQuestion(q24);\n Questions q25 = new Questions(\"How many types of quark are there?\", \"6\", \"4 \", \"8\", \"2\", 1);\n addQuestion(q25);\n Questions q26 = new Questions(\"A neutrino is a type of?\", \"Baryon\", \"Gluon\", \"Lepton\", \"Quark\", 3);\n addQuestion(q26);\n Questions q27 = new Questions(\"A moving charge produces:\", \"A weak field\", \"An electric field\", \"A strong field\", \"Another moving charge\", 2);\n addQuestion(q27);\n Questions q28 = new Questions(\"What contains nuclear fusion reactors?\", \"A magnetic field\", \"An electric field\", \"A pool of water\", \"Large amounts of padding\", 1);\n addQuestion(q28);\n Questions q29 = new Questions(\"What is the critical angle of a surface?\", \"The incident angle where the angle of refraction is 45 degrees.\", \"The incident angle where the angle of refraction is 90 degrees.\", \"The incident angle where the angle of refraction is 135 degrees.\", \"The incident angle where the angle of refraction is 180 degrees.\", 2);\n addQuestion(q29);\n Questions q30 = new Questions(\"Which is not a type of Lepton?\", \"Electron\", \"Tau\", \"Gluon\", \"Muon\", 3);\n addQuestion(q30);\n }", "public static void add(HttpServletRequest request) {\n\t\tSurvey survey = (Survey) request.getSession().getAttribute(\"survey\");\n\n\t\t// Exstracts the survey info\n\t\tString name = request.getParameter(\"name\");\n\t\tString description = request.getParameter(\"description\");\n\t\tString length = request.getParameter(\"length\");\n\t\tString repeatable = request.getParameter(\"repeatable\");\n\t\t// checks to avoid nullpointer exceptions\n\t\tif (repeatable == null) {\n\t\t\trepeatable = \"\";\n\t\t}\n\t\tString traversable = request.getParameter(\"traversable\");\n\t\tif (traversable == null) {\n\t\t\ttraversable = \"\";\n\t\t}\n\n\t\t// parse extracted info to the survey\n\t\tsurvey.setName(name);\n\t\tsurvey.setDescription(description);\n\n\t\tif (!length.equals(\"\")) {\n\t\t\tsurvey.setLength(survey.convertLength(length));\n\t\t}\n\n\t\t// check if repetable\n\t\tif (repeatable.equals(\"repeatable\")) {\n\t\t\tsurvey.setRepeatable(true);\n\t\t} else {\n\t\t\tsurvey.setRepeatable(false);\n\t\t}\n\n\t\t// check if traversable\n\t\tif (traversable.equals(\"traversable\")) {\n\t\t\tsurvey.setTraversable(true);\n\t\t} else {\n\t\t\tsurvey.setTraversable(false);\n\t\t}\n\n\t\t// Question knows how manny question there are.\n\t\tfor (int i = 0; i < survey.getQuestions().size(); i++) {\n\t\t\t// Get parameter from request and pares to object\n\t\t\tString text = request.getParameter(\"text\" + i);\n\t\t\tsurvey.getQuestions().get(i).setText(text);\n\n\t\t\t// Type logic\n\t\t\tif (survey.getQuestions().get(i).getType().equals(\"mc\")) {\n\t\t\t\tMultipleChoiceQuestion question = (MultipleChoiceQuestion) survey.getQuestions().get(i);\n\t\t\t\tString singleAnswer = request.getParameter(\"singleAnswer\");\n\t\t\t\t\n\t\t\t\tif (singleAnswer == null) {\n\t\t\t\t\tsingleAnswer = \"\";\n\t\t\t\t}\n\t\t\t\tif (singleAnswer.equals(\"singleAnswer\")) {\n\t\t\t\t\tquestion.setSingleAnswer(true);\n\t\t\t\t} else {\n\t\t\t\t\tquestion.setSingleAnswer(false);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < question.getOptions().size(); j++) {\n\t\t\t\t\t// Get parameter from request and pares to object\n\t\t\t\t\tString option = request.getParameter(\"option\" + j + i);\n\t\t\t\t\tquestion.getOptions().set(j, option);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\trequest.getSession().setAttribute(\"survey\", survey);\n\t}", "private void fetchNewQuestion()\r\n\t{\r\n\t\t//Gets question and answers from model\r\n\t\tString[] question = quizModel.getNewQuestion();\r\n\t\t\r\n\t\t//Allocates answers to a new ArrayList then shuffles them randomly\r\n\t\tArrayList<String> answers = new ArrayList<String>();\r\n\t\tanswers.add(question[1]);\r\n\t\tanswers.add(question[2]);\r\n\t\tanswers.add(question[3]);\r\n\t\tanswers.add(question[4]);\r\n\t\tCollections.shuffle(answers);\r\n\t\t\r\n\t\t//Allocates north label to the question\r\n\t\tnorthLabel.setText(\"<html><div style='text-align: center;'>\" + question[0] + \"</div></html>\");\r\n\t\t\r\n\t\t//Allocates each radio button to a possible answer. Based on strings, so randomly generated questions...\r\n\t\t//...which by chance repeat a correct answer in two slots, either will award the user a point.\r\n\t\toption1.setText(answers.get(0));\r\n\t\toption2.setText(answers.get(1));\r\n\t\toption3.setText(answers.get(2));\r\n\t\toption4.setText(answers.get(3));\r\n\t\toption1.setActionCommand(answers.get(0));\r\n\t\toption2.setActionCommand(answers.get(1));\r\n\t\toption3.setActionCommand(answers.get(2));\r\n\t\toption4.setActionCommand(answers.get(3));\r\n\t\toption1.setSelected(true);\r\n\t\t\r\n\t\t//Update score\r\n\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"</div></html>\");\r\n\t}", "@SuppressWarnings(\"rawtypes\")\n\tpublic AddSurveyForApplicant() {\n\t\tif (getSession().getAttribute(\"isLogin\").equals(\"false\")) {\n\t\t\tsetResponsePage(Authentication.class);\n\t\t\treturn;\n\t\t}\n\t\tif (getSession().getAttribute(\"personTyp\").equals(\"a\")) {\n\t\t\tsetResponsePage(PersonTyp.class);\n\t\t\treturn;\n\t\t}\n\n\t\tLong id = Long.valueOf(getSession().getAttribute(\"id\").toString());\n\n\t\tp = ps.find(id);\n\n\t\tString url = RequestCycle.get().getRequest().getUrl().toString();\n\t\tString[] idFromUrl = url.split(\"/\");\n\t\tfinal Long receiverID = Long.valueOf(idFromUrl[3]);\n\t\tfinal IApplicant applicant = (IApplicant) ps.find(receiverID);\n\n\t\t// final IApplicant applicant\n\t\tList<ISurvey> surveys = new ArrayList<ISurvey>();\n\t\tsurveys = ss.loadAllServeyByEmployer(id);\n\t\tlogger.info(\"surveyes loaded, size: \" + surveys.size());\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tPageableListView surveyView = new PageableListView(\"surveys\", surveys,\n\t\t\t\t6) {\n\t\t\t/**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 53780096350876440L;\n\n\t\t\t@Override\n\t\t\tprotected void populateItem(ListItem item) {\n\t\t\t\tISurvey survey = (ISurvey) item.getModelObject();\n\t\t\t\titem.add(new Label(\"date\", \"Date: \" + survey.getDate()));\n\t\t\t\titem.add(new Label(\"name\", \"Survey: \" + survey.getName()));\n\t\t\t\titem.add(new Label(\"text\", \"Info: \" + survey.getText()));\n\t\t\t\tString fragmentId = null;\n\t\t\t\tif (ss.loadAppSurveyByApplicantAndSurvey(\n\t\t\t\t\t\t((IPerson) applicant).getId(), survey.getId()).size() == 0) {\n\t\t\t\t\tfragmentId = \"variant_add\";\n\t\t\t\t\titem.add(new FragmentForAddSurvey(\n\t\t\t\t\t\t\t\"placeholderForFragmente\", fragmentId, this,\n\t\t\t\t\t\t\tapplicant, survey));\n\t\t\t\t\tlogger.info(\"Varinat add, size = 0\");\n\t\t\t\t}\n\t\t\t\tif (ss.loadAppSurveyByApplicantAndSurvey(\n\t\t\t\t\t\t((IPerson) applicant).getId(), survey.getId()).size() > 0) {\n\t\t\t\t\tfragmentId = \"variant_has\";\n\t\t\t\t\tlogger.info(\"Varinat has, size > 0\");\n\t\t\t\t\titem.add(new FragmentAlreadySend(\"placeholderForFragmente\",\n\t\t\t\t\t\t\tfragmentId, this));\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tadd(new FeedbackPanel(\"feedback\"));\n\t\tadd(surveyView);\n\t\tadd(new PagingNavigator(\"navigator\", surveyView));\n\n\t}", "public void createEssay() {\n Question q = new Essay(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your Essay question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n int numAns = 0;\n while (numAns == 0) {\n this.o.setDisplay(\"How many answers does this question have?\\n\");\n this.o.getDisplay();\n\n try {\n numAns = Integer.parseInt(this.in.getUserInput());\n if (numAns > numChoices || numAns < 1) {\n numAns = 0;\n } else {\n q.setMaxResponses(numAns);\n }\n } catch (NumberFormatException e) {\n numAns = 0;\n }\n }\n\n if (isTest) {\n RCA ca = new RCA(this.in,this.o);\n Test t = (Test)this.survey;\n String ans;\n\n this.o.setDisplay(\"Enter correct answer(s)\\n\");\n this.o.getDisplay();\n\n for (int j=0; j < q.getMaxResponses(); j++){\n\n ans = this.in.getUserInput();\n\n ca.addResponse(ans);\n }\n t.addAnswer(ca);\n }\n\n this.survey.addQuestion(q);\n }", "private void addQuestion() {\n Question q = new Question(\n \"¿Quien propuso la prueba del camino básico ?\", \"Tom McCabe\", \"Tom Robert\", \"Tom Charlie\", \"Tom McCabe\");\n this.addQuestion(q);\n\n\n Question q1 = new Question(\"¿Qué es una prueba de Caja negra y que errores desean encontrar en las categorías?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \" determina la funcionalidad del sistema\", \" determina la funcionalidad del sistema\");\n this.addQuestion(q1);\n Question q2 = new Question(\"¿Qué es la complejidad ciclomática es una métrica de calidad software?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \"basada en el cálculo del número\", \"basada en el cálculo del número\");\n this.addQuestion(q2);\n //preguntas del quiz II\n Question q3=new Question(\"Las pruebas de caja blanca buscan revisar los caminos, condiciones, \" +\n \"particiones de control y datos, de las funciones o módulos del sistema; \" +\n \"para lo cual el grupo de diseño de pruebas debe:\",\n \"Conformar un grupo de personas para que use el sistema nuevo\",\n \"Ejecutar sistema nuevo con los datos usados en el sistema actual\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\");\n this.addQuestion(q3);\n Question q4=new Question(\"¿Las pruebas unitarias son llamadas?\",\n \"Pruebas del camino\", \"Pruebas modulares\",\n \"Pruebas de complejidad\", \"Pruebas modulares\");\n this.addQuestion(q4);\n Question q5=new Question(\"¿Qué es una prueba de camino básico?\",\n \"Hace una cobertura de declaraciones del código\",\n \"Permite determinar si un modulo esta listo\",\n \"Técnica de pueba de caja blanca\",\n \"Técnica de pueba de caja blanca\" );\n this.addQuestion(q5);\n Question q6=new Question(\"Prueba de camino es propuesta:\", \"Tom McCabe\", \"McCall \", \"Pressman\",\n \"Tom McCabe\");\n this.addQuestion(q6);\n Question q7=new Question(\"¿Qué es complejidad ciclomatica?\",\"Grafo de flujo\",\"Programming\",\n \"Metrica\",\"Metrica\");\n this.addQuestion(q7);\n //preguntas del quiz III\n Question q8 = new Question(\n \"¿Se le llama prueba de regresión?\", \"Se tienen que hacer nuevas pruebas donde se han probado antes\",\n \"Manten informes detallados de las pruebas\", \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\");\n this.addQuestion(q8);\n Question q9 = new Question(\"¿Cómo se realizan las pruebas de regresión?\",\n \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\", \"A través de herramientas de automatización de pruebas\", \"A través de herramientas de automatización de pruebas\");\n this.addQuestion(q9);\n Question q10 = new Question(\"¿Cuándo ya hay falta de tiempo para ejecutar casos de prueba ya ejecutadas se dejan?\",\n \"En primer plano\", \"En segundo plano\", \"En tercer plano\", \"En segundo plano\");\n this.addQuestion(q10);\n //preguntas del quiz IV\n Question q11 = new Question(\n \"¿En qué se enfocan las pruebas funcionales?\",\n \"Enfocarse en los requisitos funcionales\", \"Enfocarse en los requisitos no funcionales\",\n \"Verificar la apropiada aceptación de datos\", \"Enfocarse en los requisitos funcionales\");\n this.addQuestion(q11);\n Question q12 = new Question(\"Las metas de estas pruebas son:\", \"Verificar la apropiada aceptación de datos\",\n \"Verificar el procesamiento\", \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\",\n \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\");\n this.addQuestion(q12);\n Question q13 = new Question(\"¿En qué estan basadas este tipo de pruebas?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Técnicas de cajas negra\", \"Técnicas de cajas negra\");\n this.addQuestion(q13);\n //preguntas del quiz V\n Question q14 = new Question(\n \"¿Cúal es el objetivo de esta técnica?\", \"Identificar errores introducidos por la combinación de programas probados unitariamente\",\n \"Decide qué acciones tomar cuando se descubren problemas\",\n \"Verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Identificar errores introducidos por la combinación de programas probados unitariamente\");\n this.addQuestion(q14);\n Question q15 = new Question(\"¿Cúal es la descripción de la Prueba?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\");\n this.addQuestion(q15);\n Question q16 = new Question(\"Por cada caso de prueba ejecutado:\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Comparar el resultado esperado con el resultado obtenido\", \"Comparar el resultado esperado con el resultado obtenido\");\n this.addQuestion(q16);\n //preguntas del quiz VI\n Question q17 = new Question(\n \"Este tipo de pruebas sirven para garantizar que la calidad del código es realmente óptima:\",\n \"Pruebas Unitarias\", \"Pruebas de Calidad de Código\",\n \"Pruebas de Regresión\", \"Pruebas de Calidad de Código\");\n this.addQuestion(q17);\n Question q18 = new Question(\"Pruebas de Calidad de código sirven para: \",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Verificar que las especificaciones de diseño sean alcanzadas\",\n \"Garantizar la probabilidad de tener errores o bugs en la codificación\", \"Garantizar la probabilidad de tener errores o bugs en la codificación\");\n this.addQuestion(q18);\n Question q19 = new Question(\"Este análisis nos indica el porcentaje que nuestro código desarrollado ha sido probado por las pruebas unitarias\",\n \"Cobertura\", \"Focalización\", \"Regresión\", \"Cobertura\");\n this.addQuestion(q19);\n\n Question q20 = new Question( \"¿Qué significa V(G)?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Regiones\");\n this.addQuestion(q20);\n\n Question q21 = new Question( \"¿Qué significa A?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Aristas\");\n this.addQuestion(q21);\n\n Question q22 = new Question( \"¿Qué significa N?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Nodos\");\n this.addQuestion(q22);\n\n Question q23 = new Question( \"¿Qué significa P?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos Predicado\", \"Número de Nodos Predicado\");\n this.addQuestion(q23);\n Question q24 = new Question( \"De cuantás formas se puede calcular la complejidad ciclomatica V(G):\",\n \"3\", \"1\", \"2\", \"3\");\n this.addQuestion(q24);\n\n // END\n }", "public void startSurvey(){\n\t\tmRecordTimer.sendMessageDelayed(Message.obtain(null, MESSAGE_TO_START_SURVEY), TIME_TO_START_SURVEY);\n\t}", "public void fillForm() {\n\t\t// fills the name field with nameOfProject\n\t\tprojName.sendKeys(nameOfProject);\n\t\t// selects the first option from the 'Client partner' dropdown list\n\t\tSelect sel = new Select(clientList);\n\t\tsel.selectByIndex(1);\n\t\t// enters valid date data\n\t\tstartDate.sendKeys(\"06042018\");\n\t\tendDate.sendKeys(\"06052018\");\n\t}", "public void createQuestion(int sid,int qid,String qtype,String qtitle,String answer_a,String answer_b,String answer_c,String answer_d);", "public Survey getSurveybySid(int sid);", "void addQuestions(String surveyId, List<Question> questions);", "public String surveyResults(String nameDiscipline, String nameProject) throws\n InvalidDisciplineException, InvalidProjectException, NoSuchSurveyException{\n Professor _professor = getProfessor();\n return _professor.surveyResults(nameDiscipline, nameProject);\n }", "public String studentsDiscipline(String discipline) throws InvalidDisciplineException{ \n int id = _person.getId();\n Professor _professor = getProfessors().get(id);\n\n return _professor.studentsDiscipline(discipline);\n }", "public void createShortAnswer() {\n Question q = new ShortAnswer(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your Short Answer question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n int charlimit = 0;\n while (charlimit == 0) {\n this.o.setDisplay(\"Enter character limit\\n\");\n this.o.getDisplay();\n\n try {\n charlimit = Integer.parseInt(this.in.getUserInput());\n if (charlimit < 1) {\n charlimit = 0;\n } else {\n ((ShortAnswer) q).setCharLimit(charlimit);\n }\n } catch (NumberFormatException e) {\n charlimit = 0;\n }\n }\n\n int numAns = 0;\n while (numAns == 0) {\n this.o.setDisplay(\"How many answers does this question have?\\n\");\n this.o.getDisplay();\n\n try {\n numAns = Integer.parseInt(this.in.getUserInput());\n if (numAns > numChoices || numAns < 1) {\n numAns = 0;\n } else {\n q.setMaxResponses(numAns);\n }\n } catch (NumberFormatException e) {\n numAns = 0;\n }\n }\n\n if (isTest) {\n RCA ca = new RCA(this.in,this.o);\n Test t = (Test)this.survey;\n String ans;\n\n for (int j=0; j < q.getMaxResponses(); j++){\n this.o.setDisplay(\"Enter correct answer(s):\\n\");\n this.o.getDisplay();\n\n ans = this.in.getUserInput();\n\n while (ans.length() > ((ShortAnswer) q).getCharLimit()) {\n this.o.setDisplay(\"Answer must be less then \" + ((ShortAnswer) q).getCharLimit() + \" characters \\n\");\n this.o.getDisplay();\n ans = this.in.getUserInput();\n }\n\n ca.addResponse(ans);\n }\n t.addAnswer(ca);\n }\n this.survey.addQuestion(q);\n }", "public void testMedicalQuestionDefaultAnswersSupplied() {\n final String QUESTION_ID = \"insulin-declaration\";\n\n Map<String, MedicalCondition> conditions = cache.getConditions(Service.NOTIFY);\n MedicalCondition condition = conditions.get(DIABETES_CONDITION);\n\n assertNotNull(condition);\n\n MedicalQuestion question = condition.getQuestions().get(QUESTION_ID);\n assertNotNull(question);\n\n assertEquals(QUESTION_ID, question.getID());\n assertEquals(\"9\", question.getStep());\n assertEquals(Page.VERIFIED.getName(), question.getPage());\n assertEquals(13, question.getOrder().intValue());\n assertEquals(Format.RADIO.getName(), question.getType());\n assertEquals(Boolean.TRUE, question.getValidate());\n assertEquals(Boolean.FALSE, question.getLogout());\n assertEquals(EMPTY, question.getOptions());\n\n assertNotNull(question.getAnswers());\n assertEquals(question.getAnswers().size(), 0);\n\n assertNotNull(question.toString());\n }", "public void saveSurvey(Survey survey) throws SurveyEngineException{\r\n surveyValidation(survey);\r\n \r\n Element surveysElement = (Element) doc.getElementsByTagName(\"surveys\").item(0);\r\n NodeList surveysElements = surveysElement.getElementsByTagName(\"survey\");\r\n Element surveyElement;\r\n \r\n //try to find survey, if found delete it\r\n int sid = survey.getSid();\r\n try {\r\n surveyElement = getSurveyElementBySid(sid);\r\n surveysElement.removeChild(surveyElement);\r\n }\r\n \r\n //if not found, find a new id for the survey\r\n catch(NullPointerException e) {\r\n int maxId = 0;\r\n for (int i = 0; i < surveysElements.getLength(); i++) {\r\n int id = Integer.parseInt(((Element)surveysElements.item(i)).getAttribute(\"sid\"));\r\n maxId = max(id, maxId);\r\n }\r\n sid = ++maxId;\r\n }\r\n \r\n //create a new element and add title and description\r\n surveyElement = doc.createElement(\"survey\");\r\n surveyElement.setAttribute(\"sid\", Integer.toString(sid));\r\n Element titleElement = doc.createElement(\"title\");\r\n titleElement.setTextContent(survey.getTitle());\r\n surveyElement.appendChild(titleElement);\r\n Element descriptionElement = doc.createElement(\"description\");\r\n descriptionElement.setTextContent(survey.getDescription());\r\n surveyElement.appendChild(descriptionElement);\r\n \r\n //add questions\r\n Element questionsElement = doc.createElement(\"questions\");\r\n for (Question question: survey.getQuestions()) {\r\n Element questionElement = doc.createElement(\"question\");\r\n questionElement.setAttribute(\"qid\", Integer.toString(question.getQid()));\r\n \r\n descriptionElement = doc.createElement(\"description\");\r\n descriptionElement.setTextContent(question.getDescription());\r\n questionElement.appendChild(descriptionElement);\r\n \r\n String qTString = null;\r\n switch (question.getQuestionType()) {\r\n case CLOSED: \r\n qTString = \"closed\"; \r\n break;\r\n case MULTIPLE: \r\n qTString = \"multiple\"; \r\n break;\r\n }\r\n questionElement.setAttribute(\"type\", qTString);\r\n \r\n Element answersElement = doc.createElement(\"answers\");\r\n \r\n //add answers\r\n for(int aid: question.getAnswerIDs()) {\r\n Element answerElement = doc.createElement(\"answer\");\r\n answerElement.setAttribute(\"aid\", Integer.toString(aid));\r\n answerElement.setTextContent(question.getAnswer(aid));\r\n answersElement.appendChild(answerElement);\r\n }\r\n \r\n questionElement.appendChild(answersElement);\r\n questionsElement.appendChild(questionElement);\r\n }\r\n \r\n surveyElement.appendChild(questionsElement);\r\n surveysElement.appendChild(surveyElement);\r\n \r\n //save the xml document\r\n {\r\n try {\r\n TransformerFactory tFactory = TransformerFactory.newInstance();\r\n Transformer transformer = tFactory.newTransformer();\r\n transformer.setOutputProperty(OutputKeys.INDENT, \"yes\");\r\n \r\n DOMSource source = new DOMSource(doc);\r\n StreamResult result = new StreamResult(new File(this.filePath));\r\n transformer.transform(source, result);\r\n } catch (TransformerException e) {\r\n throw new SurveyEngineException(\"Survey could not be saved\");\r\n }\r\n }\r\n }", "public void setSurveyrow(Integer surveyrow) {\n this.surveyrow = surveyrow;\n }", "public SurveyWithQuestions (SurveyMetaData survey, List<SurveyQuestion> questions)\n {\n this.survey = survey;\n this.questions = questions;\n }", "@When(\"^select (.+), enter (.+), enter (.+), select (.+)$\")\n public void patient_enters_appointment_info (String apttype, String date, String comments, long hmid) throws Throwable {\n \tTimestamp date2 = Timestamp.valueOf(date);\n \tappt.setPatient(patientMID);\n \tappt.setHcp(hmid);\n \tappt.setApptType(apttype); \n \tappt.setDate(date2);\n \tappt.setComment(comments);\n \t//set the patient's info at this point\n \n }", "public Survey getSurvey(int surveyId) {\r\n try {\r\n Element survey = getSurveyElementBySid(surveyId);\r\n \r\n List<Question> questions = new ArrayList<>();\r\n \r\n //get Questions of survey\r\n NodeList questionList = survey.getElementsByTagName(\"question\");\r\n for (int i = 0; i < questionList.getLength(); i++) {\r\n Element questionElement = (Element) questionList.item(i);\r\n int qid = Integer.parseInt(questionElement.getAttribute(\"qid\"));\r\n String description = questionElement.getElementsByTagName(\"description\").item(0).getTextContent();\r\n String qTString = questionElement.getAttribute(\"type\");\r\n QuestionType qt = null;\r\n switch (qTString) {\r\n case \"closed\":\r\n qt = QuestionType.CLOSED;\r\n break;\r\n case \"multiple\":\r\n qt = QuestionType.MULTIPLE;\r\n break;\r\n }\r\n Question question = new Question(qid, description, qt);\r\n \r\n //get Answers of survey\r\n NodeList answersList = questionElement.getElementsByTagName(\"answer\");\r\n for (int j = 0; j < answersList.getLength(); j++) {\r\n Element answerElement = (Element) answersList.item(j);\r\n int aid = Integer.parseInt(answerElement.getAttribute(\"aid\"));\r\n String text = answerElement.getTextContent();\r\n question.addAnswer(aid, text);\r\n }\r\n\r\n questions.add(question);\r\n }\r\n return new Survey(\r\n Integer.parseInt(survey.getAttribute(\"sid\")), \r\n survey.getElementsByTagName(\"title\").item(0).getTextContent(), \r\n survey.getElementsByTagName(\"description\").item(0).getTextContent(), \r\n questions);\r\n } catch (NumberFormatException | DOMException e) {\r\n throw e;\r\n }\r\n }", "private void populateQuestion(String tempQuestionText) {\n\n\t\t// set them to radio options\n\t\tquestionTextView.setText(tempQuestionText);\n\n\t}", "public abstract void selectQuestion();", "private void setThePatient() {\n String ppsn = mPPSN.getText().toString();\n thePatient.set_id(ppsn.substring(ppsn.indexOf(\":\")+1).trim());\n\n String name = mName.getText().toString();\n thePatient.setName(name.substring(name.indexOf(\":\")+1).trim());\n\n String illness = mCondition.getText().toString();\n thePatient.setIllness(illness.substring(illness.indexOf(\":\")+1).trim());\n\n Address a = new Address();\n String addressLine1 = mAddressLine1.getText().toString();\n a.setAddressLine1(addressLine1.substring(addressLine1.indexOf(\":\")+1).trim());\n\n String addressLine2 = mAddressLine2.getText().toString();\n a.setAddressLine2(addressLine2.substring(addressLine2.indexOf(\":\")+1).trim());\n\n String city = mCity.getText().toString();\n a.setCity(city.substring(city.indexOf(\":\")+1).trim());\n\n String county = mCounty.getText().toString();\n a.setCounty(county.substring(county.indexOf(\":\")+1).trim());\n\n String country = mCountry.getText().toString();\n a.setCountry(country.substring(country.indexOf(\":\")+1).trim());\n\n String postcode = mPostCode.getText().toString();\n a.setPostCode(postcode.substring(postcode.indexOf(\":\")+1).trim());\n\n thePatient.setAddress(a);\n }", "private void makeDiagnosis(Patient patient, String diagnosis) {\n patient.setDiagnosis(diagnosis);\n }", "public static void updateQuestionnaire() {\n\t\t\tint a = 1;\n\t\t\tJOptionPane.showMessageDialog(null,\"1.Gender\\n2.Last Name\\n3.First Name\\n 4.Father's Name\\n5.Year of Birth\\n6.Place of Birth\\n7.Profession\\n8.ID Number\\n9.Address\\n\"\n\t\t \t\t+ \" 10.PostCode\\n11.City\\n12.Phone Number\\n13.Have you ever gave blood before\\n14.When was the last time you gave blood?\\n\"\n\t\t \t\t+ \"15.excluded from a blood donation?\\n16.dangerous profession or hobby?\\n17.previous health problems?\\n\"\n\t\t \t\t+ \"18.jaundice or hepatitis\\n19.syphilis\\n20.malaria\\n21.tuberculosis\\n22.rheumatoid arthritis\\n23.heart disease\\n24.precardiac pan\\n25.hypertension\\n\"\n\t\t \t\t+ \"26.convulsions(as an adult)\\n27.fainting\\n28.stomach aliments\\n29.ulcer\\n30.other surgeries\\n31.kidney diseasea\\n32.diabetes\\n33.allergies\\n\"\n\t\t \t\t+ \"34.anemia\\n35.other diseasess\\n36.contagious diseases in your envirnment?\\n37.taken medicine?\\n\"\n\t\t \t\t+ \"38.take aspirin?\\n39.born or lived or traveled aboard?\\n40.lost weight, had fever or swollen tonsils?\\n\"\n\t\t \t\t+ \"41.cornea or scar implant in your eye?\\n42.Creutzfeldt-Jakob disease?\\n43.growth hormones?\\n\"\n\t\t \t\t+ \"44. tooth extraction or treatment the past week?\\n45.vaccines the past week?\\n46.surgery or medical examinations the past year?\\n\"\n\t\t\t\t+\"47.transfusion of blood or blood producers?\\n48.tattoo or ear piercing or acupuncture?\\n\"\n\t\t \t\t+ \"49.pierced by a syringe needle\\n50.any skin wounds or scratches that came in contact with foreign blood?\\n\"\n\t\t \t\t+ \"51.were you pregnant the past year?\\n\");\n\t\t\tboolean g = true;\n\t\t\tdo {\n\t\t\t\ttry {\n\t\t\t\t\ta = Integer.parseInt(JOptionPane.showInputDialog(\"If you want to change a question press the number of the question or else press 0\"));\n\t \t \t\tif (a >= 1 && a <= 51) {\n\t \t\t \t\tg = false;\n\t \t\t \t\tchangeQuestion(a, username);\n\t \t \t\t} else if (a == 0) {\n\t \t\t \t\tg = true;\n\t \t\t \t\tHomeMenu.donorSecondMenu(username);\n\t \t\t \t} else {\n\t \t\t \t\tJOptionPane.showMessageDialog(null, \"Please enter a valid question number\",\"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t \t \t\t}\n\t \t \t} catch (NumberFormatException e) {\n\t \t\tJOptionPane.showMessageDialog(null, \"Please enter a number\",\"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t \t\tg = true;\n\t \t\t}\n\t\t\t} while (g);\t \n\t\t}", "public abstract void generateQuestion();", "private void submitSurvey(Bundle capturedArgs) {\n SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);\n\n Bundle allArgs = new Bundle(capturedArgs);\n allArgs.putString(Store.KEY_FIELD_FIRST_NAME,\n sharedPref.getString(SettingsActivity.KEY_PREF_FIRST_NAME, \"\"));\n allArgs.putString(Store.KEY_FIELD_LAST_NAME,\n sharedPref.getString(SettingsActivity.KEY_PREF_LAST_NAME, \"\"));\n allArgs.putString(Store.KEY_FIELD_GENDER,\n sharedPref.getString(SettingsActivity.KEY_PREF_GENDER, \"\"));\n allArgs.putInt(Store.KEY_FIELD_BIRTH_YEAR,\n sharedPref.getInt(SettingsActivity.KEY_PREF_BIRTH_YEAR, 1990));\n allArgs.putString(Store.KEY_FIELD_STREET,\n sharedPref.getString(SettingsActivity.KEY_PREF_STREET, \"\"));\n allArgs.putString(Store.KEY_FIELD_CITY,\n sharedPref.getString(SettingsActivity.KEY_PREF_CITY, \"\"));\n allArgs.putString(Store.KEY_FIELD_POSTAL_CODE,\n sharedPref.getString(SettingsActivity.KEY_PREF_POSTAL_CODE, \"\"));\n allArgs.putString(Store.KEY_FIELD_EMAIL,\n sharedPref.getString(SettingsActivity.KEY_PREF_EMAIL, \"\"));\n allArgs.putString(Store.KEY_FIELD_PHONE,\n sharedPref.getString(SettingsActivity.KEY_PREF_PHONE, \"\"));\n\n //Send to the API the new SurveyFields instance built by FieldsFactory\n mApiClient.conductSurvey(FieldsFactory.getFields(allArgs));\n\n }", "@And ( \"enter Drug: (.+) and Patient: (.+) and Dosage: (.+) and Renewals: (.+) and Start Date: (.+) and End Date: (.+) and Notes: (.+) click Submit Prescription\" )\r\n public void enterPatientDrugInformation ( final String drug, final String patient, final String dosage,\r\n final String renewals, final String startDate, final String endDate, final String notes )\r\n throws InterruptedException {\r\n // Thread.sleep( 500 );\r\n // // Assuming there is at least one patient in the database\r\n // wait.until( ExpectedConditions.visibilityOfElementLocated( By.id(\r\n // \"drug\" ) ) );\r\n // final WebElement prescription = driver.findElement( By.id( \"drug\" )\r\n // );\r\n // final Select selection = new Select( prescription );\r\n // selection.selectByVisibleText( drug );\r\n // final WebElement element = driver.findElement( By.id( \"patient\" ) );\r\n // final Select select = new Select( element );\r\n // select.selectByVisibleText( patient );\r\n // final WebElement amount = driver.findElement( By.name( \"dosage\" ) );\r\n // amount.clear();\r\n // amount.sendKeys( \"\" + dosage );\r\n // final WebElement ren = driver.findElement( By.name( \"renewals\" ) );\r\n // ren.clear();\r\n // ren.sendKeys( \"\" + renewals );\r\n // final WebElement sDate = driver.findElement( By.name( \"startDate\" )\r\n // );\r\n // sDate.clear();\r\n // sDate.sendKeys( startDate );\r\n // final WebElement eDate = driver.findElement( By.name( \"endDate\" ) );\r\n // eDate.clear();\r\n // eDate.sendKeys( endDate );\r\n // final WebElement comments = driver.findElement( By.name( \"notes\" ) );\r\n // comments.clear();\r\n // comments.sendKeys( notes );\r\n // final WebElement submit = driver.findElement( By.name( \"submit\" ) );\r\n // submit.click();\r\n\r\n }", "public void surveyUpdated (SurveyMetaData survey)\n {\n if (_surveys == null) {\n return;\n }\n\n for (int ii = 0; ii < _surveys.size(); ++ii) {\n if (_surveys.get(ii).surveyId == survey.surveyId) {\n _surveys.set(ii, survey);\n return;\n }\n }\n\n _surveys.add(survey);\n }", "int createSurvey(List<Question> questions, String userId);", "public Discipline getDisciplineById(int id) {\r\n for (Discipline discipline : disciplines) {\r\n if (discipline.getId() == id) {\r\n return discipline;\r\n }\r\n }\r\n return null;\r\n }", "public void registerPoll(){\n\t\tSystem.out.println(\"what company is the survey?\");\n\t\tSystem.out.println(theHolding.serviceCompanys());\n\t\tint selected = reader.nextInt();\n\t\treader.nextLine();\n\t\tif(selected > theHolding.getSubordinates().size()-1){\n\t\t\tSystem.out.println(\"Please select a correct option\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Please rate from 1 to 5 each of the following items\");\n\t\t System.out.println(\"Service rendered:\");\n\t\t int serviceRendered = reader.nextInt();\n\t\t reader.nextLine();\n\t\t System.out.println(\"Response time:\");\n\t\t int responseTime = reader.nextInt();\n\t\t reader.nextLine();\n\t\t System.out.println(\"Cost-benefit:\");\n\t\t int costBenefit = reader.nextInt();\n\t\t reader.nextLine();\n\t\t Poll toAdd = new Poll(serviceRendered, responseTime, costBenefit);\n\t\t System.out.println(theHolding.addPoll(selected, toAdd));\n\t\t}\n\t}", "public void fillCondTbl(String sentenceID){\n\t\t// implement me!\n\t}", "public String singleSelect() throws IOException{\n\t\t int count = 0;\t\t\t\t\t\t// count variable is used for count lines in file\n\t\t Fin = new FileReader(\"Survey.txt\");// to read form text file\n\t\t \n\t\t bufferReader = new BufferedReader(Fin);\t// take contents of file in bufferReader\n\t\t\n\t\t String[] questionArray = new String[6];\n\t\t while( count != 6 ) \t\t // starting 6 lines of files contains data for single select question. so it reads only six line\n\t\t {\n\t\t\t\n\t\t\t String line = bufferReader.readLine();\n\t\t\t System.out.println(line);\n\t\t\t questionArray[count] = line;\t// questionArray holds sentence with its option of single select question\n\t\t\t \n\t\t\t count++;\n\t\t }\n\t\t int flag = 0;\n\t\t String answer = new String();\t// string ans which holds the resultant option given by the user\n while( flag == 0 )\n {\n \t answer = sc.nextLine();\n \n\t for( int i=1; i<6; i++ )\n\t {\n\t if( questionArray[i].equals(answer) )\t// check whether user select answer is available or not\n\t {\n\t \t flag = 1;\t\t\t\t\t// if yes than make flag=1\n\t \t break;\n\t }\n\t }\n\t if( flag == 0 )\n\t {\n\t System.out.println(\"Enter Valid ans\");\t // otherwise continue the loop until answer is valid\n\t \n\t }\n }\n return answer;\t\t\t// return output\n\t }", "public void clickSurvey() {\n driver.get(\"https://\"+MainClass.site);\n driver.findElement(survey).click();\n //Home.waitObjectLoad(3000); //forced timeout to load the survey\n }", "private void checkFill(FyQuestion q, FyAnswer a) {\n\t\tList<FyQuestionItem> is = q.getItems();\r\n\t\tDouble avg = q.getScore() != 0 ? q.getScore() / is.size() : 0;\t\r\n\t\ta.setGoal(0.0);\r\n\t\tfor (int i = 0; i < is.size(); i++) {\r\n\t\t\tif (a.getAnswers()[i].equals(is.get(i).getContent())) {\r\n\t\t\t\ta.setGoal(avg + (a.getGoal() != null ? a.getGoal() : 0.0));\r\n\t\t\t}\r\n\t\t}\r\n\t\ta.setIsGrade(true);\r\n\t}", "public void setIdQuestion(int value) {\n this.idQuestion = value;\n }", "private void updateQuestion()//update the question each time\n\t{\n\t\tInteger num = random.nextInt(20);\n\t\tcurrentAminoAcid = FULL_NAMES[num];\n\t\tcurrentShortAA= SHORT_NAMES[num];\n\t\tquestionField.setText(\"What is the ONE letter name for:\");\n\t\taminoacid.setText(currentAminoAcid);\n\t\tanswerField.setText(\"\");\n\t\tvalidate();\n\t}", "void fillAssignmentWithActivities(Assignment assignment);", "public void addSurvey(Survey survey,Application passport) throws Exception;", "public Survey getSurvey() {\n return this.survey;\n }", "void setQuestionType(QuestionType type);", "public void setSingleChoices() {\r\n Random randomGenerator = new Random();\r\n int singleAnswer = randomGenerator.nextInt(4);\r\n studentAnswer.add(singleAnswer); }", "private void loadForm() {\n CodingProxy icd9 = problem.getIcd9Code();\n \n if (icd9 != null) {\n txtICD.setText(icd9.getProxiedObject().getCode());\n }\n \n String narr = problem.getProviderNarrative();\n \n if (narr == null) {\n narr = icd9 == null ? \"\" : icd9.getProxiedObject().getDisplay();\n }\n \n String probId = problem.getNumberCode();\n \n if (probId == null || probId.isEmpty()) {\n probId = getBroker().callRPC(\"BGOPROB NEXTID\", PatientContext.getActivePatient().getIdElement().getIdPart());\n }\n \n String pcs[] = probId.split(\"\\\\-\", 2);\n lblPrefix.setValue(pcs[0] + \" - \");\n txtID.setValue(pcs.length < 2 ? \"\" : pcs[1]);\n txtNarrative.setText(narr);\n datOnset.setValue(problem.getOnsetDate());\n \n if (\"P\".equals(problem.getProblemClass())) {\n radPersonal.setSelected(true);\n } else if (\"F\".equals(problem.getProblemClass())) {\n radFamily.setSelected(true);\n } else if (\"I\".equals(problem.getStatus())) {\n radInactive.setSelected(true);\n } else {\n radActive.setSelected(true);\n }\n \n int priority = NumberUtils.toInt(problem.getPriority());\n cboPriority.setSelectedIndex(priority < 0 || priority > 5 ? 0 : priority);\n loadNotes();\n }", "private void patientSetBtnActionPerformed(java.awt.event.ActionEvent evt) {\n patientArr[patientI] = new patient(patientNameBox.getText(),\n Integer.parseInt(patientAgeBox.getText()),\n patientDiseaseBox.getText(),\n Integer.parseInt(patientIDBox.getText()));\n try {\n for (int i = 0; i < doc.length; i++) {\n if (patientDiseaseBox.getText().equalsIgnoreCase(doc[i].expertise)) {\n doc[i].newPatient(patientArr[patientI]);\n patientArr[patientI].docIndex = i;\n break;\n }\n }\n } catch (NullPointerException e) {\n for (int i = 0; i < doc.length; i++) {\n if (doc[i].expertise.equalsIgnoreCase(\"medicine\")) {\n doc[i].newPatient(patientArr[patientI]);\n\n }\n }\n }\n\n patientArr[patientI].due += 1000;\n\n patientI++;\n \n }", "List<Question> getQuestions(String surveyId);", "private void parseQuestions()\n\t{\n\t\tlog.info(\"Parsing questions\");\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<Element> questions_list = doc.selectNodes(\"//document/questions/rows/row\");\n\t\tq_l10ns_node = doc.selectSingleNode(\"//document/question_l10ns/rows\");\n\t\tsq_node = doc.selectSingleNode(\"//document/subquestions/rows\");\n\t\tq_node = doc.selectSingleNode(\"//document/questions/rows\");\n\t\ta_node = doc.selectSingleNode(\"//document/answers/rows\");\n\n\t\tfor (Element question : questions_list) {\n\t\t\tString qid = question.element(\"qid\").getText();\n\t\t\tlog.debug(\"Working on question: \" + qid);\n\t\t\tQuestion q = new Question(qid,\n\t\t\t\t\t\t\t\t\t Integer.parseInt(question.element(\"gid\").getText()),\n\t\t\t\t\t\t\t\t\t question.element(\"type\").getText(),\n\t\t\t\t\t\t\t\t\t q_l10ns_node.selectSingleNode(\"row[qid=\" + qid + \"]/question\").getText(),\n\t\t\t\t\t\t\t\t\t question.element(\"title\").getText(),\n\t\t\t\t\t\t\t\t\t question.element(\"mandatory\").getText().equals(\"N\") ? \"No\" : \"Yes\",\n\t\t\t\t\t\t\t\t\t q_l10ns_node.selectSingleNode(\"row[qid=\" + qid + \"]/language\").getText());\n\n\t\t\t// Add a description, if there is one\n\t\t\tNode desc = q_l10ns_node.selectSingleNode(\"row[qid=\" + q.getQid() + \"]/help\");\n\t\t\tif (desc != null) {\n\t\t\t\tq.setDescription(desc.getText());\n\t\t\t}\n\n\t\t\taddCondition(q);\n\n\t\t\tswitch (q.type) {\n\t\t\t\t// Normal Text Fields\n\t\t\t\tcase \"S\":\n\t\t\t\tcase \"T\":\n\t\t\t\tcase \"U\":\n\t\t\t\t\tq.setType(\"T\");\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Date/Time\n\t\t\t\tcase \"D\":\n\t\t\t\t\tdate_time_qids.add(q.getQid());\n\t\t\t\t\tbreak;\n\t\t\t\t// Numeric Input\n\t\t\t\tcase \"N\":\n\t\t\t\t\tif (check_int_only(q)) {\n\t\t\t\t\t\tq.setType(\"I\");\n\t\t\t\t\t}\n\t\t\t\t\tadd_range(q);\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Single 5-Point Choice\n\t\t\t\tcase \"5\":\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(\"5pt.cl\", ClGenerator.getIntCl(5), \"string\", true));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Yes/No\n\t\t\t\tcase \"Y\":\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(\"YN.cl\", ClGenerator.getYNCl(), \"string\", false));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Gender\n\t\t\t\tcase \"G\":\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(\"Gender.cl\", ClGenerator.getGenderCl(), \"string\", false));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// List with comment\n\t\t\t\tcase \"O\":\n\t\t\t\t\taddComment(q);\n\t\t\t\t// Radio List\n\t\t\t\tcase \"L\":\n\t\t\t\t// Dropdown List\n\t\t\t\tcase \"!\":\n\t\t\t\t\tboolean oth = question.elementText(\"other\").equals(\"Y\");\n\t\t\t\t\tif(oth) {\n\t\t\t\t\t\taddOtherQuestion(q);\n\t\t\t\t\t}\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(q.getQid() + \".cl\", getAnswerCodesByID(q.getQid(), oth), \"string\", false));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Multiple Texts\n\t\t\t\t// Input On Demand\n\t\t\t\tcase \"Q\":\n\t\t\t\t\taddSubquestions(q, \"T\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Multiple Numeric Inputs\n\t\t\t\tcase \"K\":\n\t\t\t\t\tadd_range(q);\n\t\t\t\t\tif (check_int_only(q)){\n\t\t\t\t\t\taddSubquestions(q, \"I\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\taddSubquestions(q, \"N\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Dual scale array\n\t\t\t\tcase \"1\":\n\t\t\t\t\tHashMap<String, String>[] code_lists = ClGenerator.getDualScaleCls(q.getQid(), getAnswerIdsByID(q.getQid()), a_node);\n\t\t\t\t\taddSubquestionsWithCL(q, q.getQid() + \".0\", code_lists[0], \"string\", false, \"-0\");\n\t\t\t\t\taddSubquestionsWithCL(q, q.getQid() + \".1\", code_lists[1], \"string\", false, \"-1\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Array by column\n\t\t\t\tcase \"H\":\n\t\t\t\t// Flexible Array\n\t\t\t\tcase \"F\":\n\t\t\t\t\taddSubquestionsWithCL(q, q.getQid().concat(\".cl\"), getAnswerCodesByID(q.getQid(), false), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// 5pt Array\n\t\t\t\tcase \"A\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"5pt.cl\", ClGenerator.getIntCl(5), \"integer\", true, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// 10pt Array\n\t\t\t\tcase \"B\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"10pt.cl\", ClGenerator.getIntCl(10), \"integer\", true, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Increase/Same/Decrease Array\n\t\t\t\tcase \"E\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"ISD.cl\", ClGenerator.getISDCL(), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// 10pt Array\n\t\t\t\tcase \"C\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"YNU.cl\", ClGenerator.getYNUCL(), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Matrix with numerical input\n\t\t\t\tcase \":\":\n\t\t\t\t\tq.setType(\"N\");\n\t\t\t\t\taddQuestionMatrix(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Matrix with text input\n\t\t\t\tcase \";\":\n\t\t\t\t\tq.setType(\"T\");\n\t\t\t\t\taddQuestionMatrix(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Multiple Choice (Normal, Bootstrap, Image select)\n\t\t\t\tcase \"M\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"MC.cl\", ClGenerator.getMCCL(), \"string\", false, \"\");\n\t\t\t\t\tif (question.elementTextTrim(\"other\").equals(\"Y\")) {\n\t\t\t\t\t\tq.setQid(q.getQid().concat(\"other\"));\n\t\t\t\t\t\tq.setType(\"T\");\n\t\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// MC with comments\n\t\t\t\tcase \"P\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"MC.cl\", ClGenerator.getMCCL(), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tlog.error(\"Question type not supported: \" + q.type);\n\t\t\t}\n\t\t}\n\t}", "public void startSingleQuestionSet() {\n this.singleQuestionSet = new HashSet<>();//creates a new singleQuestionSet\n for (Question q : this.getForm().getQuestionList()) {//for every question in the question list of the current form\n if (q.getType().getId() == 2) {//if the question is type Single Question\n Quest newQuest = new Quest();//creates a new Quest\n newQuest.setqQuestion(q);//adds the current question to the new Quest\n this.singleQuestionSet.add(newQuest);//adds the new Quest to the new singleQuestionSet\n }\n }\n }", "public void question() {\n\t\tlead.answer(this);\n\t}", "public void setSurveyId(long surveyId) {\n this.surveyId = surveyId;\n }", "public Question generateQuestion(String type, String field, int studyYear, int length)\n\t{\n\t\tQuestion q = null;\n\t\t\n\t\treturn q;\n\t}", "public void sendQuestion() {\n/* 76 */ Village village = getResponder().getCitizenVillage();\n/* 77 */ if (village != null) {\n/* */ \n/* 79 */ this.allies = village.getAllies();\n/* */ \n/* 81 */ Arrays.sort((Object[])this.allies);\n/* 82 */ StringBuilder buf = new StringBuilder();\n/* 83 */ buf.append(getBmlHeader());\n/* 84 */ PvPAlliance pvpAll = PvPAlliance.getPvPAlliance(village.getAllianceNumber());\n/* 85 */ if (pvpAll != null) {\n/* */ \n/* 87 */ buf.append(\"text{text=\\\"You are in the \" + pvpAll.getName() + \".\\\"}\");\n/* 88 */ if (FocusZone.getHotaZone() != null)\n/* */ {\n/* 90 */ buf.append(\"text{text=\\\"\" + pvpAll.getName() + \" has won the Hunt of the Ancients \" + pvpAll\n/* 91 */ .getNumberOfWins() + \" times.\\\"}\");\n/* */ }\n/* */ \n/* */ \n/* 95 */ if (village.getId() == village.getAllianceNumber()) {\n/* */ \n/* 97 */ if (village.getMayor().getId() == getResponder().getWurmId()) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 102 */ buf.append(\"text{text=\\\"\" + village\n/* 103 */ .getName() + \" is the capital in the alliance which means your diplomats are responsible for ousting other settlements. The mayor may change name, disband or set another village as the alliance capital:\\\"};\");\n/* */ \n/* */ \n/* */ \n/* 107 */ buf.append(\"harray{label{text=\\\"Alliance name:\\\"};input{id=\\\"allName\\\"; text=\\\"\" + pvpAll.getName() + \"\\\";maxchars=\\\"20\\\"}}\");\n/* */ \n/* 109 */ buf.append(\"harray{label{text='Alliance capital:'}dropdown{id=\\\"masterVill\\\";options=\\\"\");\n/* */ \n/* 111 */ for (int x = 0; x < this.allies.length; x++)\n/* */ {\n/* 113 */ buf.append(this.allies[x].getName() + \",\");\n/* */ }\n/* */ \n/* 116 */ buf.append(\"No change\");\n/* 117 */ buf.append(\"\\\";default=\\\"\" + this.allies.length + \"\\\"}}\");\n/* 118 */ buf.append(\"harray{checkbox{text=\\\"Check this if you wish to disband this alliance: \\\";id=\\\"disbandAll\\\"; selected=\\\"false\\\"}}\");\n/* */ } \n/* */ \n/* */ \n/* 122 */ for (Village ally : this.allies)\n/* */ {\n/* 124 */ if (ally != village) {\n/* 125 */ buf.append(\"harray{label{text=\\\"Check to break alliance with \" + ally.getName() + \":\\\"}checkbox{id=\\\"break\" + ally\n/* */ \n/* 127 */ .getId() + \"\\\";text=' '}}\");\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 177 */ buf.append(\"harray{label{text=\\\"Check to break alliance with \" + pvpAll.getName() + \":\\\"}checkbox{id=\\\"break\" + pvpAll\n/* */ \n/* 179 */ .getId() + \"\\\";text=' '}}\");\n/* */ } \n/* 181 */ buf.append(\"text{type=\\\"bold\\\";text=\\\"Alliance message of the day:\\\"}\");\n/* 182 */ buf.append(\"input{maxchars=\\\"200\\\";id=\\\"motd\\\";text=\\\"\" + pvpAll.getMotd() + \"\\\"}\");\n/* */ } \n/* 184 */ if (this.allies.length == 0)\n/* 185 */ buf.append(\"text{text='You have no allies.'}\"); \n/* 186 */ buf.append(\"text{text=''}\");\n/* 187 */ buf.append(\"text{text=''}\");\n/* 188 */ if (village.warDeclarations != null) {\n/* */ \n/* 190 */ buf.append(\"text{type='bold'; text='The current village war declarations:' }\");\n/* 191 */ for (WarDeclaration declaration : village.warDeclarations.values()) {\n/* */ \n/* 193 */ if (declaration.declarer == village) {\n/* */ \n/* 195 */ if (Servers.isThisAChaosServer() && \n/* 196 */ System.currentTimeMillis() - declaration.time > 86400000L) {\n/* */ \n/* 198 */ declaration.accept();\n/* 199 */ buf.append(\"harray{label{text=\\\"\" + declaration.receiver.getName() + \" has now automatically accepted your declaration.\\\"}}\");\n/* */ \n/* */ continue;\n/* */ } \n/* 203 */ buf.append(\"harray{label{text=\\\"Check to withdraw declaration to \" + declaration.receiver.getName() + \":\\\"}checkbox{id'decl\" + declaration.receiver\n/* 204 */ .getId() + \"';text=' '}}\");\n/* */ \n/* */ continue;\n/* */ } \n/* */ \n/* 209 */ if (Servers.isThisAChaosServer()) {\n/* */ \n/* 211 */ if (System.currentTimeMillis() - declaration.time < 86400000L) {\n/* */ \n/* 213 */ buf.append(\"harray{label{text=\\\"You have \" + \n/* 214 */ Server.getTimeFor(System.currentTimeMillis() - declaration.time) + \" until you automatically accept the declaration of war.\\\"}}\");\n/* */ \n/* */ \n/* 217 */ buf.append(\"harray{label{text=\\\"Check to accept declaration from \" + declaration.declarer\n/* 218 */ .getName() + \":\\\"}checkbox{id='recv\" + declaration.declarer\n/* */ \n/* 220 */ .getId() + \"';text=' '}}\");\n/* */ \n/* */ continue;\n/* */ } \n/* 224 */ declaration.accept();\n/* 225 */ buf.append(\"harray{label{text=\\\"\" + declaration.receiver.getName() + \" has now automatically accepted the war declaration from \" + declaration.declarer\n/* */ \n/* 227 */ .getName() + \".\\\"}}\");\n/* */ \n/* */ continue;\n/* */ } \n/* */ \n/* 232 */ buf.append(\"harray{label{text=\\\"Check to accept declaration from \" + declaration.declarer.getName() + \":\\\"}checkbox{id='recv\" + declaration.declarer\n/* */ \n/* 234 */ .getId() + \"';text=' '}}\");\n/* */ } \n/* */ \n/* 237 */ buf.append(\"text{text=''}\");\n/* 238 */ buf.append(\"text{text=''}\");\n/* */ }\n/* 240 */ else if (Servers.localServer.PVPSERVER) {\n/* 241 */ buf.append(\"text{text='You have no pending war declarations.'}\");\n/* 242 */ } Village[] enemies = village.getEnemies();\n/* 243 */ if (enemies.length > 0) {\n/* */ \n/* 245 */ buf.append(\"harray{text{type='bold'; text='We are at war with: '}text{text=\\\" \");\n/* */ \n/* 247 */ Arrays.sort((Object[])enemies);\n/* */ \n/* 249 */ for (int x = 0; x < enemies.length; x++) {\n/* */ \n/* 251 */ if (x == enemies.length - 1) {\n/* 252 */ buf.append(enemies[x].getName());\n/* 253 */ } else if (x == enemies.length - 2) {\n/* 254 */ buf.append(enemies[x].getName() + \" and \");\n/* */ } else {\n/* 256 */ buf.append(enemies[x].getName() + \", \");\n/* */ } \n/* 258 */ } buf.append(\".\\\"}}\");\n/* */ }\n/* 260 */ else if (Servers.localServer.PVPSERVER) {\n/* 261 */ buf.append(\"text{text='You are not at war with any particular settlement.'}\");\n/* 262 */ } buf.append(createAnswerButton2());\n/* 263 */ getResponder().getCommunicator().sendBml(300, 300, true, true, buf.toString(), 200, 200, 200, this.title);\n/* */ } \n/* */ }", "public Record(\n LinkedHashSet<String> symptoms,\n LinkedHashSet<String> diagnoses,\n LinkedHashSet<String> prescriptions\n ) {\n this.symptoms = symptoms;\n this.diagnoses = diagnoses;\n this.prescriptions = prescriptions;\n }", "public void requestAppointment(Doctor doctor, Secretary sec)\n {\n sec.addToAppointmentRequests(doctor, this);\n }", "public void setQuestion(Question v) {\n if (Problem_Type.featOkTst && ((Problem_Type)jcasType).casFeat_question == null)\n jcasType.jcas.throwFeatMissing(\"question\", \"hw1.qa.Problem\");\n jcasType.ll_cas.ll_setRefValue(addr, ((Problem_Type)jcasType).casFeatCode_question, jcasType.ll_cas.ll_getFSRef(v));}", "public void fill(Object requestor);", "Question(String ques, String opt1, String opt2, String opt3, String opt4) {\n this.ques = ques;\n this.opt1 = opt1;\n this.opt2 = opt2;\n this.opt3 = opt3;\n this.opt4 = opt4;\n }", "public void deleteSurvey(int sid);", "void checkSurveyExists() {\n\n if (dbg) System.out.println(\"<br>checkSurveyExists: inventory = \" + inventory);\n if (dbg) System.out.println(\"<br>checkSurveyExists: survey = \" + survey);\n if (dbg) System.out.println(\"<br>checkSurveyExists: lineCount = \" + lineCount);\n\n // is the survey already loaded?\n surveyLoaded = false;\n surveyStatus = \"new\";\n\n boolean emptyFields = false;\n\n // survey_id may not be blank\n if (\"\".equals(survey.getSurveyId(\"\"))) {\n outputError((lineCount-1) + \" - Fatal - \" +\n \"Field empty - Survey-ID\");\n emptyFields = true;\n } // if (\"\".equals(survey.getSurveyId())\n\n // institute may not be blank\n if (\"\".equals(survey.getInstitute(\"\"))) {\n outputError((lineCount-1) + \" - Fatal - \" +\n \"Field empty - Institute (3-letter institute code: code 01 3)\");\n emptyFields = true;\n } // if (\"\".equals(survey.getInstitute())\n\n // domain may not be blank - only need to check if inventory does not exist\n if (dbg) System.out.println(\"<br>checkSurveyExists: inventoryExists = \" +\n inventoryExists);\n if (!inventoryExists) {\n if (\"\".equals(inventory.getDomain(\"\"))) {\n if (dataType == WATER) {\n outputError((lineCount-1) + \" - Fatal - \" +\n \"Field empty - Domain (code 01 4)\");\n emptyFields = true;\n } else {\n inventory.setDomain(\"DEEPSEA\");\n } // if (dataType == WATER) {\n } // if (\"\".equals(survey.getDomain())\n } // if (!inventoryExists)\n\n if (!emptyFields) {\n\n tSurvey = new MrnSurvey(survey.getSurveyId()).get();\n if (dbg) if (tSurvey.length > 0)\n System.out.println(\"<br>checkSurveyExists: tsurvey[0] = \" + tSurvey[0]);\n if (dbg) System.out.println(\"<br>checkSurveyExists: survey = \" + survey);\n if (tSurvey.length > 0) {\n //if (!tSurvey[0].getPlanam().equals(survey.getPlanam()) &&\n // !tSurvey[0].getExpnam().equals(survey.getExpnam()) &&\n // !tSurvey[0].getInstitute().equals(survey.getInstitute())) {\n if (!tSurvey[0].getPlanam(\"\").equals(survey.getPlanam(\"\")) ||\n !tSurvey[0].getExpnam(\"\").equals(survey.getExpnam(\"\")) ||\n !tSurvey[0].getInstitute(\"\").equals(survey.getInstitute(\"\"))) {\n\n outputError((lineCount-1) + \" - Fatal - \" +\n \"Survey-ID already in use: \" + survey.getSurveyId() +\n \": planam (code 01 1), expnam (code 01 2) or\\n\" +\n \" institute (code 01 3) not same as \" +\n \"in survey table\");\n } else {\n surveyLoaded = true;\n surveyStatus = \"dup\";\n } // if (!tSurvey.getPlanam().equals(survey.getPlanam()) &&\n } // if (tSurvey.length > 0)\n\n } // if (!emptyFields)\n\n // load the survey data (only if no errors)\n if (dbg) System.out.println(\"checkSurveyExists: loadflag = \" + loadFlag);\n if (dbg) System.out.println(\"checkSurveyExists: fatalCount = \" + fatalCount);\n if (dbg) System.out.println(\"checkSurveyExists: surveyLoaded = \" + surveyLoaded);\n if (loadFlag && (fatalCount == 0) && !surveyLoaded) {\n loadInventory();\n try {\n survey.put();\n } catch(Exception e) {\n System.err.println(\"checkSurveyExists: put survey = \" + survey);\n System.err.println(\"checkSurveyExists: put sql = \" + survey.getInsStr());\n e.printStackTrace();\n } // try-catch\n\n if (dbg3) System.out.println(\"<br>checkSurveyExists: put survey = \" + survey);\n } // if (loadFlag)\n\n institute = survey.getInstitute(\"\"); // 3-letter institute code\n\n }", "private void assignDiagnosisInfo( String cosmoId )\r\n {\r\n\r\n String[] info = helper.retrieveHealthStatusInfo(cosmoId);\r\n familyPhysicianTxt.setText(info[0]);\r\n physicianPhoneTxt.setText(info[1]);\r\n participantDiagnosisTxt.setText(info[2]);\r\n tylenolGiven.setSelected(Boolean.parseBoolean(info[3]));\r\n careGiverPermission.setSelected(Boolean.parseBoolean(info[4]));\r\n\r\n dateCompletedTxt.setText(info[5]);\r\n otherInfoTxt.setText(info[6]);\r\n\r\n }", "private void creatingNewQuestion() {\r\n AbstractStatement<?> s;\r\n ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());\r\n switch ((String) typeQuestion.getValue()) {\r\n case \"TrueFalse\":\r\n // just to be sure the answer corresponds to the json file\r\n Boolean answer = CorrectAnswer.getText().equalsIgnoreCase(\"true\");\r\n s = new TrueFalse<>(Text.getText(), answer);\r\n break;\r\n\r\n case \"MCQ\":\r\n s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());\r\n break;\r\n\r\n default:\r\n s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());\r\n break;\r\n }\r\n lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));\r\n lq.writeJson(ThemesController.getThemeSelected());\r\n }", "Question getQuestionInDraw(String questionId);", "public void selectSurvey(int index) {\n selectedSurvey = activeTargetedSurveys.get(index);\n }", "public MAidQuestion(String s) {\n\t\tScanner sc = new Scanner(s);\n\t\tSystem.err.println(\"s: \"+s);\n //test if there is an integer\n\t\ttry {\n\t\t\tsc.nextInt();\n\t\t\tsc.next();\n\t\t} catch (Exception e) {\n\t\t\tsc.next();\n\t\t}\n\t\t\n //tests if there is one and only one question mark\n\t\ts = \"\";\n\t\twhile (sc.hasNextLine()){\n\t\t\ts = s+sc.nextLine().trim()+\" \";\n\t\t}\n\t\ts = s.trim();\n\t\tint lq = s.lastIndexOf('?');\n\t\tint fq = s.indexOf('?');\n\t\tif (fq != lq){\n\t\t\tSystem.out.println(\"bad question:\\n\"+s);\n\t\t\treturn;\n\t\t}\n \n\t\tquestion = s.substring(0,lq+1);\n\t\t//validate the answer\n s = s.substring(lq+1).trim();\n\t\tSystem.out.println(\"ans s: \"+s);\n\t\tint f_ = s.indexOf('_');\n\t\ts = s.substring(0,f_);\n\t\tsc = new Scanner(s);\n\t\tString numS = Util.dollarProcess(sc.next()); //process currency quantity\n\t\ttry {\n\t\t\tanswerNum = Double.parseDouble(numS); //gets answer as a number if possible\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tgoodQ = false; //if we can't represent the answer as a number, badness results\n\t\t\treturn;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tanswerObj = sc.nextLine();\n\t\t} catch (Exception e) {\n\t\t\t\n\t\t}\n\t\t\n\t\tif (sc.hasNext()){\n\t\t\tSystem.out.println(\"bad end \"+question+\" \"+answerNum);\n\t\t\tgoodQ = false;\n\t\t}\n\t\tgoodQ = true;\n\t}", "@Test(groups = { \"survey-creation\", \"all-tests\", \"key-tests\" })\r\n public void successfullyVerifySurveyDefaultDropDowns() throws Exception {\r\n\r\n String number = driver.getTimestamp();\r\n String surveyName = number + \"VerifyDefaultDropDowns\";\r\n\r\n log.startTest( \"LeadEnable: Verify that survey drop downs have default value Please select\" );\r\n try {\r\n // Log And Go to Survey Page\r\n loginToSend().goToSurveyPage().sfdcSurvey.createSurveyAndTypeSurveyName( surveyName )\r\n .checkLogResponseInCRM()\r\n .selectSurveyFolders( surveyType4, sfdcCampaign4 ).sfdcQuestion.editQuestionType( \"A free text question\" );\r\n\r\n log.resultStep( \"Verify the Contact Field drop down\" );\r\n log.endStep( driver.isValueSelected( \"#qTypetextSalesforceContactsField span\", \"Please select\" ) );\r\n\r\n log.resultStep( \"Verify the Lead drop down\" );\r\n log.endStep( driver.isValueSelected( \"#qTypetextSalesforceLeadField span\", \"Please select\" ) );\r\n\r\n send.sfdcSurvey.sfdcQuestion.cancelQuestion().editQuestionType( \"A multiple choice question\" );\r\n\r\n log.resultStep( \"Verify the Contact Field drop down\" );\r\n log.endStep( driver.isValueSelected( \"#qTypemcSalesforceContactsField span\", \"Please select\" ) );\r\n\r\n log.resultStep( \"Verify the Lead drop down\" );\r\n log.endStep( driver.isValueSelected( \"#qTypemcSalesforceLeadField span\", \"Please select\" ) );\r\n\r\n send.sfdcSurvey.sfdcQuestion.cancelQuestion().addNewQuestionType( \"Free text\", element.ftQId );\r\n\r\n log.resultStep( \"Verify the Contact Field drop down\" );\r\n log.endStep( driver.isValueSelected( \"#qTypetextSalesforceContactsField span\", \"Please select\" ) );\r\n\r\n log.resultStep( \"Verify the Lead drop down\" );\r\n log.endStep( driver.isValueSelected( \"#qTypetextSalesforceLeadField span\", \"Please select\" ) );\r\n\r\n send.sfdcSurvey.sfdcQuestion.cancelQuestion().addNewQuestionType( \"Multiple choice\",\r\n element.mcQId );\r\n\r\n log.resultStep( \"Verify the Contact Field drop down\" );\r\n log.endStep( driver.isValueSelected( \"#qTypemcSalesforceContactsField span\", \"Please select\" ) );\r\n\r\n log.resultStep( \"Verify the Lead drop down\" );\r\n log.endStep( driver.isSelected( \"#qTypemcSalesforceLeadField span\", \"Please select\" ) );\r\n\r\n } catch( Exception e ) {\r\n log.endStep( false );\r\n throw e;\r\n }\r\n log.endTest();\r\n }", "public QuestionnaireExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public final EObject ruleSurvey() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_0=null;\n Token otherlv_2=null;\n Token otherlv_4=null;\n Token otherlv_6=null;\n AntlrDatatypeRuleToken lv_title_1_0 = null;\n\n AntlrDatatypeRuleToken lv_date_3_0 = null;\n\n AntlrDatatypeRuleToken lv_description_5_0 = null;\n\n AntlrDatatypeRuleToken lv_email_7_0 = null;\n\n EObject lv_person_8_0 = null;\n\n EObject lv_categories_9_0 = null;\n\n EObject lv_categories_10_0 = null;\n\n\n enterRule(); \n \n try {\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:79:28: ( (otherlv_0= 'survey' ( (lv_title_1_0= ruleEString ) ) (otherlv_2= 'date' ( (lv_date_3_0= ruleEString ) ) )? (otherlv_4= 'description' ( (lv_description_5_0= ruleEString ) ) )? (otherlv_6= 'email' ( (lv_email_7_0= ruleEString ) ) )? ( (lv_person_8_0= rulePerson ) )? ( (lv_categories_9_0= ruleCategory ) ) ( (lv_categories_10_0= ruleCategory ) )* ) )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:80:1: (otherlv_0= 'survey' ( (lv_title_1_0= ruleEString ) ) (otherlv_2= 'date' ( (lv_date_3_0= ruleEString ) ) )? (otherlv_4= 'description' ( (lv_description_5_0= ruleEString ) ) )? (otherlv_6= 'email' ( (lv_email_7_0= ruleEString ) ) )? ( (lv_person_8_0= rulePerson ) )? ( (lv_categories_9_0= ruleCategory ) ) ( (lv_categories_10_0= ruleCategory ) )* )\n {\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:80:1: (otherlv_0= 'survey' ( (lv_title_1_0= ruleEString ) ) (otherlv_2= 'date' ( (lv_date_3_0= ruleEString ) ) )? (otherlv_4= 'description' ( (lv_description_5_0= ruleEString ) ) )? (otherlv_6= 'email' ( (lv_email_7_0= ruleEString ) ) )? ( (lv_person_8_0= rulePerson ) )? ( (lv_categories_9_0= ruleCategory ) ) ( (lv_categories_10_0= ruleCategory ) )* )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:80:3: otherlv_0= 'survey' ( (lv_title_1_0= ruleEString ) ) (otherlv_2= 'date' ( (lv_date_3_0= ruleEString ) ) )? (otherlv_4= 'description' ( (lv_description_5_0= ruleEString ) ) )? (otherlv_6= 'email' ( (lv_email_7_0= ruleEString ) ) )? ( (lv_person_8_0= rulePerson ) )? ( (lv_categories_9_0= ruleCategory ) ) ( (lv_categories_10_0= ruleCategory ) )*\n {\n otherlv_0=(Token)match(input,11,FollowSets000.FOLLOW_11_in_ruleSurvey122); \n\n \tnewLeafNode(otherlv_0, grammarAccess.getSurveyAccess().getSurveyKeyword_0());\n \n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:84:1: ( (lv_title_1_0= ruleEString ) )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:85:1: (lv_title_1_0= ruleEString )\n {\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:85:1: (lv_title_1_0= ruleEString )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:86:3: lv_title_1_0= ruleEString\n {\n \n \t newCompositeNode(grammarAccess.getSurveyAccess().getTitleEStringParserRuleCall_1_0()); \n \t \n pushFollow(FollowSets000.FOLLOW_ruleEString_in_ruleSurvey143);\n lv_title_1_0=ruleEString();\n\n state._fsp--;\n\n\n \t if (current==null) {\n \t current = createModelElementForParent(grammarAccess.getSurveyRule());\n \t }\n \t\tset(\n \t\t\tcurrent, \n \t\t\t\"title\",\n \t\tlv_title_1_0, \n \t\t\"EString\");\n \t afterParserOrEnumRuleCall();\n \t \n\n }\n\n\n }\n\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:102:2: (otherlv_2= 'date' ( (lv_date_3_0= ruleEString ) ) )?\n int alt1=2;\n int LA1_0 = input.LA(1);\n\n if ( (LA1_0==12) ) {\n alt1=1;\n }\n switch (alt1) {\n case 1 :\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:102:4: otherlv_2= 'date' ( (lv_date_3_0= ruleEString ) )\n {\n otherlv_2=(Token)match(input,12,FollowSets000.FOLLOW_12_in_ruleSurvey156); \n\n \tnewLeafNode(otherlv_2, grammarAccess.getSurveyAccess().getDateKeyword_2_0());\n \n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:106:1: ( (lv_date_3_0= ruleEString ) )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:107:1: (lv_date_3_0= ruleEString )\n {\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:107:1: (lv_date_3_0= ruleEString )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:108:3: lv_date_3_0= ruleEString\n {\n \n \t newCompositeNode(grammarAccess.getSurveyAccess().getDateEStringParserRuleCall_2_1_0()); \n \t \n pushFollow(FollowSets000.FOLLOW_ruleEString_in_ruleSurvey177);\n lv_date_3_0=ruleEString();\n\n state._fsp--;\n\n\n \t if (current==null) {\n \t current = createModelElementForParent(grammarAccess.getSurveyRule());\n \t }\n \t\tset(\n \t\t\tcurrent, \n \t\t\t\"date\",\n \t\tlv_date_3_0, \n \t\t\"EString\");\n \t afterParserOrEnumRuleCall();\n \t \n\n }\n\n\n }\n\n\n }\n break;\n\n }\n\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:124:4: (otherlv_4= 'description' ( (lv_description_5_0= ruleEString ) ) )?\n int alt2=2;\n int LA2_0 = input.LA(1);\n\n if ( (LA2_0==13) ) {\n alt2=1;\n }\n switch (alt2) {\n case 1 :\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:124:6: otherlv_4= 'description' ( (lv_description_5_0= ruleEString ) )\n {\n otherlv_4=(Token)match(input,13,FollowSets000.FOLLOW_13_in_ruleSurvey192); \n\n \tnewLeafNode(otherlv_4, grammarAccess.getSurveyAccess().getDescriptionKeyword_3_0());\n \n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:128:1: ( (lv_description_5_0= ruleEString ) )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:129:1: (lv_description_5_0= ruleEString )\n {\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:129:1: (lv_description_5_0= ruleEString )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:130:3: lv_description_5_0= ruleEString\n {\n \n \t newCompositeNode(grammarAccess.getSurveyAccess().getDescriptionEStringParserRuleCall_3_1_0()); \n \t \n pushFollow(FollowSets000.FOLLOW_ruleEString_in_ruleSurvey213);\n lv_description_5_0=ruleEString();\n\n state._fsp--;\n\n\n \t if (current==null) {\n \t current = createModelElementForParent(grammarAccess.getSurveyRule());\n \t }\n \t\tset(\n \t\t\tcurrent, \n \t\t\t\"description\",\n \t\tlv_description_5_0, \n \t\t\"EString\");\n \t afterParserOrEnumRuleCall();\n \t \n\n }\n\n\n }\n\n\n }\n break;\n\n }\n\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:146:4: (otherlv_6= 'email' ( (lv_email_7_0= ruleEString ) ) )?\n int alt3=2;\n int LA3_0 = input.LA(1);\n\n if ( (LA3_0==14) ) {\n alt3=1;\n }\n switch (alt3) {\n case 1 :\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:146:6: otherlv_6= 'email' ( (lv_email_7_0= ruleEString ) )\n {\n otherlv_6=(Token)match(input,14,FollowSets000.FOLLOW_14_in_ruleSurvey228); \n\n \tnewLeafNode(otherlv_6, grammarAccess.getSurveyAccess().getEmailKeyword_4_0());\n \n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:150:1: ( (lv_email_7_0= ruleEString ) )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:151:1: (lv_email_7_0= ruleEString )\n {\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:151:1: (lv_email_7_0= ruleEString )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:152:3: lv_email_7_0= ruleEString\n {\n \n \t newCompositeNode(grammarAccess.getSurveyAccess().getEmailEStringParserRuleCall_4_1_0()); \n \t \n pushFollow(FollowSets000.FOLLOW_ruleEString_in_ruleSurvey249);\n lv_email_7_0=ruleEString();\n\n state._fsp--;\n\n\n \t if (current==null) {\n \t current = createModelElementForParent(grammarAccess.getSurveyRule());\n \t }\n \t\tset(\n \t\t\tcurrent, \n \t\t\t\"email\",\n \t\tlv_email_7_0, \n \t\t\"EString\");\n \t afterParserOrEnumRuleCall();\n \t \n\n }\n\n\n }\n\n\n }\n break;\n\n }\n\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:168:4: ( (lv_person_8_0= rulePerson ) )?\n int alt4=2;\n int LA4_0 = input.LA(1);\n\n if ( (LA4_0==16) ) {\n alt4=1;\n }\n switch (alt4) {\n case 1 :\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:169:1: (lv_person_8_0= rulePerson )\n {\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:169:1: (lv_person_8_0= rulePerson )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:170:3: lv_person_8_0= rulePerson\n {\n \n \t newCompositeNode(grammarAccess.getSurveyAccess().getPersonPersonParserRuleCall_5_0()); \n \t \n pushFollow(FollowSets000.FOLLOW_rulePerson_in_ruleSurvey272);\n lv_person_8_0=rulePerson();\n\n state._fsp--;\n\n\n \t if (current==null) {\n \t current = createModelElementForParent(grammarAccess.getSurveyRule());\n \t }\n \t\tset(\n \t\t\tcurrent, \n \t\t\t\"person\",\n \t\tlv_person_8_0, \n \t\t\"Person\");\n \t afterParserOrEnumRuleCall();\n \t \n\n }\n\n\n }\n break;\n\n }\n\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:186:3: ( (lv_categories_9_0= ruleCategory ) )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:187:1: (lv_categories_9_0= ruleCategory )\n {\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:187:1: (lv_categories_9_0= ruleCategory )\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:188:3: lv_categories_9_0= ruleCategory\n {\n \n \t newCompositeNode(grammarAccess.getSurveyAccess().getCategoriesCategoryParserRuleCall_6_0()); \n \t \n pushFollow(FollowSets000.FOLLOW_ruleCategory_in_ruleSurvey294);\n lv_categories_9_0=ruleCategory();\n\n state._fsp--;\n\n\n \t if (current==null) {\n \t current = createModelElementForParent(grammarAccess.getSurveyRule());\n \t }\n \t\tadd(\n \t\t\tcurrent, \n \t\t\t\"categories\",\n \t\tlv_categories_9_0, \n \t\t\"Category\");\n \t afterParserOrEnumRuleCall();\n \t \n\n }\n\n\n }\n\n // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:204:2: ( (lv_categories_10_0= ruleCategory ) )*\n loop5:\n do {\n int alt5=2;\n int LA5_0 = input.LA(1);\n\n if ( (LA5_0==15) ) {\n alt5=1;\n }\n\n\n switch (alt5) {\n \tcase 1 :\n \t // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:205:1: (lv_categories_10_0= ruleCategory )\n \t {\n \t // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:205:1: (lv_categories_10_0= ruleCategory )\n \t // ../dk.itu.smdp.survey.xtext/src-gen/dk/itu/smdp/survey/xtext/parser/antlr/internal/InternalTaco.g:206:3: lv_categories_10_0= ruleCategory\n \t {\n \t \n \t \t newCompositeNode(grammarAccess.getSurveyAccess().getCategoriesCategoryParserRuleCall_7_0()); \n \t \t \n \t pushFollow(FollowSets000.FOLLOW_ruleCategory_in_ruleSurvey315);\n \t lv_categories_10_0=ruleCategory();\n\n \t state._fsp--;\n\n\n \t \t if (current==null) {\n \t \t current = createModelElementForParent(grammarAccess.getSurveyRule());\n \t \t }\n \t \t\tadd(\n \t \t\t\tcurrent, \n \t \t\t\t\"categories\",\n \t \t\tlv_categories_10_0, \n \t \t\t\"Category\");\n \t \t afterParserOrEnumRuleCall();\n \t \t \n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop5;\n }\n } while (true);\n\n\n }\n\n\n }\n\n leaveRule(); \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "public static void questionnaire() {\n\t\tboolean flag = true;\n\t\tString a = null;\n\t\t//donor's username\n\t\tflag = true;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tusername = JOptionPane.showInputDialog(null,\"Enter your username: \", \"SIGN UP\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\tif (username.equals(\"null\")) {\n\t\t\t\t\tthrow new NullPointerException();\n\t\t }\n\t\t\t\tflag = false;\n\t\t\t} catch (NullPointerException e) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Please enter a username.\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t flag = true;\n\t\t\t}\t\n\t\t}while (flag);\n\t\ttry {\n\t\t\tResultSet rs = Messages.connect().executeQuery(\"SELECT * FROM Questionnaire \");\n\t\t\twhile (rs.next()) {\n\t\t\t\tint qid = rs.getInt(\"Q_id\");\n\t\t\t\tString r = rs.getString(\"Question\");\n\t\t\t\tdo {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (qid == 1) {\n\t\t\t\t\t\t\tflag = true;\n \t \t\t\t\t\tObject[] opt = {\"Male\", \"Female\"};\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tint g = JOptionPane.showOptionDialog(null,\"Choose your gender: \", \"SIGN UP\", JOptionPane.YES_NO_OPTION,\n\t\t\t\t\t\t\t\t\t\t\tJOptionPane.PLAIN_MESSAGE, null, opt, null);\n\t\t\t\t\t\t\t\t\tif (g == 0) {\n\t\t\t\t\t\t\t\t\t\tgender = \"male\";\n\t\t\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t} else if (g == 1){\n\t\t\t\t\t\t\t\t\t\tgender = \"female\";\n\t\t\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (NullPointerException e1) {\n\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please choose your gender\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}while (flag);\n\t\t\t\t\t\t\ta = gender;\n\t\t\t\t\t\t} else if (((qid >= 2) && (qid<=12)) || (qid == 14)) {\n\t\t\t\t\t\t\ta = JOptionPane.showInputDialog(null, qid + \". \" + r, \"QUESTIONNAIRE\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\t\t\tif (a.equals(null)) {\n\t\t\t\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tint p = JOptionPane.showConfirmDialog(null, qid + \". \" + r, \"QUESTIONNAIRE\", JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\t\t\ta = String.valueOf(p);\n\t\t\t\t\t\t\tif (p == -1) {\n\t\t\t\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please insert your answer\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\tflag = true;\n\t\t\t\t\t}\n\t\t\t\t} while (flag);\n\t\t\t\tif (checkQuestion(qid, a) == false) {\n\t\t\t\t\t//delete data from data base\n\t\t\t\t\tint d = Messages.connect().executeUpdate(\"DELETE FROM Answers WHERE B_Username ='\" + username + \"'\");\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"We regret to inform you that you are not compatible as a blood donor.\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t} else {\n\t\t\t\t\tinsertAnswers(username, qid, a);\n\t\t\t\t}\n\t\t\t}\n\t\t\trs.close();\n\t\t\tMessages.connect().close();\n\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t\t}", "public static int sapQuestions (int sapPathway)\r\n {\r\n int questionNumber = (int)(Math.random()*20)+1;\r\n\r\n switch (questionNumber)\r\n {\r\n case 1: System.out.println(\"Which of the following is not a social institution?\\r\\n\" + \r\n \"1.) family\\r\\n\" + \r\n \"2.) education\\r\\n\" + \r\n \"3.) hidden Media\\r\\n\" + \r\n \"4.) social Media\\r\\n\");\r\n break;\r\n case 2: System.out.println(\"Stereotypes are maintained by _______\\r\\n\" + \r\n \"1.) ignoring contradictory evidence\\r\\n\" + \r\n \"2.) individualization \\r\\n\" + \r\n \"3.) overcomplicating generalization that is applied to all members of a group\\r\\n\" + \r\n \"4.) the ideology of “rescue”\\r\\n\");\r\n break;\r\n case 3: System.out.println(\"Racism is about _____\\r\\n\" + \r\n \"1.) effect not Intent\\r\\n\" + \r\n \"2.) intent not effect\\r\\n\" + \r\n \"3.) response not question\\r\\n\" + \r\n \"4.) question not response\\r\\n\");\r\n break;\r\n case 4: System.out.println(\"What is the definition of theory?\\r\\n\" + \r\n \"1.) what’s important to you\\r\\n\" + \r\n \"2.) best possible explanation based on available evidence\\r\\n\" + \r\n \"3.) your experiences, what you think is real\\r\\n\" + \r\n \"4.) determines how you interpret situations\\r\\n\");\r\n break;\r\n case 5: System.out.println(\"Which of the following is not an obstacle to clear thinking?\\r\\n\" + \r\n \"1.) drugs\\r\\n\" + \r\n \"2.) close-minded\\r\\n\" + \r\n \"3.) honesty\\r\\n\" + \r\n \"4.) emotions\\r\\n\");\r\n break;\r\n case 6: System.out.println(\"What does the IQ test asses?\\r\\n\" + \r\n \"1.) literacy skills\\r\\n\" + \r\n \"2.) survival skills\\r\\n\" + \r\n \"3.) logical reasoning skills\\r\\n\" + \r\n \"4.) 1 and 3\\r\\n\");\r\n break;\r\n case 7: System.out.println(\"How many types of intelligence are there?\\r\\n\" + \r\n \"1.) 27\\r\\n\" + \r\n \"2.) 5\\r\\n\" + \r\n \"3.) 3\\r\\n\" + \r\n \"4.) 8\\r\\n\");\r\n break;\r\n case 8: System.out.println(\"Emotions have 3 components\\r\\n\" + \r\n \"1.) psychological, cognitive, behavioral\\r\\n\" + \r\n \"2.) psychological, physical, social\\r\\n\" + \r\n \"3.) intensity, range, exposure\\r\\n\" + \r\n \"4.) range, duration, intensity\\r\\n\");\r\n break;\r\n case 9: System.out.println(\"Which of the following is not a component of happiness?\\r\\n\" + \r\n \"1.) diet and nutrition\\r\\n\" + \r\n \"2.) time in nature\\r\\n\" + \r\n \"3.) interventions\\r\\n\" + \r\n \"4.) relationships\\r\\n\");\r\n break;\r\n case 10: System.out.println(\"The brain compensates for damaged neurons by ______.\\r\\n\" + \r\n \"1.) extending neural connections over the dead neurons\\r\\n\" + \r\n \"2.) it doesn’t need too\\r\\n\" + \r\n \"3.) grows new neurons\\r\\n\" + \r\n \"4.) send neurons in from different places\\r\\n\");\r\n break;\r\n case 11: System.out.println(\"Which of the following is true?\\r\\n\" + \r\n \"1.) you continue to grow neurons until age 50\\r\\n\" + \r\n \"2.) 90% of the brain is achieved by age 6\\r\\n\" + \r\n \"3.) only 20% of the brain is actually being used \\r\\n\" + \r\n \"4.) the size of your brain determines your intelligence\\r\\n\");\r\n break;\r\n case 12: System.out.println(\"The feel-good chemical is properly known as?\\r\\n\" + \r\n \"1.) acetycholine\\r\\n\" + \r\n \"2.) endocrine\\r\\n\" + \r\n \"3.) dopamine\\r\\n\" + \r\n \"4.) doperdoodle\\r\\n\");\r\n break;\r\n case 13: System.out.println(\"Who created the theory about ID, superego and ego?\\r\\n\" + \r\n \"1.) Albert\\r\\n\" + \r\n \"2.) Freud\\r\\n\" + \r\n \"3.) Erikson\\r\\n\" + \r\n \"4.) Olaf\\r\\n\");\r\n break;\r\n case 14: System.out.println(\"Classic Conditioning is _______?\\r\\n\" + \r\n \"1.) when an organism learns to associate two things that are normally unrelated\\r\\n\" + \r\n \"2.) when an organism learns to disassociate two things that are normally related \\r\\n\" + \r\n \"3.) when you teach an organism the survival style of another organism\\r\\n\" + \r\n \"4.) when you train an organism without the use of modern technology\\r\\n\");\r\n break;\r\n case 15: System.out.println(\"The cerebellum is responsible for what?\\r\\n\" + \r\n \"1.) visual info processing\\r\\n\" + \r\n \"2.) secrets hormones\\r\\n\" + \r\n \"3.) balance and coordination\\r\\n\" + \r\n \"4.) controls heartbeat\\r\\n\");\r\n break;\r\n case 16: System.out.println(\"Transphobia is the fear of?\\r\\n\" + \r\n \"1.) transgender individuals\\r\\n\" + \r\n \"2.) homosexual individuals\\r\\n\" + \r\n \"3.) women\\r\\n\" + \r\n \"4.) transfats\\r\\n\");\r\n break;\r\n case 17: System.out.println(\"What factors contribute to a positive IQ score in children?\\r\\n\" + \r\n \"1.) early access to words\\r\\n\" + \r\n \"2.) affectionate parents\\r\\n\" + \r\n \"3.) spending time on activities\\r\\n\" + \r\n \"4.) all of the above\\r\\n\");\r\n break;\r\n case 18: System.out.println(\"Emotions can be ______.\\r\\n\" + \r\n \"1.) a reaction\\r\\n\" + \r\n \"2.) a goal\\r\\n\" + \r\n \"3.) all of the above\\r\\n\" + \r\n \"4.) none of the above\\r\\n\");\r\n break;\r\n case 19: System.out.println(\"What is not a stage in increasing prejudice?\\r\\n\" + \r\n \"1.) verbal rejection\\r\\n\" + \r\n \"2.) extermination\\r\\n\" + \r\n \"3.) avoidance\\r\\n\" + \r\n \"4.) self agreement\\r\\n\");\r\n break;\r\n case 20: System.out.println(\"What part of the brain is still developing in adolescents?\\r\\n\" + \r\n \"1.) brain stem\\r\\n\" + \r\n \"2.) pons\\r\\n\" + \r\n \"3.) prefrontal cortex\\r\\n\" + \r\n \"4.) occipital\\r\\n\");\r\n break;\r\n }\r\n\r\n return questionNumber;\r\n }", "public QuestionPanel (int surveyId)\n {\n this(surveyId, -1);\n }", "public void customerInquiry(short w, short d, int c)\n throws SQLException\n {\n \n PreparedStatement customerInquiry = prepareStatement(\n \"SELECT C_BALANCE, C_FIRST, C_MIDDLE, C_LAST, \" +\n \"C_STREET_1, C_STREET_2, C_CITY, C_STATE, C_ZIP, \" +\n \"C_PHONE \" +\n \"FROM CUSTOMER WHERE C_W_ID = ? AND C_D_ID = ? AND C_ID = ?\");\n \n customerInquiry.setShort(1, w);\n customerInquiry.setShort(2, d);\n customerInquiry.setInt(3, c);\n ResultSet rs = customerInquiry.executeQuery();\n rs.next();\n \n customer.clear();\n customer.setBalance(rs.getString(\"C_BALANCE\"));\n customer.setFirst(rs.getString(\"C_FIRST\"));\n customer.setMiddle(rs.getString(\"C_MIDDLE\"));\n customer.setLast(rs.getString(\"C_LAST\"));\n \n customer.setAddress(getAddress(address, rs, \"C_STREET_1\"));\n \n customer.setPhone(rs.getString(\"C_PHONE\"));\n \n reset(customerInquiry);\n conn.commit();\n }", "public void setQuestion(){\n txt_question.setText(arrayList.get(quesAttempted).getQuestion());\n txt_optionA.setText(arrayList.get(quesAttempted).getOptionA());\n txt_optionB.setText(arrayList.get(quesAttempted).getOptionB());\n txt_optionC.setText(arrayList.get(quesAttempted).getOptionC());\n txt_optionD.setText(arrayList.get(quesAttempted).getOptionD());\n txt_que_count.setText(\"Que: \"+(quesAttempted+1)+\"/\"+totalQues);\n txt_score.setText(\"Score: \"+setScore);\n }", "public static void changeQuestion(int qid, String username) {\n\t\t\tboolean flag = false;\n\t\t\tString a2 = null;\n \t\tint d = 0;\n\t\t\tdo {\n\t\t\t\ttry {\n\t\t\t\t\tif ((qid <= 12) || (qid == 14)) {\n\t\t\t\t\t\ta2 = JOptionPane.showInputDialog(null, qid + \" Update your answer\", \"QUESTIONNAIRE\", JOptionPane.PLAIN_MESSAGE);\n \t\t\t\tflag = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\td = JOptionPane.showConfirmDialog(null, qid + \" Update your answer\", \"QUESTIONNAIRE\", JOptionPane.YES_NO_OPTION,JOptionPane.PLAIN_MESSAGE);\n \t\t\t\ta2 = String.valueOf(d);\n \t\t\tflag = true;\n \t\t\t} \n \t\t\tif (a2.equals(null) || (d == -1)) {\n \t\t\t\tthrow new NullPointerException();\n \t\t\t}\n \t\t} catch (NullPointerException e1) {\n \t\t\tJOptionPane.showMessageDialog(null, \"Please insert your answer\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n \t\t\tflag = false;\n \t\t}\n \t\t}while (flag == false);\n\t\t\tif (checkQuestion(qid, a2) == false) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"We regret to inform you that you are no longer compatible as a blood donor.\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\tSystem.exit(0);\n\t\t\t} else {\n\t\t\t\tupdateTableAnswers(qid, username, a2);\n\t\t\t}\n\t\t\t\n\t\t\treturn;\t\n\t\t}", "public void askCourseDetails() {\n\t\t\n\t\tString courseCode, courseName, facultyName;\n\t\tint courseVacancy = 10;\n\t\n\t\t\n\t\tSystem.out.println(\"-------The current faculties are-------\");\n\t\tfacultyNameList = acadCtrl.getFacultyNameList();\n\t\tfor(String fName : facultyNameList) {\n\t\t\tSystem.out.println(fName);\n\t\t}\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Enter faculty name: \");\n\t\t\tfacultyName = sc.nextLine().toUpperCase();\n\t\t\t\n\t\t\t//check if input data of faculty is correct\n\t\t\tif(checkFacName(facultyName)) {\n\t\t\t\tfacultyNameList.add(facultyName);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse System.out.println(\"Wrong faculty Name\");\n\t\t}\n\t\t\n\t\t\n\t\tcourseCodeList = acadCtrl.getCourseCodeList(facultyName);\n\t\tSystem.out.println(\"The current course codes are \");\n\t\tfor(String code : courseCodeList) {\n\t\t\tSystem.out.println(code);\n\t\t}\n\t\tSystem.out.println(\"Enter course code: \");\n\t\tcourseCode = sc.nextLine().toUpperCase();\n\t\t\n\t\t\n\t\tif(checkCourseCode(courseCode)) {\n\t\t\tSystem.out.println(\"Course code already exists. \\n Please try again\");\n\t\t\tcourseCode = sc.nextLine().toUpperCase();\n\t\t\tcourseCodeList.add(courseCode);\n\t\t}else courseCodeList.add(courseCode);\n\t\t\n\t\t\n\t\tcourseNameList = acadCtrl.getCourseNameList(facultyName);\n\t\tSystem.out.println(\"The current course names are \");\n\t\tfor(String name : courseNameList) {\n\t\t\tSystem.out.println(name);\n\t\t}\n\t\tSystem.out.println(\"Enter course name: \");\n\t\t\n\t\tcourseName = sc.nextLine().toUpperCase();\n\t\t\n\t\tif(checkCourseName(courseName)) {\n\t\t\tSystem.out.println(\"Course name already exists. \\n Please try again\");\n\t\t}else courseNameList.add(courseName);\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Choose your available professors\");\n\t\tprofNameList = acadCtrl.getProfessorNameList(facultyName);\n\t\tfor(String p : profNameList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\tSystem.out.println(\"Enter the professor's staff name\"); //input validation\n\t\tString ProfName = sc.nextLine();\n\t\t\n\t\tif(!CheckProfName(ProfName)) {\n\t\t\tSystem.out.println(\"Enter correct professor's name\");\n\t\t\tProfName = sc.nextLine();\n\t\t}\n\t\t\n\t\t// want to add if he's the coordinator?\n\t\t// input who is the coordinator\n\t\tSystem.out.println(\"Is he the course coordinator? Y for Yes / N for No\");\n\t\tchar yn = sc.nextLine().charAt(0);\n\n\t\tif(yn == 'Y' || yn == 'y') {\n\t\t\t// set ProfName to course coord\n\t\t\tacadCtrl.getProfessor(facultyName, ProfName).setCourseCoordinator(true);\n\t\t\tcourseCoordList.add(ProfName);\n\t\t}\n\t\telse if (yn == 'N' || yn == 'n') {\n\t\t\tSystem.out.println(\"Who is the course coordinator for the course?\");\n\t\t\tSystem.out.println();\n\t\t\tfor(String p : profNameList) {\n\t\t\t\tSystem.out.println(p);\n\t\t\t}\n\t\t\t// for course coord\n\t\t\tSystem.out.println(\"Enter the professor's staff name\"); //input validation\n\t\t\tString profNameCoord = sc.nextLine();\n\t\t\t\n\t\t\tif(!CheckProfName(profNameCoord)) {\n\t\t\t\tSystem.out.println(\"Enter correct professor's name\");\n\t\t\t\tprofNameCoord = sc.nextLine();\n\t\t\t\tacadCtrl.getProfessor(facultyName, profNameCoord).setCourseCoordinator(true);\n\t\t\t\tcourseCoordList.add(profNameCoord);\n\t\t\t}\n\t\t\tacadCtrl.getProfessor(facultyName, profNameCoord).setCourseCoordinator(true);\n\t\t\tcourseCoordList.add(profNameCoord);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Enter course Vacancy\");\n\t\tif(sc.hasNextInt()) {\n\t\t\tcourseVacancy = sc.nextInt();\n\t\t}else System.out.println(\"Enter only integers\");\n\t\t\n\t\tString dummy = sc.nextLine(); // dummy scan changes from sc int to string\n\t\t\n\t\tSystem.out.println(\"Lectures only? Y for Yes / N for No\");\n\t\tchar input = sc.nextLine().charAt(0);\n\n\t\tif(input == 'Y' || input == 'y') {\n\t\t\t// creation of course object, by default only exam, only 1 lecture\n\t\t\tacadCtrl.passCourseDetails(courseCode, courseName, facultyName, courseVacancy, ProfName); \n\t\t}\n\t\telse if (input == 'N' || input == 'n') {\n\t\t\t\n\t\t\tint tutVacancy = 0;\n\t\t\t\n\t\t\tSystem.out.println(\"Is there tutorial? Y for Yes / N for No\");\n\t\t\tinput = sc.nextLine().charAt(0);\n\t\t\t\n\t\t\tif (input == 'Y'|| input == 'y') {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"What is the class vacancy for each group?\");\t\n\t\t\t\tif(sc.hasNextInt()) {\n\t\t\t\t\ttutVacancy = sc.nextInt(); // total tutorial vacancy > lecture size OK!\n\t\t\t\t}\n\t\t\t\ttutGroups = addTutorial(tutVacancy);\n\t\t\t\n\t\t\t\tdummy = sc.nextLine();\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Is there Lab? Y for Yes / N for No\");\n\t\t\t\tinput = sc.nextLine().charAt(0);\n\t\t\t\t\n\t\t\t\tif(input == 'Y'|| input == 'y') {\n\t\t\t\t\tSystem.out.println(\"Lab group is same as Lecture group\");\n\t\t\t\t\t// creation of course object, with tutorials and lab group\n\t\t\t\t\tacadCtrl.passCourseDetailsWithTutorial(courseCode, courseName, facultyName, courseVacancy, ProfName, tutGroups, true, tutVacancy);\n\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(input == 'N'|| input == 'n') {\n\t\t\t\t\t// creation of course object, with tutorials only\n\t\t\t\t\tacadCtrl.passCourseDetailsWithTutorial(courseCode, courseName, facultyName, courseVacancy, ProfName, tutGroups, false, tutVacancy);\n\t\t\t\t}\n\t\t\t\telse System.out.println(\"Please Enter Y or N only\");\n\t\t\t}\n\t\t}else System.out.println(\"Please Enter Y or N only\");\n\t\t\n\t\t//done and print\n\t\t\n\t\tSystem.out.println(\"Course added to System!\");\n\t\tSystem.out.println(\"The current Lists of courses in \"+ facultyName + \" is: \");\n\t\tprintCourses();\n\t\tSystem.out.println(\"To add sub components into Course Work use function 6 \");\n\t\tSystem.out.println();\n\t}", "public void createMatching() {\n int numChoices = 0;\n Question q = new Matching(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your Matching question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n while (numChoices == 0) {\n this.o.setDisplay(\"Enter the number of choices for your question:\\n\");\n this.o.getDisplay();\n\n try {\n numChoices = Integer.parseInt(this.in.getUserInput());\n } catch (NumberFormatException e) {\n numChoices = 0;\n }\n }\n\n for (int i=0; i<numChoices;i++) {\n this.o.setDisplay(\"Enter choice#\" + (i+1) + \"\\n\");\n this.o.getDisplay();\n\n ((Matching) q).addChoicesToMatch(this.in.getUserInput());\n }\n\n for (int i=0; i<numChoices;i++) {\n this.o.setDisplay(\"Answer#\" + (i+1) + \" (enter any answer for one of the choices)\\n\");\n this.o.getDisplay();\n\n ((Matching) q).addChoice(this.in.getUserInput());\n }\n\n q.setMaxResponses(numChoices);\n\n if (isTest) {\n int choiceNum = 0;\n RCA ca = new RCA(this.in,this.o);\n Test t = (Test)this.survey;\n ArrayList<Integer> ans = new ArrayList<Integer>();\n\n for (int j=0; j < q.getMaxResponses(); j++){\n\n while (choiceNum == 0) {\n this.o.setDisplay(\"Enter answer# for choice#\" + (j+1) + \": \\n\");\n this.o.getDisplay();\n\n try {\n choiceNum = Integer.parseInt(this.in.getUserInput());\n\n if (choiceNum > numChoices || choiceNum < 1) {\n choiceNum = 0;\n } else {\n if (ans.contains(choiceNum)) {\n this.o.setDisplay(\"Answer already used\\n\");\n this.o.getDisplay();\n choiceNum = 0;\n } else {\n ans.add(choiceNum);\n ca.addResponse(Integer.toString(choiceNum));\n }\n }\n\n } catch (NumberFormatException e) {\n choiceNum = 0;\n }\n }\n choiceNum = 0;\n }\n t.addAnswer(ca);\n }\n this.survey.addQuestion(q);\n }", "private void getAllQuestion(){\r\n\r\n if(ques.getText().toString().equals(\"\")||opt1.getText().toString().equals(\"\")||opt2.getText().toString().equals(\"\")||\r\n opt3.getText().toString().equals(\"\")||correct.getText().toString().equals(\"\")){\r\n Toast.makeText(getBaseContext(), \"Please fill all fields\", Toast.LENGTH_LONG).show();\r\n }\r\n else{\r\n\r\n int c = Integer.parseInt((correct.getText().toString()));\r\n if (c > 3) {\r\n Toast.makeText(getBaseContext(), \"Invalid Correct answer\", Toast.LENGTH_LONG).show();\r\n } else {\r\n\r\n setQuestions();\r\n }\r\n finishQuiz();\r\n }\r\n }", "Question getFirstQuestion();", "public T caseSurvey(Survey object) {\n\t\treturn null;\n\t}", "public static void sitExam(int stuId) {\n ExamService examService = new ExamServiceImpl();\n Scanner sc = new Scanner(System.in);\n\n int testId;\n while (true) {\n System.out.print(\"Please input the test ID: \");\n try {\n String input = sc.nextLine().trim();\n if (input.length() == 6) {\n testId = Integer.parseInt(input);\n break;\n }\n } catch (NumberFormatException ignored) {\n }\n System.out.println(\"The id should be 6 digits!\");\n }\n\n List<Question> allQuestion = examService.sitExam(stuId, testId);\n LoggerUtil.addLog(\"[Student \" + stuId + \"] take exam \" + testId);\n\n for (Question q : allQuestion) {\n if (isTimeUp(testId) == true) {\n System.out.println(\"Exam ended, please wait us upload your answer...\");\n AutoJudgeService autoJudgeService = new AutoJudgeServiceImpl();\n autoJudgeService.judgeAnExam(testId);\n break;\n }\n System.out.printf(\"QNo:%d Type:%s, Complsory:%s Score:%d \\n\", q.getqNo(), q.getType(), q.getCompulsory(),\n q.getScore());\n System.out.println(\"****************************************\");\n System.out.println(q.getqDescri());\n System.out.println(\"****************************************\");\n\n String answer;\n while (true) {\n System.out.printf(\"Input your answer(in one line): \");\n answer = sc.nextLine();\n\n boolean nextQustion = false;\n while (true) {\n System.out.println(\"Next question?(Y/N)\");\n String op = sc.nextLine().trim().toUpperCase();\n if (op.equals(\"Y\"))\n nextQustion = true;\n else if (!op.equals(\"N\"))\n continue;\n break;\n }\n if (nextQustion) {\n break;\n }\n }\n examService.answerAnQuestion(q, stuId, answer);\n }\n\n while (true) {\n System.out.println(\"You have answered all question, submit now?(Y/N)\");\n String op = sc.nextLine().trim().toUpperCase();\n if (op.equals(\"Y\")) {\n AutoJudgeService autoJudgeService = new AutoJudgeServiceImpl();\n autoJudgeService.judgeAnExam(testId);\n break;\n }\n }\n }", "int getNumberOfServeyQuestions(Survey survey);", "QuestionPick addPickDetail(Question question);", "public Model() {\n\t\t\n\t\t\n\t\t\n\t\t\n\tquestionMap = new HashMap<String, Question>();\n\t\n\tQuestion q1 = new Question(\"Climate\");\n\tq1.setContent(\"Do you prefer hot Climate to Cold Climate?\");\n\tquestionMap.put(q1.getAbbrev(), q1);\n\t\n\tQuestion q2 = new Question(\"Cost of Living\");\n\tq2.setContent(\"Do you prefer high cost of living areas?\");\n\tquestionMap.put(q2.getAbbrev(), q2);\n\t\n\tQuestion q3 = new Question(\"Population Density\");\n\tq3.setContent(\"Do you prefer high population to low population density areas?\");\n\tquestionMap.put(q3.getAbbrev(), q3);\n\t\n\tQuestion q4 = new Question(\"Job Opportunity\");\n\tq4.setContent(\"Do you prefer higher Job Opportunity areas?\");\n\tquestionMap.put(q4.getAbbrev(), q4);\n\t\n\tQuestion q5 = new Question(\"Crime Rates\");\n\tq5.setContent(\"Do you prefer high crime rate areas?\");\n\tquestionMap.put(q5.getAbbrev(), q5);\n\n\t\n\t}", "public void populateDiseaseTable() {\r\n DefaultTableModel dtm = (DefaultTableModel) tblDisease.getModel();\r\n dtm.setRowCount(0);\r\n for (Conditions disease : system.getConditionsList().getConditionList()) {\r\n Object[] row = new Object[2];\r\n row[0] = disease;\r\n row[1] = disease.getDiseaseId();\r\n dtm.addRow(row);\r\n }\r\n }", "List<SurveyQuestion> getSurveyQuestionsByQuestions(List<Question> questions);", "private void generateNewQuestion() {\n GameManager gameManager = new GameManager();\n long previousQuestionId = -1;\n try {\n previousQuestionId = mGameModel.getQuestion().getId();\n } catch (NullPointerException e) {\n previousQuestionId = -1;\n }\n mGameModel.setQuestion(gameManager.generateRandomQuestion(previousQuestionId));\n mGameModel.getGameMaster().setDidPlayerAnswer(false);\n mGameModel.getGameMaster().setPlayerAnswerCorrect(false);\n mGameModel.getGameSlave().setDidPlayerAnswer(false);\n mGameModel.getGameSlave().setPlayerAnswerCorrect(false);\n LOGD(TAG, \"New question generated\");\n }", "public void setQuestions(){\r\n question.setTestname(test.getText().toString());\r\n question.setQuestion(ques.getText().toString());\r\n question.setOption1(opt1.getText().toString());\r\n question.setOption2(opt2.getText().toString());\r\n question.setOption3(opt3.getText().toString());\r\n int num = Integer.parseInt(correct.getText().toString());\r\n question.setAnswerNumber(num);\r\n long check = db.addToDb(question);\r\n if(check == -1){\r\n Toast.makeText(getBaseContext(), \"Question already exists\", Toast.LENGTH_LONG).show();\r\n }else{\r\n Toast.makeText(getBaseContext(), \"Question added\", Toast.LENGTH_LONG).show();\r\n }\r\n }", "Question() {\n ques = opt1 = opt2 = opt3 = opt4 = null; // initializing to null\n }", "public Survey getSurveyQuestion(Long surveyId, Long userId);" ]
[ "0.5933194", "0.557708", "0.53741026", "0.5319083", "0.52898234", "0.52300566", "0.5224387", "0.5103519", "0.50966376", "0.5067829", "0.50266314", "0.4975435", "0.49476722", "0.4883367", "0.4873854", "0.48658246", "0.4859403", "0.4841917", "0.48366144", "0.4827136", "0.4825755", "0.48195094", "0.47948694", "0.4791267", "0.47521582", "0.47439522", "0.4727134", "0.47189304", "0.4696973", "0.46950582", "0.46935102", "0.46815917", "0.46767518", "0.4670938", "0.467023", "0.4664852", "0.46566537", "0.46495885", "0.46174017", "0.4615459", "0.46072692", "0.46038115", "0.46003392", "0.45962012", "0.4589052", "0.45865282", "0.45809573", "0.4580385", "0.45790726", "0.4574721", "0.45409685", "0.45263836", "0.45202824", "0.45198405", "0.4516151", "0.45106524", "0.45078415", "0.45023108", "0.44917202", "0.44908276", "0.4479651", "0.4469616", "0.44618642", "0.4460759", "0.4441841", "0.44347924", "0.44311345", "0.4427159", "0.44157124", "0.44142514", "0.44080326", "0.44075012", "0.44069165", "0.4406323", "0.43974444", "0.43895188", "0.43874288", "0.4376073", "0.4374848", "0.43635494", "0.43586108", "0.43392998", "0.43386835", "0.4337877", "0.43360394", "0.43358737", "0.43348226", "0.43342137", "0.43240234", "0.4309626", "0.43093142", "0.4309183", "0.43082356", "0.4302857", "0.43018734", "0.42977327", "0.42957306", "0.42935053", "0.42823464", "0.42808554" ]
0.70599765
0
Created by Butcheer on 20190325 14:01
public interface PetTypeService extends CrudService<PetType, Long> { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void mo51373a() {\n }", "public void mo38117a() {\n }", "@Override\n public void perish() {\n \n }", "public void mo4359a() {\n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo6081a() {\n }", "@Override\n public void func_104112_b() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public void gored() {\n\t\t\n\t}", "private void m50366E() {\n }", "private void poetries() {\n\n\t}", "private void kk12() {\n\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public void mo12628c() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void mo12930a() {\n }", "public void mo55254a() {\n }", "protected boolean func_70814_o() { return true; }", "protected void mo6255a() {\n }", "public void mo21877s() {\n }", "@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 anular() {\n\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void mo9848a() {\n }", "public void mo1531a() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void mo21878t() {\n }", "public void mo3376r() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "public void mo21779D() {\n }", "public abstract void mo70713b();", "public void mo115190b() {\n }", "public void mo21825b() {\n }", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "private void m50367F() {\n }", "public void mo21793R() {\n }", "public void skystonePos4() {\n }", "public void m23075a() {\n }", "private Rekenhulp()\n\t{\n\t}", "private void strin() {\n\n\t}", "public void mo21794S() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "public void mo21785J() {\n }", "public void skystonePos6() {\n }", "public void Tyre() {\n\t\t\r\n\t}", "public void method_4270() {}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "public void mo21791P() {\n }", "public abstract void mo56925d();", "public void mo3749d() {\n }", "private zza.zza()\n\t\t{\n\t\t}", "public void mo21783H() {\n }", "public Pitonyak_09_02() {\r\n }", "public void mo21795T() {\n }", "public void mo21782G() {\n }", "public final void mo91715d() {\n }", "private void init() {\n\n\t}", "public void mo23813b() {\n }", "public void mo21787L() {\n }", "public void mo97908d() {\n }", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "public void baocun() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\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\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void mo5382o() {\n }", "static void feladat9() {\n\t}" ]
[ "0.5899609", "0.58478045", "0.58200085", "0.58045256", "0.57485276", "0.5707595", "0.570565", "0.56945544", "0.56945544", "0.56874764", "0.56874764", "0.56874764", "0.56874764", "0.56874764", "0.56874764", "0.56874764", "0.56792814", "0.5670893", "0.5648833", "0.5609208", "0.5604521", "0.55951047", "0.5587118", "0.55854726", "0.5582253", "0.55694145", "0.5561215", "0.55431426", "0.55428404", "0.5532924", "0.5527555", "0.5512483", "0.5496037", "0.5493009", "0.5479864", "0.5477964", "0.5458302", "0.54476357", "0.54457664", "0.5438763", "0.54300416", "0.54146516", "0.540122", "0.53974473", "0.538064", "0.536893", "0.53584534", "0.5345856", "0.53371084", "0.53327036", "0.5332439", "0.53299034", "0.53286016", "0.5327153", "0.5326428", "0.5319012", "0.5316425", "0.52987874", "0.52940845", "0.5293073", "0.5291991", "0.5288797", "0.5288098", "0.5288098", "0.5288098", "0.5288098", "0.5288098", "0.52876484", "0.5285585", "0.52783686", "0.52737606", "0.5271904", "0.52686435", "0.5263552", "0.52567816", "0.52538025", "0.52523845", "0.5251214", "0.52486557", "0.52475905", "0.52474", "0.5243149", "0.52190024", "0.521755", "0.521551", "0.52127165", "0.52050334", "0.5201722", "0.5198429", "0.5195387", "0.51926136", "0.5190256", "0.5190256", "0.5190256", "0.51889396", "0.5188058", "0.51747894", "0.51747894", "0.5171962", "0.51663536", "0.5164456" ]
0.0
-1
TODO Autogenerated method stub
@Override public List<Supplies> findall() { return suppliesDao.findall(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public List<Supplies> findbyname(String name) { return suppliesDao.findbyname(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public List<Supplies> checkbythreed(Supplies supplies) { return suppliesDao.checkbythreed(supplies); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0.6080555", "0.6076938", "0.6041293", "0.6024541", "0.6019185", "0.5998426", "0.5967487", "0.5967487", "0.5964935", "0.59489644", "0.59404725", "0.5922823", "0.5908894", "0.5903041", "0.5893847", "0.5885641", "0.5883141", "0.586924", "0.5856793", "0.58503157", "0.58464456", "0.5823378", "0.5809384", "0.58089525", "0.58065355", "0.58065355", "0.5800514", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57896614", "0.5789486", "0.5786597", "0.5783299", "0.5783299", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5760369", "0.5758614", "0.5758614", "0.574912", "0.574912", "0.574912", "0.57482654", "0.5732775", "0.5732775", "0.5732775", "0.57207066", "0.57149917", "0.5714821", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57115865", "0.57045746", "0.5699", "0.5696016", "0.5687285", "0.5677473", "0.5673346", "0.56716853", "0.56688815", "0.5661065", "0.5657898", "0.5654782", "0.5654782", "0.5654782", "0.5654563", "0.56536144", "0.5652585", "0.5649566" ]
0.0
-1
executed such that system output responses can be tested
@Before public void setUpStreams() { System.setOut(new PrintStream(outContent)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void requestOutput();", "@Test\n public void systemOut()\n {\n String message = \"Testing 1, 2, 3\";\n System.out.print(message);\n assertTrue(SYSTEM_OUT_REDIRECT.toString().contains(message));\n }", "@Test\n\tpublic void testApp()\n\t{\n\t\tPrintStream outBkp = System.out;\n\t\tByteArrayOutputStream outBuf = new ByteArrayOutputStream ();\n\t\tSystem.setOut ( new PrintStream ( outBuf ) );\n\t\t\n\t\tApp.main ( \"a\", \"b\", \"c\" );\n\n\t\tSystem.setOut ( outBkp ); // restore the original output\n\t\t\n\t\tlog.debug ( \"CLI output:\\n{}\", outBuf.toString () );\n\t\tAssert.assertTrue ( \"Can't find CLI output!\", outBuf.toString ().contains ( \"a\\tb\\tc\" ) );\n\t\tassertEquals ( \"Bad exit code!\", 0, App.getExitCode () );\n\t}", "public void test_execute() throws Throwable {\r\n\t\t\r\n\t\tCLIService service = null;\r\n\t\t\r\n\t\t// Ping\r\n\t\ttry {\r\n\t\t\tservice = CLIServiceWrapper.getService();\r\n\t\t\tString response = service.tender(CLIServiceConstants.COMMAND_PING + \" \" + TEST_PING_ARG0);\r\n\t\t\tif ( CLIServiceTools.isResponseOkAndComplete(response) ) {\r\n\t\t\t\tPASS(TEST_PING);\r\n\t\t\t} else {\r\n\t\t\t\tFAIL(TEST_PING, \"Response not ok. response=\" + response);\t\t\t\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tABORT(TEST_PING,\"ping failed to exception:\" + e.getMessage());\r\n\t\t}\r\n\r\n\t\t// Process list - log and cli\r\n\t\ttry {\r\n\t\t\tString response = service.tender(CLIServiceConstants.COMMAND_PROCESSLIST);\r\n\t\t\tif ( (CLIServiceTools.isResponseOkAndComplete(response)) && (response.indexOf(TEST_PROCESSLIST_VALIDATION1) >= 0) &&\r\n\t\t\t\t (response.indexOf(TEST_PROCESSLIST_VALIDATION2) >= 0) && (response.indexOf(TEST_PROCESSLIST_VALIDATION3) >= 0) ) {\r\n\t\t\t\tPASS(TEST_PROCESSLIST);\r\n\t\t\t} else {\r\n\t\t\t\tFAIL(TEST_PROCESSLIST, \"Response not ok. See log for response.\");\t\t\t\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tABORT(TEST_PROCESSLIST,\"process list failed to exception:\" + e.getMessage());\r\n\t\t}\t\r\n\t\t\r\n\t\t// Process list - log only - the CLI output should not contain any validations, just the OK.\r\n\t\ttry {\r\n\t\t\tString response = service.tender(CLIServiceConstants.COMMAND_PROCESSLIST + \" =\" + CLIServiceConstants.COMMAND_PROCESSLIST_LOG_VALUE);\r\n\t\t\tif ( (CLIServiceTools.isResponseOkAndComplete(response)) && (response.indexOf(TEST_PROCESSLIST_VALIDATION1) < 0) &&\r\n\t\t\t (response.indexOf(TEST_PROCESSLIST_VALIDATION2) < 0) && (response.indexOf(TEST_PROCESSLIST_VALIDATION3) < 0) ) {\r\n\t\t\t\tPASS(TEST_PROCESSLIST_LOG);\r\n\t\t\t} else {\r\n\t\t\t\tFAIL(TEST_PROCESSLIST_LOG, \"Response not ok. See log for response.\");\t\t\t\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tABORT(TEST_PROCESSLIST_LOG,\"process list (log only) failed to exception:\" + e.getMessage());\r\n\t\t}\t\r\n\r\n\t}", "@Test\n\tpublic void test_001() {\n\t\tfinal String EXPECTED_RESPONSE = \"{\\\"hello\\\": \\\"world\\\"}\";\n\t\tJdProgramRequestParms.put(\"U$FUNZ\", new StringValue(\"URL\"));\n\t\tJdProgramRequestParms.put(\"U$METO\", new StringValue(\"HTTP\"));\n\t\tJdProgramRequestParms.put(\"U$SVARSK\", new StringValue(\"http://www.mocky.io/v2/5185415ba171ea3a00704eed\"));\n\n\t\tList<Value> responseParms = JdProgram.execute(javaSystemInterface, JdProgramRequestParms);\n\t\tassertTrue(responseParms.get(2).asString().getValue().equals(EXPECTED_RESPONSE));\n\t}", "@Test\n\tpublic void whenExecuteMainThenPrintToConsole() {\n\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\tSystem.setOut(new PrintStream(out));\n\t\tCalculate.main(null);\n\t\tassertThat(out.toString(), is(\"Hello World\\r\\n\"));\n\t}", "public void processOutput() {\n\n\t}", "public boolean processOutput();", "boolean hasSystemResponse();", "protected void finalizeSystemOut() {}", "public void setOutput(String output) { this.output = output; }", "@Before\n\tpublic void loadOutput() {\n\t\tSystem.setOut(new PrintStream(this.out));\n\t}", "@Test\n\tpublic void check() {\n\n\t\ttry {\n\t\t\tSystem.out.println(\"Unit Test Begins\");\n\t\t\t// Generate Random Log file\n\t\t\tUnitTestLogGenerator.generateRandomLogs();\n\t\t\t// Generate Cmd String\n\t\t\tString cmd = ClientClass.generateCommand(IpAddress, \"seth\", \"v\",\n\t\t\t\t\ttrue);\n\t\t\t// Run Local Grep;\n\t\t\tlocalGrep(cmd);\n\t\t\t// Connecting to Server\n\t\t\tConnectorService connectorService = new ConnectorService();\n\t\t\tconnectorService.connect(IpAddress, cmd);\n\t\t\tInputStream FirstFileStream = new FileInputStream(\n\t\t\t\t\t\"/tmp/localoutput_unitTest.txt\");\n\t\t\tInputStream SecondFileStream = new FileInputStream(\n\t\t\t\t\t\"/tmp/output_main.txt\");\n\t\t\tSystem.out.println(\"Comparing the two outputs...\");\n\t\t\tboolean result = fileComparison(FirstFileStream, SecondFileStream);\n\t\t\tAssert.assertTrue(result);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Ignore\n\t@Test\n\tpublic void test() throws IOException {\n\n\t\tClient.main(new String[] {\"localhost\", \"6700\"});\n\n\t\tSystem.out.println(\"free\");\n\t\tSystem.out.println(\"in\");\n\t\tSystem.out.println(\"in\");\n\t\tSystem.out.println(\"free\");\n\t\tSystem.out.println(\"out\");\n\t\tSystem.out.println(\"free\");\n\n\t}", "@Test\n\tpublic void addTaskOutput(){\n\t}", "@Test\n\tpublic void checkStatus() {\n\t\tclient.execute(\"1095C-16-111111\");\n\t}", "boolean hasOutput();", "public void test() {\n\t\t\r\n\t\tSystem.out.println(\"-->\" + CommonMethod.createCmdOfflineVersion10(\"jxsmarthome\"));\r\n\t\t\r\n\t}", "public String runTest( String input ){\n\t\tString response = null;\n\t\t// Deals with cases where this component reference is not wired\n\t\tif( reference1 != null ) {\n\t\t\tString response1 = reference1.operation1(input);\n\t\t\t\n\t\t\tresponse = testName + \" \" + input + \" \" + response1;\n\t\t} else {\n\t\t\tresponse = testName + \" \" + input + \" no invocation\";\n\t\t}\t// end if\n\t\t\n\t\treturn response;\n\t}", "@Test\n\tpublic void test_003() {\n\t\tJdProgramRequestParms.put(\"U$FUNZ\", new StringValue(\"URL\"));\n\t\tJdProgramRequestParms.put(\"U$METO\", new StringValue(\"HTTP\"));\n\t\tJdProgramRequestParms.put(\"U$SVARSK\", new StringValue(\"http://www.mocky.io/v2/5185415ba171ea3a00704eedxxx\"));\n\n\t\tJdProgramResponseParms = JdProgram.execute(javaSystemInterface, JdProgramRequestParms);\n\t\tassertTrue(JdProgramResponseParms.get(2).asString().getValue().startsWith(\"*ERROR\"));\n\t\tassertTrue(JdProgramResponseParms.get(2).asString().getValue().contains(\"HTTP response code: 500\"));\n\t}", "String getOutput();", "static void mainTest(PrintWriter out) throws Exception {\n\t}", "public static void sendTestMessage (PrintWriter out) {\r\n\t\tString pack = \"0|test\";\r\n\t\tout.println(pack);\r\n\t}", "public static void main(String[] args) throws IOException, UnexpectedResponseException {\n }", "private void sysout() {\nSystem.out.println(\"pandiya\");\n}", "java.lang.String getOutput();", "@Before\n public void setup(){\n output = new TestingOutputInterface();\n mLogic = new Logic(output);\n \n System.err.flush();\n System.out.flush();\n myOut = new ByteArrayOutputStream();\n myErr = new ByteArrayOutputStream();\n System.setOut(new PrintStream(myOut));\n System.setErr(new PrintStream(myErr));\n }", "@Test\n\tpublic void checkProjectOutput() throws IOException {\n\t\tcheckServerOutput(8080, \"/reviewsearch\", \"\", \"GET\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/reviewsearch\", \"\", \"PULL\", HTTPConstants.NOT_ALLOWED);\n\t\tcheckServerOutput(8080, \"/reviewsearch\", \"query=the\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/reviewsearch\", \"query=computer%20science\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/reviewsearchcurl\", \"query=computer%20science\", \"POST\", HTTPConstants.NOT_FOUND);\n\t\tcheckServerOutput(8080, \"/reviewsearch\", \"query=computer%20science&query=computer%20science\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/find\", \"\", \"GET\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/find\", \"\", \"PULL\", HTTPConstants.NOT_ALLOWED);\n\t\tcheckServerOutput(8080, \"/find\", \"asin=the\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/find\", \"asin=B00002243X\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/findcurl\", \"asin=B00002243X\", \"POST\", HTTPConstants.NOT_FOUND);\n\t\tcheckServerOutput(8080, \"/find\", \"asin=B00002243X&asin=B00002243X\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(9090, \"/slackbot\", \"\", \"GET\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(9090, \"/slackbot\", \"\", \"PULL\", HTTPConstants.NOT_ALLOWED);\n\t\tcheckServerOutput(9090, \"/slackbot\", \"message=hello\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(9090, \"/slackbot\", \"message=bye\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(9090, \"/slackbotds\", \"message=bye\", \"POST\", HTTPConstants.NOT_FOUND);\n\t\tcheckServerOutput(9090, \"/slackbot\", \"message=bye&message=bye\", \"POST\", HTTPConstants.OK_HEADER);\n\t}", "public void testOutput(String path) {\n\t\ttestOutput(path, false);\n\t}", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = new String[]{\"-i\", \"-p\", \"src/test/resources/problems_resp.xml\", \"src/test/resources/context.txt\"};\n PrintStream prev = System.out;\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n System.setOut(new PrintStream(bos));\n XpathGenerator.main(args);\n System.setOut(prev);\n System.out.println(bos.toString());\n assertTrue(bos.toString().startsWith(\"/fhir:Bundle[1]\"));\n }", "@Override\n\tpublic void printtest(String s)\n\t{\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Now executing the command \" + s + \"...\");\n\t\tSystem.out.println(\"The Results of this command are:\");\n\t\tif(!s.contentEquals(\"toString\")) System.out.println(toStringCursor());\n\t\telse System.out.println(toString());\n\t}", "@Test\n\tpublic void testMain() {\n\t\t// TODO: test output streams for various IO methods, emulating a user's\n\t\t// input - kinda like Joel did for CSSE2310\n\t\tAssert.fail();\n\t}", "private void execute(String cmd[])\n {\n /* Begin process */\n Process p;\n String cmdLine = \"\";\n int i;\n \n for ( i = 0 ; i < cmd.length; i++ ) {\n cmdLine += cmd[i];\n cmdLine += \" \";\n }\n System.out.println(\"Starting: \" + cmdLine);\n \n try {\n p = Runtime.getRuntime().exec(cmd);\n } catch ( IOException e ) {\n throw new RuntimeException(\"Test failed - exec got IO exception\");\n }\n \n /* Save process output in StringBuffers */\n output = new MyInputStream(\"Input Stream\", p.getInputStream());\n error = new MyInputStream(\"Error Stream\", p.getErrorStream());\n \n /* Wait for process to complete, and if exit code is non-zero we fail */\n try {\n int exitStatus;\n exitStatus = p.waitFor();\n if ( exitStatus != 0) {\n System.out.println(\"Exit code is \" + exitStatus);\n error.dump(System.out);\n output.dump(System.out);\n throw new RuntimeException(\"Test failed - \" +\n \"exit return code non-zero \" +\n \"(exitStatus==\" + exitStatus + \")\");\n }\n } catch ( InterruptedException e ) {\n throw new RuntimeException(\"Test failed - process interrupted\");\n }\n System.out.println(\"Completed: \" + cmdLine);\n }", "@Test\n\tpublic void testDisplay1() {\n\t\t\n\t\t\n\t\tSystem.setOut(new PrintStream(Actualout));\n\t\t\n\t\tcircularlist.display();\n\t\t\n\t\tassertEquals(\"List : Empty List.\\r\\n\", Actualout.toString());\n\t}", "@Override\n\t\t\t\tpublic void onResponse(String arg0) {\n\t\t\t\t\tSystem.out.println(arg0);\n\t\t\t\t\t\n\t\t\t\t}", "private void getAppResponse(String theuri, PrintWriter out) {\n String response = spring.executeService(theuri);\n String header = \"HTTP/1.1 200 OK\\r\\n\"\n + \"Content-Type: text/html\\r\\n\"\n + \"\\r\\n\";\n out.println(header + response);\n }", "String diagnosticsOutput();", "private void processMessage(String msg) {\n\t\t\tif (msg.equals(Message.TEST_SERVER)) {\n\t\t\t\tSystem.out.println(\"Server test passed. Testing client...\");\n\t\t\t\tpw.println(Message.TEST_CLIENT);\n\t\t\t}\n\t\t}", "public static\n void hookSystemOutputStreams() {\n out();\n err();\n }", "public TestOut getOutput() {\n\treturn(output);\n }", "@Test\n public void main() {\n // App.main(null);\n // assertEquals(\"Hello world\", outContent.toString());\n }", "private void _debugSystemOutAndErr() {\n try {\n File outF = new File(System.getProperty(\"user.home\") +\n System.getProperty(\"file.separator\") + \"out.txt\");\n FileWriter wo = new FileWriter(outF);\n final PrintWriter outWriter = new PrintWriter(wo);\n File errF = new File(System.getProperty(\"user.home\") +\n System.getProperty(\"file.separator\") + \"err.txt\");\n FileWriter we = new FileWriter(errF);\n final PrintWriter errWriter = new PrintWriter(we);\n System.setOut(new PrintStream(new edu.rice.cs.util.OutputStreamRedirector() {\n public void print(String s) {\n outWriter.print(s);\n outWriter.flush();\n }\n }));\n System.setErr(new PrintStream(new edu.rice.cs.util.OutputStreamRedirector() {\n public void print(String s) {\n errWriter.print(s);\n errWriter.flush();\n }\n }));\n }\n catch (IOException ioe) {}\n }", "@Test\n\tpublic void test_002() {\n\t\tJdProgramRequestParms.put(\"U$FUNZ\", new StringValue(\"URL\"));\n\t\tJdProgramRequestParms.put(\"U$METO\", new StringValue(\"HTTP\"));\n\t\tJdProgramRequestParms.put(\"U$SVARSK\", new StringValue(\"malformed_url\"));\n\n\t\tJdProgramResponseParms = JdProgram.execute(javaSystemInterface, JdProgramRequestParms);\n\t\tassertTrue(JdProgramResponseParms.get(2).asString().getValue().startsWith(\"*ERROR\"));\n\t\tassertTrue(JdProgramResponseParms.get(2).asString().getValue().contains(\"malformed_url\"));\n\t}", "public void printStatus();", "public static void stdout(){\n\t\tSystem.out.println(\"Buildings Found: \" + buildingsFound);\n\t\tSystem.out.println(\"Pages searched: \"+ pagesSearched);\n\t\tSystem.out.println(\"Time Taken: \" + (endTime - startTime) +\"ms\");\t\n\t}", "@Override\r\n\t\t\tpublic void execute(String content) {\n\t\t\t\tSystem.out.println(content);\r\n\t\t\t}", "@LargeTest\n public void testUsageIO() {\n TestAction ta = new TestAction(TestName.USAGE_IO);\n runTest(ta, TestName.USAGE_IO.name());\n }", "@Test(groups = \"Integration\")\n public void testSshExecCommands() throws Exception {\n OutputStream outStream = new ByteArrayOutputStream();\n String expectedName = Os.user();\n host.execCommands(MutableMap.of(\"out\", outStream), \"mysummary\", ImmutableList.of(\"whoami; exit\"));\n String outString = outStream.toString();\n \n assertTrue(outString.contains(expectedName), outString);\n }", "void createdOutput(TestResult tr, Section section, String outputName);", "public interface CLIResult {\n\n /**\n * Enumeration for the different types of streams to get output for,\n * including STDOUT and STDERR.\n */\n enum STREAM {\n STDOUT, STDERR;\n }\n\n /**\n * Get the output for the specified stream.\n * @param stream The {@link STREAM} to get output from.\n * @return A single String of the output.\n */\n String getOutput(STREAM stream);\n\n /**\n * Get standard output.\n * @return the standard output.\n */\n String getOutput();\n\n /**\n * Get the output for the specified stream split by lines.\n * @param stream The {@link STREAM} to get output from.\n * @return A List of Strings of output, one list item per line.\n */\n List<String> getOutputByLine(STREAM stream);\n\n /**\n * Get the exit value of the process that was run.\n * @return The exit value of the program that was run.\n */\n int exitValue();\n}", "public void setOutput(String output) {\n this.output = output;\n }", "private void runCommandAndVerifyOutput(CommandHandler commandHandler, String expectedOutput)\n throws InterruptedException {\n session = createDefaultSession(commandHandler);\n\n Thread thread = new Thread(session);\n thread.start();\n\n for (int i = 0; !commandHandled && i < 10; i++) {\n Thread.sleep(50L);\n }\n\n session.close();\n thread.join();\n\n assertEquals(\"commandHandled\", true, commandHandled);\n\n String output = outputStream.toString();\n LOG.info(\"output=[\" + output.trim() + \"]\");\n assertTrue(\"line ends with \\\\r\\\\n\",\n output.charAt(output.length() - 2) == '\\r' && output.charAt(output.length() - 1) == '\\n');\n assertTrue(\"output: expected [\" + expectedOutput + \"]\", output.indexOf(expectedOutput) != -1);\n }", "@Override\n\tpublic void run() {\n\t\tPrintWriter out;\n\t\ttry {\n\t\t\tout = new PrintWriter(s.getOutputStream());\n\t\t\tout.print(\"HTTP/1.1 200 Ok\\n\\r\"+ \n\"Server: nginx/1.8.0\\n\\r\"+\n\"Date: Mon, 07 Dec 2015 09:11:39 GMT\\n\\r\"+ \n\"Content-Type: text/html\\n\\r\"+\n\"Connection: close\\n\\r\\n\\r\"+\n\"<html>\"+ \n\"<head><title>Test ok</title></head>\"+\n\"<body bgcolor=\\\"white\\\"> \"+\n\"<center><h1>HELLO</h1></center>\"+ \n\"</body>\"+\n\"</html>\"); \n\t\t\tout.close();\n\t\t\ts.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\n\t\n\t\t\n\t}", "@Before\n public void changeOutStream() {\n PrintStream printStream = new PrintStream(outContent);\n System.setOut(printStream);\n }", "void completedOutput(TestResult tr, Section section, String outputName);", "@Test\n\tpublic void runSend(){\n\t\tstandard();\n\t}", "public void invoke() throws Exception, IOException {\n java.io.PrintWriter out = response.getWriter();\n out.println(\"Welcome to ping\");\n return;\n}", "final private static void usage () {\n\t\t usage_print () ;\n\t\t System.exit (0) ;\n }", "private static void printUsage() throws Exception {\n\t\tSystem.out.println(new ResourceGetter(\"uk/ac/cam/ch/wwmm/oscar3/resources/\").getString(\"usage.txt\"));\n\t}", "@Test\n public void localAction_stdoutIsReported() throws Exception {\n if (OS.getCurrent() == OS.WINDOWS) {\n return;\n }\n write(\n \"BUILD\",\n \"genrule(\",\n \" name = 'foo',\",\n \" srcs = [],\",\n \" outs = ['out/foo.txt'],\",\n \" cmd = 'echo my-output-message > $@',\",\n \")\",\n \"genrule(\",\n \" name = 'foobar',\",\n \" srcs = [':foo'],\",\n \" outs = ['out/foobar.txt'],\",\n \" cmd = 'cat $(location :foo) && touch $@',\",\n \" tags = ['no-remote'],\",\n \")\");\n RecordingOutErr outErr = new RecordingOutErr();\n this.outErr = outErr;\n\n buildTarget(\"//:foobar\");\n waitDownloads();\n\n assertOutputContains(outErr.outAsLatin1(), \"my-output-message\");\n }", "private static void printTest(boolean isValid, String description, String recieved, String expected) {\r\n\t\tSystem.out.println(String.format(\"Is Valid: %s%nDescription: %s%nRecieved: %s%nExpected: %s%n\", isValid, description, recieved, expected));\r\n\t}", "public void testExecCommand() throws Exception {\n PKey hostKey = PKey.readPrivateKeyFromStream(new FileInputStream(\n \"test/test_rsa.key\"), null);\n PKey publicHostKey = PKey.createFromBase64(hostKey.getBase64());\n mTS.addServerKey(hostKey);\n final FakeServer server = new FakeServer();\n\n final Event sync = new Event();\n new Thread(new Runnable() {\n public void run() {\n try {\n mTS.start(server, 15000);\n sync.set();\n } catch (IOException x) {}\n }\n }).start();\n\n mTC.start(publicHostKey, 15000);\n mTC.authPassword(\"slowdive\", \"pygmalion\", 15000);\n\n sync.waitFor(5000);\n assertTrue(sync.isSet());\n assertTrue(mTS.isActive());\n\n Channel chan = mTC.openSession(5000);\n Channel schan = mTS.accept(5000);\n try {\n chan.execCommand(\"no\", 5000);\n fail(\"expected exception\");\n } catch (IOException x) {\n // pass\n }\n chan.close();\n schan.close();\n\n chan = mTC.openSession(5000);\n chan.execCommand(\"yes\", 5000);\n schan = mTS.accept(5000);\n\n schan.getOutputStream().write(\"Hello there.\\n\".getBytes());\n schan.getStderrOutputStream().write(\"This is on stderr.\\n\".getBytes());\n schan.close();\n\n BufferedReader r = new BufferedReader(new InputStreamReader(\n chan.getInputStream()));\n assertEquals(\"Hello there.\", r.readLine());\n assertEquals(null, r.readLine());\n r = new BufferedReader(new InputStreamReader(\n chan.getStderrInputStream()));\n assertEquals(\"This is on stderr.\", r.readLine());\n assertEquals(null, r.readLine());\n chan.close();\n\n // now try it with combined stdout/stderr\n chan = mTC.openSession(5000);\n chan.execCommand(\"yes\", 5000);\n schan = mTS.accept(5000);\n schan.getOutputStream().write(\"Hello there\\n\".getBytes());\n schan.getStderrOutputStream().write(\"This is on stderr.\\n\".getBytes());\n schan.close();\n\n chan.setCombineStderr(true);\n r = new BufferedReader(new InputStreamReader(chan.getInputStream()));\n assertEquals(\"Hello there\", r.readLine());\n assertEquals(\"This is on stderr.\", r.readLine());\n assertEquals(null, r.readLine());\n chan.close();\n }", "@Test\n\tpublic void testHelpOption()\n\t{\n\t\tPrintStream outBkp = System.out;\n\t\tByteArrayOutputStream outBuf = new ByteArrayOutputStream ();\n\t\tSystem.setOut ( new PrintStream ( outBuf ) );\n\n\t\tApp.main ( \"--help\" );\n\t\t\n\t\tSystem.setOut ( outBkp ); // restore the original output\n\n\t\tlog.debug ( \"CLI output:\\n{}\", outBuf.toString () );\n\t\tassertTrue ( \"Can't find CLI output!\", outBuf.toString ().contains ( \"*** Command Line Example ***\" ) );\n\t\tassertEquals ( \"Bad exit code!\", 1, App.getExitCode () );\n\t}", "static int printUsage() {\n\t System.out.println(\"netflix1Driver [-m <maps>] [-r <reduces>] <input> <output>\");\n\t ToolRunner.printGenericCommandUsage(System.out);\n\t return -1;\n\t }", "private Output() {}", "public interface RunOutput {\n /**\n * The actual results of the test run.\n * @return actual results\n */\n ResultSummary getActualResultSummary();\n\n /**\n * The results of the test run, modified to account for {@link org.concordion.api.ImplementationStatus}.\n * @return modified results\n */\n ResultSummary getModifiedResultSummary();\n}", "@Before\n public void newHTTPTest() throws IOException {\n code = callHandlerResponse(\"\", \"POST\");\n }", "@After\n public void tearDown(){\n final String standardOutput = myOut.toString();\n final String standardError = myErr.toString();\n assertEquals(\"You used 'System.out' in your assignment, This is not allowed.\",true, standardOutput.length() == 0);\n assertEquals(\"You used 'System.err' in your assignment, This is not allowed.\",true, standardError.length() == 0);\n System.err.flush();\n System.out.flush();\n System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));\n System.setErr(new PrintStream(new FileOutputStream(FileDescriptor.err)));\n }", "@Test\n public void execute_validParameters_success() throws CommandException {\n System.setOut(modelPrintStream);\n new ViewParticipantCommand(this.participantToView.getId()).execute(modelOneParticipant);\n String output = modelOut.toString();\n // Configure correct output\n String expectedOutput = new StringBuilder()\n .append(String.format(\"Viewing %s%s\", this.participantToView.getName(), NEW_LINE))\n .append(String.format(\"\\t%s%s\", this.participantToView.toString(), NEW_LINE))\n .toString();\n // Test and reset OutputStream\n assertEquals(expectedOutput, output);\n modelOut.reset();\n }", "private void consoleOutput(String textOutput){\r\n\t\tSystem.out.println(textOutput);\r\n\t}", "public static void setup() {\n\t\toutputs.add(new Console.stdout());\n\t}", "private String getResponse(String input) {\n try {\n CommandResult result = logicManager.execute(input);\n if (result.isExit()) {\n handleExit();\n }\n return result.getFeedbackToUser();\n } catch (CommandException | ParserException e) {\n return e.getMessage();\n }\n }", "static final void flushSystemOut()\n {\n PrintStream out = sysOut;\n if (out != null)\n {\n try\n {\n out.flush();\n }\n catch (Error e) {}\n catch (RuntimeException e) {}\n }\n }", "private static void printUsage() {\n\t\tSystem.out.println(errorHeader + \"Incorrect parameters\\nUsage :\"\n\t\t\t\t+ \"\\njava DaemonImpl <server>\\n With server = address of the server\"\n\t\t\t\t+ \" the DaemonImpl is executed on\");\n\t}", "@Test\n public void dynamicExecution_stdoutIsReported() throws Exception {\n if (OS.getCurrent() == OS.WINDOWS) {\n return;\n }\n addOptions(\"--internal_spawn_scheduler\");\n addOptions(\"--strategy=Genrule=dynamic\");\n addOptions(\"--experimental_local_execution_delay=9999999\");\n write(\n \"BUILD\",\n \"genrule(\",\n \" name = 'foo',\",\n \" srcs = [],\",\n \" outs = ['out/foo.txt'],\",\n \" cmd = 'echo my-output-message > $@',\",\n \" tags = ['no-local'],\",\n \")\",\n \"genrule(\",\n \" name = 'foobar',\",\n \" srcs = [':foo'],\",\n \" outs = ['out/foobar.txt'],\",\n \" cmd = 'cat $(location :foo) && touch $@',\",\n \")\");\n RecordingOutErr outErr = new RecordingOutErr();\n this.outErr = outErr;\n\n buildTarget(\"//:foobar\");\n waitDownloads();\n\n assertOutputContains(outErr.outAsLatin1(), \"my-output-message\");\n }", "private void testCommand(String cmdName, Map<String, String> kwargs, InputStream inputStream,\n String authInfo,\n Map<String, String> expectedHeaders, int expectedStatusCode,\n Field... fields) throws IOException, InterruptedException {\n ZooKeeperServer zks = serverFactory.getZooKeeperServer();\n final CommandResponse commandResponse = inputStream == null\n ? Commands.runGetCommand(cmdName, zks, kwargs, authInfo, null) : Commands.runPostCommand(cmdName, zks, inputStream, authInfo, null);\n assertNotNull(commandResponse);\n assertEquals(expectedStatusCode, commandResponse.getStatusCode());\n try (final InputStream responseStream = commandResponse.getInputStream()) {\n if (Boolean.parseBoolean(kwargs.getOrDefault(REQUEST_QUERY_PARAM_STREAMING, \"false\"))) {\n assertNotNull(responseStream, \"InputStream in the response of command \" + cmdName + \" should not be null\");\n } else {\n Map<String, Object> result = commandResponse.toMap();\n assertTrue(result.containsKey(\"command\"));\n // This is only true because we're setting cmdName to the primary name\n assertEquals(cmdName, result.remove(\"command\"));\n assertTrue(result.containsKey(\"error\"));\n assertNull(result.remove(\"error\"), \"error: \" + result.get(\"error\"));\n\n for (Field field : fields) {\n String k = field.key;\n assertTrue(result.containsKey(k),\n \"Result from command \" + cmdName + \" missing field \\\"\" + k + \"\\\"\" + \"\\n\" + result);\n Class<?> t = field.type;\n Object v = result.remove(k);\n assertTrue(t.isAssignableFrom(v.getClass()),\n \"\\\"\" + k + \"\\\" field from command \" + cmdName\n + \" should be of type \" + t + \", is actually of type \" + v.getClass());\n }\n\n assertTrue(result.isEmpty(), \"Result from command \" + cmdName + \" contains extra fields: \" + result);\n }\n }\n assertEquals(expectedHeaders, commandResponse.getHeaders());\n }", "@Test\n public void printResponse(){\n when().get(\"http:://34.223.219.142:1212/ords/hr/countries\")\n .body().prettyPrint();\n\n }", "@Test\n public void Day5AExample1() {\n intCodeProcessorService = new IntCodeProcessorService(\"data/day05/example1.txt\");\n intCodeProcessorService.setCpuInputValue(555L);\n intCodeProcessorService.runToCompletion();\n\n long result = intCodeProcessorService.getProgramOutput();\n Assert.assertEquals(555L, result);\n }", "@Test\n public void execute_modelWithSameParticipant_sameOutput() throws CommandException {\n System.setOut(modelPrintStream);\n new ViewParticipantCommand(this.participantToView.getId()).execute(modelOneParticipant);\n String output1 = modelOut.toString();\n // Collect console output of ViewParticipantCommand of expectedOneParticipant\n System.setOut(expectedPrintStream);\n new ViewParticipantCommand(this.participantToView.getId()).execute(expectedOneParticipant);\n String output2 = expectedOut.toString();\n // Test and reset OutputStreams\n assertEquals(output1, output2);\n modelOut.reset();\n expectedOut.reset();\n }", "private void getStatus() {\n\t\t\n\t}", "public void setOutput(String output) {\r\n\t\tthis.output = output;\r\n\t}", "public abstract boolean getOutput();", "protected static void printUsage() {\n\t}", "private static void sample1() {\n\t\tIComputer computer = new Computer();\n\t\tcomputer.setProgram(\n\t\t\t(byte) 0x70,\n\t\t\t(byte) 0x71,\n\t\t\t(byte) 0xc0,\n\t\t\t(byte) 0xc1,\n\t\t\t(byte) 0x70,\n\t\t\t(byte) 0xc0,\n\t\t\t(byte) 0xff);\n\t\tTestContext context = new TestContext(\n\t\t (byte) 0xa1, (byte) 0x9b, (byte) 0x3c);\n\t\tcomputer.run(context);\n\t\tSystem.out.println(context.outputToString());\n\t}", "private static void simpleRun(String [] args){\n\t\tString applicationPath = convertApplication(args[2], null);\n\t\tboolean testHardware = args[0].equals(\"-testCGRAVerilog\");\n\t\t\n\t\t\n\t\tboolean synthesis = false;\n\t\tif(args[0].equals(\"-testCGRAVerilog\") || args[3].equals(\"true\")){\n\t\t\tsynthesis = true;\n\t\t} else if (args[3].equals(\"false\")){\n\t\t\tsynthesis = false;\n\t\t} else{\n\t\t\tSystem.out.println(\"Synthesis parameter not set correctly: \" + args[3]+ \"\");\n\t\t\tSystem.out.println(\"Valid values are \\\"true\\\" and \\\"false\\\"\");\n\t\t\tSystem.out.println(\"Aborting...\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tConfMan configManager = new ConfMan(args[1], applicationPath, synthesis);\n\t\t\n\t\tTrace simpleRunTrace = new Trace(System.out, System.in, \"\", \"\");\n\t\tif(configManager.getTraceActivation(\"config\")){\n\t\t\tsimpleRunTrace.setPrefix(\"config\");\n\t\t\tconfigManager.printConfig(simpleRunTrace);\n\t\t}\n\n\t\tDecimalFormatSymbols symbols = new DecimalFormatSymbols();\n\t\tsymbols.setGroupingSeparator(',');\n\t\tsymbols.setDecimalSeparator('.');\n\t\tDecimalFormat formater = new DecimalFormat(\"#.000\", symbols);\n\t\t\n\t\tAmidarSimulationResult results = run(configManager, null, testHardware);\n\t\t\n\t\tif(configManager.getTraceActivation(\"results\")){\n\t\t\tsimpleRunTrace.setPrefix(\"results\");\n\t\t\tsimpleRunTrace.printTableHeader(\"Simulated \"+applicationPath+\" - Synthesis \"+(configManager.getSynthesis()?\"ON\":\"OFF\"));\n\t\t\tsimpleRunTrace.println(\"Ticks: \"+results.getTicks());\n\t\t\tsimpleRunTrace.println(\"Bytecodes: \"+results.getByteCodes());\n\t\t\tsimpleRunTrace.println(\"Energy consumption: \"+formater.format(results.getEnergy()));\n\t\t\tsimpleRunTrace.println(\"Execution Time: \"+results.getExecutionDuration()+\" ms\");\n\t\t\tsimpleRunTrace.printTableHeader(\"Loop Profiling\");\n\t\t\tresults.getProfiler().reportProfile(simpleRunTrace);\n\t\t\tsimpleRunTrace.printTableHeader(\"Kernel Profiling\");\n\t\t\tresults.getKernelProfiler().reportProfile(simpleRunTrace, results.getTicks());\n\t\t}\n\t\t\n\t\tif(testHardware){\n\t\t\tsimpleRunTrace.setPrefix(\"CGRA verilog test\");\n\t\t\tsimpleRunTrace.printTableHeader(\"Testing CGRA Verilog descrption\");\n\t\t\tAmidar core = results.getAmidarCore();\n\t\t\tCGRA myCGRA = (CGRA)core.functionalUnits[core.functionalUnits.length-1]; // CGRA is the last one\n\t\t\t\n\t\t VerilogGenerator gen = target.Processor.Instance.getGenerator();\n\t\t CgraModel model = myCGRA.getModel();\n\t\t model.finalizeCgra();\n\t\t simpleRunTrace.println(\"Generate Verilog...\");\n\t\t gen.printVerilogDescription(\"out\",model);\n\t\t TestbenchGeneratorAmidar tbgen = new TestbenchGeneratorAmidar((VerilogGeneratorAmidar) gen);\n\t\t StimulusAmidar[] stimuli = new StimulusAmidar[1];\n\t\t stimuli = myCGRA.getStimulus().toArray(stimuli);\n\t\t TestbenchContextGenerator tbcongen = new TestbenchContextGenerator(model);\n\t\t tbcongen.exportContext(myCGRA.getContextCopyPEs(), myCGRA.getContextCopyCBOX(), myCGRA.getContextCopyCCU());\n//\t\t for(Stimulus stim : stimuli){\n//\t\t \tSystem.out.println(stim);\n//\t\t }\n\t\t \n\t\t tbgen.exportAppAndPrintTestbench(stimuli);\n\t\t \n//\t\t tbgen.importAppAndPrintTestbench(\"SimpleTest.main\");\n\t\t TestbenchExecutor tbex = new TestbenchExecutor();\n\t\t \n\t\t if(tbex.runTestbench()){\n\t\t \tsimpleRunTrace.println(\"Run was successful - Cosimulation succeeded\");\n\t\t }\n\t\t else{\n\t\t \tConsistencyChecker sammi = new ConsistencyChecker();\n\t\t \tboolean mismatch = sammi.findRegfileMismatch();\n\t\t \tif(mismatch){\n\t\t \t\tsimpleRunTrace.println(\"Error(s) during Simulation. Something went wrong in the data path\");\n\t\t \t}\n\t\t \telse{\n\t\t \t\tsimpleRunTrace.println(\"Emulation / HDL missmatch. Maybe there's is something not equal concerning the communication or FSM.\");\n\t\t \t}\n\t\t }\n\t\t}\n\t\t\n\n\t}", "ProbeResult run();", "ProcessRunner print();", "public static void main(String[] args) {\n\t\t\r\n\t\tmyGreetingsResp mg = new myGreetingsResp();\r\n\t\tSystem.out.println(mg.greetResp(\"John\", \"Bye\"));\r\n\t\t\r\n\t\tSystem.out.println(\"updating print text\");\r\n\r\n\t}", "@Test\n public void testPrintRoster() {\n System.out.println(\"Roster.printRoster\");\n System.setOut(new PrintStream(outContent));\n allStudents.printRoster();\n String expectedResult = \"\" +\n \"Alice A Anderson is majoring in Anthropology with a GPA of 3.0\\n\" +\n \"Bob Black is majoring in Biology with a GPA of 3.2\\n\" +\n \"Charles Chuck Chamberlain is majoring in Computer Science with a GPA of 3.5\\n\" +\n \"Dave Deer is majoring in Dance with a GPA of 2.5\\n\" +\n \"Eve Edelstein is majoring in Environmental Studies with a GPA of 2.5\\n\" +\n \"Fred F Flinstone is majoring in French with a GPA of 3.2\\n\" +\n \"George Giannopulos is majoring in German with a GPA of 2.0\\n\" +\n \"Hillary Humble is majoring in History with a GPA of 2.8\\n\" +\n \"Ivan Iverson is majoring in Information Technology with a GPA of 3.3\\n\" +\n \"Juan is majoring in Journalism with a GPA of 3.5\\n\";\n assertEquals(expectedResult, outContent.toString());\n System.setOut(System.out);\n }", "public void printMsg() {\n System.out.println(\"This is an example RMI program\");\n }", "@Test\n\tpublic void testResponse() throws IOException {\n\t\tConfigurationManager config = new ConfigurationManager();\n\t\tHashMap<String, Handler> map = new HashMap<String,Handler>();\n\t\tHashMap<String, String> parameters = new HashMap<String, String>();\n\t\tcheckResponse(new RequestObject(\"\", \"\", parameters), HTTPConstants.BAD_REQUEST, map);\n\t\tcheckResponse(new RequestObject(\"PUT\", \"/reviewsearch\", parameters), HTTPConstants.NOT_ALLOWED, map);\n\t\tcheckResponse(new RequestObject(\"PULL\", \"/slackbot\", parameters), HTTPConstants.NOT_ALLOWED, map);\n\t\tcheckResponse(new RequestObject(\"GET\", \"/slackbot\", parameters), HTTPConstants.NOT_FOUND, map);\n\t\tcheckResponse(new RequestObject(\"POST\", \"/slackbot\", parameters), HTTPConstants.NOT_FOUND, map);\n\t\tmap.put(\"/slackbot\", new ChatHandler(config.getConfig()));\n\t\tcheckResponse(new RequestObject(\"POST\", \"/slackbot\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tcheckResponse(new RequestObject(\"POST\", \"/reviewsearch\", parameters), HTTPConstants.NOT_FOUND, map);\n\t\tmap.put(\"/reviewsearch\", new ReviewSearchHandler(config.getConfig(), new InvertedIndex()));\n\t\tcheckResponse(new RequestObject(\"POST\", \"/reviewsearch\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tparameters.put(\"query\", \"jumpers\");\n\t\tcheckResponse(new RequestObject(\"POST\", \"/reviewsearch\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tparameters.put(\"unknown\", \"unknown\");\n\t\tcheckResponse(new RequestObject(\"POST\", \"/reviewsearch\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tparameters.remove(\"query\");\n\t\tcheckResponse(new RequestObject(\"GET\", \"/reviewsearch\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tcheckResponse(new RequestObject(\"GET\", \"/\", parameters), HTTPConstants.NOT_FOUND, map);\n\t}", "public void printCommandResult(CommandResult result) {\n String commandResult = result.getResult();\n switch (commandResult) {\n case CommandResult.EXECUTION_SUCCESS:\n printSuccessCommandResult(result);\n break;\n case CommandResult.EXECUTION_FAIL:\n printFailCommandResult(result);\n break;\n default:\n System.out.println(\"SOMETHING WENT WRONG\");\n break;\n }\n }", "public void printFailure() {\n //\n }", "private static void execWithOutput(String[] cmd)\n throws IOException\n {\n Process p = Runtime.getRuntime().exec(cmd);\n StreamRedirector errRedirector = new StreamRedirector(p.getErrorStream(), System.err);\n errRedirector.start();\n StreamRedirector outRedirector = new StreamRedirector(p.getInputStream(), System.out);\n outRedirector.start();\n }", "private void sout() {\n\t\t\n\t}", "private static void consoleOutput() {\n\n Output airportFlightCounter = new AirportFlightCounter(airports);\n Output flightInventory = new FlightInventory(flights);\n Output flightPassengerCounter = new FlightPassengerCounter(flights);\n Output mileageCounter = new MileageCounter(flights, airports);\n\n airportFlightCounter.toConsole();\n flightInventory.toConsole();\n flightPassengerCounter.toConsole();\n mileageCounter.toConsole();\n }", "public void testHello() {\n FakeEngineManagerListener engineManagerListener = new FakeEngineManagerListener();\n try {\n EngineManager engineManager =\n new EngineManager(engineManagerListener, TEST_MAIN_SC_XML);\n\n // EngineManager.Event event = EngineManager.Event.HELLO;\n Node utterance = makeDoc(\"hello\");\n\n engineManager.fireEvent(\"user_input\", utterance);\n Thread.sleep(1000); // give the async trigger a chance\n\n // now we should have some output (the reply, \"hello\").\n\n assertEquals(1, engineManagerListener.getTargets().size());\n assertNull(engineManagerListener.getTargets().get(0));\n\n assertEquals(1, engineManagerListener.getTargetTypes().size());\n assertEquals(\"x-java\", engineManagerListener.getTargetTypes().get(0));\n\n assertEquals(1, engineManagerListener.getDatas().size());\n if (engineManagerListener.getDatas().get(0) != null) {\n Map<String, Node> data = engineManagerListener.getDatas().get(0);\n assertEquals(1, data.size());\n assertTrue(data.keySet().contains(\"speak0\"));\n Node outputNode = data.values().iterator().next();\n assertEquals(\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-16\\\"?>\" //\n + \"<data xmlns=\\\"http://www.w3.org/2005/07/scxml\\\" name=\\\"speak0\\\">\\n\" //\n + \" <messageId xmlns=\\\"http://www.joelsgarage.com/callcenter\\\">hello</messageId>\\n\" //\n + \"</data>\\n\", //\n XMLUtil.writeXML(outputNode));\n }\n } catch (InitializationException e) {\n e.printStackTrace();\n fail();\n } catch (InterruptedException e) {\n e.printStackTrace();\n fail();\n }\n }", "public void run() {\n assertEquals(sendQuery(\"SFO\"), 7);\n assertEquals(sendQuery(\"RHV\"), 1);\n assertEquals(sendQuery(\"xyzzy\"), 0);\n }", "public void ex02() {\n\n boolean hasFinished = false;\n\n\n if (hasFinished==true) {\n printResults();\n }\n\n\n }", "@After\n public void returnOutStream() { //\n System.setOut(System.out);\n }" ]
[ "0.662321", "0.6558489", "0.6448994", "0.63715065", "0.63262033", "0.62289757", "0.6199024", "0.6194868", "0.61512256", "0.6112802", "0.6048811", "0.60385466", "0.6003418", "0.59838843", "0.59763616", "0.59758407", "0.59625083", "0.5959944", "0.595484", "0.5927014", "0.59242445", "0.59226686", "0.58667123", "0.58506685", "0.5810663", "0.5797193", "0.57799226", "0.5752544", "0.57371575", "0.57306933", "0.5721788", "0.5700743", "0.56671375", "0.56565815", "0.56561893", "0.5651955", "0.5632965", "0.56224906", "0.5615952", "0.56024927", "0.5601465", "0.5597687", "0.5596614", "0.55961275", "0.5593326", "0.5589407", "0.5578271", "0.5574411", "0.5565706", "0.5562693", "0.55552936", "0.5532308", "0.55268717", "0.55229276", "0.551761", "0.5515046", "0.5509874", "0.5502615", "0.54987484", "0.54963464", "0.5493603", "0.5486276", "0.5484897", "0.5484486", "0.5482489", "0.548131", "0.54782206", "0.54777473", "0.54749614", "0.54749304", "0.5474153", "0.5472715", "0.54681116", "0.5467763", "0.5466065", "0.5465422", "0.54618555", "0.5458758", "0.5457021", "0.5455249", "0.5455127", "0.54520077", "0.5451943", "0.54408574", "0.54390866", "0.5431862", "0.54296637", "0.54260314", "0.54251194", "0.5424929", "0.54224735", "0.5422173", "0.5421665", "0.54211915", "0.5418511", "0.54179704", "0.54164195", "0.54134744", "0.5409131", "0.54087013" ]
0.592879
19
executed such that system output responses can be tested
@After public void restoreStreams() { System.setOut(originalOut); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void requestOutput();", "@Test\n public void systemOut()\n {\n String message = \"Testing 1, 2, 3\";\n System.out.print(message);\n assertTrue(SYSTEM_OUT_REDIRECT.toString().contains(message));\n }", "@Test\n\tpublic void testApp()\n\t{\n\t\tPrintStream outBkp = System.out;\n\t\tByteArrayOutputStream outBuf = new ByteArrayOutputStream ();\n\t\tSystem.setOut ( new PrintStream ( outBuf ) );\n\t\t\n\t\tApp.main ( \"a\", \"b\", \"c\" );\n\n\t\tSystem.setOut ( outBkp ); // restore the original output\n\t\t\n\t\tlog.debug ( \"CLI output:\\n{}\", outBuf.toString () );\n\t\tAssert.assertTrue ( \"Can't find CLI output!\", outBuf.toString ().contains ( \"a\\tb\\tc\" ) );\n\t\tassertEquals ( \"Bad exit code!\", 0, App.getExitCode () );\n\t}", "public void test_execute() throws Throwable {\r\n\t\t\r\n\t\tCLIService service = null;\r\n\t\t\r\n\t\t// Ping\r\n\t\ttry {\r\n\t\t\tservice = CLIServiceWrapper.getService();\r\n\t\t\tString response = service.tender(CLIServiceConstants.COMMAND_PING + \" \" + TEST_PING_ARG0);\r\n\t\t\tif ( CLIServiceTools.isResponseOkAndComplete(response) ) {\r\n\t\t\t\tPASS(TEST_PING);\r\n\t\t\t} else {\r\n\t\t\t\tFAIL(TEST_PING, \"Response not ok. response=\" + response);\t\t\t\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tABORT(TEST_PING,\"ping failed to exception:\" + e.getMessage());\r\n\t\t}\r\n\r\n\t\t// Process list - log and cli\r\n\t\ttry {\r\n\t\t\tString response = service.tender(CLIServiceConstants.COMMAND_PROCESSLIST);\r\n\t\t\tif ( (CLIServiceTools.isResponseOkAndComplete(response)) && (response.indexOf(TEST_PROCESSLIST_VALIDATION1) >= 0) &&\r\n\t\t\t\t (response.indexOf(TEST_PROCESSLIST_VALIDATION2) >= 0) && (response.indexOf(TEST_PROCESSLIST_VALIDATION3) >= 0) ) {\r\n\t\t\t\tPASS(TEST_PROCESSLIST);\r\n\t\t\t} else {\r\n\t\t\t\tFAIL(TEST_PROCESSLIST, \"Response not ok. See log for response.\");\t\t\t\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tABORT(TEST_PROCESSLIST,\"process list failed to exception:\" + e.getMessage());\r\n\t\t}\t\r\n\t\t\r\n\t\t// Process list - log only - the CLI output should not contain any validations, just the OK.\r\n\t\ttry {\r\n\t\t\tString response = service.tender(CLIServiceConstants.COMMAND_PROCESSLIST + \" =\" + CLIServiceConstants.COMMAND_PROCESSLIST_LOG_VALUE);\r\n\t\t\tif ( (CLIServiceTools.isResponseOkAndComplete(response)) && (response.indexOf(TEST_PROCESSLIST_VALIDATION1) < 0) &&\r\n\t\t\t (response.indexOf(TEST_PROCESSLIST_VALIDATION2) < 0) && (response.indexOf(TEST_PROCESSLIST_VALIDATION3) < 0) ) {\r\n\t\t\t\tPASS(TEST_PROCESSLIST_LOG);\r\n\t\t\t} else {\r\n\t\t\t\tFAIL(TEST_PROCESSLIST_LOG, \"Response not ok. See log for response.\");\t\t\t\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tABORT(TEST_PROCESSLIST_LOG,\"process list (log only) failed to exception:\" + e.getMessage());\r\n\t\t}\t\r\n\r\n\t}", "@Test\n\tpublic void test_001() {\n\t\tfinal String EXPECTED_RESPONSE = \"{\\\"hello\\\": \\\"world\\\"}\";\n\t\tJdProgramRequestParms.put(\"U$FUNZ\", new StringValue(\"URL\"));\n\t\tJdProgramRequestParms.put(\"U$METO\", new StringValue(\"HTTP\"));\n\t\tJdProgramRequestParms.put(\"U$SVARSK\", new StringValue(\"http://www.mocky.io/v2/5185415ba171ea3a00704eed\"));\n\n\t\tList<Value> responseParms = JdProgram.execute(javaSystemInterface, JdProgramRequestParms);\n\t\tassertTrue(responseParms.get(2).asString().getValue().equals(EXPECTED_RESPONSE));\n\t}", "@Test\n\tpublic void whenExecuteMainThenPrintToConsole() {\n\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\tSystem.setOut(new PrintStream(out));\n\t\tCalculate.main(null);\n\t\tassertThat(out.toString(), is(\"Hello World\\r\\n\"));\n\t}", "public void processOutput() {\n\n\t}", "public boolean processOutput();", "boolean hasSystemResponse();", "protected void finalizeSystemOut() {}", "public void setOutput(String output) { this.output = output; }", "@Before\n\tpublic void loadOutput() {\n\t\tSystem.setOut(new PrintStream(this.out));\n\t}", "@Test\n\tpublic void check() {\n\n\t\ttry {\n\t\t\tSystem.out.println(\"Unit Test Begins\");\n\t\t\t// Generate Random Log file\n\t\t\tUnitTestLogGenerator.generateRandomLogs();\n\t\t\t// Generate Cmd String\n\t\t\tString cmd = ClientClass.generateCommand(IpAddress, \"seth\", \"v\",\n\t\t\t\t\ttrue);\n\t\t\t// Run Local Grep;\n\t\t\tlocalGrep(cmd);\n\t\t\t// Connecting to Server\n\t\t\tConnectorService connectorService = new ConnectorService();\n\t\t\tconnectorService.connect(IpAddress, cmd);\n\t\t\tInputStream FirstFileStream = new FileInputStream(\n\t\t\t\t\t\"/tmp/localoutput_unitTest.txt\");\n\t\t\tInputStream SecondFileStream = new FileInputStream(\n\t\t\t\t\t\"/tmp/output_main.txt\");\n\t\t\tSystem.out.println(\"Comparing the two outputs...\");\n\t\t\tboolean result = fileComparison(FirstFileStream, SecondFileStream);\n\t\t\tAssert.assertTrue(result);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Ignore\n\t@Test\n\tpublic void test() throws IOException {\n\n\t\tClient.main(new String[] {\"localhost\", \"6700\"});\n\n\t\tSystem.out.println(\"free\");\n\t\tSystem.out.println(\"in\");\n\t\tSystem.out.println(\"in\");\n\t\tSystem.out.println(\"free\");\n\t\tSystem.out.println(\"out\");\n\t\tSystem.out.println(\"free\");\n\n\t}", "@Test\n\tpublic void checkStatus() {\n\t\tclient.execute(\"1095C-16-111111\");\n\t}", "@Test\n\tpublic void addTaskOutput(){\n\t}", "public void test() {\n\t\t\r\n\t\tSystem.out.println(\"-->\" + CommonMethod.createCmdOfflineVersion10(\"jxsmarthome\"));\r\n\t\t\r\n\t}", "boolean hasOutput();", "public String runTest( String input ){\n\t\tString response = null;\n\t\t// Deals with cases where this component reference is not wired\n\t\tif( reference1 != null ) {\n\t\t\tString response1 = reference1.operation1(input);\n\t\t\t\n\t\t\tresponse = testName + \" \" + input + \" \" + response1;\n\t\t} else {\n\t\t\tresponse = testName + \" \" + input + \" no invocation\";\n\t\t}\t// end if\n\t\t\n\t\treturn response;\n\t}", "@Before\n\tpublic void setUpStreams() {\n\t\tSystem.setOut(new PrintStream(outContent));\n\t}", "@Test\n\tpublic void test_003() {\n\t\tJdProgramRequestParms.put(\"U$FUNZ\", new StringValue(\"URL\"));\n\t\tJdProgramRequestParms.put(\"U$METO\", new StringValue(\"HTTP\"));\n\t\tJdProgramRequestParms.put(\"U$SVARSK\", new StringValue(\"http://www.mocky.io/v2/5185415ba171ea3a00704eedxxx\"));\n\n\t\tJdProgramResponseParms = JdProgram.execute(javaSystemInterface, JdProgramRequestParms);\n\t\tassertTrue(JdProgramResponseParms.get(2).asString().getValue().startsWith(\"*ERROR\"));\n\t\tassertTrue(JdProgramResponseParms.get(2).asString().getValue().contains(\"HTTP response code: 500\"));\n\t}", "String getOutput();", "static void mainTest(PrintWriter out) throws Exception {\n\t}", "public static void sendTestMessage (PrintWriter out) {\r\n\t\tString pack = \"0|test\";\r\n\t\tout.println(pack);\r\n\t}", "public static void main(String[] args) throws IOException, UnexpectedResponseException {\n }", "private void sysout() {\nSystem.out.println(\"pandiya\");\n}", "java.lang.String getOutput();", "@Before\n public void setup(){\n output = new TestingOutputInterface();\n mLogic = new Logic(output);\n \n System.err.flush();\n System.out.flush();\n myOut = new ByteArrayOutputStream();\n myErr = new ByteArrayOutputStream();\n System.setOut(new PrintStream(myOut));\n System.setErr(new PrintStream(myErr));\n }", "@Test\n\tpublic void checkProjectOutput() throws IOException {\n\t\tcheckServerOutput(8080, \"/reviewsearch\", \"\", \"GET\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/reviewsearch\", \"\", \"PULL\", HTTPConstants.NOT_ALLOWED);\n\t\tcheckServerOutput(8080, \"/reviewsearch\", \"query=the\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/reviewsearch\", \"query=computer%20science\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/reviewsearchcurl\", \"query=computer%20science\", \"POST\", HTTPConstants.NOT_FOUND);\n\t\tcheckServerOutput(8080, \"/reviewsearch\", \"query=computer%20science&query=computer%20science\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/find\", \"\", \"GET\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/find\", \"\", \"PULL\", HTTPConstants.NOT_ALLOWED);\n\t\tcheckServerOutput(8080, \"/find\", \"asin=the\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/find\", \"asin=B00002243X\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(8080, \"/findcurl\", \"asin=B00002243X\", \"POST\", HTTPConstants.NOT_FOUND);\n\t\tcheckServerOutput(8080, \"/find\", \"asin=B00002243X&asin=B00002243X\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(9090, \"/slackbot\", \"\", \"GET\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(9090, \"/slackbot\", \"\", \"PULL\", HTTPConstants.NOT_ALLOWED);\n\t\tcheckServerOutput(9090, \"/slackbot\", \"message=hello\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(9090, \"/slackbot\", \"message=bye\", \"POST\", HTTPConstants.OK_HEADER);\n\t\tcheckServerOutput(9090, \"/slackbotds\", \"message=bye\", \"POST\", HTTPConstants.NOT_FOUND);\n\t\tcheckServerOutput(9090, \"/slackbot\", \"message=bye&message=bye\", \"POST\", HTTPConstants.OK_HEADER);\n\t}", "public void testOutput(String path) {\n\t\ttestOutput(path, false);\n\t}", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = new String[]{\"-i\", \"-p\", \"src/test/resources/problems_resp.xml\", \"src/test/resources/context.txt\"};\n PrintStream prev = System.out;\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n System.setOut(new PrintStream(bos));\n XpathGenerator.main(args);\n System.setOut(prev);\n System.out.println(bos.toString());\n assertTrue(bos.toString().startsWith(\"/fhir:Bundle[1]\"));\n }", "@Override\n\tpublic void printtest(String s)\n\t{\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Now executing the command \" + s + \"...\");\n\t\tSystem.out.println(\"The Results of this command are:\");\n\t\tif(!s.contentEquals(\"toString\")) System.out.println(toStringCursor());\n\t\telse System.out.println(toString());\n\t}", "@Test\n\tpublic void testMain() {\n\t\t// TODO: test output streams for various IO methods, emulating a user's\n\t\t// input - kinda like Joel did for CSSE2310\n\t\tAssert.fail();\n\t}", "private void execute(String cmd[])\n {\n /* Begin process */\n Process p;\n String cmdLine = \"\";\n int i;\n \n for ( i = 0 ; i < cmd.length; i++ ) {\n cmdLine += cmd[i];\n cmdLine += \" \";\n }\n System.out.println(\"Starting: \" + cmdLine);\n \n try {\n p = Runtime.getRuntime().exec(cmd);\n } catch ( IOException e ) {\n throw new RuntimeException(\"Test failed - exec got IO exception\");\n }\n \n /* Save process output in StringBuffers */\n output = new MyInputStream(\"Input Stream\", p.getInputStream());\n error = new MyInputStream(\"Error Stream\", p.getErrorStream());\n \n /* Wait for process to complete, and if exit code is non-zero we fail */\n try {\n int exitStatus;\n exitStatus = p.waitFor();\n if ( exitStatus != 0) {\n System.out.println(\"Exit code is \" + exitStatus);\n error.dump(System.out);\n output.dump(System.out);\n throw new RuntimeException(\"Test failed - \" +\n \"exit return code non-zero \" +\n \"(exitStatus==\" + exitStatus + \")\");\n }\n } catch ( InterruptedException e ) {\n throw new RuntimeException(\"Test failed - process interrupted\");\n }\n System.out.println(\"Completed: \" + cmdLine);\n }", "@Test\n\tpublic void testDisplay1() {\n\t\t\n\t\t\n\t\tSystem.setOut(new PrintStream(Actualout));\n\t\t\n\t\tcircularlist.display();\n\t\t\n\t\tassertEquals(\"List : Empty List.\\r\\n\", Actualout.toString());\n\t}", "@Override\n\t\t\t\tpublic void onResponse(String arg0) {\n\t\t\t\t\tSystem.out.println(arg0);\n\t\t\t\t\t\n\t\t\t\t}", "private void getAppResponse(String theuri, PrintWriter out) {\n String response = spring.executeService(theuri);\n String header = \"HTTP/1.1 200 OK\\r\\n\"\n + \"Content-Type: text/html\\r\\n\"\n + \"\\r\\n\";\n out.println(header + response);\n }", "String diagnosticsOutput();", "private void processMessage(String msg) {\n\t\t\tif (msg.equals(Message.TEST_SERVER)) {\n\t\t\t\tSystem.out.println(\"Server test passed. Testing client...\");\n\t\t\t\tpw.println(Message.TEST_CLIENT);\n\t\t\t}\n\t\t}", "public static\n void hookSystemOutputStreams() {\n out();\n err();\n }", "@Test\n public void main() {\n // App.main(null);\n // assertEquals(\"Hello world\", outContent.toString());\n }", "public TestOut getOutput() {\n\treturn(output);\n }", "@Test\n\tpublic void test_002() {\n\t\tJdProgramRequestParms.put(\"U$FUNZ\", new StringValue(\"URL\"));\n\t\tJdProgramRequestParms.put(\"U$METO\", new StringValue(\"HTTP\"));\n\t\tJdProgramRequestParms.put(\"U$SVARSK\", new StringValue(\"malformed_url\"));\n\n\t\tJdProgramResponseParms = JdProgram.execute(javaSystemInterface, JdProgramRequestParms);\n\t\tassertTrue(JdProgramResponseParms.get(2).asString().getValue().startsWith(\"*ERROR\"));\n\t\tassertTrue(JdProgramResponseParms.get(2).asString().getValue().contains(\"malformed_url\"));\n\t}", "public void printStatus();", "private void _debugSystemOutAndErr() {\n try {\n File outF = new File(System.getProperty(\"user.home\") +\n System.getProperty(\"file.separator\") + \"out.txt\");\n FileWriter wo = new FileWriter(outF);\n final PrintWriter outWriter = new PrintWriter(wo);\n File errF = new File(System.getProperty(\"user.home\") +\n System.getProperty(\"file.separator\") + \"err.txt\");\n FileWriter we = new FileWriter(errF);\n final PrintWriter errWriter = new PrintWriter(we);\n System.setOut(new PrintStream(new edu.rice.cs.util.OutputStreamRedirector() {\n public void print(String s) {\n outWriter.print(s);\n outWriter.flush();\n }\n }));\n System.setErr(new PrintStream(new edu.rice.cs.util.OutputStreamRedirector() {\n public void print(String s) {\n errWriter.print(s);\n errWriter.flush();\n }\n }));\n }\n catch (IOException ioe) {}\n }", "public static void stdout(){\n\t\tSystem.out.println(\"Buildings Found: \" + buildingsFound);\n\t\tSystem.out.println(\"Pages searched: \"+ pagesSearched);\n\t\tSystem.out.println(\"Time Taken: \" + (endTime - startTime) +\"ms\");\t\n\t}", "@Override\r\n\t\t\tpublic void execute(String content) {\n\t\t\t\tSystem.out.println(content);\r\n\t\t\t}", "@LargeTest\n public void testUsageIO() {\n TestAction ta = new TestAction(TestName.USAGE_IO);\n runTest(ta, TestName.USAGE_IO.name());\n }", "@Test(groups = \"Integration\")\n public void testSshExecCommands() throws Exception {\n OutputStream outStream = new ByteArrayOutputStream();\n String expectedName = Os.user();\n host.execCommands(MutableMap.of(\"out\", outStream), \"mysummary\", ImmutableList.of(\"whoami; exit\"));\n String outString = outStream.toString();\n \n assertTrue(outString.contains(expectedName), outString);\n }", "void createdOutput(TestResult tr, Section section, String outputName);", "public interface CLIResult {\n\n /**\n * Enumeration for the different types of streams to get output for,\n * including STDOUT and STDERR.\n */\n enum STREAM {\n STDOUT, STDERR;\n }\n\n /**\n * Get the output for the specified stream.\n * @param stream The {@link STREAM} to get output from.\n * @return A single String of the output.\n */\n String getOutput(STREAM stream);\n\n /**\n * Get standard output.\n * @return the standard output.\n */\n String getOutput();\n\n /**\n * Get the output for the specified stream split by lines.\n * @param stream The {@link STREAM} to get output from.\n * @return A List of Strings of output, one list item per line.\n */\n List<String> getOutputByLine(STREAM stream);\n\n /**\n * Get the exit value of the process that was run.\n * @return The exit value of the program that was run.\n */\n int exitValue();\n}", "public void setOutput(String output) {\n this.output = output;\n }", "private void runCommandAndVerifyOutput(CommandHandler commandHandler, String expectedOutput)\n throws InterruptedException {\n session = createDefaultSession(commandHandler);\n\n Thread thread = new Thread(session);\n thread.start();\n\n for (int i = 0; !commandHandled && i < 10; i++) {\n Thread.sleep(50L);\n }\n\n session.close();\n thread.join();\n\n assertEquals(\"commandHandled\", true, commandHandled);\n\n String output = outputStream.toString();\n LOG.info(\"output=[\" + output.trim() + \"]\");\n assertTrue(\"line ends with \\\\r\\\\n\",\n output.charAt(output.length() - 2) == '\\r' && output.charAt(output.length() - 1) == '\\n');\n assertTrue(\"output: expected [\" + expectedOutput + \"]\", output.indexOf(expectedOutput) != -1);\n }", "@Override\n\tpublic void run() {\n\t\tPrintWriter out;\n\t\ttry {\n\t\t\tout = new PrintWriter(s.getOutputStream());\n\t\t\tout.print(\"HTTP/1.1 200 Ok\\n\\r\"+ \n\"Server: nginx/1.8.0\\n\\r\"+\n\"Date: Mon, 07 Dec 2015 09:11:39 GMT\\n\\r\"+ \n\"Content-Type: text/html\\n\\r\"+\n\"Connection: close\\n\\r\\n\\r\"+\n\"<html>\"+ \n\"<head><title>Test ok</title></head>\"+\n\"<body bgcolor=\\\"white\\\"> \"+\n\"<center><h1>HELLO</h1></center>\"+ \n\"</body>\"+\n\"</html>\"); \n\t\t\tout.close();\n\t\t\ts.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\n\t\n\t\t\n\t}", "@Before\n public void changeOutStream() {\n PrintStream printStream = new PrintStream(outContent);\n System.setOut(printStream);\n }", "void completedOutput(TestResult tr, Section section, String outputName);", "@Test\n\tpublic void runSend(){\n\t\tstandard();\n\t}", "public void invoke() throws Exception, IOException {\n java.io.PrintWriter out = response.getWriter();\n out.println(\"Welcome to ping\");\n return;\n}", "final private static void usage () {\n\t\t usage_print () ;\n\t\t System.exit (0) ;\n }", "private static void printUsage() throws Exception {\n\t\tSystem.out.println(new ResourceGetter(\"uk/ac/cam/ch/wwmm/oscar3/resources/\").getString(\"usage.txt\"));\n\t}", "@Test\n public void localAction_stdoutIsReported() throws Exception {\n if (OS.getCurrent() == OS.WINDOWS) {\n return;\n }\n write(\n \"BUILD\",\n \"genrule(\",\n \" name = 'foo',\",\n \" srcs = [],\",\n \" outs = ['out/foo.txt'],\",\n \" cmd = 'echo my-output-message > $@',\",\n \")\",\n \"genrule(\",\n \" name = 'foobar',\",\n \" srcs = [':foo'],\",\n \" outs = ['out/foobar.txt'],\",\n \" cmd = 'cat $(location :foo) && touch $@',\",\n \" tags = ['no-remote'],\",\n \")\");\n RecordingOutErr outErr = new RecordingOutErr();\n this.outErr = outErr;\n\n buildTarget(\"//:foobar\");\n waitDownloads();\n\n assertOutputContains(outErr.outAsLatin1(), \"my-output-message\");\n }", "private static void printTest(boolean isValid, String description, String recieved, String expected) {\r\n\t\tSystem.out.println(String.format(\"Is Valid: %s%nDescription: %s%nRecieved: %s%nExpected: %s%n\", isValid, description, recieved, expected));\r\n\t}", "@Test\n\tpublic void testHelpOption()\n\t{\n\t\tPrintStream outBkp = System.out;\n\t\tByteArrayOutputStream outBuf = new ByteArrayOutputStream ();\n\t\tSystem.setOut ( new PrintStream ( outBuf ) );\n\n\t\tApp.main ( \"--help\" );\n\t\t\n\t\tSystem.setOut ( outBkp ); // restore the original output\n\n\t\tlog.debug ( \"CLI output:\\n{}\", outBuf.toString () );\n\t\tassertTrue ( \"Can't find CLI output!\", outBuf.toString ().contains ( \"*** Command Line Example ***\" ) );\n\t\tassertEquals ( \"Bad exit code!\", 1, App.getExitCode () );\n\t}", "public void testExecCommand() throws Exception {\n PKey hostKey = PKey.readPrivateKeyFromStream(new FileInputStream(\n \"test/test_rsa.key\"), null);\n PKey publicHostKey = PKey.createFromBase64(hostKey.getBase64());\n mTS.addServerKey(hostKey);\n final FakeServer server = new FakeServer();\n\n final Event sync = new Event();\n new Thread(new Runnable() {\n public void run() {\n try {\n mTS.start(server, 15000);\n sync.set();\n } catch (IOException x) {}\n }\n }).start();\n\n mTC.start(publicHostKey, 15000);\n mTC.authPassword(\"slowdive\", \"pygmalion\", 15000);\n\n sync.waitFor(5000);\n assertTrue(sync.isSet());\n assertTrue(mTS.isActive());\n\n Channel chan = mTC.openSession(5000);\n Channel schan = mTS.accept(5000);\n try {\n chan.execCommand(\"no\", 5000);\n fail(\"expected exception\");\n } catch (IOException x) {\n // pass\n }\n chan.close();\n schan.close();\n\n chan = mTC.openSession(5000);\n chan.execCommand(\"yes\", 5000);\n schan = mTS.accept(5000);\n\n schan.getOutputStream().write(\"Hello there.\\n\".getBytes());\n schan.getStderrOutputStream().write(\"This is on stderr.\\n\".getBytes());\n schan.close();\n\n BufferedReader r = new BufferedReader(new InputStreamReader(\n chan.getInputStream()));\n assertEquals(\"Hello there.\", r.readLine());\n assertEquals(null, r.readLine());\n r = new BufferedReader(new InputStreamReader(\n chan.getStderrInputStream()));\n assertEquals(\"This is on stderr.\", r.readLine());\n assertEquals(null, r.readLine());\n chan.close();\n\n // now try it with combined stdout/stderr\n chan = mTC.openSession(5000);\n chan.execCommand(\"yes\", 5000);\n schan = mTS.accept(5000);\n schan.getOutputStream().write(\"Hello there\\n\".getBytes());\n schan.getStderrOutputStream().write(\"This is on stderr.\\n\".getBytes());\n schan.close();\n\n chan.setCombineStderr(true);\n r = new BufferedReader(new InputStreamReader(chan.getInputStream()));\n assertEquals(\"Hello there\", r.readLine());\n assertEquals(\"This is on stderr.\", r.readLine());\n assertEquals(null, r.readLine());\n chan.close();\n }", "static int printUsage() {\n\t System.out.println(\"netflix1Driver [-m <maps>] [-r <reduces>] <input> <output>\");\n\t ToolRunner.printGenericCommandUsage(System.out);\n\t return -1;\n\t }", "private Output() {}", "public interface RunOutput {\n /**\n * The actual results of the test run.\n * @return actual results\n */\n ResultSummary getActualResultSummary();\n\n /**\n * The results of the test run, modified to account for {@link org.concordion.api.ImplementationStatus}.\n * @return modified results\n */\n ResultSummary getModifiedResultSummary();\n}", "@Before\n public void newHTTPTest() throws IOException {\n code = callHandlerResponse(\"\", \"POST\");\n }", "@After\n public void tearDown(){\n final String standardOutput = myOut.toString();\n final String standardError = myErr.toString();\n assertEquals(\"You used 'System.out' in your assignment, This is not allowed.\",true, standardOutput.length() == 0);\n assertEquals(\"You used 'System.err' in your assignment, This is not allowed.\",true, standardError.length() == 0);\n System.err.flush();\n System.out.flush();\n System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));\n System.setErr(new PrintStream(new FileOutputStream(FileDescriptor.err)));\n }", "@Test\n public void execute_validParameters_success() throws CommandException {\n System.setOut(modelPrintStream);\n new ViewParticipantCommand(this.participantToView.getId()).execute(modelOneParticipant);\n String output = modelOut.toString();\n // Configure correct output\n String expectedOutput = new StringBuilder()\n .append(String.format(\"Viewing %s%s\", this.participantToView.getName(), NEW_LINE))\n .append(String.format(\"\\t%s%s\", this.participantToView.toString(), NEW_LINE))\n .toString();\n // Test and reset OutputStream\n assertEquals(expectedOutput, output);\n modelOut.reset();\n }", "private void consoleOutput(String textOutput){\r\n\t\tSystem.out.println(textOutput);\r\n\t}", "public static void setup() {\n\t\toutputs.add(new Console.stdout());\n\t}", "private String getResponse(String input) {\n try {\n CommandResult result = logicManager.execute(input);\n if (result.isExit()) {\n handleExit();\n }\n return result.getFeedbackToUser();\n } catch (CommandException | ParserException e) {\n return e.getMessage();\n }\n }", "private static void printUsage() {\n\t\tSystem.out.println(errorHeader + \"Incorrect parameters\\nUsage :\"\n\t\t\t\t+ \"\\njava DaemonImpl <server>\\n With server = address of the server\"\n\t\t\t\t+ \" the DaemonImpl is executed on\");\n\t}", "static final void flushSystemOut()\n {\n PrintStream out = sysOut;\n if (out != null)\n {\n try\n {\n out.flush();\n }\n catch (Error e) {}\n catch (RuntimeException e) {}\n }\n }", "@Test\n public void dynamicExecution_stdoutIsReported() throws Exception {\n if (OS.getCurrent() == OS.WINDOWS) {\n return;\n }\n addOptions(\"--internal_spawn_scheduler\");\n addOptions(\"--strategy=Genrule=dynamic\");\n addOptions(\"--experimental_local_execution_delay=9999999\");\n write(\n \"BUILD\",\n \"genrule(\",\n \" name = 'foo',\",\n \" srcs = [],\",\n \" outs = ['out/foo.txt'],\",\n \" cmd = 'echo my-output-message > $@',\",\n \" tags = ['no-local'],\",\n \")\",\n \"genrule(\",\n \" name = 'foobar',\",\n \" srcs = [':foo'],\",\n \" outs = ['out/foobar.txt'],\",\n \" cmd = 'cat $(location :foo) && touch $@',\",\n \")\");\n RecordingOutErr outErr = new RecordingOutErr();\n this.outErr = outErr;\n\n buildTarget(\"//:foobar\");\n waitDownloads();\n\n assertOutputContains(outErr.outAsLatin1(), \"my-output-message\");\n }", "private void testCommand(String cmdName, Map<String, String> kwargs, InputStream inputStream,\n String authInfo,\n Map<String, String> expectedHeaders, int expectedStatusCode,\n Field... fields) throws IOException, InterruptedException {\n ZooKeeperServer zks = serverFactory.getZooKeeperServer();\n final CommandResponse commandResponse = inputStream == null\n ? Commands.runGetCommand(cmdName, zks, kwargs, authInfo, null) : Commands.runPostCommand(cmdName, zks, inputStream, authInfo, null);\n assertNotNull(commandResponse);\n assertEquals(expectedStatusCode, commandResponse.getStatusCode());\n try (final InputStream responseStream = commandResponse.getInputStream()) {\n if (Boolean.parseBoolean(kwargs.getOrDefault(REQUEST_QUERY_PARAM_STREAMING, \"false\"))) {\n assertNotNull(responseStream, \"InputStream in the response of command \" + cmdName + \" should not be null\");\n } else {\n Map<String, Object> result = commandResponse.toMap();\n assertTrue(result.containsKey(\"command\"));\n // This is only true because we're setting cmdName to the primary name\n assertEquals(cmdName, result.remove(\"command\"));\n assertTrue(result.containsKey(\"error\"));\n assertNull(result.remove(\"error\"), \"error: \" + result.get(\"error\"));\n\n for (Field field : fields) {\n String k = field.key;\n assertTrue(result.containsKey(k),\n \"Result from command \" + cmdName + \" missing field \\\"\" + k + \"\\\"\" + \"\\n\" + result);\n Class<?> t = field.type;\n Object v = result.remove(k);\n assertTrue(t.isAssignableFrom(v.getClass()),\n \"\\\"\" + k + \"\\\" field from command \" + cmdName\n + \" should be of type \" + t + \", is actually of type \" + v.getClass());\n }\n\n assertTrue(result.isEmpty(), \"Result from command \" + cmdName + \" contains extra fields: \" + result);\n }\n }\n assertEquals(expectedHeaders, commandResponse.getHeaders());\n }", "@Test\n public void printResponse(){\n when().get(\"http:://34.223.219.142:1212/ords/hr/countries\")\n .body().prettyPrint();\n\n }", "@Test\n public void Day5AExample1() {\n intCodeProcessorService = new IntCodeProcessorService(\"data/day05/example1.txt\");\n intCodeProcessorService.setCpuInputValue(555L);\n intCodeProcessorService.runToCompletion();\n\n long result = intCodeProcessorService.getProgramOutput();\n Assert.assertEquals(555L, result);\n }", "private void getStatus() {\n\t\t\n\t}", "@Test\n public void execute_modelWithSameParticipant_sameOutput() throws CommandException {\n System.setOut(modelPrintStream);\n new ViewParticipantCommand(this.participantToView.getId()).execute(modelOneParticipant);\n String output1 = modelOut.toString();\n // Collect console output of ViewParticipantCommand of expectedOneParticipant\n System.setOut(expectedPrintStream);\n new ViewParticipantCommand(this.participantToView.getId()).execute(expectedOneParticipant);\n String output2 = expectedOut.toString();\n // Test and reset OutputStreams\n assertEquals(output1, output2);\n modelOut.reset();\n expectedOut.reset();\n }", "protected static void printUsage() {\n\t}", "public void setOutput(String output) {\r\n\t\tthis.output = output;\r\n\t}", "public abstract boolean getOutput();", "private static void sample1() {\n\t\tIComputer computer = new Computer();\n\t\tcomputer.setProgram(\n\t\t\t(byte) 0x70,\n\t\t\t(byte) 0x71,\n\t\t\t(byte) 0xc0,\n\t\t\t(byte) 0xc1,\n\t\t\t(byte) 0x70,\n\t\t\t(byte) 0xc0,\n\t\t\t(byte) 0xff);\n\t\tTestContext context = new TestContext(\n\t\t (byte) 0xa1, (byte) 0x9b, (byte) 0x3c);\n\t\tcomputer.run(context);\n\t\tSystem.out.println(context.outputToString());\n\t}", "private static void simpleRun(String [] args){\n\t\tString applicationPath = convertApplication(args[2], null);\n\t\tboolean testHardware = args[0].equals(\"-testCGRAVerilog\");\n\t\t\n\t\t\n\t\tboolean synthesis = false;\n\t\tif(args[0].equals(\"-testCGRAVerilog\") || args[3].equals(\"true\")){\n\t\t\tsynthesis = true;\n\t\t} else if (args[3].equals(\"false\")){\n\t\t\tsynthesis = false;\n\t\t} else{\n\t\t\tSystem.out.println(\"Synthesis parameter not set correctly: \" + args[3]+ \"\");\n\t\t\tSystem.out.println(\"Valid values are \\\"true\\\" and \\\"false\\\"\");\n\t\t\tSystem.out.println(\"Aborting...\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tConfMan configManager = new ConfMan(args[1], applicationPath, synthesis);\n\t\t\n\t\tTrace simpleRunTrace = new Trace(System.out, System.in, \"\", \"\");\n\t\tif(configManager.getTraceActivation(\"config\")){\n\t\t\tsimpleRunTrace.setPrefix(\"config\");\n\t\t\tconfigManager.printConfig(simpleRunTrace);\n\t\t}\n\n\t\tDecimalFormatSymbols symbols = new DecimalFormatSymbols();\n\t\tsymbols.setGroupingSeparator(',');\n\t\tsymbols.setDecimalSeparator('.');\n\t\tDecimalFormat formater = new DecimalFormat(\"#.000\", symbols);\n\t\t\n\t\tAmidarSimulationResult results = run(configManager, null, testHardware);\n\t\t\n\t\tif(configManager.getTraceActivation(\"results\")){\n\t\t\tsimpleRunTrace.setPrefix(\"results\");\n\t\t\tsimpleRunTrace.printTableHeader(\"Simulated \"+applicationPath+\" - Synthesis \"+(configManager.getSynthesis()?\"ON\":\"OFF\"));\n\t\t\tsimpleRunTrace.println(\"Ticks: \"+results.getTicks());\n\t\t\tsimpleRunTrace.println(\"Bytecodes: \"+results.getByteCodes());\n\t\t\tsimpleRunTrace.println(\"Energy consumption: \"+formater.format(results.getEnergy()));\n\t\t\tsimpleRunTrace.println(\"Execution Time: \"+results.getExecutionDuration()+\" ms\");\n\t\t\tsimpleRunTrace.printTableHeader(\"Loop Profiling\");\n\t\t\tresults.getProfiler().reportProfile(simpleRunTrace);\n\t\t\tsimpleRunTrace.printTableHeader(\"Kernel Profiling\");\n\t\t\tresults.getKernelProfiler().reportProfile(simpleRunTrace, results.getTicks());\n\t\t}\n\t\t\n\t\tif(testHardware){\n\t\t\tsimpleRunTrace.setPrefix(\"CGRA verilog test\");\n\t\t\tsimpleRunTrace.printTableHeader(\"Testing CGRA Verilog descrption\");\n\t\t\tAmidar core = results.getAmidarCore();\n\t\t\tCGRA myCGRA = (CGRA)core.functionalUnits[core.functionalUnits.length-1]; // CGRA is the last one\n\t\t\t\n\t\t VerilogGenerator gen = target.Processor.Instance.getGenerator();\n\t\t CgraModel model = myCGRA.getModel();\n\t\t model.finalizeCgra();\n\t\t simpleRunTrace.println(\"Generate Verilog...\");\n\t\t gen.printVerilogDescription(\"out\",model);\n\t\t TestbenchGeneratorAmidar tbgen = new TestbenchGeneratorAmidar((VerilogGeneratorAmidar) gen);\n\t\t StimulusAmidar[] stimuli = new StimulusAmidar[1];\n\t\t stimuli = myCGRA.getStimulus().toArray(stimuli);\n\t\t TestbenchContextGenerator tbcongen = new TestbenchContextGenerator(model);\n\t\t tbcongen.exportContext(myCGRA.getContextCopyPEs(), myCGRA.getContextCopyCBOX(), myCGRA.getContextCopyCCU());\n//\t\t for(Stimulus stim : stimuli){\n//\t\t \tSystem.out.println(stim);\n//\t\t }\n\t\t \n\t\t tbgen.exportAppAndPrintTestbench(stimuli);\n\t\t \n//\t\t tbgen.importAppAndPrintTestbench(\"SimpleTest.main\");\n\t\t TestbenchExecutor tbex = new TestbenchExecutor();\n\t\t \n\t\t if(tbex.runTestbench()){\n\t\t \tsimpleRunTrace.println(\"Run was successful - Cosimulation succeeded\");\n\t\t }\n\t\t else{\n\t\t \tConsistencyChecker sammi = new ConsistencyChecker();\n\t\t \tboolean mismatch = sammi.findRegfileMismatch();\n\t\t \tif(mismatch){\n\t\t \t\tsimpleRunTrace.println(\"Error(s) during Simulation. Something went wrong in the data path\");\n\t\t \t}\n\t\t \telse{\n\t\t \t\tsimpleRunTrace.println(\"Emulation / HDL missmatch. Maybe there's is something not equal concerning the communication or FSM.\");\n\t\t \t}\n\t\t }\n\t\t}\n\t\t\n\n\t}", "ProbeResult run();", "ProcessRunner print();", "public static void main(String[] args) {\n\t\t\r\n\t\tmyGreetingsResp mg = new myGreetingsResp();\r\n\t\tSystem.out.println(mg.greetResp(\"John\", \"Bye\"));\r\n\t\t\r\n\t\tSystem.out.println(\"updating print text\");\r\n\r\n\t}", "public void printMsg() {\n System.out.println(\"This is an example RMI program\");\n }", "@Test\n public void testPrintRoster() {\n System.out.println(\"Roster.printRoster\");\n System.setOut(new PrintStream(outContent));\n allStudents.printRoster();\n String expectedResult = \"\" +\n \"Alice A Anderson is majoring in Anthropology with a GPA of 3.0\\n\" +\n \"Bob Black is majoring in Biology with a GPA of 3.2\\n\" +\n \"Charles Chuck Chamberlain is majoring in Computer Science with a GPA of 3.5\\n\" +\n \"Dave Deer is majoring in Dance with a GPA of 2.5\\n\" +\n \"Eve Edelstein is majoring in Environmental Studies with a GPA of 2.5\\n\" +\n \"Fred F Flinstone is majoring in French with a GPA of 3.2\\n\" +\n \"George Giannopulos is majoring in German with a GPA of 2.0\\n\" +\n \"Hillary Humble is majoring in History with a GPA of 2.8\\n\" +\n \"Ivan Iverson is majoring in Information Technology with a GPA of 3.3\\n\" +\n \"Juan is majoring in Journalism with a GPA of 3.5\\n\";\n assertEquals(expectedResult, outContent.toString());\n System.setOut(System.out);\n }", "@Test\n\tpublic void testResponse() throws IOException {\n\t\tConfigurationManager config = new ConfigurationManager();\n\t\tHashMap<String, Handler> map = new HashMap<String,Handler>();\n\t\tHashMap<String, String> parameters = new HashMap<String, String>();\n\t\tcheckResponse(new RequestObject(\"\", \"\", parameters), HTTPConstants.BAD_REQUEST, map);\n\t\tcheckResponse(new RequestObject(\"PUT\", \"/reviewsearch\", parameters), HTTPConstants.NOT_ALLOWED, map);\n\t\tcheckResponse(new RequestObject(\"PULL\", \"/slackbot\", parameters), HTTPConstants.NOT_ALLOWED, map);\n\t\tcheckResponse(new RequestObject(\"GET\", \"/slackbot\", parameters), HTTPConstants.NOT_FOUND, map);\n\t\tcheckResponse(new RequestObject(\"POST\", \"/slackbot\", parameters), HTTPConstants.NOT_FOUND, map);\n\t\tmap.put(\"/slackbot\", new ChatHandler(config.getConfig()));\n\t\tcheckResponse(new RequestObject(\"POST\", \"/slackbot\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tcheckResponse(new RequestObject(\"POST\", \"/reviewsearch\", parameters), HTTPConstants.NOT_FOUND, map);\n\t\tmap.put(\"/reviewsearch\", new ReviewSearchHandler(config.getConfig(), new InvertedIndex()));\n\t\tcheckResponse(new RequestObject(\"POST\", \"/reviewsearch\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tparameters.put(\"query\", \"jumpers\");\n\t\tcheckResponse(new RequestObject(\"POST\", \"/reviewsearch\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tparameters.put(\"unknown\", \"unknown\");\n\t\tcheckResponse(new RequestObject(\"POST\", \"/reviewsearch\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tparameters.remove(\"query\");\n\t\tcheckResponse(new RequestObject(\"GET\", \"/reviewsearch\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tcheckResponse(new RequestObject(\"GET\", \"/\", parameters), HTTPConstants.NOT_FOUND, map);\n\t}", "public void printFailure() {\n //\n }", "public void printCommandResult(CommandResult result) {\n String commandResult = result.getResult();\n switch (commandResult) {\n case CommandResult.EXECUTION_SUCCESS:\n printSuccessCommandResult(result);\n break;\n case CommandResult.EXECUTION_FAIL:\n printFailCommandResult(result);\n break;\n default:\n System.out.println(\"SOMETHING WENT WRONG\");\n break;\n }\n }", "private void sout() {\n\t\t\n\t}", "private static void execWithOutput(String[] cmd)\n throws IOException\n {\n Process p = Runtime.getRuntime().exec(cmd);\n StreamRedirector errRedirector = new StreamRedirector(p.getErrorStream(), System.err);\n errRedirector.start();\n StreamRedirector outRedirector = new StreamRedirector(p.getInputStream(), System.out);\n outRedirector.start();\n }", "private static void consoleOutput() {\n\n Output airportFlightCounter = new AirportFlightCounter(airports);\n Output flightInventory = new FlightInventory(flights);\n Output flightPassengerCounter = new FlightPassengerCounter(flights);\n Output mileageCounter = new MileageCounter(flights, airports);\n\n airportFlightCounter.toConsole();\n flightInventory.toConsole();\n flightPassengerCounter.toConsole();\n mileageCounter.toConsole();\n }", "public void testHello() {\n FakeEngineManagerListener engineManagerListener = new FakeEngineManagerListener();\n try {\n EngineManager engineManager =\n new EngineManager(engineManagerListener, TEST_MAIN_SC_XML);\n\n // EngineManager.Event event = EngineManager.Event.HELLO;\n Node utterance = makeDoc(\"hello\");\n\n engineManager.fireEvent(\"user_input\", utterance);\n Thread.sleep(1000); // give the async trigger a chance\n\n // now we should have some output (the reply, \"hello\").\n\n assertEquals(1, engineManagerListener.getTargets().size());\n assertNull(engineManagerListener.getTargets().get(0));\n\n assertEquals(1, engineManagerListener.getTargetTypes().size());\n assertEquals(\"x-java\", engineManagerListener.getTargetTypes().get(0));\n\n assertEquals(1, engineManagerListener.getDatas().size());\n if (engineManagerListener.getDatas().get(0) != null) {\n Map<String, Node> data = engineManagerListener.getDatas().get(0);\n assertEquals(1, data.size());\n assertTrue(data.keySet().contains(\"speak0\"));\n Node outputNode = data.values().iterator().next();\n assertEquals(\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-16\\\"?>\" //\n + \"<data xmlns=\\\"http://www.w3.org/2005/07/scxml\\\" name=\\\"speak0\\\">\\n\" //\n + \" <messageId xmlns=\\\"http://www.joelsgarage.com/callcenter\\\">hello</messageId>\\n\" //\n + \"</data>\\n\", //\n XMLUtil.writeXML(outputNode));\n }\n } catch (InitializationException e) {\n e.printStackTrace();\n fail();\n } catch (InterruptedException e) {\n e.printStackTrace();\n fail();\n }\n }", "public void run() {\n assertEquals(sendQuery(\"SFO\"), 7);\n assertEquals(sendQuery(\"RHV\"), 1);\n assertEquals(sendQuery(\"xyzzy\"), 0);\n }", "public void ex02() {\n\n boolean hasFinished = false;\n\n\n if (hasFinished==true) {\n printResults();\n }\n\n\n }", "@After\n public void returnOutStream() { //\n System.setOut(System.out);\n }" ]
[ "0.66226023", "0.65592116", "0.6449299", "0.63710177", "0.6327571", "0.62289363", "0.6197313", "0.6192556", "0.6151575", "0.6112125", "0.6046635", "0.6037524", "0.6003795", "0.59847087", "0.597683", "0.59756845", "0.59619564", "0.59606683", "0.59551096", "0.5928967", "0.59285283", "0.5924253", "0.59222037", "0.58667016", "0.5850754", "0.5811048", "0.5797256", "0.5780124", "0.5753054", "0.5736386", "0.57315093", "0.5722256", "0.5701433", "0.5665", "0.5657352", "0.56558424", "0.56517017", "0.56331044", "0.5623723", "0.56154746", "0.56028503", "0.56024486", "0.5598201", "0.55976516", "0.5597497", "0.559352", "0.5588332", "0.55795413", "0.5573141", "0.55650795", "0.5561496", "0.55530673", "0.5530463", "0.5527105", "0.55232185", "0.55163085", "0.5516126", "0.5510613", "0.5503096", "0.5500205", "0.54958314", "0.54947597", "0.54853636", "0.5485105", "0.54846454", "0.5481533", "0.5480244", "0.54800093", "0.5477861", "0.5474726", "0.5474353", "0.5473882", "0.54715073", "0.5468328", "0.546798", "0.5464665", "0.5464644", "0.54634017", "0.5459107", "0.5457142", "0.54566187", "0.54529876", "0.54529494", "0.54511416", "0.5441946", "0.54397213", "0.5432064", "0.5429245", "0.5426973", "0.5426183", "0.5425963", "0.5423466", "0.5422397", "0.5421296", "0.5419224", "0.5418329", "0.54178375", "0.5417664", "0.5414231", "0.54086846", "0.5408648" ]
0.0
-1
test to check setting speed for car
@Test public void TestSetSpeed() { assertTrue(v1.setSpeed(70)); assertEquals("Speed of car is not set to 70.",v1.getSpeed(),70.0, 0); assertFalse(v2.setSpeed(150)); assertEquals("Speed of truck is changed from 0.",v2.getSpeed(), 0, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkSpeed() {\n\t\tboolean flag = oTest.checkSpeed();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "@Test\r\n\tpublic final void testSetSpeed() {\n\t\t a=new airConditioner(\"ON\",33);\r\n\t\tassertEquals(33,a.getSpeed());\r\n\t}", "boolean hasSpeed();", "boolean hasSpeed();", "boolean hasSpeed();", "boolean hasSpeed();", "boolean hasSpeed();", "boolean hasSpeed();", "@Test\r\n\tpublic final void testGetSpeed() {\n\t\tassertEquals(20,a.getSpeed());\r\n\t}", "public boolean isOverSpeed(){ return vehicleAvarageSpeed > roadMaxSpeed; }", "boolean hasSimspeed();", "@Test\n public void SpeedControlTest() {\n\n /**\n * Setting up mock\n * */\n Gdx.input = mock(Input.class);\n Course course = mock(Course.class);\n when(course.getLeftBoundary()).thenReturn(0);\n when(course.getRightBoundary()).thenReturn(1080);\n\n\n /**\n * tests cases for when increasing speed\n * creating player to test on and setting test case stats\n * */\n\n player.setStats(5, 11, 3, 3);\n\n float start = player.getCurrentSpeed();\n when(Gdx.input.isKeyPressed(Input.Keys.W)).thenReturn(true);\n player.GetInput(course);\n float finish = player.getCurrentSpeed();\n\n assertTrue(finish > start);\n\n /**\n * resetting stat\n * */\n player.setCurrentSpeed(2);\n\n /**\n * test cases for when decreasing speed\n * */\n when(Gdx.input.isKeyPressed(Input.Keys.S)).thenReturn(true);\n player.GetInput(course);\n\n assertTrue(2 > player.getCurrentSpeed());\n\n }", "public void setSpeed(float val) {speed = val;}", "public boolean isSetSpeed() {\n return this.speed != null;\n }", "@Test\n public void testGetMoveSpeedMultiplier() {\n assertEquals(1, proj.getMoveSpeedMultiplier(), 0.001);\n }", "public abstract void setSpeed(int sp);", "public void setVehicleSpeed(float value) {\n this.vehicleSpeed = value;\n }", "public void setSpeed(double speed)\r\n {\r\n this.speed = speed;\r\n }", "void setSpeed(RobotSpeedValue newSpeed);", "public void setSpeed() {\n //assigns the speed based on the shuffleboard with a default value of zero\n double tempSpeed = setpoint.getDouble(0.0);\n\n //runs the proportional control system based on the aquired speed\n controlRotator.proportionalSpeedSetter(tempSpeed);\n }", "public void verifySpeeds() {\n double maxStartSpeed = 0.0;\n double[] startSpeeds = new double[segments.size() + 1];\n startSpeeds[segments.size()] = 0.0;\n for (int i = segments.size() - 1; i >= 0; i--) {\n PathSegment segment = segments.get(i);\n maxStartSpeed += Math\n .sqrt(maxStartSpeed * maxStartSpeed + 2 * maxAccel * segment.getLength());\n startSpeeds[i] = segment.getStartState().vel();\n if (startSpeeds[i] > maxStartSpeed) {\n startSpeeds[i] = maxStartSpeed;\n }\n maxStartSpeed = startSpeeds[i];\n }\n for (int i = 0; i < segments.size(); i++) {\n PathSegment segment = segments.get(i);\n double endSpeed = startSpeeds[i + 1];\n MotionState startState = (i > 0) ? segments.get(i - 1).getEndState() : new MotionState(0, 0, 0, 0);\n startState = new MotionState(0, 0, startState.vel(), startState.vel());\n segment.createMotionProfiler(startState, endSpeed);\n }\n }", "public void setSpeed(double speed) {\n \tthis.speed = speed;\n }", "public void setSpeed(double speed) {\n this.speed = speed;\n }", "public void setSpeed(double speed) {\n this.speed = speed;\n }", "@Test\n public void testGetSetSpeedMax() {\n System.out.println(\"setSpeedMax\");\n Station aStation = new StationImpl();\n Float speedMax = 10.0f;\n Inlet instance = new Inlet(aStation);\n instance.setSpeedMax(speedMax);\n assertEquals(instance.getSpeedMax(), speedMax);\n \n }", "public void setSpeed(int value) {\n this.speed = value;\n }", "public void setSpeed(int s){\r\n\t\tspeed = s;\r\n\t}", "void simulationSpeedChange(int value);", "int getSimspeed();", "public void setSpeed(int value) {\n speed = value;\n if (speed < 40) {\n speedIter = speed == 0 ? 0 : speed / 4 + 1;\n speedWait = (44 - speed) * 3;\n fieldDispRate = 20;\n listDispRate = 20;\n } else if (speed < 100) {\n speedIter = speed * 2 - 70;\n fieldDispRate = (speed - 40) * speed / 50;\n speedWait = 1;\n listDispRate = 1000;\n } else {\n speedIter = 10000;\n fieldDispRate = 2000;\n speedWait = 1;\n listDispRate = 4000;\n }\n }", "void changeUpdateSpeed();", "public void setSpeed(int speed) {\n this.speed = speed;\n }", "int getSpeed();", "int getSpeed();", "int getSpeed();", "int getSpeed();", "int getSpeed();", "int getSpeed();", "@Override\n\tpublic void setSpeed(double speed) {\n\n\t}", "@Test\n public void checkFuelEnough() {\n Game.getInstance().getPlayer().setSolarSystems(SolarSystems.SOMEBI);\n Game.getInstance().getPlayer().setFuel(SolarSystems.SOMEBI.getDistance(SolarSystems.ADDAM) + 1);\n assertTrue(SolarSystems.SOMEBI.canTravel(SolarSystems.ADDAM));\n }", "public void setSpeed(float speed) {\n this.speed = speed;\n }", "public void setSpeed(float speed) {\n this.speed = speed;\n }", "public abstract int getSpeed();", "public abstract int getSpeed();", "public void setSpeed(int newSpeed)\n {\n speed = newSpeed;\n }", "double getSpeed();", "public void setSpeed(int wpm);", "@Test\n public void testSetTorque() {\n System.out.println(\"setTorque\");\n double torque = 95.0;\n Regime instance = r1;\n instance.setTorque(torque);\n double result=instance.getTorque();\n double expResult=95.0;\n assertEquals(expResult, result, 0.0);\n }", "public Boolean setSpeed(Integer speed)\r\n\t{\r\n\t\tspeed = checkSpeed(speed);\r\n String cmd = String.format(\"flippers/speed?value=%d\", speed);\r\n return cmdSimpleResult(cmd);\r\n\t}", "public boolean hasSpeed() {\n return ((bitField0_ & 0x00001000) == 0x00001000);\n }", "public boolean hasSpeed() {\n return ((bitField0_ & 0x00001000) == 0x00001000);\n }", "public boolean hasSpeed() {\n return ((bitField0_ & 0x00001000) == 0x00001000);\n }", "public void setSpeed() {\r\n\t\tthis.currSpeed = this.maxSpeed * this.myStrategy.setEffort(this.distRun);\r\n\t}", "public boolean hasSpeed() {\n return ((bitField0_ & 0x00001000) == 0x00001000);\n }", "public boolean hasSpeed() {\n return ((bitField0_ & 0x00001000) == 0x00001000);\n }", "public boolean hasSpeed() {\n return ((bitField0_ & 0x00001000) == 0x00001000);\n }", "public void setCurrentSpeed (double speed);", "public synchronized void set (double speed){\n m_liftSpeed = speed;\n if (m_liftSpeed < 0 && isLowerLimit() == false) {\n m_liftMotor.set(m_liftSpeed);\n } else if (m_liftSpeed > 0 && isUpperLimit() == false){\n m_liftMotor.set(m_liftSpeed);\n } else {\n m_liftSpeed = 0;\n m_liftMotor.set(0); \n }\n }", "public void testConstantSpeed() {\n double endtime = racetrack.getPerimeter() / racetrack.getVelocity();\n double epsilon = 0.000000000001;\n uniformMotion(racetrack, 0, endtime, dt, velocity, epsilon);\n }", "public abstract double getSpeed();", "@Test\n void testDefault() {\n final int SPEED = 5;\n final int X = 1;\n final int Y = 1;\n\n //positions to test against (correct conditions: X=x,Y=y)\n final int x = 1;\n final int y = 1;\n\n //Assigns Vehicle position x, y\n Vehicle vehicle = new Vehicle(X,Y,5);\n\n System.out.print(\"Vehicle speed is: \");\n System.out.println(vehicle.speed);\n\n //Testing vehicle positions and speed\n assertEquals(SPEED, vehicle.speed);\n assertEquals(x, vehicle.x);\n assertEquals(y, vehicle.y);\n\n\n\n }", "public boolean hasSpeed() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "public void setWalkSpeed(int n)\n{\n walkSpeed = n;\n}", "public boolean hasSpeed() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "@Override\npublic int accelerate(int speed) {\n\tint carSpeed=getSpeed();\n\treturn carSpeed;\n}", "public void setSpeed(double multiplier);", "public boolean hasSpeed() {\n return ((bitField0_ & 0x00000800) == 0x00000800);\n }", "@Override\n\tpublic void setSpeed(float speed) {\n\t\t\n\t}", "@Override\n public double speed() {\n \tif(Robot.drive.getDistance() > 120) {\n \t\treturn 0.2;\n \t}\n \treturn speed;\n }", "public boolean hasSpeed() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasSpeed() {\n return ((bitField0_ & 0x00000800) == 0x00000800);\n }", "public boolean hasSpeed() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public void setElevatorSpeed(double spd)\n {\n mSpeed = spd;\n }", "public void setSpeed() {\n if (this.equals(null)) {\n this.speedValue=-5;\n }\n }", "public void setNewSpeed(float simSpeed) {\n synchronized (settings){\n settings.setSimSpeed(simSpeed);\n\n if(settings.getSimSpeed() > 1000){\n settings.setSimSpeed(1000f);\n System.out.println(\"The simulation only supports a simSpeed between 0.001 and 1000!\");\n System.out.println(\"The simulation speed was set to 1000\");\n }\n if(settings.getSimSpeed() < 0){\n settings.setSimSpeed(0.001f);\n System.out.println(\"The simulation only supports a simSpeed between 0.001 and 1000!\");\n System.out.println(\"The simulation speed was set to 0.001\");\n }\n }\n }", "public void setSpeed(int newSpeed){\n\t\tmyVaisseau=Isep.getListeVaisseau();\n\t\tspeed=newSpeed;\t\t\n\t}", "@Test\n public void testDecrementSpeed() {\n saab.currentSpeed = .5;\n saab.decrementSpeed(.3);\n Assertions.assertTrue(saab.getCurrentSpeed() <= .2);\n }", "@Override\n\tpublic void set(double speed) {\n\t\tsuper.changeControlMode(TalonControlMode.PercentVbus);\n\t\tsuper.set(speed);\n\t\tsuper.enableControl();\n\t}", "public double getSpeed();", "@Override\r\n\tpublic boolean stopCondition(State<CarRpmState, CarControl> state) {\n\t\treturn (state.num>start.num && state.state.getSpeed()<0.5);\r\n\t}", "public void setSpeed(float speed) {\n this.speed = (int) speed * 13;\n }", "public void setMotors(final double speed, double spinnerSafetySpeedMod) {\n\n spinnerMotorCan.set(ControlMode.PercentOutput, speed);\n\n /// DEBUG CODE ///\n\n if (RobotMap.driveDebug) {\n System.out.println(\"Spinner Speed : \" + speed);\n }\n }", "public void setSpeed( Vector2 sp ) { speed = sp; }", "public void setSpeed(long speed) {\n\t\tmSpeed = speed;\n\t}", "@Override\r\n\tpublic void showSpeed() {\n\t\tSystem.out.println(\"i can run at 100km/h\");\r\n\t}", "public void changeSpeed(int speed);", "public void setSpeed(int speed) {\n\t\tthis.speed = speed;\n\t}", "public void setSpeed(int speed) {\n\t\tthis.speed = speed;\n\t}", "public void setSpeed(int speed) {\n\t\tthis.speed = speed;\n\t}", "protected void initialize() {\r\n \t((Launcher) Robot.fuelLauncher).controlSpeed(i);\r\n }", "public void setSpeed(float speed_)\n\t{\n\t\tthis.speed=speed_;\n\t}", "@Test\n\tpublic void test() {\n\t\tcar.setUpCar(model, brand, 150, 5);\n\t\tassertEquals(result, car.getBrandAndModel());\n\t}", "@Test\n public void checkIfSupportedTest() {\n assertTrue(EngineController.checkIfSupported(\"getMaxRotateSpeed\"));\n assertTrue(EngineController.checkIfSupported(\"rotate 10 1\"));\n assertTrue(EngineController.checkIfSupported(\"orient\"));\n // check interface, that specific for engine\n assertTrue(EngineController.checkIfSupported(\"getMaxThrust\"));\n assertTrue(EngineController.checkIfSupported(\"getCurrentThrust\"));\n assertTrue(EngineController.checkIfSupported(\"setThrust 333\"));\n }", "void OnSpeedChanges(float speed);", "public int getSpeed(){return this.speed;}", "private void setSpeedValues(){\n minSpeed = trackingList.get(0).getSpeed();\n maxSpeed = trackingList.get(0).getSpeed();\n averageSpeed = trackingList.get(0).getSpeed();\n\n double sumSpeed =0.0;\n for (TrackingEntry entry:trackingList) {\n\n sumSpeed += entry.getSpeed();\n\n //sets min Speed\n if (minSpeed > entry.getSpeed()){\n minSpeed = entry.getSpeed();\n }\n //sets max Speed\n if (maxSpeed < entry.getSpeed()) {\n maxSpeed = entry.getSpeed();\n }\n\n }\n\n averageSpeed = sumSpeed/trackingList.size();\n }", "public void setSpeed(int newSpeed)\n\t{\n\t\tspeed = newSpeed;\n\t}", "public void setSpeed(double speed) {\r\n this.speed = Math.min(1.0, Math.max(speed, 0));\r\n }", "@Override\n public void periodic() {\n\t\t// myDrive.\n\n\t\t// System.out.println(Robot.m_oi.getSpeed());\n\t\t// SmartDashboard.putNumber(\"Dial Output: \", Robot.m_oi.getSpeed());\n\n\t\t// //Wheel Speed Limits\n\n\t\t// SmartDashboard.putNumber(\"Front Left Percent\", myDrive.getFLSpeed());\n\t\t// SmartDashboard.putNumber(\"Front Right Percent\", myDrive.getFRSpeed());\n\t\t// SmartDashboard.putNumber(\"Rear Left Percent\", myDrive.getRLSpeed());\n\t\t// SmartDashboard.putNumber(\"Rear Right Percent\", myDrive.getRRSpeed());\n\n\t\t//Test Code for Selecting Calibration Motor \n\t\t//***COMMENT OUT BEFORE REAL GAME USE***\n\t\t// if (Robot.m_oi.getArmDown()) {\n\t\t// \t// System.out.println(\"Front Left Wheel Selected\");\n\t\t// \tWheel = 1;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getArmUp()) {\n\t\t// \t// System.out.println(\"Back Left Wheel Selected\");\n\t\t// \tWheel = 2;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getBallIn()) {\n\t\t// \t// System.out.println(\"Front Right Wheel Selected\");\n\t\t// \tWheel = 3;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getBallOut()) {\n\t\t// \t// System.out.println(\"Back Right Wheel Selected\");\n\t\t// \tWheel = 4;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getBlueButton()) {\n\t\t// \t// System.out.println(\"Back Right Wheel Selected\");\n\t\t// \tWheel = 0;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t// } \n\n\t\t// if (Wheel == 1) {\n\n\t\t// \tmyDrive.setFLSpeed(Robot.m_oi.getSpeed());\n\n\t\t// } else if (Wheel == 2) {\n\n\t\t// \tmyDrive.setRLSpeed(Robot.m_oi.getSpeed());\n\n\t\t// } else if (Wheel == 3) {\n\n\t\t// \tmyDrive.setFRSpeed(Robot.m_oi.getSpeed());\n\n\t\t// } else if (Wheel == 4) {\n\n\t\t// \tmyDrive.setRRSpeed(Robot.m_oi.getSpeed());\n\n\t\t// }\n\n\t\t// if (Robot.m_oi.getSafety()) {\n\n\t\t// \tspeedLimit = 1.0;\n\t\t// \tstrafeLimit = 1.0;\n\n\t\t// } else {\n\n\t\t// \tspeedLimit = 0.5; \n\t\t// \tstrafeLimit = 0.8;\n\t\t\t\t\n\t\t// }\n\n\n\n\t\t//System.out.print (\"strafeLimit: \" + strafeLimit);\n\t\t//System.out.println(Robot.m_oi.getX() * strafeLimit);\n\n\t\t// myDrive.driveCartesian(\n\t\t// \t(Robot.m_oi.getY() * speedLimit), // set Y speed\n\t\t// \t(Robot.m_oi.getX() * strafeLimit), // set X speed\n\t\t// \t(Robot.m_oi.getRotate() * rotateLimit), // set rotation rate\n\t\t// \t0); // gyro angle \n\t\t\n\t\t//TODO: Rotate robot with vision tracking, set up curve to slow down as target approaches center.\n\t\t// if (Robot.m_oi.getStartButton()) {\n\t\t// \tmyDrive.driveCartesian(\n\t\t// \t\t (0.4), // set Rotation\n\t\t// \t\t (0.0), // set Strafe\n\t\t// \t\t (0.0), // set Forward/Back\n\t\t// \t\t 0);\n\t\t// } else {\n\t\tmyDrive.driveCartesian(\n\t\t\t(Robot.m_oi.getY() * rotateLimit), // set Y speed\n\t\t\t(Robot.m_oi.getX() * strafeLimit), // set X speed\n\t\t\t(Robot.m_oi.getRotate() * speedLimit), // set rotation rate\n\t\t\t0);\n\t\t// }\n\t\t// myDrive.driveCartesian(\n\t\t// \t(Robot.m_oi.getY()), // set Y speed\n\t\t// \t(Robot.m_oi.getX()), // set X speed\n\t\t// \t(Robot.m_oi.getRotate()), // set rotation rate\n\t\t// \t0); \n\n }", "private void setBallSpeed() {\n RandomGenerator rgen = RandomGenerator.getInstance();\n vx = rgen.nextDouble(1.0, 3.0);\n if (rgen.nextBoolean(0.5)) {\n vx = - vx;\n }\n vy = BALL_SPEED;\n }" ]
[ "0.746904", "0.7197636", "0.7016296", "0.7016296", "0.7016296", "0.7016296", "0.7016296", "0.7016296", "0.6931608", "0.6794566", "0.66982776", "0.6666354", "0.6655941", "0.6483675", "0.6473631", "0.6418428", "0.6406024", "0.63672704", "0.63300407", "0.6294709", "0.62851906", "0.6265239", "0.6248647", "0.6248647", "0.62307554", "0.6206181", "0.6176495", "0.61735874", "0.61592823", "0.6155513", "0.6154501", "0.61374754", "0.61045474", "0.61045474", "0.61045474", "0.61045474", "0.61045474", "0.61045474", "0.6090909", "0.60749483", "0.60687155", "0.60687155", "0.60533845", "0.60533845", "0.60517925", "0.6049693", "0.6021346", "0.60189867", "0.60186356", "0.60179186", "0.60179186", "0.6017316", "0.6013038", "0.6008179", "0.6006784", "0.6006784", "0.59980905", "0.59934324", "0.59826994", "0.5975215", "0.5961771", "0.5956561", "0.5955562", "0.59480864", "0.59448975", "0.59440595", "0.5931929", "0.5929172", "0.59262836", "0.59178066", "0.5915682", "0.5908224", "0.58949775", "0.5887527", "0.5876097", "0.5868202", "0.5866955", "0.5861344", "0.5859467", "0.5854931", "0.5848804", "0.584363", "0.5834093", "0.5824407", "0.5816536", "0.5816525", "0.58134025", "0.58134025", "0.58134025", "0.58122694", "0.5802172", "0.57944316", "0.5793227", "0.57833797", "0.57824546", "0.5780726", "0.57743955", "0.5767041", "0.57658607", "0.5764019" ]
0.74362105
1
test to check the honk function
@Test public void TestHonk() { assertTrue(v1.setSpeed(25)); String carMessage = "Make way for car DL50, running at 25.0 mph, carrying 6 passengers."; assertTrue(v2.setSpeed(40)); String truckMessage = carMessage+"\nMake way for truck HR11, running at 40.0 mph, carrying 10 quintals of cargo."; v1.honk(); assertEquals("Honk message is incorrect for car v1.", carMessage, outContent.toString().strip()); v2.honk(); assertEquals("Honk message is incorrect for truck v2.", truckMessage, outContent.toString().strip()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkLoosePLayer(){\n if (hero.getHp()<=0){\n loose();\n }\n\n }", "void doCheckHealthy();", "@Test\r\n\tpublic final void testIsWon() {\r\n\t\tassertTrue(gameStatistics.isWon());\r\n\t\tassertFalse(gameStatisticsLoss.isWon());\r\n\t}", "@Test\n\tpublic void testIfKingHasLost()\n\t{\n\t\tData d = new Data(); \n\t\td.set(14, 34); // set a black piece to square 34\n\t\td.set(15, 32); // set a black piece to square 32\n\t\td.set(16, 22); //set a black piece to square 22, i.e. one above the king\n\t\td.set(17, 44); // set a black piece to square 44, i.e. one below the king\n\t\t\n\t\tassertTrue(d.kingLost(33));\n\t}", "public void testMoleKingInstantKO() {\n\t\tassertEquals(5, player.getHP());\n\t\tkingMole.update(kingMole.getMOLE_APPEARANCE_TIME());\n\t\tkingMole.update(0);\n\t\tassertEquals(0, player.getHP());\n\t}", "@Test\n\tpublic void testMoleKingHP() {\n\t\tassertEquals(20, kingMole.getHP());\n\t\tassertEquals(false, kingMole.isDead());\n\t\tfor (int i=0; i<19; i++) {\n\t\t\tkingMole.minusHP();\n\t\t}\n\t\tassertEquals(false, kingMole.isDead());\n\t\tkingMole.minusHP();\n\t\tassertEquals(true, kingMole.isDead());\n\t\t\n\t}", "@Test\n\t\tpublic void testKudomonStolen() throws KudomonCantBeCaughtException {\n\t\t thrown.expect(KudomonCantBeCaughtException.class);\n\t\t thrown.expectMessage(\"aggron has been stolen from you!\");\n\t\t testTrainer1.attemptCapture(aggron);\n\t\t testTrainer2.attemptCapture(aggron);\n\t\t}", "@Test\n\tpublic void testIfKingHasNotLost()\n\t{\n\t\tData d = new Data();\n\t\td.set(14, 34); // set a black piece to square 34\n\t\td.set(15, 32); // set a black piece to square 32\n\t\td.set(16, 22); //set a black piece to square 22, i.e. one above the king\n\t\td.set(17, 44); // set a black piece to square 44, i.e. one below the king\n\t\t\n\t\tassertFalse(d.kingLost(100)); \n\t}", "public void testGetWhoHasWon()\n {\n assertTrue(b1.getWhoHasWon() == Cell.EMPTY);\n }", "boolean getHealthy();", "@Test\n\tpublic void testIsWon() {\n\t\tGameState test = new GameState();\n\t\ttest.blankBoard();\n\t\tassertTrue(test.isWon());\n\t}", "@Test\n public void testHealthy() {\n checker.checkHealth();\n\n assertThat(checker.isHealthy(), is(true));\n }", "@Test\n\tpublic void testIfKingHasLostNearThrone()\n\t{\n\t\tData d = new Data();\n\t\td.set(9, 10); // move 9th white piece to the 10th square\n\t\td.set(10, 9); // move 10th white piece to the 9th square\n\t\td.set(11, 12); // move 11th white piece to the 12th square\n\t\td.set(12, 14); // move 12th white piece to the 14th square\n\t\td.set(14, 71); // set a black piece to square 71\n\t\td.set(15, 73); // set a black piece to square 73\n\t\td.set(16, 83); //set a black piece to square 83, i.e. one below the king\n\t\n\t\t\n\t\tassertTrue(d.kingLost(72)); // a square below the throne is 72\n\t}", "@Test\n public void kingTest() {\n assertTrue(!red_piece.isKing());\n red_piece.king();\n assertTrue(red_piece.isKing());\n assertTrue(!white_piece.isKing());\n }", "int getHappiness();", "abstract protected boolean isReadyToJog() throws GkException;", "@Test\n\tpublic void lateHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfLateHires() == 1);\n\t}", "@Test\n public void isGameOver()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Run / Verify.\n assertFalse(adjudicator.isGameOver(environment));\n }", "void checkWinner() {\n\t}", "boolean mo203k();", "@Test\n\tpublic void testWheatOfferings1() throws GameControlException {\n\t\tint result = GameControl.wheatOfferings(10, 2000);\n\t\tassertEquals(200, result);\n\t}", "@Test\n\t\tpublic void woeIsMeUnreachabletest() {\n\t\t\tassertTrue(System.currentTimeMillis() > 0);\n\t\t}", "public static void hvitetest1w(){\r\n\t}", "public boolean lokiAlive() {\n\t\tif (lokiHp <= 0) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void isGameOverNull()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Run / Verify.\n assertFalse(adjudicator.isGameOver(null));\n }", "public void testCheckOxyEmpty() {\n }", "@Test\n public void testValidHashZero() \n\t{\n\tLaboonCoin l = new LaboonCoin();\n\tboolean result = l.validHash(0,8);\n\tassertEquals(result, true);\n }", "@Test\n\tpublic void happyCheck() {\n\t\tMoodAnalyser moodAnalyser;\n\n\t\tmoodAnalyser = new MoodAnalyser(null);\n\n\t\tString mood;\n\t\ttry {\n\t\t\tmood = moodAnalyser.analyseMood();\n\t\t\tAssert.assertEquals(\"HAPPY\", mood);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t}", "@Test\n\tpublic void testGeldEinzahlenNormalfall() throws KontonummerNichtVorhandenException {\n\t\tktnr3= bank.kontoErstellen(testfabrik, Kunde.MUSTERMANN);\n\t\tMockito.doNothing().when(test1).notifyObservers();\n\t\tMockito.doNothing().when(test1).einzahlen(ArgumentMatchers.anyDouble());\n\t\tbank.geldEinzahlen(ktnr3, 150.0);\n\t\t\n\t\tMockito.verify(test1).einzahlen(ArgumentMatchers.anyDouble());\t\n\t\t\n\t}", "@Test\n\tpublic void preventTakeOffWhenStormyWeather() {\n\t\tException exception = new Exception();\n\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t\t// airport instance return stormy weather\n\t\t\twhen(weatherMock.getWeather()).thenReturn(\"stormy\");\n\t\t\theathrow.takeoff(tap);\n\t\t} catch (Exception e) {\n\t\t\texception = e;\n\t\t}\n\n\t\tassertEquals(\"Not allowed to takeoff in stormy weather\", exception.getMessage());\n\t\tassertEquals(1, heathrow.hangar.size());\n\t}", "public void check_empate_GAME_OVER() {\n doNothing().when(c0).sendEvent(EventType.GAME_OVER, null);\n \n //Capturamos el evento GAME_OVER y comprobamos sus parámetros\n ArgumentCaptor<Event> argument = ArgumentCaptor.forClass(Event.class);\n verify(c0, times(1)).sendEvent(eq(EventType.GAME_OVER), argument.capture());\n Object event = argument.getValue();\n WinnerValue wv = (WinnerValue) event;\n \n assertEquals(\"Al haber empate, el valor del ganador debería ser null\", null, wv);\n }", "@Test\n\tpublic void testIfKingIsWhite()\n\t{\n\t\tData d=new Data();\n\t\tassertTrue(d.isWhite(61));\n\t}", "@Test\r\n public void testOnkoSama() {\r\n System.out.println(\"onkoSama\");\r\n Pala toinenpala = null;\r\n Pala instance = null;\r\n boolean expResult = false;\r\n boolean result = instance.onkoSama(toinenpala);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Test\n\tpublic void bikesDamaged()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfBikesDamaged() == 1);\n\t}", "@Test\n public void testPlayerWon()\n {\n assertTrue(theEngine.inStartingState());\n theEngine.start();\n assertTrue(theEngine.inPlayingState());\n assertTrue(theEngine.getPlayer().living());\n\n theEngine.quit();\n assertTrue(theEngine.inHaltedState());\n \n theEngine.start();\n assertTrue(theEngine.inPlayingState());\n \n letPlayerWin();\n \n assertTrue(theEngine.getPlayer().living());\n assertTrue(getTheGame().playerWon());\n assertTrue(theEngine.inGameOverState());\n assertTrue(theEngine.inWonState());\n \n theEngine.start();\n assertTrue(theEngine.inStartingState());\n }", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkAbout() {\n\t\tboolean flag = oTest.checkAbout();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "@Test\n\tpublic void testTAlive3() {\n\t\tassertEquals(false, (tank.getHealth() == 0));\n\t}", "@Test\n\tpublic void testMonsterHPwithRock() {\n\t\tEngine engine = new Engine(20);\n\t\tint shouldHit = 1;\n\t\tengine.update();\n\t\tassertEquals(\"failure - monsterX's hp is not functioning properly\", shouldHit, engine.getMoveableObject(1).getHP(), 0.0);\n\t}", "private void checkFirstStep(Horse horse) {\n\n\t\tif(horse.isOnHouse()) {\n\t\t\tif(d1.getValue()==6||d2.getValue()==6) {\n\t\t\t\tsound.playOutNestSound();\n\t\t\t\tstatus.setText(\"Player \" + lb_currentplayername.getText() + \" horse is out\");\n\t\t\t\thorse.setOnHouse(false);\n\t\t\t\thorse.setPosition(horse.getPosition()+12*currentPlayer);\n\t\t\t\tthread=new MyThread(1, horse);\n\t\t\t\tthread.start();\n\t\t\t\tresetDisableButton(true);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthread=new MyThread(0, horse);\n\t\t\t\tthread.start();\n\t\t\t\tresetDisableButton(true);\n\t\t\t}\n\t\t}\n\n\t}", "@Test\n\tpublic void activeHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfActiveHires() == 1);\n\t}", "@Test\n public void lowHealthWarningTest() {\n }", "boolean hasFullHadith();", "boolean hasHat();", "@Test\n\tpublic void testHigherDifficulty()\n\t{\n\t\n\t\tLaboonCoin l = new LaboonCoin();\n\t\tassertTrue(l.validHash(1, 16619695));\t\n\t\t\t\n\t}", "@Test\n\tpublic void bikesAvailable()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfBikesAvailable() == 1);\n\t}", "@Test\n public void isMyPetHungry() {\n int isHungry = underTest.getHungerLevel();\n // Assert\n assertThat(isHungry, is(5));\n }", "public boolean mo5370d() {\n throw null;\n }", "@Override\r\n\tint check_sweetness() {\n\t\treturn 30;\r\n\t}", "boolean hasBunho();", "boolean hasBunho();", "public void testGetUptime() {\n assertTrue(mb.getUptime() > -1);\n }", "@Test\n\tpublic void planeCanTakeOff() {\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t} catch (Exception exception) {\n\n\t\t}\n\n\t\ttry {\n\t\t\theathrow.takeoff(tap);\n\t\t} catch (Exception exception) {\n\n\t\t}\n\n\t\tassertEquals(expectedPlanes, heathrow.hangar);\n\t\tassertTrue(heathrow.hangar.isEmpty());\n\t}", "boolean isGameOver();", "boolean isGameOver();", "boolean hasHangmogCode();", "public boolean gameOverTick(Game game) {\n\t\treturn false;\n\t}", "@Test\n\tpublic void testPlayerHPwithRock() {\n\tEngine engine = new Engine(20);\n\t\tint shouldHit = 2;\n\t\tfor (int i = 0; i < 9; i++ ) {\n\t\t\tengine.update();\n\t\t}\n\t\tassertEquals(\"failure - player's hp is not functioning properly\", shouldHit, engine.getMoveableObject(0).getHP(), 0.0);\t\n\t}", "boolean hasHangmogName();", "protected boolean triggerAlert() throws Throwable {\n runSystemCommand(SSH_ROOT + adminVIP + \" hostname\");\n String master = stdout.readLine();\n int i = ((int)(Math.random() * nodes));\n String node = \"hcb\" + (i + 1 + NODE_NUM_OFFSET);\n while (node.equals(master)) {\n i = ((int)(Math.random() * nodes));\n node = \"hcb\"+(i + 1 + NODE_NUM_OFFSET);\n }\n int n = i + 1 + NODE_NUM_OFFSET;\n int d = (int)(Math.random() * DISKS_PER_NODE);\n diskString = \"DISK-\" + n + \":\" + d;\n cli.runCommand(\"hwcfg -F -D \" + diskString);\n pause(SLEEP_DISK_DOWN);\n cli.runCommand(\"hwcfg -F -E \" + diskString);\n pause(SLEEP_DISK_DOWN);\n waitForClusterToStart();\n return true;\n }", "@Test\n\tpublic void testHarvestWheat1() throws GameControlException {\n\t\tint result = GameControl.harvestWheat(900, 15, 1, 2, 4);\n\t\tassertEquals(3600, result);\n\t}", "public boolean gameOver();", "public boolean gameOver();", "private void checkIfHungry(){\r\n\t\tif (myRC.getEnergonLevel() * 2.5 < myRC.getMaxEnergonLevel()) {\r\n\t\t\tmission = Mission.HUNGRY;\r\n\t\t}\r\n\t}", "@Test\n void win() {\n getGame().start();\n assertThat(getGame().isInProgress()).isTrue();\n getGame().move(getPlayer(), Direction.EAST);\n getGame().move(getPlayer(), Direction.EAST);\n verify(observer).levelWon();\n assertThat(getGame().isInProgress()).isFalse();\n }", "void ok();", "boolean hasCurHP();", "boolean hasCurHP();", "boolean hasCurHP();", "boolean hasCurHP();", "boolean hasCurHP();", "boolean hasCurHP();", "public abstract boolean zzbek();", "private boolean gameOver() {\r\n\t\treturn (lifeBar == null || mehran == null);\r\n\t}", "boolean mo51986hp();", "boolean testOnTick(Tester t) {\n return t\n .checkExpect(new NBullets(0).onTickTester(), new NBullets(new MtLoGamePiece(),\n new MtLoGamePiece(), 0, 0, 1))\n && t.checkExpect(new NBullets(lob2, los3, 8, 12, 23, new Random(2)).onTickTester(),\n new NBullets(\n new ConsLoGamePiece(\n new Bullet(2, Color.PINK, new MyPosn(250, 292), new MyPosn(0, -8), 1),\n new ConsLoGamePiece(\n new Bullet(4, Color.PINK, new MyPosn(51, 50), new MyPosn(1, 0), 2),\n new ConsLoGamePiece(\n new Bullet(4, Color.PINK, new MyPosn(51, 50), new MyPosn(-1, 0), 2),\n new MtLoGamePiece()))),\n new ConsLoGamePiece(new Ship(10, Color.CYAN, new MyPosn(4, 239), new MyPosn(4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(496, 248), new MyPosn(-4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(50, 200), new MyPosn(50, 50)),\n new MtLoGamePiece()))),\n 8, 14, 24))\n && t.checkExpect(new NBullets(lob5, los3, 8, 12, 23, new Random(2)).onTickTester(),\n new NBullets(new MtLoGamePiece(), new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(4, 239), new MyPosn(4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(496, 248), new MyPosn(-4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(51, 50), new MyPosn(1, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(51, 50), new MyPosn(1, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(50, 200), new MyPosn(50, 50)),\n new MtLoGamePiece()))))),\n 8, 12, 24));\n }", "boolean testOnTickTester(Tester t) {\n return t\n .checkExpect(new NBullets(0).onTickTester(), new NBullets(new MtLoGamePiece(),\n new MtLoGamePiece(), 0, 0, 1, new Random()))\n && t.checkExpect(new NBullets(lob2, los3, 8, 12, 23, new Random(2)).onTickTester(),\n new NBullets(\n new ConsLoGamePiece(\n new Bullet(2, Color.PINK, new MyPosn(250, 292), new MyPosn(0, -8), 1),\n new ConsLoGamePiece(\n new Bullet(4, Color.PINK, new MyPosn(51, 50), new MyPosn(1, 0), 2),\n new ConsLoGamePiece(\n new Bullet(4, Color.PINK, new MyPosn(51, 50), new MyPosn(-1, 0), 2),\n new MtLoGamePiece()))),\n new ConsLoGamePiece(new Ship(10, Color.CYAN, new MyPosn(4, 239), new MyPosn(4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(496, 248), new MyPosn(-4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(50, 200), new MyPosn(50, 50)),\n new MtLoGamePiece()))),\n 8, 14, 24, new Random()))\n && t.checkExpect(new NBullets(lob5, los3, 8, 12, 23, new Random(2)).onTickTester(),\n new NBullets(new MtLoGamePiece(),\n new ConsLoGamePiece(new Ship(10, Color.CYAN, new MyPosn(4, 239), new MyPosn(4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(496, 248), new MyPosn(-4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(51, 50), new MyPosn(1, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(51, 50), new MyPosn(1, 0)),\n new ConsLoGamePiece(new Ship(10, Color.CYAN, new MyPosn(50, 200),\n new MyPosn(50, 50)), new MtLoGamePiece()))))),\n 8, 12, 24, new Random()));\n }", "public boolean gameWon(){\n return false;\n }", "@Test\n\tpublic void testTAlive1() {\n\t\tassertEquals(false, tank.isDeceased());\n\t}", "@Test\r\n\tpublic void emptyOneSideEndsGame() {\r\n\t\tBowl bowl = setupGame(new Bowl());\r\n\t\tvar player = new Player();\r\n\t\tvar answer = bowl.gameEndCheck();\r\n\t\tassertEquals(false,answer);\r\n\t\tbowl.getNeighbor(5).playTurn(player);\r\n\t\tanswer = bowl.getNeighbor(6).gameEndCheck();\r\n\t\tassertEquals(true,answer);\r\n\t}", "@Test\n public void testOverflowClient()\n {\n String sName = \"local-overflow-client\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "@Test\n\tpublic void bikesOnHire()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfBikesOnHire() == 2);\n\t}", "public HawthornWandBehaviorTest() {\n \n }", "@Test\n\tpublic void testLessDifficulty()\n\t{\n\t\tLaboonCoin l = new LaboonCoin();\n\t\tassertTrue(l.validHash(5, 212));\t\n\t}", "public void caughtCheating(){\n\t\tinGoodStanding = false;\n\t}", "public void checkGame() {\n\n\t}", "@Test\n void basicTest() {\n final OSEntropyCheck.Report report =\n assertDoesNotThrow(() -> OSEntropyCheck.execute(), \"Check should not throw\");\n assertTrue(report.success(), \"Check should succeed\");\n assertNotNull(report.elapsedNanos(), \"Elapsed nanos should not be null\");\n assertTrue(report.elapsedNanos() > 0, \"Elapsed nanos should have a positive value\");\n assertNotNull(report.randomLong(), \"A random long should have been generated\");\n }", "boolean hasHPValue();", "public boolean isOn() throws Exception;", "@Test\n public void testHMacValidate() throws Exception {\n System.out.println(\"hMacValidate\");\n String key = \"secret\";\n boolean expResult = true;\n boolean result = instance.hMacValidate(key);\n assertEquals(expResult, result);\n }", "@Ignore\r\n @Test\r\n public void shouldReturnValidTime() {\n\r\n HealthCheck hc = client.healthCheck();\r\n assertNotNull(hc.getCurrentTime());\r\n }", "@Test\n public void testHasSugarmanWon() {\n System.out.println(\"hasSugarmanWon\");\n Sugarman instance = new Sugarman();\n instance.changeSugarLevel(100);\n boolean expResult = true;\n boolean result = instance.hasSugarmanWon();\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 }", "@Test\n\tpublic void completeHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfCompleteHires() == 2);\n\t}", "public boolean isGameOver();", "public boolean isGameOver();", "boolean hasWhid();", "@Before\n public void setUp() {\n \n hawthorn1 = new HawthornWandBehavior();\n }", "@Test\n\tpublic void testGetBehandelingNaam(){\n\t\tString expResult = \"Hamstring\";\n\t\tassertTrue(expResult == Behandelcode.getBehandelingNaam());\n\t}", "@Test\n\tpublic void testGetBehandelCode() throws Exception {\n\t\tint expResult = 001;\n\t\tassertTrue(instance.getBehandelCode() == expResult);\n\t}", "@Override\r\n\tint check_sweetness() {\n\t\treturn 10;\r\n\t}", "int mo200h() throws RemoteException;" ]
[ "0.6398135", "0.6254844", "0.6254276", "0.6246255", "0.62405485", "0.61987054", "0.61687386", "0.61382556", "0.6033679", "0.6030656", "0.59969157", "0.59922534", "0.5966206", "0.596186", "0.59504193", "0.5948282", "0.5916726", "0.58936447", "0.58831275", "0.5869334", "0.5854804", "0.5852771", "0.5852761", "0.5823713", "0.58022916", "0.5794755", "0.5792503", "0.5786586", "0.5778535", "0.5775384", "0.5767597", "0.5766049", "0.5732478", "0.5723869", "0.57238406", "0.5721001", "0.5713344", "0.5713182", "0.57090765", "0.570402", "0.5691177", "0.5690786", "0.5680431", "0.5678741", "0.56715006", "0.56606466", "0.56542903", "0.5650002", "0.5647912", "0.5647912", "0.56477314", "0.5646356", "0.56436175", "0.56436175", "0.56395453", "0.5601558", "0.5581674", "0.556747", "0.55633384", "0.5553195", "0.55529726", "0.55529726", "0.5550809", "0.5548876", "0.5546878", "0.55448526", "0.55448526", "0.55448526", "0.55448526", "0.55448526", "0.55448526", "0.5534093", "0.55309933", "0.5521044", "0.552002", "0.5502841", "0.54984087", "0.5496498", "0.54900545", "0.5488595", "0.5488536", "0.5488509", "0.54842234", "0.5477414", "0.5467024", "0.5465707", "0.54642785", "0.54638755", "0.54625124", "0.5454062", "0.5452801", "0.5449339", "0.54470533", "0.54470533", "0.5446851", "0.54460067", "0.54435533", "0.54403657", "0.54398733", "0.5433483" ]
0.66556066
0
Return whether marker with same location is already on map
private static boolean mapAlreadyHasMarkerForLocation(String location, HashMap<String, String> markerLocation) { return (markerLocation.containsValue(location)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasLatLng();", "protected abstract boolean isMarkerPositionInternal(int index);", "boolean hasLocation();", "boolean hasLocation();", "public boolean containsInformation(Position position){\n return savedMap[position.getLatitude()][position.getLongitude()] != -1;\n }", "boolean isCurrentTrackDataMarkerPosition(int position) {\n return currentTrackData[position].isMarkerPosition(position);\n }", "@Override\n public boolean onMarkerClick(Marker marker) {\n if (Objects.equals(marker.getTag(), true)) {\n Toast.makeText(MapsActivity.this,\n \"Own marker\", Toast.LENGTH_SHORT).show();\n } else {\n try {\n showDetails(marker);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n return true;\n }", "private boolean MARK(Marker m) {\r\n if (look > 0) return true;\r\n if (marked > in) throw new Error(\"marked \" + marked + \" in \" + in);\r\n if (marked < in) {\r\n markers.clear();\r\n marked = in;\r\n }\r\n markers.add(m);\r\n return true;\r\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (obj == null)\n\t\t\treturn false;\n\n\t\tif (!(obj instanceof Location))\n\t\t\treturn false;\n\n\t\tif (obj == this)\n\t\t\treturn true;\n\n\t\tLocation that = (Location) obj;\n\n\t\treturn this.map == that.map && this.y() == that.y() && this.x() == that.x();\n\t}", "private boolean knowMyLocation(LatLng myloc) {\n\t\tboolean isindoor = true;\n\t\tif((myloc.latitude>42.395||myloc.latitude<42.393) && (myloc.longitude>-72.528||myloc.longitude<-72.529)){\n\t\t\tisindoor = false;\n\t\t}\n\t\treturn isindoor;\n\t}", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "private boolean hasMarker(Component paramComponent)\n/* */ {\n/* 1006 */ for (Iterator localIterator = this.typeAheadMarkers.iterator(); localIterator.hasNext();) {\n/* 1007 */ if (((TypeAheadMarker)localIterator.next()).untilFocused == paramComponent) {\n/* 1008 */ return true;\n/* */ }\n/* */ }\n/* 1011 */ return false;\n/* */ }", "boolean hasCoordinates();", "boolean hasCoordinates();", "boolean hasCoordinates();", "public boolean isMarkerChange() {\n \t\t\treturn fMarkerChange;\n \t\t}", "boolean hasHasLatitude();", "public boolean isAtLocation(Location loc) {\n return loc.equals(loc);\n }", "boolean hasLatitude();", "boolean hasLatitude();", "public boolean onMarkerClick(Marker arg0) {\n\t\t\n\t\tif(arg0.equals(startMarker) || arg0.equals(endMarker))\n\t\t\treturn false;\n\t\t\n\t\tSet<DBMarker> keyList = markerHashTable.keySet();\n\t\tDBMarker editedMarker = null;\n\t\t\n\t\tfor(DBMarker marker : keyList)\n\t\t{\n\t\t\tif(markerHashTable.get(marker).equals(arg0))\n\t\t\t{\n\t\t\t\t//editedMarker = someFunction(markerHashTable.get(marker));\n\t\t\t\tmarkerHashTable.put(editedMarker, arg0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public boolean hasLatLng() {\n return this.mLatLng != null;\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (getClass() != obj.getClass())\n\t\t\treturn false;\n\t\tGridMarker other = (GridMarker) obj;\n\t\tif (colour == null) {\n\t\t\tif (other.colour != null)\n\t\t\t\treturn false;\n\t\t} else if (!colour.equals(other.colour))\n\t\t\treturn false;\n\t\tif (shape == null) {\n\t\t\tif (other.shape != null)\n\t\t\t\treturn false;\n\t\t} else if (!shape.equals(other.shape))\n\t\t\treturn false;\n\t\treturn true;\n\t}", "public boolean getAnyMarker(int notSpecies) {\r\n\t\t//returns true if any marker not of species notSpecies is true\r\n\t\tint i = 0;\r\n\t\tint j = 0;\r\n\t\tfor(i = 0; i < this.markers.length; i++){\r\n\t\t\tif(i != notSpecies){\r\n\t\t\t\tfor(j = 0; j < 6; j++){\r\n\t\t\t\t\tif(this.markers[i][j] == true){\r\n\t\t\t\t\t\treturn true;\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 false;\r\n\t}", "public boolean isMarkerPosition(int position) {\n return isDiskImageMounted() && isMarkerPositionInternal(getPositionIndex(position));\n }", "@Override\n public boolean onMarkerClick(Marker marker) {\n for(MapItem mi : lmi) {\n Log.d(TAG, \"clickCount \"+mi.getId()+\" \"+\n marker.getTag());\n if(mi.getId().equals(marker.getTag())) {\n Log.d(TAG, \"clickCount \"+mi.getImages().get(0));\n Picasso.get().load(mi.getImages().get(0)).into(sh.getI0());\n sh.setVisibility(View.VISIBLE);\n sh.fill(mi.getSiteName(), mi.getCreator(),\n \"\"+mi.getSiteLocation().getLatitude()+\", \"+mi.getSiteLocation().getLongitude());\n }\n }\n\n return false;\n }", "private boolean canFindLocationAddress(){\n\n Geocoder geo = new Geocoder(this);\n\n //Get address provided for location as Address object\n try{\n List<Address> foundAddresses = geo.getFromLocationName(location.getAddress(),1);\n //Return true if an address is found\n return (foundAddresses.size() == 1);\n }\n catch(IOException e){\n e.printStackTrace();\n return false;\n }\n\n }", "private boolean markersClose(Marker one, Marker two) {\n if (one.getID() == two.getID()) {\n if (one.getArea() - two.getArea() < 20 && one.getArea() - two\n .getArea\n () > -20) {\n log.debug(TAG, \"Removing double marker! ID: \" + one.getID());\n return true;\n }\n }\n return false;\n }", "boolean hasCoordInfo();", "boolean hasLongitude();", "boolean hasLongitude();", "public boolean createMarker(ArrayList<LocationsData>datas) {\n\n boolean isNotEmpty= true;\n if (isNotEmpty) {\n placesMarker= placesMap.addMarker(new MarkerOptions()\n .position(new LatLng(datas.get(0).locationLatitude,datas.get(0).locationLongitude))\n .title(datas.get(0).locationName));\n placesMarker.showInfoWindow();\n placesMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {\n @Override\n public boolean onMarkerClick(Marker marker) {\n Log.i(\"Places Marker\",marker.getTitle()+\"\\n\"+places.toString());\n\n LocationsData data= new LocationsData();\n data.set_id(places.get(0).get_id());\n data.setImage_path(places.get(0).getImage_path());\n data.setLocationName(places.get(0).getLocationName());\n data.setLocationLatitude(places.get(0).getLocationLatitude());\n data.setLocationLongitude(places.get(0).getLocationLongitude());\n data.setLocationProducts(places.get(0).getLocationProducts());\n\n Intent i= new Intent(MainActivity.this,PlaceDetailsActivity.class);\n i.putExtra(\"places\",data);\n startActivity(i);\n\n Log.i(\"Intent\",i.toString());\n Log.i(\"onMarkerClick\",\"Successfull, Title: \"+marker.getTitle());\n Log.i(\"Getting Item Id\",String.valueOf(places.get(0).get_id()));\n return false;\n }\n });\n }else {\n isNotEmpty=false;\n }\n return isNotEmpty;\n }", "public abstract Boolean isExist(LocationDto location);", "public boolean sameLocation(SearchResult other) {\n\t\t\treturn this.location.compareTo(other.location) == 0;\n\t\t}", "public Boolean sameCenterPoints(Cell cell) {\r\n int centerX = cell.getcenterX();\r\n int centerY = cell.getcenterY();\r\n for (int i = 0; i < cells.size(); i++) {\r\n Cell currCell = cells.get(i);\r\n if (currCell.getcenterX()==centerX && currCell.getcenterY()==centerY\r\n ) {\r\n return (true);\r\n }\r\n }\r\n return false;\r\n }", "@Override\n public boolean onMarkerClick(Marker marker) {\n\n marker.showInfoWindow();\n marker.setTag(true);\n totalCounter = totalCounter + 1;\n\n // If both stations have been selected save destination station id to array\n\n if ((totalCounter % 2) == 0 ) {\n\n // Iterate current stations and save its id to array\n\n for (int i = 0; i < currentStations.size(); i++) {\n if (currentStations.get(i).getName().equals(marker.getTitle())) {\n stationIDs[1] = currentStations.get(i).getId();\n }\n }\n\n // If destination station is the same as start station, prompt user to select a different station\n\n if (stationIDs[0] == stationIDs[1]) {\n\n stationIDs[1] = -1;\n totalCounter = totalCounter - 1;\n Helpers.showToast(getApplicationContext(), \"Select a different station for destination\");\n\n } else {\n infoMessage.setText(\"Destination: \" + marker.getTitle());\n }\n\n } else {\n\n // If number of stations selected is not an even number, mark their tag with false value\n\n stationIDs[0] = -1;\n stationIDs[1] = -1;\n\n for (Marker currentMarker : mMarkerArray) {\n marker.hideInfoWindow();\n currentMarker.setTag(false);\n }\n\n // Iterate current stations and save its id to array\n\n for (int i = 0; i < currentStations.size(); i++) {\n if (currentStations.get(i).getName().equals(marker.getTitle())) {\n stationIDs[0] = currentStations.get(i).getId();\n }\n }\n marker.showInfoWindow();\n marker.setTag(true);\n infoMessage.setText(\"From station: \" + marker.getTitle());\n }\n return true;\n }", "@Override\n public void onMarkerDragStart(Marker marker) {\n if(marker.equals(markerPruebaDrag)){\n Toast.makeText(this, \"Start\", Toast.LENGTH_SHORT).show();\n }\n }", "@Override\n\t\t\t\tpublic boolean onMarkerClick(Marker arg0) {\n\t\t\t\t\t\n\t\t\t\t\tfor(final PoiInfo poiInfo:AppContext.listmap){\n\t\t\t\t\t\tif(poiInfo.location.latitude==arg0.getPosition().latitude&&poiInfo.location.longitude==arg0.getPosition().longitude){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tView mView = LayoutInflater.from(ZhouBianYaodian.this).inflate(R.layout.map_massage_data, null);\n\t\t\t\t\t\t\tTextView dataname=(TextView) mView.findViewById(R.id.txt_map_name);\n\t\t\t\t\t\t\tTextView address=(TextView)mView. findViewById(R.id.txt_map_address);\n\t\t\t\t\t\t\tImageView imageView=(ImageView)mView. findViewById(R.id.map_image_call); \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdataname.setText(poiInfo.name==null?\"\":poiInfo.name);\n\t\t\t\t\t\t\t\taddress.setText(poiInfo.address==null?\"\":poiInfo.address);\n\t\t\t\t\t\t\t\tif(poiInfo.phoneNum!=null&&!poiInfo.phoneNum.equals(\"\")){\n\t\t\t\t\t\t\t\t\timageView.setVisibility(ImageView.VISIBLE);\n\t\t\t\t\t\t\t\t\timageView.setOnClickListener(new OnClickListener() {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\t\t\t\t\tIntent intent = new Intent(Intent.ACTION_DIAL, Uri\n\t\t\t\t\t\t\t\t\t\t\t\t\t.parse(\"tel:\" + poiInfo.phoneNum));\n\t\t\t\t\t\t\t\t\t\t\tLog.d(\"测试数据\", poiInfo.phoneNum);\n\t\t\t\t\t\t\t\t\t\t\tstartActivity(intent);\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\tmInfoWindow= new InfoWindow(mView,arg0.getPosition(), -47);\n\t\t\t\t\t\t\tmBaiduMap.showInfoWindow(mInfoWindow);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}", "boolean hasHasLongitude();", "private boolean checkExistLocationPoint(String point, String lPoint) {\n\n ArrayList<LocationPointModel> listLocationPoint ;\n\n listLocationPoint = point.equals(\"loading\")?listLoadingnPoint : listDestinationPoint ;\n\n for (LocationPointModel lPointModel:listLocationPoint) {\n if(lPointModel.locPoint.toLowerCase().trim().equals(lPoint.toLowerCase().trim()))\n {\n Toast.makeText(getActivity(),(point.equals(\"loading\")?\"Loading\":\"Destination\")+\" point already exists!\", Toast.LENGTH_SHORT).show();\n return true ;\n }\n }\n return false ;\n\n }", "public boolean locatedElsewhere(Card card) {\n\t\treturn (x != card.getX() || y != card.getY());\n\t}", "public abstract boolean locationExists(Location location);", "public boolean alreadyOwnsIdenticalRoute(){\n City city1 = mSelectedRoute.getCity1();\n City city2 = mSelectedRoute.getCity2();\n for(int i=0; i<mUser.getClaimedRoutes().size(); i++){\n City ownedCity1 = mUser.getClaimedRoutes().get(i).getCity1();\n City ownedCity2 = mUser.getClaimedRoutes().get(i).getCity2();\n if(city1.equals(ownedCity1) && city2.equals(ownedCity2))\n return true;\n }\n return false;\n }", "boolean hasPosition();", "boolean hasPosition();", "boolean hasPosition();", "boolean hasPosition();", "private boolean containsSameCoord(Point p) {\n boolean elementsContainsP = false;\n Iterator<Point> it = _elements.iterator();\n while (it.hasNext()) {\n Point pt = it.next();\n if (x(pt) == x(p) && y(pt) == y(p)) {\n elementsContainsP = true;\n break;\n }\n }\n return elementsContainsP;\n }", "public boolean cellAlreadyExists(Cell c) {\r\n for (Cell cell : cells) {\r\n if (Arrays.equals(c.getShape().xpoints, cell.getShape().xpoints)) { // && Arrays.equals(c.getShape().ypoints, cell.getShape().ypoints)) {\r\n\r\n return true;\r\n }\r\n }\r\n return false;\r\n\r\n }", "public boolean isAmbiguous() {\n return positionMap.size() > 1;\n }", "private boolean towerLocation(final Point current_point) {\r\n\t\tfor (int i = 0; i < my_towers.size(); i++) {\r\n\t\t\tif (my_towers.get(i).getLocation().equals(current_point)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean seen( K key ) {\n return map.containsKey( key );\n }", "private void addMarkerOnMap(double latitude, double longitude) {\n try {\n //System.out.println(\"LAT::: \" + latitude);\n //System.out.println(\"LONG::: \" + longitude);\n mCurrentLocationLat = latitude;\n mCurrentLocationLongitude = longitude;\n if (markerOptions == null)\n markerOptions = new MarkerOptions();\n\n // Creating a LatLng object for the current / new location\n LatLng currentLatLng = new LatLng(latitude, longitude);\n markerOptions.position(currentLatLng).icon(BitmapDescriptorFactory.defaultMarker()).title(\"Current Location\");\n\n if (mapMarker != null)\n mapMarker.remove();\n\n mapMarker = mMap.addMarker(markerOptions);\n\n// if (dlBean.getAddress() != null) {\n// if (!dlBean.getAddress().equals(\"No Location Found\") && !dlBean.getAddress().equals(\"No Address returned\") && !dlBean.getAddress().equals(\"No Network To Get Address\"))\n// mapMarker.setTitle(dlBean.getAddress());\n// }\n\n // Showing the current location in Google Map by Zooming it\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(currentLatLng, 15));\n\n for (TripsheetSOList saleOrder : tripSheetSOList) {\n AgentLatLong agentLatLong = new AgentLatLong();\n double distance;\n\n // We are calculating distance b/w current location and agent location if lat long are not empty\n if (saleOrder.getmTripshetSOAgentLatitude() != null && !saleOrder.getmTripshetSOAgentLatitude().equals(\"\") && saleOrder.getmTripshetSOAgentLongitude() != null && !saleOrder.getmTripshetSOAgentLongitude().equals(\"\")) {\n double agentLatitude = Double.parseDouble(saleOrder.getmTripshetSOAgentLatitude());\n double agentLongitude = Double.parseDouble(saleOrder.getmTripshetSOAgentLongitude());\n\n distance = getDistanceBetweenLocationsInMeters(mCurrentLocationLat, mCurrentLocationLongitude, agentLatitude, agentLongitude);\n\n agentLatLong.setAgentName(saleOrder.getmTripshetSOAgentFirstName());\n agentLatLong.setLatitude(agentLatitude);\n agentLatLong.setLongitude(agentLongitude);\n agentLatLong.setDistance(distance);\n\n agentsLatLongList.add(agentLatLong);\n\n } else {\n distance = 0.0;\n }\n\n saleOrder.setDistance(Math.round(distance / 1000));\n }\n\n // Sorting by distance in descending order i.e. nearest destination\n Collections.sort(agentsLatLongList, new Comparator<AgentLatLong>() {\n @Override\n public int compare(AgentLatLong o1, AgentLatLong o2) {\n return o1.getDistance().compareTo(o2.getDistance());\n }\n });\n\n Collections.sort(tripSheetSOList, new Comparator<TripsheetSOList>() {\n @Override\n public int compare(TripsheetSOList o1, TripsheetSOList o2) {\n return o1.getDistance().compareTo(o2.getDistance());\n }\n });\n\n // to update distance value in list after getting current location details.\n if (mTripsheetSOAdapter != null) {\n mTripsheetSOAdapter.setAllSaleOrdersList(tripSheetSOList);\n mTripsheetSOAdapter.notifyDataSetChanged();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public boolean getMarker() {\n return (buffer.get(1) & 0xff & 0x80) == 0x80;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Location)) {\r\n return false;\r\n }\r\n Location other = (Location) object;\r\n if ((this.locId == null && other.locId != null) || (this.locId != null && !this.locId.equals(other.locId))) {\r\n return false;\r\n }\r\n return true;\r\n }", "private boolean placeFlag(Location m) {\r\n\r\n // if the game is finished then nothing to do\r\n if (gameState > STARTED) {\r\n return false;\r\n } \r\n \r\n // if the location is already revealed then nothing more to do\r\n if (query(m) != GameStateModel.HIDDEN && query(m) != GameStateModel.FLAG) {\r\n return false;\r\n }\r\n \r\n // otherwise toggle the flag\r\n flag[m.x][m.y] = !flag[m.x][m.y];\r\n \r\n if (flag[m.x][m.y]) {\r\n \r\n //if (board[m.x][m.y] != GameState.MINE) {\r\n // System.out.println(\"DEBUG (\" + m.x + \",\" + m.y + \") is not a mine!\");\r\n //}\r\n flagsPlaced++;\r\n } else {\r\n flagsPlaced--;\r\n }\r\n\r\n // call this handle to allow extra logic to be added by the extending class\r\n placeFlagHandle(m);\r\n \r\n return true;\r\n \r\n }", "@Override\n public boolean onMarkerClick(Marker marker) {\n searchMarker.remove();\n if(truckMarker!= null) {\n truckMarker.remove();\n }\n truckMarker = mMap.addMarker(new MarkerOptions().position(marker.getPosition()));\n new LoadTruckDetails().execute(marker.getTag());\n return true;\n }", "boolean hasLocationView();", "protected boolean wouldBeNewCoordinator(Address potential_new_coord) {\n Address new_coord;\n\n if(potential_new_coord == null) return false;\n\n synchronized(members) {\n if(members.size() < 2) return false;\n new_coord=(Address)members.elementAt(1); // member at 2nd place\n return new_coord != null && new_coord.equals(potential_new_coord);\n }\n }", "public boolean isMine(int x, int y);", "@Override\n public boolean isLocationFogged(XYCoord coord)\n {\n return isLocationFogged(coord.xCoord, coord.yCoord);\n }", "@Override\n public boolean onMarkerClick(Marker marker) {\n layoutManager.smoothScrollToPosition(recyclerView, null, stationList.indexOf(main.stationMap.get(marker.getTag())));\n centreOnStation(main.stationMap.get(marker.getTag()), true);\n return true;\n }", "@Override\n public boolean equals(Object o) {\n if ((o == null) || !(o instanceof Location)) {\n return false;\n }\n\n // Check x- and y-coordinates.\n Location other = (Location) o;\n if ((this.x == other.x) && (this.y == other.y)) {\n return true;\n }\n\n return false;\n }", "@Override\n public boolean equals(final Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n GpsInfo gpsInfo = (GpsInfo) o;\n return latitude.equals(gpsInfo.latitude) &&\n longitude.equals(gpsInfo.longitude) &&\n altitude.equals(gpsInfo.altitude) &&\n dateTimeZone.equals(gpsInfo.dateTimeZone) &&\n datum.equals(gpsInfo.datum);\n }", "public boolean equals(Object o) {\r\n\t if(o instanceof Point) {\r\n\t\t Point temp = (Point) o;\r\n\t\t long x = ((Compare2D) o).getX();\r\n\t\t long y = ((Compare2D) o).getY();\r\n\t\t if(longitude == x && latitude == y)\r\n\t\t\t return true;\r\n\t }\r\n\t return false;\r\n }", "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 boolean isSeen() {\n return seen;\n }", "@Override\n public boolean onMarkerClick(Marker marker) {\n //Cuando se presiona un marker, se abre la ventana de info (default)\n marker.showInfoWindow();\n return true;\n }", "public boolean checkMarker(AntColor color)\r\n\t{\r\n\t\tif (color == AntColor.Black)\r\n\t\t{\r\n\t\t\treturn blackMarkers > 0;\r\n\t\t} else\r\n\t\t{\r\n\t\t\treturn redMarkers > 0;\r\n\t\t}\r\n\t}", "public int[] updateMap() {\r\n\t\tint[] isObstacle = super.updateMap();\r\n\t\tsmap.setMap(map);\r\n\t\treturn isObstacle;\r\n\t}", "public boolean checkDuplicates() {\n\t\tboolean[] vals = new boolean[9];\n\t\tfor(int i = 0; i < 3; i++) {\n\t\t\tfor(int k = 0; k < 3; k++) {\n\t\t\t\tint num = this.getCellNum(i, k);\n\t\t\t\tif(num != 0) {\n\t\t\t\t\tif(!vals[num-1]) {\n\t\t\t\t\t\t//The number hasn't already been found\n\t\t\t\t\t\tvals[num-1] = true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//A duplicate number was found\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Seatmap)) {\n return false;\n }\n Seatmap other = (Seatmap) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "boolean isLocator();", "public boolean getMarker(int species, int i) {\r\n\t\treturn this.markers[species][i];\r\n\t}", "public void checkMarkers(int num) {\n\t\t\n\t}", "public boolean equals(Tile tile){\n\t if(tile.getLocation().equals(location))\n\t\t return true;\n\t else\n\t\t return false;\n\t}", "private boolean isExists(City c){\r\n\t\tfor(City i:map.getVerteices()){\r\n\t\t\tif (i.equals(c)){\r\n\t\t\t\treturn true;\r\n\t\t\t}}\r\n\t\treturn false;\r\n\r\n\t}", "private boolean checkInsideZone() {\n for (Zone z : shiftZones) {\n if (PolyUtil.containsLocation(userLocation, Arrays.asList(z.getCoords()), true)) {\n return true;\n }\n }\n return false;\n }", "private boolean allGPSDataExists() {\n for(int i = 0; i < 6; i++) {\n if(databaseHandler.getSingleExperimentInfoValue(experimentNumber, DatabaseHandler.SENDER_LATITUDE).equals(\"-1\"))\n return false;\n }\n return true;\n }", "public boolean pointInFlammableLocations(Point point) {\n for (Point location : fireLocations) {\n if (location == point) {\n return true;\n }\n }\n return false;\n }", "public static MarkerException markLocation()\n {\n return getInstance().doMarkLocation();\n }", "@Override\n public void onMapLongClick(LatLng latLng) {\n String markerName = mTextField.getText().toString();\n\n // check if a marker name is set\n if(markerName.isEmpty()) {\n markerName = \"Marker\" + Integer.toString(numberOfMarkers);\n }\n\n // add marker\n Marker marker = mMap.addMarker(\n new MarkerOptions()\n .position(latLng)\n .title(markerName)\n .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED))\n );\n\n // add halo\n Circle halo = mMap.addCircle(new CircleOptions()\n .center(latLng)\n .radius(100.0)\n .strokeColor(Color.RED)\n .visible(false)\n );\n\n // add marker and halo to tracked markers\n mMarkerHalos.put(marker, halo);\n\n // lat and long to separate values\n double markerLat = latLng.latitude;\n double markerLong = latLng.longitude;\n\n // save marker to shared preferences\n Set<String> positionSet = new HashSet<String>();\n positionSet.add(Double.toString(markerLat));\n positionSet.add(Double.toString(markerLong));\n mPrefEditor.putStringSet(markerName, positionSet);\n mPrefEditor.apply();\n\n // clear text field\n mTextField.setText(\"\");\n\n // increase marker counter\n ++numberOfMarkers;\n }", "public boolean hasLocation()\n\t{\n\t\treturn location != null;\n\t}", "private Marker createMarker(final int a, final String id1, String lat, String lng, final String title) {\n\n mMarkerMap.put(marker, a);\n mMarkerMap1.put(marker, title);\n\n Log.e(\"Data\", \"\" + lat + \"-->>>>\" + lng + \"--->>\" + title);\n\n if (a == 999999999) {\n\n marker = googleMap.addMarker(new MarkerOptions()\n .position(new LatLng(Double.valueOf(lat), Double.valueOf(lng))).title(title)\n .anchor(0.5f, 0.5f));\n\n } else if (getIntent().getStringExtra(\"placetype\").equalsIgnoreCase(\"Hospitals\")) {\n\n BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.hosp);\n\n marker = googleMap.addMarker(new MarkerOptions()\n .position(new LatLng(Double.valueOf(lat), Double.valueOf(lng))).title(title).icon(icon)\n .anchor(0.5f, 0.5f));\n\n\n } else if (getIntent().getStringExtra(\"placetype\").equalsIgnoreCase(\"Fire_stations\")) {\n\n BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.fire11515);\n marker = googleMap.addMarker(new MarkerOptions()\n .position(new LatLng(Double.valueOf(lat), Double.valueOf(lng))).title(title).icon(icon)\n .anchor(0.5f, 0.5f));\n\n\n } else if (getIntent().getStringExtra(\"placetype\").equalsIgnoreCase(\"Police Stations\")) {\n\n BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.police55);\n marker = googleMap.addMarker(new MarkerOptions()\n .position(new LatLng(Double.valueOf(lat), Double.valueOf(lng))).title(title).icon(icon)\n .anchor(0.5f, 0.5f));\n\n }\n\n marker.showInfoWindow();\n\n return marker;\n\n }", "public void addMapMarker() {\n if (iLat != null && !iLat.equals(\"\") && iLon != null && !iLon.equals(\"\") && iLatRef != null && !iLatRef.equals(\"\") && iLonRef != null && !iLonRef.equals(\"\")) {\n\n if (iLatRef.equals(\"N\")) {\n //North of equator, positive value\n iLatFloat = toDegrees(iLat);\n } else {\n //South of equator, negative value\n iLatFloat = 0 - toDegrees(iLat);\n }\n\n if (iLonRef.equals(\"E\")) {\n //East of prime meridian, positive value\n iLonFloat = toDegrees(iLon);\n } else {\n //West of prime meridian, negative value\n iLonFloat = 0 - toDegrees(iLon);\n }\n }\n\n final MapView gMap = (MapView) findViewById(R.id.map);\n\n if (addedMarker == false) {\n posMarker = gMap.getMap().addMarker(posMarkerOptions);\n posMarker.setTitle(getString(R.string.map_position));\n addedMarker = true;\n }\n\n posMarker.setVisible(true);\n posMarker.setPosition(new LatLng(iLatFloat, iLonFloat));\n\n GoogleMap gMapObj = gMap.getMap();\n\n gMapObj.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n @Override\n public void onMapClick(LatLng latLng) {\n posMarker.setPosition(latLng);\n displayCoordsInDegrees();\n\n //Use text view values instead of posMarker values\n iLat = toDMS(posMarker.getPosition().latitude);\n iLon = toDMS(posMarker.getPosition().longitude);\n\n if (posMarker.getPosition().latitude > 0) {\n //North of equator, positive value\n iLatFloat = toDegrees(iLat);\n iLatRef = \"N\";\n } else {\n //South of equator, negative value\n iLatFloat = 0 - toDegrees(iLat);\n iLatRef = \"S\";\n }\n\n if (posMarker.getPosition().longitude > 0) {\n //East of prime meridian, positive value\n iLonFloat = toDegrees(iLon);\n iLonRef = \"E\";\n } else {\n //West of prime meridian, negative value\n iLonFloat = 0 - toDegrees(iLon);\n iLonRef = \"W\";\n }\n }\n });\n }", "public boolean isInCircle(LatLng location){\n float[] distance=new float[2];\n Location.distanceBetween( location.latitude, location.longitude,\n circle.getCenter().latitude, circle.getCenter().longitude, distance);\n return distance[0] <= circle.getRadius();\n\n }", "public boolean equals(Object obj) {\n\n if (obj instanceof Location) {\n\n Location other = (Location) obj;\n\n return row == other.getRow() && col == other.getCol();\n\n } else {\n\n return false;\n\n }\n }", "private void showMarker() {\n\n if (myMarker == null) {\n MarkerOptions options = new MarkerOptions();//1 option co 2 thu k thieu vi tri ,hinh anh\n options.position(new LatLng(myLocation.getLatitude(), myLocation.getLongitude()));//vi tri kinh do vi do,no tra ve vi tri cuoi cung gps nhan dc ,neu\n options.title(\"dung123\");\n options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));\n //newu chua co thif sedc sinh ra bang cach add\n googleMap.addMarker(options);\n// myMarker.setTag(\"Hello\");//co the truyen doi tuig vao duoi window marker getTag\n } else {\n myMarker.setPosition(new LatLng(myLocation.getLatitude(), myLocation.getLongitude()));\n }\n }" ]
[ "0.66832036", "0.63682574", "0.6243381", "0.6243381", "0.61625725", "0.61218256", "0.6090926", "0.6056721", "0.60013896", "0.59907514", "0.59856224", "0.59856224", "0.59856224", "0.59856224", "0.59856224", "0.59856224", "0.59856224", "0.59856224", "0.59856224", "0.59856224", "0.59856224", "0.59856224", "0.59856224", "0.594057", "0.59264266", "0.59264266", "0.59264266", "0.5925371", "0.59108335", "0.59030426", "0.5887466", "0.5887466", "0.58282405", "0.58038807", "0.57940495", "0.57812244", "0.57722086", "0.57693726", "0.5756298", "0.5734079", "0.5726452", "0.5717864", "0.5717864", "0.5714361", "0.56904685", "0.56873035", "0.56852996", "0.5682778", "0.56769824", "0.5661842", "0.5642684", "0.56372476", "0.56289285", "0.56264234", "0.56238705", "0.5596338", "0.5596338", "0.5596338", "0.5596338", "0.55919313", "0.558776", "0.55837446", "0.55811524", "0.5575241", "0.5561039", "0.55607206", "0.55506647", "0.55350226", "0.55311745", "0.5529798", "0.5526531", "0.5519295", "0.5519091", "0.5514861", "0.55102223", "0.55102146", "0.5503703", "0.54915434", "0.5486033", "0.54844403", "0.5454404", "0.5453469", "0.5442289", "0.54360753", "0.54311407", "0.54167664", "0.5408337", "0.54082215", "0.5406124", "0.5405951", "0.54029673", "0.54003567", "0.5394413", "0.5387897", "0.538613", "0.5385573", "0.53849167", "0.53815067", "0.5379832", "0.53621817" ]
0.77612764
0
Return the number of rows updated
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public int getUpdateCount() throws SQLException {\n int to_return = getUpdateCountInternal();\n update_result = -1;\n return to_return;\n }", "public int getUpdateCount() throws SQLException {\n return 0;\r\n }", "@Override\n public int getUpdateCount() throws SQLException {\n return -1;\n }", "@Override\n\tpublic int getUpdateCount() throws SQLException {\n\t\treturn -1;\n\t}", "public int getUpdateCount();", "long getUpdateCount();", "public int getUpdateCount() throws SQLException {\n return currentPreparedStatement.getUpdateCount();\n }", "int getUpdateCountsCount();", "public Long getRows_affected() {\n return rows_affected;\n }", "public String updateRowCount() {\n return null;\n }", "long getUpdateCounts(int index);", "int getRowsCount();", "public int totalRowsCount();", "private int update(String sql) {\n int rows = 0;\n\n if (checkConnected()) {\n PreparedStatement statement = null;\n\n try {\n statement = connection.prepareStatement(sql);\n rows = statement.executeUpdate();\n }\n catch (SQLException ex) {\n printErrors(ex);\n }\n finally {\n if (statement != null) {\n try {\n statement.close();\n }\n catch (SQLException e) {\n // Ignore\n }\n }\n }\n }\n\n return rows;\n }", "public int executeUpdateSQL() {\n\t\tint columnsAffected = -1;\n\t\ttry {\n\t\t\tcolumnsAffected = pstmt.executeUpdate();\n\t\t} catch (SQLException se) {\n\t\t\tse.printStackTrace();\n\t\t}\n\t\treturn columnsAffected;\n\t}", "public int getUpdateCountsCount() {\n return updateCounts_.size();\n }", "int getMockUpdatesCount();", "public int getUpdateCountsCount() {\n return updateCounts_.size();\n }", "private int numRows(){\n return attrTable.getModel().getRowCount();\n }", "int rowCount();", "public abstract long getNumUpdate();", "public int rowCount() {\n\t\treturn n_;\n\t}", "public int getRowsCount() {\n return rows_.size();\n }", "@Override\n\tpublic int queryCountOfRows() {\n\t\treturn parentDao.queryCountOfRows();\n\t}", "public int getMockUpdatesCount() {\n return instance.getMockUpdatesCount();\n }", "public int executeUpdate() throws SQLException {\n return statement.executeUpdate();\n }", "public int getMockUpdatesCount() {\n return mockUpdates_.size();\n }", "public int update(Connection db) throws SQLException {\n int resultCount = -1;\n boolean commit = false;\n try {\n commit = db.getAutoCommit();\n if (commit) {\n db.setAutoCommit(false);\n }\n resultCount = this.update(db, false);\n if (commit) {\n db.commit();\n }\n } catch (Exception e) {\n if (commit) {\n db.rollback();\n }\n throw new SQLException(e.getMessage());\n } finally {\n if (commit) {\n db.setAutoCommit(true);\n }\n }\n return resultCount;\n }", "int executeUpdate() throws SQLException;", "public int getRowsCount() {\n return rows_.size();\n }", "private int executeUpdateInternal(List<Object> values) {\r\n\t\tif (logger.isDebugEnabled()) {\r\n\t\t\tlogger.debug(\"The following parameters are used for update \" + getUpdateString() + \" with: \" + values);\r\n\t\t}\r\n\t\tint updateCount = jdbcTemplate.update(updateString, values.toArray(), columnTypes);\r\n\t\treturn updateCount;\r\n\t}", "public long getTotalUpdates() {\n return executor.getTotalUpdates();\n }", "public int getNumUpdates() {\n return (Integer) getProperty(\"numUpdates\");\n }", "public int executeUpdate(String sql)\r\n throws SQLException {\n return 0;\r\n }", "@Override\r\n\tpublic int update() throws Exception {\n\t\treturn 0;\r\n\t}", "public long getUpdateCount() {\n return updateCount_;\n }", "public boolean rowUpdated() throws SQLException\n {\n return m_rs.rowUpdated();\n }", "public int executeUpdate() throws SQLException {\n return currentPreparedStatement.executeUpdate();\n }", "@Override\n public long count() {\n String countQuery = \"SELECT COUNT(*) FROM \" + getTableName();\n return getJdbcTemplate().query(countQuery, SingleColumnRowMapper.newInstance(Long.class))\n .get(0);\n }", "public int resultCount(){\n\n int c = 0;\n\n try{\n if(res.last()){\n c = res.getRow();\n res.beforeFirst();\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return c;\n }", "@Transactional\n\t\tpublic Long getNumberRows (){\n\t\t\n\t\t\treturn pharmacyRepository1.getNumberOfRows();\n\t\t\t\n\t\t}", "public long getUpdateCount() {\n return updateCount_;\n }", "public int getRowCount() {\r\n return this.rowCount;\r\n }", "int getNumberOfRows() {\n lock.readLock().lock();\n try {\n return extensionPointPluginMap.rowMap().size();\n } finally {\n lock.readLock().unlock();\n }\n }", "public int getTotalRows();", "public int getRowCount() {\n return this.rowCount;\n }", "long getUpdated();", "public int getRowCount()\r\n\t{\r\n\t\treturn rowCount;\r\n\t}", "public int dbSyncCount(){\n int count = 0;\n String selectQuery = \"SELECT * FROM farmers where updateStatus = '\"+\"no\"+\"'\";\n SQLiteDatabase database = this.getWritableDatabase();\n Cursor cursor = database.rawQuery(selectQuery, null);\n count = cursor.getCount();\n database.close();\n return count;\n }", "public int getActualRowCount() {\r\n int ret = 0;\r\n if (rows != null) ret = rows.size();\r\n return ret;\r\n }", "public int numberOfRows() {\n\t\treturn rowCount;\n\t}", "public static int update( String sql )\n \t{\n \t\tint rowsModified = -1;\n \t\t\n \t\tConnection conn = getConnection();\n \t\n \t\t\ttry {\n \t\t\t\tStatement st = conn.createStatement();\n \t\t\t\trowsModified = st.executeUpdate( sql );\n \t\t\t\tst.close();\n \t\t\t}\n \t\t\tcatch (SQLException ex) {\n \t\t\t\tthrow new RuntimeException( ex );\n \t\t\t}\n \t\t\n \t\treturnConnection( conn );\n \t\t\n \t\treturn rowsModified; \n \t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn records.size();\n\t}", "public int getRowCount();", "@Override\n public int getNbChanges()\n {\n return nbChanges;\n }", "public void setRows_affected(Long rows_affected) {\n this.rows_affected = rows_affected;\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() { return this.underlying.getRowCount(); }", "public int dbSyncCount()\n {\n int count = 0;\n String selectQuery = \"SELECT * FROM UsersTable where udpateStatus = '\"+\"no\"+\"'\";\n SQLiteDatabase database = this.getWritableDatabase();\n Cursor cursor = database.rawQuery(selectQuery, null);\n count = cursor.getCount();\n database.close();\n return count;\n }", "public int getRowCount() {\r\n //return outputs.length;\r\n return NUM_ROW;\r\n }", "public abstract void rowsUpdated(int firstRow, int endRow);", "public abstract int getNumOfRows();", "int getRowsAmount();", "@Override\n\t\t\t\tpublic void rowsUpdated(int firstRow, int endRow) {\n\n\t\t\t\t}", "private void update() {\n\t\tConfiguration conf = new Configuration();\n\t\tconf.configure(\"hibernate.cfg.xml\");\n\t\tSessionFactory sf = conf.buildSessionFactory();\n\t\tSession s = sf.openSession();\n\t\ts.beginTransaction();\n\n\t\tQuery query = s.createQuery(\"update OldStudent os set id=9 where os.name = 'Omkar'\");\n\t\tint count = query.executeUpdate();\n\t\tSystem.out.println(\"Number of Rows Updated in the oldstudent table=\" + count);\n\n\t\ts.getTransaction().commit();\n\t\ts.clear();// s.evict() on all student objects in session\n\t\tsf.close();\n\n\t}", "public int getNumRows () {\n\t\treturn numrows_;\n\t}", "public int getRowCount() {\n\t\treturn this.records.size();\n\t}", "public abstract int getNumRows();", "public int getRowCount()\n\t{\n\t\treturn datas.size();\n\t}", "int countRows() throws IOException {\n Scan s = new Scan();\n ResultScanner rs = tbl.getScanner(s);\n int i = 0;\n while(rs.next() !=null) {\n i++;\n }\n return i;\n }", "@Override\n\t\tpublic int getRowCount() \n\t\t{\n\t\t\treturn tables.size();\n\t\t}", "@Override\n\tpublic int getRowCnt() {\n\t\treturn invBaseStockDao.getRowCnt();\n\t}", "public boolean rowUpdated() throws SQLException {\n\n try {\n debugCodeCall(\"rowUpdated\");\n return false;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public int getUpdated() {\n return updated;\n }", "int getRowCount();", "int getRowCount();", "int getRowCount();", "int getRowCount();", "int getRowCount();", "int getRowCount();", "int getRowCount();", "@Override\n\tpublic int getRowCount() {\n\t\treturn rowCount;\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn rowCount;\n\t}", "public Long getWaiting_query_rows_affected() {\n return waiting_query_rows_affected;\n }", "@Override\n public int getRowCount() {\n return (model == null) ? 0 : model.getRowCount(); \n }", "public int getRowCount() {\n return _data.size();\n }", "@Override\r\n public int getRowCount() {\n return this.rowData.size();\r\n }", "public int getNumberOfRows() {\n return this.numberOfRows;\n }", "public int numberOfRows(){\n SQLiteDatabase db = this.getReadableDatabase();\n int numRows = (int) DatabaseUtils.queryNumEntries(db,TABLE_NAME);\n return numRows;\n }", "@Override\n\tpublic int updateByPrimaryKeySelective(Cell record) {\n\t\t\t\tSqlSession sqlSession =null;\n\t\t\t\tint count=0;\n\t\t\t\ttry {\n\t\t\t\t\tsqlSession = MySqlSessionFactory.getSqlSession(true);\n\t\t\t\t\tCellMapper cellMapper = sqlSession.getMapper(CellMapper.class);\n\t\t\t\t\tcount = cellMapper.updateByPrimaryKeySelective(record);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}finally{\n\t\t\t\t\tif(sqlSession != null) {\n\t\t\t\t\t\tsqlSession.close();\n\t\t\t\t\t\tsqlSession = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn count;\n\t}", "public int getRowCount() {\n\t\treturn _rowCount;\n\t}", "public int getRowCount() {\n\t\treturn _rowCount;\n\t}", "public int getRowCount() throws IllegalStateException\r\n { \r\n if ( !connectedToDatabase ) \r\n throw new IllegalStateException( \"Not Connected to Database\" );\r\n \r\n return numberOfRows;\r\n }", "public int getRowCount()\n\t{\n\t\treturn m_data.rows.size();\n\t}", "public int getRowCount() {\n\t\treturn(data.size());\n\t}", "public int getRowCount() {\r\n int currentRowCount = this.table.getRowCount();\r\n if (currentRowCount > rowCount) {\r\n rowCount = currentRowCount;\r\n }\r\n return rowCount;\r\n }" ]
[ "0.7926831", "0.77093184", "0.7680219", "0.762149", "0.7529616", "0.7475716", "0.74598974", "0.7194893", "0.69452727", "0.69433963", "0.68848646", "0.6883733", "0.6851921", "0.68139964", "0.676054", "0.67260116", "0.67009366", "0.66703266", "0.6655702", "0.66414434", "0.66385937", "0.65661526", "0.6553339", "0.6529587", "0.6506931", "0.6490745", "0.64844596", "0.64840543", "0.6470436", "0.6469245", "0.6450801", "0.64425504", "0.64396316", "0.6436078", "0.64339066", "0.6430551", "0.6430353", "0.6427061", "0.6417078", "0.6409042", "0.6395546", "0.63770485", "0.6376862", "0.6375932", "0.6344657", "0.633896", "0.6320454", "0.6313567", "0.6304838", "0.630322", "0.62943685", "0.6288883", "0.6284932", "0.6280184", "0.6266507", "0.62538564", "0.62502044", "0.62502044", "0.62502044", "0.62502044", "0.62502044", "0.62502044", "0.6248787", "0.6242613", "0.62413996", "0.62377864", "0.6229942", "0.62223905", "0.62196475", "0.6218687", "0.6214777", "0.62122583", "0.6211084", "0.6209397", "0.6208855", "0.62065125", "0.6205471", "0.62051046", "0.6204171", "0.6204112", "0.6204112", "0.6204112", "0.6204112", "0.6204112", "0.6204112", "0.6204112", "0.619321", "0.619321", "0.6189461", "0.61863405", "0.61824995", "0.61695623", "0.6165001", "0.61616975", "0.61537296", "0.6147298", "0.6147298", "0.6132726", "0.612951", "0.61278176", "0.6126477" ]
0.0
-1
the flag to overwrite
public void writeToFile(String msg, boolean flag) { try { // writing without overwriting PrintWriter out = new PrintWriter(new FileWriter(fileName)); out.append(msg); out.close(); } catch (IOException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void overwrite() {\n\t\tdefaultOverwriteMode = OVERWRITE;\n\t}", "public static void noOverwrite() {\n\t\tdefaultOverwriteMode = NO_OVERWRITE;\n\t}", "public void setOverwrite(boolean overwrite)\n {\n this.overwrite = overwrite;\n }", "public void setOverwrite(boolean overwrite) {\n this.overwrite = overwrite;\n }", "public void onOverwrite();", "public boolean is_overwrite() {\n\t\treturn _overwrite;\n\t}", "public void set_overwrite(boolean _overwrite) {\n\t\tthis._overwrite = _overwrite;\n\t}", "protected void setFlag() {\n flag = flagVal;\n }", "protected void setFlag() {\n flag = flagVal;\n }", "public static String getOverwriteMode() {\n\t\treturn defaultOverwriteMode;\n\t}", "public void changeOverwrite (final boolean overwrite) {\n\t\tsetModelProperty(OVERWRITE_PROPERTY, overwrite);\n\t}", "public static boolean allowOverwrite() {\n\t\tif ((xml != null) && (overwrite != null) && overwrite.equals(\"no\")) return false;\n\t\treturn true;\n\t}", "private void setDirty(boolean flag) {\n\tdirty = flag;\n\tmain.bSave.setEnabled(dirty);\n }", "static void setNotAutoCopy(){isAutoCopying=false;}", "void clearModifiedFlag();", "public boolean getShouldChangePatchAfterWrite()\n {\n return false; \n }", "public void setFlag(int flag) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeInt(__io__address + 20, flag);\n\t\t} else {\n\t\t\t__io__block.writeInt(__io__address + 12, flag);\n\t\t}\n\t}", "public void setFlag(int which) {\n setFlag(which, true);\n }", "public void setFlag(int flag) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeInt(__io__address + 4, flag);\n\t\t} else {\n\t\t\t__io__block.writeInt(__io__address + 4, flag);\n\t\t}\n\t}", "public void setFlag(Integer flag) { this.flag = flag; }", "public static String getOverwrite() {\n\t\tif ((xml != null) && (overwrite != null) && overwrite.equals(\"no\")) return \"no\";\n\t\treturn \"yes\";\n\t}", "boolean shouldModify();", "public void reset(){\r\n \tdefaultFlag = false;\r\n }", "public void setFlag( int flag )\n {\n value |= 1 << ( MAX_SIZE - 1 - flag );\n }", "public boolean doModify() {\n return true;\n }", "static void setNotCopying(){isCopying=false;}", "public void giveFlag(Flag f)\r\n\t{\r\n\t\thasFlag = true;\r\n\t\tflag = f;\r\n\t}", "@Override\n public boolean getOrReplace() {\n return orReplace_;\n }", "@Override\n public boolean getOrReplace() {\n return orReplace_;\n }", "default void setNeedToBeUpdated(boolean flag)\n {\n getUpdateState().update(flag);\n }", "@Override\n public boolean getOrReplace() {\n return orReplace_;\n }", "@Override\n public boolean getOrReplace() {\n return orReplace_;\n }", "@Override\n\t\t\t\t\tprotected void onChangeFlag(Service object, Boolean flag) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void setFlag(Boolean flag) {\n this.flag = flag;\n }", "public void setFlag(boolean bol){\n\t\tflag = bol;\n\t}", "private void setDirty(boolean flag) {\n\tmain.getState().dirty = flag;\n\tif (main.bSave != null)\n\t main.bSave.setEnabled(flag);\n }", "protected final synchronized void setFlag(int flag, boolean sts) {\n\t\tboolean state = (m_flags & flag) != 0 ? true : false;\n\t\tif ( state && sts == false)\n\t\t\tm_flags -= flag;\n\t\telse if ( state == false && sts == true)\n\t\t\tm_flags += flag;\n\t}", "public void markFileAsNotSaved()\r\n {\r\n saved = false;\r\n }", "static void setNotSaved(){saved=false;}", "void setFlag(long flag, boolean val) {\n\t\tif (val)\r\n\t\t\tflags = flags | flag;\r\n\t\telse\r\n\t\t\tflags = flags & ~flag;\r\n\t}", "public static void setFlags(int flag){\r\n flags |= flag;\r\n }", "@Override\r\n\tpublic boolean update(Amigo amigo) {\n\t\treturn false;\r\n\t}", "public void clearModifiedFlag();", "public void setFlag(short flag) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeShort(__io__address + 6, flag);\n\t\t} else {\n\t\t\t__io__block.writeShort(__io__address + 6, flag);\n\t\t}\n\t}", "public void getEaten() {\n\t\tsuper.flag=true;\n\t}", "void setOssModified(boolean ossModified);", "static void setNotEdit(){isEditing=false;}", "@Override\n\tpublic boolean update() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean update() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean update() {\n\t\treturn false;\n\t}", "@Override\n\tpublic void atirou() {\n\n\t\t\tatirou=true;\n\t\t\t\n\t\t\n\t}", "public void updateFlags()\n {\n initialize();\n }", "@Override\n public int getFlag() {\n return flag_;\n }", "@Override\n public int getFlag() {\n return flag_;\n }", "public void changeIsFlagged() {\r\n\t\tif (this.isFlagged) {\r\n\t\t\tthis.isFlagged = false;\r\n\t\t} else {\r\n\t\t\tthis.isFlagged = true;\r\n\t\t}\r\n\t}", "boolean getOrReplace();", "boolean getOrReplace();", "private boolean ALT(boolean b) {\r\n --save;\r\n return b;\r\n }", "@Override\n public boolean undo() {\n // nothing required to be done\n return false;\n }", "public void defender(){setModopelea(1);}", "public void changeIfFlagZone()\r\n\t{\r\n\t\tlocInFlagZone = !locInFlagZone;\r\n\t}", "@Override\n public boolean isUndo() {\n return false;\n }", "public void setItNew(boolean itNew) {\n\t\t\n\t}", "static void setCopying(){isCopying=true;}", "@Override\n public boolean update(Revue objet) {\n return false;\n }", "@Override\n\tpublic void updateFalse(MetodoPagamento object) {\n\t\t\n\t}", "@Override\n\tpublic void resetToExisting() {\n\t\t\n\t}", "public void setIsNostroUpdateEnabled(String flag) {\n isNostroUpdateEnabled = (flag.equals(YES));\n updateParameters = true;\n }", "public void pickUpFlag(IRobot robot) {\n String objectName = getObjectNameOnPos(tiledMap, robot.getPos());\n if(objectName != null && objectName.contains(\"Flag\")){\n robot.addFlag(objectName);\n }\n }", "protected void failed()\r\n {\r\n //overwrite\r\n }", "public void setMailReadflag(int v) \n {\n \n if (this.mailReadflag != v)\n {\n this.mailReadflag = v;\n setModified(true);\n }\n \n \n }", "protected void setFlag(int x, int y) {\r\n \r\n if (!flag[x][y]) {\r\n \t//System.out.println(\"Auto flag set at (\" + x + \",\" + y + \")\");\r\n \tflag[x][y] = true;\r\n flagsPlaced++;\r\n }\r\n\r\n }", "public void setFlags(short flag) {\n\tflags = flag;\n }", "public synchronized void setFlags(Flags newFlags, boolean set) throws MessagingException {\n/* 91 */ Flags oldFlags = (Flags)this.flags.clone();\n/* 92 */ super.setFlags(newFlags, set);\n/* 93 */ if (!this.flags.equals(oldFlags)) {\n/* 94 */ this.folder.notifyMessageChangedListeners(1, (Message)this);\n/* */ }\n/* */ }", "@Override\n\tpublic boolean update(Etape obj) {\n\t\treturn false;\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\tEditor e=sh.edit();\n\t\t\te.putInt(\"mainflag\",0);\n\t\t\te.commit();\n\t\t}", "public void setAllUpdateFlags() {\n\t}", "public Builder setOrReplace(boolean value) {\n\n orReplace_ = value;\n onChanged();\n return this;\n }", "public Builder setOrReplace(boolean value) {\n\n orReplace_ = value;\n onChanged();\n return this;\n }", "public void ativa() {\n this.ativada = true;\n }", "void setBinaryFileAttribute(boolean flag);", "public void FlagupdatePatientPersonal(String flag) {\n SQLiteDatabase db = null;\n\n try {\n db = this.getWritableDatabase();\n\n\n ContentValues values = new ContentValues();\n\n values.put(SYCHRONIZED, flag); // Name\n\n // Inserting Row\n db.update(TABLE_PATIENT, values, null, null);\n\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (db != null) {\n db.close();\n }\n }\n\n }", "public void changeCanThrowFlag()\r\n\t{\r\n\t\tcanThrowFlag = !canThrowFlag;\r\n\t}", "@Override\n public boolean canUndo() {\n return false;\n }", "public void setModified (boolean modified);", "@Override\n public boolean a(boolean flag0, IProgressUpdate iprogressupdate) {\n return false;\n }", "public void change() {\r\n this.mode = !this.mode;\r\n }", "public void setFavorSSO(final boolean flag) {\n checkSetterPreconditions();\n favorSSO = flag;\n }", "@Override\n public boolean isMutable()\n {\n return true;\n }", "@Override\n public boolean isMutable() {\n return true;\n }", "public void acaba() \n\t\t{\n\t\t\tsigo2 = false;\n\t\t}", "public void flagUser() {\n\t\tsuper.flagUser();\n\t}", "public void setReadWriteOnMyLatestView()\n {\n \t m_acl = \tm_acl | (1<<2);\n }", "public void addDefaultFlag(byte flag)\n {\n defaultFlags |= flag;\n }", "public void markReused() {\n\t\tupdate(Phase.vm_creation, State.SKIPPED);\n\t\tupdate(Phase.installation, State.SKIPPED);\n\t\tupdate(Phase.configuration, State.SKIPPED);\n\t\tsetState(State.SKIPPED);\n\t}", "public void setErase(boolean isErase){\n erase=isErase;\n }", "public void FlagupdateAssociateMaster(String flag) {\n SQLiteDatabase db = null;\n\n try {\n db = this.getWritableDatabase();\n\n\n ContentValues values = new ContentValues();\n\n values.put(FLAG, flag); // Name\n\n db.update(TABLE_ASSOCIATE_MASTER, values, null, null);\n\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (db != null) {\n db.close();\n }\n }\n\n }", "@Override\n void undo() {\n assert false;\n }", "public default boolean canBePermanent(){ return false; }", "@Override\n public boolean redo() {\n // nothing required to be done\n return false;\n }", "public void setFlag( KerberosFlag flag )\n {\n int pos = MAX_SIZE - 1 - flag.getOrdinal();\n value |= 1 << pos;\n }" ]
[ "0.7342305", "0.724737", "0.70611715", "0.6905084", "0.68453056", "0.6822372", "0.6802941", "0.65608907", "0.65608907", "0.6407992", "0.61961806", "0.61955607", "0.61358154", "0.6079804", "0.60512495", "0.5974364", "0.59727955", "0.5962906", "0.5955559", "0.59310085", "0.59045255", "0.59034497", "0.5901574", "0.5900455", "0.5896758", "0.58911157", "0.5872827", "0.5852262", "0.5852262", "0.5818685", "0.5811673", "0.5811673", "0.57907283", "0.5786003", "0.57841676", "0.57793397", "0.5770949", "0.57602113", "0.57566947", "0.5756594", "0.5742864", "0.5740903", "0.57399136", "0.5720754", "0.5714617", "0.5670334", "0.566796", "0.56673235", "0.56673235", "0.56673235", "0.565363", "0.5645136", "0.563981", "0.56385237", "0.56324446", "0.56272846", "0.56272846", "0.5604458", "0.55929905", "0.5591015", "0.5585725", "0.55845964", "0.5579855", "0.5574254", "0.55670136", "0.5560862", "0.55604327", "0.5546554", "0.55262697", "0.55242753", "0.55229527", "0.55177766", "0.5507562", "0.55067575", "0.55057067", "0.5487248", "0.54686123", "0.546084", "0.546084", "0.54556054", "0.54539436", "0.5442014", "0.5441023", "0.54378116", "0.5433443", "0.5433185", "0.5432626", "0.542945", "0.5426757", "0.54246444", "0.5417046", "0.54159206", "0.5406058", "0.53963125", "0.5390285", "0.53884226", "0.5384765", "0.53843546", "0.538182", "0.5369399", "0.5367681" ]
0.0
-1
variables // Add local variables to postCopy. abstract accessing //
public void set(AcAirportMailScanPerformanceVo vo) { setReceiveExpected(vo.getReceiveExpected()); setReceiveCompliance(vo.getReceiveCompliance()); setReceivePerformance(vo.getReceivePerformance()); setOriginLoadExpected(vo.getOriginLoadExpected()); setOriginLoadCompliance(vo.getOriginLoadCompliance()); setOriginLoadPerformance(vo.getOriginLoadPerformance()); setTransferLoadExpected(vo.getTransferLoadExpected()); setTransferLoadCompliance(vo.getTransferLoadCompliance()); setTransferLoadPerformance(vo.getTransferLoadPerformance()); setOriginDepartureExpected(vo.getOriginDepartureExpected()); setOriginDepartureCompliance(vo.getOriginDepartureCompliance()); setOriginDeparturePerformance(vo.getOriginDeparturePerformance()); setTransferDepartureExpected(vo.getTransferDepartureExpected()); setTransferDepartureCompliance(vo.getTransferDepartureCompliance()); setTransferDeparturePerformance(vo.getTransferDeparturePerformance()); setDeliverExpected(vo.getDeliverExpected()); setDeliverCompliance(vo.getDeliverCompliance()); setDeliverPerformance(vo.getDeliverPerformance()); setGroundHandlingTimeExpected(vo.getGroundHandlingTimeExpected()); setGroundHandlingTimeCompliance(vo.getGroundHandlingTimeCompliance()); setGroundHandlingTimePerformance(vo.getGroundHandlingTimePerformance()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void copy() {\n\n\t}", "static void setCopying(){isCopying=true;}", "@Override\n\tprotected void copy(Object source, Object dest) {\n\t\t\n\t}", "public void copy(DataRequest original){\n\t\t//potential problems with object sharing\n\t\tfilters = \toriginal.get_filters();\n\t\tsort_by = \toriginal.get_sort_by();\n\t\tcount = \toriginal.get_count();\n\t\tstart = \toriginal.get_start();\n\t\tsource = \toriginal.get_source();\n\t\tfieldset =\toriginal.get_fieldset();\n\t\trelation = \toriginal.get_relation();\n\t}", "static void setNotCopying(){isCopying=false;}", "Field getCopy();", "@Override\r\npublic int getNumcopy() {\n\treturn super.getNumcopy();\r\n}", "private List<String> copySubstitutes(String postScriptName) {\n/* 195 */ return new ArrayList<String>(this.substitutes.get(postScriptName));\n/* */ }", "private void updateVars()\n {\n\n }", "@Override\r\npublic void setNumcopy(int numcopy) {\n\tsuper.setNumcopy(numcopy);\r\n}", "protected void copyProperties(AbstractContext context) {\n\t\tcontext.description = this.description;\n\t\tcontext.batchSize = this.batchSize;\n\t\tcontext.injectBeans = this.injectBeans;\n\t\tcontext.commitImmediately = this.isCommitImmediately();\n\t\tcontext.script = this.script;\n\t}", "void addCopy() {\r\n numCopies++;\r\n }", "private List<Copy> createCopyForMetaParameters(String targetVariable) {\n\t\tArrayList<Copy> copies = new ArrayList<Copy>();\n\t\t\n\t\t/* Copy token */\n\t\tCopy copy = new Copy();\n\t\tFromSpec from = new FromSpec();\n\t\tfrom.setType(fromTypes.EXPRESSION);\n\t\tfrom.setExpression(\"$input.payload/tns:token\");\n\t\tcopy.setFromSpec(from);\n\t\t\n\t\tToSpec to = new ToSpec();\n\t\tto.setType(toTypes.EXPRESSION);\n\t\tto.setExpression(\"$\" + targetVariable + \".parameters/token\");\n\t\tcopy.setToSpec(to);\n\t\t\n\t\tcopies.add(copy);\n\t\t\n\t\t/* Copy reporting service URL */\n\t\tcopy = new Copy();\n\t\tfrom = new FromSpec();\n\t\tfrom.setType(fromTypes.EXPRESSION);\n\t\tfrom.setExpression(\"$input.payload/tns:reportingServiceUrl\");\n\t\tcopy.setFromSpec(from);\n\t\t\n\t\tto = new ToSpec();\n\t\tto.setType(toTypes.EXPRESSION);\n\t\tto.setExpression(\"$\" + targetVariable + \".parameters/reportingServiceUrl\");\n\t\tcopy.setToSpec(to);\n\t\t\n\t\tcopies.add(copy);\n\t\t\n\t\treturn copies;\n\t}", "Prototype makeCopy();", "private void copyOp(Scanner input) {\n\t\tprogramStack.add(\"copy\");\n\n\t\twhile (input.hasNext()){\n\t\t\tString token = input.next();\n\t\t\tif(token.equalsIgnoreCase(\"add\"))\n\t\t\t\taddOp(input);\n\t\t\telse\n\t\t\t\tprogramStack.push(token);\n\t\t}\n\n\t\twhile (!programStack.peek().equalsIgnoreCase(\"copy\")){\n\t\t\tString tokenToAdd = programStack.pop();\n\t\t\tint valueToAddRam;\n\t\t\tif(isVariable(tokenToAdd))\n\t\t\t\tvalueToAddRam = getRAMValue(tokenToAdd);\n\t\t\telse\n\t\t\t\tvalueToAddRam = Integer.parseInt(tokenToAdd);\n\n\t\t\tString memLocal = programStack.pop();\n\t\t\tputVariable(memLocal, valueToAddRam);\n\t\t}\n\n\t\tprogramStack.pop();\n\t}", "private void assignment() {\n\n\t\t\t}", "public void MIPSme()\n\t{\n\t\t\n\t\tTEMP varAddress = null;\n\t\t//v := v - this is the right side of the assignment - we want to load the value of v from memory\n\t\tif (isRight){\n\t\t\tif(isParamFromStack){\n\t\t\t\t// we want value from stack\n\t\t\t\tsir_MIPS_a_lot.getInstance().loadFromFrame(dst,(this.localVarOffset+1)*4);\n\t\t\t}\n\t\t\t//need to be modified\n\t\t\telse{\n\t\t\t\tsir_MIPS_a_lot.getInstance().loadFromFrame(dst,-(this.localVarOffset+1)*4);\n\t\t\t}\n\t\t}\n\t\t//left side - we want to get variable address into temp t \n\t\telse{\n\t\t\t//variable is a parameter of a function\n\t\t\tif (isParamFromStack){\n\t\t\t\tvarAddress = sir_MIPS_a_lot.getInstance().addressParamVar(this.localVarOffset);\n\t\t\t}\n\t\t\t//for now it represents local variable but need to be changed.... (data members, globals...) \n\t\t\telse{\n\t\t\t\tvarAddress = sir_MIPS_a_lot.getInstance().addressLocalVar(this.localVarOffset);\n\t\t\t}\n\t\t\tsir_MIPS_a_lot.getInstance().move(dst,varAddress);\n\t\t}\n\t}", "Variables createVariables();", "abstract void copyFromVar(MatrixVariableI var, int i);", "void copyPosition (DVector3 pos);", "public abstract INodo copy();", "protected void copyParameters( RestParamsPropertyHolder srcParams, RestParamsPropertyHolder destinationParams )\n\t{\n\t\tfor( int i = 0; i < srcParams.size(); i++ )\n\t\t{\n\t\t\tRestParamProperty prop = srcParams.getPropertyAt( i );\n\n\t\t\tdestinationParams.addParameter( prop );\n\n\t\t}\n\t}", "void copyMetasToProperties( Object sourceAndTarget );", "public HttpParams copy() {\n/* 268 */ return (HttpParams)this;\n/* */ }", "void copyPropertiesToMetas( Object sourceAndTarget );", "@Override\n public VariableListNode deepCopy(BsjNodeFactory factory);", "public void copyData(TrianaType source) { // not needed\n }", "void copyValues(AgileItem agileItem);", "WorkoutBatch copy();", "@Override\n\tpublic void copyReferences() {\n\t\tlateCopies = new LinkedHashMap<>();\n\n\t\tsuper.copyReferences();\n\n\t\tputAll(lateCopies);\n\t\tlateCopies = null;\n\t}", "public ArrayList<Variable> deepCopy (ArrayList<Variable> forCopy){\n ArrayList<Variable> copy = new ArrayList<>();\n for (Variable var: forCopy){ // for all variables in the arrayList clone\n Variable newVar = var.clone();\n copy.add(newVar);\n }\n return copy;\n }", "@Override\n public FieldEntity copy()\n {\n return state.copy();\n }", "public ParticleRenderData copy()\n\t{\n\t\tRenderData copy = super.copy();\n\t\tParticleRenderData pcopy = new ParticleRenderData(new Vector3f(), new Euler(), new Vector3f());\n\t\tpcopy.transform = copy.transform;\n\t\tpcopy.postStage = this.postStage;\n\t\tpcopy.currStage = this.currStage;\n\t\tpcopy.particleColor = this.particleColor;\n\t\treturn pcopy;\n\t}", "void method_9229(int var1, int var2, int var3) {\r\n this.field_8735 = var1;\r\n this.field_8736 = var2;\r\n this.field_8737 = var3;\r\n super();\r\n }", "private static void initCopyContext (SessionState state)\n\t{\n\t\tstate.setAttribute (STATE_COPIED_IDS, new Vector ());\n\n\t\tstate.setAttribute (STATE_COPY_FLAG, Boolean.FALSE.toString());\n\n\t}", "public void postData() {\n\n\t}", "static void setNotAutoCopy(){isAutoCopying=false;}", "protected abstract String copyQuestionTx(String userId, String qid, Pool destination);", "public abstract String createObjectCopy(OwObject obj_p, OwPropertyCollection properties_p, OwPermissionCollection permissions_p, OwObject parent_p, int[] childTypes_p) throws Exception;", "public void copy(Posts that) {\r\n\t\tsetId(that.getId());\r\n\t\tsetTitle(that.getTitle());\r\n\t\tsetContent(that.getContent());\r\n\t\tsetShareDate(that.getShareDate());\r\n\t\tsetIsPrivate(that.getIsPrivate());\r\n\t\tsetUsers(that.getUsers());\r\n\t\tsetCommentses(new java.util.LinkedHashSet<com.ira.domain.Comments>(that.getCommentses()));\r\n\t}", "@Override\n\tvoid post() {\n\t\t\n\t}", "T copy();", "@Override //function was implemented as abstract in super class\n public void Set(Instruction toCopy){\n Extra temp = (Extra) toCopy; //downcast for valid assignment\n this.Price = temp.Price;\n this.Allergens = temp.Allergens;\n this.Notes = new String(temp.Notes);\n this.Density = temp.Density;\n this.Topping = new String(temp.Topping);\n this.Vegetarian = temp.Vegetarian;\n }", "private zzfl$zzg$zzc() {\n void var3_1;\n void var2_-1;\n void var1_-1;\n this.value = var3_1;\n }", "public void destMethod(){\n\t}", "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "public SoPickedPoint \ncopy() \n//\n////////////////////////////////////////////////////////////////////////\n{\n SoPickedPoint newCopy = new SoPickedPoint(this);\n return newCopy;\n}", "public P copy(){\n AssetLoader l = GDefence.getInstance().assetLoader;\n P p = new P(chance.get(), duration.get(), bonusDmg.get(), g);\n p.gemBoost[0] = new BoostInteger(p.bonusDmg, g.bonusDmgUp, l.getWord(\"bashGrade3\"),\n true, BoostInteger.IntegerGradeFieldType.NONE);\n p.gemBoost[1] = new BoostFloat(p.duration, g.durationUp, l.getWord(\"bashGrade2\"),\n true, BoostFloat.FloatGradeFieldType.TIME);\n p.gemBoost[2] = new BoostFloat(p.chance, g.chanceUp, l.getWord(\"bashGrade1\"),\n true, BoostFloat.FloatGradeFieldType.PERCENT);\n p.s = new S(chance.get(), duration.get(), bonusDmg.get());\n return p;\n }", "private void internalCopy(Board b) {\n for (int i = 0; i < SIDE * SIDE; i += 1) {\n set(i, b.get(i));\n }\n\n _directions = b._directions;\n _whoseMove = b._whoseMove;\n _history = b._history;\n }", "public ExpressionCopyVisitor(Map<VariableDeclaration, VariableDeclaration> mapping, boolean reuse) {\n super(mapping, reuse);\n }", "VarAssignment createVarAssignment();", "public abstract void copy(Result result, Object object);", "public void performCopy() {\n \t\ttext.copy();\n \t}", "public void pasteData(PrimitiveDeepCopy pasteBuffer) {\n List<PrimitiveData> bufferCopy = new ArrayList<PrimitiveData>();\n Map<Long, Long> newNodeIds = new HashMap<Long, Long>();\n Map<Long, Long> newWayIds = new HashMap<Long, Long>();\n Map<Long, Long> newRelationIds = new HashMap<Long, Long>();\n for (PrimitiveData data: pasteBuffer.getAll()) {\n if (data.isIncomplete()) {\n continue;\n }\n PrimitiveData copy = data.makeCopy();\n copy.clearOsmMetadata();\n if (data instanceof NodeData) {\n newNodeIds.put(data.getUniqueId(), copy.getUniqueId());\n } else if (data instanceof WayData) {\n newWayIds.put(data.getUniqueId(), copy.getUniqueId());\n } else if (data instanceof RelationData) {\n newRelationIds.put(data.getUniqueId(), copy.getUniqueId());\n }\n bufferCopy.add(copy);\n }\n\n // Update references in copied buffer\n for (PrimitiveData data:bufferCopy) {\n if (data instanceof NodeData) {\n NodeData nodeData = (NodeData)data;\n\t\t\t\tnodeData.setEastNorth(nodeData.getEastNorth());\n } else if (data instanceof WayData) {\n List<Long> newNodes = new ArrayList<Long>();\n for (Long oldNodeId: ((WayData)data).getNodes()) {\n Long newNodeId = newNodeIds.get(oldNodeId);\n if (newNodeId != null) {\n newNodes.add(newNodeId);\n }\n }\n ((WayData)data).setNodes(newNodes);\n } else if (data instanceof RelationData) {\n List<RelationMemberData> newMembers = new ArrayList<RelationMemberData>();\n for (RelationMemberData member: ((RelationData)data).getMembers()) {\n OsmPrimitiveType memberType = member.getMemberType();\n Long newId = null;\n switch (memberType) {\n case NODE:\n newId = newNodeIds.get(member.getMemberId());\n break;\n case WAY:\n newId = newWayIds.get(member.getMemberId());\n break;\n case RELATION:\n newId = newRelationIds.get(member.getMemberId());\n break;\n }\n if (newId != null) {\n newMembers.add(new RelationMemberData(member.getRole(), memberType, newId));\n }\n }\n ((RelationData)data).setMembers(newMembers);\n }\n }\n\n /* Now execute the commands to add the duplicated contents of the paste buffer to the map */\n\n Main.main.undoRedo.add(new AddPrimitivesCommand(bufferCopy));\n Main.map.mapView.repaint();\n }", "public void doCopy ( RunData data )\n\t{\n\t\t// get the state object\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\t// cancel copy if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_COPY_FLAG)))\n\t\t{\n\t\t\tinitCopyContext(state);\n\t\t}\n\n\t\t// cancel move if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_MOVE_FLAG)))\n\t\t{\n\t\t\tinitMoveContext(state);\n\t\t}\n\n\t\tVector copyItemsVector = new Vector ();\n\n\t\tString[] copyItems = data.getParameters ().getStrings (\"selectedMembers\");\n\t\tif (copyItems == 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(\"choosefile6\"));\n\t\t\tstate.setAttribute (STATE_MODE, MODE_LIST);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString copyId = NULL_STRING;\n\t\t\tfor (int i = 0; i < copyItems.length; i++)\n\t\t\t{\n\t\t\t\tcopyId = copyItems[i];\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tResourceProperties properties = ContentHostingService.getProperties (copyId);\n\t\t\t\t\t/*\n\t\t\t\t\tif (properties.getProperty (ResourceProperties.PROP_IS_COLLECTION).equals (Boolean.TRUE.toString()))\n\t\t\t\t\t{\n\t\t\t\t\t\tString alert = (String) state.getAttribute(STATE_MESSAGE);\n\t\t\t\t\t\tif (alert == null || ((alert != null) && (alert.indexOf(RESOURCE_INVALID_OPERATION_ON_COLLECTION_STRING) == -1)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taddAlert(state, RESOURCE_INVALID_OPERATION_ON_COLLECTION_STRING);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t}\n\t\t\t\tcatch (PermissionException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"notpermis15\"));\n\t\t\t\t}\n\t\t\t\tcatch (IdUnusedException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state,RESOURCE_NOT_EXIST_STRING);\n\t\t\t\t}\t// try-catch\n\t\t\t}\n\n\t\t\tif (state.getAttribute(STATE_MESSAGE) == null)\n\t\t\t{\n\t\t\t\tstate.setAttribute (STATE_COPY_FLAG, Boolean.TRUE.toString());\n\n\t\t\t\tcopyItemsVector.addAll(Arrays.asList(copyItems));\n\t\t\t\tContentHostingService.eliminateDuplicates(copyItemsVector);\n\t\t\t\tstate.setAttribute (STATE_COPIED_IDS, copyItemsVector);\n\n\t\t\t}\t// if-else\n\t\t}\t// if-else\n\n\t}", "@Override\n\tpublic void post(BookCopies object) throws SQLException {\n\t\t\n\t}", "private final State copy( State state)\n {\n State copy = new State();\n copy.index = counter++;\n copy.stackOps = Arrays.copyOf( state.stackOps, state.stackOps.length);\n copy.gotos = Arrays.copyOf( state.gotos, state.gotos.length);\n itemSetMap.put( copy, itemSetMap.get( state));\n return copy;\n }", "public ExpressionCopyVisitor(Map<VariableDeclaration, VariableDeclaration> mapping, boolean reuse, \n IVariableMapper mapper) {\n super(mapping, reuse, mapper);\n }", "private void copy()\n\t{\n\t\t//for loop for row\n\t\tfor (int row =0; row<nextVersion.length; row++)\n\t\t{\t//for loop for column\n\t\t\tfor (int column =0; column<nextVersion[row].length; column++)\n\t\t\t{\n\t\t\t\t//assigning values for currentVersion to nextVersion array\n\t\t\t\tnextVersion[row][column] = currentVersion[row][column];\n\t\t\t}\n\t\t}\n\t\n\t}", "public ProcessedDynamicData deepCopy( ) {\r\n\r\n ProcessedDynamicData copy = new ProcessedDynamicData( this.channelId );\r\n\r\n copy.channelId = this.channelId;\r\n copy.dateTimeStamp = new java.util.Date( this.dateTimeStamp.getTime() );\r\n copy.samplingRate = this.samplingRate;\r\n copy.eu = this.eu;\r\n\r\n copy.min = this.min;\r\n copy.max = this.max;\r\n\r\n copy.measurementType = this.measurementType;\r\n copy.measurementUnit = this.measurementUnit;\r\n\r\n // data and labels\r\n List<Double> dataCopy = new Vector<Double>();\r\n for( int i = 0; i < this.data.size(); i++ ) {\r\n dataCopy.add( new Double( this.data.get( i ) ) );\r\n }\r\n copy.setData( dataCopy );\r\n\r\n List<Double> dataLabels = new Vector<Double>();\r\n for( int i = 0; i < this.dataLabels.size(); i++ ) {\r\n dataLabels.add( new Double( this.dataLabels.get( i ) ) );\r\n }\r\n copy.setDataLabels( dataLabels );\r\n\r\n // create a deep copy of overalls\r\n if( overalls != null ) {\r\n copy.overalls = new OverallLevels( this.overalls.getChannelId() );\r\n copy.overalls.setDateTimeStampMillis( this.getDateTimeStampMillis() );\r\n Vector<String> overallKeys = this.overalls.getKeys();\r\n for( int i = 0; i < overallKeys.size(); i++ ) {\r\n copy.overalls.addOverall( new String( overallKeys.elementAt( i ) ),\r\n new Double( this.overalls.getOverall( overallKeys.elementAt( i ) ) ) );\r\n }\r\n }\r\n\r\n copy.xEUnit = this.xEUnit;\r\n copy.yEUnit = this.yEUnit;\r\n\r\n copy.xSymbol = this.xSymbol;\r\n copy.ySymbol = this.ySymbol;\r\n copy.xPhysDomain = this.xPhysDomain;\r\n copy.yPhysDomain = this.yPhysDomain;\r\n \r\n copy.noOfAppendedZeros = this.noOfAppendedZeros;\r\n\r\n return copy;\r\n }", "public boolean isCopyState() {\n\t\treturn true;\n\t}", "StoryState copy() {\r\n\t\tStoryState copy = new StoryState(story);\r\n\r\n\t\tcopy.getOutputStream().addAll(outputStream);\r\n\t\toutputStreamDirty();\r\n\t\tcopy.currentChoices.addAll(currentChoices);\r\n\r\n\t\tif (hasError()) {\r\n\t\t\tcopy.currentErrors = new ArrayList<String>();\r\n\t\t\tcopy.currentErrors.addAll(currentErrors);\r\n\t\t}\r\n\r\n\t\tcopy.callStack = new CallStack(callStack);\r\n\r\n\t\tcopy.variablesState = new VariablesState(copy.callStack, story.getListDefinitions());\r\n\t\tcopy.variablesState.copyFrom(variablesState);\r\n\r\n\t\tcopy.evaluationStack.addAll(evaluationStack);\r\n\r\n\t\tif (getDivertedTargetObject() != null)\r\n\t\t\tcopy.setDivertedTargetObject(divertedTargetObject);\r\n\r\n\t\tcopy.setPreviousContentObject(getPreviousContentObject());\r\n\r\n\t\tcopy.visitCounts = new HashMap<String, Integer>(visitCounts);\r\n\t\tcopy.turnIndices = new HashMap<String, Integer>(turnIndices);\r\n\t\tcopy.currentTurnIndex = currentTurnIndex;\r\n\t\tcopy.storySeed = storySeed;\r\n\t\tcopy.previousRandom = previousRandom;\r\n\r\n\t\tcopy.setDidSafeExit(didSafeExit);\r\n\r\n\t\treturn copy;\r\n\t}", "public abstract B copy();", "public SceneLabelObjectState copy(){\n\n\t\t//get a copy of the generic data from the supertype\n\t\tSceneDivObjectState genericCopy = super.copy(); \n\n\t\t//then generate a copy of this specific data using it (which is easier then specifying all the fields\n\t\t//Separately like we used too)\n\t\tSceneLabelObjectState newObject = new SceneLabelObjectState(\n\t\t\t\tgenericCopy,\n\t\t\t\tObjectsCurrentText,\t\t\n\t\t\t\tCSSname,\n\t\t\t\tcursorVisible,\n\t\t\t\tTypedText,\n\t\t\t\tCustom_Key_Beep,\n\t\t\t\tCustom_Space_Beep);\n\n\t\treturn newObject;\n\n\n\t}", "private ProcessedDynamicData( ) {\r\n super();\r\n }", "protected Element initMyVar(Node[] data){\n\t\treturn \t\t\n\t\t\tel( \"bpws:copy\", new Node[] {\n\t\t\t\tel(\t\"bpws:from\",\n\t\t\t\t\tel(\"nswomoxsd:receive\", new Node[]{\n\t\t\t\t\t\tel(\"nswomoxsd:processName\", text(this.name)),\n\t\t\t\t\t\tel(\"nswomoxsd:processId\", text(\"0\")),\n\t\t\t\t\t\tel(\"nswomoxsd:evt\", data)\n\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t\tel(\t\"bpws:to\", new Node[]{\n\t\t\t\t\tattr(\"variable\", VARNAME),\n\t\t\t\t\tattr(\"part\", \"part1\")\n\t\t\t\t})\n\t\t\t});\n\t}", "void onPrepareForSubmit() {\n\t\t// Create the same list as was rendered.\n\t\t// Loop will write its input field values into the list's objects.\n\n\t\tcreatePersonsList();\n\n\t\t// Prepare to take a copy of each field.\n\n\t\trowNum = -1;\n\t\tfirstNameFieldCopyByRowNum = new HashMap<Integer, FieldCopy>();\n\t\tlastNameFieldCopyByRowNum = new HashMap<Integer, FieldCopy>();\n\t\tregionFieldCopyByRowNum = new HashMap<Integer, FieldCopy>();\n\t\tstartDateFieldCopyByRowNum = new HashMap<Integer, FieldCopy>();\n\t}", "void postProcess();", "void postProcess();", "public abstract SoftwareLight copy();", "void copyPropertiesToMetas( Object source, Object target );", "public void Duplicate()\n {\n\n tacc2 = tacc.clone();\n px2 = px.clone();\n py2 = py.clone();\n pz2 = pz.clone();\n\n tgyro2 = tgyro.clone();\n\n accx2 = accx.clone();\n accy2 = accy.clone();\n accz2 = accz.clone();\n\n lng2 = lng.clone();\n lat2 = lat.clone();\n }", "public abstract Player freshCopy();", "private synchronized void updateVariables() throws DebugException {\n\t\tif (lastUpdated == target.getSuspendCount()\n\t\t\t\t|| (variables != null && oldLineNumber == lineNumber))\n\t\t\treturn;\n\t\t\n\t\tSynchronizer frontend = target.getFrontend();\n\t\tif (frontend != null) {\n\t\t\t// get local variables\n\t\t\tString localsSausage = frontend.GetLocals(thread.getID(),frameNumber);\n\t\t\tString[] locals;\n\t\t\tif (localsSausage == null || localsSausage.equals(\"--\")\n\t\t\t\t\t|| localsSausage.equals(\"\"))\n\t\t\t\tlocals = new String[0];\n\t\t\telse\n\t\t\t\tlocals = localsSausage.split(\" \");\n\t\t\t// get parameters\n\t\t\tString paramsSausage = frontend.GetParameters(thread.getID(),frameNumber);\n\t\t\tString[] params;\n\t\t\tif (paramsSausage == null || paramsSausage.equals(\"--\")\n\t\t\t\t\t|| paramsSausage.equals(\"\"))\n\t\t\t\tparams = new String[0];\n\t\t\telse\n\t\t\t\tparams = paramsSausage.split(\" \");\n\t\t\t// get static fields of the current class\n\t\t\tString className;\n\t\t\ttry {\n\t\t\t\tclassName = methodName.substring(0, methodName.lastIndexOf('.'));\n\t\t\t} catch (StringIndexOutOfBoundsException e) {\n\t\t\t\tclassName = \"\";\n\t\t\t}\n\t\t\tString staticsSausage = frontend.PtypeFieldsOnly(thread.getID(),frameNumber,\n\t\t\t\t\tclassName,true);\n\t\t\tString[] statics;\n\t\t\tif (staticsSausage == null || staticsSausage.equals(\"--\")\n\t\t\t\t\t|| staticsSausage.equals(\"\"))\n\t\t\t\tstatics = new String[0];\n\t\t\telse\n\t\t\t\tstatics = staticsSausage.split(\" \");\n\t\t\t// determine if \"this\" is valid\n\t\t\tboolean _this = true;\n\t\t\tif (frontend.PtypeFieldsOnly(thread.getID(),frameNumber,\"this\",false).equals(\"--\"))\n\t\t\t\t_this = false;\n\t\t\t\n\t\t\t// create variable objects\n\t\t\tIVariable[] tempVariables = new EmonicVariable[locals.length + params.length\n\t\t\t + statics.length + (_this ? 1 : 0)];\n\n\t\t\tif (variables == null || variables.length != tempVariables.length) {\n\t\t\t\t// something changed\n\t\t\t\tint index = 0;\n\t\t\t\tif (_this) {\n\t\t\t\t\ttempVariables[0] = new EmonicVariable(this,\"this\",null);\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t\tArrays.sort(locals);\n\t\t\t\tfor (int i=0; i<locals.length; i++) {\n\t\t\t\t\ttempVariables[i+index] = new EmonicVariable(this,locals[i],null);\n\t\t\t\t}\n\t\t\t\tindex+=locals.length;\n\t\t\t\tArrays.sort(params);\n\t\t\t\tfor (int i=0; i<params.length; i++) {\n\t\t\t\t\ttempVariables[i+index] = new EmonicVariable(this,params[i],null);\n\t\t\t\t}\n\t\t\t\tindex+=params.length;\n\t\t\t\tArrays.sort(statics);\n\t\t\t\tfor (int i=0; i<statics.length; i++) {\n\t\t\t\t\ttempVariables[i+index] = new EmonicVariable(this,statics[i],null);\n\t\t\t\t}\n\t\t\t\tvariables = tempVariables;\n\t\t\t} \n\t\t}\n\t\tlastUpdated = target.getSuspendCount();\n//\t\toldLineNumber = lineNumber;\n\t}", "void copyMetasToProperties( Object source, Object target );", "protected void initVars() {}", "public void postPlace(World var1, int var2, int var3, int var4, int var5)\n {\n super.postPlace(var1, var2, var3, var4, var5);\n int var6 = var1.getData(var2, var3, var4);\n\n if (var5 == 1 && BuildersProxy.canPlaceTorch(var1, var2, var3 - 1, var4))\n {\n var6 = 5;\n }\n\n if (var5 == 2 && BuildersProxy.canPlaceTorch(var1, var2, var3, var4 + 1))\n {\n var6 = 4;\n }\n\n if (var5 == 3 && BuildersProxy.canPlaceTorch(var1, var2, var3, var4 - 1))\n {\n var6 = 3;\n }\n\n if (var5 == 4 && BuildersProxy.canPlaceTorch(var1, var2 + 1, var3, var4))\n {\n var6 = 2;\n }\n\n if (var5 == 5 && BuildersProxy.canPlaceTorch(var1, var2 - 1, var3, var4))\n {\n var6 = 1;\n }\n\n if (var5 == 0 && BuildersProxy.canPlaceTorch(var1, var2, var3 + 1, var4))\n {\n var6 = 0;\n }\n\n var1.setData(var2, var3, var4, var6);\n }", "@Override\n protected Workflow copy(CompoundWorkflow parent) {\n return copyImpl(new AssignmentWorkflow(getNode().clone(), parent, newTaskTemplate, newTaskClass, newTaskOutcomes));\n }", "@Override\n\tpublic TemplateEffect copy() {\n\t\treturn new TemplateEffect(labelTemplate, valueTemplate, type, priority);\n\t}", "public void saveActions()\r\n {\r\n\t imageCopy[0] = bufferedImage;\r\n\t imageCopy[1] = edited;\r\n\t imageCopy[2] = cropedPart;\r\n\t imageCopy[3] = bufferedImage;\r\n\t \r\n\t statesCopy[0] = isBlured;\r\n\t statesCopy[1] = isReadyToSave;\r\n\t statesCopy[2] = isChanged;\r\n\t statesCopy[3] = isInverted;\r\n\t statesCopy[4] = isRectangularCrop;\r\n\t statesCopy[5] = isCircularCrop;\r\n\t statesCopy[6] = isImageLoaded;\r\n\t \r\n }", "private void postLocal() {\n reduce3(_nleft); // Reduce global results from neighbors.\n reduce3(_nrite);\n if( _fs != null ) // Block on all other pending tasks, also\n _fs.blockForPending();\n // Finally, must return all results in 'this' because that is the API -\n // what the user expects\n int nlo = _nlo, nhi = _nhi; // Save these before copyOver crushes them\n if( _res == null ) _nlo = -1; // Flag for no local results *at all*\n else if( _res != this ) // There is a local result, and its not self\n copyOver(_res); // So copy into self\n if( nlo==0 && nhi == H2O.CLOUD.size() ) // All-done on head of whole MRTask tree?\n _fr.closeAppendables(); // Final close ops on any new appendable vec\n }", "private Copy prepareCopyForHeaderMetaData(String variableName, String property) {\n\t\tCopy copy = new Copy();\n\t\tFromSpec from = new FromSpec();\n\t\tfrom.setType(fromTypes.VARIABLE);\n\t\tfrom.setPart(\"payload\");\n\t\tfrom.setVariableName(\"input\");\n\t\tfrom.setQueryLanguage(\"urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0\");\n\t\tfrom.setQuery(\"<![CDATA[tns:\" + property + \"]]>\");\n\t\tcopy.setFromSpec(from);\n\t\t\n\t\tToSpec to = new ToSpec();\n\t\tto.setType(toTypes.VARIABLE);\n\t\tto.setVariableName(variableName);\n\t\tto.setHeader(property);\n\t\tcopy.setToSpec(to);\n\t\t\n\t\treturn copy;\n\t}", "@Override\n\tpublic void postBacktrack(MetaVariable metaVariable) {\n\t\t\n\t}", "public IAspectVariable<V> createNewVariable(PartTarget target);", "@Override\n\tprotected void remapVariablesInThisExpression(Map<String, String> fromToVariableMap) {\n\t}", "@LargeTest\n public void testCopy() {\n TestAction ta = new TestAction(TestName.COPY);\n runTest(ta, TestName.COPY.name());\n }", "Builder copyValues(PropertyBox source);", "public static void copyFields(FieldMap copyTo,\r\n FieldMap copyFrom)\r\n {\r\n \tIterator<Field<?>> iter = copyFrom.iterator();\r\n \twhile (iter.hasNext()){\r\n \t\tField<?> field = iter.next();\r\n \t\ttry {\r\n\t\t\t\tcopyTo.setField(copyFrom.getField(new StringField(field.getTag())));\r\n\t\t\t} catch (FieldNotFound e) {\r\n\t\t\t\t// do nothing\r\n\t\t\t}\r\n \t}\r\n }", "private final void postLocal() {\n reduce3(_nleft); // Reduce global results from neighbors.\n reduce3(_nrite);\n _profile._remoteBlkDone = System.currentTimeMillis();\n _fs.blockForPending();\n _profile._localBlkDone = System.currentTimeMillis();\n // Finally, must return all results in 'this' because that is the API -\n // what the user expects\n int nlo = subShift(H2O.SELF.index());\n int nhi = _nhi; // Save before copyOver crushes them\n if( _res == null ) _nhi=-1; // Flag for no local results *at all*\n else if( _res != this ) { // There is a local result, and its not self\n _res._profile = _profile; // Use my profile (not childs)\n copyOver(_res); // So copy into self\n }\n closeLocal();\n if( nlo==0 && nhi == H2O.CLOUD.size() ) {\n // Do any post-writing work (zap rollup fields, etc)\n _fr.reloadVecs();\n for( int i=0; i<_fr.numCols(); i++ )\n _fr.vecs()[i].postWrite();\n postGlobal();\n }\n }", "Model copy();", "public void copy() {\n\t\tcmd = new CopyCommand(editor);\n\t\tinvoker = new MiniEditorInvoker(cmd);\n\t\tinvoker.action();\n\t}", "public void doCopyitem ( RunData data )\n\t{\n\t\t// get the state object\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\tString itemId = data.getParameters ().getString (\"itemId\");\n\n\t\tif (itemId == 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(\"choosefile6\"));\n\t\t\tstate.setAttribute (STATE_MODE, MODE_LIST);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tResourceProperties properties = ContentHostingService.getProperties (itemId);\n\t\t\t\t/*\n\t\t\t\tif (properties.getProperty (ResourceProperties.PROP_IS_COLLECTION).equals (Boolean.TRUE.toString()))\n\t\t\t\t{\n\t\t\t\t\tString alert = (String) state.getAttribute(STATE_MESSAGE);\n\t\t\t\t\tif (alert == null || ((alert != null) && (alert.indexOf(RESOURCE_INVALID_OPERATION_ON_COLLECTION_STRING) == -1)))\n\t\t\t\t\t{\n\t\t\t\t\t\taddAlert(state, RESOURCE_INVALID_OPERATION_ON_COLLECTION_STRING);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}\n\t\t\tcatch (PermissionException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"notpermis15\"));\n\t\t\t}\n\t\t\tcatch (IdUnusedException e)\n\t\t\t{\n\t\t\t\taddAlert(state,RESOURCE_NOT_EXIST_STRING);\n\t\t\t}\t// try-catch\n\n\t\t\tif (state.getAttribute(STATE_MESSAGE) == null)\n\t\t\t{\n\t\t\t\tstate.setAttribute (STATE_COPY_FLAG, Boolean.TRUE.toString());\n\n\t\t\t\tstate.setAttribute (STATE_COPIED_ID, itemId);\n\t\t\t}\t// if-else\n\t\t}\t// if-else\n\n\t}", "public void copyingPrivateUserAttributes(final Anything copy) \n\t\t\t\tthrows PersistenceException{\n }", "@Override\r\n\tpublic void copy(Property p) {\n\t\t\r\n\t}", "public void setPost(WPPost post) {this.post = post;}", "public interface Copy {\r\n public void copy(String now, String after);\r\n}", "protected void setCopyFlags(SessionState state)\n\t{\n\t\tString copyFlag = (String) state.getAttribute(STATE_COPY_FLAG);\n\t\tList copyItemsVector = (List) state.getAttribute(STATE_COPIED_IDS);\n\n\t\tif(copyFlag == null)\n\t\t{\n\t\t\tcopyFlag = Boolean.FALSE.toString();\n\t\t\tstate.setAttribute(STATE_COPY_FLAG, copyFlag);\n\t\t}\n\n\t\tif(copyFlag.equals(Boolean.TRUE.toString()))\n\t\t{\n\t\t\tif(copyItemsVector == null)\n\t\t\t{\n\t\t\t\tcopyItemsVector = new Vector();\n\t\t\t\tstate.setAttribute(STATE_COPIED_IDS, copyItemsVector);\n\t\t\t}\n\t\t\tif(copyItemsVector.isEmpty())\n\t\t\t{\n\t\t\t\tstate.setAttribute(STATE_COPY_FLAG, Boolean.FALSE.toString());\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcopyItemsVector = new Vector();\n\t\t\tstate.setAttribute(STATE_COPIED_IDS, copyItemsVector);\n\t\t}\n\n\t\tList roots = (List) state.getAttribute(STATE_COLLECTION_ROOTS);\n\t\tIterator rootIt = roots.iterator();\n\t\twhile(rootIt.hasNext())\n\t\t{\n\t\t\tBrowseItem root = (BrowseItem) rootIt.next();\n\t\t\tboolean root_copied = copyItemsVector.contains(root.getId());\n\t\t\troot.setCopied(root_copied);\n\n\t\t\tList members = root.getMembers();\n\t\t\tIterator memberIt = members.iterator();\n\t\t\twhile(memberIt.hasNext())\n\t\t\t{\n\t\t\t\tBrowseItem member = (BrowseItem) memberIt.next();\n\t\t\t\tboolean member_copied = copyItemsVector.contains(member.getId());\n\t\t\t\tmember.setCopied(member_copied);\n\t\t\t}\n\t\t}\n\t\t// check -- jim\n\t\tstate.setAttribute(STATE_COLLECTION_ROOTS, roots);\n\n\t}", "protected AbstractChartModel copy(AbstractChartModel aCopy) {\n aCopy.title = title;\n aCopy.xAxisTitle = xAxisTitle;\n aCopy.yAxisTitle = yAxisTitle;\n aCopy.xRangeMax = xRangeMax;\n aCopy.xRangeMin = xRangeMin;\n aCopy.xRangeIncr = xRangeIncr;\n aCopy.yRangeMax = yRangeMax;\n aCopy.yRangeMin = yRangeMin;\n aCopy.yRangeIncr = yRangeIncr;\n aCopy.simModel = simModel;\n ArrayList list = new ArrayList();\n for (int i = 0, n = dataSources.size(); i < n; i++) {\n GuiChartDataSource ds = (GuiChartDataSource) dataSources.get(i);\n list.add(ds.copy());\n }\n aCopy.dataSources = list;\n\n return aCopy;\n }", "public void copyInfo( Student stu ) {\r\n this.firstName = stu.firstName;\r\n this.lastName = stu.lastName;\r\n this.address = stu.address;\r\n this.loginID = stu.loginID;\r\n this.numCredits = stu.numCredits;\r\n this.totalGradePoints = stu.totalGradePoints;\r\n this.studentNum = stu.studentNum;\r\n }", "void method_6615(class_1303 var1) {\r\n this.field_6524 = var1;\r\n super();\r\n }", "void copy(Board b) {\n internalCopy(b);\n }" ]
[ "0.6435038", "0.61587846", "0.61378103", "0.6011706", "0.59936553", "0.5920907", "0.5885295", "0.5839777", "0.56938016", "0.56872565", "0.560634", "0.55553865", "0.5547898", "0.55456585", "0.5535043", "0.55340725", "0.55205286", "0.55019265", "0.54765713", "0.5463148", "0.54324496", "0.54272556", "0.5407441", "0.53834844", "0.5364707", "0.5347795", "0.5341862", "0.5319379", "0.53052574", "0.53041637", "0.5297226", "0.5290102", "0.52820057", "0.52781093", "0.52776855", "0.5270163", "0.5260252", "0.5255149", "0.5254146", "0.5247938", "0.5245286", "0.5241833", "0.52384984", "0.52292216", "0.5212155", "0.52076983", "0.5204121", "0.5204117", "0.5191399", "0.51832783", "0.5176974", "0.51736724", "0.5154305", "0.5148566", "0.5145228", "0.5124493", "0.512077", "0.51123", "0.5110463", "0.51066005", "0.5102787", "0.50854695", "0.5079319", "0.50669014", "0.50664353", "0.50652397", "0.5061944", "0.50574017", "0.50574017", "0.50477344", "0.5045013", "0.5044683", "0.5038338", "0.5033649", "0.5031004", "0.5030639", "0.50300944", "0.49996692", "0.4999527", "0.49921453", "0.49796346", "0.4978124", "0.49774757", "0.49744195", "0.49657577", "0.4961365", "0.49581456", "0.49542964", "0.49527583", "0.4951749", "0.49508676", "0.4947283", "0.49470627", "0.4944844", "0.49238193", "0.49195048", "0.49179965", "0.49168888", "0.49141508", "0.4912563", "0.49089986" ]
0.0
-1
/ / / / / / / / / / / / / / / /
public static int upHeap(char[] heap, int size, int i, CharComparator c) { /* 90 */ assert i < size; /* 91 */ char e = heap[i]; /* 92 */ if (c == null) { /* 93 */ while (i != 0) { /* 94 */ int parent = i - 1 >>> 1; /* 95 */ char t = heap[parent]; /* 96 */ if (t <= e) /* */ break; /* 98 */ heap[i] = t; /* 99 */ i = parent; /* */ } /* */ } else { /* 102 */ while (i != 0) { /* 103 */ int parent = i - 1 >>> 1; /* 104 */ char t = heap[parent]; /* 105 */ if (c.compare(t, e) <= 0) /* */ break; /* 107 */ heap[i] = t; /* 108 */ i = parent; /* */ } /* 110 */ } heap[i] = e; /* 111 */ return i; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "double passer();", "public Integer getWidth(){return this.width;}", "int getWidth() {return width;}", "public void divide() {\n\t\t\n\t}", "int width();", "private int rightChild(int i){return 2*i+2;}", "public abstract void bepaalGrootte();", "static int getNumPatterns() { return 64; }", "public double getWidth() {\n return this.size * 2.0; \n }", "public void getTile_B8();", "public void gored() {\n\t\t\n\t}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "int getTribeSize();", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "public int getEdgeCount() \n {\n return 3;\n }", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public String ring();", "void mo33732Px();", "long getWidth();", "public String toString(){ return \"DIV\";}", "public int getWidth() {\r\n\treturn this.width;\r\n}", "public double getWidth() { return _width<0? -_width : _width; }", "double getNewWidth();", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "double seBlesser();", "public int generateRoshambo(){\n ;]\n\n }", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "public int getBlockLength()\r\n/* 45: */ {\r\n/* 46:107 */ return -32;\r\n/* 47: */ }", "public int my_leaf_count();", "public abstract int getSpotsNeeded();", "public static int size_parent() {\n return (8 / 8);\n }", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "@Override\n public void bfs() {\n\n }", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "public abstract String division();", "long getMid();", "long getMid();", "int getSpriteArraySize();", "int getSize ();", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "int expand();", "public static int size_parentId() {\n return (16 / 8);\n }", "public void leerPlanesDietas();", "public void skystonePos4() {\n }", "public int getWidth(){\n return width;\n }", "public int getTakeSpace() {\n return 0;\n }", "@Override\npublic void processDirection() {\n\t\n}", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public abstract double getBaseWidth();", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic int sount() {\n\t\treturn 0;\n\t}", "public String getRing();", "public int getWidth()\n {return width;}", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "Operations operations();", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "@Override\n\tpublic int taille() {\n\t\treturn 1;\n\t}", "public double getPerimiter(){return (2*height +2*width);}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "double volume(){\n return width*height*depth;\n }", "public int getInternalBlockLength()\r\n/* 40: */ {\r\n/* 41: 95 */ return 32;\r\n/* 42: */ }", "int depth();", "int depth();", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\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{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "public int length() { return 1+maxidx; }", "public static int offset_parent() {\n return (40 / 8);\n }", "@Override\n public int width()\n {\n return widthCent; //Charlie Gao helped me debug the issue here\n }", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "public String getRingback();", "private void poetries() {\n\n\t}", "String directsTo();", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "public int width();", "Parallelogram(){\n length = width = height = 0;\n }", "int align();", "public double width() { return _width; }", "@Override\r\n\tpublic int operar() {\n\t\treturn 0;\r\n\t}", "int getWidth()\n {\n return width;\n }", "public void Exterior() {\n\t\t\r\n\t}", "public void method_4270() {}", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "public static void enrichmentMaxLowMem(String szinputsegment,String szinputcoorddir,String szinputcoordlist,\n\t\t\t\t int noffsetleft, int noffsetright,\n int nbinsize, boolean bcenter,boolean bunique, boolean busesignal,String szcolfields,\n\t\t\t\t boolean bbaseres, String szoutfile,boolean bcolscaleheat,Color theColor,String sztitle, \n\t\t\t\t\t String szlabelmapping, boolean bprintimage, boolean bstringlabels, boolean bbrowser) throws IOException\n {\n\n\n //for each enrichment category and state label gives a count of how often\n //overlapped by a segment optionally with signal\n\n String szLine;\n String[] files;\n\n if (szinputcoordlist == null)\n {\n File dir = new File(szinputcoorddir);\n\t //we don't have a specific list of files to include\n\t //will use all files in the directory\n\t if (dir.isDirectory())\t \n\t {\n\t //throw new IllegalArgumentException(szinputcoorddir+\" is not a directory!\");\n\t //added in v1.11 to skip hidden files\n\t String[] filesWithHidden = dir.list();\n\t int nnonhiddencount = 0;\n\t for (int nfile = 0; nfile < filesWithHidden.length; nfile++)\n\t {\n\t if (!(new File(filesWithHidden[nfile])).isHidden())\n\t\t{\n\t\t nnonhiddencount++;\n\t\t}\n\t }\t \n\n\t int nactualindex = 0;\n\t files = new String[nnonhiddencount];// dir.list(); \n\t if (nnonhiddencount == 0)\n\t {\n\t throw new IllegalArgumentException(\"No files found in \"+szinputcoorddir);\n\t }\n\n for (int nfile = 0; nfile < filesWithHidden.length; nfile++)\n\t {\n\t if (!(new File(filesWithHidden[nfile])).isHidden())\n\t {\n\t files[nactualindex] = filesWithHidden[nfile];\n\t\t nactualindex++;\n\t }\n\t }\n\t Arrays.sort(files);\n\t szinputcoorddir += \"/\";\n\t }\n\t else\n\t {\n\t files = new String[1];\n\t files[0] = szinputcoorddir;\n\t szinputcoorddir = \"\";\n\t }\n }\n else\n {\n szinputcoorddir += \"/\";\n\t //store in files all file names given in szinputcoordlist\n\t BufferedReader brfiles = Util.getBufferedReader(szinputcoordlist);\n\t ArrayList alfiles = new ArrayList();\n\t while ((szLine = brfiles.readLine())!=null)\n\t {\n\t alfiles.add(szLine);\n\t }\n\t brfiles.close(); \n\t files = new String[alfiles.size()];\n\t for (int nfile = 0; nfile < files.length; nfile++)\n\t {\n\t files[nfile] = (String) alfiles.get(nfile);\n\t }\n }\n\t\n ArrayList alchromindex = new ArrayList(); //stores the index of the chromosome\n\t\n if (busesignal)\n {\n bunique = false;\n }\n\n HashMap hmchromMax = new HashMap(); //maps chromosome to the maximum index\n HashMap hmchromToIndex = new HashMap(); //maps chromosome to an index\n HashMap hmLabelToIndex = new HashMap(); //maps label to an index\n HashMap hmIndexToLabel = new HashMap(); //maps index string to label\n int nmaxlabel=0; // the maximum label found\n String szlabel=\"\";\n boolean busedunderscore = false;\n //reads in the segmentation recording maximum position for each chromosome and\n //maximum label\n BufferedReader brinputsegment = Util.getBufferedReader(szinputsegment);\n while ((szLine = brinputsegment.readLine())!=null)\n {\n\n\t //added v1.24\n\t if (bbrowser)\n\t {\n\t if ((szLine.toLowerCase(Locale.ENGLISH).startsWith(\"browser\"))||(szLine.toLowerCase(Locale.ENGLISH).startsWith(\"track\")))\n\t {\n\t continue;\n\t }\n\t }\n\n\t StringTokenizer st;\n\t if (bstringlabels)\n\t {\n st = new StringTokenizer(szLine,\"\\t\");\n\t }\n\t else\n\t {\n\t st = new StringTokenizer(szLine,\"\\t \");\n }\n\n\t //added in v1.24\n\t int numtokens = st.countTokens();\n\t if (numtokens == 0)\n\t {\n\t //skip blank lines\n\t continue;\n\t }\n\t else if (numtokens < 4)\n\t {\n\t throw new IllegalArgumentException(\"Line \"+szLine+\" in \"+szinputsegment+\" only had \"+numtokens+\" token(s). Expecting at least 4\");\n\t }\n\n\t String szchrom = st.nextToken().trim();\n\t int nbegincoord = Integer.parseInt(st.nextToken().trim());\n\t int nendcoord = Integer.parseInt(st.nextToken().trim());\n\t if (nbegincoord % nbinsize != 0)\n\t {\n\t\tthrow new IllegalArgumentException(\"Binsize of \"+nbinsize+\" does not agree with coordinates in input segment \"+szLine+\". -b binsize should match parameter value to LearnModel or \"+\n \"MakeSegmentation used to produce segmentation. If segmentation is derived from a lift over from another assembly, then the '-b 1' option should be used\");\n\t }\n //int nbegin = nbegincoord/nbinsize;\n\t int nend = (nendcoord-1)/nbinsize;\n szlabel = st.nextToken().trim();\n\t short slabel;\n\n\n if (bstringlabels)\n\t {\n\n\t int nunderscoreindex = szlabel.indexOf(\"_\");\n\n\t if (nunderscoreindex >=0)\n\t {\n\t String szprefix = szlabel.substring(0,nunderscoreindex);\n\n try\n\t {\n\t\t slabel = (short) (Short.parseShort(szprefix));\n\t\t if (slabel > nmaxlabel)\n\t {\n\t nmaxlabel = slabel;\n\t }\n\t\t busedunderscore = true;\n\t hmLabelToIndex.put(szlabel, Short.valueOf(slabel));\n\t\t hmIndexToLabel.put(\"\"+slabel, szlabel);\n\t\t}\n catch (NumberFormatException ex)\n\t\t{\n try\n\t\t {\n\t\t slabel = (short) (Short.parseShort(szprefix.substring(1)));\n\t\t if (slabel > nmaxlabel)\n\t\t {\n\t\t nmaxlabel = slabel;\n\t\t }\n\t\t busedunderscore = true;\n\t\t hmLabelToIndex.put(szlabel, Short.valueOf(slabel));\n\t\t hmIndexToLabel.put(\"\"+slabel, szlabel);\n\t\t }\n\t\t catch (NumberFormatException ex2)\n\t\t {\n\t\t if (busedunderscore)\n\t\t {\n\t throw new IllegalArgumentException(\"Not a valid ID before '_' in \"+szlabel+\", while valid ID found for other entries\");\n\t\t }\n\t\t }\n\t\t}\n\t }\n\n\t if (!busedunderscore)\n\t {\n //handle string labels\n\t Short objshort = (Short) hmLabelToIndex.get(szlabel);\n\n\t if (objshort == null)\n\t {\n\t nmaxlabel = hmLabelToIndex.size()+1;\n\t slabel = (short) nmaxlabel;\n\t hmLabelToIndex.put(szlabel, Short.valueOf(slabel));\n \t hmIndexToLabel.put(\"\"+nmaxlabel, szlabel);\n\t }\n\t //else\n\t //{\n\t // slabel = ((Short) objshort).shortValue();\n\t //}\n\t }\n\t }\n\t else\n\t {\n try\n\t {\n slabel = (short) (Short.parseShort(szlabel));\n\t }\n\t catch (NumberFormatException ex)\n\t {\n try\n\t\t{\n slabel = (short) (Short.parseShort(szlabel.substring(1)));\n\t\t}\n\t catch (NumberFormatException ex2)\n\t {\n throw new IllegalArgumentException(\"In fourth column neither state number or ID found in segmentation file. Use '-labels' option to run overlap enrichment treating fourth column as labels\");\n\t\t}\n\t }\n\n\t //alsegments.add(new SegmentRec(szchrom,nbegin,nend,slabel));\n\t if (slabel > nmaxlabel)\n\t {\n\t nmaxlabel = slabel;\n\t }\n\t }\n\n\t Integer objMax = (Integer) hmchromMax.get(szchrom);\n\t if (objMax == null)\n\t {\n\t //System.out.println(\"on chrom \"+szchrom);\n\t hmchromMax.put(szchrom,Integer.valueOf(nend));\n\t hmchromToIndex.put(szchrom, Integer.valueOf(hmchromToIndex.size()));\n\t alchromindex.add(szchrom);\n\t }\n\t else\n\t {\n\t int ncurrmax = objMax.intValue();\n\t if (ncurrmax < nend)\n\t {\n\t hmchromMax.put(szchrom, Integer.valueOf(nend));\t\t \n\t }\n\t }\n }\n brinputsegment.close();\n\n double[][] tallyoverlaplabel = new double[files.length][nmaxlabel+1];\n double[] dsumoverlaplabel = new double[files.length];\n double[] tallylabel = new double[nmaxlabel+1];\n\n int numchroms = alchromindex.size();\n\n for (int nchrom = 0; nchrom < numchroms; nchrom++)\n {\n //ArrayList alsegments = new ArrayList(); //stores all the segments\n\t String szchromwant = (String) alchromindex.get(nchrom);\n\t //System.out.println(\"processing \"+szchromwant);\n\t int nsize = ((Integer) hmchromMax.get(szchromwant)).intValue()+1;\n\t short[] labels = new short[nsize]; //stores the hard label assignments\n\n\t //sets to -1 so missing segments not counted as label 0\n\t for (int npos = 0; npos < nsize; npos++)\n\t {\n labels[npos] = -1;\n\t }\n\n\t brinputsegment = Util.getBufferedReader(szinputsegment);\n\t while ((szLine = brinputsegment.readLine())!=null)\n\t {\n\t StringTokenizer st;\n\t if (bstringlabels)\n\t {\n\t st = new StringTokenizer(szLine,\"\\t\");\n\t }\n\t else\n\t {\n\t st = new StringTokenizer(szLine,\"\\t \");\n\t }\n\n\t String szchrom = st.nextToken().trim();\n\t if (!szchrom.equals(szchromwant)) \n\t continue;\n\n\t int nbegincoord = Integer.parseInt(st.nextToken().trim());\n\t int nendcoord = Integer.parseInt(st.nextToken().trim());\n\n\t //if (nbegincoord % nbinsize != 0)\n\t // {\n\t //\t throw new IllegalArgumentException(\"Binsize of \"+nbinsize+\" does not agree with input segment \"+szLine);\n\t //}\n\t int nbegin = nbegincoord/nbinsize;\n\t int nend = (nendcoord-1)/nbinsize;\n\t szlabel = st.nextToken().trim();\n\t short slabel = -1;\n\n\t if (bstringlabels)\n\t {\n\t\tint nunderscoreindex = szlabel.indexOf(\"_\");\n\n\t\tif (nunderscoreindex >=0)\n\t\t{\n\t\t String szprefix = szlabel.substring(0,nunderscoreindex);\n\n try\n\t\t {\n\t\t slabel = (short) (Short.parseShort(szprefix));\n\t\t busedunderscore = true;\n\t\t }\n catch (NumberFormatException ex)\n\t\t {\n try\n\t\t {\n\t\t slabel = (short) (Short.parseShort(szprefix.substring(1)));\n\t\t\t busedunderscore = true;\n\t\t }\n\t\t catch (NumberFormatException ex2)\n\t\t {\n\t\t\t if (busedunderscore)\n\t\t\t {\n\t\t\t throw new IllegalArgumentException(\"Not a valid ID before '_' in \"+szlabel+\", while valid ID found for other entries\");\n\t\t\t }\n\t\t }\n\t\t }\n\t\t}\n\n\t\tif (!busedunderscore)\n\t\t{\n\t //handle string labels\n\t\t Short objshort = (Short) hmLabelToIndex.get(szlabel);\n\t\t slabel = ((Short) objshort).shortValue();\n\t\t}\n\t }\n\t else\n\t {\n try\n\t {\n\t slabel = (short) (Short.parseShort(szlabel));\n\t }\n\t catch (NumberFormatException ex)\n\t {\n try\n\t\t {\n slabel = (short) (Short.parseShort(szlabel.substring(1)));\n\t\t }\n\t\t catch (NumberFormatException ex2)\n\t\t {\n\t\t throw new IllegalArgumentException(\"In fourth column neither state number or ID found in segmentation file. Use '-labels' option to run overlap enrichment treating fourth column as labels\");\n\t }\n\t\t}\n\t }\n\n\t if (nbegin < 0)\n\t {\n\t nbegin = 0;\n\t }\n\n\t if (nend >= labels.length)\n\t {\n\t nend = labels.length - 1;\n\t }\n\n\t //SegmentRec theSegmentRec = (SegmentRec) alsegments.get(nindex);\n\t //int nbegin = theSegmentRec.nbegin;\n\t //int nend = theSegmentRec.nend;\n\t //short slabel = theSegmentRec.slabel;\n\t //int nchrom = ((Integer) hmchromToIndex.get(theSegmentRec.szchrom)).intValue();\n\t //short[] labels_nchrom = labels[nchrom];\n\t //stores each label position in the genome\n\t for (int npos = nbegin; npos <= nend; npos++)\n\t {\n\t labels[npos] = slabel;\n\t //tallylabel[slabel]++; \n\t }\n\t tallylabel[slabel] += (nend-nbegin)+1;\n\t }\n\n\n\t for (int nfile = 0; nfile < files.length; nfile++)\n\t {\n\t double[] tallyoverlaplabel_nfile = tallyoverlaplabel[nfile];\n\n\t int nchromindex = 0;\n\t int nstartindex = 1;\n\t int nendindex = 2;\n\t int nsignalindex = 3;\n\n\t if (szcolfields != null)\n\t {\n\t StringTokenizer stcolfields = new StringTokenizer(szcolfields,\",\");\n\t\tnchromindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t\tnstartindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t\tnendindex = Integer.parseInt(stcolfields.nextToken().trim());\n\n\t if (busesignal)\n\t {\n\t nsignalindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t }\n\t }\n\n \t \n if (bunique)\n\t {\n\t //Iterator itrChroms = hmchromToIndex.entrySet().iterator();\n\t //while (itrChroms.hasNext())\n\t //{\n\t //Map.Entry pairs = (Map.Entry) itrChroms.next();\n\t //String szchrom =(String) pairs.getKey();\n\t //int nchrom = ((Integer) pairs.getValue()).intValue();\n\t //short[] labels_nchrom = labels[nchrom];\n\n\t //reading in the coordinates to overlap with\n BufferedReader brcoords = Util.getBufferedReader(szinputcoorddir +files[nfile]);\n\t ArrayList alrecs = new ArrayList();\n\t while ((szLine = brcoords.readLine())!=null)\n\t {\n\t if (szLine.trim().equals(\"\")) continue;\n\t String[] szLineA = szLine.split(\"\\\\s+\");\n\t\t if (nstartindex >= szLineA.length)\n\t\t {\n\t\t throw new IllegalArgumentException(nstartindex+\" is an invalid column index for \"+szLine+\" in \"+szinputcoorddir+files[nfile]);\n\t\t }\n\n if (nendindex >= szLineA.length)\n\t\t {\n\t\t throw new IllegalArgumentException(nendindex+\" is an invalid column index for \"+szLine+\" in \"+szinputcoorddir+files[nfile]);\n\t\t }\n\n\t String szcurrchrom = szLineA[nchromindex];\n\t \t if (szchromwant.equals(szcurrchrom))\n\t\t {\n\t\t int nbeginactual =Integer.parseInt(szLineA[nstartindex])-noffsetleft;\n\t\t int nendactual =Integer.parseInt(szLineA[nendindex])-noffsetright;\n\t\t if (bcenter)\n\t\t {\n\t\t nbeginactual = (nbeginactual+nendactual)/2;\n\t\t nendactual = nbeginactual;\n\t\t }\n\t\t alrecs.add(new Interval(nbeginactual,nendactual));\n\t\t }\n\t\t}\n\t brcoords.close();\n\n\t\tObject[] alrecA = alrecs.toArray();\n\t\tArrays.sort(alrecA,new IntervalCompare());\n\n\t\tboolean bclosed = true;\n\t int nintervalstart = -1;\n\t\tint nintervalend = -1;\n\t\tboolean bdone = false;\n\n\t\tfor (int nindex = 0; (nindex <= alrecA.length&&(alrecA.length>0)); nindex++)\n\t\t{\n\t\t int ncurrstart = -1;\n\t\t int ncurrend = -1;\n\n\t\t if (nindex == alrecA.length)\n\t\t {\n\t\t bdone = true;\n\t\t }\n\t\t else \n\t\t {\n\t\t ncurrstart = ((Interval) alrecA[nindex]).nstart;\n\t\t ncurrend = ((Interval) alrecA[nindex]).nend;\n if (nindex == 0)\n\t\t {\n\t\t nintervalstart = ncurrstart;\n\t\t\t nintervalend = ncurrend;\n\t\t }\n\t\t else if (ncurrstart <= nintervalend)\n\t\t {\n\t\t //this read is still in the active interval\n\t\t //extending the current active interval \n\t\t if (ncurrend > nintervalend)\n\t\t {\n\t\t nintervalend = ncurrend;\n\t\t }\n\t\t }\t\t \n\t\t else \n\t\t {\n\t\t //just finished the current active interval\n\t\t bdone = true;\n\t\t }\n\t\t }\n\n\t\t if (bdone)\n\t {\t\t \t\t\t\t\t\t\n\t int nbegin = nintervalstart/nbinsize;\n\t\t int nend = nintervalend/nbinsize;\n\n\t\t if (nbegin < 0)\n\t\t {\n\t\t nbegin = 0;\n\t\t }\n\n\t\t if (nend >= labels.length)\n\t\t {\n\t\t nend = labels.length - 1;\n\t\t }\n\n\t for (int nbin = nbegin; nbin <= nend; nbin++)\n\t {\n\t\t if (labels[nbin]>=0)\n\t\t {\n\t\t tallyoverlaplabel_nfile[labels[nbin]]++;\n\t\t }\n\t\t }\n\n\t\t if (bbaseres)\n\t\t { \n\t\t //dbeginfrac represents the fraction of bases the nbegin interval\n\t\t //which came after the actual nbeginactual\n\t double dbeginfrac = (nintervalstart - nbegin*nbinsize)/(double) nbinsize;\n\t\t\t \n\t\t\t //dendfrac represents the fraction of bases after the end position in the interval\n\t double dendfrac = ((nend+1)*nbinsize-nintervalend-1)/(double) nbinsize;\n\t\t\t \n\t\t\t if ((nbegin < labels.length)&&(labels[nbegin]>=0)&&(dbeginfrac>0))\n\t\t { \t\t\t \n\t\t //only counted the bases if nbegin was less than labels.length \n\t\t tallyoverlaplabel_nfile[labels[nbegin]]-=dbeginfrac;\n\t\t\t }\n\n if ((nend < labels.length)&&(labels[nend]>=0)&&(dendfrac>0))\n\t\t {\n\t\t //only counted the bases if nend was less than labels.length \n\t\t tallyoverlaplabel_nfile[labels[nend]]-=dendfrac;\n\t\t\t }\n\t\t }\t\t\t \n\n\t\t nintervalstart = ncurrstart; \n\t\t nintervalend = ncurrend;\n\t\t bdone = false;\n\t\t }\t \n\t\t}\n\t\t //}\n\t }\n\t else\n\t {\n\t BufferedReader brcoords = Util.getBufferedReader(szinputcoorddir +files[nfile]);\n\t while ((szLine = brcoords.readLine())!=null)\n\t {\n\t if (szLine.trim().equals(\"\")) continue;\n\t String[] szLineA = szLine.split(\"\\\\s+\");\n\n\t String szchrom = szLineA[nchromindex];\n\t\t if (!szchromwant.equals(szchrom))\n\t\t continue;\n\n\t int nbeginactual =Integer.parseInt(szLineA[nstartindex])-noffsetleft;\n\t int nbegin = nbeginactual/nbinsize;\n\n\t\t int nendactual =Integer.parseInt(szLineA[nendindex])-noffsetright;\n\t int nend = nendactual/nbinsize;\n\n\t\t double damount;\n\t if ((busesignal)&&(nsignalindex < szLineA.length))\n\t {\n\t \t damount = Double.parseDouble(szLineA[nsignalindex]);\n\t\t }\n\t else\n\t {\n\t damount = 1;\n\t\t }\n\n\t //Integer objChrom = (Integer) hmchromToIndex.get(szchrom);\n\t //if (objChrom != null)\n\t\t //{\n\t\t //we have the chromosome corresponding to this read\n\t //int nchrom = objChrom.intValue();\n\t //short[] labels_nchrom = labels[nchrom];\n\n\t\t if (bcenter)\n\t {\n\t //using the center position of the interval only\n\t\t int ncenter = (nbeginactual+nendactual)/(2*nbinsize);\n\t\t if ((ncenter < labels.length)&&(labels[ncenter]>=0))\n\t\t {\n\t tallyoverlaplabel_nfile[labels[ncenter]]+=damount;\t\t\t \n\t\t }\n\t\t }\n\t else\n\t {\n\t\t if (nbegin < 0)\n\t\t {\n\t\t nbegin = 0;\n\t\t }\n\t\t //using the full interval range\n\t\t //no requirement on uniqueness\n\t\t if (nend >= labels.length)\n\t\t {\n\t\t nend = labels.length - 1;\n\t\t }\n\t\t\t\n\t for (int nindex = nbegin; nindex <= nend; nindex++)\n\t {\n\t\t if (labels[nindex]>=0)\n\t\t {\n\t\t //increment overlap tally not checking for uniqueness\n \t tallyoverlaplabel_nfile[labels[nindex]]+=damount;\n\t\t\t }\n\t\t }\t \n\n\t\t if (bbaseres)\n\t\t { \n\t\t //dbeginfrac represents the fraction of bases the nbegin interval\n\t\t\t //which came after the actual nbeginactual\n\t double dbeginfrac = (nbeginactual - nbegin*nbinsize)/(double) nbinsize;\n\t\t\t \n\t\t\t //dendfrac represents the fraction of bases after the end position in the interval\n\t double dendfrac = ((nend+1)*nbinsize-nendactual-1)/(double) nbinsize;\n\n\t\t\t if ((nbegin < labels.length)&&(labels[nbegin]>=0)&&(dbeginfrac>0))\n\t\t\t { \n\t\t\t //only counted the bases if nbegin was less than labels.length \n\t\t\t tallyoverlaplabel_nfile[labels[nbegin]]-=damount*dbeginfrac;\n\t\t\t }\n\n if ((nend < labels.length)&&(labels[nend]>=0)&&(dendfrac>0))\n\t\t {\n\t\t //only counted the bases if nend was less than labels.length \n\t\t\t tallyoverlaplabel_nfile[labels[nend]]-=damount*dendfrac;\n\t\t\t }\t\t\t \n\t\t }\n\t\t }\n\t\t}\t \n\t\tbrcoords.close();\n\t }\n\t }\n }\n\n\n for (int nfile = 0; nfile < files.length; nfile++)\n {\n\t double[] tallyoverlaplabel_nfile = tallyoverlaplabel[nfile];\n\n\t for (int nindex = 0; nindex < tallyoverlaplabel_nfile.length; nindex++)\n {\n dsumoverlaplabel[nfile] += tallyoverlaplabel_nfile[nindex];\n }\n\t\t\n if (dsumoverlaplabel[nfile] < EPSILONOVERLAP) // 0.00000001)\n {\n\t throw new IllegalArgumentException(\"Coordinates in \"+files[nfile]+\" not assigned to any state. Check if chromosome naming in \"+files[nfile]+\n\t\t\t\t\t\t \" match those in the segmentation file.\");\n\t }\n\t}\n\n\toutputenrichment(szoutfile, files,tallyoverlaplabel, tallylabel, dsumoverlaplabel,theColor,\n\t\t\t bcolscaleheat,ChromHMM.convertCharOrderToStringOrder(szlabel.charAt(0)),sztitle,0,szlabelmapping,szlabel.charAt(0), bprintimage, bstringlabels, hmIndexToLabel);\n }", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();" ]
[ "0.5430595", "0.53330356", "0.5092637", "0.50776035", "0.50656015", "0.5061517", "0.50255305", "0.501914", "0.5013608", "0.5012112", "0.50097734", "0.49939048", "0.49924976", "0.49502665", "0.4925594", "0.4921649", "0.49190572", "0.49077547", "0.49070126", "0.49018925", "0.48999804", "0.488493", "0.48846358", "0.48739335", "0.48632213", "0.48605266", "0.4857587", "0.4850445", "0.4847252", "0.48460993", "0.4840025", "0.48375157", "0.4835153", "0.48279664", "0.48260632", "0.4825089", "0.48174995", "0.4810252", "0.47989792", "0.47930446", "0.4789371", "0.4776887", "0.4776887", "0.47760046", "0.4774504", "0.4767123", "0.4766668", "0.4761947", "0.47615656", "0.47611192", "0.4757967", "0.47522596", "0.47508425", "0.47504175", "0.47475496", "0.47463676", "0.47461066", "0.4736013", "0.47317326", "0.47290143", "0.47165486", "0.47142136", "0.47133484", "0.47119215", "0.4709692", "0.4696957", "0.469671", "0.469411", "0.46940878", "0.46931034", "0.4691934", "0.46906507", "0.46882108", "0.46882108", "0.46868974", "0.4684452", "0.46817034", "0.46813998", "0.46741885", "0.46733153", "0.4672824", "0.467257", "0.467188", "0.4666837", "0.46659094", "0.4664564", "0.46611282", "0.4659277", "0.4656269", "0.4654199", "0.46540377", "0.46501794", "0.46494237", "0.46490437", "0.46490437", "0.46490437", "0.46490437", "0.46490437", "0.46490437", "0.46490437", "0.46490437" ]
0.0
-1
/ / / / / / / / / / /
public static void makeHeap(char[] heap, int size, CharComparator c) { /* 124 */ int i = size >>> 1; /* 125 */ while (i-- != 0) /* 126 */ downHeap(heap, size, i, c); /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "public abstract void bepaalGrootte();", "double passer();", "int getWidth() {return width;}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public Integer getWidth(){return this.width;}", "public double getWidth() {\n return this.size * 2.0; \n }", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "public void getTile_B8();", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "public String ring();", "int width();", "public void gored() {\n\t\t\n\t}", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public String toString(){ return \"DIV\";}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "public abstract String division();", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public double getWidth() { return _width<0? -_width : _width; }", "public int getEdgeCount() \n {\n return 3;\n }", "public int getWidth() {\r\n\treturn this.width;\r\n}", "long getWidth();", "@Override\n public void bfs() {\n\n }", "double getNewWidth();", "static int getNumPatterns() { return 64; }", "public int my_leaf_count();", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public int generateRoshambo(){\n ;]\n\n }", "@Override\npublic void processDirection() {\n\t\n}", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "void mo33732Px();", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "double volume(){\n return width*height*depth;\n }", "double seBlesser();", "int getTribeSize();", "Operations operations();", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "public double getPerimiter(){return (2*height +2*width);}", "public int getWidth(){\n return width;\n }", "public void leerPlanesDietas();", "public void skystonePos4() {\n }", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "public String getRing();", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "public void SubRect(){\n\t\n}", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\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{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "public abstract double getBaseWidth();", "protected int parent(int i) { return (i - 1) / 2; }", "static void pyramid(){\n\t}", "public static int size_parent() {\n return (8 / 8);\n }", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "int expand();", "public abstract int getSpotsNeeded();", "Parallelogram(){\n length = width = height = 0;\n }", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "public int getWidth()\n {return width;}", "void walk() {\n\t\t\n\t}", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "long getMid();", "long getMid();", "int depth();", "int depth();", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "String directsTo();", "int getSpriteArraySize();", "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 }", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "double getPerimeter(){\n return 2*height+width;\n }", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "int getWidth1();", "public String getRingback();", "void sharpen();", "void sharpen();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();" ]
[ "0.55399555", "0.5443442", "0.5204333", "0.5179791", "0.5094038", "0.50590646", "0.50539684", "0.5044856", "0.5026184", "0.5012574", "0.5011971", "0.50119406", "0.5004753", "0.49995723", "0.4997555", "0.49849585", "0.49794894", "0.49783266", "0.49673575", "0.4958746", "0.49115106", "0.49106503", "0.48971504", "0.48768324", "0.48714986", "0.48657656", "0.48426878", "0.48417065", "0.48406786", "0.48364836", "0.48328376", "0.4825989", "0.48220542", "0.48161465", "0.48098812", "0.48063135", "0.48051882", "0.48041537", "0.47947842", "0.4791725", "0.47886303", "0.47822112", "0.47796196", "0.47715592", "0.47692412", "0.4766935", "0.47619638", "0.4757733", "0.47523904", "0.4752045", "0.47508958", "0.47497448", "0.47489473", "0.4747727", "0.47465518", "0.47412032", "0.47345492", "0.4732624", "0.47325167", "0.47280744", "0.47272453", "0.47268674", "0.4723086", "0.47152674", "0.47094834", "0.4707848", "0.4703817", "0.47037342", "0.4695662", "0.4695552", "0.46952298", "0.46952263", "0.46876547", "0.46872154", "0.46872154", "0.4686972", "0.4686972", "0.46869096", "0.4686499", "0.46836683", "0.4682445", "0.46821058", "0.46798703", "0.4675308", "0.46727479", "0.46692434", "0.4667666", "0.4666604", "0.4666604", "0.4664779", "0.4664779", "0.4664779", "0.4664779", "0.4664779", "0.4664779", "0.4664779", "0.4664779", "0.4664779", "0.4664779", "0.4664779", "0.4664779" ]
0.0
-1
rest capacity of vertex vertex
public double residualCapacity(int vertex) { if (vertex == v) return flow; // 正向流量 else if (vertex == w) return capacity() - flow;// 剩余流量 else throw new InconsistentEdgeException(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private final void resizeVertex(int capacity) {\n\t\tif (vertex.length < capacity) {\n\t\t\tvertex = new float[capacity];\n\t\t}\n\t}", "public void removeVertex();", "public native VertexList clear();", "@Override\n public void clearVertices()\n {\n // Shouldn't clear vertices\n }", "public void removeVertex (T vertex){\n int index = vertexIndex(vertex);\n \n if (index < 0) return; // vertex does not exist\n \n n--;\n // IF THIS DOESN'T WORK make separate loop for column moving\n for (int i = index; i < n; i++){\n vertices[i] = vertices[i + 1];\n for (int j = 0; j < n; j++){\n edges[j][i] = edges[j][i + 1]; // moving row up\n edges[i] = edges[i + 1]; // moving column over\n }\n }\n }", "@Override\r\n\tpublic vec3 minus() {\n\t\treturn null;\r\n\t}", "private int removeAgentFromVertex(Vertex vertex, Agent ag){\n synchronized (vertexAgentsNumber) {\n vertexAgentsNumber.get(vertex).remove(ag);\n if( vertexAgentsNumber.get(vertex).isEmpty() ) {\n vertexAgentsNumber.remove(vertex);\n return 0;\n }\n else\n return vertexAgentsNumber.get(vertex).size();\n }\n }", "@Override\n\tpublic int remainingCapacity() {\n\t\treturn 0;\n\t}", "void remove(Vertex vertex);", "private void expandCapacity() {\n T[] tempVertices = (T[])(new Object[vertices.length * 2]);\n int[][] tempEdges = new int[vertices.length * 2][vertices.length * 2];\n \n for (int i = 0; i < n; i++) {\n tempVertices[i] = vertices[i];\n for (int j = 0; j < n; j++) {\n tempEdges[i][j] = edges[i][j];\n }\n }\n \n vertices = tempVertices;\n edges = tempEdges;\n }", "private void clean() {\n Iterable<Long> v = vertices();\n Iterator<Long> iter = v.iterator();\n while (iter.hasNext()) {\n Long n = iter.next();\n if (world.get(n).adj.size() == 0) {\n iter.remove();\n }\n }\n }", "@Override\n public void deleteVertex(int vertex) {\n\n }", "public void setEdgeCapacity(double capacity) {\n\t\tthis.capacity = capacity;\r\n\r\n\t}", "public void removeVertex (E vertex)\n {\n int indexOfVertex = this.indexOf (vertex);\n if (indexOfVertex != -1)\n {\n this.removeEdges (vertex);\n\t for (int index = indexOfVertex + 1; index <= lastIndex; index++)\n {\n vertices[index - 1] = vertices[index];\n adjacencySequences[index - 1] = adjacencySequences[index];\n }\n \n vertices[lastIndex] = null;\n adjacencySequences[lastIndex] = null;\n lastIndex--;\n \n for (int index = 0; index <= lastIndex; index++)\n {\n Node node = adjacencySequences[index];\n while (node != null)\n {\n if (node.neighbourIndex > indexOfVertex)\n node.neighbourIndex--;\n node = node.nextNode;\n }\n }\n\t}\n }", "public double getEdgeCapacity() {\r\n\t\treturn this.capacity;\r\n\t}", "public double getRemainingCapacity() {\r\n return capacity;\r\n }", "public void testRemoveVertex() {\n System.out.println(\"removeVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n for (int i = 24; i >= 0; i--) {\n Assert.assertTrue(graph.removeVertex(new Integer(i)));\n Assert.assertFalse(graph.containsVertex(new Integer(i)));\n Assert.assertEquals(graph.verticesSet().size(), i);\n }\n }", "public Edge getResidualEdge () {\r\n return new Edge(from,to,(capacity - flow));\r\n }", "public int backCapacity() {\n\t\treturn this.flow;\n\t}", "protected Vertex() {\n\t\tisInDepot = false;\n\t}", "private ProjectedVertex() {\n this.valid = false;\n this.edge = null;\n }", "protected byte[] getTankCapacity() {return null;}", "@Test\r\n public void testRemoveVertex() {\r\n System.out.println(\"removeVertex\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n int expectedResult = 0;\r\n int result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n Object v1Element = 1;\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n\r\n expectedResult = 1;\r\n result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeVertex(v1);\r\n\r\n expectedResult = 0;\r\n result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n }", "@Override\r\n\tpublic void minusFromCost() {\n\t\t\r\n\t}", "int capacity();", "int capacity();", "public int capacity();", "public int capacity();", "public abstract int capacity();", "public void testRemoveAllVertices() {\n System.out.println(\"removeAllVertices\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n Assert.assertTrue(graph.removeAllVertices());\n Assert.assertEquals(graph.verticesSet().size(), 0);\n }", "public void decreaseDegreeOfUsedNodes() {\n\t\tthis.v0.decreseDegree();\n\t\tthis.v1.decreseDegree();\n\t}", "public double uninvested() {\r\n\t\treturn getAmount() - allocated();\r\n\t}", "@Override\n\tpublic int vanish() {\n\t\treturn 1;\n\t}", "E shrink();", "public float getCapacity();", "private void clean() {\n // TODO: Your code here.\n for (Long id : vertices()) {\n if (adj.get(id).size() == 1) {\n adj.remove(id);\n }\n }\n }", "@Override\r\n public int size() {\r\n return vertices.size();\r\n }", "abstract protected int getCapacity();", "public int capacity(Edge e) {\n\t\tif(mcg!=null)\n\t\t{\n\t\t\treturn mcg.capacity(e);\n\t\t}\n\t\treturn 0;\n\t}", "public double getOriginalCapacity() {\r\n return originalCapacity;\r\n }", "void downgradeLastEdge();", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "void unlockLastEdge();", "int getVertices();", "public void vaciar(){\r\n\t\t//Monto un iterador de vertices del grafo\r\n\t\tIterator iteradorVertices = vertices.iterator();\r\n\t\tArista aristaAux;\r\n\t\tVertice verticeAux;\r\n\t\t//obtengo todos los vertices del grafo\r\n\t\twhile (iteradorVertices.hasNext()){\r\n\t\t\tverticeAux = (Vertice) iteradorVertices.next();\r\n\t\t\t//por cada vertice obtengo sus aristas salientes\r\n\t\t\tIterator iteradorAristas = verticeAux.getAristasSalientes().iterator();\r\n\t\t\t//mientras tenga aristas salientes\r\n\t\t\twhile(iteradorAristas.hasNext()){\r\n\t\t\t\t//Elimino cada arista\r\n\t\t\t\taristaAux = (Arista)iteradorAristas.next(); \r\n\t\t\t\tverticeAux.elimiarAristaSaliente(aristaAux);\r\n\t\t\t}\r\n\t\t\t//Elimino el vertice\r\n\t\t\tthis.eliminarVertice(verticeAux);\r\n\t\t}\r\n\t}", "public V removeVertex(V v);", "protected void enlarge ()\n {\n // The new capacity of the graph\n int newLength = 1 + vertices.length + ENLARGE_VALUE * vertices.length / 100;\n\n E[] newVertices = (E[]) new Object[newLength];\n Node[] newAdjacencySequences = new Node[newLength];\n \n for (int index = 0; index <= lastIndex; index++)\n {\n newVertices[index] = vertices[index];\n vertices[index] = null;\n newAdjacencySequences[index] = adjacencySequences[index];\n adjacencySequences[index] = null;\n }\n\n vertices = newVertices;\n adjacencySequences = newAdjacencySequences;\n }", "public int getCapacity();", "void removeVertex(Vertex v) throws GraphException;", "protected void removeEdgeAndVertices(TestbedEdge edge) {\n java.util.Collection<Agent> agents = getIncidentVertices(edge);\n removeEdge(edge);\n for (Agent v : agents) {\n if (getIncidentEdges(v).isEmpty()) {\n removeVertex(v);\n }\n }\n }", "@Override\n public E removeVertex(E vertex) {\n if (vertex == null || !dictionary.containsKey(vertex)) {\n return null;\n } else {\n for (E opposite : getNeighbors(vertex)) {\n dictionary.get(opposite).remove(vertex);\n }\n dictionary.remove(vertex);\n return vertex;\n }\n }", "public E uncons() throws IndexOutOfBoundsException {\n return remove(0);\n }", "public void removeAllEdges() {\n }", "public int numVertices() { return numV; }", "public native VertexList remove(VertexNode vertex);", "@Override\n public void removeVertices(List<V> plstVertex) {\n for (V v : plstVertex) {\n removeVertex(v);\n }\n }", "public int getVertexCount();", "public Edge()\n {\n start = -1;\n end = -1;\n capacity = -1;\n }", "public void compact() {\n\t\tint n = vertices.size();\n\t\t// ids utilizados de 1 a n\n\t\tint[] small = new int[n + 1];\n\t\tVertice[] big = new Vertice[n];\n\n\t\tint qbig = 0;\n\t\tfor (Vertice v1 : vertices.values()) {\n\t\t\tif (v1.id <= n)\n\t\t\t\tsmall[v1.id] = 1;\n\t\t\telse\n\t\t\t\tbig[qbig++] = v1;\n\t\t}\n\n\t\tint i = 1;\n\t\tfor (int pairs = 0; pairs < qbig; i++) {\n\t\t\tif (small[i] == 0)\n\t\t\t\tsmall[pairs++] = i;\n\t\t}\n\n\t\tfor (i = 0; i < qbig; i++) {\n\t\t\tint old_id = big[i].id;\n\t\t\tbig[i].id = small[i];\n\n\t\t\tvertices.remove(old_id);\n\t\t\tvertices.put(big[i].id, big[i]);\n\n\t\t\tfor (Vertice v1 : vertices.values()) {\n\t\t\t\tif (v1.vizinhos.get(old_id) != null) {\n\t\t\t\t\tv1.vizinhos.remove(old_id);\n\t\t\t\t\tv1.vizinhos.put(big[i].id, big[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n void test06_removeEdge_checkSize() {\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n graph.removeEdge(\"a\", \"b\"); // removes one of the edges\n if (graph.size() != 1) {\n fail(\"graph has counted incorrect number of edges\");\n }\n }", "public void clear ()\n {\n for (int index = 0; index <= lastIndex; index++)\n {\n vertices[index] = null;\n adjacencySequences[index] = null;\n }\n lastIndex = -1;\n }", "void unset() {\n size = min = pref = max = UNSET;\n }", "private void applyFlow(List<Edge> edges, int capacity) {\n\t\t\n\t\tfor (Edge edge : edges) {\t\n\t\t\tint startVertexIndex = edge.getStartVertex().getIndex();\n\t\t\tint endVertexIndex = edge.getEndVertex().getIndex();\n\t\t\t//ustawienie przeplywu we wlasciwym grafie\n\t\t\tEdge graphEdge = graph.findEdge(startVertexIndex, endVertexIndex, EdgeType.DIRECTED);\n\t\t\tint graphEdgeFlow = graphEdge.getFlow();\n\t\t\tint resultFlow = graphEdgeFlow+capacity;\n\t\t\tgraphEdge.setFlow(resultFlow);\n\t\t\t\n\t\t\tEdge residualEdge = residualNetwork.findEdge(startVertexIndex, endVertexIndex, EdgeType.DIRECTED);\n\t\t\tif(residualEdge!=null) {\n\t\t\t\tint residualEdgeCapacity = residualEdge.getCapacity();\n\t\t\t\tresidualEdge.setCapacity(residualEdgeCapacity-capacity); //odjecie\n\t\t\t\tif (residualEdge.getCapacity() == 0){\n\t\t\t\t\tresidualNetwork.removeEdge(residualEdge);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresidualEdge = residualNetwork.findEdge(endVertexIndex, startVertexIndex, EdgeType.DIRECTED);\n\t\t\tif(residualEdge!=null){\n\t\t\t\tint residualEdgeCapacity = residualEdge.getCapacity();\n\t\t\t\tresidualEdge.setCapacity(residualEdgeCapacity+capacity); //dodanie \n\t\t\t} else {\n\t\t\t\tEdge tmpEdge= new SwingEdge(); //kanal przeciwyny\n\t\t\t\ttmpEdge.getDataModel().setStartingVertex(edge.getEndVertex());\n\t\t\t\ttmpEdge.getDataModel().setEndingVertex(edge.getStartVertex());\n\t\t\t\ttmpEdge.setCapacity(capacity);\n\t\t\t\tresidualNetwork.addEdge(tmpEdge);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "private void toZeroWeightGraph() {\n source.disable();\n for (Graph.Vertex v : graph) {\n int min = Integer.MAX_VALUE;\n XGraph.XVertex vertex = (XGraph.XVertex) v;\n for (XGraph.Edge e : vertex.getNonZeroRevItr()) {\n if (e.getWeight() < min) {\n min = e.getWeight();\n }\n }\n for (Graph.Edge e : vertex.getNonZeroRevItr())\n e.setWeight(e.getWeight() - min);\n }\n source.enable();\n }", "public int getNumberOfVertices();", "public BufferSlot remove();", "int getTribeSize();", "public void clear() {\n\t members = 0;\n\t dense[0] = -1;\n\t}", "@Override\n public void clear() {\n capacity = 15;\n currentSize = 0;\n this.container = new Object[capacity];\n }", "public int getVertexSize() {\n\t\treturn graph.vertexSet().size();\r\n\t}", "public void resizeStartUnchanged(int newcapacity){\n Object []lin=new Object[newcapacity];\n int k=start;\n for(int i=0;i<size;i++){\n lin[i]=cir[k];\n k=(k+1)%cir.length;\n }\n cir=new Object[newcapacity];\n for(int i=0;i<size;i++){\n cir[k]=lin[i];\n k=(k+1)%cir.length;\n }\n }", "public Builder clearAvailableCapacity() {\n \n availableCapacity_ = 0;\n onChanged();\n return this;\n }", "public void clear(){\r\n currentSize = 0;\r\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\n public void removeVertex(V pVertex) {\n for (TimeFrame tf : darrGlobalAdjList.get(pVertex.getId()).keySet()) {\n hmpGraphsAtTimeframes.get(tf).removeVertex(pVertex);\n }\n darrGlobalAdjList.remove(pVertex.getId());\n mapAllVertices.remove(pVertex.getId());\n }", "public Graph<VLabel, ELabel>.Vertex finalVertex() {\n return _finalVertex;\n }", "ResourceSkuCapacity capacity();", "public int getCapacity( )\n {\n // Implemented by student.\n }", "public abstract int getVertexCount();", "private int extractMinCapacityFromPath(List<Edge> path) {\n\t\tint result = Integer.MAX_VALUE;\n\t\t\n\t\tfor (Edge e : path) {\n\t\t\tif (e.getCapacity() < result) {\n\t\t\t\tresult = e.getCapacity();\n\t\t\t}\n\t\t}\n\t\tflowValue+=result;\n\t\treturn result;\n\t}", "protected void trimToSize() {\n\tnodeList.trimToSize();\n\tedgeList.trimToSize();\n }", "public int getRemainingCapacity() { // get the remaining capacity\n\t\treturn maximumCapacity - cargoCapacity;\n\t}", "void FlowMaintain() {\n newFlowCap[0] = Integer.MAX_VALUE; // initial value\n\n // check the smallest in the edgesInPath, if edgesInPath is empty ==> new flow is INF\n for (Edge<E> edge : edgesInPath) {\n if (edge.getCapability() < newFlowCap[0]) {\n newFlowCap[0] = edge.getCapability();\n }\n }\n }", "private int dequeue(){\n size--;\n int ret = array[front];\n front = (front+1)%capacity;\n return ret;\n }", "@Override\n public int Capacity() {\n return current_capacity;\n }", "@Override\n @SuppressWarnings(\"unchecked\")\n public void clear() {\n @SuppressWarnings(\"Not Checked\")\n E[] newArray = (E[])new Comparable[super.capacity()];\n array = newArray;\n size = 0;\n front = 0;\n end = 0;\n }", "private void clearVisited(){\r\n\t\tfor(int i=0; i<graphSize; i++){\r\n\t\t\tmyGraph[i].visited = false;\r\n\t\t\tAdjVertex vert = myGraph[i].adjVertexHead;\r\n\t\t\twhile(vert != null){\r\n\t\t\t\tvert.visited = false;\r\n\t\t\t\tvert= vert.next;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic vec3 minus(ShaderVar var) {\n\t\treturn null;\r\n\t}", "public E removeMin() {\n // TODO: YOUR CODE HERE\n E min = getElement(1);\n swap(1, size());\n setElement(size(), null);\n bubbleDown(1);\n size -= 1;\n return min;\n }", "void retract()\n\t\t{\n\t\t\tsides = sides-1;\n\t\t\t\n\t\t\tDimension[] dime2 = new Dimension[d.length - 1];\n\t\t\t\n\t\t\tfor (int i=0; i< d.length-1; i++)\n\t\t\t{\n\t\t\t\tdime2[i]= d[i];\n\t\t\t}\n\t\t\t\n\t\t\td = new Dimension[d.length - 1];\n\t\t\tfor(int i = 0; i< dime2.length; i++)\n\t\t\t{\n\t\t\t\td[i] = dime2[i];\n\t\t\t}\n\t\t\t\t\n\t\t}", "public int freeCapacity() {\n\t\treturn this.capacity - this.flow;\n\t}", "@Override\n\tpublic void clear() {\n\t\tdata=(E[])new Object[DEFAULT_CAPACITY];\n\t\tsize=0;\n\t\trear=0;\n\t\tfront=0;\n\t}", "public Edge(Vertex from, Vertex to, int capacity){\r\n this.from = from;\r\n this.to = to;\r\n this.capacity = capacity;\r\n flow = 0;\r\n\r\n }", "public V getVertex()\r\n/* */ {\r\n/* 198 */ return (V)this.vertex;\r\n/* */ }", "public int passengers(){\n return currentCapacity(); \n }", "private void vertexDown(String vertex) {\r\n\t\tIterator it = vertexMap.entrySet().iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tMap.Entry pair = (Map.Entry) it.next();\r\n\t\t\tif (pair.getKey().equals(vertex)) {\r\n\t\t\t\tVertex v = (Vertex) pair.getValue();\r\n\t\t\t\tv.setStatus(false);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public long getVertexCount(){\n return vertexCount;\n }", "public Object getVertex(){\r\n return this.vertex;\r\n }", "public Builder clearCapacity() {\n bitField0_ = (bitField0_ & ~0x00000040);\n capacity_ = 0;\n onChanged();\n return this;\n }", "public int getEndVertex() {\n\t\treturn endVertex;\n\t}" ]
[ "0.62959164", "0.6275554", "0.5900929", "0.58959365", "0.58772415", "0.58173746", "0.5798524", "0.5787045", "0.5771136", "0.572189", "0.57203865", "0.57071215", "0.5679892", "0.5675126", "0.56408554", "0.56369096", "0.5606914", "0.55343664", "0.55227697", "0.55001736", "0.54882497", "0.5470104", "0.5446515", "0.5441066", "0.54403055", "0.54403055", "0.5418662", "0.5418662", "0.5409626", "0.5398186", "0.53901154", "0.532484", "0.53133786", "0.530679", "0.53057665", "0.52957153", "0.5292915", "0.5285018", "0.52808267", "0.52666557", "0.52549344", "0.5246033", "0.5244877", "0.5241443", "0.5229937", "0.5225383", "0.52136767", "0.521249", "0.5204936", "0.51885664", "0.5188119", "0.5186282", "0.51797605", "0.51787275", "0.51729745", "0.5161269", "0.5150414", "0.51486534", "0.51471436", "0.5140338", "0.51376784", "0.5119783", "0.5119047", "0.51171535", "0.51159894", "0.51129496", "0.51103526", "0.5104109", "0.51027215", "0.5097945", "0.5097393", "0.50955987", "0.5094323", "0.5091883", "0.50819606", "0.5077354", "0.5077011", "0.5076676", "0.50746757", "0.5071961", "0.5067838", "0.5067302", "0.5065925", "0.506579", "0.50617385", "0.5055403", "0.50450546", "0.50417095", "0.50381124", "0.5033367", "0.5026816", "0.50266397", "0.5026634", "0.50251496", "0.50251454", "0.5024486", "0.5023538", "0.50155926", "0.5010906", "0.501053" ]
0.66351485
0
To be used in the future, once test is successful. /ConnectivityManager cm = (ConnectivityManager)Context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); WifiManager wm = (WifiManager)Context.getApplicationContext.(getSystemService(Context.WIFI_SERVICE)); WifiInfo connectionInfo = wm.getConnectionInfo(); int ipAddress = connectionInfo.getIpAddress(); String ipString = formatter.formatIPAddress(ipAddress);
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView text = (TextView) findViewById(R.id.printText); String wrong = "nothing worked"; text.setText(wrong); //Test pinging localhost and printing something on the screen when the ping returns. try { InetAddress localhost = InetAddress.getLocalHost(); byte[] ip = localhost.getAddress(); String word = "address + address.getHostAddress() + address.getAddress() + address.getHostName() + address.getCanonicalHostName()"; for (int i = 1; i <= 254; i++) { ip[3] = (byte) i; InetAddress address = InetAddress.getByAddress(ip); if (address.isReachable(30)) { text.setText(word); } else { Log.d("ERROR", "The address is not reachable."); } } } catch(Exception e) { Log.d("ERROR", "" + e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressLint(\"DefaultLocale\")\n\tprivate String getIpAddr()\n\t{\n\t\tString ipString = null;\n\t\tWifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);\n\t\tif (wifiManager != null)\n\t\t{\n\t\t\tWifiInfo wifiInfo = wifiManager.getConnectionInfo();\n\t\t\tif (wifiInfo != null)\n\t\t\t{\n\t\t\t\tint ip = wifiInfo.getIpAddress();\n\n\t\t\t\tipString = String.format(\"%d.%d.%d.%d\", (ip & 0xff),\n\t\t\t\t\t(ip >> 8 & 0xff), (ip >> 16 & 0xff), (ip >> 24 & 0xff));\n\n\t\t\t}\n\t\t}\n\t\treturn ipString;\n\t}", "private String getWifiIPAddress() {\n\t\tWifiManager wifiManager = (WifiManager) this.getSystemService(this.WIFI_SERVICE);\n\t\tWifiInfo wifiInfo = wifiManager.getConnectionInfo();\n\n\t\tint ipAddress = wifiInfo.getIpAddress();\n\n\t\tif(ipAddress != 0)\n\t\t\t//\n\t\t\treturn String.format(\"%d.%d.%d.%d\",\n\t\t\t\t\t(ipAddress & 0xff), (ipAddress >> 8 & 0xff),\n\t\t\t\t\t(ipAddress >> 16 & 0xff), (ipAddress >> 24 & 0xff));\n\t\telse\n\t\t\treturn \"127.0.0.1\";\n\t}", "private String getWifiIP()\n {\n WifiManager wm = (WifiManager) getSystemService(WIFI_SERVICE);\n @SuppressWarnings(\"deprecation\")\n String ip = Formatter.formatIpAddress(wm.getConnectionInfo().getIpAddress());\n return ip;\n }", "private String getClientIP(){\n try {\n ConnectivityManager connManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);\n @SuppressWarnings(\"deprecation\")\n NetworkInfo wifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);\n @SuppressWarnings(\"deprecation\")\n NetworkInfo mobile = connManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);\n\n if (wifi.isConnected()) {\n // If Wi-Fi connected\n return getWifiIP();\n }\n\n if (mobile.isConnected()) {\n // If Internet connected\n return getMobileIP();\n }\n\n return null;\n }catch(SecurityException e){\n return null;\n }\n }", "public InetAddress getIP()\r\n\r\n {\r\n InetAddress ip=null;\r\n try{\r\n WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\r\n DhcpInfo dhcp = wifi.getDhcpInfo();\r\n int dip=dhcp.ipAddress;\r\n byte[] quads = new byte[4];\r\n for (int k = 0; k < 4; k++)\r\n quads[k] = (byte) (dip >> (k * 8));\r\n ip= InetAddress.getByAddress(quads);\r\n } catch (UnknownHostException e) {\r\n e.printStackTrace();\r\n }\r\n return ip;\r\n }", "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 static String Ipconfig(){\n StringBuilder sbuf = new StringBuilder();\n InetAddress ip;\n String hostname;\n // Inet6Address ipv6; *add a ipv6 to get the ipv6 address\n try {\n ip = InetAddress.getLocalHost();\n hostname = ip.getHostName();\n\n //NetworkInterface network = NetworkInterface.getByInetAddress(ip);\n NetworkInterface nif = NetworkInterface.getByName(\"localhost\");\n //InetAddress[] inet = InetAddress.getAllByName(ip.getHostName());\n //String address = getAddress(inet).getHostAddress();\n\n sbuf.append(\"Default gateway: \"+ip.getLocalHost());\n //fmt.format(\"MAc address:\" + nif.getHardwareAddress());\n sbuf.append(\"\\nCurrent Name : \" + ip.getHostName());\n sbuf.append(\"\\nCurrent IP address : \" + ip.getHostAddress());\n //System.out.println(\"Current IPv6 address : \"+ getByAddress(hostname,inet,nets));// + ipv6.getHostAddress());\n //System.out.println(\"Current IPv6 Temp address : \");// + ipv6.getHostAddress());\n sbuf.append(\"\\nCurrent IPv6 Local : \");// + ipv6.getHostAddress());\n \n } catch(Throwable se){\n se.printStackTrace();\n }\n return sbuf.toString();\n }", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "public static String getIP()\n {\n try\n {\n URL whatismyip = new URL(\"http://checkip.amazonaws.com\");\n BufferedReader in = new BufferedReader(new InputStreamReader(\n whatismyip.openStream()));\n\n String ip = in.readLine(); //you get the IP as a String\n return ip;\n }\n catch (Exception exc)\n {\n System.out.println(\"Get internet IP address error:\" + exc.toString());\n return \"\";\n }\n }", "private String getIPAddress() throws Exception {\n //Don't need the line of code below, TODO: delete it!\n InetAddress getIP = InetAddress.getLocalHost();\n String thisSystemAddress = \"\";\n try{\n URL thisUrl = new URL(\"http://bot.whatismyipaddress.com\");\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(thisUrl.openStream()));\n thisSystemAddress = bufferedReader.readLine().trim();\n } catch (Exception e){\n e.printStackTrace();\n e.getCause();\n }\n\n return thisSystemAddress;\n }", "private static String convertIpAddress(int rawAddress)\n {\n if (ByteOrder.nativeOrder().equals(ByteOrder.LITTLE_ENDIAN)) {\n rawAddress = Integer.reverseBytes(rawAddress);\n }\n\n byte[] ipByteArray = BigInteger.valueOf(rawAddress).toByteArray();\n\n String ipAddressString;\n try {\n ipAddressString = InetAddress.getByAddress(ipByteArray).getHostAddress();\n } catch (UnknownHostException ex) {\n Log.e(\"WIFIIP\", \"Unable to get host address.\");\n ipAddressString = null;\n }\n return ipAddressString;\n }", "public String getIP() throws UnknownHostException{\n\t\tInetAddress addr = InetAddress.getLocalHost();//Get local IP\n \t String ip = addr.toString().split(\"\\\\/\")[1];//local IP\n \t //ip = ip.indexOf('\\\\');\n \t if(!getIsLocal()){\n\t \ttry{\n\t\t \tURL whatismyip = new URL(\"http://automation.whatismyip.com/n09230945.asp\");\n\t\t \tBufferedReader in = new BufferedReader(new InputStreamReader(\n\t\t \t whatismyip.openStream()));\n\t\t \tip = in.readLine(); //you get the IP as a String\n\t\t \t//System.out.println(ip);\n\t\t \tin.close();\n\t\t \treturn ip;\n\n\t \t}\n\t \tcatch(IOException e){\n\t \t\te.printStackTrace();\n\t \t}\n\t \treturn null;\n \t }\n\t\treturn ip;\n\t }", "String getIp();", "String getIp();", "public static String getLocalIPAddress() {\r\n return (localIPAddress);\r\n }", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "private String getIp(){\n\t\tStringBuilder ip=new StringBuilder(20);\n\t\t\n\t\tEditText ip1=(EditText) findViewById(R.id.ipaddress_text_1);\n\t\tEditText ip2=(EditText) findViewById(R.id.ipaddress_text_2);\n\t\tEditText ip3=(EditText) findViewById(R.id.ipaddress_text_3);\n\t\tEditText ip4=(EditText) findViewById(R.id.ipaddress_text_4);\n\t\tEditText ip5=(EditText) findViewById(R.id.ipaddress_text_5);\n\t\t\n\t\tip.append(ip1.getText());\n\t\tip.append('.');\n\t\tip.append(ip2.getText());\n\t\tip.append('.');\n\t\tip.append(ip3.getText());\n\t\tip.append('.');\n\t\tip.append(ip4.getText());\n\t\tif(!(ip5.getText().toString().equals(\"\"))){\n\t\t\tip.append(':');\n\t\t\tip.append(ip5.getText());\n\t\t}\n\t\t\n\t\treturn ip.toString();\n\t}", "public static String ipAddress() {\r\n String _ipaddress=\"\";\r\n InetAddress _address=null;\r\n \r\n try {\r\n _address=InetAddress.getLocalHost();\r\n _ipaddress=_address.getHostAddress();\r\n }\r\n catch (Exception ex) {\r\n throw new RuntimeException(ex.getMessage());\r\n }\r\n \r\n if (_address!=null) {\r\n _address=null; System.gc();\r\n }\r\n \r\n return _ipaddress;\r\n }", "public static String getWANIP() {\n URL whatismyip = null;\n BufferedReader in = null;\n try {\n \twhatismyip = new URL(\"http://checkip.amazonaws.com\");\n in = new BufferedReader(new InputStreamReader(whatismyip.openStream()));\n String ip = in.readLine();\n return ip;\n } catch (IOException e) {\n \treturn \"No internet.\";\n\t\t}\n }", "private String[] getNetworkInformation(Context context)\n {\n String[] output = new String[4];\n\n WifiManager wifiMgr = (WifiManager) getSystemService(Context.WIFI_SERVICE);\n WifiInfo wifiInfo = wifiMgr.getConnectionInfo();\n int ip = wifiInfo.getIpAddress();\n String ipAddress = Formatter.formatIpAddress(ip);\n output[0] = ipAddress;\n // Get DNS Server\n final DhcpInfo dhcp = wifiMgr.getDhcpInfo();\n output[1] = Formatter.formatIpAddress(dhcp.netmask);\n output[2] = Formatter.formatIpAddress(dhcp.gateway);\n output[3] = Formatter.formatIpAddress(dhcp.dns1);\n return output;\n }", "public String getIP() throws Exception {\n this.IPAddress = \"http://192.168.1.15\";\n return this.IPAddress;\n }", "private String getAddress() {\n\t\tif (localIp != null) {\n\t\t\treturn localIp;\n\t\t}\n\t\tString address = \"\";\n\t\tInetAddress lanIp = null;\n\t\ttry {\n\t\t\tString ipAddress = null;\n\t\t\tEnumeration<NetworkInterface> net = null;\n\t\t\tnet = NetworkInterface.getNetworkInterfaces();\n\t\t\twhile (net.hasMoreElements()) {\n\t\t\t\tNetworkInterface element = net.nextElement();\n\t\t\t\tEnumeration<InetAddress> addresses = element.getInetAddresses();\n\t\t\t\twhile (addresses.hasMoreElements()) {\n\t\t\t\t\tInetAddress ip = addresses.nextElement();\n\t\t\t\t\tif (ip instanceof Inet4Address) {\n\t\t\t\t\t\tif (ip.isSiteLocalAddress()) {\n\t\t\t\t\t\t\tipAddress = ip.getHostAddress();\n\t\t\t\t\t\t\tlanIp = InetAddress.getByName(ipAddress);\n\t\t\t\t\t\t\tSystem.out.println(\"found local address: \" + ipAddress);\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\tif (lanIp == null)\n\t\t\t\treturn null; \n\t\t\taddress = lanIp.toString().replaceAll(\"^/+\", \"\"); \n\t\t} catch (UnknownHostException ex) {\n\t\t\tex.printStackTrace();\n\t\t} catch (SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn address;\n\n\t}", "public static String getDeviceIpAddress() {\n try {\n for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {\n NetworkInterface intf = en.nextElement();\n for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {\n InetAddress inetAddress = enumIpAddr.nextElement();\n\n log.debug(\"inetAddress: \" + inetAddress);\n\n if (!inetAddress.isLoopbackAddress()) {\n String ip = Formatter.formatIpAddress(inetAddress.hashCode());\n return ip;\n }\n }\n }\n } catch (SocketException ex) {\n log.error(ex.getMessage(), ex);\n }\n\n return null;\n }", "int getIp();", "int getIp();", "int getIp();", "private Label getIP() { \n\t\tString address = new String(); \n\t\ttry { \n\t\t\tURL IpWebSite = new URL(\"http://bot.whatismyipaddress.com\"); \n\t\t\tBufferedReader sc = new BufferedReader(new InputStreamReader(IpWebSite.openStream())); \n\t\t\t\n\t\t\taddress = sc.readLine(); \n\t\t\t\n\t\t} catch (Exception e) { \n\t address = \"Can't get your IP Address \\n Check your internet connection\"; \n\t } \n\t\t\n\t\tLabel ip = new Label(\"Your IP Address is : \" + address);\n\t\tip.setMaxWidth(Double.MAX_VALUE);\n\t\tip.setAlignment(Pos.CENTER);\n\t\treturn ip;\n\t}", "private String getLocalIpAddress() throws Exception {\n return InetAddress.getLocalHost().getHostAddress();\n }", "public static String restoreIP(Context context)\n {\n SharedPreferences settings = context.getSharedPreferences(\"chihlee\", 0);\n //取出name屬性的字串\n return settings.getString(\"ip\", \"127.0.0.1\");\n }", "java.lang.String getSnIp();", "java.lang.String getSnIp();", "String getRemoteIpAddress();", "private static String m21388a(WifiManager wifiManager) {\n String a = m21386a(wifiManager.getConnectionInfo().getIpAddress());\n return a != null ? a : \"\";\n }", "private static String m21383C(Context context) {\n WifiInfo wifiInfo;\n String str = \"02:00:00:00:00:00\";\n if (context == null) {\n return str;\n }\n WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(\"wifi\");\n if (wifiManager == null) {\n return str;\n }\n try {\n wifiInfo = wifiManager.getConnectionInfo();\n } catch (Exception e) {\n C5205o.m21464a((Throwable) e);\n wifiInfo = null;\n }\n if (wifiInfo == null) {\n return null;\n }\n String macAddress = wifiInfo.getMacAddress();\n if (!TextUtils.isEmpty(macAddress)) {\n macAddress = macAddress.toUpperCase(Locale.ENGLISH);\n }\n return macAddress;\n }", "@SuppressLint(\"MissingPermission\")\n private NetworkInfo getActiveNetworkInfo(){\n ConnectivityManager connectivityManager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);\n return connectivityManager == null ? null : connectivityManager.getActiveNetworkInfo();\n }", "public String getIp();", "private String getIpAddress() throws SocketException {\n String ip = null;\n\n Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces();\n\n while (networkInterfaces.hasMoreElements()) {\n NetworkInterface networkInterface = (NetworkInterface) networkInterfaces.nextElement();\n\n if (networkInterface.getName().equals(\"eth0\") || networkInterface.getName().equals(\"wlan0\")) {\n Enumeration inetAddresses = networkInterface.getInetAddresses();\n\n while (inetAddresses.hasMoreElements()) {\n InetAddress inetAddress = (InetAddress) inetAddresses.nextElement();\n if (inetAddress instanceof Inet4Address) {\n ip = inetAddress.getHostAddress();\n }\n }\n }\n }\n \n return ip;\n }", "public static NetworkInfo getNetworkInfo(Context context){\n ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);\n return cm.getActiveNetworkInfo();\n }", "public static NetworkInfo getNetworkInfo(Context context){\n ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);\n return cm.getActiveNetworkInfo();\n }", "int getInIp();", "int getInIp();", "@Test\n public void testGetMyIP() {\n System.out.println(\"getMyIP\");\n String expResult = MY_IP_ADDRESS;\n String result = instance.getMyIP();\n assertEquals(expResult, result);\n }", "public static String getMyIpv4Address() {\n try {\n Enumeration<NetworkInterface> nets = NetworkInterface.getNetworkInterfaces();\n\n for (NetworkInterface netInterface : Collections.list(nets)) {\n Enumeration<InetAddress> inetAddresses = netInterface.getInetAddresses();\n\n if (!netInterface.isUp() || netInterface.isVirtual() || netInterface.isLoopback())\n continue;\n\n for (InetAddress inetAddress : Collections.list(inetAddresses)) {\n if (!inetAddress.isLinkLocalAddress() && !inetAddress.isLoopbackAddress() && (inetAddress instanceof Inet4Address))\n return inetAddress.getHostAddress();\n }\n\n }\n } catch (SocketException e) {\n // ignore it\n }\n\n return \"127.0.0.1\";\n }", "public String getDeviceIp(){\n\t return deviceIP;\n }", "@Test\r\n public void ipConnectionTest()\r\n {\r\n try\r\n {\r\n MSocket ms = new MSocket(InetAddress.getByName(LOCALHOST), LOCAL_PORT);\r\n InputStream is = ms.getInputStream();\r\n OutputStream os = ms.getOutputStream();\r\n echoTest(is, os, 54);\r\n echoTest(is, os, 45);\r\n ms.close();\r\n }\r\n catch (Exception e)\r\n {\r\n e.printStackTrace();\r\n fail(\"IP Connection test failed\");\r\n }\r\n }", "public InetAddress getBroadcastAddress() {\r\n InetAddress ip=null;\r\n try{\r\n WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\r\n DhcpInfo dhcp = wifi.getDhcpInfo();\r\n int broadcast = (dhcp.ipAddress & dhcp.netmask) | ~dhcp.netmask;\r\n byte[] quads = new byte[4];\r\n for (int k = 0; k < 4; k++)\r\n quads[k] = (byte) (broadcast >> (k * 8));\r\n ip= InetAddress.getByAddress(quads);\r\n }catch(IOException e)\r\n {\r\n\r\n }\r\n\r\n return ip;\r\n }", "private static void getServerIPAddress() {\r\n // Get local IP address\r\n try {\r\n Enumeration<NetworkInterface> enumeratedNetworkInterface = NetworkInterface.getNetworkInterfaces();\r\n\r\n NetworkInterface networkInterface;\r\n Enumeration<InetAddress> enumeratedInetAddress;\r\n InetAddress inetAddress;\r\n\r\n for (; enumeratedNetworkInterface.hasMoreElements(); ) {\r\n networkInterface = enumeratedNetworkInterface.nextElement();\r\n enumeratedInetAddress = networkInterface.getInetAddresses();\r\n\r\n for (; enumeratedInetAddress.hasMoreElements(); ) {\r\n inetAddress = enumeratedInetAddress.nextElement();\r\n String anIPAddress = inetAddress.getHostAddress();\r\n if (log.isDebugEnabled()) {\r\n log.debug(\"Scanning local IP space: \" + anIPAddress);\r\n }\r\n\r\n // exclude loop-back and MAC address\r\n if (!(anIPAddress.equals(\"127.0.0.1\") || anIPAddress.contains(\":\")))\r\n localIPAddress = anIPAddress;\r\n }\r\n }\r\n } catch (Exception e) {\r\n log.error(\"Error in retrieving the local IP address: \" + e.toString());\r\n }\r\n }", "String getExternalIPAddress() throws NotDiscoverUpnpGatewayException, UpnpException;", "public static String getCurrentIp() throws UnknownHostException {\n try {\n InetAddress candidateAddress = null;\n for (Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); ifaces\n .hasMoreElements();) {\n NetworkInterface iface = (NetworkInterface) ifaces.nextElement();\n for (Enumeration inetAddrs = iface.getInetAddresses(); inetAddrs.hasMoreElements();) {\n InetAddress inetAddr = (InetAddress) inetAddrs.nextElement();\n if (!inetAddr.isLoopbackAddress()) {\n if (inetAddr.isSiteLocalAddress() && !iface.getName().contains(\"docker\")) {\n return inetAddr.getHostAddress();\n } else if (candidateAddress == null) {\n candidateAddress = inetAddr;\n }\n }\n }\n }\n if (candidateAddress != null) {\n return candidateAddress.getHostAddress();\n }\n InetAddress jdkSuppliedAddress = InetAddress.getLocalHost();\n if (jdkSuppliedAddress == null) {\n throw new UnknownHostException(\n \"The JDK InetAddress.getLocalHost() method unexpectedly returned null.\");\n }\n return jdkSuppliedAddress.getHostAddress();\n } catch (Exception e) {\n UnknownHostException unknownHostException =\n new UnknownHostException(\"Failed to determine LAN address: \" + e);\n unknownHostException.initCause(e);\n throw unknownHostException;\n }\n }", "public InetAddress getIPAddress ( ) { return _IPAddress; }", "public String getUpnpExternalIpaddress();", "public static String getIP() {\n\t\treturn ip;\r\n\t}", "@SuppressLint(\"DefaultLocale\")\n private String formatIP(int ip) {\n return String.format(\n \"%d.%d.%d.%d\",\n (ip & 0xff),\n (ip >> 8 & 0xff),\n (ip >> 16 & 0xff),\n (ip >> 24 & 0xff)\n );\n }", "private static String w(Context object) {\n void var4_7;\n Object object2;\n block5: {\n int n10 = Build.VERSION.SDK_INT;\n object2 = null;\n int n11 = 23;\n if (n10 >= n11) {\n return null;\n }\n String string2 = \"wifi\";\n try {\n object = object.getSystemService(string2);\n object = (WifiManager)object;\n object = object.getConnectionInfo();\n object = object.getMacAddress();\n string2 = \"02:00:00:00:00:00\";\n }\n catch (Exception exception) {\n // empty catch block\n break block5;\n }\n try {\n n10 = (int)(string2.equals(object) ? 1 : 0);\n if (n10 == 0) return object;\n return null;\n }\n catch (Exception exception) {\n object2 = object;\n }\n }\n object = new Object[]{};\n String string3 = \"failed to get wifi mac address\";\n m.a.a.z((Throwable)var4_7, string3, (Object[])object);\n return object2;\n }", "public String getLocalIpAddress()\n {\n \t\n \treturn null;\n }", "public InetAddress getIP();", "public String getIPAddress()\n {\n return fIPAddress;\n }", "public static String getIPCliente(){//192.168, 172.16. o 10.0.\n\t\tString ipAddress=\"\";\n\t\ttry{\n\t\t\tHttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n\t\t\tipAddress = request.getHeader(\"X-FORWARDED-FOR\");\n\t\t\tif ( ipAddress == null ) {\n\t\t\t\tipAddress = request.getRemoteAddr();\n\t\t\t\tif(ipAddress.equals(\"127.0.0.1\")){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tipAddress = InetAddress.getLocalHost().getHostAddress();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tipAddress = \"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tString[] ips = ipAddress.split(\",\");\n\t\t\tfor(String ip : ips){\n\t\t\t\tif(!ip.trim().startsWith(\"127.0.\")){\n\t\t\t\t\tipAddress = ip;\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(Exception ex){\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn ipAddress;\n\t}", "private void checkWifiStep1() {\n\n Log.i(\"checkk\", \"ikan\");\n\n WifiManager wifiManager= (WifiManager)getApplicationContext().getSystemService(Context.WIFI_SERVICE);\n\n WifiInfo wifiInfo = wifiManager.getConnectionInfo();\n\n String name = wifiInfo.getSSID();\n\n //String macbabyyy = wifiInfo.getMacAddress();\n\n String bssiddda = wifiInfo.getBSSID();\n\n //wifiInfo.get\n\n // Log.i(\"checkk mac\",macbabyyy);\n Log.i(\"checkk bssid\",bssiddda);\n Log.i(\"checkk ssid\",name);\n\n Toast.makeText(getApplicationContext(),\"wifi ini :\"+ name, Toast.LENGTH_LONG).show();\n\n //asking fine location permission\n\n String constWifiName = \"\\\"arif0527 2.4GHz@unifi\\\"\";\n\n if(name.equals(constWifiName)){\n\n Log.i(\"checkk BERJAYA : \",bssiddda);\n Toast.makeText(getApplicationContext(),\"BERJAYA :\"+ name, Toast.LENGTH_LONG).show();\n message.setText(\"BERJAYA!!\");\n }\n\n\n }", "java.lang.String getAgentIP();", "private static String getExternalIP() {\n\t\ttry {\n\t URL checkURL = new URL(EXTERNAL_IP_PROVIDER);\n\t BufferedReader in = new BufferedReader(new InputStreamReader(checkURL.openStream()));;\n\t String ip = in.readLine();\n\t return ip;\n\t } catch (IOException e) {\n\t \t DecentLogger.write(\"Unable to get external IP Address\");\n\t }\n\t\treturn null;\n\t}", "public static String getIPAddress(boolean useIPv4) throws SocketException{\n List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\n for (NetworkInterface netInterface : interfaces) {\n List<InetAddress> addressList = Collections.list(netInterface.getInetAddresses());\n for (InetAddress address : addressList) {\n if (!address.isLoopbackAddress()) {\n String addressString = address.getHostAddress();\n boolean isIPv4 = addressString.indexOf(':') < 0;\n if (useIPv4) {\n if (isIPv4)\n return addressString;\n } else {\n if (!isIPv4) {\n int delim = addressString.indexOf('%'); // drop ip6 zone suffix\n return delim < 0 ? addressString.toUpperCase() : addressString.substring(0, delim).toUpperCase();\n }\n }\n }\n }\n }\n return \"\";\n }", "public String getIp() {\r\n return ip;\r\n }", "public String getIp(){\n\treturn ip;\n }", "private String getIP() {\n\t\treturn getRandomArbitrary(Constants.MIN_IP_VALUE, Constants.MAX_IP_VALUE) + Constants.DOT\n\t\t\t\t+ getRandomArbitrary(Constants.MIN_IP_VALUE, Constants.MAX_IP_VALUE) + Constants.DOT\n\t\t\t\t+ getRandomArbitrary(Constants.MIN_IP_VALUE, Constants.MAX_IP_VALUE) + Constants.DOT\n\t\t\t\t+ getRandomArbitrary(Constants.MIN_IP_VALUE, Constants.MAX_IP_VALUE);\n\n\t}", "public static String getLocalIpAddress() {\n\t\tInetAddress inetAddress = getLocalInetAddress();\n\t\tif (inetAddress != null) {\n\t\t\treturn inetAddress.getHostAddress();\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}", "public static String getGateWayIp() {\n try {\n for (Enumeration<NetworkInterface> en = NetworkInterface\n .getNetworkInterfaces(); en.hasMoreElements();) {\n NetworkInterface intf = en.nextElement();\n for (Enumeration<InetAddress> ipAddr = intf.getInetAddresses(); ipAddr\n .hasMoreElements();) {\n InetAddress inetAddress = ipAddr.nextElement();\n if (!inetAddress.isLoopbackAddress()) {\n if (inetAddress.getHostAddress().length() <= 16) {\n return inetAddress.getHostAddress();\n }\n }\n }\n }\n } catch (SocketException ex) {\n ex.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return \"\";\n }", "@Test\n public void testInterfaceIp() throws Exception {\n isisNeighbor.setInterfaceIp(interfaceIp);\n result2 = isisNeighbor.interfaceIp();\n assertThat(result2, is(interfaceIp));\n }", "public String getIP() {\n return this.IP;\n }", "public String getIp() {\n\t\treturn InfraUtil.getIpMachine();\n\t}", "public String getIPAddress () {\n\t\treturn _ipTextField.getText();\n\t}", "public static String getOpenIpAddress() {\n\t\tif (!mInitialized) Log.v(\"OpenIp\", \"Initialisation isn't done\");\n\t\treturn ip;\n\t}", "private String findIpAddress() throws Exception {\n\n\t\tString ipAddress = null;\n\t\tEnumeration<?> e = NetworkInterface.getNetworkInterfaces();\n\t\tloop: while( e.hasMoreElements()) {\n\t\t\tNetworkInterface n = (NetworkInterface) e.nextElement();\n\t\t\tEnumeration<?> ee = n.getInetAddresses();\n\n\t\t\twhile( ee.hasMoreElements()) {\n\t\t\t\tInetAddress i = (InetAddress) ee.nextElement();\n\t\t\t\tif( i instanceof Inet4Address\n\t\t\t\t\t\t&& ! \"127.0.0.1\".equals( i.getHostAddress())) {\n\t\t\t\t\tipAddress = i.getHostAddress();\n\t\t\t\t\tbreak loop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif( ipAddress == null )\n\t\t\tthrow new Exception( \"No IP address was found.\" );\n\n\t\treturn ipAddress;\n\t}", "private void testConnection(){ \n\t\t\tconnection=false;\n\t\t\tip = ipfield.getText().toString();\n\t\t\tLog.d(null,\"ip is \"+ip);\n\t\t\tif(ip.equals(\"\")) \n\t\t\t\tToast.makeText(getApplicationContext(), \"Please Enter an IP Address\", Toast.LENGTH_SHORT).show();\n\t\t\telse{\n\t\t\t\tRunnable runnable = new Runnable(){\n\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tSocket s = new Socket(ip,6969);\n\t\t\t\t\t\t\t\ts.close();\n\t\t\t\t\t\t\t\tconnection=true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t catch (UnknownHostException e1) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\tLog.d(null, \"Wrong ip\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t\t\tLog.d(null, \"Wrong ip\");\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread thread = new Thread(runnable);\n\t\t\t\tthread.start();\n\t\t\t}\n\t}", "String getAddr();", "private void print_addr() {\n try(final DatagramSocket socket = new DatagramSocket()){\n socket.connect(InetAddress.getByName(\"8.8.8.8\"), 10002);\n System.out.println(socket.getLocalAddress().getHostAddress()+\":\"+port);\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }", "public String getIp() {\n return ip;\n }", "public static String ip(boolean useIPv4) {\n\t try {\n\t List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\n\t for (NetworkInterface intf : interfaces) {\n\t List<InetAddress> addrs = Collections.list(intf.getInetAddresses());\n\t for (InetAddress addr : addrs) {\n\t if (!addr.isLoopbackAddress()) {\n\t String sAddr = addr.getHostAddress().toUpperCase();\n\t boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr); \n\t if (useIPv4) {\n\t if (isIPv4) \n\t return sAddr;\n\t } else {\n\t if (!isIPv4) {\n\t int delim = sAddr.indexOf('%'); // drop ip6 port suffix\n\t return delim<0 ? sAddr : sAddr.substring(0, delim);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t } catch (Exception ex) { } // for now eat exceptions\n\t return \"\";\n\t }", "public String getIp() {\n return (String) get(24);\n }", "public String getIpAddress()\n\t{\n\t\t/* TODO: The IP address returned is in this format: /127.0.0.1:9845\n\t\t * Rewrite to remove the unnessecary data. */\n\t\treturn getSession().getIpAddress();\n\t}", "public static String getIPAddress(boolean useIPv4) {\n\t\ttry {\n\t\t\tList<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\n\t\t\tfor (NetworkInterface intf : interfaces) {\n\t\t\t\tList<InetAddress> addrs = Collections.list(intf.getInetAddresses());\n\t\t\t\tfor (InetAddress addr : addrs) {\n\t\t\t\t\tif (!addr.isLoopbackAddress()) {\n\t\t\t\t\t\tString sAddr = addr.getHostAddress();\n\t\t\t\t\t\t//boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr);\n\t\t\t\t\t\tboolean isIPv4 = sAddr.indexOf(':')<0;\n\n\t\t\t\t\t\tif (useIPv4) {\n\t\t\t\t\t\t\tif (isIPv4)\n\t\t\t\t\t\t\t\treturn sAddr;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!isIPv4) {\n\t\t\t\t\t\t\t\tint delim = sAddr.indexOf('%'); // drop ip6 zone suffix\n\t\t\t\t\t\t\t\treturn delim<0 ? sAddr.toUpperCase() : sAddr.substring(0, delim).toUpperCase();\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} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t} // for now eat exceptions\n\t\treturn \"\";\n\t}", "public static String getIPAddress(boolean useIPv4) {\r\n\t\ttry {\r\n\t\t\tList<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\r\n\t\t\tfor (NetworkInterface intf : interfaces) {\r\n\t\t\t\tList<InetAddress> addrs = Collections.list(intf.getInetAddresses());\r\n\t\t\t\tfor (InetAddress addr : addrs) {\r\n\t\t\t\t\tif (!addr.isLoopbackAddress()) {\r\n\t\t\t\t\t\tString sAddr = addr.getHostAddress();\r\n\t\t\t\t\t\t//boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr);\r\n\t\t\t\t\t\tboolean isIPv4 = sAddr.indexOf(':')<0;\r\n\r\n\t\t\t\t\t\tif (useIPv4) {\r\n\t\t\t\t\t\t\tif (isIPv4)\r\n\t\t\t\t\t\t\t\treturn sAddr;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (!isIPv4) {\r\n\t\t\t\t\t\t\t\tint delim = sAddr.indexOf('%'); // drop ip6 zone suffix\r\n\t\t\t\t\t\t\t\treturn delim<0 ? sAddr.toUpperCase() : sAddr.substring(0, delim).toUpperCase();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception ex) { } // for now eat exceptions\r\n\t\treturn \"\";\r\n\t}", "public String getIp() {\n return ip;\n }", "public String getIp() {\n return ip;\n }", "public String getIp() {\n return ip;\n }", "public String getIp() {\n return ip;\n }", "public String getIp() {\n return ip;\n }", "public String getIp() {\n return ip;\n }", "private static String getMacAddress(Context context) {\n // android devices should have a wifi address\n final String wlanAddress = readAddressFromInterface(\"wlan0\");\n\n if (wlanAddress != null) {\n return wlanAddress.replace(\"\\n\", \"\").toUpperCase();\n }\n\n final String ethAddress = readAddressFromInterface(\"eth0\");\n if (ethAddress != null) {\n return ethAddress.replace(\"\\n\", \"\").toUpperCase();\n }\n\n // backup -> read from Wifi!\n if (!Utils.checkPermission(context, android.Manifest.permission.ACCESS_WIFI_STATE)) {\n return \"\";\n } else {\n try {\n final WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n @SuppressWarnings(\"MissingPermission\") final String wifiAddress = wifiManager.getConnectionInfo().getMacAddress();\n\n if (wifiAddress != null) {\n return wifiAddress;\n }\n } catch (Exception e) {\n log.debug(e.getMessage(), e);\n }\n }\n\n return null;\n }", "@Override\n\t\tpublic String buildBasicIp() {\n\t\t\treturn buildIp();\n\t\t}", "public String getIpaddress ()\n {\n return ipaddress;\n }", "public String getIp() {\n return getIpString(inetAddress);\n }", "public String getIp() {\n return ip;\n }" ]
[ "0.8149139", "0.7862385", "0.77987343", "0.7674278", "0.7462056", "0.70476884", "0.69123083", "0.6888928", "0.6888928", "0.6883864", "0.6857758", "0.68324757", "0.6812046", "0.67893076", "0.67893076", "0.6768579", "0.6762269", "0.6762269", "0.6762269", "0.6762269", "0.6762269", "0.6762269", "0.6762269", "0.6762269", "0.6726635", "0.6690179", "0.6681606", "0.66748536", "0.6671475", "0.6661382", "0.66235137", "0.6599482", "0.6599482", "0.6599482", "0.6578718", "0.6574142", "0.64992785", "0.64865535", "0.64865535", "0.6480334", "0.6462929", "0.64539385", "0.6436084", "0.64354235", "0.6424008", "0.6419983", "0.6419983", "0.6407683", "0.6407683", "0.63803744", "0.63661945", "0.63641566", "0.63598394", "0.63327944", "0.6330329", "0.6326521", "0.6302395", "0.627673", "0.62744087", "0.6273217", "0.62549746", "0.6245669", "0.623938", "0.6234109", "0.62226844", "0.62060666", "0.61866254", "0.61693954", "0.61659074", "0.6150321", "0.6143314", "0.6137728", "0.61243033", "0.61239684", "0.6117299", "0.6112228", "0.6109509", "0.6107391", "0.6107195", "0.6104491", "0.6081572", "0.6080778", "0.6076196", "0.6073924", "0.6064874", "0.6055041", "0.6052506", "0.6048062", "0.6047006", "0.60383356", "0.6038165", "0.6038165", "0.6038165", "0.6038165", "0.6038165", "0.6038165", "0.6033999", "0.60304993", "0.6023062", "0.6016409", "0.6009612" ]
0.0
-1
Initialize objects before testing
@Before public void setup(){ mockUserRepo = mock(UserRepository.class); mockSession = mock(UserSession.class); mockValidator = mock(InputValidator.class); sut = new UserService( mockUserRepo, mockSession, mockValidator); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Before\r\n\tpublic void initializeDefaultMockObjects()\r\n\t{\r\n\t\tconfigs = new ArrayList<Config>();\r\n\t\tscreenshots = new ArrayList<Screenshot>();\r\n\t\tprocessedImages = new ArrayList<ProcessedImage>();\r\n\t\ttestExecutions = new ArrayList<TestExecution>();\r\n\t\ttestEnvironments = new ArrayList<TestEnvironment>();\r\n\r\n\t\tinitializeDefaultTestExecution();\r\n\t\tinitializeDefaultTestEnvironment();\r\n\t\tinitializeDefaultScreenshot();\r\n\t}", "@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\n\tpublic void init() {\n\t}", "@Before\n public void init() {\n }", "@Before\n @Override\n public void init() {\n }", "@BeforeClass\n\tpublic static void init() {\n\t\ttestProduct = new Product();\n\t\ttestProduct.setPrice(1000);\n\t\ttestProduct.setName(\"Moto 360\");\n\t\ttestProduct.setDescrip(\"Moto 360 smart watch for smart generation.\");\n\n\t\ttestReview = new Review();\n\t\ttestReview.setHeadline(\"Excellent battery life\");\n\t\ttestReview.setContent(\"Moto 360 has an excellent battery life of 10 days per full charge.\");\n\t}", "@BeforeEach\n void init() {\n carte = new Carte();\n planning = new Planning(carte);\n }", "private void initObjects() {\n inputValidation = new InputValidation(activity);\n databaseHelper = new DatabaseHelper(activity);\n user = new User();\n }", "@BeforeClass\n public void initgeometOb() {\n\tthis.geometOb = new GeometricObjects();\n }", "public SwerveAutoTest() {\n // Initialize base classes.\n // All via self-construction.\n\n // Initialize class members.\n // All via self-construction.\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}", "private void init() {\n\t\tinitProtocol();\n\t\tinitResultStorage();\n\t}", "public void initialize() {\n // empty for now\n }", "@Before\n public void init(){\n }", "@Before\n\tpublic void init() {\n\t\tthis.acccountMock = new AccountDTO();\n\t\tthis.acccountMock.setId(ACCOUNT_ID);\n\t\tthis.acccountMock.setActive(true);\n\t\tthis.acccountMock.setBankingTransactions(new ArrayList<>());\n\n\t}", "protected void initialize() {\n \t\n }", "private void init() {\n }", "@BeforeAll\n static void init() {\n }", "protected void initialize() {}", "protected void initialize() {}", "@Before\n public void init() throws Exception {\n TestObjectGraphSingleton.init();\n TestObjectGraphSingleton.getInstance().inject(this);\n\n mockWebServer.start();\n }", "private void initialize() {\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "@Before\n public void init() {\n user = new User();\n user.setId(5);\n user.setUsername(\"username\");\n user.setPassword(\"password\");\n user.setName(\"name\");\n user.setSurname(\"surname\");\n user.setCityId(1);\n user.setEmail(\"[email protected]\");\n user.setPhone(\"phone...\");\n JacksonTester.initFields(this, new ObjectMapper());\n }", "private void initialize() {\n\t}", "@BeforeEach\n\tvoid init() {\n\t\tthis.repo.deleteAll();\n\t\tthis.testLists = new TDLists(listTitle, listSubtitle);\n\t\tthis.testListsWithId = this.repo.save(this.testLists);\n\t\tthis.tdListsDTO = this.mapToDTO(testListsWithId);\n\t\tthis.id = this.testListsWithId.getId();\n\t}", "@Before\n\tpublic void initialize() {\n\t\tCategory category= new Category();// = SAMPLE_CATEGORY1;\n\t\tcategory.setCategoryName(SAMPLE_CATEGORY1.getCategoryName());\n\t\tcategory.setCompanyReferenceNumber(SAMPLE_COMPANY.getCompanyReferenceNumber());\n\t\tcomServ.saveOrUpdate(SAMPLE_COMPANY);\n\t\tcatServ.saveOrUpdate(category);\n\t\tappServ.saveOrUpdate(SAMPLE_APPLICATION1);\n\t\t\n\t}", "protected void initializeInstances() {\n if (mUser == null) {\n mUser = new User(getApplicationContext());\n }\n if (mUserCache == null) {\n mUserCache = new UserCache();\n }\n if(mGlobalGroupContainer == null) {\n mGlobalGroupContainer = new GroupContainer(getApplicationContext());\n }\n if(mGlobalHistoryContainer == null) {\n mGlobalHistoryContainer = new HistoryContainer(getApplicationContext());\n }\n\n if(mGlobalContactContainer == null) {\n mGlobalContactContainer = new ContactContainer(getApplicationContext());\n mGlobalContactContainer.setContactSortKey(Contact.UserSortKey.USER_FIRST_NAME);\n }\n }", "private void init() {\n\n\t}", "private void init() {\n\n\t\tinitializeLists();\n\t\tcreateTiles();\n\t\tcreateTileViews();\n\t\tshuffleTiles();\n\n\t}", "public void init() {}", "public void init() {}", "public void initialize() {\n // TODO\n }", "@Before\n public void setUpTheObjects() {\n mh.setMessageDate(new Date());\n mr.setMessageHeader(mh);\n mr.getVaccinations().add(v);\n v.setAdministered(true);\n v.setAdminCvxCode(\"143\");\n }", "@Test\n public void init() {\n }", "public void init() {\r\n\r\n\t}", "@BeforeEach\n void init() {\n player = Mockito.mock(Player.class);\n level = Mockito.mock(Level.class);\n pointCalculator = Mockito.mock(PointCalculator.class);\n game = new SinglePlayerGame(player, level, pointCalculator);\n }", "@Before\r\n public void setupTestCases() {\r\n instance = new ShoppingListArray();\r\n }", "@Before\n\tpublic void initBeforeEachTestMethod()\n\t{\n\t\ttileScorer_STUDENT = new TileScorerImpl_Moran(ScrabbleEliteConfiguration_Moran.getEliteTileToPointsMap());\n\t\ttileTranslator_STUDENT = new TileTranslatorImpl_Moran(ScrabbleEliteConfiguration_Moran.getEliteTileToTranslationSetMap());\n\t\tdictionary_STUDENT = new DictionaryImpl_Moran(ScrabbleEliteConfiguration_Moran.getEliteWordList());\n\t\tscrabbleWordScorer_STUDENT = new ScrabbleWordScorerImpl_Moran(tileScorer_STUDENT, tileTranslator_STUDENT, dictionary_STUDENT);\n\t}", "protected void initialize() {\r\n }", "protected void initialize() {\r\n }", "public void init() {\n \n }", "public void initialize() {\r\n }", "public static void init() {}", "public void init() {\n\t\t}", "private void initialize() {\n\t\t\n\t}", "public static void init() {\n }", "public static void init() {\n }", "protected void init() {\n }", "protected void initialize() {\n\n\t}", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "private void init() {\n filmCollection = new FilmCollection();\n cameraCollection = new CameraCollection();\n }", "protected void setUp()\r\n {\r\n /* Add any necessary initialization code here (e.g., open a socket). */\r\n }", "public void initialize()\n {\n }", "protected void setUp()\n {\n /* Add any necessary initialization code here (e.g., open a socket). */\n }", "protected void init() {\n\t}", "protected void init() {\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "@Before\n\tpublic void init() {\n\t\tuserDao=new UsersDAO();\n\t\tentityManager=mock(EntityManager.class);\n\t\tuserDao.setEntityManager(entityManager);\n\t\t\n\t}", "@BeforeEach\n\tvoid init() {\n\t\tcalculator = new Calculator();//but create the different object.\n\t\tSystem.out.println(\"init\");\n\t}", "protected void initialize() {\n\t}", "public static void init() {\n\n }", "@Before\n public void init() {\n this.testMethodName = this.getTestMethodName();\n this.initialize();\n }", "public static void start() {\n\t\t\n\t\ttestEmptyConstructors();\n\t\ttestConstructors();\n\n\t}", "public void initialize() {\n }", "@Before\n public void initJUnitTest() {\n final double[] location = {0, 0};\n final String bodyFace = \"initial back\";\n final String bodyLocation = \"initial arm\";\n body = new BodyLocation(location, bodyFace, bodyLocation);\n }", "@Before\n\tpublic void init() {\n\t\tbankingTransactionDTO = new BankingTransactionDTO();\n\t\tbankingTransactionDTO.setType(\"deposit\");\n\t\tbankingTransactionDTO.setAmount(100.77d);\n\n\t\t// mock initialization\n\n\t}", "protected void initialize() {\n\t\t\n\t}", "protected void initialize() {\n\t\t\n\t}", "public void initialize() {\n\t}", "public void initialize() {\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 }", "@Before\n public void setUp()\n {\n m_instance = ConversationRepository.getInstance();\n m_fileSystem = FileSystem.getInstance();\n }", "public void init() {\n }", "public void init() {\n }", "public void init() {\n }", "public void init() {\n }", "public static void init() {\n\t\t\n\t}", "public void init() {\n\t\n\t}" ]
[ "0.79679894", "0.79476017", "0.78312635", "0.7806326", "0.7749807", "0.7717027", "0.7700651", "0.76751184", "0.76016337", "0.75912094", "0.7579422", "0.74616426", "0.7453325", "0.74358404", "0.743538", "0.7420618", "0.7393667", "0.7388714", "0.7378557", "0.7378557", "0.73783976", "0.7355812", "0.73519295", "0.73519295", "0.73519295", "0.73519295", "0.73338854", "0.73106104", "0.7305899", "0.7303311", "0.7298702", "0.7276898", "0.7270349", "0.7266724", "0.7266724", "0.7266222", "0.7246482", "0.724453", "0.7240665", "0.72406644", "0.72357446", "0.7224795", "0.7219409", "0.7219409", "0.72018886", "0.71901226", "0.7177071", "0.71745086", "0.7160546", "0.7151277", "0.7151277", "0.71494", "0.71440136", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.71436155", "0.7132442", "0.7132077", "0.71272737", "0.7123844", "0.7123694", "0.7123694", "0.7122261", "0.7122261", "0.7122261", "0.7117194", "0.71137184", "0.71064115", "0.71027976", "0.7099302", "0.7098963", "0.70961106", "0.709563", "0.7095236", "0.7092839", "0.7092839", "0.7092575", "0.7092575", "0.7091778", "0.70827067", "0.7072733", "0.7072733", "0.7072733", "0.7072733", "0.7070864", "0.7069383" ]
0.0
-1
Clear out objects after testing by setting them to null
@After public void cleanUp(){ mockUserRepo = null; mockSession = null; sut = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void resetTesting() {\r\n\t\tcompanyCars.clear();\r\n\t\trentDetails.clear();\r\n\t}", "protected void clearResolvedObjects() {\n\t\ttype = null;\n\t\tmanagedType = null;\n\t\ttypeDeclaration = null;\n\t}", "private void nullify() {\n\t\tpaint = null;\n\t\tup = null;\n\t\tdown = null;\n\t\tleft = null;\n\t\tright = null;\n\t\tg_up = null;\n\t\tg_down = null;\n\t\tg_left = null;\n\t\tg_right = null;\n\t\tgrass = null;\n\t\tcake = null;\n\n\t\t// Call garbage collector to clean up memory.\n\t\tSystem.gc();\n\n\t}", "public void clear()\r\n {\r\n first = null;\r\n last = null;\r\n count = 0;\r\n }", "public void clear()\r\n {\r\n result = null;\r\n leftOperand = null;\r\n rightOperand = null;\r\n operator = null;\r\n resultDoubles = null;\r\n }", "public static void clear(){\r\n instance = null;\r\n }", "private void nullify() {\n paint = null;\n bg1 = null;\n bg2 = null;\n madafacka = null;\n for(int i=0; i<enemies.size(); i++){\n enemies.remove(i);\n i--;\n }\n currentSprite = null;\n ship = null;\n shipleft1 = null;\n shipleft2 = null;\n shipright1 = null;\n shipright2 = null;\n basicInv1 = null;\n basicInv2 = null;\n badBoyAnim = null;\n\n // Call garbage collector to clean up memory.\n System.gc();\n }", "public void clear()\n\t{\n\t\tobjectToId.clear();\n\t\tidToObject.clear();\n\t}", "public void clear() {\r\n init();\r\n }", "public void clear() {\n first = null;\n n = 0;\n }", "protected void nullifyTutorialObjectsAndStats() {\n\t\tthis.tutorial = null;\n\t\tthis.practiceDrillHuman = null;\n\t\tthis.practiceDrillAI = null;\n\t\tthis.finalMission = null;\n\t\tthis.numOfMoves = 0;\n\t\tthis.numOfTimesAITriggered = 0;\n\t}", "private void clearTemporaryData() {\n\n numbers.stream().forEach(n -> {\n n.setPossibleValues(null);\n n.setUsedValues(null);\n });\n }", "@Override\n\tpublic void cleanUp() {\n\t\tofferingStrategy = null;\n\t\tacceptConditions = null;\n\t\topponentModel = null;\n\t\tnegotiationSession = null;\n\t\tutilitySpace = null;\n\t\tdagent = null;\n\t}", "public void clear() {\n\t\t//Kill all entities\n\t\tentities.parallelStream().forEach(e -> e.kill());\n\n\t\t//Clear the lists\n\t\tentities.clear();\n\t\tdrawables.clear();\n\t\tcollidables.clear();\n\t}", "protected void tearDown() {\r\n instance = null;\r\n columnNames = null;\r\n }", "private void clean() {\n nodesToRemove.clear();\n edgesToRemove.clear();\n }", "private void clear() {\n }", "public void reset() {\n counters = null;\n counterMap = null;\n counterValueMap = null;\n }", "public void clear() {\n\t\tnegatedConcepts.clear();\n\t\tnegex.clear();\n\t\tconcepts.clear();\n\t}", "public static void reset() {\n\t\tE_Location.THIS.reset();\n\t\tE_Resource.THIS.reset();\n\t\t\n\t\tT_Object.reset();\n\t\tT_Location.reset();\n\t\tT_Resource.reset();\n\t\t\n\t}", "private void clearLists() {\n\t\tobjects = new ArrayList<Entity>();\n\t\tenemies.clear();\n\t\titemList.clear();\n\t}", "@Override\n public void clear() {\n initialize();\n }", "private void clearObjUser() { objUser_ = null;\n \n }", "public void noPropertyies() {\n\t\tproperties.clear();\r\n\t\tfor(int i = 0; i<groups.length; i++){\r\n\t\t\tgroups[i].clear();\r\n\t\t}\r\n\t}", "public void clear() {\n\t\tthis._cooccurenceMatrix = null;\n\t\tthis._modules.clear();\n\t\tthis._vertices.clear();\n\t}", "public void clear() {\n\t\troot = null;\n\t\tcount = 0;\n\t}", "public void clear() {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tbeams[i] = null;\n\t\t}\n\t}", "public void reset() {\n\t\tVector2 gravity = new Vector2(world.getGravity() );\n\t\t\n\t\tfor(Obstacle obj : objects) {\n\t\t\tobj.deactivatePhysics(world);\n\t\t}\n\t\tobjects.clear();\n\t\taddQueue.clear();\n\t\tworld.dispose();\n\t\t\n\t\tworld = new World(gravity,false);\n\t\tsetComplete(false);\n\t\tsetFailure(false);\n\t\tpopulateLevel();\n\t}", "public void clear() {\n count = 0;\n root = null;\n }", "void clearInstances() {\n\t\t\tinterceptor.printer = null;\n\t\t\tinterceptor.converter = null;\n\t\t}", "public void emptyTickets() {\r\n tickets.clear();\r\n }", "public void clear() {\n context = null;\n nestedElements.clear();\n }", "@AfterEach\n public void teardown() {\n mockDAO = null;\n addFlight = null;\n flight = null;\n }", "public void clear() {\n classifiedSamples.clear();\n classificationNameMap.clear();\n classifications.clear();\n sampleClassificationMap.clear();\n nextIndex = 0;\n }", "public void clearLookups() {\n diseaseMap = null;\n feedMap = null;\n healthMapProvenance = null;\n }", "public void clear(){\n firstNode = null;\n lastNode = null;\n }", "public void clean() {\n\t\tbufferSize = 0;\n\t\tbuffer = new Object[Consts.N_ELEMENTS_FACTORY];\n\t}", "public void clear() {\n root = null;\n size = 0;\n }", "public void clear() {\n root = null;\n size = 0;\n }", "public void clear () {\n\t\treset();\n\t}", "public void clear(){\n root = null;\n count = 0;\n }", "public void reset() {\n\t\tvar.clear();\n\t\tname.clear();\n\t}", "@After\n public void tearDown() {\n try {\n this.c19.clear();\n }\n catch(NullPointerException e){\n log.info(\"NullPointerException caught\");\n }\n }", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public static void cleanseInits() {\n delayDuration = null;\n timerFrequency = null;\n numProcessorThreads = null;\n maxProcessorTasks = null;\n }", "public void clear()\n {\n providerService = null;\n }", "public void clear() {\n\t\tstate = null;\n\t}", "public void clear() {\n root = null;\n }", "public void clear() {\n root = null;\n }", "public void clearLinks(){\r\n varContextObject=null; \r\n varContextFields=null; \r\n }", "@After\r\n public void cleanTestObject()\r\n {\r\n testLongTermStorage.resetInventory();\r\n }", "public void clearAll();", "public void clearAll();", "public void clearAll() {\n bikeName = \"\";\n bikeDescription = \"\";\n bikePrice = \"\";\n street = \"\";\n zipcode = \"\";\n city = \"\";\n bikeImagePath = null;\n }", "@Override\n\tpublic void clearAll() {\n\t\t\n\t}", "public void clear() {\n\t\t// Do nothing\n\t}", "public void reset(){\n star.clear();\n planet.clear();\n }", "@Override\r\n public void clear(){\r\n root = null;\r\n }", "@Override\n public void clear() {\n initialized = false;\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "public static void clear() {\n\t\trb = null;\n\t}", "public void clear() {\n\t\t\r\n\t}", "void reset(){\n if (vars!=null){\n vars.clear();\n }\n if (gVars!=null){\n gVars.clear();\n }\n }" ]
[ "0.7512399", "0.74930775", "0.71401095", "0.7067717", "0.7059228", "0.70458126", "0.7034986", "0.70239246", "0.7021796", "0.6954043", "0.69429475", "0.69399565", "0.69270676", "0.69266737", "0.69115835", "0.6862183", "0.68607646", "0.68549293", "0.6847712", "0.6836423", "0.6835625", "0.6831798", "0.68199015", "0.6802447", "0.67989427", "0.67905766", "0.678803", "0.678124", "0.67759544", "0.6759661", "0.67595667", "0.6758631", "0.67582864", "0.6757162", "0.6753104", "0.6749122", "0.6743469", "0.67422456", "0.67422456", "0.67395806", "0.67315024", "0.67307043", "0.6729807", "0.6721022", "0.6721022", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.6717972", "0.67125815", "0.6707452", "0.67057014", "0.67054737", "0.67054737", "0.6699125", "0.6697425", "0.6694572", "0.6694572", "0.66910523", "0.6687422", "0.66856456", "0.6675557", "0.66722316", "0.66679907", "0.6653979", "0.6653979", "0.6653979", "0.665369", "0.6651182", "0.6646698" ]
0.671049
80
who is the root node
@Override public Object root() { return root; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isRootContextNode();", "public Node getRoot(){\r\n return this.root;\r\n }", "@Override\r\n\tpublic Node<T> getRoot() {\r\n\t\treturn raiz;\r\n\t}", "public void printRoot()\r\n\t{\r\n\t\tSystem.out.println(\"Root is:\"+root.data);\r\n\t}", "public Object getRoot(){\r\n\t\treturn _root;\r\n\t}", "public Node getRoot() {\r\n\r\n\t\treturn root;\r\n\t}", "protected IsamIndexNode getRoot() {\n\t\treturn root;\n\t}", "public void root(Node n) {}", "public String getRoot();", "public WAVLNode getRoot() // return the root of the tree\r\n {\r\n return root;\r\n }", "public WAVLNode getRoot()\r\n\t {\r\n\t\t return this.root;\r\n\t }", "BiNode root()\n {\n return _root;\n }", "public MyBinNode<Type> getRoot(){\n return this.root;\n }", "public String describeRoot();", "public TreeNode root() {\n\t\treturn root;\n\t}", "protected BSTNode root() {\n\t\treturn root;\n\t}", "public Node getRoot() {\n return root;\n }", "boolean isRoot()\n {\n return this.parent == null;\n }", "public Node getRoot() {\n return root;\n }", "public Node getRoot() {\n return root;\n }", "public Node getRoot() {\n return root;\n }", "public int getRoot(){\n\t\t\treturn root;\n\t\t}", "public Boolean isRootNode();", "public boolean isRoot(){\n\t\treturn bound.isRoot();\n\t}", "public boolean isRoot() {\r\n return (_parent == null);\r\n }", "public ObjectTreeNode getRoot() {\n return root;\n }", "public DialogueNode getRoot() {\n\t\treturn root;\n\t}", "public Object getRoot() {\n\t\treturn null;\n\t}", "RootNode getRootNode();", "public boolean isRoot() { return getAncestorCount()<2; }", "public AVLNode getRoot() {\n return root;\n }", "@Override\n\tpublic boolean isRoot() {\n\t\treturn false;\n\t}", "default boolean isRoot() {\n if (isEmpty()){\n return false;\n }\n\n TreeNode treeNode = getTreeNode();\n return treeNode.getLeftValue() == 1;\n }", "private HtmlElement getRoot()\n\t{\n\t\treturn getBaseRootElement( ROOT_BY );\n\t}", "public RBNode<T, E> getRoot() {\r\n\t\treturn root;\r\n\t}", "protected boolean isRoot(BTNode <E> v){\n\t\treturn (v.parent() == null); \n }", "public final Node GetRootNode(){\n return m_pRoot;\n }", "public String getRoot() {\n\t\treturn null;\n\t}", "public abstract MetricTreeNode getRoot();", "private RBNode<T> getRoot(){\n return root.getLeft();\n }", "public Node<T> getRoot() {\n\t\treturn root;\n\t}", "BTNode<T> getRoot();", "public final Node getRootContext() {\n return rootContext;\n }", "public boolean isRoot()\r\n\t{\r\n\t\treturn (m_parent == null);\r\n\t}", "public TreeRootNode() {\n super(\"root\");\n }", "@Override\r\n public NamedTreeNode<T> getRoot()\r\n {\r\n return head;\r\n }", "public DefaultMutableTreeNode getRoot()\n {\n return root;\n }", "public Object\tgetRoot() {\n \treturn root;\n }", "protected final boolean isRootNode() {\n return isRootNode;\n }", "protected TreeNode<E> getRoot() {\n\t\treturn root;\n\t}", "public int jumlahNode() {\n return jumlahNode(root);\n }", "public String getRoot() {\n return root;\n }", "public BTNode getRootNode() {\n return mRoot;\n }", "public String getRootName() {\n\t\treturn rootName;\n\t}", "public boolean isRoot() {\n return term.isRoot();\n }", "public Node<T> getRoot() {\n return root;\n }", "public IAVLNode getRoot() {\n\t\treturn this.root;\n\t}", "abstract protected UiElementNode getRootNode();", "public I_LogicalAddress getRoot() {\n return root;\n }", "protected String getRootName() {\r\n\t\treturn ROOT_NAME;\r\n\t}", "public BinaryTreeNode<T> getRootNode(){\n\t\treturn root;\n\t}", "public HPTNode<K, V> root() {\n return root;\n }", "public int getRoot() {\n return _root;\n }", "T getRoot();", "public boolean isRoot() {\n return !hasParent();\n }", "public AVLNode<T> getRoot() {\n return root;\n }", "java.lang.String getRoot();", "@Override\r\n public Node[] getRootNodes() {\r\n return new Node[] {getNetworkNode()};\r\n }", "@Override\r\n\tpublic T getRootElement() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif(this.root == null) {\r\n\t\treturn null;\r\n\t\t\r\n\t\t}\r\n\t\treturn this.root.data;\r\n\t}", "public Object getRoot() {\n\t\treturn _adaptee;\n\t}", "public abstract T queryRootNode();", "public int parentInode() { return ROOT_INODE; }", "boolean isEmpty(){\r\n\t\t\r\n\t\treturn root == null;\r\n\t}", "public boolean isRealNode()\r\n\t\t{\r\n\t\t\tif (this.key == -1)\r\n\t\t\t\treturn false;\r\n\t\t\treturn true; \r\n\t\t}", "public Node getNode()\n\t{\n\t\treturn root;\n\t}", "protected final boolean isRoot() {\n return _metaData.isRoot(this);\n }", "public TreeNode<E> getRoot() {\r\n\t\treturn root;\r\n\t}", "public PhyloTreeNode getOverallRoot() {\n return overallRoot;\n }", "public boolean isRealNode();", "public boolean isRealNode();", "public boolean isRootVisible()\n {\n return rootVisible;\n }", "public boolean isRootVisible()\n {\n return rootVisible;\n }", "@Override\n public String toString() { return root.toString(); }", "boolean hasAstRoot();", "boolean isEmpty(){\n return root == null;\n }", "TrieNode root();", "public MappingRoot getRoot() { return _root; }", "public TreeNode<E> getRoot() {\n return root;\n }", "public Pane getRoot() {\n \treturn _root;\n }", "public boolean checkRoot() {\n\t\t\treturn (this.getParent().getHeight() == -1);\n\t\t}", "private void createRootNode()\r\n {\r\n root = new Node(\"root\", null);\r\n Node.clear();\r\n }", "public myBinaryNode<T> my_root();", "boolean treeFinished(treeNode root){\n\t\treturn (root.parent == null && root.lc == null && root.rc == null);\n\t}", "<T> T getRoot();", "private boolean isLeafNode() {\r\n return (this.left == null && this.right == null);\r\n }", "public Node getFirstNode() {\n\t return firstNode;\r\n\t }", "OntologyTerm getRoot();", "public Node getRootNode() throws Exception;", "private Group getRoot() throws GeppettoExecutionException\n\t{\n\t\treturn (Group) ((javax.swing.tree.DefaultMutableTreeNode) recordingsH5File.getRootNode()).getUserObject();\n\t}" ]
[ "0.6666168", "0.66077834", "0.6537749", "0.65096295", "0.6464764", "0.63945997", "0.6392772", "0.63898367", "0.63760734", "0.63611627", "0.63599956", "0.6357098", "0.6355681", "0.63294595", "0.6324695", "0.6283906", "0.62678665", "0.6264667", "0.6235096", "0.6235096", "0.6235096", "0.6226587", "0.6221405", "0.6219183", "0.62104803", "0.62100583", "0.6208517", "0.6206208", "0.62046367", "0.6204498", "0.6204193", "0.6189905", "0.61468613", "0.61403054", "0.613111", "0.6129808", "0.6128145", "0.61083084", "0.6096497", "0.60925245", "0.6090448", "0.60858953", "0.6081721", "0.6073005", "0.60692394", "0.6063059", "0.60608345", "0.6056407", "0.6031566", "0.6028035", "0.60112315", "0.59983224", "0.5989992", "0.5979202", "0.5977988", "0.5972543", "0.59682816", "0.5958633", "0.5950783", "0.59466517", "0.5924539", "0.59205097", "0.59178776", "0.59021276", "0.5899215", "0.58969986", "0.5892478", "0.5880171", "0.5878525", "0.58599097", "0.58544225", "0.5839196", "0.581938", "0.5815687", "0.5789011", "0.5787487", "0.57760125", "0.57587236", "0.5755225", "0.5755225", "0.57452047", "0.57452047", "0.5744786", "0.574175", "0.57296497", "0.5727409", "0.5722092", "0.5720458", "0.57184243", "0.5706743", "0.5700747", "0.56823874", "0.56710815", "0.5660027", "0.56568336", "0.56566983", "0.5654021", "0.564764", "0.561358" ]
0.61574894
33
how to get the left child of the node
@Override public Object left(Object node) { return ((Node<E>) node).left; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Node getLeftChild() {\r\n \treturn getChild(true);\r\n }", "public BinaryTreeNode getLeftChild() { \n\t\t\treturn null;\n\t\t}", "TreeNode<T> getLeft();", "public BinaryNode getLeftChild() {\n\t\treturn leftChild;\n\t}", "public Node getLeft () {\r\n\t\treturn left;\r\n\t}", "@Override\r\n\tpublic BinaryNodeInterface<E> getLeftChild() {\n\t\treturn left;\r\n\t}", "public TreeNode getLeftChild() {\n return leftChild;\n }", "public MyNode getLeft()\r\n {\r\n \treturn left;\r\n }", "public TreeNode getLeft() {\n\t\treturn left;\n\t}", "public abstract Position<E> getLeftChild(Position<E> p);", "public Node<T> getLeftChild() {\n return this.leftChild;\n }", "public BinarySearchTree getLeftChild(){\r\n\t\treturn leftChild;\r\n\t}", "public Node getLeft() {\n return left;\n }", "public Node getLeft() {\n return left;\n }", "public Node getLeft() {\n return left;\n }", "public Node getLeft() {\n return left;\n }", "private int leftChild(int pos)\n {\n return (2 * pos);\n }", "private int leftChild ( int pos )\n\t{\n\t\treturn -1; // replace this with working code\n\t}", "public BinaryTreeNode getLeft() {\n\t\treturn left;\n\t}", "EObject getLeft();", "public BSTNode getLeftChild() {\n\t\treturn leftChild;\n\t}", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "@Override\n\tpublic ASTNode getLeftChild() {\n\t\treturn this.leftChild ;\n\t}", "public Node<T> getLeft() {\r\n\t\treturn left;\r\n\t}", "@Override\n\tpublic WhereNode getLeftChild() {\n\t\treturn null;\n\t}", "public TreeNode getLeft(){ return leftChild;}", "public Node getLeft(){\r\n return this.left;\r\n }", "@Pure\n public QuadTreeNode<D> getLowerLeftChild() {\n QuadTreeNode<D>[] _children = this.children;\n QuadTreeNode<D> _get = null;\n if (_children!=null) {\n _get=_children[0];\n }\n return _get;\n }", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "public static Node leftDescendant(Node node){\n if(node.left!=null){\n return leftDescendant(node.left); // คือการ (findMin) ด้ายซ้าย\n }\n else{\n return node;}\n }", "private Node getLeft() {\n return this.left;\n }", "public BSTItem getLeft()\r\n\t{\r\n\t\treturn left;\r\n\t}", "protected final IntervalNode getLeft() {\n\treturn(this.left);\n }", "@Override\n\tpublic INode getLeft() {\n\t\treturn left;\n\t}", "public AVLNode<E> getLeft() {\r\n\t\treturn left;\r\n\t}", "public BinNode<T> getLeft();", "@Override\n\t\tpublic PrintNode getLeft() {\n\t\t\treturn this.left;\n\t\t}", "public abstract Position<E> getLeftRoot();", "private int leftChild(int i){return 2*i+1;}", "private int leftChild(int index) {\n return index * 2;\n }", "public Expr left() {\n\treturn this.left;\n }", "public int getLeft(int position) {\r\n\t\treturn this.treeLeft[position];\r\n\t}", "public Node popLeftChild() {\n if (leftChild == null) {\n return null;\n }\n else {\n Node tmp = leftChild;\n leftChild = null;\n return tmp;\n }\n }", "public BTNode getLeft(){\r\n return leftLeaf;\r\n }", "public static int leftChildIdx(int nodeIdx) {\n\t\treturn (2 * nodeIdx + 1);\n\t}", "private int findTreeNodeLeftBoundary(RSTTreeNode node)\n {\n // recursive call for children (if applicable)\n if (node instanceof DiscourseRelation) {\n return findTreeNodeLeftBoundary(((DiscourseRelation) node).getArg1());\n }\n\n // it's EDU\n return node.getBegin();\n }", "public abstract Position<E> getLeftSibling(Position<E> p);", "public int getLeft() {\n\t\treturn this.left;\n\t}", "public BinarySearchTreeNode<T> getLeft() {\r\n return left;\r\n }", "private int leftChildIdx(int idx) {\r\n // TODO\r\n return -1;\r\n }", "public abstract Position<E> getLeftParent(Position<E> p);", "public BTreeNode<Integer, Integer> findLeftChild(final BTreeNode<Integer, Integer> node) {\n\t\t/*no recursion needed*/\n\t\tif(node == null) {\n\t\t\treturn null;\n\t\t}\n\t\tBTreeNode<Integer, Integer> currentNode = node;\n\t\twhile(currentNode.getLeftNode() != null) {\n\t\t\tcurrentNode = currentNode.getLeftNode();\n\t\t}\n\t\treturn currentNode;\n\t}", "@Override\n public AVLTreeNode<E> getLeft() {\n return (AVLTreeNode<E>) super.getLeft();\n }", "public AST getLeft() {\n\t\treturn left;\n\t}", "public BinaryTreeADT<T> getLeft();", "private int leftchild(int i) {\n return (2 * i) + 1;\n }", "private BSTNode<E> getLeftmostNode() {\r\n\t\tif (this.left != null) {\r\n\t\t\treturn this.left.getLeftmostNode();\r\n\t\t} else {\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}", "private static int leftChildIndex(int index) {\n\t\treturn (index * 2) + 1;\n\t}", "private int left(int parent) {\n\t\treturn (parent*2)+1;\n\t}", "public int getLeft() {\n\t\treturn left;\n\t}", "public IAVLNode getLeft() {\n\t\t\treturn this.left; // to be replaced by student code\n\t\t}", "private static int leftChild(int i) {\n\t\treturn 2 * i + 1;\n\t}", "private static int leftChild(int i) {\n\t\treturn 2*i + 1;\n\t}", "protected int leftChild(int i) {\n return (i << 1) + 1;\n }", "@Override\n\tpublic BTree<T> left() \n\t{\n\t\t\n\t\treturn root.left;\n\t}", "public TreeNodeDataType leftDescendant(TreeNodeDataType node) {\r\n\r\n if (node != null) {\r\n\r\n if (node.getLeftChild() == null) {\r\n return node;\r\n } else {\r\n return leftDescendant(node.getLeftChild());\r\n }\r\n\r\n } else {\r\n return null;\r\n }\r\n }", "public HuffmanNode getLeftNode()\n\t{\n\t\treturn left;\n\t}", "void leftView(Node node)\r\n {\r\n \tif(node == null)\r\n \t\treturn;\r\n \t\r\n \tif(node.leftChild != null)\r\n \t\tSystem.out.print(\" \"+node.leftChild.data);\r\n \t\r\n \tleftView(node.leftChild);\r\n \tleftView(node.rightChild);\r\n }", "public Lane getLeft() {\r\n\t\treturn left;\r\n\t}", "@Pure\n public QuadTreeNode<D> getLowerRightChild() {\n QuadTreeNode<D>[] _children = this.children;\n QuadTreeNode<D> _get = null;\n if (_children!=null) {\n _get=_children[2];\n }\n return _get;\n }", "public Node getChild(boolean isLeft) {\r\n if (isLeft) {\r\n return leftChild;\r\n }\r\n else {\r\n return rightChild;\r\n }\r\n }", "Node findLeftmost(Node R){\n Node L = R;\n if( L!= null ) for( ; L.left != null; L = L.left);\n return L;\n }", "public Node getSibling(String leftOrRight) {\r\n\t\t\tif (parent == null) return null;\r\n\t\t\tNode ret = null;\r\n\t\t\t//get this node's position in the parent\r\n\t\t\tint position;\r\n\t\t\t\r\n\t\t\tif (data.size() > 0)\r\n\t\t\t\tposition = parent.getChildNumber(data.get(0).getKey());\r\n\t\t\telse\r\n\t\t\t\tposition = parent.getEmptyChild();\r\n\t\t\t\r\n\t\t\tif (leftOrRight.compareTo(\"left\") == 0) {\r\n\t\t\t\tif (position != 0)\r\n\t\t\t\t\tret = parent.getChild(position - 1);\r\n\t\t\t} else if (leftOrRight.compareTo(\"right\") == 0) {\r\n\t\t\t\tif (position != parent.getChildren().size() - 1)\r\n\t\t\t\t\tret = parent.getChild(position + 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn ret;\r\n\t\t}", "public HuffmanNode getLeftSubtree () {\n \treturn left;\n }", "public Fork getLeft() {\n\t\treturn left;\n\t}", "protected BinarySearchTree<K, V> getLeft() {\n return this.left;\n }", "public CellIDExpression getLeftCell() {\n\t\treturn leftCell;\n\t}", "private BinaryTreeNode getSuccessorFromLeft(BinaryTreeNode node) {\n\n\t\tBinaryTreeNode nodeLeft = node.left;\n\n\t\twhile(nodeLeft.right != null) {\n\t\t\tnodeLeft = nodeLeft.right;\n\t\t}\n\n\t\treturn nodeLeft;\n\n\t}", "Binarbre<E> getLeft();", "public final L getFst() {\n return leftMember;\n }", "public BinaryTree leftTree()\n { return left;}", "LogicExpression getLeft();", "public int getLeftX() {\n\t\treturn 0;\r\n\t}", "public abstract Position<E> insertLeftChild(Position<E> p, E e);", "public int getLeftEdge() {\n return leftEdge;\n }", "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 }", "private AvlNode<E> doubleWithLeftChild(AvlNode<E> k1){\n k1.left = rotateWithRightChild(k1.left);\n return rotateWithLeftChild(k1);\n }", "protected long getLeftPosition() {\n return leftPosition;\n }", "public abstract boolean hasLeftChild(Position<E> p);", "public Pixel downLeft() {\n if (this.down == null) {\n return null;\n }\n else {\n return this.down.left;\n }\n }", "public AVLNode delUnaryLeft() {\n\t\t\tchar side = this.parentSide();\n\t\t\tif (side == 'L') {\n\t\t\t\tthis.parent.setLeft(this.getLeft());\n\t\t\t} else { // side == 'R', 'N' cannot happen\n\t\t\t\tthis.parent.setRight(this.getLeft());\n\t\t\t}\n\t\t\tthis.left.setParent(this.parent);\n\t\t\tAVLNode parent = (AVLNode) this.parent;\n\t\t\tthis.parent = null;\n\t\t\tthis.left = null;\n\t\t\treturn parent;\n\t\t}", "private KeyedItem findLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\t//return the root when we find that we reached the leftmost child\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\treturn tree.getRoot();\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//keep going. has more left children\r\n\t\t\treturn findLeftMost(tree.getLeftChild());\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic boolean hasLeftChild() {\n\t\treturn left!=null;\r\n\t}", "public int getXLeft() {\n return xLeft;\n }", "private static Position getLeftNeighbor(Position curr, int side) {\n int newX = curr.getX() - getNumElement(0, side) - getNumSpacePerSide(0, side) - 1;\n int newY = curr.getY() - side;\n return new Position(newX, newY);\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}", "private boolean isLeftChild(Node curr) {\n\t\tif(curr.parent.left == curr) {\n return true;\n } else {\n return false;\n }\n\t}", "protected boolean isLeftChild(BTNode<E> v){\n\t\tif (isRoot(v)) return false;\n\t\treturn (v == (v.parent()).leftChild()); \n\t}", "private BinarySearchTree deleteLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\t//this is the node we want. No left child\r\n\t\t\t//Right child might exist\r\n\t\t\t\r\n\t\t\treturn tree.getRightChild();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tBinarySearchTree replacement = deleteLeftMost(tree.getLeftChild());\r\n\t\t\ttree.attachRightSubtree(replacement);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}" ]
[ "0.86966944", "0.8160296", "0.80831647", "0.80569816", "0.8040137", "0.80321085", "0.79866695", "0.7959788", "0.79351586", "0.7932222", "0.7920373", "0.7904405", "0.78747314", "0.78747314", "0.78747314", "0.78747314", "0.7839906", "0.78340816", "0.78181833", "0.7749199", "0.76780456", "0.76623255", "0.7656714", "0.76445675", "0.76245224", "0.7620244", "0.75855416", "0.75756174", "0.7575187", "0.757091", "0.7569149", "0.75555223", "0.7534582", "0.7517097", "0.7512365", "0.7509171", "0.74838257", "0.74693406", "0.74399155", "0.74383277", "0.74373853", "0.7436468", "0.74087566", "0.7376452", "0.7367322", "0.734818", "0.7334196", "0.73088056", "0.7305983", "0.7276549", "0.72606647", "0.7252141", "0.7218968", "0.7218358", "0.72131586", "0.7209318", "0.7204977", "0.71984035", "0.716858", "0.7141372", "0.71402806", "0.70894694", "0.70800287", "0.70742315", "0.7033143", "0.7027702", "0.70264924", "0.70040745", "0.69807106", "0.69500196", "0.69376737", "0.69272435", "0.6868059", "0.68651485", "0.68547326", "0.68427753", "0.6840486", "0.6796067", "0.6772221", "0.67548734", "0.6752114", "0.6748805", "0.6730383", "0.6719993", "0.669948", "0.66933036", "0.6680211", "0.6672781", "0.66702706", "0.66696846", "0.6615075", "0.6613975", "0.65946907", "0.65758914", "0.65733075", "0.65639335", "0.6556507", "0.6542572", "0.6540151" ]
0.7504872
37
how to get the right child of the node
@Override public Object right(Object node) { return ((Node<E>) node).right; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Node getChild();", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public abstract Position<E> getRightChild(Position<E> p);", "public Node getRightChild() {\r\n \treturn getChild(false);\r\n }", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "private int rightChild ( int pos )\n\t{\t\n\t\treturn -1; // replace this with working code\n\t}", "private int rightChild(int index) {\n return index * 2 + 1;\n }", "private int rightChild(int i){return 2*i+2;}", "public Node getRightChild() {\n\t\treturn null;\n\t}", "Node getChild(String childID) throws IllegalAccessException;", "private Node getChild(char key) {\n for (Node child : children) {\n if (child.getKey() == key) {\n return child;\n }\n }\n return null;\n }", "private TreeNode getOnlyChild() {\n return templateRoot.getChildren().get(0);\n }", "HNode getFirstChild();", "Node getNode();", "private int rightChildIdx(int idx) {\r\n // TODO\r\n return -1;\r\n }", "private int leftChild(int i){return 2*i+1;}", "public Node returnNextChild(){\n try{\n return children.get(counter);\n }catch(Exception ex){\n return null;\n }\n }", "private int leftChild(int pos)\n {\n return (2 * pos);\n }", "@Override\n\tpublic WhereNode getRightChild() {\n\t\treturn null;\n\t}", "public BinaryTreeNode getRightChild() {\n\t\t\treturn null;\n\t\t}", "HNode getLastChild();", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "public N getChild() {\n\t\tcheckRep();\n\t\treturn this.child;\n\t}", "private int leftChild(int index) {\n return index * 2;\n }", "public TreeNode getRight(){ return rightChild;}", "private Node getChild(K key) {\r\n\r\n // binarySearch for the correct index\r\n int correct_place = Collections.binarySearch(keys, key);\r\n int child_indexing;\r\n if (correct_place >= 0) {\r\n child_indexing = correct_place + 1;\r\n } else {\r\n child_indexing = -correct_place - 1;\r\n }\r\n\r\n return children.get(child_indexing);\r\n }", "public abstract Position<E> getLeftChild(Position<E> p);", "public Node getChild(boolean isLeft) {\r\n if (isLeft) {\r\n return leftChild;\r\n }\r\n else {\r\n return rightChild;\r\n }\r\n }", "public Node getLeftChild() {\r\n \treturn getChild(true);\r\n }", "private E findRightmost(Node<E> node){\n\t\t/** the rightmost child found */\n\t\tif(node.right.right == null){\n\t\t\tE rightmost = node.right.item;\n\t\t\tnode.right = node.right.left;\n\t\t\treturn rightmost;\n\t\t}else{\n\t\t\treturn findRightmost(node.right);\n\t\t}\n\t}", "public WSLNode getChild(int i) {return (WSLNode) children.elementAt(i);}", "private Node getChildById(String identifier)\r\n {\r\n Node result = null;\r\n\r\n result = convertNode(cmisSession.getObject(identifier));\r\n\r\n return result;\r\n }", "public TreeNode getRightChild() {\n return rightChild;\n }", "public XMLElement getChild(int index)\n/* */ {\n/* 545 */ return (XMLElement)this.children.elementAt(index);\n/* */ }", "@Pure\n public QuadTreeNode<D> getLowerRightChild() {\n QuadTreeNode<D>[] _children = this.children;\n QuadTreeNode<D> _get = null;\n if (_children!=null) {\n _get=_children[2];\n }\n return _get;\n }", "public String getChild() {\n return child;\n }", "private int rightchild(int i) {\n return (2 * i) + 2;\n }", "Object getChild(int groupPosition, int childPosition);", "public ChildType getChildAt( int index );", "Node getChild(K key) {\r\n\t\t\tint loc = Collections.binarySearch(keys, key);\r\n\t\t\tint childIndex = loc >= 0 ? loc + 1 : -loc - 1;\r\n\t\t\treturn children.get(childIndex);\r\n\t\t}", "public Node getChild(Character ch){\n return children.get(ch);\n }", "public TreeNode getChildNode(GameMove move) throws IllegalArgumentException;", "public IBiNode getChild() {\n return this.child;\n }", "public abstract Position<E> getRightSibling(Position<E> p);", "private static int rightChild(int i) {\n\t\treturn 2 * i + 2;\n\t}", "private static int rightChildIndex(int index) {\n\t\treturn (index * 2) + 2;\n\t}", "@Override\n\tpublic ASTNode getRightChild() {\n\t\treturn this.rightChild ;\n\t}", "private static int rightChild(int i) {\n\t\treturn 2*i + 2;\n\t}", "private int leftChild ( int pos )\n\t{\n\t\treturn -1; // replace this with working code\n\t}", "@Override\r\n\t\tpublic Node getLastChild()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public final int child ()\r\n {\r\n return _value.child();\r\n }", "@Override\n public Object getChild(int groupPos, int childPos) {\n return item.get(groupPos).elements.get(childPos);\n }", "public Node<T> getRightChild() {\n return this.rightChild;\n }", "@Override\r\n\tpublic BinaryNodeInterface<E> getRightChild() {\n\t\treturn right;\r\n\t}", "protected int rightChild(int i) {\n return (i + 1) << 1;\n }", "public BinaryNode getRightChild() {\n\t\treturn rightChild;\n\t}", "public TreeNode getChildAt(int i) { return data[i]; }", "public BinarySearchTree getRightChild(){\r\n\t\treturn rightChild;\r\n\t}", "TreeNode getTreeNode();", "private int leftchild(int i) {\n return (2 * i) + 1;\n }", "public TreeNode getLeft(){ return leftChild;}", "@AutoEscape\n\tpublic String getNode_2();", "public BTreeNode<E> findDonor() {\n\t\tint index = parent.children.indexOf(this);\n\t\tBTreeNode<E> right = parent.getChild(index + 1);\n\t\tBTreeNode<E> left = parent.getChild(index - 1);\n\t\tif (index == 0) {\n\t\t\treturn right;\n\t\t}\n\t\telse if ( (index == parent.children.size() - 1) || left.dataSize() >= right.dataSize()) {\n\t\t\treturn left;\n\t\t}\n\t\telse {\n\t\t\treturn right;\n\t\t}\n\t}", "@Override public BTreeNode getChild(int index) {\n return this.children[index];\n }", "private Node deepestChild(String gestureSequence)\n {\n Node currNode;\n String seqToCheck;\n for(int startInd=0; startInd < gestureSequence.length(); startInd++)\n {\n currNode = root;\n seqToCheck = gestureSequence.substring(startInd);\n for(int charInd = 0; charInd < seqToCheck.length(); charInd++)\n {\n currNode = currNode.getChild(Gestures.getGestureByChar(seqToCheck.charAt(charInd)));\n if(currNode == null)\n break;\n }\n if(currNode != null)\n {\n return currNode;\n }\n }\n return null; // Should not happen\n }", "private int leftChildIdx(int idx) {\r\n // TODO\r\n return -1;\r\n }", "@Pure\n public QuadTreeNode<D> getUpperLeftChild() {\n QuadTreeNode<D>[] _children = this.children;\n QuadTreeNode<D> _get = null;\n if (_children!=null) {\n _get=_children[1];\n }\n return _get;\n }", "public Node getSibling(String leftOrRight) {\r\n\t\t\tif (parent == null) return null;\r\n\t\t\tNode ret = null;\r\n\t\t\t//get this node's position in the parent\r\n\t\t\tint position;\r\n\t\t\t\r\n\t\t\tif (data.size() > 0)\r\n\t\t\t\tposition = parent.getChildNumber(data.get(0).getKey());\r\n\t\t\telse\r\n\t\t\t\tposition = parent.getEmptyChild();\r\n\t\t\t\r\n\t\t\tif (leftOrRight.compareTo(\"left\") == 0) {\r\n\t\t\t\tif (position != 0)\r\n\t\t\t\t\tret = parent.getChild(position - 1);\r\n\t\t\t} else if (leftOrRight.compareTo(\"right\") == 0) {\r\n\t\t\t\tif (position != parent.getChildren().size() - 1)\r\n\t\t\t\t\tret = parent.getChild(position + 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn ret;\r\n\t\t}", "public static int rightChildIdx(int nodeIdx) {\n\t\treturn (2 * nodeIdx + 2);\n\t}", "@Pure\n public QuadTreeNode<D> getUpperRightChild() {\n QuadTreeNode<D>[] _children = this.children;\n QuadTreeNode<D> _get = null;\n if (_children!=null) {\n _get=_children[3];\n }\n return _get;\n }", "public abstract Position<E> getRightParent(Position<E> p);", "public IContentNode getChild(String path);", "@Override\n\tpublic WhereNode getLeftChild() {\n\t\treturn null;\n\t}", "public RMShape getChild(int anIndex) { return null; }", "public BinaryTreeNode getLeftChild() { \n\t\t\treturn null;\n\t\t}", "public Node getChild(int index) {\n\t\treturn this.children.get(index);\n\t}", "int getBaseNode();", "@Pure\n\tpublic TreeNode<?, ?> getChild() {\n\t\treturn this.child;\n\t}", "java.lang.String getEntryNode();", "public String getNodeValue ();", "public Node getNode();", "private static int leftChild(int i) {\n\t\treturn 2*i + 1;\n\t}", "abstract protected UiElementNode getRootNode();", "private void leftOrRightChildOf(Node n) {\n if (!(n == mRoot)) {\n System.out.print(((n == n.mParent.mLeft) ? \" left\" : \" right\")\n + \" child of \" + n.mParent + \" \");\n }\n }", "private static int leftChild(int i) {\n\t\treturn 2 * i + 1;\n\t}", "private Node findChild(Node parent, Node lastChild, String elementName) {\n if (lastChild == null && parent != null) {\n lastChild = parent.getFirstChild();\n } else if (lastChild != null) {\n lastChild = lastChild.getNextSibling();\n }\n\n for ( ; lastChild != null ; lastChild = lastChild.getNextSibling()) {\n if (lastChild.getNodeType() == Node.ELEMENT_NODE &&\n lastChild.getNamespaceURI() == null && // resources don't have any NS URI\n elementName.equals(lastChild.getLocalName())) {\n return lastChild;\n }\n }\n\n return null;\n }", "@AutoEscape\n\tpublic String getNode_1();", "TreeNode<T> getRight();", "public SaveGameNode getFirstChild() {\r\n SaveGameNode node;\r\n node = this.children.get(0);\r\n return node;\r\n }", "public BTreeNode<E> getChild(int pos) {\n\t\tif (pos >= 0 && pos < children.size()) {\n\t\t\treturn children.get(pos);\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}", "@JsProperty\n Node getLastChild();", "private SortableTreeNode findChild(DefaultMutableTreeNode parentNode, String childString) {\n Enumeration<SortableTreeNode> e = parentNode.children();\n while (e.hasMoreElements()) {\n SortableTreeNode node = e.nextElement();\n if (node.toString().equalsIgnoreCase(childString)) {\n return node;\n }\n }\n return null;\n }", "Node[] getChildren(Node node);", "public XMLPath getChild(String localName) {\r\n return this.childs.get(localName);\r\n }", "@Override\r\n\t\tpublic Node getFirstChild()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "@Override\r\n\tpublic Object getChild(int groupPosition, int childPosition) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic Node getNextChild(Node existing) {\n\t\treturn null;\n\t}", "Object get(Node node);", "TreeNodeValueModel<T> child(int index);", "public child getChild() {\n return this.child;\n }", "private int firstChild(int index) {\n // Formula to calculate the index of the first child of parent node\n return d * index + 1;\n }" ]
[ "0.7626", "0.7100107", "0.706036", "0.7024124", "0.6897084", "0.6887867", "0.6875255", "0.6847681", "0.6821086", "0.672061", "0.66451", "0.6629075", "0.66113245", "0.6595521", "0.6591197", "0.65756994", "0.6559439", "0.65349483", "0.65122724", "0.65095514", "0.6509106", "0.6505471", "0.64996654", "0.64683765", "0.6451426", "0.64409363", "0.64311457", "0.6430913", "0.64018685", "0.6374875", "0.6365205", "0.6362125", "0.6347065", "0.6334438", "0.63281864", "0.631025", "0.6306137", "0.62911373", "0.6283225", "0.62711346", "0.6253751", "0.6240807", "0.6236795", "0.62305915", "0.6227288", "0.62219834", "0.6220316", "0.62144303", "0.6212203", "0.61970913", "0.61889607", "0.61877084", "0.6186722", "0.61828643", "0.6154656", "0.6152115", "0.6132938", "0.6131956", "0.6126564", "0.6120323", "0.61194223", "0.61167264", "0.6107112", "0.60899746", "0.6071561", "0.6068849", "0.6061113", "0.60600674", "0.60472876", "0.60365415", "0.6027352", "0.60194755", "0.6016381", "0.6016052", "0.60087276", "0.6003758", "0.5995854", "0.5989609", "0.59861875", "0.5980124", "0.5976219", "0.59647346", "0.5959251", "0.59584504", "0.59565777", "0.5956284", "0.594032", "0.59357387", "0.5931004", "0.5913117", "0.5911915", "0.59028333", "0.59012663", "0.5895726", "0.5885148", "0.5874047", "0.5870048", "0.58687156", "0.58657116", "0.58473", "0.58455354" ]
0.0
-1
how to print the node
@Override public Object string(Object node) { return ((Node<E>) node).element.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void printNode() {\n System.out.println(\"value:\" + value + \" next:\" + nextNode);\n }", "public void printNode(Node n);", "public void displayNode() {\n\t\t\tSystem.out.println(\"{ \" + data + \" } \");\n\t\t}", "public void displayNode() // display ourself\n\t{\n\t\tSystem.out.print('{');\n\t\tSystem.out.print(iData);\n\t\t\n\t\tSystem.out.print(\"} \");\n\t}", "public void printNode(){\n\t\tSystem.out.println(\"\\nCurrent neigbor: \" + serventList.size());\n\t\tfor(int i = 0;i<serventList.size();i++){\n\t\t\tServentInfo b = serventList.get(i);\n\t\t\tSystem.out.println(\"(\" + b.IP + \":\" + b.port + \"); \");\n\t\t}\n\t\tSystem.out.println(\"\");\n\t}", "public void print(){\n NodeD tmp = this.head;\n\n while(tmp!=null){\n System.out.println(tmp.getObject().asString());\n tmp = tmp.getNext();\n }\n }", "void printNode() {\n\t\tint j;\n\t\tSystem.out.print(\"[\");\n\t\tfor (j = 0; j <= lastindex; j++) {\n\n\t\t\tif (j == 0)\n\t\t\t\tSystem.out.print (\" * \");\n\t\t\telse\n\t\t\t\tSystem.out.print(keys[j] + \" * \");\n\n\t\t\tif (j == lastindex)\n\t\t\t\tSystem.out.print (\"]\");\n\t\t}\n\t}", "public void printTree() {\n Object[] nodeArray = this.toArray();\n for (int i = 0; i < nodeArray.length; i++) {\n System.out.println(nodeArray[i]);\n }\n }", "public void print(Node node) \n{\n PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out), true);\n print(node, w);\n}", "public static void print()\r\n\t {\r\n\t\t Node n = head; \r\n\t\t\t\r\n\t\t\twhile(n!=null)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(n.data+\" \");\r\n\t\t\t\r\n\t\t\t\tn=n.next;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t }", "@Override\n\tpublic void processNode(DirectedGraphNode node) {\n\t\tSystem.out.print(node.getLabel()+\" \");\n\t}", "private static void printNode(@Nonnull Node<OWLClass> node) {\n DefaultPrefixManager pm = new DefaultPrefixManager(null, null, \"http://owl.man.ac.uk/2005/07/sssw/people#\");\n // Print out a node as a list of class names in curly brackets\n for (Iterator<OWLClass> it = node.getEntities().iterator(); it.hasNext();) {\n OWLClass cls = it.next();\n // User a prefix manager to provide a slightly nicer shorter name\n String shortForm = pm.getShortForm(cls);\n\n System.out.println(\"Short Name: \"+shortForm);\n //assertNotNull(shortForm);\n }\n }", "public String toString(){\n return \"Node: \" + data;\n }", "public void print(){\r\n\t\t\tNode temp = this.head;\r\n\t\t\twhile(temp!=null){\r\n\t\t\t\tSystem.out.print(\"| prev=\"+temp.prev+\", val=\"+temp.val+\", next=\"+temp.next+\" |\");\r\n\t\t\t\ttemp = temp.next;\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}", "public String printNodeData(Node<T> node){\n return String.valueOf(node.data);\n }", "private static void PrintNode(Node n, String prefix, int depth) {\r\n\r\n\t\ttry {\r\n\t\t\tSystem.out.print(\"\\n\" + Pad(depth) + \"[\" + n.getNodeName());\r\n\t\t\tNamedNodeMap m = n.getAttributes();\r\n\t\t\tfor (int i = 0; m != null && i < m.getLength(); i++) {\r\n\t\t\t\tNode item = m.item(i);\r\n\t\t\t\tSystem.out.print(\" \" + item.getNodeName() + \"=\"\r\n\t\t\t\t\t\t+ item.getNodeValue());\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\"] \");\r\n\r\n\t\t\tboolean has_text = false;\r\n\t\t\tif (n.getNodeType() == Node.TEXT_NODE) {\r\n\t\t\t\thas_text = true;\r\n\t\t\t\tString valn = n.getNodeValue().trim();\r\n\t\t\t\tif (valn.length() > 0)\r\n\t\t\t\t\tSystem.out.print(\"\\n\" + Pad(depth) + \" \\\"\" + valn + \"\\\"\");\r\n\t\t\t}\r\n\r\n\t\t\tNodeList cn = n.getChildNodes();\r\n\r\n\t\t\tfor (int i = 0; cn != null && i < cn.getLength(); i++) {\r\n\t\t\t\tNode item = cn.item(i);\r\n\t\t\t\tif (item.getNodeType() == Node.TEXT_NODE) {\r\n\t\t\t\t\tString val = item.getNodeValue().trim();\r\n\t\t\t\t\tif (val.length() > 0)\r\n\t\t\t\t\t\tSystem.out.print(\"\\n\" + Pad(depth) + val + \"\\\"\");\r\n\t\t\t\t} else\r\n\t\t\t\t\tPrintNode(item, prefix, depth + 2);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(Pad(depth) + \"Exception e: \");\r\n\t\t}\r\n\t}", "public void print(Node node, PrintWriter w)\n{\n print(node, 0, w);\n}", "public void print()\n\t{\n\t\tDNode tem=first;\n\t\tSystem.out.print(tem.distance+\" \");\n\t\twhile(tem.nextDNode!=null)\n\t\t{\n\t\t\ttem=tem.nextDNode;\n\t\t\tSystem.out.print(tem.distance+\" \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void PrintMe()\n\t{\n\t\t/**************************************/\n\t\t/* AST NODE TYPE = AST TYPE NAME NODE */\n\t\t/**************************************/\n\t\tSystem.out.format(\"NAME(%s):TYPE(%s)\\n\",name,type);\n\n\t\t/***************************************/\n\t\t/* PRINT Node to AST GRAPHVIZ DOT file */\n\t\t/***************************************/\n\t\tAST_GRAPHVIZ.getInstance().logNode(\n\t\t\tSerialNumber,\n\t\t\tString.format(\"NAME:TYPE\\n%s:%s\",name,type));\n\t}", "public void print() {\r\n\r\n Node currentNode = this.head;\r\n while (currentNode != null) {\r\n System.out.print(currentNode.data + \" \");\r\n currentNode = currentNode.next;\r\n }\r\n\r\n }", "public void PrintMe()\r\n\t{\r\n\t\t/************************************/\r\n\t\t/* AST NODE TYPE = EXP NIL AST NODE */\r\n\t\t/************************************/\r\n\t\tSystem.out.print(\"AST NODE EXP NIL\\n\");\r\n\r\n\t\t\r\n\t\t/*********************************/\r\n\t\t/* Print to AST GRAPHIZ DOT file */\r\n\t\t/*********************************/\r\n\t\tAST_GRAPHVIZ.getInstance().logNode(\r\n\t\t\tSerialNumber,\r\n\t\t\t\"EXP\\nNIL\");\r\n\t\t\t\r\n\t}", "void Print() {\r\n\r\n AVLTreeNode node = root;\r\n\r\n printInorder(node);\r\n\r\n }", "public void printInfo() {\n\t\tString nodeType = \"\";\n\t\tif (nextLayerNodes.size() == 0) {\n\t\t\tnodeType = \"Output Node\";\n\t\t} else if (prevLayerNodes.size() == 0) {\n\t\t\tnodeType = \"Input Node\";\n\t\t} else {\n\t\t\tnodeType = \"Hidden Node\";\n\t\t}\n\t\tSystem.out.printf(\"%n-----Node Values %s-----%n\", nodeType);\n\t\tSystem.out.printf(\"\tNumber of nodes in next layer: %d%n\", nextLayerNodes.size());\n\t\tSystem.out.printf(\"\tNumber of nodes in prev layer: %d%n\", prevLayerNodes.size());\n\t\tSystem.out.printf(\"\tNext Layer Node Weights:%n\");\n\t\tNode[] nextLayer = new Node[nextLayerNodes.keySet().toArray().length];\n\t\tfor (int i = 0; i < nextLayer.length; i++) {\n\t\t\tnextLayer[i] = (Node) nextLayerNodes.keySet().toArray()[i];\n\t\t}\n\t\tfor (int i = 0; i < nextLayerNodes.size(); i++) {\n\t\t\tSystem.out.printf(\"\t\t# %f%n\", nextLayerNodes.get(nextLayer[i]));\n\t\t}\n\t\tSystem.out.printf(\"%n\tPartial err partial out = %f%n%n\", getPartialErrPartialOut());\n\t}", "public void printNodes() {\n\t\tNode currentNode = headNode;\n\t\tif(currentNode==null) {\n\t\t\tSystem.out.println(\" The Node is Null\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tSystem.out.print(\" \"+ currentNode.getData());\n\t\t\twhile(currentNode.getNextNode()!=null) {\n\t\t\t\tcurrentNode = currentNode.getNextNode();\n\t\t\t\tSystem.out.print(\"=> \"+ currentNode.getData());\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public void printNodes() {\n\t\tprintNodes(root);\n\n\t}", "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}", "public void displayNodes() {\n Node node = this.head;\n StringBuilder sb = new StringBuilder();\n while (node != null) {\n sb.append(node.data).append(\" \");\n node = node.next;\n };\n\n System.out.println(sb.toString());\n }", "public static void printNode(Node parent) {\n if (parent == null) {\n System.out.println(\"null node!\");\n return;\n }\n System.out.println(parent.getNodeName() + \" node:\");\n NamedNodeMap attrs = parent.getAttributes();\n for(int i = 0 ; i < attrs.getLength() ; i++) {\n Attr attribute = (Attr)attrs.item(i);\n System.out.println(\" \" + attribute.getName()+\" = \"+attribute.getValue());\n }\n }", "public void print() {\r\n\t\tif(isEmpty()) {\r\n\t\t\tSystem.out.printf(\"%s is Empty%n\", name);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.printf(\"%s: %n\", name);\r\n\t\tNode<E> current = first;//node to traverse the list\r\n\t\t\r\n\t\twhile(current != null) {\r\n\t\t\tSystem.out.printf(\"%d \", current.data);\r\n\t\t\tcurrent = current.next;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public void printNode(){\r\n // make an appropriately lengthed array of formatting\r\n // to separate rows/space coordinates\r\n String[] separators = new String[puzzleSize + 2];\r\n separators[0] = \"\\n((\";\r\n for (int i=0; i<puzzleSize; i++)\r\n separators[i+1] = \") (\";\r\n separators[puzzleSize+1] = \"))\";\r\n // print the rows\r\n for (int i = 0; i<puzzleSize; i++){\r\n System.out.print(separators[i]);\r\n for (int j = 0; j<puzzleSize; j++){\r\n System.out.print(this.state[i][j]);\r\n if (j<puzzleSize-1)\r\n System.out.print(\" \");\r\n }\r\n }\r\n // print the space's coordinates\r\n int x = (int)this.space.getX();\r\n int y = (int)this.space.getY();\r\n System.out.print(separators[puzzleSize] + x + \" \" + y + separators[puzzleSize+1]);\r\n }", "@Override\n\tpublic void print() {\n System.out.println(\"Leaf [isbn=\"+number+\", title=\"+title+\"]\");\n\t}", "public void print(){\n\t\t\tNode current = head;\n\t\t\tSystem.out.println(\"--------------------------\");\n\t\t\twhile(current != null) \n\t\t\t{\n\t\t\t\tSystem.out.println(current.data);\n\t\t\t\tcurrent = current.next;\n\t\t\t}\n\t}", "public void print() {\n\r\n Node aux = head;\r\n while (aux != null) {\r\n\r\n System.out.println(\" \" + aux.data);\r\n aux = aux.Next;\r\n\r\n }\r\n System.out.println();\r\n\r\n }", "public void print()\n {\n for (Node curr = first; curr != null; curr = curr.next)\n System.out.print(curr.val + \" \");\n System.out.println();\n }", "public void print() {\n\t\tNode temp = head;\n\n\t\tif(temp == null) {\n\t\t\treturn;\n\t\t} \n\n\t\twhile(temp.next != null) {\n\t\t\tSystem.out.print(temp.data + \"->\");\n\t\t\ttemp = temp.next;\n\t\t}\n\t\tSystem.out.println(temp.data);\n\t}", "public void print(){\n\t\tif(isEmpty()){\n\t\t\tSystem.out.printf(\"Empty %s\\n\", name);\n\t\t\treturn;\n\t\t}//end if\n\n\t\tSystem.out.printf(\"The %s is: \", name);\n\t\tListNode current = firstNode;\n\n\t\t//while not at end of list, output current node's data\n\t\twhile(current != null){\n\t\t\tSystem.out.printf(\"%s \", current.data);\n\t\t\tcurrent = current.nextNode;\n\t\t}//end while\n\n\t\tSystem.out.println(\"\\n\");\n\t}", "public void display() {\n ITree.Node root = this.createNode(0);\n TreePrinter.printNode(root);\n }", "public void show() {\n\n\t\tNode n = head;\n\t\twhile (n.next != null) {\n\t\t\t//logger.info(n.data);\n\t\t\tn = n.next;\n\t\t}\n\t\t//logger.info(n.data);\n\n\t}", "@Override\n public String toString() {\n return InternalNodeSerializer.toString(this);\n }", "@Override\n public void printTree() {\n System.out.println(\"node with char: \" + this.getChar() + \" and key: \" + this.getKey());\n int i = 0;\n for(IABTNode node : this.sons) {\n if(!node.isNull()) {\n System.out.print(\"Son \" + i + \" :\");\n node.printTree();\n }\n i++;\n }\n }", "@Override\n\t\t\tpublic void print() {\n\t\t\t\t\n\t\t\t}", "public void print() {\n\t\tprint(root);\n\t}", "public void print()\r\n {\r\n print(root);\r\n }", "void print() {\n Node current = this;\n while (current != null) {\n System.out.format(\"%d \", current.value);\n current = current.next;\n }\n System.out.println();\n }", "public void print(){\r\n ListNode temp = head;\r\n while(temp != null){\r\n System.out.println(temp.data.toString());//TODO check this\r\n temp = temp.link;\r\n }\r\n }", "public void display(Node node)\n\t{\n\t\tif(node == null)\n\t\t\treturn;\n\t\tSystem.out.print(node.getData()+\"\\t\");\n\t\tdisplay(node.left);\n\t\tdisplay(node.right);\n\t}", "@Override\n\t\tpublic void print() {\n\n\t\t}", "public void show() {\n Node<T> node = head;\n while (node.next != null) {\n System.out.println(node.data);\n node = node.next;\n }\n System.out.println(node.data);\n }", "@Override\r\n public String toString(){\r\n return Integer.toString(node);\r\n }", "public void printTreeNodes(){\n logger.trace(\"Name: \"+this.getName());\n for(int i=0;i<this.getChildCount();i++){\n SearchBaseNode node = (SearchBaseNode) this.getChildAt(i);\n node.printTreeNodes();\n }\n }", "public void printTree() {\n\t\tSystem.out.println(printHelp(root));\r\n\t\t\r\n\t}", "public void print(){\n String res = \"\" + this.number;\n for(Edge edge: edges){\n res += \" \" + edge.toString() + \" \";\n }\n System.out.println(res.trim());\n }", "private void printTree(AvlNode<E> node){\n if(node != null){\n printTree(node.left);\n System.out.print(node.value);\n System.out.print(\" \");\n printTree(node.right);\n }\n }", "public String toString() {\r\n\t\treturn print(this.root,0);\r\n\t}", "@Override\r\n\t\t\tpublic void print() {\n\t\t\t\t\r\n\t\t\t}", "public void printOut() {\n\t\tif(root.left != null) {\n\t\t\tprintOut(root.left);\n\t\t}\n\t\t\n\t\tSystem.out.println(root.element);\n\t\t\n\t\tif(root.right != null) {\n\t\t\tprintOut(root.right);\n\t\t}\n\t}", "private void printTree(Tree parse) {\n \t\tparse.pennPrint();\n \t}", "public void printTree(Node n) {\r\n\t\tif( !n.isNil ) {\r\n\t\t\tSystem.out.print(\"Key: \" + n.key + \" c: \" + n.color + \" p: \" + n.p + \" v: \"+ n.val + \" mv: \" + n.maxval + \"\\t\\tleft.key: \" + n.left.key + \"\\t\\tright.key: \" + n.right.key + \"\\n\");\r\n\t\t\tprintTree(n.left);\r\n\t\t\tprintTree(n.right);\r\n\t\t}\r\n\t}", "private static void print(ArrayList<Node<BinaryTreeNode<Integer>>> n) {\n\t\tfor(int i=0; i<n.size(); i++) {\n\t\t\tNode<BinaryTreeNode<Integer>> head = n.get(i);\n\t\t\twhile(head != null) {\n\t\t\t\tSystem.out.print(head.data.data+\" \");\n\t\t\t\thead = head.next;\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "void printNodes(){\n\t\tfor(int i=0;i<Table.length;i++){\r\n\t\t\tfor(StockNode t=Table[i];t!=null;t=t.next){\r\n\t\t\t\tSystem.out.println(t.stockName+\":\"+t.stockValue+\" \"+t.transactions);\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void PrintMe()\n\t{\n\t\t/**************************************/\n\t\t/* AST NODE TYPE = AST CFIELD_VARDEC */\n\t\t/**************************************/\n\t\tSystem.out.print(\"AST NODE CFIELD VAR DEC\\n\");\n\n\t\t/*************************************/\n\t\t/* RECURSIVELY PRINT HEAD + TAIL ... */\n\t\t/*************************************/\n\t\tif (vardec != null) vardec.PrintMe();\n\n\t\t/**********************************/\n\t\t/* PRINT to AST GRAPHVIZ DOT file */\n\t\t/**********************************/\n\t\tAST_GRAPHVIZ.getInstance().logNode(\n\t\t\tSerialNumber,\n\t\t\t\"CFIELD\\nVAR DEC\\n\");\n\t\t\n\t\t/****************************************/\n\t\t/* PRINT Edges to AST GRAPHVIZ DOT file */\n\t\t/****************************************/\n\t\tif (vardec != null) AST_GRAPHVIZ.getInstance().logEdge(SerialNumber,vardec.SerialNumber);\n\t}", "public void printGraphStructure() {\n\t\tSystem.out.println(\"Vector size \" + nodes.size());\n\t\tSystem.out.println(\"Nodes: \"+ this.getSize());\n\t\tfor (int i=0; i<nodes.size(); i++) {\n\t\t\tSystem.out.print(\"pos \"+i+\": \");\n\t\t\tNode<T> node = nodes.get(i);\n\t\t\tSystem.out.print(node.data+\" -- \");\n\t\t\tIterator<EDEdge<W>> it = node.lEdges.listIterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tEDEdge<W> e = it.next();\n\t\t\t\tSystem.out.print(\"(\"+e.getSource()+\",\"+e.getTarget()+\", \"+e.getWeight()+\")->\" );\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void printTree() {\n printTreeHelper(root);\n }", "public void printNodes(){\n for(int i =0; i<n;i++)\n System.out.print(key[i]+\" \");\n System.out.println(isLeaf);\n if (!isLeaf){\n for(int i =0; i<=n;i++){\n c[i].printNodes();\n }\n }\n }", "@Override\n public String toString() {\n return \"Node [id=\" + id + \", data=\" + data + \", red=\" + red + \"]\";\n }", "public void display(){\n\t\tSystem.out.println(\"node: \"+name+\", at \"+drawnNode.getXPosition()+\",\"+drawnNode.getYPosition()+\", colour \"+drawnNode.getColour());\n\t\tif(outArcs.length > 0)\n\t\t\tSystem.out.println(\"out arcs:\");\n\t\tfor(int i=0;i<outArcs.length;i++)\n\t\t\tSystem.out.println(\"to \"+outArcs[i].getEndNode().getName());\n\t}", "public void PrintMe() {\n\t\t/* AST NODE TYPE = AST EXP NIL */\n\t\t/**********************************/\n\t\tSystem.out.print(\"AST NODE: EXP_EXP\\n\");\n\n\t\t/*****************************/\n\t\t/* RECURSIVELY PRINT exp ... */\n\t\t/*****************************/\n\t\tif (exp != null) exp.PrintMe();\n\n\t\t/*********************************/\n\t\t/* Print to AST GRAPHIZ DOT file */\n\t\t/*********************************/\n\t\tAST_GRAPHVIZ.getInstance().logNode(\n\t\t\tSerialNumber,\n \"(exp)\");\n \n\t\t/****************************************/\n\t\t/* PRINT Edges to AST GRAPHVIZ DOT file */\n\t\t/****************************************/\n\t\tAST_GRAPHVIZ.getInstance().logEdge(SerialNumber, exp.SerialNumber);\n\n\t}", "public void printList() \r\n\t { \r\n\t Node tnode = head; \r\n\t while (tnode != null) \r\n\t { \r\n\t System.out.print(tnode.data+\" \"); \r\n\t tnode = tnode.next; \r\n\t } \r\n\t }", "private void print(Node x) {\n\t\tif (x == null) return;\n\t\tprint(x.getLeft());\n\t\tSystem.out.println(x);\n\t\tprint(x.getRight());\n\t}", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }" ]
[ "0.826155", "0.8250031", "0.81362396", "0.79425746", "0.78326684", "0.7801914", "0.77517825", "0.764033", "0.7606202", "0.75538194", "0.75308114", "0.75299203", "0.7523183", "0.7505804", "0.74843895", "0.7444763", "0.741507", "0.7387177", "0.7383683", "0.7373027", "0.7368839", "0.7345015", "0.73275864", "0.7326651", "0.7313529", "0.7312481", "0.7309228", "0.73085755", "0.73011553", "0.7300808", "0.7288352", "0.7284553", "0.7274774", "0.72466135", "0.7227153", "0.72268116", "0.72166646", "0.72086215", "0.71910226", "0.7185201", "0.7179496", "0.71751237", "0.7167146", "0.7150394", "0.7147653", "0.7123834", "0.7120226", "0.71189094", "0.7114817", "0.7112131", "0.71089274", "0.7108162", "0.71063256", "0.70962566", "0.708756", "0.7079039", "0.70700395", "0.70603865", "0.7058196", "0.7052337", "0.70333", "0.70270705", "0.7022458", "0.7021881", "0.7015333", "0.7012086", "0.7011964", "0.699823", "0.69898593", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425", "0.69888425" ]
0.0
-1
The Constructor. Takes a Collection of Vertices and a Collection of LabeledEdges connecting those Vertices
public Graph(Collection<LabeledEdge> edges, Collection<Vertex> vertices) { this.edges = new HashSet<>(edges); this.vertices = new HashSet<>(vertices); this.edgesByStart = new HashMap<>(); this.edgesByEnd = new HashMap<>(); this.edgesByAction = new HashMap<>(); this.searcher = null; for(Vertex vertex : vertices){ this.edgesByStart.put(vertex, new HashSet<LabeledEdge>()); this.edgesByEnd.put(vertex, new HashSet<LabeledEdge>()); } for(LabeledEdge trans : edges){ assert(edgesByStart.keySet().contains(trans.getStart())); assert(edgesByEnd.keySet().contains(trans.getEnd())); this.edgesByStart.get(trans.getStart()).add(trans); this.edgesByEnd.get(trans.getEnd()).add(trans); if(edgesByAction.get(trans.getLabel()) == null) edgesByAction.put(trans.getLabel(), new HashSet<LabeledEdge>()); this.edgesByAction.get(trans.getLabel()).add(trans); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Graph(ArrayList<Vertex> vertices){\r\n this.vertices = new HashMap<String, Vertex>();\r\n this.edges = new HashMap<Integer, Edge>();\r\n \r\n for(Vertex v: vertices){\r\n this.vertices.put(v.getLabel(), v);\r\n }\r\n \r\n }", "public WeightedGraph(Collection<K> v)\n {\n\t // make ourselves a private copy of the vertex set\n verts = new HashSet<K>(v);\n\n\t // set up empty adjacency lists for each vertex\n adjMaps = new HashMap<K, Map<K, Edge>>();\n for (K src : verts)\n {\n Map<K, Edge> adjMap = new HashMap<K, Edge>();\n adjMaps.put(src, adjMap);\n }\n }", "public MyGraph(Collection<Vertex> v, Collection<Edge> e) {\n myGraph = new HashMap<Vertex, Collection<Edge>>();\n \n Iterator<Vertex> vertices = v.iterator();\n while(vertices.hasNext()) {\n //create a new vertex copy of each passes in vertex in Collection v to restrict any reference\n //to the internals of this class\n Vertex currV = new Vertex(vertices.next().getLabel()); //NEW\n //Vertex currV = vertices.next(); OLD\n if(!myGraph.containsKey(currV)){\n //add the copy of the vertex into the HashMap\n myGraph.put(currV, new ArrayList<Edge>());\n }\n }\n\n Iterator<Edge> edges = e.iterator();\n while(edges.hasNext()){\n //copies a new edge for each edge in Collection e to restrict any reference \n //to the internals of this class\n Edge parameterEdge = edges.next();\n Edge currE = new Edge(parameterEdge.getSource(), parameterEdge.getDestination(), parameterEdge.getWeight()); //NEW\n //Edge currE = edges.next(); OLD\n if(currE.getWeight() < 0){\n throw new IllegalArgumentException(\"Edge weight is negative\");\n }\n Vertex currESrc = currE.getSource();\n Vertex currEDest = currE.getDestination();\n if(v.contains(currESrc) && v.contains(currEDest)){\n Collection<Edge> outEdges = myGraph.get(currESrc);\n if(!outEdges.contains(currE)){\n //add the copy of the edge as a value in the HashMap\n outEdges.add(currE);\n }\n } else {\n throw new IllegalArgumentException(\"Vertex in edge is not valid\");\n }\n }\n }", "public WeightedGraph(List<E> v, List<WeightedEdge> edges) {\n this();\n for (E e : v) {\n addVertex(e);\n }\n for (WeightedEdge e : edges) {\n addEdge(e);\n }\n }", "public Collection<V> addVertices(Collection<V> vs);", "protected AbstractGraph(List<Edges> edges,List<V> vertices){\n\t\t\n\t\tfor(int i=0;i<vertices.size();i++)\n\t\t\tthis.vertices.add(vertices.get(i));\n\t\t\n\t\tcreateAdjacencyLists(edges,vertices.size());\t\t\n\t}", "void addEdges(Collection<ExpLineageEdge> edges);", "Vertex(){}", "GameBoardVertex(ArrayList<GameBoardVertex> neighbors){this.neighbors = neighbors;}", "AdjacencyGraph(){\r\n vertices = new HashMap<>();\r\n }", "public AdjacentListGraph(String[] vertexes) {\n this.vertexes = Arrays.copyOf(vertexes, vertexes.length);\n this.heads = new LinkedList[vertexes.length];\n\n // init the heads to save code: if(heads != null)\n for (int i = 0; i < heads.length; i++) {\n this.heads[i] = new LinkedList<>();\n }\n }", "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 }", "VertexNetwork() {\r\n /* This constructor creates an empty list of vertex locations. \r\n read The transmission range is set to 0.0. */\r\n transmissionRange = 0.0;\r\n location = new ArrayList<Vertex>(0);\r\n }", "public EdgeListGraph(int V) {\n\t\t// TODO Auto-generated constructor stub\n\t\tthis.V = V;\n\t\tthis.edgeList = new ArrayList<>();\n\t}", "public ConcreteGraph(AbstractPartitionSet<T> points, AbstractMathSet<Link<T>> edges) {\n super(points.directSum(edges));\n vertices = points;\n this.edges = edges;\n\n }", "public Graph(ArrayList<Town> verticesList){\n\t\tthis.vertices = new HashMap<String, Vertex>();\n\t\tthis.edges = new HashMap<Integer, Edge>();\n\t\t\n\t\tfor(Town v : verticesList){\n\t\t\tthis.vertices.put(v.getName(), v);\n\t\t}\n\t}", "public boolean connectsVertices(Collection<V> vs);", "Edge(Vertex u, Vertex v) {\n From = u;\n To = v;\n\n }", "public Graph(int numberOfVertices){\r\n this.numberOfVertices = numberOfVertices;\r\n this.adjacencyList = new TreeMap<>();\r\n }", "Graph(int vertices) {\r\n this.numVertices = vertices;\r\n adjacencylist = new LinkedList[vertices];\r\n //initialize adjacency lists for all the vertices\r\n for (int i = 0; i <vertices ; i++) {\r\n adjacencylist[i] = new LinkedList<>();\r\n }\r\n }", "@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 void setVertices(){\n\t\tvertices = new ArrayList<V>();\n\t\tfor (E e : edges){\n\t\t\tV v1 = e.getOrigin();\n\t\t\tV v2 = e.getDestination();\n\t\t\tif (!vertices.contains(v1))\n\t\t\t\tvertices.add(v1);\n\t\t\tif (!vertices.contains(v2))\n\t\t\t\tvertices.add(v2);\n\t\t}\n\t}", "public ListGraph(int numV, boolean directed) {\r\n super(numV, directed);\r\n edges = new List[numV];\r\n for (int i = 0; i < numV; i++) {\r\n edges[i] = new LinkedList < Edge > ();\r\n }\r\n }", "public Edge(Vertex<VV> from, Vertex<VV> to)\r\n {\r\n this.from = from;\r\n this.to = to;\r\n from.addEdge(this);\r\n to.addEdge(this);\r\n }", "public ConcreteGraph(AbstractMathSet<T> points, AbstractMathSet<Link<T>> edges) {\n super(points.directSum(edges));\n\n vertices = new PartitionSet<>(points, this::areConnected);\n this.edges = edges;\n\n }", "public abstract ArrayList<Pair<Vector2, Vector2>> getEdges();", "public EdgesRecord() {\n super(Edges.EDGES);\n }", "public WeightedGraph(List<K> v)\n\t{\n\t // make ourselves a private copy of the vertex set\n\t verts = new HashSet<K>(v);\n\n\t // set up empty adkacency lists for each vertex\n\t adjLists = new HashMap<K, List<HashMap<K, Integer>>>();\n\t for (K src : verts)\n\t\t{\n\t\t adjLists.put(src, new ArrayList<HashMap<K, Integer>>());\n\t\t}\n\t}", "private static void InitializeEdges()\n {\n edges = new ArrayList<Edge>();\n\n for (int i = 0; i < Size -1; i++)\n {\n for (int j = 0; j < Size; j++)\n {\n edges.add(new Edge(cells[i][j].Point, cells[i + 1][ j].Point));\n edges.add(new Edge(cells[j][i].Point, cells[j][ i + 1].Point));\n }\n }\n\n for (Edge e : edges)\n {\n if ((e.A.X - e.B.X) == -1)\n {\n e.Direction = Edge.EdgeDirection.Vertical;\n }\n else\n {\n e.Direction = Edge.EdgeDirection.Horizontal;\n }\n }\n }", "public Graph(int V) {\n if (V < 0) throw new RuntimeException(\"Number of vertices must be nonnegative\");\n this.V = V;\n this.E = 0;\n\n\n adj = (LinkedList<Edge>[])new LinkedList[V];\n for (int v = 0; v < V; v++) adj[v] = new LinkedList<Edge>();\n }", "public Graph(int vertices, int[][] edges) {\n this.vertices = vertices;\n this.edges = edges;\n childToParentMap = new HashMap<>();\n\n // initialize map\n for (int i = 0; i < vertices; i++) {\n // put parent as null for each of the vertices\n childToParentMap.put(i, null);\n }\n }", "public wVertex(String s){\r\n name = s;\r\n adjacencies = new ArrayList<Edge>();\r\n }", "public static void main(String args[])\n\t{\n\t\tList<Vertex> v = new LinkedList<Vertex>();\n\t\tVertex v1 = new Vertex(1);\n\t\tVertex v2 = new Vertex(2);\n\t\tVertex v3 = new Vertex(3);\n \t\tVertex v4 = new Vertex(4);\n\t\t\n \t\t//Setting adjList for each vertex\n \t\tList<Vertex> adjList = new LinkedList<Vertex>();\n\t\tadjList.add(v2);\n\t\tadjList.add(v3);\n\t\tv1.setAdjList(adjList);\n\t\t\n\t\tadjList = new LinkedList<Vertex>();\n\t\tadjList.add(v4);\n\t\tv2.setAdjList(adjList);\n\t\t\n\t\tadjList = new LinkedList<Vertex>();\n\t\tadjList.add(v2);\n\t\tv3.setAdjList(adjList);\n\t\t\n\t\tadjList = new LinkedList<Vertex>();\n\t\tadjList.add(v3);\n\t\tv4.setAdjList(adjList);\n\t\t\n\t\tv.add(v1);\n\t\tv.add(v2);\n \t\tv.add(v3);\n\t\tv.add(v4);\n\n\t\tEdge e1 = new Edge(1, 2);\n\t\tList<Edge> e = new LinkedList<Edge>();\n\t\te.add(e1);\n\t\te1 = new Edge(1, 3);\n\t\te.add(e1);\n\t\te1 = new Edge(2, 4);\n\t\te.add(e1);\n\t\te1 = new Edge(4, 3);\n\t\te.add(e1);\n\t\te1 = new Edge(3, 2);\n\t\te.add(e1);\n\t\t\n\t\t\n\t\tGraph g = new Graph(v, e);\n\t\tg.bfs(v4);\n\t\t\n\t\t//v has all vertices\n\t\tg.unconnected(v2, v);\n\t}", "public Graph(int numVertices) {\n myAdjLists = new LinkedList[numVertices];\n myStartVertex = 0;\n for (int k = 0; k < numVertices; k++) {\n myAdjLists[k] = new LinkedList<Edge>();\n }\n myVertexCount = numVertices;\n }", "public FlowNetwork(int V) {\n this.V = V-1;\n adj = (List<FlowEdge>[]) new List[V];\n for (int v=0; v < V; v++)\n adj[v] = new ArrayList<>();\n }", "public Graph()\r\n {\r\n this( \"x\", \"y\" );\r\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 }", "void addVertex(Vertex v, ArrayList<Vertex> neighbors, ArrayList<Double> weights) throws VertexNotInGraphException;", "public Edge() {}", "public Edge(int index1, int index2, float crease, boolean inFace, List<Vector3f> vertices) {\n this(index1, index2, crease, inFace);\n this.set(vertices.get(index1), vertices.get(index2));\n }", "public Edge(int sv, int dv, int d) // constructor\n {\n srcVert = sv;\n destVert = dv;\n distance = d;\n }", "public Graph(int numVertices) {\r\n myAdjLists = new LinkedList[numVertices];\r\n myStartVertex = 0;\r\n for (int k = 0; k < numVertices; k++) {\r\n myAdjLists[k] = new LinkedList<Edge>();\r\n }\r\n myVertexCount = numVertices;\r\n }", "public void setEdges(DEdge[] listOfEdges){\n this.listOfEdges = listOfEdges;\n }", "public Graph(){//constructor\n //edgemap\n srcs=new LinkedList<>();\n maps=new LinkedList<>();\n chkIntegrity(\"edgemap\");\n \n nodes=new LinkedList<>();\n //m=new EdgeMap();\n }", "public Graph(int V)\n {\n this.V = V;\n adj = (Bag<Integer>[]) new Bag[V];\n for (int v = 0; v < V; v++)\n adj[v] = new Bag<Integer>();\n }", "public GraphEdge()\r\n {\r\n cost = 1.0;\r\n indexFrom = -1;\r\n indexTo = -1;\r\n }", "public Edge(Object vertex1, Object vertex2, int w){\n v1 = vertex1;\n v2 = vertex2;\n weight = w;\n }", "public GraphEdge(GraphNode u, GraphNode v, char busLine){\r\n first = u;\r\n second = v;\r\n this.busLine = busLine;\r\n }", "public void setEdges(List<E> edges) {\n\t\tthis.edges = edges;\n\t\tvirtualEdges = new ArrayList<E>();\n\t}", "public Polygon4D(ArrayList<Vertex> vertices){\n\t\t\n\t\tthis.vertices = vertices;\n\t\tsetFaces();\n\t}", "public static ArrayList<Vertex> initializeGraph() {\n\t\tVertex uVertex = new Vertex('u');\n\t\tVertex vVertex = new Vertex('v');\n\t\tVertex wVertex = new Vertex('w');\n\t\tVertex xVertex = new Vertex('x');\n\t\tVertex yVertex = new Vertex('y');\n\t\tVertex zVertex = new Vertex('z');\n\t\t\n\t\tVertex[] uAdjacencyList = {xVertex, vVertex};\n\t\tuVertex.setAdjacencyList(createArrayList( uAdjacencyList ));\n\t\t\n\t\tVertex[] vAdjacencyList = {yVertex};\n\t\tvVertex.setAdjacencyList(createArrayList( vAdjacencyList ));\n\t\t\n\t\tVertex[] wAdjacencyList = {zVertex, yVertex};\n\t\twVertex.setAdjacencyList(createArrayList( wAdjacencyList ));\n\t\t\n\t\tVertex[] xAdjacencyList = {vVertex};\n\t\txVertex.setAdjacencyList(createArrayList( xAdjacencyList ));\n\t\t\n\t\tVertex[] yAdjacencyList = {xVertex};\n\t\tyVertex.setAdjacencyList(createArrayList( yAdjacencyList ));\n\t\t\n\t\tVertex[] zAdjacencyList = {zVertex};\n\t\tzVertex.setAdjacencyList(createArrayList( zAdjacencyList ));\n\n\t\tVertex[] graph = { uVertex, vVertex, wVertex, xVertex, yVertex, zVertex};\n\t\treturn createArrayList( graph );\n\n\t}", "public Graph() // constructor\n{\n vertexList = new Vertex[MAX_VERTS];\n // adjacency matrix\n adjMat = new int[MAX_VERTS][MAX_VERTS];\n nVerts = 0;\n for (int j = 0; j < MAX_VERTS; j++) // set adjacency\n for (int k = 0; k < MAX_VERTS; k++) // matrix to 0\n adjMat[j][k] = INFINITY;\n}", "public Graph(){\r\n this.listEdges = new ArrayList<>();\r\n this.listNodes = new ArrayList<>();\r\n this.shown = true;\r\n }", "public void connectClusters()\n\t{\n//\t\tfor(int i = 0; i<edges.size();i++)\n//\t\t{\n//\t\t\tEdgeElement edge = edges.get(i);\n//\t\t\tString fromNodeID = edge.fromNodeID;\n//\t\t\tNodeElement fromNode = findSubNode(fromNodeID);\n//\t\t\tString toNodeID = edge.toNodeID;\n//\t\t\tNodeElement toNode = findSubNode(toNodeID); \n//\t\t\t\n//\t\t\tif(fromNode != null && toNode != null)\n//\t\t\t{\n//\t\t\t\tPortInfo oport = new PortInfo(edge, fromNode);\n//\t\t\t\tfromNode.addOutgoingPort(oport);\n//\t\t\t\tedge.addIncomingPort(oport);\n//\t\t\t\tPortInfo iport = new PortInfo(edge, toNode);\n//\t\t\t\ttoNode.addIncomingPort(iport);\n//\t\t\t\tedge.addOutgoingPort(iport);\n//\t\t\t}\n//\t\t}\n\t}", "public HopcroftTarjanSplitComponent() {\n\t\tsuper();\n\t\tvirtualEdges = new ArrayList<E>();\n\t}", "public IndexedImmutableGraph(Graph tripleCollection) {\n this.tripleCollection = new IndexedGraph(tripleCollection);\n }", "public Vertex(){\n\n }", "public Graph(int numVertices) {\n adjLists = new LinkedList[numVertices];\n startVertex = 0;\n for (int k = 0; k < numVertices; k++) {\n adjLists[k] = new LinkedList<Edge>();\n }\n vertexCount = numVertices;\n }", "GraphObj() {\n this._V = 0;\n this._E = 0;\n inListArray = new ArrayList<>();\n inListArray.add(null);\n outListArray = new ArrayList<>();\n outListArray.add(null);\n selfEdges = new ArrayList<>();\n selfEdges.add(-1);\n edgeList = new ArrayList<>();\n edgeList.add(null);\n }", "public Edge()\r\n {\r\n }", "public Graph(int V, int E) {\n this(V);\n if (E < 0) throw new RuntimeException(\"Number of edges must be nonnegative\");\n for (int i = 0; i < E; i++) {\n int v = (int) (Math.random() * V);\n int w = (int) (Math.random() * V);\n double weight = Math.round(100 * Math.random()) / 100.0;\n Edge e = new Edge(v, w, weight,0);\n //addEdge(e);\n }\n }", "public EdgeWeightedDigraph(int V) \n {\n if (V < 0) throw new RuntimeException(\"Number of vertices must be nonnegative\");\n this.V = V;\n this.E = 0;\n adj = (ArrayList<DirectedEdge>[]) new ArrayList[V];\n for (int v = 0; v < V; v++)\n adj[v] = new ArrayList<DirectedEdge>();\n }", "public Vertex(L l) {\n\t\tlabel = l;\n\t}", "public MyVertex( ) {\n // Set ID and increment so next Vertex count++\n id = count;\n count++;\n\n // Set color to NULL initially\n color = null;\n\n // Create new Lists\n incidentEdges = new ArrayList< Edge >( );\n adjacentVertices = new ArrayList< Vertex >( );\n }", "public VoronoiVisualization()\n\t \t{\n\t\t super();\n\t \t}", "public Graph(int V) {\r\n \t \t\r\n if (V < 0) throw new IllegalArgumentException(\"Number of vertices in a Digraph must be nonnegative\");\r\n this.V = V;\r\n this.E = 0;\r\n this.indegree = new int[V];\r\n adj = (Bag<Edge>[]) new Bag[V];\r\n for (int v = 0; v < V; v++)\r\n adj[v] = new Bag<Edge>();\r\n }", "Graph(int v) {\n V = v;\n adj = new LinkedList[v];\n for (int i = 0; i < v; ++i)\n adj [i] = new LinkedList();\n }", "public ListGraph(int numberOfVertex, boolean directed) throws Exception {\n super(numberOfVertex, directed);\n\n edges = new List[numberOfVertex];\n\n for(int index = 0; index < numberOfVertex; ++index)\n this.edges[index] = new LinkedList<Edge>();\n }", "GameBoardVertex(Piece pieceAtVertex, ArrayList<GameBoardVertex> neighbors){\n this.pieceAtVertex = pieceAtVertex;\n this.neighbors = neighbors;\n }", "public Graph(Node... nodes)\r\n\t{\r\n\t\tedges = new ArrayList<>();\r\n\r\n\t\tfor (int i = 0; i < nodes.length - 1; i += 2)\r\n\t\t{\r\n\t\t\tedges.add(new Node[]\r\n\t\t\t{\r\n\t\t\t\tnodes[i], nodes[i + 1]\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (nodes.length % 2 == 1)\r\n\t\t{\r\n\t\t\tedges.add(new Node[]\r\n\t\t\t{\r\n\t\t\t\tnodes[nodes.length - 1]\r\n\t\t\t});\r\n\t\t}\r\n\t}", "public boolean addVertices(Collection<? extends V> vertices);", "Graph(int v) {\n this.v = v;\n array = new ArrayList[v];\n\n // Add linkedList to array\n for (int i = 0; i < v; i++) {\n array[i] = new ArrayList<>();\n }\n }", "public Graph()\r\n\t{\r\n\t\tthis.adjacencyMap = new HashMap<String, HashMap<String,Integer>>();\r\n\t\tthis.dataMap = new HashMap<String,E>();\r\n\t}", "public Vertex( String nm )\n { name = nm; adjEdge = new TreeMap<String,Edge>( ); reset( ); }", "public ArangoDBVertex(ArangoDBGraph graph, String collection) {\n\t\tthis(null, collection, graph);\n\t}", "public Graph() {\r\n\t\tthis.matrix = new Matrix();\r\n\t\tthis.listVertex = new ArrayList<Vertex>();\r\n\t}", "public abstract ArrayList<String> neighbours(String vertLabel);", "Collection<E> edges();", "public void constructGraph(){\r\n\t\tmyGraph = new Graph();\r\n\r\n\t\tfor(int i =0;i<=35;i++) {\r\n\t\t\tmyGraph.addVertex(allSpots[i]);\r\n\t\t}\r\n\r\n\t\tfor(int i =0;i<=35;i++) {\r\n\t\t\tint th = i;\r\n\t\t\twhile(th%6!=0) {\r\n\t\t\t\tth--;\r\n\t\t\t}\r\n\t\t\tfor(int h=th;h<=th+5;h++) {\r\n\t\t\t\tif(h!=i) {\r\n\t\t\t\t\tif(allSpots[i].equals(allSpots[h])) {\t\t\r\n\t\t\t\t\t\tmyGraph.addEdge(allSpots[i], allSpots[h]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tint tv=i;\r\n\t\t\twhile(tv-6>0) {\r\n\t\t\t\ttv=tv-6;\r\n\t\t\t}\r\n\t\t\tfor(int v=tv;v<36; v=v+6) {\r\n\t\t\t\tif(v!=i) {\r\n\t\t\t\t\tif(allSpots[i].equals(allSpots[v])) {\t\t\r\n\t\t\t\t\t\tmyGraph.addEdge(allSpots[i], allSpots[v]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Add verticies that store the Spot objects\r\n\t\t//Add edges to connect spots that share a property along an orthogonal direction\r\n\r\n\t\t//This is the ONLY time it is ok to iterate the array.\r\n\t\t\r\n\t\t//myGraph.addVert(...);\r\n\t\t//myGraph.addEdge(...);\r\n\t}", "public WeightedEdge(){\n\t\t\n\t}", "@Before\n public void setUp() {\n for (int i = 0; i < 6; i++) {\n\n Vertex tempV1 = new Vertex(i + \"\", \"Location number \" + i);\n\n testVertices.add(tempV1);\n\n }\n\n //Build Edges that connect each vertex and put edges into ArrayList\n for (int i = 0; i < 5; i++) {\n\n Edge tempE = new Edge(i + \"\",testVertices.get(i),testVertices.get(i+1) ,(i*10));\n\n testEdges.add(tempE);\n }\n\n //Graph created with complete ArrayLists of all Edges and Vertices\n testGraph = new Graph(testVertices, testEdges);\n }", "public DFSGraph() {\n this(new HashMap<>(), HashMap::new, HashSet::new, HashSet::new);\n }", "public DSAGraph()\n\t{\n\t\tvertices = new DSALinkedList();\n\t\tedgeCount = 0;\n\t}", "public AdjacencyLists(int num)\n {\n numVertices = num;\n clearGraph();\n }", "public WeightedAdjacencyGraph() {\n this.vertices = new HashMap<>();\n }", "public ConnectVertexView(Stage primaryStage, HashSet<Integer> vertexesCurrentlyOnScreen) {\n this.primaryStage = primaryStage;\n this.vertexesCurrentlyOnScreen = vertexesCurrentlyOnScreen;\n setupElements();\n positionElementsInsideView();\n }", "@SuppressWarnings(\"unchecked\")\n\tEdgeWeightedGraph(int V)\n\t{\n\t\tthis.V=V;\n\t\tadj=(Bag<Edge>[]) new Bag[V];\n\t\tfor(int v=0;v<V;v++)\n\t\t\tadj[v]=new Bag<Edge> ();\n\t}", "public Graph(){\n\t\tthis.sizeE = 0;\n\t\tthis.sizeV = 0;\n\t}", "GameBoardVertex(GameBoardVertex neighbor){this.neighbors.add(neighbor);}", "public Vertex(String aName)\r\n\t\t{\r\n\t\t\tthis.name = aName;\r\n\t\t\tthis.neighbors = new ArrayList<Edge>();\r\n\t\t}", "Graph(int size) {\n n = size;\n V = new Vertex[size + 1];\n // create an array of Vertex objects\n for (int i = 1; i <= size; i++)\n V[i] = new Vertex(i);\n }", "public listVertices_args(listVertices_args other) {\n }", "public Graph(int V){\n this.V = V;\n this.E = 0;//no edge at initial condition.\n //initialize the adjacency list\n this.adj = new Queue[V];\n //initialize the Queue\n for(int i=0;i<adj.length;i++) {\n //each element in adj is a Queue that stores all vertexes connected with the index i of adj.\n adj[i] = new Queue<Integer>();\n }\n }", "public Edge(L source,L target,Integer weight) {\r\n \tsou=source;\r\n \ttar=target;\r\n \twei=weight;\r\n \tcheckRep();\r\n }", "public Polygon(List<Point> vertices) {\n\t\tthis.vertices = vertices;\n\t\tthis.segments = new ArrayList<LineSegment>(vertices.size());\n\n\t\tPoint first = vertices.get(0);\n\t\tPoint current = first;\n\t\tfor (int i = 1; i < vertices.size(); i++) {\n\t\t\tPoint next = vertices.get(i);\n\t\t\tsegments.add(new LineSegment(current, next));\n\t\t\tcurrent = next;\n\t\t}\n\t\tsegments.add(new LineSegment(current, first));\n\t\tvertices.add(first);\n\t}", "public AbstractListMapGraph()\n\t{\n\t\tsuper();\n\t\tedgeList = new ArrayList<ET>();\n\t\tnodeList = new ArrayList<N>();\n\t\tgcs = new GraphChangeSupport<N, ET>(this);\n\t\tnodeEdgeMap = new HashMap<N, Set<ET>>();\n\t}", "private void connectAll()\n {\n\t\tint i = 0;\n\t\tint j = 1;\n\t\twhile (i < getNodes().size()) {\n\t\t\twhile (j < getNodes().size()) {\n\t\t\t\tLineEdge l = new LineEdge(false);\n\t\t\t\tl.setStart(getNodes().get(i));\n\t\t\t\tl.setEnd(getNodes().get(j));\n\t\t\t\taddEdge(l);\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++; j = i+1;\n\t\t}\n\n }", "public abstract Set<? extends EE> edgesOf(VV vertex);", "Graph(){\n\t\tadjlist = new HashMap<String, Vertex>();\n\t\tvertices = 0;\n\t\tedges = 0;\n\t\tkeys = new ArrayList<String>();\n\t}", "public void addVertex (){\t\t \n\t\tthis.graph.insert( new MyList<Integer>() );\n\t}" ]
[ "0.6693902", "0.6358779", "0.6295274", "0.60759705", "0.6040067", "0.6038896", "0.60322744", "0.5975202", "0.5971222", "0.59463227", "0.59286183", "0.58633685", "0.57764786", "0.5771764", "0.5770805", "0.5749956", "0.57402956", "0.57168156", "0.56935436", "0.56824476", "0.56784606", "0.56650215", "0.56579256", "0.5656947", "0.56498724", "0.56353724", "0.56230867", "0.56139976", "0.5584514", "0.55699205", "0.55450785", "0.5531372", "0.5516936", "0.55144906", "0.55108684", "0.5509158", "0.5504292", "0.5499933", "0.54978245", "0.5492002", "0.5474455", "0.54719955", "0.5445467", "0.5440683", "0.54309183", "0.5423634", "0.5421829", "0.5418174", "0.54041", "0.5398769", "0.5393074", "0.5390154", "0.5388625", "0.5379706", "0.53756005", "0.53624547", "0.5358705", "0.5348474", "0.53471357", "0.5341835", "0.53362495", "0.5326145", "0.53169453", "0.53105545", "0.53097665", "0.53020716", "0.5291854", "0.52823687", "0.52815133", "0.52710015", "0.52673805", "0.5266956", "0.5263178", "0.52624875", "0.5253723", "0.5248726", "0.52450055", "0.5243836", "0.52404875", "0.5237867", "0.5223402", "0.52205503", "0.52108866", "0.52077496", "0.51999086", "0.5194348", "0.51906276", "0.51757", "0.517445", "0.5164006", "0.51612836", "0.5160407", "0.5157002", "0.5152449", "0.5151012", "0.51457155", "0.51334006", "0.51277435", "0.51141375", "0.5112882" ]
0.65397304
1
Returns the direct followers of a given vertex
public Set<Vertex> post(Vertex start){ Set<Vertex> reach = new HashSet<Vertex>(); if(this.edgesByStart.get(start) == null) return reach; for(LabeledEdge trans : this.edgesByStart.get(start)){ reach.add(trans.getEnd()); } return reach; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<User> getFollowersForUser(User user);", "public String getFollowerIds() {\n\t\treturn restClient.getFollowers();\n\t}", "List<User> getFollowingForUser(User user);", "public Followers getFollowers() {\n return followers;\n }", "@Override\n\tpublic List<Location> getNeighbors(Location vertex) {\n\n\t\tArrayList<Location> neighbors = new ArrayList<Location>();\n\n\t\tfor (Path p : getOutEdges(vertex))\n\t\t\tneighbors.add(p.getDestination());\n\n\t\treturn neighbors;\n\n\n\t}", "Data<List<User>> getFollowers();", "public Iterator<DocTokenInf> getPrev(int vertex) {\n\t\tDocTokenLinkedList ll = list[vertex];\n\t\tif(ll == null)\n\t\t\treturn null;\n\t\treturn ll.iterator();\n\t}", "@Override\n\tpublic List<User> getFollowers() throws Exception {\n\t\treturn null;\n\t}", "List<V> getShortestPath(V vertex);", "public ArrayList<String> shortestPath(String u, String v)\n {\n ArrayList<String> path = new ArrayList<>();\n HashMap<String, Boolean> flag = new HashMap<>();\n HashMap<String, String> prev = new HashMap<>();\n\n Queue<GraphVertex> queue = new LinkedList<>();\n HashMap<String, Boolean> visited = new HashMap<>();\n\n GraphVertex src = graphVertexHashMap.get(u);\n flag.put(src.getVertexName(), true);\n queue.add(src);\n visited.put(src.getVertexName(), true);\n\n while(!queue.isEmpty()){\n GraphVertex node = queue.poll();\n\n HashMap<String, GraphVertex> edges = node.getOutDegrees();\n Iterator it = edges.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry pair = (Map.Entry)it.next();\n if(flag.get(pair.getKey()) == null || flag.get(pair.getKey()) == false){\n String vertex = (String)pair.getKey();\n flag.put(vertex, true);\n prev.put(vertex, node.getVertexName());\n queue.add(edges.get(pair.getKey()));\n }\n }\n\n }\n path = backTrackPath(prev, u, v);\n return path;\n }", "public void follow(int followerId, int followeeId) {\n\n }", "private static Vector3f nextVertex(Vector3f normal, Vector3f vertex) {\n Vector3f next = new Vector3f();\n Vector3f.cross(normal, vertex, next);\n Vector3f.add(normal, next, next);\n return next;\n }", "Data<List<User>> getFollowers(Integer limit);", "public int getPredecessorCount(final LazyNode2 vertex) {\n Set<Node> vertices = new HashSet<Node>();\n \n Node n = neo.getNodeById(vertex.getId());\n \n for(Relationship r : n.getRelationships(relType.DEFAULT, Direction.INCOMING)){\n if(isActive(r))\n vertices.add(r.getStartNode());\n }\n n = null; \n \n return vertices.size();\n }", "public String getFollowers() {\n return followers;\n }", "List<V> getAdjacentVertexList(V v);", "public List<String> getUserFollowers(String username) {\n return userDAO.getUserFollowers(username);\n }", "@Override\r\n\tpublic List<Integer> getReachableVertices(GraphStructure graph,int vertex) {\r\n\t\tadjacencyList=graph.getAdjacencyList();\r\n\t\tpathList=new ArrayList<Integer>();\r\n\t\tisVisited=new boolean [graph.getNumberOfVertices()];\r\n\t\ttraverseRecursively(graph, vertex);\r\n\t\treturn pathList;\r\n\t}", "public Set<V> getNeighbours(V vertex);", "public Set<LabeledEdge> getTransitions(Vertex start, Vertex follower){\n\t\tSet<LabeledEdge> paths = new HashSet<LabeledEdge>();\n\t\tfor(LabeledEdge trans : edgesByStart.get(start)){\n\t\t\tif(trans.getEnd().equals(follower))\n\t\t\t\tpaths.add(trans);\n\t\t}\n\t\treturn paths;\n\t}", "Data<List<User>> getFollowersCursor(String cursor, Integer limit);", "public void addFollower(String follower, String following) {\n for (User u : users) {\n System.out.println(\"iterating: \" + u.getName() + \" : \" + following);\n if (u.getName().equals(follower)) {\n for (String f : u.getFollowers()) {\n\n if (f.equals(following)) {\n System.out.println(\"ENDDDDD\");\n return;\n }\n }\n System.out.println(\"adding follower!!!!!!!!\");\n getUser(follower).addFollower(following);\n }\n }\n }", "@Override\n public Set<User> followersOfUser(String usernname) {\n return userDataMapper.getFollowersOfUser(getUser(usernname).getId());\n }", "Data<List<User>> getFollowers(Integer limit, String fields);", "public List<Integer> neighbors(int vertex) {\r\n \tArrayList<Integer> vertices = new ArrayList<Integer>();\r\n \tLinkedList<Edge> testList = myAdjLists[vertex];\r\n int counter = 0;\r\n while (counter < testList.size()) {\r\n \tvertices.add(testList.get(counter).myTo);\r\n \tcounter++;\r\n }\r\n return vertices;\r\n }", "public void metFollower() {\n metFollowers++;\n }", "@Override\n\tpublic List<User> getFollowingUsers() throws Exception {\n\t\treturn null;\n\t}", "Iterable<T> followNode(T start) throws NullPointerException;", "Data<List<User>> getFollowersCursor(String cursor, Integer limit, String fields);", "public Collection<Vertex> adjacentVertices(Vertex v) {\n Vertex parameterVertex = new Vertex(v.getLabel());\n if(!myGraph.containsKey(parameterVertex)){\n throw new IllegalArgumentException(\"Vertex is not valid\");\n }\n\n //create a copy of the passed in vertex to restrict any reference\n //to interals of this class\n Collection<Vertex> adjVertices = new ArrayList<Vertex>();\n\n Iterator<Edge> edges = myGraph.get(parameterVertex).iterator();\n while(edges.hasNext()) {\n adjVertices.add(edges.next().getDestination());\n }\n return adjVertices;\n }", "public V getParent(V vertex);", "public ArrayList<Follower> getFollower_list(){\n return follower_list;\n }", "public void followEdge(int e) {\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.edge == e) {\r\n\t\t\t\tcurrentVertex = neighbor.vertex;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Edge to \" + e + \" not exist.\");\r\n\t}", "public FollowersResponse oldGetFollowers(FollowersRequest request) {\n\n if(!isRecognizedUser(request.getUser().getAlias())) {\n List<User> returnMe = new ArrayList<>();\n return new FollowersResponse(returnMe, false);\n }\n\n List<User> allFollowers = getDummyFollowers();\n List<User> responseFollowers = new ArrayList<>(request.getLimit());\n\n boolean hasMorePages = false;\n\n if(request.getLimit() > 0) {\n // TODO the followers index will now be the last followerHandle and the followeeHandle pair\n // TODO: The followees index won't implement the index.\n int followersIndex = getFollowersStartingIndex(request.getLastFollower(), allFollowers);\n\n for(int limitCounter = 0; followersIndex < allFollowers.size() && limitCounter < request.getLimit(); followersIndex++, limitCounter++) {\n responseFollowers.add(allFollowers.get(followersIndex));\n }\n\n hasMorePages = followersIndex < allFollowers.size();\n }\n\n return new FollowersResponse(responseFollowers, hasMorePages);\n }", "public Long getFollowerId() {\n return followerId;\n }", "@GET(\"/users/{user}/following\")\n Call<List<UserFollowing>> getUserFollowing(@Path(\"user\") String user);", "public FollowResponse getFollowers(FollowRequest request) throws IOException {\n ClientCommunicator communicator = new ClientCommunicator(new FollowerStrategy());\n\n return (FollowResponse) communicator.doWebRequest(request, null);\n }", "List<WeightedEdge<Vertex>> neighbors(Vertex v);", "protected abstract List<Integer> getNeighbors(int vertex);", "public List neighbors(int vertex) {\n // your code here\n \tList toReturn = new ArrayList<Integer>();\n \tfor (Edge e : myAdjLists[vertex]) {\n \t\ttoReturn.add(e.to());\n \t}\n return toReturn;\n }", "public boolean follow(Node n) { return true; }", "public void getFollowersList(User user, AsyncHttpResponseHandler handler) {\n if (user == null) {\n return;\n }\n\n String apiUrl = getApiUrl(\"followers/ids.json\");\n RequestParams params = new RequestParams();\n\n params.put(\"user_id\", String.valueOf(user.getUid()));\n\n // Execute the request\n getClient().get(apiUrl, params, handler);\n }", "public Integer getFollowers() {\n if (getGroupType() == Group.DISCUSSION_KEY) {\n return getMemberCount();\n } else {\n return followers;\n }\n }", "Data<List<User>> getfollowingUsers(Integer limit);", "List<Company> getFollowing();", "Iterable<Long> adjacent(long v) {\n List<Node> adjNodes = adj.get(v);\n List<Long> adjVertices = new ArrayList<>();\n for (int i = 1; i < adjNodes.size(); i++) {\n adjVertices.add(adjNodes.get(i).getID());\n }\n return adjVertices;\n }", "@Override\r\n public List<Vertex> getNeighbors(Vertex v) {\r\n ArrayList<Vertex> neighborsList = new ArrayList<>();\r\n neighborsList = adjacencyList.get(v);\r\n Collections.sort(neighborsList, Comparator.comparing(Vertex::getLabel));\r\n return neighborsList; //getting the list of all adjacent vertices of vertex v\r\n }", "public FollowerResp getUsersFollowing(Dataset dataset, Dataset clusterizedDataset) throws InterruptedException {\n Chrono c = new Chrono(\"Downloading user friendships....\");\n FollowerResp resp = new FollowerResp(dataset.getName());\n Twitter twitter = new TwitterFactory().getInstance();\n\n List<UserModel> users = this.getSortedUsers(dataset);\n int current_user = 0; // keeps tack of current user\n\n while (current_user < users.size()) {\n UserModel u = users.get(current_user);\n System.out.println(String.format(\"Downloading friends of user %s...\", current_user));\n\n try {\n String stringUserId = u.getName(dataset);\n long userId = Integer.parseInt(stringUserId);\n User user = twitter.showUser(userId);\n if (user.getStatus() == null) {\n u.setIsPrivate(true);\n resp.addPrivateUserId(stringUserId);\n } else {\n IDs ids = twitter.getFriendsIDs(userId, -1);\n HashSet<String> friends = new HashSet<String>();\n for (long i : ids.getIDs()) {\n if (clusterizedDataset.exixstObj(i + \"\")) {\n friends.add(i + \"\");\n// UserModel followed = clusterizedDataset.getUser(i + \"\");\n// TwitterObjectFactory tof = new TwitterObjectFactory(clusterizedDataset);\n// UserModel following = tof.getUser(userId + \"\", dataset.getName());\n// following.addFollowOut(followed);\n }\n }\n resp.addFriends(stringUserId, friends);\n }\n\n current_user++;\n } catch (TwitterException e) {\n boolean cause = manageRequestError(e, u, resp, dataset);\n current_user += cause ? 1 : 0;\n }\n }\n c.millis();\n return resp;\n }", "public Set<UserDto> getFollowing(String username) {\n\t\tUser getting = userRepository.findByUname(username);\n\t\tSet<UserDto> dtoSet = new HashSet<>();\n\t\tfor (User u : getting.getFollowing()) {\n\t\t\tdtoSet.add(userMapper.toUserDto(u));\n\t\t}\n\t\treturn dtoSet;\n\t}", "public void followEdgeInReverse(int e) {\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 (neighbor.edge == e) {\r\n\t\t\t\tcurrentVertex = neighbor.vertex;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Edge from \" + e + \" does not exist.\");\r\n\t}", "private LinkedList<T> getUnvisitedNeighbors(T vertex){\n LinkedList<T> neighbors = getNeighbors(vertex);\n LinkedList<T> unvisitedNeighbors = new LinkedList<T>();\n \n for (T neighbor : neighbors){\n if (!visited.contains(neighbor)){\n unvisitedNeighbors.add(neighbor);\n }\n }\n return unvisitedNeighbors;\n }", "public List<GraphEdge<D>> getForwardEdges() {\n List<GraphEdge<D>> edges = new ArrayList<>();\n \n for (GraphNode<D> node : successors) {\n edges.add(new GraphEdge<>(this, node));\n }\n \n return edges;\n }", "Iterable<T> followNodeAndSelef(T start) throws NullPointerException;", "public List<Long> getFollowings(long userId) throws NewsfeedException {\n return followingCache.getFollowings(userId);\n }", "public ProfileInterface[] following(int howMany);", "public FAVertex next(FAVertex v, String mark){\n\t\tfor(FAEdge edge : edges)\n\t\t\tif(getVertex(edge.getStart())==v&&edge.getCharacter().equals(mark))\n\t\t\t\treturn getVertex(edge.getEnd());\n\t\treturn null;\n\t}", "private int getFollowersStartingIndex(User lastFollower, List<User> allFollowers) {\n\n int followersIndex = 0;\n\n if(lastFollower != null) {\n // This is a paged request for something after the first page. Find the first item\n // we should return\n for (int i = 0; i < allFollowers.size(); i++) {\n if(lastFollower.equals(allFollowers.get(i))) {\n // We found the index of the last item returned last time. Increment to get\n // to the first one we should return\n followersIndex = i + 1;\n }\n }\n }\n\n return followersIndex;\n }", "public void findPath(Vertex v, Graph g)\n {\n \tQueue<Vertex> q = new LinkedList<Vertex>();\n \tSet<String> visited= new HashSet<String>();\n \tSet<String> edges= new TreeSet<String>();\n \t\n \t \tq.add(v);\n \t \tvisited.add(v.name);\n \t \t\n \t \twhile(!q.isEmpty()){\n \t \t\tVertex vertex = q.poll();\n \t \t\t \n \t for(Edge adjEdge: vertex.adjEdge.values()){\n \t\t if(!visited.contains(adjEdge.adjVertex.name) && !adjEdge.adjVertex.isDown && !adjEdge.isDown){\n \t\t\t q.offer(adjEdge.adjVertex);\n \t\t\t visited.add(adjEdge.adjVertex.name);\n \t\t\t \n \t\t\t edges.add(adjEdge.adjVertex.name);\n \t\t\t \n \t\t }\n \t }\n \t \n \t }\n \t \tfor(String str: edges){\n \t\t System.out.print('\\t');\n \t\t System.out.println(str);\n \t }\n \t \t\n }", "protected VertexRelation getProteinsRelation(VertexObject proteinVertex, VertexObject relatedVertex) {\n Map<VertexObject, VertexRelation> relationsMap = proteinRelationMaps.get(proteinVertex);\n if (relationsMap == null) {\n relationsMap = createProteinsRelationsMap(proteinVertex);\n proteinRelationMaps.put(proteinVertex, relationsMap);\n }\n \n if (relationsMap != null) {\n return relationsMap.get(relatedVertex);\n } else {\n return null;\n }\n }", "public int inDegree(int vertex) {\n int count = 0;\n//your code here\n for(int i=0; i<adjLists.length; i++){\n if(i==vertex){ continue;}\n if(isAdjacent(i,vertex)){\n count++;\n continue;\n }\n }\n return count;\n }", "int getWhoThisUserFollows(User user, AsyncResultHandler handler);", "public int getDegree(V vertex);", "static int getFollowers(int amountFollowers, int amountFollowers2)\n {\n int followers = amountFollowers2 - amountFollowers;\n return followers;\n }", "public List<Integer> getPredecessors(int v);", "int getWhoFollows(User user, AsyncResultHandler handler);", "public Set<String>[] getFollow();", "public List<User> formFollowingList(User user) throws UserException, FollowerException {\n\t\tList<User> following = new ArrayList<User>();\n\t\tList<BigInteger> listfo = followerDao.getFollowersbyUser(user);\n\t\tif(listfo!=null) {\n\t\tfor(BigInteger i: listfo)\n\t {\n\t for(User u:userDao.getAllUser()) {\n\t if(u.getPersonID()==i.longValue()) {\n\t following.add(u);\n\t }\n\t }\n\t }\n\t\t}\n\t\treturn following;\n\t\n\t}", "public ArrayList<Users> getFollowing() {\n\t\tif (hbm.getFollowing(username) != null) {\n\t\t\tString[] usernames = hbm.getFollowing(username).split(\",\");\n\n\t\t\t// init arraylist of user object\n\t\t\tArrayList<Users> users = new ArrayList<Users>();\n\n\t\t\t// loop through all the username we are following and get their\n\t\t\t// object and add it to our list to return\n\t\t\tfor (String uname : usernames)\n\t\t\t\tusers.add(hbm.getUserObject(uname));\n\t\t\treturn users;\n\t\t}\n\t\treturn null;\n\t}", "public FollowerResponse getFollowers(FollowerRequest request, String urlPath) throws IOException, TweeterRemoteException {\n FollowerResponse response = clientCommunicator.doPost(urlPath, request, null, FollowerResponse.class);\n\n if(response.isSuccess()) {\n return response;\n } else {\n throw new RuntimeException(response.getMessage());\n }\n }", "public List<String> getUserFollowing(String username) {\n return userDAO.getUserFollowing(username);\n }", "public String getUserFollowers() {\n String temp = userFollowers;\r\n userFollowers = \"Has no followers\";\r\n return temp;\r\n }", "Data<List<User>> getfollowingUsersCursor(String cursor, Integer limit);", "public Vertex getFrom() {\r\n\r\n return from;\r\n }", "public static List<User> getUserFollowers(Long userId, int first, int limit) {\n User user = DAO.getUserById(userId);\n return DAO.getAllUsersFromQuery(\"select distinct us from User us where ? in elements(us.following)\", first, limit, user);\n }", "public void neighhbors(Village vertex) {\n\t\tIterable<Edge> neighbors = g.getNeighbors(vertex);\n\t\tSystem.out.println(\"------------\");\n\t\tSystem.out.println(\"vertex: \" + vertex.getName());\n\t\tfor(Edge e : neighbors) {\n\t\t\tSystem.out.println(\"edge: \" + e.getName());\n\t\t\tSystem.out.println(\"transit: \" + e.getTransit() + \" color: \" + e.getColor());\n\t\t}\n\t}", "public void unfollow(int followerId, int followeeId) {\n\n }", "@Override\n\t\tpublic void vertexCallback(List<String> vertex)\n\t\t{\n\t\t\tList<String> v = new ArrayList<String>(vertex.size());\n\t\t\tv.addAll(vertex);\n\t\t\tm_hyperedge.add(v);\n\t\t}", "public Integer getFollowerCount() {\n return followerCount;\n }", "public followerRelation(User follower, User followee) {\n this.follower = follower;\n this.followee = followee;\n }", "private void vertexUp(String vertex) {\r\n\t\tIterator it = vertexMap.entrySet().iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tMap.Entry pair = (Map.Entry) it.next();\r\n\t\t\tif (pair.getKey().equals(vertex)) {\r\n\t\t\t\tVertex v = (Vertex) pair.getValue();\r\n\t\t\t\tv.setStatus(true);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public V getOriginator() {\r\n\r\n\t\tV result = null;\r\n\t\tif ((counter <= links.size()) && (counter > 0)) {\r\n\t\t\tresult = predNodes.get(counter - 1);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public ArrayList< Vertex > adjacentVertices( ) {\n return adjacentVertices;\n }", "public List<Message> getUserFollowersMessages(String userName) {\n List<Message> followerMessages = new ArrayList<Message>();\n\n if (getUser(userName) != null) {\n for (Message message : messages) {\n for (String u : getUser(userName).getFollowers()) {\n if (message.getUserName().equals(u)) {\n followerMessages.add(message);\n }\n }\n }\n }\n\n return followerMessages;\n }", "public List<Vertex> getShortestPathTo(Vertex target)\n {\n List<Vertex> path = new ArrayList<Vertex>();\n for (Vertex vertex = target; vertex != null; vertex = vertex.previous)\n path.add(vertex);\n Collections.reverse(path);\n return path;\n }", "@Override\n\tpublic void onFollow(User source, User followedUser) {\n\n\t}", "public followerRelation(Long followerId, Long followeeId) {\n this.follower = User.findById(followerId);\n this.followee = User.findById(followeeId);\n }", "public void setFollowers(String followers) {\n this.followers = followers;\n }", "public Vertex<VV> getFrom()\r\n { return from; }", "public Collection<V> getOtherVertices(V v);", "public List neighbors(int vertex) {\n// your code here\n LinkedList<Integer> result = new LinkedList<>();\n LinkedList<Edge> list = adjLists[vertex];\n for (Edge a : list) {\n result.add(a.to());\n }\n//List<Integer> list = new List<Integer>();\n return result;\n }", "public int inDegree(int vertex) {\n int count = 0;\n //your code here\n for (LinkedList<Edge> l : myAdjLists) {\n \tfor (Edge e : l) {\n \t\tif (e.to() == vertex) {\n \t\t\tcount++;\n \t\t\tbreak;\n \t\t}\n \t}\n }\n return count;\n }", "public List<Object> getAllFollower(int profileId) {\n\t\t\tlog.info(\"Getting follower list of the user\"+profileId);\n\t\t\tList followeList = null;\n\t\t\tfolloweList = followerDAO.getFollower(profileId);\n\t\t\tlog.debug(\"Number of follower:\"+followeList.size());\n\t\t\treturn followeList;\n\t}", "public void setFollowerCount(Integer followerCount) {\n this.followerCount = followerCount;\n }", "public Set<Pair<V,V>> neighbourEdgesOf(V vertex);", "public void follow(int followerId, int followeeId) {\n User source = null, target = null;\n for (User user : users) {\n if (user.id == followerId) {\n source = user;\n } else if (user.id == followeeId) {\n target = user;\n }\n }\n if (source == null) {\n source = new User(followerId);\n }\n if (target == null) {\n target = new User(followeeId);\n }\n source.follow(target);\n }", "public it.grpc.tokenRing.Node getFollowingN() {\n return followingN_ == null ? it.grpc.tokenRing.Node.getDefaultInstance() : followingN_;\n }", "public static List<Edge> getNei(int u){\n return adj.get(u);\n }", "public E getParentEdge(V vertex);", "public int degreeOf(V vertex);", "public String getFollow() {\r\n return follow;\r\n }", "@Override\n public Optional<List<FollowStateTracker>> getAllFSTByFollower() {\n return this.getFSTByFollowerID(authenticationService.getCurrentUser().getId());\n }" ]
[ "0.62792516", "0.5996907", "0.5748069", "0.5716853", "0.5683311", "0.56793374", "0.56572413", "0.5644271", "0.56134766", "0.55323017", "0.5521513", "0.5499378", "0.5497149", "0.54963326", "0.54955274", "0.54909086", "0.5394688", "0.5382554", "0.5341586", "0.5326189", "0.5299877", "0.5298957", "0.5298765", "0.52842087", "0.5282793", "0.52727103", "0.521472", "0.52054703", "0.5189254", "0.51752913", "0.5175226", "0.5167225", "0.5165295", "0.5159413", "0.51585174", "0.5157135", "0.5153707", "0.5146129", "0.51432014", "0.5140435", "0.5131999", "0.5104079", "0.5098404", "0.5070795", "0.5065735", "0.50643873", "0.50516874", "0.5051515", "0.50515044", "0.504916", "0.5047447", "0.5037168", "0.5025801", "0.50166154", "0.50161356", "0.501498", "0.50104463", "0.5003543", "0.49888015", "0.4976151", "0.49748737", "0.49699333", "0.49676394", "0.4957271", "0.495385", "0.49387103", "0.49354804", "0.49249727", "0.49241462", "0.49130145", "0.49110186", "0.49005815", "0.4900539", "0.48962638", "0.48908544", "0.48904428", "0.48814404", "0.48803797", "0.48775226", "0.48733675", "0.48730987", "0.48664522", "0.4865941", "0.48636296", "0.4853649", "0.48508447", "0.48466608", "0.4844677", "0.4840814", "0.48391873", "0.4837727", "0.48342875", "0.48325497", "0.4826582", "0.48236626", "0.48206487", "0.48196328", "0.48161942", "0.48158556", "0.48105925", "0.47898874" ]
0.0
-1
Returns the direct predecessors of a given vertex
public Set<Vertex> pre(Vertex start){ Set<Vertex> reach = new HashSet<Vertex>(); if(this.edgesByEnd.get(start) == null) return reach; for(LabeledEdge trans : this.edgesByEnd.get(start)){ reach.add(trans.getStart()); } return reach; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Integer> getPredecessors(int v);", "public int getPredecessorCount(final LazyNode2 vertex) {\n Set<Node> vertices = new HashSet<Node>();\n \n Node n = neo.getNodeById(vertex.getId());\n \n for(Relationship r : n.getRelationships(relType.DEFAULT, Direction.INCOMING)){\n if(isActive(r))\n vertices.add(r.getStartNode());\n }\n n = null; \n \n return vertices.size();\n }", "@Override\r\n\tpublic VertexInterface<T> getPredecessor() {\n\t\treturn null;\r\n\t}", "List<V> getShortestPath(V vertex);", "public Object[] getPredecessorNodes (Object node) throws InvalidComponentException;", "public V getParent(V vertex);", "Set<? extends IRBasicBlock> getPredecessors(IRBasicBlock block);", "public Set<V> getNeighbours(V vertex);", "public Set getPredecessors() {\n if (predecessors == null) return Collections.EMPTY_SET;\n return predecessors.entrySet();\n }", "List<V> getAdjacentVertexList(V v);", "public Iterator<DocTokenInf> getPrev(int vertex) {\n\t\tDocTokenLinkedList ll = list[vertex];\n\t\tif(ll == null)\n\t\t\treturn null;\n\t\treturn ll.iterator();\n\t}", "public E getParentEdge(V vertex);", "@Override\r\n\tpublic List<Integer> getReachableVertices(GraphStructure graph,int vertex) {\r\n\t\tadjacencyList=graph.getAdjacencyList();\r\n\t\tpathList=new ArrayList<Integer>();\r\n\t\tisVisited=new boolean [graph.getNumberOfVertices()];\r\n\t\ttraverseRecursively(graph, vertex);\r\n\t\treturn pathList;\r\n\t}", "@Override\r\n\tpublic E getSingleSourcePredecessor(E key) {\r\n\t\tif(containsVertex(key) && vertices.get(key).getPredecessor() != null) {\r\n\t\t\treturn vertices.get(key).getPredecessor().getElement();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private static Vector3f nextVertex(Vector3f normal, Vector3f vertex) {\n Vector3f next = new Vector3f();\n Vector3f.cross(normal, vertex, next);\n Vector3f.add(normal, next, next);\n return next;\n }", "public Set<Pair<V,V>> neighbourEdgesOf(V vertex);", "public static GeoPoint[] getPredecessorPointsForElement(final GeoElement element) {\n \tList<GeoPoint> points = new ArrayList<GeoPoint>(10);\n \n Iterator<GeoElement> it = element.getAllPredecessors().iterator();\n GeoElement el;\n while(it.hasNext()){\n el = it.next();\n if(el.isGeoPoint()){\n points.add((GeoPoint) el);\n }\n }\n return points.toArray(new GeoPoint[points.size()]);\n }", "public Collection<Vertex> adjacentVertices(Vertex v) {\n Vertex parameterVertex = new Vertex(v.getLabel());\n if(!myGraph.containsKey(parameterVertex)){\n throw new IllegalArgumentException(\"Vertex is not valid\");\n }\n\n //create a copy of the passed in vertex to restrict any reference\n //to interals of this class\n Collection<Vertex> adjVertices = new ArrayList<Vertex>();\n\n Iterator<Edge> edges = myGraph.get(parameterVertex).iterator();\n while(edges.hasNext()) {\n adjVertices.add(edges.next().getDestination());\n }\n return adjVertices;\n }", "public Set getAccessPathPredecessors() {\n if (field_predecessors == null) return Collections.EMPTY_SET;\n return field_predecessors;\n }", "public native VertexNode first();", "public Node predecessor(Node target){\n\t\tif(target.getLeft() != null)\n\t\t\t//if have left child, max of left is predecessor\n\t\t\treturn treeMax(target);\n\t\tNode parent = target.getParent();\n\t\twhile(parent != null && parent.getRight() != target){\n\t\t\t//loop until curNode is right child (>) of parent\n\t\t\ttarget = parent;\n\t\t\tparent = target.parent;\n\t\t}\n\t\treturn parent; //if null means no successor\n\t}", "public Vertex getNextVertex(List<Vertex> unvisitedNodes){\n Vertex smallest = null;\n for(Vertex vertex: unvisitedNodes){\n if(smallest==null)\n smallest = vertex;\n else if(distance.get(vertex)< distance.get(smallest))\n smallest = vertex;\n }\n return smallest;\n }", "public static GeoPoint[] getDependentPredecessorPointsForElement(final GeoElement element) {\n // Count points.\n \tList<GeoPoint> points = new ArrayList<GeoPoint>(10); // Lucky guess. \n \n Iterator<GeoElement> it = element.getAllPredecessors().iterator();\n \n GeoElement el;\n \n while(it.hasNext()){\n el = it.next();\n if(el.isGeoPoint() &&\n !el.isIndependent()){\n points.add((GeoPoint) el);\n }\n }\n \n if(element.isGeoPoint()) {\n points.add((GeoPoint) element);\n }\n \n return points.toArray(new GeoPoint[points.size()]);\n }", "@DISPID(123)\r\n\t// = 0x7b. The runtime will prefer the VTID if present\r\n\t@VTID(118)\r\n\tint predecessorID();", "public native VertexList insertBefore(VertexNode target, VertexNode vertex);", "public static void populateNeighbors(Vertex[] vertices)\r\n\t{\r\n\t\tfor(int i = 1; i < vertices.length; i++)\r\n\t\t{\r\n\t\t\tvertices[i].addNeighbor(vertices[i].getPredecessor());\r\n\t\t\tvertices[vertices[i].getPredecessor()].addNeighbor(i);\r\n\t\t}\r\n\t}", "private LinkedList<T> getUnvisitedNeighbors(T vertex){\n LinkedList<T> neighbors = getNeighbors(vertex);\n LinkedList<T> unvisitedNeighbors = new LinkedList<T>();\n \n for (T neighbor : neighbors){\n if (!visited.contains(neighbor)){\n unvisitedNeighbors.add(neighbor);\n }\n }\n return unvisitedNeighbors;\n }", "@Override\r\n public final Map<_Node, List<_Node>> getPredecessor(_Node end) throws RoutePlannerException\r\n {\r\n \treturn predecessors;\r\n }", "private void Visitar(Vertice v, int p) {\n\t\t\n\t\tv.setVisited(true);\n\t\tv.setPredecessor(p);\n\t\t\n\t\tLinkedList<ListaAdjacencia> L = v.getAdjList();\n\t\t\n\t\tfor (ListaAdjacencia node : L) {\n\t\t\tint n = node.getverticeNumero();\n\t\t\tif (!vertices[n].getVisited()) {\n\t\t\t\tVisitar(vertices[n], v.getIndex());\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public static void computePaths(Vertex source){\n\t\tsource.minDistance=0;\n\t\t//visit each vertex u, always visiting vertex with smallest minDistance first\n\t\tPriorityQueue<Vertex> vertexQueue=new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(source);\n\t\twhile(!vertexQueue.isEmpty()){\n\t\t\tVertex u = vertexQueue.poll();\n\t\t\tSystem.out.println(\"For: \"+u);\n\t\t\tfor (Edge e: u.adjacencies){\n\t\t\t\tVertex v = e.target;\n\t\t\t\tSystem.out.println(\"Checking: \"+u+\" -> \"+v);\n\t\t\t\tdouble weight=e.weight;\n\t\t\t\t//relax the edge (u,v)\n\t\t\t\tdouble distanceThroughU=u.minDistance+weight;\n\t\t\t\tif(distanceThroughU<v.minDistance){\n\t\t\t\t\tSystem.out.println(\"Updating minDistance to \"+distanceThroughU);\n\t\t\t\t\tv.minDistance=distanceThroughU;\n\t\t\t\t\tv.previous=u;\n\t\t\t\t\t//move the vertex v to the top of the queue\n\t\t\t\t\tvertexQueue.remove(v);\n\t\t\t\t\tvertexQueue.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "List<WeightedEdge<Vertex>> neighbors(Vertex v);", "@Override\r\n\tpublic void setPredecessor(VertexInterface<T> predecessor) {\n\r\n\t}", "public ArrayList<String> shortestPath(String u, String v)\n {\n ArrayList<String> path = new ArrayList<>();\n HashMap<String, Boolean> flag = new HashMap<>();\n HashMap<String, String> prev = new HashMap<>();\n\n Queue<GraphVertex> queue = new LinkedList<>();\n HashMap<String, Boolean> visited = new HashMap<>();\n\n GraphVertex src = graphVertexHashMap.get(u);\n flag.put(src.getVertexName(), true);\n queue.add(src);\n visited.put(src.getVertexName(), true);\n\n while(!queue.isEmpty()){\n GraphVertex node = queue.poll();\n\n HashMap<String, GraphVertex> edges = node.getOutDegrees();\n Iterator it = edges.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry pair = (Map.Entry)it.next();\n if(flag.get(pair.getKey()) == null || flag.get(pair.getKey()) == false){\n String vertex = (String)pair.getKey();\n flag.put(vertex, true);\n prev.put(vertex, node.getVertexName());\n queue.add(edges.get(pair.getKey()));\n }\n }\n\n }\n path = backTrackPath(prev, u, v);\n return path;\n }", "public List<Integer> neighbors(int vertex) {\r\n \tArrayList<Integer> vertices = new ArrayList<Integer>();\r\n \tLinkedList<Edge> testList = myAdjLists[vertex];\r\n int counter = 0;\r\n while (counter < testList.size()) {\r\n \tvertices.add(testList.get(counter).myTo);\r\n \tcounter++;\r\n }\r\n return vertices;\r\n }", "public Alloc getPredecessor() {\n return variant == null ? null : variant.getPredecessor(this);\n }", "public List<Vertex> getPathTo(int targetVertexPortnum){\n LinkedList<Vertex> path = new LinkedList<Vertex>();\n path.add(graph.getVertex(convertToString(targetVertexPortnum))); // use string version of the port num.\n \n while(targetVertexPortnum != this.initialVertexPortNum)\n {\n Vertex predecessor = graph.getVertex(this.predecessors.get(convertToString(targetVertexPortnum))); // use string version of the portnum.\n targetVertexPortnum = predecessor.getVertexPortNum(); // get the int representation of the vertex portnum.\n path.add(0, predecessor); // add the vertex to our shortest path.\n }\n \n return path; // return the shortest path to the target vertex.\n }", "@Override\r\n\tpublic ArrayList<Edge<E>> primMinimumSpanningTree(E src) {\r\n\t\tArrayList<Edge<E>> prim = new ArrayList<Edge<E>>();\r\n\t\tif(containsVertex(src)) {\r\n\t\t\tlastSrc = vertices.get(src);\r\n\t\t\tPriorityQueue<Vertex<E>> pq = new PriorityQueue<Vertex<E>>();\r\n\t\t\tvertices.forEach((E t, Vertex<E> u) -> {\r\n\t\t\t\tu.setDistance(Integer.MAX_VALUE);\r\n\t\t\t\tu.setColor(Color.WHITE);\r\n\t\t\t\tu.setPredecessor(null);\r\n\t\t\t\tpq.offer(u);\r\n\t\t\t});\r\n\t\t\tpq.remove(lastSrc);\r\n\t\t\tlastSrc.setDistance(0);\r\n\t\t\tpq.offer(lastSrc);\r\n\r\n\t\t\twhile(!pq.isEmpty()) {\r\n\t\t\t\tVertex<E> u = pq.poll();\r\n\t\t\t\tfor(Edge<E> ale : adjacencyLists.get(u.getElement())) {\r\n\t\t\t\t\tVertex<E> s = vertices.get(ale.getSrc());\r\n\t\t\t\t\tVertex<E> d = vertices.get(ale.getDst());\r\n\t\t\t\t\tif(d.getColor() == Color.WHITE && d.getDistance() > ale.getWeight()) {\r\n\t\t\t\t\t\tpq.remove(d);\r\n\t\t\t\t\t\tVertex<E> pred = d.getPredecessor();\r\n\t\t\t\t\t\tif(pred != null) { //remove the edge that has ale.dst as dst vertex\r\n\t\t\t\t\t\t\tEdge<E> edgeToRemove = new Edge<>(pred.getElement(), ale.getDst(), 1);\r\n\t\t\t\t\t\t\tprim.remove(edgeToRemove);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\td.setDistance(ale.getWeight());\r\n\t\t\t\t\t\td.setPredecessor(s);\r\n\t\t\t\t\t\tpq.offer(d);\r\n\t\t\t\t\t\tprim.add(ale);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tu.setColor(Color.BLACK);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn prim;\r\n\t}", "private List<Edge> getPath(Vertex source) {\n\t\tint [] predecessors = new ShortestPath().findShortestPath(this.residualNetwork, source);\n\t\tList<Edge> path = retrieveEdgesFromPredecessorArray(predecessors);\n\t\treturn path;\n\t}", "void Explore(int vertex){\n // first mark it as true as it has been visited\n visited[vertex]=true;\n\n //now make the pre at the counterPre index this vertex\n pre[counterPre] = vertex;\n // also increase the counterPre for next iteration\n counterPre+=1;\n\n // do exploration\n // using Iterator to iterate the adjList\n Iterator<Integer> i = adjList[vertex].listIterator();\n while(i.hasNext()){\n int ver = i.next();\n\n // check is it visited or not if not then again explore that ver\n if (visited[ver]==false){\n Explore(ver);\n }\n }\n }", "@Override\r\n\tpublic List<Node<T>> getPreOrderTraversal() {\r\n\t\tList<Node<T>> lista = new LinkedList<Node<T>>();// La lista para el\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// recursivo\r\n\t\treturn auxiliarRecorridoPre(raiz, lista);\r\n\t}", "private void depthFirstSearch(DirectedGraph graph, int vertex) {\r\n \r\n visited[vertex] = true;\r\n inRecursionStack[vertex] = true;\r\n \r\n for(int adjacentVertex: graph.adjacentVertices(vertex)) {\r\n if(inRecursionStack[adjacentVertex]) {\r\n throw new IllegalArgumentException(String.format(\"Graph contains a cycle: no topological sort possible: %s -> %s\", vertex, adjacentVertex));\r\n }\r\n \r\n if(!visited[adjacentVertex]) {\r\n depthFirstSearch(graph, adjacentVertex);\r\n }\r\n }\r\n\r\n reversePostOrder.push(vertex); \r\n inRecursionStack[vertex] = false;\r\n }", "public List<Gap> getPredecessors() {\n return this.resourcePredecessors;\n }", "public BitSet getAdjacentVertices(int vertex) {\n\t\treturn adjacencyMatrix[vertex];\n\t}", "private IAVLNode findPredecessor(IAVLNode node)\r\n\t{\r\n\t\t//minimum node has no predecessor\r\n\t\tif (node == minimum) \r\n\t\t\treturn null; \r\n\t\t\r\n\t\tif (node.getLeft().isRealNode()) \r\n\t\t\treturn maxPointer(node.getLeft()); \r\n\t\telse \r\n\t\t{\r\n\t\t\tIAVLNode parent = node.getParent();\r\n\t\t\twhile ((node == parent.getLeft())&&(parent != null)) \r\n\t\t\t{ \r\n\t\t\t\tnode = parent; \r\n \t\t\t\tparent = parent.getParent() ; \r\n\t\t\t}\r\n\t\t\treturn parent;\t\r\n\t\t}\r\n\t}", "public int predecessor(int node) {\n \n if (node < 0) {\n throw new IllegalArgumentException(\"node must \"\n + \"be greater than or equal to 0\");\n } else if (node > maxC) {\n throw new IllegalArgumentException(\"node must \"\n + \"be less than \" + maxC);\n }\n \n Integer nodeKey = Integer.valueOf(node);\n \n int nodeIndex = node/binSz;\n \n // the repr is stored in xft and it is always the minium for the bin\n boolean isAMinimum = xft.find(nodeKey) != null;\n \n /*\n if the node is not a minima, the answer is in\n the node's map if its size is larger > 1\n */\n \n TreeMap<Integer, Integer> map = getTreeMap(nodeIndex);\n \n if (!isAMinimum && (map.size() > 1)) {\n Entry<Integer, Integer> pred = map.lowerEntry(nodeKey);\n if (pred != null) {\n return pred.getKey().intValue();\n }\n }\n \n // else, predeccessor is in the closest bin < nodeIndex that has\n // items in it.\n \n Integer prev = xft.predecessor(nodeKey);\n if (prev == null) {\n return -1;\n }\n \n int prev0Index = prev.intValue()/binSz;\n \n map = getTreeMap(prev0Index);\n \n Entry<Integer, Integer> lastItem = map.lastEntry();\n \n if (lastItem == null) {\n return -1;\n }\n \n return lastItem.getKey();\n }", "Node predecessor(T value) {\n Node x = search(value);\n if (x.value.compareTo(value) < 0) return x;\n else return predecessor(x);\n }", "public RBNode<T> predecessor(RBNode<T> x) {\r\n //if current node have leftChild, then predecessor is the biggest node in a tree with the root of x.left\r\n if(x.left != null)\r\n return maxNode(x.left);\r\n //if x have no leftChild, there are two cases:\r\n //1. x is the rightChild of parent, then predecessor is parent\r\n //2. x is the leftChild of parent, then find parent, evaluate parent with these two cases again\r\n RBNode<T> p = x.parent;\r\n while((p != null) && (x == p.left)) { //case2\r\n x = p;\r\n p = x.parent;\r\n }\r\n return p; //case1\r\n }", "public Node findPredecessor(int id) {\n\t\tNode n = this;\n\t\twhile (id <= n.getId() || id > n.getSuccessor().getId()) {\n\t\t\tn = n.closestPrecedingFinger(id);\n\t\t}\n\t\treturn n;\n\t}", "@Override\n\tpublic List<Location> getNeighbors(Location vertex) {\n\n\t\tArrayList<Location> neighbors = new ArrayList<Location>();\n\n\t\tfor (Path p : getOutEdges(vertex))\n\t\t\tneighbors.add(p.getDestination());\n\n\t\treturn neighbors;\n\n\n\t}", "@Override\r\n public List<Vertex> getNeighbors(Vertex v) {\r\n ArrayList<Vertex> neighborsList = new ArrayList<>();\r\n neighborsList = adjacencyList.get(v);\r\n Collections.sort(neighborsList, Comparator.comparing(Vertex::getLabel));\r\n return neighborsList; //getting the list of all adjacent vertices of vertex v\r\n }", "public Iterable<DirectedEdge> pathTo(int v){\n\t\tvalidateVertex(v);\n\t\tif(!hasPathTo(v)) return null;\n\n\t\tLinkedStack<DirectedEdge> stack=new LinkedStack<>();\n\t\twhile(edgeTo[v]!=null){\n\t\t\tstack.push(edgeTo[v]);\n\t\t\tv=edgeTo[v].from();\n\t\t}\n\t\treturn stack;\n\t}", "Vertex getVertex(int index);", "void topologicalSort(Vertex vertex) {\n if (vertex.visited == false) {\n vertex.visited = true;\n for (Vertex neighbor : vertex.neighbors) {\n topologicalSort(neighbor);\n }\n stack.add(vertex);\n }\n }", "private ArrayList<SkipListNode<K>> findPredecessors(K value)\n {\n\t// Searches the SkipList for the node prior to the value for each list (levels 0 through height()-1)\n\t// Starts at head node and goes through each list, starting at height()-1\n\t// After each execution of the loop, starts searching for next predecessor at predecessor of the previous level \n\t\n \t//ArrayList that holds predecessor nodes\n\tArrayList<SkipListNode<K>> predecessors = new ArrayList<SkipListNode<K>>(height());\n\n\tSkipListNode<K> curr = head; //Current node being examined, initialized to head\n\n\t//Traverse each i-level list, starting at i = height()-1\n\tfor (int i = height()-1; i>=0; i--) {\n\t //While curr is not the last node in the i list and its next(i) reference is less than value, advance curr to its next(i) reference\n\t while (curr.next(i) != null && curr.next(i).data().compareTo(value) < 0) {\n\t\tcurr = curr.next(i); //curr.next(i) is a potential predecessor, so curr is set to it\n\t }\n\t //Once curr is the last node in the i list or its next(i) reference is >= value, add curr to predecessors at index i \n\t predecessors.add(0,curr); \n\t}\n\treturn predecessors; //Return predecessors list\n\t\n }", "private static List<Vertex> doDijkstra(List<Vertex> vertexes) {\n\n\t\t// Zok, we have a graph constructed. Traverse.\n\t\tPriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(me);\n\t\tme.setMinDistance(0);\n\n\t\twhile (!vertexQueue.isEmpty()) {\n\t\t\tVertex v = vertexQueue.poll();\n\t\t\tdouble distance = v.getMinDistance() + 1;\n\n\t\t\tfor (Vertex neighbor : v.getAdjacencies()) {\n\t\t\t\tif (distance < neighbor.getMinDistance()) {\n\t\t\t\t\tneighbor.setMinDistance(distance);\n\t\t\t\t\tneighbor.setPrevious(v);\n\t\t\t\t\tvertexQueue.remove(neighbor);\n\t\t\t\t\tvertexQueue.add(neighbor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn vertexes;\n\t}", "public final Rule getPredecessor() {\n //ELM: in again\n//\t\treturn null; // TODO by m.zopf: because of performance reasons return here just null\n return m_pred;\n }", "public java.util.List<Integer> getHamiltonianPath(V vertex);", "@Override\r\n\tpublic Iterable<Integer> pathTo(int v) {\r\n\t\tif (!hasPathTo(v)) return null;\r\n\r\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\r\n\t\twhile(v != -1) {\r\n\t\t\tlist.add(v);\r\n\t\t\tv = edgeTo[v];\r\n\t\t}\r\n\r\n\t\treturn list;\r\n\t}", "public LinkedList<Vertex> getPath(Vertex target) {\n LinkedList<Vertex> path = new LinkedList<Vertex>();\n Vertex step = target;\n // check if a path exists\n if (predecessors.get(step) == null) {\n return null;\n }\n path.add(step);\n while (predecessors.get(step) != null) {\n step = predecessors.get(step);\n path.add(step);\n }\n // Put it into the correct order\n Collections.reverse(path);\n return path;\n }", "protected BSTNode getPredecessorByNode(BSTNode n) {\n\t\tif (hasLeftChild(n)) {\n\t\t\treturn getMaximumChild(n.left);\n\t\t} else {\n\t\t\twhile (!isRoot(n) && isLeftChild(n)) {\n\t\t\t\tn = n.parent;\n\t\t\t\t_stats.incOtherTraversals();\n\t\t\t}\n\n\t\t\tif (isRoot(n)) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\treturn n.parent;\n\t\t\t}\n\t\t}\n\t}", "public static ImmutableSet<Worker<?, ?>> getAllPredecessors(Worker<?, ?> worker) {\n\t\tQueue<Worker<?, ?>> frontier = new ArrayDeque<>();\n\t\tfrontier.addAll(Workers.getPredecessors(worker));\n\t\tSet<Worker<?, ?>> closed = new HashSet<>(frontier);\n\t\twhile (!frontier.isEmpty()) {\n\t\t\tWorker<?, ?> cur = frontier.remove();\n\t\t\tfor (Worker<?, ?> w : Workers.getPredecessors(cur))\n\t\t\t\tif (!closed.contains(w)) {\n\t\t\t\t\tfrontier.add(w);\n\t\t\t\t\tclosed.add(w);\n\t\t\t\t}\n\t\t}\n\t\treturn ImmutableSet.copyOf(closed);\n\t}", "Vertex getVertex();", "int getShortestDistance(V vertex);", "public ProcessVertex getInVertex() {\n\t\treturn this.inVertex;\n\t}", "protected abstract List<Integer> getNeighbors(int vertex);", "public Iterable<Integer> pathTo(int v)\n {\n if (!hasPathTo(v)) return null;\n Stack<Integer> path = new Stack<Integer>();\n for (int x = v; x != s; x = edgeTo[x])\n path.push(x);\n path.push(s);\n return path;\n }", "public int getNextUnvisitedNeighbor (int v){\n for (int j=0; j<nVerts; j++) {\n if (adjMat[v][j] == 1 && vertextList[j].wasVisited == false) \n return j\n return -1; // none found\n }\n }", "public V getVertex(int index);", "public static int[] get(int vertex)\n {\n vertex -= 1;\n\n int tempConnectedVertices[] = new int[100000];\n\n int j = 0;\n\n for (int i = 0; i < n; i++)\n {\n if (connectMatrix[vertex][i] == 1)\n {\n tempConnectedVertices[j] = i + 1;\n j++;\n }\n }\n\n int connectedVertices[] = new int[j];\n\n for(int i = 0; i < j;i++)\n {\n connectedVertices[i] = tempConnectedVertices[i];\n\n }\n\n return connectedVertices;\n\n }", "private T getPredecessor (BSTNode<T> current) {\n\t\twhile(current.getRight() != null) {\n\t\t\tcurrent = current.getRight();\n\t\t}\n\t\treturn current.getData();\n\n\t}", "public void neighhbors(Village vertex) {\n\t\tIterable<Edge> neighbors = g.getNeighbors(vertex);\n\t\tSystem.out.println(\"------------\");\n\t\tSystem.out.println(\"vertex: \" + vertex.getName());\n\t\tfor(Edge e : neighbors) {\n\t\t\tSystem.out.println(\"edge: \" + e.getName());\n\t\t\tSystem.out.println(\"transit: \" + e.getTransit() + \" color: \" + e.getColor());\n\t\t}\n\t}", "private void computeShortestPath(){\n T current = start;\n boolean atEnd = false;\n while (!unvisited.isEmpty()&& !atEnd){\n int currentIndex = vertexIndex(current);\n LinkedList<T> neighbors = getUnvisitedNeighbors(current); // getting unvisited neighbors\n \n //what is this doing here???\n if (neighbors.isEmpty()){\n \n }\n \n // looping through to find distances from start to neighbors\n for (T neighbor : neighbors){ \n int neighborIndex = vertexIndex(neighbor); \n int d = distances[currentIndex] + getEdgeWeight(current, neighbor);\n \n if (d < distances[neighborIndex]){ // if this distance is less than previous distance\n distances[neighborIndex] = d;\n closestPredecessor[neighborIndex] = current; // now closest predecessor is current\n }\n }\n \n if (current.equals(end)){\n atEnd = true;\n }\n else{\n // finding unvisited node that is closest to start node\n T min = getMinUnvisited();\n if (min != null){\n unvisited.remove(min); // remove minimum neighbor from unvisited\n visited.add(min); // add minimum neighbor to visited\n current = min;\n }\n }\n }\n computePath();\n totalDistance = distances[vertexIndex(end)];\n }", "public Node getPredecessor(Node element) {\r\n\t\tNode predecessor = null;\r\n\t\tif (element.getLeftChild() != null) {\r\n\t\t\tpredecessor = element.getLeftChild();\r\n\t\t\tif (predecessor.getRightChild() == null) {\r\n\t\t\t\tpredecessor = element.getLeftChild();\r\n\t\t\t} else {\r\n\t\t\t\twhile (predecessor.getRightChild() != null) {\r\n\t\t\t\t\tpredecessor = predecessor.getRightChild();\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"No left sub tree\");\r\n\t\t\tif (element.isRoot()) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tpredecessor = element;\r\n\t\t\tSystem.out.println(\"-- \" + element.getKey());\r\n\t\t\tNode rightChild = predecessor.getParent().getRightChild();\r\n\t\t\tif (rightChild == null) {\r\n\t\t\t\trightChild = predecessor.getParent();\r\n\t\t\t}\r\n\t\t\twhile (!predecessor.getParent().equals(root) && !rightChild.equals(predecessor)) {\r\n\t\t\t\tSystem.out.println(\"In loop\");\r\n\t\t\t\tpredecessor = predecessor.getParent();\r\n\t\t\t\trightChild = predecessor.getParent().getRightChild();\r\n\t\t\t\tif (rightChild == null) {\r\n\t\t\t\t\trightChild = predecessor.getParent();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (predecessor.getParent().getKey() < predecessor.getKey()) {\r\n\t\t\t\tpredecessor = predecessor.getParent();\r\n\t\t\t} else {\r\n\t\t\t\t// element is the smallest, no predecessor\r\n\t\t\t\tpredecessor = null;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn predecessor;\r\n\t}", "@Override\r\n\tpublic boolean hasPredecessor() {\n\t\treturn false;\r\n\t}", "private static void computePaths(Vertex source) {\n source.minDistance = 0;\n // retrieves with log(n) time\n PriorityQueue<Vertex> vertexPriorityQueue = new PriorityQueue<>();\n\n //BFS traversal\n vertexPriorityQueue.add(source);\n\n // O((v + e) * log(v))\n while (!vertexPriorityQueue.isEmpty()) {\n // this poll always returns the shortest distance vertex at log(v) time\n Vertex vertex = vertexPriorityQueue.poll();\n\n //visit each edge exiting vertex (adjacencies)\n for (Edge edgeInVertex : vertex.adjacencies) {\n // calculate new distance between edgeInVertex and target\n Vertex targetVertex = edgeInVertex.target;\n double edgeWeightForThisVertex = edgeInVertex.weight;\n double distanceThruVertex = vertex.minDistance + edgeWeightForThisVertex;\n if (distanceThruVertex < targetVertex.minDistance) {\n // modify the targetVertex with new calculated minDistance and previous vertex\n // by removing the old vertex and add new vertex with updates\n vertexPriorityQueue.remove(targetVertex);\n targetVertex.minDistance = distanceThruVertex;\n // update previous with the shortest distance vertex\n targetVertex.previous = vertex;\n vertexPriorityQueue.add(targetVertex);// adding takes log(v) time because needs to heapify\n }\n }\n }\n }", "public ArrayList<Vertex> getNeighbours(Vertex vertex) {\r\n\t\tArrayList<Vertex> neighbours = new ArrayList<Vertex>();\r\n\t\tfor (Vertex vertexOfList : listVertex) {\r\n\r\n\t\t\tif (matrix.getEdges(vertex.getIdVertex(), vertexOfList.getIdVertex()) != null) {\r\n\t\t\t\tneighbours.add(vertexOfList);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn neighbours;\r\n\t}", "int[] primMST() {\n // Clone actual array\n int[][] graph = Arrays.stream(this.graph).map(int[]::clone).toArray(int[][]::new);\n\n // Array to store constructed MST\n int[] parent = new int[VERTICES];\n\n // Key values used to pick minimum weight edge in cut\n int[] key = new int[VERTICES];\n\n // To represent set of vertices included in MST\n Boolean[] mstSet = new Boolean[VERTICES];\n\n // Initialize all keys as INFINITE\n for (int i = 0; i < VERTICES; i++) {\n key[i] = Integer.MAX_VALUE;\n mstSet[i] = false;\n }\n\n // Always include first 1st vertex in MST.\n key[0] = 0; // Make key 0 so that this vertex is picked as first vertex\n parent[0] = -1; // zFirst node is always root of MST\n\n // The MST will have V vertices\n for (int count = 0; count < VERTICES - 1; count++) {\n // Pick thd minimum key vertex from the set of vertices\n // not yet included in MST\n int u = minKey(key, mstSet);\n\n // Add the picked vertex to the MST Set\n mstSet[u] = true;\n\n // Update key value and parent index of the adjacent\n // vertices of the picked vertex. Consider only those\n // vertices which are not yet included in MST\n for (int v = 0; v < VERTICES; v++)\n\n // graph[u][v] is non zero only for adjacent vertices of m\n // mstSet[v] is false for vertices not yet included in MST\n // Update the key only if graph[u][v] is smaller than key[v]\n if (graph[u][v] != 0 && mstSet[v] == false && graph[u][v] < key[v]) {\n parent[v] = u;\n key[v] = graph[u][v];\n }\n }\n\n return parent;\n }", "public List neighbors(int vertex) {\n // your code here\n \tList toReturn = new ArrayList<Integer>();\n \tfor (Edge e : myAdjLists[vertex]) {\n \t\ttoReturn.add(e.to());\n \t}\n return toReturn;\n }", "public abstract int[] getConnected(int vertexIndex);", "public E[] getNeighbours (E vertex) throws IllegalArgumentException\n {\n int index = this.indexOf (vertex);\n\n // Check if the vertex exists in the graph\n if (index < 0)\n throw new IllegalArgumentException (vertex + \" was not found!\");\n\n\n Node node = this.adjacencySequences[index];\n int countNeighbours = 0;\n while(node != null)\n {\n countNeighbours++;\n node = node.nextNode;\n }\n\n E[] neighbours = (E[]) new Object[countNeighbours];\n node = this.adjacencySequences[index];\n int neighbourIndex = 0;\n \n while(node != null)\n {\n neighbours[neighbourIndex++] = vertices[node.neighbourIndex];\n node = node.nextNode;\n }\n\n return neighbours;\n }", "private List<E> get(V vertex) {\n return this.data.getOrDefault(vertex, new BinarySearchTree<>()).getTreeByInOrder_depthFirst();\n }", "public List<Vertex> getShortestPathTo(Vertex target)\n {\n List<Vertex> path = new ArrayList<Vertex>();\n for (Vertex vertex = target; vertex != null; vertex = vertex.previous)\n path.add(vertex);\n Collections.reverse(path);\n return path;\n }", "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 Integer[][] makePredecessorMatrix(Double[][] aMatrix)\n {\n Integer pMatrix[][] = new Integer[aMatrix.length][aMatrix.length];\n\n for (int i = 0; i < pMatrix.length; i++)\n {\n for (int j = 0; j < pMatrix.length; j++)\n {\n pMatrix[i][j] = null;\n\n if (aMatrix[i][j] != null)\n {\n pMatrix[i][j] = i;\n }\n if (i == j)\n {\n pMatrix[i][j] = 0;\n }\n }\n }\n\n return pMatrix;\n }", "private NodoGrafo Vert2Nodo(int v) {\n\t\tNodoGrafo aux = origen;\n\t\twhile (aux != null && aux.nodo != v)\n\t\t\taux = aux.sigNodo;\t\t\n\t\treturn aux;\n\t}", "public void iterativeDfs(Graph graph, int sourceVertex) {\n\n stack.addLast(sourceVertex);\n\n while (!stack.isEmpty()) {\n int vertex = stack.removeLast();\n\n if (!marked[vertex]) {\n sourceVertexCount++;\n marked[vertex] = true;\n\n for (int adjacentVertex : graph.adj(vertex)) {\n if (!marked[adjacentVertex]) {\n stack.addLast(adjacentVertex);\n }\n }\n }\n }\n }", "Iterable<DirectedEdge> pathTo(int v)\n\t{\n\t\tStack<DirectedEdge> path=new Stack<>();\n\t\tfor(DirectedEdge e=edgeTo[v]; e!=null; e=edgeTo[e.from()])\n\t\t{\n\t\t\tpath.push(e);\n\t\t}\n\t\treturn path;\n\t}", "public List<Edge> breadthFirstTraverse(String v) {\n int start = indexOf(v);\n if (start == -1) return new LinkedList<>();\n\n List<Edge> path = new LinkedList<>();\n Queue<Integer> queue = new Queue<>();\n boolean[] visited = new boolean[vertexes.length];\n\n queue.enQueue(start);\n while(!queue.isEmpty()) {\n start = queue.deQueue();\n visited[start] = true;\n\n for (int i: this.heads[start]) {\n if (!visited[i]) { // not visited yet\n visited[i] = true;\n path.add(new Edge(start, i));\n\n queue.enQueue(i); // add to the queue for the next loop\n }\n }\n }\n\n return path;\n }", "void shortestPath( final VertexType fromNode, Integer node );", "public Collection< VKeyT > neighborKeys( VKeyT key )\n throws NoSuchVertexException;", "public Dijkstra(Graph graph, int firstVertexPortNum)\n {\n this.graph = graph;\n Set<String> vertexKeys = this.graph.vertexKeys();\n \n this.initialVertexPortNum = firstVertexPortNum;\n this.predecessors = new HashMap<String, String>();\n this.distances = new HashMap<String, Integer>();\n this.availableVertices = new PriorityQueue<Vertex>(vertexKeys.size(), new Comparator<Vertex>()\n {\n // compare weights of these two vertices.\n public int compare(Vertex v1, Vertex v2)\n {\n \t// errors are here.\n int weightOne = Dijkstra.this.distances.get(v1.convertToString(v1.getVertexPortNum())); // distances stored by portnum in string form.\n int weightTwo = Dijkstra.this.distances.get(v2.convertToString(v2.getVertexPortNum())); // distances stored by portnum in string form.\n return weightOne - weightTwo; // return the modified weight of the two vertices.\n }\n });\n \n this.visitedVertices = new HashSet<Vertex>();\n \n // for each Vertex in the graph\n for(String key: vertexKeys)\n {\n this.predecessors.put(key, null);\n this.distances.put(key, Integer.MAX_VALUE); // assuming that the distance of this is infinity.\n }\n \n \n //the distance from the initial vertex to itself is 0\n this.distances.put(convertToString(initialVertexPortNum), 0); \n \n //and seed initialVertex's neighbors\n Vertex initialVertex = this.graph.getVertex(convertToString(initialVertexPortNum)); // converted portnum to String to make this work.\n ArrayList<Edge> initialVertexNeighbors = initialVertex.getSquad();\n for(Edge e : initialVertexNeighbors)\n {\n Vertex other = e.getNeighbor(initialVertex);\n this.predecessors.put(convertToString(other.getVertexPortNum()), convertToString(initialVertexPortNum));\n this.distances.put(convertToString(other.getVertexPortNum()), e.getWeight()); // converted portnum to String to make this work.\n this.availableVertices.add(other); // add to available vertices.\n }\n \n this.visitedVertices.add(initialVertex); // add to list of visited vertices.\n \n // apply Dijkstra's algorithm to the overlay.\n processOverlay();\n \n }", "private Vector<String> headOfIncomingEdges(int layerID, String v) {\n \tVector<String> result = new Vector<String>();\n \t\n \tif (layerID == 0)\n \t\treturn result;\n \t\t\n \tVector<Edge> es = edges.get(layerID - 1);\n \t\n \tfor (Edge e : es) {\n \t\tif (e.getTail().equals(v))\n \t\t\tresult.add(e.getHead());\n \t}\n \t\n \treturn result;\n }", "public boolean addPredecessor(jq_Field m, Node n) {\n if (predecessors == null) predecessors = new LinkedHashMap();\n Object o = predecessors.get(m);\n if (o == null) {\n predecessors.put(m, n);\n return true;\n }\n if (o instanceof Set) return ((Set)o).add(n);\n if (o == n) return false;\n Set s = NodeSet.FACTORY.makeSet(); s.add(o); s.add(n);\n predecessors.put(m, s);\n return true;\n }", "private void traverseHelper(Graph<VLabel, ELabel>.Vertex v) {\n PriorityQueue<Graph<VLabel, ELabel>.Vertex> fringe =\n new PriorityQueue<Graph<VLabel,\n ELabel>.Vertex>(_graph.vertexSize(), _comparator);\n fringe.add(v);\n while (fringe.size() > 0) {\n Graph<VLabel, ELabel>.Vertex curV = fringe.poll();\n try {\n if (!_marked.contains(curV)) {\n _marked.add(curV);\n visit(curV);\n for (Graph<VLabel, ELabel>.Edge e: _graph.outEdges(curV)) {\n if (!_marked.contains(e.getV(curV))) {\n preVisit(e, curV);\n fringe.add(e.getV(curV));\n }\n }\n }\n } catch (StopException e) {\n _finalVertex = curV;\n return;\n }\n }\n }", "int[] primMST(float graph[][])\n {\n // Array to store constructed MST\n int parent[] = new int[V];\n \n // Key values used to pick minimum weight edge in cut\n float key[] = new float[V];\n \n // To represent set of vertices included in MST\n Boolean mstSet[] = new Boolean[V];\n \n // Initialize all keys as INFINITE\n for (int i = 0; i < V; i++) {\n key[i] = Integer.MAX_VALUE;\n mstSet[i] = false;\n }\n \n // Always include first 1st vertex in MST.\n key[0] = 0; // Make key 0 so that this vertex is\n // picked as first vertex\n parent[0] = 0; // First node is always root of MST\n \n // The MST will have V vertices\n for (int count = 0; count < V - 1; count++) {\n // Pick thd minimum key vertex from the set of vertices\n // not yet included in MST\n int u = minKey(key, mstSet);\n \n // Add the picked vertex to the MST Set\n mstSet[u] = true;\n \n // Update key value and parent index of the adjacent\n // vertices of the picked vertex. Consider only those\n // vertices which are not yet included in MST\n for (int v = 0; v < V; v++)\n \n // graph[u][v] is non zero only for adjacent vertices of m\n // mstSet[v] is false for vertices not yet included in MST\n // Update the key only if graph[u][v] is smaller than key[v]\n if (graph[u][v] != 0 && mstSet[v] == false && graph[u][v] < key[v]) {\n parent[v] = u;\n key[v] = graph[u][v];\n }\n }\n return parent;\n }", "private T getPredecessor(BSTNode<T> current) {\n while (current.getRight() != null) {\n current = current.getRight();\n }\n return current.getData();\n }", "public static int countPredecessorsPoints(final GeoElement el) {\n Iterator<GeoElement> it = el.getAllPredecessors().iterator();\n int count = 0;\n GeoElement element;\n while(it.hasNext()) {\n element = it.next();\n if(element.isGeoPoint()) count++;\n }\n return count;\n }", "void prim(AdjacencyLists g, int start)\r\n\t{\r\n\t\t// whether the node is in the tree or not.\r\n\t\tboolean[] intree = new boolean[g.nvertices];\r\n\t\t\r\n\t\t// the cost of adding the edge to the tree\r\n\t\tint[] distance = new int[g.nvertices];\r\n\t\t\r\n\t\tint[] parent = new int[g.nvertices]; \r\n\t\t\r\n\t\tfor (int i = 0; i < g.nvertices; ++i) {\r\n\t\t\tintree[i] = false;\r\n\t\t\tdistance[i] = Integer.MAX_VALUE;\r\n\t\t\tparent[i] = -1;\r\n\t\t}\r\n\t\t\r\n\t\tdistance[start] = 0;\r\n\t\t\r\n\t\t// current vertex to process\r\n\t\tint v = start;\r\n\t\t// candidate next vertex\r\n\t\tint w; \r\n\t\t// edge weight\r\n\t\tint weight;\r\n\t\t// best current distance from start\r\n\t\tint dist;\r\n\t\t\r\n\t\twhile (!intree[v]) {\r\n\t\t\tintree[v] = true;\r\n\t\t\t\r\n\t\t\tEdgeNode p = g.edges[v];\r\n\t\t\t\r\n\t\t\t// for each node w that is not in the tree\r\n\t\t\t// identify the lowest cost\r\n\t\t\twhile (p != null) {\r\n\t\t\t\tw = p.y;\r\n\t\t\t\tweight = p.weight;\r\n\t\t\t\tif (!intree[w] && distance[w] > weight) {\r\n\t\t\t\t\t// pick the edge that is lowest cost from v.\r\n\t\t\t\t\tdistance[w] = weight;\r\n\t\t\t\t\tparent[w] = v;\r\n\t\t\t\t}\r\n\t\t\t\tp = p.next;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// find the node that is not in the list, \r\n\t\t\t// and has the smallest distance value.\r\n\t\t\tv = 0;\r\n\t\t\tdist = Integer.MAX_VALUE;\r\n\t\t\tfor (int i = 0; i < g.nvertices; ++i) {\r\n\t\t\t\tif (!intree[i] && dist > distance[i]) {\r\n\t\t\t\t\tdist = distance[i];\r\n\t\t\t\t\tv = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Collection<V> getOtherVertices(V v);", "private List<Edge<T>> getPath(T target) {\n List<Edge<T>> path = new LinkedList<>();\n T step = target;\n // check if a path exists\n if (predecessors.get(step) == null) {\n return path;\n }\n while (predecessors.get(step) != null) {\n T endVertex = step;\n step = predecessors.get(step);\n T startVertex = step;\n path.add(getEdge(startVertex, endVertex));\n }\n // Put it into the correct order\n Collections.reverse(path);\n return path;\n }" ]
[ "0.7525325", "0.7290376", "0.67301184", "0.6464027", "0.6358294", "0.6339367", "0.63155735", "0.62923807", "0.626771", "0.6200703", "0.61491203", "0.6145463", "0.6126974", "0.6024009", "0.59732574", "0.59348655", "0.5909238", "0.5886378", "0.57728267", "0.57605594", "0.574541", "0.574078", "0.5677498", "0.56686294", "0.56631464", "0.56561", "0.5639813", "0.5634876", "0.5631583", "0.5622278", "0.56208986", "0.56157047", "0.5586875", "0.55842704", "0.55549294", "0.55406576", "0.552655", "0.5510387", "0.55031043", "0.5495487", "0.54880553", "0.5488032", "0.54839915", "0.54741335", "0.547027", "0.54671264", "0.5458604", "0.54532623", "0.544813", "0.54371226", "0.5426597", "0.541179", "0.54086775", "0.5374861", "0.53559387", "0.5352397", "0.53498286", "0.5327346", "0.53184026", "0.5316231", "0.5312545", "0.5312276", "0.53110623", "0.5309141", "0.53046095", "0.5299407", "0.5289388", "0.5273294", "0.5262087", "0.5260462", "0.5253647", "0.52455825", "0.5241638", "0.52344704", "0.5231371", "0.5217891", "0.52170604", "0.52096874", "0.5197833", "0.5197043", "0.5195386", "0.5184279", "0.5168014", "0.5159448", "0.5152721", "0.5145155", "0.5137034", "0.5134025", "0.51322365", "0.51210016", "0.5116565", "0.51113415", "0.5106541", "0.5104008", "0.5094546", "0.50930756", "0.5077671", "0.50725985", "0.50603414", "0.5060185" ]
0.55777323
34
Looks up if the end vertex is in Post(start)
public boolean reachable(Vertex start, Vertex end){ Set<Vertex> reach = this.post(start); return reach.contains(end); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean hasEdge(T beg, T end);", "public boolean hasEdge(T begin, T end);", "boolean hasEndPosition();", "boolean hasEndPosition();", "@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 }", "boolean hasIsBoundaryNodeOf();", "public abstract boolean hasEdge(int from, int to);", "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 }", "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 boolean contains(Index position) { // TODO rename: adjoinsOrContains\n return position != null && position.getX() + 1 >= start.getX() && position.getY() + 1 >= start.getY() && position.getX() <= end.getX() && position.getY() <= end.getY();\n }", "public boolean containsEdge(V head, V tail);", "private boolean isNearToEndPosition() {\n switch (direction) {\n case UP:\n return posY <= endPosition;\n case DOWN:\n return posY >= endPosition;\n case LEFT:\n return posX <= endPosition;\n case RIGHT:\n return posX >= endPosition;\n }\n throw new RuntimeException(\"Unknown position\");\n }", "boolean hasIsVertexOf();", "public boolean containsEdge(String start, String end) {\n\t\tif (!isLocked(end))\n\t\t\treturn false;\n\t\tif (containsVertex(start) && containsVertex(end) && adj_list.get(start) != null) {\n\t\t\tList<String> list = adj_list.get(start);\n\t\t\tif (list.contains(end))\n\t\t\t\treturn true;\n\t\t} else {\n\n\t\t}\n\t\treturn false;\n\t}", "public boolean hasEdge(Node k){\n for(int i = 0; i<edges.size(); i++){\n Edge edge = edges.get(i);\n if(edge.end() == k){\n return true;\n }\n }\n return false;\n }", "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 addEdge(T beg, T end);", "public boolean pathExists(int startVertex, int stopVertex) {\n// your code here\n ArrayList<Integer> fetch_result = visitAll(startVertex);\n if(fetch_result.contains(stopVertex)){\n return true;\n }\n return false;\n }", "public boolean isInEdge(int width, int height, Position position);", "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 }", "private boolean hasHitEdge() {\n if (!enableClusterExitPurging) {\n return false;\n }\n int lx = (int) location.x, ly = (int) location.y;\n int sx = chip.getSizeX(), sy = chip.getSizeY();\n if (lx < radiusX || lx > sx - radiusX || ly < radiusY || ly > sy - radiusY) {\n if (hitEdgeTime == 0) {\n hitEdgeTime = getLastEventTimestamp();\n return false;\n } else {\n if (getLastEventTimestamp() - hitEdgeTime > 0/* getClusterLifetimeWithoutSupportUs()*/) {\n return true;\n } else {\n return false;\n }\n }\n }\n return false;\n }", "public Set<Vertex> post(Vertex start){\n\t\tSet<Vertex> reach = new HashSet<Vertex>();\n\t\tif(this.edgesByStart.get(start) == null)\n\t\t\treturn reach;\n\t\tfor(LabeledEdge trans : this.edgesByStart.get(start)){\n\t\t\treach.add(trans.getEnd());\n\t\t}\n\t\treturn reach;\n\t\t\n\t}", "boolean hasDestRange();", "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 }", "public boolean contains(Vector pt) {\r\n final double x = pt.getX();\r\n final double y = pt.getY();\r\n final double z = pt.getZ();\r\n return x >= this.getMinimumPoint().getBlockX() && x < this.getMaximumPoint().getBlockX() + 1\r\n && y >= this.getMinimumPoint().getBlockY() && y < this.getMaximumPoint().getBlockY() + 1\r\n && z >= this.getMinimumPoint().getBlockZ() && z < this.getMaximumPoint().getBlockZ() + 1;\r\n }", "public static boolean recursiveFindPath(Edge edge, Shape end) {\n\t\tif (edge.getDest() instanceof JoinPoint) {\n\t\t\tif (recursiveFindPath((Edge) ((JoinPoint)edge.getDest()).getDest(), end)) {\n\t\t\t\tedge.setColor(Color.green);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if (edge.getDest().equals(end)) {\n\t\t\tedge.setColor(Color.green);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean hitTarget(MouseEvent e) {\n\t\treturn (e.getX() > coord.x && e.getX() < endCoord.x && e.getY() > coord.y && e.getY() < endCoord.y);\n\t}", "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}", "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}", "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 }", "public boolean areAdjacent(Position vp, Position wp) throws InvalidPositionException;", "boolean isSetEndPosition();", "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 }", "boolean checkIfValidToCreate(int start, int end) {\n return myMarkerTree.processOverlappingWith(start, end, region->{\n int rStart = region.getStartOffset();\n int rEnd = region.getEndOffset();\n if (rStart < start) {\n if (region.isValid() && start < rEnd && rEnd < end) {\n return false;\n }\n }\n else if (rStart == start) {\n if (rEnd == end) {\n return false;\n }\n }\n else {\n if (rStart > end) {\n return true;\n }\n if (region.isValid() && rStart < end && end < rEnd) {\n return false;\n }\n }\n return true;\n });\n }", "public boolean adjoinsEclusive(Rectangle rectangle) {\n int startX = Math.max(start.getX(), rectangle.start.getX());\n int startY = Math.max(start.getY(), rectangle.start.getY());\n\n int endX = Math.min(end.getX(), rectangle.end.getX());\n int endY = Math.min(end.getY(), rectangle.end.getY());\n\n return startX < endX && startY < endY;\n }", "public boolean inGoalRegion() {\n return position >= GOAL_POSITION;\n }", "@Override\n\tpublic boolean contains(Vec2f pnt) {\n\t\tboolean isIn = false;\n\t\tif (_shape != null) {\n\t\t\tisIn = _shape.contains(pnt);\n\t\t}\n\t\treturn isIn;\n\t}", "@Override\n public boolean hasEdge(V from, V to)\n {\n if (from.equals(null) || to.equals(null)){\n throw new IllegalArgumentException();\n }\n if (!contains(from)){\n return false;\n }\n else{\n Iterator graphIterator = graph.entrySet().iterator();\n Map.Entry graphElement = (Map.Entry) graphIterator.next();\n V vert = (V) graphElement.getKey();\n while (graphIterator.hasNext() && vert != from){\n graphElement = (Map.Entry) graphIterator.next();\n vert = (V)graphElement.getKey();\n }\n\t ArrayList <V> edges = graph.get(vert);\n\t return edges.contains(to);\n\t }\n }", "boolean containsSpecifiedEnd(AssociationEnd specifiedEnd);", "@Override\r\n protected boolean isGoal(Point node) {\r\n return (node.equals(finish));\r\n }", "boolean hasIsMidNode();", "boolean inBoundingBox(Coord pos) {\n\t\treturn min(from.x, to.x) <= pos.x && pos.x <= max(from.x, to.x)\n\t\t\t\t&& min(from.y, to.y) <= pos.y && pos.y <= max(from.y, to.y);\n\t}", "boolean contains(Edge edge);", "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}", "boolean hasSegment();", "boolean isEndInclusive();", "boolean hasSegments();", "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 boolean isInBoundaries() {\n\t return Referee.playfield.isInBoundaries(this);\n }", "private static boolean hasVisibleRegion(int begin,int end,int first,int last) {\n return (end > first && begin < last);\n }", "public abstract boolean hasMapped(Edge queryEdge);", "public boolean hasEdge(Edge e) {\n for (Edge outEdge : outEdges) {\n if (outEdge.equals(e) && e.getTo() == outEdge.getTo()) {\n return true;\n }\n }\n return false;\n }", "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 }", "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 void finish(){\n //check start vertex is valid for given algorithm\n }", "static int getExitAxis(S2Point n) {\n // assert (intersectsFace(n));\n if (intersectsOppositeEdges(n)) {\n // The line passes through opposite edges of the face.\n // It exits through the v=+1 or v=-1 edge if the u-component of N has a\n // larger absolute magnitude than the v-component.\n return (Math.abs(n.x) >= Math.abs(n.y)) ? 1 : 0;\n } else {\n // The line passes through two adjacent edges of the face.\n // It exits the v=+1 or v=-1 edge if an even number of the components of N\n // are negative. We test this using signbit() rather than multiplication\n // to avoid the possibility of underflow.\n // assert(n.x != 0 && n.y != 0 && n.z != 0);\n return ((n.x < 0) ^ (n.y < 0) ^ (n.z < 0)) ? 0 : 1;\n }\n }", "public abstract boolean getEdge(Point a, Point b);", "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 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: */ }", "@Override\n\tpublic Boolean isEnd() {\n\t\tfor (int i = 0;i < grid.length;i++){\n\t\t\tfor (int j = 0;j < grid.length;j++){\n\t\t\t\tif(grid[i][j] == null){\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}", "boolean contains( Geometry gmo );", "public boolean pathExists(int startVertex, int stopVertex) {\n // your code here\n \tIterator iter = new DFSIterator(startVertex);\n \tInteger i = stopVertex;\n \twhile (iter.hasNext()) {\n \t\tif (iter.next().equals(i)) {\n \t\t\treturn true;\n \t\t}\n \t}\n return false;\n }", "public boolean reachableWith(Vertex start, Vertex end, Action act){\n\t\tSet<LabeledEdge> reach = edgesByStart.get(start);\n\t\tif(reach.contains(new LabeledEdge(start, end, act)))\n\t\t\treturn true;\n\t\tif(start.equals(end) && act.equals(Action.TAU))\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean isDestination(Node node)\r\n {\r\n if(node == End)\r\n return true;\r\n else \r\n return false;\r\n }", "public boolean isAdjacentTo(final Vertex other){\n\t\tboolean result = false;\n\t\tif(getNeighbours().contains(other))\n\t\t\tresult = true;\n\t\treturn result;\n\t}", "public isWithin() {\n\t\tsuper();\n\t}", "public static boolean isSequence(double start, double mid, double end)\r\n/* 140: */ {\r\n/* 141:324 */ return (start < mid) && (mid < end);\r\n/* 142: */ }", "public boolean hasVertex(T vert);", "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 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 isConnectedWith(Shapes shape){\n if(this.endShapes.length == 2){\n if(endShapes[0].equals(shape) || endShapes[1].equals(shape)){\n return true;\n }\n return false; \n }else{\n return false;\n }\n }", "public boolean contains(Point2D.Double p) {\n if(p.x <= middle.x + length/2.0 &&\n p.x >= middle.x - length/2.0 &&\n p.y <= middle.y + length/2.0 &&\n p.y >= middle.y - length/2.0) return true;\n else return false;\n }", "public boolean isUndefined(Address start, Address end);", "boolean hasTargetPos();", "public boolean adjoins(Rectangle rectangle) {\n int startX = Math.max(start.getX(), rectangle.start.getX());\n int startY = Math.max(start.getY(), rectangle.start.getY());\n\n int endX = Math.min(end.getX(), rectangle.end.getX());\n int endY = Math.min(end.getY(), rectangle.end.getY());\n\n return startX <= endX && startY <= endY;\n }", "public static Predicate<BiomeSelectionContext> foundInTheEnd() {\n\t\treturn context -> context.canGenerateIn(DimensionOptions.END);\n\t}", "private final boolean hasTautExit(int vFrom, int vTo, int currentLevel) {\n int x1 = xPositions[vFrom];\n int y1 = yPositions[vFrom];\n int x2 = xPositions[vTo];\n int y2 = yPositions[vTo];\n\n int nOutgoingEdges = nOutgoingEdgess[vTo];\n int[] outgoingEdges = outgoingEdgess[vTo];\n int[] outgoingEdgeIndexes = outgoingEdgeIndexess[vTo];\n for (int j=0;j<nOutgoingEdges;++j) {\n if (edgeLevels[outgoingEdgeIndexes[j]] < currentLevel) continue;\n int v3 = outgoingEdges[j];\n int x3 = xPositions[v3];\n int y3 = yPositions[v3];\n if (graph.isTaut(x1,y1,x2,y2,x3,y3)) return true;\n }\n return false;\n }", "private boolean search(Clique clique) {\n if (null != listener) {\n listener.visited(clique);\n }\n\n Set<Clique> neighbors = joinTree.neighbors(clique);\n if (null == neighbors || neighbors.size() == 0) {\n return false;\n }\n\n if (neighbors.contains(stop)) {\n return true;\n } else {\n seen.add(clique);\n for (Clique neighbor : neighbors) {\n if (!seen.contains(neighbor)) {\n if (search(neighbor)) {\n return true;\n }\n }\n }\n }\n\n return false;\n }", "@JsMethod(name = \"interiorContainsPoint\")\n public boolean interiorContains(double p) {\n return p > lo && p < hi;\n }", "boolean hasIsPartOf();", "protected boolean planEndNode(SearchNode node) {\n\n\tif (gc.satisfies(node.s.s)) {\n\t return true;\n\t}\n\n\treturn false;\n\n }", "public static <T> boolean routeBetween2NodesBFS(MyGraph<T> graph, MyNode<T> start, MyNode<T> end) {\n if (start == end) return true;\n LinkedList<MyNode<T>> queue = new LinkedList<>();\n queue.add(start);\n while (!queue.isEmpty()) {\n MyNode<T> u = queue.removeFirst();\n if (u != null) {\n for (MyNode<T> node : u.getAdjacent()) {\n if (node.getState() == State.Unvisited) {\n if (node == end) {\n return true;\n } else {\n node.setState(State.Visiting);\n queue.add(node);\n }\n }\n }\n\n }\n }\n return false;\n }", "public boolean 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 boolean endPoint(Point a) {\n\t\tint TetanggaHitam = 0;\r\n\t\tfor (int i = 0; i < Pos.length; i++) {\r\n\t\t\tif (safeGet(binaryImage, a.x + (int) Pos[i].getX(), a.y + (int) Pos[i].getY()) == 1)\r\n\t\t\t\tTetanggaHitam += 1;\r\n\t\t\tif (TetanggaHitam > 1)\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\tif (TetanggaHitam == 1)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "boolean hasMid();", "boolean hasMid();", "public boolean containsEdge(V source, V target);", "public boolean isEmbracedBy (Point top,\r\n Point bottom)\r\n {\r\n for (TreeNode node : getNotes()) {\r\n Note note = (Note) node;\r\n Point center = note.getCenter();\r\n\r\n if ((center.y >= top.y) && (center.y <= bottom.y)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "@Override\n\t\tpublic boolean isStopNode(TraversalPosition tp) {\n\t\t\t// System.out.println( \"\\nVisited nodes: \" + count++);\n\t\t\tStop currentStop = cache.get(tp.currentNode());\n\t\t\tif (currentStop.getStation().equals(dest)) {\n\t\t\t\treturn true;\n\t\t\t} else if ((currentStop.getTime() > stopTime))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "boolean isDrawInterior(DrawContext dc, Object shape);", "private boolean withinGridDimensions(int startX, int startY, int endX, int endY) {\n boolean within = true;\n int largerX = Math.max(startX, endX);\n int smallerX = Math.min(startX, endX);\n int largerY = Math.max(startY, endY);\n int smallerY = Math.min(startY, endY);\n \n if (smallerX < 1 || smallerY < 1 || largerX > GRID_DIMENSIONS || largerY > GRID_DIMENSIONS) {\n within = false;\n }\n \n return within;\n }", "private boolean isValid(AStarNode start, AStarNode end) {\n boolean check = true;\n for (Obstacle obs : getObstacles()) {\n if (isOnTheWay(start, end, obs))\n check = false;\n }\n return check;\n }", "public boolean 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 }", "private boolean hasANeighbour(Graph<V, E> g, Set<V> set, V v)\n {\n return set.stream().anyMatch(s -> g.containsEdge(s, v));\n }", "public boolean checkValidSelection(Point start, Point end){\n \t\tboolean flag = false;\n \t\tif (start.x == end.x) {\n \t\t\tflag = true;\n \t\t}\n \t\telse if (start.y == end.y) {\n \t\t\tflag = true;\n \t\t}\n \t\telse if ((start.x - start.y) == (end.x - end.y)) {\n \t\t\tflag = true;\n \t\t}\n \t\telse if ((start.x + start.y) == (end.x + end.y)) {\n \t\t\tflag = true;\n \t\t}\n \t\treturn flag;\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 }", "public abstract boolean isUsing(Edge graphEdge);", "boolean isEmpty() {\n return (bottom < top.getReference());\n }", "protected final boolean computeHasNext() {\n return this.getEnds().getGraph().getSuccessorEdges(this.getNext()).isEmpty();\n }", "public boolean hasNeighbours() {\n\t\tif (this.eltZero != null || this.eltOne != null || this.eltTwo != null)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}" ]
[ "0.67391306", "0.6681366", "0.62574464", "0.62574464", "0.6089036", "0.6049378", "0.593453", "0.5922778", "0.5919012", "0.5911264", "0.5869047", "0.58513314", "0.58410865", "0.58155566", "0.5810965", "0.5797043", "0.5781526", "0.5768324", "0.57462305", "0.57101476", "0.5668443", "0.56526613", "0.5648779", "0.5617903", "0.55969083", "0.5595407", "0.5585534", "0.55602413", "0.55537605", "0.5551831", "0.5550495", "0.55363804", "0.5526359", "0.55028343", "0.55006075", "0.54963255", "0.5476044", "0.5457212", "0.54491884", "0.54491526", "0.54456425", "0.54413784", "0.5434526", "0.5428893", "0.5427589", "0.5419164", "0.541605", "0.54154974", "0.5404498", "0.54006016", "0.5397943", "0.5394241", "0.53799707", "0.53657496", "0.53599226", "0.5348807", "0.53387743", "0.53357714", "0.5329912", "0.5326933", "0.5326844", "0.5323634", "0.53201807", "0.5319088", "0.531183", "0.531183", "0.52963346", "0.5293614", "0.52793276", "0.5276739", "0.52693266", "0.52585644", "0.52573574", "0.52516574", "0.5246948", "0.52453834", "0.52333564", "0.5218328", "0.5215351", "0.5215296", "0.52128214", "0.5210721", "0.52088445", "0.52022755", "0.5201918", "0.5201918", "0.5199569", "0.5188167", "0.5185233", "0.51813805", "0.51763326", "0.51750267", "0.5170715", "0.5170589", "0.51585287", "0.514175", "0.51379573", "0.5133816", "0.51324546", "0.51313007" ]
0.7181144
0
Looks up if the end vertex is in Post(start) and can be reached with Action act
public boolean reachableWith(Vertex start, Vertex end, Action act){ Set<LabeledEdge> reach = edgesByStart.get(start); if(reach.contains(new LabeledEdge(start, end, act))) return true; if(start.equals(end) && act.equals(Action.TAU)) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean reachable(Vertex start, Vertex end){\n\t\tSet<Vertex> reach = this.post(start); \n\t\treturn reach.contains(end);\n\t}", "@Override\r\n protected boolean isGoal(Point node) {\r\n return (node.equals(finish));\r\n }", "public void finish(){\n //check start vertex is valid for given algorithm\n }", "public Set<Vertex> post(Vertex start){\n\t\tSet<Vertex> reach = new HashSet<Vertex>();\n\t\tif(this.edgesByStart.get(start) == null)\n\t\t\treturn reach;\n\t\tfor(LabeledEdge trans : this.edgesByStart.get(start)){\n\t\t\treach.add(trans.getEnd());\n\t\t}\n\t\treturn reach;\n\t\t\n\t}", "public boolean hitTarget(MouseEvent e) {\n\t\treturn (e.getX() > coord.x && e.getX() < endCoord.x && e.getY() > coord.y && e.getY() < endCoord.y);\n\t}", "boolean hasEndPosition();", "boolean hasEndPosition();", "public boolean hasEdge(T begin, T end);", "@Override\r\n public boolean breadthFirstSearch(T start, T end) {\r\n Vertex<T> startV = vertices.get(start);\r\n Vertex<T> endV = vertices.get(end);\r\n\r\n Queue<Vertex<T>> queue = new LinkedList<Vertex<T>>();\r\n Set<Vertex<T>> visited = new HashSet<>();\r\n\r\n queue.add(startV);\r\n visited.add(startV);\r\n\r\n while(queue.size() > 0){\r\n Vertex<T> next = queue.poll();\r\n if(next == null){\r\n continue;\r\n }\r\n if(next == endV){\r\n return true;\r\n }\r\n\r\n for (Vertex<T> neighbor: next.getNeighbors()){\r\n if(!visited.contains(neighbor)){\r\n visited.add(neighbor);\r\n queue.add(neighbor);\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }", "public boolean hasEdge(T beg, T end);", "public boolean inGoalRegion() {\n return position >= GOAL_POSITION;\n }", "public boolean pathExists(int startVertex, int stopVertex) {\n// your code here\n ArrayList<Integer> fetch_result = visitAll(startVertex);\n if(fetch_result.contains(stopVertex)){\n return true;\n }\n return false;\n }", "public boolean compute() {\n\t\tif(this.startNode.equals(goalNode)) {\r\n\t\t\tSystem.out.println(\"Goal Node Found :)\");\r\n\t\t\tSystem.out.println(startNode);\r\n\t\t}\r\n\t\r\n\t\tQueue<Node> queue = new LinkedList<>();\r\n\t\tArrayList<Node> explored = new ArrayList<>();\r\n\t\tqueue.add(this.startNode);\r\n\t\texplored.add(startNode);\r\n\t\t\r\n\t\t//while queue is not empty\r\n\t\twhile(!queue.isEmpty()) {\r\n\t\t\t//remove and return the first node in the queue\r\n\t\t\tNode current = queue.remove();\r\n\t\t\tif(current.equals(this.goalNode)) {\r\n\t\t\t\tSystem.out.println(\"Explored: \" + explored + \"\\nQueue: \" + queue);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//dead end\r\n\t\t\t\tif(current.getChildren().isEmpty()){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t//add to queue the children of the current node\r\n\t\t\t\telse {\r\n\t\t\t\t\tqueue.addAll(current.getChildren());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\texplored.add(current);\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static <T> boolean routeBetween2NodesBFS(MyGraph<T> graph, MyNode<T> start, MyNode<T> end) {\n if (start == end) return true;\n LinkedList<MyNode<T>> queue = new LinkedList<>();\n queue.add(start);\n while (!queue.isEmpty()) {\n MyNode<T> u = queue.removeFirst();\n if (u != null) {\n for (MyNode<T> node : u.getAdjacent()) {\n if (node.getState() == State.Unvisited) {\n if (node == end) {\n return true;\n } else {\n node.setState(State.Visiting);\n queue.add(node);\n }\n }\n }\n\n }\n }\n return false;\n }", "private void backTrack(String start, AdjVertex end, Vertex parent){\r\n\t\tif(parent.name.compareToIgnoreCase(start) == 0){ \r\n\t\t\t//if we have found our way back to the start, then we print the result\r\n\t\t\tif(pathStack.isEmpty()){\r\n\t\t\t\tSystem.out.println(start + \" -- \" + end.name);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.print(start + \" -- \" + end.name);\r\n\t\t\t\twhile(!pathStack.isEmpty()){\r\n\t\t\t\t\tSystem.out.print(\" -- \" + pathStack.pop());\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//if we still have to find our way back to the first person,\r\n\t\t//we push the end name into the stack, \r\n\t\telse{ \r\n\t\t\tpathStack.push(end.name);\r\n\t\t\tconnector(start, parent.name);\r\n\t\t}\r\n\t}", "private boolean isNearToEndPosition() {\n switch (direction) {\n case UP:\n return posY <= endPosition;\n case DOWN:\n return posY >= endPosition;\n case LEFT:\n return posX <= endPosition;\n case RIGHT:\n return posX >= endPosition;\n }\n throw new RuntimeException(\"Unknown position\");\n }", "public abstract boolean hasEdge(int from, int to);", "private void thinkAboutNext(ArrayList<Point> pos, boolean hit, boolean destroyedIt) {\n if (!searching && hit) {\n betweenTwo = false;\n System.out.println(\"WAS A NEW TARGET\");\n if(!destroyedIt) {\n int[] d = Direction.DOWN.getDirectionVector();\n Point n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.DOWN);\n\n d = Direction.UP.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.UP);\n\n d = Direction.LEFT.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.LEFT);\n\n d = Direction.RIGHT.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.RIGHT);\n\n directionLooking = directionsToGo.get(directionsToGo.size() - 1);\n }\n }\n else if (searching) {\n //FILTER OUT ALREADY ATTACKED\n\n System.out.println(\"WAS AN OLD TARGET\");\n\n //FAILED\n if(!hit) {\n justBefore = firstHit;\n int size = directionsToGo.size();\n\n for(int i = size - 1; i >= 0; i--){\n Point n = new Point(justBefore.x + directionsToGo.get(i).getDirectionVector()[0],\n justBefore.y + directionsToGo.get(i).getDirectionVector()[1]);\n if(!pos.contains(n))\n directionsToGo.remove(i);\n }\n directionLooking = directionsToGo.get(0);\n }\n else\n if(!pos.contains(pWD(justBefore, directionLooking))) {\n justBefore = firstHit;\n directionLooking = directionLooking.getOpposite();\n }\n\n }\n if(hit) {\n searching = !destroyedIt;\n }\n }", "public void checkIsFrogAtTheEdge() {\n\t\tif (getY()<0 || getY()>800) {\n\t\t\tsetY(FrogPositionY);\t\n\t\t}\n\t\tif (getX()<-20) {\n\t\t\tmove(movementX*2, 0);\n\t\t} else if (getX()>600) {\n\t\t\tmove(-movementX*2, 0);\n\t\t}\n\t\tif (getY()<130 && ! ((getIntersectingObjects(End.class).size() >= 1))) {\n\t\t\tmove(0, movementY*2);\n\t\t\t\n\t\t}\n\t}", "public boolean addEdge(T beg, T end);", "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}", "boolean isSetEndPosition();", "public boolean isDestination(Node node)\r\n {\r\n if(node == End)\r\n return true;\r\n else \r\n return false;\r\n }", "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 }", "private boolean hasHitEdge() {\n if (!enableClusterExitPurging) {\n return false;\n }\n int lx = (int) location.x, ly = (int) location.y;\n int sx = chip.getSizeX(), sy = chip.getSizeY();\n if (lx < radiusX || lx > sx - radiusX || ly < radiusY || ly > sy - radiusY) {\n if (hitEdgeTime == 0) {\n hitEdgeTime = getLastEventTimestamp();\n return false;\n } else {\n if (getLastEventTimestamp() - hitEdgeTime > 0/* getClusterLifetimeWithoutSupportUs()*/) {\n return true;\n } else {\n return false;\n }\n }\n }\n return false;\n }", "@Override\n public boolean isFinished() {\n return swerve.getPose().getTranslation().distance(pointOfInterest) <= distance;\n }", "boolean hasStart();", "boolean complete() {\n return start2D != null && stop2D != null;// && start3D!=null && stop3D!=null;\n }", "@Override\n\t\tpublic boolean isStopNode(TraversalPosition tp) {\n\t\t\t// System.out.println( \"\\nVisited nodes: \" + count++);\n\t\t\tStop currentStop = cache.get(tp.currentNode());\n\t\t\tif (currentStop.getStation().equals(dest)) {\n\t\t\t\treturn true;\n\t\t\t} else if ((currentStop.getTime() > stopTime))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "boolean hasIsBoundaryNodeOf();", "boolean hasTargetPos();", "boolean wasHit();", "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 act() {\n\n\tif (0 == stepCount) {\n\n\t ArrayList<Location> node = new ArrayList<Location>();\n\t node.add(getLocation());\n\t crossLocation.push(node);\n\t}\n\n\tboolean willMove = canMove();\n\tif (isEnd == true) {\n\t //to show step count when reach the goal\t\t\n\t if (hasShown == false) {\n\t\tString msg = stepCount.toString() + \" steps\";\n\t\tJOptionPane.showMessageDialog(null, msg);\n\t\thasShown = true;\n\t }\n\t} else if (willMove) {\n\t\n\t move();\n\t //increase step count when move \n\t stepCount++;\n\t} else {\n\t \n\t back();\n\t stepCount++;\n\t}\n\n }", "public static boolean recursiveFindPath(Edge edge, Shape end) {\n\t\tif (edge.getDest() instanceof JoinPoint) {\n\t\t\tif (recursiveFindPath((Edge) ((JoinPoint)edge.getDest()).getDest(), end)) {\n\t\t\t\tedge.setColor(Color.green);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if (edge.getDest().equals(end)) {\n\t\t\tedge.setColor(Color.green);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "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}", "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}", "boolean hasLastAction();", "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 boolean continueExecuting()\n {\n if (!closestEntity.isEntityAlive())\n {\n return false;\n }\n\n if (field_46105_a.getDistanceSqToEntity(closestEntity) > (double)(field_46101_d * field_46101_d))\n {\n return false;\n }\n else\n {\n return field_46102_e > 0;\n }\n }", "@Override\r\n\tpublic boolean connect(VertexInterface<T> endVertex) {\n\t\treturn false;\r\n\t}", "public boolean isPressed() {\r\n List<Entity> entities = dungeon.getEntities();\r\n for (Entity e: entities) {\r\n if (e != null && e.getY() == getY() && e.getX() == getX()) {\r\n if (\"Boulder\".equals(e.getClass().getSimpleName()))\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "private final boolean hasTautExit(int vFrom, int vTo, int currentLevel) {\n int x1 = xPositions[vFrom];\n int y1 = yPositions[vFrom];\n int x2 = xPositions[vTo];\n int y2 = yPositions[vTo];\n\n int nOutgoingEdges = nOutgoingEdgess[vTo];\n int[] outgoingEdges = outgoingEdgess[vTo];\n int[] outgoingEdgeIndexes = outgoingEdgeIndexess[vTo];\n for (int j=0;j<nOutgoingEdges;++j) {\n if (edgeLevels[outgoingEdgeIndexes[j]] < currentLevel) continue;\n int v3 = outgoingEdges[j];\n int x3 = xPositions[v3];\n int y3 = yPositions[v3];\n if (graph.isTaut(x1,y1,x2,y2,x3,y3)) return true;\n }\n return false;\n }", "public boolean hasFinished(int neighbour){\n\t//System.out.println(\"ATTENTION\");\n\treturn false;\n }", "@Override\n protected boolean isFinished() {\n return (Math.abs(hpIntake.getWristPosition()) - HatchPanelIntake.positions[position.ordinal()] < Math.PI/12);\n }", "default boolean visitEnd() {\n\t\treturn true;\n\t}", "public abstract boolean shouldEnd();", "@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 }", "boolean hasIsVertexOf();", "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 }", "public void checkIfAtEdge() {\n\t\tif(x<=0){\n\t\t\tx=1;\n\t\t\tatEdge=true;\n\t\t\tmoving=false;\n\t\t}\n\t\tif(y<=0){\n\t\t\ty=1;\n\t\t\tatEdge=true;\n\t\t\tmoving=false;\n\t\t}\n\t\tif(x>=GameSystem.GAME_WIDTH-collisionWidth){\n\t\t\tx=GameSystem.GAME_WIDTH-collisionHeight-1;\n\t\t\tatEdge=true;\n\t\t\tmoving=false;\n\t\t}\n\t\tif(y>=GameSystem.GAME_HEIGHT-collisionWidth){\n\t\t\ty=GameSystem.GAME_HEIGHT-collisionHeight-1;\n\t\t\tatEdge=true;\n\t\t\tmoving=false;\n\t\t}\n\t\telse{\n\t\t\tatEdge=false;\n\t\t}\n\t\t\n\t}", "private void paveAWay(Position start, Position end) {\n move(start);\n while (!position.equals(end)) {\n oneStepPavePlan(end);\n }\n }", "public void processTargetTracker (Entity squad, Entity target, boolean contactEnd) {\n\t}", "protected boolean planEndNode(SearchNode node) {\n\n\tif (gc.satisfies(node.s.s)) {\n\t return true;\n\t}\n\n\treturn false;\n\n }", "public abstract boolean isUsing(Edge graphEdge);", "@Override\r\n\tprotected boolean isFinished() {\n\t\treturn Math.abs(elevator.getWristPosition() - elevator.getWristStages()[elevator.getWristStage()]) < Math.PI/18 && !elevator.isRunning(ElevatorSubsystem.Follower.ELEVATOR);\r\n\t}", "@Override\n\t\t\tprotected Void doInBackground() throws Exception {\n\t\t\t\tif (!verifyStartEndVerticesExist(true, false)) {\n\t\t\t\t\tsetRunning(false);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Queue\n\t\t\t\tQueue<Vertex> q = new LinkedList<Vertex>();\n\t\t\t\t\n\t\t\t\t// set start vertex as visited\n\t\t\t\tpanel.getStartVertex().setVisited(true);\n\t\t\t\tq.add(panel.getStartVertex());\n\t\t\t\twhile (!q.isEmpty()) {\n\t\t\t\t\tVertex v = q.remove();\n\t\t\t\t\tv.setSelected(true);\n\t\t\t\t\tpublish();\n\t\t\t\t\tThread.sleep(panel.getCurrentDelay());\n\t\t\t\t\tfor (Vertex vertex : getNeighbors(v)) {\n\t\t\t\t\t\tvertex.setHighlighted();\n\t\t\t\t\t\tpublish();\n\t\t\t\t\t\tThread.sleep(panel.getCurrentDelay());\n\t\t\t\t\t\tif (!vertex.isVisited()) {\n\t\t\t\t\t\t\tvertex.setVisited(true);\n\t\t\t\t\t\t\tvertex.setParent(v);\n\t\t\t\t\t\t\tq.add(vertex);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tv.setSelected(false);\n\t\t\t\t\tv.setHighlighted();\n\t\t\t\t\tpublish();\n\t\t\t\t\tThread.sleep(panel.getCurrentDelay());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"BFS Finished!\");\n\t\t\t\tpublish();\n\t\t\t\tsetRunning(false);\n\t\t\t\treturn null;\n\t\t\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 transition() {\n current = new State(ts++, hopper); \n if (terminus.isTerminus(current)) {\n return false;\n } else {\n hopper.sendBall(oneMinute);\n return true;\n }\n }", "boolean isSetEnd();", "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 }", "boolean hasTo();", "public boolean isDirected(Position ep) throws InvalidPositionException;", "public void followEdge(int e) {\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.edge == e) {\r\n\t\t\t\tcurrentVertex = neighbor.vertex;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Edge to \" + e + \" not exist.\");\r\n\t}", "private boolean isValid(AStarNode start, AStarNode end) {\n boolean check = true;\n for (Obstacle obs : getObstacles()) {\n if (isOnTheWay(start, end, obs))\n check = false;\n }\n return check;\n }", "@Override\r\n\tpublic boolean BFS(E src) {\r\n\t\tif(containsVertex(src)) {\r\n\t\t\tVertex<E> s = vertices.get(src);\r\n\t\t\tlastSrc = s;\r\n\t\t\tvertices.forEach((E e, Vertex<E> u) -> {\r\n\t\t\t\tu.setColor(Color.WHITE);\r\n\t\t\t\tu.setDistance(Integer.MAX_VALUE);\r\n\t\t\t\tu.setPredecessor(null);\r\n\t\t\t});\r\n\t\t\ts.setColor(Color.GRAY);\r\n\t\t\ts.setDistance(0);\r\n\t\t\t//s.predecessor is already null so skip that step\r\n\t\t\tQueue<Vertex<E>> queue = new Queue<>();\r\n\t\t\tqueue.enqueue(s);\r\n\t\t\ttry {\r\n\t\t\t\twhile(!queue.isEmpty()) {\r\n\t\t\t\t\tVertex<E> u = queue.dequeue();\r\n\t\t\t\t\tArrayList<Edge<E>> adj = adjacencyLists.get(u.getElement());\r\n\t\t\t\t\tfor(Edge<E> ale: adj) {\r\n\t\t\t\t\t\tVertex<E> v = vertices.get(ale.getDst());\r\n\t\t\t\t\t\tif(v.getColor() == Color.WHITE) {\r\n\t\t\t\t\t\t\tv.setColor(Color.GRAY);\r\n\t\t\t\t\t\t\tv.setDistance(u.getDistance()+1);\r\n\t\t\t\t\t\t\tv.setPredecessor(u);\r\n\t\t\t\t\t\t\tqueue.enqueue(v);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tu.setColor(Color.BLACK);\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception emptyQueueException) {\r\n\t\t\t\t//-_-\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "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}", "@Override\r\n public boolean canMove() {\r\n Grid<Actor> gr = getGrid();\r\n int dirs[] = {\r\n Location.AHEAD, Location.HALF_CIRCLE, Location.LEFT,\r\n Location.RIGHT };\r\n // 当终点在周围时,不能移动且isEnd应当为true\r\n for (int i = 0; i < dirs.length; i++) {\r\n Location tarLoc = getLocation().getAdjacentLocation(dirs[i]);\r\n if (gr.isValid(tarLoc) && gr.get(tarLoc) != null) {\r\n // Color直接用==计算竟然不可行(真是哔了dog...\r\n if (gr.get(tarLoc) instanceof Rock\r\n && gr.get(tarLoc).getColor().equals(Color.RED)) {\r\n isEnd = true;\r\n return false;\r\n }\r\n }\r\n }\r\n ArrayList<Location> nextLocs = getValid(getLocation());\r\n // 当附近没有可以移动的位置时,不能移动\r\n if (nextLocs.size() == 0) {\r\n return false;\r\n }\r\n // 当可以移动的位置>1时,说明存在一个节点,这个节点应当被新建一个arraylist入栈\r\n if (nextLocs.size() > 1) {\r\n ArrayList<Location> newStackElem = new ArrayList<Location>();\r\n newStackElem.add(getLocation());\r\n crossLocation.push(newStackElem);\r\n }\r\n // 有可以移动的位置时,向概率最高的方向移动\r\n int maxProbLoc = 0;\r\n // 由于nextLocs不一定有4个location,所以只好循环判断取最大值\r\n for (int i = 0; i < nextLocs.size(); i++) {\r\n Location loc = nextLocs.get(i);\r\n int dirNum = getLocation().getDirectionToward(loc) / 90;\r\n if (probablyDir[dirNum] > probablyDir[maxProbLoc]) {\r\n maxProbLoc = i;\r\n }\r\n }\r\n next = nextLocs.get(maxProbLoc);\r\n return true;\r\n }", "private static boolean isKonAfterVerb(AnalyzedTokenReadings[] tokens, int start, int end) {\n if(tokens[start].matchesPosTagRegex(\"VER:(MOD|AUX).*\") && tokens[start + 1].matchesPosTagRegex(\"(KON|PRP).*\")) {\n if(start + 3 == end) {\n return true;\n }\n for(int i = start + 2; i < end; i++) {\n if(tokens[i].matchesPosTagRegex(\"(SUB|PRO:PER).*\")) {\n return true;\n }\n }\n }\n return false;\n }", "public boolean isReached();", "public boolean solve(Point start, Point end, boolean draw) {\n \t\t// Clear the visited array for solving\n \t\tfor (int x = 1; x <= size; x++) {\n \t\t\tfor (int y = 1; y <= size; y++) {\n \t\t\t\tvisited[x][y] = false;\n \t\t\t}\n \t\t}\n \t\tfoundTarget = false;\n \t\ttarget = new Point(end);\n \t\tsolve(start.x, start.y, draw);\n \t\treturn foundTarget;\n \t}", "private boolean search() {\n if (null != listener) {\n listener.pre(joinTree, start, stop);\n }\n\n if (start.equals(stop)) {\n if (null != listener) {\n listener.post(joinTree, start, stop);\n }\n return false;\n }\n\n boolean result = search(start);\n\n if (null != listener) {\n listener.post(joinTree, start, stop);\n }\n\n return result;\n }", "boolean hasPerformAt();", "boolean hasCurrentAction();", "boolean isDone(){\n\t\t\n\t\treturn (x0==x1 && y0==y1);\n\t}", "public boolean isHit() { return hit; }", "public boolean containsEdge(String start, String end) {\n\t\tif (!isLocked(end))\n\t\t\treturn false;\n\t\tif (containsVertex(start) && containsVertex(end) && adj_list.get(start) != null) {\n\t\t\tList<String> list = adj_list.get(start);\n\t\t\tif (list.contains(end))\n\t\t\t\treturn true;\n\t\t} else {\n\n\t\t}\n\t\treturn false;\n\t}", "public void connector(String start, String finish){\r\n\t \tclearVisited();\r\n\t \tboolean found = false;\r\n\t \tQueue<Vertex> vertexList = new LinkedList<Vertex>();\r\n\t \tvertexList.add(myGraph[getId(start)]);\r\n\t \tmyGraph[getId(start)].visited = true;\r\n\t \twhile (!vertexList.isEmpty() && !found) {\t\r\n\t\t\tVertex current = vertexList.remove();\r\n\t\t\tAdjVertex friend = current.adjVertexHead;\r\n\t\t\twhile(friend.next != null && !found){\t\r\n\t\t\t\t\tif (!friend.visited) {\t //if we have not visted this, make it visited and add it to the queue\r\n\t\t\t\t\t\tfriend.visited = true;\t\r\n\t\t\t\t\t\tvertexList.add(myGraph[getId(friend.name)]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(friend.name.compareToIgnoreCase(finish) == 0){ //if we found what we want, backtrack the path\r\n\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\tbackTrack(start, friend, current);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfriend = friend.next;\r\n\t\t\t}\t\r\n\t \t}\r\n\t \tif(!found){\r\n\t \t\tSystem.out.println(\"There is no connection between \" +start+ \" and \" +finish);\r\n\t \t\tSystem.out.println();\r\n\t \t}\r\n\t}", "public boolean GO ()\r\n\t{\r\n\t\t\r\n\t\t for (GenericTreeNode<String> node : ActualNode.getChildren()) {\r\n\t\t\t if (node.getData().equalsIgnoreCase(Navigation_WHERE)){\r\n\t\t\t\t Path.add(new GenericTreeNode<String>(ActualNode));\r\n\t\t\t\t ActualNode=new GenericTreeNode<String>(node);\r\n\t\t\t return true;\r\n\t\t\t }\r\n\t }\r\n\t\t return false;\r\n\t}", "public boolean isGoal();", "boolean hasVisitEndtime();", "boolean hasVisitEndtime();", "public boolean isOver() {\n return this.treeNode.getBuilding().isFinished();\n }", "@Override\n\tpublic boolean findPath(PathfindingNode start, PathfindingNode end, ArrayList<PathfindingNode> path) \n\t{\n\t\tpath.clear();\n\t\t\n\t\t_visited.clear();\n\t\t_toVisit.clear();\n\t\t_parents.clear();\n\t\t_costsFromStart.clear();\n\t\t_totalCosts.clear();\n\n\t\t_costsFromStart.put(start, 0);\n\t\t_toVisit.add(start);\n\t\t_parents.put(start, null);\n\t\t\n\t\twhile (!_toVisit.isEmpty() && !_toVisit.contains(end))\n\t\t{\n\t\t\tPathfindingNode m = _toVisit.remove();\n\t\t\t\n\t\t\tint mCost = _costsFromStart.get(m);\n\t\t\t\n\t\t\tfor (int i = 0; i < m.getNeighbors().size(); ++i)\n\t\t\t{\n\t\t\t\tPathfindingNodeEdge n = m.getNeighbors().get(i);\n\t\t\t\tif (n.getNeighbor() != null && !_visited.contains(n.getNeighbor()))\n\t\t\t\t{\n\t\t\t\t\tint costFromSource = mCost + n.getCost();\n\t\t\t\t\tint totalCost = costFromSource + _estimator.estimate(n.getNeighbor(), end);\n\t\t\t\t\tif (!_toVisit.contains(n.getNeighbor()) || totalCost < _totalCosts.get(n.getNeighbor()))\n\t\t\t\t\t{\n\t\t\t\t\t\t_parents.put(n.getNeighbor(), m);\n\t\t\t\t\t\t_costsFromStart.put(n.getNeighbor(), costFromSource);\n\t\t\t\t\t\t_totalCosts.put(n.getNeighbor(), totalCost);\n\t\t\t\t\t\tif (_toVisit.contains(n.getNeighbor()))\n\t\t\t\t\t\t\t_toVisit.remove(n.getNeighbor());\n\t\t\t\t\t\t_toVisit.add(n.getNeighbor());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t_visited.add(m);\n\t\t}\n\t\t\n\t\tif (_toVisit.contains(end))\n\t\t{\n\t\t\t_reversePath.clear();\n\t\t\t\n\t\t\tPathfindingNode current = end;\n\t\t\twhile (current != null)\n\t\t\t{\n\t\t\t\t_reversePath.push(current);\n\t\t\t\tcurrent = _parents.get(current);\n\t\t\t}\n\t\t\t\n\t\t\twhile (!_reversePath.isEmpty())\n\t\t\t\tpath.add(_reversePath.pop());\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpath.add(start);\n\t\t\treturn false;\n\t\t}\n\t}", "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 }", "public boolean canMoveEntity (Entity entity, Point dest) {\n if (entity == null) throw new IllegalArgumentException(\"Entity is null\");\n if (dest == null) throw new IllegalArgumentException(\"Point is null\");\n if (!grid.containsKey(dest)) throw new IllegalArgumentException(\"The cell is not on the grid\");\n\n Point origin = entity.getCoords();\n\n if (origin.equals(dest)) return false;\n\n Vector vector = Vector.findStraightVector(origin, dest);\n\n if (vector == null) return false;\n Vector step = new Vector(vector.axis(), (int) (1 * Math.signum(vector.length())));\n Point probe = (Point) origin.clone();\n while (!probe.equals(dest)) {\n probe = step.applyVector(probe);\n if (!grid.containsKey(probe)) return false;\n }\n\n\n return true;\n }", "private boolean isOnTheWay(AStarNode start, AStarNode end, Obstacle obs){\n\t/*Making sure whether obstacle even has a chance to be on the way*/\n\tdouble x_left_bound = Math.min(start.getX(), end.getX()) - obs.getRadius() - CLEARANCE;\n\tdouble x_right_bound = Math.max(start.getX(), end.getY()) + obs.getRadius() + CLEARANCE;\n\tdouble y_top_bound = Math.min(start.getY(), end.getY()) - obs.getRadius() - CLEARANCE;\n\tdouble y_bottom_bound = Math.max(start.getY(), end.getY()) + obs.getRadius() + CLEARANCE;\n\t\n\t/*If it is not within the range we should worry about, return false*/\n\tif(obs.getX() < x_left_bound || obs.getX() > x_right_bound || obs.getY() < y_top_bound || obs.getY() > y_bottom_bound){\n\t return false;\n\t}\n\t\n\t/*Angle between the tangent line of clearance range that intersects start node position and the line between start node and center of Obstacle*/\n double theta = Math.atan((CLEARANCE / 2 + obs.getRadius()) / Math.abs(start.getDistTo(obs)));\n\t\n\t/*Absolute angle positions of two tangent lines of clearance ranges that intersects start position*/\n double leftBound = start.getHeadingTo(obs) - theta;\n double rightBound = start.getHeadingTo(obs) + theta;\n\n if (rightBound > Math.PI * 2) rightBound = rightBound - 2 * Math.PI; // In case the angle bounds\n if (leftBound < 0) leftBound = leftBound + 2 * Math.PI; // exceed the angle range\n\n double angle = start.getHeadingTo(end); // absolute angle position of end node relative to the start node\n\n if (leftBound < rightBound) { // Normal case\n if (angle > leftBound && angle < rightBound) return true;\n else return false;\n } else { // Special case, when either leftBound or rightBound value exceeded angle range\n if (angle > rightBound && angle < leftBound) return false;\n else return true;\n }\n\n }", "public boolean areAdjacent(Position vp, Position wp) throws InvalidPositionException;", "private boolean boulderObstructed(List<Entity> entities) {\r\n for (Entity e : entities) {\r\n if (e instanceof Exit) return true;\r\n if (e instanceof Door) return true;\r\n if (e instanceof Wall) return true;\r\n }\r\n return false;\r\n }", "public boolean onEnPassant() {\n\t\tfinal FigureColor opponentColor = FigureColor.getOpponentColor(this.pawnColor);\n\t\tfinal BaseFigure lastUsedFigure = MoveWatcherEvent.getLastUsedFigure(opponentColor);\n\n\t\tif (lastUsedFigure.getFigureType() == FigureSet.PAWN) {\n\t\t\tfinal FigurePawn opponentPawn = (FigurePawn) lastUsedFigure;\n\n\t\t\tif (opponentPawn.getMoveInformation() == PawnMoveInformation.MOVED_TWO_FIELDS) {\n\t\t\t\tif (Matrix.INSTANCE.onPawnNeighbors(this, opponentPawn)) {\n\t\t\t\t\tthis.flagForEnPassant = true;\n\t\t\t\t} else {\n\t\t\t\t\tthis.flagForEnPassant = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.flagForEnPassant;\n\t}", "protected boolean isFinished() {\n\t\treturn RobotMap.VisionDistanceLeftPIDController.onTarget() && RobotMap.VisionDistanceRightPIDController.onTarget() || !hasStarted;\n\t}", "private void checkFlowFromTo(\n NodeAdaptor source, NodeAdaptor target) {\n if (source.isChoreographyActivity() && target.isChoreographyActivity()) {\n Collection<NodeAdaptor> nodesWithoutParticipation =\n getFinalTasksWithoutParticipant(source,\n ((ChoreographyNodeAdaptor) target).getActiveParticipant());\n if (!nodesWithoutParticipation.isEmpty()) {\n validator.addMessage(\n \"initiatorOfChoreographyActivityNotParticipantInPriorActivity\",\n target, nodesWithoutParticipation);\n }\n }\n }", "public boolean isEndState()\n {\n return !this.safe || (this.e.size() == 0) || (this.d.size() == 0);\n }", "boolean isStartMethod(JflowMethod fm)\t{ return start_set.contains(fm); }", "public void setEndVertex(int e) {\n\t\tendVertex = e;\n\t}", "public void IntersectEnd() {\n\t\tif (getIntersectingObjects(End.class).get(0).isEnd()) {\n\t\t\tthis.end--;\n\t\t\taddPoints(-100);\n\t\t}\n\t\tpoints+=100;\n\t\tgetIntersectingObjects(End.class).get(0).setEnd();\n\t\tfrogReposition();\n\t\tthis.end++;\n\t}", "public boolean isGoal() {\n if (blocks[dimension()-1][dimension()-1] != 0) return false;\n return hamming() == 0;\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 }", "protected boolean isFinished() {\n\t\treturn Robot.elevator.isInPosition(newPosition, direction);\n\t}", "static boolean isVerbBehind(AnalyzedTokenReadings[] tokens, int end) {\n return (end < tokens.length - 1 && tokens[end].getToken().equals(\",\") && tokens[end+1].hasPosTagStartingWith(\"VER:\"));\n }" ]
[ "0.67539996", "0.6210705", "0.6023742", "0.5859598", "0.585836", "0.5653272", "0.5653272", "0.5588707", "0.5566247", "0.5539826", "0.5471795", "0.5471331", "0.54610693", "0.5398748", "0.53732014", "0.53528804", "0.53527385", "0.5340053", "0.53141165", "0.5310557", "0.53079563", "0.5267579", "0.5264108", "0.52460504", "0.5237514", "0.5230816", "0.5222475", "0.52077043", "0.5187001", "0.518202", "0.5170126", "0.5165078", "0.5156169", "0.51412976", "0.5140316", "0.512543", "0.5116389", "0.5105543", "0.50924325", "0.5061097", "0.5055203", "0.50537485", "0.5050497", "0.5039", "0.50363874", "0.501935", "0.5018904", "0.5014479", "0.5007899", "0.50023794", "0.49940798", "0.4993518", "0.49911273", "0.49845958", "0.4983369", "0.49833643", "0.49807787", "0.49765387", "0.4971663", "0.49691117", "0.4962434", "0.49582833", "0.49545056", "0.4953082", "0.49414504", "0.49354857", "0.49342787", "0.4932535", "0.49255157", "0.49165273", "0.4910183", "0.48956242", "0.4893055", "0.4891122", "0.4885697", "0.48845983", "0.48838192", "0.48835117", "0.48807666", "0.48790616", "0.48782223", "0.48782223", "0.48778898", "0.4873929", "0.4869747", "0.48692653", "0.48690572", "0.48658532", "0.48598683", "0.48560125", "0.48523447", "0.48503852", "0.4849279", "0.48485392", "0.48480627", "0.48475176", "0.4847213", "0.48436356", "0.48379514", "0.48362213" ]
0.6515171
1
Lists the transitions with the vertex start as the start and the vertex follower as the end
public Set<LabeledEdge> getTransitions(Vertex start, Vertex follower){ Set<LabeledEdge> paths = new HashSet<LabeledEdge>(); for(LabeledEdge trans : edgesByStart.get(start)){ if(trans.getEnd().equals(follower)) paths.add(trans); } return paths; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setTransitionsList () {\n for (int i = 0; i < dfaStates.size(); i++) {\n List<State> currStateList = dfaStates.get(i);\n int currStateListID = dfaStatesWithNumbering.get(currStateList);\n State initialState = new State(currStateListID, true);\n\n HashMap<String, List<State>> currStateListInfo = dfaTable.get(currStateList);\n for (int j = 0; j < symbolList.size()-1; j++) {\n String currSymbol = Character.toString(symbolList.get(j));\n List<State> currStateListSymbolList = currStateListInfo.get(currSymbol);\n\n if (currStateListSymbolList.size() > 0) {\n State finalState = new State(dfaStatesWithNumbering.get(currStateListSymbolList), true);\n Transition tmpTransition = new Transition(currSymbol, initialState, finalState);\n\n // now add to transition list\n if (!transitionsList.contains(tmpTransition)) {\n transitionsList.add(tmpTransition);\n }\n }\n }\n }\n }", "private void constructTransitionMatrix() {\r\n\t\tfor(Node node: mNodes) {\r\n\t\t\tint nodeId = node.getId();\r\n\t\t\tint outDegree = node.getOutDegree();\r\n\t\t\tArrayList<NodeTransition> transitionList = new ArrayList<NodeTransition>();\r\n\t\t\t\r\n\t\t\tSet<Integer> outEdges = getOutEdges(nodeId);\r\n\t\t\tfor(Integer edgeId: outEdges) {\r\n\t\t\t\tint toId = getEdge(edgeId).getToId();\r\n\t\t\t\tdouble pTransition = (double) getEdge(edgeId).getWeight() / (double) outDegree;\r\n\t\t\t\ttransitionList.add( new NodeTransition(toId, pTransition) );\r\n\t\t\t}\r\n\t\t\tmTransition.add( transitionList );\r\n\t\t}\r\n\t}", "private static void createSlideTransitions() {\n\t\tif (slideList.size() < SLIDES_REGIONS_LIMIT) {\n\t\t\tint length = (slideList.size() / 2) - 1;\n\t\t\t\n\t\t\tif (slideList.size() % 2 == 0) {\n\t\t\t\tlength++;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < length; i++) {\n\t\t\t\ttransitionList.add(slideList.get(i));\n\t\t\t\ttransitionList.add(slideList.get(length - i - 1));\n\t\t\t}\n\t\t} else {\n\t\t\tint length = slideList.size() / NUMBER_REGIONS / 2 - 1;\n\t\t\t\n\t\t\tif (slideList.size() % 2 == 0) {\n\t\t\t\tlength++;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < NUMBER_REGIONS; i++) {\n\t\t\t\tfor (int j = 0; j < length; j++) {\n\t\t\t\t\ttransitionList.add(slideList.get(j + i * length));\n\t\t\t\t\t//System.out.println(i * length - j - 1);\n\t\t\t\t\ttransitionList.add(slideList.get((i + 1) * length - j - 1));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (slideList.size() % 2 != 0) {\n\t\t\t\ttransitionList.add(slideList.get(slideList.size() - 1));\n\t\t\t}\n\t\t}\n\t}", "private List<routerNode> getPathVertexList(routerNode beginNode, routerNode endNode) {\r\n\t\tTransformer<routerLink, Integer> wtTransformer; // transformer for getting edge weight\r\n\t\twtTransformer = new Transformer<routerLink, Integer>() {\r\n public Integer transform(routerLink link) {\r\n return link.getWeight();\r\n \t}\r\n };\t\t\r\n\r\n\t\t\r\n\t\tList<routerNode> vlist;\r\n\t\tDijkstraShortestPath<routerNode, routerLink> DSPath = \r\n\t \t new DijkstraShortestPath<routerNode, routerLink>(gGraph, wtTransformer);\r\n \t// get the shortest path in the form of edge list \r\n List<routerLink> elist = DSPath.getPath(beginNode, endNode);\r\n\t\t\r\n \t\t// get the node list form the shortest path\r\n\t Iterator<routerLink> ebIter = elist.iterator();\r\n\t vlist = new ArrayList<routerNode>(elist.size() + 1);\r\n \tvlist.add(0, beginNode);\r\n\t for(int i=0; i<elist.size(); i++){\r\n\t\t routerLink aLink = ebIter.next();\r\n\t \t \t// get the nodes corresponding to the edge\r\n \t\tPair<routerNode> endpoints = gGraph.getEndpoints(aLink);\r\n\t routerNode V1 = endpoints.getFirst();\r\n\t routerNode V2 = endpoints.getSecond();\r\n\t \tif(vlist.get(i) == V1)\r\n\t \t vlist.add(i+1, V2);\r\n\t else\r\n\t \tvlist.add(i+1, V1);\r\n\t }\r\n\t return vlist;\r\n\t}", "public TransitionIterator transitionIterator () {\n\t\t\treturn transitionIterator (null, 0, null, 0);\n\t\t}", "@objid (\"5fbc4043-71c3-4fa2-8c35-72372f15ccb1\")\n EList<Transition> getSends();", "public List<Transition> getInTransitions() {\r\n\t\treturn inTransitions;\r\n\t}", "public List<Transition> getTransitionsFromStateToState(final State from, final State to) {\n\t\tfinal List<Transition> list = new ArrayList<>();\n\t\tgetTransitionsFromState(from).stream().forEach(transition -> {\n\t\t\tif (transition.getToState() == to) {\n\t\t\t\tlist.add(transition);\n\t\t\t}\n\t\t});\n\t\treturn list;\n\t}", "private void constructTransitionTransposeMatrix() {\r\n\t\tfor(int i=0; i<getNodeCnt(); i++) {\r\n\t\t\tArrayList<NodeTransition> transitionList = new ArrayList<NodeTransition>();\r\n\t\t\tmTransitionTranspose.add( transitionList );\r\n\t\t}\r\n\t\tfor(Node node: mNodes) {\r\n\t\t\tint fromId = node.getId();\r\n\t\t\tint outDegree = node.getOutDegree();\r\n\t\t\t\r\n\t\t\tSet<Integer> outEdges = getOutEdges(fromId);\r\n\t\t\tfor(Integer edgeId: outEdges) {\r\n\t\t\t\tint toId = getEdge(edgeId).getToId();\r\n\t\t\t\tdouble pTransition = (double) getEdge(edgeId).getWeight() / (double) outDegree;\r\n\t\t\t\t\r\n\t\t\t\tArrayList<NodeTransition> transitionList = mTransitionTranspose.get(toId);\r\n\t\t\t\ttransitionList.add( new NodeTransition(fromId, pTransition) );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Iterable<Transition> getTransitions() {\n return new TransitionsIterable();\n }", "private void addVerticesToGraph()\n\t{\n\t\tString vertexName;\n\n\t\tMap<Long, IOFSwitch> switches = this.floodlightProvider.getSwitches();\n\t\tfor(IOFSwitch s :switches.values())\n\t\t{\n\t\t\tvertexName =Long.toString(s.getId());\n\t\t\tm_graph.addVertex(vertexName);\t\t\t \t\t\t \n\t\t}\n\t\tSystem.out.println(m_graph);\n\t}", "private static void criaListaDeVertices(Graph graph) {\r\n\t\tfor (int i = 0; i < graph.getArestas().size(); i++) {\r\n\t\t\tif (!graph.getArestas().get(i).getV1().statusVertice()) {\r\n\t\t\t\tgraph.getVerticesGraph().add( graph.getArestas().get(i).getV1() );\r\n\t\t\t\tgraph.getArestas().get(i).getV1().alteraStatusVertice(true);\r\n\t\t\t}\r\n\r\n\t\t\tif (!graph.getArestas().get(i).getV2().statusVertice()) {\r\n\t\t\t\tgraph.getVerticesGraph().add( graph.getArestas().get(i).getV2() );\r\n\t\t\t\tgraph.getArestas().get(i).getV2().alteraStatusVertice(true);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "List<V> getAdjacentVertexList(V v);", "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 }", "protected void addVertices(IWeightedGraph<GraphNode, WeightedEdge> graph, List<GoapState> goalState) {\r\n\t\t// The effects from the world state as well as the precondition of each\r\n\t\t// goal have to be set at the beginning, since these are the effects the\r\n\t\t// unit tries to archive with its actions. Also the startNode has to\r\n\t\t// overwrite the existing GraphNode as an initialization of a new Object\r\n\t\t// would not be reflected to the function caller.\r\n\t\tGraphNode start = new GraphNode(null, this.goapUnit.getWorldState());\r\n\t\tthis.startNode.overwriteOwnProperties(start);\r\n\t\tgraph.addVertex(this.startNode);\r\n\r\n\t\tfor (GoapState state : goalState) {\r\n\t\t\tHashSet<GoapState> goalStateHash = new HashSet<GoapState>();\r\n\t\t\tgoalStateHash.add(state);\r\n\r\n\t\t\tGraphNode end = new GraphNode(goalStateHash, null);\r\n\t\t\tgraph.addVertex(end);\r\n\t\t\tthis.endNodes.add(end);\r\n\t\t}\r\n\r\n\t\tHashSet<GoapAction> possibleActions = extractPossibleActions();\r\n\r\n\t\t// Afterward all other possible actions have to be added as well.\r\n\t\tif (possibleActions != null) {\r\n\t\t\tfor (GoapAction goapAction : possibleActions) {\r\n\t\t\t\tgraph.addVertex(new GraphNode(goapAction));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public List<NextStateInfo> getTransitions(String state) {\r\n \t\treturn transitions.get(state).getNextStateInfo();\r\n \t}", "private void printGraph() {\r\n\t\tSortedSet<String> keys = new TreeSet<String>(vertexMap.keySet());\r\n\t\tIterator it = keys.iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tVertex v = vertexMap.get(it.next());\r\n\t\t\tif (v.isStatus())\r\n\t\t\t\tSystem.out.println(v.getName());\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(v.getName() + \" DOWN\");\r\n\t\t\tsortEdges(v.adjacent);\r\n\t\t\tfor (Iterator i = v.adjacent.iterator(); i.hasNext();) {\r\n\t\t\t\t// v.adjacent.sort();\r\n\t\t\t\tEdge edge = (Edge) i.next();\r\n\t\t\t\tif (edge.isStatus())\r\n\t\t\t\t\tSystem.out.println(\" \" + edge.getDestination() + \" \" + edge.getCost());\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.println(\" \" + edge.getDestination() + \" \" + edge.getCost() + \" DOWN\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic synchronized Collection<Transition> getTransitions() {\n\t\treturn this.transitions;\n\t}", "public void setVertices(){\n\t\tvertices = new ArrayList<V>();\n\t\tfor (E e : edges){\n\t\t\tV v1 = e.getOrigin();\n\t\t\tV v2 = e.getDestination();\n\t\t\tif (!vertices.contains(v1))\n\t\t\t\tvertices.add(v1);\n\t\t\tif (!vertices.contains(v2))\n\t\t\t\tvertices.add(v2);\n\t\t}\n\t}", "public MMPCOrderNodeNext[] getTransitions() {\n\n MMPCOrderNodeNext[]\tretValue\t= new MMPCOrderNodeNext[m_next.size()];\n\n m_next.toArray(retValue);\n\n return retValue;\n\n }", "@Override\n public String toString() {\n return \"TRANSITION\\n\\tPerformative:\\t[\" + this.getPerformative() + \"]\\n\" + \"\\tSTART:\\t\\t[\" + this.getStartState().getName() + \"]\\n\" + \"\\tEND:\\t\\t[\" + this.getEndState().getName() + \"]\\n\" + \"\\tSENDER:\\t\\t[\" + this.getSender() + \"]\\n\" + \"\\tRECIPIENT:\\t[\" + this.getReceiver() + \"]\\n\" + \"\\tBY:\\t\\t[\" + this.getContent() + \"]\\n\";\n }", "public void outAdjacentVertices() {\r\n\t\tfor (int i = 0; i < currentVertex.outList.size(); i++) {\r\n\t\t\tSystem.out.print(currentVertex.outList.get(i).vertex.label + \" \");\r\n\t\t}\r\n\t\tprintLine();\r\n\t}", "public List<E> createEdgeListPath()\r\n/* */ {\r\n/* 146 */ List<E> path = new ArrayList();\r\n/* 147 */ AbstractPathElement<V, E> pathElement = this;\r\n/* */ \r\n/* */ \r\n/* 150 */ while (pathElement.getPrevEdge() != null) {\r\n/* 151 */ path.add(pathElement.getPrevEdge());\r\n/* */ \r\n/* 153 */ pathElement = pathElement.getPrevPathElement();\r\n/* */ }\r\n/* */ \r\n/* 156 */ Collections.reverse(path);\r\n/* */ \r\n/* 158 */ return path;\r\n/* */ }", "public void inAdjacentVertices() {\r\n\t\tfor (int i = 0; i < currentVertex.inList.size(); i++) {\r\n\t\t\tSystem.out.print(currentVertex.inList.get(i).vertex.label + \" \");\r\n\t\t}\r\n\t\tprintLine();\r\n\t}", "public abstract Etat transition();", "private void printPath( Vertex dest )\n {\n if( dest.prev != null )\n {\n printPath( dest.prev );\n // System.out.print( \" to \" );\n }\n System.out.print( dest.name +\" \" );\n }", "@Override\r\n public void connect(V start, V destination) {\r\n try {\r\n Iterator<Vertex> vertexIterator = map.values().iterator();\r\n Vertex a = null, b = null;\r\n while(vertexIterator.hasNext()) {\r\n Vertex v = vertexIterator.next();\r\n if(start.compareTo(v.vertexName) == 0)\r\n a = v;\r\n if(destination.compareTo(v.vertexName) == 0)\r\n b = v;\r\n }\r\n if(a == null || b == null)\r\n vertexIterator.next();\r\n a.addDestinations(destination);\r\n } catch(NoSuchElementException e) {\r\n throw e;\r\n }\r\n }", "private void initTransitions() {\n s0.addTransition(htThr, s1, startStep);\n\n s1.addTransition(htPosPeekThr, s2, null);\n s1.addTransition(ltThr, s4, null);\n\n s2.addTransition(ltNegPeekThr, s3, null);\n\n s3.addTransition(htNegPeekThr, s5, null);\n\n s4.addTransition(ltThr, s0, null);\n s4.addTransition(htThr, s1, null);\n\n s5.addTransition(ltNegPeekThr, s3, null);\n s5.addTransition(htNegThr, s6, endStep);\n\n s6.addTransition(ltThr, s0, null);\n }", "public List<Vertex> newPath() {\r\n\t\tList<Vertex> Pathchange = new ArrayList<Vertex>();\r\n\t\tList<Vertex> tempPath = new ArrayList<Vertex>();\r\n\t\tint BestEval = Integer.MAX_VALUE;\r\n\t\tVertex changeVertexV1 = new Vertex();\r\n\t\tVertex changeVertexV2 = new Vertex();\r\n\r\n\t\tfor (int position = 0; position < this.LastPath.size() - 1; position++) {\r\n\t\t\tfor (int changement = position+1; changement < this.LastPath.size(); changement++) {\r\n\r\n\t\t\t\ttempPath.clear();\r\n\t\t\t\ttempPath = new ArrayList<Vertex>(this.LastPath);\r\n\t\t\t\tif (!(this.TabuListV1.contains(tempPath.get(position)) || this.TabuListV1.contains(tempPath.get(changement)) || this.TabuListV2.contains(tempPath.get(position)) || this.TabuListV2.contains(tempPath.get(changement)))) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tCollections.swap(tempPath, position, changement);\r\n\t\t\t\t\tif (this.fit(tempPath) < BestEval) {\r\n\t\t\t\t\t\tPathchange.clear();\r\n\t\t\t\t\t\tPathchange = new ArrayList<Vertex>(tempPath);\r\n\t\t\t\t\t\tchangeVertexV1 = tempPath.get(position);\r\n\t\t\t\t\t\tchangeVertexV2 = tempPath.get(changement);\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\tif(this.tabuElementType == 0) {\r\n\t\t\tthis.TabuListV1.add(0, changeVertexV1);\r\n\t\t}else if(this.tabuElementType == 1) {\r\n\t\t\tthis.TabuListV2.add(0, changeVertexV2);\r\n\t\t}else {\r\n\t\t\tthis.TabuListV1.add(0, changeVertexV1);\r\n\t\t\tthis.TabuListV2.add(0, changeVertexV2);\r\n\t\t}\r\n\t\t\r\n\t\tif (this.TabuListV1.size() > this.TabuListSize) {\r\n\t\t\tthis.TabuListV1.remove(this.TabuListV1.size() - 1);\r\n\t\t}\r\n\t\tif (this.TabuListV2.size() > this.TabuListSize) {\r\n\t\t\tthis.TabuListV2.remove(this.TabuListV2.size() - 1);\r\n\t\t}\r\n\r\n\t\treturn Pathchange;\r\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 List<Transition> getSelfTransitions() {\r\n\t\treturn selfTransitions;\r\n\t}", "public Collection<LazyNode2> getVertices() {\n List<LazyNode2> l = new ArrayList();\n \n for(Path p : getActiveTraverser())\n //TODO: Add cache clearing\n l.add(new LazyNode2(p.endNode().getId()));\n \n return l;\n }", "@Override\r\n public void drawEntrance()\r\n {\r\n\tdraw();\r\n\tif (_transition != null)\r\n\t _transition.draw();\r\n }", "private List<Matrix> obtainTransitions(List<Matrix>probs){\n\t\tList<Matrix> output = new ArrayList<Matrix>();\n\t\tfor (int i =0;i<probs.size();i++) {\n\t\t\toutput.add(genTransFunction(probs.get(i)));\n\t\t}\n\t\treturn output;\n\t}", "public ArrayList<String> shortestPath(String u, String v)\n {\n ArrayList<String> path = new ArrayList<>();\n HashMap<String, Boolean> flag = new HashMap<>();\n HashMap<String, String> prev = new HashMap<>();\n\n Queue<GraphVertex> queue = new LinkedList<>();\n HashMap<String, Boolean> visited = new HashMap<>();\n\n GraphVertex src = graphVertexHashMap.get(u);\n flag.put(src.getVertexName(), true);\n queue.add(src);\n visited.put(src.getVertexName(), true);\n\n while(!queue.isEmpty()){\n GraphVertex node = queue.poll();\n\n HashMap<String, GraphVertex> edges = node.getOutDegrees();\n Iterator it = edges.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry pair = (Map.Entry)it.next();\n if(flag.get(pair.getKey()) == null || flag.get(pair.getKey()) == false){\n String vertex = (String)pair.getKey();\n flag.put(vertex, true);\n prev.put(vertex, node.getVertexName());\n queue.add(edges.get(pair.getKey()));\n }\n }\n\n }\n path = backTrackPath(prev, u, v);\n return path;\n }", "public List<GraphEdge<D>> getForwardEdges() {\n List<GraphEdge<D>> edges = new ArrayList<>();\n \n for (GraphNode<D> node : successors) {\n edges.add(new GraphEdge<>(this, node));\n }\n \n return edges;\n }", "public String toString() {\n String result=\"Initial state: 0\\nFinal state: \"+(transitionTable.length-1)+\"\\nTransition list:\\n\";\n for (int i=0;i<epsilonTransitionTable.length;i++) for (int state: epsilonTransitionTable[i])\n result+=\" \"+i+\" -- epsilon --> \"+state+\"\\n\";\n for (int i=0;i<transitionTable.length;i++) for (int col = 0; col< NFA.N; col++)\n if (transitionTable[i][col]!=-1) result+=\" \"+i+\" -- \"+(char)col+\" --> \"+transitionTable[i][col]+\"\\n\";\n return result;\n }", "public String toString()\n {\n return \"(\" + start + \"->\"+ (start+size-1) + \")\";\n }", "List<V> getVertexList();", "private final List<State> PreE(List<State> y) {\r\n // {s \b S | exists s\u0001, (s � s\u0001 and s\u0001 \b Y )}\r\n List<State> states = new ArrayList<State>();\r\n //List<Transition> transitions = new ArrayList<Transition>();\r\n for (State sourceState : this._kripke.States) {\r\n for (State destState : y) {\r\n Transition myTransition = new Transition(sourceState, destState);\r\n \tfor(Transition transition : this._kripke.Transitions)\r\n \t{\r\n \t\tif (transition.FromState.equals(myTransition.FromState) &&\r\n \t\t\t\ttransition.ToState.equals(myTransition.ToState)) {\r\n \t\t\tif (!states.contains(sourceState)) {\r\n states.add(sourceState);\r\n }\r\n \t} \r\n \r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n return states;\r\n }", "private List<Vertex> prepareGraphAdjacencyList() {\n\n\t\tList<Vertex> graph = new ArrayList<Vertex>();\n\t\tVertex vertexA = new Vertex(\"A\");\n\t\tVertex vertexB = new Vertex(\"B\");\n\t\tVertex vertexC = new Vertex(\"C\");\n\t\tVertex vertexD = new Vertex(\"D\");\n\t\tVertex vertexE = new Vertex(\"E\");\n\t\tVertex vertexF = new Vertex(\"F\");\n\t\tVertex vertexG = new Vertex(\"G\");\n\n\t\tList<Edge> edges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexB, 2));\n\t\tedges.add(new Edge(vertexD, 6));\n\t\tedges.add(new Edge(vertexF, 5));\n\t\tvertexA.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 2));\n\t\tedges.add(new Edge(vertexC, 7));\n\t\tvertexB.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexB, 7));\n\t\tedges.add(new Edge(vertexD, 9));\n\t\tedges.add(new Edge(vertexF, 1));\n\t\tvertexC.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 6));\n\t\tedges.add(new Edge(vertexC, 9));\n\t\tedges.add(new Edge(vertexE, 4));\n\t\tedges.add(new Edge(vertexG, 8));\n\t\tvertexD.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexD, 4));\n\t\tedges.add(new Edge(vertexF, 3));\n\t\tvertexE.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 5));\n\t\tedges.add(new Edge(vertexC, 1));\n\t\tedges.add(new Edge(vertexE, 3));\n\t\tvertexF.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexD, 8));\n\t\tvertexG.incidentEdges = edges;\n\n\t\tgraph.add(vertexA);\n\t\tgraph.add(vertexB);\n\t\tgraph.add(vertexC);\n\t\tgraph.add(vertexD);\n\t\tgraph.add(vertexE);\n\t\tgraph.add(vertexF);\n\t\tgraph.add(vertexG);\n\n\t\treturn graph;\n\t}", "public ArrayList< Vertex > adjacentVertices( ) {\n return adjacentVertices;\n }", "@Override\n public Set<Vertex> getVertices() {\n Set<Vertex> vertices = new HashSet<Vertex>();\n vertices.add(sourceVertex);\n vertices.add(targetVertex);\n return vertices;\n }", "public Set<Vertex> pre(Vertex start){\n\t\tSet<Vertex> reach = new HashSet<Vertex>();\n\t\tif(this.edgesByEnd.get(start) == null)\n\t\t\treturn reach;\n\t\tfor(LabeledEdge trans : this.edgesByEnd.get(start)){\n\t\t\treach.add(trans.getStart());\n\t\t}\n\t\treturn reach;\n\t}", "@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 List<Transition> getOutTransitions() {\r\n\t\treturn outTransitions;\r\n\t}", "public Enumeration vertices();", "private void backTrack(String start, AdjVertex end, Vertex parent){\r\n\t\tif(parent.name.compareToIgnoreCase(start) == 0){ \r\n\t\t\t//if we have found our way back to the start, then we print the result\r\n\t\t\tif(pathStack.isEmpty()){\r\n\t\t\t\tSystem.out.println(start + \" -- \" + end.name);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.print(start + \" -- \" + end.name);\r\n\t\t\t\twhile(!pathStack.isEmpty()){\r\n\t\t\t\t\tSystem.out.print(\" -- \" + pathStack.pop());\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//if we still have to find our way back to the first person,\r\n\t\t//we push the end name into the stack, \r\n\t\telse{ \r\n\t\t\tpathStack.push(end.name);\r\n\t\t\tconnector(start, parent.name);\r\n\t\t}\r\n\t}", "public static ArrayList<String> shortestChain(Graph g, String p1, String p2) {\t\n\t\tif (g == null || p1 == null || p2 == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (g.map.get(p1) == null || g.map.get(p2) == null) {\n\t\t\treturn null;\n\t\t}\n\t\tboolean [] traversed = new boolean [g.members.length];\n\t\tboolean targetfound = false;\n\t\tArrayList <Person> names = new ArrayList<>();\n\t\tArrayList <String> shortestPath = new ArrayList<>();\n\t\tQueue <Person> list = new Queue<>();\n\t\tPerson start = g.members[g.map.get(p1)];\n\t\tPerson target = g.members[g.map.get(p2)];\n\t\t\n\t\tlist.enqueue(start);\n\t\twhile(!list.isEmpty()) {\n\t\t\tPerson temp = list.dequeue();\n\t\t\tnames.add(temp);\n\t\t\tif(target.equals(temp)) {\n\t\t\t\ttargetfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tint nameIndex = g.map.get(temp.name);\n\t\t\ttraversed[nameIndex] = true;\n\t\t\tFriend adjacent = g.members[nameIndex].first;\n\t\t\twhile(adjacent != null) {\n\t\t\t\tif(traversed[adjacent.fnum] == false) {\n\t\t\t\t\tlist.enqueue(g.members[adjacent.fnum]);\n\t\t\t\t\t\tif(target.equals(g.members[adjacent.fnum])) {\n\t\t\t\t\t\t\ttargetfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tadjacent = adjacent.next;\n\t\t\t}\n\t\t}\t\t\n\t\tStack <String> flip = new Stack<>();\n\t\tif (targetfound == true) {\n\t\t\tint minIndex;\n\t\t\tint i = names.size()-1;\n\t\t\tflip.push(names.get(i).name);\n\t\t\twhile (i != 0) {\n\t\t\t\tFriend ptr = names.get(i).first; \n\t\t\t\tminIndex = Integer.MAX_VALUE;\n\t\t\t\twhile (ptr != null) {\n\t\t\t\t\tPerson tempName = g.members[ptr.fnum];\n\t\t\t\t\tfor (int j = 0; j<names.size(); j++) {\n\t\t\t\t\t\tif ( j < i && tempName == names.get(j) && j < minIndex){\n\t\t\t\t\t\t\tminIndex = j;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tptr = ptr.next;\n\t\t\t\t}\n\t\t\t\ti = minIndex;\n\t\t\t\tflip.push(names.get(i).name);\n\t\t\t}\n\t\t\twhile (!flip.isEmpty()) {\n\t\t\t\tshortestPath.add(flip.pop());\n\t\t\t} \n\t\t\treturn shortestPath;\n\t\t}\n\t\treturn null;\n\t}", "public void displayAsList()\n\t{\n\t\tSystem.out.println(\"Printing all vertices\");\n\t\tvertices.show();\n\t}", "private void transPose(graph g) {\n\t\tIterator it = g.getV().iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tnode_data temp = (node_data) it.next();\n\t\t\tif(g.getE(temp.getKey())!=null) {\n\t\t\t\tIterator it1 = g.getE(temp.getKey()).iterator();\n\t\t\t\twhile (it1.hasNext()) {\n\t\t\t\t\tedge_data temp1 = (edge_data) it1.next();\n\t\t\t\t\tif (temp1 != null && temp1.getTag() == 0) {\n\t\t\t\t\t\tif (g.getEdge(temp1.getDest(), temp1.getSrc()) != null) {\n\t\t\t\t\t\t\tEdge temps = new Edge((Edge)g.getEdge(temp1.getSrc(),temp1.getDest()));\n\t\t\t\t\t\t\tdouble weight1 = g.getEdge(temp1.getSrc(),temp1.getDest()).getWeight();\n\t\t\t\t\t\t\tdouble weight2 = g.getEdge(temp1.getDest(),temp1.getSrc()).getWeight();\n\t\t\t\t\t\t\tg.connect(temp1.getSrc(),temp1.getDest(),weight2);\n\t\t\t\t\t\t\tg.connect(temps.getDest(),temps.getSrc(),weight1);\n\t\t\t\t\t\t\tg.getEdge(temps.getDest(), temps.getSrc()).setTag(1);\n\t\t\t\t\t\t\tg.getEdge(temps.getSrc(),temps.getDest()).setTag(1);\n\t\t\t\t\t\t\tit1 = g.getE(temp.getKey()).iterator();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tg.connect(temp1.getDest(), temp1.getSrc(), temp1.getWeight());\n\t\t\t\t\t\t\tg.getEdge(temp1.getDest(), temp1.getSrc()).setTag(1);\n\t\t\t\t\t\t\tg.removeEdge(temp1.getSrc(), temp1.getDest());\n\t\t\t\t\t\t\tit1 = g.getE(temp.getKey()).iterator();\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 List<Transition> getTransitionsFromState(final State from) {\n\t\tList<Transition> toReturn = transitionArrayFromStateMap.get(from);\n\t\tif (toReturn == null) {\n\t\t\tfinal List<Transition> list = transitionFromStateMap.get(from);\n\t\t\ttoReturn = list;\n\t\t\ttransitionArrayFromStateMap.put(from, toReturn);\n\t\t}\n\t\treturn toReturn;\n\t}", "public static void main(String argv[]) {\n\n\tRandomIntGenerator rand = new RandomIntGenerator(5,10);\n\tRandomIntGenerator rand2 = new RandomIntGenerator(10,15);\n\tRandomIntGenerator rand3 = new RandomIntGenerator(1,2);\n\n\tint vertices = rand.nextInt();\n\tSystem.out.println(\"vertices=\"+vertices);\n\t\n\tRandomIntGenerator rand4 = new RandomIntGenerator(0,vertices-1);\n\n\tTrAnchor[] vertex = new TrAnchor[vertices];\n\tfor (int i=0;i<vertices;i++) {\n\t int t=rand3.nextInt();\n\t if (t==1) {\n\t\tvertex[i] = new Statename(\"S\"+i);\n\t } else if (t==2) {\n\t\tvertex[i] = new Conname(\"C\"+i);\n\t } else {\n\t\tvertex[i] = new UNDEFINED();\n\t }\n\t}\n\n\tint edges = rand2.nextInt();\n\tSystem.out.println(\"edges=\"+edges);\n\t\n\tTr[] transition = new Tr[edges];\n\tfor (int i=0;i<edges;i++) {\n\t int si = rand4.nextInt();\n\t int ti = rand4.nextInt();\n\t \n\t TrAnchor source = vertex[si];\n\t TrAnchor target = vertex[ti];\n\t transition[i] = new Tr(source,target,null);\n\t}\n\t \n\tSystem.out.println();\n\tSystem.out.println(\"Ausgabe:\");\n\n\tfor (int i=0;i<edges;i++) \n\t new PrettyPrint().start(transition[i]);\n\t\n\ttesc2.ProperMap properMap = new tesc2.ProperMap(vertex,transition);\n\n\tfor (int i=0;i<properMap.getHeight();i++) {\n\t System.out.print(properMap.getWidthOfRow(i));\n\t \n\t for (int j=0;j<properMap.getWidthOfRow(i);j++) {\n\t\tSystem.out.print(properMap.getElement(i,j)+\" \");\n\t }\n\t System.out.println();\n\t}\n\n\ttesc2.MapTransition[] mt = properMap.getMapTransitions();\n\tfor (int i=0;i<mt.length;i++)\n\t System.out.println(mt[i]);\n\n }", "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}", "Iterable<Vertex> computePath(Vertex start, Vertex end) throws GraphException;", "public Enumeration adjacentVertices(Position vp) throws InvalidPositionException;", "@Override\n public Iterable<V> adjacentTo(V from)\n {\n if (from.equals(null)){\n throw new IllegalArgumentException();\n }\n Iterator graphIterator = graph.entrySet().iterator();\n \t Map.Entry graphElement = (Map.Entry) graphIterator.next();\n \t V vert = (V)graphElement.getKey();\n \t while (graphIterator.hasNext() && vert != from){\n \t\tgraphElement = (Map.Entry) graphIterator.next();\n \t\tvert = (V)graphElement.getKey();\n \t }\n \t ArrayList <V> edges = graph.get(vert);\n \t //Iterable <V> e = edges;\n \t return edges;\n }", "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 }", "public boolean canIterateAllTransitions () { return false; }", "@ApiModelProperty(value = \"The transitions that can be performed on the issue.\")\n public List<IssueTransition> getTransitions() {\n return transitions;\n }", "public long[][] getTransitionIds() {\n\t\treturn this.transitionIds;\n\t}", "Iterable<T> followNodeAndSelef(T start) throws NullPointerException;", "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 Collection<Vertex> adjacentVertices(Vertex v) {\n Vertex parameterVertex = new Vertex(v.getLabel());\n if(!myGraph.containsKey(parameterVertex)){\n throw new IllegalArgumentException(\"Vertex is not valid\");\n }\n\n //create a copy of the passed in vertex to restrict any reference\n //to interals of this class\n Collection<Vertex> adjVertices = new ArrayList<Vertex>();\n\n Iterator<Edge> edges = myGraph.get(parameterVertex).iterator();\n while(edges.hasNext()) {\n adjVertices.add(edges.next().getDestination());\n }\n return adjVertices;\n }", "public List<NavArc> listOutgoing() {\r\n List<NavArc> result = new ArrayList<>(outgoing);\r\n return result;\r\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 }", "Iterable<Vertex> computePathToGraph(Loc start, Vertex end) throws GraphException;", "public Stack<Vertex> next() {\n Vertex u = lov.pop();\n for (Edge e : u.outEdges) {\n if (!e.to.visited) {\n cameFromEdge.put(e.to.toIdentifier(), e.from);\n if (e.to.x == MazeWorld.width - 1 && e.to.y == MazeWorld.height - 1) {\n reconstruct(cameFromEdge, e.to);\n lov = new Stack<Vertex>();\n }\n else {\n lov.push(u);\n e.to.visited = true;\n lov.push(e.to);\n break;\n }\n }\n }\n return lov;\n }", "public List<node_info> shortestPath(int src, int dest);", "protected Transition addTransitionSteps(Transition transition,\n InternalSystemEntryDelta entryDelta,\n Object fromState,\n Object toState)\n {\n // nothing to do if both states are equal!\n if(LangUtils.isEqual(fromState, toState))\n return transition;\n \n if(fromState == null)\n fromState = StateMachine.NONE;\n \n if(toState == null)\n toState = StateMachine.NONE;\n \n // when no state machine (empty agents) nothing to do...\n StateMachine stateMachine = entryDelta.getStateMachine();\n if(stateMachine == null)\n return transition;\n\n int distance = stateMachine.getDistance(fromState, toState);\n \n @SuppressWarnings(\"unchecked\")\n Collection<Map<String,String>> path =\n (Collection<Map<String,String>>) entryDelta.getStateMachine().findShortestPath(fromState,\n toState);\n for(Map<String, String> p : path)\n {\n Transition newTransition =\n addTransition(entryDelta, p.get(\"action\"), p.get(\"to\"), distance);\n newTransition.executeAfter(transition);\n transition = newTransition;\n }\n \n return transition;\n }", "public Vertex<VV> getTo()\r\n { return to; }", "public static void traversals(Node node){\r\n System.out.println(\"Node Pre \" + node.data);\r\n for(Node child : node.children){\r\n System.out.println(\"Edge Pre \" + node.data + \"--\" + child.data);\r\n traversals(child);\r\n System.out.println(\"Edge Post \" + node.data + \"--\" + child.data);\r\n }\r\n System.out.println(\"Node Post \" + node.data);\r\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 }", "@Override\n\tpublic String toString() {\n\t\tfinal StringBuffer buffer = new StringBuffer();\n\t\tbuffer.append(super.toString());\n\t\tbuffer.append('\\n');\n\t\tfor (final State state : getStates()) {\n\t\t\tif (initialState == state) {\n\t\t\t\tbuffer.append(\"--> \");\n\t\t\t}\n\t\t\tbuffer.append(state);\n\t\t\tif (isFinalState(state)) {\n\t\t\t\tbuffer.append(\" **FINAL**\");\n\t\t\t}\n\t\t\tbuffer.append('\\n');\n\t\t\tfor (final Transition transition : getTransitionsFromState(state)) {\n\t\t\t\tbuffer.append('\\t');\n\t\t\t\tbuffer.append(transition);\n\t\t\t\tbuffer.append('\\n');\n\t\t\t}\n\t\t}\n\n\t\treturn buffer.toString();\n\t}", "private String transitionTable() {\r\n\r\n\t\tString transitionTable = \"\t\";\r\n\t\tchar[][] matrix = new char[numStates.size() + 1][alphabet.size() + 1];\r\n\t\tStringBuilder bldmatrix = new StringBuilder();\r\n\r\n\t\tfor (int i = 0; i < matrix.length; i++) {\r\n\t\t\tfor (int j = 0; j < matrix[i].length; j++) {\r\n\t\t\t\tif (i == 0) {\r\n\t\t\t\t\tif (j == 0) {\r\n\t\t\t\t\t\tmatrix[i][j] = ' ';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tArrayList<Character> trans = new ArrayList<>(alphabet);\r\n\t\t\t\t\t\tmatrix[i][j] = trans.get(j - 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (j == 0) {\r\n\t\t\t\t\t\tmatrix[i][j] = numStates.get(i - 1).getName().charAt(0);\r\n\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\tArrayList<Character> trans2 = new ArrayList<>(alphabet);\r\n\t\t\t\t\t\tmatrix[i][j] = ((NFAState) getToState(numStates.get(i - 1), trans2.get(j - 1))).getName()\r\n\t\t\t\t\t\t\t\t.charAt(0);\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\tfor (int x = 0; x < matrix.length; x++) {\r\n\t\t\tfor (int y = 0; y < matrix[x].length; y++) {\r\n\t\t\t\tbldmatrix.append(\"\\t\" + matrix[x][y]);\r\n\r\n\t\t\t}\r\n\t\t\tbldmatrix.append(\"\\n\");\r\n\t\t}\r\n\r\n\t\ttransitionTable = bldmatrix.toString();\r\n\r\n\t\treturn transitionTable;\r\n\r\n\t}", "public Set<Vec3i> transConnections();", "Transition createTransition();", "Transition createTransition();", "String convertTransition(Transition instanceValue);", "@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 Graph(){\r\n this.listEdges = new ArrayList<>();\r\n this.listNodes = new ArrayList<>();\r\n this.shown = true;\r\n }", "public NewTransitionRecord(){\r\n fromstate = 0;\r\n tostate = 0;\r\n rate = 0.0;\r\n }", "public List<Eventable> getShortestPath(StateVertex start, StateVertex end) {\n\t\treturn DijkstraShortestPath.findPathBetween(sfg, start, end);\n\t}", "@Override\n\t\tpublic void vertexCallback(List<String> vertex)\n\t\t{\n\t\t\tList<String> v = new ArrayList<String>(vertex.size());\n\t\t\tv.addAll(vertex);\n\t\t\tm_hyperedge.add(v);\n\t\t}", "public void transitionStates () {\n myCurrentState = myNextState;\n myNextState = null;\n }", "private List<Edge<T>> getPath(T target) {\n List<Edge<T>> path = new LinkedList<>();\n T step = target;\n // check if a path exists\n if (predecessors.get(step) == null) {\n return path;\n }\n while (predecessors.get(step) != null) {\n T endVertex = step;\n step = predecessors.get(step);\n T startVertex = step;\n path.add(getEdge(startVertex, endVertex));\n }\n // Put it into the correct order\n Collections.reverse(path);\n return path;\n }", "public ArrayList<Vertex> initStart() {\r\n\t\tArrayList<Vertex> startPoint = new ArrayList<>();\r\n\t\tstartPoint.add(new Vertex(17, 2));\r\n\t\tstartPoint.add(new Vertex(16, 14));\r\n\t\tstartPoint.add(new Vertex(15, 14));\r\n\t\tstartPoint.add(new Vertex(11, 22));\r\n\t\tstartPoint.add(new Vertex(11, 21));\r\n\t\tstartPoint.add(new Vertex(22, 3));\r\n\t\tstartPoint.add(new Vertex(22, 2));\r\n\t\tstartPoint.add(new Vertex(20, 3));\r\n\t\tstartPoint.add(new Vertex(17, 21));\r\n\t\tstartPoint.add(new Vertex(17, 20));\r\n\t\tstartPoint.add(new Vertex(15, 21));\r\n\t\tstartPoint.add(new Vertex(12, 21));\r\n\t\treturn startPoint;\r\n\t}", "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 Vertex getPrevious(){\n return previous;\n }", "private Graph constructReversedGraph() {\n Graph Gt = new Graph(this.nodes.size());\n for (int i = 0; i < this.nodes.size(); i++) {\n // the from node in the original graph\n Node from = this.nodes.get(i);\n // set the finishing time from the original graph to the same node in G^t so we can sort by finishing times\n Gt.getNodes().get(i).setF(from.getF());\n for (int j = 0; j < from.getAdjacencyList().size(); j++) {\n Node to = from.getAdjacencyList().get(j);\n Gt.addEdge(to.getName(), from.getName());\n }\n }\n return Gt;\n }", "private static List<State<StepStateful>> getStates() {\n List<State<StepStateful>> states = new LinkedList<>();\n states.add(s0);\n states.add(s1);\n states.add(s2);\n states.add(s3);\n states.add(s4);\n states.add(s5);\n states.add(s6);\n return states;\n }", "public void shortestPathList() {\n Cell cell = maze.getGrid()[r - 1][r - 1];\n\n parents.add(cell);\n\n while (cell.getParent() != null) {\n parents.add(cell.getParent());\n cell = cell.getParent();\n }\n\n Collections.reverse(parents);\n }", "public ArrayList<Vertex> getPath(Vertex target) {\n\t\tArrayList<Vertex> path = new ArrayList<Vertex>();\n\t\tVertex step = target;\n\t\t// check if a path exists\n\t\tif (predecessors.get(step) == null) {\n\t\t\treturn null;\n\t\t}\n\t\tpath.add(step);\n\t\twhile (predecessors.get(step) != null) {\n\t\t\tstep = predecessors.get(step);\n\t\t\tpath.add(step);\n\t\t}\n\t\t// Put it into the correct order\n\t\tCollections.reverse(path);\n\n\n\t\tVertex current=null;\n\t\tVertex next=null;\n\t\tint length = path.size();\n\t\tfor(int i=0;i<length-1;i++){\n current = path.get(i);\n\t\t\t next = path.get(i+1);\n\t\t\tif(!rapid && (nodeColor_map.get(current.getName()).equalsIgnoreCase(\"dB\")||\n\t\t\t\t\tnodeColor_map.get(next.getName()).equalsIgnoreCase(\"dB\")))\n\t\t\t\trapid = true;\n\t\t\troute_length+= edge_length_map.get(new Pair(current,next));\n\t\t}\n\n\t\treturn path;\n\t}", "@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 }", "void dijkstra(Coordinate startName) {\n if (!graph.containsKey(startName)) {\n //test use print statement\n //System.out.printf(\"Graph doesn't contain start vertex \\\"%s\\\"\\n\", startName);\n return;\n }\n final Node source = graph.get(startName);\n NavigableSet<Node> queue = new TreeSet<>();\n\n // set-up vertices\n for (Node node : graph.values()) {\n node.previous = node == source ? source : null;\n node.dist = node == source ? 0 : Integer.MAX_VALUE;\n queue.add(node);\n }\n dijkstra(queue);\n }", "List<Edge<V>> getEdgeList();", "List<IEdge> getMST();", "private void generatePath(List<Coordinate> source, List<Coordinate> path) {\n for (int i = 0; i < source.size() - 1; i++) {\n Graph graph = new Graph(getEdge(map));\n Coordinate start = source.get(i);\n Coordinate end = source.get(i + 1);\n graph.dijkstra(start);\n graph.printPath(end);\n for (Graph.Node node : graph.getPathReference()) {\n path.add(node.coordinate);\n }\n }\n }", "private static String getTransitionString(Transition expected) {\n\t\treturn expected.getFromState().getName()+\"-->\"+expected.getDescription()+\"-->\"+expected.getToState().getName();\n\t}", "void graph3() {\n\t\tconnect(\"0\", \"0\");\n\t\tconnect(\"2\", \"2\");\n\t\tconnect(\"2\", \"3\");\n\t\tconnect(\"3\", \"0\");\n\t}" ]
[ "0.60274565", "0.59459853", "0.5653537", "0.5623923", "0.55991095", "0.5575491", "0.54735845", "0.54457915", "0.54230344", "0.54052055", "0.5402273", "0.53112406", "0.529343", "0.52888334", "0.5267993", "0.52449924", "0.52421796", "0.5237609", "0.52176666", "0.52165955", "0.52111953", "0.51894903", "0.5175276", "0.5169538", "0.51587695", "0.5141406", "0.5140116", "0.50795394", "0.5076426", "0.50708216", "0.50693417", "0.50496006", "0.50390005", "0.50313807", "0.50307107", "0.497632", "0.49729627", "0.4943201", "0.4937734", "0.49204928", "0.49161577", "0.4914503", "0.4905034", "0.49038836", "0.48963344", "0.48937434", "0.48878673", "0.48808512", "0.48617536", "0.4859587", "0.48588547", "0.4854902", "0.48520055", "0.4849644", "0.48390818", "0.48385072", "0.48370692", "0.4828387", "0.48234746", "0.48111433", "0.4802689", "0.48026875", "0.47999", "0.47991806", "0.47912958", "0.47851095", "0.4781004", "0.47710836", "0.47696057", "0.4768069", "0.47593662", "0.47573033", "0.47569475", "0.47502792", "0.47490275", "0.4735848", "0.47293955", "0.47293955", "0.4727559", "0.47219682", "0.47219455", "0.47180367", "0.47170544", "0.47151238", "0.4714712", "0.47143888", "0.47109863", "0.47078842", "0.47049493", "0.46996942", "0.46976295", "0.46974972", "0.46957242", "0.4686777", "0.46820867", "0.46797872", "0.46757573", "0.4674955", "0.46726885", "0.46679404" ]
0.61366224
0
TODO Autogenerated method stub
@Override public View getView(int position, View convertView, ViewGroup parent) { View view = super.getView(position, convertView, parent); ViewHolder helper = getViewHolderNow(); MyOnClickListener myOnClickListener = (MyOnClickListener) helper.getOnClickListener(); if(myOnClickListener==null) myOnClickListener = new MyOnClickListener(); myOnClickListener.setPosition(position); myOnClickListener.setHelper(helper); myOnClickListener.setRecommendRoute(mDatas.get(position)); aboutOnClickListener(helper,myOnClickListener); return view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onClick(View v) { onLoveClick(helper, recommendRoute); // boolean isCollected = VGDao.getInstance(getContext()).getRecommendRouteCollected(recommendRoute.getRouteID()); // helper.setImageSelected(R.id.bigscenelist_love_iv, (isCollected==false)); // VGDao.getInstance(getContext()).setRecommendRouteCollected(recommendRoute.getRouteID(), (isCollected==false)?1: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
new FlatChunkGenerator(world, new DungeonBiomeProvider(), new FlatGenerationSettings());
@Override @Nonnull public EndChunkGenerator createChunkGenerator() { return new EndChunkGenerator(world, new DungeonBiomeProvider(), new EndGenerationSettings()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic IChunkProvider createChunkGenerator()\n\t{\n\t\treturn new ChunkProviderHeaven(worldObj, worldObj.getSeed(), true);\n\t}", "private static void generateWorld(){\n for(int i = 0; i < SIZE*SIZE; i++){\n new Chunk();\n }\n }", "public IChunkProvider createChunkGenerator() {\n\t\treturn new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());\n\t}", "public IChunkProvider createChunkGenerator()\n {\n return new ChunkProviderXirk(this.worldObj, this.worldObj.getSeed(), false);\n }", "public static GenLayer[] initializeAllBiomeGeneratorsTofu(long seed, WorldType worldType)\n {\n byte biomeSize = getModdedBiomeSize(worldType, (byte) (worldType == WorldType.LARGE_BIOMES ? 7 : 5));\n\n\n GenLayerIsland genlayerisland = new GenLayerIsland(1L);\n GenLayerFuzzyZoom genlayerfuzzyzoom = new GenLayerFuzzyZoom(2000L, genlayerisland);\n GenLayerAddIsland genlayeraddisland = new GenLayerAddIsland(1L, genlayerfuzzyzoom);\n GenLayerZoom genlayerzoom = new GenLayerZoom(2001L, genlayeraddisland);\n genlayeraddisland = new GenLayerAddIsland(2L, genlayerzoom);\n genlayeraddisland = new GenLayerAddIsland(50L, genlayeraddisland);\n genlayeraddisland = new GenLayerAddIsland(70L, genlayeraddisland);\n genlayeraddisland = new GenLayerAddIsland(3L, genlayeraddisland);\n genlayeraddisland = new GenLayerAddIsland(2L, genlayeraddisland);\n GenLayerEdge genlayeredge = new GenLayerEdge(2L, genlayeraddisland, GenLayerEdge.Mode.COOL_WARM);\n genlayeredge = new GenLayerEdge(2L, genlayeredge, GenLayerEdge.Mode.HEAT_ICE);\n genlayeredge = new GenLayerEdge(3L, genlayeredge, GenLayerEdge.Mode.SPECIAL);\n genlayerzoom = new GenLayerZoom(2002L, genlayeredge);\n genlayerzoom = new GenLayerZoom(2003L, genlayerzoom);\n genlayeraddisland = new GenLayerAddIsland(4L, genlayerzoom);\n\n GenLayerTofu genlayer3 = GenLayerZoom.magnify(1000L, genlayeraddisland, 0);\n GenLayerTofu genlayer = GenLayerZoom.magnify(1000L, genlayer3, 0);\n GenLayerRiverInit genlayerriverinit = new GenLayerRiverInit(100L, genlayer);\n Object object = GenLayerTofu.getBiomeLayer(seed, genlayer3, worldType);\n\n GenLayerTofu genlayer1 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2);\n GenLayerHills genlayerhills = new GenLayerHills(1000L, (GenLayerTofu)object, genlayer1);\n genlayer = GenLayerZoom.magnify(1000L, genlayerriverinit, 2);\n genlayer = GenLayerZoom.magnify(1000L, genlayer, biomeSize);\n GenLayerRiver genlayerriver = new GenLayerRiver(1L, genlayer);\n GenLayerSmooth genlayersmooth = new GenLayerSmooth(1000L, genlayerriver);\n object = GenLayerZoom.magnify(1000L, genlayerhills, 2);\n\n for (int j = 0; j < biomeSize; ++j)\n {\n object = new GenLayerZoom((long)(1000 + j), (GenLayerTofu)object);\n\n if (j == 0)\n {\n object = new GenLayerAddIsland(3L, (GenLayerTofu)object);\n }\n if (j == 1)\n {\n object = new GenLayerShore(1000L, (GenLayerTofu)object);\n }\n }\n\n GenLayerSmooth genlayersmooth1 = new GenLayerSmooth(1000L, (GenLayerTofu)object);\n GenLayerRiverMix genlayerrivermix = new GenLayerRiverMix(100L, genlayersmooth1, genlayersmooth);\n\n\n GenLayerTofu layerVoronoi = new GenLayerTofuVoronoiZoom(10L, genlayerrivermix);\n\n genlayerrivermix.initWorldGenSeed(seed);\n\n layerVoronoi.initWorldGenSeed(seed);\n\n return new GenLayer[] {genlayerrivermix, layerVoronoi};\n }", "private void generateWorld() {\n\t\t// Loop through all block locations where a block needs to be generated\n\t\tfor(int x=0; x<WORLD_SIZE; x++) {\n\t\t\tfor(int z=0; z<WORLD_SIZE; z++) {\n\t\t\t\tfor(int y=0; y<WORLD_HEIGHT/2; y++) {\n\t\t\t\t\tsetBlockAt(x, y, z, BlockType.STONE);\n\t\t\t\t\tif(y > (WORLD_HEIGHT/2) - 5)\n\t\t\t\t\t\tsetBlockAt(x, y, z, BlockType.DIRT);\n\t\t\t\t\tif(y == (WORLD_HEIGHT/2) -1)\n\t\t\t\t\t\tsetBlockAt(x, y, z, BlockType.GRASS);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Generate NUM_DIAMONDS of diamonds in random locations\n\t\tfor(int i=0; i<NUM_DIAMONDS; i++)\n\t\t\tsetBlockAt(getRandomLocation(), BlockType.DIAMOND);\t\n\t}", "private void generateNextChunk() {\n \n chunkNumber++;\n \n // generate a chunk filled with content\n List<Object> list = chunkFactory.generateChunk(chunkNumber);\n Vector3f newChunkPosition =\n new Vector3f(nextChunkX, 0f, 0f);\n nextChunkX += P.chunkLength;\n\n for (Object object : list) {\n if (object instanceof Spatial) {\n Spatial spatial = (Spatial) object;\n addToLevel(spatial, spatial.getLocalTranslation().add(newChunkPosition));\n } else if (object instanceof SpotLight) {\n SpotLight light = (SpotLight) object;\n addToLevel(light, light.getPosition().add(newChunkPosition));\n } else if (object instanceof PointLight) {\n PointLight light = (PointLight) object;\n addToLevel(light, light.getPosition().add(newChunkPosition)); \n }\n }\n\n }", "public void generateTerrain()\n\t{\n\t\tint rand;\n\t\tint starting=(int)(blocksWide*0.45);//Choose the first grass block\n\t\tblocksTall=(int)(blocksWide*0.6);\n\t\tfor(int i=0;i<blocksWide;i++)\n\t\t{\n\t\t\t//Determine whether the next block will go up a level, down a level or stay the same (55% chance of staying the same)\n\t\t\trand=ThreadLocalRandom.current().nextInt(0,3);\t\n\t\t\tif(rand!=0)\n\t\t\t{\n\t\t\t\trand=ThreadLocalRandom.current().nextInt(-1,2);\n\t\t\t}\n\t\t\tif(starting+rand<blocksTall-2 && starting+rand>4)\t//Make sure new position isn't too close to the top or bottom\n\t\t\t{\n\t\t\t\tstarting+=rand;\n\t\t\t}\n\t\t\tgrassy[i]=starting;\n\t\t\tgrassT[i]=ThreadLocalRandom.current().nextInt(0,3);\n\t\t\t//Generate a platform to allow for collision detection\n\t\t\tplatforms.add(new Platform((double)i/blocksWide,(double)starting/blocksTall,1.0/blocksWide,1.0/blocksWide));\n\t\t}\n\t\tplatforms.add(new Platform(0.0,0.0,0.0,0.0));\n\t}", "public MapGenWoodChest()\n {\n// this.scatteredFeatureSpawnList = Lists.<Biome.SpawnListEntry>newArrayList();\n this.maxChunkDistanceBetweenF = 32;\n// this.minChunkDistanceBetweenF = 8;\n// this.scatteredFeatureSpawnList.add(new Biome.SpawnListEntry(EntityWitch.class, 1, 1, 1));\n }", "public Chunk provideChunk(int par1, int par2)\n {\n endRNG.setSeed((long)par1 * 0x4f9939f508L + (long)par2 * 0x1ef1565bd5L);\n byte abyte0[] = new byte[32768];\n biomesForGeneration = endWorld.getWorldChunkManager().loadBlockGeneratorData(biomesForGeneration, par1 * 16, par2 * 16, 16, 16);\n func_40380_a(par1, par2, abyte0, biomesForGeneration);\n func_40381_b(par1, par2, abyte0, biomesForGeneration);\n Chunk chunk = new Chunk(endWorld, abyte0, par1, par2);\n byte abyte1[] = chunk.getBiomeArray();\n\n for (int i = 0; i < abyte1.length; i++)\n {\n abyte1[i] = (byte)biomesForGeneration[i].biomeID;\n }\n\n chunk.generateSkylightMap();\n return chunk;\n }", "public void registerWorldChunkManager() {\n\t\tthis.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.sky, 0.5F, 0.0F);\n\t\tthis.dimensionId = 1;\n\t\tthis.hasNoSky = true;\n\t}", "WorldGenerator getForWorld(World world);", "@Override\n public BiomeDecorator createBiomeDecorator()\n { \n return new BiomeDecoratorAtum(this);\n }", "public void registerWorldChunkManager()\n\t{\n\t\tthis.worldChunkMgr = new WorldChunkMangerHeaven(worldObj.getSeed(), terrainType);\n\t\tthis.hasNoSky = false;\n\t}", "void postGen(World world, int x, int y, int z);", "public void populate(IChunkProvider loader, int chunkX, int chunkZ)\n\t{\n\t\tBlockFalling.fallInstantly = true;\n\t\tint k = chunkX * 16;\n\t\tint l = chunkZ * 16;\n\t\tBiomeGenBase biomegenbase = worldObj.getBiomeGenForCoords(k + 16, l + 16);\n\t\trand.setSeed(worldObj.getSeed());\n\t\tlong i1 = rand.nextLong() / 2L * 2L + 1L;\n\t\tlong j1 = rand.nextLong() / 2L * 2L + 1L;\n\t\trand.setSeed(chunkX * i1 + chunkZ * j1 ^ worldObj.getSeed());\n\t\tboolean flag = false;\n\n\t\tint k1;\n\t\tint l1;\n\t\tint i2;\n\n\t\t//controls vanilla ores and things like dirt patches\n\t\t//biomegenbase.decorate(worldObj, rand, k, l);\n\n\t\t//if (TerrainGen.populate(loader, worldObj, rand, chunkX, chunkZ, flag, ANIMALS)) {\n\t\t//\tSpawnerAnimals.performWorldGenSpawning(worldObj, biomegenbase, k + 8, l + 8, 16, 16, rand);\n\t\t//}\n\t\tk += 8;\n\t\tl += 8;\n\n\t\tBlockFalling.fallInstantly = false;\n\t}", "@Override\n protected void generateMonsters()\n {\n generateWeakEnemies(2);\n generateStrongEnemies(12);\n generateElites(10);\n }", "public Chunk provideChunk(int chunkX, int chunkZ)\n\t{\n\t\trand.setSeed(chunkX * 341873128712L + chunkZ * 132897987541L);\n\t\tBlock[] ablock = new Block[65536];\n\t\tbyte[] abyte = new byte[65536];\n\t\tbiomesForGeneration = new BiomeGenBase[256];//chunkManager.loadBlockGeneratorData(biomesForGeneration, chunkX * 16, chunkZ * 16, 16, 16);\n\t\tfor (int dx = 0; dx < 16; dx++) {\n\t\t\tfor (int dz = 0; dz < 16; dz++) {\n\t\t\t\tint x = chunkX*16+dx;\n\t\t\t\tint z = chunkZ*16+dz;\n\t\t\t\tint i = dz*16+dx;\n\t\t\t\tbiomesForGeneration[i] = BiomeDistributor.getBiome(x, z);\n\t\t\t}\n\t\t}\n\t\tthis.generateColumnData(chunkX, chunkZ, ablock);\n\t\tablock = this.shiftTerrainGen(ablock, VERTICAL_OFFSET);\n\t\tthis.replaceBlocksForBiome(chunkX, chunkZ, ablock, abyte, biomesForGeneration, VERTICAL_OFFSET);\n\n\t\tthis.runGenerators(chunkZ, chunkZ, ablock, abyte);\n\n\t\tChunk chunk = new Chunk(worldObj, ablock, abyte, chunkX, chunkZ);\n\t\tbyte[] biomeData = chunk.getBiomeArray();\n\n\t\tfor (int k = 0; k < biomeData.length; ++k) {\n\t\t\tbiomeData[k] = (byte)biomesForGeneration[k].biomeID;\n\t\t}\n\n\t\tchunk.generateSkylightMap();\n\n\t\tthis.populate(null, chunkX, chunkZ);\n\n\t\t//chunk.isTerrainPopulated = true; //use this to disable all populators\n\n\t\treturn chunk;\n\t}", "public Chunk provideChunk(int par1, int par2)\n {\n this.random.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);\n byte[] var3 = new byte[32768];\n Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);\n BiomeGenBase[] var5 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, par1 * 16, par2 * 16, 16, 16);\n byte[] var6 = var4.getBiomeArray();\n\n for (int var7 = 0; var7 < var6.length; ++var7)\n {\n var6[var7] = (byte)var5[var7].biomeID;\n }\n\n var4.resetRelightChecks();\n return var4;\n }", "@Override\n\tpublic void registerWorldChunkManager() {\n\t\tworldChunkMgr = new zei_WorldChunkManagerZeitgeist(giants, worldObj);\n\t\tworldType = 99;\n\t\thasNoSky = false;\n\t}", "public void initWorldGenSeed(long p_75905_1_) {\n/* 99 */ this.worldGenSeed = p_75905_1_;\n/* */ \n/* 101 */ if (this.parent != null)\n/* */ {\n/* 103 */ this.parent.initWorldGenSeed(p_75905_1_);\n/* */ }\n/* */ \n/* 106 */ this.worldGenSeed *= (this.worldGenSeed * 6364136223846793005L + 1442695040888963407L);\n/* 107 */ this.worldGenSeed += this.baseSeed;\n/* 108 */ this.worldGenSeed *= (this.worldGenSeed * 6364136223846793005L + 1442695040888963407L);\n/* 109 */ this.worldGenSeed += this.baseSeed;\n/* 110 */ this.worldGenSeed *= (this.worldGenSeed * 6364136223846793005L + 1442695040888963407L);\n/* 111 */ this.worldGenSeed += this.baseSeed;\n/* */ }", "public MapGen()//Collect images, create Platform list, create grassy array and generate a random integer as the map wideness\n\t{\n\t\tblocksWide= ThreadLocalRandom.current().nextInt(32, 64 + 1);\n\t\tclouds=kit.getImage(\"Resources/SkyBackground.jpg\");\n\t\tdirt=kit.getImage(\"Resources/Dirt.png\");\n\t\tgrass[0]=kit.getImage(\"Resources/Grass.png\");\n\t\tgrass[1]=kit.getImage(\"Resources/Grass1.png\");\n\t\tgrass[2]=kit.getImage(\"Resources/Grass2.png\");\n\t\tplatforms=new ArrayList<Platform>();\n\t\tgrassy=new int[blocksWide];\n\t\tgrassT=new int[blocksWide];\n\t\tgenerateTerrain();\n\t\t\n\t\t\n\t\t\n\t}", "@SuppressWarnings(\"InvalidInjectorMethodSignature\")\n @Inject(method = \"generateVeinPart\", at = @At(value = \"INVOKE\", target = \"Lnet/minecraft/world/chunk/ChunkSection;setBlockState(IIILnet/minecraft/block/BlockState;Z)Lnet/minecraft/block/BlockState;\"), locals = LocalCapture.CAPTURE_FAILHARD)\n private void malding(StructureWorldAccess world, Random random, OreFeatureConfig config, double startX, double endX, double startZ, double endZ,\n double startY, double endY, int p_x, int p_y, int p_z, int p_horizontalSize, int p_verticalSize, CallbackInfoReturnable<Boolean> cir,\n int i, BitSet bitSet, BlockPos.Mutable mutable, int j, double[] ds, ChunkSectionCache chunkSectionCache, int m, double d, double e,\n double g, double h, int n, int o, int p, int q, int r, int s, int t, double u, int v, double w, int aa, ChunkSection chunkSection,\n int ad, int ae, int af, BlockState blockState, Iterator<OreFeatureConfig.Target> var57, OreFeatureConfig.Target target) {\n\n if (!Maldenhagen.isOnCopium(target.state.getBlock())) return;\n OWO$COPING.get().put(new BlockPos(t, v, aa), target.state);\n }", "@Override\n public WorldGenerator getRandomWorldGenForTrees(Random par1Random)\n {\n return treeGenerator;\n }", "public BlockType[][] generateChunk(BlockType[][] inputChunk){\n BlockType[][] returnChunk = new BlockType[chunkHeight][boardWidth];\n // Fill the new chunk with air initially\n for(int c = 0; c < boardWidth; c++){\n for(int r = 0; r < returnChunk.length; r++){\n\t\treturnChunk[r][c] = BlockType.AIR;\n\t }\n\t}\n\n\n\tList<BlockPoint> upmostPlattforms = getTopPlattforms(inputChunk);\n\tList<BlockPoint> reachablePositions = getReachablePositions(returnChunk, upmostPlattforms);\n\tList<BlockPoint> chosenPositions = chooseFurthestPoints(reachablePositions);\n\n\n\t// Set the randomly chosen blocks to plattform or powerup randomly,\n\t// and if possible also set their neighbors.\n\tfor(BlockPoint pos : chosenPositions){\n\t BlockType randomBlock = randomBlock();\n\t returnChunk[pos.y][pos.x] = randomBlock;\n\n\t // Extend the point to a plattform of length 3 if possible\n\t if(pos.x > 0){\n\t\treturnChunk[pos.y][pos.x-1] = randomBlock;\n\t }\n\t if(pos.x < boardWidth-1){\n\t \treturnChunk[pos.y][pos.x+1] = randomBlock;\n\t }\n\t}\n\treturn returnChunk;\n\n }", "public void createWorldMap() {\r\n\t\tdo {\r\n\t\t\t//\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Recursive map generation method over here@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n\t\t\t//Generation loop 1 *ADDS VEIN STARTS AND GRASS*\r\n\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\r\n\t\t\t\t\tif (Math.random()*10000>9999) { //randomly spawn a conore vein start\r\n\t\t\t\t\t\ttileMap[i][j] = new ConoreTile (conore, true);\r\n\t\t\t\t\t\tconoreCount++;\r\n\t\t\t\t\t}else if (Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new KannaiteTile(kanna, true);\r\n\t\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new FuelTile(fuel, true);\r\n\t\t\t\t\t\tfuelCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999) {\r\n\t\t\t\t\t\ttileMap[i][j] = new ForestTile(forest, true);\r\n\t\t\t\t\t\tforestCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new OilTile(oil,true);\r\n\t\t\t\t\t}else if(Math.random()*10000>9997) {\r\n\t\t\t\t\t\ttileMap[i][j] = new MountainTile(mountain, true);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\ttileMap[i][j] = new GrassTile(dirt);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} // End for loop \r\n\t\t\t} // End for loop\r\n\t\t\t//End generation loop 1\r\n\r\n\t\t\t//Generation loop 2 *EXPANDS ON THE VEINS*\r\n\t\t\tdo {\r\n\t\t\t\tif (conoreCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new ConoreTile (conore,true);\r\n\t\t\t\t\tconoreCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tconorePass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (kannaiteCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new KannaiteTile (kanna,true);\r\n\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tkannaitePass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (fuelCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new FuelTile (fuel,true);\r\n\t\t\t\t\tfuelCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfuelPass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (forestCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new ForestTile (forest,true);\r\n\t\t\t\t\tforestCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tforestPass = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tSystem.out.println(\"Conore: \" + conoreCount + \" - \" + conorePass);\r\n\t\t\t\tSystem.out.println(\"Kannaite: \" + kannaiteCount + \" - \" + kannaitePass);\r\n\t\t\t\tSystem.out.println(\"Fuel: \" + fuelCount + \" - \" + fuelPass);\r\n\t\t\t\tSystem.out.println(\"Forest: \" + forestCount + \" - \" + forestPass);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}while(!conorePass || !kannaitePass || !fuelPass || !forestPass);\r\n\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\tbuildConore(i,j);\r\n\t\t\t\t\tbuildKannaite(i,j);\r\n\t\t\t\t\tbuildFuel(i,j);\r\n\t\t\t\t\tbuildForest(i,j);\r\n\t\t\t\t}//End of for loop\r\n\t\t\t}//End of for loop\r\n\t\t\t//End of generation loop 2\r\n\r\n\t\t\t//Generation loop 3 *COUNT ORES*\r\n\t\t\tint loop3Count = 0;\r\n\t\t\tconorePass = false;\r\n\t\t\tkannaitePass = false;\r\n\t\t\tfuelPass = false;\r\n\t\t\tforestPass = false;\r\n\t\t\tdo {\r\n\t\t\t\tconoreCount = 0;\r\n\t\t\t\tkannaiteCount = 0;\r\n\t\t\t\tfuelCount = 0;\r\n\t\t\t\tforestCount = 0;\r\n\t\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\t\tif (tileMap[i][j] instanceof ConoreTile) {\r\n\t\t\t\t\t\t\tconoreCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof KannaiteTile) {\r\n\t\t\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof FuelTile) {\r\n\t\t\t\t\t\t\tfuelCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof ForestTile) {\r\n\t\t\t\t\t\t\tforestCount++;\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\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\t\tif (conoreCount < 220) {\r\n\t\t\t\t\t\t\tbuildConore(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tconorePass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (kannaiteCount < 220) {\r\n\t\t\t\t\t\t\tbuildKannaite(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tkannaitePass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (fuelCount< 220) {\r\n\t\t\t\t\t\t\tbuildFuel(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tfuelPass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (forestCount < 220) {\r\n\t\t\t\t\t\t\tbuildForest(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tforestPass = 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\tSystem.out.println(\"Conore: \" + conoreCount + \" - \" + conorePass);\r\n\t\t\t\tSystem.out.println(\"Kannaite: \" + kannaiteCount + \" - \" + kannaitePass);\r\n\t\t\t\tSystem.out.println(\"Fuel: \" + fuelCount + \" - \" + fuelPass);\r\n\t\t\t\tSystem.out.println(\"Forest: \" + forestCount + \" - \" + forestPass);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tloop3Count++;\r\n\t\t\t\tif (loop3Count > 100) {\r\n\t\t\t\t\tSystem.out.println(\"map generation failed! restarting\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}while(!conorePass || !kannaitePass || !fuelPass || !forestPass);\r\n\t\t\t//END OF LOOP 3\r\n\r\n\t\t\t//LOOP 4: THE MOUNTAIN & OIL LOOP\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\tbuildMountain(i,j);\r\n\t\t\t\t\tbuildOil(i,j);\r\n\t\t\t\t}\r\n\t\t\t}//End of THE Mountain & OIL LOOP\r\n\r\n\t\t\t//ADD MINIMUM AMOUNT OF ORES\r\n\r\n\t\t\t//Generation Loop 5 *FINAL SETUP*\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\r\n\t\t\t\t\tif(i == 1 || j == 1 || i == tileMap.length-2 || j == tileMap[i].length-2) {\r\n\t\t\t\t\t\ttileMap[i][j] = new DesertTile(desert);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (i == 0 || j == 0 || i == tileMap.length-1 || j == tileMap[i].length-1) {\r\n\t\t\t\t\t\ttileMap[i][j] = new WaterTile(water);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}//End of for loop\r\n\t\t\t}//End of for loop\r\n\t\t\t//End of generation loop 5\r\n\t\t\t//mapToString();//TEST RUN\r\n\t\t} while(!conorePass || !kannaitePass || !fuelPass || !forestPass); // End createWorldMap method\r\n\t}", "@Override\n\tpublic GenLayer getBiomeLayer(long worldSeed, GenLayer parentLayer)\n\t{\n\t\t//return super.getBiomeLayer(worldSeed, parentLayer);\n\t\tGenLayer ret = new GenLayerBiomePlanet(200L, parentLayer, this);\n\n\t\tret = GenLayerZoom.magnify(1000L, ret, 2);\n\t\tret = new GenLayerEdgeExtendedBiomes(1000L, ret);\n\t\treturn ret;\n\t}", "private void generateLevel() {\n\t\tgenerateBorder();\n\t\tfor (int y = 1; y < height - 1; y++) {\n\t\t\tfor (int x = 1; x < height - 1; x++) {\n\t\t\t\tif (random.nextInt(2) == 1) {\n\t\t\t\t\ttiles[x + y * width] = new Tile(Sprite.getGrass(), false, x, y);\n\t\t\t\t\trandForest(x, y);\n\t\t\t\t} else {\n\t\t\t\t\ttiles[x + y * width] = new Tile(Sprite.getDirt(), false, x, y);\n\t\t\t\t\trandOre(x, y);\n\t\t\t\t}\n\t\t\t\tif (x == 4 && y == 4) {\n\t\t\t\t\ttiles[x + y * width] = new Tile(Sprite.getGrass(), false, x, y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public World() {\n\t\tblockIDArray = new byte[WORLD_SIZE][WORLD_HEIGHT][WORLD_SIZE];\n\t\tentities\t = new ArrayList<Entity>();\n\t\trand\t\t = new Random();\n\t\t\n new GravityThread(this);\n\t\t\t\t\n\t\tgenerateWorld();\n\t}", "public WorldGenerator getRandomWorldGenForGrass(Random par1Random)\n {\n return new WorldGenTallGrass(Blocks.tallgrass, 1);\n }", "public HallwayGenerator(IRoomGenerationStrategy generator) {\n\t\tsetGenerationStrategy(generator);\n\t}", "@Override\n protected void generateTiles() {\n }", "@Override\n public BiomeDecorator createBiomeDecorator()\n { \n return new ForgottenPlanetBiomeDecorator(this);\n }", "@Override\n\tprotected void generateTiles() {\n\t}", "@ForgeSubscribe\n public void performChunkSpawning(PopulateChunkEvent.Populate event) {\n if (event.type == PopulateChunkEvent.Populate.EventType.ICE\n && event.world.getGameRules().getGameRuleBooleanValue(\"doCustomMobSpawning\")) {\n int k = event.chunkX * 16;\n int l = event.chunkZ * 16;\n Iterator<CreatureType> iterator = JustAnotherSpawner.worldSettings().creatureTypeRegistry()\n .getCreatureTypes();\n BiomeGenBase spawnBiome = event.world.getBiomeGenForCoords(k + 16, l + 16);\n \n if (spawnBiome == null || blacklist.isBlacklisted(spawnBiome)) {\n return;\n }\n \n while (iterator.hasNext()) {\n CreatureType creatureType = iterator.next();\n if (creatureType.chunkSpawning) {\n CustomSpawner.performWorldGenSpawning(event.world, creatureType, spawnBiome, k + 8, l + 8, 16, 16,\n event.world.rand);\n }\n }\n }\n }", "@Override\n public void createTerrain( ) {\n //System.out.println( \"terrain#material: \" +getAppearance().getMaterial() ); \n ElevationGridGenerator gridGenerator = new ElevationGridGenerator(\n getTerrainWidth(),\n getTerrainDepth(),\n getTerrainHeights()[0].length,\n getTerrainHeights().length,\n getTranslation(),\n isTerrainCentered() );\n\n // set the terrain into the elevation grid handler\n gridGenerator.setTerrainDetail( getTerrainHeights(), 0 );\n\n GeometryData data = new GeometryData();\n data.geometryType = getGeometryType();\n data.geometryComponents = GeometryData.NORMAL_DATA;\n if ( getTexture() != null ){\n data.geometryComponents |= GeometryData.TEXTURE_2D_DATA;\n }\n try {\n gridGenerator.generate( data );\n } catch ( UnsupportedTypeException ute ) {\n System.out.println( \"Geometry type is not supported\" );\n }\n int format = GeometryArray.COORDINATES | GeometryArray.NORMALS;\n if ( getTexture() != null )\n format |= GeometryArray.TEXTURE_COORDINATE_2;\n GeometryArray geom = createGeometryArray( data, format );\n\n geom.setCoordinates( 0, data.coordinates );\n geom.setNormals( 0, data.normals );\n if ( getTexture() != null ){\n geom.setTextureCoordinates( 0, 0, data.textureCoordinates );\n }\n setGeometry( geom );\n }", "@Override\n public WorldGenerator getRandomWorldGenForTrees(Random par1Random)\n {\n return treeGenerator;\n }", "public MineHard()\r\n { \r\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\r\n super(16, 16, 32);\r\n addObject(new Person() , 1 , 14);\r\n addObject(new Rock() , 1 , 15);\r\n addObject(new Rock() , 8 , 15);\r\n addObject(new Rock() , 12 , 15);\r\n addObject(new Rock() , 5 , 14);\r\n addObject(new Rock() , 15 , 13);\r\n addObject(new Rock() , 9 , 13);\r\n addObject(new Rock() , 12 , 12);\r\n addObject(new Rock() , 10 , 11);\r\n addObject(new Rock() , 7 , 11);\r\n addObject(new Rock() , 2 , 11);\r\n addObject(new Rock() , 1 , 12);\r\n addObject(new Rock() , 15 , 10);\r\n addObject(new Rock() , 12 , 9);\r\n addObject(new Rock() , 4 , 9);\r\n addObject(new Rock() , 1 , 9);\r\n addObject(new Rock() , 11 , 8);\r\n addObject(new Rock() , 13 , 7);\r\n addObject(new Rock() , 10 , 7);\r\n addObject(new Rock() , 9 , 7);\r\n addObject(new Rock() , 8 , 7);\r\n addObject(new Rock() , 7 , 7);\r\n addObject(new Rock() , 2 , 6);\r\n addObject(new Rock() , 5 , 5);\r\n addObject(new Rock() , 12 , 5);\r\n addObject(new Rock() , 9 , 4);\r\n addObject(new Rock() , 13 , 2);\r\n addObject(new Rock() , 3 , 3);\r\n addObject(new Rock() , 4 , 2);\r\n addObject(new Rock() , 1 , 1);\r\n addObject(new Rock() , 9 , 1);\r\n addObject(new Rock() , 10 , 0);\r\n addObject(new Rock() , 0 , 0);\r\n addObject(new Rock() , 0 , 7);\r\n addObject(new Rock() , 5 , 0);\r\n addObject(new Rock() , 15 , 0);\r\n addObject(new Rock() , 15 , 8);\r\n \r\n addObject(new Goldbar() , 15 , 2);\r\n addObject(new Goldbar() , 12 , 8);\r\n addObject(new Goldbar() , 15 , 15);\r\n addObject(new Goldbar() , 3 , 2);\r\n addObject(new Goldbar() , 9 , 0);\r\n addObject(new Goldbar() , 2 , 9);\r\n \r\n addObject(new Zombie() , 13 , 13);\r\n addObject(new Zombie() , 12 , 6);\r\n addObject(new Zombie() , 6 , 0);\r\n addObject(new Zombie() , 1 , 4);\r\n addObject(new Zombie() , 7 , 9);\r\n addObject(new TryC() , 2 , 1);\r\n addObject(new MainMenu() , 12 , 1);\r\n }", "protected MapChunk[] generateChunks( Tile[] tiles ) {\n \n // Check that the tiles we have been given are valid.\n if(tiles == null) {\n return null;\n }\n \n // Ensure we have tiles\n if(tiles.length <= 0) {\n return null;\n }\n \n // Ensure that the tile count is correct\n int tileRows = getHeightInTiles();\n int tileCols = getWidthInTiles();\n \n int tileCount = tileRows * tileCols;\n \n if(tiles.length != tileCount) {\n return null;\n }\n \n // Calculate the amount of chunks we need\n int chunkRows = getWidthInChunks();\n int chunkCols = getHeightInChunks();\n \n int chunkCount = chunkRows * chunkCols;\n \n // Create an array to store these chunks\n MapChunk[] chunks = new MapChunk[ chunkCount ];\n \n // Nullify the chunks\n for( int i = 0; i < chunkCount; i++ ) {\n chunks[i] = null;\n }\n \n // Render the tiles onto the chunks\n for(int x = 0; x < tileCols; x++) {\n for(int y = 0; y < tileRows; y++) {\n \n // Get the current tile\n Tile thisTile = tiles[ (y * tileCols) + x ];\n \n // Figure out which chunk we're in \n int tileX = x * getTileWidth();\n int tileY = y * getTileHeight();\n \n int chunkX = 0;\n int chunkY = 0;\n \n while( tileX >= getChunkWidth() ) {\n chunkX ++;\n tileX -= getChunkWidth();\n }\n \n while( tileY >= getChunkHeight() ) {\n chunkY ++;\n tileY -= getChunkHeight();\n }\n \n // Find the chunk\n MapChunk chunk = chunks[ (chunkY * chunkCols) + chunkX ];\n \n // System.out.println(\" Tile \" + ((y * tileCols) + x) + \" (\" + x + \", \" + y + \") Tile Position \" + (x * getTileWidth()) + \", \" + (y * getTileHeight()) + \" is in Chunk \" + chunkX + \", \" + chunkY + \" which is at index \" + ((chunkY * chunkCols) + chunkX));\n \n // Ensure this chunk has been created\n if(chunk == null) {\n chunk = new MapChunk( getChunkWidth(), getChunkHeight() );\n chunks[ (chunkY * chunkCols) + chunkX ] = chunk;\n \n }\n \n // Draw the tile\n for(int tx = 0; tx < getTileWidth(); tx++ ){\n for(int ty = 0; ty < getTileHeight(); ty++) {\n chunk.image.setPixel(\n \n tx + (x * getTileWidth()) - (chunkX * getChunkWidth()),\n ty + (y * getTileHeight()) - (chunkY * getChunkHeight()),\n thisTile.getColor()\n \n );\n }\n }\n \n }\n }\n \n return chunks;\n \n }", "public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)\n {\n BlockSand.fallInstantly = true;\n int i = par2 * 16;\n int j = par3 * 16;\n BiomeGenBase biomegenbase = endWorld.getBiomeGenForCoords(i + 16, j + 16);\n biomegenbase.decorate(endWorld, endWorld.rand, i, j);\n BlockSand.fallInstantly = false;\n }", "private void runGenerators(int chunkX, int chunkZ, Block[] ablock, byte[] abyte) {\n\t}", "public void initChunkSeed(long p_75903_1_, long p_75903_3_) {\n/* 119 */ this.chunkSeed = this.worldGenSeed;\n/* 120 */ this.chunkSeed *= (this.chunkSeed * 6364136223846793005L + 1442695040888963407L);\n/* 121 */ this.chunkSeed += p_75903_1_;\n/* 122 */ this.chunkSeed *= (this.chunkSeed * 6364136223846793005L + 1442695040888963407L);\n/* 123 */ this.chunkSeed += p_75903_3_;\n/* 124 */ this.chunkSeed *= (this.chunkSeed * 6364136223846793005L + 1442695040888963407L);\n/* 125 */ this.chunkSeed += p_75903_1_;\n/* 126 */ this.chunkSeed *= (this.chunkSeed * 6364136223846793005L + 1442695040888963407L);\n/* 127 */ this.chunkSeed += p_75903_3_;\n/* */ }", "private void generate()\r\n {\r\n mapPieces = myMap.Generate3();\r\n mapWidth = myMap.getMapWidth();\r\n mapHeight = myMap.getMapHeight();\r\n }", "public void generate() {\n currentlyGenerating = true;\n Bukkit.broadcastMessage(ChatColor.GREEN + \"The world generation process has been started!\");\n createUhcWorld();\n }", "@Override\n\tpublic void populateMap(CityWorldGenerator generator, PlatMap platmap) {\n\t\tgetSchematics(generator).populate(generator, platmap);\n\t\t\n\t\t// random fluff!\n\t\tOdds platmapOdds = platmap.getOddsGenerator();\n\t\tShapeProvider shapeProvider = generator.shapeProvider;\n\t\tint waterDepth = ParkLot.getWaterDepth(platmapOdds);\n\t\t\n\t\t// backfill with buildings and parks\n\t\tfor (int x = 0; x < PlatMap.Width; x++) {\n\t\t\tfor (int z = 0; z < PlatMap.Width; z++) {\n\t\t\t\tPlatLot current = platmap.getLot(x, z);\n\t\t\t\tif (current == null) {\n\t\t\t\t\t\n\t\t\t\t\t//TODO I need to come up with a more elegant way of doing this!\n\t\t\t\t\tif (generator.settings.includeBuildings) {\n\n\t\t\t\t\t\t// what to build?\n\t\t\t\t\t\tboolean buildPark = platmapOdds.playOdds(oddsOfParks);\n\t\t\t\t\t\tif (buildPark)\n\t\t\t\t\t\t\tcurrent = getPark(generator, platmap, platmapOdds, platmap.originX + x, platmap.originZ + z, waterDepth);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tcurrent = getBackfillLot(generator, platmap, platmapOdds, platmap.originX + x, platmap.originZ + z);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// see if the previous chunk is the same type\n\t\t\t\t\t\tPlatLot previous = null;\n\t\t\t\t\t\tif (x > 0 && current.isConnectable(platmap.getLot(x - 1, z))) {\n\t\t\t\t\t\t\tprevious = platmap.getLot(x - 1, z);\n\t\t\t\t\t\t} else if (z > 0 && current.isConnectable(platmap.getLot(x, z - 1))) {\n\t\t\t\t\t\t\tprevious = platmap.getLot(x, z - 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if there was a similar previous one then copy it... maybe\n\t\t\t\t\t\tif (previous != null && !shapeProvider.isIsolatedLotAt(platmap.originX + x, platmap.originZ + z, oddsOfIsolatedLots)) {\n\t\t\t\t\t\t\tcurrent.makeConnected(previous);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// 2 by 2 at a minimum if at all possible\n\t\t\t\t\t\t} else if (!buildPark && x < PlatMap.Width - 1 && z < PlatMap.Width - 1) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// is there room?\n\t\t\t\t\t\t\tPlatLot toEast = platmap.getLot(x + 1, z);\n\t\t\t\t\t\t\tPlatLot toSouth = platmap.getLot(x, z + 1);\n\t\t\t\t\t\t\tPlatLot toSouthEast = platmap.getLot(x + 1, z + 1);\n\t\t\t\t\t\t\tif (toEast == null && toSouth == null && toSouthEast == null) {\n\t\t\t\t\t\t\t\ttoEast = current.newLike(platmap, platmap.originX + x + 1, platmap.originZ + z);\n\t\t\t\t\t\t\t\ttoEast.makeConnected(current);\n\t\t\t\t\t\t\t\tplatmap.setLot(x + 1, z, toEast);\n\n\t\t\t\t\t\t\t\ttoSouth = current.newLike(platmap, platmap.originX + x, platmap.originZ + z + 1);\n\t\t\t\t\t\t\t\ttoSouth.makeConnected(current);\n\t\t\t\t\t\t\t\tplatmap.setLot(x, z + 1, toSouth);\n\n\t\t\t\t\t\t\t\ttoSouthEast = current.newLike(platmap, platmap.originX + x + 1, platmap.originZ + z + 1);\n\t\t\t\t\t\t\t\ttoSouthEast.makeConnected(current);\n\t\t\t\t\t\t\t\tplatmap.setLot(x + 1, z + 1, toSouthEast);\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\t// remember what we did\n\t\t\t\t\tif (current != null)\n\t\t\t\t\t\tplatmap.setLot(x, z, current);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// validate each lot\n\t\tfor (int x = 0; x < PlatMap.Width; x++) {\n\t\t\tfor (int z = 0; z < PlatMap.Width; z++) {\n\t\t\t\tPlatLot current = platmap.getLot(x, z);\n\t\t\t\tif (current != null) {\n\t\t\t\t\tPlatLot replacement = current.validateLot(platmap, x, z);\n\t\t\t\t\tif (replacement != null)\n\t\t\t\t\t\tplatmap.setLot(x, z, replacement);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void generateMap(){\n int[] blockStepX = {X_STEP, 0, -X_STEP, -X_STEP, 0, X_STEP};\n int[] blockStepY = {Y_STEP_ONE, Y_STEP_TWO, Y_STEP_ONE, -Y_STEP_ONE, -Y_STEP_TWO, -Y_STEP_ONE};\n int blockSpecialValue = 0;\n int cellSpecial = 0;\n\n mapCells[origin.x/10][origin.y/10] = new EschatonCell(new CellPosition(0, 0, 0),\n new Point(origin.x, origin.y), blockSpecialValue);\n\n cellGrid[0][0][0] = new EschatonCell(new CellPosition(0, 0, 0),\n new Point(origin.x, origin.y), blockSpecialValue);\n\n for (int distanceFromOrigin = 0; distanceFromOrigin < config.getSizeOfMap();\n distanceFromOrigin++){\n\n int[] blockXVals = {origin.x,\n origin.x + X_STEP * distanceFromOrigin,\n origin.x + X_STEP * distanceFromOrigin,\n origin.x,\n origin.x - X_STEP * distanceFromOrigin,\n origin.x - X_STEP * distanceFromOrigin};\n\n int[] blockYVals = {origin.y - Y_STEP_TWO * distanceFromOrigin,\n origin.y - Y_STEP_ONE * distanceFromOrigin,\n origin.y + Y_STEP_ONE * distanceFromOrigin,\n origin.y + Y_STEP_TWO * distanceFromOrigin,\n origin.y + Y_STEP_ONE * distanceFromOrigin,\n origin.y - Y_STEP_ONE * distanceFromOrigin};\n\n blockSpecialValue = getRandomNumber(distanceFromOrigin, 0, 0);\n\n for (int block = 0; block < NUMBER_OF_BLOCKS; block ++){\n\n int blockXOrdinal = blockXVals[block];\n int blockYOrdinal = blockYVals[block];\n\n for (int blockSize = 0; blockSize < distanceFromOrigin; blockSize++){\n if(blockSpecialValue == blockSize){\n cellSpecial = getRandomNumber(2, 1, 1);\n }else {\n cellSpecial = 0;\n }\n cellGrid [distanceFromOrigin][block+1][blockSize+1] = makeNewCell(\n new CellPosition(distanceFromOrigin,block+1, blockSize+1),\n new Point(blockXOrdinal + blockStepX[block] * (blockSize + 1),\n blockYOrdinal + blockStepY[block] * (blockSize + 1)), cellSpecial);\n }\n }\n }\n }", "public static void generateWorld(int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)\n\t{\n\t\tlong worldSeed = world.getSeed();\n\t\tRandom random = new Random(worldSeed);\n\t\tlong xSeed = random.nextLong() >> 2 + 1L;\n\t\tlong zSeed = random.nextLong() >> 2 + 1L;\n\t\trandom.setSeed((xSeed * chunkX + zSeed * chunkZ) ^ worldSeed);\n\n\t\tfor (IWorldGenerator generator : worldGenerators)\n\t\t{\n\t\t\tgenerator.generate(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);\n\t\t}\n\t}", "@Override\n\tpublic TileEntity createNewTileEntity(World world) {\n\t\treturn new TileEntityGrinder();\n\t}", "void randomBlock() {\n\t\t// map generate (int map)\n\t\tfor (int i = 0; i < mapX; i += 2) {\n\t\t\tfor (int j = 0; j < mapY; j += 2) {\n\t\t\t\tint r = (int) Math.random() * 4;\n\t\t\t\tif (r == 0) {\n\t\t\t\t\ttileMap[i][j] = new Tile(i, j, 1);\n\t\t\t\t\ttileMap[i + 1][j] = new Tile(i + 1, j, 1);\n\t\t\t\t\ttileMap[i][j + 1] = new Tile(i, j + 1, 1);\n\t\t\t\t\ttileMap[i + 1][j + 1] = new Tile(i + 1, j + 1, 1);\n\n\t\t\t\t} else {\n\t\t\t\t\ttileMap[i][j] = new Tile(i, j, 0);\n\t\t\t\t\ttileMap[i + 1][j] = new Tile(i + 1, j, 0);\n\t\t\t\t\ttileMap[i][j + 1] = new Tile(i, j + 1, 0);\n\t\t\t\t\ttileMap[i + 1][j + 1] = new Tile(i + 1, j + 1, 0);\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public IChunkProvider getChunkProvider() {\n\t\treturn new zei_ChunkProviderZeitgeist(worldObj, worldObj.getSeed(), true);\n\t}", "private void generateGhost() {\r\n\t\ttry {\r\n\t\t\tghost = (FallingPiece)falling.clone();\r\n\t\t} catch (CloneNotSupportedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\twhile(moveIfNoConflict(ghost.moveDown(), ghost));\t\t\r\n\t\tfor (BlockDrawable block : ghost.allBlocks())\r\n\t\t\tblock.setGhost(true);\r\n\t}", "public WorldGenerator getRandomWorldGenForTrees(Random par1Random)\n {\n return worldGenSwamp;\n }", "public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)\n {\n int var4 = par2 * 16;\n int var5 = par3 * 16;\n BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);\n boolean var7 = false;\n this.random.setSeed(this.worldObj.getSeed());\n long var8 = this.random.nextLong() / 2L * 2L + 1L;\n long var10 = this.random.nextLong() / 2L * 2L + 1L;\n this.random.setSeed((long)par2 * var8 + (long)par3 * var10 ^ this.worldObj.getSeed());\n Iterator var12 = this.field_82696_f.iterator();\n int k;\n int l;\n \n Random r = random;\n Chunk c = this.worldObj.getChunkFromChunkCoords(par2, par3);\n ArrayList<Object> var20 = rooms;\n \n for (int i = 1; i < 5; i++)\n {\n k = r.nextInt(23); //# of different rooms to generate\n l = r.nextInt(5); //Chance for boss rooms to generate 1/number specified\n\n if (k > 19 && l != 0 || i > 3) // boss chance\n {\n k = r.nextInt(20);\n }\n\n if (k < 21) //boss rooms have to use world gen while the rest use chunk gen\n {\n \t((DungeonComponentBase)(var20.get(k))).generate(c, r, var4, i * 8, var5);\n }\n else\n {\n \t((WorldGenerator)(var20.get(k))).generate(this.worldObj, r, var4, i * 8, var5);\n }\n }\n DungeonCeiling var21 = ceiling;\n var21.generate(c, r, var4, 40, var5);//80\n }", "public WorldGenGrassUnderbean()\n {\n }", "private void newGame(long seed) {\n ter.initialize(WIDTH, HEIGHT, 0, -3);\n GameWorld world = new GameWorld(seed);\n String toSave = \"N\" + seed + \"S\";\n world.setSaveScript(toSave);\n for (int x = 0; x < WIDTH; x += 1) {\n for (int y = 0; y < HEIGHT; y += 1) {\n world.world[x][y] = Tileset.NOTHING;\n }\n }\n world.buildManyRandomSq();\n GameWorld.Position avatarPosition = randomAvatarPosition(world);\n ter.renderFrame(world.world);\n loadAvatar(world, avatarPosition);\n }", "static void DungeonGen() {\n\t\tdungeontype = 0;\n\t\t\n\t\tswitch(dungeontype) {\n\t\tcase 0:\n\t\t\tSystem.out.println(\"\tDebug: DungeonGen passed\");\n\t\t\tDungeonforgotten();\t\t\t\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tSystem.out.println(\"DUNGEON GEN TEST\");\n\t\t\tbreak;\t\t\t\n\t\t}\n\t}", "public TerrainMesh generateTerrain() {\n float[] vertices = new float[(zVertexCount * xSize) * 9];\n float[] colors = new float[(zVertexCount * xSize) * 8];\n float[] normals = new float[(zVertexCount * xSize) * 8];\n int[] indices = new int[(zVertexCount * xSize) * 3];\n\n for(int x = 0; x < xSize; x++) {\n for(int z = 0; z < zSize; z++) {\n TerrainSquare square = new TerrainSquare(this, new Vector2f(x, z),\n new Vector3f(x == 0 ? 0 : size * x,\n 0 + getHeight(x, z),\n z == 0 ? 0 : size * z),\n null);\n\n square.setColor(biomeGenerator.getColors()[square.getSquareId()]);\n\n storeSquareVertices(vertices, square);\n storeSquareColors(colors, square);\n storeSquareNormals(normals, square);\n storeSquareIndices(indices, square);\n\n terrainSquareMap.put(square.getSquareIndex(), square);\n }\n }\n\n return new TerrainMesh(vertices, colors, normals, indices);\n }", "public void generate() {\n\t}", "public interface MapGenerator {\n\n /**\n * Creates the map with the current set options\n */\n public abstract void createMap(Game game) throws FreeColException;\n\n /**\n * Creates a <code>Map</code> for the given <code>Game</code>.\n *\n * The <code>Map</code> is added to the <code>Game</code> after\n * it is created.\n *\n * @param game The game.\n * @param landMap Determines whether there should be land\n * or ocean on a given tile. This array also\n * specifies the size of the map that is going\n * to be created.\n * @see net.sf.freecol.common.model.Map\n */\n public abstract void createEmptyMap(Game game, boolean[][] landMap);\n\n /**\n * Gets the options used when generating the map.\n * @return The <code>MapGeneratorOptions</code>.\n */\n public abstract OptionGroup getMapGeneratorOptions();\n\n}", "public WaterWorld()\r\n { \r\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\r\n super(600, 400, 1); \r\n populateWorld();\r\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic byte[][] generateBlockSections(World world, Random rand, int ChunkX, int ChunkZ, BiomeGrid biomeGrid) {\n\t\tbyte[][] chunk = new byte[world.getMaxHeight() / 16][];\n\n\t\t\n\n\t\tfor (int x = 0; x < 16; x++) {\n\t\t\tfor (int z = 0; z < 16; z++) {\n\t\t\t\t// the seas\n\t\t\t\tfor (int y = 0; y < 35; y++) {\n\t\t\t\t\tif (getBlock(x, y, z, chunk) == Material.AIR.getId()) {\n\t\t\t\t\t\tsetBlock(x, y, z, chunk, Material.STATIONARY_WATER);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// bottom\n\t\t\t\tfor (int y = 0; y < 2; y++) {\n\t\t\t\t\tif (getBlock(x, y, z, chunk) == Material.STATIONARY_WATER.getId()) {\n\t\t\t\t\t\tsetBlock(x, y, z, chunk, Material.SAND);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsetBlock(x, 0, z, chunk, Material.BEDROCK);\n\t\t\t}\n\t\t}\n\t\treturn chunk;\n\t}", "@Override\n public WorldGenerator getRandomWorldGenForTrees(Random par1Random)\n {\n return this.worldGeneratorTrees;\n }", "public WorldChunk(int width, int height, SceneNode node) {\r\n\t\tinit();\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.parent = node;\r\n\t\tblockMatrix = new Tile[width][height];\r\n\t\tcountTiles = new int[blockTypes.length];\r\n\t\t\r\n\t\tobjectBuckets = new Entity[objectTypes.size()][width*height];\r\n\t\tobjectCounts = new int[objectTypes.size()];\r\n\t\t\r\n\t\tgrassBuckets = new Grass[2][width*height];\r\n\t\tgrassCounts = new int[2];\r\n\t\t\r\n\t\tworldChunkBuckets = new Renderable[blockTypes.length];\r\n\t}", "public abstract String getBiomeName();", "public static FlatGeneratorSettings getDefaultSettings() {\n final List<FlatLayer> layers = Lists.newArrayListWithCapacity(3);\n layers.add(new FlatLayer(BlockTypes.BEDROCK, 1));\n layers.add(new FlatLayer(BlockTypes.DIRT, 2));\n layers.add(new FlatLayer(BlockTypes.GRASS, 1));\n return new FlatGeneratorSettings(BiomeTypes.PLAINS, layers);\n }", "void makeDragon() {\n new BukkitRunnable() {\n int i = 555;\n\n @Override\n public void run() {\n Set<BlockData> set = create.get(i);\n for (BlockData blockData : set) {\n blockData.setBlock();\n }\n\n i++;\n if (i > 734) {\n cancel();\n }\n }\n }.runTaskTimer(Main.plugin, 0, 2);\n // Location end = new Location(Bukkit.getWorld(\"world\"), 3, 254, 733);\n }", "@Override\r\n protected void generateRavine(long seed, int chunkX, int chunkZ, byte[] chunkData, double blockX, double blockY, double blockZ, float scale, float leftRightRadian, float upDownRadian, int currentY, int targetY, double scaleHeight) {\r\n final int worldHeight = chunkData.length / (16 * 16); // 128 or 256\r\n final Random random = new SecureRandom();\r\n random.setSeed(seed);\r\n\r\n final double chunkCenterX = (double) (chunkX * 16 + 8);\r\n final double chunkCenterZ = (double) (chunkZ * 16 + 8);\r\n float leftRightChange = 0.0F;\r\n float upDownChange = 0.0F;\r\n\r\n if (targetY <= 0) {\r\n final int blockRangeY = this.range * 16 - 16;\r\n targetY = blockRangeY - random.nextInt(blockRangeY / 4);\r\n }\r\n\r\n boolean createFinalRoom = false;\r\n\r\n if (currentY == -1) {\r\n currentY = targetY / 2;\r\n createFinalRoom = true;\r\n }\r\n\r\n float nextIntersectionHeight = 1.0F;\r\n\r\n for (int k1 = 0; k1 < worldHeight; ++k1) {\r\n if (k1 == 0 || random.nextInt(3) == 0) {\r\n nextIntersectionHeight = 1.0F + random.nextFloat() * random.nextFloat() * 1.0F;\r\n }\r\n\r\n this.field_75046_d[k1] = nextIntersectionHeight * nextIntersectionHeight;\r\n }\r\n\r\n for (; currentY < targetY; ++currentY) {\r\n double roomWidth = 1.5D + (double) (MathHelper.sin((float) currentY * (float) Math.PI / (float) targetY) * scale * 1.0F);\r\n double roomHeight = roomWidth * scaleHeight;\r\n roomWidth *= (double) random.nextFloat() * 0.25D + 0.75D;\r\n roomHeight *= (double) random.nextFloat() * 0.25D + 0.75D;\r\n float f6 = MathHelper.cos(upDownRadian);\r\n float f7 = MathHelper.sin(upDownRadian);\r\n blockX += (double) (MathHelper.cos(leftRightRadian) * f6);\r\n blockY += (double) f7;\r\n blockZ += (double) (MathHelper.sin(leftRightRadian) * f6);\r\n upDownRadian *= 0.7F;\r\n upDownRadian += upDownChange * 0.05F;\r\n leftRightRadian += leftRightChange * 0.05F;\r\n upDownChange *= 0.8F;\r\n leftRightChange *= 0.5F;\r\n upDownChange += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F;\r\n leftRightChange += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F;\r\n\r\n if (createFinalRoom || random.nextInt(4) != 0) {\r\n double d8 = blockX - chunkCenterX;\r\n double d9 = blockZ - chunkCenterZ;\r\n double d10 = (double) (targetY - currentY);\r\n double d11 = (double) (scale + 2.0F + 16.0F);\r\n\r\n if (d8 * d8 + d9 * d9 - d10 * d10 > d11 * d11) {\r\n return;\r\n }\r\n\r\n if (blockX >= chunkCenterX - 16.0D - roomWidth * 2.0D && blockZ >= chunkCenterZ - 16.0D - roomWidth * 2.0D && blockX <= chunkCenterX + 16.0D + roomWidth * 2.0D && blockZ <= chunkCenterZ + 16.0D + roomWidth * 2.0D) {\r\n final int xLow = TwoMath.withinBounds(MathHelper.floor_double(blockX - roomWidth) - chunkX * 16 - 1, 0, 16);\r\n final int xHigh = TwoMath.withinBounds(MathHelper.floor_double(blockX + roomWidth) - chunkX * 16 + 1, 0, 16);\r\n final int yLow = TwoMath.withinBounds(MathHelper.floor_double(blockY - roomHeight) - 1, 1, worldHeight - 8);\r\n final int yHigh = TwoMath.withinBounds(MathHelper.floor_double(blockY + roomHeight) + 1, 1, worldHeight - 8);\r\n final int zLow = TwoMath.withinBounds(MathHelper.floor_double(blockZ - roomWidth) - chunkZ * 16 - 1, 0, 16);\r\n final int zHigh = TwoMath.withinBounds(MathHelper.floor_double(blockZ + roomWidth) - chunkZ * 16 + 1, 0, 16);\r\n\r\n boolean underWater = false;\r\n for (int x = xLow; !underWater && x < xHigh; ++x) {\r\n for (int z = zLow; !underWater && z < zHigh; ++z) {\r\n for (int y = yHigh + 1; !underWater && y >= yLow - 1; --y) {\r\n final int index = (x * 16 + z) * worldHeight + y;\r\n\r\n if (y >= 0 && y < worldHeight) {\r\n if (isOceanBlock(chunkData, index, x, y, z, chunkX, chunkZ)) {\r\n underWater = true;\r\n }\r\n\r\n if (y != yLow - 1 && x != xLow && x != xHigh - 1 && z != zLow && z != zHigh - 1) {\r\n y = yLow;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!underWater) {\r\n for (int x = xLow; x < xHigh; ++x) {\r\n double d12 = ((double) (x + chunkX * 16) + 0.5D - blockX) / roomWidth;\r\n\r\n for (int z = zLow; z < zHigh; ++z) {\r\n double d13 = ((double) (z + chunkZ * 16) + 0.5D - blockZ) / roomWidth;\r\n int index = (x * 16 + z) * worldHeight + yHigh;\r\n boolean flag2 = false;\r\n\r\n if (d12 * d12 + d13 * d13 < 1.0D) {\r\n for (int y = yHigh - 1; y >= yLow; --y) {\r\n double yScale = ((double) y + 0.5D - blockY) / roomHeight;\r\n\r\n if ((d12 * d12 + d13 * d13) * (double) this.field_75046_d[y] + yScale * yScale / 6.0D < 1.0D) {\r\n if (isTopBlock(chunkData, index, x, y, z, chunkX, chunkZ)) {\r\n flag2 = true;\r\n }\r\n\r\n digBlock(chunkData, index, x, y, z, chunkX, chunkZ, flag2);\r\n }\r\n\r\n --index;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (createFinalRoom) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "protected BiomeDecorator createBiomeDecorator()\n {\n return new BiomeDecorator();\n }", "public interface MapGenerator {\n\n /**\n * Creates the map with the current set options\n *\n * @param game a <code>Game</code> value\n * @exception FreeColException if an error occurs\n */\n public abstract void createMap(Game game) throws FreeColException;\n\n /**\n * Creates a <code>Map</code> for the given <code>Game</code>.\n *\n * The <code>Map</code> is added to the <code>Game</code> after\n * it is created.\n *\n * @param game The game.\n * @param landMap Determines whether there should be land\n * or ocean on a given tile. This array also\n * specifies the size of the map that is going\n * to be created.\n * @see net.sf.freecol.common.model.Map\n */\n public abstract void createEmptyMap(Game game, boolean[][] landMap);\n\n /**\n * Gets the options used when generating the map.\n * @return The <code>MapGeneratorOptions</code>.\n */\n public abstract OptionGroup getMapGeneratorOptions();\n\n}", "boolean isGoodBiome(BiomeGenBase biome);", "public void generate() {\n\t\tMirror m = new Mirror();\n\t\tpoints.addAll(m.fish());\n\t\twhile (remainingPoints > 0) {\n\t\t\titerate();\n\t\t\tremainingPoints--;\n\t\t}\n\n\t}", "private void generateSurface(World world, Random random, int x, int z) \n\t{\n\t\tthis.addOreSpawn(blocks.blockGemOres, 0, world, random, x, z, 16, 16, 4 + random.nextInt(50), 25, 50, 128);\n\t\t\n\t\tBiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(x, z);\n\t\t\n\t\tif ((biome == BiomeGenBase.plains || biome == BiomeGenBase.desert))\n\t\t{\n\t\t\tfor(int a = 0; a < 1; a++)\n\t\t\t{\n\t\t\t\tint i = x + random.nextInt(10);\n\t\t\t\tint k = random.nextInt(200);\n\t\t\t\tint j = z + random.nextInt(10);\n\t\t\t\t\n\t\t\t\tnew StructureSmallHouse().generate(world, random, i, j, k);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public interface Chunk extends PersistentDataHolder {\r\n\r\n /**\r\n * Gets the X-coordinate of this chunk\r\n *\r\n * @return X-coordinate\r\n */\r\n int getX();\r\n\r\n /**\r\n * Gets the Z-coordinate of this chunk\r\n *\r\n * @return Z-coordinate\r\n */\r\n int getZ();\r\n\r\n /**\r\n * Gets the world containing this chunk\r\n *\r\n * @return Parent World\r\n */\r\n @NotNull\r\n World getWorld();\r\n\r\n /**\r\n * Gets a block from this chunk\r\n *\r\n * @param x 0-15\r\n * @param y 0-255\r\n * @param z 0-15\r\n * @return the Block\r\n */\r\n @NotNull\r\n Block getBlock(int x, int y, int z);\r\n\r\n /**\r\n * Capture thread-safe read-only snapshot of chunk data\r\n *\r\n * @return ChunkSnapshot\r\n */\r\n @NotNull\r\n ChunkSnapshot getChunkSnapshot();\r\n\r\n /**\r\n * Capture thread-safe read-only snapshot of chunk data\r\n *\r\n * @param includeMaxblocky - if true, snapshot includes per-coordinate\r\n * maximum Y values\r\n * @param includeBiome - if true, snapshot includes per-coordinate biome\r\n * type\r\n * @param includeBiomeTempRain - if true, snapshot includes per-coordinate\r\n * raw biome temperature and rainfall\r\n * @return ChunkSnapshot\r\n */\r\n @NotNull\r\n ChunkSnapshot getChunkSnapshot(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain);\r\n\r\n /**\r\n * Get a list of all entities in the chunk.\r\n *\r\n * @return The entities.\r\n */\r\n @NotNull\r\n Entity[] getEntities();\r\n\r\n /**\r\n * Get a list of all tile entities in the chunk.\r\n *\r\n * @return The tile entities.\r\n */\r\n @NotNull\r\n BlockState[] getTileEntities();\r\n\r\n /**\r\n * Checks if the chunk is loaded.\r\n *\r\n * @return True if it is loaded.\r\n */\r\n boolean isLoaded();\r\n\r\n /**\r\n * Loads the chunk.\r\n *\r\n * @param generate Whether or not to generate a chunk if it doesn't\r\n * already exist\r\n * @return true if the chunk has loaded successfully, otherwise false\r\n */\r\n boolean load(boolean generate);\r\n\r\n /**\r\n * Loads the chunk.\r\n *\r\n * @return true if the chunk has loaded successfully, otherwise false\r\n */\r\n boolean load();\r\n\r\n /**\r\n * Unloads and optionally saves the Chunk\r\n *\r\n * @param save Controls whether the chunk is saved\r\n * @return true if the chunk has unloaded successfully, otherwise false\r\n */\r\n boolean unload(boolean save);\r\n\r\n /**\r\n * Unloads and optionally saves the Chunk\r\n *\r\n * @return true if the chunk has unloaded successfully, otherwise false\r\n */\r\n boolean unload();\r\n\r\n /**\r\n * Checks if this chunk can spawn slimes without being a swamp biome.\r\n *\r\n * @return true if slimes are able to spawn in this chunk\r\n */\r\n boolean isSlimeChunk();\r\n\r\n /**\r\n * Gets whether the chunk at the specified chunk coordinates is force\r\n * loaded.\r\n * <p>\r\n * A force loaded chunk will not be unloaded due to lack of player activity.\r\n *\r\n * @return force load status\r\n * @see World#isChunkForceLoaded(int, int)\r\n */\r\n boolean isForceLoaded();\r\n\r\n /**\r\n * Sets whether the chunk at the specified chunk coordinates is force\r\n * loaded.\r\n * <p>\r\n * A force loaded chunk will not be unloaded due to lack of player activity.\r\n *\r\n * @param forced force load status\r\n * @see World#setChunkForceLoaded(int, int, boolean)\r\n */\r\n void setForceLoaded(boolean forced);\r\n\r\n /**\r\n * Adds a plugin ticket for this chunk, loading this chunk if it is not\r\n * already loaded.\r\n * <p>\r\n * A plugin ticket will prevent a chunk from unloading until it is\r\n * explicitly removed. A plugin instance may only have one ticket per chunk,\r\n * but each chunk can have multiple plugin tickets.\r\n * </p>\r\n *\r\n * @param plugin Plugin which owns the ticket\r\n * @return {@code true} if a plugin ticket was added, {@code false} if the\r\n * ticket already exists for the plugin\r\n * @throws IllegalStateException If the specified plugin is not enabled\r\n * @see World#addPluginChunkTicket(int, int, Plugin)\r\n */\r\n boolean addPluginChunkTicket(@NotNull Plugin plugin);\r\n\r\n /**\r\n * Removes the specified plugin's ticket for this chunk\r\n * <p>\r\n * A plugin ticket will prevent a chunk from unloading until it is\r\n * explicitly removed. A plugin instance may only have one ticket per chunk,\r\n * but each chunk can have multiple plugin tickets.\r\n * </p>\r\n *\r\n * @param plugin Plugin which owns the ticket\r\n * @return {@code true} if the plugin ticket was removed, {@code false} if\r\n * there is no plugin ticket for the chunk\r\n * @see World#removePluginChunkTicket(int, int, Plugin)\r\n */\r\n boolean removePluginChunkTicket(@NotNull Plugin plugin);\r\n\r\n /**\r\n * Retrieves a collection specifying which plugins have tickets for this\r\n * chunk. This collection is not updated when plugin tickets are added or\r\n * removed to this chunk.\r\n * <p>\r\n * A plugin ticket will prevent a chunk from unloading until it is\r\n * explicitly removed. A plugin instance may only have one ticket per chunk,\r\n * but each chunk can have multiple plugin tickets.\r\n * </p>\r\n *\r\n * @return unmodifiable collection containing which plugins have tickets for\r\n * this chunk\r\n * @see World#getPluginChunkTickets(int, int)\r\n */\r\n @NotNull\r\n Collection<Plugin> getPluginChunkTickets();\r\n\r\n /**\r\n * Gets the amount of time in ticks that this chunk has been inhabited.\r\n *\r\n * Note that the time is incremented once per tick per player in the chunk.\r\n *\r\n * @return inhabited time\r\n */\r\n long getInhabitedTime();\r\n\r\n /**\r\n * Sets the amount of time in ticks that this chunk has been inhabited.\r\n *\r\n * @param ticks new inhabited time\r\n */\r\n void setInhabitedTime(long ticks);\r\n\r\n /**\r\n * Tests if this chunk contains the specified block.\r\n *\r\n * @param block block to test\r\n * @return if the block is contained within\r\n */\r\n boolean contains(@NotNull BlockData block);\r\n}", "public int getBiomeGrassColor()\n {\n return 11176526;\n }", "public void register(WorldGenKawaiiBaseWorldGen.WorldGen gen)\r\n\t{\t\r\n\t\tif (!this.Enabled) return; \r\n\t\tGameRegistry.registerBlock(this, this.getUnlocalizedName());\r\n\t\t\r\n\t\tString saplingName = name + \".sapling\";\r\n\t\tSapling = new ItemKawaiiSeed(saplingName, SaplingToolTip, this);\r\n\t\tSapling.OreDict = SaplingOreDict;\r\n\t\tSapling.MysterySeedWeight = SeedsMysterySeedWeight;\r\n\t\tSapling.register();\r\n\r\n\t\tString fruitName = name + \".fruit\";\r\n\t\tif (FruitEdible)\r\n\t\t{\r\n\t\t\tItemKawaiiFood fruit = new ItemKawaiiFood(fruitName, FruitToolTip, FruitHunger, FruitSaturation, FruitPotionEffets);\r\n\t\t\tFruit = fruit;\r\n\t\t\tfruit.OreDict = FruitOreDict;\r\n\t\t\t\r\n\t\t\tfruit.register();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tItemKawaiiIngredient fruit = new ItemKawaiiIngredient(fruitName, FruitToolTip);\r\n\t\t\tFruit = fruit;\r\n\t\t\tfruit.OreDict = FruitOreDict;\r\n\t\t\t\r\n\t\t\tfruit.register();\r\n\t\t}\r\n\t\t\r\n\t\tif (gen.weight > 0)\r\n\t\t{\r\n\t\t\tgen.generator = new WorldGenKawaiiTree(this);\r\n\t\t\tModWorldGen.WorldGen.generators.add(gen);\r\n\t\t}\r\n\r\n\t\tModBlocks.AllTrees.add(this);\t\t\r\n\t}", "public WorldGenerator getRandomWorldGenForTrees(Random par1Random)\n {\n\t\treturn (WorldGenerator)(par1Random.nextInt(4) == 0 ? new WorldGenAcacia(false) : (par1Random.nextInt(24) == 0 ? new WorldGenDeadTree3(false) : (par1Random.nextInt(2) == 0 ? this.worldGeneratorTrees : new WorldGenShrub(0,0))));\n }", "@ForgeSubscribe\r\n\tpublic void OnBonemealUse(net.minecraftforge.event.entity.player.BonemealEvent e)\r\n\t{\n\t\tif (!e.world.isRemote && e.entityPlayer.dimension == YC_Mod.d_astralDimID)\r\n\t\t{\r\n\t\t\tif (e.world.getBlockId(e.X, e.Y, e.Z) == YC_Mod.b_astralCrystals.blockID && e.world.getBlockId(e.X, e.Y-1, e.Z) == Block.grass.blockID)//crystal in center and grass beneath them\r\n\t\t\t\tif (e.world.getBlockId(e.X+1, e.Y, e.Z) == Block.sapling.blockID && \r\n\t\t\t\t\te.world.getBlockId(e.X-1, e.Y, e.Z) == Block.sapling.blockID && \r\n\t\t\t\t\te.world.getBlockId(e.X, e.Y, e.Z+1) == Block.sapling.blockID && \r\n\t\t\t\t\te.world.getBlockId(e.X, e.Y, e.Z-1) == Block.sapling.blockID)//4 sapplings on sides\r\n\t\t\t\t{\r\n\t\t\t\t\tint iron = 0, gold = 0;\r\n\t\t\t\t\tint id = 0;\r\n\t\t\t\t\t//============================================2 blocks of iron and gold each diagonally===================================================\r\n\t\t\t\t\tid = e.world.getBlockId(e.X+1, e.Y, e.Z+1);\r\n\t\t\t\t\tif (id == Block.blockSteel.blockID) iron++;\r\n\t\t\t\t\tif (id == Block.blockGold.blockID) gold++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tid = e.world.getBlockId(e.X+1, e.Y, e.Z-1);\r\n\t\t\t\t\tif (id == Block.blockSteel.blockID) iron++;\r\n\t\t\t\t\tif (id == Block.blockGold.blockID) gold++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tid = e.world.getBlockId(e.X-1, e.Y, e.Z-1);\r\n\t\t\t\t\tif (id == Block.blockSteel.blockID) iron++;\r\n\t\t\t\t\tif (id == Block.blockGold.blockID) gold++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tid = e.world.getBlockId(e.X-1, e.Y, e.Z+1);\r\n\t\t\t\t\tif (id == Block.blockSteel.blockID) iron++;\r\n\t\t\t\t\tif (id == Block.blockGold.blockID) gold++;\r\n\t\t\t\t\tif (iron == 2 && gold == 2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (HasCoalCount(e.world, e.X, e.Y, e.Z, 64))//stack of coal for it\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tDecrCoalCount(e.world, e.X, e.Y, e.Z, 64);\r\n\t\t\t\t\t\t\tYC_WorldGenAstral.GenerateTree(e.world, new Random(), e.X, e.Y-1, e.Z);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X, e.Y, e.Z-1, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X+1, e.Y, e.Z-1, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X-1, e.Y, e.Z-1, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X+1, e.Y, e.Z, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X-1, e.Y, e.Z, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X+1, e.Y, e.Z+1, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X, e.Y, e.Z+1, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X-1, e.Y, e.Z+1, 0, 0, 3);\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}\r\n\t\t//System.out.println(e.X+\" ; \" + e.Y + \" ; \" + e.Z + \" ; \" + FMLCommonHandler.instance().getEffectiveSide());\r\n\t}", "public SmallChunkData(Chunk c){\n\t\t\tx = c.getX();\n\t\t\tz = c.getZ();\n\t\t\tworldName = c.getWorld().getName();\n\t\t\tfor(int x = 0; x < 16; x ++){\n\t\t\t\tfor(int z = 0; z < 16; z ++){\n\t\t\t\t\tbiomes[x][z] = c.getBlock(x, 0, z).getBiome();\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*for(int y = 0; y < 256; y ++){\n\t\t\t\tfor(int x = 0; x < 16; x ++){\n\t\t\t\t\tfor(int z = 0; z < 16; z ++){\n\t\t\t\t\t\tdata[y][x][z] = new MaterialData(c.getBlock(x, y, z).getType(), c.getBlock(x, y, z).getData());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}*/\n\t\t}", "public boolean generate(World paramaqu, Random paramRandom, BlockPosition paramdt)\r\n/* 12: */ {\r\n/* 13: 19 */ int i = paramRandom.nextInt(4) + 5;\r\n/* 14: 20 */ while (paramaqu.getBlock(paramdt.down()).getType().getMaterial() == Material.water) {\r\n/* 15: 21 */ paramdt = paramdt.down();\r\n/* 16: */ }\r\n/* 17: 24 */ int j = 1;\r\n/* 18: 25 */ if ((paramdt.getY() < 1) || (paramdt.getY() + i + 1 > 256)) {\r\n/* 19: 26 */ return false;\r\n/* 20: */ }\r\n/* 21: */ int n;\r\n/* 22: */ int i2;\r\n/* 23: 29 */ for (int k = paramdt.getY(); k <= paramdt.getY() + 1 + i; k++)\r\n/* 24: */ {\r\n/* 25: 30 */ int m = 1;\r\n/* 26: 31 */ if (k == paramdt.getY()) {\r\n/* 27: 32 */ m = 0;\r\n/* 28: */ }\r\n/* 29: 34 */ if (k >= paramdt.getY() + 1 + i - 2) {\r\n/* 30: 35 */ m = 3;\r\n/* 31: */ }\r\n/* 32: 37 */ for (n = paramdt.getX() - m; (n <= paramdt.getX() + m) && (j != 0); n++) {\r\n/* 33: 38 */ for (i2 = paramdt.getZ() - m; (i2 <= paramdt.getZ() + m) && (j != 0); i2++) {\r\n/* 34: 39 */ if ((k >= 0) && (k < 256))\r\n/* 35: */ {\r\n/* 36: 40 */ BlockType localatr3 = paramaqu.getBlock(new BlockPosition(n, k, i2)).getType();\r\n/* 37: 41 */ if ((localatr3.getMaterial() != Material.air) && (localatr3.getMaterial() != Material.leaves)) {\r\n/* 38: 42 */ if ((localatr3 == BlockList.water) || (localatr3 == BlockList.flowingWater))\r\n/* 39: */ {\r\n/* 40: 43 */ if (k > paramdt.getY()) {\r\n/* 41: 44 */ j = 0;\r\n/* 42: */ }\r\n/* 43: */ }\r\n/* 44: */ else {\r\n/* 45: 47 */ j = 0;\r\n/* 46: */ }\r\n/* 47: */ }\r\n/* 48: */ }\r\n/* 49: */ else\r\n/* 50: */ {\r\n/* 51: 51 */ j = 0;\r\n/* 52: */ }\r\n/* 53: */ }\r\n/* 54: */ }\r\n/* 55: */ }\r\n/* 56: 57 */ if (j == 0) {\r\n/* 57: 58 */ return false;\r\n/* 58: */ }\r\n/* 59: 61 */ BlockType localatr1 = paramaqu.getBlock(paramdt.down()).getType();\r\n/* 60: 62 */ if (((localatr1 != BlockList.grass) && (localatr1 != BlockList.dirt)) || (paramdt.getY() >= 256 - i - 1)) {\r\n/* 61: 63 */ return false;\r\n/* 62: */ }\r\n/* 63: 66 */ makeDirt(paramaqu, paramdt.down());\r\n/* 64: */ int i3;\r\n/* 65: */ int i4;\r\n/* 66: */ BlockPosition localdt3;\r\n/* 67: 68 */ for (int m = paramdt.getY() - 3 + i; m <= paramdt.getY() + i; m++)\r\n/* 68: */ {\r\n/* 69: 69 */ n = m - (paramdt.getY() + i);\r\n/* 70: 70 */ i2 = 2 - n / 2;\r\n/* 71: 71 */ for (i3 = paramdt.getX() - i2; i3 <= paramdt.getX() + i2; i3++)\r\n/* 72: */ {\r\n/* 73: 72 */ i4 = i3 - paramdt.getX();\r\n/* 74: 73 */ for (int i5 = paramdt.getZ() - i2; i5 <= paramdt.getZ() + i2; i5++)\r\n/* 75: */ {\r\n/* 76: 74 */ int i6 = i5 - paramdt.getZ();\r\n/* 77: 75 */ if ((Math.abs(i4) != i2) || (Math.abs(i6) != i2) || ((paramRandom.nextInt(2) != 0) && (n != 0)))\r\n/* 78: */ {\r\n/* 79: 78 */ localdt3 = new BlockPosition(i3, m, i5);\r\n/* 80: 79 */ if (!paramaqu.getBlock(localdt3).getType().m()) {\r\n/* 81: 80 */ setBlock(paramaqu, localdt3, BlockList.leaves);\r\n/* 82: */ }\r\n/* 83: */ }\r\n/* 84: */ }\r\n/* 85: */ }\r\n/* 86: */ }\r\n/* 87: 86 */ for (int m = 0; m < i; m++)\r\n/* 88: */ {\r\n/* 89: 87 */ BlockType localatr2 = paramaqu.getBlock(paramdt.up(m)).getType();\r\n/* 90: 88 */ if ((localatr2.getMaterial() == Material.air) || (localatr2.getMaterial() == Material.leaves) || (localatr2 == BlockList.flowingWater) || (localatr2 == BlockList.water)) {\r\n/* 91: 89 */ setBlock(paramaqu, paramdt.up(m), BlockList.log);\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94: 93 */ for (int m = paramdt.getY() - 3 + i; m <= paramdt.getY() + i; m++)\r\n/* 95: */ {\r\n/* 96: 94 */ int i1 = m - (paramdt.getY() + i);\r\n/* 97: 95 */ i2 = 2 - i1 / 2;\r\n/* 98: 96 */ for (i3 = paramdt.getX() - i2; i3 <= paramdt.getX() + i2; i3++) {\r\n/* 99: 97 */ for (i4 = paramdt.getZ() - i2; i4 <= paramdt.getZ() + i2; i4++)\r\n/* 100: */ {\r\n/* 101: 98 */ BlockPosition localdt1 = new BlockPosition(i3, m, i4);\r\n/* 102:100 */ if (paramaqu.getBlock(localdt1).getType().getMaterial() == Material.leaves)\r\n/* 103: */ {\r\n/* 104:101 */ BlockPosition localdt2 = localdt1.west();\r\n/* 105:102 */ localdt3 = localdt1.east();\r\n/* 106:103 */ BlockPosition localdt4 = localdt1.north();\r\n/* 107:104 */ BlockPosition localdt5 = localdt1.south();\r\n/* 108:106 */ if ((paramRandom.nextInt(4) == 0) && (paramaqu.getBlock(localdt2).getType().getMaterial() == Material.air)) {\r\n/* 109:107 */ a(paramaqu, localdt2, bbv.S);\r\n/* 110: */ }\r\n/* 111:109 */ if ((paramRandom.nextInt(4) == 0) && (paramaqu.getBlock(localdt3).getType().getMaterial() == Material.air)) {\r\n/* 112:110 */ a(paramaqu, localdt3, bbv.T);\r\n/* 113: */ }\r\n/* 114:112 */ if ((paramRandom.nextInt(4) == 0) && (paramaqu.getBlock(localdt4).getType().getMaterial() == Material.air)) {\r\n/* 115:113 */ a(paramaqu, localdt4, bbv.Q);\r\n/* 116: */ }\r\n/* 117:115 */ if ((paramRandom.nextInt(4) == 0) && (paramaqu.getBlock(localdt5).getType().getMaterial() == Material.air)) {\r\n/* 118:116 */ a(paramaqu, localdt5, bbv.R);\r\n/* 119: */ }\r\n/* 120: */ }\r\n/* 121: */ }\r\n/* 122: */ }\r\n/* 123: */ }\r\n/* 124:122 */ return true;\r\n/* 125: */ }", "public abstract void generateNextBlock();", "@Override\n\tpublic Biome getBiome(BlockPos pos) {\n\t\treturn Biome.getBiome(0);\n\t}", "@Override\r\n\tpublic void createSprites(World world) {\r\n \t// the height of the map since 0,0 in Tiled is in the top left\r\n // compared to the TiledMap's 0,0 in the bottom left\r\n int height = 2400;\r\n\r\n // file locations of different trees\r\n TextureAtlas atlas = new TextureAtlas(\"Game Tilesets/Trees/Trees.pack\");\r\n Skin skin = new Skin();\r\n skin.addRegions(atlas);\r\n TextureRegion T2 = skin.getRegion(\"T2\");\r\n TextureRegion T3 = skin.getRegion(\"T3\");\r\n TextureRegion T7 = skin.getRegion(\"T7\");\r\n TextureRegion T9 = skin.getRegion(\"T9\");\r\n TextureRegion T10 = skin.getRegion(\"T10\");\r\n \r\n // add all of the trees\r\n \tthis.addSprite(new ObjectSprites(T2, 236, height - 1490));\r\n \r\n this.addSprite(new ObjectSprites(T9, 622, height - 1907));\r\n this.addSprite(new ObjectSprites(T9, 683, height - 1687));\r\n this.addSprite(new ObjectSprites(T9, 174, height - 1851));\r\n this.addSprite(new ObjectSprites(T9, 361, height - 1643));\r\n \r\n this.addSprite(new ObjectSprites(T10, 572, height - 1354));\r\n this.addSprite(new ObjectSprites(T10, 0, height - 1475));\r\n this.addSprite(new ObjectSprites(T10, -9, height - 1707));\r\n this.addSprite(new ObjectSprites(T10, 675, height - 1479));\r\n this.addSprite(new ObjectSprites(T10, 416, height - 1903));\r\n\r\n this.addSprite(new ObjectSprites(T3, 428, height - 1453));\r\n this.addSprite(new ObjectSprites(T3, 596, height - 1122));\r\n this.addSprite(new ObjectSprites(T3, -32, height - 988));\r\n this.addSprite(new ObjectSprites(T3, 476, height - 864));\r\n this.addSprite(new ObjectSprites(T3, 640, height - 725));\r\n this.addSprite(new ObjectSprites(T3, 424, height - 2123));\r\n \r\n this.addSprite(new ObjectSprites(T7, 145, height - 1347));\r\n this.addSprite(new ObjectSprites(T7, 83, height - 1935));\r\n this.addSprite(new ObjectSprites(T7, 585, height - 2031));\r\n this.addSprite(new ObjectSprites(T7, 290, height - 2304));\r\n \r\n Bandit b1 = new Bandit();\r\n b1.defineBody(world, 215, 1305);\r\n super.addSprite(b1);\r\n \r\n Bandit b2 = new Bandit();\r\n b2.defineBody(world, 60, 1445);\r\n super.addSprite(b2);\r\n \r\n Bandit b3 = new Bandit();\r\n b3.defineBody(world, 90, 1640);\r\n super.addSprite(b3);\r\n \r\n Bandit b4 = new Bandit();\r\n b4.defineBody(world, 530, 1740);\r\n super.addSprite(b4);\r\n \r\n Bandit b5 = new Bandit();\r\n b5.defineBody(world, 730, 1655);\r\n super.addSprite(b5);\r\n \r\n Bandit b6 = new Bandit();\r\n b6.defineBody(world, 90, 2235);\r\n super.addSprite(b6);\r\n \r\n Bandit b7 = new Bandit();\r\n b7.defineBody(world, 715, 1490);\r\n super.addSprite(b7);\r\n \r\n Bandit b8 = new Bandit();\r\n b8.defineBody(world, 318, 1605);\r\n super.addSprite(b8);\r\n }", "public void buildMap() {\n // CUBES ENGINE INITIALIZATION MOVED TO APPSTATE METHOD\n // Here we init cubes engine\n CubesTestAssets.registerBlocks();\n CubesSettings blockSettings = CubesTestAssets.getSettings(this.app);\n blockSettings.setBlockSize(5);\n //When blockSize = 5, global coords should be multiplied by 3 \n this.blockScale = 3.0f;\n this.halfBlockStep = 0.5f;\n \n testTerrain = new BlockTerrainControl(CubesTestAssets.getSettings(this.app), new Vector3Int(4, 1, 4));\n testNode = new Node();\n int wallHeight = 3;\n //testTerrain.setBlockArea(new Vector3Int(0, 0, 0), new Vector3Int(32, 1, 64), CubesTestAssets.BLOCK_STONE);\n this.testTerrain.setBlockArea( new Vector3Int(3,0,43), new Vector3Int(10,1,10), CubesTestAssets.BLOCK_STONE); // Zone 1 Floor\n this.testTerrain.setBlockArea( new Vector3Int(3,1,43), new Vector3Int(10,wallHeight,1), CubesTestAssets.BLOCK_WOOD); // South Wall\n this.testTerrain.setBlockArea( new Vector3Int(3,1,52), new Vector3Int(10,wallHeight,1), CubesTestAssets.BLOCK_WOOD); // North Wall\n this.testTerrain.setBlockArea( new Vector3Int(3,1,43), new Vector3Int(1,wallHeight,10), CubesTestAssets.BLOCK_WOOD); // West Wall\n this.testTerrain.setBlockArea( new Vector3Int(12,1,43), new Vector3Int(1,wallHeight,10), CubesTestAssets.BLOCK_WOOD); // East Wall\n \n this.testTerrain.removeBlockArea( new Vector3Int(12,1,46), new Vector3Int(1,wallHeight,4)); // Door A\n \n this.testTerrain.setBlockArea( new Vector3Int(12,0,45), new Vector3Int(13,1,6), CubesTestAssets.BLOCK_STONE); // Zone 2 Floor A\n this.testTerrain.setBlockArea( new Vector3Int(12,1,45), new Vector3Int(8,wallHeight,1), CubesTestAssets.BLOCK_WOOD); // South Wall\n this.testTerrain.setBlockArea( new Vector3Int(12,1,50), new Vector3Int(13,wallHeight,1), CubesTestAssets.BLOCK_WOOD); // North Wall\n this.testTerrain.setBlockArea(new Vector3Int(19,0,42), new Vector3Int(6,1,3), CubesTestAssets.BLOCK_STONE); // Zone 2 Floor B\n this.testTerrain.setBlockArea( new Vector3Int(19,1,42), new Vector3Int(1,wallHeight,3), CubesTestAssets.BLOCK_WOOD); //\n this.testTerrain.setBlockArea( new Vector3Int(24,1,42), new Vector3Int(1,wallHeight,9), CubesTestAssets.BLOCK_WOOD); //\n \n this.testTerrain.setBlockArea( new Vector3Int(15,0,26), new Vector3Int(18,1,17), CubesTestAssets.BLOCK_STONE); // Zone 3 Floor\n this.testTerrain.setBlockArea( new Vector3Int(15,1,42), new Vector3Int(18,wallHeight,1), CubesTestAssets.BLOCK_WOOD); // South Wall\n this.testTerrain.setBlockArea( new Vector3Int(15,1,26), new Vector3Int(18,wallHeight,1), CubesTestAssets.BLOCK_WOOD); // North Wall\n this.testTerrain.setBlockArea( new Vector3Int(15,1,26), new Vector3Int(1,wallHeight,17), CubesTestAssets.BLOCK_WOOD); // West Wall\n this.testTerrain.setBlockArea( new Vector3Int(32,1,26), new Vector3Int(1,wallHeight,17), CubesTestAssets.BLOCK_WOOD); // East Wall\n \n this.testTerrain.removeBlockArea( new Vector3Int(20,1,42), new Vector3Int(4,wallHeight,1)); // Door B\n this.testTerrain.removeBlockArea( new Vector3Int(15,1,27), new Vector3Int(1,wallHeight,6)); // Door C\n \n this.testTerrain.setBlockArea( new Vector3Int(10,0,26), new Vector3Int(5,1,8), CubesTestAssets.BLOCK_STONE); // Zone 4 Floor A\n this.testTerrain.setBlockArea( new Vector3Int(10,1,26), new Vector3Int(5,wallHeight,1), CubesTestAssets.BLOCK_WOOD); // South Wall\n this.testTerrain.setBlockArea( new Vector3Int(3,0,18), new Vector3Int(8,1,16), CubesTestAssets.BLOCK_STONE); // Zone 4 Floor B\n this.testTerrain.setBlockArea( new Vector3Int(3,1,18), new Vector3Int(1,wallHeight,16), CubesTestAssets.BLOCK_WOOD); // East Wall\n this.testTerrain.setBlockArea( new Vector3Int(10,1,18), new Vector3Int(1,wallHeight,9), CubesTestAssets.BLOCK_WOOD); // West Wall\n this.testTerrain.setBlockArea( new Vector3Int(3,1,33), new Vector3Int(13,wallHeight,1), CubesTestAssets.BLOCK_WOOD); // North Wall\n \n this.testTerrain.setBlockArea( new Vector3Int(1,0,5), new Vector3Int(26,1,14), CubesTestAssets.BLOCK_STONE); // Zone 5\n this.testTerrain.setBlockArea( new Vector3Int(1,1,18), new Vector3Int(26,wallHeight,1), CubesTestAssets.BLOCK_WOOD); // South Wall\n this.testTerrain.setBlockArea( new Vector3Int(1,1,5), new Vector3Int(26,wallHeight,1), CubesTestAssets.BLOCK_WOOD); // North Wall\n this.testTerrain.setBlockArea( new Vector3Int(1,1,5), new Vector3Int(1,wallHeight,14), CubesTestAssets.BLOCK_WOOD); // West Wall\n this.testTerrain.setBlockArea( new Vector3Int(26,1,5), new Vector3Int(1,wallHeight,14), CubesTestAssets.BLOCK_WOOD); // East Wall\n \n this.testTerrain.removeBlockArea( new Vector3Int(4,1,18), new Vector3Int(6,wallHeight,1)); // Door E\n \n // Populate the world with spawn points\n this.initSpawnPoints();\n \n //Add voxel world/map to collisions\n testTerrain.addChunkListener(new BlockChunkListener(){\n @Override\n public void onSpatialUpdated(BlockChunkControl blockChunk){\n Geometry optimizedGeometry = blockChunk.getOptimizedGeometry_Opaque();\n phyTerrain = optimizedGeometry.getControl(RigidBodyControl.class);\n if(phyTerrain == null){\n phyTerrain = new RigidBodyControl(0);\n optimizedGeometry.addControl(phyTerrain);\n bulletAppState.getPhysicsSpace().add(phyTerrain);\n }\n phyTerrain.setCollisionShape(new MeshCollisionShape(optimizedGeometry.getMesh()));\n }\n });\n \n testNode.addControl(testTerrain);\n rootNode.attachChild(testNode);\n }", "public ChunkFiler() {}", "@Override\r\n public void initCreature() \r\n {\n \t\r\n if ( worldObj.provider.dimensionId == 1 && worldObj.rand.nextInt( 5 ) == 0 )\r\n \t{\r\n \tsetCarried( Block.whiteStone.blockID );\r\n \tsetCarryingData( 0 );\r\n \t}\r\n }", "protected void generate() {\n\t\tcpGenerator( nx, ny, nz, ClosePackedLattice.HCP);\n\t}", "public Main()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 600, 1); \n\n prepare();\n }", "public void create () {\n // TODO random generation of a ~100 x 100 x 100 world\n }", "private void growMap() {\n\t\tshort chunkId;\n\n\t\t// Fill until full\n\t\twhile (end % STORED_CHUNKS != currChunk % STORED_CHUNKS || end == 0) {\n\t\t\tchunkId = (short) random.nextInt(chunks.length);\n\t\t\tmap[end % STORED_CHUNKS] = chunkId;\n\t\t\tchunks[chunkId].setupToStage(stage, end * MapChunk.WIDTH * tileSize, 0);\n\t\t\tend++;\n\t\t}\n\t}", "private RandomLocationGen() {}", "public void renderWorldBlock(bbb renderblocks, ym iba, int i, int j, int k, int md)\r\n/* 26: */ {\r\n/* 27: 26 */ int cons = 0;\r\n/* 28: 27 */ TilePipe tt = (TilePipe)CoreLib.getTileEntity(iba, i, j, k, TilePipe.class);\r\n/* 29: 29 */ if (tt == null) {\r\n/* 30: 29 */ return;\r\n/* 31: */ }\r\n/* 32: 31 */ this.context.exactTextureCoordinates = true;\r\n/* 33: 32 */ this.context.setTexFlags(55);\r\n/* 34: 33 */ this.context.setTint(1.0F, 1.0F, 1.0F);\r\n/* 35: 34 */ this.context.setPos(i, j, k);\r\n/* 36: 35 */ if (tt.CoverSides > 0)\r\n/* 37: */ {\r\n/* 38: 36 */ this.context.readGlobalLights(iba, i, j, k);\r\n/* 39: 37 */ renderCovers(tt.CoverSides, tt.Covers);\r\n/* 40: */ }\r\n/* 41: 40 */ cons = PipeLib.getConnections(iba, i, j, k);\r\n/* 42: */ \r\n/* 43: */ \r\n/* 44: */ \r\n/* 45: 44 */ this.context.setBrightness(this.block.e(iba, i, j, k));\r\n/* 46: */ \r\n/* 47: 46 */ this.context.setLocalLights(0.5F, 1.0F, 0.8F, 0.8F, 0.6F, 0.6F);\r\n/* 48: 47 */ this.context.setPos(i, j, k);\r\n/* 49: */ \r\n/* 50: 49 */ RenderLib.bindTexture(\"/eloraam/machine/machine1.png\");\r\n/* 51: */ \r\n/* 52: */ \r\n/* 53: */ \r\n/* 54: */ \r\n/* 55: */ \r\n/* 56: */ \r\n/* 57: */ \r\n/* 58: */ \r\n/* 59: */ \r\n/* 60: */ \r\n/* 61: */ \r\n/* 62: */ \r\n/* 63: */ \r\n/* 64: 63 */ renderCenterBlock(cons, 26, 28);\r\n/* 65: */ \r\n/* 66: 65 */ tt.cacheFlange();\r\n/* 67: 66 */ renderFlanges(tt.Flanges, 27);\r\n/* 68: */ \r\n/* 69: 68 */ RenderLib.unbindTexture();\r\n/* 70: */ }", "private void initEntities() {\n \n for (int i = 0; i < 15; ++i) {\n \n //generate random position and direction\n Vector3 pos = new Vector3(\n ((ValuesUtil.rand.nextFloat() * 2.0f) - 1.0f) *\n TransformationsUtil.getOpenGLDim().x,\n ((ValuesUtil.rand.nextFloat() * 2.0f) - 1.0f) *\n TransformationsUtil.getOpenGLDim().y,\n 0.0f);\n float rot = ValuesUtil.rand.nextFloat() * 360.0f;\n \n entities.add(new GlowFish(pos, new Vector3(0.0f, 0.0f, rot)));\n }\n \n //fader\n entities.add(new Fader(FadeDirection.FADE_IN, 0.02f,\n new Vector4(0.0f, 0.0f, 0.0f, 1.0f), true));\n }", "public WorldGenerator getRandomWorldGenForTrees(EaglercraftRandom par1Random) {\n\t\treturn (WorldGenerator) (par1Random.nextInt(5) == 0 ? this.worldGeneratorForest\n\t\t\t\t: (par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees));\n\t}", "public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1000, 600, 1);\n planets();\n stars();\n }", "@Override\n\tpublic void init() {\n\t\tworld = new World(gsm);\n\t\tworld.init();\n\t\t\n\t\tif(worldName == null){\n\t\t\tworldName = \"null\";\n\t\t\tmap_name = \"map\";\n\t\t} \n\t\tworld.generate(map_name);\n\t}", "public CustomizableNoiseChunkGenerator(Registry<StructureSet> structureSets, Registry<NormalNoise.NoiseParameters> noises, BiomeSource biomeSource, BiomeSource runtimeBiomeSource, long seed, Holder<NoiseGeneratorSettings> settingsHolder)\n\t{\n\t\tsuper(structureSets, noises, runtimeBiomeSource, seed, settingsHolder);\n\t\t\n\t\tsetWorldgenBiomeSource(biomeSource);\n\t\t\n\t\tthis.noises = noises;\n\t}", "public void generateLevel() {\n\t\tfor (int y = 0; y < this.height; y++) {\n\t\t\tfor (int x = 0; x < this.width; x++) {\n\t\t\t\tif (x * y % 10 < 5)\n\t\t\t\t\ttiles[x + y * width] = Tile.GRASS.getId();\n\t\t\t\telse\n\t\t\t\t\ttiles[x + y * width] = Tile.STONE.getId();\n\t\t\t}\n\t\t}\n\t}", "public void breakBlock(World world, int x, int y, int z, Block par5, int par6)\r\n/* 186: */ {\r\n/* 187:209 */ if ((world.getBlock(x, y, z) != FMPBase.getFMPBlockId()) && \r\n/* 188:210 */ ((world.getTileEntity(x, y, z) instanceof TileEntityTransferNode)))\r\n/* 189: */ {\r\n/* 190:211 */ TileEntityTransferNode tile = (TileEntityTransferNode)world.getTileEntity(x, y, z);\r\n/* 191:213 */ if (!tile.getUpgrades().isEmpty()) {\r\n/* 192:214 */ for (int i = 0; i < tile.getUpgrades().size(); i++)\r\n/* 193: */ {\r\n/* 194:215 */ ItemStack itemstack = (ItemStack)tile.getUpgrades().get(i);\r\n/* 195:216 */ float f = this.random.nextFloat() * 0.8F + 0.1F;\r\n/* 196:217 */ float f1 = this.random.nextFloat() * 0.8F + 0.1F;\r\n/* 197: */ EntityItem entityitem;\r\n/* 198:220 */ for (float f2 = this.random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem))\r\n/* 199: */ {\r\n/* 200:221 */ int k1 = this.random.nextInt(21) + 10;\r\n/* 201:223 */ if (k1 > itemstack.stackSize) {\r\n/* 202:224 */ k1 = itemstack.stackSize;\r\n/* 203: */ }\r\n/* 204:227 */ itemstack.stackSize -= k1;\r\n/* 205:228 */ entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));\r\n/* 206:229 */ float f3 = 0.05F;\r\n/* 207:230 */ entityitem.motionX = ((float)this.random.nextGaussian() * f3);\r\n/* 208:231 */ entityitem.motionY = ((float)this.random.nextGaussian() * f3 + 0.2F);\r\n/* 209:232 */ entityitem.motionZ = ((float)this.random.nextGaussian() * f3);\r\n/* 210:234 */ if (itemstack.hasTagCompound()) {\r\n/* 211:235 */ entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());\r\n/* 212: */ }\r\n/* 213: */ }\r\n/* 214: */ }\r\n/* 215: */ }\r\n/* 216:241 */ if ((tile instanceof TileEntityTransferNodeInventory))\r\n/* 217: */ {\r\n/* 218:242 */ TileEntityTransferNodeInventory tileentity = (TileEntityTransferNodeInventory)tile;\r\n/* 219: */ \r\n/* 220:244 */ ItemStack itemstack = tileentity.getStackInSlot(0);\r\n/* 221:246 */ if (itemstack != null)\r\n/* 222: */ {\r\n/* 223:247 */ float f = this.random.nextFloat() * 0.8F + 0.1F;\r\n/* 224:248 */ float f1 = this.random.nextFloat() * 0.8F + 0.1F;\r\n/* 225: */ EntityItem entityitem;\r\n/* 226:251 */ for (float f2 = this.random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem))\r\n/* 227: */ {\r\n/* 228:252 */ int k1 = this.random.nextInt(21) + 10;\r\n/* 229:254 */ if (k1 > itemstack.stackSize) {\r\n/* 230:255 */ k1 = itemstack.stackSize;\r\n/* 231: */ }\r\n/* 232:258 */ itemstack.stackSize -= k1;\r\n/* 233:259 */ entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));\r\n/* 234:260 */ float f3 = 0.05F;\r\n/* 235:261 */ entityitem.motionX = ((float)this.random.nextGaussian() * f3);\r\n/* 236:262 */ entityitem.motionY = ((float)this.random.nextGaussian() * f3 + 0.2F);\r\n/* 237:263 */ entityitem.motionZ = ((float)this.random.nextGaussian() * f3);\r\n/* 238:265 */ if (itemstack.hasTagCompound()) {\r\n/* 239:266 */ entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());\r\n/* 240: */ }\r\n/* 241: */ }\r\n/* 242: */ }\r\n/* 243:271 */ world.func_147453_f(x, y, z, par5);\r\n/* 244: */ }\r\n/* 245: */ }\r\n/* 246:276 */ super.breakBlock(world, x, y, z, par5, par6);\r\n/* 247: */ }", "public OverWorld()\n { \n // Create a new world with 800x600 cells with a cell size of 1x1 pixels.\n super(1024, 600, 1, false);\n Setup();\n }", "private void deliverBomb(Player me, Location location) \n {\n for (int i = 0; i < NUMBER_OF_BOMBS; i++) \n {\n double plusX = Math.random() * 5;\n if ((Math.random() * 10) < 6) \n {\n \t plusX = (0 - plusX);\n }\t\t\t\n double plusZ = Math.random() * 5;\n if ((Math.random() * 10) < 6) \n {\n plusZ = (0 - plusZ);\n }\n Location newLocation = new Location(location.getWorld(),\n location.getX() + plusX, \n location.getY() + (Math.random() + 20),\n location.getZ() + plusZ);\n // This spawns the creeper at the location provided\n me.getWorld().spawn(newLocation, Creeper.class);\n } \n }" ]
[ "0.7252623", "0.708915", "0.70679116", "0.7054006", "0.6607397", "0.64371574", "0.62349504", "0.6205043", "0.61917984", "0.6187928", "0.6167356", "0.6091154", "0.60732836", "0.6052683", "0.6050643", "0.604357", "0.6024122", "0.59853834", "0.59573036", "0.5911461", "0.5906988", "0.58607835", "0.5844038", "0.58393294", "0.5813256", "0.5792333", "0.5743355", "0.57238716", "0.5700455", "0.5700168", "0.5677225", "0.56566954", "0.56562996", "0.5648851", "0.5635685", "0.5594183", "0.5578848", "0.55529124", "0.55517465", "0.5551475", "0.5545406", "0.5545217", "0.55408275", "0.5510566", "0.5505384", "0.5497594", "0.5497544", "0.5489898", "0.5484596", "0.54838794", "0.5482849", "0.5475839", "0.54678214", "0.5466987", "0.545319", "0.5441164", "0.5435085", "0.54069567", "0.5401665", "0.5399663", "0.5383764", "0.5366037", "0.5363024", "0.53596634", "0.53421056", "0.5333224", "0.532383", "0.53108823", "0.52895576", "0.5289162", "0.52846026", "0.52793056", "0.52768767", "0.5276438", "0.5272104", "0.52717936", "0.5270752", "0.5264929", "0.52626663", "0.52358913", "0.52281666", "0.5226614", "0.5224979", "0.5206682", "0.5196547", "0.519481", "0.51947856", "0.51870376", "0.51864696", "0.51826626", "0.51673007", "0.5165463", "0.5158573", "0.5155465", "0.51531935", "0.5148788", "0.51462805", "0.51419836", "0.51405877", "0.5131118" ]
0.77253854
0
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd HH:mm:ss");
@Deprecated public static long getSecond(String argDateTime, String argInFormat) { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(argInFormat); try { //Date date = simpleDateFormat.parse(simpleDateFormat.format(argDateTime)); Date date = simpleDateFormat.parse(argDateTime); return date.getTime() / 1000; } catch (ParseException ex) { //ex.printStackTrace(); return System.currentTimeMillis() / 1000; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void m1() {\n\n String d = \"2019/03/22 10:00-11:00\";\n DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd HH:mm-HH:mm\");\n try {\n Date parse = df.parse(d);\n System.out.println(df.format(parse));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }", "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 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: */ }", "public static void main(String[] args) {\r\n\t\tDate now = new Date();\r\n\t\tSimpleDateFormat sdf = \r\n\t\tnew SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\tString str = sdf.format(now);\r\n\tSystem.out.println(str);\r\n\tlong time = now.getTime();\r\n\ttime += 48954644;\r\n\tnow.setTime(time);\r\n\tSystem.out.println(sdf.format(now));\r\n\tDate dat = null;\r\n\ttry {\r\n\t\tdat = sdf.parse(str);\r\n\t} catch (ParseException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t}\r\n\tSystem.out.println(dat);\r\n\t\r\n\r\n}", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "public static String ShowDate(){\n Date date = new Date();\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss.SS a\");\n String HH_MM = sdf.format(date);\n return HH_MM;\n }", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "public static void main(String[] args)\r\n/* 96: */ {\r\n/* 97:104 */ SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n/* 98:105 */ String qiandaotime = df.format(new Date());\r\n/* 99:106 */ System.out.println(qiandaotime);\r\n/* 100: */ }", "public String getTime() {\n String pattern = \"yyyy-MM-dd HH:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\n String date = simpleDateFormat.format(new Date());\n return date;\n }", "String dateToString(int year, int month, int day, int hour, int minute, double seconds);", "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 void mostrarHora(String formato){\n Date objDate = new Date();\n SimpleDateFormat objSDF = new SimpleDateFormat(formato);\n //este sera el resultado de la fechas\n fecha=objSDF.format(objDate);\n }", "public static String getDateString(){\n\t\t\tCalendar now = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd__HH-mm-ss\");\n\t\t\treturn sdf.format(now.getTime());\n\t }", "private String getDate()\r\n\t{\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n\t\treturn sdf.format(cal.getTime());\r\n\t}", "public static Date getDateFromString(String date) {\r\n Date newdate = null;\r\n SimpleDateFormat dateformat = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\r\n\r\n try {\r\n newdate = dateformat.parse(date);\r\n System.out.println(newdate);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return newdate;\r\n }", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "public SimpleDateFormat() {\n\t\tthis(getDefaultPattern(), null, null, null, null, true, null);\n\t}", "public static String longToYYYYMMDDHHMM(long longTime)\r\n/* 157: */ {\r\n/* 158:232 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd HH:mm\");\r\n/* 159:233 */ Date strtodate = new Date(longTime);\r\n/* 160:234 */ return formatter.format(strtodate);\r\n/* 161: */ }", "public static String createTimeStamp(){\n return new SimpleDateFormat( \"yyyy.MM.dd.HH.mm.ss\").format(new Date());\n }", "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 }", "public static Date fotmatDate21(String myDate) {\n\t\tDate dDate = new SimpleDateFormat(\"HH:mm:ss\").parse(myDate,\r\n\t\t\t\tnew ParsePosition(0));\r\n\t\treturn dDate;\r\n\t}", "private void constructVssDateTimeFormat() {\n vssDateTimeFormat = new SimpleDateFormat(\"'Date: '\" + this.dateFormat + \" 'Time: 'hh:mma\"); \n }", "private String formatDate(Date date){\n SimpleDateFormat format = new SimpleDateFormat(\"dd-MM-yyyy HH:mm\", Locale.getDefault());\n\n return format.format(date);\n }", "public String formatDateAndTime(String date){\n\n return dateTimeFormatter.parse(date).toString();\n\n }", "@Test\n void test7(){\n\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date date = new Date();\n String dString = formatter.format(date);\n System.out.println(\"dString=\"+dString);\n\n Date datas = java.sql.Date.valueOf(dString);\n System.out.println(\"datas=\"+datas);\n\n\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 String getDate() {\n\t\tSimpleDateFormat parseFormat = new SimpleDateFormat(\"hh:mm a\");\n\t\tDate date = new Date();\n\t\tString s = parseFormat.format(date);\n\t\treturn s;\n\t}", "public String dar_hora(){\n Date date = new Date();\n DateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss\");\n return dateFormat.format(date).toString();\n }", "private static String time() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH-mm-ss \");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "private static String getDate()\n\t{\n\t\tString dateString = null;\n\t\tDate sysDate = new Date( System.currentTimeMillis() );\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yy HH:mm:ss\");\n\t\tdateString = sdf.format(sysDate);\n\t\treturn dateString;\n\t}", "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 String getTimeString() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss yyyy\");\n return formatter.format(new java.util.Date());\n }", "public static void main(String[] args) throws Exception {\n Calendar cal = Calendar.getInstance();\n SimpleDateFormat simpleformat = new SimpleDateFormat(\"E, dd MMM yyyy HH:mm:ss Z\");\n System.out.println(\"Today's date and time = \"+simpleformat.format(cal.getTime()));\n // displaying date\n simpleformat = new SimpleDateFormat(\"dd/MMMM/yyyy\");\n String str = simpleformat.format(new Date());\n System.out.println(\"Current Date = \"+str);\n // current time\n simpleformat = new SimpleDateFormat(\"HH:mm:ss\");\n String strTime = simpleformat.format(new Date());\n System.out.println(\"Current Time = \"+strTime);\n // displaying hour in HH format\n simpleformat = new SimpleDateFormat(\"HH\");\n String strHour = simpleformat.format(new Date());\n System.out.println(\"Hour in HH format = \"+strHour);\n\n\n\n //formato ideal\n simpleformat = new SimpleDateFormat(\"dd/MM/yyyy - HH:mm:ss\");\n String strTimeDay = simpleformat.format(new Date());\n System.out.println(\"Dia e Hora = \" + strTimeDay);\n\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 }", "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}", "public DateUtility () {\n dateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\n }", "public static void main(String[] args) {\n\t\tDate today = new Date();\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy:MM:dd hh:MM:ss\");\n\t\tString s= sdf.format(today);\n\t\tSystem.out.println(s);\n\t}", "public static void main(String[] args) throws ParseException {\n\t Long t = Long.parseLong(\"1540452984\");\r\n Timestamp ts = new Timestamp(1540453766);\r\n DateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n //方法一:优势在于可以灵活的设置字符串的形式。\r\n String tsStr = sdf.format(ts);// 2017-01-15 21:17:04\r\n System.out.println(tsStr);\r\n\t}", "private static String getDateStr() {\n\t\tDate date = Calendar.getInstance().getTime();\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMddyyy\");\n\t\tString dateStr = dateFormat.format(date);\n\t\treturn dateStr;\n\t}", "public static String timeToString(Date date)\r\n/* 24: */ {\r\n/* 25: 31 */ return sdfTime.format(date);\r\n/* 26: */ }", "public static void dateFormat() {\n }", "private static String timeFor(Date date)\n\t{\n\t\tDateFormat df = new InternetDateFormat();\n\t\tString theTime = df.format(date);\n\t\treturn theTime;\n\t}", "public String getTimeAndDate() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd MMM hh:mm\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString dateAndTime = dateFormat.format(cal.getTime());\n\t\t\treturn dateAndTime;\n\t\t}", "@SuppressWarnings(\"deprecation\")\r\n\tpublic String format(Date date,boolean time){\n\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyyMMdd\");\r\n\tString timestamp=dateFormat.format(date)+\"T\";\r\n\tif(time){\r\n\t\tdateFormat = new SimpleDateFormat(\"HH:mm:ssZ\");\r\n\t\ttimestamp+=dateFormat.format(date);\r\n\t}\r\n else{\r\n \tdate.setHours(12);\r\n \tdate.setMinutes(0);\r\n \tdate.setSeconds(0);\r\n \tdateFormat = new SimpleDateFormat(\"HH:mm:ss\");\r\n \ttimestamp+=dateFormat.format(date);\r\n \ttimestamp+=\"+0000\";\r\n }\r\n\treturn timestamp;\r\n }", "private String convertDate2String(Date date) {\n DateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yyyy HH:mm:ss\");\n return dateFormat.format(date);\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "public static String dateToString(Date date)\r\n/* 19: */ {\r\n/* 20: 23 */ return sdfDate.format(date);\r\n/* 21: */ }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "public String toString() { //toString method\n String startDateString2= \"\"; //Initialize\n try{\n Date date1 = new SimpleDateFormat(\"yyyyMMdd\").parse(full_Date);\n DateFormat df2 = new SimpleDateFormat(\"MMM dd, yyyy\");\n startDateString2 = df2.format(date1);\n \n return startDateString2;\n }catch(ParseException e){\n e.printStackTrace();\n }\n return startDateString2;\n \n}", "public String getDateCreationLibelle() {\n\t\tDateTimeFormatter format = DateTimeFormatter.ofPattern(\"dd/MM/yyyy hh:mm:ss\");\n\t\treturn this.dateCreation.format(format);\n\t}", "public static SimpleDateFormat createDateFormat() {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS\");\n TimeZone myTimeZone = TimeZone.getTimeZone(ZoneId.of(\"UTC\"));\n dateFormat.setTimeZone(myTimeZone);\n dateFormat.setLenient(false);\n return dateFormat;\n }", "public static String getDateTime(){\n String pattern = \"MM/dd/yyyy HH:mm:ss\";\n DateFormat df = new SimpleDateFormat(pattern);\n Date today = Calendar.getInstance().getTime();\n String todayAsString = df.format(today);\n return todayAsString;\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 }", "String getDate();", "String getDate();", "public SimpleDateFormat initialValue() {\n return new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\", Locale.getDefault());\n }", "protected final static String getDateStamp() {\n\n\t\treturn\n\n\t\tnew SimpleDateFormat(\"MMM d, yyyy h:mm:ss a zzz\").format(new Date());\n\n\t}", "private String createDate(){\n SimpleDateFormat date = new SimpleDateFormat(\"EEE, MMM d, yyyy\");\n String stringDate = date.format(new Date()); \n return stringDate;\n }", "public static String timestamp(){\n\t\tDate date = new Date();\n\t\tDateFormat hourdateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss \");\n\t\treturn hourdateFormat.format(date);\n\t}", "private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}", "public static String getDateTime() {\n\t\tString sDateTime=\"\";\n\t\ttry {\n\t\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t\tSimpleDateFormat sdfTime = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tDate now = new Date();\n\t\t\tString strDate = sdfDate.format(now);\n\t\t\tString strTime = sdfTime.format(now);\n\t\t\tstrTime = strTime.replace(\":\", \"-\");\n\t\t\tsDateTime = \"D\" + strDate + \"_T\" + strTime;\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\t\treturn sDateTime;\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 }", "String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}", "private String formatTime(Date dateObject) {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\");\n return timeFormat.format(dateObject);\n }", "public static void main(String[] args) {\n\n\t\tDate d=new Date();\n\t\tSimpleDateFormat sdf= new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\tSimpleDateFormat hms= new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");\n\t\tSystem.out.println(sdf.format(d));\n\t\tSystem.out.println(hms.format(d));\n\t\tSystem.out.println(d.toString());\n\t}", "protected static SimpleDateFormat dateFormat() {\n return dateFormat(true, false);\n }", "public static String timeStamp()\n {\n DateFormat format = new SimpleDateFormat(\"ddMMyyHHmmSS\");\n return format.format(new Date());\n }", "public final /* synthetic */ Object initialValue() {\n return new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\", Locale.US);\n }", "public String getDateConvert() {\n SimpleDateFormat dateFormat1 = new SimpleDateFormat(\"MMM dd yyyy - hh:mm\");\n SimpleDateFormat dateFormat2 = new SimpleDateFormat(\"a\");\n String date = dateFormat1.format(this.timePost) + dateFormat2.format(this.timePost).toLowerCase();\n return date;\n }", "public static SimpleDateFormat getHourFormat() {\n return new SimpleDateFormat(\"HH:mm\");\n }", "public static String formatDateForDetails(Timestamp date) {\n SimpleDateFormat format = new SimpleDateFormat(\"dd MMM yyyy | hh:mm aaa\", Locale.getDefault());\n return format.format(new Date(date.getTime()));\n }", "private String formatDateForVSS(Date d) {\n SimpleDateFormat sdf = new SimpleDateFormat(this.dateFormat + \";hh:mma\");\n \t\tString vssFormattedDate = sdf.format(d);\n \t\treturn vssFormattedDate.substring(0, vssFormattedDate.length() - 1);\n \t}", "private void formatTime() {\r\n\t\tDate date = new Date();\r\n\t\tSimpleDateFormat ft = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\r\n\t\tm_timeSent = ft.format(date).toString();\r\n\t}", "Date getTimeStamp();", "public Date getDateTime(SimpleDateFormat format) {\n\t\tDate dt = null;\n\t\ttry {\t\t\t\t\n\t\t\tString dateInString = this.month + \"/\" + this.day + \"/\" + this.year + \" \" +\n\t\t\t\tthis.hour + \":\" + this.minute + \":\" + this.second;\n\t\t\tif(dateInString.trim().length() > 5 ) {\n\t\t\t\tdt = format.parse(dateInString);\n\t\t\t}\n\t\t} catch (Exception e ) {\n\t\t\tdt = null;\n\t\t}\n\t\treturn dt;\n\t}", "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 void main(String[] args) {\n\t\t\n\t\tDate d=new Date();\n\t\tSystem.out.println(d.toString());\n\t\t\n\t\t/**\n\t\t * mm/dd/yyyy format or HH:MM:SS format\n\t\t */\n\t\t//SimpleDateFormat sdf=new SimpleDateFormat(\"M/d/yyyy\");\n\t\t\n\t\tSimpleDateFormat sdf=new SimpleDateFormat(\"M/d/yyyy hh:mm:ss\");\n\t\t\n\t\tSystem.out.println(sdf.format(d));\n\t\t\n\n\t}", "public static String getDateTime(String publishtime) {\n if (publishtime != null && !publishtime.equals(\"\")) {\n SimpleDateFormat data = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n return data.format(new Date(Long.parseLong(publishtime) * 1000L));\n }\n return \"\";\n }", "public void setDateAndTime(int d,int m,int y,int h,int n,int s);", "private static SimpleDateFormat getDateFormat() {\r\n\t\tif(dateFormat == null)\r\n\t\t\tdateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\t\treturn dateFormat;\r\n\t}", "public static String getDateAndTime() {\n Calendar JCalendar = Calendar.getInstance();\n String JMonth = JCalendar.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.UK);\n String JDate = JCalendar.getDisplayName(Calendar.DATE, Calendar.LONG, Locale.UK);\n String JHour = JCalendar.getDisplayName(Calendar.HOUR, Calendar.LONG, Locale.UK);\n String JSec = JCalendar.getDisplayName(Calendar.SECOND, Calendar.LONG, Locale.UK);\n\n return JDate + \"th \" + JMonth + \"/\" + JHour + \".\" + JSec + \"/24hours\";\n }", "public void log(String message){\n Date date = new Date();\n String pattern = \"hh:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n String dateText = simpleDateFormat.format(date);\n System.out.println(\"LOG \" + dateText + \": \" + message);\n }", "String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }", "public static String getHHMM()\r\n/* 74: */ {\r\n/* 75: 94 */ String nowTime = \"\";\r\n/* 76: 95 */ Date now = new Date();\r\n/* 77: 96 */ SimpleDateFormat formatter = new SimpleDateFormat(\"HH:mm\");\r\n/* 78: 97 */ nowTime = formatter.format(now);\r\n/* 79: 98 */ return nowTime;\r\n/* 80: */ }", "private String formatTime(Date dateObject) {\r\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\");\r\n return timeFormat.format(dateObject);\r\n }", "private String formatDate (Date date) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"E, dd MMM yyyy HH:mm:ss\", Locale.ENGLISH);\n return sdf.format(date);\n }", "@Override\n\tpublic Date getDate(String parameter, String parameter2) {\n\t\t String startDate=parameter+\" \"+parameter2;\n\t\t SimpleDateFormat sdf1 = new SimpleDateFormat(\"yyyy-MM-dd h:mm a\");\n\t\t java.util.Date date;\n\t\ttry {\n\t\t\tdate = sdf1.parse(startDate);\n\t\t\tDate sqlStartDate = new Date(date.getTime());\n\t\t\treturn sqlStartDate;\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public SimpleDateFormat(final String pattern) {\n\t\tthis(pattern, null, null, null, null, true, null);\n\t}", "public static String formatToSimpleDate(Date date) {\n\t\treturn FORMATTER_SIMPLE_DATE.format(date);\n\t}", "public static String getNowAsTimestamp() {\r\n\r\n DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN);\r\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\r\n return dateFormat.format(new Date()).replaceAll(\"\\\\+0000\", \"Z\").replaceAll(\"([+-][0-9]{2}):([0-9]{2})\", \"$1$2\");\r\n }", "public static String ConvertToStandardtime(Date date) {\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tformat.setLenient(false);\r\n\t\tif (date == null)\r\n\t\t\treturn \"\";\r\n\t\tString strDate = format.format(date);\r\n\t\treturn strDate;\r\n\t}", "private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy HH:mm\");\n Date date = new Date();\n return dateFormat.format(date);\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}", "@Test\n public void toStringOk(){\n Date date = new Date(1,Month.january,1970);\n assertEquals(date.toString(),\"1 january 1970\");\n }", "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 String generateDate()\r\n\t{\r\n\t\tDate d = new Date();\r\n\t\tSimpleDateFormat datef = new SimpleDateFormat(\"YYYY_MM_dd_ss\");\r\n\t\treturn datef.format(d);\r\n\r\n\r\n\t}", "private String getFecha() {\n\t\tLocalDateTime myDateObj = LocalDateTime.now();\n\t\tDateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern(\"dd-MM-yyyy HH:mm:ss\");\n\t\tString formattedDate = myDateObj.format(myFormatObj);\n \n\t\treturn formattedDate;\n }", "protected static SimpleDateFormat xsdDateFormat() {\n return new SimpleDateFormat(\"yyyy-MM-dd\");\n }" ]
[ "0.6640912", "0.6538995", "0.6393982", "0.6386351", "0.63015264", "0.6225367", "0.6150575", "0.6081788", "0.6026739", "0.6019955", "0.5924739", "0.59236455", "0.5895194", "0.5877031", "0.5857094", "0.5802417", "0.5773614", "0.5729926", "0.57202905", "0.5707658", "0.5701587", "0.5699659", "0.5668615", "0.56679857", "0.56665266", "0.56254", "0.5624831", "0.56231165", "0.5615215", "0.56088555", "0.55833536", "0.5582786", "0.55815023", "0.5578444", "0.55770004", "0.55366975", "0.5535841", "0.5524463", "0.5517239", "0.5508829", "0.5508462", "0.5499693", "0.5494805", "0.5493671", "0.5492578", "0.5489104", "0.54780394", "0.54757184", "0.54757184", "0.54677254", "0.5458223", "0.5439", "0.5436139", "0.5433234", "0.5429179", "0.5398609", "0.5396624", "0.5396624", "0.5394613", "0.53913057", "0.53876334", "0.5373093", "0.53721225", "0.5357839", "0.5355617", "0.5345029", "0.5333945", "0.53325784", "0.5331725", "0.53304166", "0.53244895", "0.5313331", "0.5309244", "0.530188", "0.529774", "0.52916473", "0.5285667", "0.52762216", "0.52754575", "0.5274947", "0.52742624", "0.52683026", "0.52633107", "0.5261198", "0.5256899", "0.5255335", "0.52509344", "0.52488995", "0.52462935", "0.5242746", "0.524217", "0.52396333", "0.52318895", "0.5231626", "0.5229538", "0.5229118", "0.52286196", "0.5223535", "0.52216166", "0.5217304", "0.5214742" ]
0.0
-1
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd HH:mm:ss");
@Deprecated public static long getGMTSecond(String argDateTime, String argInFormat) { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(argInFormat, Locale.ENGLISH); simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); try { //Date date = simpleDateFormat.parse(simpleDateFormat.format(argDateTime)); DateFormat dateFormat = new SimpleDateFormat(argInFormat); Date date = simpleDateFormat.parse(argDateTime); return date.getTime() / 1000; } catch (ParseException ex) { //ex.printStackTrace(); return System.currentTimeMillis() / 1000; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void m1() {\n\n String d = \"2019/03/22 10:00-11:00\";\n DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd HH:mm-HH:mm\");\n try {\n Date parse = df.parse(d);\n System.out.println(df.format(parse));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }", "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 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: */ }", "public static void main(String[] args) {\r\n\t\tDate now = new Date();\r\n\t\tSimpleDateFormat sdf = \r\n\t\tnew SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\tString str = sdf.format(now);\r\n\tSystem.out.println(str);\r\n\tlong time = now.getTime();\r\n\ttime += 48954644;\r\n\tnow.setTime(time);\r\n\tSystem.out.println(sdf.format(now));\r\n\tDate dat = null;\r\n\ttry {\r\n\t\tdat = sdf.parse(str);\r\n\t} catch (ParseException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t}\r\n\tSystem.out.println(dat);\r\n\t\r\n\r\n}", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "public static String ShowDate(){\n Date date = new Date();\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss.SS a\");\n String HH_MM = sdf.format(date);\n return HH_MM;\n }", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "public static void main(String[] args)\r\n/* 96: */ {\r\n/* 97:104 */ SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n/* 98:105 */ String qiandaotime = df.format(new Date());\r\n/* 99:106 */ System.out.println(qiandaotime);\r\n/* 100: */ }", "public String getTime() {\n String pattern = \"yyyy-MM-dd HH:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\n String date = simpleDateFormat.format(new Date());\n return date;\n }", "String dateToString(int year, int month, int day, int hour, int minute, double seconds);", "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 void mostrarHora(String formato){\n Date objDate = new Date();\n SimpleDateFormat objSDF = new SimpleDateFormat(formato);\n //este sera el resultado de la fechas\n fecha=objSDF.format(objDate);\n }", "public static String getDateString(){\n\t\t\tCalendar now = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd__HH-mm-ss\");\n\t\t\treturn sdf.format(now.getTime());\n\t }", "private String getDate()\r\n\t{\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n\t\treturn sdf.format(cal.getTime());\r\n\t}", "public static Date getDateFromString(String date) {\r\n Date newdate = null;\r\n SimpleDateFormat dateformat = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\r\n\r\n try {\r\n newdate = dateformat.parse(date);\r\n System.out.println(newdate);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return newdate;\r\n }", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "public SimpleDateFormat() {\n\t\tthis(getDefaultPattern(), null, null, null, null, true, null);\n\t}", "public static String longToYYYYMMDDHHMM(long longTime)\r\n/* 157: */ {\r\n/* 158:232 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd HH:mm\");\r\n/* 159:233 */ Date strtodate = new Date(longTime);\r\n/* 160:234 */ return formatter.format(strtodate);\r\n/* 161: */ }", "public static String createTimeStamp(){\n return new SimpleDateFormat( \"yyyy.MM.dd.HH.mm.ss\").format(new Date());\n }", "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 }", "public static Date fotmatDate21(String myDate) {\n\t\tDate dDate = new SimpleDateFormat(\"HH:mm:ss\").parse(myDate,\r\n\t\t\t\tnew ParsePosition(0));\r\n\t\treturn dDate;\r\n\t}", "private void constructVssDateTimeFormat() {\n vssDateTimeFormat = new SimpleDateFormat(\"'Date: '\" + this.dateFormat + \" 'Time: 'hh:mma\"); \n }", "private String formatDate(Date date){\n SimpleDateFormat format = new SimpleDateFormat(\"dd-MM-yyyy HH:mm\", Locale.getDefault());\n\n return format.format(date);\n }", "public String formatDateAndTime(String date){\n\n return dateTimeFormatter.parse(date).toString();\n\n }", "@Test\n void test7(){\n\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date date = new Date();\n String dString = formatter.format(date);\n System.out.println(\"dString=\"+dString);\n\n Date datas = java.sql.Date.valueOf(dString);\n System.out.println(\"datas=\"+datas);\n\n\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 String getDate() {\n\t\tSimpleDateFormat parseFormat = new SimpleDateFormat(\"hh:mm a\");\n\t\tDate date = new Date();\n\t\tString s = parseFormat.format(date);\n\t\treturn s;\n\t}", "public String dar_hora(){\n Date date = new Date();\n DateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss\");\n return dateFormat.format(date).toString();\n }", "private static String time() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH-mm-ss \");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "private static String getDate()\n\t{\n\t\tString dateString = null;\n\t\tDate sysDate = new Date( System.currentTimeMillis() );\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yy HH:mm:ss\");\n\t\tdateString = sdf.format(sysDate);\n\t\treturn dateString;\n\t}", "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 String getTimeString() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss yyyy\");\n return formatter.format(new java.util.Date());\n }", "public static void main(String[] args) throws Exception {\n Calendar cal = Calendar.getInstance();\n SimpleDateFormat simpleformat = new SimpleDateFormat(\"E, dd MMM yyyy HH:mm:ss Z\");\n System.out.println(\"Today's date and time = \"+simpleformat.format(cal.getTime()));\n // displaying date\n simpleformat = new SimpleDateFormat(\"dd/MMMM/yyyy\");\n String str = simpleformat.format(new Date());\n System.out.println(\"Current Date = \"+str);\n // current time\n simpleformat = new SimpleDateFormat(\"HH:mm:ss\");\n String strTime = simpleformat.format(new Date());\n System.out.println(\"Current Time = \"+strTime);\n // displaying hour in HH format\n simpleformat = new SimpleDateFormat(\"HH\");\n String strHour = simpleformat.format(new Date());\n System.out.println(\"Hour in HH format = \"+strHour);\n\n\n\n //formato ideal\n simpleformat = new SimpleDateFormat(\"dd/MM/yyyy - HH:mm:ss\");\n String strTimeDay = simpleformat.format(new Date());\n System.out.println(\"Dia e Hora = \" + strTimeDay);\n\n }", "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}", "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 DateUtility () {\n dateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\n }", "public static void main(String[] args) {\n\t\tDate today = new Date();\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy:MM:dd hh:MM:ss\");\n\t\tString s= sdf.format(today);\n\t\tSystem.out.println(s);\n\t}", "public static void main(String[] args) throws ParseException {\n\t Long t = Long.parseLong(\"1540452984\");\r\n Timestamp ts = new Timestamp(1540453766);\r\n DateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n //方法一:优势在于可以灵活的设置字符串的形式。\r\n String tsStr = sdf.format(ts);// 2017-01-15 21:17:04\r\n System.out.println(tsStr);\r\n\t}", "private static String getDateStr() {\n\t\tDate date = Calendar.getInstance().getTime();\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMddyyy\");\n\t\tString dateStr = dateFormat.format(date);\n\t\treturn dateStr;\n\t}", "public static String timeToString(Date date)\r\n/* 24: */ {\r\n/* 25: 31 */ return sdfTime.format(date);\r\n/* 26: */ }", "public static void dateFormat() {\n }", "private static String timeFor(Date date)\n\t{\n\t\tDateFormat df = new InternetDateFormat();\n\t\tString theTime = df.format(date);\n\t\treturn theTime;\n\t}", "public String getTimeAndDate() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd MMM hh:mm\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString dateAndTime = dateFormat.format(cal.getTime());\n\t\t\treturn dateAndTime;\n\t\t}", "@SuppressWarnings(\"deprecation\")\r\n\tpublic String format(Date date,boolean time){\n\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyyMMdd\");\r\n\tString timestamp=dateFormat.format(date)+\"T\";\r\n\tif(time){\r\n\t\tdateFormat = new SimpleDateFormat(\"HH:mm:ssZ\");\r\n\t\ttimestamp+=dateFormat.format(date);\r\n\t}\r\n else{\r\n \tdate.setHours(12);\r\n \tdate.setMinutes(0);\r\n \tdate.setSeconds(0);\r\n \tdateFormat = new SimpleDateFormat(\"HH:mm:ss\");\r\n \ttimestamp+=dateFormat.format(date);\r\n \ttimestamp+=\"+0000\";\r\n }\r\n\treturn timestamp;\r\n }", "private String convertDate2String(Date date) {\n DateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yyyy HH:mm:ss\");\n return dateFormat.format(date);\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "public static String dateToString(Date date)\r\n/* 19: */ {\r\n/* 20: 23 */ return sdfDate.format(date);\r\n/* 21: */ }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "public String toString() { //toString method\n String startDateString2= \"\"; //Initialize\n try{\n Date date1 = new SimpleDateFormat(\"yyyyMMdd\").parse(full_Date);\n DateFormat df2 = new SimpleDateFormat(\"MMM dd, yyyy\");\n startDateString2 = df2.format(date1);\n \n return startDateString2;\n }catch(ParseException e){\n e.printStackTrace();\n }\n return startDateString2;\n \n}", "public String getDateCreationLibelle() {\n\t\tDateTimeFormatter format = DateTimeFormatter.ofPattern(\"dd/MM/yyyy hh:mm:ss\");\n\t\treturn this.dateCreation.format(format);\n\t}", "public static SimpleDateFormat createDateFormat() {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS\");\n TimeZone myTimeZone = TimeZone.getTimeZone(ZoneId.of(\"UTC\"));\n dateFormat.setTimeZone(myTimeZone);\n dateFormat.setLenient(false);\n return dateFormat;\n }", "public static String getDateTime(){\n String pattern = \"MM/dd/yyyy HH:mm:ss\";\n DateFormat df = new SimpleDateFormat(pattern);\n Date today = Calendar.getInstance().getTime();\n String todayAsString = df.format(today);\n return todayAsString;\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 }", "String getDate();", "String getDate();", "public SimpleDateFormat initialValue() {\n return new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\", Locale.getDefault());\n }", "protected final static String getDateStamp() {\n\n\t\treturn\n\n\t\tnew SimpleDateFormat(\"MMM d, yyyy h:mm:ss a zzz\").format(new Date());\n\n\t}", "private String createDate(){\n SimpleDateFormat date = new SimpleDateFormat(\"EEE, MMM d, yyyy\");\n String stringDate = date.format(new Date()); \n return stringDate;\n }", "public static String timestamp(){\n\t\tDate date = new Date();\n\t\tDateFormat hourdateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss \");\n\t\treturn hourdateFormat.format(date);\n\t}", "private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}", "public static String getDateTime() {\n\t\tString sDateTime=\"\";\n\t\ttry {\n\t\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t\tSimpleDateFormat sdfTime = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tDate now = new Date();\n\t\t\tString strDate = sdfDate.format(now);\n\t\t\tString strTime = sdfTime.format(now);\n\t\t\tstrTime = strTime.replace(\":\", \"-\");\n\t\t\tsDateTime = \"D\" + strDate + \"_T\" + strTime;\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\t\treturn sDateTime;\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 }", "String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}", "private String formatTime(Date dateObject) {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\");\n return timeFormat.format(dateObject);\n }", "public static void main(String[] args) {\n\n\t\tDate d=new Date();\n\t\tSimpleDateFormat sdf= new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\tSimpleDateFormat hms= new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");\n\t\tSystem.out.println(sdf.format(d));\n\t\tSystem.out.println(hms.format(d));\n\t\tSystem.out.println(d.toString());\n\t}", "protected static SimpleDateFormat dateFormat() {\n return dateFormat(true, false);\n }", "public static String timeStamp()\n {\n DateFormat format = new SimpleDateFormat(\"ddMMyyHHmmSS\");\n return format.format(new Date());\n }", "public final /* synthetic */ Object initialValue() {\n return new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\", Locale.US);\n }", "public String getDateConvert() {\n SimpleDateFormat dateFormat1 = new SimpleDateFormat(\"MMM dd yyyy - hh:mm\");\n SimpleDateFormat dateFormat2 = new SimpleDateFormat(\"a\");\n String date = dateFormat1.format(this.timePost) + dateFormat2.format(this.timePost).toLowerCase();\n return date;\n }", "public static SimpleDateFormat getHourFormat() {\n return new SimpleDateFormat(\"HH:mm\");\n }", "public static String formatDateForDetails(Timestamp date) {\n SimpleDateFormat format = new SimpleDateFormat(\"dd MMM yyyy | hh:mm aaa\", Locale.getDefault());\n return format.format(new Date(date.getTime()));\n }", "private String formatDateForVSS(Date d) {\n SimpleDateFormat sdf = new SimpleDateFormat(this.dateFormat + \";hh:mma\");\n \t\tString vssFormattedDate = sdf.format(d);\n \t\treturn vssFormattedDate.substring(0, vssFormattedDate.length() - 1);\n \t}", "private void formatTime() {\r\n\t\tDate date = new Date();\r\n\t\tSimpleDateFormat ft = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\r\n\t\tm_timeSent = ft.format(date).toString();\r\n\t}", "Date getTimeStamp();", "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 Date getDateTime(SimpleDateFormat format) {\n\t\tDate dt = null;\n\t\ttry {\t\t\t\t\n\t\t\tString dateInString = this.month + \"/\" + this.day + \"/\" + this.year + \" \" +\n\t\t\t\tthis.hour + \":\" + this.minute + \":\" + this.second;\n\t\t\tif(dateInString.trim().length() > 5 ) {\n\t\t\t\tdt = format.parse(dateInString);\n\t\t\t}\n\t\t} catch (Exception e ) {\n\t\t\tdt = null;\n\t\t}\n\t\treturn dt;\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tDate d=new Date();\n\t\tSystem.out.println(d.toString());\n\t\t\n\t\t/**\n\t\t * mm/dd/yyyy format or HH:MM:SS format\n\t\t */\n\t\t//SimpleDateFormat sdf=new SimpleDateFormat(\"M/d/yyyy\");\n\t\t\n\t\tSimpleDateFormat sdf=new SimpleDateFormat(\"M/d/yyyy hh:mm:ss\");\n\t\t\n\t\tSystem.out.println(sdf.format(d));\n\t\t\n\n\t}", "public static String getDateTime(String publishtime) {\n if (publishtime != null && !publishtime.equals(\"\")) {\n SimpleDateFormat data = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n return data.format(new Date(Long.parseLong(publishtime) * 1000L));\n }\n return \"\";\n }", "public void setDateAndTime(int d,int m,int y,int h,int n,int s);", "private static SimpleDateFormat getDateFormat() {\r\n\t\tif(dateFormat == null)\r\n\t\t\tdateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\t\treturn dateFormat;\r\n\t}", "public static String getDateAndTime() {\n Calendar JCalendar = Calendar.getInstance();\n String JMonth = JCalendar.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.UK);\n String JDate = JCalendar.getDisplayName(Calendar.DATE, Calendar.LONG, Locale.UK);\n String JHour = JCalendar.getDisplayName(Calendar.HOUR, Calendar.LONG, Locale.UK);\n String JSec = JCalendar.getDisplayName(Calendar.SECOND, Calendar.LONG, Locale.UK);\n\n return JDate + \"th \" + JMonth + \"/\" + JHour + \".\" + JSec + \"/24hours\";\n }", "public void log(String message){\n Date date = new Date();\n String pattern = \"hh:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n String dateText = simpleDateFormat.format(date);\n System.out.println(\"LOG \" + dateText + \": \" + message);\n }", "String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }", "public static String getHHMM()\r\n/* 74: */ {\r\n/* 75: 94 */ String nowTime = \"\";\r\n/* 76: 95 */ Date now = new Date();\r\n/* 77: 96 */ SimpleDateFormat formatter = new SimpleDateFormat(\"HH:mm\");\r\n/* 78: 97 */ nowTime = formatter.format(now);\r\n/* 79: 98 */ return nowTime;\r\n/* 80: */ }", "private String formatTime(Date dateObject) {\r\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\");\r\n return timeFormat.format(dateObject);\r\n }", "private String formatDate (Date date) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"E, dd MMM yyyy HH:mm:ss\", Locale.ENGLISH);\n return sdf.format(date);\n }", "@Override\n\tpublic Date getDate(String parameter, String parameter2) {\n\t\t String startDate=parameter+\" \"+parameter2;\n\t\t SimpleDateFormat sdf1 = new SimpleDateFormat(\"yyyy-MM-dd h:mm a\");\n\t\t java.util.Date date;\n\t\ttry {\n\t\t\tdate = sdf1.parse(startDate);\n\t\t\tDate sqlStartDate = new Date(date.getTime());\n\t\t\treturn sqlStartDate;\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public SimpleDateFormat(final String pattern) {\n\t\tthis(pattern, null, null, null, null, true, null);\n\t}", "public static String formatToSimpleDate(Date date) {\n\t\treturn FORMATTER_SIMPLE_DATE.format(date);\n\t}", "public static String ConvertToStandardtime(Date date) {\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tformat.setLenient(false);\r\n\t\tif (date == null)\r\n\t\t\treturn \"\";\r\n\t\tString strDate = format.format(date);\r\n\t\treturn strDate;\r\n\t}", "public static String getNowAsTimestamp() {\r\n\r\n DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN);\r\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\r\n return dateFormat.format(new Date()).replaceAll(\"\\\\+0000\", \"Z\").replaceAll(\"([+-][0-9]{2}):([0-9]{2})\", \"$1$2\");\r\n }", "private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy HH:mm\");\n Date date = new Date();\n return dateFormat.format(date);\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}", "@Test\n public void toStringOk(){\n Date date = new Date(1,Month.january,1970);\n assertEquals(date.toString(),\"1 january 1970\");\n }", "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 String generateDate()\r\n\t{\r\n\t\tDate d = new Date();\r\n\t\tSimpleDateFormat datef = new SimpleDateFormat(\"YYYY_MM_dd_ss\");\r\n\t\treturn datef.format(d);\r\n\r\n\r\n\t}", "private String getFecha() {\n\t\tLocalDateTime myDateObj = LocalDateTime.now();\n\t\tDateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern(\"dd-MM-yyyy HH:mm:ss\");\n\t\tString formattedDate = myDateObj.format(myFormatObj);\n \n\t\treturn formattedDate;\n }", "protected static SimpleDateFormat xsdDateFormat() {\n return new SimpleDateFormat(\"yyyy-MM-dd\");\n }" ]
[ "0.6641881", "0.6538893", "0.63932693", "0.6385271", "0.6302066", "0.62251925", "0.61500627", "0.6081218", "0.60268325", "0.60197353", "0.59251225", "0.59235734", "0.5896095", "0.58773303", "0.58570033", "0.5802754", "0.57746166", "0.572996", "0.5721188", "0.5707091", "0.57013345", "0.56982905", "0.56694114", "0.566833", "0.5666031", "0.56254977", "0.56249213", "0.56227416", "0.5615382", "0.5609617", "0.5583984", "0.5583508", "0.5581818", "0.5578395", "0.5577583", "0.55367684", "0.5536349", "0.5524357", "0.5517287", "0.5507953", "0.5507654", "0.5499367", "0.54951435", "0.5493662", "0.54921085", "0.5489236", "0.54783046", "0.5476094", "0.5476094", "0.5467777", "0.5458654", "0.5439559", "0.5435281", "0.5434518", "0.5429412", "0.5397342", "0.539579", "0.539579", "0.5394852", "0.5391202", "0.5387459", "0.5373579", "0.5371777", "0.5358443", "0.5356108", "0.5344623", "0.53331435", "0.5332985", "0.53328645", "0.5329936", "0.5324701", "0.53126055", "0.5309947", "0.5300654", "0.5297136", "0.52918535", "0.5284943", "0.52767056", "0.5276292", "0.52755076", "0.5273601", "0.52678806", "0.5264524", "0.5261839", "0.52566457", "0.5254891", "0.52503085", "0.52481186", "0.5245531", "0.52430433", "0.5242554", "0.5239436", "0.5232747", "0.52313364", "0.5229649", "0.5229361", "0.5228706", "0.52240133", "0.52217954", "0.52182", "0.5215217" ]
0.0
-1
/DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd HH:mm:ss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMM dd, yyyy . hh:mm aa"); DateFormat dateFormat = new SimpleDateFormat(argInFormat, Locale.getDefault());
@Deprecated public static String getGMTToLocalTime(String argDateTime, String argInFormat, String argOutFormat) { DateFormat dateFormat = new SimpleDateFormat(argInFormat, Locale.getDefault()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(argOutFormat); //simpleDateFormat.setTimeZone(TimeZone.getTimeZone(Locale)); //simpleDateFormat.setTimeZone(TimeZone.getDefault()); dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); simpleDateFormat.setTimeZone(TimeZone.getDefault()); //System.out.println("-----+ " + TimeZone.getDefault()); try { Date date = dateFormat.parse(argDateTime); return simpleDateFormat.format(date); } catch (ParseException ex) { //ex.printStackTrace(); return null; } //https://medium.com/@kosta.palash/converting-date-time-considering-time-zone-android-b389ff9d5c49 //https://www.tutorialspoint.com/java/util/calendar_settimezone.htm //writeDate.setTimeZone(TimeZone.getTimeZone("GMT+04:00")); //https://vectr.com/tmp/a1hCr4Gvwc/aaegiGLyoI //http://inloop.github.io/svg2android/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String format (Date date , String dateFormat) ;", "private void constructVssDateTimeFormat() {\n vssDateTimeFormat = new SimpleDateFormat(\"'Date: '\" + this.dateFormat + \" 'Time: 'hh:mma\"); \n }", "public String getDateConvert() {\n SimpleDateFormat dateFormat1 = new SimpleDateFormat(\"MMM dd yyyy - hh:mm\");\n SimpleDateFormat dateFormat2 = new SimpleDateFormat(\"a\");\n String date = dateFormat1.format(this.timePost) + dateFormat2.format(this.timePost).toLowerCase();\n return date;\n }", "public static String convertMilliSecondsToDateFormat(long milliSeconds) {\n String dateFormat = \"MMM-dd hh:mm:ss a\";\n SimpleDateFormat formatter = new SimpleDateFormat(dateFormat, Locale.US);\n // Create a calendar object that will convert the date and time value in milliseconds to date.\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(milliSeconds);\n\n\n SimpleDateFormat mnthFormat = new SimpleDateFormat(\"MMM\", Locale.US);\n String month = mnthFormat.format(calendar.getTime());\n\n SimpleDateFormat formatDayOfMonth = new SimpleDateFormat(\"d\", Locale.US);\n int day = Integer.parseInt(formatDayOfMonth.format(calendar.getTime()));\n String daySuffix = getDayOfMonthSuffix(day);\n\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"hh:mm:ss a\", Locale.US);\n String timeStr = timeFormat.format(calendar.getTime());\n\n\n// return formatter.format(calendar.getTime());\n\n return month + \" \" + day + daySuffix + \" \" + timeStr;\n }", "public static void dateFormat() {\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 void mostrarHora(String formato){\n Date objDate = new Date();\n SimpleDateFormat objSDF = new SimpleDateFormat(formato);\n //este sera el resultado de la fechas\n fecha=objSDF.format(objDate);\n }", "public String toString() { //toString method\n String startDateString2= \"\"; //Initialize\n try{\n Date date1 = new SimpleDateFormat(\"yyyyMMdd\").parse(full_Date);\n DateFormat df2 = new SimpleDateFormat(\"MMM dd, yyyy\");\n startDateString2 = df2.format(date1);\n \n return startDateString2;\n }catch(ParseException e){\n e.printStackTrace();\n }\n return startDateString2;\n \n}", "public static void main(String[] args) {\n\t\t LocalDate ldt = LocalDate.of(2016,12,21);\n DateTimeFormatter format = DateTimeFormatter.ofPattern(\"yyyy-MMM-dd\");\n DateTimeFormatter format1 = DateTimeFormatter.ofPattern(\"YYYY-mmm-dd\");\n System.out.println(ldt.format(format));\n System.out.println(ldt.format(format1));\n\t}", "private String formatDate (Date date) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"E, dd MMM yyyy HH:mm:ss\", Locale.ENGLISH);\n return sdf.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 void main(String[] args) {\n\t double d=123456.789;\r\n\t\tNumberFormat nf=NumberFormat.getInstance(Locale.ITALY);\r\n\t\tNumberFormat nf1=NumberFormat.getInstance(Locale.US);\r\n\t\tNumberFormat nf2=NumberFormat.getInstance(Locale.ENGLISH);\r\n\t\tSystem.out.println(\"Italy representation of \" + d + \" : \"+nf.format(d));\r\n\t\tSystem.out.println(\"US representation of \" + d + \" : \" +nf1.format(d));\r\n\t\tSystem.out.println(\"Japan representation of \" + d + \" : \" +nf2.format(d));\r\n\t\t\r\n\t //DateTimeFormat in short,long and medium with getDateTimeInstance\r\n\t\tDateFormat df=DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT);\r\n\t System.out.println(\"Short format of date: \"+df.format(new Date()));\r\n\t DateFormat df1=DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG);\r\n\t System.out.println(\"Long format of date: \"+df1.format(new Date()));\r\n\t DateFormat df2=DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM);\r\n\t System.out.println(\"Medium format of date: \"+df2.format(new Date()));\r\n\t \r\n\t //Locale date format giving countries starting letters to get time but using only getDateInstance(de-denmark)\r\n\t DateFormat df3=DateFormat.getDateInstance(DateFormat.SHORT,new Locale(\"de\",\"DE\"));\r\n\t System.out.println(\"Short format of date: \"+df3.format(new Date()));\r\n\t DateFormat df4=DateFormat.getDateInstance(DateFormat.LONG,new Locale(\"de\",\"DE\"));\r\n\t System.out.println(\"Long format of date: \"+df4.format(new Date()));\r\n\t DateFormat df5=DateFormat.getDateInstance(DateFormat.MEDIUM,new Locale(\"de\",\"DE\"));\r\n\t System.out.println(\"Medium format of date: \"+df5.format(new Date()));\r\n\t \r\n\r\n}", "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 static void main(String[] args)\r\n/* 96: */ {\r\n/* 97:104 */ SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n/* 98:105 */ String qiandaotime = df.format(new Date());\r\n/* 99:106 */ System.out.println(qiandaotime);\r\n/* 100: */ }", "@Method(selector = \"stringFromDate:toDate:\")\n public native String format(NSDate fromDate, NSDate toDate);", "private static void m1() {\n\n String d = \"2019/03/22 10:00-11:00\";\n DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd HH:mm-HH:mm\");\n try {\n Date parse = df.parse(d);\n System.out.println(df.format(parse));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "private String createDate(){\n SimpleDateFormat date = new SimpleDateFormat(\"EEE, MMM d, yyyy\");\n String stringDate = date.format(new Date()); \n return stringDate;\n }", "private String formatDateForVSS(Date d) {\n SimpleDateFormat sdf = new SimpleDateFormat(this.dateFormat + \";hh:mma\");\n \t\tString vssFormattedDate = sdf.format(d);\n \t\treturn vssFormattedDate.substring(0, vssFormattedDate.length() - 1);\n \t}", "public static String ShowDate(){\n Date date = new Date();\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss.SS a\");\n String HH_MM = sdf.format(date);\n return HH_MM;\n }", "public static void main(String[] args) throws Exception {\n Calendar cal = Calendar.getInstance();\n SimpleDateFormat simpleformat = new SimpleDateFormat(\"E, dd MMM yyyy HH:mm:ss Z\");\n System.out.println(\"Today's date and time = \"+simpleformat.format(cal.getTime()));\n // displaying date\n simpleformat = new SimpleDateFormat(\"dd/MMMM/yyyy\");\n String str = simpleformat.format(new Date());\n System.out.println(\"Current Date = \"+str);\n // current time\n simpleformat = new SimpleDateFormat(\"HH:mm:ss\");\n String strTime = simpleformat.format(new Date());\n System.out.println(\"Current Time = \"+strTime);\n // displaying hour in HH format\n simpleformat = new SimpleDateFormat(\"HH\");\n String strHour = simpleformat.format(new Date());\n System.out.println(\"Hour in HH format = \"+strHour);\n\n\n\n //formato ideal\n simpleformat = new SimpleDateFormat(\"dd/MM/yyyy - HH:mm:ss\");\n String strTimeDay = simpleformat.format(new Date());\n System.out.println(\"Dia e Hora = \" + strTimeDay);\n\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 DateFormat defaultFormat() {\n return convertFormat(Locale.getDefault(), \"dd/MM/yyyy hh:mma\");\n }", "public static String timeFormatConvert(String fromFormat1, String toFormat2, String time) {\n\t\tString datestr = \"\";\n\t\t\n\t\tif(time!=null && time.trim().length()==fromFormat1.length())\n\t\t{\n\t\t\ttry {\n\t\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(fromFormat1/* \"yyyy MMM dd HH:mm:ss\" */, Locale.US);\n\t\t\t\tDate date = sdf.parse(time);\n\t\t\t\tsdf = new SimpleDateFormat(toFormat2/* \"yyyyMMddHHmmss\" */);\n\t\t\t\tdatestr = sdf.format(date);\n\t\t\t} catch (Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"fromFormat1=\"+fromFormat1+\" time=\"+time);\n\t\treturn datestr;\n\t}", "private String easyDateFormat(final String format) {\n Date today = new Date();\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n String datenewformat = formatter.format(today);\n return datenewformat;\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 static void main(String[] args) {\n\t\tLocalDate today=LocalDate.now();\n\t\t\n\t\tDateTimeFormatter dtf=DateTimeFormatter.ofPattern(\"YYYY/MM/DD\");\n\t\tDateTimeFormatter dtf1=DateTimeFormatter.ofPattern(\"YYYY MM DD\");\n\t\t\n\t\tDateTimeFormatter dtfull=DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL);\n\t\tDateTimeFormatter dtm=DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM);\n\t\tDateTimeFormatter dts=DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT);\n\t\t\n\t\t\n\t\tString afterformat=today.format(dtf);\n\t\tSystem.out.println(afterformat);\n\t\tString afterformat1=today.format(dtf1);\n\t\tSystem.out.println(afterformat1);\n\t\tString fd=today.format(dtfull);\n\t\tSystem.out.println(fd);\n\t\tString md=today.format(dtm);\n\t\tSystem.out.println(md);\n\t\tString sd=today.format(dts);\n\t\tSystem.out.println(sd);\n\t\t\n\t\t\n\n\t}", "private String formatDate(Date date){\n SimpleDateFormat format = new SimpleDateFormat(\"dd-MM-yyyy HH:mm\", Locale.getDefault());\n\n return format.format(date);\n }", "public void formatDateTime() {\n // Check if type of parsing is for display or not. \n // If it is for display, no need to check if date has already passed.\n if (parseType != 2) {\n startDate = dtFormat.formatDate(startDate,0);\n endDate = dtFormat.formatDate(endDate,0);\n } else {\n startDate = dtFormat.formatDate(startDate,1);\n endDate = dtFormat.formatDate(endDate,1);\n }\n \n startTime = dtFormat.formatTime(startTime);\n endTime = dtFormat.formatTime(endTime);\n }", "public static void main(String[] args) {\n\t String str = String.format(\"%tc\", new Date());\r\n\t System.out.printf(str);\r\n\t \r\n//\t // display time and date\r\n//\t System.out.printf(\" Today is : %1$s %2$tB %2$td, %2$tY\", \"Due date : \", new Date());\r\n//\r\n\r\n\t System.out.println( new SimpleDateFormat(\"E yyyy.MM.dd 'at' hh:mm:ss a zzz\").format(new Date()));\r\n\t System.out.println( new SimpleDateFormat(\"EEEE, MMMM d, yyyy\").format(new Date()));\r\n\t}", "public static String formatDateForDetails(Timestamp date) {\n SimpleDateFormat format = new SimpleDateFormat(\"dd MMM yyyy | hh:mm aaa\", Locale.getDefault());\n return format.format(new Date(date.getTime()));\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 }", "public static void main(String[] args) throws Exception{\n\t\t\t Date currentTime = new Date(95,7,6);\n\t\t\t SimpleDateFormat formatter = new SimpleDateFormat(\"dd/MMM/YYYY\");\n\t\t\t String dateString = formatter.format(currentTime);\n\t\t\t System.out.println(dateString);\n\t\t\t \n\t\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(Date dateObject) {\r\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\");\r\n return dateFormat.format(dateObject);\r\n }", "DateFormat getDisplayDateFormat();", "protected static SimpleDateFormat dateFormat() {\n return dateFormat(true, false);\n }", "public static void main(String[] args) throws ParseException {\n\n\t\tString startPattern = \"MMM yyyy\";\n\n\t\tString endPattern = \"MM-dd-yyyy\";\n\n\t\tString str = formateDate(\"mar 2019\", startPattern, endPattern);\n\t\tSystem.out.println(str);\n\n\t}", "DateFormat getSourceDateFormat();", "public DateGraphFormat(String pattern){\n\t((SimpleDateFormat) dateFormat).applyPattern(pattern);\n }", "public String formatDateAndTime(String date){\n\n return dateTimeFormatter.parse(date).toString();\n\n }", "public static void main(String[] args) {\n\n\t\tDate d=new Date();\n\t\tSimpleDateFormat sdf= new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\tSimpleDateFormat hms= new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");\n\t\tSystem.out.println(sdf.format(d));\n\t\tSystem.out.println(hms.format(d));\n\t\tSystem.out.println(d.toString());\n\t}", "public String formatDate (Date date){\r\n\t\tDateFormat df = new SimpleDateFormat(\"EEE, d MMM yyyy HH:mm:ss z\", Locale.ENGLISH);\r\n\t\treturn df.format(date);\r\n\t}", "private String formatDate(Date dateObject) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\");\n return dateFormat.format(dateObject);\n }", "public interface CrossDateTimeParser {\n\n\t\n\t\n\t/**\n\t * format dari date menjadi string format. pls refer pada\n\t * @param date tanggal yang akan di format menjadi string\n\t * @param dateFormat format dari date \n\t **/\n\tpublic String format (Date date , String dateFormat) ;\n\t\n\t\n\t\n\t/**\n\t * worker utnuk mem-parse dari string menjadi date\n\t * @param dateAsString date yang di jadikan string. ini apa yang akan di jadikan date\n\t * @param dateFormat format dari date\n\t **/\n\tpublic Date parse (String dateAsString , String dateFormat) throws Exception ; \n}", "public String changeDateFormat(String dateStr) {\n String inputPattern = \"MMM-dd-yyyy\";\n String outputPattern = \"MMMM dd, yyyy\";\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 dateStr(String input ){\n String mm = input.substring(0,2);\n String dd = input.substring(3,5);\n String yyyy = input.substring(6,10);\n return dd + \" - \" + mm + \" - \" + yyyy;\n }", "private void monthFormat() {\n\t\ttry {\n\t\t\tString currentMonth = monthFormat.format(new Date()); //Get current month\n\t\t\tstartDate = monthFormat.parse(currentMonth); //Parse to first of the month\n\t\t\tString[] splitCurrent = currentMonth.split(\"-\");\n\t\t\tint month = Integer.parseInt(splitCurrent[0]) + 1; //Increase the month\n\t\t\tif (month == 13) { //If moving to next year\n\t\t\t\tint year = Integer.parseInt(splitCurrent[1]) + 1;\n\t\t\t\tendDate = monthFormat.parse(\"01-\" + year);\n\t\t\t} else {\n\t\t\t\tendDate = monthFormat.parse(month + \"-\" + splitCurrent[1]);\n\t\t\t}\n\t\t\t//Create SQL times\n\t\t\tstartDateSQL = new java.sql.Date(startDate.getTime());\n\t\t\tendDateSQL = new java.sql.Date(endDate.getTime());\n\t\t\tmonthString = new SimpleDateFormat(\"MMMM\").format(startDate);\n\t\t} catch (ParseException e) {\n\t\t\t_.log(Level.SEVERE, GameMode.Sonic, \"Failed to parse dates. Monthly leaderboard disabled.\");\n\t\t}\n\t}", "public static String convertDateFormat(String date) {\n DateFormat originalFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n DateFormat targetFormat = new SimpleDateFormat(\"MMMM dd, yyyy\", Locale.ENGLISH);\n Date oldDate;\n try {\n oldDate = originalFormat.parse(date);\n } catch (ParseException e) {\n e.printStackTrace();\n return null;\n }\n return targetFormat.format(oldDate);\n }", "private String formatarData(Date data)\n {\n String sDate;\n String sDia = \"\";\n String sMes = \"\";\n\n GregorianCalendar calendar = new GregorianCalendar();\n calendar.setTime(data);\n int dia = calendar.get(GregorianCalendar.DAY_OF_MONTH);\n if (dia > 0) {\n if (dia < 10) {\n sDia = \"0\";\n }\n }\n sDia += dia;\n\n int mes = calendar.get(GregorianCalendar.MONTH);\n mes = mes + 1;\n if (mes > 0) {\n if (mes < 10) {\n sMes = \"0\";\n }\n }\n sMes += mes;\n\n int ano = calendar.get(GregorianCalendar.YEAR);\n\n int hora = calendar.get(GregorianCalendar.HOUR);\n // 0 = dia\n // 1 = noite\n int amPm = calendar.get(GregorianCalendar.AM_PM);\n\n if(amPm == 1)\n {\n if(hora>0 && hora < 13)\n {\n if(hora > 11)\n hora = 0;\n else\n hora += 12;\n }\n }\n\n String sHora = \" \";\n if(hora<=9)\n {\n sHora += \"0\";\n }\n String sMin=\":\";\n int min = calendar.get(GregorianCalendar.MINUTE);\n if(min <10)\n sMin += \"0\";\n sMin += String.valueOf(min);\n sHora += String.valueOf(hora) + sMin + \":00\";\n sDate = String.valueOf(ano) + \"-\" + sMes + \"-\" + sDia + sHora;\n return sDate;\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tDate d=new Date();\n\t\tSystem.out.println(d.toString());\n\t\t\n\t\t/**\n\t\t * mm/dd/yyyy format or HH:MM:SS format\n\t\t */\n\t\t//SimpleDateFormat sdf=new SimpleDateFormat(\"M/d/yyyy\");\n\t\t\n\t\tSimpleDateFormat sdf=new SimpleDateFormat(\"M/d/yyyy hh:mm:ss\");\n\t\t\n\t\tSystem.out.println(sdf.format(d));\n\t\t\n\n\t}", "public static String formatFechaMascara(String fecha, String formatoFecha) {\n SimpleDateFormat sdf = new SimpleDateFormat(formatoFecha);\n String response = \"\";\n // format BD\n SimpleDateFormat sdfBD = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date fechaParse = null;\n try {\n\n fechaParse = sdfBD.parse(fecha.substring(0, 10));\n\n } catch (java.text.ParseException e) {\n try {\n fechaParse = sdf.parse(fecha);\n } catch (java.text.ParseException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }\n\n if (fechaParse == null) return \"\";\n\n response = sdf.format(fechaParse);\n return response;\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}", "private void updateLabel() {\n String myFormat = \"dd-MM-YYYY\"; //In which you need put here\n SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);\n dateInput.setText(sdf.format(myCalendar.getTime()));\n }", "public static void main(String[] args) {\n\t\tDate today = new Date();\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy:MM:dd hh:MM:ss\");\n\t\tString s= sdf.format(today);\n\t\tSystem.out.println(s);\n\t}", "private String formatDate(Date dateObject) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\", Locale.getDefault());\n return dateFormat.format(dateObject);\n }", "public static String formatDateToDefault(Date date)\n\t{\n\t\tDateFormat format = new SimpleDateFormat(\"MMM dd, yyyy hh:mm a\", Locale.getDefault());\n\t\tformat.setTimeZone(TimeZone.getDefault());\n\t\tString rv = format.format(date);\n\t\treturn rv;\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}", "public static void main(String[] args) {\n\t\t\r\n\t\tString date=\"2021/02/04\";//default date format\r\n\t\tLocalDate today=LocalDate.now();\r\n\t\t\r\n\t\tDateTimeFormatter pattern1=DateTimeFormatter.ofPattern(\"yyyy/MMM/dd\");\r\n\t\tDateTimeFormatter pattern2=DateTimeFormatter.ofPattern(\"yyyy/MM/dd\");\r\n\t\t\r\n\t\tSystem.out.println(\"Default format \"+today);\r\n\t\t\r\n\t\tSystem.out.println(\"my format \"+today.format(pattern2));\r\n\t\tSystem.out.println(\"my format \"+today.format(pattern1));\r\n\t\t\r\n\t\tSystem.out.println(\"====================================================\");\r\n\t\t\r\n\t\t\tLocalDate ld=LocalDate.parse(date,pattern2);\r\n\t\t\tSystem.out.println(ld);\r\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 }", "public static Object changeDateFormat(String date)\r\n\t{\n\t\tString temp=\"\";\r\n\t\tint len = date.length();\r\n\t\tfor(int i=0;i<len;i++)\r\n\t\t{\r\n\t\t\tchar ch = date.charAt(i);\r\n\t\t\tif(ch == ',')\r\n\t\t\t{\r\n\t\t\t\ttemp = temp+'/';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttemp = temp+ch;\r\n\t\t\t}\r\n\t\t}\r\n\t\tString n=\"\"+temp.charAt(3)+temp.charAt(4);\r\n\t\tint month=Integer.parseInt(n);\r\n\t\tString m=\"\";\r\n\t\tswitch(month)\r\n\t\t{\r\n\t\t\tcase 1:\r\n\t\t\t\tm=\"jan\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tm=\"feb\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tm=\"mar\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 4:\r\n\t\t\t\tm=\"apr\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 5:\r\n\t\t\t\tm=\"may\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 6:\r\n\t\t\t\tm=\"jun\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 7:\r\n\t\t\t\tm=\"jul\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 8:\r\n\t\t\t\tm=\"aug\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 9:\r\n\t\t\t\tm=\"sep\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10:\r\n\t\t\t\tm=\"oct\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 11:\r\n\t\t\t\tm=\"nov\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 12:\r\n\t\t\t\tm=\"dec\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"Enter a valid month\");\r\n\t\t\t}\r\n\t\t\tString s=(temp.substring(0, 3)+ m +temp.substring(5));\r\n\t\t\treturn s;\r\n\t\t}", "private static String dateFormatLocal(Long timestamp) {\n DateFormat df = dateFormatLocal.get(); \n if (timestamp == null) {\n timestamp = System.currentTimeMillis();\n }\n \n return df.format(new Date(timestamp));\n }", "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 }", "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 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 }", "private void updateLabel(EditText view) {\n String myFormat = \"MM/dd/yyyy\"; //In which you need put here\n SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);\n\n view.setText(sdf.format(myCalendar.getTime()));\n }", "private String calcDate(long millis) {\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"MMM dd,yyyy HH:mm\");\n\t\tDate resultDate = new Date(millis);\n\t\treturn dateFormat.format(resultDate);\n\t}", "@SuppressWarnings(\"deprecation\")\r\n\tpublic String format(Date date,boolean time){\n\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyyMMdd\");\r\n\tString timestamp=dateFormat.format(date)+\"T\";\r\n\tif(time){\r\n\t\tdateFormat = new SimpleDateFormat(\"HH:mm:ssZ\");\r\n\t\ttimestamp+=dateFormat.format(date);\r\n\t}\r\n else{\r\n \tdate.setHours(12);\r\n \tdate.setMinutes(0);\r\n \tdate.setSeconds(0);\r\n \tdateFormat = new SimpleDateFormat(\"HH:mm:ss\");\r\n \ttimestamp+=dateFormat.format(date);\r\n \ttimestamp+=\"+0000\";\r\n }\r\n\treturn timestamp;\r\n }", "private static String _dateFormat(final Language lang) {\r\n \treturn lang == Language.SPANISH || lang == null ? Dates.ES_DEFAULT_FORMAT \r\n \t\t\t\t\t\t\t \t\t\t\t \t : Dates.EU_DEFAULT_FORMAT;\r\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 SimpleDateFormat() {\n\t\tthis(getDefaultPattern(), null, null, null, null, true, null);\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 }", "public SimpleDateFormat getDateFormat(HttpServletRequest req) {\n\t\treturn new SimpleDateFormat(DateUtil.getDatePattern(getResourceBundle(req)), Constants.DEF_LOCALE_NUMBER);\n\t}", "public String getFechatxt(Date d){\n \n try {\n String formato = selectorfecha.getDateFormatString();\n //Formato\n \n SimpleDateFormat sdf = new SimpleDateFormat(formato);\n String txtfechap = sdf.format(d);\n return txtfechap;\n } catch (NullPointerException ex) {\n JOptionPane.showMessageDialog(this, \"Al menos selecciona una fecha válida!\", \"Error!\", JOptionPane.INFORMATION_MESSAGE);\n return null;\n\n }\n\n\n \n }", "public void date_zone() {\n\n JLabel lbl_date = new JLabel(\"Date du Rapport :\");\n lbl_date.setBounds(40, 90, 119, 16);\n add(lbl_date);\n String date = rapport_visite.elementAt(DAO_Rapport.indice)[2];\n Date date_n = null;\n\n\n // *** note that it's \"yyyy-MM-dd hh:mm:ss\" not \"yyyy-mm-dd hh:mm:ss\"\n SimpleDateFormat dt = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\n try {\n date_n = dt.parse(date);\n } catch (ParseException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n // *** same for the format String below\n SimpleDateFormat dt1 = new SimpleDateFormat(\"dd-MM-yyyy\");\n\n JTextField date_rapport = new JTextField();\n date_rapport.setBounds(200, 90, 125, 22);\n date_rapport.setText(dt1.format(date_n));\n date_rapport.setEditable(false);\n add(date_rapport);\n\n\n\n\n }", "public interface Format {\n public static final String PATTERN_DATE = \"yyyy-MM-dd\";\n public static final String PATTERN_DATE_YEAR = \"yyyy\";\n}", "public DateUtility () {\n dateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\n }", "public static void main (String args[]){\n Date date = new Date();\n\n // display time and date using toString()\n System.out.println(\"The current date is: \" + date.toString());\n // display time and date\n System.out.printf(\"%1$s %2$tB %2$td, %2$tY\", \"Due date: \", date);\n System.out.println(\"\\n\");\n\n Date dNow = new Date( );\n SimpleDateFormat ft =\n new SimpleDateFormat (\"E yyyy.MM.dd 'at' hh:mm:ss a zzz\");\n /* For more info, look for: https://www.tutorialspoint.com/java/java_date_time.htm*/\n\n System.out.println(\"Current Date: \" + ft.format(dNow));\n\n\n SimpleDateFormat ft2 = new SimpleDateFormat (\"yyyy-MM-dd\");\n String input = args.length == 0 ? \"1818-11-11\" : args[0];\n\n System.out.print(input + \" Parses as \");\n Date t;\n try {\n t = ft2.parse(input);\n System.out.println(t);\n } catch (ParseException e) {\n System.out.println(\"Unparseable using \" + ft);\n }\n\n try {\n long start = System.currentTimeMillis( );\n System.out.println(new Date( ) + \"\\n\");\n\n Thread.sleep(5*60*10);\n System.out.println(new Date( ) + \"\\n\");\n\n long end = System.currentTimeMillis( );\n long diff = end - start;\n System.out.println(\"Difference is : \" + diff);\n } catch (Exception e) {\n System.out.println(\"Got an exception!\");\n }\n\n }", "public static void main(String[] args) {\n DateFormat df=new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss a\");\n \n //Get the date today using calender object.\n Date today=Calendar.getInstance().getTime();\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 //print what date is today!\n System.out.println(\"Current Date: \"+reportDate);\n }", "@Override\n\tpublic Date getDate(String parameter, String parameter2) {\n\t\t String startDate=parameter+\" \"+parameter2;\n\t\t SimpleDateFormat sdf1 = new SimpleDateFormat(\"yyyy-MM-dd h:mm a\");\n\t\t java.util.Date date;\n\t\ttry {\n\t\t\tdate = sdf1.parse(startDate);\n\t\t\tDate sqlStartDate = new Date(date.getTime());\n\t\t\treturn sqlStartDate;\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) throws ParseException {\n\t Long t = Long.parseLong(\"1540452984\");\r\n Timestamp ts = new Timestamp(1540453766);\r\n DateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n //方法一:优势在于可以灵活的设置字符串的形式。\r\n String tsStr = sdf.format(ts);// 2017-01-15 21:17:04\r\n System.out.println(tsStr);\r\n\t}", "public static String convertDate(String input) {\n String res = \"\";\n\n String[] s = input.split(\" \");\n\n res += s[2] + \"-\";\n switch (s[1]) {\n case \"January\":\n res += \"01\";\n break;\n case \"February\":\n res += \"02\";\n break;\n case \"March\":\n res += \"03\";\n break;\n case \"April\":\n res += \"04\";\n break;\n case \"May\":\n res += \"05\";\n break;\n case \"June\":\n res += \"06\";\n break;\n case \"July\":\n res += \"07\";\n break;\n case \"August\":\n res += \"08\";\n break;\n case \"September\":\n res += \"09\";\n break;\n case \"October\":\n res += \"10\";\n break;\n case \"November\":\n res += \"11\";\n break;\n case \"December\":\n res += \"12\";\n break;\n default:\n res += \"00\";\n break;\n }\n\n res += \"-\";\n if (s[0].length() == 1) {\n res += \"0\" + s[0];\n }\n else {\n res += s[0];\n }\n return res;\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 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}", "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 }", "@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}", "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 }", "private static String dateFormatter(String date) {\n\t\tString[] dateArray = date.split(AnalyticsUDFConstants.SPACE_SEPARATOR);\n\t\ttry {\n\t\t\t// convert month which is in the format of string to an integer\n\t\t\tDate dateMonth = new SimpleDateFormat(AnalyticsUDFConstants.MONTH_FORMAT, Locale.ENGLISH).parse(dateArray[1]);\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tcal.setTime(dateMonth);\n\t\t\t// months begin from 0, therefore add 1\n\t\t\tint month = cal.get(Calendar.MONTH) + 1;\n\t\t\tString dateString = dateArray[5] + AnalyticsUDFConstants.DATE_SEPARATOR + month + AnalyticsUDFConstants.DATE_SEPARATOR + dateArray[2];\n\t\t\tDateFormat df = new SimpleDateFormat(AnalyticsUDFConstants.DATE_FORMAT_WITHOUT_TIME);\n\t\t\treturn df.format(df.parse(dateString));\n\t\t} catch (ParseException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "private void updateDateTxtV()\n {\n String dateFormat =\"EEE, d MMM yyyy\";\n SimpleDateFormat sdf = new SimpleDateFormat(dateFormat, Locale.CANADA);\n dateStr = sdf.format(cal.getTime());\n dateTxtV.setText(dateStr);\n\n //unix datetime for saving in db\n dateTimeUnix = cal.getTimeInMillis() / 1000L;\n }", "protected String date(String format, double time) {\n\t\treturn new java.util.Date((long)(time*1000)).toString();\n\t}", "protected abstract DateFormat getDateFormat();", "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}", "private static SimpleDateFormat getDateFormat() {\r\n\t\tif(dateFormat == null)\r\n\t\t\tdateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\t\treturn dateFormat;\r\n\t}", "private void updateLabel() {\n String myFormat = \"yyyy-MM-dd\"; //In which you need put here\n SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.UK);\n\n serviceDate = sdf.format(myCalendar.getTime());\n callTimeSlotService();\n }", "private String getDate(long timeStamp) {\n\n try {\n DateFormat sdf = new SimpleDateFormat(\"MMM d, yyyy\", getResources().getConfiguration().locale);\n Date netDate = (new Date(timeStamp * 1000));\n return sdf.format(netDate);\n } catch (Exception ex) {\n return \"xx\";\n }\n }", "private String getDate(long timeStamp) {\n\n try {\n DateFormat sdf = new SimpleDateFormat(\"MMM d, yyyy\", getResources().getConfiguration().locale);\n Date netDate = (new Date(timeStamp * 1000));\n return sdf.format(netDate);\n } catch (Exception ex) {\n return \"xx\";\n }\n }", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\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}", "public static String formatDate(Date date, String userId)\n\t{\n\t\tDateFormat format = new SimpleDateFormat(\"MMM dd, yyyy hh:mm a\", getPreferredLocale(userId));\n\t\tformat.setTimeZone(getPreferredTimeZone(userId));\n\t\tString rv = format.format(date);\n\t\treturn rv;\n\t}", "public void actionPerformed(ActionEvent ae){\n Date date = new Date();\n //instantiate new Date object\n\n DateFormat otherFormat = new SimpleDateFormat(\"E, MMM, d y K:mm:ss a\");\n //12 hour time\n\n String otherDateTime = otherFormat.format(date);\n\n clockLabelTwo.setText(otherDateTime);\n //setting clock text to formatted String\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 Date convertirStringEnFecha(String dia, String hora)\n {\n String fecha = dia + \" \" + hora;\n SimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy hh:mm\");\n Date fecha_conv = new Date();\n try\n {\n fecha_conv = format.parse(fecha);\n }catch (ParseException e)\n {\n Log.e(TAG, e.toString());\n }\n return fecha_conv;\n }" ]
[ "0.6541367", "0.6508718", "0.64113164", "0.63950354", "0.6364396", "0.6357407", "0.63516235", "0.631923", "0.6291381", "0.6208296", "0.6184097", "0.61554986", "0.6128705", "0.61051637", "0.6102543", "0.60680085", "0.60480183", "0.60361", "0.60117424", "0.6009553", "0.5972662", "0.5957804", "0.59127456", "0.5907843", "0.58914584", "0.58471966", "0.5824433", "0.58229685", "0.5821919", "0.5808868", "0.5781072", "0.5780055", "0.57751834", "0.57609683", "0.57552594", "0.5740818", "0.5733739", "0.573192", "0.57313174", "0.5723329", "0.5720463", "0.57200617", "0.57121354", "0.57061154", "0.56963587", "0.56920546", "0.56844884", "0.56591046", "0.565527", "0.56446743", "0.5644017", "0.5641404", "0.56379956", "0.56351715", "0.5633786", "0.562335", "0.5611377", "0.5603764", "0.56020427", "0.559271", "0.5587512", "0.55804783", "0.55661345", "0.5561492", "0.5555432", "0.55546755", "0.55540735", "0.5552134", "0.5541475", "0.5539079", "0.5538831", "0.55340934", "0.55262905", "0.5524942", "0.5521758", "0.55196124", "0.55172944", "0.5503016", "0.5499608", "0.54926085", "0.54917294", "0.54914933", "0.548798", "0.54846483", "0.5478779", "0.54608554", "0.5458028", "0.5457066", "0.54539376", "0.545128", "0.5449795", "0.5448972", "0.5448125", "0.5444387", "0.5444387", "0.5440521", "0.5431845", "0.5427965", "0.5415705", "0.54107", "0.5410131" ]
0.0
-1
Retrieve the value is null or empty.
public static Spanned fromHtml(String argValue) { if (com.rz.librarycore.utils.Utils.isNullOrEmpty(argValue)) { return null; } if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { return Html.fromHtml(argValue, Html.FROM_HTML_MODE_LEGACY); } else { return Html.fromHtml(argValue); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "default boolean hasValue() {\n\t\t\treturn getValue() != null;\n\t\t}", "public boolean isEmpty() {\n\t\tString v = getValue();\n\t\treturn v == null || v.isEmpty();\n\t}", "public boolean hasValue() {\n return value_ != null;\n }", "public boolean isEmptyValue() {\r\n if(value == null){\r\n return true;\r\n }\r\n if(value.isEmpty()){\r\n return true;\r\n }\r\n if(value.size() == 1){\r\n if(value.get(0)!=null){\r\n return value.get(0).length() == 0;\r\n }else{\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public boolean hasValue() {\n return valueBuilder_ != null || value_ != null;\n }", "private boolean hasValue (String s) { return s != null && s.length() != 0; }", "private boolean checkForEmptyString(Object value)\n\t{\n\t\tif (value == null || value.toString().isEmpty()) \n\t\t\treturn true;\n\t\treturn false;\n\t}", "boolean getSearchValueNull();", "public boolean isPresent() {\r\n\t\treturn value != null;\r\n\t}", "boolean hasOptionalValue();", "default boolean isEmpty() {\n return get() == null;\n }", "@java.lang.Override\n public boolean hasVal() {\n return val_ != null;\n }", "public boolean hasTextValue() {\r\n return getTextValue() != null;\r\n // return StringUtils.isNotBlank(getTextValue());\r\n }", "static <T> boolean isNullOrEmpty(T t){\n if(t == null){\n return true;\n }\n String str = t.toString();\n if(str.isEmpty()){\n return true;\n }\n if(str.length() == 0){\n return true;\n }\n return false;\n }", "boolean isNilValue();", "public boolean isEmptyComplexValue() {\r\n if(complexValue==null){\r\n return true;\r\n }\r\n return complexValue.isEmpty();\r\n }", "private final boolean emptyVal(String val) {\n return ((val == null) || (val.length() == 0));\n }", "public boolean hasValue() {\n return result.hasValue();\n }", "public boolean hasValue() {\n return result.hasValue();\n }", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "public boolean hasValue() throws SdpParseException {\n\t\tNameValue nameValue = getAttribute();\n\t\tif (nameValue == null)\n\t\t\treturn false;\n\t\telse {\n\t\t\tObject value = nameValue.getValue();\n\t\t\tif (value == null)\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\t}\n\t}", "default boolean isPresent() {\n return get() != null;\n }", "default boolean isPresent() {\n return get() != null;\n }", "public boolean hasValue() { return false; }", "private String getStringOrNull (String value) {\n if (value == null || value.isEmpty()) value = null;\n return value;\n }", "boolean isValue();", "protected boolean isEmptyValue(final String parameter) {\n // String value = parameters.get(parameter);\n // return isEmptyString(value);\n return false;\n }", "public boolean getSearchValueNull() {\n return searchValueNull_;\n }", "public boolean getBlank(){\n return blank;\n }", "public boolean getSearchValueNull() {\n return searchValueNull_;\n }", "java.lang.String getOptionalValue();", "public boolean getValuePresent() {\r\n return ValuePresent;\r\n }", "public String getValueAsString() {\n return value == null ? StringUtils.EMPTY : value.toString();\n }", "private String notNull(String value) {\n return value != null ? value : \"\";\n }", "@Override\n\tpublic boolean getHasValue() {\n\t\treturn true;\n\t}", "boolean hasStringValue();", "public boolean isEmpty()\n {return data == null;}", "boolean isSimpleValue();", "private static String getPropertyValueOrDefault(String value) {\n return value != null ? value : \"\";\n }", "boolean getValueCharacteristicIdNull();", "boolean getValueLanguageIdNull();", "boolean containsValue(Object value) throws NullPointerException;", "boolean hasVal();", "boolean hasVal();", "private String getNullValueText() {\n return getNull();\n }", "@Override\n public boolean isDefined()\n {\n return getValue() != null || getChildrenCount() > 0\n || getAttributeCount() > 0;\n }", "private boolean haveEmptyField() {\n return getTextID(FIRST_NAME).isEmpty() ||\n getTextID(LAST_NAME).isEmpty() ||\n getTextID(ADDRESS).isEmpty();\n }", "private boolean isBuildingNumberNull() {\n return (buildingNumber == null || buildingNumber.isEmpty());\n }", "public boolean hasValues()\r\n\t{\r\n\t\t\r\n\t\tif ((this.criteriaType != null && !this.criteriaType.trim().equals(\"\"))\r\n\t\t\t\t&& (this.criteriaValues != null && !this.criteriaValues.isEmpty()))\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}", "static boolean isBlank(Token t) {\n return t.getText().isBlank(); // trim().length() == 0\n }", "public boolean getValue()\n\t{\n\t\tString tmp;\n\t\tpatt = Pattern.compile(NAME_PATTERN);\n\t\ttmp = name.getText().toString();\n\t\tif(patt.matcher(tmp).matches()){\n\t\t\tvname = tmp;\n\t\t}\n\t\telse{\n\t\t\tname.setError(getString(R.string.error_nameTxt));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\ttmp = home.getText().toString();\n\t\tif(tmp.length()!=0){\n\t\t\tif(patt.matcher(tmp).matches()){\n\t\t\t\tvhome=tmp;\n\t\t\t}\n\t\t\telse{\n\t\t\t\thome.setError(getString(R.string.error_homeTXt));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static Boolean IsStringNullOrEmpty(String value) {\n\t\treturn value == null || value == \"\" || value.length() == 0;\n\t}", "public boolean hasSearchValue() {\n return searchValue_ != null;\n }", "public boolean my_is_empty();", "public final boolean hasTerminalValue ()\r\n {\r\n return isSpecialForm() && specialForm().isValue();\r\n }", "private boolean isVal() {\n\t\treturn look.type == Tag.BOOLEAN || look.type == Tag.NUMBER\n\t\t\t\t|| look.type == Tag.STRING || look.type == Tag.NULL;\n\n\t}", "public static boolean nullOrEmpty(String value) {\n\t\tif (null == value || \"\".equals(value.trim()) || \"null\".equalsIgnoreCase(value.trim())) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isBlank() {\n return (tags.length() == 0);\n }", "public boolean isEmpty()\n\t{\n\t\tverifyParseState();\n\t\treturn values.isEmpty();\n\t}", "Boolean isBlankOrNull(String key)\n {\n return StringUtils.isBlank(properties.getProperty(key));\n }", "public static boolean isEmpty(Object field) {\r\n\t\treturn (field == null) || field.toString().trim().isEmpty();\r\n\t}", "public boolean isEmpty() {\n\t\treturn (op == null && dval == null);\n\t}", "public boolean isBlank()\n\t\t{\n\t\t\treturn m_isBlank;\n\t\t}", "public boolean isValue() {\n switch(this.getType()) {\n case CONSTANT_INTEGER : \n case CONSTANT_FLOAT :\n case CONSTANT_DOUBLE : \n case CONSTANT_LONG : \n case CONSTANT_STRING:\n return true ;\n default :\n return false;\n }\n }", "public String getValue()\r\n\t{\r\n\t\tString value = textField.getText();\r\n\t\treturn value==null || value.length()==0 ? null : value;\r\n\t}", "private Boolean isFieldEmpty(EditText field) {\n return field.getText().toString().trim().equals(\"\");\n }", "public boolean isSetValue() {\n return this.value != null;\n }", "boolean hasVarValue();", "public boolean is_empty () {\n return is_empty;\r\n }", "public boolean isEmpty() {\n return (this.text == null);\n }", "public boolean exists() {\n \t\treturn (type != UNKNOWN && isValid() && ((type == STRING) ? !sVal.equals(\"\") : true));\n \t}", "@ZenCodeType.Method\n @ZenCodeType.Getter(\"isEmpty\")\n default boolean isEmpty() {\n \n return length() == 0;\n }", "public static boolean isNullOrEmpty(String content){\n return (content !=null && !content.trim().isEmpty() ? false :true);\n }", "public boolean isSetValue() {\n return this.value != null;\n }", "boolean checkIfEmpty();", "public abstract boolean IsEmpty();", "public boolean isNull() {\n return originalValue == null;\n }", "public boolean isValue() {\n return value;\n }", "public boolean isEmpty(){\n return thing == null;\n }", "public static boolean isBlank(String value) {\r\n return ((value == null) || (value.trim().length() == 0));\r\n }", "public boolean hasOptionalValue() {\n return ((bitField0_ & 0x00000800) == 0x00000800);\n }", "public static boolean isEmpty(String value)\n {\n return (isNull(value)) || value.trim().length() == 0;\n }", "public static boolean isEmpty(String value)\n {\n return (isNull(value)) || value.trim().length() == 0;\n }", "public static boolean isEmpty(final String value) {\n\t\treturn value == null || value.trim().length() == 0 || \"null\".endsWith(value);\n\t}", "public static boolean isNullOrEmptyString(Object obj) {\r\n\t\treturn (obj instanceof String) ? ((String)obj).trim().equals(\"\") : obj==null;\r\n\t}", "public boolean exists() {\n \t\treturn (type != UNASKED && isValid() && ((type == STRING) ? !sVal.equals(\"\") : true));\n \t}", "public boolean hasSearchValue() {\n return searchValueBuilder_ != null || searchValue_ != null;\n }", "public static boolean isValueAbsent(String value) {\n return ((null == value) || (value.trim().length() == 0));\n }" ]
[ "0.74363846", "0.7406146", "0.7277347", "0.717242", "0.70934385", "0.7013986", "0.7010107", "0.6907059", "0.68254757", "0.67973006", "0.66998756", "0.6691565", "0.661762", "0.64888406", "0.6469269", "0.6466774", "0.64651084", "0.64611757", "0.64611757", "0.6459624", "0.6459624", "0.6459624", "0.6459624", "0.6459624", "0.6459624", "0.6459624", "0.6459624", "0.6459624", "0.6459624", "0.6459624", "0.6459624", "0.6459624", "0.6459624", "0.6410563", "0.63543063", "0.63543063", "0.6353741", "0.6323307", "0.6303984", "0.62836826", "0.6282659", "0.6262261", "0.6241971", "0.62399024", "0.62372833", "0.6224769", "0.6187995", "0.61580664", "0.6158041", "0.6148644", "0.61442333", "0.6140876", "0.6116255", "0.61146384", "0.60981303", "0.6084709", "0.6084709", "0.6081663", "0.60678995", "0.6058815", "0.60549605", "0.60530245", "0.6047817", "0.60363793", "0.60200727", "0.60192955", "0.6013994", "0.6011957", "0.6009487", "0.600257", "0.59937537", "0.5973372", "0.5962856", "0.5956569", "0.5949161", "0.59452355", "0.5944938", "0.594289", "0.5941693", "0.59385467", "0.5934161", "0.5926442", "0.5926038", "0.5924164", "0.5921184", "0.59004766", "0.58960855", "0.5895359", "0.58802253", "0.5879339", "0.5875897", "0.58717585", "0.5869583", "0.5863137", "0.5851578", "0.5851578", "0.5851202", "0.585105", "0.5842677", "0.5840105", "0.5839265" ]
0.0
-1
Function used to fetch an XML file from assets folder
public static int getDrawableId(Context argContext, String argName) { Resources resources = argContext.getResources(); int resourceId = resources.getIdentifier(argName, "drawable", argContext.getPackageName()); return resourceId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public XmlPullParser getLocalXML(String filename) throws IOException {\r\n\t\ttry {\r\n\t\t\tin = mContext.getAssets().open(filename);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tXmlPullParser parser = Xml.newPullParser();\r\n\t\t\tparser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);\r\n\t\t\tparser.setInput(in, null);\r\n\t\t\tparser.nextTag();\r\n\t\t\treturn parser;\r\n\t\t} catch (XmlPullParserException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "public void loadXML(){\n new DownloadXmlTask().execute(URL);\n }", "public void xmlInputStream() {\n inputStream = context.getResources().openRawResource(R.raw.flowers_xml);\n //stringInputStream = convertInputStreamToString(inputStream);\n //System.out.println(\"------------ InputStream ------------\\n\" + stringInputStream);\n //------------------------------------------------------------------------------------------\n }", "public static ArrayList<APIAsset> GetAssetsFromSampleData(String nodeFilePath, String nodePath) {\n ArrayList<APIAsset> API_Assets = new ArrayList<APIAsset>();\n\n try {\n // Get the SAXReader object \n SAXReader reader = new SAXReader();\n // Get the xml document object by sax reader. \n Document document = reader.read(nodeFilePath);\n List<Node> nodes = document.selectNodes(nodePath);\n\n // Read all the node inside xpath nodes and print the value of each \n for (Node node : nodes) {\n\n APIAsset API_Asset = GetAssetFromNode(node);\n API_Assets.add(API_Asset);\n\n }\n } catch (Exception ex) {\n ApiLog.One.WriteException(ex);\n }\n return API_Assets;\n }", "InputStream getAsset(String asset) throws IOException;", "private InputStream readFromSd() {\n\t\tString fileName = \"exchange_rates.xml\";\n\t\tFileInputStream stream = null;\n\t\tFile sdCard = android.os.Environment.getExternalStorageDirectory(); \n\t\tFile dir = new File (sdCard.getAbsolutePath() + \"/Android/data/com.douchedata.exchange/files/\");\n\t\tLog.v(\"sd\", dir.getAbsolutePath());\n\t\tFile file = new File(dir, fileName);\n\n\t\tif (dir.exists() == false) {\n\t\t\tdir.mkdirs();\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tif (file.exists())\n\t\t\t\tstream = new FileInputStream(file);\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn stream;\n\t}", "public void load(String filename){\n //Create a file if its not already on disk\n File extDir = new File(this.getFilesDir(), filename);\n\n //Read text from file\n StringBuilder text = new StringBuilder();\n\n\n //Needs lots of try and catch blocks because so much can go wrong\n try{\n\n BufferedReader br = new BufferedReader(new FileReader(extDir));\n String line;\n\n while ((line = br.readLine()) != null) {\n text.append(line);\n text.append('\\n');\n }//end while\n\n br.close();//Close the buffer\n }//end try\n catch (FileNotFoundException e){//If file not found on disk here.\n Toast.makeText(this, \"There was no data to load\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }\n\n catch (IOException e)//If io Exception here\n {\n Toast.makeText(this, \"Error loading file\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }//end catch\n\n\n //Set the data from the file content and conver it to a String\n String data = new String(text);\n\n //Safety first Parse data if available.\n if (data.length() > 0) {\n parseXML(data);\n }\n else\n Toast.makeText(this, \"There is no data to display\", Toast.LENGTH_LONG).show();\n }", "public void open(){\n\t\ttry {\n\t\t\tdocFactory = DocumentBuilderFactory.newInstance();\n\t\t\tdocBuilder = docFactory.newDocumentBuilder();\n\t\t\tdoc = docBuilder.parse(ManipXML.class.getResourceAsStream(path));\n\t\t\t\n\t\t} catch (ParserConfigurationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Savable loadAsset() {\n return file.loadAsset();\n }", "public void testRead() throws Exception\n {//��װ����\n InputStream inputStream=getInstrumentation().getTargetContext().getAssets().open(\"new_file.xml\");\n\n\n Log.v(\"abcd\", \"\"+inputStream);\n List<Person> personsList = ReadXmlByPullService.ReadXmlByPull(inputStream);\n Log.v(\"abcd\", personsList.get(0).getName());\n\n for (Iterator iterator = personsList.iterator(); iterator.hasNext();) {\n Person person = (Person) iterator.next();\n Log.v(PERSONSTRING, person.toString());\n }\n\n }", "@GET\r\n\t@Produces(MediaType.APPLICATION_OCTET_STREAM)\r\n\t@Path(\"assets/{filename}\")\r\n\tpublic Response staticResources(@PathParam(\"filename\") String filename) {\r\n\t\tSystem.out.println(\"Fichier : \" + filename);\r\n\t\t\r\n\t\tString assetsPath = \"./assets/\";\r\n\t\tFile fichier = new File(assetsPath + filename );\r\n\t\t\r\n\t\tif( !fichier.exists() ) {\r\n\t\t\treturn Response.status(404).build();\r\n\t\t}\r\n\t\treturn Response.ok(fichier, MediaType.APPLICATION_OCTET_STREAM)\r\n\t\t .header(\"Content-Disposition\", \"attachment; filename=\\\"\" + fichier.getName() + \"\\\"\")\r\n\t\t\t .build();\r\n\t}", "public void readXML() {\n\t try {\n\n\t \t//getting xml file\n\t \t\tFile fXmlFile = new File(\"cards.xml\");\n\t\t\tDocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n\t\t\tDocument doc = dBuilder.parse(fXmlFile);\n\t\t \n\t\t\t//doc.getDocumentElement().normalize(); ???\n\t\t \n\t\t \t//inserting card IDs and Effects into arrays\n\t\t\tNodeList nList = doc.getElementsByTagName(\"card\");\n\t\t\tfor (int i = 0; i < nList.getLength(); i++) {\n\t\t\t\tNode nNode = nList.item(i);\n\t\t\t\tif (nNode.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\t\tElement eElement = (Element) nNode;\n\t\t\t\t\tint id = Integer.parseInt(eElement.getAttribute(\"id\"));\n\t\t\t\t\tString effect = eElement.getElementsByTagName(\"effect\").item(0).getTextContent();\n\t\t\t\t\tidarr.add(id);\n\t\t\t\t\teffsarr.add(effect);\n\t\t\t\t}\n\t\t\t}\n\t } catch (Exception e) {\n\t\t\te.printStackTrace();\n\t }\n }", "DocumentFragment getXML(String path)\n throws ProcessingException ;", "private static String getFilesContent() {\n String content = \"\";\n try {\n //cameras.json\n AssetManager am = MarketApplication.getMarketApplication().getAssets();\n InputStream stream = am.open(CAMERAS_FILE_NAME);\n int size = stream.available();\n byte[] buffer = new byte[size];\n stream.read(buffer);\n mJsonCameras = new String(buffer);\n\n //videogames.json\n stream = am.open(VIDEO_GAMES_FILE_NAME);\n size = stream.available();\n buffer = new byte[size];\n stream.read(buffer);\n mJsonVideogames = new String(buffer);\n\n //clothes.json\n stream = am.open(CLOTHES_FILE_NAME);\n size = stream.available();\n buffer = new byte[size];\n stream.read(buffer);\n stream.close();\n mJsonClothesProducts = new String(buffer);\n\n\n } catch (IOException e) {\n Log.e(TAG, \"Couldn't read the file\");\n }\n return content;\n }", "abstract public InputStream retrieveContent( String path )\r\n throws Exception;", "public void readXmlFile() {\r\n try {\r\n ClassLoader classLoader = getClass().getClassLoader();\r\n File credentials = new File(classLoader.getResource(\"credentials_example.xml\").getFile());\r\n DocumentBuilderFactory Factory = DocumentBuilderFactory.newInstance();\r\n DocumentBuilder Builder = Factory.newDocumentBuilder();\r\n Document doc = Builder.parse(credentials);\r\n doc.getDocumentElement().normalize();\r\n username = doc.getElementsByTagName(\"username\").item(0).getTextContent();\r\n password = doc.getElementsByTagName(\"password\").item(0).getTextContent();\r\n url = doc.getElementsByTagName(\"url\").item(0).getTextContent();\r\n setUsername(username);\r\n setPassword(password);\r\n setURL(url);\r\n } catch (Exception error) {\r\n System.out.println(\"Error in parssing the given xml file: \" + error.getMessage());\r\n }\r\n }", "static String readXML(String keyName){\n File fXmlFile = new File(\".\"+ConstantsClass.PATHWAY_TO_AUXILIARY_FILES+\"/configuration.xml\");\n DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder dBuilder = null;\n try {\n dBuilder = dbFactory.newDocumentBuilder();\n } catch (ParserConfigurationException e) {\n e.printStackTrace();\n }\n Document doc = null;\n try {\n doc = dBuilder.parse(fXmlFile);\n } catch (SAXException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n doc.getDocumentElement().normalize();\n return doc.getElementsByTagName(keyName).item(0).getTextContent();\n }", "File retrieveFile(String absolutePath);", "Path getContent(String filename);", "@GET\n @Path(\"/\")\n @Produces(MediaType.TEXT_XML)\n public StreamingOutput getXCRIXml() {\n return new StreamingOutput() {\n\n @Override\n public void write(OutputStream output) throws IOException, WebApplicationException {\n byte[] out = xcriSession.loadCourseDirectoryFile(xcriSession.getCourseFileName());\n output.write(out);\n }\n };\n }", "static public void readRepository(){\n File cache_file = getCacheFile();\n if (cache_file.exists()) {\n try {\n // Read the cache acutally\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n DocumentBuilder builder = factory.newDocumentBuilder();\n Document document = builder.parse(cache_file);\n NodeList images_nodes = document.getElementsByTagName(\"image\");\n for (int i = 0; i < images_nodes.getLength(); i++) {\n Node item = images_nodes.item(i);\n String image_path = item.getTextContent();\n File image_file = new File(image_path);\n if (image_file.exists()){\n AppImage image = Resources.loadAppImage(image_path);\n images.add(image);\n }\n }\n }\n catch (Exception e) {\n throw new RuntimeException(e);\n }\n }\n }", "public String getXsdFileName();", "public void readxml() throws JAXBException, FileNotFoundException {\n Player loadplayer = xml_methods.load();\n logger.info(\"player name: \" + loadplayer.getName());\n if (!item.isEmpty()) {\n logger.trace(loadplayer.getitem(0).getName());\n }\n tfName.setText(loadplayer.getName());\n isset = true;\n player = loadplayer;\n\n }", "public static InputStream tmxFromXML(final CandyLevelActivity candyLevel, final int world, final int level) {\n\t\ttry {\r\n\t\t\tfinal InputStream input = candyLevel.getAssets().open(\"levels/w\" + world + \".xml\");\r\n\t\t\tfinal DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n\t\t\tfinal DocumentBuilder db = dbf.newDocumentBuilder();\r\n\t\t\tfinal Document doc = db.parse(new InputSource(input));\r\n\t\t\tdoc.getDocumentElement().normalize();\r\n\t\t\tfinal NodeList levelNodeList = doc.getElementsByTagName(\"l\");\r\n\t\t\tfor (int i = 0; i < levelNodeList.getLength(); i++) {\r\n\t\t\t\tif (Integer.valueOf(((Element) levelNodeList.item(i)).getAttribute(\"id\")) == level) {\r\n\t\t\t\t\tfinal Element currentLevelElement = (Element) levelNodeList.item(i);\r\n\t\t\t\t\tfinal NodeList nodeList = currentLevelElement.getElementsByTagName(\"c\");\r\n\t\t\t\t\treturn new ByteArrayInputStream(((Element) nodeList.item(0)).getTextContent().getBytes());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthrow new Exception(\"Missing level \" + world + \"-\" + level + \"!\");\r\n\t\t} catch (Exception e) {\r\n\t\t\tif (CandyUtils.DEBUG) Log.e(TAG, \"Failed to load TMX, loading default.\", e);\r\n\t\t\treturn new ByteArrayInputStream(\"H4sIAAAAAAAAA2NkYGBgpDGmFRg1f9R8aptPzXQ9HMNn1PxR80k1n5qYCYiZkfgAkQjLUsAGAAA=\".getBytes());\r\n\t\t}\r\n\t}", "java.lang.String getResourceUri();", "private String loadXmlFromNetwork(String urlString) throws XmlPullParserException, IOException {\n InputStream stream = null;\n StackOverflowXmlParser stackOverflowXmlParser = new StackOverflowXmlParser();\n List<Entry> entries = null;\n String title = null;\n String url = null;\n String summary = null;\n Calendar rightNow = Calendar.getInstance();\n DateFormat formatter = new SimpleDateFormat(\"MMM dd h:mmaa\");\n int count = 1;\n\n // Checks whether the user set the preference to include summary text\n SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);\n boolean pref = sharedPrefs.getBoolean(\"summaryPref\", false);\n\n StringBuilder htmlString = new StringBuilder();\n htmlString.append(\"<h3>\" + getResources().getString(R.string.page_title) + \"</h3>\");\n htmlString.append(\"<em>\" + getResources().getString(R.string.updated) + \" \" +\n formatter.format(rightNow.getTime()) + \"</em>\");\n\n try {\n stream = downloadUrl(urlString);\n entries = stackOverflowXmlParser.parse(stream);\n // Makes sure that the InputStream is closed after the app is\n // finished using it.\n } finally {\n if (stream != null) {\n stream.close();\n }\n }\n\n // StackOverflowXmlParser returns a List (called \"entries\") of Entry objects.\n // Each Entry object represents a single post in the XML feed.\n // This section processes the entries list to combine each entry with HTML markup.\n // Each entry is displayed in the UI as a link that optionally includes\n // a text summary.\n for (Entry entry : entries) {\n \t\n \tString photo = \"\";\n \tString video = \"video\";\n htmlString.append(\"<p><a href='\");\n photo = \"https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=\"+entry.link+\"&sensor=true&key=AIzaSyBeNRBzRlJQy0-L8OlYFTnMcJ9LRb6h_-s\";\n \n \n htmlString.append(photo);\n htmlString.append(\"'>\" + entry.title + \"</a></p>\");\n if(count == 1 ||count == 3 ||count == 6 ||count == 8 ||count == 9) {\n \tvideo =\"http://192.168.0.16:8010/cloud/my_videos/\"+Integer.toString(count);\n \thtmlString.append(\"<a href='\"+video+\"'> - Video</a>\");\n }\n count++;\n \n // If the user set the preference to include summary text,\n // adds it to the display.\n if (pref) {\n htmlString.append(entry.summary);\n }\n }\n// URL url2 = new URL(\"http://192.168.0.16:8000/cloud/images/\");\n// HttpURLConnection conn2 = (HttpURLConnection) url2.openConnection();\n//\t\t\n// //conn2.setDoOutput(true);\n// conn2.setConnectTimeout(10000 /* milliseconds */);\n// conn2.setRequestMethod(\"GET\");\n// conn2.setDoInput(true);\n// conn2.connect();\n// //OutputStream out1 = new BufferedOutputStream(conn2.getOutputStream());\n// \n// \n// InputStream in = new BufferedInputStream(conn2.getInputStream());\n// BufferedReader br = new BufferedReader(new InputStreamReader(in));\n// String test = br.readLine();\n// String output=\"\";\n// while(test != null) {\n// \toutput = output +test;\n// \ttest = br.readLine();\n// }\n// output=\"<html><body><video width=\\\"320\\\" height=\\\"240\\\" controls><source src=\\\"movie.mp4\\\" type=\\\"video/mp4\\\"><source src=\\\"movie.ogg\\\" type=\\\"video/ogg\\\">Your browser does not support the video tag.</video></body></html>\";\n \n return htmlString.toString();\n }", "public static void main(String[] args) {\n try {\n String url = \"file:///C:/enwiktionary-latest-pages-articles.xml.bz2.xml.bz2.xml\";\n// String url = \"file:///D:/enWikt_Samp.xml\n File file = new File(new URI(url));\n System.out.println(file.toURI());\n\n\n// fileLoader(file);\n staxReader(file);\n// vtdReader(file); vtd is where kittens go to die.\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public abstract void loadContent(AssetManager manager);", "protected InputStream getContentXML(String viewId) throws Exception {\n if (log.isDebugEnabled()) {\n log.debug(\"requested viewId: \" + viewId);\n }\n StringBuilder sb = new StringBuilder(\"<?xml version=\\\"1.0\\\"?>\");\n sb.append(\"<root>\");\n sb.append(\"<child>\");\n sb.append(\"Hello World!\");\n sb.append(\"</child>\");\n sb.append(\"</root>\");\n return new ByteArrayInputStream(sb.toString().getBytes(\"utf-8\"));\n }", "String getResource();", "private String readDeserialize(String fileName, AssetManager assetManager) {\n StringBuffer sb = new StringBuffer();\n try {\n InputStream is = assetManager.open(fileName);\n InputStreamReader isr = new InputStreamReader(is);\n BufferedReader br = new BufferedReader(isr);\n\n String line = br.readLine();\n while (line != null) {\n sb.append(line);\n line = br.readLine();\n }\n br.close();\n isr.close();\n is.close();\n } catch (FileNotFoundException e) {\n Log.e(\"login activity\", String.format(\"File not found: %s\", e.toString()));\n } catch (IOException e) {\n Log.e(\"login activity\", String.format(\"Can not read file: %s\", e.toString()));\n }\n return sb.toString();\n }", "private URL getAssetsUrl() {\n\t\treturn url(ASSETS_URL);\n\t}", "private void loadFromXml(String fileName) throws IOException {\n\t\tElement root = new XmlReader().parse(Gdx.files.internal(fileName));\n\n\t\tthis.name = root.get(\"name\");\n\t\tGdx.app.log(\"Tactic\", \"Loading \" + this.name + \"...\");\n\n\t\tArray<Element> players = root.getChildrenByName(\"player\");\n\t\tint playerIndex = 0;\n\t\tfor (Element player : players) {\n\t\t\t//int shirt = player.getInt(\"shirt\"); // shirt number\n\t\t\t//Gdx.app.log(\"Tactic\", \"Location for player number \" + shirt);\n\n\t\t\t// regions\n\t\t\tArray<Element> regions = player.getChildrenByName(\"region\");\n\t\t\tfor (Element region : regions) {\n\t\t\t\tString regionName = region.get(\"name\"); // region name\n\n\t\t\t\tthis.locations[playerIndex][Location.valueOf(regionName).ordinal()] = new Vector2(region.getFloat(\"x\"), region.getFloat(\"y\"));\n\n\t\t\t\t//Gdx.app.log(\"Tactic\", locationId + \" read\");\n\t\t\t}\n\t\t\tplayerIndex++;\n\t\t}\t\n\t}", "public static String getFileFromAssets(Context context, String fileName) {\n if (context == null || fileName == null || fileName.isEmpty()) {\n return null;\n }\n\n StringBuilder s = new StringBuilder(\"\");\n try {\n InputStreamReader in = new InputStreamReader(context.getResources().getAssets().open(fileName));\n BufferedReader br = new BufferedReader(in);\n String line;\n while ((line = br.readLine()) != null) {\n s.append(line);\n }\n return s.toString();\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }", "private Document getDocumentInFileSys()throws Exception{\r\n\t\t\r\n\t\tDocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();\r\n\t\tDocumentBuilder builder = builderFactory.newDocumentBuilder();\r\n\t\tFile file = new File(DIR,FILE_NAME);\r\n\t\tif(!file.exists())\r\n\t\t\treturn null;\r\n\t\t\r\n\t\tFileInputStream inStream =new FileInputStream(file);\r\n\t\ttry{\r\n\t\t\tDocument doc = builder.parse(inStream);\r\n\t\t\treturn doc;\r\n\t\t}finally{\r\n\t\t\tinStream.close();\r\n\t\t}\r\n\t}", "private void refreshXML() {\n\t\t// Build a new thread to handle the request, since fetching files from\n\t\t// a remove server shouldn't block screen drawing.\n\t\tToast.makeText(\n\t\t\t\tthis,\n\t\t\t\tgetString(R.string.xml_requested_from) + \": \"\n\t\t\t\t\t\t+ PreferencesManager.getXmlUri(this), Toast.LENGTH_LONG)\n\t\t\t\t.show();\n\t\t// We use a separate runnable class instead of an anonymous inner class\n\t\t// so that when the async request is completed, it can signal the viewer\n\t\t// to toast.\n\t\tFetchThread ft = new FetchThread(this);\n\t\tft.start();\n\t}", "void file(Context context) {\n context.getFilesDir();\n File file = new File(context.getFilesDir() + \"/Comments.xml\");\n System.out.println(context.getFilesDir());\n if (!file.exists())\n {\n XmlSerializer serializer = Xml.newSerializer();\n StringWriter writer = new StringWriter();\n try {\n serializer.setOutput(writer);\n serializer.startDocument(\"UTF-8\", true);\n serializer.startTag(\"\", \"lista\");\n serializer.text(\"\");\n serializer.endTag(\"\", \"lista\");\n serializer.endDocument();\n String result = writer.toString();\n\n FileOutputStream fos = context.openFileOutput(\"Comments.xml\", Context.MODE_PRIVATE);\n fos.write(result.getBytes(), 0, result.getBytes().length);\n fos.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public FeedManager loadFeed() throws IOException, XmlPullParserException {\n\t\tInputStream stream = null;\n\t\tSolsticeXmlParser solsticeXmlParser = new SolsticeXmlParser();\n\n\t\ttry {\n\t\t\tstream = downloadUrl(URL);\n\t\t\treturn solsticeXmlParser.parse(stream);\n\t\t} finally {\n\t\t\tif (stream != null) {\n\t\t\t\tstream.close();\n\t\t\t}\n\t\t}\n\t}", "private APKFileDetails analyzeXapkFile(String filePath) {\n try {\n ZipFile zipFile = new ZipFile(filePath);\n Enumeration<? extends ZipEntry> entries = zipFile.entries();\n\n while(entries.hasMoreElements()) {\n ZipEntry entry = entries.nextElement();\n if (entry.getName().equalsIgnoreCase(\"manifest.json\")) {\n InputStream stream = zipFile.getInputStream(entry);\n BufferedReader streamReader = new BufferedReader(new InputStreamReader(stream, \"UTF-8\"));\n StringBuilder responseStrBuilder = new StringBuilder();\n String inputStr;\n while ((inputStr = streamReader.readLine()) != null) {\n responseStrBuilder.append(inputStr);\n }\n stream.close();\n zipFile.close();\n return analyzeXapkManifest(responseStrBuilder.toString());\n }\n\n }\n zipFile.close();\n throw new APKFileAnalyzerException(\"Missing manifest in XAPK-file\", new Exception());\n\n } catch (Exception e) {\n log.error(\"Unexpected error while analyzing XAPK-file: {}\", filePath, e);\n throw new APKFileAnalyzerException(\"Unexpected error while analyzing XAPK-file\", e);\n }\n }", "@Override\n public InputStream findResource(String filename)\n {\n InputStream resource = null;\n try\n {\n Path scriptRootPath = Files.createDirectories(getScriptRootPath(side));\n Path scriptPath = scriptRootPath.resolve(filename).toAbsolutePath();\n resource = Files.newInputStream(scriptPath, StandardOpenOption.READ);\n } catch (IOException e)\n {\n resource = super.findResource(filename);\n }\n return resource;\n }", "public String loadJSONFromAsset() {\n String json;\n String file = \"assets/words.json\";\n\n try {\n InputStream is = this.getClass().getClassLoader().getResourceAsStream(file);\n int size = is.available();\n byte[] buffer = new byte[size];\n is.read(buffer);\n is.close();\n json = new String(buffer, \"UTF-8\");\n } catch (IOException ex) {\n ex.printStackTrace();\n return null;\n }\n return json;\n }", "private static String getResourcePath(String resPath) {\n URL resource = XmlReaderUtils.class.getClassLoader().getResource(resPath);\n Assert.assertNotNull(\"Could not open the resource \" + resPath, resource);\n return resource.getFile();\n }", "public Blob getResource(String relativePath) throws DocumentNotFoundException;", "public static synchronized Resource getResource(String xmlFileName, ResourceSet rs) {\r\n\t\tURI uri = URI.createFileURI(xmlFileName);\r\n\t\tResource resource = null;\r\n\t\ttry {\r\n\t\t\tresource = rs.getResource(uri, true);\r\n\t\t} catch (Throwable fileNotFoundException) {\r\n\t\t\tresource = rs.createResource(uri);\r\n\t\t}\r\n\t\treturn resource;\r\n\t}", "public String loadFromFile() {\n StringBuilder sb = new StringBuilder();\n try {\n Log.d(\"DEBUG\", this.context.getPackageName());\n Log.d(\"DEBUG\", this.file);\n FileInputStream fis = context.openFileInput(file);\n BufferedReader br = new BufferedReader(new InputStreamReader(fis, this.encoding));\n String line;\n while(( line = br.readLine()) != null ) {\n sb.append( line );\n sb.append( '\\n' );\n }\n } catch (IOException e) {\n e.printStackTrace();\n return \"\";\n }\n return sb.toString();\n }", "public File getAttributeFile();", "public String initAssetFile(String filename) {\n File file = new File(getFilesDir(), filename);\n if (!file.exists()) try {\n InputStream is = getAssets().open(filename);\n OutputStream os = new FileOutputStream(file);\n byte[] data = new byte[is.available()];\n is.read(data); os.write(data); is.close(); os.close();\n } catch (IOException e) { e.printStackTrace(); }\n Log.d(TAG,\"prepared local file: \"+filename);\n return file.getAbsolutePath();\n }", "private void loadFile() {\n String xmlContent = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><atomic-mass-table mass-units=\\\"u\\\" abundance-units=\\\"Mole Fraction\\\"><entry symbol=\\\"H\\\" atomic-number=\\\"1\\\"> <natural-abundance> <mass value=\\\"1.00794\\\" error=\\\"0.00007\\\" /> <isotope mass-number=\\\"1\\\"> <mass value=\\\"1.0078250319\\\" error=\\\"0.00000000006\\\" /> <abundance value=\\\"0.999885\\\" error=\\\"0.000070\\\" /> </isotope> <isotope mass-number=\\\"2\\\"> <mass value=\\\"2.0141017779\\\" error=\\\"0.0000000006\\\" /> <abundance value=\\\"0.000115\\\" error=\\\"0.000070\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"He\\\" atomic-number=\\\"2\\\"> <natural-abundance> <mass value=\\\"4.002602\\\" error=\\\"0.000002\\\" /> <isotope mass-number=\\\"3\\\"> <mass value=\\\"3.0160293094\\\" error=\\\"0.0000000012\\\" /> <abundance value=\\\"0.00000134\\\" error=\\\"0.00000003\\\" /> </isotope> <isotope mass-number=\\\"4\\\"> <mass value=\\\"4.0026032497\\\" error=\\\"0.0000000015\\\" /> <abundance value=\\\"0.99999866\\\" error=\\\"0.00000003\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Li\\\" atomic-number=\\\"3\\\"> <natural-abundance> <mass value=\\\"6.9421\\\" error=\\\"0.002\\\" /> <isotope mass-number=\\\"3\\\"> <mass value=\\\"6.0151223\\\" error=\\\"0.0000005\\\" /> <abundance value=\\\"0.0759\\\" error=\\\"0.0004\\\" /> </isotope> <isotope mass-number=\\\"7\\\"> <mass value=\\\"7.0160041\\\" error=\\\"0.0000005\\\" /> <abundance value=\\\"0.9241\\\" error=\\\"0.0004\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Be\\\" atomic-number=\\\"4\\\"> <natural-abundance> <mass value=\\\"9.012182\\\" error=\\\"0.000003\\\" /> <isotope mass-number=\\\"9\\\"> <mass value=\\\"9.0121822\\\" error=\\\"0.0000004\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"B\\\" atomic-number=\\\"5\\\"> <natural-abundance> <mass value=\\\"10.881\\\" error=\\\"0.007\\\" /> <isotope mass-number=\\\"10\\\"> <mass value=\\\"10.0129371\\\" error=\\\"0.0000003\\\" /> <abundance value=\\\"0.199\\\" error=\\\"0.007\\\" /> </isotope> <isotope mass-number=\\\"11\\\"> <mass value=\\\"11.0093055\\\" error=\\\"0.0000004\\\" /> <abundance value=\\\"0.801\\\" error=\\\"0.007\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"C\\\" atomic-number=\\\"6\\\"> <natural-abundance> <mass value=\\\"12.0107\\\" error=\\\"0.0008\\\" /> <isotope mass-number=\\\"12\\\"> <mass value=\\\"12\\\" error=\\\"0\\\" /> <abundance value=\\\"0.9893\\\" error=\\\"0.0008\\\" /> </isotope> <isotope mass-number=\\\"13\\\"> <mass value=\\\"13.003354838\\\" error=\\\"0.000000005\\\" /> <abundance value=\\\"0.0107\\\" error=\\\"0.0008\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"N\\\" atomic-number=\\\"7\\\"> <natural-abundance> <mass value=\\\"14.0067\\\" error=\\\"0.0002\\\" /> <isotope mass-number=\\\"14\\\"> <mass value=\\\"14.0030740074\\\" error=\\\"0.0000000018\\\" /> <abundance value=\\\"0.99636\\\" error=\\\"0.00020\\\" /> </isotope> <isotope mass-number=\\\"15\\\"> <mass value=\\\"15.000108973\\\" error=\\\"0.000000012\\\" /> <abundance value=\\\"0.00364\\\" error=\\\"0.00020\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"O\\\" atomic-number=\\\"8\\\"> <natural-abundance> <mass value=\\\"15.9994\\\" error=\\\"0.0003\\\" /> <isotope mass-number=\\\"16\\\"> <mass value=\\\"15.9949146223\\\" error=\\\"0.0000000025\\\" /> <abundance value=\\\"0.99759\\\" error=\\\"0.00016\\\" /> </isotope> <isotope mass-number=\\\"17\\\"> <mass value=\\\"16.99913150\\\" error=\\\"0.00000022\\\" /> <abundance value=\\\"0.00038\\\" error=\\\"0.00001\\\" /> </isotope> <isotope mass-number=\\\"18\\\"> <mass value=\\\"17.9991604\\\" error=\\\"0.0000009\\\" /> <abundance value=\\\"0.00205\\\" error=\\\"0.00014\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"F\\\" atomic-number=\\\"9\\\"> <natural-abundance> <mass value=\\\"18.9984032\\\" error=\\\"0.0000005\\\" /> <isotope mass-number=\\\"19\\\"> <mass value=\\\"18.99840320\\\" error=\\\"0.00000007\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ne\\\" atomic-number=\\\"10\\\"> <natural-abundance> <mass value=\\\"20.1797\\\" error=\\\"0.0006\\\" /> <isotope mass-number=\\\"20\\\"> <mass value=\\\"19.992440176\\\" error=\\\"0.000000003\\\" /> <abundance value=\\\"0.9048\\\" error=\\\"0.0003\\\" /> </isotope> <isotope mass-number=\\\"21\\\"> <mass value=\\\"20.99384674\\\" error=\\\"0.00000004\\\" /> <abundance value=\\\"0.0027\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"22\\\"> <mass value=\\\"21.99138550\\\" error=\\\"0.00000025\\\" /> <abundance value=\\\"0.0925\\\" error=\\\"0.0003\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Na\\\" atomic-number=\\\"11\\\"> <natural-abundance> <mass value=\\\"22.989770\\\" error=\\\"0.000002\\\" /> <isotope mass-number=\\\"23\\\"> <mass value=\\\"22.98976966\\\" error=\\\"0.00000026\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Mg\\\" atomic-number=\\\"12\\\"> <natural-abundance> <mass value=\\\"24.3050\\\" error=\\\"0.0006\\\" /> <isotope mass-number=\\\"24\\\"> <mass value=\\\"23.98504187\\\" error=\\\"0.00000026\\\" /> <abundance value=\\\"0.7899\\\" error=\\\"0.0004\\\" /> </isotope> <isotope mass-number=\\\"25\\\"> <mass value=\\\"24.98583700\\\" error=\\\"0.00000026\\\" /> <abundance value=\\\"0.1000\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"26\\\"> <mass value=\\\"25.98259300\\\" error=\\\"0.00000026\\\" /> <abundance value=\\\"0.1101\\\" error=\\\"0.0003\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Al\\\" atomic-number=\\\"13\\\"> <natural-abundance> <mass value=\\\"26.981538\\\" error=\\\"0.000002\\\" /> <isotope mass-number=\\\"27\\\"> <mass value=\\\"26.98153841\\\" error=\\\"0.00000024\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Si\\\" atomic-number=\\\"14\\\"> <natural-abundance> <mass value=\\\"28.0855\\\" error=\\\"0.0003\\\" /> <isotope mass-number=\\\"28\\\"> <mass value=\\\"27.97692649\\\" error=\\\"0.00000022\\\" /> <abundance value=\\\"0.92223\\\" error=\\\"0.00019\\\" /> </isotope> <isotope mass-number=\\\"29\\\"> <mass value=\\\"28.97649468\\\" error=\\\"0.00000022\\\" /> <abundance value=\\\"0.04685\\\" error=\\\"0.00008\\\" /> </isotope> <isotope mass-number=\\\"30\\\"> <mass value=\\\"29.97377018\\\" error=\\\"0.00000022\\\" /> <abundance value=\\\"0.03092\\\" error=\\\"0.00011\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"P\\\" atomic-number=\\\"15\\\"> <natural-abundance> <mass value=\\\"30.973761\\\" error=\\\"0.000002\\\" /> <isotope mass-number=\\\"31\\\"> <mass value=\\\"30.97376149\\\" error=\\\"0.00000027\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"S\\\" atomic-number=\\\"16\\\"> <natural-abundance> <mass value=\\\"32.065\\\" error=\\\"0.005\\\" /> <isotope mass-number=\\\"32\\\"> <mass value=\\\"31.97207073\\\" error=\\\"0.00000015\\\" /> <abundance value=\\\"0.9499\\\" error=\\\"0.0026\\\" /> </isotope> <isotope mass-number=\\\"33\\\"> <mass value=\\\"32.97145854\\\" error=\\\"0.00000015\\\" /> <abundance value=\\\"0.0075\\\" error=\\\"0.0002\\\" /> </isotope> <isotope mass-number=\\\"34\\\"> <mass value=\\\"33.96786687\\\" error=\\\"0.00000014\\\" /> <abundance value=\\\"0.0425\\\" error=\\\"0.0024\\\" /> </isotope> <isotope mass-number=\\\"36\\\"> <mass value=\\\"35.96708088\\\" error=\\\"0.00000025\\\" /> <abundance value=\\\"0.0001\\\" error=\\\"0.0001\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Cl\\\" atomic-number=\\\"17\\\"> <natural-abundance> <mass value=\\\"35.453\\\" error=\\\"0.002\\\" /> <isotope mass-number=\\\"35\\\"> <mass value=\\\"34.96885271\\\" error=\\\"0.00000004\\\" /> <abundance value=\\\"0.7576\\\" error=\\\"0.0010\\\" /> </isotope> <isotope mass-number=\\\"37\\\"> <mass value=\\\"36.96590260\\\" error=\\\"0.00000005\\\" /> <abundance value=\\\"0.2424\\\" error=\\\"0.0010\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ar\\\" atomic-number=\\\"18\\\"> <natural-abundance> <mass value=\\\"39.948\\\" error=\\\"0.001\\\" /> <isotope mass-number=\\\"36\\\"> <mass value=\\\"35.96754626\\\" error=\\\"0.00000027\\\" /> <abundance value=\\\"0.0003365\\\" error=\\\"0.000030\\\" /> </isotope> <isotope mass-number=\\\"38\\\"> <mass value=\\\"37.9627322\\\" error=\\\"0.0000005\\\" /> <abundance value=\\\"0.000632\\\" error=\\\"0.000005\\\" /> </isotope> <isotope mass-number=\\\"40\\\"> <mass value=\\\"39.962383124\\\" error=\\\"0.000000005\\\" /> <abundance value=\\\"0.996003\\\" error=\\\"0.000030\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"K\\\" atomic-number=\\\"19\\\"> <natural-abundance> <mass value=\\\"39.0983\\\" error=\\\"0.0001\\\" /> <isotope mass-number=\\\"39\\\"> <mass value=\\\"38.9637069\\\" error=\\\"0.0000003\\\" /> <abundance value=\\\"0.932581\\\" error=\\\"0.000044\\\" /> </isotope> <isotope mass-number=\\\"40\\\"> <mass value=\\\"39.96399867\\\" error=\\\"0.00000029\\\" /> <abundance value=\\\"0.000117\\\" error=\\\"0.000001\\\" /> </isotope> <isotope mass-number=\\\"41\\\"> <mass value=\\\"40.96182597\\\" error=\\\"0.00000028\\\" /> <abundance value=\\\"0.067302\\\" error=\\\"0.000044\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ca\\\" atomic-number=\\\"20\\\"> <natural-abundance> <mass value=\\\"40.078\\\" error=\\\"0.004\\\" /> <isotope mass-number=\\\"40\\\"> <mass value=\\\"39.9625912\\\" error=\\\"0.0000003\\\" /> <abundance value=\\\"0.96941\\\" error=\\\"0.00156\\\" /> </isotope> <isotope mass-number=\\\"42\\\"> <mass value=\\\"41.9586183\\\" error=\\\"0.0000004\\\" /> <abundance value=\\\"0.00647\\\" error=\\\"0.00023\\\" /> </isotope> <isotope mass-number=\\\"43\\\"> <mass value=\\\"42.9587668\\\" error=\\\"0.0000005\\\" /> <abundance value=\\\"0.00135\\\" error=\\\"0.00010\\\" /> </isotope> <isotope mass-number=\\\"44\\\"> <mass value=\\\"43.9554811\\\" error=\\\"0.0000009\\\" /> <abundance value=\\\"0.02086\\\" error=\\\"0.00110\\\" /> </isotope> <isotope mass-number=\\\"46\\\"> <mass value=\\\"45.9536927\\\" error=\\\"0.0000025\\\" /> <abundance value=\\\"0.00004\\\" error=\\\"0.00003\\\" /> </isotope> <isotope mass-number=\\\"48\\\"> <mass value=\\\"47.952533\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.00187\\\" error=\\\"0.00021\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Sc\\\" atomic-number=\\\"21\\\"> <natural-abundance> <mass value=\\\"44.955910\\\" error=\\\"0.000008\\\" /> <isotope mass-number=\\\"45\\\"> <mass value=\\\"44.9559102\\\" error=\\\"0.0000012\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ti\\\" atomic-number=\\\"22\\\"> <natural-abundance> <mass value=\\\"47.867\\\" error=\\\"0.001\\\" /> <isotope mass-number=\\\"46\\\"> <mass value=\\\"45.9526295\\\" error=\\\"0.0000012\\\" /> <abundance value=\\\"0.0825\\\" error=\\\"0.0003\\\" /> </isotope> <isotope mass-number=\\\"47\\\"> <mass value=\\\"46.9517637\\\" error=\\\"0.0000010\\\" /> <abundance value=\\\"0.0744\\\" error=\\\"0.0002\\\" /> </isotope> <isotope mass-number=\\\"48\\\"> <mass value=\\\"47.9479470\\\" error=\\\"0.0000010\\\" /> <abundance value=\\\"0.7372\\\" error=\\\"0.0003\\\" /> </isotope> <isotope mass-number=\\\"49\\\"> <mass value=\\\"48.9478707\\\" error=\\\"0.0000010\\\" /> <abundance value=\\\"0.0541\\\" error=\\\"0.0002\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"V\\\" atomic-number=\\\"23\\\"> <natural-abundance> <mass value=\\\"50.9415\\\" error=\\\"0.0001\\\" /> <isotope mass-number=\\\"50\\\"> <mass value=\\\"49.9471627\\\" error=\\\"0.0000014\\\" /> <abundance value=\\\"0.00250\\\" error=\\\"0.00004\\\" /> </isotope> <isotope mass-number=\\\"51\\\"> <mass value=\\\"50.9439635\\\" error=\\\"0.0000014\\\" /> <abundance value=\\\"0.99750\\\" error=\\\"0.00004\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Cr\\\" atomic-number=\\\"24\\\"> <natural-abundance> <mass value=\\\"51.9961\\\" error=\\\"0.0006\\\" /> <isotope mass-number=\\\"50\\\"> <mass value=\\\"49.9460495\\\" error=\\\"0.0000014\\\" /> <abundance value=\\\"0.04345\\\" error=\\\"0.00013\\\" /> </isotope> <isotope mass-number=\\\"52\\\"> <mass value=\\\"51.9405115\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.83789\\\" error=\\\"0.00018\\\" /> </isotope> <isotope mass-number=\\\"53\\\"> <mass value=\\\"52.9406534\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.09501\\\" error=\\\"0.00017\\\" /> </isotope> <isotope mass-number=\\\"54\\\"> <mass value=\\\"53.938846\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.02365\\\" error=\\\"0.00007\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Mn\\\" atomic-number=\\\"25\\\"> <natural-abundance> <mass value=\\\"54.938049\\\" error=\\\"0.000009\\\" /> <isotope mass-number=\\\"55\\\"> <mass value=\\\"54.9380493\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Fe\\\" atomic-number=\\\"26\\\"> <natural-abundance> <mass value=\\\"55.845\\\" error=\\\"0.002\\\" /> <isotope mass-number=\\\"54\\\"> <mass value=\\\"53.9396147\\\" error=\\\"0.0000014\\\" /> <abundance value=\\\"0.05845\\\" error=\\\"0.00035\\\" /> </isotope> <isotope mass-number=\\\"56\\\"> <mass value=\\\"55.9349418\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.91754\\\" error=\\\"0.00036\\\" /> </isotope> <isotope mass-number=\\\"57\\\"> <mass value=\\\"56.9353983\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.02119\\\" error=\\\"0.00010\\\" /> </isotope> <isotope mass-number=\\\"58\\\"> <mass value=\\\"57.9332801\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.00282\\\" error=\\\"0.00004\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Co\\\" atomic-number=\\\"27\\\"> <natural-abundance> <mass value=\\\"58.933200\\\" error=\\\"0.000009\\\" /> <isotope mass-number=\\\"59\\\"> <mass value=\\\"59.9331999\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ni\\\" atomic-number=\\\"28\\\"> <natural-abundance> <mass value=\\\"58.6934\\\" error=\\\"0.0002\\\" /> <isotope mass-number=\\\"58\\\"> <mass value=\\\"57.9353477\\\" error=\\\"0.0000016\\\" /> <abundance value=\\\"0.680769\\\" error=\\\"0.000089\\\" /> </isotope> <isotope mass-number=\\\"60\\\"> <mass value=\\\"59.9307903\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.262231\\\" error=\\\"0.000077\\\" /> </isotope> <isotope mass-number=\\\"61\\\"> <mass value=\\\"60.9310601\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.011399\\\" error=\\\"0.000006\\\" /> </isotope> <isotope mass-number=\\\"62\\\"> <mass value=\\\"61.9283484\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.0036345\\\" error=\\\"0.000017\\\" /> </isotope> <isotope mass-number=\\\"64\\\"> <mass value=\\\"63.9279692\\\" error=\\\"0.0000016\\\" /> <abundance value=\\\"0.009256\\\" error=\\\"0.000009\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Cu\\\" atomic-number=\\\"29\\\"> <natural-abundance> <mass value=\\\"63.546\\\" error=\\\"0.003\\\" /> <isotope mass-number=\\\"63\\\"> <mass value=\\\"62.9296007\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.6915\\\" error=\\\"0.0015\\\" /> </isotope> <isotope mass-number=\\\"65\\\"> <mass value=\\\"64.9277938\\\" error=\\\"0.0000019\\\" /> <abundance value=\\\"0.3085\\\" error=\\\"0.0015\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Zn\\\" atomic-number=\\\"30\\\"> <natural-abundance> <mass value=\\\"65.409\\\" error=\\\"0.004\\\" /> <isotope mass-number=\\\"64\\\"> <mass value=\\\"63.9291461\\\" error=\\\"0.0000018\\\" /> <abundance value=\\\"0.48268\\\" error=\\\"0.00321\\\" /> </isotope> <isotope mass-number=\\\"66\\\"> <mass value=\\\"65.9260364\\\" error=\\\"0.0000017\\\" /> <abundance value=\\\"0.27975\\\" error=\\\"0.00077\\\" /> </isotope> <isotope mass-number=\\\"67\\\"> <mass value=\\\"66.9271305\\\" error=\\\"0.0000017\\\" /> <abundance value=\\\"0.04102\\\" error=\\\"0.00021\\\" /> </isotope> <isotope mass-number=\\\"68\\\"> <mass value=\\\"67.9248473\\\" error=\\\"0.0000017\\\" /> <abundance value=\\\"0.19024\\\" error=\\\"0.00123\\\" /> </isotope> <isotope mass-number=\\\"70\\\"> <mass value=\\\"69.925325\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.00631\\\" error=\\\"0.00009\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ga\\\" atomic-number=\\\"31\\\"> <natural-abundance> <mass value=\\\"69.723\\\" error=\\\"0.001\\\" /> <isotope mass-number=\\\"69\\\"> <mass value=\\\"68.925581\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.60108\\\" error=\\\"0.00009\\\" /> </isotope> <isotope mass-number=\\\"71\\\"> <mass value=\\\"70.9247073\\\" error=\\\"0.0000020\\\" /> <abundance value=\\\"0.39892\\\" error=\\\"0.00009\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ge\\\" atomic-number=\\\"32\\\"> <natural-abundance> <mass value=\\\"72.64\\\" error=\\\"0.01\\\" /> <isotope mass-number=\\\"70\\\"> <mass value=\\\"69.9242500\\\" error=\\\"0.0000019\\\" /> <abundance value=\\\"0.2038\\\" error=\\\"0.0018\\\" /> </isotope> <isotope mass-number=\\\"72\\\"> <mass value=\\\"71.9220763\\\" error=\\\"0.0000016\\\" /> <abundance value=\\\"0.2731\\\" error=\\\"0.0026\\\" /> </isotope> <isotope mass-number=\\\"73\\\"> <mass value=\\\"72.9234595\\\" error=\\\"0.0000016\\\" /> <abundance value=\\\"0.0776\\\" error=\\\"0.0008\\\" /> </isotope> <isotope mass-number=\\\"74\\\"> <mass value=\\\"73.9211784\\\" error=\\\"0.0000016\\\" /> <abundance value=\\\"0.3672\\\" error=\\\"0.0015\\\" /> </isotope> <isotope mass-number=\\\"76\\\"> <mass value=\\\"75.9214029\\\" error=\\\"0.0000016\\\" /> <abundance value=\\\"0.0783\\\" error=\\\"0.0007\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"As\\\" atomic-number=\\\"33\\\"> <natural-abundance> <mass value=\\\"74.92160\\\" error=\\\"0.00002\\\" /> <isotope mass-number=\\\"75\\\"> <mass value=\\\"74.9215966\\\" error=\\\"0.0000018\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Se\\\" atomic-number=\\\"34\\\"> <natural-abundance> <mass value=\\\"78.96\\\" error=\\\"0.03\\\" /> <isotope mass-number=\\\"74\\\"> <mass value=\\\"73.9224767\\\" error=\\\"0.0000016\\\" /> <abundance value=\\\"0.0089\\\" error=\\\"0.0004\\\" /> </isotope> <isotope mass-number=\\\"76\\\"> <mass value=\\\"75.9192143\\\" error=\\\"0.0000016\\\" /> <abundance value=\\\"0.0937\\\" error=\\\"0.0029\\\" /> </isotope> <isotope mass-number=\\\"77\\\"> <mass value=\\\"76.9199148\\\" error=\\\"0.0000016\\\" /> <abundance value=\\\"0.0763\\\" error=\\\"0.0016\\\" /> </isotope> <isotope mass-number=\\\"78\\\"> <mass value=\\\"77.9173097\\\" error=\\\"0.0000016\\\" /> <abundance value=\\\"0.2377\\\" error=\\\"0.0028\\\" /> </isotope> <isotope mass-number=\\\"80\\\"> <mass value=\\\"79.9165221\\\" error=\\\"0.0000020\\\" /> <abundance value=\\\"0.4961\\\" error=\\\"0.0041\\\" /> </isotope> <isotope mass-number=\\\"82\\\"> <mass value=\\\"81.9167003\\\" error=\\\"0.0000022\\\" /> <abundance value=\\\"0.0873\\\" error=\\\"0.0022\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Br\\\" atomic-number=\\\"35\\\"> <natural-abundance> <mass value=\\\"79.904\\\" error=\\\"0.001\\\" /> <isotope mass-number=\\\"79\\\"> <mass value=\\\"78.9183379\\\" error=\\\"0.0000020\\\" /> <abundance value=\\\"0.5069\\\" error=\\\"0.0007\\\" /> </isotope> <isotope mass-number=\\\"81\\\"> <mass value=\\\"80.916291\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.4931\\\" error=\\\"0.0007\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Kr\\\" atomic-number=\\\"36\\\"> <natural-abundance> <mass value=\\\"83.798\\\" error=\\\"0.002\\\" /> <isotope mass-number=\\\"78\\\"> <mass value=\\\"77.920388\\\" error=\\\"0.000007\\\" /> <abundance value=\\\"0.00355\\\" error=\\\"0.00003\\\" /> </isotope> <isotope mass-number=\\\"80\\\"> <mass value=\\\"79.916379\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.02286\\\" error=\\\"0.00010\\\" /> </isotope> <isotope mass-number=\\\"82\\\"> <mass value=\\\"81.9134850\\\" error=\\\"0.0000028\\\" /> <abundance value=\\\"0.11593\\\" error=\\\"0.00031\\\" /> </isotope> <isotope mass-number=\\\"83\\\"> <mass value=\\\"82.914137\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.11500\\\" error=\\\"0.00019\\\" /> </isotope> <isotope mass-number=\\\"84\\\"> <mass value=\\\"83.911508\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.56987\\\" error=\\\"0.00015\\\" /> </isotope> <isotope mass-number=\\\"86\\\"> <mass value=\\\"85.910615\\\" error=\\\"0.000005\\\" /> <abundance value=\\\"0.17279\\\" error=\\\"0.00041\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Rb\\\" atomic-number=\\\"37\\\"> <natural-abundance> <mass value=\\\"85.4678\\\" error=\\\"0.0003\\\" /> <isotope mass-number=\\\"85\\\"> <mass value=\\\"84.9117924\\\" error=\\\"0.0000027\\\" /> <abundance value=\\\"0.7217\\\" error=\\\"0.0002\\\" /> </isotope> <isotope mass-number=\\\"87\\\"> <mass value=\\\"86.9091858\\\" error=\\\"0.0000028\\\" /> <abundance value=\\\"0.2783\\\" error=\\\"0.0002\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Sr\\\" atomic-number=\\\"38\\\"> <natural-abundance> <mass value=\\\"87.62\\\" error=\\\"0.01\\\" /> <isotope mass-number=\\\"84\\\"> <mass value=\\\"83.913426\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.0056\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"86\\\"> <mass value=\\\"85.9092647\\\" error=\\\"0.0000025\\\" /> <abundance value=\\\"0.0986\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"87\\\"> <mass value=\\\"86.9088816\\\" error=\\\"0.0000025\\\" /> <abundance value=\\\"0.0700\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"88\\\"> <mass value=\\\"87.9056167\\\" error=\\\"0.0000025\\\" /> <abundance value=\\\"0.8258\\\" error=\\\"0.0001\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Y\\\" atomic-number=\\\"39\\\"> <natural-abundance> <mass value=\\\"88.90585\\\" error=\\\"0.00002\\\" /> <isotope mass-number=\\\"89\\\"> <mass value=\\\"88.9058485\\\" error=\\\"0.0000026\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Zr\\\" atomic-number=\\\"40\\\"> <natural-abundance> <mass value=\\\"91.224\\\" error=\\\"0.002\\\" /> <isotope mass-number=\\\"90\\\"> <mass value=\\\"89.9047022\\\" error=\\\"0.0000024\\\" /> <abundance value=\\\"0.5145\\\" error=\\\"0.0040\\\" /> </isotope> <isotope mass-number=\\\"91\\\"> <mass value=\\\"90.9056434\\\" error=\\\"0.0000023\\\" /> <abundance value=\\\"0.1122\\\" error=\\\"0.0005\\\" /> </isotope> <isotope mass-number=\\\"92\\\"> <mass value=\\\"91.9050386\\\" error=\\\"0.0000023\\\" /> <abundance value=\\\"0.1715\\\" error=\\\"0.0008\\\" /> </isotope> <isotope mass-number=\\\"94\\\"> <mass value=\\\"93.9063144\\\" error=\\\"0.0000026\\\" /> <abundance value=\\\"0.1738\\\" error=\\\"0.0028\\\" /> </isotope> <isotope mass-number=\\\"96\\\"> <mass value=\\\"95.908275\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0280\\\" error=\\\"0.0009\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Nb\\\" atomic-number=\\\"41\\\"> <natural-abundance> <mass value=\\\"92.90638\\\" error=\\\"0.00002\\\" /> <isotope mass-number=\\\"93\\\"> <mass value=\\\"92.9063762\\\" error=\\\"0.0000024\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Mo\\\" atomic-number=\\\"42\\\"> <natural-abundance> <mass value=\\\"95.94\\\" error=\\\"0.02\\\" /> <isotope mass-number=\\\"92\\\"> <mass value=\\\"91.906810\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.1477\\\" error=\\\"0.0031\\\" /> </isotope> <isotope mass-number=\\\"94\\\"> <mass value=\\\"93.9050867\\\" error=\\\"0.0000020\\\" /> <abundance value=\\\"0.0923\\\" error=\\\"0.0010\\\" /> </isotope> <isotope mass-number=\\\"95\\\"> <mass value=\\\"94.9058406\\\" error=\\\"0.0000020\\\" /> <abundance value=\\\"0.1590\\\" error=\\\"0.0009\\\" /> </isotope> <isotope mass-number=\\\"96\\\"> <mass value=\\\"95.9046780\\\" error=\\\"0.0000020\\\" /> <abundance value=\\\"0.1668\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"97\\\"> <mass value=\\\"96.9030201\\\" error=\\\"0.0000020\\\" /> <abundance value=\\\"0.0956\\\" error=\\\"0.0005\\\" /> </isotope> <isotope mass-number=\\\"98\\\"> <mass value=\\\"97.9054069\\\" error=\\\"0.0000020\\\" /> <abundance value=\\\"0.2419\\\" error=\\\"0.0026\\\" /> </isotope> <isotope mass-number=\\\"100\\\"> <mass value=\\\"99.907476\\\" error=\\\"0.000006\\\" /> <abundance value=\\\"0.0967\\\" error=\\\"0.0020\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ru\\\" atomic-number=\\\"44\\\"> <natural-abundance> <mass value=\\\"101.07\\\" error=\\\"0.02\\\" /> <isotope mass-number=\\\"96\\\"> <mass value=\\\"95.907604\\\" error=\\\"0.000009\\\" /> <abundance value=\\\"0.0554\\\" error=\\\"0.0014\\\" /> </isotope> <isotope mass-number=\\\"98\\\"> <mass value=\\\"97.905287\\\" error=\\\"0.000007\\\" /> <abundance value=\\\"0.0187\\\" error=\\\"0.0003\\\" /> </isotope> <isotope mass-number=\\\"99\\\"> <mass value=\\\"98.9059385\\\" error=\\\"0.0000022\\\" /> <abundance value=\\\".01276\\\" error=\\\"0.0014\\\" /> </isotope> <isotope mass-number=\\\"100\\\"> <mass value=\\\"99.9042189\\\" error=\\\"0.0000022\\\" /> <abundance value=\\\"0.1260\\\" error=\\\"0.0007\\\" /> </isotope> <isotope mass-number=\\\"101\\\"> <mass value=\\\"100.9055815\\\" error=\\\"0.0000022\\\" /> <abundance value=\\\"0.1706\\\" error=\\\"0.0002\\\" /> </isotope> <isotope mass-number=\\\"102\\\"> <mass value=\\\"101.9043488\\\" error=\\\"0.0000022\\\" /> <abundance value=\\\"0.3155\\\" error=\\\"0.0014\\\" /> </isotope> <isotope mass-number=\\\"104\\\"> <mass value=\\\"103.905430\\\" error=\\\".01862\\\" /> <abundance value=\\\"0.1862\\\" error=\\\"0.0027\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Rh\\\" atomic-number=\\\"45\\\"> <natural-abundance> <mass value=\\\"1025.90550\\\" error=\\\"0.00002\\\" /> <isotope mass-number=\\\"103\\\"> <mass value=\\\"102.905504\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Pd\\\" atomic-number=\\\"46\\\"> <natural-abundance> <mass value=\\\"106.42\\\" error=\\\"0.01\\\" /> <isotope mass-number=\\\"102\\\"> <mass value=\\\"101.905607\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0102\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"104\\\"> <mass value=\\\"103.904034\\\" error=\\\"0.000005\\\" /> <abundance value=\\\"0.1114\\\" error=\\\"0.0008\\\" /> </isotope> <isotope mass-number=\\\"105\\\"> <mass value=\\\"104.905083\\\" error=\\\"0.000005\\\" /> <abundance value=\\\"0.2233\\\" error=\\\"0.0008\\\" /> </isotope> <isotope mass-number=\\\"106\\\"> <mass value=\\\"105.903484\\\" error=\\\"0.000005\\\" /> <abundance value=\\\"0.2733\\\" error=\\\"0.0003\\\" /> </isotope> <isotope mass-number=\\\"108\\\"> <mass value=\\\"107.903895\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.2646\\\" error=\\\"0.0009\\\" /> </isotope> <isotope mass-number=\\\"110\\\"> <mass value=\\\"109.905153\\\" error=\\\"0.000012\\\" /> <abundance value=\\\"0.1172\\\" error=\\\"0.0009\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ag\\\" atomic-number=\\\"47\\\"> <natural-abundance> <mass value=\\\"107.8682\\\" error=\\\"0.0002\\\" /> <isotope mass-number=\\\"107\\\"> <mass value=\\\"106.905093\\\" error=\\\"0.000006\\\" /> <abundance value=\\\"0.51839\\\" error=\\\"0.00008\\\" /> </isotope> <isotope mass-number=\\\"109\\\"> <mass value=\\\"108.904756\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.48161\\\" error=\\\"0.00008\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Cd\\\" atomic-number=\\\"48\\\"> <natural-abundance> <mass value=\\\"112.411\\\" error=\\\"0.008\\\" /> <isotope mass-number=\\\"106\\\"> <mass value=\\\"105.906458\\\" error=\\\"0.000006\\\" /> <abundance value=\\\"0.0125\\\" error=\\\"0.0006\\\" /> </isotope> <isotope mass-number=\\\"108\\\"> <mass value=\\\"107.904183\\\" error=\\\"0.000006\\\" /> <abundance value=\\\"0.0089\\\" error=\\\"0.0003\\\" /> </isotope> <isotope mass-number=\\\"110\\\"> <mass value=\\\"109.903006\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1249\\\" error=\\\"0.0018\\\" /> </isotope> <isotope mass-number=\\\"111\\\"> <mass value=\\\"110.904182\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1280\\\" error=\\\"0.0012\\\" /> </isotope> <isotope mass-number=\\\"112\\\"> <mass value=\\\"111.9027577\\\" error=\\\"0.0000030\\\" /> <abundance value=\\\"0.2413\\\" error=\\\"0.0021\\\" /> </isotope> <isotope mass-number=\\\"113\\\"> <mass value=\\\"112.9044014\\\" error=\\\"0.0000030\\\" /> <abundance value=\\\"0.1222\\\" error=\\\"0.0012\\\" /> </isotope> <isotope mass-number=\\\"114\\\"> <mass value=\\\"113.9033586\\\" error=\\\"0.0000030\\\" /> <abundance value=\\\"0.2873\\\" error=\\\"0.0042\\\" /> </isotope> <isotope mass-number=\\\"116\\\"> <mass value=\\\"115.904756\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0749\\\" error=\\\"0.0018\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"In\\\" atomic-number=\\\"49\\\"> <natural-abundance> <mass value=\\\"114.818\\\" error=\\\"0.003\\\" /> <isotope mass-number=\\\"113\\\"> <mass value=\\\"112.904062\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.0429\\\" error=\\\"0.0005\\\" /> </isotope> <isotope mass-number=\\\"115\\\"> <mass value=\\\"114.903879\\\" error=\\\"0.000040\\\" /> <abundance value=\\\"0.9571\\\" error=\\\"0.0005\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Sn\\\" atomic-number=\\\"50\\\"> <natural-abundance> <mass value=\\\"118.710\\\" error=\\\"0.007\\\" /> <isotope mass-number=\\\"112\\\"> <mass value=\\\"111.904822\\\" error=\\\"0.000005\\\" /> <abundance value=\\\"0.0097\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"114\\\"> <mass value=\\\"113.902783\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0066\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"115\\\"> <mass value=\\\"114.903347\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0034\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"116\\\"> <mass value=\\\"115.901745\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1454\\\" error=\\\"0.0009\\\" /> </isotope> <isotope mass-number=\\\"117\\\"> <mass value=\\\"116.902955\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0768\\\" error=\\\"0.0007\\\" /> </isotope> <isotope mass-number=\\\"118\\\"> <mass value=\\\"117.901608\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.2422\\\" error=\\\"0.0009\\\" /> </isotope> <isotope mass-number=\\\"119\\\"> <mass value=\\\"118.903311\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0859\\\" error=\\\"0.0004\\\" /> </isotope> <isotope mass-number=\\\"120\\\"> <mass value=\\\"119.9021985\\\" error=\\\"0.0000027\\\" /> <abundance value=\\\"0.3258\\\" error=\\\"0.0009\\\" /> </isotope> <isotope mass-number=\\\"122\\\"> <mass value=\\\"121.9034411\\\" error=\\\"0.0000029\\\" /> <abundance value=\\\"0.0463\\\" error=\\\"0.0003\\\" /> </isotope> <isotope mass-number=\\\"124\\\"> <mass value=\\\"123.9052745\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.0579\\\" error=\\\"0.0005\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Sb\\\" atomic-number=\\\"51\\\"> <natural-abundance> <mass value=\\\"121.760\\\" error=\\\"0.001\\\" /> <isotope mass-number=\\\"121\\\"> <mass value=\\\"120.9038222\\\" error=\\\"0.0000026\\\" /> <abundance value=\\\"0.5721\\\" error=\\\"0.0005\\\" /> </isotope> <isotope mass-number=\\\"123\\\"> <mass value=\\\"122.9042160\\\" error=\\\"0.0000022\\\" /> <abundance value=\\\"0.4279\\\" error=\\\"0.0005\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Te\\\" atomic-number=\\\"52\\\"> <natural-abundance> <mass value=\\\"127.60\\\" error=\\\"0.03\\\" /> <isotope mass-number=\\\"120\\\"> <mass value=\\\"119.904026\\\" error=\\\"0.000011\\\" /> <abundance value=\\\"0.0009\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"122\\\"> <mass value=\\\"121.9030558\\\" error=\\\"0.0000029\\\" /> <abundance value=\\\"0.0255\\\" error=\\\"0.0012\\\" /> </isotope> <isotope mass-number=\\\"123\\\"> <mass value=\\\"122.9042711\\\" error=\\\"0.0000020\\\" /> <abundance value=\\\"0.0089\\\" error=\\\"0.0003\\\" /> </isotope> <isotope mass-number=\\\"124\\\"> <mass value=\\\"123.9028188\\\" error=\\\"0.0000016\\\" /> <abundance value=\\\"0.0474\\\" error=\\\"0.0014\\\" /> </isotope> <isotope mass-number=\\\"125\\\"> <mass value=\\\"124.9044241\\\" error=\\\"0.0000020\\\" /> <abundance value=\\\"0.0707\\\" error=\\\"0.0015\\\" /> </isotope> <isotope mass-number=\\\"126\\\"> <mass value=\\\"125.9033049\\\" error=\\\"0.0000020\\\" /> <abundance value=\\\"0.1884\\\" error=\\\"0.0025\\\" /> </isotope> <isotope mass-number=\\\"128\\\"> <mass value=\\\"127.9044615\\\" error=\\\"0.0000019\\\" /> <abundance value=\\\"0.3174\\\" error=\\\"0.0008\\\" /> </isotope> <isotope mass-number=\\\"130\\\"> <mass value=\\\"129.9062229\\\" error=\\\"0.0000021\\\" /> <abundance value=\\\"0.3408\\\" error=\\\"0.0062\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"I\\\" atomic-number=\\\"53\\\"> <natural-abundance> <mass value=\\\"126.90447\\\" error=\\\"0.00003\\\" /> <isotope mass-number=\\\"127\\\"> <mass value=\\\"126.904468\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Xe\\\" atomic-number=\\\"54\\\"> <natural-abundance> <mass value=\\\"131.293\\\" error=\\\"0.006\\\" /> <isotope mass-number=\\\"124\\\"> <mass value=\\\"123.9058954\\\" error=\\\"0.0000021\\\" /> <abundance value=\\\"0.000952\\\" error=\\\"0.000003\\\" /> </isotope> <isotope mass-number=\\\"126\\\"> <mass value=\\\"125.904268\\\" error=\\\"0.000007\\\" /> <abundance value=\\\"0.000890\\\" error=\\\"0.000002\\\" /> </isotope> <isotope mass-number=\\\"128\\\"> <mass value=\\\"127.9035305\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.019102\\\" error=\\\"0.000008\\\" /> </isotope> <isotope mass-number=\\\"129\\\"> <mass value=\\\"128.9047799\\\" error=\\\"0.0000009\\\" /> <abundance value=\\\"0.264006\\\" error=\\\"0.000082\\\" /> </isotope> <isotope mass-number=\\\"130\\\"> <mass value=\\\"129.9035089\\\" error=\\\"0.0000011\\\" /> <abundance value=\\\"0.040710\\\" error=\\\"0.000013\\\" /> </isotope> <isotope mass-number=\\\"131\\\"> <mass value=\\\"130.9050828\\\" error=\\\"0.0000018\\\" /> <abundance value=\\\"0.212324\\\" error=\\\"0.000030\\\" /> </isotope> <isotope mass-number=\\\"132\\\"> <mass value=\\\"131.9041546\\\" error=\\\"0.0000015\\\" /> <abundance value=\\\"0.269086\\\" error=\\\"0.000033\\\" /> </isotope> <isotope mass-number=\\\"134\\\"> <mass value=\\\"133.9053945\\\" error=\\\"0.0000009\\\" /> <abundance value=\\\"0.104357\\\" error=\\\"0.000021\\\" /> </isotope> <isotope mass-number=\\\"136\\\"> <mass value=\\\"135.907220\\\" error=\\\"0.000008\\\" /> <abundance value=\\\"0.088573\\\" error=\\\"0.000044\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Cs\\\" atomic-number=\\\"55\\\"> <natural-abundance> <mass value=\\\"132.90545\\\" error=\\\"0.00002\\\" /> <isotope mass-number=\\\"133\\\"> <mass value=\\\"132.905447\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ba\\\" atomic-number=\\\"56\\\"> <natural-abundance> <mass value=\\\"137.327\\\" error=\\\"0.007\\\" /> <isotope mass-number=\\\"130\\\"> <mass value=\\\"129.906311\\\" error=\\\"0.000007\\\" /> <abundance value=\\\"0.00106\\\" error=\\\"0.00001\\\" /> </isotope> <isotope mass-number=\\\"132\\\"> <mass value=\\\"131.905056\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.00101\\\" error=\\\"0.00001\\\" /> </isotope> <isotope mass-number=\\\"134\\\"> <mass value=\\\"133.904504\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.02417\\\" error=\\\"0.00018\\\" /> </isotope> <isotope mass-number=\\\"135\\\"> <mass value=\\\"134.905684\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.000003\\\" error=\\\"0.00012\\\" /> </isotope> <isotope mass-number=\\\"136\\\"> <mass value=\\\"135.904571\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.07854\\\" error=\\\"0.00024\\\" /> </isotope> <isotope mass-number=\\\"137\\\"> <mass value=\\\"136.905822\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.11232\\\" error=\\\"0.00024\\\" /> </isotope> <isotope mass-number=\\\"138\\\"> <mass value=\\\"137.905242\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.71698\\\" error=\\\"0.00042\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"La\\\" atomic-number=\\\"57\\\"> <natural-abundance> <mass value=\\\"138.9055\\\" error=\\\"0.0002\\\" /> <isotope mass-number=\\\"138\\\"> <mass value=\\\"137.907108\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.00090\\\" error=\\\"0.00001\\\" /> </isotope> <isotope mass-number=\\\"139\\\"> <mass value=\\\"138.906349\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.99910\\\" error=\\\"0.00001\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ce\\\" atomic-number=\\\"58\\\"> <natural-abundance> <mass value=\\\"140.116\\\" error=\\\"0.001\\\" /> <isotope mass-number=\\\"136\\\"> <mass value=\\\"135.907140\\\" error=\\\"0.000050\\\" /> <abundance value=\\\"0.00185\\\" error=\\\"0.00002\\\" /> </isotope> <isotope mass-number=\\\"138\\\"> <mass value=\\\"137.905986\\\" error=\\\"0.000011\\\" /> <abundance value=\\\"0.00251\\\" error=\\\"0.00002\\\" /> </isotope> <isotope mass-number=\\\"140\\\"> <mass value=\\\"139.905\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.88450\\\" error=\\\"0.00051\\\" /> </isotope> <isotope mass-number=\\\"142\\\"> <mass value=\\\"141.909241\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.11114\\\" error=\\\"0.00051\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Pr\\\" atomic-number=\\\"59\\\"> <natural-abundance> <mass value=\\\"140.90765\\\" error=\\\"0.00002\\\" /> <isotope mass-number=\\\"141\\\"> <mass value=\\\"140.907648\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Nd\\\" atomic-number=\\\"60\\\"> <natural-abundance> <mass value=\\\"144.24\\\" error=\\\"0.03\\\" /> <isotope mass-number=\\\"142\\\"> <mass value=\\\"141.907719\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.272\\\" error=\\\"0.005\\\" /> </isotope> <isotope mass-number=\\\"143\\\"> <mass value=\\\"142.909810\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.122\\\" error=\\\"0.002\\\" /> </isotope> <isotope mass-number=\\\"144\\\"> <mass value=\\\"143.910083\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.238\\\" error=\\\"0.003\\\" /> </isotope> <isotope mass-number=\\\"145\\\"> <mass value=\\\"144.912569\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.083\\\" error=\\\"0.001\\\" /> </isotope> <isotope mass-number=\\\"146\\\"> <mass value=\\\"145.913113\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.172\\\" error=\\\"0.003\\\" /> </isotope> <isotope mass-number=\\\"148\\\"> <mass value=\\\"147.916889\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.057\\\" error=\\\"0.001\\\" /> </isotope> <isotope mass-number=\\\"150\\\"> <mass value=\\\"149.920887\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.056\\\" error=\\\"0.002\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Sm\\\" atomic-number=\\\"62\\\"> <natural-abundance> <mass value=\\\"150.36\\\" error=\\\"0.03\\\" /> <isotope mass-number=\\\"144\\\"> <mass value=\\\"143.911996\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.0307\\\" error=\\\"0.0007\\\" /> </isotope> <isotope mass-number=\\\"147\\\"> <mass value=\\\"146.914894\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1499\\\" error=\\\"0.0018\\\" /> </isotope> <isotope mass-number=\\\"148\\\"> <mass value=\\\"147.914818\\\" error=\\\"0.1124\\\" /> <abundance value=\\\"0.1124\\\" error=\\\"0.0010\\\" /> </isotope> <isotope mass-number=\\\"149\\\"> <mass value=\\\"148.917180\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1382\\\" error=\\\"0.0007\\\" /> </isotope> <isotope mass-number=\\\"150\\\"> <mass value=\\\"149.917272\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0738\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"152\\\"> <mass value=\\\"151.919729\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.2675\\\" error=\\\"0.0016\\\" /> </isotope> <isotope mass-number=\\\"154\\\"> <mass value=\\\"153.922206\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.2275\\\" error=\\\"0.0029\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Eu\\\" atomic-number=\\\"63\\\"> <natural-abundance> <mass value=\\\"151.964\\\" error=\\\"0.001\\\" /> <isotope mass-number=\\\"151\\\"> <mass value=\\\"150.919846\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.4781\\\" error=\\\"0.0006\\\" /> </isotope> <isotope mass-number=\\\"153\\\"> <mass value=\\\"152.921227\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.5219\\\" error=\\\"0.0006\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Gd\\\" atomic-number=\\\"64\\\"> <natural-abundance> <mass value=\\\"157.25\\\" error=\\\"0.03\\\" /> <isotope mass-number=\\\"152\\\"> <mass value=\\\"151.919789\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0020\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"154\\\"> <mass value=\\\"153.920862\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0218\\\" error=\\\"0.0003\\\" /> </isotope> <isotope mass-number=\\\"155\\\"> <mass value=\\\"154.922619\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1480\\\" error=\\\"0.0012\\\" /> </isotope> <isotope mass-number=\\\"156\\\"> <mass value=\\\"155.922120\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.2047\\\" error=\\\"0.0009\\\" /> </isotope> <isotope mass-number=\\\"157\\\"> <mass value=\\\"156.923957\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1565\\\" error=\\\"0.0002\\\" /> </isotope> <isotope mass-number=\\\"158\\\"> <mass value=\\\"157.924101\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.2484\\\" error=\\\"0.0007\\\" /> </isotope> <isotope mass-number=\\\"160\\\"> <mass value=\\\"159.927051\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.2186\\\" error=\\\"0.0019\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Tb\\\" atomic-number=\\\"65\\\"> <natural-abundance> <mass value=\\\"158.92534\\\" error=\\\"0.00002\\\" /> <isotope mass-number=\\\"159\\\"> <mass value=\\\"158.925343\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Dy\\\" atomic-number=\\\"66\\\"> <natural-abundance> <mass value=\\\"162.500\\\" error=\\\"0.001\\\" /> <isotope mass-number=\\\"156\\\"> <mass value=\\\"155.924278\\\" error=\\\"0.000007\\\" /> <abundance value=\\\"0.00056\\\" error=\\\"0.00003\\\" /> </isotope> <isotope mass-number=\\\"158\\\"> <mass value=\\\"157.924405\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.00095\\\" error=\\\"0.00003\\\" /> </isotope> <isotope mass-number=\\\"160\\\"> <mass value=\\\"159.925194\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.02329\\\" error=\\\"0.00018\\\" /> </isotope> <isotope mass-number=\\\"161\\\"> <mass value=\\\"160.926930\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.18889\\\" error=\\\"0.00042\\\" /> </isotope> <isotope mass-number=\\\"162\\\"> <mass value=\\\"161.926795\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.25475\\\" error=\\\"0.00036\\\" /> </isotope> <isotope mass-number=\\\"163\\\"> <mass value=\\\"162.928728\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.24896\\\" error=\\\"0.00042\\\" /> </isotope> <isotope mass-number=\\\"164\\\"> <mass value=\\\"163.929171\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.28260\\\" error=\\\"0.00054\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ho\\\" atomic-number=\\\"67\\\"> <natural-abundance> <mass value=\\\"164.93032\\\" error=\\\"0.00002\\\" /> <isotope mass-number=\\\"165\\\"> <mass value=\\\"164.930319\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Er\\\" atomic-number=\\\"68\\\"> <natural-abundance> <mass value=\\\"167.259\\\" error=\\\"0.003\\\" /> <isotope mass-number=\\\"162\\\"> <mass value=\\\"161.928775\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.00139\\\" error=\\\"0.00005\\\" /> </isotope> <isotope mass-number=\\\"164\\\"> <mass value=\\\"163.929197\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.01601\\\" error=\\\"0.00003\\\" /> </isotope> <isotope mass-number=\\\"166\\\"> <mass value=\\\"165.930290\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.33503\\\" error=\\\"0.00036\\\" /> </isotope> <isotope mass-number=\\\"167\\\"> <mass value=\\\"166.932046\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.22869\\\" error=\\\"0.00009\\\" /> </isotope> <isotope mass-number=\\\"168\\\"> <mass value=\\\"167.932368\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.26978\\\" error=\\\"0.00018\\\" /> </isotope> <isotope mass-number=\\\"170\\\"> <mass value=\\\"169.935461\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.14910\\\" error=\\\"0.00036\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Tm\\\" atomic-number=\\\"69\\\"> <natural-abundance> <mass value=\\\"168.93421\\\" error=\\\"0.00002\\\" /> <isotope mass-number=\\\"169\\\"> <mass value=\\\"168.934211\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Yb\\\" atomic-number=\\\"70\\\"> <natural-abundance> <mass value=\\\"173.04\\\" error=\\\"0.03\\\" /> <isotope mass-number=\\\"168\\\"> <mass value=\\\"167.933895\\\" error=\\\"0.000005\\\" /> <abundance value=\\\"0.0013\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"170\\\"> <mass value=\\\"169.934759\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0304\\\" error=\\\"0.0015\\\" /> </isotope> <isotope mass-number=\\\"171\\\"> <mass value=\\\"170.936323\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1428\\\" error=\\\"0.0057\\\" /> </isotope> <isotope mass-number=\\\"172\\\"> <mass value=\\\"171.936378\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.2183\\\" error=\\\"0.0067\\\" /> </isotope> <isotope mass-number=\\\"173\\\"> <mass value=\\\"172.938207\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1613\\\" error=\\\"0.0027\\\" /> </isotope> <isotope mass-number=\\\"174\\\"> <mass value=\\\"173.938858\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.3183\\\" error=\\\"0.0092\\\" /> </isotope> <isotope mass-number=\\\"176\\\"> <mass value=\\\"175.942569\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1276\\\" error=\\\"0.0041\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Lu\\\" atomic-number=\\\"71\\\"> <natural-abundance> <mass value=\\\"174.967\\\" error=\\\"0.001\\\" /> <isotope mass-number=\\\"175\\\"> <mass value=\\\"174.9407682\\\" error=\\\"0.0000028\\\" /> <abundance value=\\\"0.9741\\\" error=\\\"0.0002\\\" /> </isotope> <isotope mass-number=\\\"176\\\"> <mass value=\\\"175.9426827\\\" error=\\\"0.0000028\\\" /> <abundance value=\\\"0.0259\\\" error=\\\"0.0002\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Hf\\\" atomic-number=\\\"72\\\"> <natural-abundance> <mass value=\\\"178.49\\\" error=\\\"0.02\\\" /> <isotope mass-number=\\\"174\\\"> <mass value=\\\"173.940042\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.0016\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"176\\\"> <mass value=\\\"175.941403\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0526\\\" error=\\\"0.0007\\\" /> </isotope> <isotope mass-number=\\\"177\\\"> <mass value=\\\"176.9432204\\\" error=\\\"0.0000027\\\" /> <abundance value=\\\"0.1860\\\" error=\\\"0.0009\\\" /> </isotope> <isotope mass-number=\\\"178\\\"> <mass value=\\\"177.9436981\\\" error=\\\"0.0000027\\\" /> <abundance value=\\\"0.2728\\\" error=\\\"0.0007\\\" /> </isotope> <isotope mass-number=\\\"179\\\"> <mass value=\\\"178.9488154\\\" error=\\\"0.0000027\\\" /> <abundance value=\\\"0.1362\\\" error=\\\"0.0002\\\" /> </isotope> <isotope mass-number=\\\"180\\\"> <mass value=\\\"179.9465488\\\" error=\\\"0.0000027\\\" /> <abundance value=\\\"0.3508\\\" error=\\\"0.0016\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ta\\\" atomic-number=\\\"73\\\"> <natural-abundance> <mass value=\\\"180.9479\\\" error=\\\"0.0001\\\" /> <isotope mass-number=\\\"180\\\"> <mass value=\\\"179.947466\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.00012\\\" error=\\\"0.00002\\\" /> </isotope> <isotope mass-number=\\\"181\\\"> <mass value=\\\"180.947996\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.99988\\\" error=\\\"0.00002\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"W\\\" atomic-number=\\\"74\\\"> <natural-abundance> <mass value=\\\"183.84\\\" error=\\\"0.01\\\" /> <isotope mass-number=\\\"180\\\"> <mass value=\\\"179.946706\\\" error=\\\"0.000005\\\" /> <abundance value=\\\"0.0012\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"182\\\"> <mass value=\\\"181.948205\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.265\\\" error=\\\"0.0016\\\" /> </isotope> <isotope mass-number=\\\"183\\\"> <mass value=\\\"182.9502242\\\" error=\\\"0.0000030\\\" /> <abundance value=\\\"0.1431\\\" error=\\\"0.0004\\\" /> </isotope> <isotope mass-number=\\\"184\\\"> <mass value=\\\"183.9509323\\\" error=\\\"0.0000030\\\" /> <abundance value=\\\"0.3064\\\" error=\\\"0.0002\\\" /> </isotope> <isotope mass-number=\\\"186\\\"> <mass value=\\\"185.954362\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.2843\\\" error=\\\"0.0019\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Re\\\" atomic-number=\\\"75\\\"> <natural-abundance> <mass value=\\\"186.207\\\" error=\\\"0.001\\\" /> <isotope mass-number=\\\"185\\\"> <mass value=\\\"184.952955\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.3740\\\" error=\\\"0.0002\\\" /> </isotope> <isotope mass-number=\\\"187\\\"> <mass value=\\\"186.9557505\\\" error=\\\"0.0000030\\\" /> <abundance value=\\\"0.6260\\\" error=\\\"0.0002\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Os\\\" atomic-number=\\\"76\\\"> <natural-abundance> <mass value=\\\"190.23\\\" error=\\\"0.03\\\" /> <isotope mass-number=\\\"184\\\"> <mass value=\\\"183.952491\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0002\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"186\\\"> <mass value=\\\"185.953838\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0159\\\" error=\\\"0.0003\\\" /> </isotope> <isotope mass-number=\\\"187\\\"> <mass value=\\\"186.9557476\\\" error=\\\"0.0000030\\\" /> <abundance value=\\\"0.0196\\\" error=\\\"0.0002\\\" /> </isotope> <isotope mass-number=\\\"188\\\"> <mass value=\\\"187.9558357\\\" error=\\\"0.0000030\\\" /> <abundance value=\\\"0.1324\\\" error=\\\"0.0008\\\" /> </isotope> <isotope mass-number=\\\"189\\\"> <mass value=\\\"188.958145\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1615\\\" error=\\\"0.0005\\\" /> </isotope> <isotope mass-number=\\\"190\\\"> <mass value=\\\"189.958445\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.2626\\\" error=\\\"0.0002\\\" /> </isotope> <isotope mass-number=\\\"192\\\"> <mass value=\\\"191.961479\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.4078\\\" error=\\\"0.0019\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Ir\\\" atomic-number=\\\"77\\\"> <natural-abundance> <mass value=\\\"192.217\\\" error=\\\"0.003\\\" /> <isotope mass-number=\\\"191\\\"> <mass value=\\\"190.960591\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.373\\\" error=\\\"0.002\\\" /> </isotope> <isotope mass-number=\\\"193\\\"> <mass value=\\\"192.962923\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.627\\\" error=\\\"0.002\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Pt\\\" atomic-number=\\\"78\\\"> <natural-abundance> <mass value=\\\"195.078\\\" error=\\\"0.002\\\" /> <isotope mass-number=\\\"190\\\"> <mass value=\\\"189.959930\\\" error=\\\"0.000007\\\" /> <abundance value=\\\"0.00014\\\" error=\\\"0.00001\\\" /> </isotope> <isotope mass-number=\\\"192\\\"> <mass value=\\\"191.961035\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.00782\\\" error=\\\"0.00007\\\" /> </isotope> <isotope mass-number=\\\"194\\\"> <mass value=\\\"193.962663\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.32967\\\" error=\\\"0.00099\\\" /> </isotope> <isotope mass-number=\\\"195\\\"> <mass value=\\\"194.964774\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.33832\\\" error=\\\"0.00010\\\" /> </isotope> <isotope mass-number=\\\"196\\\"> <mass value=\\\"195.964934\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.25242\\\" error=\\\"0.00041\\\" /> </isotope> <isotope mass-number=\\\"198\\\"> <mass value=\\\"197.967875\\\" error=\\\"0.000005\\\" /> <abundance value=\\\"0.07163\\\" error=\\\"0.00055\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Au\\\" atomic-number=\\\"79\\\"> <natural-abundance> <mass value=\\\"196.96655\\\" error=\\\"0.00002\\\" /> <isotope mass-number=\\\"197\\\"> <mass value=\\\"196.966551\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Hg\\\" atomic-number=\\\"80\\\"> <natural-abundance> <mass value=\\\"200.59\\\" error=\\\"0.02\\\" /> <isotope mass-number=\\\"196\\\"> <mass value=\\\"195.965814\\\" error=\\\"0.000004\\\" /> <abundance value=\\\"0.0015\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"198\\\"> <mass value=\\\"197.966752\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0997\\\" error=\\\"0.0020\\\" /> </isotope> <isotope mass-number=\\\"199\\\"> <mass value=\\\"198.968262\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1687\\\" error=\\\"0.0022\\\" /> </isotope> <isotope mass-number=\\\"200\\\"> <mass value=\\\"199.968309\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.2310\\\" error=\\\"0.0019\\\" /> </isotope> <isotope mass-number=\\\"201\\\"> <mass value=\\\"200.970285\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.1318\\\" error=\\\"0.0009\\\" /> </isotope> <isotope mass-number=\\\"202\\\"> <mass value=\\\"201.970625\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.2986\\\" error=\\\"0.0026\\\" /> </isotope> <isotope mass-number=\\\"204\\\"> <mass value=\\\"203.973475\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.0687\\\" error=\\\"0.0015\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Tl\\\" atomic-number=\\\"81\\\"> <natural-abundance> <mass value=\\\"204.3833\\\" error=\\\"0.0002\\\" /> <isotope mass-number=\\\"203\\\"> <mass value=\\\"202.972329\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.2952\\\" error=\\\"0.0001\\\" /> </isotope> <isotope mass-number=\\\"205\\\"> <mass value=\\\"204.974412\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.7048\\\" error=\\\"0.0001\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Pb\\\" atomic-number=\\\"82\\\"> <natural-abundance> <mass value=\\\"207.2\\\" error=\\\"0.1\\\" /> <isotope mass-number=\\\"204\\\"> <mass value=\\\"203.973028\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.014\\\" error=\\\"0.001\\\" /> </isotope> <isotope mass-number=\\\"206\\\"> <mass value=\\\"205.974449\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.241\\\" error=\\\"0.001\\\" /> </isotope> <isotope mass-number=\\\"207\\\"> <mass value=\\\"206.975880\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.221\\\" error=\\\"0.001\\\" /> </isotope> <isotope mass-number=\\\"208\\\"> <mass value=\\\"207.976636\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"0.524\\\" error=\\\"0.001\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Bi\\\" atomic-number=\\\"83\\\"> <natural-abundance> <mass value=\\\"208.98038\\\" error=\\\"0.00002\\\" /> <isotope mass-number=\\\"209\\\"> <mass value=\\\"208.980384\\\" error=\\\"0.000003\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Th\\\" atomic-number=\\\"90\\\"> <natural-abundance> <mass value=\\\"232.0381\\\" error=\\\"0.0001\\\" /> <isotope mass-number=\\\"232\\\"> <mass value=\\\"232.0380495\\\" error=\\\"0.0000022\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"Pa\\\" atomic-number=\\\"91\\\"> <natural-abundance> <mass value=\\\"231.03588\\\" error=\\\"0.00002\\\" /> <isotope mass-number=\\\"231\\\"> <mass value=\\\"231.03588\\\" error=\\\"0.00002\\\" /> <abundance value=\\\"1\\\" error=\\\"0\\\" /> </isotope> </natural-abundance> </entry><entry symbol=\\\"U\\\" atomic-number=\\\"92\\\"> <natural-abundance> <mass value=\\\"238.02891\\\" error=\\\"0.00003\\\" /> <isotope mass-number=\\\"234\\\"> <mass value=\\\"234.0409447\\\" error=\\\"0.0000022\\\" /> <abundance value=\\\"0.000054\\\" error=\\\"0.000005\\\" /> </isotope> <isotope mass-number=\\\"235\\\"> <mass value=\\\"235.0439222\\\" error=\\\"0.0000021\\\" /> <abundance value=\\\"0.007204\\\" error=\\\"0.000006\\\" /> </isotope> <isotope mass-number=\\\"238\\\"> <mass value=\\\"238.0507835\\\" error=\\\"0.0000022\\\" /> <abundance value=\\\"0.992742\\\" error=\\\"0.000010\\\" /> </isotope> </natural-abundance> </entry></atomic-mass-table>\";\n try {\n// this.document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(in);\n this.document = XMLParser.parse(xmlContent);\n } catch (Exception e) {\n throw new RuntimeException(\"Error reading atomic_system.xml.\");\n }\n\n NodeList nodes = document.getElementsByTagName(\"entry\");\n\n for (int i = 0; i < nodes.getLength(); i++) {\n Node node = nodes.item(i);\n\n String symbol = node.getAttributes().getNamedItem(\"symbol\").getNodeValue();\n\n entries.put(symbol, new Entry(node));\n }\n }", "@SuppressWarnings(\"unused\")\n public AppCMSPageUI getDataFromFile(String fileName) {\n StringBuilder buf = new StringBuilder();\n try {\n InputStream json = currentActivity.getAssets().open(fileName);\n BufferedReader in =\n new BufferedReader(new InputStreamReader(json, \"UTF-8\"));\n String str;\n\n while ((str = in.readLine()) != null) {\n buf.append(str);\n }\n\n in.close();\n } catch (Exception e) {\n //Log.e(TAG, \"Error getting data from file: \" + e.getMessage());\n }\n\n Gson gson = new Gson();\n\n return gson.fromJson(buf.toString().trim(), AppCMSPageUI.class);\n }", "private void read() {\n\n\t\t\t\tString road=getActivity().getFilesDir().getAbsolutePath()+\"product\"+\".txt\";\n\n\t\t\t\ttry {\n\t\t\t\t\tFile file = new File(road); \n\t\t\t\t\tFileInputStream fis = new FileInputStream(file); \n\t\t\t\t\tint length = fis.available(); \n\t\t\t\t\tbyte [] buffer = new byte[length]; \n\t\t\t\t\tfis.read(buffer); \n\t\t\t\t\tString res1 = EncodingUtils.getString(buffer, \"UTF-8\"); \n\t\t\t\t\tfis.close(); \n\t\t\t\t\tjson(res1.toString());\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}", "ExternalFileResource getExternalFileResourceByAccessToken(String accessToken);", "private static File getAssetInfoFile(Asset asset) {\n \t\treturn getAssetInfoFile(asset.getId());\n \t}", "public static Document loadXmlFile(String fname) {\r\n try {\r\n Document doc = DocumentBuilderFactory.newInstance()\r\n .newDocumentBuilder().parse(fname);\r\n return doc;\r\n } catch (Exception e) {\r\n logger.log(Level.SEVERE, \"exception\", e);\r\n }\r\n\r\n return null;\r\n }", "abstract protected String getOtherXml();", "public Element readFromGameFile(String fileName) {\n\n Element element = null;\n File file = new File(SifebUtil.GAME_FILE_DIR + fileName + \".xml\");\n\n try {\n DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n Document doc = dBuilder.parse(file);\n doc.getDocumentElement().normalize();\n System.out.println(\"Root element :\" + doc.getDocumentElement().getNodeName());\n NodeList nList = doc.getElementsByTagName(\"Game\");\n Node nNode = nList.item(0);\n element = (Element) nNode;\n\n } catch (Exception e) {\n element = null;\n e.printStackTrace();\n }\n\n return element;\n }", "public String loadJSONFromAsset(Context context) {\n String json = null;\n try {\n InputStream is;\n int id = context.getResources().getIdentifier(\"sentiment\", \"raw\", context.getPackageName());\n is = context.getResources().openRawResource(id);\n\n int size = is.available();\n\n byte[] buffer = new byte[size];\n\n is.read(buffer);\n\n is.close();\n\n json = new String(buffer, \"UTF-8\");\n\n\n } catch (IOException ex) {\n ex.printStackTrace();\n return null;\n }\n return json;\n\n }", "FormattedSmartPlaylist readFromFile(File file) throws JAXBException, FileNotFoundException;", "private String loadJSONFromAsset() {\n String json = null;\n try {\n //AssetManager assetManager = getAssets();\n InputStream is = getAssets().open(\"sa.json\");\n //InputStream is = getResources().openRawResource(\"sa.json\");\n int size = is.available();\n\n byte[] buffer = new byte[size];\n\n is.read(buffer);\n\n is.close();\n\n json = new String(buffer, \"UTF-8\");\n Log.i(\"Json\",json);\n\n\n } catch (Exception ex) {\n ex.printStackTrace();\n return null;\n }\n return json;\n\n }", "public static Element openXML(String XMLFileName) {\r\n Document doc = null;\r\n try {\r\n SAXBuilder builder = new SAXBuilder();\r\n doc = builder.build(new File(Config.getWebAppPath() +\r\n \"/WEB-INF/xml/\" + XMLFileName));\r\n }\r\n catch (Exception e) {\r\n System.out.println(\"XMLFile Open Failure->\" + e.getMessage());\r\n }\r\n if (doc == null) {\r\n \tSystem.out.println(\"XMLHandler----->文件不存在\");\r\n return null;\r\n }\r\n\r\n return doc.getRootElement();\r\n }", "@RequestMapping(\n\t\t\tvalue = \"/ristore/foundation/xml/{filename}\",\n\t\t\tmethod = RequestMethod.GET,\n\t\t\tproduces = \"application/xml\")\n\tpublic ResponseEntity<byte[]> downloadXMLFile(@PathVariable String filename) throws IOException {\n\t\tFileInputStream fileStream;\n fileStream = new FileInputStream(new File(\"/rsrch1/rists/moonshot/data/prod/foundation/xml/\" + filename + \".xml\"));\n byte[] content = IOUtils.toByteArray(fileStream);\n HttpHeaders headers = new HttpHeaders();\n headers.setContentType(MediaType.parseMediaType(\"application/pdf\"));\n headers.setContentDispositionFormData(filename + \".xml\", filename + \".xml\");\n return new ResponseEntity<byte[]>(content, headers, HttpStatus.OK);\n\t}", "private void parseXML(String rawXML){\n Log.w(\"AndroidParseXMLActivity\", \"Start Parsing\");\n SAXParserFactory factory = SAXParserFactory.newInstance();\n try {\n\n //Use the sax parser to parse the raw XML.\n SAXParser saxParser = factory.newSAXParser();\n XMLReader xmlreader = saxParser.getXMLReader();\n\n //Use the handler to parse the XML to text\n PaintingXMLHandler handler = new PaintingXMLHandler();\n xmlreader.setContentHandler(handler);\n\n //Objects to read the stream.\n InputSource inStream = new InputSource();\n inStream.setCharacterStream(new StringReader(rawXML));\n\n //Parse the input stream\n xmlreader.parse(inStream);\n\n //Get the map markers from the handler.\n if (handler.getPaintLines() != null) {\n touchArea.loadPainting(handler.getPaintLines());\n }\n setBackgroundColor(handler.getBackground());\n\n\n Toast.makeText(this, \"Loaded\", Toast.LENGTH_LONG).show();\n } catch (ParserConfigurationException e) {\n Toast.makeText(this, \"Error 1 reading xml file.\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n } catch (SAXException e) {\n Toast.makeText(this, \"Error 2 reading xml file.\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }catch(IOException e){\n Toast.makeText(this, \"Error 3 reading xml file.\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }\n }", "public void parseXML(String xmlString) {\n DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); \n Document document = null; \n try { \n //DOM parser instance \n DocumentBuilder builder = builderFactory.newDocumentBuilder(); \n \n //parse an XML file into a DOM tree, in this case, change the filepath to xml String \n document = builder.parse(new File(filePath));\n \n //get root element, which is <Airports>\n Element rootElement = document.getDocumentElement(); \n \n //traverse child elements. retrieve all the <Airport>\n NodeList nodes = rootElement.getChildNodes(); \n for (int i=0; i < nodes.getLength(); i++) \n { \n Node node = nodes.item(i); \n if (node.getNodeType() == Node.ELEMENT_NODE) { \n Element airport = (Element) node; \n \n //process child element \n String code = airport.getAttribute(\"Code\");\n String name = airport.getAttribute(\"Name\"); \n \n // child node of airport\n NodeList airportChildren = airport.getChildNodes();\n \n // value of longitude & latitude\n String longitude = airportChildren.item(1).getTextContent();\n String latitude = airportChildren.item(2).getTextContent();\n \n Location location = new Location(longitude, latitude);\n airportList.add(new Airport(code, name, location));\n } \n } \n \n // another approach to traverse all the listNode by tagName \n /*NodeList nodeList = rootElement.getElementsByTagName(\"book\"); \n if(nodeList != null) \n { \n for (int i = 0 ; i < nodeList.getLength(); i++) \n { \n Element element = (Element)nodeList.item(i); \n String id = element.getAttribute(\"id\"); \n } \n }*/\n // add the DOM object to the airportList\n } catch (ParserConfigurationException e) { \n e.printStackTrace(); \n } catch (SAXException e) { \n e.printStackTrace(); \n } catch (IOException e) { \n e.printStackTrace(); \n } \n }", "private Document getDocumentInClassPath()throws Exception{\r\n\t\t\r\n\t\tDocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();\r\n\t\tDocumentBuilder builder = builderFactory.newDocumentBuilder();\r\n\t\t\r\n\t\tDocument doc = builder.parse(ServiceLoader.class.getResourceAsStream(\"/\"+FILE_NAME));\r\n\t\t\r\n\t\treturn doc;\r\n\t}", "private String loadJSONFromAsset(){\n String json = null;\n AssetManager assetManager = getAssets();\n try{\n InputStream IS = assetManager.open(\"datosFases.json\");\n int size = IS.available();\n byte[] buffer = new byte[size];\n IS.read(buffer);\n IS.close();\n json = new String(buffer,\"UTF-8\");\n\n } catch (IOException ex){\n ex.printStackTrace();\n return null;\n }\n\n return json;\n }", "private List<String> usingXml(String urladd) {\n List<String> retLst = new ArrayList<String>();\n try {\n\n URL url = new URL(urladd);\n URLConnection urlConnection = url.openConnection();\n HttpURLConnection connection = null;\n connection = (HttpURLConnection) urlConnection;\n\n DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n Document doc = dBuilder.parse(connection.getInputStream());\n\n doc.getDocumentElement().normalize();\n\n NodeList nList = doc.getElementsByTagName(\"surfaceForm\");\n\n boolean flg = true;\n for (int temp = 0; temp < nList.getLength(); temp++) {\n\n Node nNode = nList.item(temp);\n\n if (nNode.getNodeType() == Node.ELEMENT_NODE) {\n\n Element eElement = (Element) nNode;\n String text = eElement.getAttribute(\"name\");\n String offset = eElement.getAttribute(\"offset\");\n\n String startEnd = Integer.parseInt(offset) + \",\" + (text.length() + Integer.parseInt(offset));\n retLst.add(startEnd);\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return retLst;\n }", "private static Document parseXmlFile(String strXml) {\n // get the factory\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n\n try {\n // Using factory get an instance of document builder\n final DocumentBuilder db = dbf.newDocumentBuilder();\n final Document dom;\n File file;\n\n file = new File(strXml);\n if (!file.exists()) {\n strXml = \"data/\" + strXml;\n }\n\n // Parse using builder to get DOM representation of the XML file\n dom = db.parse(strXml);\n\n return dom;\n } catch (final Exception e) {\n Verbose.log(Level.SEVERE, e, \"Laoding Specifications\",\n e.getMessage());\n } // end try\n\n return null;\n }", "String[] getActivities(String filepath) throws ParserConfigurationException, SAXException, IOException;", "public void readXML(String xml){\n\t\tint maxId = 0;\n\t\ttry {\n \tFile xmlFile = new File(xml); \n \tDocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance(); \n \tDocumentBuilder documentBuilder = documentFactory.newDocumentBuilder(); \n \tDocument doc = documentBuilder.parse(xmlFile); \n \tdoc.getDocumentElement().normalize();\n \tNodeList nodeList = doc.getElementsByTagName(\"node\");\n \tHashMap<Integer,Artifact> artifactTable = new HashMap<Integer, Artifact>();\n \tHashMap<Integer,Element> nodeTable = new HashMap<Integer, Element>();\n \n \tfor (int i = 0; i < nodeList.getLength(); i++) { \n \t\tNode xmlItem = nodeList.item(i);\n \t\tif (xmlItem.getNodeType() == Node.ELEMENT_NODE) { \n \t\t\tElement node = (Element) xmlItem;\n \t\t\tArtifact newNode = new Artifact(Rel.getContext());\n \t\t\tRel.addView(newNode,100,100);\n \t\t\tnewNode.setId(Integer.parseInt(node.getElementsByTagName(\"id\").item(0).getTextContent()));\n \t\t\tnewNode.setPrevWidth(100);\n \t\t\tnewNode.setPrevHeight(100);\n \t\t\tnewNode.setTag(\"node\");\n \t\t\tnewNode.setText(node.getElementsByTagName(\"label\").item(0).getTextContent());\n \t\t\tnewNode.setType(node.getElementsByTagName(\"type\").item(0).getTextContent());\n \t\t\tnewNode.setInformation(node.getElementsByTagName(\"information\").item(0).getTextContent());\n \t\t\tnewNode.setPosition(node.getElementsByTagName(\"position\").item(0).getTextContent());\n \t\t\tnewNode.setAge(Long.parseLong(node.getElementsByTagName(\"age\").item(0).getTextContent()));\n \t\t\tnewNode.setBackgroundResource(Utility.getDrawableType(newNode));\n \t\t\tif(\"\".compareTo((String) newNode.getText()) != 0){\n \t\t\t\tnewNode.matchWithText();\n \t\t\t}\n \t\t\tartifactTable.put(newNode.getId(), newNode);\n \t\t\tnodeTable.put(newNode.getId(), node);\n \t\t\tif(Integer.parseInt(node.getElementsByTagName(\"id\").item(0).getTextContent())>maxId){\n \t\t\t\tmaxId = Integer.parseInt(node.getElementsByTagName(\"id\").item(0).getTextContent());\n \t\t\t}\n \t\t} \n \t\t\n \t}\n \t\n \t//once we created all the artifacts now we can set the fathers and sons for every node with the artifact and xmlnode tables we have filled while reading\n \tIterator it = artifactTable.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry pairs = (Map.Entry)it.next();\n NodeList sonsList = nodeTable.get(pairs.getKey()).getElementsByTagName(\"son\");\n if(sonsList != null){\n\t for (int j = 0; j < sonsList.getLength(); j++) {\n\t \tartifactTable.get(pairs.getKey()).addSon(artifactTable.get(Integer.parseInt(sonsList.item(j).getTextContent())));\n\t }\n }\n \n NodeList fathersList = nodeTable.get(pairs.getKey()).getElementsByTagName(\"father\");\n if(fathersList != null){\n\t for (int j = 0; j < fathersList.getLength(); j++) {\n\t \tartifactTable.get(pairs.getKey()).addFather(artifactTable.get(Integer.parseInt(fathersList.item(j).getTextContent())));\n\t }\n }\n \n }\n \n \n }catch(Exception e){\n \tLog.v(\"error reading xml\",e.toString());\n }\n\t\tGlobal.ID = maxId+1;\n\t}", "public abstract T loadResource(AssetManager assetManager, String str);", "public static Element getSpriteFromExternalXML(String path, String name) {\r\n\t\tElement e = null;\r\n\t\tDocument doc = null;\r\n\t\tFile file = new File(path);\r\n\t\ttry {\r\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\r\n\r\n\t\t\tdoc = builder.parse(file);\r\n\r\n\t\t\tNodeList nList = doc.getElementsByTagName(\"Cell\");\r\n\r\n\t\t\tfor (int i = 0; i < nList.getLength(); i++) {\r\n\t\t\t\tNode node = nList.item(i);\r\n\t\t\t\tif (node.getNodeType() == Node.ELEMENT_NODE) {\r\n\t\t\t\t\tElement eElement = (Element) node;\r\n\t\t\t\t\tSystem.out.println(eElement.getAttribute(\"name\"));\r\n\t\t\t\t\tif (eElement.getAttribute(\"name\").equals(name)) {\r\n\t\t\t\t\t\te = eElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn e;\r\n\r\n\t}", "URL getWuicXmlPath() {\n return wuicXmlPath;\n }", "private void loadArticle() {\n String filename = getFilesDir().getAbsolutePath() + \"/article\" + article.getId();\n if (Build.VERSION.SDK_INT >= 19)\n filename += \".mht\";\n File file = new File(filename);\n if (file.exists()) {\n Log.i(\"loadArticle\", \"Article loaded successfully\");\n // Pro novejsi verze systemu\n if (Build.VERSION.SDK_INT >= 19) {\n webView.loadUrl(\"file://\" + filename);\n return;\n }\n try {\n InputStream is = new FileInputStream(file);\n WebArchiveReader wr = new WebArchiveReader() {\n public void onFinished(WebView v) {\n continueWhenLoaded(v);\n }\n };\n if (wr.readWebArchive(is)) {\n wr.loadToWebView(webView);\n }\n } catch (IOException e) {\n article.setSaved(false);\n db.updateArticle(article);\n webView.loadUrl(article.getLink());\n Toast.makeText(ArticleActivity.this, getResources().getString(R.string.save_not_found), Toast.LENGTH_SHORT).show();\n }\n } else {\n // Ulozeny clanek nenalezen, bude nacten ze site\n article.setSaved(false);\n db.updateArticle(article);\n webView.loadUrl(article.getLink());\n Toast.makeText(ArticleActivity.this, getResources().getString(R.string.save_not_found), Toast.LENGTH_SHORT).show();\n }\n }", "public String loadJSONFromAsset() {\n String json = null;\n try {\n InputStream is = getAssets().open(\"election-county-2012.json\");\n int size = is.available();\n byte[] buffer = new byte[size];\n is.read(buffer);\n is.close();\n json = new String(buffer, \"UTF-8\");\n } catch (IOException ex) {\n ex.printStackTrace();\n return null;\n }\n return json;\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n \n //显示结果的TextView\n final TextView info=(TextView)findViewById(R.id.info);\n \n //获取资源管理的实例\n\t\tfinal Resources resources=getResources();\n \n //原始文件操作\n Button raw=(Button)findViewById(R.id.rawBtn);\n raw.setOnClickListener(new OnClickListener() {\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t\tInputStream input=null;\n\t\t\t\tinput=resources.openRawResource(R.raw.test); //获取指定资源文件的输入流对象\n\t\t\t\ttry { \n\t\t\t\t\t//读取文件内容,操作类似于FileInputStream\n\t\t\t\t\tbyte[] reader=new byte[input.available()]; //必须用try块包围\n\t\t\t\t\tString out=\"\";\n\t\t\t\t\twhile (input.read(reader)!=-1){\n\t\t\t\t\t\tout+=new String(reader,\"GBK\");\n\t\t\t\t\t\t//第二个参数为编码,必须与raw文件的属性中的编码相符,否则乱码\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//显示文件内容\n\t\t\t\t\tinfo.setText(out);\n\t\t\t\t\t\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}finally{ //关闭输入流对象\n\t\t\t\t\tif (input!=null){\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tinput.close(); //必须用try块包围\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n \n //xml文件操作\n Button xml=(Button)findViewById(R.id.xmlBtn);\n xml.setOnClickListener(new OnClickListener() {\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t\t//获取XML解析器\n\t\t\t\tXmlPullParser parser=resources.getXml(R.xml.people);\n\t\t\t\t\n\t\t\t\tString msg=\"\"; //显示字符串\n\t\t\t\tString people=null; //People节点名字\n\t\t\t\t//元素的属性值\n\t\t\t\tString name=null; \n\t\t\t\tString age=null;\n\t\t\t\tString height=null;\n\t\t\t\t// 从xml文件分析出的元素的名称和值\n\t\t\t\tString attrName;\n\t\t\t\tString attrValue;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tint result=parser.next(); //读取一个节点\n\t\t\t\t\t\n\t\t\t\t\twhile (result!=XmlPullParser.END_DOCUMENT){ //一直扫描到文件末尾\n\t\t\t\t\t\t\n\t\t\t\t\t\tpeople=parser.getName(); //获取当前节点的名字\n\t\t\t\t\t\t\n\t\t\t\t\t\t//处理一个元素----一行,\n\t\t\t\t\t\t//START_TAG, 开始处理一行时解析如下内容,\n\t\t\t\t\t\tif (people!=null && \tpeople.equals(\"person\") && \n\t\t\t\t\t\t\t\tresult==XmlPullParser.START_TAG){ //如果此处不加上限制条件,则解析完一行时也会触发该事件\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint count=parser.getAttributeCount(); //获取属性个数\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (int i=0; i<count; i++){ //按序号获取当前节点的每个属性值\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\tattrName=parser.getAttributeName(i);\n\t\t\t\t\t\t\t\tattrValue=parser.getAttributeValue(i);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//获取属性值-->不同的属性值赋值给不同的变量\n\t\t\t\t\t\t\t\tif ((attrName!=null) && attrName.equals(\"name\"))\n\t\t\t\t\t\t\t\t\tname=attrValue;\n\t\t\t\t\t\t\t\telse if ((attrName!=null) && attrName.equals(\"age\"))\n\t\t\t\t\t\t\t\t\tage=attrValue;\n\t\t\t\t\t\t\t\telse if ((attrName!=null) && attrName.equals(\"height\"))\n\t\t\t\t\t\t\t\t\theight=attrValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//形成要显示的字符串\n\t\t\t\t\t\t\tmsg+=\"姓名: \"+name+\", 年龄: \"+age+\", 身高: \"+height+\"\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult=parser.next();\n\t\t\t\t\t}\n\t\t\t\t} catch (XmlPullParserException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//显示内容\n\t\t\t\tinfo.setText(msg);\n\t\t\t}\n\t\t});\n }", "public String getRequestInXML() throws Exception;", "@Test\n public void in() throws IOException {\n InputStream in = getResourceAstream(\"peizhi.xml\");\n\n //InputStream in = new FileInputStream(\"G:\\\\IDEA\\\\Java_test\\\\src\\\\main\\\\resources\\\\peizhi.xml\");\n //定义一个数组相当于缓存\n byte by[]=new byte[1024];\n int n=0;\n while((n=in.read(by))!=-1)\n {\n String s=new String(by,0,n);\n System.out.println(s);\n }\n }", "private FileXML getFile(Element fileNode) throws ParserException{\n NodeList accessNDList = fileNode.getElementsByTagName(\"access\");\n \n if( accessNDList == null){\n throw new ParserException(\"Missing access definition for file, line: \"+dom.compareDocumentPosition(fileNode));\n }\n List<FileXMLAccess> fileAccessList = new LinkedList();\n String path;\n String host;\n Element fileAccess;\n for(int i=0; i<accessNDList.getLength(); i++){\n fileAccess = (Element) accessNDList.item(i);\n if(!fileAccess.hasAttribute(\"host\")){\n throw new ParserException(\"Missing host in access definition, line: \"+dom.compareDocumentPosition(fileNode));\n }\n if(!fileAccess.hasAttribute(\"path\")){\n throw new ParserException(\"Missing path in access definition, line: \"+dom.compareDocumentPosition(fileNode));\n }\n path = fileAccess.getAttribute(\"path\");\n host = fileAccess.getAttribute(\"host\");\n fileAccessList.add(new FileXMLAccess(mapForAccess.get(host), path));\n }\n return new FileXML(fileAccessList);\n }", "private void downloadContent(){\n try {\n URL yahoo = new URL( \"http://api.letsleapahead.com/LeapAheadMultiFreindzy/index.php?action=getLang&langCode=EN&langId=1&appId=6\");\n BufferedReader in = new BufferedReader(\n new InputStreamReader(yahoo.openStream()));\n String inputLine;\n while ((inputLine = in.readLine()) != null)\n Log.e(\"TAG\" , inputLine);\n in.close();\n }catch (Exception e){\n e.printStackTrace();\n }\n\n }", "public String LoadXML(String filename) throws org.xml.sax.SAXException,\n\t\t\tSAXException {\n\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t// factory.setValidating(true);\n\t\t// factory.\n\t\tfactory.setIgnoringElementContentWhitespace(true);\n\t\tDocument doc = null;\n\t\ttry {\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\tFile file = new File(filename);\n\t\t\tdoc = builder.parse(file);\n\t\t\t// Do something with the document here.\n\t\t} catch (ParserConfigurationException e) {\n\t\t} catch (IOException e) {\n\t\t}\n\t\treturn doc.getElementsByTagName(\"text\").item(0).getFirstChild()\n\t\t\t\t.getNodeValue();\n\t}", "@NonNull\n private File getDownloadLocation() {\n System.out.println(\"Hello. in download start\");\n File root = android.os.Environment.getExternalStorageDirectory();\n File file = new File(root.getAbsolutePath() + \"/V2A\");\n if (!file.exists()) {\n file.mkdirs();\n }\n System.out.println(file.toString());\n System.out.println(\"Hello. in download end\");\n //Toast.makeText(this, \"Starting Download\", Toast.LENGTH_SHORT).show();\n\n return file;\n\n }", "private String getAbsoluteFilesPath() {\n\n //sdcard/Android/data/cucumber.cukeulator\n //File directory = getTargetContext().getExternalFilesDir(null);\n //return new File(directory,\"reports\").getAbsolutePath();\n return null;\n }", "File getBundle();", "public URL getResourceLocation( String name );", "public InputStream getInputStream() throws IOException {\n return this.mContext.getAssets().open(this.mAssetName);\n }", "public static String accessiblePathOfAssetName(Context context, String assetName) {\n String fileName = String.valueOf(System.currentTimeMillis());\n try {\n MessageDigest digest = MessageDigest.getInstance(\"MD5\");\n fileName = new String(digest.digest(fileName.getBytes()));\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n\n if (context != null && !TextUtils.isEmpty(assetName)) {\n final String absoluteFilePath = context.getFilesDir().getAbsolutePath().concat(File.separator).concat(fileName);\n\n InputStream assetInputStream = null;\n FileOutputStream fileOutputStream = null;\n try {\n assetInputStream = context.getAssets().open(assetName);\n fileOutputStream = new FileOutputStream(absoluteFilePath);\n\n byte[] bytes = new byte[assetInputStream.available()];\n if (assetInputStream.read(bytes) > 0) {\n fileOutputStream.write(bytes);\n }\n fileOutputStream.flush();\n return absoluteFilePath;\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (assetInputStream != null) {\n try {\n assetInputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n if (fileOutputStream != null) {\n try {\n fileOutputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }\n\n return null;\n }", "public static File getFileToLoad() {\n\t\treturn new File(System.getProperty(\"user.home\") + File.separatorChar + \"Documents\" + File.separatorChar + \"main.css\");\n\t\t//return null;\n\t}", "public java.lang.String getXml();", "public static XmlResult getXml(final String url)\r\n {\r\n XmlResult xml = new XmlResult();\r\n\r\n HttpSimpleResponse response = getHttpFetcher().fetch(url);\r\n\r\n xml.setHttpResponse(response);\r\n\r\n return xml;\r\n }", "public static Element openXML(String filePath,String XMLFileName) {\r\n Document doc = null;\r\n try {\r\n SAXBuilder builder = new SAXBuilder();\r\n doc = builder.build(new File(Config.getWebAppPath() +\r\n \"/WEB-INF/xml/\" +filePath+\"/\"+ XMLFileName));\r\n }\r\n catch (Exception e) {\r\n System.out.println(\"XMLFile Open Failure->\" + e.getMessage());\r\n }\r\n if (doc == null) {\r\n \tSystem.out.println(\"XMLHandler----->文件不存在\");\r\n return null;\r\n }\r\n\r\n return doc.getRootElement();\r\n }", "Map<String, String> Read_File(XmlPullParser xmlPullParser, List<Tags_To_Read> tags, String account_Name) throws NullPointerException, XML_Reader_Exception;", "private static URL getDeployableXmlUrl(Class<?> clazz)\n {\n // Initialize\n StringBuffer urlString = new StringBuffer();\n\n // Assemble filename in form \"fullyQualifiedClassName\"\n urlString.append(clazz.getName());\n\n // Make a String\n String flatten = urlString.toString();\n\n // Adjust for filename structure instead of package structure\n flatten = flatten.replace('.', '/');\n\n // Append Suffix\n flatten = flatten + DEFAULT_SUFFIX_DEPLOYABLE_XML;\n\n // Get URL\n URL url = Thread.currentThread().getContextClassLoader().getResource(flatten);\n assert url != null : \"URL was not found for \" + flatten;\n \n // Return\n return url;\n }", "private void readXML() {\n\t\tSAXParserFactory factory = SAXParserFactory.newInstance();\n\t\tXMLReader handler = new XMLReader();\n\t\tSAXParser parser;\n\t\t\n\t\t//Parsing xml file\n\t\ttry {\n\t\t\tparser = factory.newSAXParser();\n\t\t\tparser.parse(\"src/data/users.xml\", handler);\n\t\t\tgroupsList = handler.getGroupNames();\n\t\t} catch(SAXException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ParserConfigurationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t};\n\t}", "private Drawable downloadFile(String fileUrl)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tInputStream is = (InputStream) new URL(fileUrl).getContent();\r\n\t\t\tDrawable d = Drawable.createFromStream(is, \"src\");\r\n\t\t\treturn d;\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public static void readXML(){\n try{\n Document doc = getDoc(\"config.xml\");\n Element root = doc.getRootElement();\n\n //Muestra los elementos dentro de la configuracion del xml\n \n System.out.println(\"Color : \" + root.getChildText(\"color\"));\n System.out.println(\"Pattern : \" + root.getChildText(\"pattern\"));\n System.out.println(\"Background : \" + root.getChildText(\"background\"));\n \n\n } catch(Exception e){\n System.out.println(e.getMessage());\n }\n }", "public InputStream getXmlStream(String base, String name){\n String fileName = name;\n if (!fileName.endsWith(\".xml\"))\n fileName = name + \".xml\";\n\n return getStream(base, fileName);\n }", "private void loadData(String fileName, String cobrandPath)\n throws ParserConfigurationException, SAXException, IOException {\n\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n DocumentBuilder db = dbf.newDocumentBuilder();\n Document doc = db.parse(cobrandPath);\n\n Element root = doc.getDocumentElement();\n\n Element updateElement = doc.createElement(IConstants.IMAGE_FILE);\n Node updateText = doc.createTextNode(fileName);\n\n updateElement.appendChild(updateText);\n root.appendChild(updateElement);\n\n try {\n\n DOMSource source = new DOMSource(doc);\n StreamResult result = new StreamResult(new FileOutputStream(\n cobrandPath));\n\n TransformerFactory transFactory = TransformerFactory.newInstance();\n Transformer transformer = transFactory.newTransformer();\n\n transformer.transform(source, result);\n\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public void run() {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tsb.append(\"<files>\");\n\t\t\t\tsb.append(\"<file>\");\n\t\t\t\tsb.append(\"<username>\");\n\t\t\t\tsb.append(e1);\n\t\t\t\tsb.append(\"</username>\");\n\t\t\t\t\n\t\t\t\tsb.append(\"<password>\");\n\t\t\t\tsb.append(e2);\n\t\t\t\tsb.append(\"</password>\");\n\t\t\t\t\n\t\t\t\tsb.append(\"<email>\");\n\t\t\t\tsb.append(e4);\n\t\t\t\tsb.append(\"</email>\");\n\t\t\t\tsb.append(\"<name>\");\n\t\t\t\tsb.append(e5);\n\t\t\t\tsb.append(\"</name>\");\n\t\t\t\t\n\t\t\t\tsb.append(\"<sex>\");\n\t\t\t\tsb.append(i);\n\t\t\t\tsb.append(\"</sex>\");\n\t\t\t\tsb.append(\"<phone>\");\n\t\t\t\tsb.append(e6);\n\t\t\t\tsb.append(\"</phone>\");\n\t\t\t\tsb.append(\"<headname>\");\n\t\t\t\tsb.append(url);\n\t\t\t\tsb.append(\"</headname>\");\n\t\t\t\tsb.append(\"<head>\");\n\t\t\t\tByteArrayOutputStream bo = new ByteArrayOutputStream();\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tFileInputStream f = new FileInputStream(\"/sdcard/\"+url);\n\t\t\t\tbyte []image = new byte [1024];\n\t\t\t\tint len = 0;\n\t\t\t\twhile ((len=f.read(image))!=-1){\n\t\t\t\t\tbo.write(image, 0, len);\n\t\t\t\t}\n\t\t\t\tbyte re[] = bo.toByteArray();\n\t\t\t\tString encond = Base64.encodeToString(re, Base64.DEFAULT);\n\t\t\t\n\t\t\t\tbo.close();\n\t\t\t\tf.close();\n\t\t\t\tsb.append(encond);\t\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\t\t\n\t\t\t\tsb.append(\"</head>\");\n\t\t\t\tsb.append(\"<job>\");\n\t\t\t\tsb.append(e8);\n\t\t\t\tsb.append(\"</job>\");\n\t\t\t\tsb.append(\"<address>\");\n\t\t\t\tsb.append(e9);\n\t\t\t\tsb.append(\"</address>\");\n\t\t\t\tsb.append(\"<circle>\");\n\t\t\t\tsb.append(e10);\n\t\t\t\tsb.append(\"</circle>\");\n\t\t\t\tsb.append(\"<guanzhu>\");\n\t\t\t\tsb.append(n1+\"\"+n2+\"\"+n3);\n\t\t\t\tsb.append(\"</guanzhu>\");\n\t\t\t\tsb.append(\"</file>\");\n\t\t\t\tsb.append(\"</files>\");\n\t\t\t\tbyte content[] = sb.toString().getBytes();\n\t\t\t\ttry {\n\t\t\t\t\tURL u = new URL(\"http://10.0.2.2:8080/Lvyou/LYRegisterServlet\");\n\t\t\t\t\tHttpURLConnection huc = (HttpURLConnection) u.openConnection();\n\t\t\t\t\thuc.setDoInput(true);\n\t\t\t\t\thuc.setDoOutput(true);\n\t\t\t\t\thuc.setRequestMethod(\"POST\");\n\t\t\t\t\thuc.setRequestProperty(\"Content-Type\", \"mutipart/form-data\");\n\t\t\t\t\thuc.setRequestProperty(\"Content-Length\", content.length+\"\");\n\t\t\t\t\thuc.getOutputStream().write(content);\n\t\t\t\t\tString str = \"\";\n\t\t\t\t\tif(huc.getResponseCode()==HttpURLConnection.HTTP_OK){\n\t\t\t\t\t\tInputStream in =huc.getInputStream();\n\t\t\t\t\n\t\t\t\t\t\tLYRegisterBean rb = new LYRegisterBean();\n\t\t\t\t\t\tString reg=rb.register(in);\n\t\t\t\t\t\tMessage msg = new Message();\n\t\t\t\t\t\tmsg.obj=reg;\n\t\t\t\t\t\thb.sendMessage(msg);\n\n\n\t\t\t\t\t}}\n\t\t\t\t\t catch (IOException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\tpd.cancel();\n\t\t\t}", "private static Document initializeXML(String filePath) throws Exception {\n\t\ttry {\n\t\t\tlogger.info(\"Initializing the xml file :\" + filePath);\n\t\t\txmlDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File(filePath));\n\t\t\txmlDocument.getDocumentElement().normalize();\n\t\t\treturn xmlDocument;\n\t\t} catch (Exception e) {\n\n\t\t\tlogger.error(\"Error while reading from XML. File Path : \" + filePath + \" \\n\" + e.getMessage());\n\t\t\tthrow (new Exception(e.getMessage()));\n\n\t\t}\n\t}", "@GetMapping(\"/assets\")\n public ResponseEntity<Resource> assets(@RequestParam(\"name\")\n final String name) {\n String fileName = Path.of(\"assets\", \"sample\", fileUtility.getFileName(name)).toString();\n return downloadFile(fileName);\n }", "@Override\r\n\t\t\tpublic void onClick(View v) \r\n\t\t\t{\n\r\n\t\t\t\tAssetManager am = context.getAssets();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tInputStream is = am.open(\"syb11.txt\"); \r\n\t\t\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(is));\r\n\t\t\t\t\tString inputLine;\r\n\t\t\t\t\twhile ((inputLine = in.readLine()) != null)\r\n\t\t\t\t\t\tSystem.out.println(inputLine);\r\n\t\t\t\t\tin.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}", "public String parseJSON(){\r\n String json = null;\r\n try{\r\n InputStream istream = context.getAssets().open(\"restaurantopeninghours.json\");\r\n int size = istream.available();\r\n byte[] buffer = new byte[size];\r\n istream.read(buffer);\r\n istream.close();\r\n json = new String(buffer, \"UTF-8\");\r\n }catch (IOException ex){\r\n ex.printStackTrace();\r\n return null;\r\n }\r\n return json;\r\n }" ]
[ "0.6785874", "0.6394494", "0.5853264", "0.57987714", "0.5784212", "0.5723", "0.57008934", "0.56399685", "0.56014216", "0.5583376", "0.5554536", "0.5549577", "0.55490834", "0.5465004", "0.54383", "0.5410919", "0.5407907", "0.53856343", "0.53550965", "0.5351122", "0.5337826", "0.5300682", "0.5298008", "0.5268271", "0.5261074", "0.5260485", "0.5241307", "0.52384794", "0.52371013", "0.5228103", "0.5219407", "0.52183527", "0.5217964", "0.5193327", "0.51824105", "0.51773596", "0.5173788", "0.5168561", "0.5165238", "0.51529545", "0.51465845", "0.514149", "0.5136535", "0.5125722", "0.51210827", "0.5105807", "0.5100528", "0.5095156", "0.5092692", "0.5085293", "0.5068623", "0.50663334", "0.5065184", "0.50473225", "0.5041442", "0.50391966", "0.5033481", "0.5027626", "0.5022956", "0.5017652", "0.50112706", "0.5010433", "0.50064147", "0.5004024", "0.49990785", "0.49959102", "0.4993429", "0.49849933", "0.49835753", "0.4981662", "0.49791944", "0.4970677", "0.49656457", "0.49652153", "0.4963169", "0.49574977", "0.49499574", "0.49475884", "0.49467784", "0.4938095", "0.49334002", "0.49330074", "0.49264434", "0.49250805", "0.4920157", "0.4917342", "0.49160954", "0.491463", "0.49110383", "0.49091908", "0.49041602", "0.49023917", "0.49023026", "0.48947644", "0.4894282", "0.4884406", "0.4881779", "0.48803523", "0.48786026", "0.48641172", "0.48635328" ]
0.0
-1
Give n role names, and a folder adds to all .json files in the folder an entry with the role names. Example: INPUT: folderpath white;black Line added to each json file: "roles":["white","black"]
public static void main(String[] args) { if(args.length !=2) { System.out.println("Two inputs expected: folder path where to look for .json files and list of roles separated by semicolon."); return; } String folderpath = args[0]; String[] roles = args[1].split(";"); List<String> rolesForJson = new ArrayList<String>(); for(String s : roles) { rolesForJson.add(s); } File folder; File[] filesInFolder; List<File> folders = new ArrayList<File>(); folders.add(new File(folderpath)); while(!folders.isEmpty()) { folder = folders.remove(0); //System.out.println(folder.getAbsolutePath()); filesInFolder = folder.listFiles(); for(File file : filesInFolder) { if(file.isDirectory()) { folders.add(file); }else if(file.getName().endsWith(".json")) { addRoles(file, rolesForJson); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void importRoles(String filename) throws Exception {\r\n\t\tFileReader fr = new FileReader(filename);\r\n\t\tBufferedReader br = new BufferedReader(fr);\r\n\r\n\t\twhile(true) {\r\n\t\t\tString line = br.readLine();\r\n\t\t\tif (line == null)\r\n\t\t\t\tbreak;\r\n\t\t\tString[] tokens = line.split(\",\");\r\n\t\t\tString roleName = tokens[0].trim();\r\n\t\t\tString rightName = tokens[1].trim();\r\n\t\t\t\r\n\t\t\tRole role = findRole(roleName);\r\n\t\t\tif (role == null) {\r\n\t\t\t\trole = new Role();\r\n\t\t\t\trole.setName(roleName);\r\n\t\t\t\tem.persist(role);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tRight right = Right.valueOf(rightName);\r\n\t\t\t\tSet<Right> rights = role.getRights();\r\n\t\t\t\tif (rights == null) {\r\n\t\t\t\t\trole.setRights(EnumSet.noneOf(Right.class));\r\n\t\t\t\t\trights = role.getRights();\r\n\t\t\t\t}\r\n\t\t\t\trights.add(right);\r\n\t\t\t} catch (IllegalArgumentException e) {\r\n\t\t\t\t//no role for name;\r\n\t\t\t\tSystem.out.println(\"ERROR : no right for name: \" + rightName);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tbr.close();\r\n\t\tfr.close();\r\n\t}", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"role\"})\n public void _4_2_6_findMultiRolesByNameRecusiveExist() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n c_1.getId()+\"/departments/\"+\n d_1.getId()+\n \"/roles?name=VP\")\n .header(AUTHORIZATION, ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.roles\",hasSize(1)))\n .andExpect(jsonPath(\"$._embedded.roles[0].id\",is(r_1.getId().toString())));\n }", "public static void main(String[] args) { // generate new json files\n \t// All directories to pull from\n \t\n \tArrayList<List<List<Integer>>> levels = new ArrayList<List<List<Integer>>>();\n \tfor(int i = 1;i<=10;i++) {\n \t\tif (i != 9) {\n \t\t\tmaxX=0;\n \t\t\tmaxY=0;\n \t\t\tvisited.clear();\n \t\t\tenemyNumber=-1;\n \t\t\tenemyString = null;\n \t\t\tbossString = null;\n \t\t\tList<List<Integer>> level = convertMMLVtoInt(MegaManVGLCUtil.MEGAMAN_MMLV_PATH+\"MegaManLevel\"+i+\".mmlv\");\n \t\t\tlevels.add(level);\n \t\t\t//MegaManVGLCUtil.printLevel(level);\n \t\t}\n\t\t}\n \tSystem.out.println(\"Read \"+levels.size()+\" levels.\");\n\n \t\n \toutputOneGAN(levels, \"NoWater9\"); \n \toutputSevenGAN(levels, \"NoWater9\");\n \t//File testFile = new File(\"data\\\\VGLC\\\\MegaMan\\\\MegaManOneGANNoWater9.json\");\n \t//showJsonContents(testFile);\n }", "@Test\n\tpublic void testReadFromFolderManyEmployers() {\n\n\t}", "private HashMap<String, Role> readRoles(JSONArray roleArray) {\n HashMap<String, Role> roles = new HashMap<>();\n\n for(int i = 0; i < roleArray.length(); i++) {\n final String roleName = roleArray.getString(i);\n roles.put(\n roleName,\n new Role(\n roleName,\n resourceHandler.getImageResource(Role.BASE_PATH + roleName + \".png\")\n )\n );\n }\n return roles;\n }", "@Test\r\n public void generateAllJsonFileTest() {\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.Builder security = com.seagate.kinetic.proto.Kinetic.Command.Security\r\n .newBuilder();\r\n\r\n // client 1 has all roles\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Builder acl1 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL\r\n .newBuilder();\r\n acl1.setIdentity(1);\r\n acl1.setKey(ByteString.copyFromUtf8(\"asdfasdf1\"));\r\n\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope.Builder domain = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope\r\n .newBuilder();\r\n\r\n for (Permission role : Permission.values()) {\r\n if (!role.equals(Permission.INVALID_PERMISSION)) {\r\n domain.addPermission(role);\r\n }\r\n }\r\n\r\n acl1.addScope(domain);\r\n\r\n security.addAcl(acl1);\r\n\r\n // client 2 only has read permission\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Builder acl2 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL\r\n .newBuilder();\r\n acl2.setIdentity(2);\r\n acl2.setKey(ByteString.copyFromUtf8(\"asdfasdf2\"));\r\n\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope.Builder domain2 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope\r\n .newBuilder();\r\n domain2.addPermission(Permission.READ);\r\n acl2.addScope(domain2);\r\n\r\n security.addAcl(acl2);\r\n\r\n // client 3 only has write permission\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Builder acl3 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL\r\n .newBuilder();\r\n acl3.setIdentity(3);\r\n acl3.setKey(ByteString.copyFromUtf8(\"asdfasdf3\"));\r\n\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope.Builder domain3 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope\r\n .newBuilder();\r\n domain3.addPermission(Permission.WRITE);\r\n acl3.addScope(domain3);\r\n\r\n security.addAcl(acl3);\r\n\r\n // client 4 only has delete permission\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Builder acl4 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL\r\n .newBuilder();\r\n acl4.setIdentity(4);\r\n acl4.setKey(ByteString.copyFromUtf8(\"asdfasdf4\"));\r\n\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope.Builder domain4 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope\r\n .newBuilder();\r\n domain4.addPermission(Permission.DELETE);\r\n acl4.addScope(domain4);\r\n\r\n security.addAcl(acl4);\r\n\r\n // client 5 only has read and write permission\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Builder acl5 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL\r\n .newBuilder();\r\n acl5.setIdentity(5);\r\n acl5.setKey(ByteString.copyFromUtf8(\"asdfasdf5\"));\r\n\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope.Builder domain5 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope\r\n .newBuilder();\r\n domain5.addPermission(Permission.READ);\r\n domain5.addPermission(Permission.WRITE);\r\n acl5.addScope(domain5);\r\n\r\n security.addAcl(acl5);\r\n\r\n // client 6 only has read and delete permission\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Builder acl6 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL\r\n .newBuilder();\r\n acl6.setIdentity(6);\r\n acl6.setKey(ByteString.copyFromUtf8(\"asdfasdf6\"));\r\n\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope.Builder domain6 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope\r\n .newBuilder();\r\n domain6.addPermission(Permission.READ);\r\n domain6.addPermission(Permission.DELETE);\r\n acl6.addScope(domain6);\r\n\r\n security.addAcl(acl6);\r\n\r\n // client 7 only has write and delete permission\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Builder acl7 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL\r\n .newBuilder();\r\n acl7.setIdentity(7);\r\n acl7.setKey(ByteString.copyFromUtf8(\"asdfasdf7\"));\r\n\r\n com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope.Builder domain7 = com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.Scope\r\n .newBuilder();\r\n domain7.addPermission(Permission.WRITE);\r\n domain7.addPermission(Permission.DELETE);\r\n acl7.addScope(domain7);\r\n\r\n security.addAcl(acl7);\r\n JsonUtil.toJson(security.build());\r\n //\t\tSystem.out.println(JsonUtil.toJson(security.build()));\r\n\r\n Command.Builder setupBuilder = Command.newBuilder();\r\n com.seagate.kinetic.proto.Kinetic.Command.Setup.Builder setup = setupBuilder\r\n .getBodyBuilder().getSetupBuilder();\r\n setup.setNewClusterVersion(1);\n \n /**\n * XXX protocol-3.0.0\n */\n \r\n //setup.setInstantSecureErase(false);\r\n //setup.setSetPin(ByteString.copyFromUtf8(\"pin002\"));\r\n //setup.setPin(ByteString.copyFromUtf8(\"pin001\"));\r\n\r\n JsonUtil.toJson(setup.build());\r\n //\t\tSystem.out.println(JsonUtil.toJson(setup.build()));\r\n\r\n Command.Builder getLogBuilder = Command.newBuilder();\r\n com.seagate.kinetic.proto.Kinetic.Command.GetLog.Builder getLog = getLogBuilder\r\n .getBodyBuilder().getGetLogBuilder();\r\n getLog.addTypes(Type.TEMPERATURES);\r\n getLog.addTypes(Type.CAPACITIES);\r\n getLog.addTypes(Type.UTILIZATIONS);\r\n JsonUtil.toJson(getLog.build());\r\n //\t\tSystem.out.println(JsonUtil.toJson(getLog.build()));\r\n\r\n }", "@Test\n\tpublic void testAddRoles_3()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tSet<String> roleNames = null;\n\n\t\tfixture.addRoles(roleNames);\n\n\t\t// add additional test code here\n\t}", "private void addFolder(){\n }", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"role\"})\n public void _4_2_6_findMultiRolesByName() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n c_1.getId()+\"/departments/**/roles?name=manager\")\n .header(AUTHORIZATION, ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.roles\",hasSize(2)));\n }", "void setRole(String roles);", "private void loadJSON() throws FileNotFoundException\n\t{\n\n\t\tGsonBuilder builder= new GsonBuilder();\n\t\tGson gson = builder.create();\n\t\t\t\t\n\t\t//get a list of folders in the data directory\n\t\t\n\t\tFile[] directories = new File(\"data\").listFiles();\n\n\t\t//Loop through folders in data directory\n\t\tfor(File folder : directories)\n\t\t\t{\n\t\t\t\t//get a list of files inside the folder\n\t\t\t\tFile[] jsonItems = new File(folder.toString()).listFiles();\n\t\t\t\t\n\t\t\t\t//Loop through files inside the folder \n\t\t\t\tfor(File file : jsonItems)\n\t\t\t\t{\n\t\t\t\t\t//Store in directory map... substring to remove the \"data/\" portion... placed by filename to foldername\n\t\t\t\t\tString dir = file.toString().substring(5);\n\t\t\t\t\t\n\t\t\t\t\t//Generate player data from gson\n\t\t\t\t\tJsonReader reader = new JsonReader(new FileReader(file));\n\t\t\t\t\tPlayer player = gson.fromJson(reader, Player.class);\n\t\t\t\t\t\n\t\t\t\t\t//Store it in the map tied to it's directory\n\t\t\t\t\tplayerData.put(dir, player);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private static void enterFolder(File folder, int i, GameFile gameFile) throws IOException {\r\n\t\tfor(File f: folder.listFiles()) { //loops through all files in a folder folder\r\n\t\t\tif(f.isFile()) { //if the file is not a folder just use the file\r\n\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(f));\r\n\t\t\t\tString path = f.getPath();\r\n\t\t\t\tString field = path.substring(path.indexOf(\"\\\\\")+1, path.lastIndexOf(\"\\\\\")).replace(\"\\\\\", \".\")+\"?\";\r\n\t\t\t\tread(br, field, \"\", i, gameFile);\r\n\t\t\t} else { //otherwise repeat with the current file\r\n\t\t\t\tenterFolder(f, i+1, gameFile);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void loadRoles(String jRestKey, HashMap<String, Object> hmapRoles,\n\t Definition apiDefinition) {\n\t// 1. If Roles keyword is present then check for emptyness\n\t// or null of its value -Done\n\t// 2. Automatically substitute -3022 if no roles are present - Done\n\t// 3. If value for Roles is not JSON array catch exception and inform - Done\n\t//\n\tif (hmapRoles.containsKey(Constants.gsLangTokenRoles)) {\n\t JSONArray defRoles = (JSONArray) hmapRoles.get(Constants.gsLangTokenRoles);\n\n\t if (defRoles != null && defRoles.size() >= Constants.gshMinNumberOfRoles) {\n\t\tfor (short shRoleIndex = 0; shRoleIndex < defRoles.size(); shRoleIndex++) {\n\t\t String sRole = defRoles.get(shRoleIndex).toString().trim();\n\t\t if (sRole.length() > 0) {\n\t\t\tapiDefinition.addRole(sRole);\n\t\t }// if (sRole.length() > 0)\n\t\t}// for (short shRoleIndex = 0; shRoleIndex < defRoles.size(); shRoleIndex++)\n\n\t\tif (apiDefinition.getRoles().size() == 0) {\n\t\t apiDefinition.addRole(String.valueOf(Constants.gshDefaultRoleId));\n\t\t}// if (apiDefinition.getRoles().size() == 0)\n\t } else {\n\t\tmLogger.error(Exceptions.gsNullSetOfRolesGiven);\n\t }// if (defRoles != null && defRoles.size() ... )\n\t} else {\n\t apiDefinition.addRole(String.valueOf(Constants.gshDefaultRoleId));\n\n\t mLogger.debug(String.format(Exceptions.gsDefaultRoleAdded, apiDefinition.getRoles()\n\t\t .toString(), jRestKey));\n\t}// end of if(jsonEntry.getValue().containsKey(Constants.gsLangTokenRoles))\n }", "private void addData(String folderName, ArrayList<String> loader1, ArrayList<String> loader2) throws IOException {\n LoadAndSave las =new LoadAndSave();\n las.createNewFolder(folderName);\n for(int x=0;x<loader1.size();x++) {\n las.addWords(loader1.get(x), loader2.get(x*3), loader2.get(x*3+1), folderName);\n }\n }", "private static void exportRoles(GraknClient.Session session, Path schemaRoot) throws IOException {\n final File outputFileRole = schemaRoot.resolve(\"role\").toFile();\n GraknClient.Transaction tx = session.transaction().write();\n Stack<String> exportingTypes = new Stack<>();\n exportingTypes.push(\"role\");\n exportExplicitHierarchy(exportingTypes, outputFileRole, tx, false);\n tx.close();\n\n LOG.info(\"Exported role hierarchy\");\n\n }", "@Test\n\tpublic void testAddRoles_4()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tSet<String> roleNames = new HashSet();\n\n\t\tfixture.addRoles(roleNames);\n\n\t\t// add additional test code here\n\t}", "@Test\n\tpublic void testAddRoles_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tSet<String> roleNames = new HashSet();\n\n\t\tfixture.addRoles(roleNames);\n\n\t\t// add additional test code here\n\t}", "private ExportRoles() {}", "public void testCreateRoles4() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role4\", \"user4\", \"upload-services\");\r\n\r\n }", "public void testCreateRoles3() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role3\", \"user3\", \"manage-security\");\r\n\r\n }", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"role\"})\n public void _4_2_6_findMultiRolesByNameRecusiveNotExist() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n c_1.getId()+\"/departments/\"+\n d_1.getId()+\n \"/roles?name=manager\")\n .header(AUTHORIZATION, ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded\").doesNotExist());\n }", "public void testCreateRoles1() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role1\", \"user1\", \"Login to admin console\");\r\n }", "public void addRole(String username, String role) throws UserNotExistsException ;", "public ArrayList <JSONObject> parseJSONFiles(String JSONdir) throws IOException {\n BufferedReader br;\n String jsonString;\n JSONParser parser = new JSONParser();\n ArrayList <JSONObject> jsonArrayList = new ArrayList<>();\n\n //visit dir that holds JSON files\n File dir = new File(JSONdir);\n\n //process every json object in given dir\n File[] jsonFiles = dir.listFiles((dir1, filename) -> filename.endsWith(\".json\"));\n\n //each newline in json object is a tweet\n for (File jsonFile : requireNonNull(jsonFiles)) {\n\n //create br to read tweets\n br = new BufferedReader(new FileReader(jsonFile.getCanonicalPath()));\n\n //while buffer has tweets to read\n while ((jsonString = br.readLine()) != null) {\n //parse the tweet\n try {\n jsonArrayList.add((JSONObject) parser.parse(jsonString));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n }\n //close br and open next text file\n br.close();\n }\n return jsonArrayList;\n }", "public void addRole(String role) {\n StringBuffer rolesStringBuffer = new StringBuffer(this.roles);\n rolesStringBuffer.append(\",\").append(role);\n this.roles = rolesStringBuffer.toString();\n }", "private static ArrayList<Team> jsontoTeam(ArrayList<File> fileList, String path){\n ArrayList<Team> teamArray = new ArrayList<Team>();\r\n int count = 0;\r\n\r\n for(File file: fileList){\r\n try {\r\n //reads the file as a JsonElement\r\n JsonElement fileElement = JsonParser.parseReader(new FileReader(file));\r\n //converts the jsonElement into as jsonObject\r\n JsonObject fileObject = fileElement.getAsJsonObject();\r\n //reads team array and stores as a JsonArray\r\n JsonArray jsonArrayTeam = fileObject.get(\"team\").getAsJsonArray();\r\n\r\n String extra_comments = fileObject.get(\"extra_comments\").getAsString();\r\n teamArray.add(new Team(extra_comments,file.toString()));\r\n\r\n //searches through all JSON files converts to a team\r\n for(JsonElement tokimonElement: jsonArrayTeam){\r\n JsonObject tokimonJsonObject = tokimonElement.getAsJsonObject();\r\n try {\r\n String name = tokimonJsonObject.get(\"name\").getAsString();\r\n String id = tokimonJsonObject.get(\"id\").getAsString();\r\n\r\n JsonObject compatibilityObject = tokimonJsonObject.get(\"compatibility\").getAsJsonObject();\r\n Double score = compatibilityObject.get(\"score\").getAsDouble();\r\n if(score<0){\r\n System.out.println(\"Score less than 0\");\r\n System.out.println(\"Path and Filename: \" + file.toString());\r\n System.exit(-1);\r\n }\r\n String comment = compatibilityObject.get(\"comment\").getAsString();\r\n teamArray.get(count).addToki(new Tokimon(name, id, new Compatibility(score, comment)));\r\n } catch(Exception e){\r\n e.printStackTrace();\r\n System.out.println(\"Path and Filename: \" + file.toString());\r\n System.exit(-1);\r\n }\r\n\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n System.out.println(\"Path and Filename: \" + file.toString());\r\n System.exit(-1);\r\n }\r\n count++;\r\n }\r\n return teamArray;\r\n }", "@Test\n\tpublic void testAddRoles_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tSet<String> roleNames = new HashSet();\n\n\t\tfixture.addRoles(roleNames);\n\n\t\t// add additional test code here\n\t}", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n File f = new File(\"Role.txt\");\n FileOutputStream fos = new FileOutputStream(f);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n //a 2d array is used to save the role description and the role salary\n String[][] role = new String[3][2];\n role[0][0] = \"Hardware Technician\";\n role[0][1] = \"32\";\n role[1][0] = \"Programmer\";\n role[1][1] = \"50\";\n role[2][0] = \"Software Installer\";\n role[2][1] = \"26\";\n //the instances are made and written to the file\n for (int i = 0; i < 3; i++) {\n Role role1 = new Role();\n role1.setRoleID(i + 1);\n role1.setRoleDesc(role[i][0]);\n role1.setHourlyPay(Integer.parseInt(role[i][1]));\n oos.writeObject(role1);\n }\n fos.close();\n oos.close();\n }", "public void setRoles(String roles) {\n this.roles = roles;\n }", "public static String createRole() {\n InputStreamReader sr = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(sr);\n String role = null;\n try {\n while (true) {\n role = br.readLine();\n\n if (role.equalsIgnoreCase(\"воин\")) {\n System.out.println(\"Замечательно! Теперь ты ВОИН.\");\n System.out.println(\"Ты получаешь длинный меч, тяжелый щит и сияющие доспехи.\");\n break;\n }\n\n if (role.equalsIgnoreCase(\"маг\")) {\n System.out.println(\"Замечательно! Теперь ты МАГ.\");\n System.out.println(\n \"Ты получаешь искрящийся посох великой мощи стихий (береги бороду!) и расшитый халат.\");\n break;\n }\n\n if (role.equalsIgnoreCase(\"разбойник\")) {\n System.out.println(\"Замечательно! Теперь ты РАЗБОЙНИК.\");\n System.out.println(\n \"Ты не получаешь ничего, ведь разбойник сам берет то, что ему положено! Ну ладно, вот тебе пара красивых кинжалов со стразиками и черная повязка на глаза.\");\n break;\n } else {\n System.out.println(\"- Опять? Прекращай. Выбери из предложенных выше.\");\n }\n\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n return role;\n }", "public void testCreateRoles5() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role5\", \"user5\", \"manage-services\");\r\n\r\n }", "void createList(int i, CommandEvent event) {\n System.out.println(i);\n int newLimit = limit;\n if(i > 0){\n newLimit = i + limit - 1;\n }\n\n String list = \"\";\n for (; i < repos.size(); i++) {\n String temp = \"**\" + String.valueOf(i + 1);\n list = list + temp + \".** \" + repos.get(i) + \"\\n\";\n eb.setDescription(list);\n if (i == newLimit - 1) {\n int counter = i + 1;\n event.getChannel().sendMessage(eb.build()).complete().addReaction(\"U+27A1\").queue();\n waiter.waitForEvent(GuildMessageReactionAddEvent.class,\n e -> e.getChannel().equals(event.getChannel())\n && e.getUser().equals(event.getAuthor())\n , e -> createList(counter, event),\n 30, TimeUnit.SECONDS, () -> event.reply(\"Please input your selected path\"));\n return;\n }\n }\n event.getChannel().sendMessage(eb.build()).queue();\n return;\n }", "public GraphNode addRole(String role){\n\t\tInteger intValue = addElement(role, 2);\n\t\t//System.out.println(role + \" Added with : \" + intValue);\n\t\tGraphNode roleVar = new GraphNode(intValue, 2);\n\t\tauthGraph.addVertex(roleVar);\n\t\treturn roleVar;\n\t}", "protected abstract String[] getFolderList() throws IOException;", "void setRoles(Set<String> roles);", "private static void readUserListFromFile() {\n\t\tJSONParser parser = new JSONParser();\n\n\t\ttry (Reader reader = new FileReader(\"users.json\")) {\n\n\t\t\tJSONArray userListJSON = (JSONArray) parser.parse(reader);\n\n\t\t\tfor (int i = 0 ; i < userListJSON.size(); i++) {\n\t\t\t\tJSONObject user = (JSONObject) userListJSON.get(i);\n\t\t\t\tString name = (String) user.get(\"name\");\n\t\t\t\tString surname = (String) user.get(\"surname\");\n\t\t\t\tString username = (String) user.get(\"username\");\n\t\t\t\tString password = (String) user.get(\"password\");\n\t\t\t\tString account = (String) user.get(\"account\");\n\n\t\t\t\tif(account.equals(\"employee\")) {\n\t\t\t\t\tMain.userList.add(new Employee(username, name, surname, password));\n\t\t\t\t} else {\n\t\t\t\t\tMain.userList.add(new Customer(username, name, surname, password));\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void setSystabIOFolderName(String name){\n this.folderName = name + \"\\\\\"; // Append the \\\\ to get inside the folder\n }", "@Override\n\tpublic void run() {\n\t\tString path = \"D:\\\\test\";\n\t\tfor(int i=1;i<65535;i++){\n\t\t\tFile file = new File(path+File.separator+name+i);\n\t\t\tif(!file.exists()){\n\t\t\t\tfile.mkdirs();\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t}", "public static ArrayList<Course> loadAllJsonFlies(){\n List<String> jsonFileNames = Data.getJsonFilesAsList();\n ArrayList<Course> coursesOfAllSemesters = new ArrayList<>();\n for (String jsonFileName:jsonFileNames){\n ArrayList<Course> coursesOfSemester = loadJsonByFileName(jsonFileName);\n coursesOfAllSemesters.addAll(coursesOfSemester);\n }\n return coursesOfAllSemesters;\n }", "@Override\n\tpublic void addRole(Role role) {\n\t\tSnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0);\n\t\tlong id = idWorker.nextId();\n\t\trole.setRoleid(Long.toString(id));\n\t\troleMapper.addRole(role);\n\t}", "public static void main(String[] args) throws TemplateManagerException {\n\n File directory = new File(TemplateManagerConstants.TEMPLATES_DIRECTORY);\n Collection<TemplateGroup> availableTemplateGroups = new ArrayList();\n\n // To store files from the directory\n File[] files = directory.listFiles();\n if (files != null) {\n for (final File fileEntry : files) {\n // If file is a valid json file\n if (fileEntry.isFile() && fileEntry.getName().endsWith(\"json\")) {\n TemplateGroup templateGroup = null;\n // Convert to TemplateGroup object\n try {\n templateGroup = TemplateManagerHelper.jsonToTemplateGroup(TemplateManagerHelper.fileToJson(fileEntry));\n } catch (NullPointerException ne) {\n System.out.println(\"Unable to convert TemplateGroup file : \" + fileEntry.getName() + \" \" + ne);\n }\n\n // Validate contents of the object\n if (templateGroup != null) {\n try {\n TemplateManagerHelper.validateTemplateGroup(templateGroup);\n // Add only valid TemplateGroups to the template\n availableTemplateGroups.add(templateGroup);\n } catch (TemplateManagerException e) { //todo: implement properly\n // Files with invalid content are not added.\n System.out.println(\"Invalid Template Group configuration file found : \" + fileEntry.getName() + e);\n }\n } else {\n System.out.println(\"Invalid Template Group configuration file found : \" + fileEntry.getName());\n }\n\n }\n }\n }\n\n System.out.println(availableTemplateGroups.size() + \" Templates Found\");\n\n }", "public void testCreateRoles2() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role2\", \"user2\", \"manage-configuration\");\r\n\r\n }", "public void testCreateRoles6() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role6\", \"user6\", \"monitor-system\");\r\n }", "public static void main (String[] args){\n validPaths(args);\r\n\r\n ArrayList<File> files = new ArrayList<File>();\r\n\r\n //finds all JSON files\r\n joinFiles(args[0], files);\r\n if(files.size()==0){\r\n System.out.println(\"No JSON files found\");\r\n System.out.println(\"Path and Filename: \" + args[0]);\r\n System.exit(-1);\r\n }\r\n\r\n //converts JSON files to teams\r\n ArrayList<Team> teams = jsontoTeam(files, args[0]);\r\n\r\n //checks all teams are valid\r\n checkOne(teams);\r\n\r\n //sorts teams to be grouped by team number\r\n Collections.sort(teams, new TeamComparator());\r\n\r\n //writes to csv\r\n writeCsv(args[1], teams);\r\n }", "protected List<Map<String, List<String>>> createDefaultBoxAceMapList() {\n List<Map<String, List<String>>> list = new ArrayList<Map<String, List<String>>>();\n\n // role2\n List<String> rolList = new ArrayList<String>();\n Map<String, List<String>> map = new HashMap<String, List<String>>();\n rolList.add(\"read\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role2\"), rolList);\n list.add(map);\n\n // role3\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"write\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role3\"), rolList);\n list.add(map);\n\n // role4\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"read\");\n rolList.add(\"write\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role4\"), rolList);\n list.add(map);\n\n // role5\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"exec\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role5\"), rolList);\n list.add(map);\n\n // role6\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"read-acl\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role6\"), rolList);\n list.add(map);\n\n // role7\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"write-acl\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role7\"), rolList);\n list.add(map);\n\n // role8\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"write-properties\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role8\"), rolList);\n list.add(map);\n\n // role9\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"read-properties\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role9\"), rolList);\n list.add(map);\n\n return list;\n }", "@Override\n\tpublic void createFolder(String bucketName, String folderName) {\n\t\t\n\t}", "@Test\n\tpublic void testAddRole_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tString roleName = \"\";\n\n\t\tfixture.addRole(roleName);\n\n\t\t// add additional test code here\n\t}", "@Test\n void getUserRolesByNameLikeSuccess() {\n List<UserRoles> userRoles = genericDao.getEntityByName(\"roleName\", \"all\");\n assertEquals(2, userRoles.size());\n List<UserRoles> users2 = genericDao.getEntityByName(\"roleName\", \"user\");\n assertEquals(2, users2.size());\n }", "public static void loadPracticeListFromFile() {\n JSONParser jsonParser = new JSONParser();\n\n try (FileReader reader = new FileReader(\"src/practiceList.json\")) {\n // Read JSON file\n Object object = jsonParser.parse(reader);\n\n //Iterate over word list array\n JSONArray wordList = (JSONArray) object;\n for (Object o : wordList) {\n\n JSONObject next = (JSONObject) o;\n String extra = \"\";\n\n if (((String) next.get(\"wordType\")).equalsIgnoreCase(\"verb\")) {\n extra = \"to \";\n }\n\n Word loadedWord = new Word(extra + next.get(\"english\"), (String) next.get(\"welsh\"), (String) next.get(\"wordType\"));\n\n addIntoPracticedWords(loadedWord);\n }\n\n } catch (ParseException | IOException e) {\n System.out.println(\"PracticeList file not found, will be created on exit.\");\n }\n }", "private void actionAddFolder ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\r\n\t\t\tJFileChooser folderChooser = new JFileChooser();\r\n\t\t\tfolderChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n\r\n\t\t\tint isFolderSelected = folderChooser.showOpenDialog(folderChooser);\r\n\r\n\t\t\tif (isFolderSelected == JFileChooser.APPROVE_OPTION)\r\n\t\t\t{\r\n\t\t\t\tString folderPath = folderChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\tFile folderFileDescriptor = new File(folderPath);\r\n\t\t\t\tFile[] listFolderFiles = folderFileDescriptor.listFiles();\r\n\r\n\t\t\t\tString[] fileList = new String[listFolderFiles.length];\r\n\r\n\t\t\t\tfor (int i = 0; i < listFolderFiles.length; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfileList[i] = listFolderFiles[i].getPath();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tDataController.scenarioOpenFolder(fileList);\r\n\r\n\t\t\t\thelperDisplayProjectFiles();\r\n\t\t\t\thelperDisplayInputImage();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\t}", "private void processNewData(Map<Integer, ArrayList<String>> data, ArrayList<String> folderName) throws IOException {\n for(int x=0; x<folderName.size();x++) {\n if(Arrays.asList(this.getListOfFileInArray()).contains(folderName.get(x))) {\n this.problemSolve(folderName.get(x), data.get(x*2), data.get(x*2+1)); \n } else {\n this.addData(folderName.get(x), data.get(x*2), data.get(x*2+1));\n }\n }\n }", "public void createPlayerListArray(int numberOfPlayers) throws IOException {\n //Generate string from JSON data\n String jsonFile = \"data/players.json\";\n //Instantiate new Gson class\n Gson gson = new Gson();\n FileReader fileReader = new FileReader(jsonFile);\n JsonReader jsonReader = new JsonReader(fileReader);\n ReadJson[] data = gson.fromJson(jsonReader, ReadJson[].class);\n\n for (int i = 0; i < numberOfPlayers; i++) {\n\n String firstName = data[i].getFirst_name();\n String lastName = data[i].getLast_name();\n\n this.playersList.add(new Player(firstName, lastName));\n //shuffle the arrayList for randomness\n Collections.shuffle(playersList);\n\n }\n }", "private void processFolders(List<File> folderList, java.io.File parentFolder) {\n // process each folder to see if it needs to be updated;\n for (File f : folderList) {\n String folderName = f.getTitle();\n java.io.File localFolder = new java.io.File(parentFolder, folderName);\n Log.e(\"folder\",localFolder.getAbsolutePath());\n if (!localFolder.exists())\n localFolder.mkdirs();\n getFolderContents(f, localFolder);\n }\n }", "private void renameFolder(String folderName, ArrayList<String> loader1, ArrayList<String> loader2) throws IOException {\n String inputValue= JOptionPane.showInputDialog(WED_ZERO.lang.getInstruct().get(1)[30]);\n if(Arrays.asList(new FileManaging().getListOfFileInArray()).contains(inputValue)) {\n ERROR.ERROR_356(Launch.frame);\n this.renameFolder(inputValue, loader1, loader2);\n } else if(inputValue==null||inputValue.length()<1) {\n ERROR.ERROR_357(Launch.frame);\n this.problemSolve(folderName, loader1, loader2);\n } else {\n this.addData(inputValue, loader1, loader2);\n }\n }", "@Test\n\tpublic void testWriteToFolderManyEmployers() throws IOException {\n\t\t_testEmployer.addCar(_tempCar);\n\t\t_testEmployer.SaveState();\n\t}", "public String checkRoleForPath(final String role) {\n\t\tSet<Map.Entry<String, String>> entrySet = allRollesForPath.entrySet();\n\t\tString chooseRole = null;\n\n\t\tfor (Map.Entry<String, String> pair : entrySet) {\n\t\t\tif (role.equals(pair.getKey())) {\n\t\t\t\tchooseRole = pair.getValue();\n\t\t\t}\n\t\t}\n\t\treturn chooseRole;\n\t}", "@Test(groups = \"role\", priority = 1)\n public void testRoleAdd() throws ExecutionException, InterruptedException {\n this.authDisabledAuthClient.roleAdd(rootRole).get();\n this.authDisabledAuthClient.roleAdd(userRole).get();\n }", "private Map<String, String> setRolesForPath() {\n\t\tallRollesForPath = new HashMap<String, String>();\n\t\tallRollesForPath.put(ServiceParamConstant.ADMIN_ROLE, JSPPagePath.PATH_ADMIN_PAGE);\n\t\tallRollesForPath.put(ServiceParamConstant.BOSS_ROLE, JSPPagePath.PATH_BOSS_PAGE);\n\t\tallRollesForPath.put(ServiceParamConstant.HR_ROLE, JSPPagePath.PATH_HR_PAGE);\n\t\tallRollesForPath.put(ServiceParamConstant.EMPLOYEE_ROLE, JSPPagePath.PATH_EMPLOYEE_PAGE);\n\t\treturn allRollesForPath;\n\t}", "public void saveRoles(){\r\n\t\tif(roles == null)\r\n\t\t\treturn;\r\n\r\n\t\tif(!rolesTreeView.isValidRolesList())\r\n\t\t\treturn;\r\n\r\n\t\tList<Role> deletedRoles = rolesTreeView.getDeletedRoles();\r\n\t\tSaveAsyncCallback callback = new SaveAsyncCallback(MainViewControllerUtil.getDirtyCount(roles) + (deletedRoles != null ? deletedRoles.size() : 0),\r\n\t\t\t\tOpenXdataText.get(TextConstants.ROLES_SAVED_SUCCESSFULLY),OpenXdataText.get(TextConstants.PROBLEM_SAVING_ROLES),roles,deletedRoles,this);\r\n\r\n\t\t//Save new and modified roles.\r\n\t\tfor(Role role : roles) {\r\n\t\t\tif(!role.isDirty())\r\n\t\t\t\tcontinue;\r\n\t\t\telse{\r\n\t\t\t\tcallback.setCurrentItem(role);\r\n\t\t\t\tMainViewControllerUtil.setEditableProperties(role);\r\n\t\t\t}\r\n\r\n\t\t\tContext.getPermissionService().saveRole(role, callback);\r\n\t\t}\r\n\r\n\t\t//Save deleted roles.\r\n\t\tif(deletedRoles != null){\r\n\t\t\tfor(Role role : deletedRoles) {\r\n\t\t\t\tcallback.setCurrentItem(role);\r\n\t\t\t\tContext.getPermissionService().deleteRole(role, callback);\r\n\t\t\t}\r\n\t\t\tdeletedRoles.clear();\r\n\t\t}\r\n\t}", "public interface RepositorySetupService {\n\n\tString USER_PATH = \"userPath\";\n String GROUP_PATH = \"groupPath\";\n String MEMBER_OF = \"memberOf\";\n\n /**\n * adds ACL accordiong to rules declared as JSON file; e.g.\n * <ul>\n * <li>allow read for 'everyone' on root ('/') to walk trough (this node only)</li>\n\t * <li>deny read for 'a-group' on '/apps' and all subnodes and ensure that this folder and the group exists</li>\n\t * <li>make 'everyone' and 'someone' a member of 'a-group' (both principals must exist)</li>\n * <li>remove each ACL for 'a-group' from '/conf' and ensure that this group exists</li>\n * </ul>\n * [{\n * \"path\": \"/\",\n * \"acl\": [{\n * \"principal\": \"everyone\",\n\t * \"reset\": true,\n\t * \"rules\": [{\n\t * \"grant\": \"jcr:read\",\n * \"restrictions\": {\n * \"rep:glob\": \"\"\n * }\n * }]\n * }]\n * },{\n * \"path\": \"/apps\",\n * \"jcr:primaryType\": \"sling:Folder\"\n * \"acl\": [{\n\t * \"principal\": [\n\t * \"a-group\"\n\t * \"another-group\"\n\t * ],\n * \"groupPath\": \"example\",\n\t * \"deny\": [\n * \"jcr:read\"\n * ]\n * }]\n * },{\n\t * \"principal\": [\n\t * \"everyone\",\n\t * \"someone\"\n\t * ],\n * \"memberOf\": [\n * \"a-group\"\n * ]\n * }]\n * },{\n * \"path\": \"/conf\",\n * \"acl\": [{\n\t * \"principal\": \"a-user\",\n\t * \"userPath\": \"example\",\n\t * \"memberOf\": [\n\t * \"a-group\"\n\t * ]\n * }]\n * }]\n *\n * @param session the session (not resolver to make it easy usable in install hooks)\n * @param jsonFilePath a repository path to the ACL JSON file\n */\n void addJsonAcl(@NotNull Session session, @NotNull String jsonFilePath,\n @Nullable Map<String, Object> values)\n throws RepositoryException, IOException;\n\n void addJsonAcl(@NotNull Session session, @NotNull Reader reader,\n @Nullable Map<String, Object> values)\n throws RepositoryException, IOException;\n\n /**\n * revert all changes made by 'addJsonAcl'... - use the same configuration file\n */\n void removeJsonAcl(@NotNull Session session, @NotNull String jsonFilePath,\n @Nullable Map<String, Object> values)\n throws RepositoryException, IOException;\n\n void removeJsonAcl(@NotNull Session session, @NotNull Reader reader,\n @Nullable Map<String, Object> values)\n throws RepositoryException, IOException;\n}", "private void listFileMyVideo() throws JSONException {\n\n listFileMyVideo = new JSONArray();\n\n int count = countFileMyVideo();\n\n for (int i = 0; count > i; i++) {\n\n JSONObject obj = new JSONObject();\n obj.put(\"name\", get_FileName(getPathMyVideo(), i));\n obj.put(\"path\", get_FilePath(getPathMyVideo(), i));\n\n listFileMyVideo.put(obj);\n }\n }", "Builder rolesAllowed(String... roles) {\n return rolesAllowed(Arrays.asList(roles));\n }", "public static String[] pickListOfNImagesRandom(int n, File dir ){\n String[] imageFileNameList = new String[n+5];\n String[] inputFileList = dir.list();\n for(int i =0; i < imageFileNameList.length; i++){\n int random = (int) getRandomIntegerBetweenRange(0,inputFileList.length-1);\n imageFileNameList[i] = inputFileList[random];\n }\n /*\n for(String imageFileNameListItem : imageFileNameList){\n System.out.println(imageFileNameListItem);\n }\n */\n return imageFileNameList;\n }", "@Test\n\tpublic void testAddAll_3()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<SimpleRole> roles = null;\n\n\t\tfixture.addAll(roles);\n\n\t\t// add additional test code here\n\t}", "Role getRoles(int index);", "Role getRoles(int index);", "public void gatherLevelJson(AssetDirectory directory, int world) {\r\n\t\tlevelAssets = directory.getEntry( String.format(\"level%d\", level), JsonValue.class);\r\n\t}", "public static void createFiles()\n\t{\n\t\t//Variable Declaration\n\t\tScanner obj = new Scanner (System.in);\n\t\tString fileName; \n\t\tint linesCount;\n\t\tList<String> content = new ArrayList<String>();\n\t\t\n\t\t//Read file name from user\n\t\tSystem.out.println(\"Enter the FIle Name:\");\n\t\tfileName= obj.nextLine();\n\t\t\n\t\t//Read number of lines from user\n\t\tSystem.out.println(\"Enter how many line in the file:\");\n\t\tlinesCount= Integer.parseInt(obj.nextLine());\n\t\t\n\t\t//Read Lines from user\n\t\tfor(int i=1; i<=linesCount;i++)\n\t\t{\n\t\t\tSystem.out.println(\"Enter line \"+i+\":\");\n\t\t\tcontent.add(obj.nextLine());\n\t\t}\n\t\t\n\t\t//Save the content into the file\n\t\tboolean isSaved = FileManager.createFiles(folderpath, fileName, content);\n\t\t\n\t\tif(isSaved)\n\t\t\tSystem.out.println(\"File and data is saved sucessfully\");\n\t\telse\n\t\t\tSystem.out.println(\"Some error occured. Please contact [email protected]\");\n\t}", "public void addFolder(TaskFolder folder)\n {\n folders.add(folder);\n }", "Set getRoles();", "public void listFilesForFolder(final File folder) {\n\t\tfor (final File fileEntry : folder.listFiles()) {\n\t\t\tif (fileEntry.isDirectory()) {\n\t\t\t\tlistFilesForFolder(fileEntry);\n\t\t\t} else if (!fileEntry.getName().startsWith(\".\")) {\n\t\t\t\tRunConfigDataNode temp = new RunConfigDataNode(null);\n\t\t\t\ttemp.setName(fileEntry.getName());\n\t\t\t\ttemp.setSerializeDestination(serializePath);\n\t\t\t\tString name = fileEntry.getName();\n\t\t\t\tif (!name.equals(\"entries\")) {\n\t\t\t\t\tRunConfigDataNode config = temp.deserialize();\n\t\t\t\t\tif (!config.isMarkedForDelete()) {\n\t\t\t\t\t\tsavedConfigs.put(name, config);\n\t\t\t\t\t\tnewConfigsNum++;\n\t\t\t\t\t}\n\t\t\t\t\t// if the config is marked for delete, delete it.\n\t\t\t\t\telse {\n\t\t\t\t\t\tfileEntry.delete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n BufferedReader console = new BufferedReader(\r\n new InputStreamReader(System.in));\r\n System.out.print(\"Please enter data file names: \");\r\n \r\n String params = null;\r\n try {\r\n \tparams = console.readLine();\r\n } catch (IOException e) {\r\n \tparams = null;\r\n }\r\n if (params == null) {\r\n \tSystem.out.print(\"Please enter valid file names.\");\r\n \treturn;\r\n }\r\n \r\n StringTokenizer token = new StringTokenizer(params, \",\");\r\n String[] inputParams = new String[100];\r\n int count = 0;\r\n while (token.hasMoreTokens())\r\n \tinputParams[count++] = token.nextToken().trim();\r\n \r\n String[] inputFiles = new String[count];\r\n System.arraycopy(inputParams, 0, inputFiles, 0, count);\r\n \r\n // Start program\r\n Log log = Log.getInstance();\r\n \r\n scanners = new Scanner[inputFiles.length];\r\n writers = new PrintWriter[inputFiles.length];\r\n filenames = inputFiles;\r\n \r\n for (int i = 0; i < inputFiles.length; i++) {\r\n try {\r\n scanners[i] = new Scanner(new File(inputFiles[i]));\r\n } catch (IOException e) {\r\n System.out.println(\"Could not open input file \" + inputFiles[i] + \" for reading.\");\r\n System.out.println(\"Please check if file exists! \" +\r\n \"Program will terminate after closing any opened files.\");\r\n closeScanners();\r\n return;\r\n }\r\n }\r\n \r\n for (int i = 0; i < inputFiles.length; i++) {\r\n try {\r\n writers[i] = new PrintWriter(getJson(inputFiles[i]));\r\n } catch (IOException e) {\r\n System.out.println(\"Could not open input file \" + inputFiles[i] + \" for writing.\");\r\n System.out.println(\"Program will terminate after closing any opened files.\");\r\n \r\n closeScanners();\r\n closeWriters();\r\n return;\r\n }\r\n }\r\n \r\n /*\r\n */\r\n if (!processFilesForValidation(scanners, writers)) {\r\n closeScanners();\r\n cleanWriters();\r\n return;\r\n }\r\n\r\n /*\r\n * Ask the user to enter the name of one of the created output files to display\r\n */\r\n for (int i = 0; i < 2; ++i) {\r\n System.out.print(\"Enter JSON file name: \");\r\n String file = \"\";\r\n try {\r\n file = console.readLine();\r\n } catch (IOException e) {\r\n\r\n }\r\n BufferedReader reader = null;\r\n try {\r\n reader = new BufferedReader(new FileReader(file));\r\n String line;\r\n while ((line = reader.readLine()) != null)\r\n System.out.println(line);\r\n break;\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"The file does not exist.\");\r\n } catch (IOException e) {\r\n System.out.println(\"Failed to read the file.\");\r\n } finally {\r\n try {\r\n if (reader != null)\r\n reader.close();\r\n } catch (IOException e) {\r\n }\r\n }\r\n }\r\n log.close();\r\n \r\n closeScanners();\r\n closeWriters();\r\n }", "@Test(groups = \"wso2.ds.dashboard\", description = \"Assigning dashboard view and edit permission\", dependsOnMethods = \"testAddUserAssignRoles\")\n public void testAddDashboardAndAssignRolesBySetting()\n throws XPathExpressionException, MalformedURLException, InterruptedException {\n addLoginRole(USERNAME_EDITOR);\n addCreateRole(USERNAME_EDITOR);\n addOwnernRole(USERNAME_EDITOR);\n login(USERNAME_EDITOR, PASSWORD_EDITOR);\n deleteDashboards();\n addDashBoardWithLandingPage(dashboardTitle, DASHBOARD_DESCRIPTION);\n getDriver().findElement(By.cssSelector(\"#\" + DASHBOARD_TITLE.toLowerCase() + \" a.ues-edit\")).click();\n allowPersonalizeDashboard();\n redirectToLocation(DS_HOME_CONTEXT, DS_DASHBOARDS_CONTEXT);\n WebElement dashboardItem = getDriver().findElement(By.id(dashboardTitle.toLowerCase()));\n dashboardItem.findElement(By.cssSelector(\".ues-edit\")).click();\n getDriver().findElement(By.id(\"dashboard-settings\")).click();\n getDriver().executeScript(\"scroll(0, 200);\");\n // Add viewer role\n WebElement viewerTextbox = getDriver().findElement(By.id(\"ues-share-view\"));\n viewerTextbox.sendKeys(\"dashboardViewer\");\n viewerTextbox.sendKeys(Keys.TAB);\n // Add editor role\n WebElement editorTextbox = getDriver().findElement(By.id(\"ues-share-edit\"));\n editorTextbox.sendKeys(\"dashboardEditor\");\n editorTextbox.sendKeys(Keys.TAB);\n // Remove all other roles\n getDriver().findElement(By.cssSelector(\".ues-shared-view > .ues-shared-role > .remove-button\")).click();\n getDriver().findElement(By.cssSelector(\".ues-shared-edit > .ues-shared-role > .remove-button\")).click();\n getDriver().findElement(By.id(\"ues-dashboard-saveBtn\")).click();\n }", "public static void main(String[] args) throws IOException \n\t\t{\n\t\t\t\n\t\t\t\n\t\t\tFile dir = new File(\"C:\\\\apache-tomcat-7.0.52\\\\webapps\\\\proj\");\t \n\t\t dir.mkdir();\n\t\t \n\t\t /* File dir1 = new File(\"C:\\\\Root\\\\module\");\n\t\t dir1.mkdir();\n\t\t \t \n\t\t File dir2 = new File(\"C:\\\\Root\\\\module\\\\file\"); \n\t\t dir2.mkdir(); \n\t\t \n\t\t File f=new File(\"C:\\\\Root\\\\module\\\\file\\\\rid.txt\");\n\t\t\tf.createNewFile();\n\t\t\tFileWriter fw=new FileWriter(f);\n\t\t\tfw.write(\"hi ridd\");\n\t\t\tfw.flush();\n\t\t\tfw.close();\n\t\t\t\n\t\t\t File f1=new File(\"C:\\\\Root\\\\module\\\\file\\\\vid.txt\");\n\t\t f1.createNewFile();\n\t\t FileWriter fw1=new FileWriter(f1);\n\t\t\tfw1.write(\"hi vidd\");\n\t\t\tfw1.flush();\n\t\t\tfw1.close();\n\n\t\t\t File f2=new File(\"C:\\\\Root\\\\module\\\\file\\\\khu.txt\");\n\t\t\t f2.createNewFile();\n\t\t\t FileWriter fw2=new FileWriter(f2);\n\t\t\t fw2.write(\"hi khu\");\n\t\t\t fw2.flush();\n\t\t\t fw2.close();\n\t\t\t \n\t\t\t File f3=new File(\"C:\\\\Root\\\\module\\\\file\\\\anu.txt\");\n\t\t\t f3.createNewFile();\n\t\t\t FileWriter fw3=new FileWriter(f3);\n\t\t\t fw3.write(\"hi anuu\");\n\t\t fw3.flush();\n\t\t\t fw3.close();\n\t\t\t\t\t\t\n\t\t \n\t\t /*rename a file*/\n\t\t\t\t \n\t\t}", "void addRoleToUser(int userID,int roleID);", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"role\"})\n public void _4_2_4_findMultiRolesByOccupant() throws Exception {\n /*d_2---r_2---s_1*/\n /*d_1_1---r_1_1-occupant-s_1*/\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n c_1.getId()+\"/departments/**/roles?occupant=\"+\n s_1.getId())\n .header(AUTHORIZATION, ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.roles\",hasSize(2)));\n }", "void setAccountRoles(List<Node> nodes) {\n\t\taccountRoles = new ArrayList<>();\n\t\tfor (Node n : nodes) {\n\t\t\tPermissionVO vo = (PermissionVO) n.getUserObject();\n\t\t\t//we only care about level 4 nodes, which is where permissions are set. Also toss any VOs that don't have permissions in them\n\t\t\tif (SecurityController.PERMISSION_DEPTH_LVL != n.getDepthLevel() || vo.isUnauthorized()) continue;\n\t\t\tvo.setHierarchyToken(n.getFullPath()); //transpose the value compiled in SmartTrakRoleModule\n\t\t\t//System.err.println(\"user authorized for hierarchy: \" + vo.getHierarchyToken())\n\t\t\taccountRoles.add(vo);\n\t\t}\n\t\tbuildACL();\n\t}", "@Override\n public void declareRoles(String... roleNames) {\n\n }", "@Test\n\tpublic void testAddRole_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tString roleName = \"\";\n\n\t\tfixture.addRole(roleName);\n\n\t\t// add additional test code here\n\t}", "public void setRole( String role )\n {\n if ( roles == null )\n {\n roles = new TreeSet<>( String.CASE_INSENSITIVE_ORDER );\n }\n\n this.roles.add( role );\n }", "private void prepareFolder(String name, String newFolderName) {\n }", "@Test\n\tpublic void testHasAllRoles_3()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<String> roleIdentifiers = new Vector();\n\n\t\tboolean result = fixture.hasAllRoles(roleIdentifiers);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "public void setRole(java.lang.String value) {\n this.role = value;\n }", "static void ReadAndWriteDataSet(String folderName) throws IOException\n\t{\n\t\t\n\t\t String path = \"data\"+FS+\"data_stage_one\"+FS+folderName; // Folder path \n\t\t \n\t\t String filename, line;\n\t\t File folder = new File(path);\n\t\t File[] listOfFiles = folder.listFiles();\n\t\t BufferedReader br = null;\n\t\t for(int i=0; i < listOfFiles.length; i++)\n\t\t { \n\t\t\t System.out.println(listOfFiles[i].getName());\n\t\t\t filename = path+FS+listOfFiles[i].getName();\n\t\t\t try\n\t\t\t {\n\t\t\t\t br= new BufferedReader(new FileReader(new File(filename)));\n\t\t\t\t while((line = br.readLine())!= null)\n\t\t\t\t {\n\t\t\t\t\tfor(int j=0; j<prep.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tStringTokenizer st = new StringTokenizer(line);\n\t\t\t\t\t\twhile(st.hasMoreTokens())\n\t\t\t\t\t\t\tif(st.nextToken().equalsIgnoreCase(prep[j]))\n\t\t\t\t\t\t\t{\t//System.out.println(line);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(arr[j] == null)\n\t\t\t\t\t\t\t\t\tarr[j] = new ArrayList<String>();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tarr[j].add(line.toLowerCase().replaceAll(\"\\\\p{Punct}\",\"\").trim().replaceAll(\"\\\\s+\", \" \"));\n\t\t\t\t\t\t\t\tbreak;\n\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 }\n\t\t\t catch(Exception e)\n\t\t\t {\n\t\t\t\t System.err.println(\"exception: \"+e.getMessage() );\n\t\t\t\t e.printStackTrace();\n\t\t\t\t System.exit(0);\n\t\t\t }\n\t\t\t finally\n\t\t\t {\n\t\t\t\t br.close();\n\t\t\t }\n\t\t }\n\t\t \n\t\t // Writes the entire arraylist(preposition wise seperated files)\n\t\t \n\t\t WriteSeperated(folderName);\n\t\t \n\t\t for(int i=0; i<prep.length; i++)\n\t\t {\n\t\t\t arr[i].clear();\n\t\t }\n\t\t \n\t}", "public static void main(String[] args) throws IOException {\n\t\t\t\t\n\t\tint count=0;\n\t\t\t\t// Create a file object for creation of new directory\n\t\t\t \tFile a = new File(\"DemoFolder\");\n\t\t\t \t//Check whether the file is already exist\n\t\t\t \tSystem.out.println(\"Is directory already Created: \"+a.exists());\n\t\t\t \t//Create a new file\n\t\t\t \ta.mkdir();\n\t\t\t \t// Check whether the new directory is created \n\t\t\t \tSystem.out.println(\"Is directory already created:\"+a.exists());\n\t\t\t \t\n\t\t\t \t// getting AbsolutePath of Cerated directory\n\t\t\t \tString path=a.getAbsolutePath();\n\t\t\t \t// Create a new text file in created a directory by using fileConstrutor\n\t\t\t \tFile a1 = new File(path, \"Demo2.txt\");\n\t\t\t \ta1.createNewFile();\n\t\t\t \tSystem.out.println(\"Verify File Created: \"+a1.exists());\n\t\t\t \t\n\t\t\t \tFile a3=new File(\"C:\\\\Users\\\\DELL\\\\eclipse-workspace\\\\Java_Learnings\\\\DemoFolder\");\n\t\t\t \tString[] s=a3.list();\n\t\t\t \t\n\t\t\t \tfor(String s1:s) {\n\t\t\t \t\t\n\t\t\t \t\tFile f2= new File(a3, s1);\n\t\t\t \t\t\n\t\t\t \t\tif(f2.isDirectory()) {\n\t\t\t \t\t\tcount++;\n\t\t\t \t\t\tSystem.out.println(s1);\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tSystem.out.println(\"No of available in given File \"+count);\n\t\t\t \t\n\t\t\t \t\n\n\t}", "public static void multiCSV(String path, MultiCSV folder){\r\n\t\t// Path to folder\r\n\t\tFile myDirectory = new File(path);\r\n\t\t// Contains all the files within the folder\r\n\t\tFile[] allFiles= myDirectory.listFiles();\r\n\t\tfor (int i=0; i<allFiles.length; i++){\r\n\t\t\tFile current= allFiles[i];\r\n\t\t\t// Checks if the files exists\r\n\t\t\tif (current.exists()) {\r\n\t\t\t\t// Checks if the file is folder\r\n\t\t\t\tif (current.isDirectory()) {\r\n\t\t\t\t\t// If the file is folder call the method recursively\r\n\t\t\t\t\tmultiCSV(current.getAbsolutePath(), folder);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t// Checks the length of the file name\r\n\t\t\t\t\tif (allFiles[i].length()>=5) {\r\n\t\t\t\t\t\tString FileName=allFiles[i].getName();\r\n\t\t\t\t\t\t// Checks if the file is from the form CSV\r\n\t\t\t\t\t\tif (FileName.substring(FileName.length()-4,FileName.length()).equals(\".csv\")) {\r\n\t\t\t\t\t\t\t// Creates a new KML file\r\n\t\t\t\t\t\t\tCsv2Kml csv2kml=new Csv2Kml();\r\n\t\t\t\t\t\t\tfolder.toKML=folder.toKML+csv2kml.ReadCSV(allFiles[i].getPath(),FileName.substring(0,FileName.length()-4));\r\n\t\t\t\t\t\t\t// Add the layer to the project\r\n\t\t\t\t\t\t\tfolder.getGISproject().add(csv2kml.getLayer_GIS());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void setSystabRegFolderName(String name){\n this.folderName = name + \"\\\\\"; // Append the \\\\ to get inside the folder\n }", "@Override\n public void run(ApplicationArguments args){\n User user1 = new User(\"Accounts Payable\");\n userRepository.save(user1);\n\n User user2 = new User(\"Admin\");\n userRepository.save(user2);\n\n Folder folder1 = new Folder(\"Accounts\", user1);\n folderRepository.save(folder1);\n\n Folder folder2 = new Folder(\"Letters\", user2);\n folderRepository.save(folder2);\n\n File file1 = new File(\"Invoice001\", \".exe\", 1.23, folder1);\n fileRepository.save(file1);\n\n File file2 = new File(\"Invoice002\", \".exe\", 1.45, folder1 );\n fileRepository.save(file2);\n\n File file3 = new File(\"Letter001\", \".doc\", 1.67, folder2);\n fileRepository.save(file3);\n\n\n }", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"role\"})\n public void _4_2_5_findRoleByName() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n c_1.getId()+\"/departments/**/roles?name=director\")\n .header(AUTHORIZATION, ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.roles\",hasSize(1)))\n .andExpect(jsonPath(\"$._embedded.roles[0].id\",is(r_2.getId().toString())))\n .andExpect(jsonPath(\"$._embedded.roles[0].department\",is(d_2.getId().toString())));\n }", "public interface RolesSyncStrategy {\n \n static final String[] USER_ROLE_CLUSTER_ACTIONS = { \"USER_CLUSTER_OPERATIONS\" };\n static final String[] PROJECT_ROLE_ACTIONS = { \"INDEX_PROJECT\" };\n static final String[] KIBANA_ROLE_ALL_INDEX_ACTIONS = { \"INDEX_ANY_KIBANA\" };\n static final String[] KIBANA_ROLE_INDEX_ACTIONS = { \"INDEX_KIBANA\" };\n static final String[] KIBANA_ROLE_CLUSTER_ACTIONS = { \"CLUSTER_MONITOR_KIBANA\" };\n static final String[] OPERATIONS_ROLE_CLUSTER_ACTIONS = { \"CLUSTER_OPERATIONS\" };\n static final String[] OPERATIONS_ROLE_OPERATIONS_ACTIONS = { \"INDEX_OPERATIONS\" };\n static final String[] OPERATIONS_ROLE_ANY_ACTIONS = { \"INDEX_ANY_OPERATIONS\" };\n static final String ALL = \"*\";\n\n /**\n * Sync the given cache to \n * @param cache The cache from which to sync\n */\n void syncFrom(final UserProjectCache cache);\n \n}", "private void initDepthToRoles(OWLOntologyManager manager, OWLOntology ont, int depth) {\n\n\t\t// save parent role structure\n\t\t// For each property r\n\t\tont.objectPropertiesInSignature().forEach(property -> {\n\t\t\t// If they aren't inverses\n\t\t\tif (!property.getInverseProperty().isOWLObjectProperty()) {\n\t\t\t\t// Get the sub properties of r. For each of these sub properties s\n\t\t\t\treasoner.getSubObjectProperties(property, true).entities().forEach(subProp -> {\n\t\t\t\t\t// If they aren't inverses\n\t\t\t\t\tif (!subProp.getInverseProperty().isOWLObjectProperty()) {\n\t\t\t\t\t\t// Get r and s as OWLObjectProperty\n\t\t\t\t\t\tOWLObjectProperty subPropAsProp = subProp.asOWLObjectProperty();\n\t\t\t\t\t\tOWLObjectProperty propAsProp = property.asOWLObjectProperty();\n\t\t\t\t\t\t// Save them in the map propertyToParent by using s as key and r as value\n\t\t\t\t\t\tpropertyToParent.put(subPropAsProp, propAsProp);\n\t\t\t\t\t\t// Do the same, but with their cleaned names\n\t\t\t\t\t\tpropertyToParentString.put(OntologyDescriptor.getCleanNameOWLObj(subPropAsProp),\n\t\t\t\t\t\t\t\tOntologyDescriptor.getCleanNameOWLObj(propAsProp));\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t}\n\t\t});\n\n\t\t// Get top properties\n\t\tSet<OWLObjectPropertyExpression> properties = reasoner\n\t\t\t\t.getSubObjectProperties(df.getOWLTopObjectProperty(), true).entities().collect(Collectors.toSet());\n\n\t\t// While there are lower level properties\n\t\tboolean isThereLowerLevel = true;\n\t\twhile (isThereLowerLevel) {\n\n\t\t\t// Set for the current level properties as OWLObjectProperty\n\t\t\tSet<OWLObjectProperty> propertiesToSave = new HashSet<>();\n\n\t\t\t// For all current level properties\n\t\t\tproperties.stream().forEach(e -> {\n\t\t\t\tif (!e.isOWLBottomObjectProperty() && !e.getInverseProperty().isOWLObjectProperty()) {\n\t\t\t\t\t// Save them as OWLObjectProperty, if they are not the BottomProperty or a Inverse\n\t\t\t\t\tpropertiesToSave.add(e.asOWLObjectProperty());\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Map the current depth to the saved properties\n\t\t\tdepthToProperties.put(depth, propertiesToSave);\n\n\t\t\t// Set for the next level properties\n\t\t\tSet<OWLObjectPropertyExpression> nextLevelProperties = new HashSet<>();\n\n\t\t\t// Go through all current level properties\n\t\t\tfor (OWLObjectPropertyExpression expr : properties) {\n\t\t\t\t// and save their sub properties to the Set of next level properties\n\t\t\t\tnextLevelProperties\n\t\t\t\t\t\t.addAll(reasoner.getSubObjectProperties(expr, true).entities().collect(Collectors.toSet()));\n\t\t\t}\n\n\t\t\t// Set the next level properties to the current level properties\n\t\t\tproperties = nextLevelProperties;\n\n\t\t\t// Increase the depth\n\t\t\tdepth++;\n\n\t\t\t// If properties is empty (so there are no properties at this level) stop\n\t\t\tif (properties.isEmpty()) {\n\t\t\t\tisThereLowerLevel = false;\n\t\t\t}\n\t\t}\n\n\t}", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"role\"})\n public void _4_2_1_getAllDeptRoles() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n d_1.getCompany()+\n \"/departments/\"+\n d_1.getId().toString()+\n \"/roles?recursive=true\")\n .header(AUTHORIZATION, ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.roles\",hasSize(3)));\n }", "public static void grantAccess(String folder) throws Exception\r\n {\r\n String drive = \"\";\r\n for(int i=0;i<folder.length();i++)\r\n {\r\n if(folder.charAt(i)=='\\\\')\r\n {\r\n drive = folder.substring(0, i);\r\n break;\r\n }\r\n }\r\n String directory = \"\";\r\n String fileName = \"\";\r\n for(int i=folder.length()-1;i>=0;i--)\r\n {\r\n if(folder.charAt(i)=='\\\\')\r\n {\r\n fileName = folder.substring(i+1);\r\n directory = folder.substring(0,i);\r\n break;\r\n }\r\n }\r\n String user = fetchUserName();\r\n Runtime r = Runtime.getRuntime();\r\n\tr.exec(\"cmd /c start cmd.exe /K \\\"\"+drive+\"&&cd \"+directory+\"&&icacls \\\"\"+fileName+\"\\\" /grant \"+user+\":R&&exit\\\"\");\r\n r.exec(\"cmd /c start cmd.exe /K \\\"\"+drive+\"&&cd \"+directory+\"&&icacls \\\"\"+fileName+\"\\\" /grant \"+user+\":W&&exit\\\"\");\r\n }", "private void loadRoles() {\n if(roleService.listAll().size() > 0) {\n log.debug(\"Test roles have already been loaded.\");\n return ;\n }\n\n Role role = new Role();\n role.setRole(SpringJPABootstrap.USER);\n roleService.save(role);\n\n log.debug(\"Test roles have been loaded!\");\n }", "public void run() throws Exception {\n\n\t\tYaml yaml = new Yaml();\n\t\tCollection<File> threadsInFolder = FileUtils.listFiles(new File(\"./runtime/\"), new String[] {\"yaml\"}, false);\n\t\tfinal List<Item> threadItems = new ArrayList<>();\n\t\t\n\t\tList<File> sortedList = new ArrayList<>(threadsInFolder);\n\t\tCollections.sort(sortedList);\n\t\t\n\t\tint index = 0;\n\t\tfor (File file : sortedList) {\n\t\t\tSystem.out.println(\"Loadling: \" + file.getName());\n\t\t\tList<String> list = (List<String>) yaml.load(new FileReader(file));\n\t\t\tString path = \"/data/thread/\"+index;\n\t\t\t//test\n\t\t\tfinal List<Item> items = toItems(list, path + \"_\");\n\n\t\t\tItem threadItem = new Item();\n\t\t\tString[] nameParts = file.getName().split(\"_thread_\");\n\t\t\tthreadItem.time = nameParts[0];\n\t\t\tthreadItem.thread = nameParts[1].replace(\".yaml\", \"\");\n\t\t\t\n\t\t\tif(true && items.size() == 0) {\n\t\t\t\tItem item = items.get(0);\n\t\t\t\tthreadItem.name = item.name;\n\t\t\t\tthreadItem.path = item.path;\n\t\t\t\tthreadItem.items = item.items;\n\t\t\t}else {\n\t\t\t\tthreadItem.items = items;\n\t\t\t\tthreadItem.name = \"Thread.run()\";\n\t\t\t\tthreadItem.path = path;\n\t\t\t}\n\t\t\t\n\t\t\tindex++;\n\t\t\tthreadItems.add(threadItem);\n\t\t}\n\n\t\tVertx vertx = Vertx.vertx();\n\t\tHttpServer server = vertx.createHttpServer();\n\n\t\tRouter router = Router.router(vertx);\n\n\t\trouter.route(\"/data\").handler(routingContext -> {\n\n\t\t\tJsonArray jsonArray = toJsonArray(threadItems);\n\n\t\t\tsendJsonResponseToClient(routingContext, jsonArray);\n\t\t});\n\n\t\trouter.route(\"/data/thread/:path\").handler(routingContext -> {\n\n\t\t\tString param = routingContext.request().getParam(\"path\");\n\n\t\t\tString[] pathIds = param.split(\"_\");\n\t\t\tList<Item> searchItems = threadItems;\n\t\t\tfor (int i = 0; i < pathIds.length; i++) {\n\t\t\t\tString s = pathIds[i];\n\t\t\t\tItem item = searchItems.get(Integer.parseInt(s));\n\t\t\t\tsearchItems = item.items;\n\t\t\t}\n\n\t\t\tJsonArray jsonArray = toJsonArray(searchItems);\n\n\t\t\tsendJsonResponseToClient(routingContext, jsonArray);\n\n\t\t});\n\n\t\trouter.route(\"/*\").handler(\n\t\t\t\tStaticHandler.create()\n\t\t\t\t\t.setCachingEnabled(false)\n\t\t\t\t\t.setMaxAgeSeconds(1));\n\t\t\n\n\t\tserver.requestHandler(router::accept).listen(8080);\n\n\t\tSystem.out.println(\"Server is running!\");\n\t}", "public static void addRoleToListOf(Keycloak keycloak, KeycloakAdminClientConfig keycloakAdminClientConfig, String client, String role, String compositeRole) {\n\n final String clientUuid = keycloak.realm(keycloakAdminClientConfig.getRealm()).clients().findByClientId(client).get(0).getId();\n\n RolesResource rolesResource = keycloak.realm(keycloakAdminClientConfig.getRealm()).clients().get(clientUuid).roles();\n\n final List<RoleRepresentation> existingRoles = rolesResource.list();\n\n final boolean roleExists = existingRoles.stream().anyMatch(r -> r.getName().equals(role));\n\n if (!roleExists) {\n RoleRepresentation roleRepresentation = new RoleRepresentation();\n roleRepresentation.setName(role);\n roleRepresentation.setClientRole(true);\n roleRepresentation.setComposite(false);\n\n rolesResource.create(roleRepresentation);\n }\n\n final boolean compositeExists = existingRoles.stream().anyMatch(r -> r.getName().equals(compositeRole));\n\n if (!compositeExists) {\n RoleRepresentation compositeRoleRepresentation = new RoleRepresentation();\n compositeRoleRepresentation.setName(compositeRole);\n compositeRoleRepresentation.setClientRole(true);\n compositeRoleRepresentation.setComposite(true);\n\n rolesResource.create(compositeRoleRepresentation);\n }\n\n final RoleResource compositeRoleResource = rolesResource.get(compositeRole);\n\n final boolean alreadyAdded = compositeRoleResource.getRoleComposites().stream().anyMatch(r -> r.getName().equals(role));\n\n if (!alreadyAdded) {\n final RoleRepresentation roleToAdd = rolesResource.get(role).toRepresentation();\n compositeRoleResource.addComposites(Collections.singletonList(roleToAdd));\n }\n }", "public void chooseRole()\n {\n Scanner answer = new Scanner(System.in);\n boolean valid = false;\n String role = \"\";\n \n while(!valid)\n {\n menu.displayRoles();\n role = answer.nextLine().trim();\n valid = validation.integerValidation(role, 1, 3);\n }\n \n if(role.equals(\"3\"))\n home();\n else\n createUser(role);\n }", "List<MovilizerResponse> batchUploadFolderSync(Path folder);", "public void criaTrolls() throws FileNotFoundException, IOException{\n \n String[] vetorNomes;\n vetorNomes = new String[20];\n int i = 0;\n String endereco = System.getProperty(\"user.dir\");\n endereco = endereco + \"/nomes/Nomes.txt\";\n Scanner leitor = new Scanner(new FileReader(endereco));\n while(leitor.hasNext() && i < 20){\n \n vetorNomes[i] = leitor.next();\n ++i;\n }\n // Atribuindo nomes aos trolls.\n Random gerador = new Random();\n int qtde = gerador.nextInt(2);\n for(i = 0; i < qtde; ++i){\n \n int rd = gerador.nextInt(20);\n setNome(vetorNomes[rd], i);\n }\n setQtdeTrolls(qtde);\n }", "public static void createLogsFolder(String name, String folderPath) {\r\n\t\tFile path = new File(folderPath);\r\n\t\tFile file = new File(folderPath+name+\".txt\");\r\n\t\tif(!file.exists()) {\r\n\t\t\tpath.mkdirs();\r\n\t\t\ttry {file.createNewFile();} catch (IOException e) {System.err.println(\"The file \\\"\"+name+\"\\\" cannot be created : \"+e.getMessage());}\r\n\t\t}\r\n\t}" ]
[ "0.5479928", "0.5200141", "0.5191148", "0.5169746", "0.5160818", "0.51502585", "0.50462973", "0.5001106", "0.49943376", "0.497724", "0.49702147", "0.49448678", "0.49186775", "0.4916365", "0.48488116", "0.48476383", "0.48361725", "0.48137873", "0.4809705", "0.47987184", "0.4794534", "0.4793929", "0.47489965", "0.4738004", "0.47082317", "0.47039363", "0.4696713", "0.46942288", "0.46721062", "0.46703097", "0.46682605", "0.46651343", "0.466511", "0.4661803", "0.46417248", "0.46295387", "0.4595341", "0.45793062", "0.45690656", "0.45672432", "0.4540595", "0.4534244", "0.45294163", "0.45223317", "0.45125318", "0.45055127", "0.4499159", "0.44941193", "0.44905275", "0.4486433", "0.44858614", "0.44851875", "0.4484709", "0.4481501", "0.44787824", "0.4474331", "0.447212", "0.44712466", "0.44696215", "0.4462471", "0.44550475", "0.44539484", "0.44511425", "0.44404778", "0.44319126", "0.44319126", "0.4423826", "0.4422212", "0.44175613", "0.44154796", "0.43992388", "0.43885103", "0.43878147", "0.43873075", "0.4375959", "0.43745914", "0.4366934", "0.4356756", "0.4356268", "0.43560869", "0.4356001", "0.43531457", "0.4346173", "0.43418592", "0.4341044", "0.43407232", "0.4337511", "0.43365598", "0.43360534", "0.43349227", "0.43251914", "0.43124002", "0.43115807", "0.4306065", "0.4299334", "0.42981085", "0.42959136", "0.42927876", "0.42883846", "0.42872778" ]
0.7707655
0
Counting the number of times an element occured in an array.................
public static int searchNumberOfOccurence(int arr[], int ele) { int count = 0; for (int i = 0; i < arr.length; i++) { if (arr[i] == ele) { count++; } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void cntArray(int A[], int N) \n { \n // initialize result with 0 \n int result = 0; \n \n for (int i = 0; i < N; i++) { \n \n // all size 1 sub-array \n // is part of our result \n result++; \n \n // element at current index \n int current_value = A[i]; \n \n for (int j = i + 1; j < N; j++) { \n \n // Check if A[j] = A[i] \n // increase result by 1 \n if (A[j] == current_value) { \n result++; \n } \n } \n } \n \n // print the result \n System.out.println(result); \n }", "public static int count(int[] a) {\n int n = a.length;\n return count(a, 0, n - 1);\n }", "public static int val(int[] a) {\n\n\t\tint count = 0;\n\t\tHashSet<Integer> set = new HashSet<Integer>();\n\t\tfor (int i = 0; i < a.length; i++)\n\t\t\tset.add(a[i]);\n\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tfor (int i = 0, j = 0; i < a.length && j < a.length;) {\n\t\t\twhile (map.size() != set.size()) {\n\t\t\t\tmap.put(a[j], map.getOrDefault(a[j], 0) + 1);\n\t\t\t\tj++;\n\t\t\t\tif (j == a.length)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\twhile (map.size() == set.size()) {\n\t\t\t\tcount += a.length - j + 1;\n\t\t\t\tif (map.get(a[i]) == 1)\n\t\t\t\t\tmap.remove(a[i]);\n\t\t\t\telse\n\t\t\t\t\tmap.put(a[i], map.get(a[i]) - 1);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\treturn count;\n\t}", "public static int count(int[] a) {\n sort(a);\n int N = a.length;\n // print out the sorted array\n System.out.print(\"Sorted array: \");\n for (int i = 0; i < N; i++) {\n System.out.print(a[i] + \" \");\n }\n System.out.println();\n int count = 0;\n for (int i = 0; i < N; i++) {\n int j = i + 1;\n int k = N - 1;\n while (j < k) {\n if (a[i] + a[j] + a[k] == 0) {\n System.out.println(i + \",\" + j + \",\" + k);\n count++;\n j++;\n } else if (a[i] + a[j] + a[k] > 0) {\n k--;\n } else {\n j++;\n }\n }\n }\n return count;\n }", "public int countOnes(int[] a) {\n int tot = 0;\n for (int i=0; i<a.length; i++) {\n tot += a[i];\n }\n return tot;\n }", "public int count(){\n\tboolean val = false;\n\tint cont = 0;\n\tfor(int i =0;i<arch.length && !val;i++){\n\t\tif(arch[i]!=null){\n\t\t\tcont++;\n\t\t}\n\t\telse{\n\t\t\tval=true;\n\t\t}\n\t}\n\treturn cont;\n}", "public static int getCount(int[] numArray, int val)\n\t{\n\t\tint count = 0;\n\t\tfor(int i = 0; i < numArray.length; i++)\n\t\t\tif(numArray[i] == val)\t\n\t\t\t\tcount++;\n\t\treturn count;\n\t}", "public static void main(String[] args) {\n\n\n int[] r = {1, 2, 3, 1, 2, 3, 10, 20, 30};\n\n int total = 0;\n\n for (int i = 0; i < r.length; i++) {\n int count = 0;\n\n for (int j = 0; j < r.length; j++) {\n if (r[i] == r[j]) {\n count++;\n }\n }\n if (count > 1) {\n total++;\n }\n\n }\n System.out.println(total);\n\n }", "public int count(int[] array, int target) {\n\t\tint left = findLeftOccurance(array, 0, array.length - 1, target);\r\n\r\n\t\t// then search for last occurance of target\r\n\t\tint right = findRightOccurance(array, left, array.length - 1, target);\r\n\t\treturn right - left + 1;\r\n\t}", "public static int count(int[] arr){\n\t\tint[] remCounts = {0,0,0}; \n\t\tfor(int i=0; i<arr.length; i++)\n\t\t\tremCounts[arr[i]%3]++; \n\t\t\n\t\tint total = 0; \n\t\t/**\n\t\t * Count the group of size 2, two possibilities:\n\t\t * (1) both elements have remainder of 0 \n\t\t * => select 2 values from group 0 \n\t\t * (2) one has remainder of 1, and the other has 2 \n\t\t * => select 1 from group 1 and the other from group 2 \n\t\t */\n\t\ttotal += calcCombinations(remCounts[0], 2); \n\t\ttotal += (remCounts[1] * remCounts[2]); \n\t\t\n\t\t/**\n\t\t * count the group of size 3: \n\t\t * \n\t\t * (1) all of them are from group 0 \n\t\t * (2) all of them are from group 1 \n\t\t * (3) all of them are from group 2 \n\t\t * (4) each of them are from group 0, 1, and 2 respectively\n\t\t */\n\t\ttotal += calcCombinations(remCounts[0], 3);\n\t\ttotal += calcCombinations(remCounts[1], 3);\n\t\ttotal += calcCombinations(remCounts[2], 3);\n\t\ttotal += remCounts[0] * remCounts[1] * remCounts[2];\n\t\t\n\t\treturn total ; \n\t}", "private static int sizeArr(int[] arr) {\n int count = 0;\n for (int i = 0; i < arr.length; i++) {\n if (arr[i] != 0) count++;\n }\n return count;\n }", "<T> int count(T[] arr, T toFind) {\n int count = 0;\n for (int i = 0; i < arr.length; i++) {\n if (arr[i] == toFind) {\n count++;\n }\n }\n return count;\n }", "int count() {\n\t\tArrayList<Integer> checked = new ArrayList<Integer>();\r\n\t\tint count = 0;\r\n\t\tfor (int x = 0; x < idNode.length; x++) {// Order of N2\r\n\t\t\tint rootX = getRoot(x);\r\n\t\t\tif (!checked.contains(rootX)) {// Order of N Access of Array\r\n\r\n\t\t\t\tSystem.out.println(\"root x is \" + rootX);\r\n\t\t\t\tcount++;\r\n\t\t\t\tchecked.add(rootX);// N Access of Array\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public static int[] count(int[] array){\n //Initialize variables for each digit.\n int count1 = 0;\n int count2 = 0;\n int count3 = 0;\n int count4 = 0;\n int count5 = 0;\n int count6 = 0;\n int count7 = 0;\n int count8 = 0;\n int count9 = 0;\n //For each item in the array, check which number it is.(1-9)\n //Increase that number count by 1.\n for(int i = 0; i < (array.length); i++){\n if(array[i] == 1){\n count1 ++;\n }\n else if(array[i] == 2){\n count2 ++;\n }\n else if(array[i] == 3){\n count3 ++;\n }\n else if(array[i] == 4){\n count4 ++;\n }\n else if(array[i] == 5){\n count5 ++;\n }\n else if(array[i] == 6){\n count6 ++;\n }\n else if(array[i] == 7){\n count7 ++;\n }\n else if(array[i] == 8){\n count8 ++;\n }\n else if(array[i] == 9){\n count9 ++;\n }\n }\n\n //Assign the counter amount into the array\n int[] amounts = {count1, count2, count3, count4, count5, count6, count7, count8, count9};\n\n //return the array\n return(amounts);\n }", "int sizeOfScansArray();", "static long countInversions(int[] arr) {\n\t\treturn countInversions(arr, 0, arr.length - 1);\n\t}", "static long countTriplets(List<Long> arr, long r) {\n\t\tMap<Long, Long> elementMapWithOccuranceCount = new HashMap<>();\n\t\t//map contains the triplet count for each element\n\t\tMap<Long, Long> elementMapWithTripletCount = new HashMap<>();\n\t\tlong count = 0;\n\t\tfor (int i = 0; i < arr.size(); i++) {\n\t\t\tlong a = arr.get(i);\n\t\t\tlong key = a / r;\n\t\t\t\n\t\t\tif (elementMapWithTripletCount.containsKey(key) && a % r == 0) {\n\t\t\t\t//Have previous count so increment the count\n\t\t\t\tcount += elementMapWithTripletCount.get(key);\n\t\t\t}\n\t\t\t\n\t\t\tif (elementMapWithOccuranceCount.containsKey(key) && a % r == 0) {\n\t\t\t\t//Have a matching member in triplet, check it's count and put that in triplet count, \n\t\t\t\t//that many triplet will be available in the array for this count, only if triplet count available, other wise 0 \n\t\t\t\tlong elementCount = elementMapWithOccuranceCount.get(key);\n\t\t\t\telementMapWithTripletCount.put(a, elementMapWithTripletCount.getOrDefault(a, 0L) + elementCount);\n\t\t\t}\n\t\t\t//By default put it every time we find a new element, this map also keeps count but only for elements\n\t\t\telementMapWithOccuranceCount.put(a, elementMapWithOccuranceCount.getOrDefault(a, 0L) + 1); // Every number can be the start of a triplet.\n\t\t}\n\t\treturn count;\n\t}", "int countDuplicateNo(int a[], int x) {\n\t\tint firstOccurrence = firstOccurrence(a, x);\n\t\tint lastOccurrence = lastOccurrence(a, x);\n\t\treturn (lastOccurrence - firstOccurrence) + 1;\n\t}", "private static int count(Number[] data, double value, int start) {\n int count = 0;\n for (int i = start; i < data.length; ++i) {\n if (Helper.roughlyEqual(data[i].doubleValue(), value)) {\n ++count;\n }\n }\n\n return count;\n }", "HashMap<Character, Integer> countCharacter(char[] array) {\n\t\tHashMap<Character, Integer> hm = new HashMap<Character, Integer>();\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (hm.containsKey(array[i]))\n\t\t\t\thm.put(array[i], hm.get(array[i]) + 1);\n\n\t\t\telse\n\t\t\t\thm.put(array[i], 1);\n\t\t}\n\t\treturn hm;\n\n\t}", "int sizeOfPerformerArray();", "public int countClumps(int[] arr)\n\t{\n\t\tif(arr.length==0)\n\t\t\tthrow new AssertionError(\"Array is Empty\");\n\t\tint clumps=0;\n\t\tfor(int i=0;i<arr.length-1;i++){\n\t\t\tint flag=0;\n\t\t\twhile(i<arr.length-1 && arr[i]==arr[i+1]){\n\t\t\t\tflag=1;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tif(flag==1)\n\t\t\t\tclumps++;\n\t\t}\n\t\treturn clumps;\n\t}", "public static int countFives(int [] num)\n{\n // Create a static method called getSum which sums an array of ints\n int i;\n int total = 0;\n for(i=0;i < num.length;i++)\n {\n \tif(num[i] == 5) {\n \t\ttotal += 1;\n \t}\n }\n return total;\n}", "public int numberOfOccorrence();", "public static int countAnagram(ArrayList<String> arr) {\n int count = 0;\n for (HashMap.Entry<String, Integer> item : countOccurences(arr).entrySet()) {\n if (item.getValue()!=1) {\n count = count + item.getValue();\n }\n }\n return count;\n }", "static long countInversions(int[] arr) {\n long ans = 0;\n int n = Arrays.stream(arr).max().getAsInt();\n BIT bit = new BIT(n);\n for (int i = 0; i < arr.length; i++) {\n ans += bit.sum(n) - bit.sum(arr[i]);\n bit.add(arr[i], 1);\n }\n return ans;\n }", "public static int countUnique(int[] A) {\n\t\tint count = 0;\n\t\tfor (int i = 0; i < A.length - 1; i++) {\n\t\t\tif (A[i] == A[i + 1]) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\t// System.out.println(\"count: \" + count);\n\t\treturn (A.length - count);\n\t}", "public static HashMap<String, Integer> countOccurences(ArrayList<String> arr) {\n arr = toSortedString(arr);\n HashMap<String, Integer> hash = new HashMap();\n for(String str :arr){\n if(hash.containsKey(str)){\n hash.replace(str, hash.get(str)+1);\n }\n else{\n hash.put(str,1);\n }\n }\n return hash;\n }", "static int jumpingOnClouds(int[] arr) {\n int i = 0;\n int count = 0;\n while (i < arr.length - 2) {\n if (arr[i + 1] == 1) {\n count++;\n i += 2;\n } else if (arr[i + 2] == 1) {\n count++;\n i += 1;\n } else {\n count++;\n i += 2;\n }\n }\n //System.out.println(count);\n if (i<arr.length-1)\n count++;\n return count;\n\n\n }", "int sizeOfRelatedArray();", "public int arrayCount9(int[] nums) {\n int result = 0;\n for (int num : nums) {\n if (num == 9) {\n result++;\n }\n }\n return result;\n }", "public interface Counter\n{\n\tlong count(int[] riceArray);\n}", "private int countOccurrence(Integer valueToCount) {\n int count = 0;\n\n for(Integer currentValue : list) {\n if (currentValue == valueToCount) {\n count++;\n }\n }\n\n return count;\n }", "public int count(double ratings[],double r)\n\t{\n\t\tint result=0;\n\t\tfor(int i=0;i<ratings.length;i++)\n\t\t{\n\t\t\tif(ratings[i]==r)\n\t\t\t\tresult++;\n\t\t}\n\t\treturn result;\n\t}", "public static int count(int[] array, int targetSum) {\n int quantityOfCounts = 0;\n Set<Integer> set = new HashSet<>();\n\n Arrays.stream(array).forEach(set::add);\n\n for (int j : set) {\n if (set.contains(targetSum - j)) {\n quantityOfCounts++;\n }\n }\n\n return quantityOfCounts / 2;\n }", "public static HashMap<String,Integer> counter(ArrayList<String> arr){\n\t\tHashMap<String,Integer> map = new HashMap<String,Integer>();\n\t\t\tfor(String s : arr){\n\t\t\t\tif (map.keySet().contains(s)){\n\t\t\t\t\tmap.put(s, map.get(s)+1);\n\t\t\t\t}else{\n\t\t\t\t\tmap.put(s, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn map;\t\n\t}", "private long sortAndCount(int[] arr) {\r\n\r\n\t\t// compare permuted array and the actual.\r\n\t\t// count offers O(n log n)\r\n\t\tint n = arr.length;\r\n\t\tif (n == 1) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tsort(arr);\r\n\t\t\r\n\t\treturn counter;\r\n\t}", "public static int arrayCount9(int[] nums){\n if(nums.length==0){\n return 0;\n }\n else{\n int count=0;\n for (int i=0;i<nums.length;i++){\n if(nums[i]==9){\n count++;\n }\n }\n return count;\n }\n }", "public static int pairs (int[] arr) {\n int c = 0;\n Arrays.sort(arr);\n for (int i = 0; i < arr.length - 1; i++) {\n if (arr[i] == arr[i+1]) {\n c += 1;\n }\n }\n return c;\n }", "@Test\n public void getCount() throws Exception {\n int[] a = new int[]{250, 501, 5000, 5, 4};\n\n Solution solution = new Solution();\n\n int c = solution.getCount(a, 0, 4, 0, 5);\n\n assertEquals(3, c);\n\n c = solution.getCount(a, 0, 4, 0, 10);\n\n assertEquals(2, c);\n\n c = solution.getCount(a, 0, 4, 2, 3);\n\n assertEquals(2, c);\n }", "static long countTriplets(List<Long> arr, long r) {\n\n long count=0;\n long l = arr.size();\n \n Map <Long,Integer> m = new HashMap<Long,Integer>();\n \n for(int i=0;i<arr.size();i++)\n {\n //Map with Uniqe numbers and their frequency.\n if(m.containsValue(arr.get(i)))\n m.put(arr.get(i), m.get(arr.get(i)) + 1);\n else\n m.put(arr.get(i),1);\n }\n \n \n long n = arr.size();\n if(r==1)\n {\n for(Map.Entry<Long,Integer> entry : m.entrySet())\n {\n long k1 = entry.getKey();\n long val = entry.getValue();\n if(val>2)\n {\n count = count + val*(val-1)*(val-2)/6;\n }\n }\n }\n else\n {\n for(Map.Entry<Long,Integer> entry : m.entrySet())\n {\n long k1 = entry.getKey();\n long val = entry.getValue();\n long k2 = k1*r;\n long k3 = k1*r*r;\n if(m.containsKey(k2) && m.containsKey(k3))\n {\n count = count + val*m.get(k2)*m.get(k3);\n }\n }\n }\n\n return count;\n }", "public static void countingSort(int[] elements) {\n int maxValue = findMax(elements);\n int[] counts = new int[maxValue + 1];\n\n // Counting elements\n for (int i = 0; i < elements.length; i++) {\n counts[elements[i]]++;\n }\n\n // Writes results back\n int place = 0;\n for (int i = 0; i < counts.length; i++) {\n for (int j = 0; j < counts[i]; j++) {\n elements[place++] = i;\n }\n }\n }", "static void zerosumarr(long[] arr) {\r\n\t \t // Write your code here\r\n\t\t HashMap<Long,Long> map = new HashMap<>();\r\n\t\t int count=0;\r\n\t\t Long psum=(long) 0;\r\n\t\t map.put(psum,(long)1);\r\n\t\t for(int i=0;i<arr.length;i++) {\r\n\t\t\t psum+=arr[i];\r\n\t\t\t if(map.containsKey(psum)) {\r\n\t\t\t\t count+=map.get(psum);\r\n\t\t\t\t map.put(psum,map.get(psum)+1);\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t map.put(psum, (long)1);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t }\r\n\t\t System.out.println(count);\r\n\t }", "public static int countShifts(int[] ar) {\n int count = 0;\n for(int i = 1; i < ar.length; i++){\n int j = i -1;\n int index = i;\n while(j >=0){\n if(ar[j] > ar[index]){\n int tmp = ar[index];\n ar[index] = ar[j];\n ar[j] = tmp;\n count++;\n index = j;\n }\n j--;\n }\n }\n// printArray(ar);\n return count;\n }", "public static void getConsicutiveOnes(int[] arr) {\n int pointerVar;\n int i;\n int counter = 0;\n int oldCounter = 0;\n\n for (i = 0; i < arr.length; i++) {\n pointerVar = 0;\n while (pointerVar < arr.length) {\n if (arr[i] == 1 && arr[i] == arr[pointerVar]) {\n counter++;\n } else {\n counter = 0;\n }\n pointerVar++;\n }\n\n }\n System.out.println(\"Counter Value :Old counter\" + counter);\n\n }", "int sizeOfClassificationArray();", "public static int countBits(int[] data) {\n\t\tint sum = 0;\n\t\tfor (int d : data) {\n\t\t\tfor (int i = 0; i < 32; i++) {\n\t\t\t\tsum += (d & (1 << i)) > 0 ? 1 : 0;\n\t\t\t}\n\t\t}\n\t\treturn sum;\n\t}", "int getUniqueNumbersCount();", "static int countSubarrWithEqualZeroAndOne(int arr[], int n)\n {\n int count=0;\n int currentSum=0;\n HashMap<Integer,Integer> mp=new HashMap<>();\n for(int i=0;i<arr.length;i++)\n {\n if(arr[i]==0)\n arr[i]=-1;\n currentSum+=arr[i];\n \n if(currentSum==0)\n count++;\n if(mp.containsKey(currentSum))\n count+=mp.get(currentSum);\n if(!mp.containsKey(currentSum))\n mp.put(currentSum,1);\n else\n mp.put(currentSum,mp.get(currentSum)+1);\n \n \n }\n return count;\n }", "static int birthdayCakeCandles(int[] arr) {\n\n\t\tint max = 0;\n\t\tint count = 0;\n\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tif (max < arr[i]) {\n\t\t\t\tmax = arr[i];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tif (max == arr[i]) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\n\t\treturn count;\n\t}", "public static void main(String[] args) {\n int [] arry = {1,2,2,2,3,4,5,5,6,7,8,9,};\n HashMap<Integer,Integer> hashMap = new HashMap<>();\n for(int i =0; i<arry.length;i++){\n if(hashMap.containsKey(arry[i])) {\n hashMap.put(arry[i], hashMap.get(arry[i]) + 1);\n }\n else {\n hashMap.put(arry[i],1);\n }\n }\n Set<Map.Entry<Integer, Integer>> set=hashMap.entrySet();\n for(Map.Entry<Integer,Integer> in:set){\n if (in.getValue()>1){\n System.out.println(in.getValue());\n }\n }\n\n\n\n }", "public int size() {\n\t\tint count = 0;\n\t\tfor (int i = 0;i < contains.length;i++) {\n\t\t\tif (contains[i]) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "public static int[] count(String[] wordsArray, int[] countArray){\r\n\t\t\r\n\t\tfor(int i=0; i<wordsArray.length;i++) {\r\n\t\t\tcountArray[i]=wordsArray[i].length();\r\n\t\t}\r\n\t\treturn countArray;\r\n\t}", "public int getNumberOfDuplicateItems(String[] order) {\n\t\n\t\t//TODO\n\t\tint counter=0;\n\t\tint howMany=0;\n\t\tArrayList<String> array=new ArrayList<>();\n\t\t\n\t\tfor(int i=0;i<order.length;i++) {\n\t\t\t\n\t\t\tif(!array.contains(order[i])) {\n\t\t\t\t\n\t\t\t\tarray.add(order[i]);\n\t\t\t\t\n\t\t\t\thowMany=getNumberOfItemOccurrences(order,order[i]);\n\t\t\t\t\n\t\t\t\tif(howMany>1) {\n\t\t\t\tcounter++;\n\t\t\t\n\t\t\t}\t\n\t\t}\t\n\t }return counter;\n\t}", "static public int solution(int[] A) {\n HashSet <Integer> newDistList = new HashSet<Integer>();\n for (int s = 0; s<A.length; s++){\n newDistList.add(A[s]);\n }\n return newDistList.size();\n }", "static int sockMerchant(int[] ar) {\n int counter = 0;\n Map<Integer, Integer> map = new HashMap<>();\n for(int i = 0; i < ar.length; i++) {\n Integer val = map.get(ar[i]);\n val = val != null? val + 1 : 1;\n map.put(ar[i], val);\n if(val > 0 && val % 2 == 0) counter++;\n }\n return counter;\n }", "public int repeatedNTimes(int[] A) {\n List<Integer> visited = new ArrayList<>();\n int result = A[0];\n for (int i = 0; i < A.length; i++) {\n if (!visited.contains(A[i])) {\n visited.add(A[i]);\n } else {\n result = A[i];\n break;\n }\n }\n return result;\n }", "int sizeOfFeatureArray();", "int sizeOfFeatureArray();", "public static void main(String[] args) {\n\t\tint[] arr = { 4, 1, 1, 4, 2, 3, 4, 4, 1, 2, 4, 9, 3 };\n\t\tint number;\n\t\tint count = 1;\n\t\tint maxCount = 1;\n\t\tint index=0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tnumber = arr[i];\n\t\t\tfor (int j = i + 1; j < arr.length; j++) {\n\t\t\t\tif (number == arr[j]) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (maxCount < count) {\n\t\t\t\tmaxCount = count;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t\tcount=1;\n\t\t}\n\t\tSystem.out.println(arr[index]+\"->\"+maxCount+\" times\");\n\t}", "public long inversion(int[] arr) {\r\n\t\treturn sortAndCount(arr);\r\n\t}", "public int count() {\n\t\tint q = 0;\n\t\tfor(int i = 0; i < list.length; i++) if (list[i] != null) q++;\n\t\treturn q;\n\t\t\n\t}", "int getNumberOfDetectedDuplicates();", "public static final int numberOf(char[] arr, char key)\n {\n if(arr == null)\n throw new NullPointerException(\"Cannot work with a null array.\");\n else {\n int n = 0;\n \n for(char c: arr)\n if(c == key)\n ++n;\n \n return n;\n }\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint flag1 =1,flag2=1, count=1;\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\t\t\r\n\t\t//System.out.println(\"Enter the no of elements in an array\");\r\n\t\tint noOfElements = scanner.nextInt();\r\n\t\tif(noOfElements<0) {\r\n\t\t\tflag1=0;\r\n\t\t\tSystem.out.println(\"Invalid input\");\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif(flag1 != 0) {\r\n\t\tint [] arr = new int [noOfElements];\r\n\t\t//System.out.println(\"enter the elemnts\");\r\n\t\t\r\n\t\t\r\n\t\tfor(int i=0;i<arr.length;i++) {\r\n\t\t\tarr[i] = scanner.nextInt();\r\n\t\t\tif(arr[i]<0) {\r\n\t\t\t\tSystem.out.println(\"Invalid input\");\r\n\t\t\t\tflag2=0;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif(flag2 != 0) {\r\n\t\tfor(int i=0;i<arr.length;i++) {\r\n\t\t\tint key = arr[i];\r\n\t\t\tfor(int j=i+1;j<arr.length;j++) {\r\n\t\t\t\tif(key==arr[j]) {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t\tbreak;\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\tSystem.out.println(\"Count is:\"+count);\r\n\t\t}\r\n\t\t}\r\n\t}", "int countPairs(int[] X, int[] Y, int m, int n){\n int out = 0;\n\n // System.out.println(Arrays.toString(X));\n // System.out.println(Arrays.toString(Y));\n // System.out.println(m);\n // System.out.println(n);\n\n\n \n\n int[] NoOfY = new int[m+n]; \n\n for (int i = 0; i < n; i++){\n if (Y[i] < 5){\n NoOfY[Y[i]]++; \n } \n }\n\n Arrays.sort(Y);\n\n // Take every element of X and count pairs with it \n for (int i=0; i<m; i++) {\n out += count(X[i], Y, n, NoOfY); \n }\n\n\n\n return out;\n }", "static int equalizeArray(int[] arr) {\n \n int a[]=new int[arr.length];\n int max=0;\n for(int i=0;i<arr.length;i++){\n int c=0; \n for(int j=0;j<arr.length;j++){\n if(arr[i]==arr[j]){\n c++;\n }\n }\n if(max<c) max=c;\n }\n return arr.length-max;\n }", "private int demSoLuong(int i) {\n\t\tint count = 0;\n\t\tfor (int j = 0; j < arrInt.length; j++) {\n\t\t\tif (this.arrInt[j] == i) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "int sizeOfContactMeansArray();", "public static void main(String[] args) {\n int []a={1,2,1,2,1,2,2,1,2,1,2,2};\r\n int count=1;\r\n Arrays.sort(a); ///1 1 1 2 2 3 3 3 \r\n int n=a.length;\r\n int temp=0,dum=0,countaaa=1;\r\n for(int i=0;i<n-1;i++)\r\n {\r\n\t if(a[i]==a[i+1])\r\n\t {\r\n\t\t count++;//1 ///how many \r\n\t\t temp=a[i];//1///tamil nadu\r\n\t }\r\n\t else\r\n\t { \r\n\t\t if(x>=y)\r\n\t\t {\r\n\t\t\t if(a[i])\r\n\t\tdum=a[i];//1///andhra\r\n\t\tcountaaa=count;//2///how many\r\n\t\tcount=1;\r\n\t\t }\r\n\t }\r\n }\r\n System.out.println(countaaa);\r\n System.out.println(count);\r\n if(countaaa>count)\r\n\t System.out.println(\"A: \"+dum+\" count: \"+countaaa);\r\n else\r\n System.out.println(temp+\" \"+count);\r\n\t}", "public int numIdenticalPairs(int[] nums) {\n int count = 0;\n for (int i = 0; i < nums.length; i++) {\n for (int j = i + 1; j < nums.length; j++) {\n if (nums[i] == nums[j]) {\n count++;\n }\n }\n }\n return count;\n }", "static int beautifulTriplets(int d, int[] arr) {\n int l = arr.length;\n int count = 0;\n for (int i = 0; i < l; i++) {\n int ei = arr[i];\n for (int j = i+1; j < l; j++) {\n int ej = arr[j];\n int diffij = Math.abs(ej-ei);\n if(diffij == d){\n for (int k = j+1; k < l; k++) {\n int ek = arr[k];\n int diffjk = Math.abs(ek-ej);\n if(diffjk == d){\n count++;\n }\n }\n }\n }\n }\n return count;\n\n }", "public List<Integer> numDuplicatesList(List<TradeGood> uniqueGoods, TradeGood[] cargoArr) {\n List<Integer> countList = new ArrayList<>();\n for (int i = 0; i < uniqueGoods.size(); i++) {\n int counter = 0;\n for (int j = 0; j < cargoArr.length; j++) {\n if (uniqueGoods.get(i).equals(cargoArr[j])) {\n counter++;\n }\n }\n countList.add(counter);\n }\n return countList;\n }", "public static void main(String[] args) {\n\n\t\tint arr[] = { 2, 3, 3, 2, 5 };\n\t\tfindCounts(arr, arr.length);\n\n\t\tint arr1[] = { 1 };\n\t\tfindCounts(arr1, arr1.length);\n\n\t\tint arr3[] = { 4, 4, 4, 4 };\n\t\tfindCounts(arr3, arr3.length);\n\n\t\tint arr2[] = { 1, 3, 5, 7, 9, 1, 3, 5, 7, 9, 1 };\n\t\tfindCounts(arr2, arr2.length);\n\n\t\tint arr4[] = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 };\n\t\tfindCounts(arr4, arr4.length);\n\n\t\tint arr5[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };\n\t\tfindCounts(arr5, arr5.length);\n\n\t\tint arr6[] = { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };\n\t\tfindCounts(arr6, arr6.length);\n\t}", "public int repeated() {\n this.order();\n int counter = 1;\n int currentCounter = 1;\n for (int i = 0; i < this.size() - 1; i++) {\n if(this.getListaAt(i).x == this.getListaAt(i + 1).x) {\n currentCounter += 1;\n }\n else {\n if (currentCounter > counter) {\n counter = currentCounter;\n }\n currentCounter = 1;\n }\n }\n if (currentCounter > counter) {\n counter = currentCounter;\n }\n return counter;\n }", "private static void mostOccur(int[] is) {\n\t\t\t\n\t\t\t\n\t\t\tMap<Integer, Integer> numberCount = new HashMap<>();\n\t\t\t\n\t\t\t\n\t\t\tfor (int i=0; i<is.length; i++ ) {\n\t\t\t\tif(null==numberCount.get(i)) {\n\t\t\t\tnumberCount.put(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnumberCount.put(i, numberCount.get(i) +1);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Iterator<Integer> it = numberCount.keySet().iterator();\n\t\t\tSet<Entry<Integer, Integer>> entries= numberCount.entrySet();\n\t\t\t\n\t\t\tint maxcount=1;\n\t\t\tint maxvalue = 0;\n\t\t\tfor(Entry<Integer, Integer> entry: entries) {\n\t\t\t\tif (entry.getValue()>maxcount) {\n\t\t\t\tmaxcount = entry.getValue();\n\t\t\t\tmaxvalue = entry.getKey();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(maxvalue == 0) {\n\t\t\t\tSystem.out.println(\"All numbers are same\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Most occurance\" + maxvalue + \"and count\" +maxcount);\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\n\t\t\t// TODO Auto-generated method stub\n\t\t\t\n\t\t}", "public static int array667(int[] nums) {\n\t\tint count = 0;\n\t\t\n\t\tfor(int i=0; i<nums.length-1; i++) {\n\t\t\t\n\t\t\tif((nums[i]==6 && nums[i+1]==6) || (nums[i]==6 && nums[i+1]==7)) {\n\t\t\t\tcount += 1;\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn count;\n\t}", "public static int countZeros(int numElements, int[] vals) {\r\n\t\t\r\n\t\tint numOfZeros = 0; // declaring needed variable\r\n\t\t\r\n\t\tfor(int i = 0; i < numElements; i++) {\r\n\t\t\t\r\n\t\t\tif(vals[i] == 0) {\r\n\t\t\t\t\r\n\t\t\t\tnumOfZeros++; // iterating through each index and determine if the element value contains a zero. If contains zero, increment variable by one.\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn numOfZeros; // return value to main\r\n\t}", "int getIndicesCount();", "public int size() {\r\n int temp = 0;\r\n for (int i = 0; i < elem.length; i++) {\r\n if (elem[i] != null) {\r\n temp++;\r\n }\r\n }\r\n return temp;\r\n }", "public static void inversecount(int a[]) {\r\n int count=0;\r\n for(int i=0;i<a.length;i++){\r\n for(int j=i+1;j<a.length;j++)\r\n if(a[i]>a[j]){\r\n int temp=a[i];\r\n a[i]=a[j];\r\n a[j]=temp;\r\n count++;\r\n }\r\n }\r\n System.out.println(\"The Answer is: \");\r\n System.out.println(count);//The final answer is printed using this line\r\n }", "public static int ombyttinger(int[] a) {\n int count=0;\n for (int i = 0; i < a.length-1; i++) {\n if (a[i] > a[i+1]) {\n int temp = a[i];\n a[i] = a[i+1];\n a[i+1] = temp;\n count++;\n\n }\n }\n return count;\n }", "public static int count(String[] arr, String target, int index) {\r\n int count = 0;\r\n for (int i = index; i < arr.length; i++) // start from start index\r\n {\r\n if (!arr[i].equals(target)) // once the element is not equal than there are no need to find further\r\n return count;\r\n\r\n count++;\r\n }\r\n return count;\r\n }", "@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 }", "public int arrayCount()\n\t{\n\t\treturn _arrayCount;\n\t}", "int sizeOfKeyArray();", "@Test\n public void findFrequency(){\n\n int[] input = {2,2,4,12,7,2,7,2,7,7};\n List<Integer> expected = new ArrayList<>(Arrays.asList(4,12));\n assertEquals(expected , Computation.findOdd(input));\n }", "public static void main(String[] args) {\n List<Integer> nums = new ArrayList<>(Arrays.asList(5, 7, 3, 7, 2, 8, 3, 7, 2));\n //Map<Integer, Integer> numCount = countOccurance(nums);\n Map<Integer, Long> numCount = nums.stream().collect(Collectors.groupingBy(num -> num, Collectors.counting()));\n Set<Integer> numSet = new LinkedHashSet<>(nums);\n numSet.forEach(num -> System.out.println(num + \" \" + numCount.get(num)));\n }", "@Override\n public int size() {\n int count = 0;\n for (Counter c : map.values())\n count += c.value();\n return count;\n }", "Integer countAll();", "public static void CountEvenOdd(int[] array) {\n\n }", "public int countOfOnes() {\r\n\t\tbyte one = (byte) 1;\r\n\t\tint count = 0;\r\n\r\n\t\tfor (byte b : values) {\r\n\t\t\tif (b == one) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn count;\r\n\t}", "public static int processArray(ArrayList<Integer> array) {\n\n ArrayList<Integer> dataArray = new ArrayList<>();\n int ctr = 0;\n for(int i=0;i<array.size();i++){\n if(array.get(i)%2==1){\n dataArray.add(array.get(i));\n }\n else{\n if(dataArray.size()>0)\n ctr+=getOddData(dataArray);\n dataArray.clear();\n }\n }\n if(dataArray.size()>0)\n ctr+=getOddData(dataArray);\n\n return ctr;\n }", "public int[] numberOfNge(int[] arr) {\n\t\tint[] indexes = new NextGreaterElement().nge(arr);\r\n\t\tint[] k = new int[arr.length];\r\n\t\tfor(int i = 0; i < k.length; i++)\r\n\t\t\tk[i] = 1;\r\n\t\tfor(int i = k.length - 1; i >= 0; i--) {\r\n\t\t\tif(indexes[i] == -1) // nge doesn't exist.\r\n\t\t\t\tk[i] = 0;\r\n\t\t\telse {\r\n\t\t\t\tint ngeIndex = indexes[i];\r\n\t\t\t\tk[i] += k[ngeIndex];\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Number of next greater elements: \");\r\n\t\tutil.Util.print(k);\r\n\t\treturn null;\r\n\t}", "int sizeOfStarArray();", "public void getCounts() {\t\r\n\t\t\r\n\t\tfor(int i = 0; i < 4; i++)\r\n\t\t\tfor(int j = 0; j < 3; j++)\r\n\t\t\t\tthecounts[i][j] = 0;\r\n\t\t\r\n\t\tfor(int i=0;i<maps.length-1;i++) {\r\n\t\t\tif(maps.Array1.charAt(i) == 'H' && maps.Array1.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[0][0]++;\r\n\t\t\telse if(maps.Array1.charAt(i) == 'E' && maps.Array1.charAt(i+1) =='-') \r\n\t\t\t\tthecounts[0][1]++;\r\n\t\t\telse if(maps.Array1.charAt(i) == '-' && maps.Array1.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[0][2]++;\r\n\t\t\tif(maps.Array2.charAt(i) == 'H' && maps.Array2.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[1][0]++;\r\n\t\t\telse if(maps.Array2.charAt(i) == 'E' && maps.Array2.charAt(i+1) == '-') \r\n\t\t\t\tthecounts[1][1]++;\r\n\t\t\telse if(maps.Array2.charAt(i) == '-' && maps.Array2.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[1][2]++;\r\n\t\t\tif(maps.Array3.charAt(i) == 'H' && maps.Array3.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[2][0]++;\r\n\t\t\telse if(maps.Array3.charAt(i) == 'E' && maps.Array3.charAt(i+1) == '-') \r\n\t\t\t\tthecounts[2][1]++;\r\n\t\t\telse if(maps.Array3.charAt(i) == '-' && maps.Array3.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[2][2]++;\r\n\t\t\tif(maps.Array4.charAt(i) == 'H' && maps.Array4.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[3][0]++;\r\n\t\t\telse if(maps.Array4.charAt(i) == 'E'&&maps.Array4.charAt(i+1) == '-') \r\n\t\t\t\tthecounts[3][1]++;\r\n\t\t\telse if(maps.Array4.charAt(i) == '-' && maps.Array1.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[3][2]++;\r\n\t\t}\r\n\t\t\r\n\t\t//Getting transition value between 1 and 0\r\n\t\tfor(int i=0;i<4;i++) {\r\n\t\t\tfor(int j=0;j<3;j++) {\r\n\t\t\t\tthecounts[i][j]/=maps.length;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Displaying the obtained values\r\n\t\tSystem.out.println(\"\\nTRANSITION\");\r\n\t\tSystem.out.println(\"HYDROPHOBICITY: 1->2: \" + thecounts[0][0] + \" 2->3: \" + thecounts[0][1] + \" 3->1: \" + thecounts[0][2]);\r\n\t\tSystem.out.println(\"POLARIZABILITY: 1->2: \" + thecounts[1][0] + \" 2->3: \" + thecounts[1][1] + \" 3-1: \" + thecounts[1][2]);\r\n\t\tSystem.out.println(\"POLARITY: 1->2: \" + thecounts[2][0] + \" 2->3: \" + thecounts[2][1] + \" 3->1: \" + thecounts[2][2]);\r\n\t\tSystem.out.println(\"VAN DER WALLS VOLUME: 1->2: \" + thecounts[3][0] + \" 2->3: \" + thecounts[3][1] + \" 3->1: \" + thecounts[3][2]);\r\n\t\t\r\n\t}", "public int numOfOccurances(Die[] dice, int num) {\n int occ = 0;\n for (Die d : dice) {\n if (d.getFace() == num) ++occ;\n }\n return occ;\n }", "public static int countElments(String[] source) {\r\n\r\n\t\tint numberElements = 0;\r\n\r\n\t\tfor (String element : source) {\r\n\r\n\t\t\tif (element != null) {\r\n\r\n\t\t\t\tnumberElements++;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn numberElements;\r\n\r\n\t}", "int sizeOfRoadsideArray();", "static int findMajority(int[] nums) {\n if (nums.length == 1) {//one element in array\n return nums[0];\n }\n\n Map<Integer, Integer> occurrencesCountMap = new HashMap<>();// element - times occured\n\n for (int n : nums) {//traverse nums\n\n if (occurrencesCountMap.containsKey(n) //if in map\n &&//and\n occurrencesCountMap.get(n) + 1 > nums.length / 2) {//times occurred +1 ( for current iteration ) > len/2\n\n return n;\n\n } else {//not in map yet\n\n occurrencesCountMap.put(n, occurrencesCountMap.getOrDefault(n, 0) + 1);//add 1 to existing , or inti with 1\n\n }\n }\n return -1;//no majority ( no one length/2 times occurred )\n }" ]
[ "0.72451836", "0.7086333", "0.70325917", "0.7022237", "0.70045066", "0.68623424", "0.6844739", "0.6791573", "0.6764254", "0.6711952", "0.6695265", "0.6693185", "0.6676226", "0.6671398", "0.66578054", "0.66140157", "0.6603484", "0.6585515", "0.6567479", "0.65493095", "0.6532964", "0.65088636", "0.64667565", "0.64590853", "0.64577365", "0.6455034", "0.6451207", "0.64492387", "0.64308614", "0.64183277", "0.64066184", "0.639873", "0.63914967", "0.63882387", "0.6372152", "0.63633925", "0.6362998", "0.63163036", "0.63035816", "0.6291062", "0.62850326", "0.6264951", "0.62623215", "0.626025", "0.6259246", "0.62538654", "0.6232171", "0.6221527", "0.6216314", "0.6193516", "0.61880356", "0.6178467", "0.6173408", "0.6172356", "0.61700666", "0.6168709", "0.6149639", "0.61437476", "0.61437476", "0.61404526", "0.61342186", "0.6130825", "0.61232114", "0.61211747", "0.6121018", "0.611889", "0.6110791", "0.61104935", "0.6110057", "0.61083186", "0.60964006", "0.60947406", "0.6070717", "0.60691744", "0.6060315", "0.60577875", "0.6056936", "0.60549706", "0.60503393", "0.60393333", "0.60283744", "0.6025317", "0.6024774", "0.6010453", "0.60096735", "0.60056347", "0.60010976", "0.59988254", "0.5994617", "0.599215", "0.5987402", "0.5986368", "0.59852505", "0.5980957", "0.5980104", "0.5978972", "0.5978427", "0.5972691", "0.59694374", "0.5969311" ]
0.64892614
22
Printing the indexes on which the element occured in the array....
public static int[] indexOfOccurence(int arr[], int ele) { int count = 0; for (int i = 0; i < arr.length; i++) { if (arr[i] == ele) { count++; } } int ans[] = new int[count]; int j = 0; for (int i = 0; i < arr.length - 1; i++) { if (arr[i] == ele) { ans[j] = i; j++; } } return ans; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int insideArray(ArrayList<Integer> array,int element){\r\n int index = 0;\r\n for(int arrayListElement:array){\r\n if(arrayListElement == element){\r\n return index;\r\n }\r\n index++;\r\n }\r\n return -1;\r\n }", "public abstract int getNumIndexes();", "private static void print(int[] a) {\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\tSystem.out.println(\"i is \"+ i +\" value is \"+ a[i]);\n\t\t}\n\t}", "public static ArrayList<Integer> getAllIndeces(char[] array, char target) //searches for indexes of letter in the array\n {\n ArrayList<Integer> indeces = new ArrayList<Integer>();\n for(int i = 0; i<array.length; i++)\n {\n if (array[i] == target)\n {\n indeces.add(i); //adds the index where target was found to the arraylist indeces\n }\n }\n\n return indeces;\n }", "public static void main(String[] args) {\n int[] arr={1,2,2,2,3,4,4,45}; // 1 3 45\n int[] array={};\n int j=0;\n for (int each:arr){\n int count=0;\n for (int i = 0; i <arr.length ; i++) {\n if (each==arr[i]){\n count++;\n }\n }\n if (count==1){\n System.out.println(each+\" \");\n // array[j++]=each;\n }\n }\n System.out.println(Arrays.toString(array));\n }", "static void find(int[] x) {\n\t\tint currentIndex = 0;\n\t\tint count = 1;\n\t\tint prevValue = x[0];\n\t\tint prevCount = 0;\n\t\t\n\t\tfor (int i = 0; i < x.length-1; i++) {\n\t\t\tif(x[i] == x[i+1]) {\n\t\t\t\tcount++;\n\t\t\t}else {\n\t\t\t\tif(count > prevCount) {\n\t\t\t\t\tprevCount = count;\n\t\t\t\t\tprevValue = x[i];\n\t\t\t\t\tcount = 1;\n\t\t\t\t}\n\n\t\t\t\tcurrentIndex = i;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(count > prevCount) {\n\t\t\tprevCount = count;\n\t\t\tprevValue = x[currentIndex + 1];\n\t\t}\n\t\tSystem.out.println(String.format(\"\\nPhan tu %d xuat hien %d lan\", prevValue, prevCount));\n\t}", "public static void printIntArray(int[] array){\n for(int i = 0; i < array.length; i++)\n System.out.print(\"[\" + i + \"]\" + \" = \" + array[i] + \" \");\n }", "@Override\n public int elementIndex(Object elem) {\n IntArray ia = (IntArray)elem;\n if (ia.equals(zeroIA)) return 0;\n return invPowerMap.get(ia) + 1;\n }", "private void display(int[] array) {\n\t\tfor(int unique: array) {\n\t\t\tSystem.out.println(unique);\n\t\t}\n\t}", "public void printArray(){\n\n\t\tfor (int i=0;i<1;i++){\n\n\t\t\tfor (int j=0;j<population[i].getLength();j++){\n\n\t\t\t\tSystem.out.println(\"X\" + j + \": \" + population[i].getX(j) + \" \" + \"Y\"+ j + \": \" + population[i].getY(j));\n\t\t\t\tSystem.out.println();\n\n\t\t\t}//end j\n\n\t\t\tSystem.out.println(\"The duplicate count is: \" + population[i].duplicateCheck());\n\t\t\tSystem.out.println(\"The fitness is \" + population[i].computeFitness());\n\t\t\t//population[i].computeFitness();\n\n\t\t}//end i\n\n\t}", "public static void main(String[] args) {\n\t\tint[] numbers = {1, 2, 3, 4, 5, 6};\r\n\t\tint index = 1; \r\n\t\tboolean indexFound = false;\r\n\t\tfor(int n = 0; n<numbers.length; n++) {\r\n\t\t\tif(index == numbers[n]) {\r\n\t\t\tSystem.out.println(index + \" is located at position \" + n + \" in the array numbers\");\r\n\t\t\tindexFound = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(indexFound == false) {\r\n\t\t\tSystem.out.println(index + \" was not found in the array numbers\");\r\n\t\t}\t\r\n\t}", "private int getIndex(int... elements) {\n int index = 0;\n for (int i = 0; i < elements.length; i++) index += elements[i] * Math.pow(universeSize, i);\n return index;\n }", "private static void printIntArray(int[] arr){\n\t\tSystem.out.print(\"[ \");\n\t\tfor(Integer i : arr){\n\t\t\tSystem.out.print(i + \" \");\n\t\t}\n\t\tSystem.out.println(\" ]\");\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tint[] arr={1,4,5,8,22};\n\t\tint findelemtn=searchElementByBinary(arr, 0, arr.length,22 );\n\t\tSystem.out.println(\"Element Position :\"+findelemtn);\n\n\t}", "private int getArrayIndex() {\n\t\tswitch (getId()) {\n\t\tcase 3493:\n\t\t\treturn Recipe_For_Disaster.AGRITH_NA_NA_INDEX;\n\t\tcase 3494:\n\t\t\treturn Recipe_For_Disaster.FLAMBEED_INDEX;\n\t\tcase 3495:\n\t\t\treturn Recipe_For_Disaster.KARAMEL_INDEX;\n\t\tcase 3496:\n\t\t\treturn Recipe_For_Disaster.DESSOURT_INDEX;\n\t\t}\n\t\treturn -1;\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tint[] arr = new int[5];\r\n\t\tarr[0]=100;\r\n\t\tarr[1]=21;\r\n\t\tarr[2]=32;\r\n\t\tarr[3]=4;\r\n\t\t\r\n\t\tint index=Arrays.binarySearch(arr, 32);\r\n\t\tSystem.out.println(index);\r\n\t\t\r\n\t\tArrays.sort(arr);\r\n\t\t\r\n\t\tfor(int i=1;i<arr.length;i++){\r\n\t\tSystem.out.println(arr[i]);\r\n\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tint[] ia= {940,880,830,790,750,660,590,510,440};\n\t\tSystem.out.println(\"Size of the array \\\"ia\\\": \"+ia.length);\n\t\tSystem.out.println(\"First index of the array ia: \"+\"0\");\n\t\tSystem.out.println(\"Last index of the array ia: \"+(ia.length-1));\n\n\t\tSystem.out.println(\"Element of ia at index 0: \"+ia[0]);\n\t\tSystem.out.println(\"Element of ia at index 0: \"+ia[1]);\n\t\tSystem.out.println(\"Element of ia at index 0: \"+ia[2]);\n\t\tSystem.out.println(\"Element of ia at index 0: \"+ia[3]);\n\t\tSystem.out.println(\"Element of ia at index 0: \"+ia[4]);\n\t\tSystem.out.println(\"Element of ia at index 0: \"+ia[5]);\n\t\tSystem.out.println(\"Element of ia at index 0: \"+ia[6]);\n\t\tSystem.out.println(\"Element of ia at index 0: \"+ia[7]);\n\t\tSystem.out.println(\"Element of ia at index 0: \"+ia[8]);\n\t\tSystem.out.println(\"Element of ia at index 0: \"+ia[9]);\n\t\t\n\t\tfor (int i = 0; i <= 9; i++) {\n\t\t\tSystem.out.println(\"Element of ia at index \"+i+\": \"+ia[i]);\n\t\t}\n\t\tfor (int i = 0; i <= ia.length; i++) {\n\t\t\tSystem.out.println(\"Element of ia at index \"+i+\": \"+ia[i]);\n\t\t}\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tSystem.out.println(\"Element of ia at index \"+i+\": \"+ia[i]);\n\t\t}\n\t\t\n\t}", "private static void accessIndexInSet(Set<Integer> numbers) {\n int desiredIndex = 2;\n int currentIndex = 0;\n\n //iterate the HashSet\n Iterator<Integer> iterator = numbers.iterator();\n while (iterator.hasNext()) {\n\n if (currentIndex == desiredIndex)\n System.out.println(\"Element at index \" + desiredIndex + \" is: \" + iterator.next());\n iterator.next();\n currentIndex++;\n }\n\n // M2: convert it to list\n List<Integer> list = new ArrayList<Integer>(numbers);\n list.get(2);\n\n // M3: convert it to Array []\n Integer[] integers = numbers.toArray(new Integer[numbers.size()]);\n int i = integers[2];\n }", "private static void search(int arr[],int element)\n {\n for(int i=0;i<arr.length;i++)\n {\n if(arr[i]==element)\n {\n System.out.println(\"The \"+element+\" is located at the position of \"+i);\n System.exit(0);\n }\n }\n }", "public static void main(String[] args) {\n\t\tint[] input = {3,0,6,1,5};\n\t\tSystem.out.println(hIndex(input));\n\t}", "int getIndicesCount();", "public static void main(String[] args) {\n \n\t\tint[] arr= {1,2,3,5,3,6,7,1};\n\t\tSystem.out.println(FirstIndex(arr,0,3));\n\t}", "public void printFlagPositions()\n {\n for (Integer[] flagLocation: flagLocations)\n {\n System.out.printf(\"{%d, %d}\\n\", flagLocation[0], flagLocation[1]);\n }\n }", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "public static int findValue(int [] array, int value){\n int index = -1;\n for(int i = 0; i < array.length; i++){\n if(value == array[i]){\n index = i + 1;\n System.out.println(Arrays.toString(array));\n }\n }\n return index;\n }", "public static void printArray(int v[]) {\n for (int i = 0; i < v.length; i++) {\n if (i == (v.length) - 2) {\n System.out.print(\"Posição \" + i + \": (\" + v[i] + \") e \");\n } else if (!(i == (v.length) - 1)) {\n System.out.print(\"Posição \" + i + \": (\" + v[i] + \"), \");\n } else {\n System.out.print(\"Posição \" + i + \": (\" + v[i] + \")\");\n }\n }\n System.out.println();\n }", "public static void main(String[] args) {\n\r\n\t\tint a[]={1,2,3,4,5,6,7,8,9,10};\r\n\r\n\t\tint loc=a.length/2;\r\n\t\tint mid=a[loc];\r\n\t\tint x=6;\r\n\r\n\r\n\t\tif(x==mid)\r\n\t\t{\r\n\t\t\tSystem.out.print(\"element found\");}\r\n\r\n\t\telse if(x<mid)\r\n\t\t{\r\n\t\tfor(int i=0;i<loc;i++)\r\n\t\t{\r\n\t\tif(x==a[i])\r\n\t\t{\r\n\t\tSystem.out.print(\"element found\");\r\n\t\tbreak;\r\n\t\t}\r\n\t\t}\r\n\t\t}\r\n\r\n\t\telse if(x>mid)\r\n\t\t{\r\n\t\tfor(int i=loc+1;i<a.length;i++)\r\n\t\t{\r\n\t\tif(x==a[i])\r\n\t\t{\r\n\t\tSystem.out.print(\"element found\");\r\n\t\tbreak;\r\n\t\t}\r\n\t\t}\r\n\t\t}\r\n\r\n\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tint[] arr1 = {2,4,6,8,10,12,13};\r\n\t\tint[] arr2 = {2,4,6,8,10,12};\r\n\t int n = arr2.length;\r\n\t \r\n\t System.out.println(\"Index is: \" + find(arr1, arr2, n));\r\n\r\n\t}", "public int[] findAnyPairIndexesCoprime() {\n return findAnyPairIndexesCoprime(seq);\n }", "public int getIndex();", "public int getIndex();", "public int getIndex();", "public static void linearSearch(int[] array,int key){\n for(int i=0;i<array.length;i++){\n if(array[i]==key){\n System.out.println(key+\" was found in the list with \"+(i+1)+\" iterations\");break;}\n else if(i==array.length-1&&array[i]!=key){\n System.out.println(key+\" was not found in the list with \"+(i+1)+\" iterations\"); }\n }\n }", "public static void displayValues(int [] array){\n System.out.println(Arrays.toString(array));\n }", "public static void printArray(int[] array){\n\n for(int i = 0 ; i < array.length; i++){\n System.out.println(\"Element \" + i + \", value is \" + array[i]);\n }\n\n }", "public static int[] getindex(int[] values) {\n\t \n\t \n\t \n\t int[] b = {64,128,192,256};\n\t \n\t int redindex = 0;\n\t int greenindex=0;\n\t int blueindex=0;\n\t \n\t for(int i=0; i<indexlevel8.length;i++) {\n\t if(values[0] <= indexlevel8[i]) { redindex = i; break;}\n\t }\n\t \n\t for(int i=0; i<indexlevel8.length;i++) {\n\t\t if(values[1] <= indexlevel8[i]) { greenindex = i; break;}\n\t\t }\n\t \n\t for(int i=0; i<b.length;i++) {\n\t\t if(values[2] <= b[i]) { blueindex = i; break;}\n\t }\n\t \n\t values[0] = redindex*32+16;\n\t values[1] = greenindex*32+16;\n\t values[2] = blueindex*64+32;\n\t \n\t \n\t return values; // the values of the lookup table for 8bit scale\n }", "public static void printDistinctElement(int arr[]) {\r\n\t\tSet<Integer> set = new HashSet<>();\r\n\t\tfor(int num : arr){\r\n\t\t\tif(set.add(num)){\r\n\t\t\t\tSystem.out.print(num + \" \");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public int getArrayIndex(){\n return squareIndex * 9 + position;\n }", "public void printArrayValues(int[] arr){\n for(int val : arr){\n System.out.println( val );\n }\n }", "int getIndexesCount();", "public int[] getIndexPointer(){\r\n \treturn this.index;\r\n \t}", "private static void printArray(int[] a) {\n\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\tSystem.out.print(a[k] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public Index getIndex() {\n return this.arr.getIndex();\n }", "private static void printArray(Integer[] a) {\n\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\tSystem.out.print(a[k] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public int[] getColorIndices();", "int index();", "public int[] nge(int[] arr) {\r\n\t\tint[] k = new int[arr.length];\r\n\t\tStack<Integer> stack = new Stack<>(); // Store the indexes.\r\n\t\tstack.push(0);\r\n\t\tint i = 1;\r\n\t\twhile(i < k.length) {\r\n\t\t\twhile(!stack.isEmpty() && arr[stack.peek()] < arr[i]) {\r\n\t\t\t\t// Then we have found the answer for the element at stack.peek() position.\r\n\t\t\t\tk[stack.peek()] = i;\r\n\t\t\t\tstack.pop();\r\n\t\t\t}\r\n\t\t\tstack.push(i);\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tutil.Util.print(arr);\r\n\t\twhile(!stack.isEmpty())\r\n\t\t\tk[stack.pop()] = -1; // No next greater element exist for these indexes.\r\n\t\tutil.Util.print(k);\r\n\t\treturn k;\r\n\t}", "Index getIndices(int index);", "private List<Integer> getSelectedIndexes() {\n\t\tList<Integer> result = new LinkedList<Integer>();\n\t\tfor (int i = 0; i < this.checked.size(); i++) {\n\t\t\tif (this.checked.get(i))\n\t\t\t\tresult.add(i);\n\t\t}\n\t\treturn result;\n\t}", "public void printArray(int array[]) {\n\t\tfor(int i = 0;i<array.length;i++) {\n\t\t\tSystem.out.println(\"Array[\"+ (i+1) +\"] = \"+array[i]);\n\t\t}\n\t}", "public int[] getExperimentColorIndices();", "private static void printArray(int[] array) {\n\t\tfor(int i: array) {\n\t\t\tSystem.out.print(i + \"\\t\");\n\t\t}\n\t\tSystem.out.println();\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}", "public int[] getIndexReference(){\r\n \treturn this.index;\r\n \t}", "public static void print(int[] arr, int i, int j)\n {\n System.out.println(IntStream.range(i, j + 1)\n .mapToObj(k -> arr[k])\n .collect(Collectors.toList()));\n }", "public static void printArray(int[] array){\n for(int i=0;i<array.length;i++){\n System.out.print(array[i]+\" \");\n }}", "static void print(int[] array)\n\t{\n\t\tfor(int i = 0; i < array.length; i++)\n\t\t{\n\t\t\tSystem.out.println(array[i]);\n\t\t}\n\t}", "public void printIntArray(int[] arr) {\n\t\tfor (int i = 0; i < arr.length; i++)\n\t\t\tSystem.out.print(arr[i] + \" \");\n\t}", "public String linearSearchForValue(int value) {\n String indexWithValue = \"\";\n boolean found = false;\n for(int i= 0; i < arraySize; i++){\n if(theArray[i] == value){\n found = true;\n indexWithValue += i + \" \";\n }\n printHorizontalArray(i, -1);\n }\n\n if(!found){\n indexWithValue = \"None\";\n }\n System.out.println(\"The value was found in the following: \" + indexWithValue);\n System.out.println();\n\n return indexWithValue;\n }", "public int showIndex(int userInputElement){\n int i;\n for(i=0; i<sirDeLa1La100.length; i++) {\n if (userInputElement == sirDeLa1La100[i]) {\n return i;\n }\n }\n return -1;\n }", "public int index();", "public int[] getIndices() {\r\n\t\treturn indices;\r\n\t}", "public static void main(String[] args) {\n int i[]={10,20,30,40,50}; //Array declation //here 10 store in i[0] 20 stored in i[1] and onwards\r\n \r\n for (int j = 0; j < i.length; j++) {\r\n System.out.println(i[j]); //printing array elements with for loop\r\n }\r\n }", "public static void main(String[] args) {\r\n\t\tString text = \"thestoryofleetcodeandme\";\r\n\t\tString[] words = new String[]{\"story\", \"fleet\", \"leetcode\"};\r\n\t\tint[][] arr = findIndexPairs(text, words);\r\n\t\tfor(int[] row : arr)\r\n\t\t{\r\n\t\t\tSystem.out.println(Arrays.toString(row));\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tint[] abc = {2,3,4,2,5,5};\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"enter searching index\");\n\t\tint n = sc.nextInt();\n\t\tSystem.out.println(abc[n]);\n\t\t\n\t\tint num = sc.nextInt();\n\t\tfor(int i=0;i<abc.length;i++)\n\t\t{\n\t\t\tif(num==abc[i])\n\t\t\t{\n\t\t\t\tSystem.out.println(i);\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\n\t\tString[] sortedArray = { \"A\", \"D\", \"C\", \"B\" };\n\t\tArrays.sort(sortedArray);\n\t\tfor (String takenVar : sortedArray) {\n\t\t\t// System.out.println(takenVar);\n\n\t\t}\n\n\t\tint index = Arrays.binarySearch(sortedArray, \"c\");\n\n\t\tSystem.out.println(index);\n\t\tindex = Arrays.binarySearch(sortedArray, \"e\");\n\t\tSystem.out.println(index);\n\t\tint[] sortedIntArray = new int[] { 1, 2, 3, 5, 7 };\n\n\t\tindex = Arrays.binarySearch(sortedIntArray, 6);\n\t\tSystem.out.println(index);\n\t\tList<String> list = Arrays.asList(sortedArray);\n\t\tCollections.shuffle(list);\n\t\tSystem.out.println(list);\n\n\t}", "private int getIndex(int u) {\n int ind = -1;\n for (int i = 0; i < getGraphRep().size(); i++) {\n ArrayList subList = getGraphRep().get(i);\n String temp = (String) subList.get(0);\n int vert = Integer.parseInt(temp);\n if (vert == u) {\n ind = i;\n }\n }\n return ind;\n }", "public static void main(String[] args)\n {\n int[] array = { 32, 27, 64, 18, 95, 14, 90, 70, 60, 37 };\n System.out.printf(\"%s%8s%n\", \"Index\", \"Value\"); // column headings\n \n // output each array element's value\n for (int counter = 0; counter < array.length; counter++)\n System.out.printf(\"%5d%8d%n\", counter, array[counter]);\n}", "public static void main(String[] args) {\n\t\tint[] intArr2= {11,12,13,14,15};\n\t\tint index=2;\n\t\tSystem.out.println(\"length of array is \"+intArr2.length);\n\t\t\n\t\tif(intArr2.length>index)\n\t\t{\n\t\t\t\n\t\t\tSystem.out.println(\"index found value is \\n\"+intArr2[index]);\n\t\t\tfor(int i=0;i<=index;i++)\n\t\t\t{\n\t\t\t\t System.out.println(\"values are \"+ intArr2[i]);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"index not found at\");\n\t\t}\n\t\t\n\t\t\n\t\n\t\t}", "public int indexOf(Object element) {\n //loop through the array\n for (int i = 0; i < this.array.length; i++) {\n //check each element to see if they are equal\n if (this.array[i] == element) {\n //return the index \n return i;\n }\n }\n \n //if it makes it through the array, then no elements are equal\n return -1;\n }", "public static void printArray(int[] array) {\n \n for (int i = 0; i < array.length; i++) {\n \n System.out.println(\"array[\" + i + \"] = \" + array[i]);\n }\n }", "public static void main(String[] args) {\n\t\tint [] numbers= {23,45,67,78,90}; // int numlent=numbers.length;\n\t\t // index 0 1 2 3 4\n\t\t\n\t//\tnumbers[0]=23;\n\t\t//numbers[1]=45;\n\t\t\n\t\t\n\t\t\n\t\t\n\t \n\t\t\n\t\t\n\t//\tSystem.out.println(numbers[4]);\n\t\n\t\n\t//for( int k : numbers) {\n\t\n\t//System.out.println(k);\n\t\n\t\n//\tSystem.out.println(numbers[numbers.length-3]);\n\t\n\t\n\t\n\t//for(int idx=0; idx<numbers.length; idx++) {\n\t\n\t//System.out.print(Arrays.toString(numbers));\n\t\n\t\n\t\n\t\tSystem.out.println(\"-----EXAMPLE RUN ---------\");\n\t \n\t\tString[] number = {\"zero\", \"one\", \"two\",\"three\",\"four\"};\n\t System.out.println(Arrays.toString(getWithE(number)));\n\t \n\t }", "public static void cntArray(int A[], int N) \n { \n // initialize result with 0 \n int result = 0; \n \n for (int i = 0; i < N; i++) { \n \n // all size 1 sub-array \n // is part of our result \n result++; \n \n // element at current index \n int current_value = A[i]; \n \n for (int j = i + 1; j < N; j++) { \n \n // Check if A[j] = A[i] \n // increase result by 1 \n if (A[j] == current_value) { \n result++; \n } \n } \n } \n \n // print the result \n System.out.println(result); \n }", "private int indexOf(Object element) {\n\t\tint index = -1;\n\t\tfor (int i = 0; i < numberOfElements; i++) {\n\t\t\tif (elements[i].equals(element)) {\n\t\t\t\tindex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn index;\n\t}", "private static void print(int[] arr) {\n\t\tfor(int i=0;i<=arr.length;i++)\r\n\t\t{\r\n\t\t\tSystem.out.print(arr[i]+\" \");\r\n\t\t}\r\n\t}", "@Test\r\n\tpublic void testArrayPos(){\n\t\tfor(int y=0;y<5;y++){\r\n\t\t\tfor(int x=0;x<5;x++){\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\n String[] array = {\"AAA\", \"BBB\", \"ABA\", \"ABB\", \"AAA\", \"ABB\", \"ABB\"};\n\n\n for (\n int i = 0;\n i < array.length - 1; i++)\n {\n for (int j = i + 1; j < array.length; j++) {\n\n if ((array[i].equals(array[j])) && (i != j)) {\n System.out.println(\"Дублирующийся элемент \" + array[j]);\n }\n }\n }\n }", "private int indexOf(Couple assoc) {\n for (int i = 0; i < nbAssoc; i++)\n if (associations[i].equals(assoc))\n return i;\n return -1;\n }", "public static void printArray(int[] array)\r\n {\r\n //Loop through array and print each individual element\r\n for (int n=0; n < array.length; ++n)\r\n {\r\n System.out.println(array [n]); \r\n \r\n }\r\n \r\n }", "public static void main(String[] args) {\n\n\t\tint[] numbers = new int[5];\n\t\tnumbers[0] = 110;\n\t\tnumbers[1] = 22;\n\t\tnumbers[2] = 3;\n\t\tnumbers[3] = 77;\n\t\tnumbers[4] = 9;\n\n// find out the element of 4th index position\n\t\tSystem.out.println(numbers[4]);\n\n\t\tint[] x = new int[5];\n\t\tx[0] = 110;\n\t\tx[1] = 22;\n\t\tx[2] = 3;\n\t\tx[3] = 77;\n\t\tx[4] = 9;\n\t\tfor (int a : x) {\n\t\t\tSystem.out.println(a);\n\n\t\t\t// Another way to careate Array\n\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\t\tint a[] = { 1, 2, 3, 6, 7, 8, 2, 3 };\r\n\r\n\t\tSystem.out.println(\"The Duplicates in the array is: \");\r\n\t\t\r\n\t\t//1 1\r\n\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tfor (int j=i+1; j < a.length; j++) {\r\n\t\t\t\tif (a[i] == a[j]) {\r\n\t\t\t\t\tSystem.out.println(a[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public static void showArrayValue(int arrayParameter[]){\r\n\t\t\tfor(int arrayElement:arrayParameter){\r\n\t\t\t\tSystem.out.println(arrayElement);\r\n\t\t\t}\r\n\t\t}", "public void printIntInformation(int[][] currentArray)\n\t{\n\t\tfor (int[] currentRow : currentArray)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"[\");\n\t\t\t\tfor (int currentNumber : currentRow)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.print(currentNumber + \", \");\n\t\t\t\t\t}\n\t\t\t\tSystem.out.println(\"]\");\n\t\t\t}\n\t}", "public static int getIndex(int i,int j){\r\n\t\t return i+(Variables.N+2)*j;\r\n\t }", "public static void main(String[] args) {\n\t\tint a[] = { 2, 3, 5, 6, 9, 10 };\n\t\tBinarySearch bs = new BinarySearch();\n\t\tint indexOne = bs.binarySearchAlgo(a, 0, a.length - 1, 11);\n\t\tSystem.out.println(indexOne);\n\n\t\tint indexTwo = bs.binarySearchAlgo(a, 11);\n\t\tSystem.out.println(indexTwo);\n\n\t\tint array[] = { 0, 3, 10, 10, 10, 10, 20, 25, 26 };\n\t\tint firstOccurrence = bs.firstOccurrence(array, 10);\n\t\tint lastOccurrence = bs.lastOccurrence(array, 10);\n\t\tSystem.out.println(\"First Occurrence \" + firstOccurrence + \" Last Occurrence \" + lastOccurrence);\n\n\t\tint count = bs.countDuplicateNo(array, 10);\n\t\tSystem.out.println(\"Duplicate No \" + count);\n\n\t\tint arratTwo[] = { 11, 20, 25, 30, 40, 45, 10 };\n\t\tint countRotation = bs.countRotation(arratTwo);\n\t\tSystem.out.println(\"count rotation \" + countRotation);\n\t\t\n\t\tint arrayThree[]={8,9,10,11,12,3,4,5};\n\t\tint index = bs.findElement(arrayThree,9);\n\t\tSystem.out.println(\"Element found at \"+index);\n\t}", "private int find(ElementType element){\n for(int i=0;i<size;i++){\n if(elements[i].equals(element)){\n return i;\n }\n }\n return -1;\n }", "private static void printArray(int[] array) {\n\t\tif(array==null){\n\t\t\tSystem.out.println(\"Nothing in the array.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint Len = array.length;\n\t\tfor(int i=0; i<Len; i++){\n\t\t\tSystem.out.print(\" \" + array[i]);\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t}", "public Integer[] indicesOf(String text, String[] targetArray) {\n List<Integer> indices = new ArrayList<Integer>();\n\n for(int i = 0; i < targetArray.length; i++ ) {\n if(targetArray[i].contains(text)) {\n indices.add(i);\n }\n }\n //convert list to array\n return indices.toArray(new Integer[indices.size()]);\n }" ]
[ "0.6485431", "0.6224687", "0.6193017", "0.6161933", "0.6130388", "0.60618806", "0.6059151", "0.6051903", "0.59868395", "0.5966903", "0.5966575", "0.5958161", "0.5953468", "0.5928384", "0.59249485", "0.5910869", "0.5910003", "0.5908399", "0.5898567", "0.58867884", "0.5873884", "0.5859768", "0.5843628", "0.5841989", "0.5841989", "0.5841989", "0.5841989", "0.5841989", "0.5841989", "0.5841989", "0.5841989", "0.5841989", "0.5841989", "0.5841989", "0.5841989", "0.5841989", "0.58399546", "0.5759808", "0.57568777", "0.5754559", "0.57427317", "0.5730225", "0.5730225", "0.5730225", "0.57273936", "0.57215714", "0.5720948", "0.57173544", "0.56857044", "0.5677766", "0.567387", "0.56624514", "0.564834", "0.5642801", "0.56327474", "0.5630225", "0.56300074", "0.5615243", "0.5614016", "0.5602003", "0.55893177", "0.5586108", "0.55856764", "0.55831337", "0.5571884", "0.5570055", "0.55673534", "0.5560799", "0.555675", "0.5539153", "0.55370086", "0.55323696", "0.55264264", "0.552449", "0.5522339", "0.5518537", "0.55175996", "0.5513193", "0.55121964", "0.5509313", "0.5509158", "0.550495", "0.5503116", "0.5500883", "0.54915476", "0.5481732", "0.54788023", "0.5478098", "0.5475749", "0.54717654", "0.54637736", "0.54636574", "0.54519385", "0.544597", "0.5444777", "0.543255", "0.54310167", "0.54300314", "0.54281294", "0.5418256" ]
0.5872775
21
Starts the QuckSort algorithm and gets a boundary (see b)
public void go(int boundary) { this.b = boundary; System.out.println("Start QuickSort ..."); this.startTime = new Date().getTime(); sort(0, sequence.length - 1); this.endTime = new Date().getTime(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override public void run() {\n\t\t\t// Handle the base case:\n\t\t\tif(len - start < 2) {\n\t\t\t\t// Arrive at the base-case state & return:\n\t\t\t\tph.arrive();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// TODO: Select an optimal pivot point:\n\t\t\tint pivot = start;\n\n\t\t\t// Perform the necessary swap operations:\n\t\t\tfor(int i = start; i < len; ++i) {\n\t\t\t\tif(data[i] < data[pivot]) {\n\t\t\t\t\tint tmp = data[pivot];\n\t\t\t\t\tdata[pivot] = data[i];\n\t\t\t\t\tdata[i] = data[pivot + 1];\n\t\t\t\t\tdata[pivot + 1] = tmp;\n\t\t\t\t\t++pivot;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle the single-threaded case:\n\t\t\tif(this.pool == null) {\n\t\t\t\t// Store local variables temporarily:\n\t\t\t\tint start = this.start;\n\t\t\t\tint len = this.len;\n\n\t\t\t\t// Do the first half:\n\t\t\t\tthis.len = pivot;\n\t\t\t\trun();\n\n\t\t\t\t// Prepare for the second half of the array:\n\t\t\t\tthis.len = len;\n\t\t\t} else {\n\t\t\t\t\t// Register a task to process the first half of the array:\n\t\t\t\t\t// TODO: Don't do this if that thread's base-case is met\n\t\t\t\t\tpool.submit(new Sorter(this.pool, this.ph, data, start, pivot));\n\t\t\t}\n\n\t\t\t// Recursively process the second half of the array:\n\t\t\tstart = pivot + 1;\n\t\t\trun();\n\t\t}", "public void buildInitialBand()\r\n\t{\n\t\r\n\tint bl = boundary.size();\r\n\tfor(int i=0; i<bl; i++) \r\n\t\t{\r\n\t\tInt2d bCur = boundary.get(i);\r\n\t\t//System.out.println(bCur.x + \", \" + bCur.y + \": size = \" + heap.size());\r\n\t\t\r\n\t\ttestPointsAround(bCur.x,bCur.y);\r\n\t\t}\r\n\t\r\n\t}", "public void sort() {\n\t\tSystem.out.println(\"Quick Sort Algorithm invoked\");\n\n\t}", "public static void intQSort(int v[], int l, int r) {\n\n int tmp; //tmp variable for swapping\n\n if (INSERTIONENABLED) {\n\n //Use insertion sort for arrays smaller than CUTOFF\n if (r < CUTOFF) {\n\n for(int i = l; i < r; i++) {\n for(int j = i; j > 0 && v[j - 1] > v[j]; j--) {\n // swap(j, j -1) {\n tmp=v[j - 1];\n v[j - 1]=v[j];\n v[j]=tmp;\n // }\n }\n }\n\n return;\n }\n }\n\n int pivot;\n int m = l + (int) (Math.random() * ((r - l) + 1)); // random number between first and last, Peto's remark\n\n //median(v[l], v[m], v[r]) {\n if (v[l] <= v[m]) {\n if (v[m] <= v[r])\n pivot = v[m];\n else {\n if (v[l] <= v[r])\n pivot = v[r];\n else\n pivot = v[l];\n }\n } else {\n if (v[m] <= v[r]) {\n if (v[l] <= v[r])\n pivot = v[l];\n else\n pivot = v[r];\n } \n else\n pivot = v[m];\n }\n // }\n\n int i=l,j=r;\n\n //Partioning\n while(i<=j) {\n\n while(v[i]<pivot) i++;\n while(v[j]>pivot) j--;\n\n if(i<=j) {\n //swap(i, j) {\n tmp=v[i];\n v[i]=v[j];\n v[j]=tmp;\n // }\n\n i++;\n j--;\n }\n }\n\n if(l<j) \n intQSort(v,l,j);\n\n if(i<r) \n intQSort(v,i,r);\n }", "public static void dbQSort(double[] v, int l, int r) {\n\n double pivot;\n int m = l + (int) (Math.random() * ((r - l) + 1)); // random number between first and last, Peto's remark\n \n //median(v[l], v[m], v[r]) {\n if (v[l] <= v[m]) {\n if (v[m] <= v[r])\n pivot = v[m];\n else {\n if (v[l] <= v[r])\n pivot = v[r];\n else\n pivot = v[l];\n }\n } else {\n if (v[m] <= v[r]) {\n if (v[l] <= v[r])\n pivot = v[l];\n else\n pivot = v[r];\n } \n else\n pivot = v[m];\n }\n // }\n\n int i=l,j=r;\n double tmp; //tmp variable for swapping\n\n //Partioning\n while(i<=j) {\n\n while(v[i]<pivot) i++;\n while(v[j]>pivot) j--;\n\n if(i<=j) {\n //swap(i, j) {\n tmp=v[i];\n v[i]=v[j];\n v[j]=tmp;\n // }\n\n i++;\n j--;\n }\n }\n\n if(l<j) \n dbQSort(v,l,j);\n\n if(i<r) \n dbQSort(v,i,r);\n\n }", "@Override\r\n\tpublic void run() {\n\t\tvfBest();\r\n\t\tif(currQSize > maxQSize){\r\n\t\t\tDTS(Prey.currentTrajectory.peek().qCounter,vFBestNode.qCounter);\r\n\t\t\tSystem.out.println(\"Queue Cut\");\r\n\t\t}\r\n\t\t\r\n\t}", "public void doTheAlgorithm() {\n this.swapCount = 0;\n this.compCount = 0;\n \n\t\tdoQuickSort(0, this.sortArray.length - 1);\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tint[] x = {9,2,4,5,6,7,8,2,44,55,90,1456,300,345654,1,76};\n\t\t\n\t\tSystem.out.println(Arrays.toString(x));\n\t\t\n\t\tint since = 0;\n\t\tint until = x.length - 1;\n\t\tquicksort(x,since,until);\n\t\tSystem.out.println(Arrays.toString(x));\n\t\t\n\t\t}", "public static void main(String arg []) {\r\n\t\tint n = 8; //problem size\r\n\t\t\r\n\t\ttestSortingAlgorithm(new Insertion(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new Selection(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new Bubble(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new QuicksortFateful(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new QuicksortCentralElement(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new QuicksortMedianOfThree(n));\r\n\t}", "public void quickSortHelper(int start, int end){\n if(start < end){\n //partition index calls partition that returns idx\n //and also puts toSort[partitionidx] in the right place\n int partitionidx = partition(start, end);\n\n //sorts elements before and after the partitions\n //recursive - nice\n //System.out.println(\"test\");\n quickSortHelper(start, partitionidx - 1); //befre\n quickSortHelper(partitionidx + 1, end); //after\n }\n }", "public static void main(String[] args){\n int [] a= {18,10,23,46,9};\n quickSort(a,0,a.length-1);\n }", "@Override\n\t\tpublic void run() {\n\t\t\tfor (int i = 0; i < 1000000; i++) {\n\t\t\t\tint[] a = Util.generateRandomArray(500, 200000);\n\t\t\t\tint[] b = a.clone();\n\t\t\t\t\n\t\t\t\ta = sort(a);\n\t\t\t\tArrays.sort(b);\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < b.length; j++) {\n\t\t\t\t\tUtil.Assert(a[j] == b[j], \"shit\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Heap sort ok\");\n\t\t}", "public BucketSort()\n {\n for(int i = 0; i < 30; i++)\n {\n a[i] = generator.nextInt(50)+1;\n b[i] = a[i];\n }\n }", "public static void startRound(int round, boolean end) throws InputMismatchException, FileNotFoundException\r\n\t{\r\n\t\t\r\n\t\tQuickSorter quickSort = null;\r\n\t\tInsertionSorter inSort = null;\r\n\t\tMergeSorter mergeSort = null;\r\n\t\tAbstractSorter selSort = null;\t\r\n\t\tPoint[] points = null;\r\n\t\tRandom ran = new Random();\r\n\t\t\r\n\t\tSystem.out.println(\"Round \" + round);\r\n\t\tSystem.out.println(\"1)Create Random Points 2)Import File 3)Exit\");\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\t\r\n\t\tint input = scan.nextInt();\r\n\t\t\r\n\t\tif(input == 1)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"How many points?\");\r\n\t\t\tinput = scan.nextInt();\r\n\t\t\tpoints = new Point[input];\r\n\t\t\tpoints = generateRandomPoints(input, ran);\r\n\t\t\t\r\n\t\t\tquickSort = new QuickSorter(points);\r\n\t\t\tinSort = new InsertionSorter(points);\r\n\t\t\tmergeSort = new MergeSorter(points);\r\n\t\t\tselSort = new SelectionSorter(points);\t\r\n\t\t}\r\n\t\telse if(input == 2)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"File Name(must end in .txt):\");\r\n\t\t\tString fileName = scan.next();\r\n\r\n\t\t\t\tquickSort = new QuickSorter(fileName);\r\n\t\t\t\tinSort = new InsertionSorter(fileName);\r\n\t\t\t\tmergeSort = new MergeSorter(fileName);\r\n\t\t\t\tselSort = new SelectionSorter(fileName);\t\r\n\t\t\t\t\r\n\t\t}\r\n\t\telse if(input == 3)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Trial Terminated\");\r\n\t\t\tend = true;\r\n\t\t\tscan.close();\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"1) Sort By X-Coordingate 2)Sort By Polar-Angle\");\r\n\t\tint order = scan.nextInt();\r\n\t\t\r\n\t\tselSort.sort(order);\r\n\t\tinSort.sort(order);\r\n\t\tmergeSort.sort(order);\r\n\t\tquickSort.sort(order);\r\n\t\t\r\n\t\tSystem.out.println(\"Algorithm\\tSize\\tTime\");\r\n\t\tSystem.out.println(\"---------------------------------------\");\r\n\t\tSystem.out.println(selSort.stats());\r\n\t\tselSort.draw();\r\n\t\t\r\n\t\tSystem.out.println(inSort.stats());\r\n\t\tinSort.draw();\r\n\t\t\r\n\t\tSystem.out.println(quickSort.stats());\r\n\t\tquickSort.draw();\r\n\t\t\r\n\t\tSystem.out.println(mergeSort.stats() + \"\\n\");\r\n\t\tmergeSort.draw();\r\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tif (initializeStackFlag == 1)\n\t\t\t\t{\n\t\t\t\t\tleftP.add(0);\n\t\t\t\t\trightP.add(box.getArrayRectangle().length - 1);\n\t\t\t\t\tinitializeStackFlag = 0;\n\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Decides which block has to be sorted \n\t\t\t\telse if (codeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\t// if the stack becomes empty then i means that our algorithm is over\n\t\t\t\t\tif (rightP.isEmpty() || leftP.isEmpty())\n\t\t\t\t\t{\n\t\t\t\t\t\tcodeFlag = 0;\n\t\t\t\t\t\ttimer.stop();\n\t\t\t\t\t\tbox.setColorRange(0, box.getNumber() - 1, END_COLOR);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tSystem.out.println(\"The quickSort is complete\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (delayFlag7 == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelay7++;\n\t\t\t\t\t\tif (delay7 >= DELAY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdelayFlag7 = 0;\n\t\t\t\t\t\t\tdelay7 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// step zero check whether to continue the algorithm or not\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// takes out the left and right index from the stack\n\t\t\t\t\t\tleft = leftP.pop();\n\t\t\t\t\t\tright = rightP.pop();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// selecting a pivot in the block\n\t\t\t\t\t\tpivot = random.nextInt(right - left + 1) + left;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//box.setColorRange(0, box.getNumber() - 1, BLOCK_COLOR2);\n\t\t\t\t\t\tbox.setColorRange(left, right, BLOCK_COLOR1);\n\t\t\t\t\t\tbox.getRectangle(pivot).setColor(FOCUS_COLOR1);\n\t\t\t\t\t\t\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\n\t\t\t\t\t\tcodeFlag = 0;\n\t\t\t\t\t\tdelay3 = 0;\n\t\t\t\t\t\tdelayFlag3 = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (delayFlag3 == 1)\n\t\t\t\t{\n\t\t\t\t\tdelay3++;\n\t\t\t\t\tif (delay3 >= DELAY)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelayFlag3 = 0;\n\t\t\t\t\t\tdelay3 = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tdownFlag = 1;\n\t\t\t\t\t\tseperateFlag = 1;\n\t\t\t\t\t\tcurrentDownCount = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if block has only one element then just sort the next block\n\t\t\t\t\t\tif (left == right)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\t\t\tseperateFlag = 0;\n\t\t\t\t\t\t\tdelayFlag7 = 1;\n\t\t\t\t\t\t\tdelay7 = 0;\n\t\t\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\t\t\tbox.getRectangle(left).setColor(BASE_COLOR);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if pivot selected is left then just start separating the elements(lesser and bigger ones)\n\t\t\t\t\t\tif (pivot == left)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\t\t\tseperateFlag = 0;\n\t\t\t\t\t\t\tcurrentDownCount = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tupFlag = 0;\n\t\t\t\t\t\t\tseperateFlag = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpartetionFlag = 1;\n\t\t\t\t\t\t\tpartetionCodeFlag = 1;\n\t\t\t\t\t\t\tdelayFlag5 = 0;\n\t\t\t\t\t\t\tdelay5 = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\trect = box.getRectangle(left);\n\t\t\t\t\t\t\tbig = left + 1;\n\t\t\t\t\t\t\tsmall = left;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// first bring the pivot at the beginning of the block\n\t\t\t\t\n\t\t\t\t// moving the pivot down\n\t\t\t\telse if (seperateFlag == 1)\n\t\t\t\t{\n\t\t\t\t\tif (downFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(pivot, 0, YCHANGE);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tcurrentDownCount += YCHANGE;\n\t\t\t\t\t\tif (currentDownCount >= DOWN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentDownCount - DOWN;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(pivot, 0, -excess);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\t\t\trightBlockFlag = 1;\n\t\t\t\t\t\t\tindex = pivot - 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// moving the block of rectangle (to the left of the pivot) to the right\n\t\t\t\t\telse if (rightBlockFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (index < left)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\t\t\tleftFlag = 1;\n\t\t\t\t\t\t\tcurrentLeftCount = 0;\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\trightFlag = 1;\n\t\t\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\t\t\tindexRightCount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// moving each rectangle of the block to the right\n\t\t\t\t\telse if (rightFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(index, XCHANGE, 0);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tindexRightCount += XCHANGE;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (indexRightCount >= width)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = indexRightCount - width;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(index, -excess, 0);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\trightFlag = 0;\n\t\t\t\t\t\t\trightBlockFlag = 1;\n\t\t\t\t\t\t\tindex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// shifting the pivot to left\n\t\t\t\t\telse if (leftFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(pivot, -XCHANGE, 0);\n\t\t\t\t\t\tcurrentLeftCount += XCHANGE;\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tif (currentLeftCount >= (pivot - left) * width)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentLeftCount - (pivot - left) * width;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(pivot, excess, 0);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tleftFlag = 0;\n\t\t\t\t\t\t\tupFlag = 1;\n\t\t\t\t\t\t\tcurrentUpCount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// moving the piot up\n\t\t\t\t\telse if (upFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(pivot, 0, -YCHANGE);\n\t\t\t\t\t\tcurrentUpCount += YCHANGE;\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tif (currentUpCount >= DOWN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentUpCount - DOWN;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(pivot, 0, excess);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tupFlag = 0;\n\t\t\t\t\t\t\tseperateFlag = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpartetionFlag = 1;\n\t\t\t\t\t\t\tpartetionCodeFlag = 1;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdelayFlag5 = 0;\n\t\t\t\t\t\t\tdelay5 = 0;\n\t\t\t\t\t\t\tRectangle pivotRectangle = box.getRectangle(pivot);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (int t = pivot - 1; t >= left; t--)\n\t\t\t\t\t\t\t\tbox.setRectangle(box.getRectangle(t), t + 1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbox.setRectangle(pivotRectangle, left);\n\t\t\t\t\t\t\trect = box.getRectangle(left);\n\t\t\t\t\t\t\tbig = left + 1;\n\t\t\t\t\t\t\tsmall = left;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// after the pivot has been moved to the starting index then start separating the rectangle\n\t\t\t\t// those which are smaller and those which are bigger than than pivot are separated\n\t\t\t\t\n\t\t\t\telse if (partetionFlag == 1)\n\t\t\t\t{\n\t\t\t\t\tif (delayFlag5 == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelay5++;\n\t\t\t\t\t\tif (delay5 >= DELAY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdelayFlag5 = 0;\n\t\t\t\t\t\t\tdelay5 = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpartetionFlag = 0;\n\t\t\t\t\t\t\tpartetionCodeFlag = 0;\n\t\t\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tleftP.add(left + 1);\n\t\t\t\t\t\t\trightP.add(right);\n\t\t\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (big > right)\n\t\t\t\t\t{\n\t\t\t\t\t\tpartetionFlag = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tpartetionEnd = 1;\n\t\t\t\t\t\tdelayFlag4 = 1;\n\t\t\t\t\t\tdelay4 = 0;\n\t\t\t\t\t\tdownFlag = 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcurrentDownCount = 0;\n\t\t\t\t\t\tpartetionFlag = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tdelayFlag1 = 0;\n\t\t\t\t\t\tdelay1 = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\t\tdelay2 = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (left == small)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox.setColorRange(left + 1, right, BLOCK_COLOR1);\n\t\t\t\t\t\t\tbox.getRectangle(small).setColor(BASE_COLOR);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tpartetionEnd = 0;\n\t\t\t\t\t\t\tdelayFlag4 = 0;\n\t\t\t\t\t\t\tdelay4 = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpartetionFlag = 1;\n\t\t\t\t\t\t\tdelayFlag5 = 1;\n\t\t\t\t\t\t\tdelay5 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if (partetionCodeFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (delayFlag1 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdelay1++;\n\t\t\t\t\t\t\tif (delay1 >= DELAY)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdelayFlag1 = 0;\n\t\t\t\t\t\t\t\tdelay1 = 0;\n\t\t\t\t\t\t\t\tbig++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (delayFlag2 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdelay2++;\n\t\t\t\t\t\t\tif (delay2 >= DELAY)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\t\t\t\tdelay2 = 0;\n\t\t\t\t\t\t\t\tbig++;\n\t\t\t\t\t\t\t\tsmall++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (rect.getData() <= box.getRectangle(big).getData())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdelayFlag1 = 1;\n\t\t\t\t\t\t\tdelay1 = 0;\n\t\t\t\t\t\t\tbox.getRectangle(big).setColor(BLOCK_COLOR2);\n\t\t\t\t\t\t\tpaintBox();\n\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\n\t\t\t\t\t\t\tif (big == small + 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdelayFlag2 = 1;\n\t\t\t\t\t\t\t\tdelay2 = 0;\n\t\t\t\t\t\t\t\tbox.getRectangle(big).setColor(DFAULT_COLOR);\n\t\t\t\t\t\t\t\tpaintBox();\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\tpartetionCodeFlag = 0;\n\t\t\t\t\t\t\t\tpartetionSwapFalg = 1;\n\t\t\t\t\t\t\t\tcurrentDownCount = 0;\n\t\t\t\t\t\t\t\tdownFlag = 1;\n\t\t\t\t\t\t\t\tbox.getRectangle(big).setColor(DFAULT_COLOR);\n\t\t\t\t\t\t\t\tdelayFlag4 = 1;\n\t\t\t\t\t\t\t\tdelay4 = 0;\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (partetionSwapFalg == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (delayFlag4 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdelay4++;\n\t\t\t\t\t\t\tif (delay4 >= DELAY)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdelayFlag4 = 0;\n\t\t\t\t\t\t\t\tdelay4 = 0;\n\t\t\t\t\t\t\t\tdownFlag = 1;\n\t\t\t\t\t\t\t\tcurrentDownCount = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (downFlag == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox.addOffsetRectangle(big, 0, YCHANGE);\n\t\t\t\t\t\t\tbox.addOffsetRectangle(small + 1, 0, YCHANGE);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tcurrentDownCount += YCHANGE;\n\t\t\t\t\t\t\tif (currentDownCount >= DOWN)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tint excess = currentDownCount - DOWN;\n\t\t\t\t\t\t\t\tbox.addOffsetRectangle(big, 0, -excess);\n\t\t\t\t\t\t\t\tbox.addOffsetRectangle(small + 1, 0, -excess);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\t\t\t\tleftFlag = 1;\n\t\t\t\t\t\t\t\tcurrentLeftCount = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// shifting the next block to left\n\t\t\t\t\t\telse if (leftFlag == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox.addOffsetRectangle(big, -XCHANGE, 0);\n\t\t\t\t\t\t\tbox.addOffsetRectangle(small + 1, XCHANGE, 0);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcurrentLeftCount += XCHANGE;\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tif (currentLeftCount >= width * (big - small - 1))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tint excess = currentLeftCount - width * (big - small - 1);\n\t\t\t\t\t\t\t\tbox.addOffsetRectangle(big, excess, 0);\n\t\t\t\t\t\t\t\tbox.addOffsetRectangle(small + 1, -excess, 0);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\tleftFlag = 0;\n\t\t\t\t\t\t\t\tupFlag = 1;\n\t\t\t\t\t\t\t\tcurrentUpCount = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// moving the next block up\n\t\t\t\t\t\telse if (upFlag == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox.addOffsetRectangle(small + 1, 0, -YCHANGE);\n\t\t\t\t\t\t\tbox.addOffsetRectangle(big, 0, -YCHANGE);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcurrentUpCount += YCHANGE;\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tif (currentUpCount >= DOWN)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tint excess = currentUpCount - DOWN;\n\t\t\t\t\t\t\t\tbox.addOffsetRectangle(big, 0, excess);\n\t\t\t\t\t\t\t\tbox.addOffsetRectangle(small + 1, 0, excess);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Reflecting the same procedure internally\n\t\t\t\t\t\t\t\tRectangle currRect = box.getRectangle(small + 1);\n\t\t\t\t\t\t\t\tRectangle nextRect = box.getRectangle(big);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tbox.setRectangle(currRect, big);\n\t\t\t\t\t\t\t\tbox.setRectangle(nextRect, small + 1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tbig++;\n\t\t\t\t\t\t\t\tsmall++;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tupFlag = 0;\n\t\t\t\t\t\t\t\tpartetionSwapFalg = 0;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tpartetionCodeFlag = 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// replacing the pivot at its correct position\n\t\t\t\telse if (partetionEnd == 1)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif (downFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(left, 0, YCHANGE);\n\t\t\t\t\t\tbox.addOffsetRectangle(small, 0, YCHANGE);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tcurrentDownCount += YCHANGE;\n\t\t\t\t\t\tif (currentDownCount >= DOWN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentDownCount - DOWN;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(left, 0, -excess);\n\t\t\t\t\t\t\tbox.addOffsetRectangle(small, 0, -excess);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\t\t\tleftFlag = 1;\n\t\t\t\t\t\t\tcurrentLeftCount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// shifting the next block to left and pivot to right\n\t\t\t\t\telse if (leftFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(left, XCHANGE, 0);\n\t\t\t\t\t\tbox.addOffsetRectangle(small, -XCHANGE, 0);\n\t\t\t\t\t\t\n\t\t\t\t\t\tcurrentLeftCount += XCHANGE;\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tif (currentLeftCount >= width * (small - left))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentLeftCount - width * (small - left);\n\t\t\t\t\t\t\tbox.addOffsetRectangle(small, excess, 0);\n\t\t\t\t\t\t\tbox.addOffsetRectangle(left, -excess, 0);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tleftFlag = 0;\n\t\t\t\t\t\t\tupFlag = 1;\n\t\t\t\t\t\t\tcurrentUpCount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// moving the pivot up\n\t\t\t\t\telse if (upFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(small, 0, -YCHANGE);\n\t\t\t\t\t\tbox.addOffsetRectangle(left, 0, -YCHANGE);\n\t\t\t\t\t\t\n\t\t\t\t\t\tcurrentUpCount += YCHANGE;\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tif (currentUpCount >= DOWN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentUpCount - DOWN;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(left, 0, excess);\n\t\t\t\t\t\t\tbox.addOffsetRectangle(small, 0, excess);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Reflecting the same procedure internally\n\t\t\t\t\t\t\tRectangle currRect = box.getRectangle(small);\n\t\t\t\t\t\t\tRectangle nextRect = box.getRectangle(left);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbox.setRectangle(currRect, left);\n\t\t\t\t\t\t\tbox.setRectangle(nextRect, small);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Add the stuffs to stack\n\t\t\t\t\t\t\tif (left < small)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbox.setColorRange(left, small - 1, BLOCK_COLOR1);\n\t\t\t\t\t\t\t\tbox.getRectangle(small).setColor(BASE_COLOR);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\tleftP.add(left);\n\t\t\t\t\t\t\t\trightP.add(small - 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (small < right)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbox.getRectangle(small).setColor(BASE_COLOR);\n\t\t\t\t\t\t\t\tbox.setColorRange(small + 1, right, BLOCK_COLOR1);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\tleftP.add(small + 1);\n\t\t\t\t\t\t\t\trightP.add(right);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tupFlag = 0;\n\t\t\t\t\t\t\tdelayFlag6 = 1;\n\t\t\t\t\t\t\tdelay6 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (delayFlag6 == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelay6++;\n\t\t\t\t\t\tif (delay6 >= DELAY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdelayFlag6 = 0;\n\t\t\t\t\t\t\tdelay6 = 0;\n\t\t\t\t\t\t\tpartetionEnd = 0;\n\t\t\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public void doQuickSort() {\n\t\t\n\t\twhile(true) {\n\t\t\tSystem.out.println(\"Enter 1, to choose the pivot as 1st element\");\n\t\t\tSystem.out.println(\"Enter 2, to Choose the pivot as random number\");\n\t\t\tSystem.out.println(\"Enter 3, to choose the pivot as median of 3 random numbers\");\n\t\t\t//System.out.println(\"Enter any random number to choose the pivot from median of median method\");\n\t\t\tchoice = quickInput.nextLine();\n\t\t\t\tif(choice.equals(\"1\") || choice.equals(\"2\") || choice.equals(\"3\")) {\n\t\t\t\t\tSystem.out.println(\"Please enter the value of L to run insertion Sort: (0 if not applicable) \");\n\t\t\t\t\tchunkValue = quickInput.nextInt();\n\t\t\t\t\tQuickAlgorithm quick = new QuickAlgorithm(dataSet, choice, chunkValue);\n\t\t\t\t\tquick.processFileData();\n\t\t\t\t\tdataSet = quick.getFinalDataSet();\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Invalid value.. Try again..!!!\");\n\t\t\t\t}\n\t\t}\n\t\t\n\t\tquickInput = new Scanner(System.in);\n\t\t\n\t\t\n\t\tSystem.out.println(\"Would you like to export the result array to a csv file?\"\n\t\t\t\t+ \"('Y' for yes)\");\n\t\tif(quickInput.nextLine().equalsIgnoreCase(\"Y\")) {\n\t\t\n\t\t\t// Write the output to a csv file\n\t\t\ttry {\n\t\t\t\tWriteOutputToCSV.generateOutput(dataSet, \"Quick\");\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}\n\t\t\n\t\tSystem.out.println(\"Quick Sort Algorithm Process complete\");\n\t\t\n\t}", "static void bucket_partition(int b_size, LikenessBuckets bk){\n\t\tint parts = b_size/partition_size; //#partitions per bucket\n\t\tdouble ratio; int offsetB; int offsetP;\n\t\tint chunk_size; int partSA;\n\t\tshort[][] tmpBucket;\n\t\tint[] loaded;\n\n\t\tif(parts == 0){\n\t\t\tparts = 1;\n\t\t\tchunk_sizes.add(b_size);\n\t\t}else{\n\t\t\tfor(int i=0; i<parts-1; i++){\n\t\t\t\tchunk_sizes.add(partition_size);\n\t\t\t}\n\t\t\tif ((b_size % partition_size) <= (partition_size/2)){\n\t\t\t\tchunk_sizes.addFirst(partition_size + (b_size % partition_size));\n\t\t\t}else{\n\t\t\t\tparts++;\n\t\t\t\tchunk_sizes.add(partition_size);\n\t\t\t\tchunk_sizes.addLast(b_size % partition_size);\n\t\t\t}\n\t\t}\n\t\tloaded = new int[parts];\n\n\t\tfor(int b=0; b<buckNum; b++){//for every bucket\n\t\t\ttmpBucket = new short[bucket_size][dims];\n\t\t\tArrayList<Integer> chg = bk.changeSA.get(b);\n\t\t\tint first = 0; int last;\n\t\t\tfor(int i=0; i<parts; i++){\n\t\t\t\tloaded[i] = 0;\n\t\t\t}\n\t\t\tfor(int i=0; i<chg.size(); i++){//for every SA\n\t\t\t\tlast = chg.get(i);\n\t\t\t\tif((last-first) > 1){\n\t\t\t\t\t//System.out.println(\"sorting bucket[\"+b+\"][\"\n\t\t\t\t\t//\t\t\t\t +first+\"--\"+last+\"]\");\n\t\t\t\t\tquickSortBucket(first, last, b);\n\t\t\t\t}\n\t\t\t\toffsetB = first;\n\t\t\t\toffsetP = 0;\n\t\t\t\tfor(int jj=0; jj<parts; jj++){//for every partition\n\t\t\t\t\tchunk_size = chunk_sizes.get(jj);\n\t\t\t\t\t//ratio = ((double)chunk_size) / ((double)bucket_size);\n\t\t\t\t\t//partSA = (int)(Math.ceil(ratio * ((float)(last-offsetB+1))));\n\t\t\t\t\tpartSA = (int)Math.ceil(((double)(last-offsetB+1)) / ((double)(parts-jj)));\n\t\t\t\t\tif (partSA > (chunk_size - loaded[jj]))\n\t\t\t\t\t\tpartSA = chunk_size - loaded[jj];\n\t\t\t\t\tfor(int j=0; j<partSA; j++){\n\t\t\t\t\t\ttmpBucket[offsetP + loaded[jj] + j] = buckets[b][offsetB + j];\n\t\t\t\t\t}\n\t\t\t\t\tloaded[jj] += partSA;\n\t\t\t\t\toffsetB += partSA;\n\t\t\t\t\toffsetP += chunk_size;\n\t\t\t\t}\n\t\t\t\tfirst = last+1;\n\t\t\t}\n\t\t\tbuckets[b] = tmpBucket;\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tQuickHelper help = new QuickHelper();\n\t\t\n\t\tSystem.out.println(\"Now starting A\");\n\t\tint A[] = {5,2,12,7,9,6};\n\t\thelp.print(A);\n\t\tint n= A.length;\n\t\thelp.sort(A, 0, n-1);\n\t\thelp.print(A);\n\t\t\n\t\tSystem.out.println(\"\\nNow starting B\");\n\t\tint B[] = {1,2,3,4};\n\t\thelp.print(B);\n\t\tn = B.length;\n\t\thelp.tailrecursivesort(B, 0, n-1);\n\t\thelp.print(B);\n\t\t\n\t\tSystem.out.println(\"\\nNow starting C\");\n\t\tint C[] = {1,2,3,4};\n\t\thelp.print(C);\n\t\tn = C.length;\n\t\thelp.improvedtailrecursivesort(C, 0, n-1);\n\t\thelp.print(C);\n\t}", "public void run()\n { // checking for appropriate sorting algorithm\n \n if(comboAlgorithm.equals(\"Shell Sort\"))\n {\n this.shellSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Selection Sort\"))\n {\n this.selectionSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Insertion Sort\"))\n {\n this.insertionSort(randInt);\n }\n if(comboAlgorithm.equals(\"Bubble Sort\"))\n {\n this.bubbleSort(randInt);\n }\n \n }", "static void minimumBribes(int[] q) {\n \t\n \tfor(int i=0;i<q.length;i++){\n if((q[i] - (i+1)) > 2){\n System.out.println(\"Too chaotic\");\n return; \n }\n }\n \n int swaps=0;\n for(int i=0;i< q.length;i++){\n for(int j=i+1;j<q.length;j++){\n if(q[i] > q[j]){ \n int tmp=q[j];\n q[j]=q[i];\n q[i]=tmp;\n swaps++;\n }\n }\n }\n \n System.out.println(swaps);\n \n }", "public void quicksort(int[] a, int start, int end){\n\t\tif(end <= start) return;\r\n\t\t//2 number\r\n//\t\tif(end - start == 1 && a[start] > a[end]){\r\n//\t\t\tswap(a, start, end);\r\n//\t\t\treturn;\r\n//\t\t}\r\n\t\tif((end - start )< 20){\r\n\t\t\tinsertSort(a, start,end);\r\n\t\t\treturn;\r\n\t\t}\r\n\t int pivot = getPivot(a, start, end);\r\n\t int i = start, j = end - 1;\r\n\t while(i < j){\r\n\t while(i < j && a[++i] < pivot);\r\n\t while(i < j && a[--j] > pivot);\r\n\t if(i < j)\r\n\t swap(a, i, j);\r\n\t }\r\n\t swap(a, i, end -1);\r\n\t quicksort(a, start, i - 1);\r\n\t quicksort(a, i + 1, end);\r\n\t}", "public int[] quicksort(int A[], int izq, int der) {\r\n\r\n\t\t int piv=A[izq]; // tomamos el primer elemento como pivote\r\n\t\t int i=izq; // i realiza la búsqueda de izquierda a derecha\r\n\t\t int j=der; // j realiza la búsqueda de derecha a izquierda\r\n\t\t int aux;\r\n\t\t \r\n\t\t while(i<j){ // mientras no se crucen...\r\n\t\t while(A[i]<=piv && i<j) i++; // busca un elemento mayor que pivote,\r\n\t\t while(A[j]>piv) j--; // busca un elemento menor que pivote,\r\n\t\t if (i<j) { // si los encuentra y no se han cruzado... \r\n\t\t aux= A[i]; // los intercambia.\r\n\t\t A[i]=A[j];\r\n\t\t A[j]=aux;\r\n\t\t }\r\n\t\t }\r\n\t\t A[izq]=A[j]; // colocamos el pivote en su lugar de la forma [menores][pivote][mayores]\r\n\t\t A[j]=piv; \r\n\t\t if(izq<j-1)\r\n\t\t quicksort(A,izq,j-1); // ordenamos mitad izquierda\r\n\t\t if(j+1 <der)\r\n\t\t quicksort(A,j+1,der); // ordenamos mitad derecha\r\n\t\t \r\n\t return A;\r\n\t\t\t }", "public static void quickSortBucket(int left, int right, int b) {\n\t\tint i = left, j = right;\n\t\tint ref = left + (right-left)/2; //i.e., (right+left)/2\n\t\tshort[] pivot = buckets[b][ref];\n\t\tshort[] temp2 = new short[dims];\n\t\twhile (i <= j) { \n\t\t\twhile (compare_data(pivot, buckets[b][i]))\n\t\t\t\ti++;\n\t\t\twhile (compare_data(buckets[b][j], pivot))\n\t\t\t\tj--;\n\t\t\tif (i <= j) {\n\t\t\t\ttemp2=buckets[b][i];\n\t\t\t\tbuckets[b][i]=buckets[b][j];\n\t\t\t\tbuckets[b][j]=temp2;\n\n\t\t\t\ti++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t}; \n\t\t// recursion\n\t\tif (left < j)\n\t\t\tquickSortBucket(left, j, b);\n\t\tif (i < right) {\n\t\t\tquickSortBucket(i, right, b);\n\t\t}\n\t}", "private void splitArrayB() {\r\n //find upper bound. anything below goes within.\r\n //calculate highest A, loop through b til above that, then iterate b index til at end of b\r\n int a_count = 0;\r\n int b_count = 0;\r\n int highA = A[splitA[a_count]];\r\n boolean first = true;\r\n for(int i = 0; i < B.length; i++){\r\n if(highA >= B[i]){\r\n first = false;\r\n }\r\n else if(highA < B[i]){\r\n if(first == false){\r\n splitB[b_count] = i - 1;\r\n b_count++;\r\n highA = A[splitA[a_count]];\r\n a_count++;\r\n }\r\n else{\r\n while(a_count != splitA.length){\r\n if(highA < B[i]){\r\n splitB[b_count] = - 1;\r\n b_count++;\r\n a_count++;\r\n highA = A[splitA[a_count]];\r\n }\r\n else{\r\n splitB[b_count] = i;\r\n b_count++;\r\n a_count++;\r\n highA = A[splitA[a_count]];\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if(b_count != splitB.length){\r\n splitB[b_count] = splitB.length - 1;\r\n b_count++;\r\n while(b_count < splitB.length){\r\n splitB[b_count] = -1;\r\n b_count++;\r\n }\r\n return;\r\n }\r\n splitB[b_count - 1] = b_count - 1;\r\n }", "public void quicksort()\n { quicksort(this.heap, 0, heap.size()-1);\n }", "public static void main(String[] args) {\n\t\t// Part 1 Bench Testing\n\t\t// -----------------------------------\n\n\t\t// -----------------------------------\n\t\t// Array and other declarations\n\t\t// -----------------------------------\n\t\tStopWatch sw = new StopWatch(); // timer for measuring execution speed\n\t\tfinal int SIZE = 100000; // size of array we are using\n\n\t\tint[] sourceArray, copyArray; // arrays for testing insertionSort and selectionSort\n\t\tInteger[] sourceArray2, copyArray2; // arrays for testing shell, merge, quicksort\n\n\t\t// -------------------------------------------------\n\t\t// Array initialization to a predetermined shuffle\n\t\t// -------------------------------------------------\n\t\tsourceArray = new int[SIZE]; // for use in selection, insertion sort\n\t\tscrambleArray(sourceArray, true); // scramble to a random state\n\t\tsourceArray2 = new Integer[SIZE]; // for use in shell,merge,quicksort\n\t\tscrambleArray(sourceArray2, true); // scramble to a random state\n\n\t\t// ---------------------------------------\n\t\t// SELECTION SORT\n\t\t// ---------------------------------------\n\t\t// for all sorts, we must reset copyArray\n\t\t// to sourceArray before sorting\n\t\t// ---------------------------------------\n\t\tcopyArray = Arrays.copyOf(sourceArray, SIZE);\n\n\t\tSystem.out.println(\"Before Selection Sort\");\n\t\t// printArray(copyArray);\n\t\tSystem.out.println(\"Selection Sort\");\n\t\tsw.start(); // start timer\n\t\tSortArray.selectionSort(copyArray, SIZE);\n\t\tsw.stop(); // stop timer\n\t\tSystem.out.println(\"selection sort took \" + sw.getElapsedTime() + \" msec\");\n\t\tSystem.out.println(\"After Selection Sort\");\n\t\t// printArray(copyArray);\n\n\t\t// -----------------------------------------\n\t\t// INSERTION SORT\n\t\t// -----------------------------------------\n\t\t// Reset copyArray back to unsorted state\n\t\t// -----------------------------------------\n\n\t\t// add statements for STEP 2 here\n\n\t\t// -----------------------------------------\n\t\t// SHELL SORT\n\t\t// -----------------------------------------\n\t\t// Reset copyArray2 back to unsorted state\n\t\t// -----------------------------------------\n\n\t\t// add statements for STEP 3 here\n\n\t\t// -----------------------------------------\n\t\t// MERGE SORT\n\t\t// -----------------------------------------\n\t\t// Reset copyArray2 back to unsorted state\n\t\t// -----------------------------------------\n\n\t\t// add statements for STEP 4 here\n\n\t\t// -----------------------------------------\n\t\t// QUICK SORT\n\t\t// -----------------------------------------\n\t\t// Reset copyArray2 back to unsorted state\n\t\t// -----------------------------------------\n\n\t\t// add statements for STEP 5 here\n\n\t}", "public static int partition(int qArr[], int start, int end){\n int pivot; int endLeft; int mid;\n \n mid = (start + end) / 2;\n swap(qArr, start, mid);\n pivot=qArr[start];\n endLeft=start;\n for (int scan = start + 1; scan <= end; scan++){\n if(qArr[scan]<pivot){\n endLeft++;\n swap(qArr,endLeft,scan);\n }\n }\n swap(qArr,start,endLeft);\n return endLeft;\n }", "public void quickSort() {\n\t\tquickSort(0, data.size() - 1);\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Counting Sort\\n\");\n\t\t\n\t\tint [] A = {14, 10, 13, 4, 7, 9, 3, 5, 3, 5};\n\t\tint [] B = new int [A.length + 1];\n\t\t\n\t\t//Gets the highest number in the array\n\t\tint k = 0;\n\t\tfor(int i = 0 ; i < A.length ; i++){\n\t\t\tif(A[i] > k)\n\t\t\t\tk = A[i];\n\t\t}\n\t\t\n\t\tCountingSort(A, B, k);\n\t\t/*\t\t\t\tCounting Sort Algorithm Starts Here\t\t\t*/\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"\\n\");\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/*\t\t\t\tBucket Sort Algorithm Starts Here\t\t\t*/\n\t\tint [] NewA = {14, 10, 13, 4, 7, 9, 3, 5};\n\t\t\n\t\t\n\t\t\n\t\tBucketSort(NewA);\n\t\t\n\t\t/*\t\t\t\tBucket Sort Algorithm Ends Here\t\t\t\t*/\n\t}", "private void quicksortSeq(Comparable[] array, int low, int up){\r\n\t\tif(low < up){\r\n\t\t\trekursionsSchritte += 2;\r\n\t\t\tint p = findPiv(array, low, up);\r\n\t\t\tquicksortSeq(array, low, p);\r\n\t\t\tquicksortSeq(array, p + 1, up);\r\n\t\t}\r\n\t}", "private void sort(int start, int stop) {\n\t\taddComparison();\n\t\tif (start > stop) {\n\t\t\treturn;\n\t\t}\n\t\taddComparison();\n\t\tif (stop - start < b) {\n\t\t\tbubbleSort(start, stop);\n\t\t} else {\n\t\t\tint pivotIndex = start + (int) ((stop - start) * Math.random());\n\t\t\tfloat pivot = sequence[pivotIndex];\n\t\t\tint left = start;\n\t\t\tint right = stop;\n\t\t\twhile (left <= right) {\n\t\t\t\taddComparison();\n\t\t\t\twhile (sequence[left] < pivot) {\n\t\t\t\t\tleft++;\n\t\t\t\t\taddComparison();\n\t\t\t\t}\n\t\t\t\taddComparison();\n\t\t\t\twhile (sequence[right] > pivot) {\n\t\t\t\t\tright--;\n\t\t\t\t\taddComparison();\n\t\t\t\t}\n\t\t\t\taddComparison();\n\t\t\t\tif (left <= right) {\n\t\t\t\t\tswapAt(left, right);\n\t\t\t\t\tleft++;\n\t\t\t\t\tright--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsort(start, right);\n\t\t\tsort(left, stop);\n\t\t}\n\t}", "private QuickSort3Way() {}", "public void shellSort(int[] a) \n {\n int increment = a.length / 2;\n while (increment > 0) \n {\n \n for (int i = increment; i < a.length; i++) //looping over the array\n {\n int j = i;\n int temp = a[i]; // swapping the values to a temporary array\n try\n {\n if(!orderPanel) // checking for Descending order\n {\n while (j >= increment && a[j - increment] > temp) \n {\n a[j] = a[j - increment]; //swapping the values\n thread.sleep(100);\n repaint();\n this.setThreadState();\n j = j - increment;\n }\n }\n \n else\n {\n while (j >= increment && a[j - increment] < temp) //checking for Ascending order\n {\n a[j] = a[j - increment];\n thread.sleep(200);\n repaint();\n this.setThreadState();\n j = j - increment;\n }\n \n }\n }\n catch(Exception e)\n {\n System.out.println(\"Exception occured\" + e);\n }\n a[j] = temp;\n }\n \n if (increment == 2) \n {\n increment = 1;\n } \n else \n {\n increment *= (5.0 / 11);\n }\n }\n }", "private void quickSortM(int[] arr, int start, int end) {\n\t\tif(start>=end)\r\n\t\t\treturn ;\r\n\t\tint bounary = partition(arr,start,end);\r\n\t\tquickSortM(arr,start,bounary-1);\r\n\t\tquickSortM(arr, bounary+1, end);\r\n\t}", "public static void main(String[] args) {\n\n\t\tMAV_QSort cQSort = new MAV_QSort();\n\t\tMAV_BSort cBSort = new MAV_BSort();\n\t\t\n\t\t// Инициализируем массивы\n\t\tinitarray();\n\t\t// Стандартная сортировка массивов\n\t\tArrays.sort(aSort_ST);\n\t\tSystem.out.print(\"Пузырек: \");\n\t\tfor (int i = 0; i< aSort_Et.length; i++) System.out.print(aSort_B[i]+ \", \");\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.print(\"Quick : \");\n\t\tfor (int i = 0; i< aSort_Et.length; i++) System.out.print(aSort_Q[i]+ \", \");\n\t\t\n\t\t// Сортируем массив по пузырьку\n\t\tcBSort.make_BSort(aSort_B);\n\t\t\n\t\t// Выводим результаты сортировки\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"Результаты сортировки\");\n\t\tSystem.out.print(\"Пузырек рез: \");\n\t\tfor (int i = 0; i< aSort_Et.length; i++) System.out.print(aSort_B[i]+ \", \");\n\t\tcQSort.make_QSort(aSort_Q);\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.print(\"Quick рез : \");\n\t\tfor (int i = 0; i< aSort_Et.length; i++) System.out.print(aSort_Q[i]+ \", \");\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"Равенство массивов сортировки пузырьком и быстрой сортировки:\"+Arrays.equals(aSort_B, aSort_Q));\n\t\tSystem.out.println(\"Равенство массивов стандарной сортировки и быстрой сортировки:\"+Arrays.equals(aSort_ST, aSort_Q));\n\n\t}", "private void calculateBPRange() {\n\t\tbroadPhaseLength = 0.0f;\n\t\tfor (Vector2f p : points) {\n\t\t\tbroadPhaseLength = Math.max(broadPhaseLength, Math.abs(p.length()));\n\t\t}\n\t}", "private int partition(int[] arr, int start, int end) {\n\t\tint bounary = arr[start];\r\n\t\twhile(start<end) {\r\n\t\t\twhile(start<end&&arr[end]>=bounary) {\r\n\t\t\t\tend--;\r\n\t\t\t}\r\n\t\t\tarr[start] = arr[end];\r\n\t\t\twhile(start<end&&arr[start]<=bounary) {\r\n\t\t\t\tstart++;\r\n\t\t\t}\r\n\t\t\tarr[end] = arr[start];\r\n\t\t}\r\n\t\tarr[start] = bounary;\r\n\t\treturn start;\r\n\t}", "private static void BucketSort(int[] A){\n\t\tSystem.out.println(\"BucketSort\\n\");\n\t\t\n\t\tSystem.out.print(\"Before bucket sort: \");\n\t\tfor(int i = 0 ; i < A.length ; i++){\n\t\t\tSystem.out.print(A[i] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\t//Gets the highest number in the array\n\t\tint MaxNum = 0;\n\t\tfor(int i = 0 ; i < A.length ; i++){\n\t\t\tif(A[i] > MaxNum)\n\t\t\t\tMaxNum = A[i];\n\t\t}\n\t\t\n\t\tint[] B = new int [MaxNum + 1];\n\t\t\n\t\tfor(int i = 0 ; i < B.length ; i++){\n\t\t\tB[i] = 0;\n\t\t}\n\t\t\n\t\tfor(int i = 0 ; i < A.length; i++){\n\t\t\t B[A[i]]++;\n\t\t}\n\t\t\n\t\t//implementing insertion sort with bucket\n\t\tint BucketPosition = 0;\n\t\t\n\t\tfor(int i = 0 ; i < B.length ; i++){\n\t\t\tfor(int j = 0 ; j < B[i] ; j++){\n\t\t\t\tA[BucketPosition] = i;\n\t\t\t\tBucketPosition++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t/* \t\t\tPrints out the after sorting algorithm\t\t*/\n\t\tSystem.out.print(\"\\nAfter bucket sort: \");\n\t\tfor(int i = 0 ; i < A.length; i++)\n\t\t\tSystem.out.print(A[i] + \" \");\n\t\t\n\t}", "private void doQuickSort(int lowerIndex, int higherIndex){\n\t\tint lowItter = lowerIndex;\n\t\tint highItter = higherIndex;\n \n\t\t// use the middle as a pivot numberr\n int middleIndex = lowerIndex + (higherIndex - lowerIndex)/2;\n\t\tint pivot = sortArray[middleIndex];\n \n\t\twhile (lowItter <= highItter) {\n\t\t\twhile (sortArray[lowItter] < pivot)\n lowItter++;\n \n\t\t\twhile (sortArray[highItter] > pivot)\n highItter--;\n \n compCount++;\n\t\t\tif (lowItter <= highItter) {\n\t\t\t\tswap(lowItter, highItter);\n swapCount++;\n \n\t\t\t\tlowItter++;\n\t\t\t\thighItter--;\n\t\t }\n\t\t}\n \n compCount++;\n\t\tif (lowerIndex < higherIndex)\n\t\t\tdoQuickSort(lowerIndex, highItter);\n \n compCount++;\n\t\tif (lowItter < higherIndex)\n\t\t\tdoQuickSort(lowItter, higherIndex);\n \n\t}", "public void sortArray() {\n\t\tSystem.out.println(\"QUICK SORT\");\n\t}", "private static <Item extends Comparable> void partitionBed(\n List<Item> unsorted, Bear pivot,\n List<Item> less, List<Item> equal, List<Item> greater) {\n for (Item s : unsorted) {\n if (s.compareTo(pivot) < 0) {\n less.add(s);\n } else if (s.compareTo(pivot) == 0) {\n equal.add(s);\n } else {\n greater.add(s);\n }\n }\n }", "static void minimumBribes(int[] q) {\n int swaps = 0;\n for (int i = 0; i < q.length; i++) {\n if ((q[i] - (i+1)) > 2) {\n System.out.println(\"Too chaotic\");\n return;\n }\n for (int j = i + 1; j < q.length; j++) {\n if (q[i] > q[j]) {\n int t = q[j];\n q[j] = q[i];\n q[i] = t;\n swaps++;\n }\n }\n }\n\n System.out.println(swaps);\n }", "public static void main(String[] args) { \n\t\tint[] try1 = new int[1000000000];\n\t\tRandom rand = new Random();\n\t\tfor(int i = 0; i < try1.length; i++) {\n\t\t\ttry1[i] = rand.nextInt();\n\t\t}\n // System.out.println(toString1(try1));\n\t\tLong startTime = new Long(System.currentTimeMillis());\n\t\tquickSortIn(try1, 0, try1.length - 1, 20);\n\t\tLong endTime = new Long(System.currentTimeMillis());\n\t\tSystem.out.println(endTime.intValue() - startTime.intValue());\n // System.out.println(toString1(try1));\n\n\n // Which test to run?\n\t // test();\n\t // test2();\n\t // test3();\n\t // test4();\n\t\n\t}", "public static void main(String[] args) \t{\n\n\t\tif (args.length!=7){\n\t\t\tSystem.out.println(\"\\nUsage: java SortGreedy_BLikeness inFile n SA beta part_size part_option q\");\n\t\t\tSystem.out.println(\"\\t inFile: input file name (path included).\");\n\t\t\tSystem.out.println(\"\\t n: number of tuples in inFile.\");\n\t\t\t//System.out.println(\"\\t d: dimensionality of the dataset.\");\n\t\t\tSystem.out.println(\"\\t SA: index of sensitive attribute [0 -- d-1].\");\n\t\t\tSystem.out.println(\"\\t l: beta: B-likeness parameter.\");\n\t\t\tSystem.out.println(\"\\t part_size: size of the bucket partitions.\");\n\t\t\tSystem.out.println(\"\\t part_option: 0 (safer, keeps all SAs distributions), or\");\n\t\t\tSystem.out.println(\"\\t 1 (better utility, but may cause problems), or \");\n\t\t\tSystem.out.println(\"\\t 2 (no bucket partitioning).\\n\");\n\t\t\tSystem.out.println(\"\\t q: 1 with queries, 0 without\\n\");\n\t\t\t//\t\t\tSystem.out.println(\"\\t th: distance threshold to place chunk in bucket, in [0, 1].\");\n\t\t\treturn;\n\t\t}\n\n\t\tString inputFile = args[0];\n\t\ttuples = Integer.parseInt(args[1]); // n\n\t\t//dims = Integer.parseInt(args[2]); //d\n\t\tSA = Integer.parseInt(args[2]); //Sensitive Attribute (0 - 7).\n\t\tb_param = Double.parseDouble(args[3]); // beta\n\t\tpartition_size = Integer.parseInt(args[4]);\n\t\tpartition_function = Integer.parseInt(args[5]);\n\t\tq = Boolean.parseBoolean(args[6]);\n\t\t//\t\tthreshold = Double.parseDouble(args[7]);\n\t\torigTuples = tuples;\n\n\t\t/*\n\t\tint modl = (tuples % l_param);\n\t\tif (modl > 0){\n\t\t\t//change n (#tuples), so that it is divided by l:\n\t\t\ttuples = tuples + (l_param - modl);\n\t\t\tfor (int i=0; i<dims-1; i++)\n\t\t\t\tcardinalities[1]++;\n\t\t}\n\t\tmap = new short[tuples][dims];\n\t\tbuckets = new short[l_param][tuples/l_param][dims];\n\t\t */\n\t\tmap = new short[tuples][dims];\n\t\tMinMaxPerAttribute = new int[dims][2];\n\n\t\tlong startTime = System.currentTimeMillis();\n\t\ttry {\n\t\t\tCensusParser tp = new CensusParser(inputFile, dims);\n\t\t\tint i=0;\n\t\t\twhile (tp.hasNext()){\n\t\t\t\tmap[i++]=tp.nextTuple2();\n\t\t\t\tfor (int j=0; j<dims; j++){\n\t\t\t\t\tif (map[i-1][j] < MinMaxPerAttribute[j][0]){ //min\n\t\t\t\t\t\tMinMaxPerAttribute[j][0] = map[i-1][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (map[i-1][j] > MinMaxPerAttribute[j][1]){ //max\n\t\t\t\t\t\tMinMaxPerAttribute[j][1] = map[i-1][j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t/*\n\t\tif (modl > 0){\n\t\t\t//add dummy tuples:\n\t\t\tfor(int i=(tuples-(l_param-modl)); i<tuples; i++){\n\t\t\t\tfor(int j=0; j<dims; j++){\n\t\t\t\t\tif (j == dims-1){\n\t\t\t\t\t\tmap[i][j] = -1; //unique SA\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmap[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t */\n\t\tlong midTime = System.currentTimeMillis();\n\t\tdimension_sort();//sort the dimensions\n\t\tLikenessBuckets bk = new LikenessBuckets(b_param, tuples, dims, map, buckets, 0, inputFile);\n\t\tbuckets = bk.bucketization(SA);\n\t\t//bk.printBuckets();\n\n\t\tlong bucketEndTime = System.currentTimeMillis();\n\t\tSystem.out.println(\"Time of reading dataset: \"+(midTime - startTime)+\" miliseconds.\");\n\t\tSystem.out.println(\"Time of creating buckets: \"+(bucketEndTime - midTime)+\" miliseconds.\");\n\t\t//bk.printBuckets();\n\n\t\tmap=null; //delete map\n\t\tSystem.gc();\n\n\n\t\tbucket_size = bk.bucketSize;//bucket capacity (c).\n\t\tbuckNum = bk.buckNum; //number of buckets (|B|).\n\t\tSystem.out.println(\"Number of buckets:\"+buckNum);\n\t\t//update \"tuples\" number, taking into account the dummies:\n\t\ttuples = (bucket_size * buckNum);\n\n\t\tfinal_assignment = new int[tuples][buckNum];\n\n\t\tdouble distortion = 0.0;\n\t\tint chunk_size;\n\n\t\t/*\n\t\t * Sort groups of same-SA tuples in each bucket, wrt QIDs.\n\t\t * Then form bucket partitions, keeping SA distributions.\n\t\t */\n\t\tif (partition_function == 0)\n\t\t\tbucket_partition(bucket_size, bk); //keep all SAs distrubutions.\n\t\telse if (partition_function == 1){\n\t\t\tbucket_partition2(bucket_size, bk); //only keep 1st SA distribution.\n\t\t} //else NO_PARTITION //default.\n\t\tSystem.gc();\n\t\t//bk.printBuckets();\n\n\t\tif((partition_function == 0) || (partition_function == 1)){ //partitioned buckets:\n\n\t\t\tfor (int bucket_index=0; bucket_index<buckNum; bucket_index++){\n\n\t\t\t\tint chunk_offset = 0;\n\t\t\t\tfor (int chunk_index=0; chunk_index<chunk_sizes.size(); chunk_index++){\n\t\t\t\t\tchunk_size = chunk_sizes.get(chunk_index);\n\n\t\t\t\t\t//edges = new HeapNode[chunk_size*chunk_size*2];\n\t\t\t\t\tedges = new HeapNode[chunk_size*chunk_size];\n\n\t\t\t\t\t//we need SA, too!\n\t\t\t\t\tif (MIXED){\n\t\t\t\t\t\tMinMaxPerAssign = new int[chunk_size][dims-1][2];\n\t\t\t\t\t\tdistinctValuesPerAssign = (LinkedList<Integer>[][]) new LinkedList[chunk_size][dims];\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif (RANGE){\n\t\t\t\t\t\t\tMinMaxPerAssign = new int[chunk_size][dims-1][2];\n\t\t\t\t\t\t\tdistinctValues1 = (LinkedList<Integer>[]) new LinkedList[chunk_size];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdistinctValuesPerAssign = (LinkedList<Integer>[][]) new LinkedList[chunk_size][dims];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//HeapComparator hc = new HeapComparator();\n\t\t\t\t\tdouble[][] array = computeCostMatrix(buckets[bucket_index],buckets[(bucket_index+1)%buckNum], bucket_index*bucket_size, chunk_offset, chunk_size);\n\t\t\t\t\tint[] assignment = new int[array.length];\n\t\t\t\t\tint times = 0;\n\n\t\t\t\t\twhile (++times<buckNum){\n\t\t\t\t\t\t//qSort(0, chunk_size*chunk_size-1);\n\t\t\t\t\t\tqSort(0, edge_size-1);\n\t\t\t\t\t\tgreedyAssign(array, assignment, chunk_size);//Call SortGreedy algorithm.\n\n\t\t\t\t\t\tfor (int i=0; i<assignment.length; i++){\n\t\t\t\t\t\t\tfinal_assignment[i+chunk_offset+bucket_index*bucket_size][times] = bucketToIndexMapping((bucket_index+times)%buckNum,(chunk_offset+assignment[i]));\n\t\t\t\t\t\t\tif (MIXED){\n\t\t\t\t\t\t\t\tfindSet_mixed(i, buckets[(bucket_index+times)%buckNum][chunk_offset+assignment[i]] );\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tif (RANGE)\n\t\t\t\t\t\t\t\t\tfindSet_numerical(i, buckets[(bucket_index+times)%buckNum][chunk_offset+assignment[i]]);\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tfindSet(i,buckets[(bucket_index+times)%buckNum][chunk_offset+assignment[i]]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (times!=buckNum-1)\n\t\t\t\t\t\t\trecomputeCostMatrix(array, (bucket_index+times+1)%buckNum, chunk_offset, chunk_size);\n\t\t\t\t\t}\n\t\t\t\t\tfor (int i=0; i<chunk_size; i++){\n\t\t\t\t\t\tif (MIXED){\n\t\t\t\t\t\t\tdistortion += NCP_mixed(MinMaxPerAssign[i], distinctValuesPerAssign[i]);\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t\tif (RANGE)\n\t\t\t\t\t\t\t\tdistortion += NCP_numerical(MinMaxPerAssign[i]);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tdistortion += NCP(distinctValuesPerAssign[i]);\n\t\t\t\t\t}\n\t\t\t\t\tchunk_offset += chunk_size;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{ //No partitioning:\n\t\t\tfor (int bucket_index=0; bucket_index<buckNum; bucket_index++){\n\n\t\t\t\t//edges = new HeapNode[bucket_size*bucket_size*2];\n\t\t\t\tedges = new HeapNode[bucket_size*bucket_size];\n\t\t\t\t//we need SA, too!\n\t\t\t\tif (MIXED){\n\t\t\t\t\tMinMaxPerAssign = new int[bucket_size][dims-1][2];\n\t\t\t\t\tdistinctValuesPerAssign = (LinkedList<Integer>[][]) new LinkedList[bucket_size][dims];\n\t\t\t\t}else{\n\t\t\t\t\tif (RANGE){\n\t\t\t\t\t\tMinMaxPerAssign = new int[bucket_size][dims-1][2];\n\t\t\t\t\t\tdistinctValues1 = (LinkedList<Integer>[]) new LinkedList[bucket_size];\n\t\t\t\t\t}else{\n\t\t\t\t\t\tdistinctValuesPerAssign = (LinkedList<Integer>[][]) new LinkedList[bucket_size][dims];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//HeapComparator hc = new HeapComparator();\n\t\t\t\tdouble[][] array = computeCostMatrix(buckets[bucket_index],buckets[(bucket_index+1)%buckNum], bucket_index*bucket_size, 0, bucket_size);\n\n\t\t\t\tint[] assignment = new int[array.length];\n\t\t\t\tint times = 0;\n\n\t\t\t\twhile (++times<buckNum){\n\t\t\t\t\t//qSort(0, bucket_size*bucket_size-1);\n\t\t\t\t\tqSort(0, edge_size-1);\n\t\t\t\t\tgreedyAssign(array, assignment, bucket_size);//Call SortGreedy algorithm.\n\n\t\t\t\t\tfor (int i=0; i<assignment.length; i++){\n\t\t\t\t\t\tfinal_assignment[i+bucket_index*bucket_size][times] = bucketToIndexMapping((bucket_index+times)%buckNum, assignment[i]);\n\t\t\t\t\t\tif (MIXED){\n\t\t\t\t\t\t\tfindSet_mixed(i, buckets[(bucket_index+times)%buckNum][assignment[i]] );\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif (RANGE)\n\t\t\t\t\t\t\t\tfindSet_numerical(i, buckets[(bucket_index+times)%buckNum][assignment[i]]);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tfindSet(i,buckets[(bucket_index+times)%buckNum][assignment[i]]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (times!=buckNum-1)\n\t\t\t\t\t\trecomputeCostMatrix(array, (bucket_index+times+1)%buckNum, 0, bucket_size);\n\t\t\t\t}\n\t\t\t\tfor (int i=0; i<bucket_size; i++){\n\t\t\t\t\tif (MIXED){\n\t\t\t\t\t\tdistortion += NCP_mixed(MinMaxPerAssign[i], distinctValuesPerAssign[i]);\n\t\t\t\t\t}else\n\t\t\t\t\t\tif (RANGE)\n\t\t\t\t\t\t\tdistortion += NCP_numerical(MinMaxPerAssign[i]);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdistortion += NCP(distinctValuesPerAssign[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}//endif (partition or no_partition)\n\n\t\t//**** BEGIN XUE MINGQIANG **** //\n\t\t// this call returns a random assignment generated from the k-regular matching graph\n\t\tint [] rand_A = Randomization.run(final_assignment, 0, final_assignment.length, buckNum);\n\t\t//**** END XUE MINGQIANG **** //\n\t\tlong endTime = System.currentTimeMillis();\n\n\t\t//System.out.println(\"The winning assignment after \"+index+\" runs (\" + sumType + \" sum) is:\\n\");\t\n\n\t\t/*\n\t\tfor (int i=0; i<final_assignment.length; i++){\n\t\t\tfor (int j=0; j<buckNum; j++){\n\t\t\t\tSystem.out.print((final_assignment[i][j] +1)+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t */\n\n\t\tSystem.out.println(\"Time: \"+(endTime - startTime)+\"ms \"+\"\\n Distortion \"+ (double)(distortion/((dims-1)*tuples)));\n\n\t\tSystem.out.println(\"Saving results.\");\n\t\t//Save Results:\n\t\tFileWriter fw = null;\n\t\ttry{\n\t\t\tfw = new FileWriter(\"./SortGreedyResults.txt\",true); //true == append\n\t\t\tfw.write(origTuples+\" \"+b_param+\" \");\n\t\t\tif((partition_function == 0) || (partition_function == 1)){\n\t\t\t\tfw.write(partition_size+\" \");\n\t\t\t}else{\n\t\t\t\tfw.write(bucket_size+\" \");\n\t\t\t}\n\t\t\tfw.write((endTime - startTime)+\" \"\n\t\t\t\t\t+((double)(distortion/((dims-1)*tuples)))+\"\\n\");\n\t\t}catch(IOException ioe){\n\t\t\tSystem.err.println(\"IOException: \" + ioe.getMessage());\n\t\t}finally{\n\t\t\ttry{\n\t\t\t\tif(fw != null) fw.close();\n\t\t\t}catch(Exception e){\n\t\t\t\t//ignore.\n\t\t\t}\n\t\t}\n\t\tif (!q){\n\t\t\tSystem.out.println(\"Range Queries.\");\n\t\t\tdouble[] selectivities = {0.05, 0.1, 0.15, 0.2, 0.25};\n\t\t\tString qErr = \"\";\n\t\t\tFileWriter qw = null;\n\t\t\ttry{\n\t\t\t\tint qtimes = 1000; //numer of random queries.\n\t\t\t\tdouble[] errArray = new double[qtimes];\n\t\t\t\tqw = new FileWriter(\"./SortGreedy_QueryError.txt\",true); //true == append\n\t\t\t\t//qw.write(\"#tuples beta size lamda sel error\\n\");\n\t\t\t\t/*\n\t\t\tfor (int i=0; i<selectivities.length; i++){\n\t\t\t\tfor (int l=1; l<dims; l++){\n\t\t\t\t\tqw.write(origTuples+\" \"+b_param+\" \"+bucket_size+\" \"+\n\t\t\t\t\t\t\t l+\" \"+selectivities[i]+\" \");\n\t\t\t\t\tdouble[][] tmpres = new double[l+1][2];\n\t\t\t\t\tqErr = rangeQueries(selectivities[i], l, tmpres, qtimes);\n\t\t\t\t\tqw.write(qErr+\" \\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t */\n\t\t\t\t//sel=0.1\n\t\t\t\tdouble[][] tmpres = new double[dims][2];\n\n\t\t\t\tSystem.out.println(\"Vary lambda (sel=0.1): \");\n\t\t\t\tfor (int l=1; l<dims; l++){\n\t\t\t\t\tqw.write(origTuples+\" \"+b_param+\" \"+bucket_size+\" \"+\n\t\t\t\t\t\t\tl+\" \"+selectivities[1]+\" \");\n\t\t\t\t\tfor (int qi=0; qi<dims; qi++){ //INITIALIZATION:\n\t\t\t\t\t\ttmpres[qi][0] = (double)MinMaxPerAttribute[qi][0]-1;//<min SA value.\n\t\t\t\t\t\ttmpres[qi][1] = (double)MinMaxPerAttribute[qi][1]+1;//>max SA value\n\t\t\t\t\t}\n\n\t\t\t\t\tqErr = rangeQueries_serial(selectivities[1], l, tmpres, qtimes, errArray);\n\t\t\t\t\tqw.write(qErr+\" \\n\");\n\t\t\t\t}\n\n\t\t\t\tqw.write(\"\\n\");\n\t\t\t\tSystem.out.println(\"Vary selectivity (lambda=3): \");\n\t\t\t\tint l=3; //lambda = 3 first QIs.\n\t\t\t\tfor (int i=0; i<selectivities.length; i++){\n\t\t\t\t\tqw.write(origTuples+\" \"+b_param+\" \"+bucket_size+\" \"+\n\t\t\t\t\t\t\tl+\" \"+selectivities[i]+\" \");\n\t\t\t\t\tfor (int qi=0; qi<dims; qi++){ //INITIALIZATION:\n\t\t\t\t\t\ttmpres[qi][0] = (double)MinMaxPerAttribute[qi][0]-1;//<min SA value.\n\t\t\t\t\t\ttmpres[qi][1] = (double)MinMaxPerAttribute[qi][1]+1;//>max SA value\n\t\t\t\t\t}\n\n\t\t\t\t\tqErr = rangeQueries_serial(selectivities[i], l, tmpres, qtimes, errArray);\n\t\t\t\t\tqw.write(qErr+\" \\n\");\n\t\t\t\t}\n\n\t\t\t\tqw.write(\"\\n\");\n\t\t\t}catch(IOException ioe){\n\t\t\t\tSystem.err.println(\"IOException: \" + ioe.getMessage());\n\t\t\t}finally{\n\t\t\t\ttry{\n\t\t\t\t\tif(qw != null) qw.close();\n\t\t\t\t}catch(Exception e){\n\t\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "private void quickSort(int start, int end) {\n\t\tint pivot, i, j;\n\t\tif (start < end) {\n\t\t\t// Select first element as Pivot\n\t\t\tpivot = start;\n\t\t\ti = start;\n\t\t\tj = end;\n\n\t\t\t// Base condition\n\t\t\twhile (i < j) {\n\t\t\t\t// increment i till found greater element than pivot\n\t\t\t\tfor (i = start; i <= end; i++) {\n\t\t\t\t\tif (data.get(i) > data.get(pivot)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// decrement j till found lesser element than pivot\n\t\t\t\tfor (j = end; j >= start; j--) {\n\t\t\t\t\tif (data.get(j) <= data.get(pivot)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// if i<j than swap\n\t\t\t\tif (i < j) {\n\t\t\t\t\tswap(i, j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// set pivot to jth element & move pivot to proper position\n\t\t\tswap(j, pivot);\n\n\t\t\t// Repeat for sub arrays\n\t\t\tquickSort(start, j - 1);\n\t\t\tquickSort(j + 1, end);\n\t\t}\n\t}", "public void quickSort() {\n if (actualArray == null || actualArray.length == 0) {\n return;\n }\n quickSort(0, actualArray.length - 1);\n }", "public void shellSort(){\n int increment = list.size() / 2;\n while (increment > 0) {\n for (int i = increment; i < list.size(); i++) {\n int j = i;\n int temp = list.get(i);\n while (j >= increment && list.get(j - increment) > temp) {\n list.set(j, list.get(j - increment));\n j = j - increment;\n }\n list.set(j, temp);\n }\n if (increment == 2) {\n increment = 1;\n } else {\n increment *= (5.0 / 11);\n }\n }\n }", "static void quickSort (double a[], int lo, int hi){\n int i=lo, j=hi;\r\n\t\tdouble h;\r\n double pivot=a[lo];\r\n\r\n // pembagian\r\n do{\r\n while (a[i]<pivot) i++;\r\n while (a[j]>pivot) j--;\r\n if (i<=j)\r\n {\r\n h=a[i]; a[i]=a[j]; a[j]=h;//tukar\r\n i++; j--;\r\n }\r\n } while (i<=j);\r\n\r\n // pengurutan\r\n if (lo<j) quickSort(a, lo, j);\r\n if (i<hi) quickSort(a, i, hi);\r\n }", "public static void main(final String... args) {\n System.out.println(\"---- QuickSort ----\");\n System.out.println(\"Before: \" + Arrays.toString(ArrayGenerator()));\n QuickSort.sort(TEST_ARRAY);\n System.out.println(\"After: \" + Arrays.toString(TEST_ARRAY));\n System.out.println(\"Is Sorted: \" + sortingCheck(TEST_ARRAY));\n // END- QuickSort\n\n }", "public static void getBubbleSort(int range) {\n\n Integer[] number = GetRandomArray.getIntegerArray(range);\n\n //main cursor to run across array\n int pivot_main = 0;\n\n //secondary cursor to run of each index of array\n int pivot_check = 0;\n\n //variable to hold current check number\n int check_num = 0;\n\n //run loop for array length time\n for (int i = number.length; i > 0; i--) {\n\n //set cursor to first number\n pivot_main = number[0];\n\n //loop size decreases with main loop (i - 1234 | j - 4321)\n for (int j = 0; j < i - 1; j++) {\n\n //set cursor to next number in loop\n pivot_check = j + 1;\n\n //get number at above cursor\n check_num = number[j + 1];\n\n //check if number at current cursor is less than number at main cursor\n if (check_num < pivot_main) {\n //swap there position\n number[pivot_check] = pivot_main;\n number[j] = check_num;\n }\n\n //check if number at current cursor is greater than number at main cursor\n if (check_num > pivot_main) {\n //transfer current number to main cursor\n pivot_main = check_num;\n }\n }\n System.out.println(Arrays.toString(number));\n }\n }", "public static void main(String[] args) {\n\t\t\t\r\n\t\tQuickSort q = new QuickSort(); \r\n\t\tif(q.input == null || q.length==0){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tq.quickSort(0, q.length-1);\r\n\t\tfor(int i=0; i<q.length;i++)\r\n\t\t\tSystem.out.println(q.input[i]);\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tint[] a;\r\n\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.bubble(a);\r\n\r\n\t\tSystem.out.println(\"BubbleSort: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.selection(a);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nSelection: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.insertion(a);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nInsertion: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.mergeSort(a, 0, a.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nMerge: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.quickSort(a, 0, a.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nQuick: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.qs(a, 0, a.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nQuick1: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n \n ArvBinPesq arv2 = new ArvBinPesq();\n \n arv2.insert(10);\n arv2.insert(5);\n arv2.insert(2);\n arv2.insert(8);\n arv2.insert(15);\n arv2.insert(22);\n\n \n arv2.insert(25);\n arv2.remover(5);\n\n \n arv2.mostrar(arv2);\n arv2.size();\n System.out.println(arv2.search(25));\n arv2.height();\n arv2.root();\n arv2.depth(5);\n\n\n\n \n// System.out.println(\"RESULTADO = > \"+arv.comparaArvBinPesq(arv, arv2));\n }", "static void bucket_partition2(int b_size, LikenessBuckets bk){\n\t\tint parts = b_size/partition_size; //#partitions per bucket\n\t\tfloat ratio; int offsetB; int offsetB2; int offsetP;\n\t\tint chunk_size; int partSA; int partSA2;\n\t\tshort[][] tmpBucket;\n\n\t\tif(parts == 0){\n\t\t\tparts = 1;\n\t\t\tchunk_sizes.add(b_size);\n\t\t}else{\n\t\t\tfor(int i=0; i<parts-1; i++){\n\t\t\t\tchunk_sizes.add(partition_size);\n\t\t\t}\n\t\t\tif ((b_size % partition_size) <= (partition_size/2)){\n\t\t\t\tchunk_sizes.addFirst(partition_size + (b_size % partition_size));\n\t\t\t}else{\n\t\t\t\tparts++;\n\t\t\t\tchunk_sizes.add(partition_size);\n\t\t\t\tchunk_sizes.addLast(b_size % partition_size);\n\t\t\t}\n\t\t}\n\n\t\tfor(int b=0; b<buckNum; b++){//for every bucket\n\t\t\ttmpBucket = new short[bucket_size][dims];\n\t\t\t//tuples of most freq SA:\n\t\t\tArrayList<Integer> chg = bk.changeSA.get(b);\n\t\t\tint first = 0; int last = chg.get(0);\n\t\t\tif((last-first) > 0){ // (last-first+1) > 1.\n\t\t\t\t//System.out.println(\"sorting bucket[\"+b+\"][\"\n\t\t\t\t//\t\t\t\t +first+\"--\"+last+\"]\");\n\t\t\t\tquickSortBucket(first, last, b);\n\t\t\t}\n\t\t\t//remaining tuples:\n\t\t\tif((bucket_size - last) > 3){ // (bucket_size-1 -last-1) > 1.\n\t\t\t\t//System.out.println(\"sorting bucket[\"+b+\"][\"\n\t\t\t\t//\t\t\t\t +(last+1)+\"--\"+(bucket_size-1)+\"]\");\n\t\t\t\tquickSortBucket(last+1, bucket_size-1, b);\n\t\t\t}\n\t\t\toffsetB = 0;\n\t\t\toffsetP = 0;\n\t\t\toffsetB2 = last+1;\n\t\t\tfor(int jj=0; jj<parts; jj++){//for every partition\n\t\t\t\tchunk_size = chunk_sizes.get(jj);\n\t\t\t\t//ratio = ((float)chunk_size) / ((float)bucket_size);\n\t\t\t\t//partSA = Math.round(ratio * ((float)(last-first+1))); //freq SA\n\t\t\t\tpartSA = (int)Math.ceil(((double)(last-offsetB+1)) / ((double)(parts-jj)));\n\t\t\t\tpartSA2 = chunk_size - partSA; //remaining SAs\n\t\t\t\tfor(int j=0; j<partSA; j++){\n\t\t\t\t\ttmpBucket[offsetP + j] = buckets[b][offsetB + j];\n\t\t\t\t}\n\t\t\t\toffsetB += partSA;\n\t\t\t\tfor(int j=0; j<partSA2; j++){\n\t\t\t\t\ttmpBucket[offsetP + partSA + j] = buckets[b][offsetB2 + j];\n\t\t\t\t}\n\t\t\t\toffsetB2 += partSA2;\n\t\t\t\toffsetP += chunk_size;\n\t\t\t}\n\t\t\tbuckets[b] = tmpBucket;\n\t\t}\n\t}", "private static void quicksort( Comparable [ ] a, int low, int high ) {\n if( low + CUTOFF > high )\n insertionSort( a, low, high );\n else {\n// Sort low, middle, high\n int middle = ( low + high ) / 2;\n if( a[ middle ].lessThan( a[ low ] ) )\n swapReferences( a, low, middle );\n if( a[ high ].lessThan( a[ low ] ) )\n swapReferences( a, low, high );\n if( a[ high ].lessThan( a[ middle ] ) )\n swapReferences( a, middle, high );\n// Place pivot at position high - 1\n swapReferences( a, middle, high - 1 );\n Comparable pivot = a[ high - 1 ];\n// Begin partitioning\n int i, j;\n for( i = low, j = high - 1; ; ) {\n while( a[ ++i ].lessThan( pivot ) );\n while( pivot.lessThan( a[ --j ] ) );\n if( i < j )\n swapReferences( a, i, j );\n else\n break;\n }\n// Restore pivot\n swapReferences( a, i, high - 1 );\n quicksort( a, low, i - 1 ); // Sort small elements\n quicksort( a, i + 1, high ); // Sort large elements\n }\n }", "public void sort()throws InterruptedException{\n\t\tfor (int i = 0; i < a.length - 1; i++) {\n\t\t\tint minPos = minPosition(i);\n\t\t\tsortStateLock.lock();\n\t\t\ttry{\n\t\t\t\tswap(minPos, i);\n\t\t\t\t// For animation\n\t\t\t\talreadySorted = i;\n\t\t\t}\n\t\t\tfinally{\n\t\t\t\tsortStateLock.unlock();\n\t\t \t\t}\n\t\t\tpause(2);\n\t }\n }", "@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }", "public static void main(String[] args) {\n QuickSort quickSort=new QuickSort();\n int[] unsortedArray=new int[] {0,100,3,24,45,54};\n int[] sortrdArray= quickSort.quickSort(unsortedArray,0,unsortedArray.length-1);\n for (int i: sortrdArray){\n System.out.println(\"Sorted values =\"+i);\n }\n }", "public static void main(String[] args) {\n\r\n\t\tint [] array1 = {3,2,5,0,1};\r\n\t\tint [] array2 = {8,10,7,6,4};\r\n\t\tint [] array3= new int[array1.length+array2.length];\r\n\t\t\r\n\t\tint i=0,j=0;\r\n\t\t\r\n\t\twhile(i<array1.length){\r\n\t\t\tarray3[i]=array1[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\t\r\n\t\twhile(j<array2.length){\r\n\t\t\tarray3[i]=array2[j];\r\n\t\t\ti++;\r\n\t\t\tj++;\r\n\t\t}\r\n\t\tQuickSort(array3,0,array3.length-1,false,false);\r\n\t\t\r\n\t}", "private void bInsertionSort(int lowerIndex, int higherIndex) {\n \t\tArrayList tmpsorted = new ArrayList();\n \t\tint tmp, lowerbound, upperbound;\n \t\t\n \t\tfor(int i = lowerIndex; i <= higherIndex; i++) {\n \t\t\ttmp = (int) unsorted.get(i);\n \t\t\tif(tmpsorted.isEmpty()) {\n \t\t\t\ttmpsorted.add(tmp);\n \t\t\t} else {\n \t\t\t\t\n \t\t\t\t//Every new number we want to insert needs\n \t\t\t\t//to reset the bounds according to the sorted list.\n \t\t\t\tupperbound = tmpsorted.size() - 1;\n \t\t\t\tlowerbound = 0;\n \t\t\t\t\n \t\t\t\twhile (unsorted.size() != 0){\n \t\t\t\t//Note that each \"break;\" throws us out of the while loop.\n \t\t\t\t//Causing our boundaries to be reset for the new number\n \t\t\t\t\t\n \t\t\t\t\tint j = (upperbound + lowerbound) / 2;\t//j points to the middle of the boundaries\n \t\t\t\t\tif (tmp <= (int)tmpsorted.get(j)){\t//is tmp less or equal to the number in j?\n \t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\tif (j == 0){\t\t\t\t\t\t//Are we at the bottom of the list?\n \t\t\t\t\t\t\ttmpsorted.add(0, tmp);\t\t//Add it to the bottom of the list.\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse if ((int)tmpsorted.get(j-1) > tmp){ \n \t\t\t\t\t\t//Else if the number behind j is bigger than tmp...\n \t\t\t\t\t\t//...we can move the upper bound behind j and repeat the split.\n \t\t\t\t\t\t//NOTE: We do NOT \"break;\" to get thrown out of the while loop.\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tupperbound = j - 1;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse{ //Else we just add the number to j\n \t\t\t\t\t\t\ttmpsorted.add(j, tmp);\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\t\n \t\t\t\t\telse{ //If tmp is HIGHER than j\n \t\t\t\t\t\tif (j == tmpsorted.size() - 1){\n \t\t\t\t\t\t//Are we at the end of the list?\n \t\t\t\t\t\t//Just add tmp at the end of the list.\t\n \t\t\t\t\t\t\ttmpsorted.add(j+1, tmp);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse if((int)tmpsorted.get(j+1) < tmp){\n \t\t\t\t\t\t//if the next number to j is still less than tmp...\n \t\t\t\t\t\t//we raise the lowerbound past j and repeat the split\n \t\t\t\t\t\t//NOTE: We do NOT \"break;\" to get thrown out of the while loop.\n \t\t\t\t\t\t\tlowerbound = j + 1;\n \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//Else we can just add tmp after j since it's higher than j\n \t\t\t\t\t\t\ttmpsorted.add(j+1, tmp);\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\t\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n \t\t}\n \t\t// Replace the unsorted values with tmpsorted.\n \t\tint j = 0;\n \t\tfor(int i = lowerIndex; i <= higherIndex; i++) {\n \t\t\tunsorted.set(i, tmpsorted.get(j));\n \t\t\tj++;\n \t\t}\n\n \t}", "public static void main(String args[]) throws IOException {\n Scanner s = new Scanner (System.in);\n int t = s.nextInt();\n while(t-- > 0)\n {\n int k = s.nextInt();\n int bucket_width [] = new int[k];\n for(int i = 0; i < k; i++)\n bucket_width[i] = s.nextInt();\n \n int n = s.nextInt();\n int balls_width[] = new int[n];\n for(int i = 0; i < n; i++)\n balls_width[i] = s.nextInt();\n \n int ball_bucket[] = new int[k];\n \n \n for(int i = 0; i < k; i++)\n ball_bucket[i] = 0;\n \n \n int j = 0;\n for(int i = 0; i < n; i++)\n {\n \n for( j = k - 1; j >= 0; j--)\n {\n if(bucket_width[j] >= balls_width[i] && ball_bucket[j] <= j )\n {\n ball_bucket[j] += 1;\n System.out.print(j + 1 + \" \");\n break;\n }\n }\n if(j < 0)\n System.out.print(\"0\" + \" \");\n }\n System.out.println();\n }\n }", "public static void main(String[] args) {\r\n\t\tint[] array = {9,4,8,2,1,5,7,6,3};\r\n\t\t\r\n\t\tSystem.out.println(\"Before sort: \" + Arrays.toString(array));\r\n\t\tSystem.out.println(\"Sorting...\"); System.out.println(\"After sort: \" +\r\n\t\tArrays.toString(quicksort(array, 0, array.length - 1)));\r\n\t}", "public void quicksort() {\r\n quicksort(mArray, 0, mArray.length -1);\r\n }", "@Test\n public void testQuickSort() {\n System.out.println(\"QuickSort listo\");\n Comparable[] list = {3,2,5,4,1};\n QuickSort instance = new QuickSort();\n Comparable[] expResult = {1,2,3,4,5};\n Comparable[] result = instance.QuickSort(list, 0, list.length-1);\n assertArrayEquals(expResult, result);\n }", "public static void main(String[] args) {\n\r\n\t\t int[] arr = generateRandomArrayWithRandomNum();\r\n\t int checksSelectionSort = 0;\r\n\t int checksBubbleSort = 0;\r\n\t int checksMergeSort = 0;\r\n\t int checksQuickSort = 0;\r\n\t int[] copyArr = new int[1000];\r\n\t for (int x = 0; x < 20; x++) {\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksSelectionSort += doSelectionSort(arr);\r\n\r\n\t \r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksBubbleSort += bubbleSort(copyArr);\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksMergeSort += new mergeSort().sort(arr);\r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksQuickSort += new quickSort().sort(copyArr);\r\n\t }\r\n\t System.out.println(\"Analysis Of Sorting algorithms \");\r\n\t System.out.println(\"Selection Sort : \"+checksSelectionSort/20);\r\n\t System.out.println(\"Bubble Sort : \"+checksBubbleSort/20);\r\n\t System.out.println(\"Merge Sort : \"+checksMergeSort/20);\r\n\t System.out.println(\"Quick Sort : \"+checksQuickSort/20);\r\n\r\n\t \r\n\t }", "public BubSortList() {\n\t\tray = new int[MAXSIZE];\n\t\tnowLength = 0;\n\t}", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "public static void main(String[] args) {\n //Q1\n String[] a = {\"S\", \"O\", \"R\", \"T\", \"E\", \"X\", \"A\", \"M\", \"P\", \"L\", \"E\"};\n //Integer[] a = {1, 3, 6, 7, 8, 9, 5, 4, 2};\n quicksortmid(a);\n //assert isSorted(a); //requires assertions enabled.\n show(a);\n \n //Q2\n String[] b = {\"S\", \"O\", \"R\", \"T\", \"E\", \"X\", \"A\", \"M\", \"P\", \"L\", \"E\"};\n //Integer[] b = {1, 2, 6, 7, 9, 5, 4, 8, 3, 0, 10};\n mergesort(b);\n //assert isSorted(b);\n show(b);\n }", "private static <AnyType extends Comparable<? super AnyType>> void quicksort(AnyType[] a, int left, int right)\n {\n if(left + CUTOFF <= right)\n {\n AnyType pivot = median3(a, left, right);\n\n // Begin partitioning\n int i = left, j = right - 1;\n for( ; ; )\n {\n while(a[++i].compareTo(pivot) < 0);\n while(a[--j].compareTo(pivot) > 0);\n if(i < j)\n CommonFunc.swapReference(a, i, j);\n else\n break;\n }\n\n CommonFunc.swapReference(a, i, right - 1);\n\n quicksort(a, left, i - 1);\n quicksort(a, i + 1, right);\n }\n else // Do an insertion sort on the subarray\n Insertionsort.insertionsort(a, left, right);\n }", "int partition(int arr[], int low, int high, SequentialTransition sq,ArrayList<StackPane> list,double speed) \n\t {\n\t\t\tint step;\n//\t\t\tint n = arr.length;\n\t int pivot = arr[high]; \n\t int i = (low-1);\n\t for (int j=low; j<high; j++) \n\t { \n\t if (arr[j] <= pivot) \n\t { \n\t i++; \n\t int temp = arr[i]; \n\t arr[i] = arr[j]; \n\t arr[j] = temp; \n\t step = j - i;\n\t sq.getChildren().add(FillBeforeSwap(list.get(i), list.get(j),speed));\n\t sq.getChildren().add(swapMe(list.get(i), list.get(j), step, list, speed));\n\t sq.getChildren().add(FillAfterSwap(list.get(j), list.get(i), speed));\n\t } \n\t } \n\t int temp = arr[i+1]; \n\t arr[i+1] = arr[high]; \n\t arr[high] = temp; \n\t step = (high) - (i+1);\n\t sq.getChildren().add(FillBeforeSwap(list.get(i+1), list.get(high), speed));\n\t sq.getChildren().add(swapMe(list.get(i+1), list.get(high), step, list, speed));\n\t sq.getChildren().add(FillAfterSwap(list.get(i+1), list.get(high), speed));\n\t \n\t return i+1; \n\t }", "public static void shellSort(Comparable[] a) {\n int n = a.length;\n int h = 1;\n // Iteratively increase the stride h until the stride will at most sort 2 elements.\n while (h < n/3) h = 3*h + 1;\n while (h >= 1) {\n for (int i = 1; i < n; i += h) {\n for (int j = i; j > 0; j--) {\n if (less(a[j], a[j-1])) exch(a, j, j-1);\n else break;\n }\n }\n h /= 3;\n }\n\n }", "private static int partition(int[] input, int start, int end) {\n int pivot = input[start];\n int i = start;\n int j = end;\n\n while (i < j) {\n while (i < j && input[--j] >= pivot) ; // empty loop body\n if (i < j) input[i] = input[j];\n\n while (i < j && input[++i] <= pivot) ; // empty loop body\n if (i < j) input[j] = input[i];\n }\n\n input[j] = pivot;\n return j;\n }", "public ListUtilities quicksort(){\n\t\t\n\t\tListUtilities lo = this.returnToStart();\n\t\tListUtilities hi = this.goToEnd();\n\t\tListUtilities sorted = this.partition(lo, hi);\n\t\t\n\t\treturn sorted.returnToStart();\t\t\n\t}", "private void sort(int[] array, int start, int end){\n //base condition\n if(start >= end)\n return;\n int boundary = partition(array, start, end);\n sort(array, start, boundary - 1);\n sort(array, boundary + 1, end);\n }", "public static void sort(int[] array, int from, int to) {\n int size = to - from + 1;\n int mid = from + (to - from)/2;\n if (size < cutoff|| counThread>20) \n \t{\n \t\tSystem.out.println(\"cut-off: \"+ (to-from+1));\n \t\tArrays.sort(array, from, to+1);\n \t}\n else {\n \n \tCompletableFuture<int[]> parsort1 = parsort(array, from, mid);\n \t\n \t\n CompletableFuture<int[]> parsort2 = parsort(array, mid+1, to);\n\n\n CompletableFuture<int[]> parsort = \n \t\tparsort1.thenCombine(parsort2, (xs1, xs2) -> {\n \tint[] result = new int[xs1.length + xs2.length];\n \tmerge(array, result, from);\n return result;\n });\n\n parsort.whenComplete((result, throwable) -> { \t\n// \tSystem.arraycopy(result, 0, array, from, to-from+1);\n// \tSystem.out.println(\"Thread count: \"+ counThread);\n \t\n \t\n }); \n parsort.join();\n }\n }", "private void trIntroSort(int r34, int r35, int r36, int r37, int r38, io.netty.handler.codec.compression.Bzip2DivSufSort.TRBudget r39, int r40) {\n /*\n r33 = this;\n r0 = r33;\n r0 = r0.SA;\n r16 = r0;\n r4 = 64;\n r0 = new io.netty.handler.codec.compression.Bzip2DivSufSort.StackEntry[r4];\n r29 = r0;\n r32 = 0;\n r27 = 0;\n r4 = r38 - r37;\n r22 = trLog(r4);\n r28 = r27;\n r23 = r22;\n L_0x001a:\n if (r23 >= 0) goto L_0x02b6;\n L_0x001c:\n r4 = -1;\n r0 = r23;\n if (r0 != r4) goto L_0x01a4;\n L_0x0021:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x0050;\n L_0x002d:\n r22 = r23;\n L_0x002f:\n r26 = 0;\n L_0x0031:\n r0 = r26;\n r1 = r28;\n if (r0 >= r1) goto L_0x072a;\n L_0x0037:\n r4 = r29[r26];\n r4 = r4.d;\n r5 = -3;\n if (r4 != r5) goto L_0x004d;\n L_0x003e:\n r4 = r29[r26];\n r4 = r4.b;\n r5 = r29[r26];\n r5 = r5.c;\n r0 = r33;\n r1 = r34;\n r0.lsUpdateGroup(r1, r4, r5);\n L_0x004d:\n r26 = r26 + 1;\n goto L_0x0031;\n L_0x0050:\n r6 = r35 + -1;\n r10 = r38 + -1;\n r4 = r33;\n r5 = r34;\n r7 = r36;\n r8 = r37;\n r9 = r38;\n r25 = r4.trPartition(r5, r6, r7, r8, r9, r10);\n r0 = r25;\n r8 = r0.first;\n r0 = r25;\n r9 = r0.last;\n r0 = r37;\n if (r0 < r8) goto L_0x0072;\n L_0x006e:\n r0 = r38;\n if (r9 >= r0) goto L_0x016d;\n L_0x0072:\n r0 = r38;\n if (r8 >= r0) goto L_0x0087;\n L_0x0076:\n r17 = r37;\n r31 = r8 + -1;\n L_0x007a:\n r0 = r17;\n if (r0 >= r8) goto L_0x0087;\n L_0x007e:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x007a;\n L_0x0087:\n r0 = r38;\n if (r9 >= r0) goto L_0x009c;\n L_0x008b:\n r17 = r8;\n r31 = r9 + -1;\n L_0x008f:\n r0 = r17;\n if (r0 >= r9) goto L_0x009c;\n L_0x0093:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x008f;\n L_0x009c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = 0;\n r6 = 0;\n r4.<init>(r5, r8, r9, r6);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + -1;\n r6 = -2;\n r0 = r37;\n r1 = r38;\n r4.<init>(r5, r0, r1, r6);\n r29[r27] = r4;\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x0117;\n L_0x00bd:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x00e3;\n L_0x00c2:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r38 - r9;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r9, r1, r5);\n r29[r28] = r4;\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n L_0x00dd:\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x00e3:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x00f3;\n L_0x00e8:\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x00f3:\n if (r28 != 0) goto L_0x00fa;\n L_0x00f5:\n r27 = r28;\n r22 = r23;\n L_0x00f9:\n return;\n L_0x00fa:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x0117:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0138;\n L_0x011c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r8 - r37;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r37;\n r4.<init>(r0, r1, r8, r5);\n r29[r28] = r4;\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n goto L_0x00dd;\n L_0x0138:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0148;\n L_0x013d:\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x0148:\n if (r28 != 0) goto L_0x014f;\n L_0x014a:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x014f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x016d:\n r17 = r37;\n L_0x016f:\n r0 = r17;\n r1 = r38;\n if (r0 >= r1) goto L_0x017e;\n L_0x0175:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r17;\n r17 = r17 + 1;\n goto L_0x016f;\n L_0x017e:\n if (r28 != 0) goto L_0x0186;\n L_0x0180:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0186:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x01a4:\n r4 = -2;\n r0 = r23;\n if (r0 != r4) goto L_0x01ea;\n L_0x01a9:\n r27 = r28 + -1;\n r4 = r29[r27];\n r8 = r4.b;\n r4 = r29[r27];\n r9 = r4.c;\n r11 = r35 - r34;\n r4 = r33;\n r5 = r34;\n r6 = r36;\n r7 = r37;\n r10 = r38;\n r4.trCopy(r5, r6, r7, r8, r9, r10, r11);\n if (r27 != 0) goto L_0x01c8;\n L_0x01c4:\n r22 = r23;\n goto L_0x00f9;\n L_0x01c8:\n r27 = r27 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x01ea:\n r4 = r16[r37];\n if (r4 < 0) goto L_0x0202;\n L_0x01ee:\n r8 = r37;\n L_0x01f0:\n r4 = r16[r8];\n r4 = r4 + r34;\n r16[r4] = r8;\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0200;\n L_0x01fc:\n r4 = r16[r8];\n if (r4 >= 0) goto L_0x01f0;\n L_0x0200:\n r37 = r8;\n L_0x0202:\n r0 = r37;\n r1 = r38;\n if (r0 >= r1) goto L_0x028c;\n L_0x0208:\n r8 = r37;\n L_0x020a:\n r4 = r16[r8];\n r4 = r4 ^ -1;\n r16[r8] = r4;\n r8 = r8 + 1;\n r4 = r16[r8];\n if (r4 < 0) goto L_0x020a;\n L_0x0216:\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r5 = r16[r8];\n r5 = r5 + r35;\n r5 = r16[r5];\n if (r4 == r5) goto L_0x0241;\n L_0x0224:\n r4 = r8 - r37;\n r4 = r4 + 1;\n r24 = trLog(r4);\n L_0x022c:\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0244;\n L_0x0232:\n r9 = r37;\n r31 = r8 + -1;\n L_0x0236:\n if (r9 >= r8) goto L_0x0244;\n L_0x0238:\n r4 = r16[r9];\n r4 = r4 + r34;\n r16[r4] = r31;\n r9 = r9 + 1;\n goto L_0x0236;\n L_0x0241:\n r24 = -1;\n goto L_0x022c;\n L_0x0244:\n r4 = r8 - r37;\n r5 = r38 - r8;\n if (r4 > r5) goto L_0x0264;\n L_0x024a:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = -3;\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r8, r1, r5);\n r29[r28] = r4;\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0264:\n r4 = 1;\n r5 = r38 - r8;\n if (r4 >= r5) goto L_0x0282;\n L_0x0269:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r37;\n r1 = r24;\n r4.<init>(r5, r0, r8, r1);\n r29[r28] = r4;\n r37 = r8;\n r22 = -3;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0282:\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x028c:\n if (r28 != 0) goto L_0x0294;\n L_0x028e:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0294:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x02b6:\n r4 = r38 - r37;\n r5 = 8;\n if (r4 > r5) goto L_0x02d5;\n L_0x02bc:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x02cc;\n L_0x02c8:\n r22 = r23;\n goto L_0x002f;\n L_0x02cc:\n r33.trInsertionSort(r34, r35, r36, r37, r38);\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x02d5:\n r22 = r23 + -1;\n if (r23 != 0) goto L_0x0331;\n L_0x02d9:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x02e5:\n r15 = r38 - r37;\n r10 = r33;\n r11 = r34;\n r12 = r35;\n r13 = r36;\n r14 = r37;\n r10.trHeapSort(r11, r12, r13, r14, r15);\n r8 = r38 + -1;\n L_0x02f6:\n r0 = r37;\n if (r0 >= r8) goto L_0x032b;\n L_0x02fa:\n r4 = r16[r8];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r9 = r8 + -1;\n L_0x030a:\n r0 = r37;\n if (r0 > r9) goto L_0x0329;\n L_0x030e:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r4 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n if (r4 != r0) goto L_0x0329;\n L_0x0320:\n r4 = r16[r9];\n r4 = r4 ^ -1;\n r16[r9] = r4;\n r9 = r9 + -1;\n goto L_0x030a;\n L_0x0329:\n r8 = r9;\n goto L_0x02f6;\n L_0x032b:\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x0331:\n r8 = r33.trPivot(r34, r35, r36, r37, r38);\n r0 = r16;\n r1 = r37;\n r2 = r16;\n swapElements(r0, r1, r2, r8);\n r4 = r16[r37];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r31 = r0.trGetC(r1, r2, r3, r4);\n r9 = r37 + 1;\n L_0x034e:\n r0 = r38;\n if (r9 >= r0) goto L_0x0369;\n L_0x0352:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0369;\n L_0x0366:\n r9 = r9 + 1;\n goto L_0x034e;\n L_0x0369:\n r8 = r9;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x036e:\n r0 = r32;\n r1 = r31;\n if (r0 >= r1) goto L_0x039e;\n L_0x0374:\n r9 = r9 + 1;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x037a:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x039e;\n L_0x038e:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0374;\n L_0x0394:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0374;\n L_0x039e:\n r17 = r38 + -1;\n L_0x03a0:\n r0 = r17;\n if (r9 >= r0) goto L_0x03bb;\n L_0x03a4:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03bb;\n L_0x03b8:\n r17 = r17 + -1;\n goto L_0x03a0;\n L_0x03bb:\n r18 = r17;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03c1:\n r0 = r32;\n r1 = r31;\n if (r0 <= r1) goto L_0x03f5;\n L_0x03c7:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03cd:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x03e1:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03c7;\n L_0x03e7:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x03c7;\n L_0x03f5:\n r0 = r17;\n if (r9 >= r0) goto L_0x045a;\n L_0x03f9:\n r0 = r16;\n r1 = r16;\n r2 = r17;\n swapElements(r0, r9, r1, r2);\n L_0x0402:\n r9 = r9 + 1;\n r0 = r17;\n if (r9 >= r0) goto L_0x042c;\n L_0x0408:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x042c;\n L_0x041c:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0402;\n L_0x0422:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0402;\n L_0x042c:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x0432:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x0446:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x042c;\n L_0x044c:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x042c;\n L_0x045a:\n r0 = r18;\n if (r8 > r0) goto L_0x0716;\n L_0x045e:\n r17 = r9 + -1;\n r26 = r8 - r37;\n r30 = r9 - r8;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x046c;\n L_0x046a:\n r26 = r30;\n L_0x046c:\n r19 = r37;\n r21 = r9 - r26;\n L_0x0470:\n if (r26 <= 0) goto L_0x0484;\n L_0x0472:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0470;\n L_0x0484:\n r26 = r18 - r17;\n r4 = r38 - r18;\n r30 = r4 + -1;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x0492;\n L_0x0490:\n r26 = r30;\n L_0x0492:\n r19 = r9;\n r21 = r38 - r26;\n L_0x0496:\n if (r26 <= 0) goto L_0x04aa;\n L_0x0498:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0496;\n L_0x04aa:\n r4 = r9 - r8;\n r8 = r37 + r4;\n r4 = r18 - r17;\n r9 = r38 - r4;\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r0 = r31;\n if (r4 == r0) goto L_0x04d3;\n L_0x04bc:\n r4 = r9 - r8;\n r24 = trLog(r4);\n L_0x04c2:\n r17 = r37;\n r31 = r8 + -1;\n L_0x04c6:\n r0 = r17;\n if (r0 >= r8) goto L_0x04d6;\n L_0x04ca:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04c6;\n L_0x04d3:\n r24 = -1;\n goto L_0x04c2;\n L_0x04d6:\n r0 = r38;\n if (r9 >= r0) goto L_0x04eb;\n L_0x04da:\n r17 = r8;\n r31 = r9 + -1;\n L_0x04de:\n r0 = r17;\n if (r0 >= r9) goto L_0x04eb;\n L_0x04e2:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04de;\n L_0x04eb:\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x060c;\n L_0x04f1:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x0571;\n L_0x04f7:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x051e;\n L_0x04fc:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x051e:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0538;\n L_0x0523:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0538:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0549;\n L_0x053d:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0549:\n if (r28 != 0) goto L_0x054f;\n L_0x054b:\n r27 = r28;\n goto L_0x00f9;\n L_0x054f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0571:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x05c6;\n L_0x0577:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x059e;\n L_0x057c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x059e:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05c0;\n L_0x05a3:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x05c0:\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x05c6:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05f5;\n L_0x05cb:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x05f5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x060c:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x067b;\n L_0x0612:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0639;\n L_0x0617:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x0639:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0653;\n L_0x063e:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0653:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0664;\n L_0x0658:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0664:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r38;\n r3 = r22;\n r4.<init>(r0, r1, r2, r3);\n r29[r28] = r4;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x067b:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x06d0;\n L_0x0681:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x06a8;\n L_0x0686:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x06a8:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ca;\n L_0x06ad:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x06ca:\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x06d0:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ff;\n L_0x06d5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x06ff:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0716:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x0722:\n r22 = r22 + 1;\n r35 = r35 + 1;\n r23 = r22;\n goto L_0x001a;\n L_0x072a:\n r27 = r28;\n goto L_0x00f9;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.netty.handler.codec.compression.Bzip2DivSufSort.trIntroSort(int, int, int, int, int, io.netty.handler.codec.compression.Bzip2DivSufSort$TRBudget, int):void\");\n }", "private static void performSort(TestApp testApp) {\n testApp.testPartition();\n\n /*\n Date end = new Date();\n System.out.println(\"Sort ended @ \" + end.getTime());\n System.out.println(\"Total time = \" + (end.getTime() - start.getTime())/1000.0 + \" seconds...\");\n */\n }", "public static void main(String[] args) {\n int[] arr = {10, 7, 8, 9, 1, 5};\n QuickSort quickSort = new QuickSort();\n quickSort.sort(arr, 0, arr.length - 1);\n System.out.println(\"Sorted array:\");\n quickSort.printArray(arr);\n }", "public static void main(String[] args) {\n QuickSort obj = new QuickSort();\n int numbers[] = new int[]{};\n try {\n numbers = obj.driverFunction(numbers);\n System.out.println(Arrays.toString(numbers));\n }catch(Exception e) {\n \t System.out.println(\"Invalid Argument\");\n }\n }", "private static void quickSort(double arr[],Integer[] pageIDS, int low, int high)\n {\n if (low < high)\n {\n /* pi is partitioning index, arr[pi] is\n now at right place */\n int pi = partition(arr,pageIDS, low, high);\n\n // Recursively sort elements before\n // partition and after partition\n quickSort(arr, pageIDS, low, pi-1);\n quickSort(arr, pageIDS,pi+1, high);\n }\n }", "public void radixSorting() {\n\t\t\n\t}", "public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(br.readLine());\n n = Integer.parseInt(st.nextToken());\n k = Integer.parseInt(st.nextToken());\n belt = new int[2 * n + 1];\n visit = new boolean[2 * n + 1];\n st = new StringTokenizer(br.readLine());\n for (int i = 1; i <= 2 * n; i++)\n belt[i] = Integer.parseInt(st.nextToken());\n\n int answer = 0;\n start = 1;\n end = n;\n while (cnt < k) {\n answer++;\n move_belt();\n move_robot();\n make_robot();\n }\n System.out.println(answer);\n }", "private static int partition(int a[], int left, int right) {\r\n\t\t int i = left, j = right;\r\n\t\t int tmp;\r\n\t\t int pivot = a[(left + right) / 2];\r\n\r\n\t\t while (i <= j) {\r\n\t\t while (a[i] < pivot) // scan from left\r\n\t\t i++;\r\n\t\t count = count + 1;\r\n\t\t while (a[j] > pivot) // scan from right\r\n\t\t j--;\r\n\t\t count = count + 1;\r\n\t\t if (i <= j) { // swap\r\n\t\t tmp = a[i];\r\n\t\t a[i] = a[j];\r\n\t\t a[j] = tmp;\r\n\t\t i++;\r\n\t\t j--;\r\n\t\t }\r\n\t\t };\r\n\t\t return i; // this will be the dividing point between the two halves\r\n\t\t}", "public static void main(String[] args) {\n\t\tSelectionSort ob=new SelectionSort();\n\t\tint i=0;\n\t\tint min=0;\n\t\tfor(int j=i+1;j<a.length;j++){\n\t\t\tmin=ob.mini(a, j);\n\t\t\tif(a[i]>a[min]){\n\t\t\t\tob.exch(a, i, min);\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\tfor(int i1=0;i1<a.length;i1++){\n\t\t\tSystem.out.println(a[i1]);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\n\t}", "void quickSort(int arr[], int low, int high) \n { \n if (low < high) \n { \n /* pi is partitioning index, arr[pi] is \n now at right place */\n int pi = partition(arr, low, high); \n \n // Recursively sort elements before \n // partition and after partition \n quickSort(arr, low, pi-1); \n quickSort(arr, pi+1, high); \n } \n }", "private static void quickSort(Array A, int iStart, int iEnd)\n\t{\n\t\tif (iStart == iEnd)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tint pivot = Rand.randInt(iStart, iEnd);\n\t\tpivot = partition(A, iStart, iEnd, pivot);\n\t\tif (pivot > iStart)\n\t\t{\n\t\t\tquickSort(A, iStart, pivot - 1);\n\t\t}\n\t\tif (pivot < iEnd)\n\t\t{\n\t\t\tquickSort(A, pivot + 1, iEnd);\n\t\t}\n\t}", "static void minimumBribes(int[] q) {\r\n int bribes = 0;\r\n boolean valid = true;\r\n int index = 1;\r\n \r\n // We get the length of the input array\r\n int size = q.length; \r\n \r\n // We cycle through the input array\r\n for (int i = 0; i < size; i++) {\r\n int actual = q[i];\r\n \r\n // We check if the current person has surely swapped position more than two times since it appears before they are supposed to\r\n if (actual > index) {\r\n int difference = actual - index;\r\n if (difference > 2) {\r\n valid = false;\r\n break;\r\n }\r\n }\r\n \r\n // We check the number of bribes by counting how many persons with bigger IDs have already swapped place with the current one\r\n // NOTE: We can safely begin to check from position (actual-2) since higher numbers of swaps would have been caught by the previous if condition\r\n for (int j = actual-2; j < index; j++) {\r\n if (j < 0) {\r\n continue;\r\n }\r\n if (actual < q[j]) {\r\n bribes += 1;\r\n }\r\n }\r\n \r\n index += 1;\r\n }\r\n \r\n // Checks if the result is valid, and if so, it prints it\r\n if (valid == false) {\r\n System.out.println(\"Too chaotic\");\r\n }\r\n else {\r\n System.out.println(bribes);\r\n }\r\n}", "public void sort() {\r\n int k = start;\r\n for (int i = 0; i < size - 1; i++) {\r\n int p = (k + 1) % cir.length;\r\n for (int j = i + 1; j < size; j++) {\r\n if ((int) cir[p] < (int) cir[k % cir.length]) {\r\n Object temp = cir[k];\r\n cir[k] = cir[p];\r\n cir[p] = temp;\r\n }\r\n p = (p + 1) % cir.length;\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n }", "private int[] fader(int[] a, int[] b) {\n\t\tfor(int i = 0; i < 3; i++) {\n\t\t\tif(a[i] > b[i]) {\n\t\t\t\ta[i] = a[i]-1;\n\t\t\t} else if(a[i] < b[i]) {\n\t\t\t\ta[i] = a[i]+1;\n\t\t\t}\n\t\t}\n\n\t\treturn a;\n\t}", "public static void main(String[] args) {\n int size = 100;\n int mult = 100;\n\n ArrayList<Integer> numbers = new ArrayList<>();\n\n //generate random array to sort\n for (int i = 0; i < size; i++) {\n numbers.add((int) (Math.random() * mult));\n }\n\n System.out.println(numbers.toString());\n\n numbers = quickSortSubset(numbers,0);\n\n System.out.println(numbers.toString());\n\n }", "public void selectionSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2;\r\n\t\tfor (int i = list.size() - 1; i >= 0; i--){\r\n\t\t\tsteps ++;\r\n\t\t\tint biggest = 0; \r\n\t\t\tsteps += 2;\r\n\t\t\tfor (int j = 0; j < i; j++){\r\n\t\t\t\tsteps += 4;\r\n\t\t\t\tif (list.get(j).compareTo(list.get(biggest)) > 0){\r\n\t\t\t\t\tsteps ++;\r\n\t\t\t\t\tbiggest = j;\r\n\t\t\t\t}\r\n\t\t\t\tsteps += 2;\r\n\t\t\t}\r\n\t\t\tsteps += 5;\r\n\t\t\tswap(list, i, biggest);\r\n\t\t\tsteps += 2;\r\n\t\t}\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Selection Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "public static void quickSortTest(){\n\t\tTransformer soundwave = new Transformer(\"Soundwave\", 'D', new int[] {8,9,2,6,7,5,6,10});\n\t\tTransformer bluestreak = new Transformer(\"Bluestreak\", 'A', new int[] {6,6,7,9,5,2,9,7});\n\t\tTransformer hubcap = new Transformer(\"Hubcap\", 'A', new int[] {4,4,4,4,4,4,4,4});\n\t\tTransformer abominus = new Transformer(\"Abominus\", 'D', new int[] {10,1,3,10,5,10,8,4});\n\t\t\n\t\tgame.addTransformer(soundwave);\n\t\tgame.addTransformer(bluestreak);\n\t\tgame.addTransformer(hubcap);\n\t\tgame.addTransformer(abominus);\n\t\t\n\t\tgame.sortCompetitorsByRank();\n\t\tgame.printSortedRoster();\n\t}", "private void sort(int start, int end) {\n int firstHalf = start;\n int lastHalf = end;\n int pivotIndex = start + (int) (Math.random() * (end - start));\n T pivot = sortedArray[pivotIndex];\n while (firstHalf <= lastHalf) {\n while (sortedArray[firstHalf].compareTo(pivot) > 0) {\n firstHalf++;\n }\n while (sortedArray[lastHalf].compareTo(pivot) < 0) {\n lastHalf--;\n }\n if (firstHalf <= lastHalf) {\n T temp = sortedArray[firstHalf];\n sortedArray[firstHalf] = sortedArray[lastHalf];\n sortedArray[lastHalf] = temp;\n firstHalf++;\n lastHalf--;\n }\n }\n if (start < lastHalf) {\n sort(start, firstHalf);\n }\n if (firstHalf < end) {\n sort(firstHalf, end);\n }\n }", "public void bucketSort() {\n MyArray ten = new MyArray();\n MyArray hundred = new MyArray();\n MyArray thousand = new MyArray();\n MyArray tenThousand = new MyArray();\n MyArray hundredThousand = new MyArray();\n MyArray million = new MyArray();\n MyArray tenMillion = new MyArray();\n MyArray hundredMillion = new MyArray();\n MyArray billion = new MyArray();\n\n for (int i = 0; i < array.length; i++) {\n if ((int) array[i] / 10 < 0) {\n ten.add(array[i]);\n } else if ((int) array[i] / 100 < 0) {\n hundred.add(array[i]);\n } else if ((int) array[i] / 1000 < 0) {\n thousand.add(array[i]);\n } else if ((int) array[i] / 10000 < 0) {\n tenThousand.add(array[i]);\n } else if ((int) array[i] / 100000 < 0) {\n hundredThousand.add(array[i]);\n } else if ((int) array[i] / 1000000 < 0) {\n million.add(array[i]);\n } else if ((int) array[i] / 10000000 < 0) {\n tenMillion.add(array[i]);\n } else if ((int) array[i] / 100000000 < 0) {\n hundredMillion.add(array[i]);\n } else {\n billion.add(array[i]);\n }\n }\n\n ten = ten.radixSort(ten);\n hundred = hundred.radixSort(hundred);\n thousand = thousand.radixSort(thousand);\n tenThousand = tenThousand.radixSort(tenThousand);\n hundredThousand = hundredThousand.radixSort(hundredThousand);\n million = million.radixSort(million);\n tenMillion = tenMillion.radixSort(tenMillion);\n hundredMillion = hundredMillion.radixSort(hundredMillion);\n billion = billion.radixSort(billion);\n\n int j = 0;\n for (int i = 0; i < ten.getSize(); i++) {\n array[i] = (T) ten.get(i);\n j++;\n }\n for (int i = 0; i < hundred.getSize(); i++) {\n array[i] = (T) hundred.get(i);\n j++;\n }\n for (int i = 0; i < thousand.getSize(); i++) {\n array[i] = (T) thousand.get(i);\n j++;\n }\n for (int i = 0; i < tenThousand.getSize(); i++) {\n array[i] = (T) tenThousand.get(i);\n j++;\n }\n for (int i = 0; i < hundredThousand.getSize(); i++) {\n array[i] = (T) hundredThousand.get(i);\n j++;\n }\n for (int i = 0; i < million.getSize(); i++) {\n array[i] = (T) million.get(i);\n j++;\n }\n for (int i = 0; i < tenMillion.getSize(); i++) {\n array[i] = (T) tenMillion.get(i);\n j++;\n }\n for (int i = 0; i < hundredMillion.getSize(); i++) {\n array[j] = (T) hundredMillion.get(i);\n j++;\n }\n for (int i = 0; i < billion.getSize(); i++) {\n array[j] = (T) billion.get(i);\n j++;\n }\n\n }", "private void quicksort(int inLow, int inHigh) {\n\t\tint i = inLow; int j = inHigh;\n\t\t//____| Get Pivot from middle.\n\t\tfloat pivot = gameObjectsList.get(inLow + (inHigh - inLow)/2).getX();\n\t\t//____| Divide List\n\t\twhile (i <= j){\n\t\t\twhile(gameObjectsList.get(i).getX() < pivot){\n\t\t\t\ti++;\n\t\t\t}\n\t\t\twhile(gameObjectsList.get(j).getX() > pivot){\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tif (i<=j){\n\t\t\t\tCollections.swap(gameObjectsList, i, j);\n\t\t\t\ti++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\tif (inLow < j)\n\t\t\tquicksort(inLow, j);\n\t\tif (i < inHigh)\n\t\t\tquicksort(i, inHigh);\n\t}", "public static void main(String[] args){\n\tint[] o = {3,1,2,2,4};\n\tint[] p = {3,7,1,4,32,95,47,12,50,41};\n\tSystem.out.println(toString(o));\n\tSystem.out.println(toString(quicksort(o,0,o.length)));\n }", "private void recMergeSort(final long[] workSpace, final int lowerBound,\n final int upperBound) {\n if (lowerBound == upperBound) // if range is 1,\n return; // no use sorting\n else { // find midpoint\n final int mid = (lowerBound + upperBound) / 2;\n // sort low half\n recMergeSort(workSpace, lowerBound, mid);\n // sort high half\n recMergeSort(workSpace, mid + 1, upperBound);\n // merge them\n merge(workSpace, lowerBound, mid + 1, upperBound);\n } // end else\n }", "protected void quickSort(Vector v, int lo0, int hi0) {\r\n\tint lo = lo0;\r\n\tint hi = hi0;\r\n\tTypedFile mid;\r\n\r\n\tif ( hi0 > lo0)\r\n\t{\r\n\r\n\t /* Arbitrarily establishing partition element as the midpoint of\r\n\t * the array.\r\n\t */\r\n\t mid = (TypedFile) v.elementAt(( lo0 + hi0 ) / 2);\r\n\r\n\t // loop through the array until indices cross\r\n\t while( lo <= hi )\r\n\t {\r\n\t\t/* find the first element that is greater than or equal to \r\n\t\t * the partition element starting from the left Index.\r\n\t\t */\r\n\t\t// Nasty to have to cast here. Would it be quicker\r\n\t\t// to copy the vectors into arrays and sort the arrays?\r\n\t\twhile( ( lo < hi0 ) && lt( (TypedFile)v.elementAt(lo), mid ) )\r\n\t\t ++lo;\r\n\r\n\t\t /* find an element that is smaller than or equal to \r\n\t\t * the partition element starting from the right Index.\r\n\t\t */\r\n\t\twhile( ( hi > lo0 ) && lt( mid, (TypedFile)v.elementAt(hi) ) )\r\n\t\t --hi;\r\n\r\n\t\t // if the indexes have not crossed, swap\r\n\t\tif( lo <= hi ) \r\n\t\t{\r\n\t\t swap(v, lo, hi);\r\n\t\t ++lo;\r\n\t\t --hi;\r\n\t\t}\r\n\t }\r\n\r\n\t /* If the right index has not reached the left side of array\r\n\t\t * must now sort the left partition.\r\n\t\t */\r\n\t if( lo0 < hi )\r\n\t\tquickSort( v, lo0, hi );\r\n\r\n\t\t/* If the left index has not reached the right side of array\r\n\t\t * must now sort the right partition.\r\n\t\t */\r\n\t if( lo < hi0 )\r\n\t\tquickSort( v, lo, hi0 );\r\n\r\n\t}\r\n }", "private int hoaresPartition(int[] arr, int start, int end)\n {\n int pivot = arr[start];\n int left = start + 1;\n int right = end;\n\n while(left < right)\n {\n while(arr[left] < pivot && left < end) left ++;\n while(arr[right] > pivot && right > start) right --;\n if(left < right) {\n swap(arr, left, right);\n }\n }\n swap(arr, start, right);\n return right;\n }", "public static void main(String[] args) {\r\n Scanner s = new Scanner(System.in);\r\n int length = Integer.parseInt(s.nextLine());\r\n int[] arr = new int[length];\r\n for (int i=0; i<length; i++)\r\n {\r\n arr[i] = s.nextInt();\r\n }\r\n quickSort(arr, 0, length-1);\r\n// printArray(arr);\r\n }" ]
[ "0.6085908", "0.60427696", "0.5877109", "0.56916803", "0.5677044", "0.56362605", "0.56195366", "0.56161684", "0.55942255", "0.55870867", "0.55779016", "0.5555641", "0.5548037", "0.54907763", "0.5480525", "0.5473788", "0.54725534", "0.5455342", "0.54243714", "0.5423215", "0.5419828", "0.54103166", "0.54037815", "0.53955525", "0.5391789", "0.538815", "0.5386362", "0.5382377", "0.53754914", "0.53656393", "0.53538585", "0.53269804", "0.531712", "0.52979034", "0.52937734", "0.52868336", "0.5281618", "0.52774113", "0.52764356", "0.5269358", "0.526725", "0.52549547", "0.524425", "0.52367705", "0.52311075", "0.52276903", "0.5219564", "0.5216361", "0.5206071", "0.51970774", "0.5189104", "0.51855797", "0.5183543", "0.51686686", "0.5166092", "0.5164512", "0.51613814", "0.5157448", "0.51571476", "0.5154314", "0.5149976", "0.51398385", "0.51293606", "0.5124788", "0.5124077", "0.512094", "0.51151913", "0.51111054", "0.5110904", "0.5110272", "0.5107094", "0.5104437", "0.50981647", "0.5091594", "0.5088345", "0.5082248", "0.50780475", "0.5077102", "0.50742185", "0.5055383", "0.5054788", "0.50375897", "0.503591", "0.5033854", "0.5033424", "0.5024687", "0.50225395", "0.5022237", "0.5022007", "0.50162977", "0.5015767", "0.501559", "0.501469", "0.5014209", "0.5008563", "0.5006648", "0.5000136", "0.49958888", "0.49920353", "0.49918428" ]
0.7639435
0
This method performs a QuckSort iteration and is calling recursively.
private void sort(int start, int stop) { addComparison(); if (start > stop) { return; } addComparison(); if (stop - start < b) { bubbleSort(start, stop); } else { int pivotIndex = start + (int) ((stop - start) * Math.random()); float pivot = sequence[pivotIndex]; int left = start; int right = stop; while (left <= right) { addComparison(); while (sequence[left] < pivot) { left++; addComparison(); } addComparison(); while (sequence[right] > pivot) { right--; addComparison(); } addComparison(); if (left <= right) { swapAt(left, right); left++; right--; } } sort(start, right); sort(left, stop); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void quickSortIter(){\n int pivot = 0;\n int partition;\n boolean unordered = false;\n do {\n unordered = false;\n partition = pivot;\n for (int i = pivot + 1; i < array.length; i++) {\n if (((Comparable) array[pivot]).compareTo(array[i]) >= 0) {\n if (i - partition > 1) {\n T temp = array[i];\n array[i] = array[partition];\n array[partition] = temp;\n partition++;\n unordered = true;\n } else {\n partition++;\n unordered = true;\n }\n }\n }\n T temp = array[partition];\n array[partition] = array[pivot];\n array[pivot] = temp;\n if (partition < array.length) {\n pivot = partition + 1;\n for (int i = 0; i < partition; i++) {\n if (((Comparable) array[i]).compareTo(array[i + 1]) > 0) {\n pivot = i;\n break;\n }\n }\n }\n } while (unordered);\n\n }", "public void sort() {\n\t\tSystem.out.println(\"Quick Sort Algorithm invoked\");\n\n\t}", "@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }", "public void sortRecursively() {\n\t\tif (!this.isEmpty()) {\n\t\t\tT x = this.peek();\n\t\t\tthis.pop();\n\t\t\tsortRecursively();\n\t\t\tinsertInOrder(x);\n\t\t} else\n\t\t\treturn;\n\t}", "public void doQuickSort() {\n\t\t\n\t\twhile(true) {\n\t\t\tSystem.out.println(\"Enter 1, to choose the pivot as 1st element\");\n\t\t\tSystem.out.println(\"Enter 2, to Choose the pivot as random number\");\n\t\t\tSystem.out.println(\"Enter 3, to choose the pivot as median of 3 random numbers\");\n\t\t\t//System.out.println(\"Enter any random number to choose the pivot from median of median method\");\n\t\t\tchoice = quickInput.nextLine();\n\t\t\t\tif(choice.equals(\"1\") || choice.equals(\"2\") || choice.equals(\"3\")) {\n\t\t\t\t\tSystem.out.println(\"Please enter the value of L to run insertion Sort: (0 if not applicable) \");\n\t\t\t\t\tchunkValue = quickInput.nextInt();\n\t\t\t\t\tQuickAlgorithm quick = new QuickAlgorithm(dataSet, choice, chunkValue);\n\t\t\t\t\tquick.processFileData();\n\t\t\t\t\tdataSet = quick.getFinalDataSet();\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Invalid value.. Try again..!!!\");\n\t\t\t\t}\n\t\t}\n\t\t\n\t\tquickInput = new Scanner(System.in);\n\t\t\n\t\t\n\t\tSystem.out.println(\"Would you like to export the result array to a csv file?\"\n\t\t\t\t+ \"('Y' for yes)\");\n\t\tif(quickInput.nextLine().equalsIgnoreCase(\"Y\")) {\n\t\t\n\t\t\t// Write the output to a csv file\n\t\t\ttry {\n\t\t\t\tWriteOutputToCSV.generateOutput(dataSet, \"Quick\");\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}\n\t\t\n\t\tSystem.out.println(\"Quick Sort Algorithm Process complete\");\n\t\t\n\t}", "public void quickSort() {\n\t\tquickSort(0, data.size() - 1);\n\t}", "public void doTheAlgorithm() {\n this.swapCount = 0;\n this.compCount = 0;\n \n\t\tdoQuickSort(0, this.sortArray.length - 1);\n\t}", "public static void quickSortTest(){\n\t\tTransformer soundwave = new Transformer(\"Soundwave\", 'D', new int[] {8,9,2,6,7,5,6,10});\n\t\tTransformer bluestreak = new Transformer(\"Bluestreak\", 'A', new int[] {6,6,7,9,5,2,9,7});\n\t\tTransformer hubcap = new Transformer(\"Hubcap\", 'A', new int[] {4,4,4,4,4,4,4,4});\n\t\tTransformer abominus = new Transformer(\"Abominus\", 'D', new int[] {10,1,3,10,5,10,8,4});\n\t\t\n\t\tgame.addTransformer(soundwave);\n\t\tgame.addTransformer(bluestreak);\n\t\tgame.addTransformer(hubcap);\n\t\tgame.addTransformer(abominus);\n\t\t\n\t\tgame.sortCompetitorsByRank();\n\t\tgame.printSortedRoster();\n\t}", "public void sort() {\r\n int k = start;\r\n for (int i = 0; i < size - 1; i++) {\r\n int p = (k + 1) % cir.length;\r\n for (int j = i + 1; j < size; j++) {\r\n if ((int) cir[p] < (int) cir[k % cir.length]) {\r\n Object temp = cir[k];\r\n cir[k] = cir[p];\r\n cir[p] = temp;\r\n }\r\n p = (p + 1) % cir.length;\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n }", "public void go(int boundary) {\n\t\tthis.b = boundary;\n\t\tSystem.out.println(\"Start QuickSort ...\");\n\t\tthis.startTime = new Date().getTime();\n\t\tsort(0, sequence.length - 1);\n\t\tthis.endTime = new Date().getTime();\n\t}", "public void radixSorting() {\n\t\t\n\t}", "public void run()\n { // checking for appropriate sorting algorithm\n \n if(comboAlgorithm.equals(\"Shell Sort\"))\n {\n this.shellSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Selection Sort\"))\n {\n this.selectionSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Insertion Sort\"))\n {\n this.insertionSort(randInt);\n }\n if(comboAlgorithm.equals(\"Bubble Sort\"))\n {\n this.bubbleSort(randInt);\n }\n \n }", "public void sort() {\n\t\tif (data.size() < 10) {\n\t\t\tbubbleSort();\n\t\t\tSystem.out.println(\"Bubble Sort\");\n\t\t} else {\n\t\t\tquickSort();\n\t\t\tSystem.out.println(\"Quick Sort\");\n\t\t}\n\t}", "public void quicksort()\n { quicksort(this.heap, 0, heap.size()-1);\n }", "public void quickSort() {\n if (actualArray == null || actualArray.length == 0) {\n return;\n }\n quickSort(0, actualArray.length - 1);\n }", "public static void tenArray(){ //method dealing with 10 array elements\n \n System.out.println(\"QUESTION 1: 10 ELEMENT ARRAY\"); System.out.println(\"-----------------------------------------------------\");\n \n for(int x =1; x<=10; x++){ //recursive loop that runs the method 10 times\n \n btemp1= bCount+ btemp1; itemp1= iCount+ itemp1; qstemp1= qsCount+ qstemp1; //adds comparisons to each other before resetting\n bCount=0; iCount=0; qsCount=0; //resets variables after every iteration of the for loop\n int arr[] = new int [10]; //initializes 10 element array\n \n System.out.print(x+\") Starting Array: \");\n for(int i=0; i<arr.length; i++){ //loop that generates random numbers from 0-99\n Random rand = new Random();\n arr[i] = rand.nextInt(100);\n System.out.print(arr[i] + \" \");\n }\n \n System.out.println(\"\"); System.out.println(\"-----------------------------------------------------\");\n\n bubbleSort(arr); //runs the bubble sort method\n System.out.print(\"Bubble Sorted Array: \");\n for(int i=0; i<arr.length; i++){ //loop that prints the sorted array\n System.out.print(arr[i] + \" \");\n }\n System.out.println(\"\");\n System.out.println(\" Bubble Comparisons: \" + bCount); System.out.println(\"\"); //prints comparisons for bubble sort\n\n \n insertionSort(arr); //runs the insertion sort method\n System.out.print(\"Insertion Sorted Array: \");\n for(int i=0; i<arr.length; i++){ //loop that prints the sorted array\n System.out.print(arr[i] + \" \");\n }\n System.out.println(\"\");\n System.out.println(\" Insertion Comparisons: \" + iCount); System.out.println(\"\"); //prints comparisons for insertion sort\n\n \n quickSort(arr,0,arr.length-1); //runs the quicksort method\n System.out.print(\"Quick Sorted Array: \");\n for(int i=0; i<arr.length; i++){ //loop that prints the sorted array\n System.out.print(arr[i] + \" \");\n }\n System.out.println(\"\");\n System.out.println(\" Quick Comparisons: \" + qsCount); System.out.println(\"-----------------------------------------------------\");\n \n } //ends x10 iteration\n System.out.println(\"\");System.out.println(\"\");System.out.println(\"\");\n}", "public static void thousandArray(){\n \n bCount=0; iCount=0; qsCount=0; //so that counter variables do not carry over values from the last iteration of previous method\n System.out.println(\"QUESTION 3: 1000 ELEMENT ARRAY\"); System.out.println(\"-----------------------------------------------------\");\n \n for(int x =1; x<=10; x++){ //recursive loop that runs the method 10 times\n \n btemp3= bCount+ btemp3; itemp3= iCount+ itemp3; qstemp3= qsCount+ qstemp3; //adds comparisons to each other before resetting\n bCount=0; iCount=0; qsCount=0; //resets variables after every iteration of the for loop\n int arr[] = new int [1000];\n \n System.out.print(x+\") Starting Array: \");\n for(int i=0; i<arr.length; i++){\n Random rand = new Random();\n arr[i] = rand.nextInt(100);\n System.out.print(arr[i] + \" \");\n }\n \n System.out.println(\"\"); System.out.println(\"-----------------------------------------------------\");\n\n bubbleSort(arr);\n System.out.print(\"Bubble Sorted Array: \");\n for(int i=0; i<arr.length; i++){\n System.out.print(arr[i] + \" \");\n }\n System.out.println(\"\");\n System.out.println(\" Bubble Comparisons: \" + bCount); System.out.println(\"\");\n\n \n insertionSort(arr);\n System.out.print(\"Insertion Sorted Array: \");\n for(int i=0; i<arr.length; i++){\n System.out.print(arr[i] + \" \");\n }\n System.out.println(\"\");\n System.out.println(\" Insertion Comparisons: \" + iCount); System.out.println(\"\");\n\n \n quickSort(arr,0,arr.length-1);\n System.out.print(\"Quick Sorted Array: \");\n for(int i=0; i<arr.length; i++){\n System.out.print(arr[i] + \" \");\n }\n System.out.println(\"\");\n System.out.println(\" Quick Comparisons: \" + qsCount); System.out.println(\"-----------------------------------------------------\");\n \n } //ends x10 iteration\n System.out.println(\"\");System.out.println(\"\");System.out.println(\"\");\n}", "public void quickSortRecur() {\n this.array = quickSortRecur(array, size);\n }", "public static void intQSort(int v[], int l, int r) {\n\n int tmp; //tmp variable for swapping\n\n if (INSERTIONENABLED) {\n\n //Use insertion sort for arrays smaller than CUTOFF\n if (r < CUTOFF) {\n\n for(int i = l; i < r; i++) {\n for(int j = i; j > 0 && v[j - 1] > v[j]; j--) {\n // swap(j, j -1) {\n tmp=v[j - 1];\n v[j - 1]=v[j];\n v[j]=tmp;\n // }\n }\n }\n\n return;\n }\n }\n\n int pivot;\n int m = l + (int) (Math.random() * ((r - l) + 1)); // random number between first and last, Peto's remark\n\n //median(v[l], v[m], v[r]) {\n if (v[l] <= v[m]) {\n if (v[m] <= v[r])\n pivot = v[m];\n else {\n if (v[l] <= v[r])\n pivot = v[r];\n else\n pivot = v[l];\n }\n } else {\n if (v[m] <= v[r]) {\n if (v[l] <= v[r])\n pivot = v[l];\n else\n pivot = v[r];\n } \n else\n pivot = v[m];\n }\n // }\n\n int i=l,j=r;\n\n //Partioning\n while(i<=j) {\n\n while(v[i]<pivot) i++;\n while(v[j]>pivot) j--;\n\n if(i<=j) {\n //swap(i, j) {\n tmp=v[i];\n v[i]=v[j];\n v[j]=tmp;\n // }\n\n i++;\n j--;\n }\n }\n\n if(l<j) \n intQSort(v,l,j);\n\n if(i<r) \n intQSort(v,i,r);\n }", "@Override public void run() {\n\t\t\t// Handle the base case:\n\t\t\tif(len - start < 2) {\n\t\t\t\t// Arrive at the base-case state & return:\n\t\t\t\tph.arrive();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// TODO: Select an optimal pivot point:\n\t\t\tint pivot = start;\n\n\t\t\t// Perform the necessary swap operations:\n\t\t\tfor(int i = start; i < len; ++i) {\n\t\t\t\tif(data[i] < data[pivot]) {\n\t\t\t\t\tint tmp = data[pivot];\n\t\t\t\t\tdata[pivot] = data[i];\n\t\t\t\t\tdata[i] = data[pivot + 1];\n\t\t\t\t\tdata[pivot + 1] = tmp;\n\t\t\t\t\t++pivot;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle the single-threaded case:\n\t\t\tif(this.pool == null) {\n\t\t\t\t// Store local variables temporarily:\n\t\t\t\tint start = this.start;\n\t\t\t\tint len = this.len;\n\n\t\t\t\t// Do the first half:\n\t\t\t\tthis.len = pivot;\n\t\t\t\trun();\n\n\t\t\t\t// Prepare for the second half of the array:\n\t\t\t\tthis.len = len;\n\t\t\t} else {\n\t\t\t\t\t// Register a task to process the first half of the array:\n\t\t\t\t\t// TODO: Don't do this if that thread's base-case is met\n\t\t\t\t\tpool.submit(new Sorter(this.pool, this.ph, data, start, pivot));\n\t\t\t}\n\n\t\t\t// Recursively process the second half of the array:\n\t\t\tstart = pivot + 1;\n\t\t\trun();\n\t\t}", "public void quickSortHelper(int start, int end){\n if(start < end){\n //partition index calls partition that returns idx\n //and also puts toSort[partitionidx] in the right place\n int partitionidx = partition(start, end);\n\n //sorts elements before and after the partitions\n //recursive - nice\n //System.out.println(\"test\");\n quickSortHelper(start, partitionidx - 1); //befre\n quickSortHelper(partitionidx + 1, end); //after\n }\n }", "public void quicksort() {\r\n quicksort(mArray, 0, mArray.length -1);\r\n }", "public static void qSort(int left, int right){\n\t\tint i = left, j = right;\n\t\tint ref = left + (right-left)/2;\n\t\tHeapNode pivot = edges[ref];\n\t\tHeapNode temp2 ;\n\t\twhile (i <= j) {\n\t\t\twhile (compare(pivot, edges[i]))\n\t\t\t\ti++;\n\t\t\twhile (compare(edges[j], pivot))\n\t\t\t\tj--;\n\t\t\tif (i <= j) {\n\t\t\t\ttemp2=edges[i];\n\t\t\t\tedges[i]=edges[j];\n\t\t\t\tedges[j]=temp2;\n\n\t\t\t\ti++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t};\n\t\t// recursion\n\t\tif (left < j)\n\t\t\tqSort(left, j);\n\t\tif (i < right) {\n\t\t\tqSort(i, right);\n\t\t}\n\n\t}", "@Test\n public void testQuickSort() {\n System.out.println(\"QuickSort listo\");\n Comparable[] list = {3,2,5,4,1};\n QuickSort instance = new QuickSort();\n Comparable[] expResult = {1,2,3,4,5};\n Comparable[] result = instance.QuickSort(list, 0, list.length-1);\n assertArrayEquals(expResult, result);\n }", "private void doSort (Column A, int [] i, int p, int r, int begin) {//double[] A, int p, int r, MutableTable t) {\n\t\tif (p < r) {\n\t\t\tint q = partition(A, i, p, r, begin);\n\t\t\tdoSort(A, i, p, q, begin);\n\t\t\tdoSort(A, i, q + 1, r, begin);\n\t\t}\n\t}", "private static void performSort(TestApp testApp) {\n testApp.testPartition();\n\n /*\n Date end = new Date();\n System.out.println(\"Sort ended @ \" + end.getTime());\n System.out.println(\"Total time = \" + (end.getTime() - start.getTime())/1000.0 + \" seconds...\");\n */\n }", "public static void hundredArray(){\n \n bCount=0; iCount=0; qsCount=0; //so that counter variables do not carry over values from the last iteration of previous method\n System.out.println(\"QUESTION 2: 100 ELEMENT ARRAY\"); System.out.println(\"-----------------------------------------------------\");\n \n for(int x =1; x<=10; x++){ //recursive loop that runs the method 10 times\n \n btemp2= bCount+ btemp2; itemp2= iCount+ itemp2; qstemp2= qsCount+ qstemp2; //adds comparisons to each other before resetting\n bCount=0; iCount=0; qsCount=0; //resets variables after every iteration of the for loop\n int arr[] = new int [100];\n \n System.out.print(x+\") Starting Array: \");\n for(int i=0; i<arr.length; i++){\n Random rand = new Random();\n arr[i] = rand.nextInt(100);\n System.out.print(arr[i] + \" \");\n }\n \n System.out.println(\"\"); System.out.println(\"-----------------------------------------------------\");\n\n bubbleSort(arr);\n System.out.print(\"Bubble Sorted Array: \");\n for(int i=0; i<arr.length; i++){\n System.out.print(arr[i] + \" \");\n }\n System.out.println(\"\");\n System.out.println(\" Bubble Comparisons: \" + bCount); System.out.println(\"\");\n\n \n insertionSort(arr);\n System.out.print(\"Insertion Sorted Array: \");\n for(int i=0; i<arr.length; i++){\n System.out.print(arr[i] + \" \");\n }\n System.out.println(\"\");\n System.out.println(\" Insertion Comparisons: \" + iCount); System.out.println(\"\");\n\n \n quickSort(arr,0,arr.length-1);\n System.out.print(\"Quick Sorted Array: \");\n for(int i=0; i<arr.length; i++){\n System.out.print(arr[i] + \" \");\n }\n System.out.println(\"\");\n System.out.println(\" Quick Comparisons: \" + qsCount); System.out.println(\"-----------------------------------------------------\");\n \n } //ends x10 iteration\n System.out.println(\"\");System.out.println(\"\");System.out.println(\"\");\n}", "public static void quickSort(LinkedQueue q) {\n // Your solution here.\n if (q.isEmpty())\n {\n return;\n }\n int pivotInt = (int) (1 + Math.random() * q.size());\n Object pivot = q.nth(pivotInt);\n LinkedQueue qSmall = new LinkedQueue();\n LinkedQueue qEquals = new LinkedQueue();\n LinkedQueue qLarge = new LinkedQueue();\n \n ListSorts.partition(q, (Comparable) pivot, qSmall, qEquals, qLarge);\n \n ListSorts.quickSort(qSmall);\n ListSorts.quickSort(qLarge);\n \n q.append(qSmall);\n q.append(qEquals);\n q.append(qLarge);\n \n\n }", "public void shellSort(){\n int increment = list.size() / 2;\n while (increment > 0) {\n for (int i = increment; i < list.size(); i++) {\n int j = i;\n int temp = list.get(i);\n while (j >= increment && list.get(j - increment) > temp) {\n list.set(j, list.get(j - increment));\n j = j - increment;\n }\n list.set(j, temp);\n }\n if (increment == 2) {\n increment = 1;\n } else {\n increment *= (5.0 / 11);\n }\n }\n }", "public void sort() {\n Stack<Pair> stack = new Stack();\n //fill the stack\n Pair temp = new Pair(0, a.length);\n stack.push(temp);\n quickSort(stack,stack.peek().first, stack.peek().n);\n }", "public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n \n //prompting input\n \tSystem.out.println(\"How many elements do you need sorted?\");\n \n //storing input\n int n = s.nextInt();\n \t\n \tint arr[] = new int[n];\n \n System.out.println(\"Enter the elements of your array, please.\");\n \n //populating array\n for (int i = 0; i < n; i++) {\n \tarr[i] = s.nextInt();\n }\n \n //instanciating object of Quick_Sort class\n Quick_Sort sorter = new Quick_Sort();\n //calling a method on object with array argument\n \tsorter.sort(arr);\n \n System.out.println(\"Your elements after recursive Quick Sort\");\n\n for (int i = 0; i < n; i++)\n System.out.println(arr[i]);\n \n s.close(); \n \n }", "public void sort() {\n }", "public static void main(String[] args)\n {\n Stack<Integer> s=new Stack<Integer>();\n s.push(28);\n s.push(2);\n s.push(16);\n s.push(3);\n s.push(72);\n s.push(19);\n s.push(6);\n System.out.print(\"Before sorting: \");\n for(int e : s)\n System.out.print(e+\" \");\n System.out.println();\n sort(s);\n //the iteration starts from stack bottom\n System.out.print(\"After sorting: \");\n for(int e : s)\n System.out.print(e+\" \");\n System.out.println();\n }", "public String doSort();", "public static void main(final String... args) {\n System.out.println(\"---- QuickSort ----\");\n System.out.println(\"Before: \" + Arrays.toString(ArrayGenerator()));\n QuickSort.sort(TEST_ARRAY);\n System.out.println(\"After: \" + Arrays.toString(TEST_ARRAY));\n System.out.println(\"Is Sorted: \" + sortingCheck(TEST_ARRAY));\n // END- QuickSort\n\n }", "private static <T extends Comparable<? super T>> void quickSort(List<T> list, int beginIndex, int finishIndex){\n if(beginIndex + 1 <= finishIndex){\n int i = beginIndex;\n int j = finishIndex;\n while(i <= j){\n while(list.get(i).compareTo(list.get(finishIndex)) < 0 && i < finishIndex){\n i++;\n }\n while(list.get(j).compareTo(list.get(finishIndex)) >= 0 && j > beginIndex){\n j--;\n }\n if(i <= j) {\n if(i != j)\n swap(list, i, j);\n if(i != beginIndex)\n i++;\n if(j != finishIndex)\n j--;\n }\n }\n if(i < finishIndex)\n swap(list, i, finishIndex);\n\n quickSort(list, beginIndex, i - 1);\n quickSort(list, i + 1, finishIndex);\n }\n }", "@Override\n\t\tpublic void run() {\n\t\t\tfor (int i = 0; i < 1000000; i++) {\n\t\t\t\tint[] a = Util.generateRandomArray(500, 200000);\n\t\t\t\tint[] b = a.clone();\n\t\t\t\t\n\t\t\t\ta = sort(a);\n\t\t\t\tArrays.sort(b);\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < b.length; j++) {\n\t\t\t\t\tUtil.Assert(a[j] == b[j], \"shit\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Heap sort ok\");\n\t\t}", "private QuickSort3Way() {}", "private void externalSort() throws IOException{\n\t\t/*\n\t\t * Pass 0: internal sort\n\t\t */\n\t\t// Read in from child;Write out runs of B pages;\n\t\t\n\t\tint numPerRun = B * 4096 / (schema.size() * 4); // # of tuples per run given in Pass0\n\t\tboolean buildMore;\n\t\tint numRuns = 0;\n\t\tif(sortAttrsIndex == null) {\n\t\t\tthis.buildAttrsIndex();\n\t\t}\n\t\texComparator myComp = new exComparator();\n\t\tinternal = new PriorityQueue<Tuple>(myComp);\n\t\tdo {\n\t\t\tbuildMore = this.buildHeap(numPerRun);\n\t\t\tnumRuns++;\n\t\t\t\n\t\t\t// write out the (numRuns)th run\n\t\t\tTupleWriter TW;\n\t\t\tif(!buildMore && numRuns == 1) {\n\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"sortResult\"));\n\t\t\t} else {\n\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"0_\" + numRuns));\n\t\t\t}\n\t\t\twhile(!internal.isEmpty()) {\n//\t\t\t\tSystem.out.println(internal.peek().data);\n\t\t\t\tTW.setNextTuple(internal.poll()); \n\t\t\t}\n\t\t\t// leftover, fill with zero and write out\n\t\t\tif(!TW.bufferEmpty()) { // TW would never know the end of writing\n\t\t\t\tTW.fillFlush(); \n\t\t\t}\n\t\t\tTW.close();\n\t\t\t// internal must be empty until this point\n\t\t}while (buildMore);\n\t\t\n\t\t/*\n\t\t * Pass 1 and any following\n\t\t */\n\t\tif(numRuns > 1) { // if numRuns generated in Pass 0 is 1 already, file sorted already, no need to merge\n\t\t\tthis.merge(numRuns, myComp);\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t// Part 1 Bench Testing\n\t\t// -----------------------------------\n\n\t\t// -----------------------------------\n\t\t// Array and other declarations\n\t\t// -----------------------------------\n\t\tStopWatch sw = new StopWatch(); // timer for measuring execution speed\n\t\tfinal int SIZE = 100000; // size of array we are using\n\n\t\tint[] sourceArray, copyArray; // arrays for testing insertionSort and selectionSort\n\t\tInteger[] sourceArray2, copyArray2; // arrays for testing shell, merge, quicksort\n\n\t\t// -------------------------------------------------\n\t\t// Array initialization to a predetermined shuffle\n\t\t// -------------------------------------------------\n\t\tsourceArray = new int[SIZE]; // for use in selection, insertion sort\n\t\tscrambleArray(sourceArray, true); // scramble to a random state\n\t\tsourceArray2 = new Integer[SIZE]; // for use in shell,merge,quicksort\n\t\tscrambleArray(sourceArray2, true); // scramble to a random state\n\n\t\t// ---------------------------------------\n\t\t// SELECTION SORT\n\t\t// ---------------------------------------\n\t\t// for all sorts, we must reset copyArray\n\t\t// to sourceArray before sorting\n\t\t// ---------------------------------------\n\t\tcopyArray = Arrays.copyOf(sourceArray, SIZE);\n\n\t\tSystem.out.println(\"Before Selection Sort\");\n\t\t// printArray(copyArray);\n\t\tSystem.out.println(\"Selection Sort\");\n\t\tsw.start(); // start timer\n\t\tSortArray.selectionSort(copyArray, SIZE);\n\t\tsw.stop(); // stop timer\n\t\tSystem.out.println(\"selection sort took \" + sw.getElapsedTime() + \" msec\");\n\t\tSystem.out.println(\"After Selection Sort\");\n\t\t// printArray(copyArray);\n\n\t\t// -----------------------------------------\n\t\t// INSERTION SORT\n\t\t// -----------------------------------------\n\t\t// Reset copyArray back to unsorted state\n\t\t// -----------------------------------------\n\n\t\t// add statements for STEP 2 here\n\n\t\t// -----------------------------------------\n\t\t// SHELL SORT\n\t\t// -----------------------------------------\n\t\t// Reset copyArray2 back to unsorted state\n\t\t// -----------------------------------------\n\n\t\t// add statements for STEP 3 here\n\n\t\t// -----------------------------------------\n\t\t// MERGE SORT\n\t\t// -----------------------------------------\n\t\t// Reset copyArray2 back to unsorted state\n\t\t// -----------------------------------------\n\n\t\t// add statements for STEP 4 here\n\n\t\t// -----------------------------------------\n\t\t// QUICK SORT\n\t\t// -----------------------------------------\n\t\t// Reset copyArray2 back to unsorted state\n\t\t// -----------------------------------------\n\n\t\t// add statements for STEP 5 here\n\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tint[] x = {9,2,4,5,6,7,8,2,44,55,90,1456,300,345654,1,76};\n\t\t\n\t\tSystem.out.println(Arrays.toString(x));\n\t\t\n\t\tint since = 0;\n\t\tint until = x.length - 1;\n\t\tquicksort(x,since,until);\n\t\tSystem.out.println(Arrays.toString(x));\n\t\t\n\t\t}", "public static void main(String[] args) {\n\t\tQuickHelper help = new QuickHelper();\n\t\t\n\t\tSystem.out.println(\"Now starting A\");\n\t\tint A[] = {5,2,12,7,9,6};\n\t\thelp.print(A);\n\t\tint n= A.length;\n\t\thelp.sort(A, 0, n-1);\n\t\thelp.print(A);\n\t\t\n\t\tSystem.out.println(\"\\nNow starting B\");\n\t\tint B[] = {1,2,3,4};\n\t\thelp.print(B);\n\t\tn = B.length;\n\t\thelp.tailrecursivesort(B, 0, n-1);\n\t\thelp.print(B);\n\t\t\n\t\tSystem.out.println(\"\\nNow starting C\");\n\t\tint C[] = {1,2,3,4};\n\t\thelp.print(C);\n\t\tn = C.length;\n\t\thelp.improvedtailrecursivesort(C, 0, n-1);\n\t\thelp.print(C);\n\t}", "public void sortArray() {\n\t\tSystem.out.println(\"QUICK SORT\");\n\t}", "public void moveSort() {\r\n\t\trefX = 0;\r\n\t\tmoveSort(root);\r\n\t}", "private void doQuickSort(int lowerIndex, int higherIndex){\n\t\tint lowItter = lowerIndex;\n\t\tint highItter = higherIndex;\n \n\t\t// use the middle as a pivot numberr\n int middleIndex = lowerIndex + (higherIndex - lowerIndex)/2;\n\t\tint pivot = sortArray[middleIndex];\n \n\t\twhile (lowItter <= highItter) {\n\t\t\twhile (sortArray[lowItter] < pivot)\n lowItter++;\n \n\t\t\twhile (sortArray[highItter] > pivot)\n highItter--;\n \n compCount++;\n\t\t\tif (lowItter <= highItter) {\n\t\t\t\tswap(lowItter, highItter);\n swapCount++;\n \n\t\t\t\tlowItter++;\n\t\t\t\thighItter--;\n\t\t }\n\t\t}\n \n compCount++;\n\t\tif (lowerIndex < higherIndex)\n\t\t\tdoQuickSort(lowerIndex, highItter);\n \n compCount++;\n\t\tif (lowItter < higherIndex)\n\t\t\tdoQuickSort(lowItter, higherIndex);\n \n\t}", "public void sort(){\n\t\t\n\t\tif(Q.size() != 1){\n\t\t\tArrayQueue<E> tempQueue1 = Q.dequeue();\n\t\t\tArrayQueue<E> tempQueue2 = Q.dequeue();\n\t\t\tArrayQueue<E> tempQueue3 = merge(tempQueue1, tempQueue2);\n\t\t\tQ.enqueue(tempQueue3);\n\t\t\tsort();\n\t\t}\n\t\t\n\t}", "public static void main(String arg []) {\r\n\t\tint n = 8; //problem size\r\n\t\t\r\n\t\ttestSortingAlgorithm(new Insertion(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new Selection(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new Bubble(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new QuicksortFateful(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new QuicksortCentralElement(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new QuicksortMedianOfThree(n));\r\n\t}", "public static void main(String[] args) {\n int[] arr = {10, 7, 8, 9, 1, 5};\n QuickSort quickSort = new QuickSort();\n quickSort.sort(arr, 0, arr.length - 1);\n System.out.println(\"Sorted array:\");\n quickSort.printArray(arr);\n }", "public static void main(String[] args) {\n\r\n\t\t int[] arr = generateRandomArrayWithRandomNum();\r\n\t int checksSelectionSort = 0;\r\n\t int checksBubbleSort = 0;\r\n\t int checksMergeSort = 0;\r\n\t int checksQuickSort = 0;\r\n\t int[] copyArr = new int[1000];\r\n\t for (int x = 0; x < 20; x++) {\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksSelectionSort += doSelectionSort(arr);\r\n\r\n\t \r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksBubbleSort += bubbleSort(copyArr);\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksMergeSort += new mergeSort().sort(arr);\r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksQuickSort += new quickSort().sort(copyArr);\r\n\t }\r\n\t System.out.println(\"Analysis Of Sorting algorithms \");\r\n\t System.out.println(\"Selection Sort : \"+checksSelectionSort/20);\r\n\t System.out.println(\"Bubble Sort : \"+checksBubbleSort/20);\r\n\t System.out.println(\"Merge Sort : \"+checksMergeSort/20);\r\n\t System.out.println(\"Quick Sort : \"+checksQuickSort/20);\r\n\r\n\t \r\n\t }", "public int[] quicksort(int A[], int izq, int der) {\r\n\r\n\t\t int piv=A[izq]; // tomamos el primer elemento como pivote\r\n\t\t int i=izq; // i realiza la búsqueda de izquierda a derecha\r\n\t\t int j=der; // j realiza la búsqueda de derecha a izquierda\r\n\t\t int aux;\r\n\t\t \r\n\t\t while(i<j){ // mientras no se crucen...\r\n\t\t while(A[i]<=piv && i<j) i++; // busca un elemento mayor que pivote,\r\n\t\t while(A[j]>piv) j--; // busca un elemento menor que pivote,\r\n\t\t if (i<j) { // si los encuentra y no se han cruzado... \r\n\t\t aux= A[i]; // los intercambia.\r\n\t\t A[i]=A[j];\r\n\t\t A[j]=aux;\r\n\t\t }\r\n\t\t }\r\n\t\t A[izq]=A[j]; // colocamos el pivote en su lugar de la forma [menores][pivote][mayores]\r\n\t\t A[j]=piv; \r\n\t\t if(izq<j-1)\r\n\t\t quicksort(A,izq,j-1); // ordenamos mitad izquierda\r\n\t\t if(j+1 <der)\r\n\t\t quicksort(A,j+1,der); // ordenamos mitad derecha\r\n\t\t \r\n\t return A;\r\n\t\t\t }", "public static void main(String[] args) {\n QuickSort quickSort=new QuickSort();\n int[] unsortedArray=new int[] {0,100,3,24,45,54};\n int[] sortrdArray= quickSort.quickSort(unsortedArray,0,unsortedArray.length-1);\n for (int i: sortrdArray){\n System.out.println(\"Sorted values =\"+i);\n }\n }", "@Override\n public void sort() {\n for (int i = 0; i < size; i++) {\n for (int j = i + 1; j < size; j++) {\n if (((Comparable) data[i]).compareTo(data[j]) > 0) {\n E c = data[i];\n data[i] = data[j];\n data[j] = c;\n\n }\n }\n }\n }", "private void quickSort(int low, int high) {\n\t\tint i = low;\n\t\tint k = high;\n\t\tint pivot = array[low + (high - low) / 2];\n\n\t\twhile (i <= k) {\n\t\t\t// Stops when element on left side is greater than the pivot\n\t\t\twhile (array[i] < pivot) {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t// Stops when the element on the right side is less than the pivot\n\t\t\twhile (array[k] > pivot) {\n\t\t\t\tk--;\n\t\t\t}\n\t\t\t// Swap the left and right elements, since the one on the left is\n\t\t\t// greater than the one on the right (proved via pivot)\n\t\t\tif (i <= k) {\n\t\t\t\texchangeNums(i, k);\n\t\t\t\t// Move on to the next elements\n\t\t\t\ti++;\n\t\t\t\tk--;\n\t\t\t}\n\t\t}\n\t\t// Recursive calls\n\t\tif (low < k) {\n\t\t\tquickSort(low, k);\n\t\t}\n\t\tif (i < high) {\n\t\t\tquickSort(i, high);\n\t\t}\n\t}", "@Test\n public void testShellSort() throws Exception {\n int[] list = new int[]{49, 38, 65, 97, 76, 13, 27, 49, 55, 4};\n LogUtils.d(list);\n A_10_4_to_10_5.shellSort(list);\n LogUtils.d(list);\n }", "public static void quickSort(ArrayList<Integer> S){\n\t\t\n\t\tif (S.isEmpty()) { //if empty just return itself \n\t\t\treturn; \n\t\t}\n\t\t\n\t\tint pivot = S.get(S.size()-1); //creating a pivot point for the sort \n\t\t\n\t\tArrayList<Integer> L = new ArrayList<Integer>(); //Creating array list for Less than\n\t\tArrayList<Integer> E = new ArrayList<Integer>(); //Creating array list for Equal than\n\t\tArrayList<Integer> G = new ArrayList<Integer>(); //Creating array list for Greater than \n\t\t\n\t\twhile (!S.isEmpty()) { //run while the array list isn't empty \n\t\t\t\n\t\t\tif (S.get(0)< pivot) { //if its less than the pivot, add less than \n\t\t\t\t\n\t\t\t\tL.add(S.get(0)); //adds the less than \n\t\t\t\tS.remove(0); //removes the elements at that index position \n\t\t\t}\n\t\t\telse if(S.get(0) == pivot) { //if its equal to the pivot, add equal to \n\t\t\t\t\n\t\t\t\tE.add(S.get(0));\n\t\t\t\tS.remove(0);\n\t\t\t}\n\t\t\t\n\t\t\telse if (S.get(0) > pivot) { //if its greater than the pivot point, add greater than \n\t\t\t\t\n\t\t\t\tG.add(S.get(0));\n\t\t\t\tS.remove(0);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tif (!L.isEmpty()) { //if Less than isn't empty, call quick sort on less than \n\t\t\t\n\t\t\tquickSort(L); //calls the quick sort for less than \n\t\t}\n\t\t\n\t\tif (!G.isEmpty()) { //if Greater than isn't empty, call quick sort on greater than \n\t\t\t\n\t\t\tquickSort(G); //calls quick sort for greater than \n\t\t}\n\t\t\n\t\tS.addAll(L); //Shifting all of the elements to the right \n\t\tS.addAll(E); //Shifting all of the elements to the right \n\t\tS.addAll(G); //Shifting all of the elements to the right \n\t}", "public static void dbQSort(double[] v, int l, int r) {\n\n double pivot;\n int m = l + (int) (Math.random() * ((r - l) + 1)); // random number between first and last, Peto's remark\n \n //median(v[l], v[m], v[r]) {\n if (v[l] <= v[m]) {\n if (v[m] <= v[r])\n pivot = v[m];\n else {\n if (v[l] <= v[r])\n pivot = v[r];\n else\n pivot = v[l];\n }\n } else {\n if (v[m] <= v[r]) {\n if (v[l] <= v[r])\n pivot = v[l];\n else\n pivot = v[r];\n } \n else\n pivot = v[m];\n }\n // }\n\n int i=l,j=r;\n double tmp; //tmp variable for swapping\n\n //Partioning\n while(i<=j) {\n\n while(v[i]<pivot) i++;\n while(v[j]>pivot) j--;\n\n if(i<=j) {\n //swap(i, j) {\n tmp=v[i];\n v[i]=v[j];\n v[j]=tmp;\n // }\n\n i++;\n j--;\n }\n }\n\n if(l<j) \n dbQSort(v,l,j);\n\n if(i<r) \n dbQSort(v,i,r);\n\n }", "void quickSort(int arr[], int low, int high) \n { \n if (low < high) \n { \n /* pi is partitioning index, arr[pi] is \n now at right place */\n int pi = partition(arr, low, high); \n \n // Recursively sort elements before \n // partition and after partition \n quickSort(arr, low, pi-1); \n quickSort(arr, pi+1, high); \n } \n }", "public ListUtilities quicksort(){\n\t\t\n\t\tListUtilities lo = this.returnToStart();\n\t\tListUtilities hi = this.goToEnd();\n\t\tListUtilities sorted = this.partition(lo, hi);\n\t\t\n\t\treturn sorted.returnToStart();\t\t\n\t}", "public void bucketSort() {\n MyArray ten = new MyArray();\n MyArray hundred = new MyArray();\n MyArray thousand = new MyArray();\n MyArray tenThousand = new MyArray();\n MyArray hundredThousand = new MyArray();\n MyArray million = new MyArray();\n MyArray tenMillion = new MyArray();\n MyArray hundredMillion = new MyArray();\n MyArray billion = new MyArray();\n\n for (int i = 0; i < array.length; i++) {\n if ((int) array[i] / 10 < 0) {\n ten.add(array[i]);\n } else if ((int) array[i] / 100 < 0) {\n hundred.add(array[i]);\n } else if ((int) array[i] / 1000 < 0) {\n thousand.add(array[i]);\n } else if ((int) array[i] / 10000 < 0) {\n tenThousand.add(array[i]);\n } else if ((int) array[i] / 100000 < 0) {\n hundredThousand.add(array[i]);\n } else if ((int) array[i] / 1000000 < 0) {\n million.add(array[i]);\n } else if ((int) array[i] / 10000000 < 0) {\n tenMillion.add(array[i]);\n } else if ((int) array[i] / 100000000 < 0) {\n hundredMillion.add(array[i]);\n } else {\n billion.add(array[i]);\n }\n }\n\n ten = ten.radixSort(ten);\n hundred = hundred.radixSort(hundred);\n thousand = thousand.radixSort(thousand);\n tenThousand = tenThousand.radixSort(tenThousand);\n hundredThousand = hundredThousand.radixSort(hundredThousand);\n million = million.radixSort(million);\n tenMillion = tenMillion.radixSort(tenMillion);\n hundredMillion = hundredMillion.radixSort(hundredMillion);\n billion = billion.radixSort(billion);\n\n int j = 0;\n for (int i = 0; i < ten.getSize(); i++) {\n array[i] = (T) ten.get(i);\n j++;\n }\n for (int i = 0; i < hundred.getSize(); i++) {\n array[i] = (T) hundred.get(i);\n j++;\n }\n for (int i = 0; i < thousand.getSize(); i++) {\n array[i] = (T) thousand.get(i);\n j++;\n }\n for (int i = 0; i < tenThousand.getSize(); i++) {\n array[i] = (T) tenThousand.get(i);\n j++;\n }\n for (int i = 0; i < hundredThousand.getSize(); i++) {\n array[i] = (T) hundredThousand.get(i);\n j++;\n }\n for (int i = 0; i < million.getSize(); i++) {\n array[i] = (T) million.get(i);\n j++;\n }\n for (int i = 0; i < tenMillion.getSize(); i++) {\n array[i] = (T) tenMillion.get(i);\n j++;\n }\n for (int i = 0; i < hundredMillion.getSize(); i++) {\n array[j] = (T) hundredMillion.get(i);\n j++;\n }\n for (int i = 0; i < billion.getSize(); i++) {\n array[j] = (T) billion.get(i);\n j++;\n }\n\n }", "private void sort()\n {\n // This implements Shell sort.\n // Unfortunately we cannot use the sorting functions from the library\n // (e.g. java.util.Arrays.sort), since the ones that work on int\n // arrays do not accept a comparison function, but only allow\n // sorting into natural order.\n int jump = length;\n boolean done;\n \n while( jump>1 ){\n jump /= 2;\n \n do {\n done = true;\n \n for( int j = 0; j<(length-jump); j++ ){\n int i = j + jump;\n \n if( !areCorrectlyOrdered( indices[j], indices[i] ) ){\n // Things are in the wrong order, swap them and step back.\n int tmp = indices[i];\n indices[i] = indices[j];\n indices[j] = tmp;\n done = false;\n }\n }\n } while( !done );\n }\n \n // TODO: integrate this with the stuff above.\n for( int i=1; i<length; i++ ){\n commonality[i] = commonLength( indices[i-1], indices[i] );\n }\n commonality[0] = -1;\n }", "public static void main(String[] args){\n int [] a= {18,10,23,46,9};\n quickSort(a,0,a.length-1);\n }", "private static <K> void quickSortHelper(Queue<K> S, Comparator<K> comp, long timeGiven, long startTime) throws TimedOutException {\n if (System.currentTimeMillis() - startTime > timeGiven) {\n throw new TimedOutException(\"TimeOut\");\n }\n int n = S.size();\n if (n < 2) return; // queue is trivially sorted\n // divide\n K pivot = S.first(); // using first as arbitrary pivot\n Queue<K> L = new LinkedQueue<>();\n Queue<K> E = new LinkedQueue<>();\n Queue<K> G = new LinkedQueue<>();\n while (!S.isEmpty()) { // divide original into L, E, and G\n K element = S.dequeue();\n int c = comp.compare(element, pivot);\n if (c < 0) // element is less than pivot\n L.enqueue(element);\n else if (c == 0) // element is equal to pivot\n E.enqueue(element);\n else // element is greater than pivot\n G.enqueue(element);\n }\n // conquer\n quickSortHelper(L, comp, timeGiven, startTime); // sort elements less than pivot\n quickSortHelper(G, comp, timeGiven, startTime); // sort elements greater than pivot\n // concatenate results\n while (!G.isEmpty())\n S.enqueue(G.dequeue());\n while (!E.isEmpty())\n S.enqueue(E.dequeue());\n while (!L.isEmpty())\n S.enqueue(L.dequeue());\n }", "public void shellSort(int[] a) \n {\n int increment = a.length / 2;\n while (increment > 0) \n {\n \n for (int i = increment; i < a.length; i++) //looping over the array\n {\n int j = i;\n int temp = a[i]; // swapping the values to a temporary array\n try\n {\n if(!orderPanel) // checking for Descending order\n {\n while (j >= increment && a[j - increment] > temp) \n {\n a[j] = a[j - increment]; //swapping the values\n thread.sleep(100);\n repaint();\n this.setThreadState();\n j = j - increment;\n }\n }\n \n else\n {\n while (j >= increment && a[j - increment] < temp) //checking for Ascending order\n {\n a[j] = a[j - increment];\n thread.sleep(200);\n repaint();\n this.setThreadState();\n j = j - increment;\n }\n \n }\n }\n catch(Exception e)\n {\n System.out.println(\"Exception occured\" + e);\n }\n a[j] = temp;\n }\n \n if (increment == 2) \n {\n increment = 1;\n } \n else \n {\n increment *= (5.0 / 11);\n }\n }\n }", "public void run(DataAccessor data) {\n boolean cocktail = true;\n \n int loc = 0;\n //continue till sorted\n while (cocktail) {\n //set to false, until true\n cocktail = false;\n //goes through array one way to sort\n //drunk is 'i'\n for (int drunk = loc; drunk <= data.size() - loc - 2; drunk++) {\n //if it has found where it is more than the next one, it switches it\n if (data.get(drunk) > data.get(drunk + 1)) {\n //switches and returns true\n //wasted is the temp\n int wasted = data.get(drunk);\n data.set(drunk, data.get(drunk + 1));\n data.set(drunk + 1, wasted);\n cocktail = true;\n }\n }\n //breaks if it is never true\n if (!cocktail) {\n break;\n }\n //set to false (again), until true\n cocktail = false;\n //goes through other way to sort\n //twerk is 'i'\n for (int twerk = data.size() - loc - 2; twerk >= loc; twerk--) {\n //if it has found where it is more than the next one, it switches it\n if (data.get(twerk) > data.get(twerk + 1)) {\n //switches and returns true\n //club is temp\n int club = data.get(twerk);\n data.set(twerk, data.get(twerk + 1));\n data.set(twerk + 1, club);\n cocktail = true;\n }\n }\n loc++;\n }\n\n data.done();\n }", "private static <E extends Comparable<? super E>> void quickSortHelper(\r\n\t\t\tComparable<E>[] data, int left, int right) {\r\n\t\tif (left + CUTOFF <= right) {\r\n\t\t\tE pivot = median3(data, left, right);\r\n\t\t\tint partition = partition(data, left, right, pivot);\r\n\t\t\tquickSortHelper(data, left, partition - 1);\r\n\t\t\tquickSortHelper(data, partition + 1, right);\r\n\t\t} else {\r\n\t\t\tinsertionSort(data, left, right);\r\n\t\t}\r\n\t}", "public void sort(){\n for(int i = array.length-1;i >= 0;i--){\n sink(i);\n }\n while(size > 0){\n swap(0, size-1);\n size -= 1;\n sink(0);\n }\n }", "@Override\n public void sort(IAlg algorithm, boolean decrescent){}", "public void inOrderTraverseIterative();", "private void trIntroSort(int r34, int r35, int r36, int r37, int r38, io.netty.handler.codec.compression.Bzip2DivSufSort.TRBudget r39, int r40) {\n /*\n r33 = this;\n r0 = r33;\n r0 = r0.SA;\n r16 = r0;\n r4 = 64;\n r0 = new io.netty.handler.codec.compression.Bzip2DivSufSort.StackEntry[r4];\n r29 = r0;\n r32 = 0;\n r27 = 0;\n r4 = r38 - r37;\n r22 = trLog(r4);\n r28 = r27;\n r23 = r22;\n L_0x001a:\n if (r23 >= 0) goto L_0x02b6;\n L_0x001c:\n r4 = -1;\n r0 = r23;\n if (r0 != r4) goto L_0x01a4;\n L_0x0021:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x0050;\n L_0x002d:\n r22 = r23;\n L_0x002f:\n r26 = 0;\n L_0x0031:\n r0 = r26;\n r1 = r28;\n if (r0 >= r1) goto L_0x072a;\n L_0x0037:\n r4 = r29[r26];\n r4 = r4.d;\n r5 = -3;\n if (r4 != r5) goto L_0x004d;\n L_0x003e:\n r4 = r29[r26];\n r4 = r4.b;\n r5 = r29[r26];\n r5 = r5.c;\n r0 = r33;\n r1 = r34;\n r0.lsUpdateGroup(r1, r4, r5);\n L_0x004d:\n r26 = r26 + 1;\n goto L_0x0031;\n L_0x0050:\n r6 = r35 + -1;\n r10 = r38 + -1;\n r4 = r33;\n r5 = r34;\n r7 = r36;\n r8 = r37;\n r9 = r38;\n r25 = r4.trPartition(r5, r6, r7, r8, r9, r10);\n r0 = r25;\n r8 = r0.first;\n r0 = r25;\n r9 = r0.last;\n r0 = r37;\n if (r0 < r8) goto L_0x0072;\n L_0x006e:\n r0 = r38;\n if (r9 >= r0) goto L_0x016d;\n L_0x0072:\n r0 = r38;\n if (r8 >= r0) goto L_0x0087;\n L_0x0076:\n r17 = r37;\n r31 = r8 + -1;\n L_0x007a:\n r0 = r17;\n if (r0 >= r8) goto L_0x0087;\n L_0x007e:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x007a;\n L_0x0087:\n r0 = r38;\n if (r9 >= r0) goto L_0x009c;\n L_0x008b:\n r17 = r8;\n r31 = r9 + -1;\n L_0x008f:\n r0 = r17;\n if (r0 >= r9) goto L_0x009c;\n L_0x0093:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x008f;\n L_0x009c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = 0;\n r6 = 0;\n r4.<init>(r5, r8, r9, r6);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + -1;\n r6 = -2;\n r0 = r37;\n r1 = r38;\n r4.<init>(r5, r0, r1, r6);\n r29[r27] = r4;\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x0117;\n L_0x00bd:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x00e3;\n L_0x00c2:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r38 - r9;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r9, r1, r5);\n r29[r28] = r4;\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n L_0x00dd:\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x00e3:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x00f3;\n L_0x00e8:\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x00f3:\n if (r28 != 0) goto L_0x00fa;\n L_0x00f5:\n r27 = r28;\n r22 = r23;\n L_0x00f9:\n return;\n L_0x00fa:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x0117:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0138;\n L_0x011c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r8 - r37;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r37;\n r4.<init>(r0, r1, r8, r5);\n r29[r28] = r4;\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n goto L_0x00dd;\n L_0x0138:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0148;\n L_0x013d:\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x0148:\n if (r28 != 0) goto L_0x014f;\n L_0x014a:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x014f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x016d:\n r17 = r37;\n L_0x016f:\n r0 = r17;\n r1 = r38;\n if (r0 >= r1) goto L_0x017e;\n L_0x0175:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r17;\n r17 = r17 + 1;\n goto L_0x016f;\n L_0x017e:\n if (r28 != 0) goto L_0x0186;\n L_0x0180:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0186:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x01a4:\n r4 = -2;\n r0 = r23;\n if (r0 != r4) goto L_0x01ea;\n L_0x01a9:\n r27 = r28 + -1;\n r4 = r29[r27];\n r8 = r4.b;\n r4 = r29[r27];\n r9 = r4.c;\n r11 = r35 - r34;\n r4 = r33;\n r5 = r34;\n r6 = r36;\n r7 = r37;\n r10 = r38;\n r4.trCopy(r5, r6, r7, r8, r9, r10, r11);\n if (r27 != 0) goto L_0x01c8;\n L_0x01c4:\n r22 = r23;\n goto L_0x00f9;\n L_0x01c8:\n r27 = r27 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x01ea:\n r4 = r16[r37];\n if (r4 < 0) goto L_0x0202;\n L_0x01ee:\n r8 = r37;\n L_0x01f0:\n r4 = r16[r8];\n r4 = r4 + r34;\n r16[r4] = r8;\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0200;\n L_0x01fc:\n r4 = r16[r8];\n if (r4 >= 0) goto L_0x01f0;\n L_0x0200:\n r37 = r8;\n L_0x0202:\n r0 = r37;\n r1 = r38;\n if (r0 >= r1) goto L_0x028c;\n L_0x0208:\n r8 = r37;\n L_0x020a:\n r4 = r16[r8];\n r4 = r4 ^ -1;\n r16[r8] = r4;\n r8 = r8 + 1;\n r4 = r16[r8];\n if (r4 < 0) goto L_0x020a;\n L_0x0216:\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r5 = r16[r8];\n r5 = r5 + r35;\n r5 = r16[r5];\n if (r4 == r5) goto L_0x0241;\n L_0x0224:\n r4 = r8 - r37;\n r4 = r4 + 1;\n r24 = trLog(r4);\n L_0x022c:\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0244;\n L_0x0232:\n r9 = r37;\n r31 = r8 + -1;\n L_0x0236:\n if (r9 >= r8) goto L_0x0244;\n L_0x0238:\n r4 = r16[r9];\n r4 = r4 + r34;\n r16[r4] = r31;\n r9 = r9 + 1;\n goto L_0x0236;\n L_0x0241:\n r24 = -1;\n goto L_0x022c;\n L_0x0244:\n r4 = r8 - r37;\n r5 = r38 - r8;\n if (r4 > r5) goto L_0x0264;\n L_0x024a:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = -3;\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r8, r1, r5);\n r29[r28] = r4;\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0264:\n r4 = 1;\n r5 = r38 - r8;\n if (r4 >= r5) goto L_0x0282;\n L_0x0269:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r37;\n r1 = r24;\n r4.<init>(r5, r0, r8, r1);\n r29[r28] = r4;\n r37 = r8;\n r22 = -3;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0282:\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x028c:\n if (r28 != 0) goto L_0x0294;\n L_0x028e:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0294:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x02b6:\n r4 = r38 - r37;\n r5 = 8;\n if (r4 > r5) goto L_0x02d5;\n L_0x02bc:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x02cc;\n L_0x02c8:\n r22 = r23;\n goto L_0x002f;\n L_0x02cc:\n r33.trInsertionSort(r34, r35, r36, r37, r38);\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x02d5:\n r22 = r23 + -1;\n if (r23 != 0) goto L_0x0331;\n L_0x02d9:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x02e5:\n r15 = r38 - r37;\n r10 = r33;\n r11 = r34;\n r12 = r35;\n r13 = r36;\n r14 = r37;\n r10.trHeapSort(r11, r12, r13, r14, r15);\n r8 = r38 + -1;\n L_0x02f6:\n r0 = r37;\n if (r0 >= r8) goto L_0x032b;\n L_0x02fa:\n r4 = r16[r8];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r9 = r8 + -1;\n L_0x030a:\n r0 = r37;\n if (r0 > r9) goto L_0x0329;\n L_0x030e:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r4 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n if (r4 != r0) goto L_0x0329;\n L_0x0320:\n r4 = r16[r9];\n r4 = r4 ^ -1;\n r16[r9] = r4;\n r9 = r9 + -1;\n goto L_0x030a;\n L_0x0329:\n r8 = r9;\n goto L_0x02f6;\n L_0x032b:\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x0331:\n r8 = r33.trPivot(r34, r35, r36, r37, r38);\n r0 = r16;\n r1 = r37;\n r2 = r16;\n swapElements(r0, r1, r2, r8);\n r4 = r16[r37];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r31 = r0.trGetC(r1, r2, r3, r4);\n r9 = r37 + 1;\n L_0x034e:\n r0 = r38;\n if (r9 >= r0) goto L_0x0369;\n L_0x0352:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0369;\n L_0x0366:\n r9 = r9 + 1;\n goto L_0x034e;\n L_0x0369:\n r8 = r9;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x036e:\n r0 = r32;\n r1 = r31;\n if (r0 >= r1) goto L_0x039e;\n L_0x0374:\n r9 = r9 + 1;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x037a:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x039e;\n L_0x038e:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0374;\n L_0x0394:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0374;\n L_0x039e:\n r17 = r38 + -1;\n L_0x03a0:\n r0 = r17;\n if (r9 >= r0) goto L_0x03bb;\n L_0x03a4:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03bb;\n L_0x03b8:\n r17 = r17 + -1;\n goto L_0x03a0;\n L_0x03bb:\n r18 = r17;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03c1:\n r0 = r32;\n r1 = r31;\n if (r0 <= r1) goto L_0x03f5;\n L_0x03c7:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03cd:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x03e1:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03c7;\n L_0x03e7:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x03c7;\n L_0x03f5:\n r0 = r17;\n if (r9 >= r0) goto L_0x045a;\n L_0x03f9:\n r0 = r16;\n r1 = r16;\n r2 = r17;\n swapElements(r0, r9, r1, r2);\n L_0x0402:\n r9 = r9 + 1;\n r0 = r17;\n if (r9 >= r0) goto L_0x042c;\n L_0x0408:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x042c;\n L_0x041c:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0402;\n L_0x0422:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0402;\n L_0x042c:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x0432:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x0446:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x042c;\n L_0x044c:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x042c;\n L_0x045a:\n r0 = r18;\n if (r8 > r0) goto L_0x0716;\n L_0x045e:\n r17 = r9 + -1;\n r26 = r8 - r37;\n r30 = r9 - r8;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x046c;\n L_0x046a:\n r26 = r30;\n L_0x046c:\n r19 = r37;\n r21 = r9 - r26;\n L_0x0470:\n if (r26 <= 0) goto L_0x0484;\n L_0x0472:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0470;\n L_0x0484:\n r26 = r18 - r17;\n r4 = r38 - r18;\n r30 = r4 + -1;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x0492;\n L_0x0490:\n r26 = r30;\n L_0x0492:\n r19 = r9;\n r21 = r38 - r26;\n L_0x0496:\n if (r26 <= 0) goto L_0x04aa;\n L_0x0498:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0496;\n L_0x04aa:\n r4 = r9 - r8;\n r8 = r37 + r4;\n r4 = r18 - r17;\n r9 = r38 - r4;\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r0 = r31;\n if (r4 == r0) goto L_0x04d3;\n L_0x04bc:\n r4 = r9 - r8;\n r24 = trLog(r4);\n L_0x04c2:\n r17 = r37;\n r31 = r8 + -1;\n L_0x04c6:\n r0 = r17;\n if (r0 >= r8) goto L_0x04d6;\n L_0x04ca:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04c6;\n L_0x04d3:\n r24 = -1;\n goto L_0x04c2;\n L_0x04d6:\n r0 = r38;\n if (r9 >= r0) goto L_0x04eb;\n L_0x04da:\n r17 = r8;\n r31 = r9 + -1;\n L_0x04de:\n r0 = r17;\n if (r0 >= r9) goto L_0x04eb;\n L_0x04e2:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04de;\n L_0x04eb:\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x060c;\n L_0x04f1:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x0571;\n L_0x04f7:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x051e;\n L_0x04fc:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x051e:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0538;\n L_0x0523:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0538:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0549;\n L_0x053d:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0549:\n if (r28 != 0) goto L_0x054f;\n L_0x054b:\n r27 = r28;\n goto L_0x00f9;\n L_0x054f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0571:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x05c6;\n L_0x0577:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x059e;\n L_0x057c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x059e:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05c0;\n L_0x05a3:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x05c0:\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x05c6:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05f5;\n L_0x05cb:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x05f5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x060c:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x067b;\n L_0x0612:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0639;\n L_0x0617:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x0639:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0653;\n L_0x063e:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0653:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0664;\n L_0x0658:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0664:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r38;\n r3 = r22;\n r4.<init>(r0, r1, r2, r3);\n r29[r28] = r4;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x067b:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x06d0;\n L_0x0681:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x06a8;\n L_0x0686:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x06a8:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ca;\n L_0x06ad:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x06ca:\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x06d0:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ff;\n L_0x06d5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x06ff:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0716:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x0722:\n r22 = r22 + 1;\n r35 = r35 + 1;\n r23 = r22;\n goto L_0x001a;\n L_0x072a:\n r27 = r28;\n goto L_0x00f9;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.netty.handler.codec.compression.Bzip2DivSufSort.trIntroSort(int, int, int, int, int, io.netty.handler.codec.compression.Bzip2DivSufSort$TRBudget, int):void\");\n }", "private void quicksortSeq(Comparable[] array, int low, int up){\r\n\t\tif(low < up){\r\n\t\t\trekursionsSchritte += 2;\r\n\t\t\tint p = findPiv(array, low, up);\r\n\t\t\tquicksortSeq(array, low, p);\r\n\t\t\tquicksortSeq(array, p + 1, up);\r\n\t\t}\r\n\t}", "public static void sort(Comparable[] pq) {\n int n = pq.length;\n \n /*\n * Fill in this method! Use the code on p. 324 of the book as a model,\n * but change it so each node in the heap has 3 children instead of 2.\n */\n }", "private void quickSort(Node state, ArrayList<Move> A, int p, int r, boolean isAscending) {\n\t\tif (p < r) {\n\t\t\tint q = this.partition(state, A, p, r, isAscending);\n\t\t\tthis.quickSort(state, A, p, q - 1, isAscending);\n\t\t\tthis.quickSort(state, A, q + 1, r, isAscending);\n\t\t}\n\t}", "private void quickSort(List<T> array, int startIndex, int endIndex, FuncInterface<T> ICompare)\n {\n if (startIndex < endIndex)\n {\n // calculate the pivotIndex\n int pivotIndex = partition(array, startIndex, endIndex, ICompare);\n // quickSort the left sub-array\n quickSort(array, startIndex, pivotIndex, ICompare);\n // quickSort the right sub-array\n quickSort(array, pivotIndex + 1, endIndex, ICompare); \n }\n }", "private void rearrangeGeneric(){\n for (int i = rear; i > 0; i++) {\n if (arr1[i].compareTo(arr1[i-1]) == 1){\n /*\n In this if condition the crr is a calling object and the parameter passing into the\n compareTo method is argument methods\n\n --> compareTo() will return 1, if calling object is bigger then argument object\n --> compareTo() will return 0, if both objects are same\n --> compareTo() will return -1, if calling object is smaller then argument object\n */\n\n //Now perform swapping\n E temp = arr1[i];\n arr1[i] = arr1[i-1];\n arr1[i-1] = temp;\n }\n }\n }", "@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n List<SortBase<Integer>> list = Arrays.asList(new Select<>(), new Insert<>(), new Shell<>(), new MergeImpl2<>(), new Quick<>(),new HeapSort<>());\n for (SortBase<Integer> sort : list) {\n StdOut.print(sort.getClass().getSimpleName()+\"\\n\");\n sort.testCorrectness(new Integer[]{3, 2, 1, 5, 7, 8, 32, 12, 0, -4, -12});\n }\n }", "@Test\n public void testSort(){\n InsertionSort sort = new InsertionSort();\n int arr[] = sort.shellInsertionSort(initArr());\n scan(arr);\n }", "public static void main(String[] args) \n {\n Integer[] a = new Integer[5];\n a[0] = new Integer(2);\n a[1] = new Integer(1);\n a[2] = new Integer(4);\n a[3] = new Integer(3);\n a[4] = new Integer(-1);\n\t// T will be instantiated to Integer as a resutl of this call\n \n quickSort.sort(a);\n\n \n\t// Print the result after the sorting\n for (int i = 0; i < a.length; i++)\n {System.out.println(a[i].toString());}\n\n }", "private void quickSort(int start, int end) {\n\t\tint pivot, i, j;\n\t\tif (start < end) {\n\t\t\t// Select first element as Pivot\n\t\t\tpivot = start;\n\t\t\ti = start;\n\t\t\tj = end;\n\n\t\t\t// Base condition\n\t\t\twhile (i < j) {\n\t\t\t\t// increment i till found greater element than pivot\n\t\t\t\tfor (i = start; i <= end; i++) {\n\t\t\t\t\tif (data.get(i) > data.get(pivot)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// decrement j till found lesser element than pivot\n\t\t\t\tfor (j = end; j >= start; j--) {\n\t\t\t\t\tif (data.get(j) <= data.get(pivot)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// if i<j than swap\n\t\t\t\tif (i < j) {\n\t\t\t\t\tswap(i, j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// set pivot to jth element & move pivot to proper position\n\t\t\tswap(j, pivot);\n\n\t\t\t// Repeat for sub arrays\n\t\t\tquickSort(start, j - 1);\n\t\t\tquickSort(j + 1, end);\n\t\t}\n\t}", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\t@Override\n\tpublic void sort() {\n\t\t\n\t\t// create maxHeap\n\t\tHeap<E> maxHeap = new MaxHeap<E>(arr);\n\t\t\n\t\telapsedTime = System.nanoTime(); // get time of start\n\t\t\n\t\tfor (int i = length - 1; i > 0; i--) {\n\n\t\t\tmaxHeap.swap(arr, 0, i);\n\t\t\tmaxHeap.heapSize--;\n\t\t\t((MaxHeap) maxHeap).maxHeapify(arr, 0);\n\n\t\t}\n\t\t\n\t\telapsedTime = System.nanoTime() - elapsedTime; // get elapsed time\n\t\t\n\t\tprint(); // print sorted array\n\t\tprintElapsedTime(); // print elapsed time\n\t\t\n\t\t\n\t}", "void sortV();", "public static boolean testSort() {\r\n Manager inst;\r\n try {\r\n inst = new PokemonTable();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n LinkedList<Pokemon> list;\r\n list = inst.sortByAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() < list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() > list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() < list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() > list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).getFavorite() && list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getFavorite() && !list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() < list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() > list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).isLegendary() && list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).isLegendary() && !list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) > 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) < 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() < list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() > list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() < list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() > list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() < list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() > list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public static void main(String[] args) {\r\n\t\tint[] array = {9,4,8,2,1,5,7,6,3};\r\n\t\t\r\n\t\tSystem.out.println(\"Before sort: \" + Arrays.toString(array));\r\n\t\tSystem.out.println(\"Sorting...\"); System.out.println(\"After sort: \" +\r\n\t\tArrays.toString(quicksort(array, 0, array.length - 1)));\r\n\t}", "public static void shellSort(Comparable[] a) {\n int n = a.length;\n int h = 1;\n // Iteratively increase the stride h until the stride will at most sort 2 elements.\n while (h < n/3) h = 3*h + 1;\n while (h >= 1) {\n for (int i = 1; i < n; i += h) {\n for (int j = i; j > 0; j--) {\n if (less(a[j], a[j-1])) exch(a, j, j-1);\n else break;\n }\n }\n h /= 3;\n }\n\n }", "public static void main(String[] args) {\n\n\t\tMAV_QSort cQSort = new MAV_QSort();\n\t\tMAV_BSort cBSort = new MAV_BSort();\n\t\t\n\t\t// Инициализируем массивы\n\t\tinitarray();\n\t\t// Стандартная сортировка массивов\n\t\tArrays.sort(aSort_ST);\n\t\tSystem.out.print(\"Пузырек: \");\n\t\tfor (int i = 0; i< aSort_Et.length; i++) System.out.print(aSort_B[i]+ \", \");\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.print(\"Quick : \");\n\t\tfor (int i = 0; i< aSort_Et.length; i++) System.out.print(aSort_Q[i]+ \", \");\n\t\t\n\t\t// Сортируем массив по пузырьку\n\t\tcBSort.make_BSort(aSort_B);\n\t\t\n\t\t// Выводим результаты сортировки\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"Результаты сортировки\");\n\t\tSystem.out.print(\"Пузырек рез: \");\n\t\tfor (int i = 0; i< aSort_Et.length; i++) System.out.print(aSort_B[i]+ \", \");\n\t\tcQSort.make_QSort(aSort_Q);\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.print(\"Quick рез : \");\n\t\tfor (int i = 0; i< aSort_Et.length; i++) System.out.print(aSort_Q[i]+ \", \");\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"Равенство массивов сортировки пузырьком и быстрой сортировки:\"+Arrays.equals(aSort_B, aSort_Q));\n\t\tSystem.out.println(\"Равенство массивов стандарной сортировки и быстрой сортировки:\"+Arrays.equals(aSort_ST, aSort_Q));\n\n\t}", "private static void quickSort(double arr[],Integer[] pageIDS, int low, int high)\n {\n if (low < high)\n {\n /* pi is partitioning index, arr[pi] is\n now at right place */\n int pi = partition(arr,pageIDS, low, high);\n\n // Recursively sort elements before\n // partition and after partition\n quickSort(arr, pageIDS, low, pi-1);\n quickSort(arr, pageIDS,pi+1, high);\n }\n }", "public static void main(String args[])\r\n {\r\n JavaSort ob = new JavaSort();\r\n \r\n CatalogueItem arr[] = {\r\n new CatalogueItem( 3, \"Life of Pi\",\"Books\"),\r\n new CatalogueItem( 7, \"Deelongie 4 way toaster\",\"Home and Kitchen\"),\r\n new CatalogueItem( 2, \"Glorbarl knife set\",\"Home and Kitchen\"),\r\n new CatalogueItem( 4, \"Diesorn vacuum cleaner\",\"Appliances\"),\r\n new CatalogueItem( 5, \"Jennie Olivier sauce pan\",\"Home and Kitchen\"),\r\n new CatalogueItem( 6, \"This book will save your life\",\"Books\"),\r\n new CatalogueItem( 9, \"Kemwould hand mixer\",\"Appliances\"),\r\n new CatalogueItem( 1, \"Java for Dummies\",\"Books\"),\r\n };\r\n System.out.println(\"The Unsorted array is\");\r\n ob.printArray(arr);\r\n\r\n /*\r\n //apply sort\r\n ob.doOptimisedBubbleSort(arr);\r\n System.out.println(\"The array sorted by category using Java built in sort is\");\r\n ob.printArray(arr);\r\n */\r\n\r\n sort(arr);\r\n System.out.println(\"The array sorted by category using Java built in sort is\");\r\n ob.printArray(arr);\r\n\r\n System.out.println(\"The algorithm that is most efficient is the Java built in sort.\\n\\n\" +\r\n \"It uses Timsort, which has on average is the same level of time complexity\\n\" +\r\n \"as Quicksort - O(n log(n)). But Timsort is better at it's best and worst\\n\" +\r\n \"when compared with Quicksort.\\n\\n\" +\r\n \"Quicksort best = O(n log(n)) worst = O(n^2)\\n\" +\r\n \"Timsort best = O(n) worst = O(n log(n))\\n\" +\r\n \"\\n\" +\r\n \"This means at it's best, Timsort will only have to traverse the array 'n' times, to sort.\\n\" +\r\n \"And Quicksort at it's worst will have to check an array length squared amount of elements.\\n\");\r\n\r\n }", "public void sortByQnNum() {\r\n\t\tfor (int j = 0; j < displayingList.size() - 1; j++) {\r\n\t\t\tfor (int i = 0; i < displayingList.size() - j - 1; i++) {\r\n\t\t\t\tif (displayingList.get(i).getQnNum() > displayingList.get(i + 1).getQnNum()) {\r\n\t\t\t\t\tswapPosition(displayingList, i, i + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static <T extends Comparable<T>> void quicksort(T v[], int left, int right) {\n if(left<right){\n int indexP = partition(v,left,right);\n quicksort(v, left, indexP - 1);\n quicksort(v, indexP + 1, right );\n\n }\n\n }", "public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}", "public static void main(String[] args) {\n\t\t\t\r\n\t\tQuickSort q = new QuickSort(); \r\n\t\tif(q.input == null || q.length==0){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tq.quickSort(0, q.length-1);\r\n\t\tfor(int i=0; i<q.length;i++)\r\n\t\t\tSystem.out.println(q.input[i]);\r\n\t}", "private void checkSorting()\n {\n long parentChangeCounter = this.parent.getChangeCount();\n if (this.sortedRecords == null || this.changeCounter != parentChangeCounter)\n {\n long start = System.currentTimeMillis();\n \n // perform sort\n this.sortedRecords = this.parent.cloneRecordList();\n Collections.sort(this.sortedRecords, this);\n \n // recalculate selected index\n recalculateSelectedIndex();\n\n this.changeCounter = parentChangeCounter;\n \n if (logger.isDebugEnabled())\n logger.debug(this.recordCount()+\" records sorted in \"+(System.currentTimeMillis()-start)+ \"ms (selectedIndex=\"+getSelectedRecordIndex()+\")\");\n }\n }", "protected void quickSort(Vector v, int lo0, int hi0) {\r\n\tint lo = lo0;\r\n\tint hi = hi0;\r\n\tTypedFile mid;\r\n\r\n\tif ( hi0 > lo0)\r\n\t{\r\n\r\n\t /* Arbitrarily establishing partition element as the midpoint of\r\n\t * the array.\r\n\t */\r\n\t mid = (TypedFile) v.elementAt(( lo0 + hi0 ) / 2);\r\n\r\n\t // loop through the array until indices cross\r\n\t while( lo <= hi )\r\n\t {\r\n\t\t/* find the first element that is greater than or equal to \r\n\t\t * the partition element starting from the left Index.\r\n\t\t */\r\n\t\t// Nasty to have to cast here. Would it be quicker\r\n\t\t// to copy the vectors into arrays and sort the arrays?\r\n\t\twhile( ( lo < hi0 ) && lt( (TypedFile)v.elementAt(lo), mid ) )\r\n\t\t ++lo;\r\n\r\n\t\t /* find an element that is smaller than or equal to \r\n\t\t * the partition element starting from the right Index.\r\n\t\t */\r\n\t\twhile( ( hi > lo0 ) && lt( mid, (TypedFile)v.elementAt(hi) ) )\r\n\t\t --hi;\r\n\r\n\t\t // if the indexes have not crossed, swap\r\n\t\tif( lo <= hi ) \r\n\t\t{\r\n\t\t swap(v, lo, hi);\r\n\t\t ++lo;\r\n\t\t --hi;\r\n\t\t}\r\n\t }\r\n\r\n\t /* If the right index has not reached the left side of array\r\n\t\t * must now sort the left partition.\r\n\t\t */\r\n\t if( lo0 < hi )\r\n\t\tquickSort( v, lo0, hi );\r\n\r\n\t\t/* If the left index has not reached the right side of array\r\n\t\t * must now sort the right partition.\r\n\t\t */\r\n\t if( lo < hi0 )\r\n\t\tquickSort( v, lo, hi0 );\r\n\r\n\t}\r\n }", "public static void main(String[] args) {\n\n\t\tint[] a= {10,9,7,13,2,6,14,20};\n\t\tSystem.out.println(\"before sort\"+Arrays.toString(a));\n\t\tfor(int k=1;k<a.length;k++) {\n\t\t\tint temp=a[k];\n\t\t\tint j=k-1;\n\t\t\t\n\t\t\twhile(j>=0 && temp<=a[j]) {\n\t\t\t\ta[j+1]=a[j];\n\t\t\t\tj=j-1;\n\t\t\t}\n\t\t\ta[j+1]=temp;\n\t\t}\n\n\t\t\n\t\tSystem.out.println(\"After sort\"+Arrays.toString(a));\n\t\t\n\t\tSystem.out.println(\"print uing for loop\");\n\t\tfor(int i=0;i<a.length;i++) {\n\t\t\tSystem.out.print(a[i]+\"\");\n\t\t}\n\t}", "@Test\n public void heapSort(){\n int[] array = {3, 9, 6, 5, 2, 8, 7};\n SortTestHelper.testSort(new QuickSort(), array);\n SortTestHelper.print(array);\n }", "public static void main(String[] args) {\n\r\n\t\tint [] array1 = {3,2,5,0,1};\r\n\t\tint [] array2 = {8,10,7,6,4};\r\n\t\tint [] array3= new int[array1.length+array2.length];\r\n\t\t\r\n\t\tint i=0,j=0;\r\n\t\t\r\n\t\twhile(i<array1.length){\r\n\t\t\tarray3[i]=array1[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\t\r\n\t\twhile(j<array2.length){\r\n\t\t\tarray3[i]=array2[j];\r\n\t\t\ti++;\r\n\t\t\tj++;\r\n\t\t}\r\n\t\tQuickSort(array3,0,array3.length-1,false,false);\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tint[] a;\r\n\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.bubble(a);\r\n\r\n\t\tSystem.out.println(\"BubbleSort: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.selection(a);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nSelection: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.insertion(a);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nInsertion: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.mergeSort(a, 0, a.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nMerge: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.quickSort(a, 0, a.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nQuick: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.qs(a, 0, a.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nQuick1: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t}", "private void setup() {\r\n final int gsz = _g.getNumNodes();\r\n if (_k==2) {\r\n\t\t\tNodeComparator2 comp = new NodeComparator2();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t} else { // _k==1\r\n\t\t\tNodeComparator4 comp = new NodeComparator4();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t}\r\n for (int i=0; i<gsz; i++) {\r\n _origNodesq.add(_g.getNodeUnsynchronized(i)); // used to be _g.getNode(i)\r\n }\r\n _nodesq = new TreeSet(_origNodesq);\r\n //System.err.println(\"done sorting\");\r\n }", "@Test\n\tpublic void testSortRepeatableNumbers() {\n\t\tint[] arrayBeforeSort = { 104, 104, 0, 9, 56, 0, 9, 77, 88 };\n\t\tint[] arrayAfterSort = { 104, 104, 0, 9, 56, 0, 9, 77, 88 };\n\t\tArrayQuickSort.sort(arrayAfterSort);\n\t\tif (!isSorted(arrayBeforeSort, arrayAfterSort)) {\n\t\t\tAssert.fail(\"The array is not sorted!\");\n\t\t}\n\t}", "void _quickSort(Node l,Node h)\n {\n \tcompare++;\n if(h!=null && l!=h && l!=h.next){\n \tassign++;\n Node temp = partition(l,h);\n _quickSort(l,temp.prev);\n _quickSort(temp.next,h);\n }\n }", "private void quicksort(int inLow, int inHigh) {\n\t\tint i = inLow; int j = inHigh;\n\t\t//____| Get Pivot from middle.\n\t\tfloat pivot = gameObjectsList.get(inLow + (inHigh - inLow)/2).getX();\n\t\t//____| Divide List\n\t\twhile (i <= j){\n\t\t\twhile(gameObjectsList.get(i).getX() < pivot){\n\t\t\t\ti++;\n\t\t\t}\n\t\t\twhile(gameObjectsList.get(j).getX() > pivot){\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tif (i<=j){\n\t\t\t\tCollections.swap(gameObjectsList, i, j);\n\t\t\t\ti++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\tif (inLow < j)\n\t\t\tquicksort(inLow, j);\n\t\tif (i < inHigh)\n\t\t\tquicksort(i, inHigh);\n\t}" ]
[ "0.68036574", "0.65810513", "0.64433974", "0.62417257", "0.6134835", "0.61129475", "0.6111592", "0.6052337", "0.6051154", "0.5980836", "0.59052354", "0.5889425", "0.58788973", "0.5873926", "0.58627903", "0.58486074", "0.5750985", "0.5741541", "0.5737461", "0.57334065", "0.56917804", "0.56884897", "0.5662478", "0.5644569", "0.5635421", "0.56258035", "0.56197846", "0.5618777", "0.5598269", "0.55967474", "0.55954987", "0.55766314", "0.5563742", "0.55481297", "0.5545273", "0.5545091", "0.5541461", "0.5535459", "0.5524553", "0.55239326", "0.5512722", "0.5464438", "0.546304", "0.5461167", "0.54515004", "0.5451015", "0.5432793", "0.5423678", "0.5414146", "0.54125714", "0.5410424", "0.5399467", "0.53806925", "0.5380014", "0.53719825", "0.5369599", "0.5357914", "0.5338127", "0.5334476", "0.5332944", "0.5322564", "0.53134876", "0.53095746", "0.5302316", "0.5297918", "0.529435", "0.52666044", "0.52650446", "0.5263037", "0.52629143", "0.52617496", "0.52543855", "0.522725", "0.5226012", "0.5224113", "0.5220754", "0.52141494", "0.5211154", "0.52086306", "0.5205846", "0.51966345", "0.5193214", "0.518768", "0.51849824", "0.518486", "0.5172835", "0.5167186", "0.5165949", "0.5156055", "0.5141838", "0.5138717", "0.512471", "0.51052153", "0.51049346", "0.510404", "0.5103497", "0.5096155", "0.50935346", "0.50929505", "0.5088347", "0.5072786" ]
0.0
-1
Every time a comparison occurs, this method counts.
private void addComparison() { this.comparisonCounter++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void incrComparisons() { ++comparisons; }", "@Override\n public void sortAndCount() {\n Insertion.reset();\n Insertion.sort(arrayForTests);\n comp = Sort.getComparisonOperations(); // Sort.getComp();\n copy = Sort.getCopyOperations(); // Sort.getCopy();\n }", "public void can_counter()\n {\n candidate_count=0;\n for (HashMap.Entry<String,Candidate> set : allCandidates.entrySet())\n {\n candidate_count++;\n }\n }", "long getNumberOfComparisons();", "@Override\n\tpublic void count() {\n\t\t\n\t}", "public void count() {\n\t\talgae = -1;\n\t\tcrab = -1;\n\t\tbigFish = -1;\n\t\tfor(GameObjects o: objects) {\n\t\t\tswitch(o.toString()) {\n\t\t\tcase \"algae\":\n\t\t\t\talgae +=1;\n\t\t\t\tbreak;\n\t\t\tcase \"crab\":\n\t\t\t\tcrab +=1;\n\t\t\t\tbreak;\n\t\t\tcase \"big fish\":\n\t\t\t\tbigFish +=1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Override\n public long count();", "@Override\r\n\tpublic void iterateCount() {\n\t\t\r\n\t}", "private synchronized void incrementCount()\n\t{\n\t\tcount++;\n\t}", "void updateFrequencyCount() {\n //Always increments by 1 so there is no need for a parameter to specify a number\n this.count++;\n }", "@Override\n public int count() {\n return this.bench.size();\n }", "public void incrementCount() {\n\t\tcount++;\n\t}", "public void incrementNumCompareRequests() {\n this.numCompareRequests.incrementAndGet();\n }", "public boolean increaseCompares() {\r\n\t\tthis.compares++;\r\n\t\treturn true;\r\n\t}", "public void ball_counter()\n {\n ballot_count=0;\n for (HashMap.Entry<String,Ballot> set : allBallots.entrySet())\n {\n ballot_count++;\n }\n }", "@Override\npublic long count() {\n\treturn super.count();\n}", "public void incrementCount() {\n count++;\n }", "public long count() ;", "@Override\n public long count() {\n return super.doCountAll();\n }", "@Override\n public long count() {\n return super.doCountAll();\n }", "@Override\n public long count() {\n return super.doCountAll();\n }", "int getComparisons();", "public void incrementCount(){\n count+=1;\n }", "void incrementAddedCount() {\n addedCount.incrementAndGet();\n }", "public abstract long count();", "public void incCount() { }", "long count();", "long count();", "long count();", "long count();", "long count();", "long count();", "long count();", "private static void compareForIdenticalKeys() {\n Integer[] identical = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n\n Insertion insertion = new Insertion();\n insertion.analyzeSort(identical);\n insertion.getStat().printReport();\n\n Selection selection = new Selection();\n selection.analyzeSort(identical);\n selection.getStat().printReport();\n }", "public void addCount() {\n \t\tdupCount++;\n \t}", "boolean isCounting();", "public void addCount()\n {\n \tcount++;\n }", "public int compare(Object a, Object b) {\n if (a == b) {\n return 0;\n }\n CountedObject ca = (CountedObject)a;\n CountedObject cb = (CountedObject)b;\n int countA = ca.count;\n int countB = cb.count;\n if (countA < countB) {\n return 1;\n }\n if (countA > countB) {\n return -1;\n }\n return 0;\n }", "int getNumberOfDetectedDuplicates();", "private void compareDetected() {\n\t\tMap<Integer, Integer> shiftFreq = new HashMap<Integer, Integer>();\n\t\tfor (WordOccurence wordOcc : originalFreq.values()) {\n\t\t\twordOcc.calculateDifferences();\n\t\t\tif (!wordOcc.isValuesSet()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (shiftFreq.containsKey(wordOcc.getPossibleShift())) {\n\t\t\t\tshiftFreq.put(wordOcc.getPossibleShift(),\n\t\t\t\t\t\tshiftFreq.get(wordOcc.getPossibleShift()) + 1);\n\t\t\t} else {\n\t\t\t\tshiftFreq.put(wordOcc.getPossibleShift(), 1);\n\t\t\t}\n\t\t}\n\t\tshift = getMaxValuedKey(shiftFreq);\n\t}", "public void addOccurence() {\n\t\tcount = count + 1;\n\t}", "Object getNumberMatched();", "public int getComparisons(){\n return comparisons;\n }", "public void updateCounts() {\n\n Map<Feel, Integer> counts_of = new HashMap<>();\n\n for (Feel feeling : Feel.values()) {\n counts_of.put(feeling, 0);\n }\n\n for (FeelingRecord record : this.records) {\n counts_of.put(record.getFeeling(), counts_of.get(record.getFeeling()) + 1);\n }\n\n this.angry_count.setText(\"Anger: \" + counts_of.get(Feel.ANGER).toString());\n this.fear_count.setText(\"Fear: \" + counts_of.get(Feel.FEAR).toString());\n this.joyful_count.setText(\"Joy: \" + counts_of.get(Feel.JOY).toString());\n this.love_count.setText(\"Love: \" + counts_of.get(Feel.LOVE).toString());\n this.sad_count.setText(\"Sad:\" + counts_of.get(Feel.SADNESS).toString());\n this.suprise_count.setText(\"Suprise: \" + counts_of.get(Feel.SURPRISE).toString());\n }", "public void incrementNumCompareResponses(long j) {\n this.numCompareResponses.incrementAndGet();\n if (j > 0) {\n this.totalCompareResponseTime.addAndGet(j);\n }\n }", "public int check(){\r\n\r\n\treturn count ++;\r\n\t\r\n}", "void incCount() {\n ++refCount;\n }", "private void determineCounts( )\n {\n for( int r = 0; r < rows; r++ )\n {\n for( int c = 0; c < cols; c++ )\n {\n if( theMines[ r ][ c ] == 1 )\n theCounts[ r ] [ c ] = 9;\n else\n count( r, c );\n }\n }\n }", "protected long hit() {\n return numHits.incrementAndGet();\n }", "@Override\n public synchronized void increment() {\n count++;\n }", "private synchronized static void upCount() {\r\n\t\t++count;\r\n\t}", "void incrementCount();", "public long count() {\n/* 154 */ return this.count;\n/* */ }", "public boolean haveCount () ;", "static void compare()\n {\n \tif(a < c)\n\t\t {\n\t\t\t comp_one = 1; //store this value , else zero default \n\t\t }\n\t\t if(c < b)\n\t\t {\n\t\t\t comp_two = 2; //store this value , else zero default\n\t\t }\n\t\t if(b < a)\n\t\t {\n\t\t\t comp_thr = 5; //store this value , else zero default\n\t\t }\n\t\t \n\t\t comp_val = comp_one + comp_two + comp_thr; //create a unique value by addition\n }", "private void incrementCounter()\r\n\t{\r\n\t\tthis.counter++;\r\n\t}", "int updateCount(double dist);", "public void increaseNumHits() {\n\t\tthis.numHits += 1;\n\t}", "public int numberOfOccorrence();", "private int countOccurrence(Integer valueToCount) {\n int count = 0;\n\n for(Integer currentValue : list) {\n if (currentValue == valueToCount) {\n count++;\n }\n }\n\n return count;\n }", "@Override\r\n\tpublic long count() {\n\t\treturn 0;\r\n\t}", "public void increseHitCount() {\n\r\n\t}", "void reportCount(long ts, double factor) {\n\t\tthis.counter.reportCount(ts, factor);\n\t}", "private synchronized void increment() {\n ++count;\n }", "public void increaseCount(){\n myCount++;\n }", "@Override\n\t\t\tpublic int compare(Integer a, Integer b) {\n\t\t\t\treturn guessCount[a - 1] - guessCount[b - 1];\n\t\t\t}", "Integer count();", "Integer count();", "public int countByCopiedFrom(long copiedFrom);", "@Override\n\tpublic long count() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic long count() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic long count() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic long count() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic long count() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic long count() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic long count() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic long count() {\n\t\treturn 0;\n\t}", "public static int findNumberOfCreatedComputers() {\n return objCounter;\n }", "private int sizeForHashTable()\n {\n String compare=\"\";\n int numberOfdates = 0;\n for (int i=0; i <= hourly.size();i++)\n {\n if (i==0)\n {\n numberOfdates +=1;\n compare = data.get(i).getFCTTIME().getPretty();\n }else if(compare != data.get(i).getFCTTIME().getPretty())\n {\n numberOfdates+=1;\n compare = data.get(i).getFCTTIME().getPretty();\n }\n }\n return numberOfdates;\n }", "@Override\n\t\tpublic int hashCode() {\n\t\t\treturn countMap.hashCode();\n\t\t}", "@Override\n public int compare(Object arg0, Object arg1) {\n int a = arg0.hashCode();\n int b = arg1.hashCode();\n int accum;\n if (a == b) {\n accum = 0;\n } else if (a > b) {\n accum = 1;\n } else {\n accum = -1;\n }\n return accum;\n }", "public long count() { return count.get(); }", "private void countEquivalentDataPropertyAxiomsMetric() {\r\n\t\tint equivalentDataPropertyAxiomsCount = ontology.getAxiomCount(AxiomType.EQUIVALENT_DATA_PROPERTIES,\r\n\t\t\t\tOntologyUtility.ImportClosures(imports));\r\n\t\treturnObject.put(\"equivalentDataPropertiesAxioms\", equivalentDataPropertyAxiomsCount);\r\n\r\n\t}", "public int count();", "public int count();", "public int count();", "public int count();", "public abstract int count();", "public abstract int count();", "void assertTotalCntEquals(T key, int expected);", "int fillCount();", "public synchronized int getCountTwo() {\n return count.incrementAndGet();\n }", "public double trueCount() {\n\t\t\t\n\t\t\treturn (double)total_count/((double)size/52);\n\t\t}", "@Override\r\n\t\tpublic int count() {\n\t\t\treturn 0;\r\n\t\t}", "protected int hit() {\r\n\t\treturn hits;\r\n\t}", "public int getCompCount(){\n return this.compCount;\n }", "private static void setCounter() {++counter;}", "private void compareClassesHelper(List<Integer> arr1, List<Integer> arr2, User f) {\n Collections.sort(arr1);\n Collections.sort(arr2);\n for (int a : arr1) {\n for (int b : arr2) {\n if (a == b) {\n f.incrementCount(\"class\");\n }\n }\n }\n }", "@Override\n public int size() {\n int count = 0;\n for (Counter c : map.values())\n count += c.value();\n return count;\n }", "Long count();" ]
[ "0.72448516", "0.65932405", "0.6527721", "0.6450814", "0.62030077", "0.61891305", "0.6160498", "0.6095522", "0.6049962", "0.6044311", "0.60130566", "0.60046655", "0.6000956", "0.5998909", "0.5981718", "0.59799147", "0.5970694", "0.59680665", "0.5965138", "0.5965138", "0.5965138", "0.5956844", "0.59328765", "0.5931474", "0.5914613", "0.589362", "0.58890593", "0.58890593", "0.58890593", "0.58890593", "0.58890593", "0.58890593", "0.58890593", "0.58855265", "0.5884267", "0.58842605", "0.5872432", "0.58461994", "0.58365035", "0.5836228", "0.58273405", "0.58267385", "0.58204144", "0.58180714", "0.5811548", "0.5810242", "0.57982033", "0.5794975", "0.5788388", "0.5781133", "0.5765632", "0.57618403", "0.5744202", "0.5729887", "0.57255447", "0.5722777", "0.572053", "0.57185733", "0.5712219", "0.5712044", "0.5711266", "0.5666203", "0.56561923", "0.5654177", "0.5652702", "0.5644987", "0.5636424", "0.5636424", "0.56297755", "0.56297374", "0.56297374", "0.56297374", "0.56297374", "0.56297374", "0.56297374", "0.56297374", "0.56297374", "0.56253135", "0.56232154", "0.561964", "0.5618512", "0.5615683", "0.561152", "0.5610338", "0.5610338", "0.5610338", "0.5610338", "0.56085235", "0.56085235", "0.5598394", "0.55931157", "0.558616", "0.55838305", "0.556876", "0.55685526", "0.5565812", "0.5562246", "0.5549404", "0.5536731", "0.5536268" ]
0.7421077
0
Applies the BubbleSort algorithm to the specified range (start and stop)
public void bubbleSort(int start, int stop) { for (int n = stop; n > start + 1; n--) { for (int i = start; i < n; i++) { addComparison(); if (sequence[i] > sequence[i + 1]) { swapAt(i, i + 1); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void getBubbleSort(int range) {\n\n Integer[] number = GetRandomArray.getIntegerArray(range);\n\n //main cursor to run across array\n int pivot_main = 0;\n\n //secondary cursor to run of each index of array\n int pivot_check = 0;\n\n //variable to hold current check number\n int check_num = 0;\n\n //run loop for array length time\n for (int i = number.length; i > 0; i--) {\n\n //set cursor to first number\n pivot_main = number[0];\n\n //loop size decreases with main loop (i - 1234 | j - 4321)\n for (int j = 0; j < i - 1; j++) {\n\n //set cursor to next number in loop\n pivot_check = j + 1;\n\n //get number at above cursor\n check_num = number[j + 1];\n\n //check if number at current cursor is less than number at main cursor\n if (check_num < pivot_main) {\n //swap there position\n number[pivot_check] = pivot_main;\n number[j] = check_num;\n }\n\n //check if number at current cursor is greater than number at main cursor\n if (check_num > pivot_main) {\n //transfer current number to main cursor\n pivot_main = check_num;\n }\n }\n System.out.println(Arrays.toString(number));\n }\n }", "private void sort(int start, int stop) {\n\t\taddComparison();\n\t\tif (start > stop) {\n\t\t\treturn;\n\t\t}\n\t\taddComparison();\n\t\tif (stop - start < b) {\n\t\t\tbubbleSort(start, stop);\n\t\t} else {\n\t\t\tint pivotIndex = start + (int) ((stop - start) * Math.random());\n\t\t\tfloat pivot = sequence[pivotIndex];\n\t\t\tint left = start;\n\t\t\tint right = stop;\n\t\t\twhile (left <= right) {\n\t\t\t\taddComparison();\n\t\t\t\twhile (sequence[left] < pivot) {\n\t\t\t\t\tleft++;\n\t\t\t\t\taddComparison();\n\t\t\t\t}\n\t\t\t\taddComparison();\n\t\t\t\twhile (sequence[right] > pivot) {\n\t\t\t\t\tright--;\n\t\t\t\t\taddComparison();\n\t\t\t\t}\n\t\t\t\taddComparison();\n\t\t\t\tif (left <= right) {\n\t\t\t\t\tswapAt(left, right);\n\t\t\t\t\tleft++;\n\t\t\t\t\tright--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsort(start, right);\n\t\t\tsort(left, stop);\n\t\t}\n\t}", "void binarysort(int lo, int hi, int start) {\n //debug(\"binarysort: lo:\" + lo + \" hi:\" + hi + \" start:\" + start);\n int p;\n \n //assert_(lo <= start && start <= hi);\n /* assert [lo, start) is sorted */\n if (lo == start)\n ++start;\n for (; start < hi; ++start) {\n /* set l to where *start belongs */\n int l = lo;\n int r = start;\n PyObject pivot = this.data[r];\n // Invariants:\n // pivot >= all in [lo, l).\n // pivot < all in [r, start).\n // The second is vacuously true at the start.\n //assert_(l < r);\n do {\n p = l + ((r - l) >> 1);\n if (iflt(pivot, this.data[p]))\n r = p;\n else\n l = p+1;\n } while (l < r);\n //assert_(l == r);\n // The invariants still hold, so pivot >= all in [lo, l) and\n // pivot < all in [l, start), so pivot belongs at l. Note\n // that if there are elements equal to pivot, l points to the\n // first slot after them -- that's why this sort is stable.\n // Slide over to make room.\n for (p = start; p > l; --p)\n this.data[p] = this.data[p - 1];\n this.data[l] = pivot;\n }\n //dump_data(\"binsort\", lo, hi - lo);\n }", "public static void getBubbleSortwithoutOutput(int range) {\n\n Integer[] number = GetRandomArray.getIntegerArray(range);\n\n //pivot to indicate current cursor\n int pivot = 0;\n\n //get initial value of array to start\n int init = number[pivot];\n\n //first and last element of array\n int last = 0, first = 0;\n\n //length of array\n int array_lenght = number.length - 1;\n\n for (int i = 0; i < number.length; i++) {\n\n //get last number of modified array\n last = number[number.length - 1];\n\n //get first number of modified array\n first = number[0];\n\n //increase pivot by 1\n pivot = pivot + 1;\n\n //if current number is is greater than next right to it\n if (init > number[pivot]) {\n\n //swap number\n number[i] = number[pivot];\n number[pivot] = init;\n\n //set pivot to 0,init to first number,i to less than 0, if its length is equal to array size\n if (pivot == array_lenght) {\n init = first;\n pivot = 0;\n i = -1;\n }\n }\n\n //if current number is is less than next right to it\n if (init < number[pivot]) {\n //do nothing and set current number as pivot\n init = number[pivot];\n }\n\n //if init number is equal last number of array\n if (init == last) {\n\n //set pivot to 0,init to first number,i to less than 0, if its length is equal to array size\n init = first;\n pivot = 0;\n i = -1;\n }\n System.out.println(Arrays.toString(number));\n }\n }", "public void bubbleSort() {\n\t\tint n = data.size();\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tfor (int j = 1; j < n - i; j++) {\n\t\t\t\tif (data.get(j - 1) > data.get(j)) {\n\t\t\t\t\tswap(j, j - 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "private void sort(int[] array, int start, int end){\n //base condition\n if(start >= end)\n return;\n int boundary = partition(array, start, end);\n sort(array, start, boundary - 1);\n sort(array, boundary + 1, end);\n }", "public void bubbleSort(long [] a){\n\t\tint upperBound=a.length-1;\n\t\tint lowerBound =0;\n\t\tint swaps=0;\n\t\tint iterations=0;\n\t\twhile(upperBound>=lowerBound){\n\t\t\tfor(int i=0,j=1;i<=upperBound && j<=upperBound; j++,i++){\n\t\t\t\tlong lowerOrderElement = a[i];\n\t\t\t\tlong upperOrderElement = a[j];\n\t\t\t\titerations++;\n\t\t\t\tif(lowerOrderElement>upperOrderElement){ //swap positions\n\t\t\t\t\ta[i] = a[j];\n\t\t\t\t\ta[j]= lowerOrderElement;\n\t\t\t\t\tswaps=swaps+1;\n\t\t\t\t}\n\t\t\t\telse{ // sorted.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tupperBound--;\n//\t\tSystem.out.println(\"upperBound:- \" +upperBound);\n//\t\tSystem.out.println(\"lowerBound:- \" +lowerBound);\n\t\t}displayArr(a);\n\t\t\n\t\tSystem.out.println(\"Total Swaps:- \" + swaps);\n\t\tSystem.out.println(\"Total Iterations:- \" + iterations);\n\t}", "public void bubbleSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2; //init, check condition\r\n\t\tfor (int i = list.size() - 1; i >= 0; i --){\r\n\t\t\tsteps += 2; //init, check condition\r\n\t\t\tfor (int j = 0; j < i ; j ++){\r\n\t\t\t\tsteps += 5;\r\n\t\t\t\tif (list.get(j).compareTo(list.get(j + 1)) < 0){\r\n\t\t\t\t\tsteps += 2;\r\n\t\t\t\t\tswap(list, j, j + 1);\r\n\t\t\t\t\tsteps += 5;\r\n\t\t\t\t}\r\n\t\t\t\tsteps += 2;\r\n\t\t\t}\r\n\t\t\tsteps += 2;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Bubble Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "public static void BubbleSort(int[] input) {\r\n for (int i = input.length - 1; i > 0; i--) {\r\n for (int j = 0; j < i; i++) {\r\n if (input[j] > input[j + 1]) {\r\n swap(input, j, j + 1);\r\n }\r\n }\r\n }\r\n }", "public static void BubbleSort(int[] a) {\n\t int n = a.length;\n\t int temp = 0;\n\n\t for(int i = 0; i < n; i++) {\n\t for(int j=1; j < (n-i); j++) {\n\t if(a[j-1] > a[j]) {\n\t temp = a[j-1];\n\t a[j-1] = a[j];\n\t a[j] = temp;\n\t }\n\t }\n\t }\n\t}", "public ListUtilities bubbleSort(){\n\t\tboolean swaps = true;\t\t\n\t\t\n\t\twhile(swaps == true){\n\t\t\t//no swaps to begin with\n\t\t\tswaps = false;\n\n\t\t\t//if not end of list\n\t\t\tif (this.nextNum != null){\n\t\t\t\tListUtilities temp = new ListUtilities();\n\t\t\t\t//make temp point to 2\n\t\t\t\ttemp = this.nextNum;\n\t\t\t\t//if 1 is greater than 2\n\t\t\t\tif(this.num > this.nextNum.num){\n\t\t\t\t\t//it swapped\n\t\t\t\t\tswaps = true;\n\t\t\t\t\tswapF(temp);\n\t\t\t\t}\n\n\t\t\t//keep going until you hit end of list\n\t\t\ttemp.bubbleSort();\n\t\t\t} \n\n\t\t\t//if at end of list and swaps were made, return to beginning and try again\n\t\t\tif (this.nextNum == null && swaps == true){\n\n\t\t\t\tthis.returnToStart().bubbleSort();\n\t\t\t}\n\t\t}\n\t//return beginning of list\n\treturn this.returnToStart();\n\t}", "private void bInsertionSort(int lowerIndex, int higherIndex) {\n \t\tArrayList tmpsorted = new ArrayList();\n \t\tint tmp, lowerbound, upperbound;\n \t\t\n \t\tfor(int i = lowerIndex; i <= higherIndex; i++) {\n \t\t\ttmp = (int) unsorted.get(i);\n \t\t\tif(tmpsorted.isEmpty()) {\n \t\t\t\ttmpsorted.add(tmp);\n \t\t\t} else {\n \t\t\t\t\n \t\t\t\t//Every new number we want to insert needs\n \t\t\t\t//to reset the bounds according to the sorted list.\n \t\t\t\tupperbound = tmpsorted.size() - 1;\n \t\t\t\tlowerbound = 0;\n \t\t\t\t\n \t\t\t\twhile (unsorted.size() != 0){\n \t\t\t\t//Note that each \"break;\" throws us out of the while loop.\n \t\t\t\t//Causing our boundaries to be reset for the new number\n \t\t\t\t\t\n \t\t\t\t\tint j = (upperbound + lowerbound) / 2;\t//j points to the middle of the boundaries\n \t\t\t\t\tif (tmp <= (int)tmpsorted.get(j)){\t//is tmp less or equal to the number in j?\n \t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\tif (j == 0){\t\t\t\t\t\t//Are we at the bottom of the list?\n \t\t\t\t\t\t\ttmpsorted.add(0, tmp);\t\t//Add it to the bottom of the list.\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse if ((int)tmpsorted.get(j-1) > tmp){ \n \t\t\t\t\t\t//Else if the number behind j is bigger than tmp...\n \t\t\t\t\t\t//...we can move the upper bound behind j and repeat the split.\n \t\t\t\t\t\t//NOTE: We do NOT \"break;\" to get thrown out of the while loop.\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tupperbound = j - 1;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse{ //Else we just add the number to j\n \t\t\t\t\t\t\ttmpsorted.add(j, tmp);\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\t\n \t\t\t\t\telse{ //If tmp is HIGHER than j\n \t\t\t\t\t\tif (j == tmpsorted.size() - 1){\n \t\t\t\t\t\t//Are we at the end of the list?\n \t\t\t\t\t\t//Just add tmp at the end of the list.\t\n \t\t\t\t\t\t\ttmpsorted.add(j+1, tmp);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse if((int)tmpsorted.get(j+1) < tmp){\n \t\t\t\t\t\t//if the next number to j is still less than tmp...\n \t\t\t\t\t\t//we raise the lowerbound past j and repeat the split\n \t\t\t\t\t\t//NOTE: We do NOT \"break;\" to get thrown out of the while loop.\n \t\t\t\t\t\t\tlowerbound = j + 1;\n \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//Else we can just add tmp after j since it's higher than j\n \t\t\t\t\t\t\ttmpsorted.add(j+1, tmp);\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\t\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n \t\t}\n \t\t// Replace the unsorted values with tmpsorted.\n \t\tint j = 0;\n \t\tfor(int i = lowerIndex; i <= higherIndex; i++) {\n \t\t\tunsorted.set(i, tmpsorted.get(j));\n \t\t\tj++;\n \t\t}\n\n \t}", "private void reverse(int[] nums, int start, int end) {\n\t\twhile(start<end)\n\t\t{\n\t\t\tswap(nums,start++,end--);\n\t\t}\n\t}", "public void setBubbleSort() \n\t{\n\t\tint last = recordCount + NOT_FOUND; //array.length() - 1\n\n\t\twhile(last > RESET_VALUE) //last > 0\n\t\t{\n\t\t\tint localIndex = RESET_VALUE; \n\t\t\tboolean swap = false;\n\n\t\t\twhile(localIndex < last) \n\t\t\t{\n\t\t\t\tif(itemIDs[localIndex] > itemIDs[localIndex + 1]) \n\t\t\t\t{\n\t\t\t\t\tsetSwapArrayElements(localIndex);\n\t\t\t\t\tswap = true;\n\t\t\t\t}\n\t\t\t\tlocalIndex++;\n\t\t\t}\n\n\t\t\tif(swap == false) \n\t\t\t{\n\t\t\t\tlast = RESET_VALUE;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tlast = last + NOT_FOUND;\n\t\t\t}\n\n\t\t}//END while(last > RESET_VALUE)\n\t\treturn;\n\t}", "static void BubbleSort(int[] arr){\n for(int i = 0; i< arr.length-1;i++){\n int numberOfSwaps = 0;\n for(int j = 0; j<arr.length-i-1;j++){\n if(arr[j]>arr[j+1]){\n Swap(arr, j, j+1);\n numberOfSwaps++;\n }\n }\n if(numberOfSwaps == 0){\n break;\n }\n }\n }", "private void quickSort(int start, int end) {\n\t\tint pivot, i, j;\n\t\tif (start < end) {\n\t\t\t// Select first element as Pivot\n\t\t\tpivot = start;\n\t\t\ti = start;\n\t\t\tj = end;\n\n\t\t\t// Base condition\n\t\t\twhile (i < j) {\n\t\t\t\t// increment i till found greater element than pivot\n\t\t\t\tfor (i = start; i <= end; i++) {\n\t\t\t\t\tif (data.get(i) > data.get(pivot)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// decrement j till found lesser element than pivot\n\t\t\t\tfor (j = end; j >= start; j--) {\n\t\t\t\t\tif (data.get(j) <= data.get(pivot)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// if i<j than swap\n\t\t\t\tif (i < j) {\n\t\t\t\t\tswap(i, j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// set pivot to jth element & move pivot to proper position\n\t\t\tswap(j, pivot);\n\n\t\t\t// Repeat for sub arrays\n\t\t\tquickSort(start, j - 1);\n\t\t\tquickSort(j + 1, end);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tBubbleSort bs = new BubbleSort();\n\t\tint[] arr = {9, 1, 5, 8, 3, 7, 6, 4, 2};\n//\t\tint[] arr = {2, 1, 3, 4, 5, 6, 7, 8, 9};\n\t\t\n//\t\tbs.bubbleSort0(arr);\n//\t\tbs.bubbleSortNormal(arr);\n\t\tbs.bubbleSortImporve(arr);\n\t\t\n\t}", "public BubbleSort(){\r\n super();\r\n }", "public void go(int boundary) {\n\t\tthis.b = boundary;\n\t\tSystem.out.println(\"Start QuickSort ...\");\n\t\tthis.startTime = new Date().getTime();\n\t\tsort(0, sequence.length - 1);\n\t\tthis.endTime = new Date().getTime();\n\t}", "private void recMergeSort(final long[] workSpace, final int lowerBound,\n final int upperBound) {\n if (lowerBound == upperBound) // if range is 1,\n return; // no use sorting\n else { // find midpoint\n final int mid = (lowerBound + upperBound) / 2;\n // sort low half\n recMergeSort(workSpace, lowerBound, mid);\n // sort high half\n recMergeSort(workSpace, mid + 1, upperBound);\n // merge them\n merge(workSpace, lowerBound, mid + 1, upperBound);\n } // end else\n }", "public static void sort(int inputArray[], int start, int end) {\n if (end <= start) {\n return;\n }\n\n // Cut current window in half\n int mid = (start + end) / 2;\n\n // sort on new left array\n sort(inputArray, start, mid);\n // sort on new right array\n sort(inputArray, mid + 1, end);\n\n // merge left and right\n merge(inputArray, start, mid, end);\n }", "public static void bubbleSort(String [] list1)\r\n\t{\r\n\t\t\r\n\t String temp;\r\n\t int swap=1000;\r\n\t while(swap>0) \r\n\t {\r\n\t \tswap=0;\r\n\t \tfor(int outside=0; outside<list1.length-1; outside++)\r\n\t \t{\r\n\t \t\tif(list1[outside+1].compareTo(list1[outside])<0)\r\n\t \t\t{\r\n\t \t\t\tswap++;\r\n\t \t\t\ttemp=list1[outside];\r\n\t \t\t\tlist1[outside]=list1[outside+1];\r\n\t \t\t\tlist1[outside+1]=temp;\r\n\t \t\t}\r\n\t \t}\r\n\t }\r\n\t \r\n\t}", "public void bubbleSort(ArrayList <Integer> list){\n System.out.println();\n System.out.println(\"Bubble Sort\");\n System.out.println();\n\n steps = 0;\n for (int outer = 0; outer < list.size() - 1; outer++){\n for (int inner = 0; inner < list.size()-outer-1; inner++){\n steps += 3;//count one compare and 2 gets\n if (list.get(inner)>(list.get(inner + 1))){\n steps += 4;//count 2 gets and 2 sets\n int temp = list.get(inner);\n list.set(inner,list.get(inner + 1));\n list.set(inner + 1,temp);\n }\n }\n }\n }", "public static void sort(int[] array, int from, int to) {\n int size = to - from + 1;\n int mid = from + (to - from)/2;\n if (size < cutoff|| counThread>20) \n \t{\n \t\tSystem.out.println(\"cut-off: \"+ (to-from+1));\n \t\tArrays.sort(array, from, to+1);\n \t}\n else {\n \n \tCompletableFuture<int[]> parsort1 = parsort(array, from, mid);\n \t\n \t\n CompletableFuture<int[]> parsort2 = parsort(array, mid+1, to);\n\n\n CompletableFuture<int[]> parsort = \n \t\tparsort1.thenCombine(parsort2, (xs1, xs2) -> {\n \tint[] result = new int[xs1.length + xs2.length];\n \tmerge(array, result, from);\n return result;\n });\n\n parsort.whenComplete((result, throwable) -> { \t\n// \tSystem.arraycopy(result, 0, array, from, to-from+1);\n// \tSystem.out.println(\"Thread count: \"+ counThread);\n \t\n \t\n }); \n parsort.join();\n }\n }", "private static void BubbleIter(int[] arr) {\n\t\t\n\t\tint size = arr.length;\n\t for (int i=1; i<size; ++i) {\n\t for (int j=0; j<size-i; ++j) {\n\t \t// Sorts the array arr[first] through arr[last] iteratively.\n\t \t// Last index changes by i pass\n\t if (arr[j]>arr[j+1]) swap(arr, j);\n\t }\n\t }\n\t}", "public static void main(String[] args) {\n\t\tint a[]= {2,5,7,8,4,6,3};\n\t\tint start=0;\n\t\tint end=a.length-1;\n\t\tint minindex=0;\n\t\tint maxindex=0;\n\t\twhile(end>start)\n\t\t{\n\t\t minindex=start;\n\t\t maxindex=end;\n\t\t for (int i =start; i <=end; i++) \n\t\t {\n\t\t\tif(a[i]<a[minindex])\n\t\t\t{\n\t\t\t\tminindex=i;\n\t\t\t}\n\t\t\tif(a[i]>a[maxindex])\n\t\t\t{\n\t\t\t\tmaxindex=i;\n\t\t\t}\n\t\t }\n\t\t \n\t\tint temp=a[end];\n\t\t a[end]=a[maxindex];\n\t\t a[maxindex]=temp;\n\t\t temp=a[start];\n\t\t a[start]=a[minindex];\n\t\t a[minindex]=temp;\n\t\t start++;end--;\n\t\t}\n\t\tSystem.out.println(Arrays.toString(a));\n\n\t}", "public static void mergeSort(int[] array, int from, int to) {\r\n\t\tif (from < to) {\r\n\t\t\tint middle = (from + to) / 2;\r\n\t\t\tmergeSort(array, from, middle);\r\n\t\t\tmergeSort(array, middle + 1, to);\r\n\t\t\tmerge(array, from, middle, to);\r\n\t\t}\r\n\t}", "public static void mergeSortReverse(int[] nums, int start, int end) {\n // check for the base condition\n if (end - start < 2) {\n return;\n }\n // otherwise break the array [10, 2, 6, -12, 5,12,16] into parts\n int mid = (start + end) / 2;\n // now got the mid and array is divided\n // Left array - [10, 2, 6] & Right array - [-12, 5, 12, 16]\n mergeSortReverse(nums, start, mid); //calling mergeSort for left array\n mergeSortReverse(nums, mid, end); //calling mergeSort for right array\n // merge the sorted array\n mergeReverse(nums, start, mid, end);\n }", "public static void mergeSort(int start, int end, int[] numbers) {\n int mid = (start + end) / 2;\n\n if (start < end) {\n // sort left half\n mergeSort(start, mid, numbers);\n\n // sort right half\n mergeSort(mid + 1, end, numbers);\n\n // merge\n merge(start, mid, end, numbers);\n }\n }", "public static void bubbleSortAlgo(int[] arr) {\n for(int i = 1; i<arr.length-1; i++){\n // inner loop to compare each element with it's next one in every iteration in one complete outer loop\n for(int j = 0; j<arr.length -1; j++){\n if(isSmaller(arr, j+1, j)){ // compares the jth element from it's next element\n swap(arr, j+1, j); // if ismaller condition is true swaps both the elements\n }\n }\n }\n \n }", "public void quicksort(int[] a, int start, int end){\n\t\tif(end <= start) return;\r\n\t\t//2 number\r\n//\t\tif(end - start == 1 && a[start] > a[end]){\r\n//\t\t\tswap(a, start, end);\r\n//\t\t\treturn;\r\n//\t\t}\r\n\t\tif((end - start )< 20){\r\n\t\t\tinsertSort(a, start,end);\r\n\t\t\treturn;\r\n\t\t}\r\n\t int pivot = getPivot(a, start, end);\r\n\t int i = start, j = end - 1;\r\n\t while(i < j){\r\n\t while(i < j && a[++i] < pivot);\r\n\t while(i < j && a[--j] > pivot);\r\n\t if(i < j)\r\n\t swap(a, i, j);\r\n\t }\r\n\t swap(a, i, end -1);\r\n\t quicksort(a, start, i - 1);\r\n\t quicksort(a, i + 1, end);\r\n\t}", "void BubbleSortforLinkedList() {\n\t\tif (isEmpty() || head.next == null) return;\n\t\tNode curr = head;\n\t\tBoolean change = true;\n\t\twhile (change) {\n\t\t\tchange = false;\n\t\t\twhile (curr != null) {\n\t\t\t\tif (curr.next.data < curr.data) {\n\t\t\t\t\tint temp = curr.data;\n\t\t\t\t\tcurr.data = curr.next.data;\n\t\t\t\t\tcurr.next.data = temp;\n\t\t\t\t\tchange = true;\n\t\t\t\t}\n\t\t\tcurr = curr.next;\n\t\t\t} \n\t\t}\n\t}", "private void mergeSort(int[] array, int start, int end) {\n\t\tif (start < end) {\n\t\t\tint mid = (start + end) / 2;\n\t\t\tmergeSort(array, start, mid);\n\t\t\tmergeSort(array, mid + 1, end);\n\t\t\tmerge(array, start, mid, end);\n\t\t}\n\t}", "public static void sequentialSort(List<Integer> list, int start, int end) {\n if (start >= end)\n return;\n // recursive case\n\n // now sort into two sections so stuff in lower section is less than\n // pivot, and remainder is in upper section.\n int pivot = list.get((start + end) / 2);\n int lower = start;\n int upper = end - 1;\n\n while (lower < upper) {\n int lowerItem = list.get(lower);\n int upperItem = list.get(upper);\n if (lowerItem < pivot)\n // this item is not out of place\n lower++;\n else if (upperItem > pivot)\n // this item is not out of place\n upper--;\n else {\n // both items are out of place --- so swap them.\n list.set(lower, upperItem);\n list.set(upper, lowerItem);\n if (upperItem != pivot)\n lower++;\n if (lowerItem != pivot)\n upper--;\n }\n }\n\n list.set(lower, pivot);\n\n ParSort.pause(list, 100); // to make animation in display mode better\n\n // A this point, lower == upper.\n ParSort.sequentialSort(list, start, lower);\n ParSort.sequentialSort(list, lower + 1, end);\n }", "public static void quickSort (int[] nums, int start, int end) {\n\t\t// check if it's a valid array\n\t\tif (nums == null || nums.length == 0) {\n\t\t\treturn;\n\t\t}\n\n // exit condition\n\t\tif (start >= end) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint left = start, right = end;\n\t\tint pivot = nums[start + (end - start) / 2];\n\t\t\n\t\twhile (left <= right) {\n\t\t\twhile (left <= right && nums[left] < pivot) {\n\t\t\t\tleft++;\n\t\t\t}\n\t\t\twhile (left <= right && nums[right] > pivot) {\n\t\t\t\tright--;\n\t\t\t}\n\t\t\tif (left <= right) {\n\t\t\t\tswap(nums, left, right);\n\t\t\t\tleft++;\n\t\t\t\tright--;\n\t\t\t}\n\t\t}\n\n // call quickSort recursively\n\t\tquickSort(nums, start, right);\n\t\tquickSort(nums, left, end);\n\t}", "public static void main(String[] args) {\n\t\tBubbleSort ob = new BubbleSort();\n\t\t\n\t\tint arr[] = {23,3,4,56,78,1};\n\t\t\n\t\tob.BubbleSort(arr);\n\n\t}", "public static void mergeReverse(int[] nums, int start, int mid, int end) {\n\n if (nums[mid - 1] >= nums[mid]) {\n return;\n }\n\n int i = start; // i points to first index of left array\n int j = mid; // j points to first index of right array\n int tempIndex = 0;\n int[] tempArray = new int[end - start]; //new array to hold the sorted elements.\n while (i < mid && j < end) {\n tempArray[tempIndex++] = nums[i] >= nums[j] ? nums[i++] : nums[j++];\n }\n\n System.arraycopy(nums, i, nums, start + tempIndex, mid - i);\n // now copying complete temp array to input array.\n System.arraycopy(tempArray, 0, nums, start, tempIndex);\n\n }", "private void createArrays(){\n array1 = new BubbleSort(CreateIntArray.fillArray(15)).bubbleSort();\n array2 = new BubbleSort(CreateIntArray.fillArray(15)).bubbleSort();\n BubbleSort.listArrayElements(array1);\n BubbleSort.listArrayElements(array2);\n\n int[] array = new int[array1.length + array2.length];\n\n int i = 0, j = 0;\n for (int k = 0; k < array.length; k++){\n if(i > array1.length - 1){\n array[k] = array2[j];\n j++;\n } else if(j > array2.length - 1){\n array[k] = array1[i];\n i++;\n } else if (array1[i] < array2[j]){\n array[k] = array1[i];\n i++;\n } else {\n array[k] = array2[j];\n j++;\n }\n\n }\n BubbleSort.listArrayElements(array);\n\n\n }", "public static void main(String[] args) {\n // auxIntArr is found in AuxPkg.AuxFuncs\n int[] arr = auxIntArr.clone();\n\n System.out.println(\"BubbleSort:\");\n System.out.print(\"Before: \");\n printIntArr(arr);\n\n // Main loop where the index will grow smaller as the array gets sorted\n for( int lastUnsortedIdx = arr.length -1;\n lastUnsortedIdx > 0;\n lastUnsortedIdx--)\n {\n // Nested loop for bubbling highest values to the next sorted slot\n // in the main loop\n for(int idx = 0; idx < lastUnsortedIdx; idx++)\n {\n if(arr[idx] > arr[idx+1])\n {\n swap(arr, idx, idx+1);\n }\n }\n }\n\n System.out.print(\"After: \");\n printIntArr(arr);\n System.out.println();\n }", "public void simpleSelectionSort(int start, int end, int[] array) {\n\t\tfor (int i = start; i <= end - 1; i++) {\n\t\t\tint minIndex = i;\n\t\t\tfor (int k = i + 1; k <= end; k++) {\n\t\t\t\tif (array[k] < array[minIndex]) {\n\t\t\t\t\tminIndex = k;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Yes, find smaller element\n\t\t\tif (minIndex != i) {\n\t\t\t\tCommUtil.swap(i, minIndex, array);\n\t\t\t}\n\t\t}\n\t}", "public static void bubbleSort(int[] arr)\n\t{\n\t\tint len=arr.length;\n\t\tboolean swapped=true;\n\t\twhile(swapped){\n\t\t\tswapped=false;\n\t\t\tfor(int j=1;j<len;j++){\n\t\t\t\tif(arr[j-1]>arr[j]){\n\t\t\t\t\tint temp=arr[j-1];\n\t\t\t\t\tarr[j-1]=arr[j];\n\t\t\t\t\tarr[j]=temp;\n\t\t\t\t\tswapped=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void sort(int start, int end) {\n int firstHalf = start;\n int lastHalf = end;\n int pivotIndex = start + (int) (Math.random() * (end - start));\n T pivot = sortedArray[pivotIndex];\n while (firstHalf <= lastHalf) {\n while (sortedArray[firstHalf].compareTo(pivot) > 0) {\n firstHalf++;\n }\n while (sortedArray[lastHalf].compareTo(pivot) < 0) {\n lastHalf--;\n }\n if (firstHalf <= lastHalf) {\n T temp = sortedArray[firstHalf];\n sortedArray[firstHalf] = sortedArray[lastHalf];\n sortedArray[lastHalf] = temp;\n firstHalf++;\n lastHalf--;\n }\n }\n if (start < lastHalf) {\n sort(start, firstHalf);\n }\n if (firstHalf < end) {\n sort(firstHalf, end);\n }\n }", "public void recursiveBubbleSort(int[] numbers) {\n boolean sorted = false;\n int posA;\n int posB;\n\n for(int i = 0; i < numbers.length - 1; i++) {\n if(numbers[i] > numbers[i + 1] && numbers[i] != numbers.length) {\n posA = numbers[i];\n posB = numbers[i + 1];\n numbers[i] = posB;\n numbers[i + 1] = posA;\n sorted = true;\n }\n }\n if (sorted) {\n recursiveBubbleSort(numbers);\n }\n }", "private void permutation(int[] nums, int start, int end) {\n if (start == end) { //\n int[] newNums = new int[nums.length]; //\n if (end + 1 >= 0) System.arraycopy(\n nums, 0, newNums, 0, end + 1);\n allOrderSorts.add(newNums); //\n } else {\n for (int i = start; i <= end; i++) {\n int temp = nums[start]; //\n nums[start] = nums[i];\n nums[i] = temp;\n permutation(nums, start + 1, end); //\n nums[i] = nums[start]; //\n nums[start] = temp;\n }\n }\n }", "public static void bubbleSort(int[] arr){\n\n\t\tboolean swaps = true; //setting boolean swaps to true \n\t\tint l = arr.length; //varibale to hold the length of the array \n\n\t\twhile (swaps == true) { //goes through while swaps is true \n\n\t\t\tswaps = false; //setting swaps to false \n\n\t\t\tfor(int i = 0; i < l-1; i++) { //iterates through the length of the array \n\t\t\t\t\n\t\t\t\tif (arr[i + 1] < arr[i]) { //if the element on the right is less than the one on the left (54321)\n\n\n\t\t\t\t\tint temp = arr[i]; //holds the value of element at that index position \n\t\t\t\t\tarr[i] = arr[i+1]; //swaps the elments over \n\t\t\t\t\tarr[i+1] = temp; //moves onto the next element \n\n\t\t\t\t\tswaps = true; //as n-1, moves back and repeats to do the last element \n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}", "private static void sort(Object[] a, Object[] tmp,\n int from, int to, Fun isLess) {\n int split = (from + to) / 2;\n if (split - from > 1)\n sort(tmp, a, from, split, isLess);\n if (to - split > 1)\n sort(tmp, a, split, to, isLess);\n int i = from, j = split;\n while (i < split && j < to) {\n if (isLess.apply(tmp[i], tmp[j]) == Boolean.TRUE)\n a[from] = tmp[i++];\n else\n a[from] = tmp[j++];\n ++from;\n }\n if (i < split)\n System.arraycopy(tmp, i, a, from, split - i);\n else if (j < to)\n System.arraycopy(tmp, j, a, from, to - j);\n }", "public void bubbleSort(){\n for(int i = arraySize -1; i > 1; i--){\n for(int j = 0; j < i; j++){\n // Use < to change it to Descending order\n if(theArray[j] > theArray[j+1]){\n swapValues(j, j+1);\n printHorizontalArray(i, j);\n }\n printHorizontalArray(i, j);\n }\n }\n }", "public void sort() {\n ListNode start = head;\n ListNode position1;\n ListNode position2;\n\n // Going through each element of the array from the second element to the end\n while (start.next != null) {\n start = start.next;\n position1 = start;\n position2 = position1.previous;\n // Checks if previous is null and keeps swapping elements backwards till there\n // is an element that is bigger than the original element\n while (position2 != null && (position1.data < position2.data)) {\n swap(position1, position2);\n numberComparisons++;\n position1 = position2;\n position2 = position1.previous;\n }\n }\n }", "private int partition(int[] arr, int start, int end) {\n\t\tint bounary = arr[start];\r\n\t\twhile(start<end) {\r\n\t\t\twhile(start<end&&arr[end]>=bounary) {\r\n\t\t\t\tend--;\r\n\t\t\t}\r\n\t\t\tarr[start] = arr[end];\r\n\t\t\twhile(start<end&&arr[start]<=bounary) {\r\n\t\t\t\tstart++;\r\n\t\t\t}\r\n\t\t\tarr[end] = arr[start];\r\n\t\t}\r\n\t\tarr[start] = bounary;\r\n\t\treturn start;\r\n\t}", "public static void bubbleSort(int[] arr){\r\n \tfor(int i = 0; i< arr.length - 1;i++)\r\n \t{\r\n \t\tfor(int j = 0; j< arr.length - 1; j++)\r\n \t\t{\r\n \t\t\tif(arr[j] > arr[j + 1])\r\n \t\t\t{\r\n \t\t\t\tint temp = arr[j];\r\n \t\t\t\tarr[j] = arr[j + 1];\r\n \t\t\t\tarr[j + 1] = temp;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n }", "void sort( int low, int high)\n {\n if (low > high)\n {\n /* pi is partitioning index, arr[pi] is\n now at right place */\n int pi = partition(low, high);\n\n // Recursively sort elements before\n // partition and after partition\n sort( low, pi-1);\n sort( pi+1, high);\n }\n }", "public void shuttlesort(int from[], int to[], int low, int high) {\n if (high - low < 2) {\n return;\n }\n int middle = (low + high) / 2;\n shuttlesort(to, from, low, middle);\n shuttlesort(to, from, middle, high);\n int p = low;\n int q = middle;\n if (high - low >= 4 && compare(from[middle - 1], from[middle]) <= 0) {\n for (int i = low; i < high; i++) {\n to[i] = from[i];\n }\n return;\n }\n for (int i = low; i < high; i++) {\n if (q >= high || (p < middle && compare(from[p], from[q]) <= 0)) {\n to[i] = from[p++];\n } else {\n to[i] = from[q++];\n }\n }\n }", "private void mergeSort(int low, int high) {\n\t\tif (low < high) {\n\t\t\tint middle = low + (high - low) / 2;\n\t\t\tmergeSort(low, middle);\n\t\t\tmergeSort(middle + 1, high);\n\t\t\tmergeParts(low, middle, high);\n\t\t}\n\t}", "static int[] Bubble_sort(int[] input) {\n\t\t//int n=input.length;\t\t\t\t\t//length of the array\n\t\tfor(int i=0;i<input.length;i++)\n\t\t{\t\t\t\t\t\t\t\t\n\t\t\tint pos=0;\t\t\t//setting the first element as the Max element\n\t\t\tint max=input[pos];\n\t\t\tfor(int j=0;j<input.length-i;j++)\n\t\t\t{\t\t\t\t\t//traversing the array to find the max element\n\t\t\t\tif(input[j]>max)\n\t\t\t\t{\n\t\t\t\t\tpos=j;\n\t\t\t\t\tmax=input[pos];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t//swapping the Max element with input.length-i-1 position\n\t\t\tinput[pos]=input[input.length-i-1];\n\t\t\tinput[input.length-i-1]=max;\n\t\t}\n\t\treturn input;\n\t}", "private static void reverse(int[] nums, int[] pos, int start, int end){\n \tif(start>=end){\n \t\treturn ;\n \t}\n \tint mid=start+(end-start)/2;\n \treverse(nums, pos, start, mid);\n \treverse(nums, pos, mid+1, end);\n \tint[] temp=new int[end-start+1];\n \tint i=start, j=mid+1, k=0;\n \twhile(i<=mid||j<=end){\n \t\tif(i>mid){\n \t\t\ttemp[k++]=pos[j++];\n \t\t}else if(j>end){ \t\t\t\n \t\t\ttemp[k++]=pos[i++];\n \t\t}else if(nums[pos[i]]<=nums[pos[j]]){ \t\t\t\n \t\t\ttemp[k++]=pos[i++];\n \t\t}else{\n \t\t\ttemp[k++]=pos[j++];\n \t\t} \t\t\n \t} \t\n \tfor(i=0; i<k; i++){\n \t\tpos[start+i]=temp[i];\n \t} \t\n }", "public static void main(String[] args) {\r\n int[] numbers = {25, 43, 29, 50, -6, 32, -20, 43, 8, -6};\r\n\t\r\n\tSystem.out.print(\"before sorting: \");\r\n\toutputArray(numbers);\r\n \r\n\tbubbleSort(numbers);\r\n\t\r\n\tSystem.out.print(\"after sorting: \");\r\n\toutputArray(numbers);\r\n }", "public static void OddSort(int arr[], int start, int end)\n {\n for (int i = start; i < end - 1; i++)\n {\n int index = i;\n for (int j = i + 1; j < end; j++){\n if (arr[j] >= arr[index]){\n index = j;\n }\n }\n int smallerNumber = arr[index];\n arr[index] = arr[i];\n arr[i] = smallerNumber;\n }\n }", "void bubbleSort(int arr[]) {\r\n\r\n int n = arr.length;\r\n boolean swapped;\r\n for(int i = 0; i < n-1; i++) { //denotes pass #\r\n for(int j = 0; j < n-i-1; j++) { //denotes element in the pass\r\n if(arr[j] > arr[j+1]) {\r\n //swapping of the element\r\n arr[j] += arr[j+1];\r\n arr[j+1] = arr[j] - arr[j+1];\r\n arr[j] -= arr[j+1];\r\n swapped = true;\r\n\r\n } //end of if block\r\n }//end of element checking loop\r\n //if no 2 elements were swapped by inner loop, then break\r\n if (swapped == false)\r\n break;\r\n }//end of pass loop\r\n }", "public void quickSortHelper(int start, int end){\n if(start < end){\n //partition index calls partition that returns idx\n //and also puts toSort[partitionidx] in the right place\n int partitionidx = partition(start, end);\n\n //sorts elements before and after the partitions\n //recursive - nice\n //System.out.println(\"test\");\n quickSortHelper(start, partitionidx - 1); //befre\n quickSortHelper(partitionidx + 1, end); //after\n }\n }", "public static void bubbleSort(int[] src) {\n if (src == null || src.length <= 1) return;\n\n for (int i = 0; i < src.length; ++i) {\n boolean flag = false;\n for (int j = 0; j < src.length - i - 1; ++j) {\n if (src[j] > src[j + 1]) {\n Utils.swap(src, j, j + 1);\n flag = true;\n }\n }\n\n if (!flag) return;\n }\n }", "static void mergeSort(int array[], int start, int end) {\n if (start < end) {\n // Find the middle point\n int middle = start + (end - start)/2;\n\n // Sort first and second parts\n mergeSort(array, start, middle);\n mergeSort(array, middle + 1, end);\n\n // Merge the sorted parts\n merge(array, start, middle, end);\n\n }\n\n }", "@Test\n public void testBubbleSort() {\n BubbleSort<Integer> testing = new BubbleSort<>();\n\n testing.sort(array, new Comparator<Integer>() {\n @Override\n public int compare(Integer i1, Integer i2) {\n return i1.compareTo(i2);\n }\n });\n\n checkArray(\"Bubble sort doesn't work!\", array);\n }", "private static void merge(int[] nums, int[] work, int start, int mid, int end){\n\t\tboolean loop = true;\n\t\tint counter1 = start;\n\t\tint counter2 = mid+1;\n\t\tint workCounter = start;\n\t\t\n\t\twhile(loop){\n\t\t\tif(counter1 > mid){\n\t\t\t\t// Copy all elements from 2nd end to work\n\t\t\t\tfor(int i=counter2; i<=end; i++)\n\t\t\t\t\twork[workCounter++] = nums[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif(counter2 > end){\n\t\t\t\t// Copy all elements from start-mid to work\n\t\t\t\tfor(int i=counter1; i<=mid; i++)\n\t\t\t\t\twork[workCounter++] = nums[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Swap the number if the numbers in are not is sorted order\n\t\t\tif(nums[counter1] < nums[counter2]){\n\t\t\t\twork[workCounter] = nums[counter1]; \n\t\t\t\tcounter1++;\n\t\t\t}else{\n\t\t\t\twork[workCounter] = nums[counter2]; \n\t\t\t\tcounter2++;\n\t\t\t}\n\t\t\t\n\t\t\tworkCounter++;\n\t\t}\n\t\t\n\t\t// Copy the sorted work array into main array\n\t\tfor(int i=start; i <= end; i++)\n\t\t\tnums[i] = work[i];\n\t}", "public static void EvenSort(int arr[], int start, int end)\n {\n int n = end;\n for (int i = 0; i < n-1; i++)\n for (int j = 0; j < n-i-1; j++)\n if (arr[j] > arr[j+1])\n {\n // swap arr[j+1] and arr[j]\n int temp = arr[j];\n arr[j] = arr[j+1];\n arr[j+1] = temp;\n }\n }", "public static void main(String[] args) {\n\n\t\tint[] a= {10,9,7,13,2,6,14,20};\n\t\tSystem.out.println(\"before sort\"+Arrays.toString(a));\n\t\tfor(int k=1;k<a.length;k++) {\n\t\t\tint temp=a[k];\n\t\t\tint j=k-1;\n\t\t\t\n\t\t\twhile(j>=0 && temp<=a[j]) {\n\t\t\t\ta[j+1]=a[j];\n\t\t\t\tj=j-1;\n\t\t\t}\n\t\t\ta[j+1]=temp;\n\t\t}\n\n\t\t\n\t\tSystem.out.println(\"After sort\"+Arrays.toString(a));\n\t\t\n\t\tSystem.out.println(\"print uing for loop\");\n\t\tfor(int i=0;i<a.length;i++) {\n\t\t\tSystem.out.print(a[i]+\"\");\n\t\t}\n\t}", "public void myBubbleSort(int array[]) {\n for (int i = 0; i < array.length - 1; i++) {\n //Iterate through the array to the index to the left of i\n for (int j = 0; j < array.length - i - 1; j++) {\n //Check if the value of the index on the left is less than the index on the right\n if (array[j] > array[j + 1]) {\n //If so, swap them.\n int temp = array[j];\n array[j] = array[j + 1];\n array[j + 1] = temp;\n\n }\n }\n }\n }", "public static void bubbleSort(Array a) {\n int temp;\n for (int i = 0; i < a.length - 1; i++) { // for passes\n int flag = 0;\n for (int j = 0; j < a.length - 1 - i; j++) { // for iteration\n if (a.get(j) > a.get(j + 1)) {\n temp = a.get(j);\n a.set(j, a.get(j + 1));\n a.set(j + 1, temp);\n flag = 1;\n }\n }\n if (flag == 0) break; // if the list is already sorted\n }\n }", "public static void main(String[] args) {\n\t\tint[] nums={1,3,7,2,5,9};\n\t\tint[] sorted=bubbleSort(nums);\n\t\t\n\t\tprint(sorted);\n\n\t}", "private static void BubbleRec(int[] arr, int first, int last) {\n\t\t\n\t\tif(first<last) {\n\t\t\tif (arr[first]>arr[first+1]) swap(arr, first);\n\t\t\t\n\t\t\t//Sort the biggest element to last index\n\t\t\tBubbleRec(arr, first+1, last); \n\t\t\t\n\t\t\t// Prohibit calling n+1 pass before finishing n pass\n\t\t\t// Start n+1 pass\n\t\t\tif (first==0) BubbleRec(arr, first, last-1);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tSystem.out.println(\"Bubble Sort\");\r\n\t\tint[] arr1 = {8,3,2,1,4,6,5,7};\r\n\t\tSystem.out.println(Arrays.toString(arr1));\r\n\t\tBubble.sort(arr1);\r\n\t\tSystem.out.println(Arrays.toString(arr1));\r\n\t\t\r\n\t\tSystem.out.println(\"Select Sort\");\r\n\t\tint[] arr2 = {8,3,2,1,4,6,5,7};\r\n\t\tSystem.out.println(Arrays.toString(arr2));\r\n\t\tSelect.sort(arr2);\r\n\t\tSystem.out.println(Arrays.toString(arr2));\r\n\t\t\r\n\t\tSystem.out.println(\"Insert Sort\");\r\n\t\tint[] arr3 = {8,3,2,1,4,6,5,7};\r\n\t\tSystem.out.println(Arrays.toString(arr3));\r\n\t\tInsert.sort(arr3);\r\n\t\tSystem.out.println(Arrays.toString(arr3));\r\n\t\t\r\n\t\tSystem.out.println(\"Quick Sort\");\r\n\t\tint[] arr4 = {8,3,2,1,4,6,5,7};\r\n\t\tSystem.out.println(Arrays.toString(arr4));\r\n\t\tQuickSort.sort(arr4, 0, arr4.length-1);\r\n\t\tSystem.out.println(Arrays.toString(arr4));\r\n\t\t\r\n\t\tbyte b = -127;\r\n\t\tb = (byte) (b << 1);\r\n\t\tSystem.out.println(b);\r\n\t}", "static void bubbleSort(int[] arr) {\n\t\tboolean swapped; //using swapped for optimization, inner loop will continue only if swapping is possible\n\t\tfor(int i=0;i<arr.length-1;i++) {\n\t\t\tswapped =false;\n\t\t\tfor(int j =0;j<arr.length-i-1;j++) {\n\t\t\t\tif(arr[j]>arr[j+1]) {\n\t\t\t\t\tint temp = arr[j+1]; \n\t\t arr[j+1] = arr[j]; \n\t\t arr[j] = temp;\n\t\t swapped = true;\n\t\t\t\t}\n\t\t\t\t// IF no two elements were \n\t // swapped by inner loop, then break \n\t\t\t\t if (swapped == false) \n\t\t break;\n\t\t\t}\n\t\t}\n\t\tfor(int a:arr) \n\t\t{ \n\t\t\tSystem.out.print(a+ \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t}", "private void quickSortM(int[] arr, int start, int end) {\n\t\tif(start>=end)\r\n\t\t\treturn ;\r\n\t\tint bounary = partition(arr,start,end);\r\n\t\tquickSortM(arr,start,bounary-1);\r\n\t\tquickSortM(arr, bounary+1, end);\r\n\t}", "public static int[] mergeSort(int[] elements, int start, int end) {\n\t\tif (start == end)\n\t\t\treturn elements;\n\t\t\n\t\tint middle = (end + start) / 2;\n\t\tmergeSort(elements, start, middle);\n\t\tmergeSort(elements, middle + 1, end);\n\t\tmerge(elements, start, middle, end);\n\t\t\n\t\treturn elements;\n\t}", "public static void sortBubble(int[] tab) {\n boolean alreadySorted=false;\n int temp;\n int n=tab.length;\n int i=0;\n if(tab.length!=0){\n while (i<n-1 && !alreadySorted){\n alreadySorted=true;\n for (int j=0; j<n-1-i;j++){\n if (tab[j]>tab[j+1]){\n alreadySorted=false;\n temp=tab[j];\n tab[j]=tab[j+1];\n tab[j+1]=temp;\n }\n }\n i=i+1;\n }\n }\n}", "void sort(int arr[], int low, int high) {\n\t\tif (low < high) {\n\t\t\t/*\n\t\t\t * pi is partitioning index, arr[pi] is now at right place\n\t\t\t */\n\t\t\tint pi = partition(arr, low, high);\n\n\t\t\t// Recursively sort elements before\n\t\t\t// partition and after partition\n\t\t\tsort(arr, low, pi - 1);\n\t\t\tsort(arr, pi + 1, high);\n\t\t}\n\t}", "private void bubbleSort(T[] arr) {\n boolean swaps;\n for (int i = 0; i < n - 1; i++) { // since we always compare two elements, we will need to iterate up to (n - 1) times\n swaps = false;\n for (int j = 1; j < n - i; j++) // we reduce the inspected area by one element at each loop, because the largest element will already be pushed to the right\n if (arr[j].compareTo(arr[j - 1]) < 0) {\n swap(arr, j, j - 1); // the swap method is implemented further\n swaps = true;\n }\n if (!swaps) break; // we stop if there were no swaps during the last iteration\n }\n }", "public static void main(String[] args) {\n\r\n\t\tint[] a;\r\n\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.bubble(a);\r\n\r\n\t\tSystem.out.println(\"BubbleSort: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.selection(a);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nSelection: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.insertion(a);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nInsertion: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.mergeSort(a, 0, a.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nMerge: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.quickSort(a, 0, a.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nQuick: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.qs(a, 0, a.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nQuick1: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t}", "private static void quicksort(int[] array, int fromIndex, int toIndex) {\r\n\t\tint pivot = array[toIndex];\r\n\t\tint j = toIndex;\r\n\r\n\t\t// searching for a bigger value than pivot starting at fromIndex\r\n\t\tfor (int i = fromIndex; i <= toIndex; i++) {\r\n\t\t\tif (array[i] >= pivot) {\r\n\r\n\t\t\t\t// searching for a smaller value than pivot starting at toIndex\r\n\t\t\t\twhile (j > i) {\r\n\t\t\t\t\tj--;\r\n\r\n\t\t\t\t\t// swap values at i and j\r\n\t\t\t\t\tif (array[j] <= pivot) {\r\n\t\t\t\t\t\tswap(array, j, i);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * if right position for pivot has been found swap pivot and\r\n\t\t\t\t * element at reached position\r\n\t\t\t\t */\r\n\t\t\t\tif (i == j) {\r\n\t\t\t\t\tswap(array, i, toIndex);\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Checks if there are more elements to sort on the left\r\n\t\t\t\t\t * side of the right of pivot\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (i - 1 > fromIndex) {\r\n\t\t\t\t\t\tquicksort(array, fromIndex, i - 1);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * calls quicksort if there are more elements to sort on the\r\n\t\t\t\t\t * right side of the of pivot\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (i + 1 < toIndex) {\r\n\t\t\t\t\t\tquicksort(array, i + 1, toIndex);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// i shouldn't be bigger than j\r\n\t\t\tif (i > j) {\r\n\t\t\t\tthrow new IllegalStateException(\"i > j\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "static void sort(int vec[], int low, int high) {\n\t\tif (low < high) {\n\t\t\t/* pi esta particionando indices, arr[pi] is now at right place */\n\t\t\tint pi = particion(vec, low, high);\n\t\t\t// Recursivamente ordena elementos antes de\n\t\t\t// la partición y despues de la partición\n\t\t\tsort(vec, low, pi - 1);\n\t\t\tsort(vec, pi + 1, high);\n\t\t}\n\t}", "static int[] bubbleSort(int[] a) {\n int n = a.length;\n while(n > 0) {\n int newLastN = 0; // if no swap occurred in last step we won't need to run next iteration\n for (int i = 1; i < n; i++) {\n comparisonCount++;\n if (a[i - 1] > a[i]) {\n swapCount++;\n swap(a, i - 1, i);\n newLastN = i;\n }\n }\n n = newLastN;\n }\n return a;\n }", "public static int[] BubbleSort(int[] array){\n int j;\n int temp;\n boolean flag=false;\n while ( flag )\n {\n flag= false;\n for( j=0;j<array.length-1;j++ )\n {\n if ( array[j] < array[j+1] )\n {\n temp = array[j];\n array[j] = array[j+1];\n array[j+1] = temp;\n flag = true;\n }\n }\n }\n return array;\n }", "private void bubbleSort() {\r\n\r\n int n = leaderboardScores.size();\r\n int intChange;\r\n String stringChange;\r\n\r\n for (int i = 0 ; i < n - 1 ; i ++ ) {\r\n for (int j = 0 ; j < n - i - 1 ; j ++ ) {\r\n\r\n if (leaderboardScores.get(j) > leaderboardScores.get(j + 1)) {\r\n // swap arr[j+1] and arr[i]\r\n intChange = leaderboardScores.get(j);\r\n leaderboardScores.set(j, leaderboardScores.get(j + 1));\r\n leaderboardScores.set(j + 1, intChange);\r\n\r\n stringChange = leaderboardUsers.get(j);\r\n leaderboardUsers.set(j, leaderboardUsers.get(j + 1));\r\n leaderboardUsers.set(j + 1, stringChange);\r\n }\r\n\r\n }\r\n }\r\n }", "public static void main(String[] args) {\n\r\n\t\tint[] abc = { 5, 7, 1, 3, 5 };\r\n\t\tquicksort(abc, 0, abc.length - 1);\r\n\t\tBubbleSort.display(abc);\r\n\t}", "public static void bubbleSort(int[] arr) {\r\n for (int i = 0; i < arr.length; i++) {\r\n boolean swapped = false;\r\n for (int j = 1; j < arr.length - i; j++) {\r\n if (arr[j] < arr[j - 1]) {\r\n swap(arr, j, j - 1);\r\n swapped = true;\r\n }\r\n }\r\n if (!swapped) {\r\n break;\r\n }\r\n }\r\n }", "private int[] mergeSort(int[] nums, int start, int end) {\n if (start == end) {\n return new int[]{nums[start]};\n }\n\n // keep dividing the entire array into sub-arrays\n int mid = (end - start) / 2 + start;\n int[] left = mergeSort(nums, start, mid);\n int[] right = mergeSort(nums, mid + 1, end);\n // return merged array\n return mergeTwoSortedArrays(left, right);\n }", "public static int lomutoPartition(int[] nums, int start, int end) {\n int pivot = nums[end];\n\n // elements less than pivot will be pushed to the left of pIndex\n // elements more than pivot will be pushed to the right of pIndex\n // equal elements can go either way\n int pIndex = start; // Basically has the index of the 1st element greater than the pivot chosen\n\n // each time we finds an element less than or equal to pivot,\n // pIndex is incremented and that element would be placed\n // before the pivot.\n for (int i = start; i < end; i++) {\n if (nums[i] <= pivot) {\n swap(nums, i, pIndex);\n pIndex++;\n }\n }\n\n // swap pIndex with Pivot\n swap(nums, end, pIndex);\n\n // return pIndex (index of pivot element)\n return pIndex;\n }", "public static void main(String[] args) {\n\t\tint[] sortArray = new int[] {1,-5,10,2,8};\r\n\t\tBubbleSort.sort(sortArray);\r\n\t\tfor(int elm:sortArray){\r\n\t\t\tSystem.out.println(\"Sorted Array \"+elm);\r\n\t\t}\r\n\r\n\r\n\t}", "public static void bubbleSort() {\r\n\t\tfor(int i = nodeArrList.size() -1; i > 0; i--) {\r\n\t\t\tfor(int j = 0; j < i; j++) {\r\n\t\t\t\tif(nodeArrList.get(j).frequency > nodeArrList.get(j +1).frequency) {\r\n\t\t\t\t\tHuffmanNode temp = nodeArrList.get(j);\r\n\t\t\t\t\tnodeArrList.set(j, nodeArrList.get(j + 1));\r\n\t\t\t\t\tnodeArrList.set(j + 1, temp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static int quickSortInDescendingOrder(int[] array, int start, int end) {\n\n int pivot = array[start];\n int index1 = start;\n int index2 = end;\n\n while (index1 < index2) {\n while (index1 < index2 && array[--index2] <= pivot);\n if (index1 < index2) {\n array[index1] = array[index2];\n }\n\n while (index1 < index2 && array[++index1] >= pivot);\n\n if (index1 < index2) {\n array[index2] = array[index1];\n }\n }\n\n array[index2] = pivot;\n return index2;\n }", "public void bubbleSort(ArrayList<Pokemon> p);", "private static <T extends Comparable<T>> void merge(T[] arrayToSort, int startIndex, int centerIndex, int endIndex) {\n List<T> left = new ArrayList<>(centerIndex - startIndex);\n List<T> right = new ArrayList<>(endIndex - centerIndex);\n for(int i = startIndex; i < centerIndex; i++)\n left.add(arrayToSort[i]);\n for(int i = centerIndex; i < endIndex; i++)\n right.add(arrayToSort[i]);\n int leftItr = 0;\n int rightItr = 0;\n for(int i = startIndex; i < endIndex; i++) {\n if(leftItr < left.size())\n if(rightItr < right.size())\n if(left.get(leftItr).compareTo(right.get(rightItr)) < 0)\n arrayToSort[i] = left.get(leftItr++);\n else\n arrayToSort[i] = right.get(rightItr++);\n else\n arrayToSort[i] = left.get(leftItr++);\n else\n arrayToSort[i] = right.get(rightItr++);\n }\n }", "void sort(double arr[], long start, long end) \n { \n double biggest = 0, temp;\n int biggestIndex = 0;\n for(int j = 0; j > arr.length+1; j++){\n for(int i = 0; i < arr.length-j; i++){\n if(arr[i] > biggest){\n biggest = arr[i];\n biggestIndex = i;\n }\n }\n temp = arr[arr.length-1];\n arr[arr.length-1] = biggest;\n arr[biggestIndex] = temp;\n biggest = 0;\n biggestIndex = 0;\n }\n }", "private static void sortPoints(int[][] pointSet, int start, int end)\n {\n if (start < end)\n {\n int mid = (start+end)/2;\n sortPoints(pointSet, start, mid);\n sortPoints(pointSet, mid+1, end);\n crossProductMerge(pointSet, start, mid, end);\n }\n }", "public static void mergesort(ArrayList<Score> items, int start, int end) {\r\n if (start < end) {\r\n int mid = (start + end) / 2;\r\n mergesort(items, start, mid);\r\n mergesort(items, mid + 1, end);\r\n merge(items, start, mid, end);\r\n }\r\n }", "void sort (int [] items) {\r\n\tint length = items.length;\r\n\tfor (int gap=length/2; gap>0; gap/=2) {\r\n\t\tfor (int i=gap; i<length; i++) {\r\n\t\t\tfor (int j=i-gap; j>=0; j-=gap) {\r\n\t\t \t\tif (items [j] <= items [j + gap]) {\r\n\t\t\t\t\tint swap = items [j];\r\n\t\t\t\t\titems [j] = items [j + gap];\r\n\t\t\t\t\titems [j + gap] = swap;\r\n\t\t \t\t}\r\n\t \t}\r\n\t }\r\n\t}\r\n}", "public void bubbleSort() {\n \tfor (int i = 0; i < contarElementos()-1; i++) {\n\t\t\tboolean intercambiado= false;\n\t\t\tfor (int j = 0; j < contarElementos()-1; j++) {\n\t\t\t\tif (encontrarNodoEnElndice(j).getElemento().compareTo(encontrarNodoEnElndice(j+1).getElemento())>0) {\n\t\t\t\t\tintercambiar(j, j+1);\n\t\t\t\t\tintercambiado=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!intercambiado) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void mergeWithComparator(T[] arr, int from, int mid, int to, Comparator<T> comp) {\n\t\tint n = to - from + 1;\n\t\tint n1 = mid - from + 1;\n\t\tint n2 = to - mid;\n\t\t/* Create two sub-arrays according to the partition point\n\t\t * and copy the contents into them */\n\t\tT[] arr1 = (T[]) new Comparable[n1];\n\t\tT[] arr2 = (T[]) new Comparable[n2];\n\t\tfor (int i = 0; i < n1; i++) {\n\t\t\tarr1[i] = arr[from + i];\n\t\t}\n\t\tfor (int j = 0; j < n2; j++) {\n\t\t\tarr2[j] = arr[mid + 1 + j];\n\t\t}\n\n\t\tint i = 0, j = 0;\n\t\tfor (int k = from; k <= to; k++) {\n\t\t\t/* if arr2 is finished going through OR the element in arr1 is less than arr2,\n\t\t\t * use the element in arr1 */\n\t\t\tif (j >= arr2.length || (i < arr1.length && comp.compare(arr1[i], arr2[j]) <= 0)) {\n\t\t\t arr[k] = arr1[i];\n\t\t\t i++;\n\t\t\t}\n\t\t\t/* if arr1 is finished going through OR the element in arr1 is greater than arr2,\n\t\t\t * use the element in arr2 */\n\t\t\telse if (i >= arr1.length || (j < arr2.length && comp.compare(arr1[i], arr2[j]) > 0)){\n\t\t\t\tarr[k] = arr2[j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t\t//System.out.println(k + \": \" + arr[k]);\n\t\t}\n\t}", "public static void merge(int start, int mid, int end, int[] numbers) {\n int[] tempArray = new int[numbers.length]; // Create a temporary array\n int tmpArrayIndex = start; // create a temporary index\n\n // initialize start index and mid index to be used as counters\n int startIndex = start;\n int midIndex = mid + 1;\n\n // Iterate until the smaller array reaches the end.\n while (startIndex <= mid && midIndex <= end) {\n if (numbers[startIndex] < numbers[midIndex]) {\n // The ++ increases the value by one after it has been used\n // to prevent the while loop from giving us an infinite loop\n tempArray[tmpArrayIndex++] = numbers[startIndex++];\n } else {\n tempArray[tmpArrayIndex++] = numbers[midIndex++];\n }\n }\n\n // copy the remaining elements into the array\n while(startIndex <= mid) {\n tempArray[tmpArrayIndex++] = numbers[startIndex++];\n }\n\n while (midIndex <= end) {\n tempArray[tmpArrayIndex++] = numbers[midIndex++];\n }\n\n // copy our temporary array to the actual array after sorting\n if (end + 1 - start >= 0) {\n\n // java method for copying arrays\n System.arraycopy(tempArray, start, numbers, start, end + 1 - start);\n }\n }", "private static <T extends Comparable<T>> void mergeSort(T[] arrayToSort, int startIndex, int endIndex) {\n if(startIndex + 1 < endIndex) {\n int centerIndex = (endIndex + startIndex)/2;\n mergeSort(arrayToSort, startIndex, centerIndex); // sort left half\n mergeSort(arrayToSort, centerIndex, endIndex); // sort right half\n merge(arrayToSort, startIndex, centerIndex, endIndex); // merge two, sorted halves\n }\n }", "public static int[] bubble(int[] arr)\n {\n int l=arr.length;\n\n for (int i = 0; i <l-1; i++)\n {\n for (int j=0; j<l-1-i; j++)\n {\n if (arr[j] > arr[j + 1])\n {\n swap(j, j+ 1, arr);\n }\n }\n }\n return arr;\n }" ]
[ "0.7224017", "0.7084231", "0.6704334", "0.6648936", "0.6307179", "0.62533075", "0.6211856", "0.61959904", "0.6140325", "0.6121233", "0.6091252", "0.60832864", "0.6052339", "0.60129225", "0.60087615", "0.6001888", "0.5985668", "0.5946862", "0.5944961", "0.5944908", "0.59124935", "0.58907086", "0.58826226", "0.5882577", "0.58804375", "0.587005", "0.58292186", "0.58206254", "0.58162254", "0.58147395", "0.58140796", "0.57782996", "0.57675385", "0.57641214", "0.5747512", "0.5729653", "0.5719727", "0.5709157", "0.5686914", "0.5684481", "0.5681151", "0.5674456", "0.5666487", "0.56494343", "0.56386626", "0.5619168", "0.5610068", "0.5601851", "0.5598341", "0.5594957", "0.5590631", "0.55851144", "0.55833495", "0.5580792", "0.5563838", "0.55536056", "0.55496365", "0.553909", "0.5526801", "0.5524418", "0.5519864", "0.5519055", "0.5508588", "0.5508442", "0.5504238", "0.5496509", "0.5487902", "0.5474133", "0.54740465", "0.5467356", "0.54603004", "0.5456479", "0.5448164", "0.544518", "0.5435179", "0.5431431", "0.54199886", "0.5418767", "0.54109144", "0.5408782", "0.54072714", "0.54042614", "0.5403711", "0.5402664", "0.54009855", "0.5396907", "0.5382707", "0.53765106", "0.53742903", "0.5373298", "0.5368767", "0.53628397", "0.5351267", "0.53478634", "0.53471655", "0.5346534", "0.53460205", "0.5345889", "0.53455555", "0.5344068" ]
0.7754725
0
Prints out the content of the sequence between the given range.
public void printSequence(int l, int r) { for (int i = 1; i <= 10; i++) { System.out.print(sequence[i + 1]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void print() {\n int n = getSeq().size();\n int m = n / printLength;\n for (int i = 0; i < m; i++) {\n printLine(i * printLength, printLength);\n }\n printLine(n - n % printLength, n % printLength);\n System.out.println();\n }", "public static void show(){\n IntStream.rangeClosed(1,5)\n .forEach(System.out::println);\n }", "public void printRangeFibonacci() {\n BigInteger before = BigInteger.valueOf(0);\n BigInteger current = BigInteger.valueOf(1);\n BigInteger next = BigInteger.valueOf(1);\n for (int i = 2; i <= finish; i++) {\n next = current.add(before);\n before = current;\n current = next;\n\n if (i >= start && i <= finish) {\n String delimiter = i == finish ? \"\" : \", \";\n out.print(before + delimiter);\n }\n }\n }", "public static void main(String[] args) {\n\t\tprintRange('q', 'r');\n\t}", "public void printRange(AnyType lower, AnyType upper) {\r\n\t\tif (lower.compareTo(upper) > 0) {\r\n\t\t\tAnyType temp = lower;\r\n\t\t\tlower = upper;\r\n\t\t\tupper = temp;\r\n\t\t} // if (switches values to check and use them)\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\tprintRange(root, lower, upper);\r\n\t\t} // else\r\n\t}", "private static void display(Segment[] intervals) {\n\t\tfor(int i=0;i<intervals.length;i++){\n\t\t\tSystem.out.println(intervals[i].getStart()+\" \"+intervals[i].getEnd());\n\t\t}\n\t}", "public void getRange()\n\t{\n\t\tint start = randInt(0, 9);\n\t\tint end = randInt(0, 9);\t\t\n\t\tint startNode = start<=end?start:end;\n\t\tint endNode = start>end?start:end;\n\t\tSystem.out.println(\"Start : \"+startNode+\" End : \"+endNode);\n\t}", "public StringBuffer rangeToString(Key low, Key high)\n {\n \t\n \tStringBuffer str=new StringBuffer();\n \t\n \tint l=(int) low;\n \tint h=(int) high;\n \tfor(int ch=l;ch<=h;ch++)\n \tstr.append(ch);\n \treturn str;\n \t \t\n }", "public static void main(String[] args) {\n\t\tint start = 100;\r\n\t\tint end = 1;\r\n\t\t//int add = 1;\r\n\t\twhile (start>=end) {\r\n\t\t\tSystem.out.println(start);\r\n\t\t\t//start = start - add;\r\n\t\t\tstart--;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\n\t\tint [] numbers = {1,2,3,4,5,6,7,8,9,10};\n\n\t\tint Startrange = 3;\n\t\tint Endrange = 7;\n\n\t\tfor(int i = 0; i < numbers.length; ++i) {\n\n\t\t\tif (!(numbers[i] > Startrange && numbers[i] < Endrange )){\n\t\t\t\tSystem.out.print(numbers[i] + \" \");\n\t\t\t}\t\n\n\t\t}\n\n\t}", "@Override\r\n public String toString() {\r\n return \"Range [\" + \"min=\" + min + \", max=\" + max + \"]\";\r\n }", "public void startNumberMethod(int startNumber) {\n for (int i = startNumber; i <= 100; i++) {\n System.out.println(i);\n }\n }", "protected void printContentRange(List content, int start, int end,\r\n Writer out, int level,\r\n NamespaceStack namespaces)\r\n throws IOException {\r\n boolean firstNode; // Flag for 1st node in content\r\n Object next; // Node we're about to print\r\n int first, index; // Indexes into the list of content\r\n\r\n index = start;\r\n while( index < end) {\r\n firstNode = (index == start) ? true : false;\r\n next = content.get( index);\r\n\r\n //\r\n // Handle consecutive CDATA and Text nodes all at once\r\n //\r\n if (next instanceof Text) {\r\n first = skipLeadingWhite( content, index);\r\n // Set index to next node for loop\r\n index = nextNonText( content, first);\r\n\r\n // If it's not all whitespace - print it!\r\n if (first < index) {\r\n if (!firstNode)\r\n newline(out);\r\n indent(out, level);\r\n printTextRange( content, first, index, out);\r\n }\r\n continue;\r\n }\r\n\r\n //\r\n // Handle other nodes\r\n //\r\n if (!firstNode) {\r\n newline(out);\r\n }\r\n\r\n indent(out, level);\r\n\r\n if (next instanceof Comment) {\r\n printComment((Comment)next, out);\r\n }\r\n else if (next instanceof Element) {\r\n printElement((Element)next, out, level, namespaces);\r\n }\r\n else if (next instanceof EntityRef) {\r\n printEntityRef((EntityRef)next, out);\r\n }\r\n else if (next instanceof ProcessingInstruction) {\r\n printProcessingInstruction((ProcessingInstruction)next, out);\r\n }\r\n else {\r\n // XXX if we get here then we have a illegal content, for\r\n // now we'll just ignore it (probably should throw\r\n // a exception)\r\n }\r\n\r\n index++;\r\n } /* while */\r\n }", "private void Show (int inicio, int fin){\n int start = inicio;\n int end = fin; \n for(int i = start; i<=end; i++){\n areaT.append(this.letrasTexto[i]);\n } \n areaT.append(this.tipo.getDescripcion()+\"\\n\");\n }", "public static void main(String[] args) {\n\t\ttry {\r\n\t\t\t//int start = Integer.parseInt(args[0]);//larger number\r\n\t\t\t//int end = Integer.parseInt(args[1]);\r\n\t\t\tint start=20,end=10;\r\n\t\t\t\tfor(int j=start;j>=end;j--) {\r\n\t\t\t\t\tSystem.out.println(j+\" \");\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println();\r\n\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Error\");\r\n\t\t}\r\n\t}", "public static void runPrint(int numbers, int min, int max){\r\n a1q1Obj object = new a1q1Obj();\r\n System.out.println(\"Welcome to the Not-So-Secure (NNS) pseudo-random number generator.\");\r\n System.out.println(\"Numbers cost $0.25 apiece\");\r\n System.out.printf(\"Generating %d random numbers in the range [%d, %d]\\n\",numbers,min,max); \r\n System.out.println(object.printRandomSample(numbers,min,max)+\"\\n\"); \r\n }", "public void showLineage() {\n\t\tfor (Iterator i = this.getLineage().iterator(); i.hasNext();) {\n\t\t\tprtln((String) i.next());\n\t\t}\n\t}", "public String toString() {\n/* 387 */ if (this.toString == null) {\n/* 388 */ StrBuilder buf = new StrBuilder(32);\n/* 389 */ buf.append(\"Range[\");\n/* 390 */ buf.append(this.min);\n/* 391 */ buf.append(',');\n/* 392 */ buf.append(this.max);\n/* 393 */ buf.append(']');\n/* 394 */ this.toString = buf.toString();\n/* */ } \n/* 396 */ return this.toString;\n/* */ }", "public static void printNum() {\n\t\tfor(int i = 1; i<= 20; i++) {\n\t\t\tSystem.out.print(\" \" + i);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\t}", "public void print(){\n String res = \"\" + this.number;\n for(Edge edge: edges){\n res += \" \" + edge.toString() + \" \";\n }\n System.out.println(res.trim());\n }", "@Override\r\n\tpublic String toString()\r\n\t{\r\n\t\treturn this.getIndentation() + \"(in-subrange \" + this.getPosition1().getCoordX() + \", \" + this.getPosition1().getCoordY() + \", \"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t + this.getPosition2().getCoordX() + \", \" + this.getPosition2().getCoordY() + \")\";\r\n\t}", "String getBeginRange();", "public void printRing(PrintStream outs)\n {\n Map<Range, List<EndPoint>> rangeMap = getRangeToEndpointMap();\n \n // Print range-to-endpoint mapping\n int counter = 0;\n for (Range range : rangeMap.keySet()) {\n List<EndPoint> endpoints = rangeMap.get(range);\n \n outs.print(String.format(\"%-46s \", range.left()));\n outs.print(String.format(\"%2d \", endpoints.size()));\n outs.print(String.format(\"%-15s\", endpoints.get(0).getHost()));\n \n String asciiRingArt;\n if (counter == 0)\n {\n asciiRingArt = \"|<--|\";\n }\n else if (counter == (rangeMap.size() - 1))\n {\n asciiRingArt = \"|-->|\";\n }\n else\n {\n if ((rangeMap.size() > 4) && ((counter % 2) == 0))\n {\n asciiRingArt = \"v |\";\n }\n else if ((rangeMap.size() > 4) && ((counter % 2) != 0))\n {\n asciiRingArt = \"| ^\";\n }\n else\n {\n asciiRingArt = \"| |\";\n }\n }\n outs.println(asciiRingArt);\n \n counter++;\n }\n }", "public void print() {\n\t\t\n\t\tfor (int j = 0; j < height(); j++) {\n\t\t\tfor (int i = 0; i < width(); i++) {\n\t\t\t\tSystem.out.printf(\"%3d \", valueAt(i, j));\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t\tSystem.out.printf(\"\\n\");\t\n\t}", "private static void printNumber(){\r\n\t\tfor(int i = 1;i <= 10; i++)\r\n\t\t\tSystem.out.println(i);\r\n\t}", "private void show_text()\n {\n NumberFormat f = NumberFormat.getInstance();\n f.setGroupingUsed( false );\n setText( label + \" \" +\n START + \" \" + f.format(min) + \n SEPARATOR + f.format(max) + \n \" \" + END );\n }", "public static void main(String[] args) {\n System.out.println(\"Random Number is :\"+ Range());\n }", "public Integer oneToThis(int start, int ending){\n\t\tSystem.out.println(\"Print 1-255\");\n\t\twhile(start <= ending){\n\t\t\tSystem.out.println(start);\n\t\t\tstart++;\n\t\t}\n\t\treturn 0;\n\t}", "public StringView toStringView(QueryLocationRange range) {\n int start = offsetToIndex(range.getStartByteOffset());\n int end = offsetToIndex(range.getEndByteOffset());\n return StringView.of(query, start, end);\n }", "@Override\r\n\tpublic String getActivity_range() {\n\t\treturn super.getActivity_range();\r\n\t}", "public static void main(String[] args) {\n\t\tSummaryRanges obj = new SummaryRanges();\n\t\tobj.addNum(1);\n\t\t\n\t\tfor (Interval interval: obj.getIntervals()) {\n\t\t\tSystem.out.print(\"[\" + interval.start + \",\" + interval.end + \"]\");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\tobj.addNum(3);\n\t\t\n\t\tfor (Interval interval: obj.getIntervals()) {\n\t\t\tSystem.out.print(\"[\" + interval.start + \",\" + interval.end + \"]\");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\tobj.addNum(7);\n\t\t\n\t\tfor (Interval interval: obj.getIntervals()) {\n\t\t\tSystem.out.print(\"[\" + interval.start + \",\" + interval.end + \"]\");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\tobj.addNum(2);\n\t\t\n\t\tfor (Interval interval: obj.getIntervals()) {\n\t\t\tSystem.out.print(\"[\" + interval.start + \",\" + interval.end + \"]\");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\tobj.addNum(6);\n\t\t\n\t\tfor (Interval interval: obj.getIntervals()) {\n\t\t\tSystem.out.print(\"[\" + interval.start + \",\" + interval.end + \"]\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "@Override\n\tpublic void print() {\n\t\tSystem.out.print(amount + \" \" + currencyFrom + \" to \" + currencyTo + \" is \" + ans);\n\t}", "@Override\r\n\tpublic void run() {\n\t\tfor(int i =1; i<=lastNum;i++)\r\n\t\t{\r\n\t\t\tSystem.out.print(\" \"+i);\r\n\t\t}\r\n\t}", "T println(String data, int from, int len) throws PrintingException, StringIndexOutOfBoundsException;", "private static void passoutNum(int start, int end) {\n\t\tlindOfNum(0, start);\n\n\t\tif(start == end) {\n\t\t\t//System.out.println(end);\n\t\t\treturn;\n\t\t}\n\t\t//System.out.print(start);\n\t\tpassoutNum(start + 1, end);\n\t\tlindOfNum(0, start);\n\n\t}", "public static void printEvenNumbers(int from, int to){\n for(int i=from; i<=to; i++){\n if(i%2==0){\n System.out.print(i + \" \");\n }\n }\n System.out.println();\n }", "@Override\r\n\tpublic void printResult() {\n\t\tfor(Integer i:numbers)\r\n\t\t{\r\n\t\t\tSystem.out.println(i+\" \");\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\r\n public String toString() \r\n {\n return \"[\" + getStart() + \", \" + getEnd() + \"]\";\r\n }", "public void printSummary() {\n\t\tSystem.out.println(MessageFormat.format(\"\\nSummary:\\n Name: {0}\\n Range: 1 to {1}\\n\", this.name, this.numSides));\n\t}", "@Override\n public void print() {\n for (int i = 1; i <= itertion; i++) {\n if(n <0){\n this.result = String.format(\"%-3d %-3s (%-3d) %-3s %d \", i, \"*\", n, \"=\", (n * i));\n System.out.println(this.result);\n }else {\n this.result = String.format(\"%-3d %-3s %-3d %-3s %d \", i, \"*\", n, \"=\", (n * i));\n System.out.println(this.result);\n }\n }\n }", "void printBed(Variant seqChange, float score) {\n\t\tSystem.out.print(seqChange.getChromosomeName() //\n\t\t\t\t+ \"\\t\" + (seqChange.getStart()) //\n\t\t\t\t+ \"\\t\" + (seqChange.getEnd() + 1) // End base is not included in BED format\n\t\t\t\t+ \"\\t\" + seqChange.getId() //\n\t\t);\n\n\t\tif (score > minScore) System.out.print(String.format(\"\\t%.3f\", score));\n\t\tSystem.out.println(\"\");\n\t}", "public static void main(String[] args) {\n IntStream\n .range(1, 10) //loops 1-9\n .forEach(System.out::println); //for each element print them\n System.out.println();\n\n }", "public void print() {\n for (int i=0; i<lines.size(); i++)\n {\n System.out.println(lines.get(i));\n }\n }", "public void print() \n //POST:\tThe contents of the linked list are printed\n\t{\n\t\tNode<T> tmp = start;\n\t\tint count = 0; //counter to keep track of how many loops occur\n\t\tif(length == 0) //if empty list \n\t\t{\n\t\t\tSystem.out.println(\"0: []\");\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\"start: \" + tmp.value);\n\t\tSystem.out.print(length + \": [\");\n\n\t\t//while the end of the list is not reached and it has not already looped once\n\t\twhile((tmp.next != start && count == 0) || count < 1) \n\t\t{\n\t\t\tSystem.out.print(tmp.value.toString() + \", \");\n\t\t\tif(tmp.next == start) //if we have reached the end of the list\n\t\t\t{\n\t\t\t\tcount++;\t\t//increment loop counter\n\t\t\t}\n\t\t\ttmp = tmp.next;\t\t//traverse list\n\t\t}\n\t\tSystem.out.print(\"]\\n\");\n\t}", "public void print()\n {\n System.out.println(\"Course: \" + title + \" \" + codeNumber);\n \n module1.print();\n module2.print();\n module3.print();\n module4.print();\n \n System.out.println(\"Final mark: \" + finalMark + \".\");\n }", "private String useRangeFormat(Unit units, int lowerBound, int upperBound) {\n return lowerBound + \" to \" + upperBound + getUnits(units, upperBound);\n }", "public void printForward(){\n int k=start;\n for(int i=0;i<size;i++){\n System.out.print(cir[k]+\",\");\n k=(k+1)%cir.length;\n }\n System.out.println();\n }", "public static void main(String[] args) {\n\n\t\tint a=100;\n\t\tint b=21;\n\t\t\n\t\tfor(int i=a;i>=b;i--) {\n\t\t\tSystem.out.print(i + \", \");\n\t\t}\n\t\t\t\n\t}", "public void print();", "public void print();", "public void print();", "public void print();", "public void fizzBuzzBar(int upperRange)\n {\n String result = \"\";\n for(int i = 1; i <= upperRange; i++) {\n if (i % 3 == 0) {\n result += \"Fizz\";\n }\n if (i % 5 == 0) {\n result += \"Buzz\";\n }\n if(i % 7 == 0)\n {\n result += \"Bar\";\n }\n if( result.isEmpty())\n {\n result += String.valueOf(i);\n }\n System.out.println(result);\n\n result = \"\";\n }// end for\n }", "@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 static void main(String[] args) {\n\t\tint first;\n\t\tint second;\n\t\tfor (first=0; first <=5; first++) {\n\t\t\tfor (second=0; second<=5;second++) {\n\t\t\t\tSystem.out.printf(\"%d%d\\t\",first,second);//is there any kind of methode u can represent with 00\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t}", "public static void printOddNumbers (int from, int to) {//when we dont know the range\n for(int i=from; i<=to; i++){\n if(i%2!=0){\n System.out.print(i + \" \");\n }\n\n }\n System.out.println();\n }", "public static void main(String[] args) {\n\n\t\tint number = 20;\n\n\t\twhile (number >= 2) {\n\t\t\tSystem.out.println(number);\n\t\t\tnumber -= 2;\n\n\t\t}\n\t\tSystem.out.println(\"--------01------------\");\n\n\t\tint num = 2;\n\n\t\twhile (num <= 20) {\n\t\t\tSystem.out.println(num);\n\t\t\tnum += 2;\n\t\t}\n\t}", "private String select(int start, int end) {\n this.selection = null;\n\n if (start >= end) {\n //return sb.toString();\n return printList();\n }\n if (start < 0 || start > sb.length()) {\n //return sb.toString();\n return printList();\n }\n this.selection = new Selection(start, Math.min(end, sb.length()));\n\n //return sb.toString();\n return printList();\n }", "@Override\n\tpublic String toString(){\n return description + \"\\n\" + SequenceUtils.format(sequence);\n\t}", "public static void main(String[] args) {\n IntStream.range(0, 10)\n .forEach(System.out::print);\n\n System.out.println();\n\n // print the range of elements but skip first 5\n IntStream.range(0, 10)\n .skip(5)\n .forEach(System.out::print);\n\n // Integer stream with sum\n System.out.println(\n IntStream\n .range(0, 10)\n .sum());\n\n }", "public void fizzBuzz(int upperRange)\n {\n for(int i = 1; i <= upperRange; i++) {\n if ((i % 3 == 0) && (i % 5 == 0))\n {\n System.out.println(\"FizzBuzz\");\n }\n else if (i % 3 == 0) {\n System.out.println(\"Fizz\");\n }\n else if (i % 5 == 0) {\n System.out.println(\"Buzz\");\n }\n else\n {\n System.out.println(i);\n }\n }// end for\n }", "public void print()\n {\n for (int i=0; i<list.length; i++)\n System.out.println(i + \":\\t\" + list[i]);\n }", "public static void main(String[] args) {\n\t\tint a=4;\r\n\t\tint b=16;\r\n\t\tfor (int i=1; i<5; i++){\r\n\t\t\tfor (int j=b; j>=a; j=j-4){\r\n\t\t\t\tSystem.out.print(j);\r\n\t\t\t\tSystem.out.print(\"\\t\");\r\n\t\t\t}\r\n\t\t\tb--;\r\n\t\t\ta--;\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public void print() \r\n\t{\r\n\t\tif(debug)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Debug - Starting print\");\r\n\t\t}\r\n\t\t\r\n\t\tfor (int index = 0; index < count; index++) \r\n\t\t{\r\n\t\t\tif (index % 5 == 0) \r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\r\n\t\t\tif(debug)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"\\nDebug - numArray[index] = \" + numArray[index]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.print(numArray[index] + \"\\t\");\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\tif(debug)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Debug - Ending print\");\r\n\t\t}\r\n\t}", "public void print() {\r\n\t\t System.out.println(toString());\r\n\t }", "public void selectRange(String currentRange);", "public void printAlignment(SWGAlignment alignment){\n\t\t\tString \torigSeq1 = alignment.getOriginalSequence1().toString(),\n\t\t\t\t\torigSeq2 = alignment.getOriginalSequence2().toString(),\n\t\t\t\t\talnSeq1 = new String(alignment.getSequence1()),\n\t\t\t\t\talnSeq2 = new String(alignment.getSequence2());\n\t\t\tint \tstart1 = alignment.getStart1(),\n\t\t\t\t\tstart2 = alignment.getStart2(),\n\t\t\t\t\tgap1 = alignment.getGaps1(),\n\t\t\t\t\tgap2 = alignment.getGaps2();\n\t\t\t\n\t\t\tString seq1, seq2, mark;\n\t\t\tif(start1>=start2){\n\t\t\t\tseq1=origSeq1.substring(0, start1) + alnSeq1 + origSeq1.substring(start1+alnSeq1.length()-gap1);\n\t\t\t\tString \tseq2Filler = start1==start2?\"\":String.format(\"%\"+(start1-start2)+\"s\", \"\"),\n\t\t\t\t\t\tmarkFiller = start1==0?\"\":String.format(\"%\"+start1+\"s\", \"\");\n\t\t\t\tseq2= seq2Filler + origSeq2.substring(0, start2) + alnSeq2 + origSeq2.substring(start2+alnSeq2.length()-gap2);\n\t\t\t\tmark= markFiller+String.valueOf(alignment.getMarkupLine());\n\t\t\t}else{\n\t\t\t\tseq2=origSeq2.substring(0, start2) + alnSeq2 + origSeq2.substring(start2+alnSeq2.length()-gap2);\n\t\t\t\tString \tmarkFiller = start2==0?\"\":String.format(\"%\"+start2+\"s\", \"\");\n\t\t\t\tseq1=String.format(\"%\"+(start2-start1)+\"s\", \"\") + origSeq1.substring(0, start1) + alnSeq1 + origSeq1.substring(start1+alnSeq1.length()-gap1);\n\t\t\t\tmark=markFiller+String.valueOf(alignment.getMarkupLine());\n\t\t\t}\n\t\t\tSystem.out.println(alignment.getSummary());\n\t\t\tSystem.out.println(seq1);\n\t\t\tSystem.out.println(mark);\n\t\t\tSystem.out.println(seq2);\n\t\t}", "public void print() {\n\t\tif(log.isTraceEnabled()) {\n\t\t\tlog.info(\">> print()\");\n\t\t}\n\t\tSystem.out.println(p + \"/\" + q);\n\t\tif(log.isTraceEnabled()) {\n\t\t\tlog.info(\"<< print()\");\n\t\t}\n\t}", "T print(String data, int from, int len) throws PrintingException, StringIndexOutOfBoundsException;", "public void print() {\n System.out.println(toString());\n }", "VocNoun getRange();", "public static void main(String[] args) {\n StringBuilder numbers = new StringBuilder();\n for (int i = 1; i < 5; i++) {\n numbers.append(i);\n }\n System.out.println(numbers.toString());\n }", "public String print();", "public String getRange() {\n return this.range;\n }", "protected void appendSelectRange(SQLBuffer buf, long start, long end) {\n buf.append(\" FETCH FIRST \").append(Long.toString(end)).\r\n append(\" ROWS ONLY\");\r\n }", "public void start(int range) {\n start(mRangeStart, range, mIsPositive);\n }", "public void showContent() {\n createStream().forEach(System.out::println);\n }", "public void printForward() {\r\n int k = start;\r\n for (int i = 0; i < size; i++) {\r\n if (i == size - 1) {\r\n System.out.print(cir[k] + \".\");\r\n } else {\r\n System.out.print(cir[k] + \", \");\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n System.out.println();\r\n }", "public void print1T0255(){\n StringBuilder out = new StringBuilder();\n for (int i = 1; i <= 255; i++){\n out.append( i + \" \");\n }\n System.out.println( out.toString());\n }", "void print();", "void print();", "void print();", "void print();", "void print();", "public void print() {\n\t\tSystem.out.println(toString());\n\t}", "public void print()\r\n {\r\n System.out.println(\"From: \" + from);\r\n System.out.println(\"To: \" + to);\r\n System.out.println(\"Subject: \" + subject);\r\n System.out.println(\"Message: \" + message);\r\n }", "public void print() {\r\n\t\tfor (int i = front; i <= rear; i++) {\r\n\t\t\tSystem.out.print(arr[i].getData() + \"\\t\");\r\n\t\t}\r\n\t}", "public String toString()\n {\n return _xstr.subSequence(_start, _end).toString();\n }", "public void print(){\r\n System.out.println(toString());\r\n }", "public void print() {\n print$$dsl$guidsl$guigs();\n System.out.print( \" eqn =\" + eqn );\n }", "private void printLine(int n, int k) {\n System.out.printf(\"%4d- \", n + 1);\n for (int i = 0; i < k; i++) {\n if (i % 10 == 0) System.out.printf(\" \");\n System.out.printf(\"%c\", seq.get(i + n));\n }\n for (int i = k; i < printLength; i++) {\n if (i % 10 == 0) System.out.printf(\" \");\n System.out.printf(\" \");\n }\n System.out.printf(\" -%4d\\n\", n + printLength);\n }", "public void print() {\r\n System.out.println(c() + \"(\" + x + \", \" + y + \")\");\r\n }", "public static void printAlphabetInRange(char beginning, char ending ){\n\n if(beginning<ending){\n System.out.println(\"we need to increment from \" + beginning+\" till \"+ending);\n for (char i = beginning; i <=ending ; i++) {\n System.out.print(i+\" \");\n }\n System.out.println();\n }else if (beginning>ending){\n System.out.println(\"we need to decrement from \" + beginning+\" till \"+ending);\n for (char i = beginning; i >=ending ; i--) {\n System.out.print(i+\" \");\n }\n System.out.println();\n }else{\n System.out.println(\"They are same character\");\n }\n\n }", "public void mostrar() {\r\n\t\tfor (int i = 0; i < bolsa.length; i++) {\r\n\t\t\tSystem.out.printf(\"#%d: %d\\t\", i, bolsa[i]);\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "java.lang.String getDestRange();", "@Override\n\t\t\tpublic void print() {\n\t\t\t\t\n\t\t\t}", "public static void main(String args[]) {\n\n int start = Integer.parseInt(args[0]);\n int end = Integer.parseInt(args[1]);\n\n System.out.println(\"\\nArmstrong numbers within the range \" + start + \" - \" + end + \" are as follows: \");\n\n for(int number = start; number <= end; number++) {\n\n int sum = 0;\n int original = 0;\n int digits = 0;\n\n original = number;\n\n while(original > 0) {\n digits++;\n original = original / 10;\n }\n\n original = number;\n\n while(original > 0) {\n int remainder = original % 10;\n sum = sum + (int) Math.pow((double)remainder, (double)digits);\n original = original / 10;\n }\n\n if(number == sum) {\n System.out.print(number + \" \");\n }\n }\n\n System.out.println(\"\\n\");\n\n }", "protected static String expectedRangeString(Object minValue, boolean minInclusive, Object maxValue, boolean maxInclusive) {\n // A means for a return value\n String retVal;\n\n // Start with the proper symbol for the lower bound\n if (minInclusive) {\n retVal = \"[\";\n } else {\n retVal = \"(\";\n }\n\n // Add in the minimum and maximum values\n retVal += minValue + \" .. \" + maxValue;\n\n // End with the proper symbol for the upper bound\n if (maxInclusive) {\n retVal += \"]\";\n } else {\n retVal += \")\";\n }\n\n // Return the formatted string\n return retVal;\n }", "@Override\n\tpublic int getRange() {\n\t\treturn range;\n\t}", "public String toString()\n {\n return \"(\" + start + \"->\"+ (start+size-1) + \")\";\n }" ]
[ "0.6417904", "0.61782724", "0.5967377", "0.5877842", "0.58728", "0.5845504", "0.5841277", "0.583574", "0.56862676", "0.56725943", "0.56319445", "0.5618636", "0.5583593", "0.5561283", "0.55538774", "0.5550642", "0.5514967", "0.5503762", "0.548973", "0.5460275", "0.5459598", "0.5449996", "0.54469454", "0.54192424", "0.5380061", "0.53537893", "0.53523284", "0.53405035", "0.5333655", "0.5333643", "0.53144044", "0.5310048", "0.5299722", "0.5295803", "0.52844626", "0.5282589", "0.5277919", "0.52717805", "0.52709943", "0.5266943", "0.5247965", "0.524655", "0.5210507", "0.51978606", "0.5195189", "0.5192017", "0.518946", "0.5186665", "0.5172766", "0.5172766", "0.5172766", "0.5172766", "0.5170881", "0.5163141", "0.5161263", "0.5151083", "0.51503205", "0.51438296", "0.51395434", "0.51386136", "0.513848", "0.51380736", "0.51373446", "0.51291466", "0.51265585", "0.5124342", "0.5121024", "0.51174456", "0.5106421", "0.50886756", "0.5077988", "0.50777394", "0.507633", "0.5075651", "0.50747204", "0.5073877", "0.5057106", "0.50530034", "0.50511914", "0.5044499", "0.5044499", "0.5044499", "0.5044499", "0.5044499", "0.50432265", "0.5042532", "0.50394344", "0.5038702", "0.50364125", "0.50321203", "0.5030419", "0.5025408", "0.5025341", "0.5024203", "0.5018603", "0.50156814", "0.50027764", "0.49949488", "0.4994898", "0.499028" ]
0.62841177
1
Swaps the element at i with the element at j.
private void swapAt(int i, int j) { float tmp = sequence[i]; sequence[i] = sequence[j]; sequence[j] = tmp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void swap(int i, int j){\n \t\tint temp = a[i];\n \t\ta[i] = a[j];\n \t\ta[j] = temp;\n }", "private void swap(int i, int j) {\n\t\tint tmp = data.get(i);\n\t\tdata.set(i, data.get(j));\n\t\tdata.set(j, tmp);\n\t}", "@Override\n protected void swap(int i, int j)\n {\n E temp = this.elements[i];\n this.elements[i] = this.elements[j];\n \tthis.elementsToArrayIndex.put(elements[i], i);\n this.elements[j] = temp;\n \tthis.elementsToArrayIndex.put(elements[j], j);\n }", "private void swap(int i, int j) {\n\t\t//gets elements\n\t\tPair e1 = heap.get(i);\n\t\tPair e2 = heap.get(j);\n\t\t//swaps them in heap\n\t\theap.remove(i);\n\t\theap.add(i,e2);\n\t\theap.remove(j);\n\t\theap.add(j,e1);\n\t\t//removes and re-adds their mappings\n\t\tlocation.remove(e1.element);\n\t\tlocation.remove(e2.element);\n\t\tlocation.put((int)e1.element, j);\n\t\tlocation.put((int)e2.element, i);\n\t}", "private void swap(int i, int j) {\n\t\tlong temp = a[i];\n\t\ta[i] = a[j];\n\t\ta[j] = temp;\n\t}", "private void exchange(int i, int j){\n\t\tnode_data t = _a[i];\n\t\t_a[i] = _a[j];\n\t\t_a[j] = t;\n\t}", "private void exchange(int i, int j){\n\t\tString temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n\t}", "public void swap(int i, int j) {\n int temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }", "private static <E> void swap(ArrayList<E> a, int i, int j) {\n\t\tE t = a.get(i);\n\t\ta.set(i, a.get(j));\n\t\ta.set(j, t);\n\t}", "private static <E> void swap(ArrayList<E> a, int i, int j) {\n\t\tE t = a.get(i);\n\t\ta.set(i, a.get(j));\n\t\ta.set(j, t);\n\t}", "private void exchange(int i, int j) {\n int temp = numbers[i];\n numbers[i] = numbers[j];\n numbers[j] = temp;\n \n }", "private void swap(int i, int j) {\n Item tmp = heap[i-1];\n heap[i-1] = heap[j-1];\n heap[j-1] = tmp;\n }", "public static void swap (int[] elts, int i, int j) {\r\n\t\tint temp = elts[i];\r\n\t\telts[i] = elts[j];\r\n\t\telts[j] = temp;\r\n\t}", "public static void swap (int[] elts, int i, int j) {\r\n\t\tint temp = elts[i];\r\n\t\telts[i] = elts[j];\r\n\t\telts[j] = temp;\r\n\t}", "private static void swap(int[] arr, int j) {\n\t\t\n\t\tint temp = arr[j];\n\t\tarr[j] = arr[j+1];\n\t\tarr[j+1] = temp;\n\t}", "private void swap(int[] nums, int i, int j) {\n\t\tint tmp=nums[i];\n\t\tnums[i]=nums[j];\n\t\tnums[j]=tmp;\n\t}", "public static void swap(List<Integer> values, int i, int j) {\r\n int temp = values.get(i);\r\n values.set(i, values.get(j));\r\n values.set(j, temp);\r\n }", "private void swap(int[] nums, int i, int j) {\n int temp = nums[i];\n nums[i] = nums[j];\n nums[j] = temp;\n }", "public static void swap(Integer arr[], int i, int j)\n {\n int tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n }", "public static void swap(int arr[], int i, int j){\n int tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n }", "public static void swap(int arr[], int i, int j) {\n int tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n }", "private static void swap(int[] array, int j, int i) {\r\n\t\tint temp = array[i];\r\n\t\tarray[i] = array[j];\r\n\t\tarray[j] = temp;\r\n\t}", "void exchange(Node[] arr, int i, int j) {\n\n\t\tNode temp = arr[i];\n\t\tarr[i] = arr[j];\n\t\tarr[j] = temp;\n\t}", "public void swap(int i, int j) {\n swapRows(i, j);\n swapColumns(i, j);\n }", "protected void swap(int i, int j) {\n Card temp = cards[i];\n cards[i] = cards[j];\n cards[j] = temp;\n }", "private void swap(int []a, int i, int j){\n\t\tint temp = a[i];\n\t\ta[i] = a[j];\n\t\ta[j] = temp;\n\t}", "private static void swap(int[] a, int i, int j) {\n int swap = a[i];\n a[i] = a[j];\n a[j] = swap;\n }", "private static void swap(List<Integer> list, int i, int j){\n int temp = list.get(i);\n list.set(i,list.get(j));\n list.set(j, temp);\n }", "public void swap(int[] nums, int i, int j) {\n int temp = nums[i];\n nums[i] = nums[j];\n nums[j] = temp;\n }", "public static void swap(int[] arr, int i, int j) {\r\n int temp = arr[i];\r\n arr[i] = arr[j];\r\n arr[j] = temp;\r\n }", "private void swap(int[] a, int i, int j) {\n int tmp = a[i];\n a[i] = a[j];\n a[j] = tmp;\n }", "private void swap( int i, int j )\n {\n\t\n\tString jStr = _fruits[j] ;\n\t_fruits[j] = _fruits[i];\n\t_fruits[i] = jStr;\n }", "private static void swap(int[] array, int i, int j) {\n\n int temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }", "public static void swap(int[] arr,int i,int j){\n int temp=arr[i];\n arr[i]=arr[j];\n arr[j]=temp;\n }", "public static void swap(int[] arr, int i, int j) {\n System.out.println(\"Swapping index \" + j + \" and index \" + i);\n int temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }", "@Override\n \tpublic void swap(int i, int j) {\n \t\tint t=data[i];\n \t\tdata[i]=data[j];\n \t\tdata[j]=t;\n \t}", "private void swap(int i, int j) {\n double[] temp = data[i];\n data[i] = data[j];\n data[j] = temp;\n }", "public static void swap(int i, int j, int[] arr)\n {\n int temp=0;\n temp=arr[i];\n arr[i]=arr[j];\n arr[j]=temp;\n }", "private void exchange(int i, int j) {\r\n\t\t//swap values\r\n\t\tint temp = mutualNum[i];\r\n\t\tmutualNum[i] = mutualNum[j];\r\n\t\tmutualNum[j] = temp;\r\n\t\t//swap the same friends\r\n\t\tString Stemp = potentialFriends[i];\r\n\t\tpotentialFriends[i] = potentialFriends[j];\r\n\t\tpotentialFriends[j] = Stemp;\r\n\t}", "public static void swap(int[] input, int i, int j){\n\t\tint temp = input[i];\n\t\tinput[i] = input[j];\n\t\tinput[j] = temp;\n\t}", "private static void swap(int[] A, int i , int j){\r\n\t\tint temp = A[i];\r\n\t\tA[i] = A[j];\r\n\t\tA[j] = temp;\r\n\t}", "private static void exch(Object[] a, int i, int j) {\n Object swap = a[i];\n a[i] = a[j];\n a[j] = swap;\n }", "private static void exch(Object[] a, int i, int j) {\n Object swap = a[i];\n a[i] = a[j];\n a[j] = swap;\n }", "private static void exch(Object[] a, int i, int j) {\n Object swap = a[i];\n a[i] = a[j];\n a[j] = swap;\n }", "public static void swap(int[] a, int i, int j)\n {\n int temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }", "static void swap(int[] A, int i, int j) {\n\t\tint temp = A[i];\n\t\tA[i] = A[j];\n\t\tA[j] = temp;\n\t}", "private static void swap(int[] nums, int i, int j) {\n nums[i] += nums[j];\n nums[j] = nums[i] - nums[j];\n nums[i] = nums[i] - nums[j];\n }", "public void swap(int i, int j) {\n double[] temp = data[i];\n data[i] = data[j];\n data[j] = temp;\n }", "private static void exch(Object[] a, int i, int j) {\r\n Object swap = a[i];\r\n a[i] = a[j];\r\n a[j] = swap;\r\n }", "private static void swap(int[] A, int i, int j) {\n int temp = A[i];\n A[i] = A[j];\n A[j] = temp;\n }", "public static void swap(int[] arr, int i, int j) {\n System.out.println(\"Swapping \" + arr[i] + \" and \" + arr[j]);\n int temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }", "void swap(int[] array, int i, int j) {\n\t\tint t = array[i];\n\t\tarray[i] = array[j];\n\t\tarray[j] = t;\n\t}", "static void swap(int[] array, int i, int j) {\n if (i >= 0 && j >= 0 && i < array.length && j < array.length) {\n int tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n }", "public static void swap(int[] array, int i, int j)\n {\n int temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }", "private int[] swap(int[] a, int i, int j) {\n int tmp;\n tmp = a[i];\n a[i] = a[j];\n a[j] = tmp;\n return a;\n }", "public static void swap(int[] array, int i, int j) {\n if (i == j) {\n return;\n }\n int temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }", "public static void swapPosts(int[][] view, int i, int j) {\n int[] temp = view[i];\n view[i] = view[j];\n view[j] = temp;\n }", "public static void swap(int[] A, int i, int j) {\n int temp = A[i];\n A[i] = A[j];\n A[j] = temp;\n }", "public static void swap(int[] array,int i, int j)\n {\n if( i==j)\n {\n return;\n }\n int temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }", "private static <E extends Comparable<? super E>> void swap(\r\n\t\t\tComparable<E>[] data, int i, int j) {\r\n\t\tComparable<E> temp = data[i];\r\n\t\tdata[i] = data[j];\r\n\t\tdata[j] = temp;\r\n\t}", "private void exchangeCards(int i, int j){\r\n\t Card temp = cards[i];\r\n\t cards[i] = cards[j];\r\n\t cards[j] = temp;\r\n\t}", "protected void exchange(int i, int j)\n {\n Key t = pq[i];\n pq[i] = pq[j];\n pq[j] = t;\n }", "private static void exch(Comparable[] a, int i, int j) {\n Comparable swap = a[i];\n a[i] = a[j];\n a[j] = swap;\n }", "private static void exch(String[] a, int i, int j) {\n String temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }", "private static void exch(String[] a, int i, int j) {\n String temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }", "public void swapInventoryItems(int i, int j) {\n\t\tint k = inv[i];\n\t\tinv[i] = inv[j];\n\t\tinv[j] = k;\n\t\tk = invStackSizes[i];\n\t\tinvStackSizes[i] = invStackSizes[j];\n\t\tinvStackSizes[j] = k;\n\t}", "public static void swap(MatchUp[] matchups, int i, int j) {\n MatchUp temp = matchups[i];\r\n matchups[i] = matchups[j];\r\n matchups[j] = temp;\r\n return;\r\n }", "private static void exch(Alumno[] a, int i, int j) {\n\t Alumno swap = a[i];\n\t a[i] = a[j];\n\t a[j] = swap;\n\t }", "public static void swap(int[]array, int i, int j) {\n\t\t\n\t\tif(i==j) {\n\t\t\treturn;\n\t\t}\n\t\tint temp = array[i];\n\t\tarray[i] = array[j];\n\t\tarray[j] = temp;\n\t}", "public static void swap(int[] array, int i, int j) {\n if (array == null || array.length == 0){\n return;\n }\n int temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n\n }", "private static void swap(char[] arr,int i,int j){\n char temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }", "private static void swap(int[] arr, int i, int j) {\n arr[i] = arr[j]^arr[i]^(arr[j] = arr[i]);\n }", "public static void swapArr(int a[], int i, int j) {\n\t\tint temp = a[i];\n\t\ta[i] = a[j];\n\t\ta[j] = temp;\n\n\t}", "public void swapRows(int i, int j) {\n swap(rowPivot, rowUnpivot, i, j);\n }", "public static void swap(int[] arr, int i, int j)\n {\n arr[i] = arr[i] ^ arr[j];\n arr[j] = arr[i] ^ arr[j];\n arr[i] = arr[i] ^ arr[j];\n }", "private static <Key extends Comparable<Key>> void exch(Key[] a, int i, int j)\n\t{\n\t\tKey tmp = a[i];\n\t\ta[i] = a[j];\n\t\ta[j] = tmp;\n\t}", "protected static void exch(Comparable[] a, int i, int j) {\n\t\t\r\n\t\tComparable temp = a[i];\r\n\t\ta[i] = a[j];\r\n\t\ta[j] = temp;\r\n\t\t\r\n\t}", "public static void swap(int[] s, int i, int j) {\n\t\tif (i == j) {\n\t\t\treturn;\n\t\t} else {\n\t\t\t// System.out.println(\"i = \" + i + \" j = \" + j);\n\t\t\ts[i] = s[i] + s[j];\n\t\t\ts[j] = s[i] - s[j];\n\t\t\ts[i] = s[i] - s[j];\n\t\t}\n\t}", "private static void swap(char[] arr, int i, int j) {\r\n\t\tchar c = arr[i];\r\n\t\tarr[i] = arr[j];\r\n\t\tarr[j] = c;\r\n\t}", "public static void swap(int[] array, int i, int j) {\n int help = array[j];\n array[j] = array[i];\n array[i] = help;\n }", "private void swapElement ( int p1, int p2 )\n\t{\n\t}", "private void exch(int i, int j) {\n \tif (i < 0 || j< 0 || j >= length() || i >= length()) \n \t\tthrow new IllegalArgumentException();\n int swap = csa[i];\n csa[i] = csa[j];\n csa[j] = swap;\n }", "public static void swap2DArr(int a[][], int i, int j, int x, int y) {\n\t\tint temp = a[i][j];\n\t\ta[i][j] = a[x][y];\n\t\ta[x][y] = temp;\n\n\t}", "private static void exchange( Comparable[] datos, int i, int j)\n\t{\n\t\t// TODO implementar\n\t\tComparable copia=datos[j];\n\t\tdatos[j]=datos[i];\n\t\tdatos[i]=copia; \n\t}", "public void reverse(int[] nums, int i, int j) {\n while (i < j) {\n int temp = nums[i];\n nums[i] = nums[j];\n nums[j] = temp;\n j--;\n i++;\n }\n }", "private Pallet exchange(int i, int j) {\n Pallet result = (Pallet) clone();\n result.pallet[i] = pallet[j];\n result.pallet[j] = pallet[i];\n return result;\n }", "private void swap(char[] chars, int i, int j) {\n\t\tchar ch = chars[i];\r\n\t\tchars[i] = chars[j];\r\n\t\tchars[j] = ch;\r\n\t}", "private static void swap(char[] a, int i, int j) {\r\n\r\n\t\tchar c;\r\n\t\tc = a[i];\r\n\t\ta[i] = a[j];\r\n\t\ta[j] = c;\r\n\t}", "private int[] swap(final int[] current, int i, int j) {\n int[] newStatus = current.clone();\n newStatus[j] = current[i];\n newStatus[i] = current[j];\n return newStatus;\n }", "private static <Key extends Comparable<Key> > void exch(Key []a, int i, int j){\n Key tmp=a[i-1];\n a[i-1]=a[j-1];\n a[j-1]=tmp;\n }", "public static void swap(String[] entrants, int i, int j) {\r\n // Swap 2 elements in array\r\n String temp = entrants[i];\r\n entrants[i] = entrants[j];\r\n entrants[j] = temp;\r\n return;\r\n }", "private void swap(int[] nums, int i, int index) {\n if (i < nums.length && index < nums.length) {\n int temp = nums[i];\n nums[i] = nums[index];\n nums[index] = temp;\n }\n }", "private static void exchange(int[] A, int i, int j) {\n if(A[i] == A[j]) return;\n\n A[i] = A[i] ^ A[j];\n A[j] = A[i] ^ A[j];\n A[i] = A[i] ^ A[j];\n }", "public static void swap(int[][] matrix, int i, int j, int n) {\n\t\tint temp = matrix[i][j];\n\t\tmatrix[i][j] = matrix[n - j - 1][i];\n\t\tmatrix[n - j - 1][i] = matrix[n - i - 1][n - j - 1];\n\t\tmatrix[n - i - 1][n - j - 1] = matrix[j][n - i - 1];\n\t\tmatrix[j][n - i - 1] = temp;\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static <T> void swap(Comparable<T>[] array, int j, int i) {\r\n\t\tT temp = ((T) array[i]);\r\n\t\tarray[i] = array[j];\r\n\t\tarray[j] = (Comparable<T>) temp;\r\n\t}", "private static void swap(Integer[] a, int x, int y) {\n\t\tInteger temp = a[x];\n\t\ta[x] = a[y];\n\t\ta[y] = temp;\n\t}", "public void swapColumns(int i, int j) {\n swap(columnPivot, columnUnpivot, i, j);\n }", "void rndSwapTwo(int i, int j) {\r\n\t\tint a, b;\r\n\t\tint tmp;\r\n\r\n\t\ta = Util.rndInt(i, j);\r\n\t\tb = Util.rndInt(i, j);\r\n\t\ttmp = index[a];\r\n\t\tindex[a] = index[b];\r\n\t\tindex[b] = tmp;\r\n\t}", "private static void swapMatrix(int[][] matrix, int i1, int j1, int i2, int j2) {\n int temp = matrix[i1][j1];\n matrix[i1][j1] = matrix[i2][j2];\n matrix[i2][j2] = temp;\n }", "void swap(int index_1,int index_2){\n int temp=arr[index_1];\n arr[index_1]=arr[index_2];\n arr[index_2]=temp;\n }" ]
[ "0.8081762", "0.8069114", "0.802367", "0.7956258", "0.7922566", "0.79209936", "0.78955543", "0.780021", "0.7751165", "0.7751165", "0.7732189", "0.77161175", "0.76518106", "0.76518106", "0.7645253", "0.7619771", "0.7592973", "0.7577481", "0.75702393", "0.7567115", "0.75428253", "0.75270784", "0.75242513", "0.7511815", "0.74948364", "0.7490977", "0.7483676", "0.74734074", "0.74723285", "0.74614996", "0.74551153", "0.7428961", "0.741908", "0.7362846", "0.73548454", "0.73542345", "0.73433703", "0.7341517", "0.7333548", "0.7330833", "0.73053205", "0.73019654", "0.73019654", "0.73019654", "0.729277", "0.72820956", "0.72720075", "0.72557044", "0.72546434", "0.7249406", "0.7218753", "0.7206417", "0.7179215", "0.71699005", "0.71698135", "0.714753", "0.71263915", "0.7120619", "0.70978993", "0.7064799", "0.7059108", "0.7052408", "0.703024", "0.700379", "0.700379", "0.70034146", "0.69663304", "0.6921278", "0.69184494", "0.6909555", "0.6885252", "0.68754673", "0.68576497", "0.68495876", "0.6834306", "0.67517793", "0.6746711", "0.67232215", "0.67166436", "0.6704069", "0.669858", "0.66968334", "0.6687059", "0.6678156", "0.6674003", "0.66737884", "0.6631544", "0.6629293", "0.66285586", "0.66085774", "0.65769285", "0.65214527", "0.64921707", "0.648954", "0.6457145", "0.64530694", "0.6452985", "0.64491254", "0.6441517", "0.6374661" ]
0.7774227
8
Prints out some statistics relating the current run.
public void printStats() { System.out.println("QuickSort terminates!"); System.out.println(); System.out.println("Duration: " + getDuration() + " seconds"); System.out.println("Comparisons: " + this.comparisonCounter); System.out.println("Boundary: " + this.b); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printStatistics() {\n\t// Skriv statistiken samlad så här långt\n stats.print();\n }", "void printStats();", "private static void printStats()\r\n\t{\r\n\t\tSystem.out.println(\"Keywords found: \" + keywordHits);\r\n\t\tSystem.out.println(\"Links found: \" + SharedLink.getLinksFound());\r\n\t\tSystem.out.println(\"Pages found: \" + SharedPage.getPagesDownloaded());\r\n\t\tSystem.out.println(\"Failed downloads: \" + SharedPage.getFailedDownloads());\r\n\t\tSystem.out.println(\"Producers: \" + fetchers);\r\n\t\tSystem.out.println(\"Consumers: \" + parsers);\r\n\t}", "public void printStatistics() {\r\n\t\tLog.info(\"*** Statistics of Sequence Selector ***\");\r\n\r\n\t\t// chains\r\n\t\tLog.info(String.format(\"Chains: %d\", chains.size()));\r\n\t\tLog.info(String.format(\"Executable Chains: %d\", execChains.size()));\r\n\t\tLog.info(String.format(\"Causal Executable Chains: %d\",\r\n\t\t\t\tcausalExecChains.size()));\r\n\r\n\t\t// bushes\r\n\t\tLog.info(String.format(\"Bushes: %d\", bushes.size()));\r\n\t\tLog.info(String.format(\"Executable Bushes: %d\", execBushes.size()));\r\n\t\tLog.info(String.format(\"Required Bushes: %d\", requiredExecBushes.size()));\r\n\t\tLog.info(String.format(\"Redundant Bushes: %d\",\r\n\t\t\t\tredundantExecBushes.size()));\r\n\r\n\t\t// total\r\n\t\tLog.info(String.format(\"Bushes in Chains: %d\", bushesInChains.size()));\r\n\t\tLog.info(String.format(\"Total Sequences: %d\", totalSequences.size()));\r\n\r\n\t\t// time\r\n\t\tLog.info(String.format(\"Total Time: %d ms\", stopWatch.getTime()));\r\n\t\tLog.info(String.format(\"Time per Event: %d ms\", stopWatch.getTime()\r\n\t\t\t\t/ events.size()));\r\n\t}", "public void printStats() {\n\t\tSystem.out.println(\"========== LCMFreq v0.96r18 - STATS ============\");\n\t\tSystem.out.println(\" Freq. itemsets count: \" + frequentCount);\n\t\tSystem.out.println(\" Total time ~: \" + (endTimestamp - startTimestamp)\n\t\t\t\t+ \" ms\");\n\t\tSystem.out.println(\" Max memory:\" + MemoryLogger.getInstance().getMaxMemory());\n\t\tSystem.out.println(\"=====================================\");\n\t}", "public void stats() {\n\t\tSystem.out.println(\"The score is: \" + score \n\t\t\t\t+ \"\\nNumber of Astronauts rescused: \" + rescuedAstronauts \n\t\t\t\t+ \"\\nNumber of Astronauts roaming: \" + roamingAstronauts\n\t\t\t\t+ \"\\nNumber of Aliens rescued: \" + rescuedAliens\n\t\t\t\t+ \"\\nNumber of Aliens roaming: \" + roamingAliens);\n\t}", "public void printStats() {\n\t\tSystem.out.println(\"============= RULEGROWTH - STATS ========\");\n\t\tSystem.out.println(\"Sequential rules count: \" + ruleCount);\n\t\tSystem.out.println(\"Total time: \" + (timeEnd - timeStart) + \" ms\");\n\t\tSystem.out.println(\"Max memory: \" + MemoryLogger.getInstance().getMaxMemory());\n\t\tSystem.out.println(\"==========================================\");\n\t}", "private void printStats()\n\t{\n\t\t// X\n\t\tSystem.out.println(\"X:\");\n\t\tfor(int i = 0; i < xPosList.size(); i++)\n\t\t{\n\t\t\tSystem.out.println(xPosList.get(i));\n\t\t}\n\n\t\t// Y\n\t\tSystem.out.println(\"Y:\");\n\t\tfor(int i = 0; i < yPosList.size(); i++)\n\t\t{\n\t\t\tSystem.out.println(yPosList.get(i));\n\t\t}\n\n\t\t// Time\n\t\tSystem.out.println(\"Time:\");\n\t\tfor(int i = 0; i < timeList.size(); i++)\n\t\t{\n\t\t\tSystem.out.println(timeList.get(i));\n\t\t}\n\t}", "private void summarize() {\n System.out.println();\n System.out.println(totalErrors + \" errors found in \" +\n totalTests + \" tests.\");\n }", "private void summarize() {\n System.out.println();\n System.out.println(totalErrors + \" errors found in \" +\n totalTests + \" tests.\");\n }", "private static void printStats(Stats stats) {\n long elapsedTime = (System.nanoTime() - startTime) / 1000000;\n System.out.println(\"Analysis completed - \" + keyCount + \" keys processed in \" + elapsedTime + \" ms\");\n getConsole().println(\"Analysis completed - \" + keyCount + \" keys processed in \" + elapsedTime + \" ms\");\n stats.print();\n }", "public void reportStats() {\n System.out.println(\"Number of requests: \" + (requestCount - warmUpRequests));\n System.out.println(\"Number of hits: \" + hitCount);\n System.out.println(\"hit ratio: \" + (double) hitCount / (requestCount - warmUpRequests));\n System.out.println(\"Average hit cost: \" + (double) hitCost / hitCount);\n }", "public void printStats() {\n\n System.out.println(\"Number of Users Arrived: \" + numIn);\n System.out.println(\"Number of Users Exited: \" + numOut);\n System.out.println(\"Average Time Spent Waiting for Cab: \" + (totTimeWait / numIn));\n if (numOut != 0) {\n System.out.println(\"Average Time Spent Waiting and Travelling: \" + (totTime / numOut));\n }\n }", "public void show() {\n\t\t\n\t\tSystem.out.println(\"time (tree setup) = \" + treeSetup + \" ms\");\n\t\tSystem.out.println(\"time (average search) = \" + (totalSearch/(float)countSearch) + \" ms\");\n\t\tSystem.out.println(\"time (average at) = \" + (totalAt/(float)countAt) + \" ms\");\n \t}", "public void outputStats (){\n System.out.println(\"Your sorcerer's stats:\");\n System.out.println(\"HP = \" + hp);\n System.out.println(\"Mana = \" + mana);\n System.out.println(\"Strength = \" + strength);\n System.out.println(\"Vitality = \" + vitality);\n System.out.println(\"Energy = \" + energy);\n }", "public static String printStats() {\n return \"Your Statistics:\" + \"\\n\" +\n \"Total Time in Game (Seconds): \" + timeElapsedSeconds + \"\\n\" +\n \"Total Points: \" + totalScore + \"\\n\" +\n \"Total Number of Taps on Screen: \" + counterClicks + \"\\n\" +\n \"Thanks for Playing!\";\n }", "public void statistics(){\n System.out.println(this.scoreboard.toString());\n }", "public void printMetrics() {\n System.out.println(\"\\nPROG_SIZE = \" + Metrics.getProgSize() + '\\n' + \"EXEC_TIME = \" + Metrics.getExecTime() + \" ms\" + '\\n' + \"EXEC_MOVE = \" + Metrics.getExecMove() + '\\n' + \"DATA_MOVE = \" + Metrics.getDataMove() + '\\n' + \"DATA_READ = \" + Metrics.getDataRead() + '\\n' + \"DATA_WRITE = \" + Metrics.getDataWrite() + '\\n');\n }", "public void printStats() {\n\t\t\n\t\tif(grafo==null) {\n\t\t\t\n\t\t\tthis.createGraph();\n\t\t}\n\t\t\n\t\tConnectivityInspector <Airport, DefaultWeightedEdge> c = new ConnectivityInspector<>(grafo);\n\t\t\n\t\tSystem.out.println(c.connectedSets().size());\n\n\t}", "public static void _generateStatistics() {\n\t\ttry {\n\t\t\t// Setup info\n\t\t\tPrintStream stats = new PrintStream(new File (_statLogFileName + \".txt\"));\n\n\t\t\tScanner scan = new Scanner(new File(_logFileName+\".txt\"));\n\t\t\twhile (scan.hasNext(SETUP.toString())) {\n\t\t\t\t// Append setup info\n\t\t\t\tstats.append(scan.nextLine()+\"\\n\");\n\t\t\t}\n\t\t\tstats.append(\"\\n\");\n\n\t\t\twhile (scan.hasNext(DETAILS.toString()) || scan.hasNext(RUN.toString())) {\n\t\t\t\t// Throw detailed info away\n\t\t\t\tscan.nextLine();\n\t\t\t}\n\n\t\t\twhile (scan.hasNext()) {\n\t\t\t\t// Append post-run info\n\t\t\t\tstats.append(scan.nextLine()+\"\\n\");\n\t\t\t}\n\t\t\tscan.close();\n\t\t\tstats.append(\"\\n\");\n\n\t\t\t// Perf4J info\n\t\t\tReader reader = new FileReader(_logFileName+\".txt\");\n\t\t\tLogParser parser = new LogParser(reader, stats, null, 10800000, true, new GroupedTimingStatisticsTextFormatter());\n\t\t\tparser.parseLog();\n\t\t\tstats.close();\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void printStatistics() {\n\t\t\r\n\t\tSystem.out.println(\"End of simulation report\\n\");\r\n\t\tSystem.out.println(\"\\t# total arrival customers \t\t\t: \" + customerIDCounter);\r\n\t\tSystem.out.println(\"\\t# customers turned-away \t\t: \" + numTurnedAway);\r\n\t\tSystem.out.println(\"\\t# customers served \t\t\t: \" + numServed + \"\\n\");\r\n\t\tSystem.out.println(\"\\t*** Current Tellers Info ***\\n\\n\");\r\n\t\tservicearea.printStatistics();\r\n\t\tSystem.out.println(\"\\n\\n\\tTotal waiting time \t\t\t\t: \" + totalWaitingTime);\r\n\t\tSystem.out.println(\"\\tAverage waiting time \t\t\t: \"\r\n\t\t\t\t+ (double) totalWaitingTime / (customerIDCounter - numTurnedAway));\r\n\t\tSystem.out.println(\"\\n\\n\\tBusy Tellers (\" + servicearea.numBusyTellers() + \") Info\\n\\n\");\r\n\t\tfor (int i = 0; i < servicearea.numBusyTellers();) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// loops through busyTellerQ\r\n\t\t\tTeller nextBusyTeller = servicearea.removeBusyTellerQ();\t\t\t\t\t\t\t\t\t\t\t\t\t\t// empties queue and prints\r\n\t\t\tnextBusyTeller.printStatistics();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// teller statistics\r\n\t\t}\r\n\t\tSystem.out.println(\"\\n\\tFree Tellers (\" + servicearea.numFreeTellers() + \") Info\\n\\n\");\r\n\t\tfor (int i = 0; i < servicearea.numFreeTellers();) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// loops through freeTellerQ\r\n\t\t\tTeller nextFreeTeller = servicearea.removeFreeTellerQ();\t\t\t\t\t\t\t\t\t\t\t\t\t\t// empties queue and prints\r\n\t\t\tnextFreeTeller.printStatistics();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// teller statistics\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\t\t}\r\n\t}", "public void stats() {\n\t\tSystem.out.println(\"Hash Table Stats\");\n\t\tSystem.out.println(\"=================\");\n\t\tSystem.out.println(\"Number of Entries: \" + numEntries);\n\t\tSystem.out.println(\"Number of Buckets: \" + myBuckets.size());\n\t\tSystem.out.println(\"Histogram of Bucket Sizes: \" + histogram());\n\t\tSystem.out.printf(\"Fill Percentage: %.5f%%\\n\", fillPercent());\n\t\tSystem.out.printf(\"Average Non-Empty Bucket: %.7f\\n\\n\", avgNonEmpty());\t\t\n\t}", "public static void stdout(){\n\t\tSystem.out.println(\"Buildings Found: \" + buildingsFound);\n\t\tSystem.out.println(\"Pages searched: \"+ pagesSearched);\n\t\tSystem.out.println(\"Time Taken: \" + (endTime - startTime) +\"ms\");\t\n\t}", "protected void dumpStats() {\n\t\t// Print the header.\n\t\tSystem.out.println(\"\\n\"+phCode+\" \"+minDelta+\" \"+maxDelta);\n\t\t\n\t\t// Print the data.\n\t\tSystem.out.println(\"Bias:\");\n\t\tfor(int j=0; j<bias.size(); j++) {\n\t\t\tSystem.out.format(\" %3d range = %6.2f, %6.2f fit = %11.4e, \"+\n\t\t\t\t\t\"%11.4e\\n\",j,bias.get(j).minDelta,bias.get(j).maxDelta,\n\t\t\t\t\tbias.get(j).slope,bias.get(j).offset);\n\t\t}\n\t\tSystem.out.println(\"Spread:\");\n\t\tfor(int j=0; j<spread.size(); j++) {\n\t\t\tSystem.out.format(\" %3d range = %6.2f, %6.2f fit = %11.4e, \"+\n\t\t\t\t\t\"%11.4e\\n\",j,spread.get(j).minDelta,spread.get(j).maxDelta,\n\t\t\t\t\tspread.get(j).slope,spread.get(j).offset);\n\t\t}\n\t\tSystem.out.println(\"Observability:\");\n\t\tfor(int j=0; j<observ.size(); j++) {\n\t\t\tSystem.out.format(\" %3d range = %6.2f, %6.2f fit = %11.4e, \"+\n\t\t\t\t\t\"%11.4e\\n\",j,observ.get(j).minDelta,observ.get(j).maxDelta,\n\t\t\t\t\tobserv.get(j).slope,observ.get(j).offset);\n\t\t}\n\t}", "public static void displaySta() {\n System.out.println(\"\\n\\n\");\n System.out.println(\"average service time: \" + doAvgProcessingTime() /100 + \" milliseconds\");\n System.out.println(\"max service time: \" + maxProcessingTime /100 + \" milliseconds\");\n System.out.println(\"average turn around time \" + doAvgTurnAroundTime()/100 + \" milliseconds\");\n System.out.println(\"max turn around time \" + maxTurnAroundTime/100 + \" milliseconds\");\n System.out.println(\"average wait time \" + doAvgWaitTime()/10000 + \" milliseconds\");\n System.out.println(\"max wait time \" + maxWaitTime/10000 + \" milliseconds\");\n System.out.println(\"end time \" + endProgramTime);\n System.out.println(\"start time \" + startProgramTime);\n System.out.println(\"processor utilization: \" + doCPU_usage() + \" %\");\n System.out.println(\"Throughput: \" + doThroughPut());\n System.out.println(\"---------------------------\");\n\n\n }", "public void statistics(){\n\t\tSystem.out.println(\"heads: \"+ heads+\"\\ttails: \"+tails);\n\t\t\n\t}", "public static void showStatistics(){\n\n }", "void dumpStats() {\n long wallTimeNanos = totalStopwatch.elapsed(TimeUnit.NANOSECONDS);\n long dbtime = 0;\n for (String name : methodCalls.keySet()) {\n long calls = methodCalls.get(name);\n long time = methodTotalTime.get(name);\n dbtime += time;\n long average = time / calls;\n double proportion = (time + 0.0) / (wallTimeNanos + 0.0);\n log.info(name + \" c:\" + calls + \" r:\" + time + \" a:\" + average + \" p:\" + String.format(\"%.2f\", proportion));\n }\n double dbproportion = (dbtime + 0.0) / (wallTimeNanos + 0.0);\n double hitrate = (hit + 0.0) / (hit + miss + 0.0);\n log.info(\"Cache size:\" + utxoCache.size() + \" hit:\" + hit + \" miss:\" + miss + \" rate:\"\n + String.format(\"%.2f\", hitrate));\n bloom.printStat();\n log.info(\"hasTxOut call:\" + hasCall + \" True:\" + hasTrue + \" False:\" + hasFalse);\n log.info(\"Wall:\" + totalStopwatch + \" percent:\" + String.format(\"%.2f\", dbproportion));\n String stats = db.getProperty(\"leveldb.stats\");\n System.out.println(stats);\n\n }", "public static void tstatSheet(){\n\t\tSystem.out.println(\"\\tStats\");\n\t\tSystem.out.println(\"--------------------------\");\n\t\tSystem.out.println(\"Strength - \" + tstr + \"\\tMagic Power - \" + tmag);\n\t\tSystem.out.println(\"Luck - \" + tluc + \" \\tAccuaracy - \" + tacc);\n\t\tSystem.out.println(\"Defense - \" + tdef + \" \\tSpeed - \" + tspe);\n\t\tSystem.out.println(\"Health - \" + tHP + \" \\tMystic Energy - \" + tMP);\n\t}", "public void printStatus() {\n\t\tSystem.out.println(\"Current : \"+current+\"\\n\"\n\t\t\t\t+ \"Tour restant : \"+nb_rounds+\"\\n\"\n\t\t\t\t\t\t+ \"Troupe restant : \"+nb_to_train);\n\t}", "public String getStats() {\n String stats = \"Total running time: \" + runtime + \"\\\\\\\\\";\n int totalit = 0;\n int largestit = 0;\n int averageit = 0;\n for (Integer i : recGraphs) {\n totalit += i;\n averageit += i;\n if (i > largestit) {\n largestit = i;\n }\n }\n averageit /= recGraphs.size();\n double totalhit = 0;\n double longesthit = 0;\n double averagehit = 0;\n for (Double i : recHitTimes) {\n totalhit += i;\n averagehit += i / recHitTimes.size();\n if (i > longesthit) {\n longesthit = i;\n }\n }\n stats += \"Total iterations in step 3: \" + totalit + \"\\\\\\\\\";\n stats += \"Largest set of iterations in step 3: \" + largestit + \"\\\\\\\\\";\n stats += \"Average iterations set in step 3: \" + averageit + \"\\\\\\\\\";\n stats += \"Total hitting sets calculation time: \" + totalhit + \"\\\\\\\\\";\n stats += \"Average hitting set calculation time: \" + averagehit + \"\\\\\\\\\";\n stats += \"Longest hitting set calculation time: \" + longesthit + \"\\\\\\\\\";\n return stats;\n }", "@Override\n public void printStatistics(\n PrintStream out, Result result, ReachedSet reached) {\n Preconditions.checkNotNull(out);\n Preconditions.checkNotNull(result);\n // reached set can be NULL\n\n if (analysisTime.isRunning()) {\n analysisTime.stop();\n }\n if (programTime.isRunning()) {\n programTime.stop();\n }\n if (memStats != null) {\n memStatsThread.interrupt(); // stop memory statistics collection\n }\n\n // print CFA statistics\n printCfaStatistics(out);\n\n // print global time statistics\n printTimeStatistics(out);\n\n // print global memory statistics\n printMemoryStatistics(out);\n\n }", "void statistics();", "public static void showStats() {\n\n List<String> stats = statsList.subList(Math.max(statsList.size() - 3, 0), statsList.size());\n\n System.out.println(\"Stats:\");\n for(String stat : stats){\n System.out.println(stat);\n }\n }", "public static void printStatistics(String statFile)\r\n\t{\r\n\t\t// TODO add code here to print statistics in the output file\r\n\t}", "public void printSummary() {\n\t\tSystem.out.println(MessageFormat.format(\"\\nSummary:\\n Name: {0}\\n Range: 1 to {1}\\n\", this.name, this.numSides));\n\t}", "public void show()\n {\n System.out.println( getFullName() + \", \" +\n String.format(Locale.ENGLISH, \"%.1f\", getAcademicPerformance()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getSocialActivity()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getCommunicability()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getInitiative()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getOrganizationalAbilities())\n );\n }", "public void printAll(){\n\t\tSystem.out.println(\"Single hits: \" + sin);\n\t\tSystem.out.println(\"Double hits: \" + doub);\n\t\tSystem.out.println(\"Triple hits: \" + trip);\n\t\tSystem.out.println(\"Homerun: \" + home);\n\t\tSystem.out.println(\"Times at bat: \" + atbat);\n\t\tSystem.out.println(\"Total hits: \" + hits);\n\t\tSystem.out.println(\"Baseball average: \" + average);\n\t}", "public static String showAllStats() {\n return showStats(allStats, \"All stats\");\n }", "@Override\n public void visualize() {\n if (this.count() > 0){\n for (int i = 0; i < this.count(); i++){\n System.out.println(i + \".- \" + this.bench.get(i).getName() + \" (ID: \" + this.bench.get(i).getId() + \")\");\n }\n } else {\n System.out.println(\"La banca está vacía.\");\n }\n\n }", "public void printInfo() {\n System.out.println(\"\\n\" + name + \"#\" + id);\n System.out.println(\"Wall clock time: \" + endWallClockTime + \" ms ~ \" + convertFromMillisToSec(endWallClockTime) + \" sec\");\n System.out.println(\"User time: \" + endUserTimeNano + \" ns ~ \" + convertFromNanoToSec(endUserTimeNano) + \" sec\");\n System.out.println(\"System time: \" + endSystemTimeNano + \" ns ~ \" + convertFromNanoToSec(endSystemTimeNano) + \" sec\");\n System.out.println(\"CPU time: \" + (endUserTimeNano + endSystemTimeNano) + \" ns ~ \" + convertFromNanoToSec(endUserTimeNano + endSystemTimeNano) + \" sec\\n\");\n }", "private void displayTestResultSummary() {\n int passNum = mSessionLog.getTestList(CtsTestResult.CODE_PASS).size();\n int failNum = mSessionLog.getTestList(CtsTestResult.CODE_FAIL).size();\n int notExecutedNum =\n mSessionLog.getTestList(CtsTestResult.CODE_NOT_EXECUTED).size();\n int timeOutNum = mSessionLog.getTestList(CtsTestResult.CODE_TIMEOUT).size();\n int total = passNum + failNum + notExecutedNum + timeOutNum;\n \n println(\"Test summary: pass=\" + passNum\n + \" fail=\" + failNum\n + \" timeOut=\" + timeOutNum\n + \" notExecuted=\" + notExecutedNum\n + \" Total=\" + total);\n }", "private void showStat() {\n\t\tSystem.out.println(\"=============================\");\n\t\tSystem.out.println(\"Your won! Congrates!\");\n\t\tSystem.out.println(\"The word is:\");\n\t\tSystem.out.println(\"->\\t\" + this.word.toString().replaceAll(\" \", \"\"));\n\t\tSystem.out.println(\"Your found the word with \" \n\t\t\t\t+ this.numOfWrongGuess + \" wrong guesses.\");\n\t}", "private void printResults() {\n\t\tfor (Test test : tests) {\n\t\t\ttest.printResults();\n\t\t}\n\t}", "static void showStatistics() throws IOException {\n System.out.println(\"You entered \" + initialSlots + \" for the number of slots on your wheel.\");\n System.out.println(\"You entered \" + initialZeroes + \" for the number of 0's or 00's on your wheel.\");\n System.out.println(\"You entered \" + initialVisits + \" for the number of times you visited to the casino.\");\n System.out.println(\"You entered $\" + initialDollars + \" for the amount of money you started with at every visit to the casino.\");\n System.out.println(\"You had $\" + dollarsRisked + \" for the total amount of money you brought to the casino over your visits.\");\n System.out.println(\"You walked away with $\" + moneyCount + \" total over \" + winCount + \" wins of your \" + initialVisits + \" total visits. This is %\" + df.format(percentWon) +\n \" of the $\" + dollarsRisked + \" you brought to the casino.\");\n System.out.println(\"Your most money won on a spin was $\" + biggestGain + \" across all your visits.\");\n // Prints to console if the user never won once on all their visits to the casino, otherwise lets them know the largest amount they walked away with\n if (largestWalkedAway < 1) {\n System.out.println(\"Sorry, you never walked away a winner across all \" + initialVisits + \" visits to the casino.\");\n } else {\n System.out.println(\"The most you ever walked away with on a visit to the casino was $\" + largestWalkedAway + \".\");\n }\n System.out.println(\"You came out a loser \" + lossCount + \" times out of your \" + initialVisits + \" visits.\" );\n // Prints to console only if the user never won once on all their visits to the casino\n if (completeLoss >= 1) {\n System.out.println(\"You completely lost all of your money in \" + completeLoss + \" visits.\");\n }\n // Gives the user of their average winnings/losses per visit of the casino\n System.out.println(\"You won an average of $\" + df.format(((float)runningTotal / initialVisits))+ \" each time you visited the casino.\");\n System.out.println(\"Out of \" + initialVisits + \" visits you walked away a winner \" + winCount + \" times. You walked away a loser \" + lossCount + \" times. \" +\n \"You broke even \" + brokeEven + \" times.\\n\");\n // Prompts the user to press Enter to exit the program\n System.out.println(\"Press Enter to exit.\");\n System.in.read();\n }", "public void printResults() {\n\t System.out.println(\"BP\\tBR\\tBF\\tWP\\tWR\\tWF\");\n\t System.out.print(NF.format(boundaryPrecision) + \"\\t\" + NF.format(boundaryRecall) + \"\\t\" + NF.format(boundaryF1()) + \"\\t\");\n\t System.out.print(NF.format(chunkPrecision) + \"\\t\" + NF.format(chunkRecall) + \"\\t\" + NF.format(chunkF1()));\n\t System.out.println();\n }", "public void printDetails() {\r\n\t\tSystem.out.println(\" \");\r\n\t\tSystem.out.println(showtimeId + \" \" + movie.getTitle() + \" starts at \" + startTime.toString());\r\n\t}", "public String getStatistics() throws IOException{\n initiateWordCount();\n getHamStatistics(); \n getSpamStatistics();\n return printStatistics(); \n }", "public void printRuntimes() {\n\t\tfor(long x: runtimes){\n\t\t\tSystem.out.println(\"run with time \"+x+\" nanoseconds\");\n\t\t}\t\n\t}", "public void showInformation() {\n\t\tSystem.out.println(\"Title: \" + getTitle());\n\t\tSystem.out.println(\"Time: \" + getTime());\n\t\tSystem.out.println(\"Number: \" + getNumber());\n\t}", "private void printReport() {\n\t\t\tSystem.out.println(\"Processed \" + this.countItems + \" items:\");\n\t\t\tSystem.out.println(\" * Labels: \" + this.countLabels);\n\t\t\tSystem.out.println(\" * Descriptions: \" + this.countDescriptions);\n\t\t\tSystem.out.println(\" * Aliases: \" + this.countAliases);\n\t\t\tSystem.out.println(\" * Statements: \" + this.countStatements);\n\t\t\tSystem.out.println(\" * Site links: \" + this.countSiteLinks);\n\t\t}", "private static void displayStats() {\n\t\tint numPlay = 0;\n\t\tint numWon = 0;\n\t\tint sumGuess = 0;\n\t\tint minGuess = Integer.MAX_VALUE;\n\t\tint maxGuess = Integer.MIN_VALUE;\n\t\tdouble average = 0;\n\t\tint lastNumGuess = 0;\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(fileName));\n\t\t\tString line = \"\";\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tnumPlay++;\n\t\t\t\tlastNumGuess = Integer.parseInt(line);\n\t\t\t\tif (lastNumGuess > 0) { // a positive number of guesses indicates the user won the game\n\t\t\t\t\tnumWon++;\n\t\t\t\t\tminGuess = Math.min(minGuess, lastNumGuess);\n\t\t\t\t\tmaxGuess = Math.max(maxGuess, lastNumGuess);\n\t\t\t\t\tsumGuess += lastNumGuess;\n\t\t\t\t}\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (FileNotFoundException exception) {\n\t\t\tSystem.out.println(\"It seems that you haven't played this game before. Keep playing to gather statistics!\");\n\t\t\treturn;\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Sorry the software encountered an IO Error. Please try again later.\");\n\t\t}\n\t\tSystem.out.println(\"Below are the summary statistics: \");\n\t\tSystem.out.println(\"Number of games played: \" + numPlay);\n\t\tSystem.out.println(\"Number of games won: \" + numWon);\n\t\tSystem.out.println(String.format(\"Total number of guesses: %d\", sumGuess + 12 * (numPlay - numWon)));\n\t\tif (lastNumGuess < 1) {\n\t\t\tSystem.out.println(\"Last time you lost\");\n\t\t} else {\n\t\t\tSystem.out.println(String.format(\"Last time you won and made %d guess%s\", lastNumGuess,\n\t\t\t\t\t(lastNumGuess > 1 ? \"es\" : \"\")));\n\t\t}\n\t\tif (numWon > 0) {\n\t\t\tSystem.out.println(\"Minimum number of guesses to win: \" + minGuess);\n\t\t\tSystem.out.println(\"Maximum number of guesses to win: \" + maxGuess);\n\t\t\taverage = (double) sumGuess / numWon;\n\t\t\tSystem.out.println(String.format(\"Average number of guesses to win: %.2f\", average));\n\t\t}\n\t}", "private void printStatistics(int i){\n\t\tdouble mean=0;\n\t\tdouble min=999999999;\n\t\tdouble max=-999999999;\n\t\tint cnt=0;\n\t\tfor (String[] rCode:GMSValues.keySet()){\n\t\t\tdouble x=GMSValues.get(rCode);\n\t\t\tif (x==0)System.out.println(\"NULL\");\n\t\t\tmean=mean+x;\n\t\t\tif (x<min)min=x;\n\t\t\tif (x>max)max=x;\n\t\t\tcnt++;\n\t\t}\n\t\tmean=mean/(double)cnt;\n\t\tSystem.out.println(\"Minimum: \"+min);\n\t\tSystem.out.println(\"Maximum: \"+max);\n\t\tSystem.out.println(\"Mean Value: \"+mean);\n\t\ttry {\n\t \t FileWriter fw = new FileWriter(new File(\"data/GreedyResults.log\"), true);\n\t \t if (i==0)fw.write(\"Date, Run, Minimum, Maximum, Mean \"+\"\\n\");\n\t \t fw.write(new SimpleDateFormat(\"dd.MM.yyyy HH:mm:ss\").format(new Date())+\", \"+i+\", \");\n\t \t fw.write(min+\", \"+max+\", \"+mean+\"\\n\");\n\t \t fw.close();\n\t } catch (IOException e) {\n\t\t\tSystem.out.println(\"Filewriter Error\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif(mean<min){\n\t\t\tSystem.out.println(\"FEHLER: Mean too small\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\t\n\t}", "public void printCountersAndDiagnostics() {\n\t\tSystem.out.println(\"Node \" + myAssignedID + \"::\" + \"\\t\" + \"Sent\" + \"\\t\"\n\t\t\t\t+ \"Rec'd\" + \"\\t\" + \"Relayed\" + \"\\t\" + \"SumSent\" + \"\\t\"\n\t\t\t\t+ \"SumRecd\");\n\t\tSystem.out.println(\"\\t\\t\" + this.sendTracker + \"\\t\"\n\t\t\t\t+ this.receiveTracker + \"\\t\" + this.relayTracker + \"\\t\"\n\t\t\t\t+ this.sendSummation + \"\\t\" + this.receiveSummation);\n\t}", "public void Display() {\n\t\tSystem.out.println(Integer.toHexString(PID) + \"\\t\" + Integer.toString(CreationTime) + \"\\t\"+ Integer.toHexString(CommandCounter) + \"\\t\" + ProcessStatus.toString() \n\t\t+ \"\\t\" + Integer.toString(MemoryVolume) + \"\\t\" + Integer.toHexString(Priority) + \"\\t\" + ((MemorySegments != null)? MemorySegments.toString() : \"null\"));\n\t}", "public void getStats(){\n for (Shelf shelf : this.shelves){\n if (!shelf.isEmpty()){\n shelf.printStats();\n }\n\n }\n }", "public static void Print() {\n\t\tSystem.out.println(\"Ticks: total \" + totalTicks + \", idle \" + idleTicks + \", system \" + systemTicks + \", user \"\n\t\t\t\t+ userTicks);\n\n\t\tSystem.out.println(\"Disk I/O: reads \" + numDiskReads + \", writes \" + numDiskWrites);\n\t\tSystem.out.println(\"Console I/O: reads \" + numConsoleCharsRead + \", writes \" + numConsoleCharsWritten);\n\t\tSystem.out.println(\"Paging: faults \" + numPageFaults);\n\n\t\tSystem.out.println(\"Network I/O: packets received \" + numPacketsRecvd + \", sent \" + numPacketsSent);\n\t}", "public void displayResults() {\r\n Preferences.debug(\" ******* FitMultiExponential ********* \\n\\n\", Preferences.DEBUG_ALGORITHM);\r\n dumpTestResults();\r\n }", "public void displayStats(int lowAttack, int medAttack, int highAttack)\n\t{\n\t\tSystem.out.println (\"Summary of Combat\");\n\t\tSystem.out.println (\"Total Hits Overall: \" + numHits + \" Total Blocks Overall: \" + numBlocks);\n\t\tSystem.out.println (\"Attacker Proportions: \" + \"Low \" + lowAttack + \"% \" + \"Medium \" +\n\t\t\t\t\t\t\tmedAttack + \"% \" + \"High \" + highAttack + \"% \");\n\t\tSystem.out.print (\"Defender Proportions: \" + \"Low \");\n\t\tSystem.out.printf(\"%.2f\", (lowBlocks * 100)/(count+1));\n\t\tSystem.out.print(\"% \" + \"Medium \"); \n\t\tSystem.out.printf(\"%.2f\", ((medBlocks*100)/(count+1)));\n\t\tSystem.out.print(\"% \" + \"High \");\n\t\tSystem.out.printf(\"%.2f\", ((highBlocks*100)/(count+1)));\n\t\tSystem.out.println(\"% \");\t\t\n\t\n\t}", "public void printResults() {\n getUtl().getOutput().add(\"~~ Results ~~\\n\");\n for (int i = 0; i < getHeroes().size(); i++) {\n if (getHeroes().get(i).isDead()) {\n getUtl().getOutput().add(getHeroes().get(i).getName().\n toCharArray()[0] + \" dead\\n\");\n } else {\n getUtl().getOutput().add(getHeroes().get(i).getName().\n toCharArray()[0] + \" \"\n + getHeroes().get(i).getLevel() + \" \"\n + getHeroes().get(i).getXp() + \" \"\n + getHeroes().get(i).getHp() + \" \"\n + getHeroes().get(i).getPosX() + \" \"\n + getHeroes().get(i).getPosY() + \"\\n\");\n }\n }\n // Write output to given outputPath.\n getGameFileWriter().write(getUtl().getOutput());\n for (int i = 0; i < getUtl().getOutput().size(); i++) {\n // Write output to console as well.\n System.out.print(getUtl().getOutput().get(i));\n }\n }", "public void print_metrics(){\n\t\tHashMap<Integer, HashSet<Integer>> pairs=return_pairs();\n\t\tint total=gold.data.getTuples().size();\n\t\ttotal=total*(total-1)/2;\n\t\tSystem.out.println(\"Reduction Ratio is: \"+(1.0-(double) countHashMap(pairs)/total));\n\t\tint count=0;\n\t\tfor(int i:pairs.keySet())\n\t\t\tfor(int j:pairs.get(i))\n\t\t\tif(goldContains(i,j))\n\t\t\t\tcount++;\n\t\tSystem.out.println(\"Pairs Completeness is: \"+(double) count/gold.num_dups);\n\t}", "public void printUsage() {\n printUsage(System.out);\n }", "public String doPrint() {\n\t\t// Get the event title.\n\t\tString event = \"\";\n\t\tswitch (eventType) {\n\t\t\tcase \"IND\": event = \"Individual\";\n\t\t\t\t\t\tbreak;\n\t\t\tcase \"GRP\": event = \"Group\";\n\t\t\t\t\t\tbreak;\n\t\t\tcase \"PARIND\": event = \"Parallel Individual\";\n\t\t\t\t\t\t break;\n\t\t\tcase \"PARGRP\": event = \"Parallel Group\";\n\t\t\t\t\t\t break;\n\t\t default:\tevent = \"\";\n\t\t \t\t\tbreak;\n\t\t}\n\t\t\n\t\tString out = \"RUN BIB TIME\t \" + event +\"\\n\";\n\t\t\n\t\t// Print completed runs.\n\t\tfor ( Run run : completedRuns ) {\n\t\t\tout += run.print() + \"\\n\";\n\t\t}\n\t\t\n\t\t// Print inProgress runs.\n\t\tfor ( Run run : finishQueue ) {\n\t\t\tout += run.print() + \"\\n\";\n\t\t}\n\t\t\n\t\t// Print waiting runs.\n\t\tfor ( Run run : startQueue ) {\n\t\t\tout += run.print() + \"\\n\";\n\t\t}\n\t\t\n\t\treturn out;\n\t}", "public void getResults() {\n\t\tSystem.out.println(\"|V| : \" + g.getV());\n\t\tSystem.out.println(\"|E| : \" + g.getE());\n\t\tSystem.out.println(\"Max flow : \" + g.getVertex(sink).e);\n\t\tSystem.out.println(\"Run time : \" + (System.currentTimeMillis()-timeStart) + \" ms\"+\"\\n\");\n\t}", "public void printAnalysis(){\n System.out.println(\"Product: \" + this.getName());\n System.out.println(\"History: \" + this.history());\n System.out.println(\"Largest amount of product: \" + this.inventoryHistory.maxValue());\n System.out.println(\"Smallest amount of product: \" + this.inventoryHistory.minValue());\n System.out.println(\"Average: \" + this.inventoryHistory.average());\n }", "public void run()\n\t{\n\n\t\tout.println();\n\t\tout.printf( \"The class average is %.2f \\n\", grades.classAverage() );\n\t\tout.println();\n\t\tout.print ( \"The top student is \");\n\t\tout.println( grades.topStudent() );\n\t\tout.println();\n\t\tout.println( \"The list of students that made A's:\");\n\t\tout.println( Arrays.toString(grades.allAs()) );\n\t\tout.println();\n\t\tout.println( \"The students above the class average are:\");\n\t\tout.println( Arrays.toString(grades.aboveAverage()) );\n\t\tout.println();\n\t\tout.println();\n\t}", "public String stats() { \r\n String stats; \r\n stats = getWins() + \" wins, \" + getLosses() + \" losses, \" \r\n + getSaves() + \" saves, \" + getEra() + \" ERA\"; \r\n return stats;\r\n }", "public String currStats(){\n\t\treturn String.format(\"Damage: %f\\nRange (in tiles): %f\\nFire\"\n\t\t\t\t+ \" speed (shots per second): %d\\nUpgrade cost: %d\", damage,\n\t\t\t\trange / MainFrame.TILE_SIZE, initCooldown, getCostToUpgrade());\n\t}", "private void calculateAndShowStatistics() {\n Map<Country, Float> countryWithMinInternetUsers = findCountryWithMinInternetUsers();\n Map<Country, Float> countryWithMinLiteracyRate = findCountryWithMinLiteracyRate();\n Map<Country, Float> countryWithMaxInternetUsers = findCountryWithMaxInternetUsers();\n Map<Country, Float> countryWithMaxLiteracyRate = findCountryWithMaxLiteracyRate();\n\n // Output header\n System.out.println(\"\\nStatistics based on the data provided in the database\\n\");\n\n // Output minimums\n screenPrinter.outputMinOrMax(\"minimum\", \"amount of Internet Users\", countryWithMinInternetUsers);\n screenPrinter.outputMinOrMax(\"minimum\", \"Adult Literacy Rate\",countryWithMinLiteracyRate);\n\n // Output maximums\n screenPrinter.outputMinOrMax(\"maximum\", \"amount of Internet Users\",countryWithMaxInternetUsers);\n screenPrinter.outputMinOrMax(\"maximum\", \"Adult Literacy Rate\",countryWithMaxLiteracyRate);\n System.out.println();\n\n // Find countries that have all the data\n List<Country> countriesWithoutMissingData = findAllCountiesWithoutMissingData();\n\n // Form two separate lists with just indicators\n List<Float> listOfInternetUsersRates = getListOfInternetUsersRates(countriesWithoutMissingData);\n List<Float> listOfLiteracyRates = getListOfLiteracyRates(countriesWithoutMissingData);\n\n // Calculate the correlation coefficient\n double correlationCoefficient = calculateCorCoeff(listOfInternetUsersRates, listOfLiteracyRates);\n// double pearsonCoefficient = calculateCoeffThirdParty(listOfInternetUsersRates, listOfLiteracyRates);\n\n // output correlation coefficient\n screenPrinter.outputCorrelation(correlationCoefficient);\n }", "public static void displayStats(ArrayList<String> standings){\n\t\tString[] parts;\n\t\tdouble avg, gamesB; //variables for fucntion calls\n\t\tSystem.out.println(\"----------------------------------------------------------------\");\n\t\tSystem.out.println(\"Teams: Wins: Loses: Pct: Games Behind:\" );\n\t\tSystem.out.println(\"----------------------------------------------------------------\");\n\t\tfor(String standing : standings){\n\t\t\tparts = standing.split(\"\\t\");\n\t\t\tavg = getAvg(standing);\n\t\t\tSystem.out.printf(\"%-15s%-8s%-8s%6.2f \\n \", parts[0], parts[1], parts[2], avg);\n\t\t}//end for \n//\t\tSystem.out.println(standings);\n\t}", "private void printStatistics() throws IOException {\n\n\t\tSystem.out.println(\"*********************** \" + analyzer\n\t\t\t\t+ \" *********************************\");\n\n\t\tidxReader = DirectoryReader\n\t\t\t\t.open(FSDirectory.open(Paths.get(indexPath)));\n\n\t\tSystem.out.println(\"Total no. of document in the corpus: \"\n\t\t\t\t+ idxReader.maxDoc());\n\n\t\tTerms vocabulary = MultiFields.getTerms(idxReader, \"TEXT\");\n\n\t\tSystem.out.println(\"Number of terms in dictionary for TEXT field:\"\n\t\t\t\t+ vocabulary.size());\n\n\t\tSystem.out.println(\"Number of tokens for TEXT field:\"\n\t\t\t\t+ vocabulary.getSumTotalTermFreq());\n\n\t\tidxReader.close();\n\t}", "private static void printUsage() {\n System.err.println(\"\\n\\nUsage:\\n\\tAnalyzeRandomizedDB [-p] [-v] [--enzyme <enzymeName> [--mc <number_of_missed_cleavages>]] <original_DB> <randomized_DB>\");\n System.err.println(\"\\n\\tFlag significance:\\n\\t - p : print all redundant sequences\\n\\t - v : verbose output (application flow and basic statistics)\\n\");\n System.exit(1);\n }", "private void printTimer() {\n\t\tif (_verbose) {\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"-- \" + getTimeString() + \" --\");\n\t\t}\n\t}", "public static void printResults() {\n System.out.println(\" Results: \");\n Crawler.getKeyWordsHits().forEach((keyWord, hitsNumber) -> System.out.println(keyWord + \" : \" + hitsNumber + \";\"));\n System.out.println(\" Total hits: \" + Crawler.getTotalHits());\n\n }", "@Override\r\n\tpublic void showSpeed() {\n\t\tSystem.out.println(\"i can run at 100km/h\");\r\n\t}", "public void printPlayerStats(PlayerStats statistics) {\r\n\t\tSystem.out.print(statistics.playerStatsToString());\r\n\t}", "public void displayStats() {\n VisitorDAO visitorDAO = new VisitorDAO();\n Object countAllVisitors = visitorDAO.getCountAllVisitors();\n Object countNewSubscribers = visitorDAO.getCountNewSubscribersForMonth(this.simpleDateFormat.format(new Date()));\n\n this.totalSubscribersText.setText(this.totalSubscribersText.getText() + countAllVisitors.toString());\n this.newSubscribersText.setText(this.newSubscribersText.getText() + countNewSubscribers.toString());\n }", "private static void printData(List<Long> runningTimes) {\n\t\tlong min = Collections.min(runningTimes);\n\t\tlong max = Collections.max(runningTimes);\n\t\t\n\t\tlong total = 0;\n\t\tfor(long runTime : runningTimes)\n\t\t\ttotal+=runTime;\n\t\t\n\t\tSystem.out.println(\"******* SEQUENTIAL RESULTS *******\");\n\t\tSystem.out.println(\"MIN RUNNING TIME(ms): \"+min);\n\t\tSystem.out.println(\"MAX RUNNING TIME(ms): \"+max);\n\t\tSystem.out.println(\"AVG RUNNING TIME(ms): \"+(total/runningTimes.size()));\n\t\tSystem.out.println(\"***********************************\");\n\t\tSystem.out.println();\n\t}", "public static void printResults() {\n resultMap.entrySet().stream().forEach((Map.Entry<File, String> entry) -> {\n System.out.println(String.format(\"%s processed by thread: %s\", entry.getKey(), entry.getValue()));\n });\n System.out.println(String.format(\"processed %d entries\", resultMap.size()));\n }", "public static void reportStats() {\n if (!VmSettings.COLLECT_TYPE_STATS) {\n return;\n }\n Output.println(\"RESULT-NumberOfTypeCheckExecutions: \" + numTypeCheckExecutions);\n Output.println(\"RESULT-NumberOfSubclassChecks: \" + numSubclassChecks);\n Output.println(\"RESULT-NumberOfTypes: \" + nTypes);\n }", "@Scheduled(fixedRate = 3600_000, initialDelay = 3600_000)\n public static void showAllStatsJob() {\n showStats(allStats, \"All stats\");\n }", "public void display(){\n double avg;\n avg=getAvg();\n System.out.println(\"\\nThe Average of the times is : \"+avg+\" Milliseconds\");\n }", "public void dumpStats(PrintStream out, int postCount, int totalSingleCorrect, int totalHalfCorrect) {\n out.println(\"evaluated \" + postCount + \" posts; \" \n + totalSingleCorrect + \" with one correct tag, \" \n + totalHalfCorrect + \" with half correct\");\n\n out.print(\"\\t %single correct: \" + nf.format((totalSingleCorrect * 100) / (float) postCount));\n out.println(\", %half correct: \" + nf.format((totalHalfCorrect * 100) / (float) postCount));\n out.println();\n out.flush();\n }", "public static void printStats(QuitObject q) {\r\n\t\t\tSystem.out.println(\"Numbers greater than 0.5 after \" + q.getFinalCount() + \"= \" + q.getGreaterThan());\r\n\t\t\tSystem.out.println(\"Numbers less that or equal to 0.5 after \" + q.getFinalCount() + \"= \" + q.getLessThan());\r\n\t\t}", "public void printResults(){\n\t\tSystem.out.println(\"The area of the triangle is \" + findArea());\n\t\tSystem.out.println(\"The perimeter of the triangle is \"+ findPerimeter());}", "private static void consoleOutput() {\n\n Output airportFlightCounter = new AirportFlightCounter(airports);\n Output flightInventory = new FlightInventory(flights);\n Output flightPassengerCounter = new FlightPassengerCounter(flights);\n Output mileageCounter = new MileageCounter(flights, airports);\n\n airportFlightCounter.toConsole();\n flightInventory.toConsole();\n flightPassengerCounter.toConsole();\n mileageCounter.toConsole();\n }", "public void printStatus(){\n System.out.println(\"Nodes: \" + \n getVertexCount() + \" Edges: \" + \n getEdgeCount()); \n //and \" + getEdgeCount() + \" edges active.\");\n }", "public void statsOut(PrintWriter out) throws IOException {\n\t\t\n\t\tanalyze(); //see the above method\n\t\tint i;\n\t\t\n\t\tif (bundle.getString(\"otherStatsToggle\").equals(\"true\") || bundle.getString(\"groupsToggle\").equals(\"true\") \n\t\t\t\t|| bundle.getString(\"percentToggle\").equals(\"true\") || bundle.getString(\"diffToggle\").equals(\"true\")) {\n\t\t\t\n\t\t\tSystem.out.println(\"|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-| \\n\");\n\t\t\tout.println(\"|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-| \\n\");\n\t\t}\n\t\t\n\t\tif (lowestRating == 2) { //implies no data was ever given since no rating will ever be above 1, let alone at 2\n\t\t\tSystem.out.println(\"Nothing here to give statistics on \\n\");\n\t\t\tout.println(\"Nothing here to give statistics on \\n\");\n\t\t}\n\t\t\n\t\telse {\n\t\t\t\n\t\t\tif (bundle.getString(\"otherStatsToggle\").equals(\"true\")) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Relevant Segment of Revision History: \" + then + \" to \" + now + \" \\n\");\n\t\t\t\tout.println(\"Relevant Segment of Revision History: \" + then + \" to \" + now + \" \\n\");\n\t\t\t\tSystem.out.println(\"Total Number of Relevant Revisions: \" + revisionTotal);\n\t\t\t\tout.println(\"Total Number of Relevant Revisions: \" + revisionTotal);\n\t\t\t\tSystem.out.println(\"\\t Average Number of relevant files per revision: \" + Math.round(relevantAverage) + \"\\n\");\n\t\t\t\tout.println(\"\\t Average Number of relevant files per revision: \" + Math.round(relevantAverage) + \"\\n\");\n\t\t\t\t\n\t\t\t\tfor (i = 0; i < args.length; i++) {\n\t\t\t\t\tSystem.out.println(\"\\t Number of Revisions Changing \" + (i + 1) + \" of the Relevant Files: \" + relevantPresent[i]);\n\t\t\t\t\tout.println(\"\\t Number of Revisions Changing \" + (i + 1) + \" of the Relevant Files: \" + relevantPresent[i]);\n\t\t\t\t\tSystem.out.println(\"\\t\\t Number of these revisions with under \" + (10 * (i + 1)) + \" irrelevant extra files: \" + irrelevantPresent[i] + \"\\n\");\n\t\t\t\t\tout.println(\"\\t\\t Number of these revisions with under \" + (10 * (i + 1)) + \" irrelevant extra files: \" + irrelevantPresent[i] + \"\\n\");\n\t\t\t\t}\n\t\t\n\t\t\t\tSystem.out.println();\n\t\t\t\tout.println();\n\t\t\t\t\n\t\t\t\ttimeStats(\"Average\", timeDiffAverage, \"\", out);\n\t\t\t\ttimeStats(\"\\t Lowest\", timeDiffLow, revisionReference[5], out);\n\t\t\t\ttimeStats(\"\\t Highest\", timeDiffHigh, revisionReference[4], out);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\nAverage Rating: \" + ratingAverage);\n\t\t\t\tout.println(\"\\nAverage Rating: \" + ratingAverage);\n\t\t\t\tSystem.out.println(\"\\t Lowest Rating: \" + lowestRating + \" for Revision \" + revisionReference[1]);\n\t\t\t\tout.println(\"\\t Lowest Rating: \" + lowestRating + \" for Revision \" + revisionReference[1]);\n\t\t\t\tSystem.out.println(\"\\t Highest Rating: \" + highestRating + \" for Revision \" + revisionReference[0] + \"\\n\");\n\t\t\t\tout.println(\"\\t Highest Rating: \" + highestRating + \" for Revision \" + revisionReference[0] + \"\\n\");\n\t\t\n\t\t\t\tSystem.out.println(\"Average Number of Changed files: \" + nFilesAverage);\n\t\t\t\tout.println(\"Average Number of Changed files: \" + nFilesAverage);\n\t\t\t\tSystem.out.println(\"\\t Lowest Number of Changed Files: \" + lowestFileNumber + \" changed at Revision \" + revisionReference[3]);\n\t\t\t\tout.println(\"\\t Lowest Number of Changed Files: \" + lowestFileNumber + \" changed at Revision \" + revisionReference[3]);\n\t\t\t\tSystem.out.println(\"\\t Highest Number of Changed Files: \" + highestFileNumber + \" changed at Revision \" + revisionReference[2] + \"\\n\");\n\t\t\t\tout.println(\"\\t Highest Number of Changed Files: \" + highestFileNumber + \" changed at Revision \" + revisionReference[2] + \"\\n\");\n\t\t\t}\n\t\t\t\n\t\t\tif (bundle.getString(\"groupsToggle\").equals(\"true\")) {\n\t\t\t\tgrouping.currentOutput(out);\n\t\t\t}\n\t\t\t\n\t\t\tif (args.length > 1) {\n\t\t\t\t\n\t\t\t\tif (bundle.getString(\"percentToggle\").equals(\"true\")) {\n\t\t\t\t\tpercentages(args, out);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (bundle.getString(\"CSVToggle\").equals(\"true\")) {\n\t\t\t\tcsv();\n\t\t\t}\n\t\t\t\n\t\t\tif (bundle.getString(\"diffToggle\").equals(\"true\") && revisionTotal > 1) {\t\t\n\t\t\t\tdiff(out);\n\t\t\t}\n\t\t\t\n\t\t\tif (bundle.getString(\"commentToggle\").equals(\"true\")) {\n\t\t\t\tSystem.out.println(\"\\nRevision Comments (IMPORTANT DISCLAIMER: all commas have been replaced with semi-colons to allow insertion into a csv file): \\n\");\n\t\t\t\tout.println(\"Revision Comments (IMPORTANT DISCLAIMER: all commas have been replaced with semi-colons to allow insertion into a csv file): \\n\");\n\t\t\t\t\n\t\t\t\tfor (i = 0; i < commenting.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"\\t\" + revisions[i] + \":\");\n\t\t\t\t\tout.println(\"\\t\" + revisions[i] + \":\");\n\t\t\t\t\tSystem.out.println(commenting.get(i) + \"\\n\");\n\t\t\t\t\tout.println(commenting.get(i) + \"\\n\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tif (bundle.getString(\"otherStatsToggle\").equals(\"true\") || bundle.getString(\"groupsToggle\").equals(\"true\") || \n\t\t\t\tbundle.getString(\"percentToggle\").equals(\"true\") || bundle.getString(\"diffToggle\").equals(\"true\")) {\n\t\t\t\n\t\t\tSystem.out.println(\"|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-| \\n\");\n\t\t\tout.println(\"|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-| \\n\");\n\t\t}\n\n\t}", "public void printResults() {\r\n System.out.printf(\"\\nHistory\\n\\n\");\r\n String format = \"%-25s %s from %s\\n\";\r\n Collections.sort(results);\r\n for(Data data : results) {\r\n System.out.printf(format, data.getName(),\r\n defaultFormatter.format(data.getDate()), data.getComputer());\r\n }\r\n }", "@Override\n\tpublic void execute() {\n\t\tSystem.out.println(\"==STATISTICS FOR THE RESTAURANT==\");\n\t\tSystem.out.println(\"Most used Ingredients:\");\n\t\tmanager.printIngredients();\n\t\tSystem.out.println(\"Most ordered items:\");\n\t\tmanager.printMenuItems();\n\t\tSystem.out.println(\"==END STATISTICS==\");\n\t}", "public static void displayStats2(ArrayList<String> standings){\n\t\t\tString[] parts;\n\t\t\tdouble avg;\n\t\t\tSystem.out.println(\"-----------------------------\");\n\t\t\tSystem.out.println(\"Teams: Pct:\" );\n\t\t\tSystem.out.println(\"-----------------------------\");\n\t\t\tfor(String standing : standings){\n\t\t\t\tparts = standing.split(\"\\t\");\n\t\t\t\tavg = getAvg(standing);\n\t\t\t\tSystem.out.printf(\"%-15s%6.2f\\n \", parts[0], avg);\n\t\t\t\t//System.out.println(parts[1]);\n\t\t\t\t//System.out.println(parts[2]);\n\t\t\t\t\n\t\t\t}//end for \n\t//\t\tSystem.out.println(standings);\n\t\t}", "private void printCfaStatistics(PrintStream out) {\n if (cfa != null) {\n int edges = 0;\n for (CFANode n : cfa.getAllNodes()) {\n edges += n.getNumEnteringEdges();\n }\n\n out.println(\"Number of program locations: \" + cfa.getAllNodes().size());\n out.println(\"Number of CFA edges: \" + edges);\n if (cfa.getVarClassification().isPresent()) {\n out.println(\"Number of relevant variables: \" + cfa.getVarClassification().get()\n .getRelevantVariables().size());\n }\n out.println(\"Number of functions: \" + cfa.getNumberOfFunctions());\n\n if (cfa.getLoopStructure().isPresent()) {\n int loops = cfa.getLoopStructure().get().getCount();\n out.println(\"Number of loops: \" + loops);\n }\n }\n }", "private void printResults() {\n\t\tdouble percentCorrect = (double)(correctAnswers/numberAmt) * 100;\n\t\tSystem.out.println(\"Amount of number memorized: \" + numberAmt +\n\t\t\t\t \"\\n\" + \"Amount correctly answered: \" + correctAnswers +\n\t\t\t\t \"\\n\" + \"Percent correct: \" + (int)percentCorrect);\n\t}", "public void printComputerSummary() {\n\t\tfor (Component comp: configuration.values())\n\t\t{\n\t\t\tSystem.out.println(comp.getDescription());\n\t\t}\n\t}", "public String stats()\n\t{\n\t\tString algo = null;//set up algo return null if error\n\t\tswitch (sortingAlgorithm) {\n\t\tcase SelectionSort:\n\t\t\talgo = \"SelectionSort\";\n\t\t\tbreak;\n\t\tcase InsertionSort:\n\t\t\talgo = \"InsertionSort\";\n\t\t\tbreak;\n\t\tcase MergeSort:\n\t\t\talgo = \"MergeSort\";\n\t\t\tbreak;\n\t\tcase QuickSort:\n\t\t\talgo = \"QuickSort\";\n\t\t\tbreak;\n\t\t}\n\t\treturn algo + \"\\t\" + points.length + \"\\t\" + scanTime; \n\t}", "protected void Simulation_done()\r\n {\r\n \t// TO PRINT THE STATISTICS, FILL IN THE DETAILS BY PUTTING VARIBALE NAMES. DO NOT CHANGE THE FORMAT OF PRINTED OUTPUT\r\n \tSystem.out.println(\"\\n\\n===============STATISTICS=======================\");\r\n \tSystem.out.println(\"Number of original packets transmitted by A:\" + \"<YourVariableHere>\");\r\n \tSystem.out.println(\"Number of retransmissions by A:\" + \"<YourVariableHere>\");\r\n \tSystem.out.println(\"Number of data packets delivered to layer 5 at B:\" + \"<YourVariableHere>\");\r\n \tSystem.out.println(\"Number of ACK packets sent by B:\" + \"<YourVariableHere>\");\r\n \tSystem.out.println(\"Number of corrupted packets:\" + \"<YourVariableHere>\");\r\n \tSystem.out.println(\"Ratio of lost packets:\" + \"<YourVariableHere>\" );\r\n \tSystem.out.println(\"Ratio of corrupted packets:\" + \"<YourVariableHere>\");\r\n \tSystem.out.println(\"Average RTT:\" + \"<YourVariableHere>\");\r\n \tSystem.out.println(\"Average communication time:\" + \"<YourVariableHere>\");\r\n \tSystem.out.println(\"==================================================\");\r\n\r\n \t// PRINT YOUR OWN STATISTIC HERE TO CHECK THE CORRECTNESS OF YOUR PROGRAM\r\n \tSystem.out.println(\"\\nEXTRA:\");\r\n \t// EXAMPLE GIVEN BELOW\r\n \t//System.out.println(\"Example statistic you want to check e.g. number of ACK packets received by A :\" + \"<YourVariableHere>\"); \r\n }", "public void print() {\n\t\tSystem.out.println(\"[System] 펫 정보입니다.\\n 이름 : \"+TMGCSYS.tmgcName+\", 레벨 : \"+TMGCSYS.tmgcLV+\", 경험치 : \"+TMGCSYS.tmgcEXP+\"/\"+(100*TMGCSYS.tmgcLV)+\", 체력 : \"+TMGCSYS.tmgcHP+\", 스트레스 : \"+TMGCSYS.tmgcStress);\r\n\t}", "public static void show(){\n // We will test all the APIs here\n System.out.println(\"Pasture seeds: \" + PastureSeed.count + \"\\tPasture product : \" + PastureProduct.count);\n System.out.println(\"Corn seeds: \" + CornSeed.count + \"\\t\\tCorn product : \" + CornProduct.count);\n System.out.println(\"Rice seeds: \" + RiceSeed.count + \"\\t\\tRice product : \" + RiceProduct.count);\n }", "@Override\n\tpublic String toString()\n\t{\n\t\treturn \"Statistical output: \"\n\t\t\t\t+\"replication size = \"+this.replicationSize+\"; \"\n\t\t\t\t+\"sample size = \"+this.sampleSize+\"; \"\n\t\t\t\t+\"mean = \"+this.mean+\"; \"\n\t\t\t\t+\"std. dev. = \"+this.stDev+\"; \"\n\t\t\t\t+\"CI width (alpha = \"+this.alpha+\"; \"+this.nameOfStatisticalTest+\" ) = \"+this.CIWidth+\".\";\n\t}", "public void printStats(PrintStream out)\n {\n \n out.println(\"\\np(a_e|P_c,P_e,a_c):\");\n printProb(out, srcDstPredicateArgMap, 10, 0.05f);\n \n out.println(\"\\np(a_c|P_e,P_c,a_e):\");\n printProb(out, dstSrcPredicateArgMap, 10, 0.05f);\n \n //printMatrix(out, srcDstArgTypeMap, dstSrcArgTypeMap);\n \n //out.printf(\"one-to-one: %d, total: %d, %f\\n\", oneToOne, total, oneToOne*1.0/total);\n\n }" ]
[ "0.80032307", "0.78790224", "0.78014976", "0.77957135", "0.7782993", "0.75877726", "0.7528194", "0.7503221", "0.74541813", "0.74541813", "0.7450012", "0.7401637", "0.7366336", "0.7238039", "0.7196629", "0.71848804", "0.71724796", "0.7136786", "0.70869744", "0.703375", "0.7016458", "0.6948736", "0.6942757", "0.690279", "0.68958426", "0.68572176", "0.6845142", "0.6795234", "0.6788153", "0.67703074", "0.67612225", "0.6722016", "0.67142236", "0.67118907", "0.66895753", "0.6673823", "0.66597307", "0.6654624", "0.66505176", "0.66438735", "0.6637132", "0.65381885", "0.65157783", "0.64912176", "0.64897674", "0.6485323", "0.647997", "0.64713174", "0.6467563", "0.64671135", "0.64531225", "0.644785", "0.6442902", "0.64409286", "0.64320487", "0.64115614", "0.64041764", "0.63870656", "0.6372862", "0.6355214", "0.633727", "0.63369817", "0.632433", "0.62991846", "0.6277031", "0.6274732", "0.626571", "0.62603396", "0.624516", "0.62375915", "0.62331444", "0.6224471", "0.622185", "0.6221374", "0.6221022", "0.6220124", "0.6218989", "0.620633", "0.6201138", "0.6170823", "0.61699414", "0.61693394", "0.61597514", "0.615878", "0.6156512", "0.61543286", "0.61503613", "0.61501974", "0.61465794", "0.614516", "0.61404634", "0.6131842", "0.6125333", "0.6125297", "0.6124604", "0.61202973", "0.6109792", "0.61051446", "0.6097076", "0.6080056" ]
0.74407965
11
TODO Autogenerated method stub
private static int MaxSubarraySum(int[] a) { int max_so_for =Integer.MIN_VALUE; int max_ending_here = 0;; for (int i = 0; i < a.length; i++) { max_ending_here = max_ending_here + a[i]; if(max_so_for < max_ending_here ) max_so_for = max_ending_here; if(max_ending_here < 0) max_ending_here = 0; } return max_so_for; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Constructor for primary key
public Systemlog (java.lang.Integer rowid) { super(rowid); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "PrimaryKey createPrimaryKey();", "public DatasetParameterPK() {\n }", "public ParametroPorParametroPK() {\r\n\t}", "PrimaryKey getPrimarykey();", "Key getPrimaryKey();", "public TdOficioAfectacionPK() {\n }", "PrimaryKey getPrimaryKey();", "public DomainPK()\n {\n }", "public LeaguePrimaryKey() {\n }", "public TdNmResumenPK() {\n }", "public PrimaryKey getPrimaryKey();", "public EnvioPersonaPK() {\r\n }", "public static Key createPrimaryKey(Number idexped, Number idbulto)\n {\n return new Key(new Object[] {idexped, idbulto});\n }", "public void setPrimaryKey(String primaryKey);", "public void setPrimaryKey(String primaryKey);", "public void setPrimaryKey(String primaryKey);", "public PaymentRecordKey() {\n super();\n }", "private Integer newPrimaryKey( )\n {\n DAOUtil daoUtil = new DAOUtil( SQL_QUERY_NEW_PK );\n daoUtil.executeQuery( );\n Integer nKey = null;\n\n if ( daoUtil.next( ) )\n {\n nKey = daoUtil.getInt( 1 );\n }\n else\n {\n nKey = 1;\n }\n daoUtil.close( );\n\n return nKey.intValue( );\n }", "public MarketplaceRatingPK(){\n\t}", "public static PrimaryIndexBuilder pkIndex() {\n return new PrimaryKeyBuilderImpl();\n }", "public void setPrimaryKey(String primaryKey) {\r\n this.primaryKey = primaryKey;\r\n }", "@Override\r\n\tpublic String getPrimaryKey() {\n\t\treturn \"ID\";\r\n\t}", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(long primaryKey);", "public void setPrimaryKey(int primaryKey);", "public Key()\n {\n name = \"\";\n fields = new Vector<String>();\n options = new Vector<String>();\n isPrimary = false;\n isUnique = false;\n }", "public void setPrimaryKey(String primaryKey) {\n this.primaryKey = primaryKey;\n }", "public void setPrimaryKey(long primaryKey) {\n this.primaryKey = primaryKey;\n }", "public Constraint setKey( String theId) {\n\t\tmyKey = new IdDt(theId); \n\t\treturn this; \n\t}", "Object getPrimaryKey() throws IllegalStateException;", "public void setPrimaryKey(String primaryKey) {\r\n\t\tthis.primaryKey = primaryKey;\r\n\t}", "private int newPrimaryKey( )\n {\n int nKey;\n DAOUtil daoUtil = new DAOUtil( SQL_QUERY_NEW_PK );\n\n daoUtil.executeQuery( );\n\n if ( daoUtil.next( ) )\n {\n nKey = daoUtil.getInt( 1 ) + 1;\n }\n else\n {\n // If the table is empty\n nKey = 1;\n }\n\n daoUtil.free( );\n\n return nKey;\n }", "PK create(T newInstance);", "public ProductoPk createPk() {\r\n return new ProductoPk(idProducto);\r\n }", "private TbviajepasajeroPK getPrimaryKey(PathSegment pathSegment) {\r\n ugt.entidades.TbviajepasajeroPK key = new ugt.entidades.TbviajepasajeroPK();\r\n javax.ws.rs.core.MultivaluedMap<String, String> map = pathSegment.getMatrixParameters();\r\n java.util.List<String> idviaje = map.get(\"idviaje\");\r\n if (idviaje != null && !idviaje.isEmpty()) {\r\n key.setIdviaje(new java.lang.Integer(idviaje.get(0)));\r\n }\r\n java.util.List<String> cedulap = map.get(\"cedulap\");\r\n if (cedulap != null && !cedulap.isEmpty()) {\r\n key.setCedulap(java.lang.String.valueOf(cedulap.get(0)));\r\n }\r\n return key;\r\n }", "public String getPrimaryKey() {\n if (primaryKey == null) primaryKey = \"id\";\n return primaryKey;\n }", "public static Key createPrimaryKey(Number supplierId) {\n return new Key(new Object[]{supplierId});\n }", "public void setPrimaryKey(String primaryKey) {\n\t\tthis.primaryKey = primaryKey;\n\t}", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "public ListaPorMenuPK() {\r\n\t}", "public DBRecordKey<gDBR> createKey() // <? extends DBRecord<?>>\n throws DBException\n {\n if (this.keyClass != null) {\n try {\n // this creates an empty key with no key fields\n Constructor<? extends DBRecordKey<gDBR>> kc = this.keyClass.getConstructor(new Class<?>[0]);\n return kc.newInstance(new Object[0]); // \"unchecked cast\"\n } catch (Throwable t) { // NoSuchMethodException, ...\n // Implementation error (should never occur)\n throw new DBException(\"Key Creation\", t);\n }\n }\n return null;\n }", "boolean isPrimaryKey();", "public void setIdkey(String pIdkey){\n this.idkey = pIdkey;\n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_1()\n\t\tthrows Exception {\n\t\tDBTable table = new DefaultDBTable(\"\");\n\t\tString name = \"\";\n\t\tboolean nameDeterministic = false;\n\t\tString columnName1 = \"\";\n\t\tString columnName2 = \"0123456789\";\n\t\tString columnName3 = \"An��t-1.0.txt\";\n\t\tString columnName4 = null;\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1, columnName2, columnName3, columnName4);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(\"CONSTRAINT PRIMARY KEY (, 0123456789, An��t-1.0.txt, )\", result.toString());\n\t\tassertEquals(false, result.isNameDeterministic());\n\t\tassertEquals(\"\", result.getName());\n\t\tassertEquals(\"unique constraint\", result.getObjectType());\n\t\tassertEquals(null, result.getDoc());\n\t}", "@Test\n\tpublic void testDBPrimaryKeyConstraint_18()\n\t\tthrows Exception {\n\t\tDBTable table = new DefaultDBTable(\"\", new DBSchema(\"\"));\n\t\tString name = \"\";\n\t\tboolean nameDeterministic = true;\n\t\tString columnName1 = \"0123456789\";\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(\"CONSTRAINT PRIMARY KEY (0123456789)\", result.toString());\n\t\tassertEquals(true, result.isNameDeterministic());\n\t\tassertEquals(\"\", result.getName());\n\t\tassertEquals(\"unique constraint\", result.getObjectType());\n\t\tassertEquals(null, result.getDoc());\n\t}", "public SQLRowIdentifier() {\n\t\tsuper(EnumSQLType.SqlRowIdentifier, LENGTH);\n\t\t\n\t\tthis.page = new SQLInteger();\n\t\tthis.slot = new SQLInteger();\n\t}", "public void setPrimaryKey(VLegalFORelPK primaryKey);", "@Test\n\tpublic void testDBPrimaryKeyConstraint_23()\n\t\tthrows Exception {\n\t\tDBTable table = new LazyTable(new JDBCDBImporter(\"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\"), (DBSchema) null, (String) null, (String) null);\n\t\tString name = \"0123456789\";\n\t\tboolean nameDeterministic = true;\n\t\tString columnName1 = \"\";\n\t\tString columnName2 = \"0123456789\";\n\t\tString columnName3 = \"An��t-1.0.txt\";\n\t\tString columnName4 = null;\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1, columnName2, columnName3, columnName4);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NullPointerException\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getCatalog(LazyTable.java:130)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getRealTable(LazyTable.java:256)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.setPrimaryKey(LazyTable.java:97)\n\t\t// at org.databene.jdbacl.model.DBPrimaryKeyConstraint.<init>(DBPrimaryKeyConstraint.java:47)\n\t\tassertNotNull(result);\n\t}", "@Override\n\tpublic Object getPrimaryKey() {\n\t\treturn null;\n\t}", "protected String createPrimaryKeyConstraint(TableModel table) {\r\n\t\tColumnModel[] pks = table.getPrimaryKeyColumns();\r\n\t\tString s = \"\";\r\n\t\tif (pks.length > 1) {\r\n\t\t\ts = \",\\n PRIMARY KEY(\";\r\n\t\t\tString a = \"\";\r\n\t\t\tfor (ColumnModel c : pks) {\r\n\t\t\t\tif (a.length() > 0) {\r\n\t\t\t\t\ta += \", \";\r\n\t\t\t\t}\r\n\t\t\t\ta += this.quote(c.getName());\r\n\t\t\t}\r\n\t\t\ts += a + \")\";\r\n\t\t}\r\n\t\treturn s;\r\n\t}", "public Object generalPK() {\n\t\treturn null;\r\n\t}", "public Key getKey() {\n\t\tString fieldvalue = getValue(\"sys_id\");\n\t\tassert fieldvalue != null;\n\t\treturn new Key(fieldvalue);\n\t}", "@Test\n\tpublic void testDBPrimaryKeyConstraint_29()\n\t\tthrows Exception {\n\t\tDBTable table = new DefaultDBTable(\"\");\n\t\tString name = \"\";\n\t\tboolean nameDeterministic = false;\n\t\tString columnName1 = \"\";\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(\"CONSTRAINT PRIMARY KEY ()\", result.toString());\n\t\tassertEquals(false, result.isNameDeterministic());\n\t\tassertEquals(\"\", result.getName());\n\t\tassertEquals(\"unique constraint\", result.getObjectType());\n\t\tassertEquals(null, result.getDoc());\n\t}", "@Override\n\tpublic Key getPk() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Key getPk() {\n\t\treturn null;\n\t}", "@Override\n public void setPrimaryKey(long primaryKey) {\n _partido.setPrimaryKey(primaryKey);\n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_2()\n\t\tthrows Exception {\n\t\tDBTable table = new DefaultDBTable(\"\", new DBSchema(\"\"));\n\t\tString name = \"0123456789\";\n\t\tboolean nameDeterministic = true;\n\t\tString columnName1 = \"\";\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(\"CONSTRAINT 0123456789 PRIMARY KEY ()\", result.toString());\n\t\tassertEquals(true, result.isNameDeterministic());\n\t\tassertEquals(\"0123456789\", result.getName());\n\t\tassertEquals(\"unique constraint\", result.getObjectType());\n\t\tassertEquals(null, result.getDoc());\n\t}", "@Test\n\tpublic void testDBPrimaryKeyConstraint_24()\n\t\tthrows Exception {\n\t\tDBTable table = new DefaultDBTable(\"\", new DBSchema(\"\"));\n\t\tString name = \"0123456789\";\n\t\tboolean nameDeterministic = false;\n\t\tString columnName1 = \"\";\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(\"CONSTRAINT 0123456789 PRIMARY KEY ()\", result.toString());\n\t\tassertEquals(false, result.isNameDeterministic());\n\t\tassertEquals(\"0123456789\", result.getName());\n\t\tassertEquals(\"unique constraint\", result.getObjectType());\n\t\tassertEquals(null, result.getDoc());\n\t}", "public void setPrimaryKey(int primaryKey) {\n\t\tthis.primaryKey = primaryKey;\n\t}", "public JobID() {\n super();\n }", "public PessoaVO(Long pk){\r\n\t\tsuper(pk);\r\n\t}", "public PrimaryKeySpec(String aSchema, String aTable, String aField, String aCName) {\n this();\n copyPkFromValues(aSchema, aTable, aField, aCName);\n }", "public String getPrimaryKey() {\r\n return primaryKey;\r\n }", "public ObjectKey getPrimaryKey()\n {\n return SimpleKey.keyFor(getNewsletterId());\n }", "@Nonnull\n protected KeyExpression buildPrimaryKey() {\n return Key.Expressions.concat(\n Key.Expressions.recordType(),\n Key.Expressions.list(constituents.stream()\n .map(c -> Key.Expressions.field(c.getName()).nest(c.getRecordType().getPrimaryKey()))\n .collect(Collectors.toList())));\n }", "public abstract String getPrimaryKey(String tableName);", "@Test\n\tpublic void testDBPrimaryKeyConstraint_11()\n\t\tthrows Exception {\n\t\tDBTable table = new LazyTable(new JDBCDBImporter(\"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\"), (DBSchema) null, (String) null, (String) null);\n\t\tString name = \"\";\n\t\tboolean nameDeterministic = true;\n\t\tString columnName1 = \"\";\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NullPointerException\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getCatalog(LazyTable.java:130)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getRealTable(LazyTable.java:256)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.setPrimaryKey(LazyTable.java:97)\n\t\t// at org.databene.jdbacl.model.DBPrimaryKeyConstraint.<init>(DBPrimaryKeyConstraint.java:47)\n\t\tassertNotNull(result);\n\t}", "@Override\n public String getPrimaryKey(String tableName) {\n return super.getPrimaryKey(tableName);\n }", "boolean getPrimaryKey();", "@Test\n\tpublic void testDBPrimaryKeyConstraint_19()\n\t\tthrows Exception {\n\t\tDBTable table = new DefaultDBTable(\"0123456789\", new DBSchema(\"\", new DBCatalog(\"\")));\n\t\tString name = \"0123456789\";\n\t\tboolean nameDeterministic = true;\n\t\tString columnName1 = \"0123456789\";\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(\"CONSTRAINT 0123456789 PRIMARY KEY (0123456789)\", result.toString());\n\t\tassertEquals(true, result.isNameDeterministic());\n\t\tassertEquals(\"0123456789\", result.getName());\n\t\tassertEquals(\"unique constraint\", result.getObjectType());\n\t\tassertEquals(null, result.getDoc());\n\t}", "@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_phieugiahan.setPrimaryKey(primaryKey);\n\t}", "public EntityID() {\n }", "public Key(int type)\n {\n this.type = type;\n this.columns = new ArrayList<Column>();\n }", "protected EquipmentTable() {\r\n\t\tsuper(NAME, PRIMARY_KEY_CONSTRAINT, null, null, GeneralHelper.getNonPrimaryColumns(COLUMNS));\r\n\t}", "public OmOrgSrefNamePK() {\r\n\t}", "@Override\n public String getKey()\n {\n return id; \n }", "public DbRecord()\n {\n m_UserName = \"\";\n // Generate user's unique identifier\n m_Key = new byte[16];\n java.util.UUID guid = java.util.UUID.randomUUID();\n long itemHigh = guid.getMostSignificantBits();\n long itemLow = guid.getLeastSignificantBits();\n for( int i = 7; i >= 0; i-- )\n {\n m_Key[i] = (byte)(itemHigh & 0xFF);\n itemHigh >>>= 8;\n m_Key[8+i] = (byte)(itemLow & 0xFF);\n itemLow >>>= 8;\n }\n m_Template = null;\n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_8()\n\t\tthrows Exception {\n\t\tDBTable table = new DefaultDBTable(\"\", new DBSchema(\"\"));\n\t\tString name = \"0123456789\";\n\t\tboolean nameDeterministic = true;\n\t\tString columnName1 = \"0123456789\";\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(\"CONSTRAINT 0123456789 PRIMARY KEY (0123456789)\", result.toString());\n\t\tassertEquals(true, result.isNameDeterministic());\n\t\tassertEquals(\"0123456789\", result.getName());\n\t\tassertEquals(\"unique constraint\", result.getObjectType());\n\t\tassertEquals(null, result.getDoc());\n\t}", "public ContentKey() {}", "public void setPrimaryKey(String primaryKey) {\n getBasicChar().setPrimaryKey(primaryKey);\n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_13()\n\t\tthrows Exception {\n\t\tDBTable table = new DefaultDBTable(\"0123456789\", new DBSchema(\"\", new DBCatalog(\"\")));\n\t\tString name = \"\";\n\t\tboolean nameDeterministic = false;\n\t\tString columnName1 = \"\";\n\t\tString columnName2 = \"0123456789\";\n\t\tString columnName3 = \"An��t-1.0.txt\";\n\t\tString columnName4 = null;\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1, columnName2, columnName3, columnName4);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(\"CONSTRAINT PRIMARY KEY (, 0123456789, An��t-1.0.txt, )\", result.toString());\n\t\tassertEquals(false, result.isNameDeterministic());\n\t\tassertEquals(\"\", result.getName());\n\t\tassertEquals(\"unique constraint\", result.getObjectType());\n\t\tassertEquals(null, result.getDoc());\n\t}", "protected String createPKString(DbEntity entity) {\n List pk = entity.getPrimaryKey();\n\n if (pk == null || pk.size() == 0) {\n throw new CayenneRuntimeException(\n \"Entity '\" + entity.getName() + \"' has no PK defined.\");\n }\n\n StringBuffer buffer = new StringBuffer();\n buffer.append(\"CREATE PRIMARY KEY \").append(entity.getName()).append(\" (\");\n\n Iterator it = pk.iterator();\n\n // at this point we know that there is at least on PK column\n DbAttribute firstColumn = (DbAttribute) it.next();\n buffer.append(firstColumn.getName());\n\n while (it.hasNext()) {\n DbAttribute column = (DbAttribute) it.next();\n buffer.append(\", \").append(column.getName());\n }\n\n buffer.append(\")\");\n return buffer.toString();\n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_30()\n\t\tthrows Exception {\n\t\tDBTable table = new DefaultDBTable(\"0123456789\", new DBSchema(\"\", new DBCatalog(\"\")));\n\t\tString name = \"\";\n\t\tboolean nameDeterministic = false;\n\t\tString columnName1 = \"\";\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(\"CONSTRAINT PRIMARY KEY ()\", result.toString());\n\t\tassertEquals(false, result.isNameDeterministic());\n\t\tassertEquals(\"\", result.getName());\n\t\tassertEquals(\"unique constraint\", result.getObjectType());\n\t\tassertEquals(null, result.getDoc());\n\t}", "protected LocationPK() {\n super();\n }", "public String getPrimaryKey() throws CloneNotSupportedException {\r\n\t\tString key=\"\";\r\n\t\tfor (int i = 0; i < this.state.getSizeCol(); i++) {\r\n\t\t\tfor (int j = 0; j < this.state.getSizeRow(); j++) {\r\n\t\t\t\tkey+=this.state.getValue(new Position(i,j));\r\n\t\t\t}\r\n\t\t}\r\n\t\tkey+=\"?\"+this.state.getTractor().getPosition().toString();\r\n\t\treturn key;\r\n\t}", "public long getPrimaryKey() {\n return primaryKey;\n }" ]
[ "0.78750813", "0.74897444", "0.73985463", "0.70965606", "0.70702577", "0.6998011", "0.6979706", "0.69716114", "0.6965111", "0.69635993", "0.6915723", "0.67964387", "0.6758262", "0.67022586", "0.67022586", "0.67022586", "0.66982806", "0.65859663", "0.6583274", "0.6531201", "0.65294653", "0.65230864", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.651203", "0.6507262", "0.6468734", "0.6455556", "0.6440212", "0.64325327", "0.63928556", "0.6373797", "0.6351234", "0.6308861", "0.6299872", "0.629687", "0.6292846", "0.62885314", "0.6270956", "0.6257069", "0.6243754", "0.6241252", "0.6229149", "0.6220587", "0.62175274", "0.6211577", "0.6202879", "0.61947286", "0.61937946", "0.6193225", "0.6191897", "0.61863357", "0.61728334", "0.61576545", "0.6151814", "0.6151814", "0.6148775", "0.61472005", "0.61377734", "0.6130182", "0.61276376", "0.61211133", "0.6111883", "0.6106823", "0.6106647", "0.61035305", "0.6101683", "0.609865", "0.60973847", "0.6093208", "0.6091701", "0.60808825", "0.60705644", "0.6067181", "0.60650146", "0.60645187", "0.60606664", "0.605043", "0.60452724", "0.60376537", "0.603744", "0.60362744", "0.6034782", "0.60331964", "0.60228753", "0.60216784", "0.6020992" ]
0.0
-1
The base predicate for an DesignAUndertaking combination.
protected abstract boolean isSatisfiedBy(Design design, AUndertaking t);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkSatisifies(Design design, AUndertaking task)\n {\n resetState();\n return checkCombination(design, task);\n }", "public boolean checkDeskSubset(ArrayList<Furniture> subset){\n boolean legs = false;\n boolean top = false;\n boolean drawer = false;\n\n for(Furniture d : subset){\n if(d instanceof Desk){\n Desk desk = (Desk)d;\n if(desk.getLegs().equals(\"Y\")){\n legs = true;\n }\n if(desk.getTop().equals(\"Y\")){\n top = true;\n }\n if(desk.getDrawer().equals(\"Y\")){\n drawer = true;\n }\n }\n }\n // check if any of the desk pieces are missing and if so the combination is invalid\n if(!legs || !top || !drawer){\n return false;\n }\n return true;\n }", "public static boolean multiProve(Tableau tableau) {\n // Alphas\n boolean retVal = expandAllAlphas(tableau);\n // Deltas\n retVal = expandAllDeltas(tableau) || retVal;\n // expand comprehension triggers before doing comprehension stuff\n retVal = expandComprehensionTriggers(tableau) || retVal;\n // Comprehension Schema\n retVal = expandClassMemberPredicates(tableau) || retVal;\n // Brown's rule\n retVal = tableau.applyAllBrowns() || retVal;\n // Beta or Gamma\n if (expandOneBeta(tableau))\n return true;\n if (Prover.unifyEquality(tableau) != null)\n return false;\n return expandOneGamma(tableau) || retVal;\n }", "@Override\n public boolean predicate2(Object dm, Designer dsgr) {\n if (!(Model.getFacade().isAClassifier(dm))) {\n return NO_PROBLEM;\n }\n if (!(Model.getFacade().isPrimaryObject(dm))) {\n return NO_PROBLEM;\n }\n\n // If the classifier does not have a name,\n // then no problem - the model is not finished anyhow.\n if ((Model.getFacade().getName(dm) == null)\n\t || (\"\".equals(Model.getFacade().getName(dm)))) {\n return NO_PROBLEM;\n\t}\n\n // Abstract elements do not necessarily require associations\n if (Model.getFacade().isAGeneralizableElement(dm)\n\t && Model.getFacade().isAbstract(dm)) {\n return NO_PROBLEM;\n }\n\n // Types can probably have associations, but we should not nag at them\n // not having any.\n // utility is a namespace collection - also not strictly required\n // to have associations.\n if (Model.getFacade().isType(dm)) {\n return NO_PROBLEM;\n }\n if (Model.getFacade().isUtility(dm)) {\n return NO_PROBLEM;\n }\n\n // See issue 1129: If the classifier has dependencies,\n // then mostly there is no problem. \n if (Model.getFacade().getClientDependencies(dm).size() > 0) {\n return NO_PROBLEM;\n }\n if (Model.getFacade().getSupplierDependencies(dm).size() > 0) {\n return NO_PROBLEM;\n }\n \n // special cases for use cases\n // Extending use cases and use case that are being included are\n // not required to have associations.\n if (Model.getFacade().isAUseCase(dm)) {\n Object usecase = dm;\n Collection includes = Model.getFacade().getIncludes(usecase);\n if (includes != null && includes.size() >= 1) {\n return NO_PROBLEM;\n }\n Collection extend = Model.getFacade().getExtends(usecase);\n if (extend != null && extend.size() >= 1) {\n return NO_PROBLEM;\n }\n }\n \n \n\n //TODO: different critic or special message for classes\n //that inherit all ops but define none of their own.\n\n if (findAssociation(dm, 0)) {\n return NO_PROBLEM;\n }\n return PROBLEM_FOUND;\n }", "public static boolean proveADBorG(Tableau tableau) {\n // TODO: set this up so that unification only happens if something\n // more than alphas and delta's are done.\n\n // Alphas\n boolean retVal = expandAllAlphas(tableau);\n\n // Deltas\n boolean temp = expandAllDeltas(tableau);\n\n // Beta or Gamma\n return (expandOneBeta(tableau) ||\n expandOneGamma(tableau) ||\n retVal || temp);\n }", "public boolean equipeConditions(CharacterProfile profile){\n\t\tSystem.err.println(\"method applyItemEffects need override!\");\n\t\treturn true;\n\t}", "public abstract Combinacion elegirCombinacionOculta();", "public abstract boolean isReusableWith(DTDSubset intSubset);", "public boolean isConjunctive() { return true; }", "@Override\n public boolean distributesDown() {\n return betterOrEqual(P);\n }", "public boolean canBecombo(){\n \treturn super.getPrice() <4;\n }", "boolean hasProduces();", "default DiscreteSet2D support() {\r\n\t\treturn pointsSatisfying(d -> d != 0);\r\n\t}", "public boolean isCoveredBy(Filter f);", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "public boolean canBecombo(){\n \treturn price <5;\n }", "@Override\n public boolean isInheritable(InheritedAccessEnabled access) {\n Preference preference = (Preference) access;\n if (preference.getVisibleAtRole() != null) {\n return true;\n }\n if (preference.isPropertyList()) {\n return !propertyBlackList.contains(preference.getProperty());\n } else {\n return true;\n }\n }", "protected boolean isPieceOfFurnitureDeletable(HomePieceOfFurniture piece) {\n return true;\n }", "protected boolean isPieceOfFurniturePartOfBasePlan(HomePieceOfFurniture piece) {\n return !piece.isMovable() || piece.isDoorOrWindow();\n }", "public abstract boolean isFilterApplicable ();", "public boolean isSomethingBuyable(GameClient game){\n for(Level l : Level.values()){\n for(ColorDevCard c : ColorDevCard.values()){\n try {\n NumberOfResources cost = dashBoard[l.ordinal()][c.ordinal()].getCost();\n cost = cost.safe_sub(game.getMe().getDiscounted());\n game.getMe().getDepots().getResources().sub(cost);\n return true;\n } catch (OutOfResourcesException | NullPointerException ignored) {}\n }\n }\n return false;\n }", "public abstract NestedSet<Artifact> auxiliary();", "public boolean isBenefitAvailableFor(Account account, Dining dining);", "protected Conjunction nonAttack(Argument a, Set<Argument> attackers) {\n\t\tif(attackers.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tConjunction nonAttack = new Conjunction(\"nonAttack_\" + a.getName());\n\t\tfor(Argument att : attackers) {\n\t\t\tnonAttack.addSubformula(new Negation(new Atom(\"acc_\" + att.getName())));\n\t\t}\n\t\treturn nonAttack;\n\t}", "public abstract boolean isSatisfied();", "public abstract boolean isUsable();", "boolean isComposite();", "boolean isComposite();", "private void crossProduct() {\n BaseCandidateElement[] it = o.inputObject.firstStageCandidates.values().toArray(new BaseCandidateElement[0]);\n // logger.info(Arrays.toString(it));\n for (int i = 0; i < it.length; i++) {\n for (int j = i + 1; j < it.length; j++) {\n if (PrecisConfigProperties.HIERARCHY_DIMS_ENABLED && hierarchyDimsNegation.checkIfBelongToSameHierarchyGroup(it[i], it[j]))\n continue;\n if (it[i].xor(it[j]).cardinality() == 4) {\n BitSet b = it[i].or(it[j]);\n o.inputObject.addCandidate(b);\n }\n }\n }\n }", "public boolean relationalExpressionUpperDerivation() {\r\n\t\treturn this.getImpl().relationalExpressionUpperDerivation();\r\n\t}", "public boolean isContradicting(Item item){\r\n if(item.getType() == BASEBALL_BAT.getType()) {\r\n if (unitMap.containsKey(FOOTBALL.getType())) return true;\r\n else return false;\r\n }\r\n if (item.getType() ==FOOTBALL.getType()){\r\n if (unitMap.containsKey(BASEBALL_BAT.getType())) return true;\r\n else return false;\r\n }\r\n return false;\r\n }", "public abstract void applyTo(StudentPaper aStudentPaper);", "public interface ApplePredicate {\n boolean test (Apple apple);\n}", "default boolean areRelated(Triple... elements) {\n return witnesses(elements).anyMatch(x -> true);\n }", "boolean canCrit();", "@Override\n public boolean applyThis() {\n Unit source = (Unit) ref.getSourceObj();\n Ref REF = ref.getCopy();\n Condition conditions = new OrConditions(\n DC_ConditionMaster\n .getSelectiveTargetingTemplateConditions(SELECTIVE_TARGETING_TEMPLATES.MY_ITEM),\n DC_ConditionMaster\n .getSelectiveTargetingTemplateConditions(SELECTIVE_TARGETING_TEMPLATES.MY_WEAPON));\n if (!new SelectiveTargeting(conditions).select(REF)) {\n ref.getActive().setCancelled(true);\n return false;\n }\n HeroItem item = (HeroItem) REF.getTargetObj();\n conditions = new Conditions(\n // ++ Max distance?\n new DistanceCondition(ref.getActive().getIntParam(PARAMS.RANGE, false) + \"\"),\n // new NumericCondition(\"{match_c_n_of_actions}\", \"1\"),\n new CanActCondition(KEYS.MATCH),\n new NotCondition(ConditionMaster.getSelfFilterCondition()),\n DC_ConditionMaster\n .getSelectiveTargetingTemplateConditions(SELECTIVE_TARGETING_TEMPLATES.ANY_ALLY));\n // non-immobile, ++facing?\n if (!new SelectiveTargeting(conditions).select(REF)) {\n ref.getActive().setCancelled(true);\n return false;\n }\n\n Unit unit = (Unit) REF.getTargetObj();\n\n boolean result = roll(source, unit, item);\n if (item instanceof QuickItem) {\n QuickItem quickItem = (QuickItem) item;\n source.removeQuickItem(quickItem);\n if (result) {\n unit.addQuickItem(quickItem);\n } else {\n dropped(item, unit);\n }\n\n } else {\n source.unequip(item, null);\n if (result) {\n unit.addItemToInventory(item); // TODO equip in hand if\n }\n// possible? spend AP?\n else {\n dropped(item, unit);\n }\n\n }\n // ref.getObj(KEYS.ITEM);\n return true;\n }", "public boolean applyCommonMeauringOperationRule() {\n\t \n\t if(isApplicableCartesiaProductRule() == false) {\n\t \tSystem.out.println(\"ERROR: Failure to apply Cartesian Product Rewriting Rule\");\n\t \treturn false;\n\t }\n\t \n\t this.rset = new HashMap<Integer, Query>();\n\t this.rtype = RType.CARTESIAN_PRODUCT_RULE;\n\t this.rqId = 1;\n\t \n\t \n\t List<Grouping> allGroupings = new ArrayList<>();\n\t for(Map.Entry<Integer, Query> entry : this.qset.entrySet()){\n\t\t Query query = entry.getValue();\n\t\t allGroupings.add(query.getQueryTriple()._1());\n\t }\n\t \n\t\tGrouping gPart = new Grouping(allGroupings);\n\t\tMeasuring mPart = this.qset.entrySet().iterator().next().getValue().getQueryTriple()._2();;\n\t Operation opPart = this.qset.entrySet().iterator().next().getValue().getQueryTriple()._3();\n\n\t /* Add the abse query to rewrited list*/\n\t\tTuple3<Grouping, Measuring, Operation> baseQuery = new Tuple3<>(gPart, mPart, opPart);\n\t\trset.put(rqId, new Query(baseQuery));\n\t \n\t\t/* Create projection queries */ \n\t\tfor(Grouping g : allGroupings) {\n\t\t\tGrouping projPart = new Grouping();\n\t\t\tprojPart.setGrouping(g.getGroupingAttribute());\n\t\t\tprojPart.setGroupingType(GType.PROJECTION_GROUPING);\n\t\t\tTuple3<Grouping, Measuring, Operation> projectionQuery = new Tuple3<>(projPart, mPart, opPart);\n\n\t\t\tthis.rqId++;\n\t\t\trset.put(rqId, new Query(projectionQuery));\t \n\t\t}\n\t\treturn true;\n\t}", "protected Conjunction isAccepted(Argument a, Set<Argument> attackers) {\n\t\tConjunction result = new Conjunction(\"isAccepted_\" + a.getName());\n\t\tConjunction nonAttack = this.nonAttack(a, attackers);\n\t\tif(nonAttack != null) {\n\t\t\tresult.addSubformula(nonAttack);\n\t\t}\n\t\tresult.addSubformula(new Atom(\"acc_\" + a.getName()));\n\t\t\n\t\treturn result;\n\t}", "public abstract DoublePredicate upperPredicate(double upperBound);", "private boolean canTakeBandanaFrom(Unit other) {\n return getCalories() >= (2 * other.getCalories());\n }", "private void goPredicate() {\n\t\t\n\t\tSurinamBananas sb = new SurinamBananas();\n\t\t\n\t\tCardboardBox<Musa,Integer> cb = sb.boxSupplier.get();\n\t\t\n\t\t// 3 bananas\n\t\tcb.add(new Basjoo()); // cb.add(new Basjoo()); cb.add(new Basjoo());\n\t\t\n\t\tPredicate< CardboardBox<Musa,Integer> > predIsEmpty = (c) -> c.size() == 0;\n\t\t\n\t\tPredicate< CardboardBox<Musa,Integer> > predLessThan3 = (c) -> c.size() < 3;\n\t\tPredicate< CardboardBox<Musa,Integer> > predMoreThan2 = (c) -> c.size() > 2;\n\t\tPredicate< CardboardBox<Musa,Integer> > predMoreThan6 = (c) -> c.size() > 6;\n\t\t\n\t\tPredicate< CardboardBox<Musa,Integer> > notEmptyAndMoreThan2 = predIsEmpty.negate().and(predMoreThan2);\n\t\t\n\t\tPredicate< CardboardBox<Musa,Integer> > lessThanThreeOrMoreThan6 = (predIsEmpty.negate().and(predLessThan3)) .or(predIsEmpty.negate().and(predMoreThan6) );\n\t\t\n\t\t//System.out.println( \"notEmptyAndMoreThan2: \" + notEmptyAndMoreThan2.test(cb) );\n\t\tSystem.out.println( \"lessThanThreeOrMoreThan6: \" + lessThanThreeOrMoreThan6.test(cb) );\n\t\t\n\t}", "public interface HadithSanad extends WrappedIndividual {\r\n\r\n /* ***************************************************\r\n * Property http://purl.org/dc/terms/hasPart\r\n */\r\n \r\n /**\r\n * Gets all property values for the hasPart property.<p>\r\n * \r\n * @returns a collection of values for the hasPart property.\r\n */\r\n Collection<? extends WrappedIndividual> getHasPart();\r\n\r\n /**\r\n * Checks if the class has a hasPart property value.<p>\r\n * \r\n * @return true if there is a hasPart property value.\r\n */\r\n boolean hasHasPart();\r\n\r\n /**\r\n * Adds a hasPart property value.<p>\r\n * \r\n * @param newHasPart the hasPart property value to be added\r\n */\r\n void addHasPart(WrappedIndividual newHasPart);\r\n\r\n /**\r\n * Removes a hasPart property value.<p>\r\n * \r\n * @param oldHasPart the hasPart property value to be removed.\r\n */\r\n void removeHasPart(WrappedIndividual oldHasPart);\r\n\r\n\r\n /* ***************************************************\r\n * Property http://purl.org/dc/terms/isPartOf\r\n */\r\n \r\n /**\r\n * Gets all property values for the isPartOf property.<p>\r\n * \r\n * @returns a collection of values for the isPartOf property.\r\n */\r\n Collection<? extends WrappedIndividual> getIsPartOf();\r\n\r\n /**\r\n * Checks if the class has a isPartOf property value.<p>\r\n * \r\n * @return true if there is a isPartOf property value.\r\n */\r\n boolean hasIsPartOf();\r\n\r\n /**\r\n * Adds a isPartOf property value.<p>\r\n * \r\n * @param newIsPartOf the isPartOf property value to be added\r\n */\r\n void addIsPartOf(WrappedIndividual newIsPartOf);\r\n\r\n /**\r\n * Removes a isPartOf property value.<p>\r\n * \r\n * @param oldIsPartOf the isPartOf property value to be removed.\r\n */\r\n void removeIsPartOf(WrappedIndividual oldIsPartOf);\r\n\r\n\r\n /* ***************************************************\r\n * Property http://quranontology.com/Resource/MentionedIn\r\n */\r\n \r\n /**\r\n * Gets all property values for the MentionedIn property.<p>\r\n * \r\n * @returns a collection of values for the MentionedIn property.\r\n */\r\n Collection<? extends Hadith> getMentionedIn();\r\n\r\n /**\r\n * Checks if the class has a MentionedIn property value.<p>\r\n * \r\n * @return true if there is a MentionedIn property value.\r\n */\r\n boolean hasMentionedIn();\r\n\r\n /**\r\n * Adds a MentionedIn property value.<p>\r\n * \r\n * @param newMentionedIn the MentionedIn property value to be added\r\n */\r\n void addMentionedIn(Hadith newMentionedIn);\r\n\r\n /**\r\n * Removes a MentionedIn property value.<p>\r\n * \r\n * @param oldMentionedIn the MentionedIn property value to be removed.\r\n */\r\n void removeMentionedIn(Hadith oldMentionedIn);\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#collectionName\r\n */\r\n \r\n /**\r\n * Gets all property values for the collectionName property.<p>\r\n * \r\n * @returns a collection of values for the collectionName property.\r\n */\r\n Collection<? extends Object> getCollectionName();\r\n\r\n /**\r\n * Checks if the class has a collectionName property value.<p>\r\n * \r\n * @return true if there is a collectionName property value.\r\n */\r\n boolean hasCollectionName();\r\n\r\n /**\r\n * Adds a collectionName property value.<p>\r\n * \r\n * @param newCollectionName the collectionName property value to be added\r\n */\r\n void addCollectionName(Object newCollectionName);\r\n\r\n /**\r\n * Removes a collectionName property value.<p>\r\n * \r\n * @param oldCollectionName the collectionName property value to be removed.\r\n */\r\n void removeCollectionName(Object oldCollectionName);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#deprecatedBookNo\r\n */\r\n \r\n /**\r\n * Gets all property values for the deprecatedBookNo property.<p>\r\n * \r\n * @returns a collection of values for the deprecatedBookNo property.\r\n */\r\n Collection<? extends Object> getDeprecatedBookNo();\r\n\r\n /**\r\n * Checks if the class has a deprecatedBookNo property value.<p>\r\n * \r\n * @return true if there is a deprecatedBookNo property value.\r\n */\r\n boolean hasDeprecatedBookNo();\r\n\r\n /**\r\n * Adds a deprecatedBookNo property value.<p>\r\n * \r\n * @param newDeprecatedBookNo the deprecatedBookNo property value to be added\r\n */\r\n void addDeprecatedBookNo(Object newDeprecatedBookNo);\r\n\r\n /**\r\n * Removes a deprecatedBookNo property value.<p>\r\n * \r\n * @param oldDeprecatedBookNo the deprecatedBookNo property value to be removed.\r\n */\r\n void removeDeprecatedBookNo(Object oldDeprecatedBookNo);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#deprecatedHadithNo\r\n */\r\n \r\n /**\r\n * Gets all property values for the deprecatedHadithNo property.<p>\r\n * \r\n * @returns a collection of values for the deprecatedHadithNo property.\r\n */\r\n Collection<? extends Object> getDeprecatedHadithNo();\r\n\r\n /**\r\n * Checks if the class has a deprecatedHadithNo property value.<p>\r\n * \r\n * @return true if there is a deprecatedHadithNo property value.\r\n */\r\n boolean hasDeprecatedHadithNo();\r\n\r\n /**\r\n * Adds a deprecatedHadithNo property value.<p>\r\n * \r\n * @param newDeprecatedHadithNo the deprecatedHadithNo property value to be added\r\n */\r\n void addDeprecatedHadithNo(Object newDeprecatedHadithNo);\r\n\r\n /**\r\n * Removes a deprecatedHadithNo property value.<p>\r\n * \r\n * @param oldDeprecatedHadithNo the deprecatedHadithNo property value to be removed.\r\n */\r\n void removeDeprecatedHadithNo(Object oldDeprecatedHadithNo);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#endingHadithNo\r\n */\r\n \r\n /**\r\n * Gets all property values for the endingHadithNo property.<p>\r\n * \r\n * @returns a collection of values for the endingHadithNo property.\r\n */\r\n Collection<? extends Object> getEndingHadithNo();\r\n\r\n /**\r\n * Checks if the class has a endingHadithNo property value.<p>\r\n * \r\n * @return true if there is a endingHadithNo property value.\r\n */\r\n boolean hasEndingHadithNo();\r\n\r\n /**\r\n * Adds a endingHadithNo property value.<p>\r\n * \r\n * @param newEndingHadithNo the endingHadithNo property value to be added\r\n */\r\n void addEndingHadithNo(Object newEndingHadithNo);\r\n\r\n /**\r\n * Removes a endingHadithNo property value.<p>\r\n * \r\n * @param oldEndingHadithNo the endingHadithNo property value to be removed.\r\n */\r\n void removeEndingHadithNo(Object oldEndingHadithNo);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#fullHadith\r\n */\r\n \r\n /**\r\n * Gets all property values for the fullHadith property.<p>\r\n * \r\n * @returns a collection of values for the fullHadith property.\r\n */\r\n Collection<? extends Object> getFullHadith();\r\n\r\n /**\r\n * Checks if the class has a fullHadith property value.<p>\r\n * \r\n * @return true if there is a fullHadith property value.\r\n */\r\n boolean hasFullHadith();\r\n\r\n /**\r\n * Adds a fullHadith property value.<p>\r\n * \r\n * @param newFullHadith the fullHadith property value to be added\r\n */\r\n void addFullHadith(Object newFullHadith);\r\n\r\n /**\r\n * Removes a fullHadith property value.<p>\r\n * \r\n * @param oldFullHadith the fullHadith property value to be removed.\r\n */\r\n void removeFullHadith(Object oldFullHadith);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#hadithBookNo\r\n */\r\n \r\n /**\r\n * Gets all property values for the hadithBookNo property.<p>\r\n * \r\n * @returns a collection of values for the hadithBookNo property.\r\n */\r\n Collection<? extends Object> getHadithBookNo();\r\n\r\n /**\r\n * Checks if the class has a hadithBookNo property value.<p>\r\n * \r\n * @return true if there is a hadithBookNo property value.\r\n */\r\n boolean hasHadithBookNo();\r\n\r\n /**\r\n * Adds a hadithBookNo property value.<p>\r\n * \r\n * @param newHadithBookNo the hadithBookNo property value to be added\r\n */\r\n void addHadithBookNo(Object newHadithBookNo);\r\n\r\n /**\r\n * Removes a hadithBookNo property value.<p>\r\n * \r\n * @param oldHadithBookNo the hadithBookNo property value to be removed.\r\n */\r\n void removeHadithBookNo(Object oldHadithBookNo);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#hadithBookUrl\r\n */\r\n \r\n /**\r\n * Gets all property values for the hadithBookUrl property.<p>\r\n * \r\n * @returns a collection of values for the hadithBookUrl property.\r\n */\r\n Collection<? extends Object> getHadithBookUrl();\r\n\r\n /**\r\n * Checks if the class has a hadithBookUrl property value.<p>\r\n * \r\n * @return true if there is a hadithBookUrl property value.\r\n */\r\n boolean hasHadithBookUrl();\r\n\r\n /**\r\n * Adds a hadithBookUrl property value.<p>\r\n * \r\n * @param newHadithBookUrl the hadithBookUrl property value to be added\r\n */\r\n void addHadithBookUrl(Object newHadithBookUrl);\r\n\r\n /**\r\n * Removes a hadithBookUrl property value.<p>\r\n * \r\n * @param oldHadithBookUrl the hadithBookUrl property value to be removed.\r\n */\r\n void removeHadithBookUrl(Object oldHadithBookUrl);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#hadithChapterIntro\r\n */\r\n \r\n /**\r\n * Gets all property values for the hadithChapterIntro property.<p>\r\n * \r\n * @returns a collection of values for the hadithChapterIntro property.\r\n */\r\n Collection<? extends Object> getHadithChapterIntro();\r\n\r\n /**\r\n * Checks if the class has a hadithChapterIntro property value.<p>\r\n * \r\n * @return true if there is a hadithChapterIntro property value.\r\n */\r\n boolean hasHadithChapterIntro();\r\n\r\n /**\r\n * Adds a hadithChapterIntro property value.<p>\r\n * \r\n * @param newHadithChapterIntro the hadithChapterIntro property value to be added\r\n */\r\n void addHadithChapterIntro(Object newHadithChapterIntro);\r\n\r\n /**\r\n * Removes a hadithChapterIntro property value.<p>\r\n * \r\n * @param oldHadithChapterIntro the hadithChapterIntro property value to be removed.\r\n */\r\n void removeHadithChapterIntro(Object oldHadithChapterIntro);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#hadithChapterNo\r\n */\r\n \r\n /**\r\n * Gets all property values for the hadithChapterNo property.<p>\r\n * \r\n * @returns a collection of values for the hadithChapterNo property.\r\n */\r\n Collection<? extends Object> getHadithChapterNo();\r\n\r\n /**\r\n * Checks if the class has a hadithChapterNo property value.<p>\r\n * \r\n * @return true if there is a hadithChapterNo property value.\r\n */\r\n boolean hasHadithChapterNo();\r\n\r\n /**\r\n * Adds a hadithChapterNo property value.<p>\r\n * \r\n * @param newHadithChapterNo the hadithChapterNo property value to be added\r\n */\r\n void addHadithChapterNo(Object newHadithChapterNo);\r\n\r\n /**\r\n * Removes a hadithChapterNo property value.<p>\r\n * \r\n * @param oldHadithChapterNo the hadithChapterNo property value to be removed.\r\n */\r\n void removeHadithChapterNo(Object oldHadithChapterNo);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#hadithNo\r\n */\r\n \r\n /**\r\n * Gets all property values for the hadithNo property.<p>\r\n * \r\n * @returns a collection of values for the hadithNo property.\r\n */\r\n Collection<? extends Object> getHadithNo();\r\n\r\n /**\r\n * Checks if the class has a hadithNo property value.<p>\r\n * \r\n * @return true if there is a hadithNo property value.\r\n */\r\n boolean hasHadithNo();\r\n\r\n /**\r\n * Adds a hadithNo property value.<p>\r\n * \r\n * @param newHadithNo the hadithNo property value to be added\r\n */\r\n void addHadithNo(Object newHadithNo);\r\n\r\n /**\r\n * Removes a hadithNo property value.<p>\r\n * \r\n * @param oldHadithNo the hadithNo property value to be removed.\r\n */\r\n void removeHadithNo(Object oldHadithNo);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#hadithReferenceNo\r\n */\r\n \r\n /**\r\n * Gets all property values for the hadithReferenceNo property.<p>\r\n * \r\n * @returns a collection of values for the hadithReferenceNo property.\r\n */\r\n Collection<? extends Object> getHadithReferenceNo();\r\n\r\n /**\r\n * Checks if the class has a hadithReferenceNo property value.<p>\r\n * \r\n * @return true if there is a hadithReferenceNo property value.\r\n */\r\n boolean hasHadithReferenceNo();\r\n\r\n /**\r\n * Adds a hadithReferenceNo property value.<p>\r\n * \r\n * @param newHadithReferenceNo the hadithReferenceNo property value to be added\r\n */\r\n void addHadithReferenceNo(Object newHadithReferenceNo);\r\n\r\n /**\r\n * Removes a hadithReferenceNo property value.<p>\r\n * \r\n * @param oldHadithReferenceNo the hadithReferenceNo property value to be removed.\r\n */\r\n void removeHadithReferenceNo(Object oldHadithReferenceNo);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#hadithText\r\n */\r\n \r\n /**\r\n * Gets all property values for the hadithText property.<p>\r\n * \r\n * @returns a collection of values for the hadithText property.\r\n */\r\n Collection<? extends Object> getHadithText();\r\n\r\n /**\r\n * Checks if the class has a hadithText property value.<p>\r\n * \r\n * @return true if there is a hadithText property value.\r\n */\r\n boolean hasHadithText();\r\n\r\n /**\r\n * Adds a hadithText property value.<p>\r\n * \r\n * @param newHadithText the hadithText property value to be added\r\n */\r\n void addHadithText(Object newHadithText);\r\n\r\n /**\r\n * Removes a hadithText property value.<p>\r\n * \r\n * @param oldHadithText the hadithText property value to be removed.\r\n */\r\n void removeHadithText(Object oldHadithText);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#hadithUrl\r\n */\r\n \r\n /**\r\n * Gets all property values for the hadithUrl property.<p>\r\n * \r\n * @returns a collection of values for the hadithUrl property.\r\n */\r\n Collection<? extends Object> getHadithUrl();\r\n\r\n /**\r\n * Checks if the class has a hadithUrl property value.<p>\r\n * \r\n * @return true if there is a hadithUrl property value.\r\n */\r\n boolean hasHadithUrl();\r\n\r\n /**\r\n * Adds a hadithUrl property value.<p>\r\n * \r\n * @param newHadithUrl the hadithUrl property value to be added\r\n */\r\n void addHadithUrl(Object newHadithUrl);\r\n\r\n /**\r\n * Removes a hadithUrl property value.<p>\r\n * \r\n * @param oldHadithUrl the hadithUrl property value to be removed.\r\n */\r\n void removeHadithUrl(Object oldHadithUrl);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#hadithVolumeNo\r\n */\r\n \r\n /**\r\n * Gets all property values for the hadithVolumeNo property.<p>\r\n * \r\n * @returns a collection of values for the hadithVolumeNo property.\r\n */\r\n Collection<? extends Object> getHadithVolumeNo();\r\n\r\n /**\r\n * Checks if the class has a hadithVolumeNo property value.<p>\r\n * \r\n * @return true if there is a hadithVolumeNo property value.\r\n */\r\n boolean hasHadithVolumeNo();\r\n\r\n /**\r\n * Adds a hadithVolumeNo property value.<p>\r\n * \r\n * @param newHadithVolumeNo the hadithVolumeNo property value to be added\r\n */\r\n void addHadithVolumeNo(Object newHadithVolumeNo);\r\n\r\n /**\r\n * Removes a hadithVolumeNo property value.<p>\r\n * \r\n * @param oldHadithVolumeNo the hadithVolumeNo property value to be removed.\r\n */\r\n void removeHadithVolumeNo(Object oldHadithVolumeNo);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#inBookNo\r\n */\r\n \r\n /**\r\n * Gets all property values for the inBookNo property.<p>\r\n * \r\n * @returns a collection of values for the inBookNo property.\r\n */\r\n Collection<? extends Object> getInBookNo();\r\n\r\n /**\r\n * Checks if the class has a inBookNo property value.<p>\r\n * \r\n * @return true if there is a inBookNo property value.\r\n */\r\n boolean hasInBookNo();\r\n\r\n /**\r\n * Adds a inBookNo property value.<p>\r\n * \r\n * @param newInBookNo the inBookNo property value to be added\r\n */\r\n void addInBookNo(Object newInBookNo);\r\n\r\n /**\r\n * Removes a inBookNo property value.<p>\r\n * \r\n * @param oldInBookNo the inBookNo property value to be removed.\r\n */\r\n void removeInBookNo(Object oldInBookNo);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#narratorChain\r\n */\r\n \r\n /**\r\n * Gets all property values for the narratorChain property.<p>\r\n * \r\n * @returns a collection of values for the narratorChain property.\r\n */\r\n Collection<? extends Object> getNarratorChain();\r\n\r\n /**\r\n * Checks if the class has a narratorChain property value.<p>\r\n * \r\n * @return true if there is a narratorChain property value.\r\n */\r\n boolean hasNarratorChain();\r\n\r\n /**\r\n * Adds a narratorChain property value.<p>\r\n * \r\n * @param newNarratorChain the narratorChain property value to be added\r\n */\r\n void addNarratorChain(Object newNarratorChain);\r\n\r\n /**\r\n * Removes a narratorChain property value.<p>\r\n * \r\n * @param oldNarratorChain the narratorChain property value to be removed.\r\n */\r\n void removeNarratorChain(Object oldNarratorChain);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#sameAs\r\n */\r\n \r\n /**\r\n * Gets all property values for the sameAs property.<p>\r\n * \r\n * @returns a collection of values for the sameAs property.\r\n */\r\n Collection<? extends Object> getSameAs();\r\n\r\n /**\r\n * Checks if the class has a sameAs property value.<p>\r\n * \r\n * @return true if there is a sameAs property value.\r\n */\r\n boolean hasSameAs();\r\n\r\n /**\r\n * Adds a sameAs property value.<p>\r\n * \r\n * @param newSameAs the sameAs property value to be added\r\n */\r\n void addSameAs(Object newSameAs);\r\n\r\n /**\r\n * Removes a sameAs property value.<p>\r\n * \r\n * @param oldSameAs the sameAs property value to be removed.\r\n */\r\n void removeSameAs(Object oldSameAs);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.lodislamica.me/ontology/hadithVoc#startingHadithNo\r\n */\r\n \r\n /**\r\n * Gets all property values for the startingHadithNo property.<p>\r\n * \r\n * @returns a collection of values for the startingHadithNo property.\r\n */\r\n Collection<? extends Object> getStartingHadithNo();\r\n\r\n /**\r\n * Checks if the class has a startingHadithNo property value.<p>\r\n * \r\n * @return true if there is a startingHadithNo property value.\r\n */\r\n boolean hasStartingHadithNo();\r\n\r\n /**\r\n * Adds a startingHadithNo property value.<p>\r\n * \r\n * @param newStartingHadithNo the startingHadithNo property value to be added\r\n */\r\n void addStartingHadithNo(Object newStartingHadithNo);\r\n\r\n /**\r\n * Removes a startingHadithNo property value.<p>\r\n * \r\n * @param oldStartingHadithNo the startingHadithNo property value to be removed.\r\n */\r\n void removeStartingHadithNo(Object oldStartingHadithNo);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Property https://www.w3.org/2000/01/rdf-schema#label\r\n */\r\n \r\n /**\r\n * Gets all property values for the label property.<p>\r\n * \r\n * @returns a collection of values for the label property.\r\n */\r\n Collection<? extends Object> getLabel();\r\n\r\n /**\r\n * Checks if the class has a label property value.<p>\r\n * \r\n * @return true if there is a label property value.\r\n */\r\n boolean hasLabel();\r\n\r\n /**\r\n * Adds a label property value.<p>\r\n * \r\n * @param newLabel the label property value to be added\r\n */\r\n void addLabel(Object newLabel);\r\n\r\n /**\r\n * Removes a label property value.<p>\r\n * \r\n * @param oldLabel the label property value to be removed.\r\n */\r\n void removeLabel(Object oldLabel);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Common interfaces\r\n */\r\n\r\n OWLNamedIndividual getOwlIndividual();\r\n\r\n OWLOntology getOwlOntology();\r\n\r\n void delete();\r\n\r\n}", "boolean hasProductBiddingCategoryConstant();", "@Test\n\tpublic void testPurachase() {\n\t\tassertTrue(order.purachaseCheeseMeal().getMeal().get(0) instanceof CheeseSandwich);\n\t\tassertTrue(order.purachaseCheeseMeal().getMeal().get(1) instanceof OrangeJuice);\n\n\t\tassertTrue(order.purachaseTunaMeal().getMeal().get(0) instanceof TunaSandwich);\n\t\tassertTrue(order.purachaseTunaMeal().getMeal().get(1) instanceof OrangeJuice);\n\t}", "public static void main(String[] args) {\n Iterable<Book> notCheckedOut = FluentIterable\n .from(Library.ALL_BOOKS)\n .filter(Utils.IS_NOT_LOANED);\n System.out.println(\"not checked out\");\n System.out.println(Utils.JOINER.join(notCheckedOut));\n System.out.println();\n \n // books that are checked out to Zeb\n Iterable<Book> checkedOutToZeb = FluentIterable\n .from(Library.ALL_BOOKS)\n .filter(Utils.IS_LOANED_TO_ZEB);\n System.out.println(\"checked out to Zeb\");\n System.out.println(Utils.JOINER.join(checkedOutToZeb));\n System.out.println();\n \n // books that are checked out to someone named \"Tobias\"\n Iterable<Book> checkedOutToSomeoneNamedTobias = FluentIterable\n .from(Library.ALL_BOOKS)\n .filter(Utils.IS_LOANED_TO_SOMEONE_NAMED_TOBIAS);\n System.out.println(\"checked out to someone named 'Tobias'\");\n System.out.println(Utils.JOINER.join(checkedOutToSomeoneNamedTobias));\n System.out.println();\n }", "@Test\n\tvoid attributeGroupDisjunction2() {\n\t\tassertEquals(\n\t\t\t\"Match procedure with left OR right foot (grouped)\",\n\t\t\tSets.newHashSet(AMPUTATION_FOOT_LEFT, AMPUTATION_FOOT_RIGHT, AMPUTATION_FOOT_BILATERAL),\n\t\t\tstrings(selectConceptIds(\"< 71388002 |Procedure|: { 363704007 |Procedure site| = 22335008 |Left Foot| } OR { 363704007 |Procedure site| = 7769000 |Right Foot| }\")));\n\n\t}", "public TDropListItem combineStrategies(TDropListItem selectedItem1, TDropListItem selectedItem2);", "protected abstract boolean gradeable();", "private static boolean checkSimpleDerivation(XSSimpleType derived, XSSimpleType base, short block) {\n/* 188 */ if (derived == base) {\n/* 189 */ return true;\n/* */ }\n/* */ \n/* */ \n/* 193 */ if ((block & 0x2) != 0 || (derived\n/* 194 */ .getBaseType().getFinal() & 0x2) != 0) {\n/* 195 */ return false;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 200 */ XSSimpleType directBase = (XSSimpleType)derived.getBaseType();\n/* 201 */ if (directBase == base) {\n/* 202 */ return true;\n/* */ }\n/* */ \n/* 205 */ if (directBase != SchemaGrammar.fAnySimpleType && \n/* 206 */ checkSimpleDerivation(directBase, base, block)) {\n/* 207 */ return true;\n/* */ }\n/* */ \n/* */ \n/* 211 */ if ((derived.getVariety() == 2 || derived\n/* 212 */ .getVariety() == 3) && base == SchemaGrammar.fAnySimpleType)\n/* */ {\n/* 214 */ return true;\n/* */ }\n/* */ \n/* */ \n/* 218 */ if (base.getVariety() == 3) {\n/* 219 */ XSObjectList subUnionMemberDV = base.getMemberTypes();\n/* 220 */ int subUnionSize = subUnionMemberDV.getLength();\n/* 221 */ for (int i = 0; i < subUnionSize; i++) {\n/* 222 */ base = (XSSimpleType)subUnionMemberDV.item(i);\n/* 223 */ if (checkSimpleDerivation(derived, base, block)) {\n/* 224 */ return true;\n/* */ }\n/* */ } \n/* */ } \n/* 228 */ return false;\n/* */ }", "default Stream<Triple> witnesses(Triple... elements) {\n Set<Triple> toBeMatched = new HashSet<>(Arrays.asList(elements));\n return apex().carrier().elements().filter(witnes -> {\n return toBeMatched.stream().allMatch(target -> {\n return projections().anyMatch(morphism -> morphism.apply(witnes).map(target::equals).orElse(false));\n });\n });\n }", "boolean isSetCombine();", "public boolean contradicts(Predicate p){\r\n\t\treturn (type.equals(p.type) && (id.equals(p.id)) && !(value.equals(p.value)));\r\n\t}", "private static UnaryPredicate bepred() {\n return new UnaryPredicate() {\n public boolean execute(Object o) {\n\tif (o instanceof BulkEstimate) {\n\t return ((BulkEstimate)o).isComplete();\n }\n\treturn false;\n }\n };\n }", "default Cocartesian<A, Choice2<A, B>, P> choose() {\n return this.<A>cocartesian().contraMap(Choice2::b);\n }", "GeneralPredicate createGeneralPredicate();", "protected Disjunction attack(Argument a, Set<Argument> attackers) {\n\t\tif(attackers.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tDisjunction attack = new Disjunction(\"attack_\" + a.getName());\n\t\tfor(Argument att : attackers) {\n\t\t\tattack.addSubformula(new Atom(\"acc_\" + att.getName()));\n\t\t}\n\t\treturn attack;\n\t}", "private boolean canJoinTuples() {\n if (predicate == null)\n return true;\n\n environment.clear();\n environment.addTuple(leftSchema, leftTuple);\n environment.addTuple(rightSchema, rightTuple);\n\n return predicate.evaluatePredicate(environment);\n }", "public static boolean overlapUPA(XSElementDecl element1, XSElementDecl element2, SubstitutionGroupHandler sgHandler) {\n/* 1445 */ if (element1.fName == element2.fName && element1.fTargetNamespace == element2.fTargetNamespace)\n/* */ {\n/* 1447 */ return true;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 1452 */ XSElementDecl[] subGroup = sgHandler.getSubstitutionGroup(element1); int i;\n/* 1453 */ for (i = subGroup.length - 1; i >= 0; i--) {\n/* 1454 */ if ((subGroup[i]).fName == element2.fName && (subGroup[i]).fTargetNamespace == element2.fTargetNamespace)\n/* */ {\n/* 1456 */ return true;\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 1462 */ subGroup = sgHandler.getSubstitutionGroup(element2);\n/* 1463 */ for (i = subGroup.length - 1; i >= 0; i--) {\n/* 1464 */ if ((subGroup[i]).fName == element1.fName && (subGroup[i]).fTargetNamespace == element1.fTargetNamespace)\n/* */ {\n/* 1466 */ return true;\n/* */ }\n/* */ } \n/* */ \n/* 1470 */ return false;\n/* */ }", "public static void main(String[] args) {\r\n \t\r\n \tfor (int i = 0; i < 20; ++i)\r\n System.out.println(i + \" - Unique Ways DP : \" + countUniqueCombinationsDP(i)\r\n\t\t\t \t\t + \", Unique Ways Recursive : \" + countUniqueCombinationsR(i));\r\n }", "protected CollectionIncomplete<Negotiation> getNegotiationsLinkedToSubAward(Map<String, String> negotiationFilters, Map<String, String> associatedValues, boolean rowCountOnly) {\n LOG.debug(\"ENTER getNegotiationsLinkedToSubAward rowCountOnly=\"+rowCountOnly);\n Map<String, String> values = transformMap(associatedValues, subAwardTransform);\n\n CollectionIncomplete<Negotiation> result = new CollectionIncomplete<>(new ArrayList(0),0L);\n if (values == null) {\n return result;\n }\n\n Long negotiationTypeId = getNegotiationService().getNegotiationAssociationType(NegotiationAssociationType.SUB_AWARD_ASSOCIATION).getId();\n String negotiationTypeIdFilter = negotiationFilters.get(NEGOTIATION_TYPE_ATTR);\n if ( StringUtils.isNotEmpty(negotiationTypeIdFilter) && !negotiationTypeId.equals( Long.parseLong(negotiationTypeIdFilter)) ) {\n LOG.debug(\"getNegotiationsLinkedToProposal: Skipping search as found different type filter=\"+negotiationTypeIdFilter);\n return result;\n }\n\n Criteria subAwardCriteria = getCollectionCriteriaFromMap(new SubAward(), values);\n\n //filter only active/pending subAwards\n Criteria activeSubAwardCriteria = getActiveOrPendingVersionCriteria();\n ReportQueryByCriteria activeSubAwardCodesQuery = QueryFactory.newReportQuery(SubAward.class, activeSubAwardCriteria);\n activeSubAwardCodesQuery.setAttributes(new String[]{MAX_SUBAWARD_CODE});\n activeSubAwardCodesQuery.addGroupBy(SUBAWARD_CODE);\n\n subAwardCriteria.addIn(SUBAWARD_CODE, activeSubAwardCodesQuery);\n ReportQueryByCriteria subQuery = QueryFactory.newReportQuery(SubAward.class, subAwardCriteria);\n subQuery.setAttributes(new String[] {SUBAWARD_CODE});\n\n\n Criteria negotiationsLinedToSubAwardsCriteria = getCollectionCriteriaFromMap(new Negotiation(), negotiationFilters);\n negotiationsLinedToSubAwardsCriteria.addIn(ASSOCIATED_DOC_ID_ATTR, subQuery);\n negotiationsLinedToSubAwardsCriteria.addEqualTo(NEGOTIATION_TYPE_ATTR, negotiationTypeId);\n\n LOG.debug(\"getNegotiationsLinkedToSubAward criteria=\"+negotiationsLinedToSubAwardsCriteria.toString());\n\n return executeSearch(negotiationsLinedToSubAwardsCriteria, rowCountOnly);\n\n }", "@Override\n public boolean isGoodForSides()\n {\n return false;\n }", "protected abstract boolean canHaveAsPrice(DukatAmount price);", "public abstract void apply() throws ContradictionException;", "public abstract boolean istAusgeliefert();", "IEmfPredicate<R> getPredicateMandatory();", "public static boolean checkTypeDerivationOk(XSTypeDefinition derived, XSTypeDefinition base, short block) {\n/* 117 */ if (derived == SchemaGrammar.fAnyType) {\n/* 118 */ return (derived == base);\n/* */ }\n/* */ \n/* 121 */ if (derived == SchemaGrammar.fAnySimpleType) {\n/* 122 */ return (base == SchemaGrammar.fAnyType || base == SchemaGrammar.fAnySimpleType);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 127 */ if (derived.getTypeCategory() == 16) {\n/* */ \n/* 129 */ if (base.getTypeCategory() == 15)\n/* */ {\n/* */ \n/* 132 */ if (base == SchemaGrammar.fAnyType) {\n/* 133 */ base = SchemaGrammar.fAnySimpleType;\n/* */ } else {\n/* 135 */ return false;\n/* */ } } \n/* 137 */ return checkSimpleDerivation((XSSimpleType)derived, (XSSimpleType)base, block);\n/* */ } \n/* */ \n/* */ \n/* 141 */ return checkComplexDerivation((XSComplexTypeDecl)derived, base, block);\n/* */ }", "public static <A> CompositePredicate<A> predicate(Predicate<? super A> pred) {\n return new CompositePredicate<A>(pred);\n }", "IRequirement or(IRequirement constraint);", "@Test\n\tpublic void testSumOverFunctionV4() {\n\t\trunTest(2, false, \"sum({{(on f in Boolean -> 0..3) product({{(on X in Boolean) f(X) : true }}) : true }})\", \"56\");\n\t}", "@Test\n public void test_shortcut_needed_bidirectional() {\n CHPreparationGraph graph = CHPreparationGraph.edgeBased(5, 4, (in, via, out) -> in == out ? 10 : 0);\n int edge = 0;\n graph.addEdge(0, 1, edge++, 10, 10);\n graph.addEdge(1, 2, edge++, 10, 10);\n graph.addEdge(2, 3, edge++, 10, 10);\n graph.addEdge(3, 4, edge++, 10, 10);\n graph.prepareForContraction();\n EdgeBasedWitnessPathSearcher searcher = new EdgeBasedWitnessPathSearcher(graph);\n searcher.initSearch(0, 1, 2, new EdgeBasedWitnessPathSearcher.Stats());\n double weight = searcher.runSearch(3, 6, 20.0, 100);\n assertTrue(Double.isInfinite(weight));\n }", "@Override\n\tpublic boolean isCovered() {\n\t\treturn (falseCount > 0) && (trueCount > 0);\n\t}", "BPredicate createBPredicate();", "@Override\n public boolean impliesCondition(ConditionPart part, List<MatchingPart> leadingParts) {\n return SubsetEvaluator.isSubset(part.getCondition(), Conditions.equal(getValue()));\n }", "public boolean estRealisable(Couple P) {\n\t\tboolean dedans = true;\n\n\t\tfor (Contrainte c : this.contraintes) {\n\t\t\tif (!c.estVerifie(P)) {\n\t\t\t\tdedans = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn dedans;\n\t}", "public boolean checkChairSubset(ArrayList<Furniture> subset){\n boolean legs = false;\n boolean arms = false;\n boolean seat = false;\n boolean cushion = false;\n\n for(Furniture c : subset){\n if(c instanceof Chair){\n Chair chair = (Chair)c;\n if(chair.getLegs().equals(\"Y\")){\n legs = true;\n }\n if(chair.getArms().equals(\"Y\")){\n arms = true;\n }\n if(chair.getSeat().equals(\"Y\")){\n seat = true;\n }\n if(chair.getCushion().equals(\"Y\")){\n cushion = true;\n }\n }\n }\n // check if any of the chair pieces are missing and if so the combination is invalid\n if(!legs || !arms || !seat || !cushion){\n return false;\n }\n return true;\n }", "public boolean canCombine(ILootProperty loot);", "@Test\n\tpublic void testSumOverFunctionEvaluatingArguments() {\n\t\trunTest(2, false, \"sum({{(on f in Boolean -> 0..3) product({{(on X in Boolean) f(not X or X) : true }}) : true }})\", \"40\");\n\t}", "public boolean isDistinctLike() {\n List<AggregationDesc> aggregators = getAggregators();\n for (AggregationDesc ad : aggregators) {\n if (!ad.getDistinct()) {\n GenericUDAFEvaluator udafEval = ad.getGenericUDAFEvaluator();\n UDFType annot = AnnotationUtils.getAnnotation(udafEval.getClass(), UDFType.class);\n if (annot == null || !annot.distinctLike()) {\n return false;\n }\n }\n }\n return true;\n }", "public Set<OWLLogicalAxiom> canWeDoBetter(){\n\t\tSet<Set<OWLClass>> largeSCCs =\n\t\t\t\ttarj.getStronglyConnectComponents().\n\t\t\t\t\t\tstream().\n\t\t\t\t\t\tfilter(x -> x.size() > 1).\n\t\t\t\t\t\tcollect(Collectors.toSet());\n\n\t\t//Add all those axioms which use their own definition on the RHS\n\t\tSet<OWLLogicalAxiom> cycleCausing = new HashSet<>();\n\t\tcycleCausing.addAll(builder.getSelfDefinedAxioms());\n\n\t\tfor(OWLLogicalAxiom axiom : axioms){\n\t\t\tOWLClass name = (OWLClass) AxiomSplitter.getNameofAxiom(axiom);\n\t\t\t\tfor(Set<OWLClass> component : largeSCCs){\n\t\t\t\t\tif(component.contains(name)){\n\t\t\t\t\t\tOWLClassExpression def = AxiomSplitter.getDefinitionofAxiom(axiom);\n\t\t\t\t\t\tSet<OWLClass> defCls = ModuleUtils.getNamedClassesInSignature(def);\n\t\t\t\t\t\tSet<OWLClass> inter = Sets.intersection(component, defCls);\n\t\t\t\t\t\tif(!inter.isEmpty()){\n\t\t\t\t\t\t\tcycleCausing.add(axiom);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\treturn cycleCausing;\n\t}", "public static boolean prove(Tableau tableau) {\n // Alphas\n boolean retVal = Prover.expandAllAlphas(tableau);\n // Deltas\n retVal = Prover.expandAllDeltas(tableau) || retVal;\n // Comprehension Schema\n retVal = Prover.expandClassMemberPredicates(tableau) || retVal;\n // Beta or Gamma\n if (Prover.expandOneBeta(tableau))\n return true;\n if (Prover.unify(tableau) != null)\n return false;\n return Prover.expandOneGamma(tableau) || retVal;\n }", "protected abstract void applyPrinciple();", "abstract public boolean isMainBusinessObjectApplicable(Object mainBusinessObject);", "IRequirement and(IRequirement requirement);", "public abstract boolean isAssignable();", "public static boolean overlapUPA(Object decl1, Object decl2, SubstitutionGroupHandler sgHandler) {\n/* 1508 */ if (decl1 instanceof XSElementDecl) {\n/* 1509 */ if (decl2 instanceof XSElementDecl) {\n/* 1510 */ return overlapUPA((XSElementDecl)decl1, (XSElementDecl)decl2, sgHandler);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 1515 */ return overlapUPA((XSElementDecl)decl1, (XSWildcardDecl)decl2, sgHandler);\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1521 */ if (decl2 instanceof XSElementDecl) {\n/* 1522 */ return overlapUPA((XSElementDecl)decl2, (XSWildcardDecl)decl1, sgHandler);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 1527 */ return overlapUPA((XSWildcardDecl)decl1, (XSWildcardDecl)decl2);\n/* */ }", "public void addBusinessFilterToAdvancedtablecompositionRequiredProperty(ViewerFilter filter);", "public double getSubjectiveValue(Apartment apart) {\n checkNotNull(apart);\n ImmutableMap<Criterion, Double> subjectiveValue =\n new ImmutableMap.Builder<Criterion, Double>()\n .put(\n Criterion.FLOOR_AREA,\n this.linearValueFunctions\n .get(Criterion.FLOOR_AREA)\n .getSubjectiveValue(apart.getFloorArea()))\n .put(\n Criterion.NB_BEDROOMS,\n this.linearValueFunctions\n .get(Criterion.NB_BEDROOMS)\n .getSubjectiveValue((double) apart.getNbBedrooms()))\n .put(\n Criterion.NB_SLEEPING,\n this.linearValueFunctions\n .get(Criterion.NB_SLEEPING)\n .getSubjectiveValue((double) apart.getNbSleeping()))\n .put(\n Criterion.NB_BATHROOMS,\n this.linearValueFunctions\n .get(Criterion.NB_BATHROOMS)\n .getSubjectiveValue((double) apart.getNbBathrooms()))\n .put(\n Criterion.TERRACE,\n this.booleanValueFunctions\n .get(Criterion.TERRACE)\n .getSubjectiveValue(apart.getTerrace()))\n .put(\n Criterion.FLOOR_AREA_TERRACE,\n this.linearValueFunctions\n .get(Criterion.FLOOR_AREA_TERRACE)\n .getSubjectiveValue(apart.getFloorAreaTerrace()))\n .put(\n Criterion.WIFI,\n this.booleanValueFunctions.get(Criterion.WIFI).getSubjectiveValue(apart.getWifi()))\n .put(\n Criterion.PRICE_PER_NIGHT,\n this.reversedValueFunctions\n .get(Criterion.PRICE_PER_NIGHT)\n .getSubjectiveValue(apart.getPricePerNight()))\n .put(\n Criterion.NB_MIN_NIGHT,\n this.reversedValueFunctions\n .get(Criterion.NB_MIN_NIGHT)\n .getSubjectiveValue((double) apart.getNbMinNight()))\n .put(\n Criterion.TELE,\n this.booleanValueFunctions.get(Criterion.TELE).getSubjectiveValue(apart.getTele()))\n .build();\n\n // Check that the subjective values ​​do have a value between 0 and 1\n subjectiveValue.forEach(\n (criterion, aDouble) -> {\n LOGGER.debug(\"The {} subjective value has been set to {}\", criterion.name(), aDouble);\n checkState(\n aDouble >= 0 && aDouble <= 1,\n \"The subjective value of \" + criterion.name() + \"must be between 0 and 1\");\n });\n\n double sum =\n Arrays.stream(Criterion.values())\n .map(c -> this.weight.get(c) * subjectiveValue.get(c))\n .reduce(0.0d, Double::sum);\n double division = this.weight.values().stream().reduce(0.0d, Double::sum);\n return sum / division;\n }", "public abstract boolean isPassable();", "public boolean isComposite();", "protected boolean bepaalDoorschuiven(int groep, int periode, int ronde) {\r\n \treturn (bepaalAantalDoorschuiven(groep, periode, ronde) > 0);\r\n }", "public abstract boolean isRestricted();", "@Override\n public boolean isUsableEffectTwo() {\n return getEffectsEnable()[1] && getUsableEffect()[1] && ((TargetSquareRequestEvent) getTargetEffectOne()).getPossibleTargetsX().length != 0 && getOwner().canAffortCost(getSecondEffectCost());\n }", "private boolean isPure(Collection<Instance> instances) {\n\t\tif (instances.size() <= 1) {\n\t\t\treturn true;\n\t\t}\n\t\tIterator<Instance> iter = instances.iterator();\n\t\tint match = iter.next().getCategory();\n\t\twhile (iter.hasNext()) {\n\t\t\tif (match != iter.next().getCategory()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "boolean isIntroduced();", "public Boolean isSummable();", "public abstract Alliance getAlliance();", "abstract public boolean isPickedBy(Point p);", "boolean isInheritableStyle(QName eltName, QName styleName);", "public boolean isWeighted();", "boolean isExcluded(Individual ind);" ]
[ "0.49904427", "0.49038088", "0.48004308", "0.4724532", "0.47096443", "0.46620044", "0.461357", "0.4550966", "0.45197368", "0.45146313", "0.45084906", "0.44809982", "0.4480984", "0.44630224", "0.443569", "0.44327974", "0.44023412", "0.43719175", "0.43533552", "0.434239", "0.43371055", "0.43285203", "0.4323727", "0.43212995", "0.4320156", "0.43165678", "0.43161014", "0.43161014", "0.4313879", "0.42902708", "0.4287703", "0.42793205", "0.42701387", "0.42672887", "0.42653733", "0.42627463", "0.4259098", "0.42587253", "0.42566723", "0.42563418", "0.42539763", "0.42536968", "0.42477864", "0.42465535", "0.4243947", "0.42376193", "0.42220345", "0.42191577", "0.42175344", "0.42117655", "0.42106548", "0.41928202", "0.41926035", "0.41915828", "0.41860673", "0.4184265", "0.41824648", "0.4177792", "0.41771004", "0.41756922", "0.4169824", "0.41643703", "0.41604728", "0.41584167", "0.41479647", "0.41466767", "0.414422", "0.4128921", "0.41270843", "0.41265142", "0.4122241", "0.41217726", "0.41171265", "0.4114957", "0.41143113", "0.41113564", "0.4107698", "0.41056618", "0.41051173", "0.41031015", "0.40983248", "0.40977928", "0.4097597", "0.4096059", "0.4090097", "0.40781775", "0.40778255", "0.4069217", "0.40654647", "0.40618905", "0.40538454", "0.40440288", "0.40431586", "0.4042641", "0.40402338", "0.40400752", "0.4035755", "0.4035591", "0.40341207", "0.40322092" ]
0.65921277
0
If a subclass has state that must be reset, override this method.
protected void resetState() { // Nothing to do by default. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void reset()\n {\n super.reset();\n }", "@Override\n public void reset() {\n super.reset();\n }", "protected abstract void reset();", "protected abstract boolean reset();", "abstract void reset();", "public void reset() {\n super.reset();\n }", "@Override\n\t\tprotected void reset()\n\t\t{\n\t\t}", "@Override\n public void reset() \n {\n\n }", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public void restoreState() \n\t{\n\t\tsuper.restoreState();\n\t}", "@Override\n\tpublic void reset() {\n\t\tthis.prepare();\n\t\tsuper.reset();\n\t}", "public void restoreState() {\n\t\tsuper.restoreState();\n\t}", "@Override\n\tvoid reset() {\n\t\t\n\t}", "@Override\n public void reset() {\n }", "@Override\r\n\tpublic void reset()\r\n\t{\r\n\t}", "@Override\r\n\t\t\tpublic void reset() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n public void reset() {\n\n }", "public void resetState();", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void reset() {\n\t\t\n\t}", "@Override\n\tpublic void reset() {\n\t\t\n\t}", "@Override\n public void reset()\n {\n state = \"initial state\";\n nbChanges = 0;\n nbResets++;\n }", "@Override\r\n\tpublic void reset() {\n\t}", "@Override\n\tpublic void reset() {\n\t}", "@Override\n\tpublic void reset() {\n\n\t}", "public abstract void onReset();", "@Override\r\n\tpublic void reset() {\n\r\n\t}", "@Override\r\n\tpublic void reset() {\n\r\n\t}", "@Override\n protected final void resetEntitySubClass ()\n {\n super.resetEntitySubClass ();\n }", "protected void reset() {\n\t\t}", "public abstract Op resetStates();", "@Override\n protected void resetEntitySubClass ()\n {\n super.resetEntitySubClass ();\n }", "protected void onReset() {\n\t\t\n\t}", "@Override\r\n\tpublic void reset() {\n\t\tsuper.reset();\r\n\t\tthis.setScale(0.75f);\r\n\t}", "@Override\r\n\tpublic void resetObject() {\n\t\t\r\n\t}", "protected void reset()\n {\n super.reset();\n m_seqNum = 1;\n }", "public void reset() {\n this.state = null;\n }", "protected void reset() {\r\n super.reset();\r\n this.ring = null;\r\n }", "StateClass() {\r\n restored = restore();\r\n }", "@Override\n\tpublic void doReset() throws BusinessException, Exception {\n\t\t\n\t}", "@Override\n public void onRestate() {\n }", "public void resetState() {\n \ts = State.STRAIGHT;\n }", "protected void onReset() {\n // Do nothing.\n }", "protected void reset(){\n inited = false;\n }", "public void resetSemanticState() throws SL_Exception\n {\n super.resetSemanticState();\n\n\n }", "public synchronized void reset() {\n }", "@Override\n public void onViewStateInstanceRestored(boolean instanceStateRetained) {\n }", "protected /*override*/ void ClearItems()\r\n { \r\n CheckSealed();\r\n super.ClearItems(); \r\n }", "void overrideState(int object_state);", "protected void doReset() throws FndException\n {\n }", "@Override\n protected void onRestoreInstanceState(Bundle state) {\n super.onRestoreInstanceState(state);\n }", "@Override\n\tpublic void reset(){\n\t\tstate.reset();\n\t\toldState.reset();\n\t\treturnAction = new boolean[Environment.numberOfButtons]; \n\t\trewardSoFar = 0;\n\t\tcurrentReward = 0;\n\t}", "public void reset() {\r\n this.x = resetX;\r\n this.y = resetY;\r\n state = 0;\r\n }", "public void reset() {\n\t\t\t\t\r\n\t\t\t}", "public void reset(){\n }", "@Override\r\n\tpublic void resetState() {\r\n\t\t// what to do for a tape device??\r\n\t}", "@Override\n public void reset(MiniGame game) {\n }", "@Override\n\tpublic void adjust() {\n\t\tstate = !state;\n\t}", "@Override\n\tprotected void resetState() {\n\n\t\tlogger.info(\"resetState: behaviorId = \" + _behavior.getBehaviorId());\n\t\t\n\t\t/*\n\t\t * Only return the username to the available usernames if\n\t\t * the user has sucessfully logged in and received a username.\n\t\t * For the auction workload the username will be an email \n\t\t * address with an @\n\t\t */\n\t\tif ((getUserName() != null) && (getUserName().contains(\"@\"))) {\n\t\t\tsynchronized (_workload.getAvailablePersonNames()) {\n\t\t\t\t// Remove the current user from the static list of all logged in\n\t\t\t\t// users\n\t\t\t\tlogger.info(\"resetState: behaviorId = \" + _behavior.getBehaviorId() + \" returning \"\n\t\t\t\t\t\t+ getUserName() + \" to availablePersonNames\");\n\t\t\t\t_workload.getAvailablePersonNames().add(getUserName());\n\t\t\t\tsetUserName(Long.toString(getId()));\n\t\t\t}\n\t\t}\n\t\t_activeAuctions.clear();\n\t\t_bidHistoryInfo.clear();\n\t\t_attendanceHistoryInfo.clear();\n\t\t_purchaseHistoryInfo.clear();\n\t}", "private void reset() {\n }", "public void reset () {}", "@Override\n public void restoreState(Map<String, Object> state) {\n\n }", "protected void resetInternalState() {\n setStepStart(null);\n setStepSize(minStep.multiply(maxStep).sqrt());\n }", "@Override\r\n\tpublic void reset() {\r\n\t\tsuper.reset();\r\n\t\tresetMomentObservation();\r\n\t\texpectations.reset();\r\n\t}", "public void reset() {\nsuper.reset();\nsetIncrease_( \"no\" );\nsetSwap_( \"tbr\" );\nsetMultrees_( \"no\" );\nsetRatchetreps_(\"200\");\nsetRatchetprop_(\"0.2\");\nsetRatchetseed_(\"0\");\n}", "@Override\n public void resetGame() {\n\n }", "public void reset()\n\t{\n\t}", "public void reset()\n\t{\n\t}", "void cancelBaseStateOverrideRequest() {\n cancelCurrentBaseStateRequestLocked();\n }", "@Override\n public void resetAllValues() {\n }", "public void reset()\n {\n mine = false;\n revealed = false;\n flagged = false;\n repaint();\n }", "public final void Reset()\n\t{\n\t}", "protected abstract void resetInputFields();", "public void reset() {\n }", "public void reset() {\n }", "public void reset() {\n }", "public void reset() {\n }", "@Override\n\tpublic void askReset() {\n\t}", "public void resetgamestate() {\n \tthis.gold = STARTING_GOLD;\n \tthis.crew = STARTING_FOOD;\n \tthis.points = 0;\n \tthis.masterVolume = 0.1f;\n this.soundVolume = 0.5f;\n this.musicVolume = 0.5f;\n \n this.ComputerScience = new Department(COMP_SCI_WEPS.getWeaponList(), COMP_SCI_UPGRADES.getRoomUpgradeList(), this);\n this.LawAndManagement = new Department(LMB_WEPS.getWeaponList(), LMB_UPGRADES.getRoomUpgradeList(), this);\n this.Physics = new Department(PHYS_WEPS.getWeaponList(), PHYS_UPGRADES.getRoomUpgradeList(), this);\n \n this.playerShip = STARTER_SHIP.getShip();\n this.playerShip.setBaseHullHP(700);\n this.playerShip.repairHull(700);\n this.combatPlayer = new CombatPlayer(playerShip);\n }", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset() {\n\n }", "public void onRestorePendingState() {\n }", "@Override\n\tpublic void resetToExisting() {\n\t\t\n\t}", "public void reset() {\n\n\t}" ]
[ "0.72900337", "0.7280791", "0.7150028", "0.7115613", "0.7017744", "0.70164394", "0.69680387", "0.6923687", "0.69179654", "0.69179654", "0.69179654", "0.69179654", "0.69179654", "0.69179654", "0.69179654", "0.69179654", "0.69179654", "0.69179654", "0.69179654", "0.6882023", "0.68692905", "0.6857414", "0.68498725", "0.6824932", "0.67736745", "0.6759507", "0.67238057", "0.6707251", "0.67052084", "0.67052084", "0.67052084", "0.67052084", "0.66925466", "0.66925466", "0.66870296", "0.66663456", "0.665153", "0.6633245", "0.66170406", "0.65896475", "0.65896475", "0.6529815", "0.65281874", "0.6517225", "0.64537406", "0.64195144", "0.6412639", "0.63928515", "0.6344646", "0.6300286", "0.6243354", "0.62419665", "0.6239481", "0.61942095", "0.6182602", "0.6181342", "0.6177404", "0.61755985", "0.6165264", "0.6134581", "0.61338985", "0.6131427", "0.61193293", "0.6105068", "0.60971373", "0.60932845", "0.60890645", "0.607979", "0.60646534", "0.6052405", "0.6051811", "0.60216707", "0.602107", "0.60165095", "0.6002246", "0.59972197", "0.59893864", "0.59458387", "0.5944929", "0.5944152", "0.5944152", "0.5931177", "0.5929702", "0.5928872", "0.59269756", "0.5926241", "0.592511", "0.592511", "0.592511", "0.592511", "0.59238786", "0.5919444", "0.5914298", "0.5914298", "0.5914298", "0.5914298", "0.59046346", "0.589861", "0.5886761", "0.58843476" ]
0.7328492
0
Given a design and an AUndertaking, check base predicate recursively checking if the AUndertaking is an TaskGroup.
public boolean checkSatisifies(Design design, AUndertaking task) { resetState(); return checkCombination(design, task); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract boolean isSatisfiedBy(Design design, AUndertaking t);", "public boolean isInSelectedHierarchy(AUndertaking task)\n {\n TaskGroup group = task.getTaskGroup();\n\n while (group != null) {\n if (isTaskSelected(group)) {\n return true;\n }\n\n group = group.getTaskGroup();\n }\n\n return false;\n }", "public boolean inGroup(Person p){\n\t return false;\n }", "boolean isSliceParent();", "public Boolean isParentable();", "private static boolean allowClose(MutableGroup currentGroup) {\n \t\tif (currentGroup instanceof Instance) {\n \t\t\treturn false; // instances may never be closed, they have no parent in the group stack\n \t\t}\n \t\t\n \t\tif (currentGroup.getDefinition() instanceof GroupPropertyDefinition && \n \t\t\t\t((GroupPropertyDefinition) currentGroup.getDefinition()).getConstraint(ChoiceFlag.class).isEnabled()) {\n \t\t\t// group is a choice\n \t\t\tIterator<QName> it = currentGroup.getPropertyNames().iterator();\n \t\t\tif (it.hasNext()) {\n \t\t\t\t// choice has at least on value set -> check cardinality for the corresponding property\n \t\t\t\tQName name = it.next();\n \t\t\t\treturn isValidCardinality(currentGroup, currentGroup.getDefinition().getChild(name));\n \t\t\t}\n \t\t\t// else check all children like below\n \t\t}\n \t\t\n \t\t// determine all children\n \t\tCollection<? extends ChildDefinition<?>> children = DefinitionUtil.getAllChildren(currentGroup.getDefinition());\n \t\n \t\t// check cardinality of children\n \t\tfor (ChildDefinition<?> childDef : children) {\n \t\t\tif (isValidCardinality(currentGroup, childDef)) { //XXX is this correct?! should it be !isValid... instead?\n \t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn true;\n \t}", "private boolean isValidtreatment(Task<?> treatment) {\n\t\treturn treatment != null && treatment.getDescription() instanceof Treatment;\n\t}", "boolean hasAdGroupCriterion();", "public boolean inGroup(String groupName);", "private boolean checkHierarchy(String lowerArg, String upperArg) {\n\n\t\tif (lowerArg.equals(upperArg)) {\n\t\t\treturn true;\n\t\t}\n\t\tList<String> primTypes = Arrays.asList(\"int\", \"int[]\", \"boolean\");\n\n\t\tif (primTypes.contains(lowerArg) || primTypes.contains(upperArg)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tSymbolTable table = null;\n\t\tfor (ClassDecl classDecl : this.classesDeclrs) {\n\t\t\tif (classDecl.name().equals(lowerArg)) {\n\t\t\t\ttable = ExtractTable(classDecl);\n\t\t\t}\n\t\t}\n\t\twhile (table != null) {\n\t\t\tif (table.className != null && table.className.equals(upperArg)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\ttable = table.getParentSymbolTable();\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public boolean shouldRun(Description description) {\n for(Description child : description.getChildren()){\n if(shouldRun(child)){\n return true;\n }\n }\n\n Collection<Class<?>> categories = getCategories(description);\n\n if (allCategoriesAreIncluded()) {\n return categoriesAreNotExcluded(categories);\n }\n\n return categoriesAreNotExcluded(categories)\n && categoriesAreIncluded(categories);\n\n }", "boolean hasConceptGroup();", "private boolean wellFormed() {\n\n\n\t\t\tGroup e = this;\n\n\t\t\tint i = 0;\n\t\t\tif(e.first == null && e.last == null && e.size == 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\n\t\t\tCard p = e.first;\n\t\t\tboolean check = false;\n\t\t\tif(e.first != null && e.last != null) {\n\t\t\t\tCard n = null;\n\t\t\t\tif(e.first.prev != null) return report(\"There is a loop\");\n\n\t\t\t\tfor(p = e.first; p.next != null; p = p.next) {\n\n\t\t\t\t\tn = p.next;\n\n\t\t\t\t\tif(n.prev != p) return report(\"p.next is null\");\n\t\t\t\t\tif(this != p.group) {\n\t\t\t\t\t\treturn report(\"this is not set to the group\");\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\n\t\t\t\tif(e.last.next != null) {\n\t\t\t\t\treturn report(\"Size is not equal to the amount of cards\");\n\t\t\t\t}\n\n\t\t\t\tfor(Card c = e.first; c.next != null; c = c.next) {\n\t\t\t\t\t++i;\n\t\t\t\t}\n\t\t\t\tif(i != this.size-1) {\n\t\t\t\t\treturn report(\"Size is not equal to the amount of cards\");\n\t\t\t\t}\n\t\t\t\tcheck = true;\n\t\t\t}\n\t\t\tif(check != true) {\n\t\t\t\tif(i != this.size) {\n\t\t\t\t\treturn report(\"Size is not equal to the amount of cards\");\n\t\t\t\t}\n\t\t\t\tif(e.first == null || e.last == null) {\n\t\t\t\t\treturn report(\"Error\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}", "default boolean isValidFor(Granularity granularity) {\n if (granularity instanceof TimeGrain) {\n return isValidFor(((TimeGrain) granularity));\n } else {\n return granularity instanceof AllGranularity;\n }\n }", "public abstract boolean isParent(T anItem);", "private boolean isRelevant(final Group group, final RunnerContext pContext) {\n\n\t\tfor (Renderable r : group.getItems()) {\n\n\t\t\tif (r instanceof Control) {\n\t\t\t\tControl control = (Control) r;\n\t\t\t\tString bind = control.getBind();\n\t\t\t\tModel model = pContext.getModel();\n\t\t\t\tInstance inst = pContext.getInstance();\n\t\t\t\tItemProperties props = model.getItemProperties(bind);\n\n\t\t\t\tif (props == null) {\n\t\t\t\t\tprops = new ItemPropertiesImpl(bind);\n\t\t\t\t}\n\n\t\t\t\tif (NodeValidator.isRelevant(props, inst, model)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else if (r instanceof TextBlock) {\n\t\t\t\treturn true;\n\t\t\t} else if (r instanceof Group && isRelevant((Group) r, pContext)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "boolean isRecursive();", "boolean isChildSelectable(int groupPosition, int childPosition);", "@Test\n public void testPassSubgroup() {\n verifyTask(new int[][]{{0, 1}, {0, 2}}, new Runnable() {\n public void run() {\n final Int i = new Int();\n final Ref<Int> r = new Ref<>(i);\n \n Task<?> task1 = new Task<Void>(new Object[]{i}, new Object[]{}) {\n @Override\n protected Void runRolez() {\n region(0);\n i.value++;\n return null;\n }\n };\n s.start(task1);\n \n Task<?> task2 = new Task<Void>(new Object[]{r}, new Object[]{}) {\n @Override\n protected Void runRolez() {\n region(1);\n r.o.value++;\n return null;\n }\n };\n s.start(task2);\n region(2);\n \n assertEquals(2, guardReadOnly(i).value);\n }\n });\n }", "protected boolean isPieceOfFurniturePartOfBasePlan(HomePieceOfFurniture piece) {\n return !piece.isMovable() || piece.isDoorOrWindow();\n }", "private boolean inAnonymusFunc(Node node, Node upper_bound) {\n Optional<Node> parentNode = node.getParentNode();\n if(!parentNode.isPresent()){\n return false;\n }\n Node parent = parentNode.get();\n //If upper bound reached\n if(parent.equals(upper_bound)){\n return false;\n }\n\n Class parentClazz = parent.getClass();\n if(parentClazz != ObjectCreationExpr.class){\n //Maybe the grandparent is an anonymous class expression\n return inAnonymusFunc(parent, upper_bound);\n }\n\n ObjectCreationExpr anonymousClassExpr = (ObjectCreationExpr) parent;\n if(anonymousClassExpr.getAnonymousClassBody().isPresent()){\n return true;\n }else{\n return inAnonymusFunc(parent,upper_bound);\n }\n }", "public boolean inGroup(String groupName) {\r\n return true;\r\n }", "boolean hasGroupPlacementView();", "boolean hasParent();", "boolean hasParent();", "public boolean isDescendantOf(Actor actor) {\n if (actor == null)\n throw new IllegalArgumentException(\"actor cannot be null.\");\n\n if(actor instanceof Group){\n Group group=(Group)actor;\n return internalGroup.isDescendantOf(group.internalGroup);\n }\n\n return internalGroup.isDescendantOf(actor.internalActor);\n }", "boolean canBuildDome(Tile t);", "boolean hasGroupByCategory();", "private static boolean rscInGroup(IResourceGroup group,\n AbstractVizResource<?, ?> resource) {\n\n for (ResourcePair pair : group.getResourceList()) {\n if (pair.getResource() == resource) {\n return true;\n }\n AbstractResourceData resourceData = pair.getResourceData();\n if (resourceData instanceof IResourceGroup) {\n if (rscInGroup((IResourceGroup) resourceData, resource)) {\n return true;\n }\n }\n }\n return false;\n }", "public boolean isParent(T anItem) { return false; }", "public void testGroupDoesNotImplySameRequiredGroup() {\n User user = RoleFactory.createUser(\"foo\");\n \n Group group = RoleFactory.createGroup(\"bar\");\n group.addRequiredMember(group);\n group.addMember(user);\n \n assertFalse(m_roleChecker.isImpliedBy(group, group));\n }", "protected boolean canDiagramBeCreatedFromElement(IElement pElement)\n {\n boolean canCreate = false;\n if (pElement != null)\n {\n // fix for CR 6417670\n // IDerivationClassifier is also an instance of IRelationship, so return false only if\n // pElement is not of type IDerivationClassifier.\n if (pElement instanceof IDiagram ||\n pElement instanceof ISourceFileArtifact ||\n (pElement instanceof IRelationship && !(pElement instanceof IDerivationClassifier)) )\n {\n return false;\n }\n \n \n // We shouldn't be able to select elements under an interaction and CDFS.\n // Therefore, we should disable the CDFS menu if you select any children\n // of the interaction.\n IElement owner = pElement.getOwner();\n if (owner == null)\n return false;\n if (owner instanceof IInteraction ||\n pElement instanceof IMessage ||\n pElement instanceof ICombinedFragment ||\n pElement instanceof IOperation ||\n pElement instanceof IAttribute)\n {\n // For operations, we have to make sure the operation can be REed\n // in order to support CDFS\n if (pElement instanceof IOperation)\n {\n// canCreate = false;\n// IUMLParsingIntegrator integrator = getUMLParsingIntegrator();\n// boolean canRE = integrator.canOperationBeREed((IOperation) pElement);\n// if (canRE)\n// {\n canCreate = true;\n// }\n }\n }\n else\n {\n canCreate = true;\n }\n }\n return canCreate;\n }", "public boolean isParent();", "public boolean\n isValid\n (\n TaskStatus status, \n TreeSet<String> privileged\n )\n {\n assert(false) : \"This should never be called!\";\n return false;\n }", "private boolean isAllowedToCreate(String userId, SignupMeeting signupMeeting) {\n\t\tif (sakaiFacade.isUserAdmin(userId))\n\t\t\treturn true;\n\n\t\tList<SignupSite> signupSites = signupMeeting.getSignupSites();\n\t\tfor (SignupSite site : signupSites) {\n\t\t\tif (site.isSiteScope()) {\n\t\t\t\tif (!sakaiFacade.isAllowedSite(userId, SakaiFacade.SIGNUP_CREATE_SITE, site.getSiteId()))\n\t\t\t\t\treturn false;\n\t\t\t\telse {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (sakaiFacade.isAllowedSite(userId, SakaiFacade.SIGNUP_CREATE_SITE, site.getSiteId())\n\t\t\t\t\t\t|| sakaiFacade.isAllowedSite(userId, SakaiFacade.SIGNUP_CREATE_GROUP_ALL, site.getSiteId()))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tList<SignupGroup> signupGroups = site.getSignupGroups();\n\t\t\t\tfor (SignupGroup group : signupGroups) {\n\t\t\t\t\tif (!(sakaiFacade.isAllowedGroup(userId, SakaiFacade.SIGNUP_CREATE_GROUP, site.getSiteId(), group.getGroupId()) \n\t\t\t\t\t\t\t|| sakaiFacade.isAllowedGroup(userId, SakaiFacade.SIGNUP_CREATE_GROUP_ALL, site.getSiteId(), group.getGroupId())))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\n\t}", "public abstract boolean impliesWithoutTreePathCheck(Permission permission);", "public boolean isAscendantOf(Actor actor) {\n if (actor == null) throw new IllegalArgumentException(\"actor cannot be null.\");\n if(actor instanceof Group){\n Group group=(Group)actor;\n return internalGroup.isAscendantOf(group.internalGroup);\n }\n return internalGroup.isAscendantOf(actor.internalActor);\n }", "boolean hasAdGroup();", "public boolean isCoveredBy(Filter f);", "abstract public boolean isPickedBy(Point p);", "public boolean isChild();", "boolean isInner();", "Boolean groupingEnabled();", "@Test\n public void testPassSubgroup2() {\n verifyTask(new int[][]{{0, 1}, {0, 2}}, new Runnable() {\n public void run() {\n final Int i = new Int();\n final Ref<Int> r = new Ref<>(i);\n \n Task<?> task1 = new Task<Void>(new Object[]{r}, new Object[]{}) {\n @Override\n protected Void runRolez() {\n region(0);\n r.o.value++;\n return null;\n }\n };\n s.start(task1);\n \n Task<?> task2 = new Task<Void>(new Object[]{i}, new Object[]{}) {\n @Override\n protected Void runRolez() {\n region(1);\n i.value++;\n return null;\n }\n };\n s.start(task2);\n region(2);\n \n assertEquals(2, guardReadOnly(i).value);\n }\n });\n }", "boolean hasIsPartOf();", "boolean isNested();", "public void testNestedAclGroupsSupported()\n {\n assertTrue(_ruleSet.addGroup(\"aclgroup1\", Arrays.asList(new String[] {\"userb\"})));\n assertTrue(_ruleSet.addGroup(\"aclgroup2\", Arrays.asList(new String[] {\"usera\", \"aclgroup1\"}))); \n \n _ruleSet.grant(1, \"aclgroup2\", Permission.ALLOW, Operation.ACCESS, ObjectType.VIRTUALHOST, ObjectProperties.EMPTY);\n assertEquals(1, _ruleSet.getRuleCount());\n\n assertEquals(Result.ALLOWED, _ruleSet.check(TestPrincipalUtils.createTestSubject(\"usera\"),Operation.ACCESS, ObjectType.VIRTUALHOST, ObjectProperties.EMPTY));\n assertEquals(Result.ALLOWED, _ruleSet.check(TestPrincipalUtils.createTestSubject(\"userb\"),Operation.ACCESS, ObjectType.VIRTUALHOST, ObjectProperties.EMPTY));\n }", "public boolean checkEventsAndGroupsLink();", "boolean hasRecursive();", "boolean isSuperclass(Concept x, Concept y);", "public boolean isGroup(String name) {\n return grouptabs.containsKey(name);\n }", "public boolean isSingleGroupInherited()\n\t\t{\n\t\t\t//Collection groups = getInheritedGroups();\n\t\t\treturn // AccessMode.INHERITED.toString().equals(this.m_access) && \n\t\t\t\t\tAccessMode.GROUPED.toString().equals(this.m_inheritedAccess) && \n\t\t\t\t\tthis.m_inheritedGroupRefs != null && \n\t\t\t\t\tthis.m_inheritedGroupRefs.size() == 1; \n\t\t\t\t\t// && this.m_oldInheritedGroups != null \n\t\t\t\t\t// && this.m_oldInheritedGroups.size() == 1;\n\t\t}", "boolean hasIsPerformOf();", "boolean hasAdGroupCriterionSimulation();", "public boolean contains(Group toCheck) {\n requireNonNull(toCheck);\n return internalList.contains(toCheck);\n }", "@Override\n public boolean predicate2(Object dm, Designer dsgr) {\n if (!(Model.getFacade().isAClassifier(dm))) {\n return NO_PROBLEM;\n }\n if (!(Model.getFacade().isPrimaryObject(dm))) {\n return NO_PROBLEM;\n }\n\n // If the classifier does not have a name,\n // then no problem - the model is not finished anyhow.\n if ((Model.getFacade().getName(dm) == null)\n\t || (\"\".equals(Model.getFacade().getName(dm)))) {\n return NO_PROBLEM;\n\t}\n\n // Abstract elements do not necessarily require associations\n if (Model.getFacade().isAGeneralizableElement(dm)\n\t && Model.getFacade().isAbstract(dm)) {\n return NO_PROBLEM;\n }\n\n // Types can probably have associations, but we should not nag at them\n // not having any.\n // utility is a namespace collection - also not strictly required\n // to have associations.\n if (Model.getFacade().isType(dm)) {\n return NO_PROBLEM;\n }\n if (Model.getFacade().isUtility(dm)) {\n return NO_PROBLEM;\n }\n\n // See issue 1129: If the classifier has dependencies,\n // then mostly there is no problem. \n if (Model.getFacade().getClientDependencies(dm).size() > 0) {\n return NO_PROBLEM;\n }\n if (Model.getFacade().getSupplierDependencies(dm).size() > 0) {\n return NO_PROBLEM;\n }\n \n // special cases for use cases\n // Extending use cases and use case that are being included are\n // not required to have associations.\n if (Model.getFacade().isAUseCase(dm)) {\n Object usecase = dm;\n Collection includes = Model.getFacade().getIncludes(usecase);\n if (includes != null && includes.size() >= 1) {\n return NO_PROBLEM;\n }\n Collection extend = Model.getFacade().getExtends(usecase);\n if (extend != null && extend.size() >= 1) {\n return NO_PROBLEM;\n }\n }\n \n \n\n //TODO: different critic or special message for classes\n //that inherit all ops but define none of their own.\n\n if (findAssociation(dm, 0)) {\n return NO_PROBLEM;\n }\n return PROBLEM_FOUND;\n }", "public void testGroupDoesNotImplySameGroup() {\n User user = RoleFactory.createUser(\"foo\");\n \n Group group = RoleFactory.createGroup(\"bar\");\n group.addMember(group);\n group.addMember(user);\n \n assertFalse(m_roleChecker.isImpliedBy(group, group));\n }", "boolean hasMaterialization(Object groupID) throws Exception;", "public boolean checkOutsiderPermission(Authentication authentication,Integer ctId){\n ContestEntity contestEntity = getContestById(ctId);\n //contest must be public(anyone can participate) and contest creator allows everyone to see\n if (!contestEntity.getIsAnyoneCanParticipate().equals(1) || !contestEntity.getShowInforToAll().equals(1)){\n return false;\n }\n\n //if so allows only when contest has started\n Date currentTime = new Date();\n Date startTime = contestEntity.getStartTime();\n List<AuthorityDTO> lstAuthority = authorityMapper.getContestAuthority(ctId, authentication.getName());\n for (AuthorityDTO curAuth : lstAuthority) {\n if (curAuth.getId().equals(Constants.AUTH_PARTICIPATE_CONTEST_ID)) {\n return false;\n }\n }\n return currentTime.compareTo(startTime) >= 0;\n }", "public boolean hasSubTasks() {\n\t\treturn (getSubTasks() != null) && (getSubTasks().size() > 0);\n\t}", "private static boolean checkTaskBounds(int task) {\r\n\t\t\tboolean isInBound;\r\n\t\t\t\r\n\t\t\tif ((task < 0) || (task > 7)) {\r\n\t\t\t\t//isInBound = false;\r\n\t\t\t\tif (task == -1) {\r\n\t\t\t\t\tisInBound = true;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tisInBound = false;\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tisInBound = true;\r\n\t\t\t}\r\n\t\t\treturn isInBound;\r\n\t\t}", "private boolean isUserInMeetingGroup(String email, String description){\n \tboolean isInside = false;\n \tfor(MeetingGroup mG : meetingGroups){\n \t\tif(this.isUserInArrayLisyOfUsers(email, mG.getMembers())|| this.isUserInArrayLisyOfUsers(email, mG.getCoorganizator())||\n \t\t\t\tmG.isMemberOrganizerOfMeetingGroup(email)){\n \t\t\tisInside = true;\n \t\t}\n \t}\n \t\t\n \treturn isInside;\n }", "boolean hasParent(CtElement candidate);", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Boolean isIncludeSubGroups();", "protected boolean conjoinSecondGroup(BGP theBGP, Group parent, Group child, List<GraphPattern> toAdd) {\n boolean b = true;\n // if the child group has its own filters or assignments, then we can't conjoin it\n // (since those are limited to the scope of that group)\n if (child.getFilters().size() == 0 && child.getAssignments().size() == 0) {\n // we can only remove this child group if we were able to eliminate\n // all of its children\n for (GraphPattern gp : child.getPatterns())\n b = conjoinGraphPattern(theBGP, parent, gp, toAdd) && b;\n // the caller of this function is responsible for removing the child group\n return b;\n }\n return false;\n }", "private boolean checkUnwanted(Schedule sched)\n\t{\n\t\tPair<Course, TimeSlot> workingPair;\n\t\tCourse workingCourse;\n\t\tTimeSlot workingSlot;\n\t\tLab workingLab;\n\t\tboolean done = false;\n\t\t\n\t\t//Courses \n\t\tfor(int i = 0;i<unwanted.size();i++)\n\t\t{\t\n\t\t\t//If the unwanted we are checking is actually a course\n\t\t\tif(unwanted.get(i).getKey().getClass() == Course.class)\n\t\t\t{\nT:\t\t\t\tfor(int j = 0; j<sched.getCourses().size();j++)\n\t\t\t\t{\n\t\t\t\t\tworkingCourse = sched.getCourses().get(j);\n\t\t\t\t\t//If we found the course \n\t\t\t\t\tif(workingCourse.equals(unwanted.get(i).getKey()) && workingCourse.getSlot() != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//And it has the same time slot as unwanted return false cause the check failsed\n\t\t\t\t\t\tworkingSlot = workingCourse.getSlot();\n\t\t\t\t\t\tif(workingSlot.getDay() == unwanted.get(i).getValue().getDay() &&\n\t\t\t\t\t\t\t\tworkingSlot.getStartTime() == unwanted.get(i).getValue().getStartTime() &&\n\t\t\t\t\t\t\t\tworkingSlot.getIsLab() == unwanted.get(i).getValue().getIsLab())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn false;\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//We found the course, but it didn't have the unwanted time slot so we \n\t\t\t\t\t\t\t//break the loop that was trying to find the course\n\t\t\t\t\t\t\tbreak T;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//If the unwanted we are checking is actually a Lab\n\t\t\tif(unwanted.get(i).getKey().getClass() == Lab.class)\n\t\t\t{\n\t\t\t\tLab unwantedLab = (Lab) unwanted.get(i).getKey();\n\t\t\t\t\nF:\t\t\t\tfor(int j = 0; j<sched.getLabs().size();j++)\n\t\t\t\t{\n\t\t\t\t\tworkingLab = sched.getLabs().get(j);\n\t\t\t\t\t//If we found the Lab and the slot is not not null\n\t\t\t\t\tif(workingLab.getDepartment().equals(unwantedLab.getDepartment()) && \n\t\t\t\t\t\t\tworkingLab.getLectureNum() == unwantedLab.getLectureNum() &&\n\t\t\t\t\t\t\tworkingLab.getNumber() == unwantedLab.getNumber() &&\n\t\t\t\t\t\t\tworkingLab.getSection() == unwantedLab.getSection() &&\n\t\t\t\t\t\t\tworkingLab.getSlot() != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//And it has the same time slot as unwanted return false cause the check failsed\n\t\t\t\t\t\tworkingSlot = workingLab.getSlot();\n\t\t\t\t\t\tif(workingSlot.getDay() == unwanted.get(i).getValue().getDay() &&\n\t\t\t\t\t\t\t\tworkingSlot.getStartTime() == unwanted.get(i).getValue().getStartTime() &&\n\t\t\t\t\t\t\t\tworkingSlot.getIsLab() == unwanted.get(i).getValue().getIsLab())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn false;\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//We found the course, but it didn't have the unwanted time slot so we \n\t\t\t\t\t\t\t//break the loop that was trying to find the course\n\t\t\t\t\t\t\tbreak F;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\n\t\treturn true;\n\t}", "public boolean check(Student stu, Section sect){\n\t\tif (sect.getSectionNum() == 1){\n\t\t\tif (sect.getParent().section2.getResi().contains(stu)){\n\t\t\t\treturn false;\n\t\t\t} \n\t\t}\n\t\telse if (sect.getParent().section1.getResi().contains(stu)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "boolean isInheritableStyle(QName eltName, QName styleName);", "private static boolean isChildrenBlacklistedViewGroup(@NonNull ViewGroup view) {\n return view instanceof ListView || view instanceof RecyclerView || view instanceof TabLayout;\n }", "public boolean checkDeskSubset(ArrayList<Furniture> subset){\n boolean legs = false;\n boolean top = false;\n boolean drawer = false;\n\n for(Furniture d : subset){\n if(d instanceof Desk){\n Desk desk = (Desk)d;\n if(desk.getLegs().equals(\"Y\")){\n legs = true;\n }\n if(desk.getTop().equals(\"Y\")){\n top = true;\n }\n if(desk.getDrawer().equals(\"Y\")){\n drawer = true;\n }\n }\n }\n // check if any of the desk pieces are missing and if so the combination is invalid\n if(!legs || !top || !drawer){\n return false;\n }\n return true;\n }", "private boolean parentKiller() {\n RadioGroup radioGroupCity = (RadioGroup) findViewById(R.id.parent_killer);\n RadioButton parentCheckRadioButton = (RadioButton) radioGroupCity.findViewById(radioGroupCity.getCheckedRadioButtonId());\n boolean checked = (parentCheckRadioButton.isChecked());\n\n switch (parentCheckRadioButton.getId()) {\n case R.id.marconi_button:\n if (checked) {\n return false;\n }\n case R.id.falcone_button:\n if (checked) {\n return false;\n }\n case R.id.chill_button:\n if (checked) {\n return true;\n }\n case R.id.zucco_button:\n if (checked) {\n return false;\n }\n }\n return false;\n }", "boolean isProcedure(Object groupID) throws Exception;", "boolean groupSupports(Object groupID, int groupConstant) throws Exception;", "public static boolean comesFromATelephonicInterviewProcess(WorkItem wi, WFSession wfSession) throws Exception{\n\t\tif (isInterviewPlanName(wi.getPlanName()))\n\t\t\treturn true;\n\t\telse\n\t\t{\n\t\t\tlong parentProcessId = wi.getProcessInstance().getParentProcessId();\n\t\t\t\n\t\t\tif (parentProcessId > -1)\n\t\t\t{\n\t\t\t\tProcessInstance parentProcess = WFObjectFactory.getProcessInstance(parentProcessId, wfSession);\t\t\t\n\t\t\t\tboolean isParentFromInterview = isInterviewPlanName(parentProcess.getPlanName());\n\t\t\t\t\n\t\t\t\tif (isParentFromInterview == true)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tProcessInstance grandParentProcess = WFObjectFactory.getProcessInstance(parentProcess.getId(), wfSession);\n\t\t\t\t\tboolean isGrandParentFromInterview = isInterviewPlanName(grandParentProcess.getPlanName());\n\t\t\t\t\treturn isGrandParentFromInterview;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\treturn false;\n\t\t}\n\t}", "public void testUserDoesNotImplyNotImpliedGroup() {\n User user = RoleFactory.createUser(\"foo\");\n Group group = RoleFactory.createGroup(\"bar\");\n \n assertFalse(m_roleChecker.isImpliedBy(user, group));\n }", "boolean checkSubProcessDefinitionValid(ProcessDefinition processDefinition);", "@Override\n public boolean process(int offset, @NotNull FoldRegionImpl region, boolean atStart, @NotNull Collection<FoldRegionImpl> overlapping) {\n if (atStart) {\n if (!isNestedWithLast(nested, region)) {\n reportVisible(nested, lastEnd, visible, duplicatesToKill);\n }\n addToNested(nested, region);\n }\n else {\n if (lastEnd != offset) {\n reportVisible(nested, lastEnd, visible, duplicatesToKill);\n lastEnd = offset;\n }\n }\n return true;\n }", "public static boolean canAct(Equation stup, Equation sel) {\n if (sel!= null && Operations.sortaNumber(sel) && Operations.getValue(sel).doubleValue() ==0){\n return false;\n }\n\n if (sel != null && stup instanceof EqualsEquation){\n while (sel.parent instanceof SignEquation){\n sel = sel.parent;\n }\n if (stup instanceof EqualsEquation && stup.DivMultiContain(sel)){\n\n // sadly we are not done.\n // we need find the multiDivEqaution\n // that is closest to root on sel side\n\n\n // we actually don't want to go so deep\n // the only cases we want to handle are like\n // 4*a = 55 where 4 is selected\n // 4 = 55 where 4 is selected\n int side = ((EqualsEquation)stup).side(sel);\n Equation sideRoot = stup.get(side);\n if (sideRoot.equals(sel)){\n return true;\n }\n while ((sideRoot instanceof SignEquation ) && !sideRoot.equals(sel)){\n sideRoot = sideRoot.get(0);\n }\n return (sideRoot.contains(sel)&& sideRoot instanceof MultiEquation) ||\n (sideRoot instanceof DivEquation && sideRoot.get(0).equals(sel)) ;\n\n\n // and see if sel is on top\n // if it's on top return true\n\n //return ((MultiDivSuperEquation)sideRoot).onTop(sel);\n\n }\n }\n return false;\n }", "private boolean overlappingTasks(BpmnShape s1, BpmnShape s2) {\n\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\t//The coordinates refer to the upper-left corner of the task, adding Width and Height \n\t\t//cause the coordinates to reflect the position of the center of the shape\n\t\tdouble firstX = s1.getBounds().getX() + firstWidth;\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\t\t\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondX = s2.getBounds().getX() + secondWidth;\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\t//Second shape is on the upper-left\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\t//Second shape is on the lower-left\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\t//Second shape is on the upper-right\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\t//Second shape is on the lower-shape\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t//completely overlapped shapes\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\t//second shape is on top of the first one\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\t//second shape is on the right\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\t//second shape is on bottom of the first one\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\t//second shape is on the left\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean canFinishRecursive(Map<Integer, Set<Integer>> courses, Set<Integer> prerequisite, int start, Set<Integer> visited){\n for(Integer p: prerequisite){\n if(visited.contains(p)){\n continue;\n }\n visited.add(p);\n //if you detect a circular dependency then return false since course can never be completed\n if(p.intValue() == start){\n return false;\n }\n if(courses.get(p).size() == 0){\n continue;\n }\n if(!canFinishRecursive(courses,courses.get(p), start, visited)){\n return false;\n }\n }\n return true;\n }", "boolean isBlockedBy(Task otherTask);", "public Boolean isThisParent(Flow f){\n\t\treturn false;\n\t}", "public void testUserImpliesImpliedGroup() {\n User user = RoleFactory.createUser(\"foo\");\n \n Group group = RoleFactory.createGroup(\"bar\");\n group.addRequiredMember(m_anyone);\n group.addMember(user);\n\n assertTrue(m_roleChecker.isImpliedBy(group, user));\n }", "public void testGroupDoesNotImplyNotImpliedUser() {\n User user = RoleFactory.createUser(\"foo\");\n \n Group group = RoleFactory.createGroup(\"bar\");\n group.addMember(user);\n \n assertFalse(m_roleChecker.isImpliedBy(user, group));\n }", "private int isPrivacyModelFulfilled(Transformation<?> transformation, HashGroupifyEntry entry) {\n \n // Check minimal group size\n if (minimalClassSize != Integer.MAX_VALUE && entry.count < minimalClassSize) {\n return 0;\n }\n \n // Check other criteria\n // Note: The d-presence criterion must be checked first to ensure correct handling of d-presence with tuple suppression.\n // This is currently ensured by convention. See ARXConfiguration.getCriteriaAsArray();\n for (int i = 0; i < classBasedCriteria.length; i++) {\n if (!classBasedCriteria[i].isAnonymous(transformation, entry)) {\n return i + 1;\n }\n }\n return -1;\n }", "public static boolean checkDateConstraints(Task task) {\n if (task.getBeginDate().before(new Date()) ||\n task.getBeginDate().after(task.getEndingDate()) ||\n task.getBeginDate().equals(task.getEndingDate())) {\n return false;\n }\n return true;\n }", "public boolean isGroupPossible()\n\t\t{\n\t\t\treturn this.m_allowedAddGroupRefs != null && ! this.m_allowedAddGroupRefs.isEmpty();\n\n\t\t}", "@Test\n @WithMockUhUser(username = \"iamtst04\")\n public void optInTest() throws Exception {\n assertFalse(isInCompositeGrouping(GROUPING, tst[0], tst[3]));\n assertTrue(isInBasisGroup(GROUPING, tst[0], tst[3]));\n assertTrue(isInExcludeGroup(GROUPING, tst[0], tst[3]));\n\n //tst[3] opts into Grouping\n mapGSRs(API_BASE + GROUPING + \"/optIn\");\n }", "@Override\n\tpublic boolean hasParticipateGroup(String openid) {\n\t\treturn seck.hasParticipateGroup(openid);\n\t}", "public boolean isExpandable();", "public abstract boolean levelUp();", "@SuppressWarnings(\"null\")\n \tstatic boolean allowAdd(Group group, DefinitionGroup groupDef,\n \t\t\tQName propertyName) {\n \t\tif (group == null && groupDef == null) {\n \t\t\tthrow new IllegalArgumentException();\n \t\t}\n \t\t\n \t\tfinal DefinitionGroup def;\n \t\tif (groupDef == null) {\n \t\t\tdef = group.getDefinition();\n \t\t}\n \t\telse {\n \t\t\tdef = groupDef;\n \t\t}\n \t\t\n \t\tif (group == null) {\n \t\t\t// create an empty dummy group if none is specified\n \t\t\tgroup = new Group() {\n \t\t\t\t@Override\n \t\t\t\tpublic Object[] getProperty(QName propertyName) {\n \t\t\t\t\treturn null;\n \t\t\t\t}\n \t\n \t\t\t\t@Override\n \t\t\t\tpublic Iterable<QName> getPropertyNames() {\n \t\t\t\t\treturn Collections.emptyList();\n \t\t\t\t}\n \t\n \t\t\t\t@Override\n \t\t\t\tpublic DefinitionGroup getDefinition() {\n \t\t\t\t\treturn def;\n \t\t\t\t}\n \t\t\t};\n \t\t}\n \t\t\n \t\tif (def instanceof GroupPropertyDefinition) {\n \t\t\t// group property\n \t\t\tGroupPropertyDefinition gpdef = (GroupPropertyDefinition) def;\n \t\t\t\n \t\t\tif (gpdef.getConstraint(ChoiceFlag.class).isEnabled()) {\n \t\t\t\t// choice\n \t\t\t\t// a choice may only contain one of its properties\n \t\t\t\tfor (QName pName : group.getPropertyNames()) {\n \t\t\t\t\tif (!pName.equals(propertyName)) {\n \t\t\t\t\t\t// other property is present -> may not add property value\n \t\t\t\t\t\treturn false;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t// check cardinality\n \t\t\t\treturn allowAddCheckCardinality(group, propertyName);\n \t\t\t}\n \t\t\telse {\n \t\t\t\t// sequence, group(, attributeGroup)\n \t\t\t\t\n \t\t\t\t// check order\n\t\t\t\tif (!allowAddCheckOrder(group, propertyName, def)) {\n \t\t\t\t\treturn false;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// check cardinality\n \t\t\t\treturn allowAddCheckCardinality(group, propertyName);\n \t\t\t}\n \t\t}\n \t\telse if (def instanceof TypeDefinition) {\n \t\t\t// type\n \t\t\tTypeDefinition typeDef = (TypeDefinition) def;\n \t\t\t\n \t\t\t// check order\n \t\t\tif (!allowAddCheckOrder(group, propertyName, typeDef)) {\n \t\t\t\treturn false;\n \t\t\t}\n \t\t\t\n \t\t\t// check cardinality\n \t\t\treturn allowAddCheckCardinality(group, propertyName);\n \t\t}\n \t\t\n \t\treturn false;\n \t}", "private static boolean groupSum( int start, int[] nums, int target, String s ) {\n\n System.out.println(new String(new char[start]).\n replace(\"\\0\", \" \") + \"start = \" + start + \" target = \" + target + \" parent = \" + s);\n\n // Base case: if there are no numbers left, then there is a\n // solution only if target is 0.\n if (start >= nums.length)\n return (target == 0);\n\n // Key idea: nums[start] is chosen or it is not.\n // Deal with nums[start], letting recursion\n // deal with all the rest of the array.\n\n // Recursive call trying the case that nums[start] is chosen --\n // subtract it from target in the call.\n if (groupSum(start + 1, nums, target - nums[start], \" A: \" + start + \" _ _ \" + target))\n return true;\n\n // Recursive call trying the case that nums[start] is not chosen.\n if (groupSum(start + 1, nums, target, \"B:\" + start + \"_\" + target))\n return true;\n\n // If neither of the above worked, it's not possible.\n return false;\n }", "private boolean overlappingTaskAndEvent(BpmnShape s1, BpmnShape s2) {\n\t\t\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\tdouble firstX = s1.getBounds().getX() + firstWidth;\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondX = s2.getBounds().getX();\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse \n\t\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "boolean isSubclass(Concept x, Concept y);", "public void test_inheritence() {\n assertTrue(\"invalid inheritence.\", Task.class.getSuperclass() == BaseTaskEntity.class);\n }", "boolean isXMLGroup(Object groupID) throws Exception;", "@Override\n public void testOneRequiredGroup() {\n }", "@Override\n public void testOneRequiredGroup() {\n }", "boolean isVirtualGroup(Object groupID) throws Exception;" ]
[ "0.65565825", "0.6382376", "0.5305601", "0.51738393", "0.5088709", "0.50143206", "0.4960091", "0.4907611", "0.48973075", "0.48915422", "0.486895", "0.48670796", "0.48516423", "0.4804318", "0.47952804", "0.47633016", "0.47589862", "0.4741975", "0.4734506", "0.47240743", "0.47039557", "0.46810117", "0.46545848", "0.46524513", "0.46524513", "0.4652147", "0.4651843", "0.46507075", "0.46451092", "0.46251208", "0.46111816", "0.4588726", "0.45841762", "0.45837992", "0.45763898", "0.4570077", "0.45695552", "0.45472068", "0.45369953", "0.4522703", "0.4518105", "0.45160177", "0.45100853", "0.4508699", "0.4507852", "0.45070297", "0.44990847", "0.44916975", "0.44901338", "0.44865808", "0.4479501", "0.4474324", "0.4463529", "0.44620958", "0.4459422", "0.44592535", "0.44580606", "0.44527435", "0.44475353", "0.44454464", "0.4444542", "0.444426", "0.44435903", "0.44376373", "0.4431915", "0.44301787", "0.4428521", "0.44137388", "0.4406291", "0.44046748", "0.4396943", "0.4394351", "0.4393595", "0.4391731", "0.43914923", "0.43884566", "0.43779498", "0.4375644", "0.43695435", "0.43676108", "0.43624997", "0.43586376", "0.43558463", "0.43537778", "0.43532804", "0.43470037", "0.4337142", "0.43327206", "0.43298742", "0.43184176", "0.4313968", "0.4310139", "0.43068755", "0.43066022", "0.4296699", "0.4290889", "0.42872286", "0.4286326", "0.4286326", "0.42821038" ]
0.5731341
2
Nothing to do yet.
public void deselectAll() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void mo51373a() {\n }", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "private void m50366E() {\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override public int describeContents() { return 0; }", "@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 nadar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public void method_4270() {}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "private void getStatus() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "@Override\n protected void prot() {\n }", "protected void mo6255a() {\n }", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public void mo4359a() {\n }", "public void gored() {\n\t\t\n\t}", "public final void mo91715d() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private void kk12() {\n\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public int retroceder() {\n return 0;\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\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "private final void i() {\n }", "private void poetries() {\n\n\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public void m23075a() {\n }", "@Override\n protected void init() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "public void mo6081a() {\n }", "private Rekenhulp()\n\t{\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo12628c() {\n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void just() {\n\t\t\r\n\t}", "@Override\n public int describeContents()\n {\n return 0;\n }", "private void initialize() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }" ]
[ "0.66031665", "0.64606583", "0.63940394", "0.6332047", "0.6251154", "0.6242532", "0.6237739", "0.618104", "0.6155405", "0.6116511", "0.60656995", "0.60624033", "0.6061129", "0.6051388", "0.6051388", "0.60487086", "0.6040131", "0.6034441", "0.601504", "0.6004764", "0.6004764", "0.5968879", "0.5963302", "0.59493744", "0.5948114", "0.59419215", "0.59147793", "0.5907965", "0.590224", "0.58988184", "0.5896718", "0.58953243", "0.58602756", "0.5854557", "0.5851151", "0.5851151", "0.5851151", "0.5851151", "0.5851151", "0.5851151", "0.58483654", "0.58479595", "0.58473796", "0.58391035", "0.58168864", "0.58168864", "0.58168864", "0.58168864", "0.58168864", "0.58168864", "0.58168864", "0.57967055", "0.5795475", "0.5790795", "0.5790795", "0.5785753", "0.57851475", "0.5783493", "0.5775113", "0.5773865", "0.5765575", "0.5761099", "0.5760893", "0.5738668", "0.57360584", "0.57297987", "0.5727055", "0.57269084", "0.57269084", "0.57227063", "0.5716229", "0.571473", "0.57035947", "0.5701495", "0.5701398", "0.5689674", "0.5685673", "0.56831", "0.568221", "0.5680219", "0.5679486", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595", "0.5678595" ]
0.0
-1
Return the set of selected undertakings (tasks and/or task groups). Although it should not be depended upon, the returned array is generally not null (which would indicate no selected undertakings). Instead, if there are no selected undertakings, an array of zero length is returned. The mode parameter indicates whether or not to prune the set of selected undertakings (i.e., pruning removes from consideration those selected undertakings that are children of other selected ITaskGroups) and/or whether or not to ensure the selected undertakings are presented in order of their occurrence in the preorder traversal of the Project's root undertakings. The constants PRUNE_SELECTION and ORDER_SELECTION may be OR'ed together for both effects. For neither effect, to achieve the fastest "selection" (e.g., when it is known that only one task is selected), FAST_SELECTION may be used.
public AUndertaking[] getSelectedTasks(int flags) { boolean prune = (flags & PRUNE_SELECTION) != 0; boolean taskGroupsOnly = (flags & TASK_GROUPS_ONLY) != 0; List<AUndertaking> keptTasks = new ArrayList<AUndertaking>(); if ((flags & ORDER_SELECTION) != 0) { orderSelection(project.getUndertakings().iterator(), prune, taskGroupsOnly, keptTasks); } else { Iterator<AUndertaking> allSelectedTasks = getSelectedTaskIterator(); while (allSelectedTasks.hasNext()) { AUndertaking selectedTask = allSelectedTasks.next(); if ((! prune) || (! isAncestorSelected(selectedTask))) { if ((! taskGroupsOnly) || selectedTask.isTaskGroup()) { keptTasks.add(selectedTask); } } } } AUndertaking[] selection = new AUndertaking[keptTasks.size()]; keptTasks.toArray(selection); return selection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TreeMap<String,CheckOutMode>\n getModes()\n {\n TreeMap<String,CheckOutMode> modes = new TreeMap<String,CheckOutMode>();\n for(String name : pVersionFields.keySet()) {\n JCollectionField field = pModeFields.get(name);\n modes.put(name, CheckOutMode.values()[field.getSelectedIndex()]);\n }\n return modes;\n }", "public int[] greedyPickingPlan() {\n return greedyPickingPlan(1);\n }", "public TaskGroup[] getSelectedTaskParents()\n {\n int selectedItemCount = getSelectedTaskCount();\n TaskGroup[] parents = new TaskGroup[selectedItemCount];\n\n Iterator<AUndertaking> selectedTasks = getSelectedTaskIterator();\n int i = 0;\n\n while (selectedTasks.hasNext()) {\n AUndertaking task = selectedTasks.next();\n\n parents[i++] = task.getTaskGroup();\n }\n\n return parents;\n }", "public static Collection<IAlgoInstance> completeSelectionWithChildren(Collection<IAlgoInstance> selected) {\n\t\tSet<IAlgoInstance> res = new HashSet<IAlgoInstance>();\n\t\t\n\t\tSet<IAlgoInstance> toProcess = new HashSet<IAlgoInstance>();\n\t\ttoProcess.addAll(selected);\n\t\t\n\t\twhile (!toProcess.isEmpty()) {\n\t\t\t\n\t\t\t// pick up one\n\t\t\tIterator<IAlgoInstance> it = toProcess.iterator();\n\t\t\tIAlgoInstance ai = it.next();;\n\t\t\tit.remove();\n\t\t\t\n\t\t\t// add it\n\t\t\tres.add(ai);\n\t\t\t\n\t\t\t// process it\n\t\t\tif (ai instanceof IAlgoContainerInstance) {\n\t\t\t\tIAlgoContainerInstance aic = (IAlgoContainerInstance)ai;\n\t\t\t\ttoProcess.addAll(aic.getChildren());\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn res;\n\t}", "public String[] getModeSelectCmd() {\n\t\tString path = sv.getCommonFunction(\"modeSelect\");\t\t//Get mode selections script path\r\n\t\tif(path == null || mode == null || comPort == null) {\r\n\t\t\tconsole.logError(\"Error creating mode selection command.\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\tString baseArray[] = {\r\n\t\t\t\t\"python\",\r\n\t\t\t\tpath,\r\n\t\t\t\t\"-p\",\r\n\t\t\t\tcomPort,\r\n\t\t\t\t\"-m\",\r\n\t\t\t\tmode\r\n\t\t};\r\n\t\t\r\n\t\tswitch (mode) {\t\t//Execute commands required by mode\r\n\t\tcase \"i2c\":\r\n\t\t\tvalidateParams(2);\r\n\t\t\tString paramArray[] = getParams(2);\r\n\t\t\tString modeArray[] = combine(baseArray, paramArray);\r\n\t\t\treturn modeArray;\r\n\t\tdefault:\r\n\t\t\tconsole.logError(\"No parameters defined for mode:\" + mode);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public AUndertaking getSelectedTask()\n {\n String errorMsg;\n Iterator<AUndertaking> taskIt = getSelectedTaskIterator();\n\n if (taskIt.hasNext()) {\n AUndertaking selectedTask = taskIt.next();\n\n if (! taskIt.hasNext()) {\n return selectedTask;\n }\n\n errorMsg = \"Selection is multiple\";\n }\n else {\n errorMsg = \"Nothing is selected\";\n }\n\n throw new IllegalStateException(errorMsg);\n }", "@Override\n public List<Mode> availableModes(List<Mode> modes) {\n if (modes != null) {\n int size = modes.size();\n if (size > 0) {\n // dock everywhere, except editor frame\n return modes.stream()\n .filter(singleMode -> singleMode.getName() != null && !\"editor\".equals(singleMode.getName()))\n .collect(Collectors.toList());\n }\n }\n\n return null;\n }", "public native String[] getFacetsHavingSelection() /*-{\r\n var self = [email protected]::getOrCreateJsObj()();\r\n var facets = self.getFacetsHavingSelection();\r\n if (facets == null) return null;\r\n return @com.smartgwt.client.util.JSOHelper::convertToArray(Lcom/google/gwt/core/client/JavaScriptObject;)(facets);\r\n }-*/;", "@Override\n\tprotected String pieceSelectionAlgorithm() {\n\t\treturn pieceSelectionAlgorithm(this.quartoBoard);\n\t}", "public static Set<AssessorDetails> selectionToSet(List<AssessorDetails> pool, List<AssessorDetails> selection) {\n Set<AssessorDetails> result = new HashSet<AssessorDetails>();\n for (AssessorDetails assessorDetail : pool) {\n for (AssessorDetails preselectedAssessorDetail : selection) {\n if (preselectedAssessorDetail.getId().equals(assessorDetail.getId())) {\n result.add(assessorDetail);\n }\n }\n }\n return result;\n\n }", "public Set<LeafNode> getSelectedNodes()\n\t{\n\t\treturn Collections.unmodifiableSet(selectionNode);\n\t}", "public TaskStack getTopStackInWindowingMode(int windowingMode) {\n return getStack(windowingMode, 0);\n }", "public boolean isInSelectedHierarchy(AUndertaking task)\n {\n TaskGroup group = task.getTaskGroup();\n\n while (group != null) {\n if (isTaskSelected(group)) {\n return true;\n }\n\n group = group.getTaskGroup();\n }\n\n return false;\n }", "public java.util.List<Node> getSelection() {\n\t\treturn selected_nodes;\n\t}", "public TaskStack getVisibleHwMulitWindowStackLocked(int mode) {\n if (!(mode == 100 || mode == 101)) {\n return null;\n }\n for (int i = DisplayContent.this.mTaskStackContainers.getChildCount() - 1; i >= 0; i--) {\n TaskStack stack = (TaskStack) DisplayContent.this.mTaskStackContainers.getChildAt(i);\n if (stack != null) {\n int windowingMode = stack.getWindowingMode();\n if (windowingMode == 1) {\n return null;\n }\n if (windowingMode == mode) {\n return stack;\n }\n }\n }\n return null;\n }", "public List<CharSequence> getSelectedEntries()\n {\n List<CharSequence> selectedEntries = new ArrayList<CharSequence>();\n CharSequence[] allEntries = getEntries();\n for( int i = 0; i < allEntries.length; i++ )\n {\n if( mCheckedStates[i] )\n selectedEntries.add( allEntries[i] );\n }\n return selectedEntries;\n }", "private ArrayList<int[]> selectionRank(int[][] chromosomes, float percentToSelect) {\n\n\t\tArrayList<int[]> selectedChromosomes = new ArrayList<int[]>();\n\n\t\t//get fitnesses and ranks of chromosomes, save in array to avoid recalculating\n\t\tint[] fitnesses = new int[chromosomes.length];\n\t\tArrayList<Integer> ranks = new ArrayList<Integer>(); //holds indices of chromosomes, position in arraylist indicates rank\n\n\t\tfor (int i = 0; i < chromosomes.length; i++) { //set up list of fitnesses and ranks\n\t\t\tfitnesses[i] = getFitness(chromosomes[i]);\n\n\n\t\t\tboolean added = false;\n\t\t\tfor (int keyIndex = 0; keyIndex < ranks.size(); keyIndex++) { //only search the second half\n\t\t\t\tif (fitnesses[ranks.get(keyIndex)] > fitnesses[i]) { //if this one is worse\n\t\t\t\t\tranks.add(keyIndex, i); //inverted rank\n\t\t\t\t\tadded = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!added) {\n\t\t\t\tranks.add(i);\n\t\t\t}\n\n\t\t}// end fitness ranking (low fitness is best, last index is worst)\n\n\n\t\t//spin the roulette wheel\n\t\tfor (int i = 0; i < chromosomes.length * percentToSelect; i++) {\n\t\t\tint currentFitnessTotal = 0;\n\t\t\tint fitSelector = rand.nextInt(chromosomes.length); //where the wheel stops\n\t\t\tint fitnessCutoff = (fitSelector * (fitSelector + 1)) / 2;\n\n\t\t\tfor (int j = 0; j < ranks.size(); j++) { //go through all ranks to see who is selected this spin\n\t\t\t\tif (currentFitnessTotal < fitnessCutoff)\n\t\t\t\t\tcurrentFitnessTotal += chromosomes.length - ranks.get(j); //reorder fitness properly\n\n\t\t\t\tif (currentFitnessTotal >= fitnessCutoff) { //if this rank pushed us over the edge, save it\n\t\t\t\t\tselectedChromosomes.add(chromosomes[ranks.get(j)]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}//end roulette spinning\n\n\t\treturn selectedChromosomes;\n\t}", "Set<String> getRunModes();", "private void pickUtts() {\n for (int i = 0; i < CATEGORIES.length; i++)\n pickedUtts[i] = new Utterance[BUTTONS_PER_PAGE];\n // check all categories to be sure there's enough\n for (int i = 0; i < CATEGORIES.length; i++) {\n if(includedUtts.get(i).size() < BUTTONS_PER_PAGE)\n new Exception().printStackTrace();\n }\n // pick new utts\n Random ran = new Random();\n for (int i = 0; i < CATEGORIES.length; i++) {\n Utterance pick;\n for ( int j = 0; j < BUTTONS_PER_PAGE; j++ ) {\n do {\n pick = includedUtts.get(i).get(ran.nextInt(includedUtts.get(i).size()));\n } while (Arrays.asList(pickedUtts[i]).contains(pick));\n pickedUtts[i][j] = pick;\n }\n }\n }", "int[] getSelection();", "public Set<Filterable> getSelections();", "private static <AnyType extends Comparable<? super AnyType>> void quickSelect(AnyType[] a, int left, int right, int k)\n {\n if(left + CUTOFF <= right)\n {\n AnyType pivot = median3(a, left, right);\n\n // Begin partitioning\n int i = left, j = right - 1;\n for( ; ; )\n {\n while(a[++i].compareTo(pivot) < 0);\n while(a[--j].compareTo(pivot) > 0);\n if(i < j)\n CommonFunc.swapReference(a, i, j);\n else \n break;\n }\n\n CommonFunc.swapReference(a, i, right - 1);\n\n // if k = i + 1, the a[i] is the kth smallest item\n if(k <= i)\n quickSelect(a, left, i - 1, k);\n else if(k > i + 1)\n quickSelect(a, i + 1, right, k);\n }\n else // Do an insertion sort on the subarray\n Insertionsort.insertionsort(a, left, right);\n }", "public int[] findMode(TreeNode root) {\n dfs(root);\n Set<Integer> ans = new HashSet<>();\n int max = 0;\n List<Integer> set = new ArrayList<>(map.keySet());\n for (int i = 0; i < set.size(); i++) {\n if (max < map.get(set.get(i))) {\n max = map.get(set.get(i));\n ans.clear();\n ans.add(set.get(i));\n } else if (max == map.get(set.get(i))) {\n ans.add(set.get(i));\n }\n }\n return ans.stream().mapToInt(i -> i).toArray();\n }", "public int[] filterBySharpness(double threshold, String mode) throws IllegalArgumentException {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n int[] keep = new int[this.midpoints.length];\n Arrays.fill(keep, 1);\n\n if (mode.equals(\"upper\")) {\n for (int i=0; i<this.sharpness[0].length; i++) {\n double maxVal = Math.max(this.sharpness[0][i], this.sharpness[1][i]);\n if (maxVal > threshold) {\n keep[i] = 0;\n }\n }\n }\n else if (mode.equals(\"lower\")) {\n for (int i=0; i<this.sharpness[0].length; i++) {\n double minVal = Math.min(this.sharpness[0][i], this.sharpness[1][i]);\n if (minVal < threshold) {\n keep[i] = 0;\n }\n }\n }\n else {\n throw new IllegalArgumentException(\"Mode must either be lower or upper\");\n }\n for (int i=0; i<keep.length; i++) {\n if(keep[i] == 1) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }", "private EmbeddedTreePlaneSubset getTreeSubset() {\n if (treeSubset == null) {\n treeSubset = new EmbeddedTreePlaneSubset(plane);\n\n if (convexSubset != null) {\n treeSubset.add(convexSubset);\n\n convexSubset = null;\n }\n }\n\n return treeSubset;\n }", "List<ToolsOutIn> selectAll();", "List<Artifact> getSelectedArtifacts() {\n final TreePath[] selectedObjects = getSelectionPaths();\n final List<Artifact> selected = new ArrayList<Artifact>(selectedObjects.length);\n\n for (final TreePath path : selectedObjects) {\n final DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent();\n final Artifact artifact = (Artifact)node.getUserObject();\n if (GROUP_AID.equals(artifact.getArtifactId())) {\n final Enumeration children = node.children();\n while (children.hasMoreElements()) {\n final DefaultMutableTreeNode child = (DefaultMutableTreeNode)children.nextElement();\n final Artifact childArtifact = (Artifact)child.getUserObject();\n if (!selected.contains(childArtifact)) {\n selected.add(childArtifact);\n }\n }\n } else {\n if (!selected.contains(artifact)) {\n selected.add(artifact);\n }\n }\n }\n\n return selected;\n }", "@Parameterized.Parameters(name = \"Execution mode = {0}\")\n public static Collection<Object[]> executionModes() {\n return Arrays.asList(\n new Object[] {TestExecutionMode.CLUSTER},\n new Object[] {TestExecutionMode.COLLECTION});\n }", "void updateTreeSelection() {\n\n TreePath[] selections = tree.getSelectionPaths();\n currentSelectedPaths.clear();\n if (selections != null) {\n for (TreePath selection : selections) {\n currentSelectedPaths.add(selection);\n }\n }\n if ((selections == null) || (selections.length == 0)) {\n farmStatistics.setEnabled(false);\n linkStatistics.setEnabled(false);\n synchronized (basicPanel.getClusterPanel().getTreeLock()) {\n basicPanel.getClusterPanel().updateClusters(new Vector(), new Hashtable());\n }\n synchronized (basicPanel.getValPanel().getTreeLock()) {\n basicPanel.getValPanel().updateValues(new Vector());\n }\n synchronized (basicPanel.getModPanel().getTreeLock()) {\n basicPanel.getModPanel().updateList(new Vector());\n }\n return;\n }\n if ((selections.length == 1)\n && (((DefaultMutableTreeNode) selections[0].getLastPathComponent()).getUserObject() instanceof rcNode)) {\n farmStatistics.setEnabled(canShowFarmStatistics());\n linkStatistics.setEnabled(canShowLinkStatistics());\n } else {\n farmStatistics.setEnabled(false);\n linkStatistics.setEnabled(false);\n }\n Object[] userSel = new Object[selections.length];\n selectedGroups.clear();\n for (int j = 0; j < selections.length; j++) {\n userSel[j] = ((DefaultMutableTreeNode) selections[j].getLastPathComponent()).getUserObject();\n if (userSel[j] instanceof String) { // group selected\n selectedGroups.add(userSel[j]);\n DefaultMutableTreeNode groupNode = ((DefaultMutableTreeNode) selections[j].getLastPathComponent());\n for (int i = 0; i < treeModel.getChildCount(groupNode); i++) {\n tree.addSelectionPath(selections[j].pathByAddingChild(treeModel.getChild(groupNode, i)));\n }\n }\n }\n\n // update the parameters window to show only common parameters\n updateParamAndModPanels(userSel);\n }", "public abstract List<MODE> getModes();", "protected HashSet<Double> getMode() {\r\n boolean handleOutOfMemoryError = false;\r\n HashSet<Double> mode = new HashSet<>();\r\n long n = getN();\r\n if (n > 0) {\r\n //TDoubleObjectHashMap modes = new TDoubleObjectHashMap();\r\n Grids_GridDouble g = getGrid();\r\n int nrows = g.getChunkNRows(ChunkID, handleOutOfMemoryError);\r\n int ncols = g.getChunkNCols(ChunkID, handleOutOfMemoryError);\r\n double noDataValue = g.getNoDataValue(false);\r\n boolean calculated = false;\r\n int row = 0;\r\n int col = 0;\r\n int p;\r\n int q;\r\n Object[] tmode = initMode(nrows, ncols, noDataValue);\r\n if (tmode[0] == null) {\r\n return mode;\r\n } else {\r\n double value;\r\n long count;\r\n long modeCount = (Long) tmode[0];\r\n mode.add((Double) tmode[1]);\r\n Grids_2D_ID_int chunkCellID = (Grids_2D_ID_int) tmode[2];\r\n // Do remainder of the row\r\n p = chunkCellID.getRow();\r\n for (q = chunkCellID.getCol() + 1; q < ncols; q++) {\r\n value = getCell(p, q);\r\n if (value != noDataValue) {\r\n count = count(p, q, nrows, ncols, value);\r\n if (count > modeCount) {\r\n mode.clear();\r\n mode.add(value);\r\n modeCount = count;\r\n } else {\r\n if (count == modeCount) {\r\n mode.add(value);\r\n }\r\n }\r\n }\r\n }\r\n // Do remainder of the grid\r\n for (p++; p < nrows; p++) {\r\n for (q = 0; q < ncols; q++) {\r\n value = getCell(p, q);\r\n if (value != noDataValue) {\r\n count = count(p, q, nrows, ncols, value);\r\n if (count > modeCount) {\r\n mode.clear();\r\n mode.add(value);\r\n modeCount = count;\r\n } else {\r\n if (count == modeCount) {\r\n mode.add(value);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return mode;\r\n }", "@DISPID(1610743811) //= 0x60020003. The runtime will prefer the VTID if present\r\n @VTID(10)\r\n uic.prominent.ScreenLogging.wsh.FolderItems selectedItems();", "public int getMode() {\r\n List<Integer> rbtList = createArray(rbt.root);\r\n int n = rbtList.size();\r\n int max = 0;\r\n int maxCount = 0;\r\n\r\n for (int i = 0; i < n; i++) {\r\n int count = 0;\r\n for (int j = 0; j < n; j++) {\r\n if (rbtList.get(j) == rbtList.get(i)) {\r\n count++;\r\n }\r\n }\r\n if (count > maxCount) {\r\n maxCount = count;\r\n max = rbtList.get(i);\r\n }\r\n }\r\n return max;\r\n }", "public TaskStack getVisibleHwMulitWindowStackLocked(int mode) {\n return this.mTaskStackContainers.getVisibleHwMulitWindowStackLocked(mode);\n }", "private PMCGenotype[] selectParents()\n\t{\n\t\tPMCGenotype[] bestGenes = new PMCGenotype[parentsToSelect];\n\n\t\tint lowestFitnessOfSelectedIndex = 0;\n\t\tdouble lowestFitnessOfSelected = -1;\n\n\t\t// Select initial set of parents.\n\t\tbestGenes[0] = population[0];\n\t\tlowestFitnessOfSelectedIndex = 0;\n\t\tlowestFitnessOfSelected = bestGenes[0].getFitness();\n\t\tfor (int i = 1; i < this.parentsToSelect; i++)\n\t\t{\n\t\t\tbestGenes[i] = population[i];\n\n\t\t\tif (bestGenes[i].getFitness() < lowestFitnessOfSelected)\n\t\t\t{\n\t\t\t\tlowestFitnessOfSelectedIndex = i;\n\t\t\t\tlowestFitnessOfSelected = bestGenes[i].getFitness();\n\t\t\t}\n\t\t}\n\n\t\t// Select candidates with the highest fitness, replacing those with lowest fitness.\n\t\tfor (int i = parentsToSelect; i < population.length; i++)\n\t\t{\n\t\t\tPMCGenotype pmcg = population[i];\n\t\t\tif (pmcg.getFitness() > lowestFitnessOfSelected)\n\t\t\t{\n\t\t\t\tbestGenes[lowestFitnessOfSelectedIndex] = pmcg;\n\n\t\t\t\tlowestFitnessOfSelectedIndex = 0;\n\t\t\t\tlowestFitnessOfSelected = bestGenes[0].getFitness();\n\n\t\t\t\tfor (int j = 1; j < parentsToSelect; j++)\n\t\t\t\t{\n\t\t\t\t\tif (bestGenes[j].getFitness() < lowestFitnessOfSelected)\n\t\t\t\t\t{\n\t\t\t\t\t\tlowestFitnessOfSelectedIndex = j;\n\t\t\t\t\t\tlowestFitnessOfSelected = bestGenes[j].getFitness();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn bestGenes;\n\t}", "public List getTeachModes() throws ULMSSysException\r\n {\r\n return codeMaintainDAO.getTeachModes();\r\n }", "public SortedSet<Date> getSelection()\n/* */ {\n/* 179 */ return new TreeSet(this.selectedDates);\n/* */ }", "public ArrayList<ArrayList<Integer>> classify(ArrayList<Integer> selection) {\n\t\tObject[] objs = new Object[objects.size()];\n\n\t\tfor(int c = 0; c < objs.length; c++){\n\t\t\t\n\t\t\tobjs[c] = getClasses(objects.get(c),c);\n\t\t}\n\n\t\tSuperClass[] superClasses = new SuperClass[selection.size()];\n\t\t\n\t\tfor(int s = 0; s < selection.size(); s++){\n\t\t\t\n\t\t\tsuperClasses[s] = new SuperClass(objs[selection.get(s)]);\n\t\t}\n\t\t\n\t\tfor(int b = 0; b < objs.length; b++){\n\t\t\tint maxScore = Integer.MIN_VALUE;\n\t\t\tint choice = 0;\n\t\t\t//System.out.println(\"Start!!!\");\n\t\t\tfor(int r = 0; r < superClasses.length; r++){\n\t\t\t\t\n\t\t\t\tint score = superClasses[r].scoreObj(objs[b]);\n\t\t\t\t//System.out.println(score + \" \" + maxScore);\n\t\t\t\tif(score > maxScore){\n\t\t\t\t\t\n\t\t\t\t\tmaxScore = score;\n\t\t\t\t\tchoice = r;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(\"End!!!\");\n\t\t\tsuperClasses[choice].addObj(objs[b]);\n\t\t}\n\t\t\n\t\tArrayList<ArrayList<Integer>> superClassChoices = new ArrayList<ArrayList<Integer>>();\n\t\t\n\t\tfor(int s = 0; s < superClasses.length; s++){\n\t\t\t\n\t\t\tSystem.out.println(superClasses[s].getSize());\n\t\t\tsuperClassChoices.add(superClasses[s].getBackObjsNos());\n\t\t}\n\t\t\n\t\treturn superClassChoices;\n\t\t\n\t}", "public void ungroupSelectedFurniture() {\n List<HomeFurnitureGroup> movableSelectedFurnitureGroups = new ArrayList<HomeFurnitureGroup>(); \n for (Selectable item : this.home.getSelectedItems()) {\n if (item instanceof HomeFurnitureGroup) {\n HomeFurnitureGroup group = (HomeFurnitureGroup)item;\n if (isPieceOfFurnitureMovable(group)) {\n movableSelectedFurnitureGroups.add(group);\n }\n }\n } \n if (!movableSelectedFurnitureGroups.isEmpty()) {\n List<HomePieceOfFurniture> homeFurniture = this.home.getFurniture();\n final boolean oldBasePlanLocked = this.home.isBasePlanLocked();\n final boolean allLevelsSelection = this.home.isAllLevelsSelection();\n final List<Selectable> oldSelection = this.home.getSelectedItems();\n // Sort the groups in the ascending order of their index in home or their group\n Map<HomeFurnitureGroup, TreeMap<Integer, HomeFurnitureGroup>> groupsMap =\n new HashMap<HomeFurnitureGroup, TreeMap<Integer, HomeFurnitureGroup>>();\n int groupsCount = 0;\n for (HomeFurnitureGroup piece : movableSelectedFurnitureGroups) {\n HomeFurnitureGroup groupGroup = getPieceOfFurnitureGroup(piece, null, homeFurniture);\n TreeMap<Integer, HomeFurnitureGroup> sortedMap = groupsMap.get(groupGroup);\n if (sortedMap == null) {\n sortedMap = new TreeMap<Integer, HomeFurnitureGroup>();\n groupsMap.put(groupGroup, sortedMap);\n }\n if (groupGroup == null) {\n sortedMap.put(homeFurniture.indexOf(piece), piece);\n } else {\n sortedMap.put(groupGroup.getFurniture().indexOf(piece), piece);\n }\n groupsCount++;\n }\n final HomeFurnitureGroup [] groups = new HomeFurnitureGroup [groupsCount]; \n final HomeFurnitureGroup [] groupsGroups = new HomeFurnitureGroup [groups.length];\n final int [] groupsIndex = new int [groups.length];\n final Level [] groupsLevels = new Level [groups.length];\n int i = 0;\n List<HomePieceOfFurniture> ungroupedPiecesList = new ArrayList<HomePieceOfFurniture>();\n List<Integer> ungroupedPiecesIndexList = new ArrayList<Integer>();\n List<HomeFurnitureGroup> ungroupedPiecesGroupsList = new ArrayList<HomeFurnitureGroup>();\n for (Map.Entry<HomeFurnitureGroup, TreeMap<Integer, HomeFurnitureGroup>> sortedMapEntry : groupsMap.entrySet()) {\n TreeMap<Integer, HomeFurnitureGroup> sortedMap = sortedMapEntry.getValue();\n int endIndex = sortedMap.lastKey() + 1 - sortedMap.size();\n for (Map.Entry<Integer, HomeFurnitureGroup> groupEntry : sortedMap.entrySet()) {\n HomeFurnitureGroup group = groupEntry.getValue();\n groups [i] = group;\n groupsGroups [i] = sortedMapEntry.getKey();\n groupsIndex [i] = groupEntry.getKey(); \n groupsLevels [i++] = group.getLevel();\n for (HomePieceOfFurniture groupPiece : group.getFurniture()) {\n ungroupedPiecesList.add(groupPiece);\n ungroupedPiecesGroupsList.add(sortedMapEntry.getKey());\n ungroupedPiecesIndexList.add(endIndex++);\n }\n }\n } \n final HomePieceOfFurniture [] ungroupedPieces = \n ungroupedPiecesList.toArray(new HomePieceOfFurniture [ungroupedPiecesList.size()]); \n final HomeFurnitureGroup [] ungroupedPiecesGroups = \n ungroupedPiecesGroupsList.toArray(new HomeFurnitureGroup [ungroupedPiecesGroupsList.size()]); \n final int [] ungroupedPiecesIndex = new int [ungroupedPieces.length];\n final Level [] ungroupedPiecesLevels = new Level [ungroupedPieces.length];\n boolean basePlanLocked = oldBasePlanLocked;\n for (i = 0; i < ungroupedPieces.length; i++) {\n ungroupedPiecesIndex [i] = ungroupedPiecesIndexList.get(i); \n ungroupedPiecesLevels [i] = ungroupedPieces [i].getLevel();\n // Unlock base plan if the piece is a part of it\n basePlanLocked &= !isPieceOfFurniturePartOfBasePlan(ungroupedPieces [i]);\n } \n final boolean newBasePlanLocked = basePlanLocked;\n\n doUngroupFurniture(groups, ungroupedPieces, ungroupedPiecesGroups, ungroupedPiecesIndex, ungroupedPiecesLevels, newBasePlanLocked, false);\n if (this.undoSupport != null) {\n UndoableEdit undoableEdit = new AbstractUndoableEdit() {\n @Override\n public void undo() throws CannotUndoException {\n super.undo();\n doGroupFurniture(ungroupedPieces, groups, groupsGroups, groupsIndex, groupsLevels, oldBasePlanLocked, allLevelsSelection);\n home.setSelectedItems(oldSelection);\n }\n \n @Override\n public void redo() throws CannotRedoException {\n super.redo();\n doUngroupFurniture(groups, ungroupedPieces, ungroupedPiecesGroups, ungroupedPiecesIndex, ungroupedPiecesLevels, newBasePlanLocked, false);\n }\n \n @Override\n public String getPresentationName() {\n return preferences.getLocalizedString(FurnitureController.class, \"undoUngroupName\");\n }\n };\n this.undoSupport.postEdit(undoableEdit);\n }\n }\n }", "private ArrayList<int[]> selectionRoulette(int[][] chromosomes, float percentToSelect) {\n\n\t\tArrayList<int[]> selectedChromosomes = new ArrayList<int[]>();\n\n\t\t//sum up fitnesses for population\n\t\tint fitnessSum = 0;\n\t\tfor (int[] chromosome : chromosomes) {\n\t\t\tfitnessSum += getFitness(chromosome);\n\t\t}\n\n\t\t//minimization problem - invert fitness\n\t\tint invertFitnessSum = 0;\n\t\tfor (int[] chromosome : chromosomes) {\n\t\t\tinvertFitnessSum += Math.round((fitnessSum * 1.0) / getFitness(chromosome)); //small fitness values (few bins) are favored\n\t\t}\n\n\t\t//get fitnesses of chromosomes, save in array to avoid recalculating\n\t\tint[] fitnesses = new int[chromosomes.length];\n\t\tfor (int i = 0; i < chromosomes.length; i++) {\n\t\t\tfitnesses[i] = (int) Math.round((fitnessSum * 1.0) / getFitness(chromosomes[i]));\n\t\t}\n\n\t\t//spin the roulette wheel\n\t\tfor (int i = 0; i < chromosomes.length * percentToSelect; i++) {\n\t\t\tint currentFitnessTotal = 0;\n\t\t\tint fitnessCutoff = rand.nextInt(invertFitnessSum); //where the wheel stops\n\n\t\t\tfor (int j = 0; j < chromosomes.length; j++) { //go through all chromosomes to see who is selected this spin\n\t\t\t\tif (currentFitnessTotal < fitnessCutoff)\n\t\t\t\t\tcurrentFitnessTotal += fitnesses[j];\n\n\t\t\t\tif (currentFitnessTotal >= fitnessCutoff) { //if this chromosome pushed us over the edge, save it\n\t\t\t\t\tselectedChromosomes.add(chromosomes[j]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}//end roulette spinning\n\t\treturn selectedChromosomes;\n\t}", "public void getMode(){\n for (int i = 0; i < nums.length; i++){\n int a = nums[i];\n mode[a] += 1;\n }\n \n // find max of occurences\n int max = 0;\n for (int i = 0; i < mode.length; i++){\n if (max < mode[i]){\n max = mode[i];\n }\n }\n \n // find amount of numbers that are equal to max\n int maxes = 0;\n for (int i = 1; i < mode.length; i++){\n if (mode[i] == max){\n maxes += 1;\n }\n }\n \n // print out mode(s)\n System.out.print(\"Mode(s): \");\n for (int i = 0; i < mode.length; i++){\n if (mode[i] == max){\n System.out.print(i + \", \");\n }\n }\n }", "public void updateSelectionMode() {\n final int numSelected = getSelectedCount();\n if ((numSelected == 0) || mDisableCab || !isViewCreated()) {\n finishSelectionMode();\n return;\n }\n if (isInSelectionMode()) {\n updateSelectionModeView();\n } else {\n mLastSelectionModeCallback = new SelectionModeCallback();\n getActivity().startActionMode(mLastSelectionModeCallback);\n }\n }", "public boolean forceSelection();", "public int[] filterByProminence(double threshold, String mode) throws IllegalArgumentException{\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n if (mode.equals(\"upper\")) {\n for (int i=0; i<this.prominence.length; i++) {\n if (this.prominence[i] <= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else if (mode.equals(\"lower\")) {\n for (int i=0; i<this.prominence.length; i++) {\n if (this.prominence[i] >= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else {\n throw new IllegalArgumentException(\"Mode must either be lower or upper\");\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }", "public TabItem [] getSelection () {\r\n\tcheckWidget();\r\n\tint index = getSelectionIndex ();\r\n\tif (index == -1) return new TabItem [0];\r\n\treturn new TabItem [] {items [index]};\r\n}", "public FBitSet getSelection() {\r\n\t\treturn selection;\r\n\t}", "public void setSelectionStrategy(PieceSelectionStrategy selectionStrategy) {\n this.selectionStrategy = selectionStrategy;\n }", "private void __selectMode(Gamemode mode) throws IOException {\n Game game = new Game(mode);\n MainApp.setGameState(game);\n MainApp.setRoot(Views.TOPIC);\n }", "public int[] filterByPlateauSize(double threshold, String mode) throws IllegalArgumentException {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n if (mode.equals(\"upper\")) {\n for (int i=0; i<this.plateau_size.length; i++) {\n if (this.plateau_size[i] <= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else if (mode.equals(\"lower\")) {\n for (int i=0; i<this.plateau_size.length; i++) {\n if (this.plateau_size[i] >= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else {\n throw new IllegalArgumentException(\"Mode must either be lower or upper\");\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }", "public void filterOutSelection() {\n RenderContext myrc = (RenderContext) rc; if (myrc == null) return;\n Set<String> sel = myrc.filterEntities(getRTParent().getSelectedEntities());\n if (sel == null || sel.size() == 0) { getRTParent().pop(); repaint(); return; }\n Set<Bundle> new_bundles = new HashSet<Bundle>();\n if (sel != null && sel.size() > 0) {\n new_bundles.addAll(myrc.bs.bundleSet());\n Iterator<String> it = sel.iterator();\n\twhile (it.hasNext()) new_bundles.removeAll(myrc.entity_counter_context.getBundles(it.next()));\n getRTParent().setSelectedEntities(new HashSet<String>());\n\tgetRTParent().push(myrc.bs.subset(new_bundles));\n repaint();\n }\n }", "private static int select (int[] arr, int p, int n, int k){\n //threshold of 17\n if(n < 17 ){\n insertionSort(arr, p, p+n-1);\n return arr[p + n - k];\n }else{\n int q = randomizedPartition(arr,p,p+n-1);\n int left = q-p;\n int right = n - left - 1;\n if(right >= k)\n return select(arr,q+1,right,k);\n else if(right + 1 == k )\n return arr[q];\n else\n return select(arr,p,left,k-right-1);\n }\n }", "@Override\n public TraverseMode getMode() {\n return null;\n }", "@Override\n public void onDestroyActionMode(ActionMode mode) {\n mSelectionMode = null;\n if (mClosedByUser) {\n // Clear selection, only when the contextual mode is explicitly closed by the user.\n //\n // We close the contextual mode when the fragment becomes temporary invisible\n // (i.e. mIsVisible == false) too, in which case we want to keep the selection.\n onDeselectAll();\n }\n }", "boolean applicable(Selection selection);", "protected abstract LabelNode[] pickNodes(Estimate predictions, int maxPicks);", "@Override\n public Object actionProduced(Object tc) {\n Mode mode1 = (Mode) projectsOper.getQueueTool().invokeSmoothly(new QueueTool.QueueAction(\"findMode\") { // NOI18N\n\n @Override\n public Object launch() {\n return WindowManager.getDefault().findMode(projectsTc);\n }\n });\n Mode mode2 = (Mode) favoritesOper.getQueueTool().invokeSmoothly(new QueueTool.QueueAction(\"findMode\") { // NOI18N\n\n @Override\n public Object launch() {\n return WindowManager.getDefault().findMode(favoritesTc);\n }\n });\n return (mode1 == mode2 && favoritesTc.isShowing()) ? Boolean.TRUE : null;\n }", "private void determineMenuSelection(String filePath) throws IOException {\n\t\tBufferedImage currentImage = Utils.readInImage(filePath);\n\t\tArrayList<Rectangle> boxes = model.getTemplateBoxes();\n\t\tArrayList<Rectangle> used = new ArrayList<>();\n\t\tdetermineInitSelections(boxes, used, currentImage);\n\t\tfor(int i = 7; i < boxes.size(); i++) { // Start at i = 2 for initial selections\n\t\t\t\n\t\t\tif(!used.contains(boxes.get(i))) {\n\t\t\t\tboolean a = searchBlackPixels(boxes.get(i), currentImage);\n\t\t\t\tboolean b = searchBlackPixels(boxes.get(i + 5), currentImage);\n\t\t\t\tif(a) {\n\t\t\t\t\tmodel.getSelections()[i] = 'A';\n\t\t\t\t\tused.add(boxes.get(i));\n\t\t\t\t\tused.add(boxes.get(i + 5));\n\t\t\t\t} else if(b) {\n\t\t\t\t\tmodel.getSelections()[i] = 'B';\n\t\t\t\t\tused.add(boxes.get(i));\n\t\t\t\t\tused.add(boxes.get(i + 5));\n\t\t\t\t} else {\n\t\t\t\t\tmodel.getSelections()[i] = 'A';\n\t\t\t\t\tused.add(boxes.get(i));\n\t\t\t\t\tused.add(boxes.get(i + 5));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "final public int[] getSubset() {\n\t\treturn subset;\n\t}", "public Node[] getSelectedNodes() {\n return selectedNodes;\n }", "@VisibleForTesting\n protected void applyProvisionalSelection() {\n mSelection.addAll(mProvisionalSelection);\n mProvisionalSelection.clear();\n }", "public static Object[] toArray(ISelection selection) {\r\n \t\tif (!(selection instanceof IStructuredSelection)) {\r\n \t\t\treturn new Object[0];\r\n \t\t}\r\n \t\tIStructuredSelection ss= (IStructuredSelection) selection;\r\n \t\treturn ss.toArray();\r\n \t}", "public final EditorSelectionEnum getSelectionMode() {\n \t\treturn selectionMode;\n \t}", "private CharSequence[] getSelections() {\n BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();\n if (null != btAdapter) {\n int idx = 0;\n Set<BluetoothDevice> setDevices = btAdapter.getBondedDevices();\n CharSequence[] entries = new CharSequence[setDevices.size() + 1];\n entries[idx++] = NONE;\n\n for (BluetoothDevice btd : setDevices) {\n entries[idx++] = btd.getName();\n }\n\n // tell bluetooth to stop scanning. it's a power issue\n btAdapter.cancelDiscovery();\n return entries;\n }\n\n CharSequence[] entries = new CharSequence[1];\n entries[0] = NONE;\n return entries;\n }", "public static List<Double> selection(PolyPopulation pop, double cutoff) {\n\t\tint lastGenerationNum = pop.getGroupCapacity();\n\t\tList<PolyIndividual> nextGeneration = new ArrayList<>();\n\t\tList<Double> fitList = new ArrayList<>();\n\t\tList<Double> valueList = new ArrayList<>();\n\t\tList<Double> actValueList = new ArrayList<>();\n\t\tdouble max = 0.0;\n\t\tdouble totalFit = 0.0;\n\t\t//calculate the value of each individual in the population\n\t\tfor(int i = 0; i < pop.getGroupCapacity(); i++) {\n\t\t\tdouble val = f(pop.getIndis().get(i).getGenotype());\n\t\t\tvalueList.add(val);\n\t\t\t//get the Max value, use it\n\t\t\tif(i == 0) max = val;\n\t\t\telse if(val > max) max = val;\n\t\t}\n\t\t//based on the value insists now, calculate the fitness of each individual and their total fitness\n\t\tfor(int i = 0; i < pop.getGroupCapacity(); i++) {\n\t\t\tdouble fit = 1/(max - valueList.get(i) + 10);\n\t\t\tfitList.add(fit);\n\t\t\ttotalFit+=fit;\n\t\t}\n\t\t\n\t\twhile(nextGeneration.size() < lastGenerationNum*cutoff) {\t\t\t\n\t\t\tdouble selectionVal = Math.random();\n\t\t\tdouble accumulateVal = 0.0;\n\t\t\tfor(int i = 0; i < pop.getGroupCapacity(); i++) {\n\t\t\t\tif(selectionVal >= accumulateVal && selectionVal < (accumulateVal+fitList.get(i)/totalFit)) {\n\t\t\t\t\tnextGeneration.add(pop.getIndis().get(i));\n\t\t\t\t\tactValueList.add(valueList.get(i));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\taccumulateVal+=(fitList.get(i)/totalFit);\n\t\t\t}\n\t\t}\n\t\tpop.setIndis(nextGeneration);\n\t\tpop.setGroupCapacity(nextGeneration.size());\n\t\treturn actValueList;\n\t}", "void setFractionDetectionMode(BuildTool.FractionDetectionMode mode);", "public int[] filterByHeight(double threshold, String mode) throws IllegalArgumentException {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n if (mode.equals(\"upper\")) {\n for (int i=0; i<this.height.length; i++) {\n if (this.height[i] <= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else if (mode.equals(\"lower\")) {\n for (int i=0; i<this.height.length; i++) {\n if (this.height[i] >= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else {\n throw new IllegalArgumentException(\"Mode must either be lower or upper\");\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }", "public TabItem[] getSelection() {\n checkWidget();\n int index = OS.SendMessage(handle, OS.TCM_GETCURSEL, 0, 0);\n if (index == -1)\n return new TabItem[0];\n return new TabItem[] { items[index] };\n }", "public Set<String> getBenchmarkButtonsSelected() {\n return new TreeSet<>(benchmarkButtonsSelected);\n }", "@Override\n public void runOpMode() {\n int selectedstate = 0;\n //set variable selecting to true for the selecting while loop\n boolean selecting = true;\n\n askState(states.colorRed, states.colorBlue);\n if (ask(\"Default Starting Position\", \"Alternate Starting Position\")) {\n if (ask(\"First Beacon\", \"Second Beacon which has now been broken so don't run it\")) {\n askState(states.arcTowardsBeacon);\n askState(states.scanForLine);\n askState(states.driveTowardsBeacon);\n askState(states.pushBeaconButton, states.sleep0);\n askState(states.backAwayFromBeacon);\n askState(states.shootballTwoBalls, states.shootballOnce, states.noscope);\n askState(states.correctStrafe);\n askState(states.slideToTheRight);\n askState(states.scanForLine);\n askState(states.driveTowardsBeacon);\n askState(states.pushBeaconButton, states.sleep0);\n if (ask(\"Corner Vortex\", \"Center Vortex\")) {\n askState(states.pivotbeacon);\n askState(states.rotate60);\n askState(states.backup84);\n } else {\n askState(states.pivotbeacon, states.pivotbeaconless);\n askState(states.backuptovortex, states.backuptovortexIncreased, states.backuptovortexReduced);\n }\n } else {\n// askState(states.driveFoward36);\n askState(states.arcTowardsBeacon24);\n askState(states.scanForLine);\n askState(states.driveTowardsBeacon);\n askState(states.pushBeaconButton, states.sleep0);\n askState(states.backAwayFromBeacon5);\n askState(states.slideToTheLeft);\n askState(states.scanForLineInverted);\n askState(states.driveTowardsBeacon);\n askState(states.pushBeaconButton, states.sleep0);\n askState(states.backAwayFromBeacon);\n askState(states.shootballTwoBalls, states.shootballOnce, states.noscope);\n askState(states.rotate110);\n askState(states.backup30);\n }\n } else {\n askState(states.sleep0, states.sleep2000, states.sleep4000, states.sleep10000);\n askState(states.backup42);\n askState(states.shootballTwoBalls, states.shootballOnce, states.noscope);\n askState(states.sleep0, states.sleep2000, states.sleep4000, states.sleep10000);\n if (ask(\"Corner Vortex\", \"Center Vortex\")) {\n askState(states.arc2);\n askState(states.driveFoward48);\n } else {\n askState(states.rotate40);\n askState(states.backup24);\n }\n }\n\n askState(states.sleep0);\n\n if (ask(\"Ready to init?\", \"Ready to init? asked again so I don't need to make a new method\")) {\n\n }\n\n // send whole LinearOpMode object and context to robotconfig init method\n robot.init(this);\n //add telementry to report that init completed\n robotconfig.addlog(dl, \"autonomous\", \"Done with robot.init --- waiting for start in \" + this.getClass().getSimpleName());\n\n //convert list of states to be run to array for theoretical performance reasons\n runlist = list.toArray(new state[list.size()]);\n //run each state multiple times until the state increases the currentState variable by 1\n currentState = 0;\n //default current color to purple, first state will either redefine it as red or blue\n states.color = 0;\n //add telementry data to display if debug mode is active, debug mode is used to test to make sure objects are oriented correctly without having actual hardware attached\n telemetry.addData(\"Say\", \"Hello Driver - debug mode is \" + robotconfig.debugMode);\n displayStates();\n //display telementry data\n telemetry.update();\n waitForStart();\n //add log to log file\n robotconfig.addlog(dl, \"autonomous\", \"Started\");\n //loop while match is running\n while (opModeIsActive()) {\n\n robotconfig.addlog(dl, \"Mainline\", \"Beginning state machine pass \" + String.format(Locale.ENGLISH, \"%d\", currentState));\n\n //check if the currentState is more than the last index of the runlist\n if (currentState + 1 < runlist.length) {\n telemetry.addData(\"state\", runlist[currentState].name);\n telemetry.update();\n //run the state from the runlist of the currentState index\n runlist[currentState].run();\n //add log of name of state that ran for debugging\n robotconfig.addlog(dl, \"Mainline\", \"Ending state machine pass of \" + runlist[currentState].name);\n } else {\n //if completed last state, stop\n robot.move(0, 0, 0);\n //add log to tell us that the program finished all selected states before stopping\n robotconfig.addlog(dl, \"StateMachine\", \"stop requested\");\n requestOpModeStop();\n }\n\n }\n\n robot.move(0, 0, 0);\n robot.pushButton(0);\n //add log to tell us that the program stopped smoothly\n robotconfig.addlog(dl, \"autonomous\", \"Done with opmode, exited based on OpmodeIsActive false\");\n\n }", "@VisibleForTesting\n public Region calculateSystemGestureExclusion() {\n Throwable th;\n Region unhandled = Region.obtain();\n unhandled.set(0, 0, this.mDisplayFrames.mDisplayWidth, this.mDisplayFrames.mDisplayHeight);\n Rect leftEdge = this.mInsetsStateController.getSourceProvider(6).getSource().getFrame();\n Rect rightEdge = this.mInsetsStateController.getSourceProvider(7).getSource().getFrame();\n Region global = Region.obtain();\n Region touchableRegion = Region.obtain();\n Region local = Region.obtain();\n int i = this.mSystemGestureExclusionLimit;\n int[] remainingLeftRight = {i, i};\n synchronized (this.mWmService.getGlobalLock()) {\n try {\n WindowManagerService.boostPriorityForLockedSection();\n try {\n forAllWindows((Consumer<WindowState>) new Consumer(unhandled, touchableRegion, local, remainingLeftRight, global, leftEdge, rightEdge) {\n /* class com.android.server.wm.$$Lambda$DisplayContent$gsQrhBQL3vGbqvwErNuLHyt9FU4 */\n private final /* synthetic */ Region f$1;\n private final /* synthetic */ Region f$2;\n private final /* synthetic */ Region f$3;\n private final /* synthetic */ int[] f$4;\n private final /* synthetic */ Region f$5;\n private final /* synthetic */ Rect f$6;\n private final /* synthetic */ Rect f$7;\n\n {\n this.f$1 = r2;\n this.f$2 = r3;\n this.f$3 = r4;\n this.f$4 = r5;\n this.f$5 = r6;\n this.f$6 = r7;\n this.f$7 = r8;\n }\n\n @Override // java.util.function.Consumer\n public final void accept(Object obj) {\n DisplayContent.this.lambda$calculateSystemGestureExclusion$26$DisplayContent(this.f$1, this.f$2, this.f$3, this.f$4, this.f$5, this.f$6, this.f$7, (WindowState) obj);\n }\n }, true);\n WindowManagerService.resetPriorityAfterLockedSection();\n local.recycle();\n touchableRegion.recycle();\n unhandled.recycle();\n return global;\n } catch (Throwable th2) {\n th = th2;\n WindowManagerService.resetPriorityAfterLockedSection();\n throw th;\n }\n } catch (Throwable th3) {\n th = th3;\n WindowManagerService.resetPriorityAfterLockedSection();\n throw th;\n }\n }\n }", "public void showAvailableTiles(Builder selected, showTilesMode mode) {\r\n //case 1: we remove tiles that were available in a previous phase\r\n if (mode == showTilesMode.hideTiles)\r\n hideAllAdjacentTiles(selected);\r\n else // mode == showTilesMode.showTiles, case 2: we are checking every single adjacent tile around the builder\r\n showAllAdjacentTiles(selected);\r\n }", "public ArrayList<Task> getVisibleTasks() {\n ArrayList<Task> visibleTasks = new ArrayList<>();\n forAllTasks(new Consumer(visibleTasks) {\n /* class com.android.server.wm.$$Lambda$DisplayContent$TaskStackContainers$rQnI0Y8R9ptQ09cGHwbCHDiG2FY */\n private final /* synthetic */ ArrayList f$0;\n\n {\n this.f$0 = r1;\n }\n\n @Override // java.util.function.Consumer\n public final void accept(Object obj) {\n DisplayContent.TaskStackContainers.lambda$getVisibleTasks$0(this.f$0, (Task) obj);\n }\n });\n return visibleTasks;\n }", "public Map<K, Set<V>> coreGetAllSupersetsOf(Collection<?> set, int mode) {\n // Skip elements in the collection having an incorrect type, as we are looking for subsets which simply\n // cannot contain the conflicting items\n Set<V> navSet = createNavigableSet(set, true);\n Iterator<V> it = navSet.iterator();\n\n List<SetTrieNode> frontier = new ArrayList<>();\n frontier.add(superRootNode);\n\n // For every value, extend the frontier with the successor nodes for that value.\n V from = null;\n V upto = null;\n\n // Use a flag for null safety so we do not rely on the comparator to treat null as the least element\n boolean isLeastFrom = true;\n while(it.hasNext()) {\n from = upto;\n upto = it.next();\n\n List<SetTrieNode> nextNodes = new ArrayList<>();\n\n // Based on the frontier, we need to keep scanning nodes whose values is in the range [from, upto]\n // until we find the nodes whose values equals upto\n // Only these nodes then constitute the next frontier\n Collection<SetTrieNode> currentScanNodes = frontier;\n do {\n Collection<SetTrieNode> nextScanNodes = new ArrayList<>();\n for(SetTrieNode currentNode : currentScanNodes) {\n if(currentNode.nextValueToChild != null) {\n NavigableMap<V, SetTrieNode> candidateNodes = isLeastFrom\n ? currentNode.nextValueToChild.headMap(upto, true)\n : currentNode.nextValueToChild.subMap(from, true, upto, true);\n\n for(SetTrieNode candidateNode : candidateNodes.values()) {\n if(Objects.equals(candidateNode.value, upto)) {\n nextNodes.add(candidateNode);\n } else {\n nextScanNodes.add(candidateNode);\n }\n }\n }\n }\n currentScanNodes = nextScanNodes;\n } while(!currentScanNodes.isEmpty());\n\n frontier = nextNodes;\n\n isLeastFrom = false;\n }\n\n Map<K, Set<V>> result = new HashMap<>();\n\n // Copy all data entries associated with the frontier to the result\n Stream<SetTrie<K, V>.SetTrieNode> stream = frontier.stream();\n\n if(mode != 0) {\n stream = stream.flatMap(node -> reachableNodesAcyclic(\n node,\n x -> (x.nextValueToChild != null ? x.nextValueToChild.values() : Collections.<SetTrieNode>emptySet()).stream()));\n }\n\n stream.forEach(currentNode -> {\n if(currentNode.keyToSet != null) {\n for(Entry<K, NavigableSet<V>> e : currentNode.keyToSet.entrySet()) {\n result.put(e.getKey(), e.getValue());\n }\n }\n });\n\n return result;\n }", "public int[] getSelectionBounds() {\r\n if(selectionBounds == null){\r\n return new int[]{};\r\n }\r\n return selectionBounds;\r\n }", "@Override\r\n protected ObservableList<TreeItem> getSelectedItems() {\r\n return getSelectionModel().getSelectedItems();\r\n }", "public Set<T> getSelectedItems() {\n return selectedEntities == null ? Collections.<T>emptySet() : selectedEntities;\n }", "private static ArrayList<Result> pruneResults(ArrayList<Result> pruneThis, int limit){\n\t\tArrayList<Result> sortednodups = sortByScore(pruneThis);\n\t\tArrayList<Result> pruned = new ArrayList<Result>();\n\t\tfor (int i = 0; i<limit && i < pruneThis.size(); i++){\n\t\t\tpruned.add(sortednodups.get(i));\n\t\t}\n\t\treturn pruned; \n\t}", "public static boolean[] solution_used(int[][] dp_array,int objects,int capacity){\r\n\r\n boolean[] opt_set = new boolean[objects+1]; // to store solutions\r\n int Items = 0;\r\n int i = dp_array.length-1;\r\n for (int j = dp_array[0].length - 1; j >= 0 && i > 0;i--) {\r\n if (dp_array[i][j] != dp_array[i-1][j]) { // trace back algorithm\r\n opt_set[i-1] = true ; // set the array value true if the values are used\r\n j -= randvariables[i-1];\r\n Items++;\r\n }\r\n }\r\n return Arrays.copyOfRange(opt_set, 0, objects); //return the items\r\n }", "public TaskGroup getSelectedTaskParent()\n {\n boolean first = true;\n TaskGroup allParent = null;\n\n // Examine the parent task group for each selected undertaking\n Iterator<AUndertaking> taskIt = getSelectedTaskIterator();\n\n while (taskIt.hasNext()) {\n AUndertaking item = taskIt.next();\n\n TaskGroup parentOfItem = item.getTaskGroup();\n\n // If the selected item represents a top-level undertaking,\n // then null is the only possible response.\n if (parentOfItem == null) {\n return null;\n }\n\n // Remember first parent to compare against the remaining ones\n if (first) {\n first = false;\n allParent = parentOfItem;\n }\n else if (parentOfItem != allParent) {\n // If a subsequent parent is different from the remembered one,\n // return null\n return null;\n }\n }\n\n // If there is no selected undertaking, return null\n if (allParent == null) {\n return null;\n }\n\n // Otherwise, return the shared parent task group\n return allParent;\n }", "private CharSequence[] getSelections() {\n\n // Allocate a new arraylist to hold the names\n ArrayList<CharSequence> entries = new ArrayList<>();\n entries.add(NONE);\n\n // fetch the bt interface adapter\n BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();\n if (null != btAdapter) {\n\n // Fetch collection of bluetooth devices\n Set<BluetoothDevice> setDevices = btAdapter.getBondedDevices();\n\n // For each device we found, get the name. It's possible for the getName()\n // to fail and return a null\n for (BluetoothDevice btd : setDevices) {\n String btName = btd.getName();\n if(null != btName) {\n entries.add(btName);\n }\n }\n\n // tell bluetooth to stop scanning. it's a power issue\n btAdapter.cancelDiscovery();\n }\n\n // Return with an array of what we just built\n return entries.toArray(new CharSequence[0]);\n }", "private void rouletteSelection() {\n parentChromosomes = new Chromosome[2];\n parentIndices = new int[2];\n Arrays.fill(parentChromosomes, null);\n parentIndices[0] = getFittestChromosomeIndex();\n parentChromosomes[0] = chromosomes[parentIndices[0]];\n parentIndices[1] = getFittestChromosomeIndex();\n parentChromosomes[1] = chromosomes[parentIndices[1]];\n System.out.println(\"Individuals selected from Roulette Wheel for crossover: \\n\" +\n Arrays.toString(parentChromosomes[0].getGenes()) + \"\\n\" +\n Arrays.toString(parentChromosomes[1].getGenes()));\n }", "private void toggleSelectedAlgorithm(int index) {\n if (selected[index] == true) {\n selected[index] = false;\n } else {\n selected[index] = true;\n }\n }", "private ElementSelection getSelectedElements()\n {\n final int[] rowViewIndexes = this.getSelectedRows();\n final NetPlan np = callback.getDesign();\n\n final List<NetworkElement> elementList = new ArrayList<>();\n final List<Pair<Demand, Link>> frList = new ArrayList<>();\n\n if (rowViewIndexes.length != 0)\n {\n final int maxValidRowIndex = model.getRowCount() - 1 - (hasAggregationRow() ? 1 : 0);\n final List<Integer> validRows = new ArrayList<Integer>();\n for (int a : rowViewIndexes) if ((a >= 0) && (a <= maxValidRowIndex)) validRows.add(a);\n\n if (networkElementType == NetworkElementType.FORWARDING_RULE)\n {\n for (int rowViewIndex : validRows)\n {\n final int viewRowIndex = this.convertRowIndexToModel(rowViewIndex);\n final String demandInfo = (String) getModel().getValueAt(viewRowIndex, AdvancedJTable_forwardingRule.COLUMN_DEMAND);\n final String linkInfo = (String) getModel().getValueAt(viewRowIndex, AdvancedJTable_forwardingRule.COLUMN_OUTGOINGLINK);\n final int demandIndex = Integer.parseInt(demandInfo.substring(0, demandInfo.indexOf(\"(\")).trim());\n final int linkIndex = Integer.parseInt(linkInfo.substring(0, linkInfo.indexOf(\"(\")).trim());\n frList.add(Pair.of(np.getDemand(demandIndex), np.getLink(linkIndex)));\n }\n } else\n {\n for (int rowViewIndex : validRows)\n {\n final int viewRowIndex = this.convertRowIndexToModel(rowViewIndex);\n final long id = (long) getModel().getValueAt(viewRowIndex, 0);\n elementList.add(np.getNetworkElement(id));\n }\n }\n }\n\n // Parse into ElementSelection\n final Pair<List<NetworkElement>, List<Pair<Demand, Link>>> selection = Pair.of(elementList, frList);\n final boolean nothingSelected = selection.getFirst().isEmpty() && selection.getSecond().isEmpty();\n\n // Checking for selection type\n final ElementSelection elementHolder;\n\n if (!nothingSelected)\n {\n if (!selection.getFirst().isEmpty())\n elementHolder = new ElementSelection(NetworkElementType.getType(selection.getFirst()), selection.getFirst());\n else if (!selection.getSecond().isEmpty())\n elementHolder = new ElementSelection(selection.getSecond());\n else elementHolder = new ElementSelection();\n } else\n {\n elementHolder = new ElementSelection();\n }\n\n return elementHolder;\n }", "public static Collection<FailoverMode> values() {\n return values(FailoverMode.class);\n }", "public int[] filterByWidth(double threshold, String mode) throws IllegalArgumentException {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n if (mode.equals(\"upper\")) {\n for (int i=0; i<this.width.length; i++) {\n if (this.width[i] <= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else if (mode.equals(\"lower\")) {\n for (int i=0; i<this.width.length; i++) {\n if (this.width[i] >= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else {\n throw new IllegalArgumentException(\"Mode must either be lower or upper\");\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }", "public myC45PruneableClassifierTree(ModelSelection toSelectLocModel,\n boolean pruneTree,float cf,\n boolean raiseTree,\n boolean cleanup)\n throws Exception {\n\n super(toSelectLocModel);\n\n m_pruneTheTree = pruneTree;\n m_CF = cf;\n m_subtreeRaising = raiseTree;\n m_cleanup = cleanup;\n }", "public void setSelections(Set<Filterable> selections);", "public final AntlrDatatypeRuleToken ruleInModesKeywords() throws RecognitionException {\n AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();\n\n Token kw=null;\n\n\n \tenterRule();\n\n try {\n // InternalSafetyParser.g:11600:2: ( (kw= In kw= Modes ) )\n // InternalSafetyParser.g:11601:2: (kw= In kw= Modes )\n {\n // InternalSafetyParser.g:11601:2: (kw= In kw= Modes )\n // InternalSafetyParser.g:11602:3: kw= In kw= Modes\n {\n kw=(Token)match(input,In,FollowSets000.FOLLOW_117); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\tcurrent.merge(kw);\n \t\t\tnewLeafNode(kw, grammarAccess.getInModesKeywordsAccess().getInKeyword_0());\n \t\t\n }\n kw=(Token)match(input,Modes,FollowSets000.FOLLOW_2); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\tcurrent.merge(kw);\n \t\t\tnewLeafNode(kw, grammarAccess.getInModesKeywordsAccess().getModesKeyword_1());\n \t\t\n }\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n\n \tleaveRule();\n\n }\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }", "private void tournament_selection() {\r\n\r\n individual[] temp_pop = new individual[this.pop_size];\r\n\r\n for (int i = 0; i < this.pop_size; i++) {\r\n\r\n // pick 2 random ints to for indices of parents\r\n int parent1 = new Random().nextInt(this.pop_size);\r\n int parent2 = new Random().nextInt(this.pop_size);\r\n\r\n individual p1 = new individual(main_population.getPopulation()[parent1].getGenes(), solutions, output);\r\n individual p2 = new individual(main_population.getPopulation()[parent2].getGenes(), solutions, output);\r\n\r\n if (p1.getFitness() >= p2.getFitness()) {\r\n temp_pop[i] = p1;\r\n } else {\r\n temp_pop[i] = p2;\r\n }\r\n }\r\n this.main_population.setPopulation(temp_pop);\r\n this.main_population.update_population();\r\n }", "@Model\n public Collection<String> choices3Act(\n final ApplicationPermissionRule rule,\n final ApplicationPermissionMode mode,\n final String packageFqn) {\n return applicationFeatureRepository.classNamesContainedIn(packageFqn, ApplicationMemberType.PROPERTY);\n }", "private static Boolean contains(int[] modes, int mode) {\n if (modes == null) {\n return false;\n\n }\n for (int i : modes) {\n if (i == mode) {\n return true;\n }\n }\n return false;\n }", "public Map<String, ArrayList<Integer>> modes() {\n return this.modes;\n }", "private Set<Integer> filterSelectionUnit() {\n singlefilter = false;\n Map<Integer, Integer> dsCounter = new HashMap<>();\n int counter = 0;\n for (DatasetPieChartFilter filter : filtersSet.values()) {\n if (filter.isActiveFilter()) {\n counter++;\n }\n\n filter.getSelectedDsIds().stream().map((id) -> {\n if (!dsCounter.containsKey(id)) {\n dsCounter.put(id, 0);\n }\n return id;\n }).forEach((id) -> {\n dsCounter.put(id, dsCounter.get(id) + 1);\n });\n\n }\n Set<Integer> finalSelectionIds = new HashSet<>();\n dsCounter.keySet().stream().filter((dsId) -> (dsCounter.get(dsId) == 6)).forEach((dsId) -> {\n finalSelectionIds.add(dsId);\n });\n if (counter == 1) {\n singlefilter = true;\n }\n\n return finalSelectionIds;\n\n }", "private ArrayList<Groepen> mogelijkeGroepen(Spelers spelers, int groepen, int[] grootte, int byes, int nobyesmask) {\r\n\r\n\t\tArrayList<Groepen> result = new ArrayList<>();\r\n\t\tint max = (int) Math.pow(2, groepen);\r\n\t\tint mask = max - 1 - nobyesmask;\r\n\t\tfor (int i = 0; i < max; i++) {\r\n\t\t\tint j = i & mask; \r\n\t\t\tint aantalbyes = Integer.bitCount(reversebits(j));\r\n\t\t\tif (aantalbyes == byes) {\r\n\t\t\t\tGroepen maakGroepen = maakGroepen(spelers, groepen, grootte, j);\r\n\t\t\t\tresult.add(maakGroepen);\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public Lista modes() {\n Lista modes = new Lista();\n int currentCounter = 1;\n int repeated = this.repeated();\n for (int i = 0; i < this.size() - 1; i++) {\n if(this.getListaAt(i).x == this.getListaAt(i + 1).x) {\n currentCounter += 1;\n }\n else {\n if (currentCounter == repeated) {\n modes.add(this.getListaAt(i).x);\n }\n currentCounter = 1;\n }\n }\n return modes;\n }", "@Test\n @WithMockUhUser(username = \"iamtst06\")\n public void optOutTest() throws Exception {\n assertTrue(isInCompositeGrouping(GROUPING, tst[0], tst[5]));\n assertTrue(isInBasisGroup(GROUPING, tst[0], tst[5]));\n\n //tst[5] opts out of Grouping\n mapGSRs(API_BASE + GROUPING + \"/optOut\");\n }", "@NonNull\n public SparseBooleanArray getSelectedItems() {\n return selectedItems;\n }", "public Set<Configuration> getSelected() {\n\t\treturn selected;\n\t}", "private static Thread pruneThread(Thread base, Thread prune)\r\n/* 71: */ {\r\n/* 72:84 */ if (prune.isEmpty()) {\r\n/* 73:84 */ return prune;\r\n/* 74: */ }\r\n/* 75:85 */ if (base.equals(prune)) {\r\n/* 76:86 */ return new Thread(prune);\r\n/* 77: */ }\r\n/* 78:88 */ if (base.contains(prune.get(prune.size() - 1))) {\r\n/* 79:89 */ return new Thread(prune);\r\n/* 80: */ }\r\n/* 81:91 */ Thread pruned = new Thread(prune);\r\n/* 82:92 */ pruned.remove(prune.get(prune.size() - 1));\r\n/* 83:93 */ return pruned;\r\n/* 84: */ }", "@Override\n\t\tprotected NonMatchingResult processSelection(\n\t\t\tTableEntitySelection selection,\n\t\t\tSession session)\n\t\t{\n\t\t\tIterator<HierarchyNode> hierarchyNodeIter = ((HierarchyEntitySelection) selection)\n\t\t\t\t.getSelectedHierarchyNodes();\n\t\t\tHierarchyNode nonMatchingHierarchyNode = null;\n\t\t\twhile (nonMatchingHierarchyNode == null && hierarchyNodeIter.hasNext())\n\t\t\t{\n\t\t\t\tHierarchyNode hierarchyNode = hierarchyNodeIter.next();\n\t\t\t\tif (!matchHierarchyNode(hierarchyNode, session))\n\t\t\t\t{\n\t\t\t\t\tnonMatchingHierarchyNode = hierarchyNode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (nonMatchingHierarchyNode == null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new NonMatchingResult(nonMatchingHierarchyNode, useJoinRecord);\n\t\t}" ]
[ "0.46359086", "0.45801076", "0.44857875", "0.44187838", "0.44014242", "0.43974626", "0.4344802", "0.4292947", "0.42856115", "0.42816338", "0.42539874", "0.42338514", "0.42240843", "0.4211907", "0.41973475", "0.41826525", "0.41604033", "0.4144987", "0.4138897", "0.4122238", "0.4117959", "0.41038498", "0.4092652", "0.40889317", "0.40869078", "0.40672377", "0.40653092", "0.4040789", "0.40177912", "0.40099314", "0.40096104", "0.40023008", "0.39947233", "0.3991061", "0.39691263", "0.39583394", "0.39506018", "0.39401466", "0.39243838", "0.3917484", "0.39044812", "0.38868064", "0.38761693", "0.3872398", "0.38709554", "0.38691333", "0.38595465", "0.3856196", "0.3845568", "0.3845235", "0.3835655", "0.38349876", "0.38138783", "0.3789045", "0.378626", "0.37803915", "0.37779877", "0.37656975", "0.3759984", "0.37598708", "0.3759527", "0.37528902", "0.37485942", "0.37467778", "0.37428695", "0.37413478", "0.37379968", "0.3734556", "0.3733735", "0.37300763", "0.372977", "0.37275797", "0.37251878", "0.37167355", "0.3713676", "0.37132862", "0.3706825", "0.3702836", "0.37018654", "0.37017915", "0.36992753", "0.36974907", "0.36960387", "0.36835247", "0.3676324", "0.36732677", "0.36724856", "0.3666811", "0.3665425", "0.36526227", "0.3639825", "0.36354434", "0.36345884", "0.36307243", "0.36286148", "0.36275727", "0.36195993", "0.36185178", "0.3617623", "0.3601971" ]
0.66115916
0
Returns the single selected task. If zero tasks or more than one task is selected, then IllegalStateException is thrown.
public AUndertaking getSelectedTask() { String errorMsg; Iterator<AUndertaking> taskIt = getSelectedTaskIterator(); if (taskIt.hasNext()) { AUndertaking selectedTask = taskIt.next(); if (! taskIt.hasNext()) { return selectedTask; } errorMsg = "Selection is multiple"; } else { errorMsg = "Nothing is selected"; } throw new IllegalStateException(errorMsg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Task getClickedTask(int position) {\r\n\t\treturn taskList.get(position);\r\n\t}", "protected abstract Optional<T> getSingleSelection();", "private String getSelectionTask() {\n String selection = \"\";\n\n if (mTypeTask.equals(TaskContract.TypeTask.Expired)) {\n selection = TaskEntry.COLUMN_TARGET_DATE_TIME + \"<?\";\n } else if(mTypeTask.equals(TaskContract.TypeTask.Today)) {\n selection = TaskEntry.COLUMN_TARGET_DATE_TIME + \"=?\";\n } else if(mTypeTask.equals(TaskContract.TypeTask.Future)) {\n selection = TaskEntry.COLUMN_TARGET_DATE_TIME + \">?\";\n }\n\n return selection;\n }", "public Task getTask(int index)\n {\n return tasks.get(index);\n }", "public Task get(int index){\n return tasks.get(index);\n }", "public Optional<PickingRequest> getTask() {\n return Optional.ofNullable(task);\n }", "public Task getTask(String stateName) throws ProcessManagerException {\r\n Task[] tasks = getTasks();\r\n for (int i = 0; i < tasks.length; i++) {\r\n if (tasks[i].getState().getName().equals(stateName)) {\r\n return tasks[i];\r\n }\r\n }\r\n return null;\r\n }", "public Task get(int taskIndex) {\n return tasks.get(taskIndex);\n }", "public Task get(int taskIndex) {\n return tasks.get(taskIndex);\n }", "public Task getTask(int index) {\n return taskList.get(index - 1);\n }", "public TaskDetails getSpecificTask (int position){\n return taskList.get(position);\n }", "private Task getTask(Integer identifier) {\n Iterator<Task> iterator = tasks.iterator();\n while (iterator.hasNext()) {\n Task nextTask = iterator.next();\n if (nextTask.getIdentifier().equals(identifier)) {\n return nextTask;\n }\n }\n\n return null;\n }", "public Task getTask(int taskNumber) {\n assert taskNumber <= getNumTasks() && taskNumber > 0 : \"Task number should be valid\";\n return tasks.get(taskNumber - 1);\n }", "public static Task getCurrentTask(Fiber paramFiber)\n/* 194 */ throws Pausable { return null; }", "public Task getTask(Integer tid);", "private Task taskAt(int p_index)\n {\n return (Task)m_taskVector.elementAt(p_index);\n }", "public E getSelected() {\n ButtonModel selection = selectedModelRef.get();\n //noinspection UseOfSystemOutOrSystemErr\n final String actionCommand = selection.getActionCommand();\n //noinspection HardCodedStringLiteral,UseOfSystemOutOrSystemErr\n return Objects.requireNonNull(textMap.get(actionCommand));\n }", "public Task getTask(int i) {\n return this.tasks.get(i);\n }", "public Task getTaskById(int id) {\n\t\t\n\t\tfor(Task task: tasks) {\n\t\t\tif(task.getId()==id)\n\t\t\t\treturn task;\n\t\t}\n\t\t\t\n\t\tthrow new NoSuchElementException(\"Invalid Id:\"+id);\n\t}", "@VisibleForTesting(otherwise = VisibleForTesting.NONE)\r\n LiveData<Task> getActiveTask();", "public String getSelectedIdentifier () {\n if (SwingUtilities.isEventDispatchThread()) {\n return getSelectedIdentifier_();\n } else {\n final String[] si = new String[1];\n try {\n SwingUtilities.invokeAndWait(new Runnable() {\n public void run() {\n si[0] = getSelectedIdentifier_();\n }\n });\n } catch (InvocationTargetException ex) {\n ErrorManager.getDefault().notify(ex.getTargetException());\n } catch (InterruptedException ex) {\n // interrupted, ignored.\n }\n return si[0];\n }\n }", "public Task task()\n {\n return _link.first;\n }", "@Override\r\n\tpublic Optional<Task> findTask(Integer taskId) {\n\t\treturn taskRepository.findById(taskId);\r\n\t}", "String getTaskId(int index);", "public Task getTask() {\n Long __key = this.TaskId;\n if (task__resolvedKey == null || !task__resolvedKey.equals(__key)) {\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n TaskDao targetDao = daoSession.getTaskDao();\n Task taskNew = targetDao.load(__key);\n synchronized (this) {\n task = taskNew;\n \ttask__resolvedKey = __key;\n }\n }\n return task;\n }", "public Coordinate getChoice () throws Exception{\n\n\t\treturn queue.dequeue();\n\t}", "public T getSelectedItem() {\n\t\tT selectedItem = null;\n\t\tint position = spinner.getSelectedItemPosition();\n\t\tif(position >= 0) {\n\t\t\tselectedItem = adapter.getItem(position);\n\t\t}\n\t\treturn selectedItem;\n\t}", "private synchronized Task taskGet() {\n\t\treturn this.taskList.remove();\n\t}", "public R getSingleSelection()\r\n {\r\n final ListSelectionModel lsm = jTable.getSelectionModel();\r\n if( lsm.isSelectionEmpty() == false )\r\n {\r\n final int row = lsm.getLeadSelectionIndex(); // or use .getJTable().getSelectedRow() for single or lsm.isSelectedIndex() for multiple selection\r\n if( row != Util.INVALID_INDEX )\r\n {\r\n final int xlatedRow = jTable.convertRowIndexToModel( row ); // has to be done with auto-sorter\r\n return provideRow( xlatedRow );\r\n }\r\n }\r\n\r\n return null;\r\n }", "public Task getNext()\n {\n\treturn new Task(toDo.get(0));\n }", "public T getSelection() {\n ButtonModel selected = buttonGroup.getSelection();\n if (selected == null) {\n return null;\n }\n T key = modelToKeyMap.get(selected);\n if (key == null) {\n throw new IllegalArgumentException(\"Key not found for selected radio button: \" + selected);\n }\n return (key != NULL ? key : null);\n }", "private Task getFirstTestTask() {\n Task task = new Task();\n task.setName(\"Buy Milk\");\n task.setCalendarDateTime(TODAY);\n task.addTag(\"personal\");\n task.setCompleted();\n return task;\n }", "public static Tasks get(int index) {\n return tasks.get(index);\n }", "final Runnable popTask() {\n int s = sp;\n while (s != base) {\n if (tryActivate()) {\n Runnable[] q = queue;\n int mask = q.length - 1;\n int i = (s - 1) & mask;\n Runnable t = q[i];\n if (t == null || !casSlotNull(q, i, t))\n break;\n storeSp(s - 1);\n return t;\n }\n }\n return null;\n }", "Object getTaskId();", "private synchronized Task takeTask() {\n while (true) {\n Task task = null;\n if (runningActions < maxConcurrentActions) {\n task = runnableActions.poll();\n }\n if (task == null) {\n task = runnableTasks.poll();\n }\n\n if (task != null) {\n runningTasks++;\n if (task.isAction()) {\n runningActions++;\n }\n return task;\n }\n\n if (isExhausted()) {\n return null;\n }\n\n try {\n wait();\n } catch (InterruptedException e) {\n throw new AssertionError();\n }\n }\n }", "public Task getTask(final int id) {\n return tasks.get(id);\n }", "public TaskGroup getSelectedTaskParent()\n {\n boolean first = true;\n TaskGroup allParent = null;\n\n // Examine the parent task group for each selected undertaking\n Iterator<AUndertaking> taskIt = getSelectedTaskIterator();\n\n while (taskIt.hasNext()) {\n AUndertaking item = taskIt.next();\n\n TaskGroup parentOfItem = item.getTaskGroup();\n\n // If the selected item represents a top-level undertaking,\n // then null is the only possible response.\n if (parentOfItem == null) {\n return null;\n }\n\n // Remember first parent to compare against the remaining ones\n if (first) {\n first = false;\n allParent = parentOfItem;\n }\n else if (parentOfItem != allParent) {\n // If a subsequent parent is different from the remembered one,\n // return null\n return null;\n }\n }\n\n // If there is no selected undertaking, return null\n if (allParent == null) {\n return null;\n }\n\n // Otherwise, return the shared parent task group\n return allParent;\n }", "public Task getTask(int index) {\n return records.get(index);\n }", "@Override\n\tpublic V get() {\n\t\tV result = null;\n\t\ttry {\n\t\t\tresult = fTask.get();\n\t\t} catch (InterruptedException | ExecutionException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "private IssuePost getSingleSelectedRow() {\n ListSelectionModel selectionModel = table.getSelectionModel();\n int selectedIndex = selectionModel.getLeadSelectionIndex();\n if (selectedIndex != NOT_SELECTED) {\n return table.getRowData(selectedIndex);\n }\n return null;\n }", "protected Task getTaskNamed(String name) throws InvalidKeyException {\n return task.getTaskNamed(name);\n }", "Task selectByPrimaryKey(String taskid);", "public Task getTask(String analysis) {\n\t\tfor (int i = 0; i < tasks.size(); i++) {\n\t\t\tif (tasks.get(i).getAnalysis().toString().equals(analysis))\n\t\t\t\treturn tasks.get(i);\n\t\t}\n\t\treturn null;\n\t}", "public ServiceSubTask getNextOpenSubTask() {\n\t\tServiceSubTask openTask = null;\n\t\tfor (ServiceSubTask subTask : getSubTasks().values()) {\n\t\t\tif (subTask.getStatus().equals(ServiceSubTaskStatus.WAITING)\n\t\t\t\t\t&& (openTask == null || subTask.getPosition() < openTask.getPosition()))\n\t\t\t\topenTask = subTask;\n\t\t\telse if (subTask.getStatus().equals(ServiceSubTaskStatus.OPEN))\n\t\t\t\treturn subTask;\n\t\t}\n\t\treturn openTask;\n\t}", "public abstract SystemTask getTask(Project project);", "public Task getTask(String taskId) throws DaoException, DataObjectNotFoundException\r\n {\n dao = (TaskManagerDao) getDao();\r\n Task task = dao.selectTask(taskId);\r\n ResourceManager rm = (ResourceManager)Application.getInstance().getModule(ResourceManager.class);\r\n if(task!=null) {\r\n //Task task = (Task)col.iterator().next();\r\n //task.setLastModifiedBy(UserUtil.getUser(task.getLastModifiedBy()).getName());\r\n task.setAttendees(getAssignees(taskId));\r\n task.setReassignments(dao.selectReassignments(taskId));\r\n task.setResources(rm.getBookedResources(task.getId(),CalendarModule.DEFAULT_INSTANCE_ID));\r\n return task;\r\n }\r\n return null;\r\n }", "int getTask() {\n return task;\n }", "@Nullable\n public T getSelectedItem() {\n return SerDes.unmirror(getElement().getSelectedItem(), getItemClass());\n }", "public int getSelected() {\n \t\treturn selected;\n \t}", "protected File getFreeTask() {\n for (File task : tasks) {\n boolean isFree = true;\n for (EvaluatorHandle handle : evaluations) {\n if (handle.getTask() == task) {\n isFree = false;\n break;\n }\n }\n if (isFree) {\n return task;\n }\n }\n return null;\n }", "@Override\n public Optional<Task> getTaskById(UUID id)\n {\n return null;\n }", "public String getSelectedItem() {\n if (selectedPosition != -1) {\n Toast.makeText(activity, \"Selected Item : \" + list.get(selectedPosition), Toast.LENGTH_SHORT).show();\n return list.get(selectedPosition);\n }\n return \"\";\n }", "final Runnable peekTask() {\n Runnable[] q = queue;\n if (q == null)\n return null;\n int mask = q.length - 1;\n int i = base;\n return q[i & mask];\n }", "protected ThreadState pickNextThread() {\n Lib.assertTrue(Machine.interrupt().disabled());\n if (threadStates.isEmpty())\n return null;\n\n return threadStates.last();\n }", "public static ITask findTaskById(final long taskId) {\r\n try {\r\n return SecurityManagerFactory.getSecurityManager().executeAsSystem(new Callable<ITask>() {\r\n public ITask call() throws Exception {\r\n ITask t = null;\r\n try {\r\n TaskQuery query = TaskQuery.create().where().taskId().isEqual(taskId);\r\n t = Ivy.wf().getGlobalContext().getTaskQueryExecutor().getResults(query).get(0);\r\n } catch (Exception e) {\r\n Ivy.log().error(e);\r\n }\r\n return t;\r\n }\r\n });\r\n } catch (Exception e) {\r\n Ivy.log().error(e);\r\n return null;\r\n }\r\n }", "public int getCustTask()\n\t{\n\t\treturn task;\n\t}", "String getTaskId();", "public String getTask() {\n return task;\n }", "public String getTask() {\n return task;\n }", "public ITask getTask() {\n \t\treturn task;\n \t}", "public LiveData<Recipe> getSelected() {\n return repository.get(selectedId);\n }", "public Task getNextTask(final String pername) {\n for (int i = 0; i < size; i++) {\n if (taskarr[i].getassignedTo().equals(pername)) {\n if (taskarr[i].getStatus().equals(\"todo\")\n && taskarr[i].getImportant().equals(\"Important\")\n && taskarr[i].getUrgent().equals(\"Not Urgent\")) {\n return taskarr[i];\n }\n }\n }\n return null;\n }", "public boolean getSelected()\n {\n return selected; \n }", "@Nullable\n public Task getTask(int id) {\n Task output = null;\n\n // get a readable instance of the database\n SQLiteDatabase db = getReadableDatabase();\n if (db == null) return null;\n\n // run the query to get the matching task\n Cursor rawTask = db.rawQuery(\"SELECT * FROM Tasks WHERE id = ? ORDER BY due_date ASC;\", new String[]{String.valueOf(id)});\n\n // move the cursor to the first result, if one exists\n if (rawTask.moveToFirst()) {\n // convert the cursor to a task and assign it to our output\n output = new Task(rawTask);\n }\n\n // we're done with the cursor and database, so we can close them here\n rawTask.close();\n db.close();\n\n // return the (possibly null) output\n return output;\n }", "public int indexOf(Task t) {\r\n return tasks.indexOf(t);\r\n }", "public Task getTask() {\n return task;\n }", "public Piece firstSelected()\n {\n return firstSelected;\n }", "public Task getTask() { return task; }", "@Override\r\n protected TreeItem getSelectedItem() {\r\n return getSelectionModel().getSelectedItem();\r\n }", "public String getTask(int position) {\n HashMap<String, String> map = list.get(position);\n return map.get(TASK_COLUMN);\n }", "public String getTaskId(int index) {\n return taskId_.get(index);\n }", "Callable<E> getTask();", "@Nullable String pickItem();", "public int getTaskId() {\n return taskId;\n }", "public String getTaskId(int index) {\n return taskId_.get(index);\n }", "public static int getLatestTaskId() {\n\n int id = 0;\n try {\n List<Task> list = Task.listAll(Task.class);\n int size = list.size();\n Task task = list.get(size - 1);\n id = task.getTaskId();\n\n } catch (Exception e) {\n id=0;\n }\n return id;\n\n }", "public void updateTask() {\r\n int selected = list.getSelectedIndex();\r\n if (selected >= 0) {\r\n Task task = myTodo.getTaskByIndex(selected + 1);\r\n todoTaskGui(\"Update\", task);\r\n }\r\n }", "private Runnable getTask() {\r\n if (mType== Type.FIFO){\r\n return mTaskQueue.removeFirst();\r\n }else if (mType== Type.LIFO){\r\n return mTaskQueue.removeLast();\r\n }\r\n return null;\r\n }", "public Axiom getSelected() {\r\n\treturn view.getSelected();\r\n }", "public int getSelection() {\n \tcheckWidget();\n \treturn selection;\n }", "ITaskView getTaskView();", "public Integer getTaskId() {\n return taskId;\n }", "public Integer getTaskId() {\n return taskId;\n }", "@Override\n public void onTaskSelected(String taskId) {\n }", "public static ITask findWorkOnTaskById(long taskId) {\r\n Ivy ivy = Ivy.getInstance();\r\n IPropertyFilter<TaskProperty> taskFilter =\r\n ivy.session.getWorkflowContext().createTaskPropertyFilter(TaskProperty.ID, RelationalOperator.EQUAL, taskId);\r\n IQueryResult<ITask> queryResult =\r\n ivy.session.findWorkTasks(taskFilter, null, 0, 1, true,\r\n EnumSet.of(TaskState.SUSPENDED, TaskState.RESUMED, TaskState.PARKED));\r\n List<ITask> tasks = queryResult.getResultList();\r\n if (tasks != null && tasks.size() > 0) {\r\n return tasks.get(0);\r\n }\r\n return null;\r\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent actionevent) {\n\t\t\t\tif (select.isSelected()) {\r\n\t\t\t\t\tservice.selectTask(row);\r\n\t\t\t\t\t// service.getTask(row).setSelected(true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tservice.cancleTask(row);\r\n\t\t\t\t\t// service.getTask(row).setSelected(false);\r\n\t\t\t\t}\r\n\t\t\t\t// System.out.println(\"after: \" + service.getSelectedSet());\r\n\r\n\t\t\t}", "public void nextTask()\n {\n Task next = null;\n \n if (!pq.isEmpty()) next = pq.remove();\n \n if (next == null)\n {\n System.out.println(\"There are no tasks in the list.\");\n }\n else\n {\n //System.out.println(pq.peek());\n System.out.println(next.getDescription());\n }\n }", "public static IProject getSelectedProject() {\n\t\tIProject activeProject = null;\n\t\tIWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();\n\t\tISelectionService selectionService = window.getSelectionService();\n\t\tISelection selection = selectionService.getSelection(IPageLayout.ID_PROJECT_EXPLORER);\n\t\tif (selection instanceof StructuredSelection) {\n\t\t\tIResource resource = (IResource) ((StructuredSelection) selection).getFirstElement();\n\t\t\tactiveProject = resource.getProject();\n\t\t}\n\t\t\n\t\treturn activeProject;\n\t}", "public String getSelected()\n\t{\n\t\treturn _current.ID;\n\t}", "public T getSelectedOption() {\n return selectedIndex == -1 ? null : options.get(selectedIndex);\n }", "_task selectByPrimaryKey(Integer taskid);", "@Override\n public String executeAndReturnMessage(TaskList tasks, Ui ui, Storage storage) throws DukeException {\n if (doIndex <= 0 || doIndex > tasks.getNumOfTasks()) {\n throw new DukeException(\"The specified task number does not exist!\");\n }\n\n Task chosenTask = tasks.getTask(doIndex - 1);\n chosenTask.markAsDone();\n try {\n storage.updateTaskInFile(doIndex);\n return (\"Nice! I've marked this task as done:\\n \"\n + chosenTask.toString() + \"\\n\");\n } catch (IOException ex) {\n throw new DukeException(\"Can't update task in the file\");\n }\n }", "public Task getTaskInstance() {\n\t\treturn taskInstance;\n\t}", "public ItemT getSelectedItem() {\n return selectedItem;\n }", "net.zyuiop.ovhapi.api.objects.license.Task getServiceNameTasksTaskId(java.lang.String serviceName, long taskId) throws java.io.IOException;", "public Task getTaskById(Long id ) {\n\t\treturn taskRepo.getOne(id);\n\t}", "public int getTaskId() {\n return mTaskId;\n }", "public ViewTaskOption getViewTaskOption() {\n return (ViewTaskOption) commandData.get(CommandProperties.TASKS_VIEW_OPTION);\n }", "DispatchTask getTask()\n {\n synchronized (m_lock)\n {\n return m_runnable;\n }\n }" ]
[ "0.62499076", "0.61152524", "0.60692227", "0.59869015", "0.59336746", "0.593317", "0.58950704", "0.5845596", "0.5845596", "0.58085907", "0.5787974", "0.57486725", "0.5707781", "0.5707176", "0.56877905", "0.5683141", "0.5672674", "0.5610128", "0.5588282", "0.5583477", "0.5569319", "0.5547596", "0.55424", "0.55230457", "0.549525", "0.54840386", "0.54832906", "0.5467748", "0.54658884", "0.545016", "0.5433519", "0.54279953", "0.5414825", "0.5406233", "0.5405586", "0.5404956", "0.5382046", "0.5354558", "0.53545386", "0.53111225", "0.5307324", "0.5304398", "0.5293778", "0.5260069", "0.5239233", "0.52332807", "0.5206257", "0.5200238", "0.5200154", "0.5199981", "0.51987535", "0.5189459", "0.51816845", "0.5166935", "0.5160625", "0.5149842", "0.5148583", "0.5141504", "0.5139035", "0.5139035", "0.5135127", "0.5125871", "0.51130486", "0.5110588", "0.5101696", "0.50944746", "0.50902855", "0.5072424", "0.50629926", "0.5058048", "0.50579786", "0.50484025", "0.5044832", "0.50323546", "0.50307196", "0.5025219", "0.5021241", "0.4999261", "0.49961227", "0.49946237", "0.4985706", "0.49819797", "0.49702537", "0.49702537", "0.49702346", "0.49628597", "0.49624127", "0.49604994", "0.49521473", "0.49515358", "0.49502695", "0.4948469", "0.4944614", "0.4937081", "0.4935868", "0.4935801", "0.49180716", "0.49090722", "0.4904788", "0.4901152" ]
0.82948756
0
Retrieves the parent task group that contains the selected undertaking.
public TaskGroup getSelectedTaskParent() { boolean first = true; TaskGroup allParent = null; // Examine the parent task group for each selected undertaking Iterator<AUndertaking> taskIt = getSelectedTaskIterator(); while (taskIt.hasNext()) { AUndertaking item = taskIt.next(); TaskGroup parentOfItem = item.getTaskGroup(); // If the selected item represents a top-level undertaking, // then null is the only possible response. if (parentOfItem == null) { return null; } // Remember first parent to compare against the remaining ones if (first) { first = false; allParent = parentOfItem; } else if (parentOfItem != allParent) { // If a subsequent parent is different from the remembered one, // return null return null; } } // If there is no selected undertaking, return null if (allParent == null) { return null; } // Otherwise, return the shared parent task group return allParent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TaskGroup[] getSelectedTaskParents()\n {\n int selectedItemCount = getSelectedTaskCount();\n TaskGroup[] parents = new TaskGroup[selectedItemCount];\n\n Iterator<AUndertaking> selectedTasks = getSelectedTaskIterator();\n int i = 0;\n\n while (selectedTasks.hasNext()) {\n AUndertaking task = selectedTasks.next();\n\n parents[i++] = task.getTaskGroup();\n }\n\n return parents;\n }", "String getParentGroupId();", "public Group getParent() {\n com.guidebee.game.engine.scene.Group group = internalGroup.getParent();\n if (group != null) {\n return (Group) group.getUserObject();\n }\n return null;\n }", "public TimedTask getParent() {\n return parent;\n }", "public final XmlAntTask getParent() {\n\t\treturn parent;\n\t}", "public long getParentGroupId() {\n return parentGroupId;\n }", "public org.apache.ant.Project getParent() {\n return parentProject;\n }", "public String getParentId() {\n return getProperty(Property.PARENT_ID);\n }", "public java.lang.Integer getParentId();", "public String getParentId() {\n return getParent() != null ? getParent().getId() : null;\n }", "public int getParent();", "public String getParent() {\n return _theParent;\n }", "com.google.apps.drive.activity.v2.DriveItem getParent();", "public String getParent() {\n return _parent;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "java.lang.String getParent();", "java.lang.String getParent();", "protected final XmlAntTask getRoot() {\n\t\tXmlAntTask tmp1 = parent;\n\t\tXmlAntTask tmp2 = this;\n\t\twhile (tmp1 != null) {\n\t\t\ttmp2 = tmp1;\n\t\t\ttmp1 = tmp2.getParent();\n\t\t}\n\t\treturn tmp2;\n\t}", "public IBuildObject getParent();", "public String getParent() {\n return parent;\n }", "public String getParent() {\r\n return parent;\r\n }", "private HObject checkParent(String groupName, Group parentGroup)\n\t{\n\t\tfor(HObject h : parentGroup.getMemberList())\n\t\t{\n\t\t\tif(h.getName().equals(groupName))\n\t\t\t{\n\t\t\t\treturn h;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Integer getParentId() {\n return parentId;\n }", "public Integer getParentId() {\n return parentId;\n }", "public Integer getParentId() {\n return parentId;\n }", "public String getParentName() {\n return getProperty(Property.PARENT_NAME);\n }", "ILitePackItem getParent();", "public CompositeObject getParent(\n )\n {return (parentLevel == null ? null : (CompositeObject)parentLevel.getCurrent());}", "String getFullParentId();", "public Kit getParent() {\n return this.parent;\n }", "public String getParent() {\r\n return this.parent;\r\n }", "private static int chooseParent() {\n\t\tint parent = 0;\n\t\tChromosome thisChromo = null;\n\t\tboolean done = false;\n\n\t\twhile (!done) {\n\t\t\t// Randomly choose an eligible parent.\n\t\t\tparent = getRandomNumber(0, population.size() - 1);\n\t\t\tthisChromo = population.get(parent);\n\t\t\tif (thisChromo.selected() == true) {\n\t\t\t\tdone = true;\n\t\t\t}\n\t\t}\n\n\t\treturn parent;\n\t}", "public long getParentId()\n {\n return parentId;\n }", "public SqlFromSubSelect getParent() {\n return parent;\n }", "Object getParent();", "public int getParent_id() {\n return this.parent_id;\n }", "public Optional<NamespaceId> getParentId() {\n return parentId;\n }", "public int getParentId() {\r\n\t\treturn parentId;\r\n\t}", "public String getParentName() {\n return parentName;\n }", "public StructuredId getParent()\r\n {\r\n return parent;\r\n }", "public Folder getParentFolder() {\n\t\treturn parentFolder;\n\t}", "ContentIdentifier getParent(ContentIdentifier cid);", "MenuEntry getParent();", "public Long getParentId() {\n return parentId;\n }", "public Long getParentId() {\n return parentId;\n }", "public Long getParentId() {\n return parentId;\n }", "public Long getParentId() {\n return parentId;\n }", "public String getParentName() {\n return parentName;\n }", "public Integer getParentid() {\n\t\treturn parentid;\n\t}", "protected Directory getParent() {\n return parent;\n }", "IMenuItem getParent();", "public String getParentNode()\r\n\t{\r\n\t\tif (roadBelongingType.equals(\"inbound\"))\r\n\t\t{\r\n\t\t\treturn endNode;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn startNode;\r\n\t\t}\r\n\t}", "public AUndertaking getSelectedTask()\n {\n String errorMsg;\n Iterator<AUndertaking> taskIt = getSelectedTaskIterator();\n\n if (taskIt.hasNext()) {\n AUndertaking selectedTask = taskIt.next();\n\n if (! taskIt.hasNext()) {\n return selectedTask;\n }\n\n errorMsg = \"Selection is multiple\";\n }\n else {\n errorMsg = \"Nothing is selected\";\n }\n\n throw new IllegalStateException(errorMsg);\n }", "Group[] getParents() throws AccessManagementException;", "public Folder getImportParent()\r\n {\r\n if (getFragment(ChildrenBrowserFragment.TAG) != null)\r\n {\r\n importParent = ((ChildrenBrowserFragment) getFragment(ChildrenBrowserFragment.TAG)).getImportFolder();\r\n if (importParent == null)\r\n {\r\n importParent = ((ChildrenBrowserFragment) getFragment(ChildrenBrowserFragment.TAG)).getParent();\r\n }\r\n }\r\n return importParent;\r\n }", "public GitCommit getParent() { return _par!=null? _par : (_par=getParentImpl()); }", "public int getParentID() {\n\t\treturn parentID;\n\t}", "public com.vmware.converter.ManagedObjectReference getParentFolder() {\r\n return parentFolder;\r\n }", "public int getParentID() {\n\t\treturn _parentID;\n\t}", "public Integer getParentTid() {\r\n return parentTid;\r\n }", "public String getParent(String anItem) { return null; }", "public String getParent(String anItem) { return null; }", "public String getParentLabel(){\n\t\treturn this.parentLabel;\n\t}", "public PuzzleState getParent();", "public ParseTreeNode getParent() {\r\n return _parent;\r\n }", "public PartialSolution getParent() {\n return _parent;\n }", "public Optional<Cause> getParent() {\n return this.parent;\n }", "public String getParentKey() {\n\n return this.parentKey;\n }", "public Long getParentId() {\n return this.parentId;\n }", "public XMLPath getParent() {\r\n return this.parent == null ? null : this.parent.get();\r\n }", "public PafDimMember getParent() {\r\n\t\treturn parent;\r\n\t}", "int createParentTask();", "public String getParent() {\r\n return (String) getAttributeInternal(PARENT);\r\n }", "public AppFile getParent(AppFile anItem) { return anItem.getParent(); }", "public PageTreeNode getParent() {\n return parent;\n }", "public Path getParent(\n ) {\n return this.parent;\n }", "public String getParentName() {\n\t\treturn parentName;\n\t}", "@VTID(7)\r\n void getParent();", "public Package getParentPackage() {\n return mPackage;\n }", "public SearchTreeNode getParent() { return parent; }", "@Override\r\n public FileName getParent() {\r\n final String parentPath;\r\n final int idx = getPath().lastIndexOf(SEPARATOR_CHAR);\r\n if (idx == -1 || idx == getPath().length() - 1) {\r\n // No parent\r\n return null;\r\n }\r\n if (idx == 0) {\r\n // Root is the parent\r\n parentPath = SEPARATOR;\r\n } else {\r\n parentPath = getPath().substring(0, idx);\r\n }\r\n return createName(parentPath, FileType.FOLDER);\r\n }", "public long getParentKey() {\n\t\treturn parentKey;\n\t}", "public Resource getParent()\n {\n if(parent == null)\n {\n if(parentId != -1)\n {\n try\n {\n parent = new ResourceRef(coral.getStore().getResource(parentId), coral);\n }\n catch(EntityDoesNotExistException e)\n {\n throw new BackendException(\"corrupted data parent resource #\"+parentId+\n \" does not exist\", e);\n }\n }\n else\n {\n parent = new ResourceRef(null, coral);\n }\n }\n try\n {\n return parent.get();\n }\n catch(EntityDoesNotExistException e)\n {\n throw new BackendException(\"in-memory data incosistency\", e);\n }\n }", "public TreeNode getParent ()\r\n {\r\n return parent;\r\n }", "public UpTreeNode<E> getParent() {\n\t\t\treturn parent;\n\t\t}", "public HtmlMap<T> getParent()\n\t{\n\t\treturn this.m_parent;\n\t}", "public static Node searchParent(Node root, int taskId) {\n Queue<Node> queue = new LinkedList<>();\n queue.add(root);\n\n while (queue.size() > 0) {\n Node current = queue.poll();\n if (current.getAllChildrenIds().contains(taskId)) {\n return current;\n } else {\n queue.addAll(current.getChildren());\n }\n }\n\n return null;\n }", "public String getParentActivity() {\n return parentActivity;\n }", "public Object getParent() {\r\n return this.parent;\r\n }", "public Object getParent()\n {\n return traversalStack.get(traversalStack.size() - 2);\n }", "public TreeNode getParent() { return par; }", "public PlanNode getParent() {\n return parent;\n }" ]
[ "0.70219845", "0.6722301", "0.64377844", "0.6430615", "0.6111415", "0.60997367", "0.59830475", "0.59484595", "0.59397787", "0.5849373", "0.58469754", "0.5841102", "0.5815735", "0.5764884", "0.5764783", "0.5764783", "0.5764783", "0.5764783", "0.5764783", "0.5764783", "0.5764783", "0.5764783", "0.5764783", "0.57569367", "0.57569367", "0.57143044", "0.56885004", "0.568212", "0.56757236", "0.56701654", "0.56690085", "0.56690085", "0.56690085", "0.56507367", "0.5648857", "0.5641992", "0.5640354", "0.56365395", "0.5635561", "0.56169873", "0.56166637", "0.56166625", "0.5605635", "0.55828255", "0.55815077", "0.55746704", "0.55744255", "0.5573809", "0.55684286", "0.55645776", "0.55627567", "0.55600435", "0.55600435", "0.55600435", "0.55600435", "0.55268335", "0.55240184", "0.55060625", "0.54919136", "0.5487177", "0.54798526", "0.54791874", "0.54780406", "0.547749", "0.5464889", "0.54628366", "0.54582924", "0.5449725", "0.5439167", "0.5439167", "0.54188913", "0.54157007", "0.5402391", "0.5400254", "0.5397944", "0.53974515", "0.53957963", "0.5388975", "0.53869027", "0.53836244", "0.5378305", "0.53738004", "0.53735894", "0.536985", "0.5358064", "0.535604", "0.5355937", "0.53533924", "0.53437525", "0.5340635", "0.5339369", "0.5333949", "0.53286946", "0.5316243", "0.5311762", "0.5308365", "0.5307071", "0.53030306", "0.5300468", "0.5296408" ]
0.84754723
0
Retrieves the parents of all selected tasks/groups.
public TaskGroup[] getSelectedTaskParents() { int selectedItemCount = getSelectedTaskCount(); TaskGroup[] parents = new TaskGroup[selectedItemCount]; Iterator<AUndertaking> selectedTasks = getSelectedTaskIterator(); int i = 0; while (selectedTasks.hasNext()) { AUndertaking task = selectedTasks.next(); parents[i++] = task.getTaskGroup(); } return parents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TaskGroup getSelectedTaskParent()\n {\n boolean first = true;\n TaskGroup allParent = null;\n\n // Examine the parent task group for each selected undertaking\n Iterator<AUndertaking> taskIt = getSelectedTaskIterator();\n\n while (taskIt.hasNext()) {\n AUndertaking item = taskIt.next();\n\n TaskGroup parentOfItem = item.getTaskGroup();\n\n // If the selected item represents a top-level undertaking,\n // then null is the only possible response.\n if (parentOfItem == null) {\n return null;\n }\n\n // Remember first parent to compare against the remaining ones\n if (first) {\n first = false;\n allParent = parentOfItem;\n }\n else if (parentOfItem != allParent) {\n // If a subsequent parent is different from the remembered one,\n // return null\n return null;\n }\n }\n\n // If there is no selected undertaking, return null\n if (allParent == null) {\n return null;\n }\n\n // Otherwise, return the shared parent task group\n return allParent;\n }", "Group[] getParents() throws AccessManagementException;", "public void selectParents() {\n // Create a new parent list for this reproductive cycle. Let the garbage\n // handler dispose of the old list, if there was one.\n switch (Defines.parentAlgo) {\n case Defines.PA_RANDOM:\n this.parents = this.selectParentsRandom();\n break;\n\n case Defines.PA_ROULETTE:\n this.parents = this.selectParentsRoulette();\n break;\n\n case Defines.PA_TOURNAMENT:\n this.parents = this.selectParentsTournament();\n break;\n }\n// this.howGoodAreParents();\n }", "public List<TempTableHeader> getParents() {\r\n\t\t\treturn parents;\r\n\t\t}", "public Set<Long> getParents() {\n String key = parentName + parentGenus;\n if (!parentNameToParentBlocks.containsKey(key)) {\n return null;\n }\n return parentNameToParentBlocks.get(key);\n }", "public List<AlfClass> getParents() {\t\r\n\t\tList<AlfClass> parents = new ArrayList<AlfClass>(this.strongParents);\r\n\t\tparents.addAll(this.weakParents);\r\n\t\treturn Collections.unmodifiableList(parents);\r\n\t}", "private ArrayList<Chromosome> selectParentsTournament() {\n ArrayList<Chromosome> parents = new ArrayList<Chromosome>(Defines.crossoverParentCt);\n ArrayList<Chromosome> matingPool = new ArrayList<Chromosome>(Defines.crossoverParentCt);\n\n // Run tournaments to select parents - for each parent\n for (int parentIdx = 0; parentIdx < Defines.crossoverParentCt; parentIdx++) {\n\n // Run tournaments - get random contestants (run.getPaTournamentSize())\n for (int tournIdx = 0; tournIdx < Defines.tournamentSize; tournIdx++) {\n int contestantID = Defines.randNum(0, this.chromosomes.size() - 1);\n matingPool.add(this.chromosomes.get(contestantID));\n }\n Collections.sort(matingPool);\n parents.add(matingPool.get(0));\n }\n\n return parents;\n }", "public List<Category> getParents() {\n\t\treturn parents;\n\t}", "public long getParentGroupId() {\n return parentGroupId;\n }", "java.util.List<java.lang.String>\n getParentIdList();", "private ArrayList<Chromosome> selectParentsRandom() {\n ArrayList<Chromosome> parents = new ArrayList<Chromosome>(Defines.crossoverParentCt);\n\n for (int i = 0; i < Defines.crossoverParentCt; i++) {\n // Generate random index into chromosomes in range [0..size-1]\n int randomParent = Defines.randNum(0, chromosomes.size() - 1);\n // Remember the new parent\n parents.add(chromosomes.get(randomParent));\n }\n return parents;\n }", "String getParentGroupId();", "public VNode[] getParents() throws VlException // for Graph\n {\n VNode parent=getParent();\n \n if (parent==null)\n return null; \n \n VNode nodes[]=new VNode[1]; \n nodes[0]=parent; \n return nodes;\n }", "private PMCGenotype[] selectParents()\n\t{\n\t\tPMCGenotype[] bestGenes = new PMCGenotype[parentsToSelect];\n\n\t\tint lowestFitnessOfSelectedIndex = 0;\n\t\tdouble lowestFitnessOfSelected = -1;\n\n\t\t// Select initial set of parents.\n\t\tbestGenes[0] = population[0];\n\t\tlowestFitnessOfSelectedIndex = 0;\n\t\tlowestFitnessOfSelected = bestGenes[0].getFitness();\n\t\tfor (int i = 1; i < this.parentsToSelect; i++)\n\t\t{\n\t\t\tbestGenes[i] = population[i];\n\n\t\t\tif (bestGenes[i].getFitness() < lowestFitnessOfSelected)\n\t\t\t{\n\t\t\t\tlowestFitnessOfSelectedIndex = i;\n\t\t\t\tlowestFitnessOfSelected = bestGenes[i].getFitness();\n\t\t\t}\n\t\t}\n\n\t\t// Select candidates with the highest fitness, replacing those with lowest fitness.\n\t\tfor (int i = parentsToSelect; i < population.length; i++)\n\t\t{\n\t\t\tPMCGenotype pmcg = population[i];\n\t\t\tif (pmcg.getFitness() > lowestFitnessOfSelected)\n\t\t\t{\n\t\t\t\tbestGenes[lowestFitnessOfSelectedIndex] = pmcg;\n\n\t\t\t\tlowestFitnessOfSelectedIndex = 0;\n\t\t\t\tlowestFitnessOfSelected = bestGenes[0].getFitness();\n\n\t\t\t\tfor (int j = 1; j < parentsToSelect; j++)\n\t\t\t\t{\n\t\t\t\t\tif (bestGenes[j].getFitness() < lowestFitnessOfSelected)\n\t\t\t\t\t{\n\t\t\t\t\t\tlowestFitnessOfSelectedIndex = j;\n\t\t\t\t\t\tlowestFitnessOfSelected = bestGenes[j].getFitness();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn bestGenes;\n\t}", "public void selectParents1() {\n // Create a new parent list for this reproductive cycle. Let the garbage\n // handler dispose of the old list, if there was one.\n switch (Defines.parentAlgo) {\n case Defines.PA_RANDOM:\n this.parents = this.selectParentsRandom();\n break;\n\n case Defines.PA_ROULETTE:\n this.parents = this.selectParentsRoulette();\n break;\n\n case Defines.PA_TOURNAMENT:\n this.parents = this.selectParentsTournament();\n break;\n }\n// this.howGoodAreParents();\n }", "public int getParentThreads() {\n\t\tfinal String key = ConfigNames.PARENT_THREADS.toString();\n\n\t\tif (getJson().isNull(key)) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn getJson().getInt(key);\n\t}", "public List getParents()\n {\n \tList result = new ArrayList();\n \tModelFacade instance = ModelFacade.getInstance(this.refOutermostPackage().refMofId());\n\n \tif (instance != null)\n \t{\n \t if (instance.isRepresentative(this.refMofId())&&\n \t instance.hasRefObject(this.refMofId()))\n \t {\n \t if (getGeneralization().isEmpty() && !(this instanceof Interface) && !(this instanceof Enumeration))\n \t {\n \t \tresult.add(OclLibraryHelper.getInstance(this).\n \t\t\t\t\t\t\t\t\t\t\tgetAny());\n \t return result;\n \t \t }\n \t } \t \n \t \n\t \tif (equals(OclLibraryHelper.getInstance(this).getVoid()))\n\t \t{\n\t \t\tModel topPackage = ModelHelper.\n\t \t\t\t\t\t\t \t\tgetInstance(\n\t \t\t\t\t\t\t \t\t\t\t(Uml15Package) this.refOutermostPackage()).\n\t \t\t\t\t\t\t \t\t\t\t\t\tgetTopPackage();\n\t \t\tresult.addAll(((NamespaceImpl)topPackage).getAllClassesWithoutSpez());\n\t \t\treturn result;\n\t \t}\n \t} \n \tIterator it = getGeneralization().iterator();\n\n \twhile(it.hasNext())\n \t{\n \t Generalization g = (Generalization)it.next(); \n \t result.add(g.getParent());\n \t}\n \treturn result;\n }", "public Integer getParentId() {\n return parentId;\n }", "public Integer getParentId() {\n return parentId;\n }", "public Integer getParentId() {\n return parentId;\n }", "public int getParentId() {\r\n\t\treturn parentId;\r\n\t}", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "private void setParentBounds() {\n GraphRepresentation baseGraph = graphRepresentationFactory.getBaseGraph();\n\n Iterator<Task> iterator = tasks.iterator();\n while (iterator.hasNext()) {\n Task nextTask = iterator.next();\n List<Integer> nextTaskParents = baseGraph.getParents(nextTask.getIdentifier());\n nextTask.setParentBound(nextTaskParents.size());\n }\n }", "public int getParent();", "private List<PSRelationship> getParentRelationships(Collection<Integer> ids) \n throws PSException\n {\n PSRelationshipFilter filter = new PSRelationshipFilter();\n filter.setDependentIds(ids);\n filter.setCategory(PSRelationshipFilter.FILTER_CATEGORY_ACTIVE_ASSEMBLY);\n filter.limitToEditOrCurrentOwnerRevision(true);\n \n return ms_rel.findByFilter(filter);\n }", "public Long getParentId() {\n return parentId;\n }", "public Long getParentId() {\n return parentId;\n }", "public Long getParentId() {\n return parentId;\n }", "public Long getParentId() {\n return parentId;\n }", "private ArrayList<Chromosome> selectParentsRoulette() {\n ArrayList<Chromosome> parents = new ArrayList<Chromosome>(Defines.crossoverParentCt);\n double sumGH = 0.0; // sums GH for all chromosomes in this pop\n Random randgen = new Random(); // random number generator\n for (Chromosome chromo : this.chromosomes) {\n sumGH += chromo.getTotalGH();\n }\n for (int i = 0; i < Defines.crossoverParentCt; i++) {\n double parentRandomizer = randgen.nextDouble() * sumGH; // get random #\n double aggGH = 0.0; // aggregate the GH until we reach our random #\n int chromoIdx = 0; // identifies the chromosome in the pop\n Chromosome parentCandidate;\n do {\n parentCandidate = this.chromosomes.get(chromoIdx++);\n aggGH += parentCandidate.getTotalGH();\n } while (aggGH < parentRandomizer);\n parents.add(parentCandidate);\n }\n return parents;\n }", "public long getParentId()\n {\n return parentId;\n }", "public java.lang.Integer getParentId();", "@Override\n\tpublic List<Tmenu> selectParentMenu() {\n\t\treturn menuMapper.selectParentMenu();\n\t}", "public PageTreeNode getParent() {\n return parent;\n }", "public ParseTreeNode getParent() {\r\n return _parent;\r\n }", "public ArrayList<DagNode> getAllParentNodes(DagNode node){\n node.setDiscovered(true);\n ArrayList<DagNode> allParentNodes = new ArrayList<>();\n allParentNodes.add(node);\n for(DagNode parentNode : node.getParentTaskIds()){\n if(!parentNode.isDiscovered()){\n //if it has not been discoverd yet, add it to the list to return\n allParentNodes.addAll(getAllParentNodes(parentNode));\n }\n }\n return allParentNodes;\n }", "public TimedTask getParent() {\n return parent;\n }", "public Integer getParentid() {\n\t\treturn parentid;\n\t}", "public java.util.List<String> getParentTables()\n {\n return this.parentTables; // never null\n }", "private static Parent[] makeParents() {\n\t\treturn null;\n\t}", "public java.lang.Long getParentId() {\n return parentId;\n }", "public String getParentId() {\n return getProperty(Property.PARENT_ID);\n }", "public int getParent_id() {\n return this.parent_id;\n }", "@Override\n\tpublic ArrayList<Parent> queryAll() {\n\t\treturn parentDao.queryAll();\n\t}", "public TreeNode getParent() { return par; }", "public SearchTreeNode getParent() { return parent; }", "public String getParentId() {\n return getParent() != null ? getParent().getId() : null;\n }", "@Override\n\tpublic WhereNode getParent() {\n\t\treturn parent;\n\t}", "public Set getParents(EntityType arg0, boolean arg1)\n throws EntityPersistenceException {\n return null;\n }", "public int getParentNode(){\n\t\treturn parentNode;\n\t}", "public Folder getParentFolder() {\n\t\treturn parentFolder;\n\t}", "public int getParentID() {\n\t\treturn parentID;\n\t}", "com.google.apps.drive.activity.v2.DriveItem getParent();", "public Cause[] getParents() {\n\t\tif (this.equals(this.rcaCase.problem)) {\n\t\t\treturn null;\n\t\t} else if (this.effectRelations.size() > 0) {\n\t\t\tCause[] causes = new Cause[this.effectRelations.size()];\n\t\t\tfor (int i = 0; i < this.effectRelations.size(); i++) {\n\t\t\t\tcauses[i] = ((Relation) this.effectRelations.toArray()[i]).causeTo;\n\t\t\t}\n\t\t\t//return ((Relation) this.effectRelations.toArray()[0]).causeTo;\n\t\t\treturn causes;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public Long getParentId() {\n return this.parentId;\n }", "public com.vmware.converter.ManagedObjectReference getParentFolder() {\r\n return parentFolder;\r\n }", "public final XmlAntTask getParent() {\n\t\treturn parent;\n\t}", "public List<ResourceCollection> getCandidateParentResourceCollections() {\n List<ResourceCollection> publicResourceCollections = resourceCollectionService.findPotentialParentCollections(getAuthenticatedUser(),\n getPersistable());\n return publicResourceCollections;\n }", "public Folder getImportParent()\r\n {\r\n if (getFragment(ChildrenBrowserFragment.TAG) != null)\r\n {\r\n importParent = ((ChildrenBrowserFragment) getFragment(ChildrenBrowserFragment.TAG)).getImportFolder();\r\n if (importParent == null)\r\n {\r\n importParent = ((ChildrenBrowserFragment) getFragment(ChildrenBrowserFragment.TAG)).getParent();\r\n }\r\n }\r\n return importParent;\r\n }", "@Override\n\tpublic List<Parent> retrieveParentListByClass(int classId) {\n\t\tint class_id_grade = classId;\n\t\tList<Parent> existingParent = parentRepository.findByClass(classId);\n\t\treturn existingParent;\n\t}", "public TreeNode getParent ()\r\n {\r\n return parent;\r\n }", "public abstract Graph getParents(String childVertexHash);", "public int getParentID() {\n\t\treturn _parentID;\n\t}", "public Object[] getParentInfo(String path);", "public static Set<String> getParentPackages()\n {\n Set<String> result = new HashSet<String>();\n result.add(Test.class.getPackage().getName());\n result.add(TestSetup.class.getPackage().getName());\n result.add(AbstractTestCaseWithSetup.class.getPackage().getName());\n result.add(Logger.class.getPackage().getName());\n result.add(LoggingPlugin.class.getPackage().getName());\n result.add(PolicyPlugin.class.getPackage().getName());\n result.add(ClassLoaderSystem.class.getPackage().getName());\n result.add(IsolatedClassLoaderTest.class.getPackage().getName());\n \n String pkgString = AccessController.doPrivileged(new PrivilegedAction<String>() \n {\n public String run() \n {\n return System.getProperty(\"jboss.test.parent.pkgs\");\n }}\n );\n\n if (pkgString != null)\n {\n StringTokenizer tok = new StringTokenizer(pkgString, \",\");\n while(tok.hasMoreTokens())\n {\n String pkg = tok.nextToken();\n result.add(pkg.trim());\n }\n }\n \n return result;\n }", "public void addParents(Collection<Integer> ids)\n {\n PSStopwatch watch = new PSStopwatch();\n watch.start();\n\n if (ids == null)\n throw new IllegalArgumentException(\"ids may not be null\");\n \n if (ids.isEmpty())\n return;\n \n try\n {\n List<PSRelationship> rels = getParentRelationships(ids);\n Set<Integer> parents = new HashSet<>();\n for (PSRelationship rel : rels)\n {\n Integer parentid = rel.getOwner().getId();\n parents.add(parentid);\n }\n addGrandParents(parents);\n\n if (ms_log.isDebugEnabled()) \n {\n watch.stop();\n ms_log.debug(\"[addParents] elapse = \" + watch.toString()\n + \". ids: \" + ids.size() + \". m_items: \" + m_items.size());\n }\n }\n catch (PSException e)\n {\n ms_log.error(\"Problem finding parents\", e);\n }\n }", "Object getParent();", "@ManyToOne\n\tpublic ParentsMst getParentsMst() {\n\t\treturn this.parentsMst;\n\t}", "public ResultSet leesParentIdLijst() {\n String sql = \"select distinct f2.id parent_id\\n\" +\n \" from bookmarkfolders f1\\n\" +\n \" join bookmarkfolders f2 on f1.parent_id = f2.id\\n\" +\n \" order by f2.id;\";\n ResultSet rst = execute(sql);\n\n ResultSet result = null;\n try {\n result = rst;\n } catch(Exception e) {\n System.out.println(e.getMessage() + \" - \" + sql);\n }\n\n return result;\n }", "public TreeNode getParentNode();", "public java.util.List getOrderedAncestors();", "public TestResultTable.TreeNode getParent() {\n return parent;\n }", "public Optional<NamespaceId> getParentId() {\n return parentId;\n }", "public Set<AlfClass> getStrongParents()\r\n\t{\treturn Collections.unmodifiableSet(this.strongParents);\t}", "public StructuredId getParent()\r\n {\r\n return parent;\r\n }", "public String getInvitedAncestorIds() {\n return invitedAncestorIds;\n }", "public PrincipalSet getAllParentPrincipals(boolean arg0)\n throws AuthorizationException {\n return null;\n }", "ContentIdentifier getParent(ContentIdentifier cid);", "public Integer getParentTid() {\r\n return parentTid;\r\n }", "public Node getParent();", "private void howGoodAreParents() {\n String msg = \"From chromo with GH scores: \";\n for (int i = 0; i < this.chromosomes.size(); i++) {\n msg += this.chromosomes.get(i).getTotalGH() + \"-\" + this.chromosomes.get(i).getNumValidGroup() + \" \";\n }\n\n msg += \"\\n\\tChose parents (\";\n switch (Defines.parentAlgo) {\n case Defines.PA_RANDOM:\n msg += \"random\";\n break;\n\n case Defines.PA_ROULETTE:\n msg += \"roulette\";\n break;\n\n case Defines.PA_TOURNAMENT:\n msg += \"tournament\";\n msg += String.format(\" (size %d)\", Defines.tournamentSize);\n break;\n }\n msg += \") \";\n for (int i = 0; i < Defines.crossoverParentCt; i++) {\n msg += this.parents.get(i).getTotalGH() + \" \";\n }\n Log.debugMsg(msg);\n }", "public List<AbstractFamixEntity> getParentEntities(AbstractFamixEntity entity) {\n List<AbstractFamixEntity> parentEntities = new ArrayList<AbstractFamixEntity>();\n if (entity.getParent() != null) {\n parentEntities.add(entity.getParent());\n parentEntities.addAll(getParentEntities(entity.getParent()));\n }\n\n return parentEntities;\n }", "java.lang.String getParent();", "java.lang.String getParent();", "public int getParentOne()\n\t{\n\t\treturn parentSetOne;\n\t}", "public UpTreeNode<E> getParent() {\n\t\t\treturn parent;\n\t\t}", "@Nonnull\n List<AbstractProject<?,?>> getTopLevelJobs();", "public String getParent() {\n return _theParent;\n }", "public Foo getParent() {\n return parent;\n }", "public TreeNode getParent()\n {\n return mParent;\n }", "public Set<Profile> getRelatives() {\n\t\tSet<Profile> parents = new HashSet<>();\n\t\tparents.add(_parent1);\n\t\tparents.add(_parent2);\n\t\treturn parents;\n\t}", "public CLIRequest getParent() {\n return parent;\n }" ]
[ "0.72020274", "0.64948165", "0.6460208", "0.6420287", "0.6396307", "0.6396296", "0.62266105", "0.61885273", "0.60504776", "0.60351866", "0.5946834", "0.5875011", "0.5822045", "0.5817051", "0.57987267", "0.5796403", "0.5736198", "0.57184863", "0.57184863", "0.57184863", "0.5704572", "0.56874985", "0.56874985", "0.56874985", "0.56874985", "0.56874985", "0.56874985", "0.56874985", "0.56874985", "0.56874985", "0.5676806", "0.5671075", "0.56565547", "0.5646107", "0.5646107", "0.5646107", "0.5646107", "0.5638748", "0.56223154", "0.5613201", "0.5585148", "0.5545686", "0.55315894", "0.5526891", "0.5519355", "0.5516085", "0.5502389", "0.5500016", "0.548801", "0.5482644", "0.54791903", "0.5478774", "0.5451094", "0.5447354", "0.5434726", "0.5427314", "0.5413002", "0.54120433", "0.5403709", "0.5386367", "0.53862", "0.538469", "0.538336", "0.5366045", "0.5361155", "0.5360473", "0.5352731", "0.5352056", "0.5339423", "0.533719", "0.53371793", "0.5334917", "0.5322441", "0.5318393", "0.53115743", "0.5311561", "0.52996016", "0.52788323", "0.52773565", "0.5261181", "0.5261088", "0.5259574", "0.52567697", "0.52429396", "0.52410656", "0.5241017", "0.52408373", "0.5239498", "0.52390957", "0.52375984", "0.52294314", "0.52294314", "0.5219898", "0.52135587", "0.5207661", "0.5198743", "0.51964056", "0.5192422", "0.518154", "0.5179416" ]
0.84916204
0
Indicate whether the given undertaking is a descendant of a selected task group.
public boolean isInSelectedHierarchy(AUndertaking task) { TaskGroup group = task.getTaskGroup(); while (group != null) { if (isTaskSelected(group)) { return true; } group = group.getTaskGroup(); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isChildSelectable(int groupPosition, int childPosition);", "public boolean isDescendant(RMShape aShape) { return aShape!=null && aShape.isAncestor(this); }", "public boolean isDescendantOf(Actor actor) {\n if (actor == null)\n throw new IllegalArgumentException(\"actor cannot be null.\");\n\n if(actor instanceof Group){\n Group group=(Group)actor;\n return internalGroup.isDescendantOf(group.internalGroup);\n }\n\n return internalGroup.isDescendantOf(actor.internalActor);\n }", "default boolean isChildOf(String tokId) {\n return getAncestors().contains(tokId);\n }", "private boolean isRelevant(final Group group, final RunnerContext pContext) {\n\n\t\tfor (Renderable r : group.getItems()) {\n\n\t\t\tif (r instanceof Control) {\n\t\t\t\tControl control = (Control) r;\n\t\t\t\tString bind = control.getBind();\n\t\t\t\tModel model = pContext.getModel();\n\t\t\t\tInstance inst = pContext.getInstance();\n\t\t\t\tItemProperties props = model.getItemProperties(bind);\n\n\t\t\t\tif (props == null) {\n\t\t\t\t\tprops = new ItemPropertiesImpl(bind);\n\t\t\t\t}\n\n\t\t\t\tif (NodeValidator.isRelevant(props, inst, model)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else if (r instanceof TextBlock) {\n\t\t\t\treturn true;\n\t\t\t} else if (r instanceof Group && isRelevant((Group) r, pContext)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean isChild();", "private static boolean isDescendantOf(final ClassLoader cl0, final ClassLoader cl1) {\n for (ClassLoader cl = cl0; cl != null; cl = cl.getParent()) {\n if (cl == cl1) {\n return true;\n }\n }\n return false;\n }", "boolean hasParent();", "boolean hasParent();", "public boolean containsChild() {\n return !(getChildList().isEmpty());\n }", "public boolean inheritsGroup(String groupRef)\n\t\t{\n\t\t\tif(m_oldInheritedGroups == null)\n\t\t\t{\n\t\t\t\tm_oldInheritedGroups = new Vector();\n\t\t\t}\n\t\t\tboolean found = false;\n\t\t\tIterator it = m_oldInheritedGroups.iterator();\n\t\t\twhile(it.hasNext() && !found)\n\t\t\t{\n\t\t\t\tGroup gr = (Group) it.next();\n\t\t\t\tfound = gr.getReference().equals(groupRef);\n\t\t\t}\n\t\n\t\t\treturn found;\n\t\t}", "public boolean isChildOf( InteractionClass other )\n\t{\n\t\t// look up our tree to see if the given class is one of our parents\n\t\tInteractionClass currentParent = this;\n\t\twhile( currentParent != null )\n\t\t{\n\t\t\tif( currentParent == other )\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\tcurrentParent = currentParent.parent;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public Boolean isFollowing() {\n Integer groupType = getGroupType();\n if (groupType != null && groupType == Group.DISCUSSION_KEY) {\n return isMember();\n } else {\n return isFollowing;\n }\n }", "boolean hasAdGroupCriterion();", "boolean hasChildren();", "public boolean getIsOutOfLineFODescendant() {\n return isOutOfLineFODescendant;\n }", "public boolean isAscendantOf(Actor actor) {\n if (actor == null) throw new IllegalArgumentException(\"actor cannot be null.\");\n if(actor instanceof Group){\n Group group=(Group)actor;\n return internalGroup.isAscendantOf(group.internalGroup);\n }\n return internalGroup.isAscendantOf(actor.internalActor);\n }", "private boolean isAllChildCompleted() {\n for (IBlock iBlock : getChildren()) {\n if (iBlock.getType() != BlockType.DISCUSSION && !iBlock.isCompleted()) {\n return false;\n }\n }\n for (IBlock iBlock : getChildren()) {\n if (iBlock.getType() == BlockType.DISCUSSION) {\n iBlock.setCompleted(1);\n }\n }\n return getChildren().size() > 0;\n }", "public boolean isDeepChildOf(Panel ancestor) {\r\n Panel p = this.parent;\r\n while (p!=null) {\r\n if (p == ancestor)\r\n return true;\r\n p = p.parent;\r\n }\r\n return false;\r\n }", "boolean hasParentalStatus();", "public boolean inGroup(Person p){\n\t return false;\n }", "public boolean hasSubTasks() {\n\t\treturn (getSubTasks() != null) && (getSubTasks().size() > 0);\n\t}", "private boolean isPartOfTree(BPMNNodeInterface dat, AbstractModelAdapter model) {\r\n\t\tfor(EdgeInterface e:model.getEdges()) {\r\n\t\t\tif(e.getTarget().equals(dat) && ((BPMNNodeInterface)e.getSource()).isDataObject()) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(e.getSource().equals(dat) && ((BPMNNodeInterface)e.getTarget()).isDataObject()) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean hasParent() {\n return internalGroup.hasParent();\n }", "public boolean inGroup(String groupName) {\r\n return true;\r\n }", "boolean hasAdGroup();", "public boolean inGroup(String groupName);", "boolean hasAdGroupLabel();", "boolean hasAdGroupCriterionLabel();", "private boolean _hasChild() {\r\n boolean ret = false;\r\n if (_childs != null && _childs.size() > 0) {\r\n ret = true;\r\n }\r\n\r\n return ret;\r\n }", "public boolean isSingleGroupInherited()\n\t\t{\n\t\t\t//Collection groups = getInheritedGroups();\n\t\t\treturn // AccessMode.INHERITED.toString().equals(this.m_access) && \n\t\t\t\t\tAccessMode.GROUPED.toString().equals(this.m_inheritedAccess) && \n\t\t\t\t\tthis.m_inheritedGroupRefs != null && \n\t\t\t\t\tthis.m_inheritedGroupRefs.size() == 1; \n\t\t\t\t\t// && this.m_oldInheritedGroups != null \n\t\t\t\t\t// && this.m_oldInheritedGroups.size() == 1;\n\t\t}", "public Boolean isParentable();", "public abstract boolean canAdvanceOver(QueryTree child);", "public boolean hasChild(int groupPos) {\n return mChildDataList.get(groupPos) == null ? false : mChildDataList.get(groupPos).size() != 0;\n }", "public boolean isChildOf(Loop child, Loop parent) {\n\t\treturn ((parent.start <= child.start) && (parent.stop >= child.stop) && (parent != child));\n\t}", "@Override\r\n\tpublic boolean isHovered() {\n\t\tint hovered = this.group.hovered;\r\n\t\tif(hovered >= 0 && hovered < this.group.items.size())\r\n\t\t{\r\n\t\t\tif(this == this.group.items.get(hovered))\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public final boolean hasChild ()\r\n {\r\n return _value.hasChild();\r\n }", "public boolean contains(Group toCheck) {\n requireNonNull(toCheck);\n return internalList.contains(toCheck);\n }", "public boolean isChild(){\r\n return(leftleaf == null) && (rightleaf == null)); \r\n }", "boolean hasGroupPlacementView();", "@Override\r\n\tpublic boolean hasChildren() {\n\t\tif (taskNodeList != null)\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "@Override\n\t\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\t\treturn false;\n\t\t}", "@Override\n\t\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\t\treturn false;\n\t\t}", "public boolean isExpandable();", "@Override\r\n\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\treturn false;\r\n\t}", "boolean hasIsPartOf();", "private boolean check_only_call_relatives(Element element){\n\t\tArrayList<Element> relatives = new ArrayList<Element>();\n\t\tfor(Element elem_called : element.getRefFromThis()){\n\t\t\t//if they are brothers\n\t\t\tif(element.getParentName() != null && elem_called.getParentName() != null && element.getParentName().equals(elem_called.getParentName())){\n\t\t\t\trelatives.add(elem_called);\n\t\t\t}\n\t\t\t//if they are son - father\n\t\t\tif(element.getParentName() != null && element.getParentName().equals(elem_called.getIdentifier())){\n\t\t\t\trelatives.add(elem_called);\n\t\t\t}\t\t\t\n\t\t}\n\t\tif (relatives.size() == element.getRefFromThis().size()){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n\t\t\tpublic boolean isChildSelectable(int groupPosition,\n\t\t\t\t\tint childPosition) {\n\t\t\t\treturn false;\n\t\t\t}", "boolean hasGroupByCategory();", "public boolean hasSubTaxa() {\n\t\treturn !children.isEmpty();\n\t}", "public boolean isParent(AccessGroup group)\n {\n if (group == this)\n {\n return true;\n }\n if (group != null)\n {\n if (group.getExtendGroup() != null)\n {\n return group.getExtendGroup() == this || isParent(group.getExtendGroup());\n }\n }\n return false;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Boolean isIncludeSubGroups();", "@Override\n public boolean shouldRun(Description description) {\n for(Description child : description.getChildren()){\n if(shouldRun(child)){\n return true;\n }\n }\n\n Collection<Class<?>> categories = getCategories(description);\n\n if (allCategoriesAreIncluded()) {\n return categoriesAreNotExcluded(categories);\n }\n\n return categoriesAreNotExcluded(categories)\n && categoriesAreIncluded(categories);\n\n }", "public boolean isChildOf(Cause cause) {\n\t\tCause[] parents = this.getParents();\n\t\tif (parents != null) {\n\t\t\tfor (int i = 0; i < parents.length; i++) {\n\t\t\t\tif (parents[i].equals(cause)) {\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 isChild(int position) {\n if (mSelectedGroupPos != -1) {\n return position > mSelectedGroupPos && position < mSelectedGroupPos +\n getChildCount(mSelectedGroupPos) + 1;\n }\n return false;\n }", "public void checkShouldTransferBack(GroupAlertEntry groupAlertEntry) {\n if (canStillTransferBack(groupAlertEntry)) {\n NotificationEntry notificationEntry = groupAlertEntry.mGroup.summary;\n if (onlySummaryAlerts(notificationEntry)) {\n ArrayList<NotificationEntry> logicalChildren = this.mGroupManager.getLogicalChildren(notificationEntry.getSbn());\n int size = logicalChildren.size();\n if (getPendingChildrenNotAlerting(groupAlertEntry.mGroup) + size > 1 && releaseChildAlerts(logicalChildren) && !this.mHeadsUpManager.isAlerting(notificationEntry.getKey())) {\n if (size > 1) {\n alertNotificationWhenPossible(notificationEntry);\n } else {\n groupAlertEntry.mAlertSummaryOnNextAddition = true;\n }\n groupAlertEntry.mLastAlertTransferTime = 0;\n }\n }\n }\n }", "public boolean isChild(){\n return child;\n }", "public boolean isChild(){\n return child;\n }", "boolean hasNested();", "boolean hasAdGroupFeed();", "@Override\r\n\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\treturn true;\r\n\t}", "boolean isSliceParent();", "boolean hasAdGroupAdLabel();", "public boolean isSelectorNeeded() {\n if (!m_selectChecked) {\n if (m_selectorType != NestingCustomBase.SELECTION_UNCHECKED) {\n \n // before reporting selector needed, make sure at least once child is going to be present\n for (int i = 0; i < m_values.size(); i++) {\n DataNode node = (DataNode)m_values.get(i);\n if (!node.isIgnored()) {\n m_selectNeeded = true;\n break;\n }\n }\n \n }\n m_selectChecked = true;\n }\n return m_selectNeeded;\n }", "public boolean isParent();", "boolean hasParent(CtElement candidate);", "boolean hasConceptGroup();", "public abstract boolean isInWidgetTree();", "private static boolean allowClose(MutableGroup currentGroup) {\n \t\tif (currentGroup instanceof Instance) {\n \t\t\treturn false; // instances may never be closed, they have no parent in the group stack\n \t\t}\n \t\t\n \t\tif (currentGroup.getDefinition() instanceof GroupPropertyDefinition && \n \t\t\t\t((GroupPropertyDefinition) currentGroup.getDefinition()).getConstraint(ChoiceFlag.class).isEnabled()) {\n \t\t\t// group is a choice\n \t\t\tIterator<QName> it = currentGroup.getPropertyNames().iterator();\n \t\t\tif (it.hasNext()) {\n \t\t\t\t// choice has at least on value set -> check cardinality for the corresponding property\n \t\t\t\tQName name = it.next();\n \t\t\t\treturn isValidCardinality(currentGroup, currentGroup.getDefinition().getChild(name));\n \t\t\t}\n \t\t\t// else check all children like below\n \t\t}\n \t\t\n \t\t// determine all children\n \t\tCollection<? extends ChildDefinition<?>> children = DefinitionUtil.getAllChildren(currentGroup.getDefinition());\n \t\n \t\t// check cardinality of children\n \t\tfor (ChildDefinition<?> childDef : children) {\n \t\t\tif (isValidCardinality(currentGroup, childDef)) { //XXX is this correct?! should it be !isValid... instead?\n \t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn true;\n \t}", "@Override\r\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\r\n }", "@Override\n\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\treturn true;\n\t}", "protected abstract boolean isSatisfiedBy(Design design, AUndertaking t);", "public boolean hasContainingParentId() {\n return fieldSetFlags()[1];\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition)\n {\n return true;\n }", "private boolean contains(Collection<Group> groups, Group group) {\n for (Group g : groups) {\n if (group.getName().equals(g.getName()))\n return true;\n }\n return false;\n }", "public abstract boolean isParent(T anItem);", "public void setIncludeSubGroups(java.lang.Boolean value);", "public boolean isGroup(String name) {\n return grouptabs.containsKey(name);\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return false;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n\n return true;\n }", "boolean hasAdGroupAd();", "@Override\n public boolean isCompleted() {\n return isAllChildCompleted() || this.completion == 1;\n }", "public boolean getHaveSub() { return haveSub;}", "public boolean isAbove( PlanNode possibleDescendant ) {\n return possibleDescendant != null && possibleDescendant.isBelow(this);\n }", "public boolean isChild(){\n return false;\n }", "boolean hasTreeNodeId();", "static boolean isGoal(TreeNode node) {\n return false; // Should be overridden\n }", "private boolean isChild(Slot current, Slot toCheck, HashMap<Slot, Slot> parents) {\n if (parents.get(current) != null) {\n if (parents.get(current).equals(toCheck)) {\n return true;\n }\n }\n\n return false;\n }", "public boolean hasGroup(String groupName){\n\t\tGuild self = this;\r\n//\t\tSystem.out.println(\"this=\" + name +\" self.groups=\"+ groups);\r\n\t\tif (self.groups == null || self.groups.isEmpty())/// try and get it again from db\r\n\t\t\tself = MysticGuilds.getGuild(this.getName());\r\n\t\tif (self == null || self.groups == null || self.groups.isEmpty())\r\n\t\t\treturn false;\r\n\t\tfor (PermissionGroup group: self.groups){\r\n//\t\t\tSystem.out.println(\"looking at group = \" + group);\r\n\t\t\tif (group.getName().equalsIgnoreCase(groupName))\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "boolean isInheritableStyle(QName eltName, QName styleName);", "boolean hasHotelGroupView();", "boolean isXMLGroup(Object groupID) throws Exception;", "boolean isSubclass(Concept x, Concept y);", "protected boolean conjoinSecondGroup(BGP theBGP, Group parent, Group child, List<GraphPattern> toAdd) {\n boolean b = true;\n // if the child group has its own filters or assignments, then we can't conjoin it\n // (since those are limited to the scope of that group)\n if (child.getFilters().size() == 0 && child.getAssignments().size() == 0) {\n // we can only remove this child group if we were able to eliminate\n // all of its children\n for (GraphPattern gp : child.getPatterns())\n b = conjoinGraphPattern(theBGP, parent, gp, toAdd) && b;\n // the caller of this function is responsible for removing the child group\n return b;\n }\n return false;\n }", "public boolean isParent(String anItem) { return anItem.equals(\"TreeView\"); }" ]
[ "0.60650146", "0.59607244", "0.59297687", "0.57862484", "0.56795925", "0.567277", "0.544976", "0.5435839", "0.5435839", "0.5427938", "0.54266316", "0.5420692", "0.5394691", "0.537885", "0.53762764", "0.53545254", "0.5347118", "0.5288605", "0.5285995", "0.5280868", "0.5259398", "0.5251988", "0.52488476", "0.5244301", "0.5210456", "0.51956415", "0.51724", "0.51583683", "0.5153145", "0.512224", "0.51130545", "0.5103399", "0.5096702", "0.50916976", "0.5079673", "0.5074178", "0.5058441", "0.504749", "0.5039131", "0.5028036", "0.50243497", "0.5017827", "0.5017827", "0.5016048", "0.5004467", "0.50015116", "0.49922305", "0.49887493", "0.49878705", "0.4987084", "0.49857408", "0.49607885", "0.49598444", "0.49575573", "0.49522397", "0.49510968", "0.49504", "0.49504", "0.4945796", "0.494126", "0.49365467", "0.49272358", "0.4917611", "0.49088624", "0.49063888", "0.49033332", "0.4902994", "0.4901614", "0.48994434", "0.48903728", "0.48899046", "0.48899046", "0.48869076", "0.4867271", "0.48609143", "0.48609143", "0.48609143", "0.48609143", "0.48601785", "0.48543343", "0.4848721", "0.48467287", "0.48426017", "0.48395422", "0.48340857", "0.48254228", "0.4819247", "0.4818049", "0.480697", "0.48021692", "0.47999355", "0.47990635", "0.47983563", "0.47944665", "0.47901255", "0.47834727", "0.47830027", "0.47810686", "0.4774534", "0.47725943" ]
0.71763176
0
TODO: Warning this method won't work in the case the id fields are not set
@Override public boolean equals(Object object) { if (!(object instanceof TipoCora)) { return false; } TipoCora other = (TipoCora) object; if ((this.idTipoCora == null && other.idTipoCora != null) || (this.idTipoCora != null && !this.idTipoCora.equals(other.idTipoCora))) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setId(Integer id) { this.id = id; }", "private Integer getId() { return this.id; }", "public void setId(int id){ this.id = id; }", "public void setId(Long id) {this.id = id;}", "public void setId(Long id) {this.id = id;}", "public void setID(String idIn) {this.id = idIn;}", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public void setId(long id) { this.id = id; }", "public void setId(long id) { this.id = id; }", "public int getId(){ return id; }", "public int getId() {return id;}", "public int getId() {return Id;}", "public int getId(){return id;}", "public void setId(long id) {\n id_ = id;\n }", "private int getId() {\r\n\t\treturn id;\r\n\t}", "public Integer getId(){return id;}", "public int id() {return id;}", "public long getId(){return this.id;}", "public int getId(){\r\n return this.id;\r\n }", "@Override public String getID() { return id;}", "public Long id() { return this.id; }", "public Integer getId() { return id; }", "@Override\n\tpublic Integer getId() {\n return id;\n }", "@Override\n public Long getId () {\n return id;\n }", "@Override\n public long getId() {\n return id;\n }", "public Long getId() {return id;}", "public Long getId() {return id;}", "public String getId(){return id;}", "@Override\r\n\tpublic Long getId() {\n\t\treturn null;\r\n\t}", "public Integer getId() { return this.id; }", "@Override\r\n public int getId() {\n return id;\r\n }", "@Override\n\t\tpublic long getId() {\n\t\t\treturn 0;\n\t\t}", "public int getId() {\n return id;\n }", "public long getId() { return _id; }", "public int getId() {\n/* 35 */ return this.id;\n/* */ }", "public long getId() { return id; }", "public long getId() { return id; }", "public void setId(Long id) \n {\n this.id = id;\n }", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "public void setId(String id) {\n this.id = id;\n }", "@Override\n\tpublic void setId(Long id) {\n\t}", "public Long getId() {\n return id;\n }", "public long getId() { return this.id; }", "public int getId()\n {\n return id;\n }", "public void setId(int id){\r\n this.id = id;\r\n }", "protected abstract String getId();", "@Test\r\n\tpublic void testSetId() {\r\n\t\tbreaku1.setId(5);\r\n\t\texternu1.setId(6);\r\n\t\tmeetingu1.setId(7);\r\n\t\tteachu1.setId(8);\r\n\r\n\t\tassertEquals(5, breaku1.getId());\r\n\t\tassertEquals(6, externu1.getId());\r\n\t\tassertEquals(7, meetingu1.getId());\r\n\t\tassertEquals(8, teachu1.getId());\r\n\t}", "@Override\n\tpublic int getId(){\n\t\treturn id;\n\t}", "public String getId() { return id; }", "public String getId() { return id; }", "public String getId() { return id; }", "public int getID() {return id;}", "public int getID() {return id;}", "public int getId ()\r\n {\r\n return id;\r\n }", "@Override\n public int getField(int id) {\n return 0;\n }", "public void setId(Long id)\n/* */ {\n/* 66 */ this.id = id;\n/* */ }", "public int getId(){\r\n return localId;\r\n }", "void setId(int id) {\n this.id = id;\n }", "@Override\n public Integer getId() {\n return id;\n }", "@Override\n\tpublic Object selectById(Object id) {\n\t\treturn null;\n\t}", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "@Override\n public int getId() {\n return id;\n }", "@Override\n public int getId() {\n return id;\n }", "public void setId(int id)\n {\n this.id=id;\n }", "@Override\r\n public int getID()\r\n {\r\n\treturn id;\r\n }", "@Override\n\tpublic Integer getId() {\n\t\treturn null;\n\t}", "public int getId()\r\n {\r\n return id;\r\n }", "public void setId(Long id){\n this.id = id;\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "final protected int getId() {\n\t\treturn id;\n\t}", "private void clearId() {\n \n id_ = 0;\n }", "public abstract Long getId();", "public void setId(Long id) \r\n {\r\n this.id = id;\r\n }", "@Override\n public long getId() {\n return this.id;\n }", "public String getId(){ return id.get(); }", "public void setId(long id){\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "@SuppressWarnings ( \"unused\" )\n private void setId ( final Long id ) {\n this.id = id;\n }", "public void setId(Integer id)\r\n/* */ {\r\n/* 122 */ this.id = id;\r\n/* */ }", "public Long getId() \n {\n return id;\n }", "@Override\n\tpublic void setId(int id) {\n\n\t}", "public void test_getId() {\n assertEquals(\"'id' value should be properly retrieved.\", id, instance.getId());\n }", "@Override\r\n\tpublic Object getId() {\n\t\treturn null;\r\n\t}", "public int getID(){\n return id;\n }", "public int getId()\n {\n return id;\n }", "public String getID(){\n return Id;\n }" ]
[ "0.6896568", "0.6839589", "0.6705305", "0.66411185", "0.66411185", "0.6592062", "0.65784657", "0.65784657", "0.65749544", "0.65749544", "0.65749544", "0.65749544", "0.65749544", "0.65749544", "0.6561728", "0.6561728", "0.6545076", "0.65248877", "0.651606", "0.6488212", "0.647747", "0.6427465", "0.64198655", "0.64177155", "0.64027804", "0.63675946", "0.63553953", "0.63525397", "0.63484466", "0.63250923", "0.63198864", "0.630231", "0.6294125", "0.6294125", "0.6284177", "0.6271725", "0.6267179", "0.62657326", "0.626255", "0.6260039", "0.62567866", "0.62523216", "0.62482584", "0.62482584", "0.6244534", "0.62395555", "0.62395555", "0.62321675", "0.62236613", "0.62214035", "0.62204707", "0.6212529", "0.6209301", "0.62017804", "0.62012", "0.61932015", "0.61902595", "0.61902595", "0.61902595", "0.6189916", "0.6189916", "0.61850536", "0.6184324", "0.6175163", "0.61746097", "0.61677086", "0.6166729", "0.6162019", "0.6157094", "0.6157094", "0.6157094", "0.6157094", "0.6157094", "0.6157094", "0.6157094", "0.61562043", "0.61562043", "0.614255", "0.6134601", "0.61291385", "0.61284745", "0.61055636", "0.6105001", "0.6105001", "0.6103769", "0.6103122", "0.61025196", "0.6100273", "0.60999817", "0.6095776", "0.6092856", "0.6092856", "0.6092842", "0.60915124", "0.6090482", "0.6076281", "0.60728455", "0.60719776", "0.6070968", "0.60706973", "0.6070349" ]
0.0
-1
/ Aqui mandar a llamar la funcion que me retorna el pagar de un empleado
private static void pagarEmpleado(int cod) { throw new UnsupportedOperationException("Not yet implemented"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Page<DTOPresupuesto> buscarPresupuestos(String filtro, Optional<Long> estado, Boolean modelo, Pageable pageable) {\n Page<Presupuesto> presupuestos = null;\n Empleado empleado = expertoUsuarios.getEmpleadoLogeado();\n\n if (estado.isPresent()){\n presupuestos = presupuestoRepository\n .findDistinctByEstadoPresupuestoIdAndClientePersonaNombreContainsAndSucursalIdAndModeloOrEstadoPresupuestoIdAndClientePersonaApellidoContainsAndSucursalIdAndModeloOrEstadoPresupuestoIdAndDetallePresupuestosMotorMarcaMotorContainsAndSucursalIdAndModeloOrEstadoPresupuestoIdAndDetallePresupuestosAplicacionNombreAplicacionContainsAndSucursalIdAndModeloOrderByIdDesc(\n estado.get(), filtro, empleado.getSucursal().getId(), modelo, estado.get(), filtro, empleado.getSucursal().getId(), modelo, estado.get(), filtro, empleado.getSucursal().getId(), modelo, estado.get(), filtro, empleado.getSucursal().getId(), modelo, pageable);\n\n } else {\n presupuestos = presupuestoRepository\n .findDistinctByClientePersonaNombreContainsAndSucursalIdAndModeloOrClientePersonaApellidoContainsAndSucursalIdAndModeloOrDetallePresupuestosMotorMarcaMotorContainsAndSucursalIdAndModeloOrDetallePresupuestosAplicacionNombreAplicacionContainsAndSucursalIdAndModeloOrderByIdDesc(\n filtro, empleado.getSucursal().getId(), modelo, filtro, empleado.getSucursal().getId(), modelo, filtro, empleado.getSucursal().getId(), modelo, filtro, empleado.getSucursal().getId(), modelo, pageable);\n }\n\n return presupuestoConverter.convertirEntidadesAModelos(presupuestos);\n }", "@Override // Métodos que fazem a anulação\n\tpublic void pagaIR() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void anterior(){//executa metodo que volta pagina de regitro de funcionarios\r\n\t\tdao.anterior();\r\n\t}", "Page<Lancamento> buscarPorFuncionarioId(Long funcionarioId, PageRequest pageRequest);", "public void ultimo(){//executa metodo para ultima pagina de registro de funcionarios\r\n\t\tdao.ultimo();\r\n\t}", "public FacturaCompra pagoPSE(String userName,TipoMoneda tipoMoneda);", "public void proximo(){//executa metodo que passa para proxima pagina de registro de funcioanrios\r\n\t\tdao.proximo();\r\n\t}", "public void PagarConsulta() {\n\t\tSystem.out.println(\"el patronato es gratiuto y no necesita pagar \");\r\n\t}", "@Override\r\n\tprotected Paginador<UnidadFuncional_VO> getPaginador() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic void realizarPago() {\n\t}", "long getAmountPage();", "@GetMapping(\"/produtos\")\n @Timed\n public ResponseEntity<List<Produto>> getAllProdutos(@ApiParam Pageable pageable) {\n log.debug(\"REST request to get a page of Produtos\");\n\n//////////////////////////////////REQUER PRIVILEGIOS\n if (!PrivilegioService.podeVer(cargoRepository, ENTITY_NAME)) {\n log.error(\"TENTATIVA DE VISUALIZAR SEM PERMISSÃO BLOQUEADA! \" + ENTITY_NAME);\n return null;\n }\n\n//////////////////////////////////REQUER PRIVILEGIOS\n Page<Produto> page = produtoRepository.findAll(pageable);\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/produtos\");\n return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);\n }", "public interface PagableResult {\n Integer getTotal();\n Integer getResults();\n}", "public void introducirPagosALojamientoClienteFechas(Date fechaInicial, Date fechaFinal,TablaModelo modelo,String dpiCliente){\n long tiempo = fechaInicial.getTime();\n java.sql.Date fechaInicialSql = new java.sql.Date(tiempo);\n long tiempo2= fechaFinal.getTime();\n java.sql.Date fechaFinalSQL = new java.sql.Date(tiempo2);// pago de alojamiento en rango fchas\n try {\n PreparedStatement declaracion;// prepara la orden \n declaracion = conexion.prepareStatement(\"SELECT ALOJAMIENTO.Id,ALOJAMIENTO.Id_Reservacion,RESERVACION.Fecha_Entrada, RESERVACION.Fecha_Salida,RESERVACION.Precio FROM RESERVACION JOIN ALOJAMIENTO WHERE RESERVACION.Id=ALOJAMIENTO.Id_Reservacion AND RESERVACION.Fecha_Entrada>=? AND RESERVACION.Fecha_Entrada<=? AND RESERVACION.Dpi_Cliente=? AND RESERVACION.Check_In=1;\");\n declaracion.setDate(1,fechaInicialSql);\n declaracion.setDate(2,fechaFinalSQL);// pago de alojamiento en rango fchas\n declaracion.setString(3, dpiCliente);\n ResultSet resultado = declaracion.executeQuery();\n while (resultado.next()) {\n Object objeto[] = new Object[6];\n objeto[0] = resultado.getInt(1);\n objeto[1] = resultado.getInt(2);\n objeto[2] = resultado.getDate(3);// pago de alojamiento en rango fchas\n objeto[3] = resultado.getDate(4);\n objeto[4] = resultado.getInt(5);\n String fechaInicialProbar=objeto[2].toString();\n String fechaFinalProbar=objeto[3].toString();// pago de alojamiento en rango fchas\n String precioProbar = objeto[4].toString();\n int total=habitacion.hacerTotalAlojamiento(fechaInicialProbar, fechaFinalProbar, precioProbar);\n objeto[5]= total;\n modelo.addRow(objeto);\n } // maneja el resultado \n\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }", "@PostMapping(\"/J314Authorities.pag\")\n\t@Timed\n\t\n\tpublic ResultExt< Page< J314AuthorityPoj >> getAllPag(HttpServletRequest request,HttpServletResponse response, @Valid @RequestBody J314AuthorityCritPaged pag)\n\t{\n\t\t\n\t\tString params=UtilParams.paramsToString(\"J314AuthorityCritPaged\",pag);\n\n\t\tContexto ctx = Contexto.init();\n\t\tctx.put(Contexto.REQUEST,request);\n\t\tctx.put(Contexto.RESPONSE,response);\n\t\tctx.put(Contexto.CLAVE_SEGURIDAD,\"REST_ENTITY_J314AUTHORITY_GETALLPAG\");\n\t\tctx.put(Contexto.URL_SOLICITADA,\"/J314Authorities.pag\");\n\t\tResult< Page< J314AuthorityPoj >> res=new Result<>();\n\t\tif (log.isInfoEnabled()) log.info(\"Entrada en REST POST:getAllPag(\"+params+\")\"+params);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tif(!verificaPermisos(\"REST_ENTITY_J314AUTHORITY_GETALLPAG\"))\n\t\t\t{\n\t\t\t\tres.addError(new ErrorSinPermiso(\"REST_ENTITY_J314AUTHORITY_GETALLPAG\",\"/J314Authorities.pag\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tparams=UtilParams.paramsToString(\"J314AuthorityCritPaged\",pag);\n\t\t\t\tif (log.isInfoEnabled()) log.info(\"Verificado en REST POST:getAllPag(\"+params+\")\"+params);\n\n\t\t\t\tJ314AuthorityCritPaged pag_ = pag;\n\n\t\t\t\tResult< Page< J314Authority > > res_=service.findAll(pag_);\n\t\t\t\tres.setInfoEWI(res_);\n\n\t\t\t\tres.setData(J314AuthorityPoj.toPOJOPage(res_.getData()));\n\n\t\t\t}\n\t\t\taddTiempoSesion();\n\t\t}\tcatch(Exception e)\n\t\t{\n\t\t\tres.addError(new ErrorGeneral(e));\n\t\t\tif (log.isErrorEnabled()) log.error(\"Error en REST POST:getAllPag(\"+params+\"). Excepcion:\"+UtilException.printStackTrace(e));\n\t\t}\n\t\tif (log.isInfoEnabled()) log.info(\"Salida de REST POST:getAllPag(\"+params+\"). Resultado:\"+res.toString());\n\n\t\tResultExt< Page< J314AuthorityPoj > > resFin=new ResultExt<>(res,ctx.getAs(\"ticketStr\"));\n\t\tContexto.close();\n\t\treturn resFin;\n\t}", "public ObservableList<Pagadores> carregaPagadores() {\n\t\tcon = Conexao.conectar();\n\t\tObservableList<Pagadores> resultadoPagadores = FXCollections.observableArrayList();\n\t\ttry {\n\t\t\tString query = \"SELECT * FROM pagadores WHERE estpagador = ? ORDER BY agente\";\n\t\t\tprepStmt = con.prepareStatement(query); // create a statement\n\t\t\tprepStmt.setString(1, \"A\");\n\t\t\trs = prepStmt.executeQuery();\n\t\t\t\t\t\t // extract data from the ResultSet\n\t\t\twhile(rs.next()) {\n\t\t\t\tPagadores temp = new Pagadores();\n\t\t\t\ttemp.setCodPagador(rs.getInt(\"codpagador\"));\n\t\t\t\ttemp.setEstPagador(rs.getString(\"estpagador\"));\n\t\t\t\ttemp.setRecDescr(rs.getString(\"recdescr\"));\n\t\t\t\t\n\t\t\t\ttemp.setValContrato(rs.getDouble(\"valcontrato\"));\n\t\t\t\ttemp.setContratoInic(DateUtils.asLocalDate(rs.getDate(\"contratoinic\")));\n\t\t\t\ttemp.setContratoFim(DateUtils.asLocalDate(rs.getDate(\"contratofim\")));\n\t\t\t\t\n\t\t\t\ttemp.setNomeContrato(rs.getString(\"nomecontrato\"));\n\t\t\t\ttemp.setContaVinc(rs.getInt(\"contavinc\"));\n\t\t\t\ttemp.setCentroReceb(rs.getInt(\"centroreceb\"));\n\t\t\t\t\n\t\t\t\ttemp.setSubCentroRec(rs.getInt(\"subcentrorec\"));\n\t\t\t\ttemp.setDataLanc(DateUtils.asLocalDate(rs.getDate(\"datalanc\")));\n\t\t\t\ttemp.setDiaVenc(rs.getInt(\"diavenc\"));\n\t\t\t\ttemp.setAgente(rs.getString(\"agente\"));\n\t\t\t\t\n\t\t\t\tresultadoPagadores.add(temp);\n\t\t\t}\n\t\t\treturn resultadoPagadores;\n\t\t} catch(Exception e) {\n\t\t\tMessageBox.show(\"Erro ao ler pagadores 59\", e.getMessage());\n\t\t\treturn null;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\trs.close();\n\t\t\t\tprepStmt.close();\n\t\t\t\t//conn.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void getWantedPageFromPagination()throws Exception{\r\n SearchPageFactory pageFactory = new SearchPageFactory(driver);\r\n List<WebElement> pageOrderList = pageFactory.searchPagePaginationList;\r\n WebElement wantedPageOrder = pageOrderList.get(1);\r\n clickElement(wantedPageOrder, Constant.explicitTime);\r\n }", "@Override\n\tpublic void pagar(Habitacion habitacion) {\n\t\tif(dinero>habitacion.getPrecio()){\n\t\t\tSystem.out.println(\"reservada\");\n\t\t}\n\t}", "@Command\n\t@NotifyChange(\"*\")\n\tpublic void paginarLista(){\n\t\tint page=pagAnalistas.getActivePage();\n\t\tcambiarAnalistas(page, null, null);\n\t}", "protected void elaboraPagina() {\n testoPagina = VUOTA;\n\n //header\n testoPagina += this.elaboraHead();\n\n //body\n testoPagina += this.elaboraBody();\n\n //footer\n //di fila nella stessa riga, senza ritorno a capo (se inizia con <include>)\n testoPagina += this.elaboraFooter();\n\n //--registra la pagina principale\n if (dimensioniValide()) {\n testoPagina = testoPagina.trim();\n\n if (pref.isBool(FlowCost.USA_DEBUG)) {\n testoPagina = titoloPagina + A_CAPO + testoPagina;\n titoloPagina = PAGINA_PROVA;\n }// end of if cycle\n\n //--nelle sottopagine non eseguo il controllo e le registro sempre (per adesso)\n if (checkPossoRegistrare(titoloPagina, testoPagina) || pref.isBool(FlowCost.USA_DEBUG)) {\n appContext.getBean(AQueryWrite.class, titoloPagina, testoPagina, summary);\n logger.info(\"Registrata la pagina: \" + titoloPagina);\n } else {\n logger.info(\"Non modificata la pagina: \" + titoloPagina);\n }// end of if/else cycle\n\n //--registra eventuali sottopagine\n if (usaBodySottopagine) {\n uploadSottoPagine();\n }// end of if cycle\n }// end of if cycle\n\n }", "public interface PagedResult<T> {\r\n\r\n\t/*\r\n\t * Result code\r\n\t */\r\n\t\r\n\tpublic static final int RESULT_CODE_OK = 0;\r\n\t\r\n\tpublic static final int RESULT_CODE_KO = -1;\r\n\t\r\n\tpublic static final int FIRST_PAGE_INDEX = 1;\r\n\t\r\n\t/**\r\n\t * The method getElementCount() returns this value if the element count is unavalable\r\n\t */\r\n\tpublic final static Integer ELEMENT_COUNT_UNAVAILABLE = -1;\r\n\t\r\n\t/**\r\n\t * <p>The position of the first element of the current pages ( (currentPage-1) * perPage )</p> \r\n\t * \r\n\t * @return\toffset of the first element in this page\r\n\t */\r\n\tpublic Integer getOffset();\r\n\t\r\n\t/**\r\n\t * <p>Maximum number of elements in a page</p>\r\n\t * \r\n\t * @return\tmaximum number of elements in a page\r\n\t */\r\n\tpublic Integer getPerPage();\r\n\r\n\t/**\r\n\t * <p>Total number of elements in all pages</p>\r\n\t * \r\n\t * @return\ttotal number of elements in all pages\r\n\t */\r\n\tpublic Long getElementCount();\r\n\t\r\n\t/**\r\n\t * <p>Position of current page ( in the range 1 - n )</p>\r\n\t * \r\n\t * @return\tposition of current page\r\n\t */\r\n\tpublic Integer getCurrentPage();\t\r\n\t\r\n\t/**\r\n\t * <p>Total number of pages</p>\r\n\t * \r\n\t * @return\ttotal number of pages\r\n\t */\r\n\tpublic Integer getPageCount();\t\r\n\t\r\n\t/**\r\n\t * <p>Number of elements in current page</p>\r\n\t * \r\n\t * @return\tthe size of the current page\r\n\t */\r\n\tpublic Integer getCurrentPageSize();\r\n\t\r\n\t/**\r\n\t * <p>Elements in the current page</p>\r\n\t * \r\n\t * @return\telements in the current page\r\n\t */\r\n\tpublic Iterator<T> getPageElements();\r\n\r\n\t/**\r\n\t * <p>Elements in the current page</p>\r\n\t * \r\n\t * @return\telements in the current page\r\n\t */\r\n\tpublic List<T> getPageElementsList();\r\n\t\r\n\t/**\r\n\t * <p>Iterator over page numbers ( 1 - n )</p>\r\n\t * \r\n\t * @return\titerator over page numbers ( 1 - n )\r\n\t */\r\n\tpublic Iterator<Integer> getPageCountIterator();\r\n\t\r\n\t/**\r\n\t * Result code for this page\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic int getResultCode();\r\n\t\r\n\t/**\r\n\t * Additional info of this page.\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic Map<String, Object> getInfo();\r\n\t\r\n\t\r\n\t/** \r\n\t * <code>true</code> if this is the last page.\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic boolean isLastPage();\r\n\t\r\n\t/** \r\n\t * <code>true</code> if this is the last page.\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic boolean isFirstPage();\t\r\n\t\r\n\t\r\n\t// ******* additiona method for virtual paging *******\r\n\t\r\n\t// *******************************************************************************************\r\n\t// *******************************************************************************************\r\n\t// * VIRTUAL PAGING IS A METHOD WHERE A VIRTUAL PAGE IS MAPPED INTO A BIGGER PAGE *\r\n\t// *******************************************************************************************\r\n\t// *******************************************************************************************\r\n\t\r\n\t/**\r\n\t * Virtual search key\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic String getVirtualSearchKey();\r\n\t\r\n\tpublic Integer getRealPerPage();\r\n\t\r\n\tpublic Integer getRealCurrentPage();\r\n\t\r\n\tpublic PagedResult<T> getVirtualPage( int currentPage );\r\n\t\r\n\tpublic boolean isSupportVirtualPaging();\r\n\t\r\n\t\r\n\t// ******* additiona method for full result *******\r\n\t\r\n\t// *******************************************************************************************\r\n\t// *******************************************************************************************\r\n\t// * FULL RESULT IS A METHOD OF ACCESS PAGE WHERE ALL ELEMENTS ARE ACCESSIBLE ONLY ITERATING *\r\n\t// *******************************************************************************************\r\n\t// *******************************************************************************************\r\n\t\r\n\t/**\r\n\t * <code>true</code> if the the page contains the full result\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic boolean isFullResult();\r\n\r\n}", "@RequestMapping(\"/pagfacturasnue\")\r\n\tpublic String paginacionFacturasNue(Model modelo, @RequestParam(value = \"numPag\", required = false) String numPag,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"tpoAccion\", required = false) String tpoAccion,\r\n\t\t \t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"numPos\", required = false) String numPos,\r\n\t\t \t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"numBloquePag\", required = false) Integer numBloquePag )\r\n\t\t{\n\t\t\tint numPagInt = 0;\r\n\t\t\tint numPosInt = 0;\r\n\t\t\tHashMap<String, Integer> paramBotonera = null;\r\n\t\t\tCrearBotoneraPag botoneraPag = null;\r\n\t\t\t\r\n\t\t\tif (numBloquePag == null)\r\n\t\t\t\t{\r\n\t\t\t\tnumBloquePag = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t// La primera vez que entra\r\n\t\t\tif (numPag == null && tpoAccion == null)\r\n\t\t\t\t{\r\n\t\t\t\tnumPagInt = 0;\r\n\t\t\t\t}\r\n\t\t\t else\r\n\t\t\t\t//No es la primera vez que entra\r\n\t\t\t \t{\r\n\t\t\t\t// Ha pinchado o avance o retroceso serguro\r\n\t\t\t\tif (tpoAccion != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (tpoAccion.equals(\"avan\")) {\r\n\t\t\t\t\t\t\tnumPagInt = Integer.parseInt(numPag) + 1;\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tnumPagInt = Integer.parseInt(numPag) - 1;\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t// Ha pinchado el numero de pagina\r\n\t\t\t\t\tnumPagInt = Integer.parseInt(numPag);\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tPage<Factura> pagFactura= servJPAFactura.paginacionFacturas(new Integer(numPagInt), ConstantesAplicacion.REG_POR_PAGINA);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tmodelo.addAttribute(\"pagGenerica\", pagFactura);\r\n\t\t\tmodelo.addAttribute(\"numPag\", String.valueOf(numPagInt));\r\n\t\t\tmodelo.addAttribute(\"numRegPag\", pagFactura.getContent().size());\r\n\t\t\t\r\n\t\t// \tmodelo.addAttribute(\"numTotalReg\", pagCliente.getTotalElements());\r\n\t\t\r\n\t\t\ttry\r\n\t\t\t {\r\n\t\t\t botoneraPag = new CrearBotoneraPag();\r\n\t\t\t paramBotonera = CrearBotoneraPag.calculaNumPagBotoneraNue(numPagInt, tpoAccion, numPos, pagFactura.getTotalElements(), new Double(numBloquePag.intValue()) );\r\n\t\t\t }\r\n\t\t\tcatch (Exception exp)\r\n\t\t\t {\r\n\t\t\t\texp.printStackTrace();\r\n\t\t\t }\r\n\t\t\t\r\n\t\t\tmodelo.addAttribute(\"numPagVisibles\", paramBotonera.get(\"numPagVisibles\") );\r\n\t\t\t\r\n\t\t\tmodelo.addAttribute(\"numPagWeb1\", paramBotonera.get(\"numPagWeb1\") );\r\n\t\t\tmodelo.addAttribute(\"numPagWeb2\", paramBotonera.get(\"numPagWeb2\") );\r\n\t\t\tmodelo.addAttribute(\"numPagWeb3\", paramBotonera.get(\"numPagWeb3\") );\r\n\t\t\tmodelo.addAttribute(\"numPagWeb4\", paramBotonera.get(\"numPagWeb4\") );\r\n\t\t\tmodelo.addAttribute(\"numPagWeb5\", paramBotonera.get(\"numPagWeb5\") );\r\n\r\n\t\t\tmodelo.addAttribute(\"linkBotonAnt\", \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + numPagInt + \"&tpoAccion=ant\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\tmodelo.addAttribute(\"linkBoton1\", \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + paramBotonera.get(\"numPaginaReal1\") + \"&numPos=1\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\tmodelo.addAttribute(\"linkBoton2\", \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + paramBotonera.get(\"numPaginaReal2\") + \"&numPos=2\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\tmodelo.addAttribute(\"linkBoton3\", \t \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + paramBotonera.get(\"numPaginaReal3\") + \"&numPos=3\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\tmodelo.addAttribute(\"linkBoton4\", \t \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + paramBotonera.get(\"numPaginaReal4\") + \"&numPos=4\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\tmodelo.addAttribute(\"linkBoton5\", \t \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + paramBotonera.get(\"numPaginaReal5\") + \"&numPos=5\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\tmodelo.addAttribute(\"linkBotonAvan\", \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + numPagInt + \"&tpoAccion=avan\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\t\r\n\t\t // Si ha pinchado avance o retroceso de pagina.\r\n\t\t\tif (tpoAccion != null)\r\n\t\t\t\t{\r\n\t\t\t\t// Detectamoos cambio de bloque ponerlo\r\n\t\t\t\tif (paramBotonera.get(\"numBloquePag\").intValue() != numBloquePag.intValue() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif (tpoAccion.equals(\"avan\")) {\r\n\t\t\t\t\t\tnumPosInt = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tnumPosInt = 5;\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{\r\n\t\t\t\t// Si es el mismo bloque la paginacion\r\n\t\t\t\t\t\tif (paramBotonera.get(\"numBloquePag\").intValue() == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tnumPosInt = numPagInt + 1;\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{\r\n\t\t\t\t\t\tnumPosInt = numPagInt - 5 ;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t else\r\n\t\t\t\t{\r\n\t\t\t\t // Si es primera vez que entra\r\n\t\t\t\t if (numPos == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t numPosInt = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t else\r\n\t\t\t\t\t{\t\r\n\t\t\t\t\t // Si ha pinchado boton pagina\r\n\t \t\t\t numPosInt = Integer.parseInt(numPos);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tswitch (numPosInt) {\r\n\t\t\tcase 1:\r\n\t\t\t\tmodelo.addAttribute(\"numPagAct1\", \"S\" );\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tmodelo.addAttribute(\"numPagAct2\", \"S\" );\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tmodelo.addAttribute(\"numPagAct3\", \"S\" );\r\n\t\t\t\tbreak;\r\n\t\t\tcase 4:\r\n\t\t\t\tmodelo.addAttribute(\"numPagAct4\", \"S\" );\r\n\t\t\t\tbreak;\r\n\t\t\tcase 5:\r\n\t\t\t\tmodelo.addAttribute(\"numPagAct5\", \"S\" );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( pagFactura.isLast() )\r\n\t\t\t\t{\r\n\t\t\t\tmodelo.addAttribute(\"indUltPag\", \"S\");\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\tmodelo.addAttribute(\"indUltPag\", \"N\");\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tmodelo.addAttribute(\"opcionesMenuUsuario\", beanUsuarioSession.getListBeanMenuUsuarioSession());\r\n\t\t\t\r\n\t\t\treturn \"gestionWeb/facturas/PagFacturas\";\r\n\t\t}", "public void validarPago(){\n RequestContext context = RequestContext.getCurrentInstance(); \n pago = new funciones().redondearMas(pago,2);\n intereses = new funciones().redondearMas(intereses,2);\n mora = new funciones().redondearMas(mora,2);\n if(pago < 0){\n pagoValido = false;\n new funciones().setMsj(3,\"Pago no puede ser Negativo\");\n }else if(pago == 0){\n new funciones().setMsj(3,\"Pago debe ser mayor a 0.00\");\n pagoValido = false;\n }else{\n float saldoActual = new funciones().redondearMas(facturaCredito.getSaldoCreditoCompra().floatValue(),2);\n if(pago <= saldoActual){\n if(intereses < 0 || mora < 0){\n //pago invalido\n pagoValido = false;\n new funciones().setMsj(3,\"Monto de INTERESES o MORA negativo\");\n }else{\n //PAGO VALIDO\n pagoValido = true;\n //calcular nuevo Saldo\n nuevoSaldo = new funciones().redondearMas(saldoActual - pago,2);\n }\n }else{\n //pago invalido\n pagoValido = false;\n new funciones().setMsj(2,\"Pago mayor que SALDO ACTUAL\");\n }\n }\n context.addCallbackParam(\"validar\", pagoValido);\n \n }", "public List<Pago> findByEmpresa(Empresa empresa);", "public void buscarMovCtaCtePorPagar(ExpedientePrevision expPrev) throws Exception {\r\n\t\tList<Movimiento> lstMov = null;\r\n\t\tInteger intParaTipoConcepto = null;\r\n\r\n\t\ttry {\r\n\t\t\tswitch (expPrev.getIntParaDocumentoGeneral()) {\r\n\t\t\tcase (102): //Constante.PARAM_T_DOCUMENTOGENERAL_FONDOSEPELIO\r\n\t\t\t\tintParaTipoConcepto = Constante.PARAM_T_CUENTACONCEPTO_SEPELIO;\r\n\t\t\t\tbreak;\r\n\t\t\tcase (103): //Constante.PARAM_T_DOCUMENTOGENERAL_FONDORETIRO\r\n\t\t\t\tintParaTipoConcepto = Constante.PARAM_T_CUENTACONCEPTO_RETIRO;\r\n\t\t\t\tbreak;\r\n//\t\t\tcase Constante.PARAM_T_DOCUMENTOGENERAL_FONDOSEPELIO:\r\n//\t\t\t\tintParaTipoConcepto = Constante.PARAM_T_CUENTACONCEPTO_SEPELIO;\r\n//\t\t\t\tbreak;\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tlstMov = conceptoFacade.getListaMovVtaCtePorPagar(expPrev.getId().getIntPersEmpresaPk(), expPrev.getId().getIntCuentaPk(), expPrev.getId().getIntItemExpediente(), intParaTipoConcepto,expPrev.getIntParaDocumentoGeneral());\r\n\t\t\tif (lstMov!=null && !lstMov.isEmpty()) {\r\n\t\t\t\tfor (Movimiento movimiento : lstMov) {\r\n\t\t\t\t\texpedientePrevisionGirar.setMovimiento(movimiento);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else expedientePrevisionGirar.setMovimiento(null);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.error(\"Error al buscarMovCtaCtePorPagar: \"+e.getMessage(),e);\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\r\n\tprotected String go() throws Exception {\n\t\tif(userSize==0)\r\n\t\t{\r\n\t\t\tuserSize=3;\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tint userid=(Integer)this.get(\"currentUserid\");\r\n\t\t\tProDiaryService proDiaryService=(ProDiaryService)this.getBean(\"proDiaryService\");\r\n\t\t\t\r\n\t\t\tpage=proDiaryService.getCurrProDiaryListByUserID(userid,userSize,pageNo);\r\n\t\t\tPagefoot pagefoot = new Pagefoot();\r\n\t\t\tpageString = pagefoot.packString(page, pageNo,\"getPage\",userSize);\r\n\t\t\t \r\n\t\t\t}catch(Exception e){\r\n\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t}\r\n\t return \"success\";\r\n\t}", "public void introducirPagosALojamientoHotelFechas(Date fechaInicial, Date fechaFinal,TablaModelo modelo){\n long tiempo = fechaInicial.getTime();\n java.sql.Date fechaInicialSql = new java.sql.Date(tiempo);\n long tiempo2= fechaFinal.getTime();\n java.sql.Date fechaFinalSQL = new java.sql.Date(tiempo2);\n try {\n PreparedStatement declaracion;// prepara la orden \n declaracion = conexion.prepareStatement(\"SELECT ALOJAMIENTO.Id,ALOJAMIENTO.Id_Reservacion,RESERVACION.Fecha_Entrada, RESERVACION.Fecha_Salida,RESERVACION.Precio FROM RESERVACION JOIN ALOJAMIENTO WHERE RESERVACION.Id=ALOJAMIENTO.Id_Reservacion AND RESERVACION.Fecha_Entrada>=? AND RESERVACION.Fecha_Entrada<=? AND RESERVACION.Check_In=1;\");\n declaracion.setDate(1,fechaInicialSql);\n declaracion.setDate(2,fechaFinalSQL);// pago de alojamiento en rango fchas\n ResultSet resultado = declaracion.executeQuery();\n while (resultado.next()) {\n Object objeto[] = new Object[6];// pago de alojamiento en rango fchas\n objeto[0] = resultado.getInt(1);\n objeto[1] = resultado.getInt(2);\n objeto[2] = resultado.getDate(3);\n objeto[3] = resultado.getDate(4);// pago de alojamiento en rango fchas\n objeto[4] = resultado.getInt(5);\n String fechaInicialProbar=objeto[2].toString();\n String fechaFinalProbar=objeto[3].toString();// pago de alojamiento en rango fchas\n String precioProbar = objeto[4].toString();// pago de alojamiento en rango fchas\n int total=habitacion.hacerTotalAlojamiento(fechaInicialProbar, fechaFinalProbar, precioProbar);\n objeto[5]= total;\n modelo.addRow(objeto);\n } // maneja el resultado \n\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }", "private int retornaPerPageEsperado(int page) {\n return given().\n param(\"page\",page).\n when().\n get(LISTA_USUARIOS_ENDPOINT).\n then().\n // faz de novo a requisicao pra checar se realmente bateu no endpoint\n statusCode(HttpStatus.SC_OK).\n // extrai o valor do campo per_page e atribui a variavel\n extract().\n path(\"per_page\");\n }", "void findWithPagination(Pagination<Task, Project> pagination);", "@Override\n public List<Produto> filtrarProdutos() {\n\n Query query = em.createQuery(\"SELECT p FROM Produto p ORDER BY p.id DESC\");\n\n// query.setFirstResult(pageRequest.getPageNumber() * pageRequest.getPageSize());\n// query.setMaxResults(pageRequest.getPageSize());\n return query.getResultList();\n }", "@Override\r\n\tpublic String paging(String sql) {\n\t\treturn null;\r\n\t}", "public List<Respuesta> getRespuestas(Pregunta q, int pageSize, int page, boolean crono);", "long buscarPrimeiro();", "private boolean pagarMedico(PersMedico medico) throws Exception {\n CuenBancaria cuenta = obtenerCuentaMedico(medico);\n //Obtener atenciones de este mes\n ArrayList<AtencionAgen> atencionesDelMes = obtenerAtencionesDelMes(medico);\n //Obtener pagos de atenciones no devueltas\n ArrayList<Pago> pagos = obtenerPagosNoDevueltos(atencionesDelMes);\n int honorarios = calcularHonorarios(medico, pagos);\n if(honorarios == 0){\n throw new Exception(\"Los honorarios no pueden ser 0\");\n }\n try {\n //aqui deberia ir la llamada a la api del banco\n registrarPagoHonorarios(cuenta, honorarios);\n return true;\n } catch (Exception e) {\n return false;\n }\n }", "public List<UserVO> pagingUser(Criteria cri);", "public void pagarFerrovia(int credor, int devedor, int valor, String NomePopriedade) {\n\n Jogador JogadorDevedor = listaJogadores.get(devedor);\n Jogador JogadorCredor = listaJogadores.get(credor);\n if ((NomePopriedade.equals(\"Reading Railroad\")) ||\n (NomePopriedade.equals(\"Pennsylvania Railroad\")) ||\n (NomePopriedade.equals(\"B & O Railroad\")) ||\n (NomePopriedade.equals(\"Short Line Railroad\"))) {\n int quantidadeFerrovias = DonosFerrovias[credor];\n int divida = quantidadeFerrovias * valor;\n this.print(\"Credor tem \" + quantidadeFerrovias);\n this.print(\"Divida eh \" + divida);\n\n if (listaJogadores.get(devedor).getDinheiro() >= divida) {\n JogadorDevedor.retirarDinheiro(divida);\n JogadorCredor.addDinheiro(divida);\n this.print(\"aqui\");\n\n } else {\n int DinheiroRestante = listaJogadores.get(devedor).getDinheiro();\n JogadorDevedor.retirarDinheiro(DinheiroRestante);\n\n if(bankruptcy);\n\n else\n JogadorCredor.addDinheiro(DinheiroRestante);\n this.removePlayer(devedor);\n\n }\n\n }\n }", "List<Registration> allRegUserPagination(long idUser, int currentPage, int elementPerPage);", "@GetMapping(\"/pagina\")\t\n\tpublic ResponseEntity<?> listar(Pageable pageable) {\n\t\tPageable pageableEnv = PageRequest.of(pageable.getPageNumber() - 1, pageable.getPageSize());\n\t\treturn ResponseEntity.ok().body(service.findAll(pageableEnv));\n\t}", "@Override\r\n\tpublic ActionForward execute(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\tint pageSize = 10; // 한 페이지 당 출력될 글의 개수 지정\r\n\t\t\r\n\t\tString pageNum = request.getParameter(\"pageNum\"); // 페이지 번호를 받아온다.\r\n\t\tif(pageNum == null) {\r\n\t\t\tpageNum = \"1\"; // 페이지 번호를 눌러서 들어오지 않으면 게시판 1page를 보여준다.\r\n\t\t}\r\n\t\t\r\n\t\t// 페이지 번호를 사용해서 페이징 처리 시 연산을 수행할 것이므로\r\n\t\t// 페이지 번호값을 정수타입으로 변경\r\n\t\tint currentPage = Integer.parseInt(pageNum);\r\n\t\t\r\n\t\t// 해당 페이지에 출력되는 글들 중 가장 먼저 출력되는 글의 레코드 번호\r\n\t\tint startRow = (currentPage - 1) * pageSize + 1;\r\n\t\t// 현재 페이지 : 1\r\n\t\t// (1 - 1) * pageSize + 1 ---------> 1\r\n\t\t// 현재 페이지 : 2\r\n\t\t// (2 - 1) * pageSize + 1 ---------> 11\r\n\t\t\r\n\t\tint count = 0;\r\n\t\t// count : 총 글의 개수를 저장할 변수\r\n\t\tint number = 0;\r\n\t\t// number : 해당 페이지에 가장 먼저 출력되는 글의 번호\r\n\t\t\r\n\t\tList<ReservationInfo> reservationList = null; // 글 정보를 저장할 리스트\r\n\t\t// 해당 페이지에 출력되는 글 목록을 저장할 컬렉션\r\n\t\t\r\n\t\t// 비지니스 로직 처리를 위해 서비스 객체 생성\r\n\t\tReservationListService reservationListService = new ReservationListService();\r\n\t\t\r\n\t\tcount = reservationListService.getReservationCount(); // 총 예약의 개수를 가져온다.\r\n\t\tif(count > 0) { \r\n\t\t\t// 예약이 하나라도 있으면 리스팅할 예약 정보 얻어오기\r\n\t\t\treservationList = reservationListService.getReservationList(startRow, pageSize); // 해당 페이지의 레코드 10개씩 가져온다.\r\n\t\t}\r\n\t\t\r\n\t\t// 전체 페이지에서 현재페이지 -1을 해서 pageSize를 곱한다.\r\n\t\tnumber = count - (currentPage - 1) * pageSize;\r\n\t\t// 총 글의 개수 : 134\r\n\t\t// 현재 페이지 : 1\r\n\t\t// 134 - (1 - 1) * 10 -------> 134\r\n\t\t\r\n\t\tint startPage = 0;\r\n\t\tint pageCount = 0;\r\n\t\tint endPage = 0;\r\n\t\t\r\n\t\tif(count > 0) { // 글이 하나라도 존재하면...\r\n\t\t\tpageCount = count / pageSize + (count % pageSize == 0 ? 0 : 1);\r\n\t\t\t// 총 페이지 개수를 구함.\r\n\t\t\t// ex) 총 글의 개수 13개이면 페이지는 2개 필요..\r\n\t\r\n\t\t\tstartPage = ((currentPage -1) / pageSize) * pageSize + 1;\r\n\t\t\t// 현재 페이지 그룹의 첫번째 페이지를 구함.\r\n\t\t\t// [1][2][3][4][5][6][7]...[10] -------> 처음 페이지 그룹\r\n\t\t\t// 다음 페이지 스타트 페이지 : [11][12][13]....[20]\r\n\t\t\t\t\t\r\n\t\t\tint pageBlock = 10;\r\n\t\t\tendPage = startPage + pageBlock - 1;\r\n\t\t\t\r\n\t\t\t// 마지막 페이지 그룹인 경우..\r\n\t\t\tif(endPage > pageCount) endPage = pageCount;\r\n\t\t}\r\n\t\t\r\n\t\t// 포워딩 하기 전, 가져 온 글 공유\r\n\t\trequest.setAttribute(\"reservationList\", reservationList);\r\n\t\tPageInfo pageInfo = new PageInfo(); // 페이지에 관한 정보를 처리하는 객체 생성\r\n\t\tpageInfo.setCount(count);\r\n\t\tpageInfo.setCurrentPage(currentPage);\r\n\t\tpageInfo.setEndPage(endPage);\r\n\t\tpageInfo.setNumber(number);\r\n\t\tpageInfo.setPageCount(pageCount);\r\n\t\tpageInfo.setStartPage(startPage);\r\n\t\t\r\n\t\trequest.setAttribute(\"pageInfo\", pageInfo);\r\n\t\tActionForward forward = new ActionForward();\r\n\t\tforward.setUrl(\"/pc/reservationList.jsp\"); // list.jsp 페이지 포워딩\r\n\t\t\r\n\t\treturn forward;\r\n\t}", "@Override\n\tpublic void onLoadMore() {\n\t\tpage++;\n\t\texecutorService.submit(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public interface PaginatedResult<T> {\n\n\t/**\n\t * Get the contents as an array of component type\n\t */\n\tpublic T[] items();\n\n\t/**\n\t * Obtain params required to perform the given relative query\n\t */\n\tpublic abstract PaginatedResult<T> first() throws AblyException;\n\tpublic abstract PaginatedResult<T> current() throws AblyException;\n\tpublic abstract PaginatedResult<T> next() throws AblyException;\n\n\tpublic abstract boolean hasFirst();\n\tpublic abstract boolean hasCurrent();\n\tpublic abstract boolean hasNext();\n}", "private <E> List<E> pageQuery(Invocation invocation,BoundSql boundSql) {\n MappedStatement mappedStatement = (MappedStatement)invocation.getArgs()[0];\n Object parameter = invocation.getArgs()[1];\n RowBounds rowBounds = (RowBounds)invocation.getArgs()[2];\n ResultHandler resultHandler = (ResultHandler)invocation.getArgs()[3];\n Executor executor = (Executor)invocation.getTarget();\n CacheKey cacheKey = executor.createCacheKey(mappedStatement, parameter, rowBounds, mappedStatement.getBoundSql(parameter));\n createParamMappingToBoundSql(mappedStatement,boundSql,cacheKey);\n createParamObjectToBoundSql(mappedStatement,boundSql);\n String pageSql = getPageSql(boundSql);\n //创建新的BoundSql对象\n BoundSql newboundSql = new BoundSql(mappedStatement.getConfiguration(), pageSql, boundSql.getParameterMappings(), boundSql.getParameterObject());\n List<E> result = null;\n try {\n boundSqlAdditionalParameterCopy(newboundSql,boundSql);\n result = executor.query(mappedStatement, parameter, rowBounds, resultHandler, cacheKey, newboundSql);\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n } catch (NoSuchFieldException e) {\n e.printStackTrace();\n }\n return result;\n }", "@Override\n @Transactional\n public Page pageQuery(String orgcode, String cnname, String startdate, String enddate, String pageno) {\n p.setPageno(Integer.parseInt(pageno));\n List<En> ens = ed.pageQuery(orgcode,cnname,startdate,enddate);\n p.setTotalsize(ens.size());\n p.setTotalpage((p.getTotalsize()%p.getPagesize())==0?p.getTotalsize()/p.getPagesize():p.getTotalsize()/p.getPagesize()+1);\n PageHelper.startPage(Integer.parseInt(pageno),p.getPagesize());\n List<En> ens1 = ed.pageQuery(orgcode,cnname,startdate,enddate);\n p.setInvs(ens1);\n return p;\n }", "public void buscarDatos() throws Exception {\r\n try {\r\n String parameter = lbxParameter.getSelectedItem().getValue()\r\n .toString();\r\n String value = tbxValue.getValue().toUpperCase().trim();\r\n\r\n Map<String, Object> parameters = new HashMap();\r\n parameters.put(\"parameter\", parameter);\r\n parameters.put(\"value\", \"%\" + value + \"%\");\r\n\r\n getServiceLocator().getHospitalizacionService().setLimit(\r\n \"limit 25 offset 0\");\r\n\r\n List<Hospitalizacion> lista_datos = getServiceLocator()\r\n .getHospitalizacionService().listar(parameters);\r\n rowsResultado.getChildren().clear();\r\n\r\n for (Hospitalizacion hospitalizacion : lista_datos) {\r\n rowsResultado.appendChild(crearFilas(hospitalizacion, this));\r\n }\r\n\r\n gridResultado.setVisible(true);\r\n gridResultado.setMold(\"paging\");\r\n gridResultado.setPageSize(20);\r\n\r\n gridResultado.applyProperties();\r\n gridResultado.invalidate();\r\n gridResultado.setVisible(true);\r\n\r\n } catch (Exception e) {\r\n MensajesUtil.mensajeError(e, \"\", this);\r\n }\r\n }", "public void pagar(int precio){\r\n this.dinero -=precio;\r\n }", "@Override\n\tprotected String getPaginaMantenimiento() throws Exception {\n\t\treturn null;\n\t}", "@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}", "public ArrayList<clsPago> consultaDataPagosCuotaInicial(int codigoCli)\n { \n ArrayList<clsPago> data = new ArrayList<clsPago>(); \n try{\n bd.conectarBaseDeDatos();\n sql = \" SELECT a.id_pagos_recibo idPago, a.id_usuario, b.name name_usuario, \"\n + \" a.referencia referencia, \"\n + \" a.fecha_pago fecha_pago, a.estado, \"\n + \" a.valor valor_pago, a.id_caja_operacion, e.name_completo nombre_cliente, \"\n + \" a.fecha_pago fecha_registro\"\n + \" FROM ck_pagos_recibo AS a\"\n + \" JOIN ck_usuario AS b ON a.id_usuario = b.id_usuario\"\n + \" JOIN ck_cliente AS e ON a.codigo = e.codigo\"\n + \" WHERE a.estado = 'A'\"\n + \" AND a.cuota_inicial = 'S'\"\n + \" AND a.estado_asignado = 'N'\"\n + \" AND a.codigo = \" + codigoCli; \n \n System.out.println(sql);\n bd.resultado = bd.sentencia.executeQuery(sql);\n \n if(bd.resultado.next())\n { \n do \n { \n clsPago oListaTemporal = new clsPago();\n \n oListaTemporal.setReferencia(bd.resultado.getString(\"referencia\"));\n oListaTemporal.setFechaPago(bd.resultado.getString(\"fecha_pago\"));\n oListaTemporal.setNombreUsuario(bd.resultado.getString(\"name_usuario\"));\n oListaTemporal.setNombreCliente(bd.resultado.getString(\"nombre_cliente\"));\n oListaTemporal.setValor(bd.resultado.getDouble(\"valor_pago\"));\n oListaTemporal.setFechaRegistro(bd.resultado.getString(\"fecha_registro\"));\n oListaTemporal.setIdPago(bd.resultado.getInt(\"idPago\"));\n data.add(oListaTemporal);\n }\n while(bd.resultado.next()); \n //return data;\n }\n else\n { \n data = null;\n } \n }\n catch(Exception ex)\n {\n System.out.print(ex);\n data = null;\n } \n bd.desconectarBaseDeDatos();\n return data;\n }", "private void listar(HttpPresentationComms comms, String _operacion) throws HttpPresentationException, KeywordValueException {\n/* 219 */ activarVista(\"consulta\");\n/* 220 */ if (_operacion.equals(\"X\")) {\n/* */ return;\n/* */ }\n/* */ \n/* */ \n/* 225 */ PrcRecursoDAO ob = new PrcRecursoDAO();\n/* 226 */ Collection<PrcRecursoDTO> arr = ob.cargarTodos();\n/* 227 */ HTMLTableSectionElement hte = this.pagHTML.getElementDetalle();\n/* 228 */ int cuantas = 0;\n/* 229 */ Iterator<PrcRecursoDTO> iterator = arr.iterator();\n/* 230 */ while (iterator.hasNext()) {\n/* 231 */ PrcRecursoDTO reg = (PrcRecursoDTO)iterator.next();\n/* 232 */ HTMLElement eltr = (HTMLElement)this.pagHTML.createElement(\"tr\");\n/* 233 */ eltr.appendChild(newtd(\"\" + reg.getIdRecurso()));\n/* 234 */ String url = \"PrcRecurso.po?_operacion=V&idRecurso=\" + reg.getIdRecurso() + \"\";\n/* 235 */ eltr.appendChild(newtdhref(\"\" + reg.getNombreIdTipoRecurso(), url));\n/* 236 */ eltr.appendChild(newtd(\"\" + reg.getDescripcionRecurso()));\n/* 237 */ eltr.appendChild(newtd(\"\" + reg.getNombreIdProcedimiento()));\n/* 238 */ eltr.appendChild(newtd(\"\" + reg.getNombreEstado()));\n/* 239 */ hte.appendChild(eltr);\n/* 240 */ cuantas++;\n/* */ } \n/* 242 */ arr.clear();\n/* 243 */ this.pagHTML.setTextNroRegistros(\"\" + cuantas);\n/* */ }", "@Override\n\tpublic int getTotalPage(Integer pageSize, EmpTypeVo vo) {\n\t\treturn 0;\n\t}", "@PostMapping(\"/J314Authorities.querypaged\")\n\t@Timed\n\n\t@Transactional\n\t\n\tpublic ResultExt< Page< J314AuthorityPoj >> queryCritPaged(HttpServletRequest request,HttpServletResponse response, @Valid @RequestBody J314AuthorityCritPaged param)\n\t{\n\t\t\n\t\tString params=UtilParams.paramsToString(\"J314AuthorityCritPaged\",param);\n\n\t\tContexto ctx = Contexto.init();\n\t\tctx.put(Contexto.REQUEST,request);\n\t\tctx.put(Contexto.RESPONSE,response);\n\t\tctx.put(Contexto.CLAVE_SEGURIDAD,\"REST_ENTITY_J314AUTHORITY_QUERYCRITPAGED\");\n\t\tctx.put(Contexto.URL_SOLICITADA,\"/J314Authorities.querypaged\");\n\t\tResult< Page< J314AuthorityPoj >> res=new Result<>();\n\t\tif (log.isInfoEnabled()) log.info(\"Entrada en REST POST:queryCritPaged(\"+params+\")\"+params);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tif(!verificaPermisos(\"REST_ENTITY_J314AUTHORITY_QUERYCRITPAGED\"))\n\t\t\t{\n\t\t\t\tres.addError(new ErrorSinPermiso(\"REST_ENTITY_J314AUTHORITY_QUERYCRITPAGED\",\"/J314Authorities.querypaged\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tparams=UtilParams.paramsToString(\"J314AuthorityCritPaged\",param);\n\t\t\t\tif (log.isInfoEnabled()) log.info(\"Verificado en REST POST:queryCritPaged(\"+params+\")\"+params);\n\n\t\t\t\tJ314AuthorityCritPaged param_ = param;\n\n\t\t\t\tResult< Page< J314Authority > > res_=service.listByCriteriaPaged(param_);\n\t\t\t\tres.setInfoEWI(res_);\n\n\t\t\t\tres.setData(J314AuthorityPoj.toPOJOPage(res_.getData()));\n\n\t\t\t}\n\t\t\taddTiempoSesion();\n\t\t}\tcatch(Exception e)\n\t\t{\n\t\t\tres.addError(new ErrorGeneral(e));\n\t\t\tif (log.isErrorEnabled()) log.error(\"Error en REST POST:queryCritPaged(\"+params+\"). Excepcion:\"+UtilException.printStackTrace(e));\n\t\t}\n\t\tif (log.isInfoEnabled()) log.info(\"Salida de REST POST:queryCritPaged(\"+params+\"). Resultado:\"+res.toString());\n\n\t\tif (!res.isOk())\n\t\t{\n\t\t\ttry {\t\n\t\t\t\tTransactionInterceptor.currentTransactionStatus().setRollbackOnly();\n\t\t\t}catch(Throwable t)\n\t\t\t{\n\t\t\t\tres.addError(new ErrorGeneral(t));\n\t\t\t\tif (log.isErrorEnabled()) log.error(\"Error en REST POST:queryCritPaged(\"+params+\"). Excepcion:\"+UtilException.printStackTrace(t));\n\t\t\t}\n\t\t}\n\n\t\tResultExt< Page< J314AuthorityPoj > > resFin=new ResultExt<>(res,ctx.getAs(\"ticketStr\"));\n\t\tContexto.close();\n\t\treturn resFin;\n\t}", "long buscarUltimo();", "boolean pagarLibertad(int PrecioLibertad){\n boolean tengoSaldo = this.tengoSaldo(PrecioLibertad);\n \n if(tengoSaldo){\n this.modificarSaldo(-PrecioLibertad);\n }\n \n return tengoSaldo;\n }", "@Query(\"select u from User u where u.role = 'EMPLOYEE' order by u.hireDay desc\")\n List<Task> getLatestHiredEmployees(Pageable pageable);", "public TransmitirResponse transmitirPago(TransmitirPagoRequest tramitePagoRequest) {\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"======================\");\r\n\t\t\tSystem.out.println(\"Inicio: transmitirPago\");\r\n\r\n\t\t\t//1: Se recupera el CDA pagado\r\n\t\t\tBeanTasa tasa = new BeanTasa(); \r\n\t\t\ttasa.setCda(tramitePagoRequest.getCda());\r\n\t\t\ttasa.setMontoPago(tramitePagoRequest.getMonto());\r\n\t\t\ttasa.setFechaPago(tramitePagoRequest.getFechaPago());\r\n\r\n\t\t\t//2: Se actualiza el pago de la Tasa\r\n\t\t\tServicioTasa servicioTasa = new ServicioTasa();\r\n\t\t\tservicioTasa.pagarTasa(tasa);\r\n\r\n\t\t\t//3: Según el CDA pagado, se obtiene la orden y otros datos importantes\r\n\t\t\tBeanFormato formato = new BeanFormato();\r\n\t\t\tServicioOrden servicioOrden = new ServicioOrden();\r\n\t\t\tBeanOrden orden = servicioOrden.buscarOrdenPorCda(tasa.getCda());\r\n\t\t\torden = servicioOrden.buscarOrdenPorOrdenId(orden.getOrdenId(), formato);\r\n\t\t\tBeanTce tce = servicioOrden.buscarTcePorOrdenId(orden.getOrdenId());\r\n\t\t\tBeanMto mto = servicioOrden.buscarMtoVigentePorOrdenId(orden.getOrdenId());\r\n\t\t\tBeanFormatoEntidad formatoEntidad = servicioOrden.buscarFormatoEntidadPorFormato(formato.getFormato(), mto);\r\n\t\t\tBeanAdjunto adjunto = servicioOrden.buscarAdjuntoPorMto(mto);\r\n\t\t\tBeanUsuario usuarioSolicitante = servicioOrden.buscarUsuarioSolicitantePorMto(mto);\r\n\r\n\t\t\t// 2.1: Registrar estado traza 4: Pago Recibido\r\n\t\t\tBeanTraza traza = new BeanTraza();\r\n\t\t\ttraza.setEstadoTraza(4);\r\n\t\t\ttraza.setDe(4);\r\n\t\t\ttraza.setPara(3);\r\n\t\t\tservicioOrden.registrarTraza(tce, mto, null, null, traza);\r\n\r\n\t\t\t//5: Genera la SUCE\r\n\t\t\tServicioSuce servicioSuce = new ServicioSuce();\r\n\t\t\tBeanSuce suce = servicioSuce.generarSuce(orden);\r\n\r\n\t\t\t//6: Se genera el nuevo MTO\r\n\t\t\t//TODO generar nuevo mto, incluye registrar otra vez la orden\r\n\r\n\t\t\t//7: Se transmite la SUCE\r\n\t\t\tservicioSuce.transmitirSuceHaciaEntidad(formato, orden, suce, formatoEntidad, adjunto, usuarioSolicitante.getRuc());\r\n\r\n\t\t\t// 2.1: Registrar estado traza 5: Suce generada\r\n\t\t\ttraza = new BeanTraza();\r\n\t\t\ttraza.setEstadoTraza(5);\r\n\t\t\ttraza.setDe(3);\r\n\t\t\ttraza.setPara(2);\r\n\t\t\tservicioOrden.registrarTraza(tce, mto, null, null, traza);\r\n\r\n\t\t\t//8: Transmitir SUCE a Usuario\r\n\t\t\t//TODO Transmitir SUCE a Usuario\r\n\r\n\t\t\tSystem.out.println(\"Fin\");\r\n\t\t\tSystem.out.println(\"======================\");\r\n\r\n\t\t\tTransmitirResponse res = new TransmitirResponse();\r\n\t\t\tres.setCodigo(suce.getSuce()+\"\");\r\n\t\t\tres.setTexto(\"Exito\");\r\n\t\t\treturn res;\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t\tTransmitirResponse res = new TransmitirResponse();\r\n\t\t\tres.setCodigo(\"ERR\");\r\n\t\t\tres.setTexto(\"Error\");\r\n\t\t\treturn res;\r\n\t\t}\r\n\t}", "public static String doPaginationResponseFormlet(HttpServletRequest request, Paginator paginator, List page) {\n request.setAttribute(\"pageRows\", page);\n return \"success\";\n }", "List<Venta1> consultarVentaPorFecha(Date desde, Date hasta, Persona cliente) throws Exception;", "long buscarProximo(long id);", "@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}", "@Override\r\n public List<Prova> consultarTodosProva() throws Exception {\n return rnProva.consultarTodos();\r\n }", "@Query(\"SELECT x \"\n + \" FROM Invtipousuario x \"\n + \"WHERE\" \n + \" (:idtipousuario is null or :idtipousuario = x.idtipousuario ) \"\n + \" and (:rollusuario is null or x.rollusuario = :rollusuario ) \"\n + \" ORDER BY x.idtipousuario ASC \")\n Page<Invtipousuario> findByFilters(Pageable page ,@Param(\"idtipousuario\") String idtipousuario ,@Param(\"rollusuario\") String rollusuario);", "@Override\r\n public List<Funcionario> consultarTodosFuncionarios() throws Exception {\n return rnFuncionario.consultarTodos();\r\n }", "@Override\n\tpublic void emprestimo(Livros livro, Aluno usuario) {\n\t\t\n\t}", "boolean hasPagination();", "boolean hasPagination();", "boolean hasPagination();", "boolean hasPagination();", "boolean hasPagination();", "boolean hasPagination();", "int getPage();", "public void buscarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tString codigo_empresa = empresa.getCodigo_empresa();\r\n\t\t\tString codigo_sucursal = sucursal.getCodigo_sucursal();\r\n\t\t\tString parameter = lbxParameter.getSelectedItem().getValue()\r\n\t\t\t\t\t.toString();\r\n\t\t\tString value = tbxValue.getValue().toUpperCase().trim();\r\n\r\n\t\t\tMap<String, Object> parameters = new HashMap();\r\n\t\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\t\tparameters.put(\"parameter\", parameter);\r\n\t\t\tparameters.put(\"value\", \"%\" + value + \"%\");\r\n\r\n\t\t\tgetServiceLocator().getHis_partoService().setLimit(\r\n\t\t\t\t\t\"limit 25 offset 0\");\r\n\r\n\t\t\tList<His_parto> lista_datos = getServiceLocator()\r\n\t\t\t\t\t.getHis_partoService().listar(parameters);\r\n\t\t\trowsResultado.getChildren().clear();\r\n\r\n\t\t\tfor (His_parto his_parto : lista_datos) {\r\n\t\t\t\trowsResultado.appendChild(crearFilas(his_parto, this));\r\n\t\t\t}\r\n\r\n\t\t\tgridResultado.setVisible(true);\r\n\t\t\tgridResultado.setMold(\"paging\");\r\n\t\t\tgridResultado.setPageSize(20);\r\n\r\n\t\t\tgridResultado.applyProperties();\r\n\t\t\tgridResultado.invalidate();\r\n\t\t\tgridResultado.setVisible(true);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\t}", "private void parametrizarPagingControl() throws Exception {\r\n\t\tlog.info(\"Ejecutando metodo [parametrizarPagingControl()]...\");\r\n\r\n\t\tidMCRZPGCTRLMaestro.setComponenteReferencia(idMCRZLbxlista);\r\n\t\tidMCRZPGCTRLMaestro.setStatementConsultaPaginada(getConsultaPaginada());\r\n\t\tidMCRZPGCTRLMaestro.setPageSize(5);\r\n\t\tidMCRZPGCTRLMaestro.setConsultaDinamica(isDinamic());\r\n\t\tidMCRZPGCTRLMaestro.setSqlConsultaDinamica(getConsultaDinamica());\r\n\t\tidMCRZPGCTRLMaestro.setTipoClase(objetoClase);\r\n\t\tidMCRZPGCTRLMaestro.setTablaPadreFrom(tablaPadreFrom);\r\n\t\tidMCRZLhdNombre.setVisible(usaColumnaNombre);\r\n\t\t// idAUTZCTRLControl.setMold(\"os\");\r\n\r\n\t\tidMCRZPGCTRLMaestro.setPagingControlFilas(new PagingControlFilas() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void render(Component component,\r\n\t\t\t\t\tIBeanAbstracto iBeanAbstracto) {\r\n\r\n\t\t\t\t// final Listitem fila = getAssemblerStandard()\r\n\t\t\t\t// .crearListitemDesdeDto((Listitem) component,\r\n\t\t\t\t// iBeanAbstracto);\r\n\r\n\t\t\t\tfinal Listitem fila = getAssemblerStandard()\r\n\t\t\t\t\t\t.crearListitemDinamico(null, iBeanAbstracto.getMD5(),\r\n\t\t\t\t\t\t\t\t(Listitem) component,\r\n\t\t\t\t\t\t\t\tiBeanAbstracto.getCodigo(),\r\n\t\t\t\t\t\t\t\tiBeanAbstracto.getNombre());\r\n\t\t\t\tfinal BandboxFindPaging padre = BandboxFindPaging.this;\r\n\t\t\t\tfinal IBeanAbstracto object = iBeanAbstracto;\r\n\t\t\t\tfila.addEventListener(Events.ON_CLICK,\r\n\t\t\t\t\t\tnew EventListener<Event>() {\r\n\r\n\t\t\t\t\t\t\tpublic void onEvent(Event arg0) throws Exception {\r\n\t\t\t\t\t\t\t\tonSeleccionarMaestro(object, padre);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\tif (interfaz != null) {\r\n\t\t\t\t\tfila.addEventListener(Events.ON_CLICK,\r\n\t\t\t\t\t\t\tnew EventListener<Event>() {\r\n\t\t\t\t\t\t\t\tpublic void onEvent(Event arg0)\r\n\t\t\t\t\t\t\t\t\t\tthrows Exception {\r\n\t\t\t\t\t\t\t\t\tif (ids != null)\r\n\t\t\t\t\t\t\t\t\t\tfila.setAttribute(\"ID\", ids);\r\n\t\t\t\t\t\t\t\t\tinterfaz.onValidateSeleccion(fila, object);\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}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tidMCRZPGCTRLMaestro\r\n\t\t\t\t.agregarAtributosColumnas(new ArrayList<PagingControlColumnas>());\r\n\t\tidMCRZPGCTRLMaestro.setComponenteContenedor(idMCRZLftPaging);\r\n\r\n\t\tif (usaColumnaCodigo && usaColumnaNombre) {\r\n\t\t\tlog.info(\"@parametrizarPagingControl ===> usaColumnaCodigo=\"\r\n\t\t\t\t\t+ usaColumnaCodigo + \";usaColumnaNombre=\"\r\n\t\t\t\t\t+ usaColumnaNombre);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0)).setSpan(2);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0))\r\n\t\t\t\t\t.appendChild(idMCRZPGCTRLMaestro);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(1))\r\n\t\t\t\t\t.setVisible(false);\r\n\t\t} else if (!usaColumnaCodigo && usaColumnaNombre) {\r\n\t\t\tlog.info(\"@parametrizarPagingControl ===> usaColumnaCodigo=\"\r\n\t\t\t\t\t+ usaColumnaCodigo + \";usaColumnaNombre=\"\r\n\t\t\t\t\t+ usaColumnaNombre);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0))\r\n\t\t\t\t\t.setVisible(false);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(1))\r\n\t\t\t\t\t.setVisible(true);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(1))\r\n\t\t\t\t\t.appendChild(idMCRZPGCTRLMaestro);\r\n\t\t} else if (usaColumnaCodigo && !usaColumnaNombre) {\r\n\t\t\tlog.info(\"@parametrizarPagingControl ===> usaColumnaCodigo=\"\r\n\t\t\t\t\t+ usaColumnaCodigo + \";usaColumnaNombre=\"\r\n\t\t\t\t\t+ usaColumnaNombre);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0)).setSpan(1);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0))\r\n\t\t\t\t\t.appendChild(idMCRZPGCTRLMaestro);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(1))\r\n\t\t\t\t\t.setVisible(false);\r\n\t\t\t((Listhead) this.getFellow(\"idMCRZListHead\"))\r\n\t\t\t\t\t.removeChild(idMCRZLhdNombre);\r\n\t\t\tidMCRZLhdNombre.setStyle(\"visibility: hidden\");\r\n\t\t}\r\n\r\n\t}", "@DirectMethod\r\n\tpublic List<MovimientoDto> obtenerPagos(int iIdEmpresa, int iIdEmpRaiz, int iIdBanco, \r\n\t\t\tString sIdDivisa, String sIdChequera, String sTipoBusqueda, int idUsuario)\r\n\t{\r\n\t\tif (!Utilerias.haveSession(WebContextManager.get())) \r\n\t\t\treturn null;\r\n\t\tList<MovimientoDto> listConsPag = new ArrayList<MovimientoDto>(); \r\n\t\ttry\r\n\t\t{\r\n\t\t\tif (Utilerias.haveSession(WebContextManager.get())) {\r\n\t\t\tParamBusquedaFondeoDto dtoBus = new ParamBusquedaFondeoDto();\r\n\t\t\tCoinversionService coinversionService = (CoinversionService) contexto.obtenerBean(\"coinversionBusinessImpl\");\r\n\t\t\tdtoBus.setIdEmpresa(funciones.validarEntero(iIdEmpresa));\r\n\t\t\tdtoBus.setIdBanco(funciones.validarEntero(iIdBanco));\r\n\t\t\tdtoBus.setIdChequera(funciones.validarCadena(sIdChequera));\r\n\t\t\tdtoBus.setIdEmpresaRaiz(funciones.validarEntero(iIdEmpRaiz));\r\n\t\t\tdtoBus.setSTipoBusqueda(funciones.validarCadena(sTipoBusqueda));\r\n\t\t\tdtoBus.setIdDivisa(funciones.validarCadena(sIdDivisa));\r\n\t\t\tdtoBus.setIdUsuario(idUsuario);\r\n\t\t\t\r\n\t\t\tlistConsPag = coinversionService.obtenerPagos(dtoBus);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tbitacora.insertarRegistro(new Date().toString() + \" \" + Bitacora.getStackTrace(e) \r\n\t\t\t\t\t+ \"P:Coinversion, C:CoinversionAction, M:obtenerPagos\");\r\n\t\t}\r\n\t\treturn listConsPag;\r\n\t}", "@Override\n\tpublic void apagar() {\n\t\tSystem.out.println(\"Apagando Computadora\");\n\t}", "public ArrayList<Pagamento> pagamentosRealizados(int associacao, int associado, int vigencia) {\r\n\t\tArrayList<Pagamento> pagamentos = new ArrayList<Pagamento>();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tConnection conexao = Conexao.getConexao();\r\n\t\t\tStatement statement = conexao.createStatement();\r\n\t\t\t\r\n\t\t\tString comando = \"select * from pagamento where associacao = \" + associacao\r\n\t\t\t\t\t+ \" and associado = \" + associado + \" and vigencia = \" + vigencia;\r\n\t\t\tSystem.out.println(comando);\r\n\t\t\tResultSet rs = statement.executeQuery(comando);\r\n\t\t\t\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tlong data = rs.getLong(\"data\");\r\n\t\t\t\tdouble valor = rs.getInt(\"valor\");\r\n\t\t\t\tString taxa = rs.getString(\"nome\");\r\n\t\t\t\t\r\n\t\t\t\tPagamento pagamento = new Pagamento(data, valor, taxa, vigencia);\r\n\t\t\t\tpagamentos.add(pagamento);\r\n\t\t\t}\r\n\t\t\tstatement.close();\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn pagamentos;\r\n\t}", "public static String paginate(HttpServletRequest request, HttpServletResponse response) {\n List page = FastList.newInstance();\n Paginator paginator = PaginatorFactory.getPaginator(request);\n String action = UtilCommon.getParameter(request, \"action\");\n String pageNumberString = UtilCommon.getParameter(request, \"pageNumber\");\n \n if (paginator != null) {\n try {\n if (pageNumberString != null) {\n try {\n long pageNumber = Long.parseLong(pageNumberString);\n page = paginator.getPageNumber(pageNumber);\n }\n catch (NumberFormatException e) {\n Debug.logWarning(\"Failed to get page numer [\" + pageNumberString + \"] to to format error: \" + e.getMessage(), module);\n page = paginator.getCurrentPage();\n }\n }\n else if (action == null || \"getCurrentPage\".equals(action)) {\n page = paginator.getCurrentPage();\n }\n else if (\"getNextPage\".equals(action)) {\n page = paginator.getNextPage();\n }\n else if (\"getPreviousPage\".equals(action)) {\n page = paginator.getPreviousPage();\n }\n else if (\"getFirstPage\".equals(action)) {\n page = paginator.getFirstPage();\n }\n else if (\"getLastPage\".equals(action)) {\n page = paginator.getLastPage();\n }\n else {\n Debug.logWarning(\"Paginate action [\" + action + \"] not supported.\", module);\n page = paginator.getCurrentPage();\n }\n }\n catch (ListBuilderException e) {\n return doListBuilderExceptionResponse(request, response, paginator, e);\n }\n }\n return doPaginationResponse(request, response, paginator, page);\n }", "@Test\n\tpublic void testPaginate() throws Exception {\n\t}", "public ObservableList<Pagadores> carregaPagadores(int centro, int subCentro) {\n\t\tcon = Conexao.conectar();\n\t\tObservableList<Pagadores> resultadoPagadores = FXCollections.observableArrayList();\n\t\ttry {\n\t\t\tString query = \"SELECT * FROM pagadores WHERE estpagador > ? AND centroreceb = ? AND subcentrorec = ?\";\n\t\t\tprepStmt = con.prepareStatement(query); // create a statement\n\t\t\tprepStmt.setString(1, \"\");\n\t\t\tprepStmt.setInt(2, centro);\n\t\t\tprepStmt.setInt(3, subCentro);\n\t\t\trs = prepStmt.executeQuery();\n\t\t\t\t\t\t // extract data from the ResultSet\n\t\t\twhile(rs.next()) {\n\t\t\t\tPagadores temp = new Pagadores();\n\t\t\t\ttemp.setCodPagador(rs.getInt(\"codpagador\"));\n\t\t\t\ttemp.setEstPagador(rs.getString(\"estpagador\"));\n\t\t\t\ttemp.setRecDescr(rs.getString(\"recdescr\"));\n\t\t\t\t\n\t\t\t\ttemp.setValContrato(rs.getDouble(\"valcontrato\"));\n\t\t\t\ttemp.setContratoInic(DateUtils.asLocalDate(rs.getDate(\"contratoinic\")));\n\t\t\t\ttemp.setContratoFim(DateUtils.asLocalDate(rs.getDate(\"contratofim\")));\n\t\t\t\t\n\t\t\t\ttemp.setNomeContrato(rs.getString(\"nomecontrato\"));\n\t\t\t\ttemp.setContaVinc(rs.getInt(\"contavinc\"));\n\t\t\t\ttemp.setCentroReceb(rs.getInt(\"centroreceb\"));\n\t\t\t\t\n\t\t\t\ttemp.setSubCentroRec(rs.getInt(\"subcentrorec\"));\n\t\t\t\ttemp.setDataLanc(DateUtils.asLocalDate(rs.getDate(\"datalanc\")));\n\t\t\t\ttemp.setDiaVenc(rs.getInt(\"diavenc\"));\n\t\t\t\ttemp.setAgente(rs.getString(\"agente\"));\n\t\t\t\t\n\t\t\t\tresultadoPagadores.add(temp);\n\t\t\t}\n\t\t\treturn resultadoPagadores;\n\t\t} catch(Exception e) {\n\t\t\tMessageBox.show(\"Erro ao ler pagadores 59\", e.getMessage());\n\t\t\treturn null;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\trs.close();\n\t\t\t\tprepStmt.close();\n\t\t\t\t//conn.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "Reserva Obtener();", "List<E> page(Page page, Long...params);", "void query9InterativaPrint(List<ParQuery9> pares);", "public void buscarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tString codigo_empresa = empresa.getCodigo_empresa();\r\n\t\t\tString codigo_sucursal = sucursal.getCodigo_sucursal();\r\n\t\t\tString parameter = lbxParameter.getSelectedItem().getValue()\r\n\t\t\t\t\t.toString();\r\n\t\t\tString value = tbxValue.getValue().toUpperCase().trim();\r\n\r\n\t\t\tMap<String, Object> parameters = new HashMap();\r\n\t\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\t\tparameters.put(\"parameter\", parameter);\r\n\t\t\tparameters.put(\"value\", \"%\" + value + \"%\");\r\n\r\n\t\t\tgetServiceLocator().getHis_atencion_embarazadaService().setLimit(\r\n\t\t\t\t\t\"limit 25 offset 0\");\r\n\r\n\t\t\tList<His_atencion_embarazada> lista_datos = getServiceLocator()\r\n\t\t\t\t\t.getHis_atencion_embarazadaService().listar(parameters);\r\n\t\t\trowsResultado.getChildren().clear();\r\n\r\n\t\t\tfor (His_atencion_embarazada his_atencion_embarazada : lista_datos) {\r\n\t\t\t\trowsResultado.appendChild(crearFilas(his_atencion_embarazada,\r\n\t\t\t\t\t\tthis));\r\n\t\t\t}\r\n\r\n\t\t\tgridResultado.setVisible(true);\r\n\t\t\tgridResultado.setMold(\"paging\");\r\n\t\t\tgridResultado.setPageSize(20);\r\n\r\n\t\t\tgridResultado.applyProperties();\r\n\t\t\tgridResultado.invalidate();\r\n\t\t\tgridResultado.setVisible(true);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\t}", "@Override\n\tpublic Page<?> pagination(Integer pagenumber, Integer rows, String sortdireccion, String sortcolumn,\n\t\t\tObject filter) {\n\t\treturn null;\n\t}", "LiveData<PagedList<Response>> pagedList();", "public List<PosPay> listPosPay(PosPay posPay,int firstResult ,int maxResults)throws DataAccessException;", "@Override\n public long minutosOcupados(Integer idEstacion, Date inicio, Date fin) {\n long minutos = 0;\n String sql = \"SELECT eje FROM Recurso rec, Ejecucion eje WHERE rec.idestacion = :idEstacion AND eje.idrecurso = rec.idrecurso AND eje.fechafin >= :inicio AND eje.fechainicio < :fin\";\n List<Ejecucion> ejecuciones = getCurrentSession().createQuery(sql).setParameter(\"idEstacion\", idEstacion).setParameter(\"inicio\", inicio).setParameter(\"fin\", fin).list();\n for (Ejecucion next : ejecuciones) {\n Date inicioEjecucion = next.getFechainicio();\n Date finEjecucion = next.getFechafin();\n if (inicioEjecucion.before(inicio) && finEjecucion.before(fin)) {\n //Comienza en inicio y finaliza en el fin de la ejecucion\n minutos = minutos + Math.abs(finEjecucion.getTime() - inicio.getTime())/60000;\n \n } else if (inicioEjecucion.after(inicio) && finEjecucion.before(fin)) {\n //Comienza en inicio de la ejecucion y finaliza en el fin de la ejecucion\n minutos = minutos + Math.abs(fin.getTime() - inicioEjecucion.getTime())/60000;\n \n }else if (inicioEjecucion.after(inicio) && finEjecucion.after(fin)){\n //Comienza en inicio de la ejecucion y finaliza en el fin\n minutos = minutos + Math.abs(fin.getTime() - inicioEjecucion.getTime())/60000;\n \n } else if (inicioEjecucion.before(inicio) && finEjecucion.after(fin)) {\n //Comienza en inicio y finaliza en el fin\n minutos = minutos + Math.abs(fin.getTime() - inicio.getTime())/60000;\n }\n }\n return minutos;\n }", "public List<Timetable> pagging(int pageIndex, int pageSize) throws Exception;", "public void pagarAluguel(int credor, int devedor, int valor, String NomePopriedade) {\n\n Jogador JogadorDevedor = listaJogadores.get(devedor);\n Jogador JogadorCredor = listaJogadores.get(credor);\n\n\n if (listaJogadores.get(devedor).getDinheiro() >= valor) {\n JogadorDevedor.retirarDinheiro(valor);\n JogadorCredor.addDinheiro(valor);\n\n } else {\n \n\n\n if(bankruptcy){\n\n }else{\n int DinheiroRestante = listaJogadores.get(devedor).getDinheiro();\n JogadorDevedor.retirarDinheiro(DinheiroRestante);\n JogadorCredor.addDinheiro(DinheiroRestante);\n }\n this.removePlayer(devedor);\n\n }\n\n\n }", "public void pagarCuentaCliente(Long idCliente,String claveMesa) throws QRocksException;", "Integer getPage();", "@Override\r\n\tpublic List<Dept> pagedQuery(Dept t) {\n\t\treturn null;\r\n\t}", "public List<Pagamento> buscarPorBusca(String busca)throws DaoException;", "void findWithPagination(Pagination<Activity, Assignment> pagination);", "private boolean pagarImposto(String nomeImposto, int valorImposto, int jogador) {\n if (Donos.get(this.posicoes[jogador]).equals(nomeImposto)) {\n this.print(\"\\tPagando imposto \" + nomeImposto);\n this.print(\"\\tValor do imposto \" + valorImposto);\n if (listaJogadores.get(jogador).getDinheiro() >= valorImposto) {\n listaJogadores.get(jogador).retirarDinheiro(valorImposto);\n } else {\n\n\n if(bankruptcy){\n listaJogadores.get(jogador).retirarDinheiro(valorImposto);\n listaJogadores.get(jogador).setBankruptcy(true);\n }else{\n int DinheiroRestante = listaJogadores.get(jogador).getDinheiro();\n listaJogadores.get(jogador).retirarDinheiro(DinheiroRestante);\n }\n\n this.removePlayer(jogador);\n\n }\n return true;\n }\n return false;\n }", "public void onEvent(Event e) throws Exception {\n\t\t\t\tlistData.getItems().clear();\n\t\t\t\tpage += 1;\n\t\t\t\tif(page.intValue() > ((listAllRow.size()-1)/manyRow)+1) page = ((listAllRow.size()-1)/manyRow)+1;\n\t\t\t\tif(page.intValue() == ((listAllRow.size()-1)/manyRow)+1){\n\t\t\t\t\t//berarti last page\n\t\t\t\t\t((Button)next).setDisabled(true);\n\t\t\t\t\t((Button)lastPage).setDisabled(true);\n\t\t\t\t\tshowListPerPage(listData,((page-1)*manyRow)+1,listAllRow.size());\n\t\t\t\t\tComponentUtil.setValue(perData,\"[ \"+String.valueOf(((page-1)*manyRow)+1)+\" - \"+String.valueOf(listAllRow.size()));\n\t\t\t\t}else{\n\t\t\t\t\t((Button)next).setDisabled(false);\n\t\t\t\t\t((Button)lastPage).setDisabled(false);\n\t\t\t\t\tshowListPerPage(listData,((page-1)*manyRow)+1,page*manyRow);\n\t\t\t\t\tComponentUtil.setValue(perData,\"[ \"+String.valueOf(((page-1)*manyRow)+1)+\" - \"+String.valueOf(page*manyRow));\n\t\t\t\t}\n\t\t\t\t((Button)previous).setDisabled(false);\n\t\t\t\t((Button)firstPage).setDisabled(false);\n\t\t\t}", "protected abstract void onRequestPage(boolean isRequestNext,int fromIndex,int toIndex,float x,float y);", "@Test\n public void test_sort_pagination() throws Exception {\n matchInvoke(serviceURL, \"PWDDIC_testSearch_sort_pagination_req.xml\",\n \"PWDDIC_testSearch_sort_pagination_res.xml\");\n }", "@GET\n\t@Path(\"PeorPorSemana\")\n\t@Produces({ MediaType.APPLICATION_JSON })\n\tpublic Response getPeoresOperadoresPorSemana() {\n\t\t\n\t\ttry {\n\t\t\tAlohAndesTransactionManager tm = new AlohAndesTransactionManager(getPath());\n\t\t\t\n\t\t\tArrayList<Operador> operador = tm.getOperadorPeorPorSemana();\n\t\t\t//Por simplicidad, solamente se obtienen los primeros 50 resultados de la consulta\n\t\t\treturn Response.status(200).entity(operador).build();\n\t\t} \n\t\tcatch (Exception e) {\n\t\t\treturn Response.status(500).entity(doErrorMessage(e)).build();\n\t\t}\n\t}", "public List<HistoriaLaboral> getHistoriasQueAfectanCargoRmu(Emp emp);", "@Override\r\n\tprotected JSON_Paginador getJson_paginador() {\n\t\treturn null;\r\n\t}" ]
[ "0.6457534", "0.6240358", "0.622573", "0.61651427", "0.61417687", "0.61330676", "0.6128262", "0.61234474", "0.61231863", "0.6080105", "0.6076221", "0.60067034", "0.5913257", "0.59030885", "0.58965653", "0.58828455", "0.587656", "0.5807222", "0.57843804", "0.57808644", "0.5766348", "0.576626", "0.57630736", "0.57269377", "0.57145405", "0.5705751", "0.56578845", "0.56294376", "0.56017905", "0.5599224", "0.55583644", "0.5549969", "0.55435777", "0.55414134", "0.553686", "0.5534244", "0.5526313", "0.5525601", "0.552335", "0.55221856", "0.5509735", "0.5479893", "0.54678756", "0.5450395", "0.5427093", "0.54188436", "0.541752", "0.541648", "0.5400431", "0.53978014", "0.5390846", "0.5390537", "0.53903997", "0.5383089", "0.53826725", "0.5381376", "0.5363031", "0.53571653", "0.5346205", "0.5344231", "0.53428525", "0.5341222", "0.5336046", "0.5334124", "0.5334124", "0.5334124", "0.5334124", "0.5334124", "0.5334124", "0.5331629", "0.53296345", "0.53263885", "0.53201467", "0.5318065", "0.53128487", "0.5312325", "0.5310501", "0.5307533", "0.53035176", "0.52977407", "0.5295956", "0.5289879", "0.5289529", "0.5287496", "0.528371", "0.527636", "0.5270487", "0.5269044", "0.52636164", "0.52590483", "0.5253261", "0.5248632", "0.5246876", "0.5230749", "0.52296084", "0.5227909", "0.522018", "0.5215573", "0.5213612", "0.5211726" ]
0.6414404
1
/ Este sub menu tiene las opciones de: 1 Registrar Horas Trabajadas 2 Registrar Venta 3 Actualizar Fecha de Nacimiento 4 Actualizar Numero de IHSS 5 Actualizar Tipo Jerarquia 6 Regresar Menu Principal Y luego segun cada opcion se pide el codigo del trabajador y su dato extra segun la opcion. Una vez que se completa la accion se regresa a este sub menu. SOLO se regresa a este menu si se selecciona la opcion 5.
private static void submenu() { throw new UnsupportedOperationException("Not yet implemented"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cargarOpcionesSubMenu() {\n\t\t\n\t\tif(esSubMenu()) {\n\t\t\tOpcionSubMenu subMenu = (OpcionSubMenu) getElementoMenuActual();\n\t\t\tsetElementosMenu(subMenu.getHijos());\n\t\t}\n\t}", "public void regolaOrdineInMenu(int codRiga) {\n\n /** variabili e costanti locali di lavoro */\n Modulo moduloPiatto = null;\n Modulo moduloRighe = null;\n\n Campo campoOrdineRiga = null;\n\n int codPiatto = 0;\n int codiceMenu = 0;\n int codiceCategoria = 0;\n\n Filtro filtro = null;\n\n int ordineMassimo = 0;\n Integer nuovoOrdine = null;\n int valoreOrdine = 0;\n Integer valoreNuovo = null;\n\n Object valore = null;\n int[] chiavi = null;\n int chiave = 0;\n\n try { // prova ad eseguire il codice\n\n /* regolazione variabili di lavoro */\n moduloRighe = this.getModulo();\n moduloPiatto = this.getModuloPiatto();\n campoOrdineRiga = this.getModulo().getCampoOrdine();\n\n /* recupera il codice del piatto dalla riga */\n valore = moduloRighe.query().valoreCampo(RMP.CAMPO_PIATTO, codRiga);\n codPiatto = Libreria.objToInt(valore);\n\n /* recupera il codice del menu dalla riga */\n valore = moduloRighe.query().valoreCampo(RMP.CAMPO_MENU, codRiga);\n codiceMenu = Libreria.objToInt(valore);\n\n /* recupera il codice categoria dal piatto */\n valore = moduloPiatto.query().valoreCampo(Piatto.CAMPO_CATEGORIA, codPiatto);\n codiceCategoria = Libreria.objToInt(valore);\n\n /* crea un filtro per ottenere tutte le righe comandabili di\n * questa categoria esistenti nel menu */\n filtro = this.filtroRigheCategoriaComandabili(codiceMenu, codiceCategoria);\n\n /* aggiunge un filtro per escludere la riga corrente */\n filtro.add(this.filtroEscludiRiga(codRiga));\n\n /* determina il massimo numero d'ordine tra le righe selezionate dal filtro */\n ordineMassimo = this.getModulo().query().valoreMassimo(campoOrdineRiga, filtro);\n\n /* determina il nuovo numero d'ordine da assegnare alla riga */\n if (ordineMassimo != 0) {\n nuovoOrdine = new Integer(ordineMassimo + 1);\n } else {\n nuovoOrdine = new Integer(1);\n } /* fine del blocco if-else */\n\n /* apre un \"buco\" nella categoria spostando verso il basso di una\n * posizione tutte le righe di questa categoria che hanno un numero\n * d'ordine uguale o superiore al numero d'ordine della nuova riga\n * (sono le righe non comandabili) */\n\n /* crea un filtro per selezionare le righe non comandabili della categoria */\n filtro = filtroRigheCategoriaNonComandabili(codiceMenu, codiceCategoria);\n\n /* aggiunge un filtro per escludere la riga corrente */\n filtro.add(this.filtroEscludiRiga(codRiga));\n\n /* recupera le chiavi dei record selezionati dal filtro */\n chiavi = this.getModulo().query().valoriChiave(filtro);\n\n /* spazzola le chiavi */\n for (int k = 0; k < chiavi.length; k++) {\n chiave = chiavi[k];\n valore = this.getModulo().query().valoreCampo(campoOrdineRiga, chiave);\n valoreOrdine = Libreria.objToInt(valore);\n valoreNuovo = new Integer(valoreOrdine + 1);\n this.getModulo().query().registraRecordValore(chiave, campoOrdineRiga, valoreNuovo);\n } // fine del ciclo for\n\n /* assegna il nuovo ordine alla riga mettendola nel buco */\n this.getModulo().query().registraRecordValore(codRiga, campoOrdineRiga, nuovoOrdine);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "private static void gestionarMenuGeneral(int opcion) {\n\t\tswitch(opcion){\n\t\tcase 1:\n\t\t\tmenuManejoJugadores();\n\t\t\tbreak;\n\t\tcase 2: jugar();\n\t\t\tbreak;\n\t\tcase 3:System.out.println(\"Hasta pronto.\");\n\t\t\tbreak;\n\t\t}\n\t}", "public void mo1751a(SubMenu subMenu) {\n subMenu.clear();\n C0475c a = C0475c.m2615a(this.f2117g, this.f2118h);\n PackageManager packageManager = this.f2117g.getPackageManager();\n int a2 = a.mo2490a();\n int min = Math.min(a2, this.f2115e);\n for (int i = 0; i < min; i++) {\n ResolveInfo b = a.mo2497b(i);\n subMenu.add(0, i, i, b.loadLabel(packageManager)).setIcon(b.loadIcon(packageManager)).setOnMenuItemClickListener(this.f2116f);\n }\n if (min < a2) {\n SubMenu addSubMenu = subMenu.addSubMenu(0, min, min, this.f2117g.getString(C0238R.string.abc_activity_chooser_view_see_all));\n for (int i2 = 0; i2 < a2; i2++) {\n ResolveInfo b2 = a.mo2497b(i2);\n addSubMenu.add(0, i2, i2, b2.loadLabel(packageManager)).setIcon(b2.loadIcon(packageManager)).setOnMenuItemClickListener(this.f2116f);\n }\n }\n }", "public void exibeMenu() {\n System.out.println(\"Digite o valor referente a operação desejada\");\r\n System.out.println(\"1. Busca Simples\");\r\n System.out.println(\"2. Busca Combinada\");\r\n System.out.println(\"3. Adicionar Personagem Manualmente\");\r\n System.out.println(\"4. Excluir Personagem\");\r\n System.out.println(\"5. Exibir Personagens\");\r\n int opcao = teclado.nextInt();\r\n if(opcao >= 7){\r\n do\r\n {\r\n System.out.println(\"Digite um numero valido\");\r\n opcao = teclado.nextInt();\r\n }while (opcao>=6);\r\n }\r\n ctrlPrincipal.opcaoMenu(opcao);\r\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}", "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 void setearOpcionesMenuProcesos()\r\n\t{\r\n\t\tArrayList<FormularioVO> lstFormsMenuProceso = new ArrayList<FormularioVO>();\r\n\t\t\r\n\t\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_PROCESOS) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_RESUMEN_PROCESO))\r\n\t\t\t{\r\n\t\t\t\tlstFormsMenuProceso.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(lstFormsMenuProceso.size()> 0)\r\n\t\t{\r\n\r\n\t\t\tthis.layoutMenu = new VerticalLayout();\r\n\t\t\t//this.tabMantenimientos.setMargin(true);\r\n\t\t\t\r\n\t\t\tthis.lbProcesos.setVisible(true);\r\n\t\t\tthis.layoutMenu.addComponent(this.lbProcesos);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor (FormularioVO formularioVO : lstFormsMenuProceso) {\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\t\t\t\t\t\t\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_PROCESOS:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_PROCESOS, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarProcesos();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.procesos);\r\n\t\t\t\t\t\t}\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\t\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_RESUMEN_PROCESO:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_RESUMEN_PROCESO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarResumenProceso();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.resumenProc);\r\n\t\t\t\t\t\t}\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\tthis.menuItems.addComponent(this.layoutMenu);\r\n\t\t\t\r\n\t\t}\r\n\t}", "private static int menu() {\n\t\tint opcion;\n\t\topcion = Leer.pedirEntero(\"1:Crear 4 Almacenes y 15 muebeles\" + \"\\n2: Mostrar los muebles\"\n\t\t\t\t+ \"\\n3: Mostrar los almacenes\" + \"\\n4: Mostrar muebles y su almacen\" + \"\\n0: Finalizar\");\n\t\treturn opcion;\n\t}", "private void setearOpcionesMenuMantenimientos()\r\n\t{\r\n\t\tArrayList<FormularioVO> lstFormsMenuMant = new ArrayList<FormularioVO>();\r\n\t\t\r\n\t\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_CLIENTES)\r\n\t\t\t\t|| formularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_FUNCIONARIOS) || \r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_IMPUESTO) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_EMPRESAS) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_CODIGOS_GENERALIZADOS) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_DOCUMENTOS) || \r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_DOCUMENTOS_DGI) || \r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_MONEDAS) || \r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_COTIZACIONES) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_TIPORUBROS) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_CUENTAS) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_BANCOS) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_PROCESOS) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_RESUMEN_PROCESO) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_PERIODO) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(\"SaldoDocumentos\") ||\r\n\t\t\t\tformularioVO.getCodigo().equals(\"SaldoCuentas\") ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_RUBROS))\r\n\t\t\t{\r\n\t\t\t\tlstFormsMenuMant.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(lstFormsMenuMant.size()> 0)\r\n\t\t{\r\n\r\n\t\t\t//this.layoutMenu = new VerticalLayout();\r\n\t\t\t//this.tabMantenimientos.setMargin(true);\r\n\t\t\t\r\n\t\t\tthis.lbMantenimientos.setVisible(true);\r\n\t\t\tthis.layoutMenu.addComponent(this.lbMantenimientos);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor (FormularioVO formularioVO : lstFormsMenuMant) {\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\t\t\t\t\t\t\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_IMPUESTO :\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_IMPUESTO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarImpuestoButton(); \r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.impuestoButton);\r\n\t\t\t\t\t\t\t\r\n\t\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\tcase VariablesPermisos.FORMULARIO_EMPRESAS :\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_EMPRESAS, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarEmpresaButton();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.empresaButton);\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\tcase VariablesPermisos.FORMULARIO_CODIGOS_GENERALIZADOS :\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_CODIGOS_GENERALIZADOS, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarCodigosGeneralizadosButton();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.codigosGeneralizados);\r\n\t\t\t\t\t\t}\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\tcase VariablesPermisos.FORMULARIO_DOCUMENTOS:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_DOCUMENTOS, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarDocumentosButton();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.documentosButton);\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\tcase VariablesPermisos.FORMULARIO_MONEDAS:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_MONEDAS, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarMonedasButton();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.monedasButton);\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\tcase VariablesPermisos.FORMULARIO_RUBROS:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_RUBROS, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarRubros();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.rubros);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_CLIENTES:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_CLIENTES, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarClientes();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.clientesButton);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_FUNCIONARIOS:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_FUNCIONARIOS, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarFuncionarios();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.funcionariosButton);\r\n\t\t\t\t\t\t}\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\tcase VariablesPermisos.FORMULARIO_COTIZACIONES:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_COTIZACIONES, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarCotizaciones();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.cotizaciones);\r\n\t\t\t\t\t\t}\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\tcase VariablesPermisos.FORMULARIO_TIPORUBROS:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_TIPORUBROS, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarTipoRubros();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.tipoRubros);\r\n\t\t\t\t\t\t}\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\tcase VariablesPermisos.FORMULARIO_CUENTAS:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_CUENTAS, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarCuentas();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.cuentas);\r\n\t\t\t\t\t\t}\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\tcase VariablesPermisos.FORMULARIO_BANCOS:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_BANCOS, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarBancos();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.bancos);\r\n\t\t\t\t\t\t}\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\tcase VariablesPermisos.FORMULARIO_PROCESOS:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_PROCESOS, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarProcesos();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.procesos);\r\n\t\t\t\t\t\t}\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\t\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_RESUMEN_PROCESO:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_RESUMEN_PROCESO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarResumenProceso();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.resumenProc);\r\n\t\t\t\t\t\t}\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\tcase VariablesPermisos.FORMULARIO_PERIODO:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_PERIODO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarPeriodo();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.periodo);\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\t\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//TODO\r\n\t\t\t//this.acordion.addTab(tabMantenimientos, \"Mantenimientos\", null);\r\n\t\t\t\r\n\t\t\t//this.menuItems.addComponent(this.layoutMenu);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//acordion.setHeight(\"75%\"); /*Seteamos alto del accordion*/\r\n\t}", "private void submenuCliente(){\n Scanner s = new Scanner(System.in);\n int opcao = 0;\n\n try{\n do{\n System.out.println(\"1 - Criar Conta\");\n System.out.println(\"2 - Já possui conta? Log In\");\n System.out.println(\"3 - Associar conta\");\n System.out.println(\"0 - Sair\");\n\n opcao = s.nextInt();\n System.out.print(\"\\n\");\n\n switch(opcao){\n case 1:\n registoCliente();\n break;\n case 2:\n loginCliente();\n break;\n case 3:\n associarContaCliente();\n break;\n case 0:\n break;\n\n default:\n System.out.println(\"Opção inválida\");\n break;\n }\n } while (opcao != 0);\n }\n catch(InputMismatchException e){\n System.out.println(\"Entrada inválida\");\n menuInicial();\n\n }\n }", "protected abstract List<OpcionMenu> inicializarOpcionesMenu();", "@Override\r\n\tpublic void cargarSubMenuPersona() {\n\t\t\r\n\t}", "private static void menuOpciones() {\n // Hacemos un do para mostrar las opciones hasta que pulse la opción correcta\n int opcion;\n // Scanner nos sirve para analizar la entrada desde el teclado. Al usar new si estamos creando el objeto (lo veremos)\n Scanner in = new Scanner(System.in);\n\n System.out.println(\"Seleccione la opción\");\n System.out.println(\"1.- Cálculo de estadístcas de clase\");\n System.out.println(\"2.- Cálculo año bisiesto\");\n System.out.println(\"3.- Cálculo de Factorial\");\n System.out.println(\"4.- Primos Gemelos\");\n System.out.println(\"0.- Salir\");\n\n // Creamos un bucle do while y lo tenemos girando aquí hasta que meta estos valores\n // Pero sabemos que scanner va a \"petar\" si no le metemos algo que pueda hacer el casting\n // Ya lo solucionaremos\n do {\n System.out.println(\"Elija opción: \");\n opcion = in.nextInt();\n } while (opcion != 0 && opcion != 1 && opcion != 2 && opcion != 3 && opcion != 4);\n\n switch (opcion) {\n case 1:\n estadisticaClase();\n break;\n case 2:\n añoBisiesto();\n break;\n case 3:\n factorial();\n break;\n case 4:\n primosGemelos();\n break;\n case 0:\n despedida();\n break;\n // No hay default, porque por el do-while no puede llegar aquí con otro valor\n }\n\n // Y si queremos volver al menú cada vez que terminemos una opción?\n\n }", "private void setearOpcionesMenuCobros()\r\n\t{\r\n\t\tArrayList<FormularioVO> lstFormsMenuCobros = new ArrayList<FormularioVO>();\r\n\t\t\r\n\t\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(\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_INGRESO_COBRO) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_INGRESO_COBRO_OTRO) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_INGRESO_EGRESO) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_GASTOS) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_DEPOSITO) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_CONCILIACION) ||\r\n\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_INGRESO_EGRESO_OTRO))\r\n\t\t\t\t\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tlstFormsMenuCobros.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(lstFormsMenuCobros.size()> 0)\r\n\t\t{\r\n\r\n\t\t\tthis.layoutMenu = new VerticalLayout();\r\n\t\t\t//this.tabMantenimientos.setMargin(true);\r\n\t\t\t\r\n\t\t\tthis.lbCobros.setVisible(true);\r\n\t\t\tthis.layoutMenu.addComponent(this.lbCobros);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor (FormularioVO formularioVO : lstFormsMenuCobros) {\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\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_INGRESO_COBRO:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_INGRESO_COBRO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarIngresoCobro();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.ingCobro);\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\tcase VariablesPermisos.FORMULARIO_INGRESO_COBRO_OTRO:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_INGRESO_COBRO_OTRO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarOtroCobro();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.otroCobro);\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\tcase VariablesPermisos.FORMULARIO_INGRESO_EGRESO:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_INGRESO_EGRESO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarIngresoEgreso();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.ingEgreso);\r\n\t\t\t\t\t\t}\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\tcase VariablesPermisos.FORMULARIO_INGRESO_EGRESO_OTRO:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_INGRESO_EGRESO_OTRO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarOtroEgreso();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.otroEgreso);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\r\n\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_GASTOS:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_GASTOS, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarGastos();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.gastos);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\r\n\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_DEPOSITO:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_DEPOSITO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarDeposito();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.deposito);\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\tcase VariablesPermisos.FORMULARIO_CONCILIACION:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_CONCILIACION, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarConciliacion();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.conciliacion);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\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\tthis.menuItems.addComponent(this.layoutMenu);\r\n\t\t\t\r\n\t\t}\r\n\t}", "private static void compraSubscricao(int idUser){\n int opcao = 0;\n Scanner teclado = new Scanner(System.in);\n System.out.println(\"Deseja\");\n System.out.println(\"1 - Comprar\");\n System.out.println(\"2 - Subscrever\");\n System.out.print(\"Opção: \");\n \n try{\n opcao = teclado.nextInt();\n System.out.println(\"\");\n switch(opcao){\n case 1: menuCategorias(idUser, false, true); break; //Escolheu comprar\n case 2: menuCategorias(idUser, true, false); break; //Escolheu subscrever\n default: throw new InputMismatchException();\n }\n \n }catch(InputMismatchException ime){\n System.out.println(\"Opção Inválida, tente novamente!\");\n System.out.println(\"\");\n compraSubscricao(idUser);\n }\n }", "public void cargarOpcionesPadre() {\n\t\tOpcionMenu elementoMenu = getElementoMenuActual();\n\t\tif(elementoMenu==null || elementoMenu.getOpcionMenuPadre() == null || elementoMenu.getOpcionMenuPadre().getOpcionMenuPadre() == null) {\n\t\t\tif(elementosMenu != elementosMenuRaiz) {\n\t\t\t\tsetElementosMenu(elementosMenuRaiz);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tOpcionSubMenu subMenu = (OpcionSubMenu) elementoMenu.getOpcionMenuPadre().getOpcionMenuPadre();\n\t\tif(subMenu!=null) {\n\t\t\tsetElementosMenu(subMenu.getHijos());\n\t\t}\n\t}", "public void controlaMenuFuncionario() {\n int opcao = this.telaFuncionario.pedeOpcao();\n\n switch (opcao) {\n case 1:\n incluiFuncionario();\n break;\n case 2:\n editaFuncionario();\n break;\n case 3:\n listaFuncionarios();\n break;\n case 4:\n menuDeletaFuncionario();\n break;\n case 5:\n ControladorPrincipal.getInstance().exibeMenuPrincipal();\n break;\n default:\n this.telaFuncionario.opcaoInexistente();\n exibeMenuFuncionario();\n break;\n }\n\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 }", "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 }", "static void mostrarMenu(){\n \t\t\n\t\tout.println();\n\t\tout.println(\"1. Crear lavadora.\");\n\t\tout.println(\"2. Mostrar lavadoras.\");\n\t\tout.println(\"3. Seleccionar lavadora.\");\n\t\tout.println(\"4. Cargar agua.\");\n\t\tout.println(\"5. Cargar ropa.\");\n\t\tout.println(\"6. Cargar detergente.\");\n\t\tout.println(\"7. Especificar tiempo.\");\n\t\tout.println(\"8. Drenar.\");\n\t\tout.println(\"9. Mostrar estado de la lavadora.\");\n\t\tout.println(\"10. Mostrar estado de la ropa.\");\n\t\tout.println(\"11. Pausar o Reanudar lavadora\");\n\t\tout.println(\"12. Probar sistema.\");\n\t\tout.println(\"13. Reiniciar sistema.\");\n\t\tout.println(\"22. Salir\");\n\t\tout.println((SELECTNOW != -1) ? \"!/*!/* Lv seleccionada: \" + SELECTNOW + \" !/*!/*\": \"\");\n\t\tout.println();\n\t}", "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 static void menu(int juego) {\n boolean decisionMenu;\n boolean continuacionJuego = true;\n int continuacionCiclo = 1;\n int seleccionMenu = 0;\n Scanner escaner = new Scanner(System.in);\n seleccionMenu = juego;\n while (continuacionJuego == true) {\n continuacionCiclo = 1;\n\n /* Esta es la parte del menu, se encuentra en un ciclo que comprueba si los valores ingresados\n se encuentran en el rango de las opciones dadas, de lo contrario repetira el ciclo hasta obtener un\n valor satisfactorio, es un ciclo comparativo */\n if (seleccionMenu == 0) {\n\n do {\n\n System.out.println(\"\\nBienvenido al menu de juegos\");\n System.out.println(\"Selecciona el juego que quieres jugar\");\n System.out.println(\"Ingresa '1': Sopa de letras \");\n System.out.println(\"Ingresa '2': Target \");\n System.out.println(\"Ingresa '3': 2048 \");\n System.out.println(\"Ingresa '4': Ver Punteos\");\n System.out.println(\"Ingresa '5': Salir del programa \");\n\n seleccionMenu = Integer.parseInt(escaner.nextLine());\n\n // Condicion para reconocer si los valores ingresados estan en el sistema, y lo decide a traves de una variable booleana\n if ((seleccionMenu >= 1) && (seleccionMenu <= 5)) {\n decisionMenu = true;\n } else {\n decisionMenu = false;\n System.out.println(\"Has ingresado una opcion incorrecta, vuelve a intentar, recuerda que solo son numeros los que hay que ingresar\");\n }\n } while (decisionMenu == false);\n }\n\n while (continuacionCiclo == 1) {\n // Condiciones para llamar el tipo de juego que se requiere\n switch (seleccionMenu) {\n\n case 1:\n sopaLetras(); // la funcion sopaLetras inicia el juego de sopa de letras que regresara un punteo depende si gano o perdio activando la funcion punteo\n continuacionCiclo = repetirJuego(1);\n break;\n\n case 2:\n target();\n continuacionCiclo = repetirJuego(2);\n break;\n\n case 3:\n juego2048();\n continuacionCiclo = repetirJuego(3);\n break;\n\n case 4:\n //Muestra todos los jugadores que han participado en los juegos, y las veces que han ganado es decir su punteo\n System.out.println(\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\");\n System.out.println(\" Punteos \");\n System.out.println(\"Nombre Puntos Ganados\");\n for (int sizeNombres = 0; sizeNombres < nombres.length - 1; sizeNombres++) {\n System.out.println(nombres[sizeNombres] + \" \" + punteos[sizeNombres]);\n }\n System.out.println(\"Ingresa cualquier caracter para continuar\");\n escaner.nextLine();\n continuacionCiclo = 2;\n break;\n case 5:\n continuacionCiclo = 3;\n break;\n\n }\n\n }\n\n if (continuacionCiclo == 3) {\n System.out.println(\"Hasta Pronto.......\");\n continuacionJuego = false;\n }\n seleccionMenu = 0;\n }\n\n }", "private void setearOpcionesMenuFacturacion()\r\n\t{\r\n\t\tArrayList<FormularioVO> lstFormsMenuFacturacion = new ArrayList<FormularioVO>();\r\n\t\t\r\n\t\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_FACTURA) ||\r\n\t\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_RECIBO) ||\r\n\t\t\t\t\tformularioVO.getCodigo().equals(VariablesPermisos.FORMULARIO_NOTA_CREDITO))\r\n\t\t\t\t\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tlstFormsMenuFacturacion.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(lstFormsMenuFacturacion.size()> 0)\r\n\t\t{\r\n\r\n\t\t\tthis.layoutMenu = new VerticalLayout();\r\n\t\t\t//this.tabMantenimientos.setMargin(true);\r\n\t\t\t\r\n\t\t\tthis.lbFacturacion.setVisible(true);\r\n\t\t\tthis.layoutMenu.addComponent(this.lbFacturacion);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor (FormularioVO formularioVO : lstFormsMenuFacturacion) {\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\t\t\t\t\t\t\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_NOTA_CREDITO:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_NOTA_CREDITO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarNotaCredito();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.ingCobro);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase VariablesPermisos.FORMULARIO_FACTURA:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_FACTURA, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarFactura();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.factura);\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\tcase VariablesPermisos.FORMULARIO_RECIBO:\r\n\t\t\t\t\t\tif(this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_RECIBO, VariablesPermisos.OPERACION_LEER)){\r\n\t\t\t\t\t\t\tthis.habilitarRecibo();\r\n\t\t\t\t\t\t\tthis.layoutMenu.addComponent(this.recibo);\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\tthis.menuItems.addComponent(this.layoutMenu);\r\n\t\t\t\r\n\t\t}\r\n\t}", "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 int menu() {\n System.out.println(\"MENU PRINCIPAL\\n\"\n + \"1 - CADASTRO DE PRODUTOS\\n\"\n + \"2 - MOVIMENTAÇÃO\\n\"\n + \"3 - REAJUSTE DE PREÇOS\\n\"\n + \"4 - RELATÓRIOS\\n\"\n + \"0 - FINALIZAR\\n\");\n return getEscolhaMenu(); \n }", "public static void MenuPrincipal() {\n System.out.println(\"Ingrese Opcion deseada :.\\n\"\r\n + \"1. Ingresar un perro a la guardería.\\n\"\r\n + \"2. Contar cuántos Perros de la raza y el Genero deceado hay o pasaron por la guardería durante el verano.\\n\"\r\n + \"3. Listar todos los perros (con su respectiva información) que ingresaron en una determinada fecha.\\n\"\r\n + \"4. Listar todos los Perrros de la Raza que decea con estadía mayor a 20 días.\\n\"\r\n + \"5. Dado el código de un perro, informar los datos de su dueño.\\n\"\r\n + \"6. Terminar.\\n\"\r\n +\"______________________________________________________________________________________________________________\"\r\n \r\n );\r\n\r\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 }", "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 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 void setMenu(){\n opciones='.';\n }", "private static void menuAdmin(){\n int opcao = 0;\n Scanner teclado = new Scanner(System.in);\n\n System.out.println(\"Administrador\");\n System.out.println(\"1 - Novo Utilizador\");\n System.out.println(\"2 - Nova Aplicação\");\n System.out.println(\"3 - Visualizar Utilizadores por ordem de registo\");\n System.out.println(\"4 - Visualizar Utilizadores por ordem de valor pago\");\n System.out.println(\"5 - Visualizar Aplicações\");\n System.out.println(\"6 - Valor acumulado pela AppStore\");\n System.out.println(\"7 - Valor acumulado por Programador\");\n System.out.println(\"8 - Gravar dados\");\n System.out.println(\"9 - Voltar atrás\");\n System.out.print(\"Opção: \");\n\n try{\n opcao = teclado.nextInt();\n System.out.println(\"\");\n switch(opcao){\n case 1: utilizadorProgramador();\n menuAdmin();\n break;\n case 2: lerIDProgramador();\n menuAdmin();\n break;\n case 3: escreverDadosUtilizador();\n menuAdmin();\n break;\n case 4: listUserValue();\n menuAdmin();\n break;\n case 5: verApps();\n break;\n case 6: System.out.println(totalAppStore()+\" euros\");\n menuAdmin();\n break;\n case 7: valorAcumuladoProgramador();\n menuAdmin();\n break;\n case 8: gravar();\n menuAdmin();\n break;\n case 9: modoVisualizacao();\n break;\n default: throw new InputMismatchException();\n }\n }catch(InputMismatchException ime){\n System.out.println(\"Opção Inválida, tente novamente!\");\n System.out.println(\"\");\n menuAdmin();\n }catch(FileNotFoundException e){\n e.printStackTrace();\n }catch(UnsupportedEncodingException e){\n e.printStackTrace();\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n lblUsuario = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jMenuBar1 = new javax.swing.JMenuBar();\n jmInicio = new javax.swing.JMenu();\n jmiCerrar = new javax.swing.JMenuItem();\n jmUsuario = new javax.swing.JMenu();\n jmiRegistrar = new javax.swing.JMenuItem();\n jmiEliminar = new javax.swing.JMenuItem();\n jMenu1 = new javax.swing.JMenu();\n JmiRegistrarServ = new javax.swing.JCheckBoxMenuItem();\n JmiModificarServ = new javax.swing.JMenuItem();\n JmiEliminarServ = new javax.swing.JMenuItem();\n jMenu2 = new javax.swing.JMenu();\n JmenuIApps = new javax.swing.JMenuItem();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setName(\"JfMenuPrincipal\"); // NOI18N\n setResizable(false);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosed(java.awt.event.WindowEvent evt) {\n formWindowClosed(evt);\n }\n });\n getContentPane().setLayout(null);\n\n jLabel1.setFont(new java.awt.Font(\"Kristen ITC\", 1, 36)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(153, 255, 255));\n jLabel1.setText(\"MENÚ PRINCIPAL.\");\n jLabel1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n getContentPane().add(jLabel1);\n jLabel1.setBounds(90, 150, 410, 49);\n\n lblUsuario.setFont(new java.awt.Font(\"Kristen ITC\", 1, 18)); // NOI18N\n lblUsuario.setForeground(new java.awt.Color(255, 255, 255));\n lblUsuario.setText(\" \");\n lblUsuario.setToolTipText(\"Usuario con sesión activa.\");\n lblUsuario.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n getContentPane().add(lblUsuario);\n lblUsuario.setBounds(190, 250, 210, 56);\n\n jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/MenuPrincipal/common/Bio-Grid_Computing.jpg\"))); // NOI18N\n jLabel2.setText(\"jLabel2\");\n jLabel2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n getContentPane().add(jLabel2);\n jLabel2.setBounds(0, 0, 570, 370);\n\n jMenuBar1.setBackground(new java.awt.Color(102, 255, 255));\n jMenuBar1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 102)));\n jMenuBar1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n\n jmInicio.setForeground(new java.awt.Color(0, 0, 153));\n jmInicio.setText(\"INICIO\");\n jmInicio.setToolTipText(\"Seleccione para ver las opciones del menú de Inicio.\");\n jmInicio.setFont(new java.awt.Font(\"Kristen ITC\", 1, 12)); // NOI18N\n\n jmiCerrar.setFont(new java.awt.Font(\"Kristen ITC\", 0, 12)); // NOI18N\n jmiCerrar.setForeground(new java.awt.Color(0, 0, 153));\n jmiCerrar.setText(\"Cerrar Sesión\");\n jmiCerrar.setToolTipText(\"Seleccione para cerrar la sesión del usuario.\");\n jmiCerrar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n jmiCerrar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jmiCerrarActionPerformed(evt);\n }\n });\n jmInicio.add(jmiCerrar);\n\n jMenuBar1.add(jmInicio);\n\n jmUsuario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 153)));\n jmUsuario.setForeground(new java.awt.Color(0, 0, 153));\n jmUsuario.setText(\"USUARIOS\");\n jmUsuario.setToolTipText(\"Seleccione para ver las opciones del menú de Usuarios.\");\n jmUsuario.setFont(new java.awt.Font(\"Kristen ITC\", 1, 12)); // NOI18N\n\n jmiRegistrar.setFont(new java.awt.Font(\"Kristen ITC\", 0, 12)); // NOI18N\n jmiRegistrar.setForeground(new java.awt.Color(0, 0, 153));\n jmiRegistrar.setText(\"Registrar\");\n jmiRegistrar.setToolTipText(\"Seleccione para registrar usuarios.\");\n jmiRegistrar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n jmiRegistrar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jmiRegistrarActionPerformed(evt);\n }\n });\n jmUsuario.add(jmiRegistrar);\n\n jmiEliminar.setFont(new java.awt.Font(\"Kristen ITC\", 0, 12)); // NOI18N\n jmiEliminar.setForeground(new java.awt.Color(0, 0, 153));\n jmiEliminar.setText(\"Eliminar\");\n jmiEliminar.setToolTipText(\"Seleccione para eliminar usuarios.\");\n jmiEliminar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n jmiEliminar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jmiEliminarActionPerformed(evt);\n }\n });\n jmUsuario.add(jmiEliminar);\n\n jMenuBar1.add(jmUsuario);\n\n jMenu1.setBackground(new java.awt.Color(0, 51, 153));\n jMenu1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 102)));\n jMenu1.setForeground(new java.awt.Color(0, 0, 153));\n jMenu1.setText(\"SERVIDORES\");\n jMenu1.setToolTipText(\"Seleccione para ver las opciones del menú de Servidores.\");\n jMenu1.setFont(new java.awt.Font(\"Kristen ITC\", 1, 12)); // NOI18N\n\n JmiRegistrarServ.setFont(new java.awt.Font(\"Kristen ITC\", 0, 12)); // NOI18N\n JmiRegistrarServ.setForeground(new java.awt.Color(0, 0, 153));\n JmiRegistrarServ.setText(\"Registrar\");\n JmiRegistrarServ.setToolTipText(\"Seleccione para registrar servidores.\");\n JmiRegistrarServ.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n JmiRegistrarServ.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n JmiRegistrarServActionPerformed(evt);\n }\n });\n jMenu1.add(JmiRegistrarServ);\n\n JmiModificarServ.setFont(new java.awt.Font(\"Kristen ITC\", 0, 12)); // NOI18N\n JmiModificarServ.setForeground(new java.awt.Color(0, 0, 153));\n JmiModificarServ.setText(\"Modificar\");\n JmiModificarServ.setToolTipText(\"Seleccione para modificar los servidores existentes.\");\n JmiModificarServ.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n JmiModificarServ.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n JmiModificarServActionPerformed(evt);\n }\n });\n jMenu1.add(JmiModificarServ);\n\n JmiEliminarServ.setFont(new java.awt.Font(\"Kristen ITC\", 0, 12)); // NOI18N\n JmiEliminarServ.setForeground(new java.awt.Color(0, 0, 153));\n JmiEliminarServ.setText(\"Eliminar\");\n JmiEliminarServ.setToolTipText(\"Seleccione para eliminar seridores.\");\n JmiEliminarServ.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n JmiEliminarServ.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n JmiEliminarServActionPerformed(evt);\n }\n });\n jMenu1.add(JmiEliminarServ);\n\n jMenuBar1.add(jMenu1);\n\n jMenu2.setText(\"Apps\");\n\n JmenuIApps.setText(\"Registrar Apps\");\n JmenuIApps.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n JmenuIAppsActionPerformed(evt);\n }\n });\n jMenu2.add(JmenuIApps);\n\n jMenuBar1.add(jMenu2);\n\n setJMenuBar(jMenuBar1);\n\n setBounds(0, 0, 587, 424);\n }", "public static void main(String[] args) {\n int opcion,opcion1, opcion2, opcion3;\n ArrayList menu = new ArrayList();\n\n menu.add(\"Informes...\");//1\n menu.add(\"Altas...\");//2\n menu.add(\"Puntuaciones...\");//2\n\n ArrayList subMenuListados = new ArrayList();\n\n subMenuListados.add(\"Listado completo de Peliculas por << Título >>.\");\n subMenuListados.add(\"Listado completo de Péliculas por << Género >>.\");\n\n subMenuListados.add(\"Listado de Péliculas de un << Director >>.\");//2.3\n subMenuListados.add(\"Listado de Péliculas de un << Género >>.\");//2.3\n \n ArrayList subMenuAltas = new ArrayList();\n subMenuAltas.add(\"Alta Péliculas.\");//3\n subMenuAltas.add(\"Alta Usuarios.\");//3 \n \n ArrayList subMenuPuntuaciones = new ArrayList();\n subMenuPuntuaciones.add(\"Puntuar una Pélicula...\");//8\n subMenuPuntuaciones.add(\"Ver la puntuación media de una Pélicula...\");//9\n\n connMySql = new GestionaBd(\"mysql\",\"localhost\",\"scott\",\"scott\",\"tiger1\");\n \n cargaDatosBdMemoria();\n do {\n opcion = pintaMenu(\"Menú Principal...\",menu);\n\n switch (opcion) {\n case 1://1.MENU INFORMES\n opcion1 = pintaMenu(\"Submenú INFORMES...\",subMenuListados);\n while (opcion1 != subMenuListados.size() + 1) {\n\n switch (opcion1) {\n case 1://1.1 Pelis Titulo...\n System.out.println(\"Pelis Titulo...\");\n System.out.println(peliculasTitulo);\n break;\n case 2://1.1 Pelis Genero...\n System.out.println(\"Pelis Genero...\");\n System.out.println(peliculasGenero);\n break;\n case 3://1.1 Péliculas de un << Director >>\n System.out.println(\"Péliculas de un << Director >>\");\n String director;\n \n System.out.println(pelisDeUnDirector.keySet());\n director= ES.leeDeTeclado(\"Nombre del Director?\");\n \n while(!pelisDeUnDirector.containsKey(director)){\n ES.leeDeTeclado(\"Director Erroneo, prueba de nuevo...\");\n \n System.out.println(pelisDeUnDirector.keySet());\n director= ES.leeDeTeclado(\"Nombre del Director?\");\n }\n \n System.out.println(\"Lista de las peliculas del Director->\"+ director);\n \n System.out.println(pelisDeUnDirector.get(director));\n \n break;\n case 4://1.1 Péliculas de un << Genero >>\n System.out.println(\"Péliculas de un << Genero >>\");\n String generos=seleccionaPGAM(pelisDeUnGenero, \"Genero\");\n \n System.out.println(pelisDeUnGenero.get(generos));\n \n \n break;\n }\n opcion1 = pintaMenu(\"Submenu Listados\",subMenuListados);\n }//while \n\n break;\n\n case 2: //2.MENU ALTAS\n opcion2 = pintaMenu(\"Submenú ALTAS...\",subMenuAltas);\n\n while (opcion2 != subMenuAltas.size() + 1) {\n\n switch (opcion2) {\n case 1://2.1 \"Alta Péliculas.\"\n //Critobal...\n altaPelicula();\n \n break;\n\n case 2: //2.2 \"Alta Usuarios.\"\n Usuarios us=altaUsuario();\n listaDeUsuarios.put(us.getLogin(),us);\n break;\n \n }\n opcion2 = pintaMenu(\"Submenu Listados\",subMenuAltas);\n }//while\n break;\n case 3: //3. PUNTUACINES....\n\n opcion3 = pintaMenu(\" Submenu Puntuaciones \", subMenuPuntuaciones);\n\n while (opcion3 != subMenuPuntuaciones.size() + 1) {\n\n switch (opcion3) {\n\n case 1://3.1 Puntuar Peli\n puntuaciones();\n break;\n case 2://3.2 Ver Puntuacion Peli\n\n break;\n }\n opcion3 = pintaMenu(\"Submenu Notas...\",subMenuPuntuaciones);\n }//while\n\n break;\n \n default:\n if (opcion == menu.size() + 1) {\n System.out.println(\"Adios....\");\n }\n }//Switch..........\n\n } while (opcion != menu.size() + 1);\n }", "public void desplegarMenuAdministrativo() {\n// //Hacia arriba\n// paneles.jLabelYDown(-50, 40, WIDTH, HEIGHT, jLabelTextoBienvenida);\n// \n// paneles.jLabelYUp(580, 82, WIDTH, HEIGHT, jLabelEntregas);\n// paneles.jLabelYUp(580, 82, WIDTH, HEIGHT, jLabelClientes);\n// paneles.jLabelYUp(580, 82, WIDTH, HEIGHT, jLabelNotas);\n// paneles.jLabelYUp(736, 238, WIDTH, HEIGHT, jLabelTextoEntrega);\n// paneles.jLabelYUp(736, 238, WIDTH, HEIGHT, jLabelTextoClientes);\n// paneles.jLabelYUp(736, 238, WIDTH, HEIGHT, jLabelTextoNotas);\n// \n// paneles.jLabelYUp(793, 295, WIDTH, HEIGHT, jLabelTrabajadores);\n// paneles.jLabelYUp(793, 295, WIDTH, HEIGHT, jLabelEntregasActivas);\n// paneles.jLabelYUp(793, 295, WIDTH, HEIGHT, jLabelEditarDatosPersonales);\n// \n// paneles.jLabelYUp(949, 451, WIDTH, HEIGHT, jLabelTextoTrabajadores);\n// paneles.jLabelYUp(949, 451, WIDTH, HEIGHT, jLabelTextoEntregasProgreso);\n// paneles.jLabelYUp(949, 451, WIDTH, HEIGHT, jLabelTextoEditarPersonales);\n }", "public int menuPrincipal() {\n lector = new Scanner(System.in);\n\n int opcion = -1;\n do {\n Lib.limpiarPantalla();\n System.out.println(\"************************************\");\n System.out.println(\"* MENU PRINCIPAL *\");\n System.out.println(\"************************************\");\n System.out.println(\"1. Altas\");\n System.out.println(\"2. Alquilar multimedia socio\");\n System.out.println(\"3 Devolver multimedia ESTO FALLA\");\n System.out.println(\"4 Listados\");\n System.out.println(\"---------------------\");\n System.out.println(\"0. Cancelar\\n\");\n System.out.println(\"Elija una opción: \");\n try {\n opcion = Integer.parseInt(Lib.lector.nextLine());\n if (opcion < 0 || opcion > 4) {\n System.out.println(\"Elija una opción del menú [0-4]\");\n Lib.pausa();\n }\n } catch (NumberFormatException nfe) {\n System.out.println(\"Solo números por favor\");\n Lib.pausa();\n }\n } while (opcion < 0 || opcion > 4);\n return opcion;\n\n }", "public static void menuPrincicipal() {\n\t\tSystem.out.println(\"+---------------------------+\");\n\t\tSystem.out.println(\"| Elige una opcion |\");\n\t\tSystem.out.println(\"+---------------------------+\");\n\t\tSystem.out.println(\"| 1-Modificar Orden |\");\n\t\tSystem.out.println(\"+---------------------------+\");\n\t\tSystem.out.println(\"| 2-Eliminar orden |\");\n\t\tSystem.out.println(\"+---------------------------+\");\n\t\tSystem.out.println(\"| 3-Ver todas las ordenes |\");\n\t\tSystem.out.println(\"+---------------------------+\");\n\t\tSystem.out.println(\"| 0-Salir |\");\n\t\tSystem.out.println(\"+---------------------------+\");\n\t}", "public static void imprimirMenu() {\r\n\tSystem.out.println(\"---------------------------menu---------------------------\");\r\n\tSystem.out.println(\"opciones: (ingrese como RF#)\");\r\n\tSystem.out.println(\"RF1: iniciar sesion \");\r\n System.out.println(\"RF2: registrarse al sistema\");\r\n\tSystem.out.println(\"RF3: Salir\");\r\n\t\r\n }", "public int menu(){\n System.out.println(\"Elija una opción:\");\n\t\tSystem.out.println(\"1. Registrar un nuevo carro\");//Le damos todas las opciones disponibles\n\t\tSystem.out.println(\"2. Eliminar un carro del registro\");\n\t\tSystem.out.println(\"3. Mostrar espacios disponibles\");\n System.out.println(\"4. Mostrar el registro completo\");\n System.out.println(\"5. Mostrar las estadisticas del parqueo\");\n System.out.println(\"6. Agregar mas espacios de parqueo\");\n System.out.println(\"7. Salir/n/n\");\n\n boolean paso = false;\n int option = 0;\n while (paso == false){//Aplicamos un metodo para que escriba el \n try {\n String optionString = scan.nextLine();//Recibimos el valor como String para evitar un bug con el metodo nextLine()\n option = Integer.parseInt(optionString);//Lo cambiamos a int\n paso = true;\n } catch (Exception e) {\n System.out.println(\"Ingrese un valor correcto, por favor\");\n }\n }\n return option;//regresamos el valor convertido\n }", "public static void presentarMenuPrincipal() {\n\t\tSystem.out.println(\"Ingresa el numero de la opcion deseada y preciona enter\");\n\t\tSystem.out.println(\"1 - Registrar nuevo libro\");\n\t\tSystem.out.println(\"2 - Consultar libros\");\n\t\tSystem.out.println(\"3 - terminar\");\n\t}", "private static void Relatorio() throws Exception \r\n {//Inicio menuRelatorio\r\n byte opcao;\r\n boolean fecharMenu = false;\r\n int idCliente, idProduto, quant;\r\n Produto p = null;\r\n Cliente c = null;\r\n do{\r\n System.out.println(\r\n \"\\n\\t*** MENU RELATORIO ***\\n\" +\r\n \"0 - Mostrar os N produtos mais Vendidos\\n\" +\r\n \"1 - Mostrar os N melhores clientes\\n\" +\r\n \"2 - Mostrar os produtos comprados por um cliente\\n\" +\r\n \"3 - Mostrar Clientes que compraram um produto\\n\" +\r\n \"4 - Sair\"\r\n );\r\n System.out.print(\"Digite sua opcao: \");\r\n opcao = read.nextByte();\r\n switch(opcao){\r\n case 0:\r\n ArrayList<Produto> listP = arqProdutos.toList();\r\n if(listP.isEmpty()) System.out.println(\"\\nNão tem produtos em nosso sistema ainda!\");\r\n else{\r\n System.out.print(\"Digite a quantidade de produtos que deseja saber: \");\r\n quant = read.nextInt();\r\n System.out.println();\r\n //Ordena a lista de forma decrescente:\r\n listP.sort((p1,p2) -> - Integer.compare(p1.getQuantVendidos(), p2.getQuantVendidos()));\r\n for(Produto n: listP){\r\n System.out.println(\"Produto de ID: \" + n.getID() + \" Nome: \" + n.nomeProduto + \"\\tQuantidade vendida: \" + n.getQuantVendidos());\r\n quant--;\r\n if(quant == 0) break;\r\n }\r\n }\r\n break;\r\n case 1:\r\n ArrayList<Cliente> listC = arqClientes.toList();\r\n if(listC.isEmpty()) System.out.println(\"Não ha clientes para mostrar!\");\r\n else{\r\n System.out.print(\"Digite a quantidade de Clientes: \");\r\n quant = read.nextInt();\r\n System.out.println();\r\n //Ordena a lista de forma decrescente:\r\n listC.sort((c1,c2) -> - Float.compare(c1.getTotalGasto(), c2.getTotalGasto()));\r\n for(Cliente n: listC){\r\n System.out.println(\"Cliente de ID: \" + n.getID() + \" Nome: \" + n.nomeCliente + \"\\tGasto total: \" + tf.format(n.getTotalGasto()));\r\n quant--;\r\n if(quant == 0) break; \r\n }\r\n }\r\n break;\r\n case 2:\r\n System.out.print(\"Digite o id do cliente: \");\r\n idCliente = read.nextInt();\r\n c = arqClientes.pesquisar(idCliente - 1);\r\n if (c != null){\r\n int[] idsProdutos = indice_Cliente_Produto.lista(idCliente);\r\n System.out.println(\"\\nO cliente \" + c.nomeCliente + \" de ID \" + c.getID() + \" comprou: \");\r\n for(int i = 0; i < idsProdutos.length; i++){\r\n p = arqProdutos.pesquisar(idsProdutos[i] - 1);\r\n System.out.println(\r\n \"\\n\\tProduto \" + i + \" -> \" + \r\n \" ID: \" + p.getID() + \r\n \" Nome: \" + p.nomeProduto + \r\n \" Marca: \" + p.marca\r\n );\r\n }\r\n }\r\n else {\r\n System.out.println(\"\\nID Invalido!\");\r\n Thread.sleep(1000);\r\n }\r\n break;\r\n case 3:\r\n System.out.print(\"Digite o id do Produto a consultar: \");\r\n idProduto = read.nextInt();\r\n p = arqProdutos.pesquisar(idProduto - 1);\r\n if(p != null){\r\n int[] idsClientes = indice_Produto_Cliente.lista(idProduto);\r\n System.out.println(\"\\nO produto '\" + p.nomeProduto + \"' de ID \" + p.getID() + \" foi comprado por: \");\r\n for(int i = 0; i < idsClientes.length; i++){\r\n c = arqClientes.pesquisar(idsClientes[i] - 1);\r\n System.out.println();\r\n System.out.println(c);\r\n }\r\n }\r\n else{\r\n System.out.println(\"\\nProduto Inexistende!\");\r\n Thread.sleep(1000);\r\n }\r\n break;\r\n case 4:\r\n fecharMenu = true;\r\n break; \r\n default:\r\n System.out.println(\"Opcao invalida!\\n\");\r\n Thread.sleep(1000);\r\n break;\r\n }\r\n }while(!fecharMenu); \r\n }", "public void componentesimplementacionIsmael() {\n\t\t// En el menu bar Ismael\n\t\tmenuIsmael = new JMenu(\"Ismael\");\n\t\tmenuBar.add(menuIsmael);\n\n\t\t// SUBMENU\n\t\tsubMenuRecientes = new JMenu(\"Recientes\");\n\t\titemSubMenuRecientes = new ArrayList<>();\n\t\trutasRecientes = new ArrayList<>();\n\t\ttry {\n\t\t\trutasRecientes = manejadorFichero.obtenerLineasDelFichero();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (!rutasRecientes.isEmpty()) {\n\t\t\tfor (int i = 0; i < rutasRecientes.size(); i++) {\n\t\t\t\tJMenuItem textoSubmenu = new JMenuItem(rutasRecientes.get(i));\n\t\t\t\titemSubMenuRecientes.add(textoSubmenu);\n\t\t\t\tsubMenuRecientes.add(textoSubmenu);\n\t\t\t}\n\t\t}\n\t\tmenuIsmael.add(subMenuRecientes);\n\n\t\tmenuIsmael.addSeparator();\n\n\t\t// Fuente\n\t\titemFuente = new JMenuItem(\"Fuente\");\n\t\titemFuente.setEnabled(false);\n\t\titemFuente.setMnemonic(KeyEvent.VK_F);\n\t\titemFuente.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, ActionEvent.CTRL_MASK));\n\t\tmenuIsmael.add(itemFuente);\n\n\t\tmenuIsmael.addSeparator();\n\n\t\titemSeleccionarTodo = new JMenuItem(\"Selec.Todo\");\n\t\titemSeleccionarTodo.setEnabled(false);\n\t\titemSeleccionarTodo.setMnemonic(KeyEvent.VK_N);\n\t\titemSeleccionarTodo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));\n\t\tmenuIsmael.add(itemSeleccionarTodo);\n\n\t\titemSeleccionarTodoYCopiar = new JMenuItem(\"Selec All+Copy\");\n\t\titemSeleccionarTodoYCopiar.setEnabled(false);\n\t\titemSeleccionarTodoYCopiar.setMnemonic(KeyEvent.VK_M);\n\t\titemSeleccionarTodoYCopiar.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, ActionEvent.CTRL_MASK));\n\t\tmenuIsmael.add(itemSeleccionarTodoYCopiar);\n\n\t\tmenuIsmael.addSeparator();\n\n\t\titemHora = new JMenuItem(\"Hora\");\n\t\titemHora.setEnabled(true);\n\t\titemHora.setMnemonic(KeyEvent.VK_H);\n\t\titemHora.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, ActionEvent.CTRL_MASK));\n\t\tmenuIsmael.add(itemHora);\n\n\t}", "public static void Regresar() {\n menu.setVisible(true);\n Controlador.ConMenu.consultaPlan.setVisible(false);\n }", "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 }", "private void teclouEnter() {\n //menu principal\n if (this.getFocusOwner() == listaMenuPrincipal) {\n if (listaMenuPrincipal.getSelectedIndex() == 0 || listaMenuPrincipal.getSelectedIndex() == 1) {\n LoginGerenteSupervisor janelaLoginGerenteSupervisor = new LoginGerenteSupervisor(this, true);\n janelaLoginGerenteSupervisor.setLocationRelativeTo(null);\n janelaLoginGerenteSupervisor.setVisible(true);\n //supervisor\n if (listaMenuPrincipal.getSelectedIndex() == 0) {\n if (janelaLoginGerenteSupervisor.loginSupervisor(true)) {\n panelSubMenu.setVisible(true);\n ((CardLayout) panelCard.getLayout()).show(panelCard, \"cardSupervisor\");\n listaSubMenuSupervisor.requestFocus();\n listaSubMenuSupervisor.setSelectedIndex(0);\n }\n }\n //gerente\n if (listaMenuPrincipal.getSelectedIndex() == 1) {\n if (janelaLoginGerenteSupervisor.loginGerente(true)) {\n panelSubMenu.setVisible(true);\n ((CardLayout) panelCard.getLayout()).show(panelCard, \"cardGerente\");\n listaSubMenuGerente.requestFocus();\n listaSubMenuGerente.setSelectedIndex(0);\n }\n }\n }\n //saida temporaria\n if (listaMenuPrincipal.getSelectedIndex() == 2) {\n if ((SessaoUsuario.statusCaixa == SC_ABERTO)) {\n int escolha = JOptionPane.showOptionDialog(this, \"Deseja fechar o caixa temporariamente?\", \"Pergunta do Sistema\",\n JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE,\n null, opcoesResposta, null);\n if (escolha == JOptionPane.YES_OPTION) {\n try {\n NfceControllerGenerico<NfceMovimentoVO> movimentoController = new NfceControllerGenerico<>();\n SessaoUsuario.movimento.setStatusMovimento(\"T\");\n SessaoUsuario.usuario = null;\n movimentoController.atualizar(SessaoUsuario.movimento);\n\n telaPadrao();\n\n MovimentoAberto ma = new MovimentoAberto(this, true);\n ma.setLocationRelativeTo(null);\n ma.setVisible(true);\n telaPadrao();\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(this, \"Erro ao registrar a saída temporária.\\n\" + ex.getMessage(), \"Aviso do Sistema\", JOptionPane.ERROR_MESSAGE);\n }\n }\n } else {\n JOptionPane.showMessageDialog(this, \"Status do caixa não permite saída temporária.\", \"Aviso do Sistema\", JOptionPane.WARNING_MESSAGE);\n }\n }\n }\n //menu principal - submenu supervisor\n if (this.getFocusOwner() == listaSubMenuSupervisor) {\n //inicia movimento\n if (listaSubMenuSupervisor.getSelectedIndex() == 0) {\n iniciaMovimento();\n }\n //encerra movimento\n if (listaSubMenuSupervisor.getSelectedIndex() == 1) {\n encerraMovimento();\n }\n //suprimento\n if (listaSubMenuSupervisor.getSelectedIndex() == 3) {\n suprimento();\n }\n //sangria\n if (listaSubMenuSupervisor.getSelectedIndex() == 4) {\n sangria();\n }\n\n }\n //menu principal - submenu gerente\n if (this.getFocusOwner() == listaSubMenuGerente) {\n //inicia movimento\n if (listaSubMenuGerente.getSelectedIndex() == 0) {\n iniciaMovimento();\n }\n //encerra movimento\n if (listaSubMenuGerente.getSelectedIndex() == 1) {\n encerraMovimento();\n }\n //suprimento\n if (listaSubMenuGerente.getSelectedIndex() == 3) {\n suprimento();\n }\n //sangria\n if (listaSubMenuGerente.getSelectedIndex() == 4) {\n sangria();\n }\n }\n //menu operacoes\n if (this.getFocusOwner() == listaMenuOperacoes) {\n //carrega dav\n if (listaMenuOperacoes.getSelectedIndex() == 0) {\n if (SessaoUsuario.statusCaixa == SC_ABERTO) {\n CarregaOrcamento janelaCarregaOrcamento = new CarregaOrcamento(this, true);\n janelaCarregaOrcamento.setLocationRelativeTo(null);\n janelaCarregaOrcamento.setVisible(true);\n if (!janelaCarregaOrcamento.cancelado) {\n dav = janelaCarregaOrcamento.getOrcamento();\n if (dav != null) {\n fechaMenuOperacoes();\n try {\n carregaDAV();\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, \"Erro ao carregar o orçamento.\\n\" + e.getMessage(), \"Erro do Sistema\", JOptionPane.ERROR_MESSAGE);\n }\n }\n }\n } else {\n JOptionPane.showMessageDialog(this, \"Já existe uma venda em andamento.\", \"Aviso do Sistema\", JOptionPane.INFORMATION_MESSAGE);\n }\n }\n\n //seleciona certificado digital\n if (listaMenuOperacoes.getSelectedIndex() == 1) {\n if (SessaoUsuario.statusCaixa != SC_VENDA_EM_ANDAMENTO) {\n selecionaCertificado();\n } else {\n JOptionPane.showMessageDialog(this, \"Existe uma venda em andamento.\", \"Aviso do Sistema\", JOptionPane.INFORMATION_MESSAGE);\n }\n }\n\n //consulta status serviço\n if (listaMenuOperacoes.getSelectedIndex() == 2) {\n SessaoUsuario.statusServico();\n }\n\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 void menu(){\n int numero;\n \n //x.setVisible(true);\n //while(opc>=3){\n r = d.readString(\"Que tipo de conversion deseas hacer?\\n\"\n + \"1)Convertir de F a C\\n\"\n + \"2)Convertir de C a F\\n\"\n + \"3)Salir\"); \n opc=Character.getNumericValue(r.charAt(0));\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 }", "public FRM_MenuPrincipal() {\n initComponents();\n archivos = new ArchivoUsuarios(); \n controlador = new CNTRL_MenuPrincipal(this, archivos);\n agregarControlador(controlador);\n setResizable(false);\n ordenarVentanas();\n }", "private static int menu() {\r\n\t\tSystem.out.println(\"Elige opcion de jugada:\");\r\n\t\tSystem.out.println(\"1-Piedra\");\r\n\t\tSystem.out.println(\"2-Papel\");\r\n\t\tSystem.out.println(\"3-Tijera\");\r\n\t\tSystem.out.println(\"0-Salir\");\r\n\t\tSystem.out.print(\"Opcion: \");\r\n\t\treturn Teclado.leerInt();\r\n\t}", "public void clicarAlterarDadosCadastrais() {\n\t\thomePage.getButtonMenu().click();\n\t\thomePage.getButtonAlterarDadosCadastrais().click();\t\t\n\t}", "private static void mostrarMenu() {\n\t\tSystem.out.println(\"------------------------------\");\n\t\tSystem.out.println(\"-----------OPCIONES-----------\");\n\t\tSystem.out.println(\"------------------------------\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"\\n\\t1) Mostrar los procesos\");\n\t\tSystem.out.println(\"\\n\\t2) Parar un proceso\");\n\t\tSystem.out.println(\"\\n\\t3) Arrancar un proceso\");\n\t\tSystem.out.println(\"\\n\\t4) A�adir un proceso\");\n\t\tSystem.out.println(\"\\n\\t5) Terminar ejecucion\");\n\t\tSystem.out.println(\"\\n------------------------------\");\n\t}", "private void menuArmadura(){\n System.out.println(\"Escolha o local em que queira colocar a uma armadura:\");\n System.out.println(\"1 - Cabeça\");\n System.out.println(\"2 - Tronco\");\n System.out.println(\"3 - Pernas\");\n System.out.println(\"4 - Pés\");\n System.out.println(\"0 - Sair\");\n }", "public static int menu()\n {\n \n int choix;\n System.out.println(\"MENU PRINCIPAL\");\n System.out.println(\"--------------\");\n System.out.println(\"1. Operation sur les membres\");\n System.out.println(\"2. Operation sur les taches\");\n System.out.println(\"3. Assignation de tache\");\n System.out.println(\"4. Rechercher les taches assigne a un membre\");\n System.out.println(\"5. Rechercher les taches en fonction de leur status\");\n System.out.println(\"6. Afficher la liste des taches assignees\");\n System.out.println(\"7. Sortir\");\n System.out.println(\"--------------\");\n System.out.print(\"votre choix : \");\n choix = Keyboard.getEntier();\n System.out.println();\n return choix;\n }", "public static int obterOpcaoMenu(Scanner sc) {\n\t\t//flag iniciando com o valor false\n\t\tboolean entradaValida = false;\n\t\t//opcao comeca com valor 3\n\t\tint opcao =3;\n\t\t//coletar dados para o menu\n\t\twhile(!entradaValida) {\n\t\tSystem.out.println(\"Digite a opcao desejada\");\n\t\tSystem.out.println(\"Digite (1) Consultar Contato\");\n\t\tSystem.out.println(\"Digite (2) Criar Contato\");\n\t\tSystem.out.println(\"Digite (3) Sair\");\n\t\t\n\t\t\n\t\ttry {\n\t\t\tString entrada= sc.nextLine();\n\t\t\t//mudando o valor de String para int\n\t\t\topcao = Integer.parseInt(entrada);\n\t\t\t//se qualquer uns desses botoes for selecionado mude para true a flag\n\t\t\tif(opcao ==1 || opcao ==2 || opcao==3) {\n\t\t\t\tentradaValida = true;\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\tentradaValida = false;\n\t\t\t\tthrow new Exception(\"Entrada invalida\");\n\t\t\t}\n\t\t}catch(Exception e) {\n\t\t\tSystem.out.println(\"entrada invalida digite novamente\\n\");\n\t\t}\n\t\t}\n\t\treturn opcao;\n\t}", "public void controlaMenuEditaFuncionario(Funcionario funcionario) {\n int opcao = this.telaFuncionario.pedeOpcao();\n\n switch (opcao) {\n case 1:\n String nome = this.telaFuncionario.pedeNome();\n funcionario.setNome(nome);\n this.telaFuncionario.mensagemNomeEditadoSucesso();\n menuEditaFuncionario(funcionario);\n break;\n case 2:\n int matricula = verificaMatriculaInserida();\n funcionario.setMatricula(matricula);\n this.telaFuncionario.mensagemMatriculaEditadaSucesso();\n menuEditaFuncionario(funcionario);\n break;\n case 3:\n String dataNascimento = cadastraDataNascimento();\n funcionario.setDataNascimento(dataNascimento);\n this.telaFuncionario.mensagemDataNascimentoEditadaSucesso();\n menuEditaFuncionario(funcionario);\n break;\n case 4:\n int telefone = this.telaFuncionario.pedeTelefone();\n funcionario.setTelefone(telefone);\n this.telaFuncionario.mensagemTelefoneEditadoSucesso();\n menuEditaFuncionario(funcionario);\n break;\n case 5:\n int salario = this.telaFuncionario.pedeSalario();\n funcionario.setSalario(salario);\n this.telaFuncionario.mensagemSalarioEditadoSucesso();\n menuEditaFuncionario(funcionario);\n break;\n\n case 6:\n this.telaFuncionario.exibeOpcaoCargoFuncionario();\n Cargo cargo = atribuiCargoAoFuncionario();\n funcionario.setCargo(cargo);\n this.telaFuncionario.mensagemCargoEditadoSucesso();\n menuEditaFuncionario(funcionario);\n break;\n\n case 7:\n exibeMenuFuncionario();\n break;\n default:\n this.telaFuncionario.opcaoInexistente();\n editaFuncionario();\n break;\n }\n }", "private static void menuno(int menuno2) {\n\t\t\r\n\t}", "private static void menuManejoJugadores() {\n\t\tint opcion;\n\t\tdo{\n\t\t\topcion=menuManejoJugadores.gestionar();\n\t\t\tgestionarMenuManejoJugador(opcion);\n\t\t}while(opcion!=menuManejoJugadores.getSALIR());\n\t}", "private static void menuCliente(int idCliente) throws Exception {//Inicio menuCliente \r\n byte opcao;\r\n int idCompra;\r\n ArrayList<Compra> minhasCompras = null;\r\n ArrayList<ItemComprado> meusItensComprados = null;\r\n ArrayList<Produto> listProdutos = null;\r\n boolean encerrarPrograma = false;\r\n do {\r\n try {\r\n System.out.println(\r\n \"\\n\\t*** MENU CLIENTE ***\\n\"\r\n + \"0 - Nova compra\\n\"\r\n + \"1 - Minhas compras\\n\"\r\n + \"2 - Alterar meus dados\\n\"\r\n + \"3 - Excluir conta\\n\"\r\n + \"4 - Sair\"\r\n );\r\n System.out.print(\"Digite sua opcao: \");\r\n opcao = read.nextByte();\r\n switch (opcao) {\r\n case 0:\r\n idCompra = arqCompra.inserir(new Compra(idCliente, new Date()));\r\n compraProdutos(idCliente, idCompra);\r\n break;\r\n case 1:\r\n listProdutos = arqProdutos.toList();\r\n minhasCompras = listComprasDoCliente(idCliente);\r\n for (Compra c : minhasCompras) {\r\n System.out.println(\"\\n*** Compra de ID: \" + c.getID() + \" Data: \" + dt.format(c.dataCompra));\r\n meusItensComprados = listarOsItensComprados(c.getID());\r\n for (ItemComprado ic : meusItensComprados) {\r\n for (Produto p : listProdutos) {\r\n if (p.getID() == ic.idProduto) {\r\n System.out.println(\r\n \"\\n\\tProduto: \" + p.nomeProduto\r\n + \"\\n\\tMarca: \" + p.marca\r\n + \"\\n\\tPreço: \" + tf.format(ic.precoUnitario)\r\n + \"\\n\\tQuant: \" + ic.qtdProduto\r\n );\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n case 2:\r\n uptadeDados(idCliente);\r\n break;\r\n case 3:\r\n System.out.println(\"\\nConfirmar opção? \\n0 - Sim\\n1 - Nao\");\r\n System.out.println(\"Digite a opcao desejada: \");\r\n switch (read.nextInt()) {\r\n case 0:\r\n if (arqClientes.remover(idCliente - 1)) {\r\n System.out.println(\"Remoção feita com sucesso!\");\r\n }\r\n break;\r\n case 1:\r\n System.out.println(\"\\nObrigado por continuar!\");\r\n break;\r\n default:\r\n System.out.println(\"\\nOpcao invalida!\");\r\n Thread.sleep(1000);\r\n break;\r\n }\r\n encerrarPrograma = true;\r\n break;\r\n case 4:\r\n encerrarPrograma = true;\r\n break;\r\n default:\r\n System.out.println(\"Opcao invalida!\\n\");\r\n Thread.sleep(1000);\r\n break;\r\n }\r\n } catch (InputMismatchException inputMismatchException) {\r\n System.out.println(\"\\nErro !\\nTente novamente!\");\r\n Thread.sleep(1000);\r\n read.next();//Limpar buffer do Scanner\r\n }\r\n } while (!encerrarPrograma);\r\n }", "public static void menuEmpleado() throws ClienteException, PersistenciaException, DniException, VehiculoException, DireccionException, VentaException, PersonaException {\n boolean salir = false;\n int opcion;\n\n while (!salir) {\n System.out.println(\"\\n1. Realizar ventas\");\n System.out.println(\"2. Gestionar clientes\");\n System.out.println(\"3. Salir\\n\");\n\n try {\n System.out.print(\"Introduzca una de las opciones: \");\n opcion = teclado.nextInt();\n teclado.nextLine();\n System.out.println(\"\");\n\n switch (opcion) {\n case 1:\n menuVentas();\n break;\n case 2:\n menuClientes();\n break;\n case 3:\n salir = true;\n break;\n default:\n System.out.println(\"Solo numeros entre 1 y 3\");\n }\n } catch (InputMismatchException e) {\n System.out.println(\"Debe insertar una opcion correcta\");\n teclado.next();\n }\n }\n }", "public static void menuInicial() {\n System.out.println(\"Boas vindas à Arena pokemon Treinador!!!\");\n System.out.println(\"Digite 1 para fazer sua inscrição\");\n System.out.println(\"Digite 2 para sair\");\n\n }", "public void consultasSeguimiento() {\r\n try {\r\n switch (opcionMostrarAnalistaSeguim) {\r\n case \"Cita\":\r\n ListSeguimientoRadicacionesConCita = Rad.ConsultasRadicacionYSeguimiento(2, mBsesion.codigoMiSesion());\r\n break;\r\n case \"Entrega\":\r\n ListSeguimientoRadicacionesConCita = Rad.ConsultasRadicacionYSeguimiento(3, mBsesion.codigoMiSesion());\r\n break;\r\n }\r\n } catch (Exception e) {\r\n mbTodero.setMens(\"Error en el metodo '\" + this.getClass() + \".consultasSeguimiento()' causado por: \" + e.getMessage());\r\n mbTodero.error();\r\n }\r\n\r\n }", "static void menuPrincipal() {\n System.out.println(\n \"\\nPizzaria o Rato que Ri:\" + '\\n' +\n \"1 - Novo pedido\" + '\\n' +\n \"2 - Mostrar pedidos\" + '\\n' +\n \"3 - Alterar estado do pedido\" + '\\n' +\n \"9 - Sair\"\n );\n }", "public void MostrarListas (){\n Nodo recorrer=inicio; // esto sirve para que el elemento de la lista vaya recorriendo conforme se inserta un elemento\r\n System.out.println(); // esto nos sirve para dar espacio a la codificacion de la lista al imprimir \r\n while (recorrer!=null){ // esta secuencia iterativa nos sirve para repetir las opciones del menu\r\n System.out.print(\"[\" + recorrer.dato +\"]--->\");\r\n recorrer=recorrer.siguiente;\r\n }\r\n }", "public static void menu(){\n System.out.println(\"-Ingrese el número correspondiente-\");\n System.out.println(\"------------ Opciones -------------\");\n System.out.println(\"------------ 1. Sumar -------------\");\n System.out.println(\"------------ 2. Restar ------------\");\n System.out.println(\"------------ 3. Multiplicar -------\");\n System.out.println(\"------------ 4. Dividir -----------\");\n }", "public MenuCriarArranhaCeus() {\n initComponents();\n }", "@SuppressWarnings(\"deprecation\")\n\tprivate static void Menu(String ruta, String base, \n\t\t\tlong tiempoInicial, long tiempoActual) {\n\t\tLocale.setDefault(Locale.UK);\n\t\tDecimalFormat df = new DecimalFormat(\"00\");\t\t\n\t\ttry {\n\t\t\tif (esDirectorio(ruta)) {\n\t\t\t\t// Lee la orden introducida por el operador\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\ttiempoActual = System.currentTimeMillis();\n\t\t\t\tDate t = new Date(tiempoActual - tiempoInicial);\n\t\t\t\tString PROMPT = df.format(t.getMinutes()) + \":\"\n\t\t\t\t\t\t+ df.format(t.getSeconds()) + \"> \";\n\t\t\t\tSystem.out.printf(\"%s\", PROMPT);\n\t\t\t\tScanner entrada = new Scanner(System.in);\n\t\t\t\tScanner orden = new Scanner(entrada.nextLine());\n\t\t\t\tString codigo = orden.next();\t\t\t\t\n\t\t\t\t\n\t\t\t\t// Procesa ordenes hasta que el operador escribe la \n\t\t\t\t//orden END\n\t\t\t\twhile (!codigo.equalsIgnoreCase(\"END\")) {\n\t\t\t\t\t// Identifica la orden y la ejecuta\n\t\t\t\t\t\n\t\t\t\t\tif (codigo.equalsIgnoreCase(\"HELP\")) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Muestra por pantalla el menu\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (!orden.hasNext()) {\n\t\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t\t\tmostrarMenu();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"--> Incorrect \" +\n\t\t\t\t\t\t\t\t\t\t\t\"order. You can write\" +\n\t\t\t\t\t\t\t\t\t\t\t\" HELP\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}// Fin Help\n\n\t\t\t\t\telse if (codigo.equalsIgnoreCase(\"DIR\")) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Lista por pantalla el contenido del \n\t\t\t\t\t\t * directorio actual\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (!orden.hasNext()) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tlistarDirectorio(ruta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"--> Incorrect \" +\n\t\t\t\t\t\t\t\t\t\t\t\"order. You can write \" +\n\t\t\t\t\t\t\t\t\t\t\t\"HELP\");\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}// Fin DIR\n\t\t\t\t\t\n\t\t\t\t\telse if (codigo.equalsIgnoreCase(\"DIRALL\")) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Lista por pantalla el contenido del \n\t\t\t\t\t\t * directorio actual con todos los subdirectorios\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (!orden.hasNext()) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tlistarDirectorio2(ruta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"--> Incorrect \" +\n\t\t\t\t\t\t\t\t\t\t\t\"order. You can write \" +\n\t\t\t\t\t\t\t\t\t\t\t\"HELP\");\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}// Fin DIR\n\n\t\t\t\t\telse if (codigo.equalsIgnoreCase(\"CD\")) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Cambia de directorio\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (orden.hasNext()) {\n\t\t\t\t\t\t\tString texto = orden.next();\n\t\t\t\t\t\t\tif (texto.equalsIgnoreCase(\"..\")) {\n\t\t\t\t\t\t\t\t// comprueba que no es el directorio \n\t\t\t\t\t\t\t\t// base\n\t\t\t\t\t\t\t\tif (!ruta.equalsIgnoreCase(base)) {\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tFile f = new File(ruta);\n\t\t\t\t\t\t\t\t\tMenu(f.getParent(), base, \n\t\t\t\t\t\t\t\t\t\t\ttiempoInicial, \n\t\t\t\t\t\t\t\t\t\t\ttiempoActual);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t\t.println(\"--> Name of \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"directory \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"unknown\");\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// cambio de directorio\n\t\t\t\t\t\t\t\tif (esDirectorio(texto)) {\n\t\t\t\t\t\t\t\t\tif(!texto.\n\t\t\t\t\t\t\t\t\t\t\tequalsIgnoreCase(ruta)) {\n\t\t\t\t\t\t\t\t\t\tMenu(texto, base, \n\t\t\t\t\t\t\t\t\t\t\t\ttiempoInicial, \n\t\t\t\t\t\t\t\t\t\t\t\ttiempoActual);\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\t// el usuario ya esta en ese \n\t\t\t\t\t\t\t\t\t\t// directorio\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"--> \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\"You are already \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\"in that directory\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t\t.println(\"--> Name of \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"directory \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"unknown\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"--> Incorrect order.\" +\n\t\t\t\t\t\t\t\t\t\t\t\" You can write HELP\");\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}// Fin CD\n\n\t\t\t\t\telse if (codigo.equalsIgnoreCase(\"WHERE\")) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Muestra por pantalla la ruta del \n\t\t\t\t\t\t * directorio actual\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (!orden.hasNext()) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSystem.out.printf(\"%s%n\", ruta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"--> Incorrect order.\" +\n\t\t\t\t\t\t\t\t\t\t\t\" You can write HELP\");\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}// Fin WHERE\n\n\t\t\t\t\telse if (codigo.equalsIgnoreCase(\"FIND\")) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Muestra por pantalla las imagenes cuyo \n\t\t\t\t\t\t * nombre coincida con una cadena de \n\t\t\t\t\t\t * caracteres determinada\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (orden.hasNext()) {\n\t\t\t\t\t\t\tString texto = \n\t\t\t\t\t\t\t\t(String) orden.next().toLowerCase();\n\t\t\t\t\t\t\t// crea el vector\n\t\t\t\t\t\t\tv = new Vector<ImageIcon>();\n\t\t\t\t\t\t\tFile f = new File(ruta);\n\t\t\t\t\t\t\tFile[] ficheros = f.listFiles();\n\t\t\t\t\t\t\trecorrerFicheros(ficheros, 0, texto);\n\t\t\t\t\t\t\trecorrerDirectorios(ficheros, 0, texto);\n\t\t\t\t\t\t\tmostrarVector(v);\n\t\t\t\t\t\t\t// si no ha encontrado imagenes\n\t\t\t\t\t\t\tif (v.size() == 0) {\n\t\t\t\t\t\t\t\tSystem.out.println(\"0 images found\");\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\tSystem.out\n\t\t\t\t\t\t\t\t\t\t.printf(\"%d images found%n\", \n\t\t\t\t\t\t\t\t\t\t\t\tv.size());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// vacia el vector\n\t\t\t\t\t\t\tv.clear();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"--> Incorrect order.\" +\n\t\t\t\t\t\t\t\t\t\t\t\" You can write HELP\");\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}// Fin FIND\n\n\t\t\t\t\telse if (codigo.equalsIgnoreCase(\"DEL\")) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Muestra la informacion de una imagen \n\t\t\t\t\t\t * determinada del directorio actual y ofrece \n\t\t\t\t\t\t * la posibilidad de eliminarla\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (orden.hasNext()) {\n\t\t\t\t\t\t\tString texto = (String) orden.next();\n\t\t\t\t\t\t\tFile f = new File(ruta);\n\t\t\t\t\t\t\tFile[] ficheros = f.listFiles();\n\t\t\t\t\t\t\tString nombre = sacarRuta(ficheros, 0, \n\t\t\t\t\t\t\t\t\ttexto);\n\t\t\t\t\t\t\tif (nombre == null) {\n\t\t\t\t\t\t\t\tSystem.out.println(\"0 images found\");\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\tFile fich = new File(nombre);\n\t\t\t\t\t\t\t\t// muestra la informacion de la \n\t\t\t\t\t\t\t\t// imagen\n\t\t\t\t\t\t\t\tinformacionImagen(fich);\n\t\t\t\t\t\t\t\tScanner s = new Scanner(System.in);\n\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t.printf(\"Do you want to \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\"delete the \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\"selected image? \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\"(Y/N): \");\n\t\t\t\t\t\t\t\tString respuesta = s.next();\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (respuesta.\n\t\t\t\t\t\t\t\t\t\tequalsIgnoreCase(\"y\")) {\n\t\t\t\t\t\t\t\t\tfich.delete();\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Image \" +\n\t\t\t\t\t\t\t\t\t\t\t\"deleted\");\n\t\t\t\t\t\t\t\t} else if (respuesta.\n\t\t\t\t\t\t\t\t\t\tequalsIgnoreCase(\"n\")) {\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"--> \" +\n\t\t\t\t\t\t\t\t\t\t\t\"Incorrect order, \" +\n\t\t\t\t\t\t\t\t\t\t\t\"please Y/N\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\"--> Incorrect \" +\n\t\t\t\t\t\t\t\t\t\"order. You can write HELP\");\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}// Fin DEL\n\n\t\t\t\t\telse if (codigo.equalsIgnoreCase(\"MOVE\")) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Mueve una imagen determinada a otro \n\t\t\t\t\t\t * directorio\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (orden.hasNext()) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString texto = (String) orden.next();\n\t\t\t\t\t\t\tFile f = new File(ruta);\n\t\t\t\t\t\t\tFile[] ficheros = f.listFiles();\n\t\t\t\t\t\t\tString nombre = sacarRuta(ficheros, 0, \n\t\t\t\t\t\t\t\t\ttexto);\n\t\t\t\t\t\t\t//no se ha encontrado la imagen\n\t\t\t\t\t\t\tif (nombre == null) {\n\t\t\t\t\t\t\t\tSystem.out.println(\"0 images found\");\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\tScanner s = new Scanner(System.in);\n\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t.printf(\"Where do you want\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\" to move the \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\"file?: \");\n\t\t\t\t\t\t\t\tString directorio = s.next();\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFile fil = new File(directorio);\n\t\t\t\t\t\t\t\tif (fil.isDirectory()) {\n\t\t\t\t\t\t\t\t\tmover(nombre, directorio);\n\t\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"Image moved\");\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t\t.println(\"--> Name of \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"directory \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"unknown\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}// Fin MOVE\n\n\t\t\t\t\telse if (codigo.equalsIgnoreCase(\"IMG\")) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Muestra por pantalla todas todas las \n\t\t\t\t\t\t * imagenes del directorio actual sin entrar\n\t\t\t\t\t\t * en subdirectorios\n\t\t\t\t\t\t */\t\t\t\t\t\t\n\t\t\t\t\t\tif (orden.hasNext()) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (orden.hasNextDouble()) {\n\t\t\t\t\t\t\t\tDouble tiempo = orden.nextDouble();\n\t\t\t\t\t\t\t\tFile f = new File(ruta);\n\t\t\t\t\t\t\t\tpractica6.Trabajo1.carrusel(f, \n\t\t\t\t\t\t\t\t\t\ttiempo);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t.println(\"--> Incorrect \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\"order. You can \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\"write HELP\");\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tFile f = new File(ruta);\n\t\t\t\t\t\t\tpractica6.Trabajo1.carrusel(f, 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}// Fin IMG\n\n\t\t\t\t\telse if (codigo.equalsIgnoreCase(\"IMGALL\")) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Muestra por pantalla todas todas las \n\t\t\t\t\t\t * imagenes del directorio actual entrando \n\t\t\t\t\t\t * en subdirectorios\n\t\t\t\t\t\t */\t\t\t\t\t\t\n\t\t\t\t\t\tif (orden.hasNext()) {\n\t\t\t\t\t\t\tif (orden.hasNextDouble()) {\n\t\t\t\t\t\t\t\tDouble tiempo = orden.nextDouble();\n\t\t\t\t\t\t\t\tFile f = new File(ruta);\n\t\t\t\t\t\t\t\tpractica6.Trabajo2.carruselTodas(f, \n\t\t\t\t\t\t\t\t\t\ttiempo);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t.println(\"--> Incorrect \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\"order. You can \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\"write HELP\");\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tFile f = new File(ruta);\n\t\t\t\t\t\t\tpractica6.Trabajo2.carruselTodas(f, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}// Fin IMGALL\n\t\t\t\t\t\n\t\t\t\t\telse if (codigo.equalsIgnoreCase(\"BIGIMG\")) {\n\t\t\t\t\t\tif (!orden.hasNext()) {\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tFile f = new File(ruta);\n\t\t\t\t\t\t\tFile[] ficheros = f.listFiles();\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tsacarGrande(ficheros,\"\",0);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\"--> Incorrect order.\"\n\t\t\t\t\t\t\t\t\t+ \" You can write HELP\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}// Fin BIGIMG\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Orden desconocida\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"--> Incorrect order. You\" +\n\t\t\t\t\t\t\t\t\t\t\" can write HELP\");\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Pide al operador una nueva orden y la lee\t\t\t\t\t\n\t\t\t\t\ttiempoActual = System.currentTimeMillis();\n\t\t\t\t\tt = new Date(tiempoActual - tiempoInicial);\n\t\t\t\t\tPROMPT = df.format(t.getMinutes()) + \":\"\n\t\t\t\t\t\t\t+ df.format(t.getSeconds()) + \"> \";\n\t\t\t\t\tSystem.out.printf(\"%n%s\", PROMPT);\n\t\t\t\t\tentrada = new Scanner(System.in);\n\t\t\t\t\torden = new Scanner(entrada.nextLine());\n\t\t\t\t\tcodigo = orden.next();\t\t\t\t\n\t\t\t\t}// Fin while\n\t\t\t\t\n // la orden del operador ha sido END\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\ttiempoActual = System.currentTimeMillis();\n\t\t\t\tt = new Date(tiempoActual - tiempoInicial);\n\t\t\t\tString ff = \"End of the program execution. \" +\n\t\t\t\t\t\t\"Running rime \"\n\t\t\t\t\t\t+ df.format(t.getMinutes()) + \" min and \"\n\t\t\t\t\t\t+ df.format(t.getSeconds()) + \"sec.\";\n\t\t\t\tSystem.out.println(ff);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"*** Error.\");\n\t\t}\n\t}", "private void mainMenuDetails() {\r\n try {\r\n System.out.println(\"Enter your choice:\");\r\n int menuOption = option.nextInt();\r\n switch (menuOption) {\r\n case 1:\r\n showFullMenu();\r\n break;\r\n case 2:\r\n empLogin();\r\n break;\r\n case 3:\r\n venLogin();\r\n // sub menu should not be this\r\n break;\r\n case 4:\r\n Runtime.getRuntime().halt(0);\r\n default:\r\n System.out.println(\"Choose either 1,2,3\");\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n System.out.println(\"enter a valid value\");\r\n }\r\n option.nextLine();\r\n mainMenu();\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n pnlPrincipal = new javax.swing.JPanel();\n mnbRestaurante = new javax.swing.JMenuBar();\n mnuPersonal = new javax.swing.JMenu();\n mniAltaPersonal = new javax.swing.JMenuItem();\n mniModificarPersonal = new javax.swing.JMenuItem();\n mniBajaPersonal = new javax.swing.JMenuItem();\n mnuVentas = new javax.swing.JMenu();\n mniRegistroVentas = new javax.swing.JMenuItem();\n mnuInventario = new javax.swing.JMenu();\n mnuNomina = new javax.swing.JMenu();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n pnlPrincipal.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n mnuPersonal.setText(\"Personal\");\n\n mniAltaPersonal.setText(\"Alta\");\n mniAltaPersonal.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n mniAltaPersonalActionPerformed(evt);\n }\n });\n mnuPersonal.add(mniAltaPersonal);\n\n mniModificarPersonal.setText(\"Modificar\");\n mnuPersonal.add(mniModificarPersonal);\n\n mniBajaPersonal.setText(\"Baja\");\n mnuPersonal.add(mniBajaPersonal);\n\n mnbRestaurante.add(mnuPersonal);\n\n mnuVentas.setText(\"Ventas\");\n\n mniRegistroVentas.setText(\"Registro Ventas\");\n mniRegistroVentas.setToolTipText(\"\");\n mnuVentas.add(mniRegistroVentas);\n\n mnbRestaurante.add(mnuVentas);\n\n mnuInventario.setText(\"Inventario\");\n mnbRestaurante.add(mnuInventario);\n\n mnuNomina.setText(\"Nomina\");\n mnbRestaurante.add(mnuNomina);\n\n setJMenuBar(mnbRestaurante);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(pnlPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(pnlPrincipal, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)\n );\n\n pack();\n }", "public PanelMenuPrincipal() {\r\n\t\tinitComponents();\r\n\t\tif (((Usuario) Util.usuarioCommon).getUsrAccPanelControlSn()\r\n\t\t\t\t.equals(\"N\")) {\r\n\t\t\tbtnAdmGral.setVisible(false);\r\n\t\t\tjSeparator4.setVisible(false);\r\n\t\t}\r\n\t\tagregarEscuchas();\r\n\t\t//panelSubMenu.setLayout(null);\r\n\r\n\t}", "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 }", "private void afficheMenu() {\n\t\tSystem.out.println(\"------------------------------ Bien venu -----------------------------\");\n\t\tSystem.out.println(\"--------------------------- \"+this.getName()+\" ------------------------\\n\");\n\t\t\n\t\ttry {\n\t\t\tThread.sleep(40);\n\t\t\tSystem.out.println(\"A- Afficher l'état de l'hôtel. \");\n\t\t\tThread.sleep(50);\n\t\t\tSystem.out.println(\"B- Afficher Le nombre de chambres réservées.\");\n\t\t\tThread.sleep(60);\n\t\t\tSystem.out.println(\"C- Afficher Le nombre de chambres libres.\");\n\t\t\tThread.sleep(70);\n\t\t\tSystem.out.println(\"D- Afficher Le numéro de la première chambre vide.\");\n\t\t\tThread.sleep(80);\n\t\t\tSystem.out.println(\"E- Afficher La numéro de la dernière chambre vide.\");\n\t\t\tThread.sleep(90);\n\t\t\tSystem.out.println(\"F- Reserver une chambre.\");\n\t\t\tThread.sleep(100);\n\t\t\tSystem.out.println(\"G- Libérer une chambre.\");\n\t\t\tThread.sleep(100);\n\t\t\tSystem.out.println(\"O- Voire toutes les options possibles?\");\n\t\t\tThread.sleep(100);\n\t\t\tSystem.out.println(\"H- Aide?\");\n\t\t\tThread.sleep(100);\n\t\t\tSystem.out.println(\"-------------------------------------------------------------------------\");\n\t\t}catch(Exception err) {\n\t\t\tSystem.out.println(\"Error d'affichage!\");\n\t\t}\n\t\n\t}", "public static void menu() {\n\t\tRaton ratones[] = new Raton[3];\n\t\tTeclado teclados[] = new Teclado[3];\n\t\tMonitor monitores[] = new Monitor[3];\n\t\tString[] computadoras = {\"Windows\",\"Linux\",\"Mac\"};\n\t\t\n\t\t// Cargamos los arrays mediante metodos\n\t\tratones = cargaRatones();\n\t\tteclados = cargaTeclados();\n\t\tmonitores = cargaMonitores();\n\t\t\n\t\t// Creamos variables para las opciones seleccionadas\n\t\tOrden orden = new Orden();\n\t\tint opRaton = 1;\n\t\tint opTeclado = 1;\n\t\tint opMonitor = 1;\n\t\tint opComputadora = 1;\n\t\tint opcion = 1;\n\t\tboolean repetir = true; // Variable para repetir la seleccion en caso de excepcion\n\t\t\n\t\t// Bucle menu\n\t\tdo {\n\t\t\tSystem.out.println(\"---- Carga de datos de Computadora ----\");\n\t\t\t// SELECCION DE RATON\n\t\t\trepetir = true; // La variable toma el valor de true antes de cada seleccion de opciones\n\t\t\twhile(repetir) { // While para repetir la pregunta en caso de excepcion o error\n\t\t\t\tSystem.out.println(\"Seleccione Raton: \");\n\t\t\t\tfor(int i=0; i<ratones.length ; i++) { // Se recorre el array y muestra los datos como opciones\n\t\t\t\t\tSystem.out.println(\"\\t[\"+(i+1)+\". \"+ratones[i]+\"]\");\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\topRaton = input.nextInt();\n\t\t\t\t\tif(opRaton>0 && opRaton<=ratones.length) { // Si el numero ingresado esta fuera del rango se repite\n\t\t\t\t\t\trepetir = false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.println(\"Error, fuera de rango...\");\n\t\t\t\t\t}\n\t\t\t\t}catch(InputMismatchException e) { // Tira una excepcion si se ingresa un valor No numerico\n\t\t\t\t\tinput.nextLine();\n\t\t\t\t\tSystem.out.println(\"Error, Debe ingresar un numero...\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// SELECCION DE TECLADO\n\t\t\trepetir = true; // La variable toma el valor de true antes de cada seleccion de opciones\n\t\t\twhile(repetir) { // While para repetir la pregunta en caso de excepcion o error\n\t\t\t\tSystem.out.println(\"Seleccione Teclado: \");\n\t\t\t\tfor(int i=0; i<teclados.length ; i++) { // Se recorre el array y muestra los datos como opciones\n\t\t\t\t\tSystem.out.println(\"\\t[\"+(i+1)+\". \"+teclados[i]+\"]\");\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\topTeclado = input.nextInt();\n\t\t\t\t\tif(opTeclado>0 && opTeclado<=ratones.length) { // Si el numero ingresado esta fuera del rango se repite\n\t\t\t\t\t\trepetir = false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.println(\"Error, fuera de rango...\");\n\t\t\t\t\t}\n\t\t\t\t}catch(InputMismatchException e) { // Tira una excepcion si se ingresa un valor No numerico\n\t\t\t\t\tinput.nextLine();\n\t\t\t\t\tSystem.out.println(\"Error, Debe ingresar un numero...\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// SELECCION DE MONITOR\n\t\t\trepetir = true; // La variable toma el valor de true antes de cada seleccion de opciones\n\t\t\twhile(repetir) { // While para repetir la pregunta en caso de excepcion o error\n\t\t\t\tSystem.out.println(\"Seleccione Monitor: \");\n\t\t\t\tfor(int i=0; i<monitores.length ; i++) { // Se recorre el array y muestra los datos como opciones\n\t\t\t\t\tSystem.out.println(\"\\t[\"+(i+1)+\". \"+monitores[i]+\"]\");\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\topMonitor = input.nextInt();\n\t\t\t\t\tif(opMonitor>0 && opMonitor<=ratones.length) { // Si el numero ingresado esta fuera del rango se repite\n\t\t\t\t\t\trepetir = false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.println(\"Error, fuera de rango...\");\n\t\t\t\t\t}\n\t\t\t\t}catch(InputMismatchException e) { // Tira una excepcion si se ingresa un valor No numerico\n\t\t\t\t\tinput.nextLine();\n\t\t\t\t\tSystem.out.println(\"Error, Debe ingresar un numero...\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// SELECCION DE COMPUTADORA\n\t\t\trepetir = true; // La variable toma el valor de true antes de cada seleccion de opciones\n\t\t\twhile(repetir) { // While para repetir la pregunta en caso de excepcion o error\n\t\t\t\tSystem.out.println(\"Seleccione una computadora:\");\n\t\t\t\tfor(int i=0 ; i<computadoras.length ; i++) { // Se recorre el array y muestra los datos como opciones\n\t\t\t\t\tSystem.out.println(\"\\t[\"+(i+1)+\". \"+computadoras[i]+\"]\");\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\topComputadora = input.nextInt();\n\t\t\t\t\tif(opComputadora>0 && opComputadora<=ratones.length) { // Si el numero ingresado esta fuera del rango se repite\n\t\t\t\t\t\trepetir = false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.println(\"Error, fuera de rango...\");\n\t\t\t\t\t}\n\t\t\t\t}catch(InputMismatchException e) { // Tira una excepcion si se ingresa un valor No numerico\n\t\t\t\t\tinput.nextLine();\n\t\t\t\t\tSystem.out.println(\"Error, Debe ingresar un numero...\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Se crea la computadora y se agrega a la orden\n\t\t\tComputadora computadora = new Computadora(computadoras[opComputadora-1], monitores[opMonitor-1], teclados[opTeclado-1], ratones[opRaton-1]);\n\t\t\torden.agregarComputadora(computadora);\n\t\t\tSystem.out.println(\"Computadora agregada a la orden!!\");\n\t\t\t\n\t\t\t// OPCIONES PARA SEGUIR AGREGANDO COMPUTADORAS\n\t\t\trepetir = true; // La variable toma el valor de true antes de cada seleccion de opciones\n\t\t\twhile(repetir) { // While para repetir la pregunta en caso de excepcion o error\n\t\t\t\tSystem.out.println(\"Desea agregar otra computadora?: [1. Si] - [2. No]\");\n\t\t\t\ttry {\n\t\t\t\t\topcion = input.nextInt();\n\t\t\t\t\tif(opcion == 1 || opcion == 2) { // Si el numero ingresado esta fuera del rango se repite\n\t\t\t\t\t\trepetir = false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.println(\"Error, fuera de rango...\");\n\t\t\t\t\t}\n\t\t\t\t}catch(InputMismatchException e) { // Tira una excepcion si se ingresa un valor No numerico\n\t\t\t\t\tinput.nextLine();\n\t\t\t\t\tSystem.out.println(\"Error, Debe ingresar un numero...\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\n\\n\");\n\t\t\t\t\t\n\t\t}while(opcion == 1);\n\t\t\n\t\t// Muestra todas las computadoras de la orden\n\t\tSystem.out.println(\"====== Datos de la orden ======\");\n\t\torden.mostrarOrden();\n\t\t\n\t}", "public int menuListados(){\n lector = new Scanner(System.in);\n\n int opcion = -1;\n do {\n Lib.limpiarPantalla();\n System.out.println(\"************************************\");\n System.out.println(\"* LISTADOS *\");\n System.out.println(\"************************************\");\n System.out.println(\"1. Mostrar todos los multimedias\");\n System.out.println(\"2. Mostrar peliculas ordenadas \");\n System.out.println(\"3. Mostrar videojuegos ordenados por anyo\");\n System.out.println(\"4. Listado del histórico de alquileres de un socio ordenados por fecha de alquiler\");\n System.out.println(\"5. Listado de los alquileres actuales de un socio\");\n System.out.println(\"6. Listado de los socios con recargos pendientes\");\n System.out.println(\"---------------------\");\n System.out.println(\"0. Cancelar\\n\");\n System.out.println(\"Elija una opción: \");\n try {\n opcion = Integer.parseInt(Lib.lector.nextLine());\n if (opcion < 0 || opcion > 6) {\n System.out.println(\"Elija una opción del menú [0-7]\");\n Lib.pausa();\n }\n } catch (NumberFormatException nfe) {\n System.out.println(\"Solo números por favor\");\n Lib.pausa();\n }\n } while (opcion < 0 || opcion > 6);\n return opcion;\n\n\n }", "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 static void menuGerente() throws ClienteException, PersistenciaException, DniException, EmpleadoException, VehiculoException, BastidorException, DireccionException, VentaException, PersonaException {\n boolean salir = false;\n int opcion;\n\n while (!salir) {\n System.out.println(\"\\n1. Realizar ventas\");\n System.out.println(\"2. Gestionar clientes\");\n System.out.println(\"3. Gestionar empleados\");\n System.out.println(\"4. Gestionar vehiculos\");\n System.out.println(\"5. Salir\\n\");\n\n try {\n System.out.print(\"Introduzca una de las opciones: \");\n opcion = teclado.nextInt();\n teclado.nextLine();\n System.out.println(\"\");\n\n switch (opcion) {\n case 1:\n menuVentas();\n break;\n case 2:\n menuClientes();\n break;\n case 3:\n menuEmpleados();\n break;\n case 4:\n menuVehiculos();\n break;\n case 5:\n salir = true;\n break;\n default:\n System.out.println(\"Solo numeros entre 1 y 5\");\n }\n } catch (InputMismatchException e) {\n System.out.println(\"Debe insertar una opcion correcta\");\n teclado.next();\n }\n }\n }", "private void setMenu() {\n\n if (tree.isEmpty() || !treeGrid.anySelected()) {\n mainMenu.setItems(newMenuItem, new MenuItemSeparator(), settingMenuItem, searchMenuItem, correlationDiagramMenuItem, progMenuItem);\n } else if (treeGrid.getSelectedRecord() == null) {\n mainMenu.setItems(renameMenuItem, searchMenuItem, correlationDiagramMenuItem, progMenuItem);\n } else if (treeGrid.getSelectedRecords().length > 1) {\n ListGridRecord[] selectedNode = treeGrid.getSelectedRecords();\n if (isSameExtension(selectedNode, Extension.FP)) {\n mainMenu.setItems(deleteMenu, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, progMenuItem, exportMenuItem);\n } else if (isSameExtension(selectedNode, Extension.FPS)) {\n mainMenu.setItems(newFPItem, deleteMenu, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, progMenuItem);\n } else if (isSameExtension(selectedNode, Extension.BPS)) {\n mainMenu.setItems(newBPItem, deleteMenu, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, progMenuItem);\n } else if (isSameExtension(selectedNode, Extension.SCSS)) {\n mainMenu.setItems(newSCSItem, deleteMenu, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, progMenuItem);\n } else {\n mainMenu.setItems(deleteMenu, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, progMenuItem);\n }\n } else if (tree.isFolder(treeGrid.getSelectedRecord())) {\n mainMenu.setItems(newMenuItem, deleteMenu, renameMenuItem, copyMenuItem, pasteMenuItem, searchMenuItem, correlationDiagramMenuItem, progMenuItem, downloadMenuItem,\n copyPathMenuItem);\n } else {\n FileTreeNode selectedNode = (FileTreeNode) treeGrid.getSelectedRecord();\n VMResource resource = selectedNode.getResource();\n if (resource instanceof VMDirectory) {\n return;\n }\n Extension extension = ((VMFile) resource).getExtension();\n if (extension == null) {\n mainMenu.setItems(openWithMenuItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n } else\n switch (extension) {\n case ARC:\n mainMenu.setItems(newBPSItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case FM:\n mainMenu.setItems(newFMCItem, newTCItem, newFPSItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case FMC:\n mainMenu.setItems(deleteMenu, renameMenuItem, historyMenuItem, downloadMenuItem, searchMenuItem, correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case TC:\n mainMenu.setItems(newTCItem, newFPSItem, deleteMenu, renameMenuItem, historyMenuItem, downloadMenuItem, searchMenuItem, correlationDiagramMenuItem,\n copyPathMenuItem);\n break;\n case FPS:\n mainMenu.setItems(newFPItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case FP:\n mainMenu.setItems(newSPQLItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, exportMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case BPS:\n mainMenu.setItems(newBPItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case BP:\n mainMenu.setItems(newSPQLItem, deleteMenu, renameMenuItem, historyMenuItem, downloadMenuItem, searchMenuItem, correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case SCSS:\n mainMenu.setItems(newSCSItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case SCS:\n mainMenu.setItems(newSPQLItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n default:\n mainMenu.setItems(deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, correlationDiagramMenuItem,\n copyPathMenuItem);\n break;\n }\n }\n }", "public String verMenu(){\r\n try {\r\n Object opcion=JOptionPane.showInputDialog(\r\n null,\r\n \"Seleccione Opcion\",\"Agenda de Anexos\",\r\n JOptionPane.QUESTION_MESSAGE,\r\n null,\r\n new String[]{\"1.- Registrar Empleado\",\r\n \"2.- Asignar Anexo a Empleado\",\r\n \"3.- Obtener ubicacion de un Anexo\",\r\n \"4.- Modificar Anexo a Empleado\",\r\n \"5.- Desasignar Anexo a Empleado\",\r\n \"6.- Listado de Asignaciones\",\r\n \"7.- Salir del Programa\"},\r\n \"1.- Registrar Empleado\");\r\n return(String.valueOf(opcion).substring(0, 1)); // RETORNA A FUNCION VOID MAIN\r\n } catch (Exception ex) {\r\n System.out.println(\"Hubo un error al ingresar una opcion \"+ex.toString());\r\n }\r\n return \"0\";\r\n }", "private void addMenuReporte(){\n \n Menu menuR = new Menu(\"Reportes\");\n MenuItem menuItem1 = new MenuItem(\"Reporte de meses que no se registro compras de revistas\");\n MenuItem menuItem2 = new MenuItem(\"Reporte por rango trimestre mostrar promedio de revistas recibidas\");\n MenuItem menuItem3 = new MenuItem(\"Reporte de continuidad, mas meses (Mas Numeros) , soportar duplicidad de datos.\");\n MenuItem menuItem4 = new MenuItem(\"Reporte ordenado por numero de cada revista que se recibio en el anio\");\n MenuItem menuItem5 = new MenuItem(\"Revistas disponibles por mes\"); \n MenuItem menuItem6 = new MenuItem(\"Reportes revistas ordenado\"); \n \n menuR.getItems().add(menuItem5);\n menuR.getItems().add(menuItem1);\n menuR.getItems().add(menuItem2);\n menuR.getItems().add(menuItem3);\n menuR.getItems().add(menuItem4);\n \n menuItem5.setOnAction(new EventHandler<ActionEvent>() { \n @Override\n public void handle(ActionEvent event) {\n gridPane.getChildren().clear();\n reporteTotal_5() ;\n }\n });\n \n menuItem1.setOnAction(new EventHandler<ActionEvent>() { \n @Override\n public void handle(ActionEvent event) {\n gridPane.getChildren().clear();\n reporteTotal_1();\n }\n });\n \n menuItem2.setOnAction(new EventHandler<ActionEvent>() { \n @Override\n public void handle(ActionEvent event) {\n gridPane.getChildren().clear();\n reporteTotal_2() ;\n }\n });\n menuItem3.setOnAction(new EventHandler<ActionEvent>() { \n @Override\n public void handle(ActionEvent event) {\n gridPane.getChildren().clear();\n reporteTotal_3() ;\n }\n });\n \n menuItem4.setOnAction(new EventHandler<ActionEvent>() { \n @Override\n public void handle(ActionEvent event) {\n gridPane.getChildren().clear();\n reporteTotal_4() ;\n }\n });\n \n menuBar.getMenus().add(menuR);\n }", "public static void menuPrincipal() throws ClienteException, PersistenciaException, DniException, EmpleadoException, VehiculoException, BastidorException, DireccionException, VentaException, PersonaException {\n teclado = new Scanner(System.in);\n boolean salir = false;\n int opcion;\n\n while (!salir) {\n System.out.println(\"\\n1. Acceso Gerente\");\n System.out.println(\"2. Acceso Empleado\");\n System.out.println(\"3. Salir\\n\");\n\n try {\n System.out.print(\"Introduzca una de las opciones: \");\n opcion = teclado.nextInt();\n teclado.nextLine();\n System.out.println(\"\");\n\n switch (opcion) {\n case 1:\n pedirCredenciales(1);\n menuGerente();\n break;\n case 2:\n pedirCredenciales(2);\n menuEmpleado();\n break;\n case 3:\n salir = true;\n System.out.println(\"Usted a salido correctamente del programa\");\n break;\n default:\n System.out.println(\"Solo numeros entre 1 y 3\");\n }\n } catch (InputMismatchException e) {\n System.out.println(\"Debe insertar una opcion correcta\");\n teclado.next();\n }\n }\n }", "public void mostrarMenu(){\n int opcion = 0;\n\n System.out.println(\"CALCULADORA\");\n System.out.println(\"****************\");\n\n do{\n\n System.out.println(\"1.- SUMAR\");\n System.out.println(\"2.- RESTAR\");\n System.out.println(\"3.- MULTIPLICAR\");\n System.out.println(\"4.- DIVIDIR\");\n System.out.println(\"0.- SALIR\");\n System.out.println(\"****************\");\n System.out.print(\"Selecciona operacion: \");\n\n opcion = sc.nextInt();\n\n switch(opcion){\n case 1:\n sumar();\n break;\n case 2:\n restar();\n break;\n case 3:\n multiplicar();\n break;\n case 4:\n dividir();\n break;\n case 0:\n System.out.println(\"Gracias por usar la calculadora\");\n break;\n default:\n System.out.println(\"La opcion selecciona no es valida\");\n\n }\n\n }while (opcion != 0);\n\n }", "public MenuAcordeon() {\n\n initComponents();\n componentes = new ArrayList<ComponenteMenu>();\n alto_componentes = 31;\n \n agregar(new ComponenteMenu());\n agregar(new ComponenteMenu());\n \n }", "public void menuLojas() {\n int ciclo = 0;\n while (ciclo == 0) {\n try {\n System.out.println(\"O que pretende fazer?\");\n System.out.println(\"\\t1 -> Declarar uma encomenda como pronta!\");\n System.out.println(\"\\t2 -> Adicionar produtos à lista de produtos\");\n System.out.println(\"\\t3 -> Remover produtos da lista de produtos\");\n System.out.println(\"\\t4 -> Alterar o tamanho da fila\");\n System.out.println(\"\\t5 -> Ver os produtos prontos para entregar\");\n System.out.println(\"\\t6 -> Alterar dados\");\n System.out.println(\"\\t0 -> Logout\");\n int opcao = Input.lerInt();\n switch (opcao) {\n case 1:\n this.prontarEnc();\n break;\n case 2:\n this.adicionaProdutos();\n System.out.println(\"Produto adicionado!\");\n this.controller.gravar();\n break;\n case 3:\n this.removeProdutos();\n System.out.println(\"Produto Removido!\");\n this.controller.gravar();\n break;\n case 4:\n System.out.println(\"Quantas pessoas estao de momento na fila?\");\n int tamanho_fila = Input.lerInt();\n this.controller.qtsPessoasAtual(tamanho_fila);\n this.controller.gravar();\n break;\n case 5:\n System.out.println(\"Produtos prontos para entregar:\");\n Collection<String> h = this.controller.historicoEncomendas();\n for (String s : h) {\n System.out.println(\"\\t\" + s);\n }\n try {\n System.out.println(\"Escreva o id de uma das compras para mais detalhes ou 0 para sair\");\n String id = Input.lerString();\n String encomenda = this.controller.getEncomenda(id);\n System.out.println(encomenda);\n } catch (EntidadeNaoExisteException exc) {\n System.out.println(exc.getMessage());\n }\n break;\n case 6:\n boolean sair = this.alteraDadosLoja();\n if(sair) ciclo = 1;\n break;\n case 0:\n ciclo = 1;\n break;\n default:\n System.out.println(\"Ups! Opção Inválida. A opção \" + opcao + \" não existe!\");\n break;\n }\n } catch (ListaVaziaException | IOException exc) {\n System.out.println(\"Ups! \" + exc.getMessage());\n }\n }\n }", "public void confirmacionVolverMenu(){\n AlertDialog.Builder builder = new AlertDialog.Builder(Postre.this);\n builder.setCancelable(false);\n builder.setMessage(\"¿Desea salir?\")\n .setPositiveButton(\"Aceptar\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\tIntent intent = new Intent(Postre.this, HomeAdmin.class);\n\t\t\t\t\t\tintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_FORWARD_RESULT);\n\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\toverridePendingTransition(R.anim.left_in, R.anim.left_out);\t\n }\n })\n .setNegativeButton(\"Cancelar\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n }\n });\n \n builder.show();\n }", "public void seleccionarBeneficiario(){\n\t\tvisualizarGrabarRequisito = false;\r\n\t\ttry{\r\n\t\t\tlog.info(\"intItemBeneficiarioSeleccionar:\"+intItemBeneficiarioSeleccionar);\r\n\t\t\tif(intItemBeneficiarioSeleccionar.equals(new Integer(0))){\r\n\t\t\t\tbeneficiarioSeleccionado = null;\r\n\t\t\t\tlistaEgresoDetalleInterfaz = new ArrayList<EgresoDetalleInterfaz>();\r\n\t\t\t\tbdTotalEgresoDetalleInterfaz = null;\r\n\t\t\t\t//\r\n\t\t\t\tmostrarPanelAdjuntoGiro = false;\r\n\t\t\t\tdeshabilitarNuevo = false;\r\n\t\t\t\tdeshabilitarNuevoBeneficiario = false;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(BeneficiarioPrevision beneficiarioPrevision : expedientePrevisionGirar.getListaBeneficiarioPrevision()){\r\n\t\t\t\tif(beneficiarioPrevision.getId().getIntItemBeneficiario().equals(intItemBeneficiarioSeleccionar)){\r\n\t\t\t\t\tbeneficiarioSeleccionado = beneficiarioPrevision;\r\n\t\t\t\t\tlistaEgresoDetalleInterfaz = previsionFacade.cargarListaEgresoDetalleInterfaz(expedientePrevisionGirar, beneficiarioSeleccionado);\t\t\t\t\t\r\n\t\t\t\t\tbdTotalEgresoDetalleInterfaz = ((EgresoDetalleInterfaz)(listaEgresoDetalleInterfaz.get(0))).getBdSubTotal();;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tList<ControlFondosFijos> listaControlValida = new ArrayList<ControlFondosFijos>();\r\n\t\t\tfor(ControlFondosFijos controlFondosFijos : listaControl){\r\n\t\t\t\tAcceso acceso = bancoFacade.obtenerAccesoPorControlFondosFijos(controlFondosFijos);\r\n\t\t\t\tlog.info(controlFondosFijos);\r\n\t\t\t\tlog.info(acceso);\t\t\t\t\r\n\t\t\t\tif(acceso!=null\r\n\t\t\t\t&& acceso.getAccesoDetalleUsar()!=null\r\n\t\t\t\t&& acceso.getAccesoDetalleUsar().getBdMontoMaximo()!=null\r\n\t\t\t\t&& acceso.getAccesoDetalleUsar().getBdMontoMaximo().compareTo(bdTotalEgresoDetalleInterfaz)>=0){\r\n\t\t\t\t\tlistaControlValida.add(controlFondosFijos);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvisualizarGrabarRequisito = true;\r\n\t\t\tdeshabilitarNuevoBeneficiario = false;\r\n\t\t\t\r\n\t\t\tif(listaControlValida.isEmpty() && intItemBeneficiarioSeleccionar!=0){\r\n\t\t\t\t//Deshabilitamos todos los campos para detener el proceso de grabacion\r\n\t\t\t\tif(validarExisteRequisito()) {\r\n\t\t\t\t\tmensajeAdjuntarRequisito = \"No existe un fondo de cambio con un monto máximo configurado que soporte el monto de giro del expediente.\"+\r\n\t\t\t\t\t \"Este giro será realizado por la Sede Central.\";\r\n\t\t\t\t\tmostrarMensajeAdjuntarRequisito = true;\r\n\t\t\t\t\tmostrarPanelAdjuntoGiro = true;\r\n\t\t\t\t\thabilitarGrabarRequisito = true;\t\r\n\t\t\t\t\tvisualizarGrabarAdjunto = true;\r\n\t\t\t\t\tdeshabilitarNuevo = true;\r\n\t\t\t\t\tdeshabilitarDescargaAdjuntoGiro = false;\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tmensajeAdjuntarRequisito = \"Ya existen requisitos registrados para este expediente.\";\r\n\t\t\t\t\tarchivoAdjuntoGiro = previsionFacade.getArchivoPorRequisitoPrevision(lstRequisitoPrevision.get(0));\r\n\t\t\t\t\tmostrarMensajeAdjuntarRequisito = true;\r\n\t\t\t\t\tmostrarPanelAdjuntoGiro = true;\r\n\t\t\t\t\thabilitarGrabarRequisito = false;\r\n\t\t\t\t\tvisualizarGrabarAdjunto =false;\r\n\t\t\t\t\tdeshabilitarNuevo = true;\r\n\t\t\t\t\tdeshabilitarDescargaAdjuntoGiro = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tvisualizarGrabarRequisito = false;\r\n\t\t\t\tmostrarPanelAdjuntoGiro = false;\r\n\t\t\t\tdeshabilitarNuevo = false;\r\n\t\t\t\tdeshabilitarDescargaAdjuntoGiro = false;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}catch (Exception e){\r\n\t\t\tlog.error(e.getMessage(),e);\r\n\t\t}\r\n\t}", "public CARGOS_REGISTRO() {\n initComponents();\n InputMap map2 = txtNombre.getInputMap(JTextField.WHEN_FOCUSED); \n map2.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK), \"null\");\n InputMap maps = TxtSue.getInputMap(JTextField.WHEN_FOCUSED); \n maps.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK), \"null\");\n InputMap map3 = txtFun.getInputMap(JTextField.WHEN_FOCUSED); \n map3.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK), \"null\");\n this.setLocationRelativeTo(null);\n this.txtFun.setLineWrap(true);\n this.lblId.setText(Funciones.extraerIdMax());\n\t\tsexo.addItem(\"Administrativo\");\n\t\tsexo.addItem(\"Operativo\");\n sexo.addItem(\"Tecnico\");\n sexo.addItem(\"Servicios\");\n \n }", "MenuPrincipal(String pLogin, String pUsuario)\t\r\n\t{\r\n\t\tsetTitle(\"Sistema de Gerenciamento de Estoque e Frente de Caixa - Não Fiscal\");\r\n\t\tsetSize(1100,700);\r\n\t\tsetLocationRelativeTo(null);\r\n\t\t\r\n\t\t// painel\r\n\t\t\r\n\t\tp1 = new JPanel();\r\n\t\tp1.setLayout(null);\r\n\t\tp1.setBackground(new Color(192,192,192));\r\n\t\tgetContentPane().add(p1);\r\n\t\t\r\n\t\t//recebendo parametro\r\n\t\t\r\n\t\tlogin = pLogin;\r\n\t\tusuario = pUsuario;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//icone\r\n\t\ticone = new ImageIcon(\"Imagens/icon_sge.jpg\");\r\n\t\tsetIconImage(icone.getImage());\r\n\r\n\t\t\r\n\t\t//definindo imagem em JLabel\r\n\r\n\t\t\r\n\t\tiImagem = new ImageIcon(\"Imagens/logo_sge.png\");\r\n\r\n\t\tlImagem = new JLabel(iImagem);\r\n\t\t\r\n\t\tlImagem.setBounds(20,78,1040,526);\r\n\t\tp1.add(lImagem);\r\n\t\t\r\n\t\t\r\n\t\t// Data\r\n\t\t\r\n\t\tagora = new Date();\r\n\t\tdf = DateFormat.getDateInstance(DateFormat.FULL);\r\n\t\tdata = df.format(agora);\r\n\t\t\r\n\t\tlData = new JLabel(data);\r\n\t\t\r\n\t\tlData.setBounds(5,615,310,30);\r\n\t\tlData.setForeground(Color.white);\r\n\t\tlData.setFont(new Font(\"Arial\",Font.PLAIN,16));\r\n\t\tp1.add(lData);\r\n\t\t\r\n\t\t// usuario\r\n\t\t\r\n\t\tlUsuario = new JLabel(\"Usuário: \"+usuario);\r\n\t\tlUsuario.setFont(new Font(\"Arial\",Font.BOLD,16));\r\n\t\tlUsuario.setBounds(315,615,200,30);\r\n\t\tp1.add(lUsuario);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// Estoque crítico e produtos indisponiveis\r\n\t\t\r\n\t\tlQuantidadeProdutosEstoqueCritico = new JLabel(\"Quantidade de Produtos em Estoque Crítico\");\r\n\t\tlQuantidadeProdutosEstoqueCritico.setBounds(10,10,250,20);\r\n\t\tp1.add(lQuantidadeProdutosEstoqueCritico);\r\n\t\t\r\n\t\t\r\n\t\ttQuantidadeProdutosEstoqueCritico = new JTextField();\t\r\n\t\ttQuantidadeProdutosEstoqueCritico.setBounds(10,30,100,30);\r\n\t\ttQuantidadeProdutosEstoqueCritico.setEditable(false);\r\n\t\tp1.add(tQuantidadeProdutosEstoqueCritico);\r\n\t\t\r\n\t\t\r\n\t\t// indisponiveis\r\n\t\tlQuantidadeProdutosIndisponiveis = new JLabel(\"Quantidade de Produtos Indisponíveis\");\r\n\t\tlQuantidadeProdutosIndisponiveis.setBounds(280,10,250,20);\r\n\t\tp1.add(lQuantidadeProdutosIndisponiveis);\r\n\t\t\r\n\t\t\r\n\t\ttQuantidadeProdutosIndisponiveis = new JTextField();\r\n\t\ttQuantidadeProdutosIndisponiveis.setBounds(280,30,100,30);\r\n\t\ttQuantidadeProdutosIndisponiveis.setEditable(false);\r\n\t\tp1.add(tQuantidadeProdutosIndisponiveis);\r\n\t\t\r\n\t\tbAtualizar = new JButton(\"Atualizar\");\r\n\t\tbAtualizar.addActionListener(this);\r\n\t\tbAtualizar.setBounds(515,30,100,30);\r\n\t\tp1.add(bAtualizar);\r\n\t\t\r\n\t\t\r\n\t\t// menu\r\n\t\t\r\n\t\tbarraMenu = new JMenuBar();\r\n\t\t\r\n\t\t\r\n\t\t//Instanciando JMenu e declarando Mnemonics\r\n\t\tcadastros = new JMenu(\"Cadastros\");\r\n\t\tcadastros.setMnemonic(KeyEvent.VK_C);\r\n\t\t\t\t\r\n\t\tvendas = new JMenu(\"Vendas\");\r\n\t\tvendas.setMnemonic(KeyEvent.VK_V);\r\n\t\t\r\n\t\tfinanceiro = new JMenu(\"Financeiro\");\r\n\t\tfinanceiro.setMnemonic(KeyEvent.VK_F);\r\n\t\t\r\n\t\trelatorios = new JMenu(\"Relatórios\");\r\n\t\trelatorios.setMnemonic(KeyEvent.VK_R);\r\n\t\t\r\n\t\tusuarios = new JMenu(\"Usuários\");\r\n\t\tusuarios.setMnemonic(KeyEvent.VK_U);\r\n\t\t\r\n\t\tmSair = new JMenu(\"Sair\");\r\n\t\tmSair.setMnemonic(KeyEvent.VK_S);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Inserindo icones\r\n\t\t//Instanciando menuItens e declarando os ActionListener para esta classe\r\n\t\t//Declarando accelerator e mnemonic\r\n\t\tprodutos = new JMenuItem(\"Produtos\", new ImageIcon(\"Imagens/cad_pro.png\"));\r\n\t\tprodutos.addActionListener(this);\r\n\t\tprodutos.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.ALT_MASK));\r\n\t\tprodutos.setMnemonic(KeyEvent.VK_P);\r\n\t\t\r\n\t\tclientes = new JMenuItem(\"Clientes\", new ImageIcon(\"Imagens/cad_cli.png\"));\r\n\t\tclientes.addActionListener(this);\r\n\t\tclientes.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.ALT_MASK));\r\n\t\tclientes.setMnemonic(KeyEvent.VK_L);\r\n\t\t\r\n\t\tfornecedores = new JMenuItem(\"Fornecedores\", new ImageIcon(\"Imagens/cad_for.png\"));\r\n\t\tfornecedores.addActionListener(this);\r\n\t\tfornecedores.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, ActionEvent.CTRL_MASK));\r\n\t\tfornecedores.setMnemonic(KeyEvent.VK_F);\r\n\t\t\r\n\t\tfuncionarios = new JMenuItem(\"Funcionários\", new ImageIcon(\"Imagens/cad_fun.png\"));\r\n\t\tfuncionarios.addActionListener(this);\r\n\t\tfuncionarios.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_U, ActionEvent.CTRL_MASK));\r\n\t\tfuncionarios.setMnemonic(KeyEvent.VK_U);\r\n\t\t\r\n\t\t\t\t\r\n\t\tvender = new JMenuItem(\"Vender\", new ImageIcon(\"Imagens/vender.png\"));\r\n\t\tvender.addActionListener(this);\r\n\t\tvender.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0));\r\n\t\t\r\n\t\tcaixaDoDia = new JMenuItem(\"Caixa do Dia\", new ImageIcon(\"Imagens/cx_dia.png\"));\r\n\t\tcaixaDoDia.addActionListener(this);\r\n\t\tcaixaDoDia.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.ALT_MASK));\r\n\t\tcaixaDoDia.setMnemonic(KeyEvent.VK_A);\r\n\t\t\r\n\t\thistoricoVendas = new JMenuItem(\"Histórico de Vendas\", new ImageIcon(\"Imagens/historico.png\"));\r\n\t\thistoricoVendas.addActionListener(this);\r\n\t\thistoricoVendas.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, ActionEvent.ALT_MASK));\r\n\t\thistoricoVendas.setMnemonic(KeyEvent.VK_H);\r\n\t\t\r\n\t\tanaliticoVendas = new JMenuItem(\"Analítico de Vendas\", new ImageIcon(\"Imagens/analitico.png\"));\r\n\t\tanaliticoVendas.addActionListener(this);\r\n\t\tanaliticoVendas.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.ALT_MASK));\r\n\t\tanaliticoVendas.setMnemonic(KeyEvent.VK_N);\r\n\t\t\r\n\t\tcadastroUsuario = new JMenuItem(\"Cadastro de Usuário\", new ImageIcon(\"Imagens/cad_usu.png\"));\r\n\t\tcadastroUsuario.addActionListener(this);\r\n\t\tcadastroUsuario.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, ActionEvent.ALT_MASK));\r\n\t\tcadastroUsuario.setMnemonic(KeyEvent.VK_D);\r\n\t\t\r\n\t\ttrocarUsuario = new JMenuItem(\"Trocar Usuário\", new ImageIcon(\"Imagens/troca_usu.png\"));\r\n\t\ttrocarUsuario.addActionListener(this);\r\n\t\ttrocarUsuario.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, ActionEvent.ALT_MASK));\r\n\t\ttrocarUsuario.setMnemonic(KeyEvent.VK_T);\r\n\t\t\r\n\t\ttrocarSenha = new JMenuItem(\"Trocar Senha\", new ImageIcon(\"Imagens/troca_usu.png\"));\r\n\t\ttrocarSenha.addActionListener(this);\r\n\t\ttrocarSenha.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.ALT_MASK));\r\n\t\ttrocarSenha.setMnemonic(KeyEvent.VK_O);\r\n\t\t\r\n\t\tiSair = new JMenuItem(\"Sair\", new ImageIcon(\"Imagens/sair.png\"));\r\n\t\tiSair.addActionListener(this);\r\n\t\tiSair.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0));\r\n\t\tiSair.setMnemonic(KeyEvent.VK_ESCAPE);\r\n\t\t\r\n\t\t\r\n\t\t//Adicionando JMenuItem aos JMenu\r\n\t\tcadastros.add(produtos);\r\n\t\tcadastros.add(clientes);\r\n\t\tcadastros.add(fornecedores);\r\n\t\tcadastros.add(funcionarios);\r\n\t\t\r\n\t\t\r\n\t\tvendas.add(vender);\r\n\t\t\r\n\t\tfinanceiro.add(caixaDoDia);\r\n\r\n\t\t\r\n\t\r\n\t\trelatorios.add(historicoVendas);\r\n\t\trelatorios.add(analiticoVendas);\r\n\t\t\r\n\t\tusuarios.add(cadastroUsuario);\r\n\t\tusuarios.add(trocarUsuario);\r\n\t\tusuarios.add(trocarSenha);\r\n\t\t\r\n\t\tmSair.add(iSair);\r\n\t\t\r\n\t\t//Adicionando JMenu ao JMenuBar\r\n\t\tbarraMenu.add(cadastros);\r\n\t\tbarraMenu.add(vendas);\r\n\t\tbarraMenu.add(financeiro);\r\n\t\tbarraMenu.add(relatorios);\r\n\t\tbarraMenu.add(usuarios);\r\n\t\tbarraMenu.add(mSair);\r\n\t\t\r\n\t\t//Setando JMenuBAr\r\n\t\tsetJMenuBar(barraMenu);\r\n\t\t\r\n\t\tcarregaResultSet();\r\n\t\tsetandoAcessos();\r\n\t\t\r\n\t\tcarregarTextField();\r\n\t\t\r\n\t\t\r\n\t}", "protected void RedirecionaTela(String opcaoMenu){\n\n Intent intentRedirecionar;\n\n if(opcaoMenu.equals(\"ADICIONAR\")){\n\n intentRedirecionar = new Intent(this, CadatroConta.class);\n startActivity(intentRedirecionar);\n finish();\n }else if (opcaoMenu.equals(\"CONSULTAR\")){\n intentRedirecionar = new Intent(this, Consultar.class);\n startActivity(intentRedirecionar);\n finish();\n\n } else\n Toast.makeText(getApplicationContext(), \"Opção inválida!\", Toast.LENGTH_SHORT).show();\n\n }", "private void menuCliente(String username){\n a_armazena.juntaCatalogos();\n a_armazena.JuntaProdutos();\n ArrayList<String> encs=b_dados.buscapraClassificar(username);\n if(!encs.isEmpty())\n menuClassifica(encs,username);\n Scanner s = new Scanner(System.in);\n int opcao = 0;\n String op=\"\";\n\n try{\n do{\n System.out.println(\"Escolha o que pretende fazer\");\n System.out.println(\"1 - Ver Lojas\");\n System.out.println(\"2 - Consultar Dados Pessoais\");\n System.out.println(\"3 - Historico de Encomendas\");\n System.out.println(\"4 - Ver estado de encomenda\");\n\n\n System.out.println(\"0 - Retroceder\");\n\n opcao = s.nextInt();\n System.out.print(\"\\n\");\n\n switch(opcao){\n case 0:\n break;\n case 1:\n verLojas(b_dados.getUtilizadores().get(username).getCodUtilizador());\n break;\n case 2:\n consultadadosUtilizador(username);\n break;\n case 3:\n b_dados.buscaHistoricoDisplay(b_dados.buscaHistoricoUtilizador(b_dados.getUtilizadores().get(username).getCodUtilizador()));\n break;\n case 4:\n System.out.println(\"As encomendas que ainda não foram entregues são\");\n b_dados.displayencsnaoentregues(username);\n EstadoEncomenda();\n break;\n default:\n System.out.print(\"Opção inválida\\n\\n\");\n break;\n\n }\n }while(opcao != 0);\n }\n catch (UtilizadorNaoExisteException e){\n System.out.println(e.getMessage());\n menuCliente(username);\n }\n catch(InputMismatchException e){\n System.out.println(\"Entrada inválida\");\n menuCliente(username);\n\n }\n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent e)\r\n\t{\r\n\t\t\r\n\t\t if (e.getActionCommand().equals(\"Retour\")) {\r\n\t\t\t this.choixMenu = 1;\r\n\t\t }\r\n\r\n\t\t else if (e.getActionCommand().equals(\"Deplacement\")) {\r\n\t\t\t this.choixMenu = 4;\r\n\t\t }\r\n\t\t \r\n\t\t else if (e.getActionCommand().equals(\"Fin du tour\")) {\r\n\t\t\t this.finDuTour = true; \r\n\t\t }\r\n\t\t \r\n\t\t else if (e.getActionCommand().equals(\"Attaque\")) {\r\n\t\t\t this.choixMenu = 2;\r\n\t\t }\r\n\t\t \r\n\t\t else if (e.getActionCommand().equals(\"Quitter\")) {\r\n\t\t\t System.exit(0);\r\n\t\t }\r\n\t\t \r\n\t\t else if (e.getActionCommand().equals(\"Haut\")) {\r\n\t\t this.choixMouvement = 1;\r\n\t\t }\r\n\t\t \r\n\t\t else if (e.getActionCommand().equals(\"Gauche\")) {\r\n\t\t\t this.choixMouvement = 2;\r\n\t\t }\r\n\t\t \r\n\t\t else if (e.getActionCommand().equals(\"Bas\")) {\r\n\t\t\t this.choixMouvement = 3;\r\n\t\t }\r\n\t\t \r\n\t\t else if (e.getActionCommand().equals(\"Droite\")) {\r\n\t\t\t this.choixMouvement = 4;\r\n\t\t }\r\n\t\t \r\n\t\t else\r\n\t\t {\r\n\t\t\t int numComp;\r\n\t\t\t int numMonstre;\r\n\t\t\t for(numComp = 0;numComp<this.competences.length;numComp++)\r\n\t\t\t {\r\n\t\t\t\t if(e.getActionCommand().equals(this.competences[numComp].getNom()))\r\n\t\t\t\t {\r\n\t\t\t\t\t this.choixCompetence = numComp;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t \r\n\t\t\t for(numMonstre = 0;numMonstre<this.monstres.length;numMonstre++)\r\n\t\t\t {\r\n\t\t\t\t if(e.getActionCommand().equals(this.monstres[numMonstre].getNom()))\r\n\t\t\t\t {\r\n\t\t\t\t\t this.choixMonstre = numMonstre;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t for(numMonstre = 0;numMonstre<this.monstres.length;numMonstre++)\r\n\t\t\t {\r\n\t\t\t\t if(e.getActionCommand().equals(\"Info \" + this.monstres[numMonstre].getNom()))\r\n\t\t\t\t {\r\n\t\t\t\t\t this.choixMonstreAAfficher = numMonstre;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t }\r\n\t\t \r\n\t\t \r\n\t}", "public synchronized void clkSubmenu(String subMenu) {\n\t\ttry {\n\t\t\tWebActionUtil.waitForElement(clkSubMenu(subMenu), \"Submenu\", 30);\n\t\t\tWebActionUtil.clickOnWebElement(clkSubMenu(subMenu), \"submenu\", \"Unable to click sub menu\");\n\t\t}\n\t\t catch (Exception e) \n\t\t{\n\t\t\t WebActionUtil.error(e.getMessage());\n\t\t\tWebActionUtil.error(\"Unable to click sub Menu\");\n\t\t\tAssert.fail(\"Unable to click sub Menu\");\n\t\t}\n\t}", "public static void mostrarMenu() throws SQLException, IOException {\r\n Scanner entrada = new Scanner(System.in);\r\n System.out.println(\"1 consultas\\n\"+\r\n \"2 actualizacion\\n\"\r\n + \"3 transacciones\");\r\n int menu = entrada.nextInt();\r\n switch (menu) {\r\n case 1: {\r\n mostrarMenuQuery();\r\n }case 2:{\r\n try{\r\n System.out.println(\"campo a modificar\");\r\n Scanner entrada2 = new Scanner(System.in);\r\n String campo = entrada2.nextLine();\r\n System.out.println(\"valor a modificar\");\r\n String valor = entrada2.nextLine();\r\n System.out.println(\"nuevo valor\");\r\n String valorFinal = entrada2.nextLine();\r\n Querys.updateQuery(campo, valorFinal, valor);\r\n }catch(SQLException ex){\r\n System.out.println(ex.getErrorCode());\r\n System.out.println(ex.getSQLState());\r\n }\r\n mostrarMenu();\r\n break;\r\n }case 3:{\r\n transacciones();\r\n mostrarMenu();\r\n break;\r\n }\r\n }\r\n }", "public MenuPrincipal() {\n\t\tinitComponents();\n\t\tbtnSplines.setVisible(false);\n\t\tbtnEcuacionesNolineales.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tGestorInterfazPrincipal.iniciarUnidad1();\n\t\t\t}\n\t\t});\n\t\tbtnSistemasdeEcuaciones.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tGestorInterfazPrincipal.iniciarSistemasEcuaciones();\n\t\t\t}\n\t\t});\n\t\tbtnGraficador.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tGestorInterfazPrincipal.iniciarGraficador();\n\t\t\t}\n\t\t});\n\t\tbtnInterpolacion.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tGestorInterfazPrincipal.iniciarInterpolacion();\n\t\t\t}\n\t\t});\n\t\tbtnDiferenciacion.addActionListener(new ActionListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tGestorInterfazPrincipal.iniciarDiferenciacion();\n\t\t\t}\n\t\t});\n\t\tbtnIntegracion.addActionListener(new ActionListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tGestorInterfazPrincipal.iniciarIntegracion();\n\t\t\t}\n\t\t});\n\n\t}", "public static int menubestias() {\r\n int op = Integer.parseInt(JOptionPane.showInputDialog(null, \"----Menu Bestias----\\n\"\r\n + \"1. Aguilas\\n\"\r\n + \"2. Arañas\\n\"\r\n + \"3. Balrogs\\n\"\r\n + \"4. Bestias aladas\\n\"\r\n + \"5. Dragones\", \"Menu de bestias pollonas\", JOptionPane.DEFAULT_OPTION));\r\n\r\n return op;\r\n }", "private void initialize() {\n frame = new JFrame();\n frame.setBounds(500, 500, 450, 300);\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n JMenuBar menuBar = new JMenuBar();\n frame.setJMenuBar(menuBar);\n\n\n JMenu mnArchivo = new JMenu(\"Registrar Cliente\");\n menuBar.add(mnArchivo);\n\n\n JMenuItem mntmNewMenuItem_1 = new JMenuItem(\"CLIENTE CENTRO COMERCIAL\");\n mntmNewMenuItem_1.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n Principal.RegistrarCliente objPA = new Principal.RegistrarCliente();\n objPA.Clientes();\n }\n });\n mnArchivo.add( mntmNewMenuItem_1);\n\n\n JMenu mnReportes = new JMenu(\"Tiendas\");\n menuBar.add(mnReportes);\n\n JMenu mnTienda1 = new JMenu(\"ETAFASHION\");\n mnReportes.add(mnTienda1);\n\n JMenuItem mntmNewMenuItem_2 = new JMenuItem(\"Deportiva\");\n mntmNewMenuItem_2.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n Comprar objVA = new Comprar(0);\n objVA.Producto(0);\n }\n });\n mnTienda1.add(mntmNewMenuItem_2);\n\n JMenuItem mntmNewMenuItem_3 = new JMenuItem(\"Casual\");\n mntmNewMenuItem_3.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n Comprar objVA = new Comprar(1);\n objVA.Producto(1);\n }\n });\n mnTienda1.add(mntmNewMenuItem_3);\n\n JMenu mnTienda2 = new JMenu(\"LA GANGA\");\n mnReportes.add(mnTienda2);\n\n JMenuItem mntmNewMenuItem_4 = new JMenuItem(\"Electrodomesticos\");\n mntmNewMenuItem_4.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n Comprar objVA = new Comprar(2);\n objVA.Producto(2);\n }\n });\n mnTienda2.add(mntmNewMenuItem_4);\n\n JMenuItem mntmNewMenuItem_5 = new JMenuItem(\"Tecnologia\");\n mntmNewMenuItem_5.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n Comprar objVA = new Comprar(3);\n objVA.Producto(3);\n }\n });\n mnTienda2.add(mntmNewMenuItem_5);\n\n JMenuItem mnCarrito = new JMenuItem(\"Carrito\");\n mnCarrito.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n Principal.Pedido objC = new Principal.Pedido();\n objC.Carrito();\n }\n });\n mnReportes.add(mnCarrito);\n\n JMenu mnArchMNSesion = new JMenu(\"Iniciar Secion\");\n menuBar.add(mnArchMNSesion);\n\n JMenuItem mntmAdministrador= new JMenuItem(\"Administrador\");\n mntmAdministrador.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n Usuario usr = new Usuario();\n usr.setVisible(true);\n }\n });\n mnArchMNSesion.add(mntmAdministrador);\n\n JMenuItem mntmCliente= new JMenuItem(\"Usuario\");\n mntmCliente.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n //Principal.Manual objST = new Principal.Manual();\n //objST.Manual();\n }\n });\n mnArchMNSesion.add(mntmCliente);\n\n JMenu mnManual = new JMenu(\"Manual\");\n menuBar.add(mnManual);\n\n JMenuItem mntmNewMenuItem_N = new JMenuItem(\"Servicio Técnico\");\n mntmNewMenuItem_N.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n Principal.Manual objST = new Principal.Manual();\n objST.Manual();\n }\n });\n mnManual.add(mntmNewMenuItem_N);\n\n JLayeredPane layeredPane = new JLayeredPane();\n layeredPane.setBounds(23, 11, 374, 204);\n frame.getContentPane().add(layeredPane);\n\n\n }", "public void BuscarGrupo() {\r\n try {\r\n // Inicializamos la tabla para refrescar todos los datos contenidos.\r\n InicializarTabla(_escuchador.session);\r\n Transaction tx = _escuchador.session.beginTransaction();\r\n List<Cursos> tabla=rsmodel.lista;\r\n List<Cursos> borrados = new <Cursos>ArrayList();\r\n if(menuCursos.campoCursosBuscarCategorias.getSelectedItem().toString().equals(\"Todos los campos\")){\r\n for(Cursos obj : tabla) {\r\n if(!obj.getCodigo().toString().contains(menuCursos.campoCursosBuscar.getText().toLowerCase()) && !obj.getNombre().toLowerCase().contains(menuCursos.campoCursosBuscar.getText().toLowerCase())){\r\n borrados.add(obj);\r\n }\r\n }\r\n }\r\n else if(menuCursos.campoCursosBuscarCategorias.getSelectedItem().toString().equals(\"Código del curso\")){\r\n for(Cursos obj : tabla) {\r\n if(!obj.getCodigo().toString().contains(menuCursos.campoCursosBuscar.getText().toLowerCase())){\r\n borrados.add(obj);\r\n }\r\n }\r\n }\r\n else if(menuCursos.campoCursosBuscarCategorias.getSelectedItem().toString().equals(\"Nombre del curso\")){\r\n for(Cursos obj : tabla) {\r\n if(!obj.getNombre().toLowerCase().contains(menuCursos.campoCursosBuscar.getText().toLowerCase())){\r\n borrados.add(obj);\r\n }\r\n }\r\n }\r\n tabla.removeAll(borrados);\r\n tx.commit();\r\n if(tabla.isEmpty()){tabla.add(new Cursos(null));}\r\n rs=tabla;\r\n ControladorTabla registrosBuscados = new ControladorTabla(tabla);\r\n menuCursos.getTablaCursos().setModel(registrosBuscados);\r\n } catch (Exception e) {\r\n JOptionPane.showMessageDialog(null, e, \"Excepción\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }", "public static void eventoArticuloClienteDistribuidor(boolean preguntar) {\n if (preguntar) {\n if (Logica.Cuadros_Emergentes.confirmacionDefinida(\"\"\n + \"-Se borraran todos los datos escritos del nuevo distribuidor.\\n\\n\") == 0) {\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldCodigo.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldNombre.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldContacto.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldDireccion.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_botonHistorialDeDistribuidor.setVisible(false);\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldCodigo.setEditable(true);\n Diseño.Facturacion.paneles_base.panelBase_inventarioClientesDistribuidores.reestablecerComponentes();\n }\n } else {\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldCodigo.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldNombre.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldContacto.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldDireccion.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_botonHistorialDeDistribuidor.setVisible(false);\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldCodigo.setEditable(true);\n Diseño.Facturacion.paneles_base.panelBase_inventarioClientesDistribuidores.reestablecerComponentes();\n }\n }", "private static void gestionarMenuManejoJugador(int opcion) {\n\t\tswitch(opcion){\n\t\tcase 1:annadirJugador();\n\t\t\tbreak;\n\t\tcase 2:eliminarJugador();\n\t\t\tbreak;\n\t\tcase 3: System.out.println(jugadores.toString());\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}", "@Override\n\tprotected void setMenu() {\n\t\t\n\t\tfinal ButtonGroup actionButtonGroup = new ButtonGroup();\n\t\tfor (String s : ((TreeSite) object).actions) {\n\t\t\tJRadioButton button = new JRadioButton(s);\n\t\t\tbutton.setActionCommand(s);\n\t\t\tactionButtonGroup.add(button);\n\t\t\tmenu.add(button);\n\t\t}\n\t\t\n\t\tJPanel headingPanel = new JPanel();\n\t\theadingPanel.setLayout(new BoxLayout(headingPanel, BoxLayout.LINE_AXIS));\n\t\theadingPanel.add(new JLabel(\"Heading: \"));\n\t\tfinal JTextField headingField = new JTextField();\n\t\theadingField.setText(Float.toString(INITIAL_FLOAT_VALUE));\n\t\theadingField.setColumns(10);\n\t\theadingPanel.add(headingField);\n\t\tmenu.add(headingPanel);\n\t\t\n\t\tJPanel lengthPanel = new JPanel();\n\t\tlengthPanel.setLayout(new BoxLayout(lengthPanel, BoxLayout.LINE_AXIS));\n\t\tlengthPanel.add(new JLabel(\"Length: \"));\n\t\tfinal JTextField lengthField = new JTextField();\n\t\tlengthField.setText(Integer.toString(INITIAL_INTEGER_VALUE));\n\t\tlengthField.setColumns(10);\n\t\tlengthPanel.add(lengthField);\n\t\tmenu.add(lengthPanel);\n\t\t\n\t\tJPanel counterPanel = new JPanel();\n\t\tcounterPanel.setLayout(new BoxLayout(counterPanel, BoxLayout.LINE_AXIS));\n\t\tcounterPanel.add(new JLabel(\"Counter: \"));\n\t\tfinal JTextField counterField = new JTextField();\n\t\tcounterField.setText(Integer.toString(INITIAL_INTEGER_VALUE));\n\t\tcounterField.setColumns(10);\n\t\tcounterPanel.add(counterField);\n\t\tmenu.add(counterPanel);\n\t\t\n\t\tJPanel targetPanel = new JPanel();\n\t\ttargetPanel.setLayout(new BoxLayout(targetPanel, BoxLayout.LINE_AXIS));\n\t\ttargetPanel.add(new JLabel(\"Target position: \"));\n\t\ttargetFieldX = new JTextField();\n\t\ttargetFieldX.setEditable(false);\n\t\ttargetFieldX.setText(\"\");\n\t\ttargetFieldX.setColumns(4);\n\t\ttargetFieldY = new JTextField();\n\t\ttargetFieldY.setEditable(false);\n\t\ttargetFieldY.setText(\"\");\n\t\ttargetFieldY.setColumns(4);\n\t\ttargetPanel.add(targetFieldX);\n\t\ttargetPanel.add(new JLabel(\", \"));\n\t\ttargetPanel.add(targetFieldY);\n\t\tmenu.add(targetPanel);\n\t\tmenu.add(new SetTargetPositionButton(editor).button);\n\t\t\n\t\tJButton removeTargetButton = new JButton(\"Remove Target\");\n\t\tremoveTargetButton.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\ttargetFieldX.setText(\"\");\n\t\t\t\ttargetFieldY.setText(\"\");\n\t\t\t\teditor.targetIcon.setVisible(false);\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tmenu.add(removeTargetButton);\n\t\t\n\t\tfinal CyclicButtonGroup cyclicButtons = new CyclicButtonGroup();\n\t\t\n\t\tJRadioButton nonCyclicButton = new JRadioButton(\"Set to non-cyclic\");\n\t\tnonCyclicButton.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\ttry {\n\t\t\t\t\tcyclicButtons.beginningOfCycle.data.cycleStart = false;\n\t\t\t\t\tcyclicButtons.beginningOfCycle = null;\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tcyclicButtons.add(nonCyclicButton);\n\t\t\n\t\tfinal JButton addActionButton = new JButton(\"Add Action\");\n\t\t\n\t\tmenu.add(addActionButton);\n\t\tmenu.add(nonCyclicButton);\n\t\t\n\t\taddActionButton.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif (actionButtonGroup.getSelection() == null) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please select an action type\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tFloat headingValue = null;\n\t\t\t\tInteger lengthValue = null;\n\t\t\t\tInteger counterValue = null;\n\t\t\t\tInteger targetValueX = null;\n\t\t\t\tInteger targetValueY = null;\n\t\t\t\tboolean noTarget = false;\n\t\t\t\ttry {\n\t\t\t\t\ttargetValueX = Integer.parseInt(targetFieldX.getText());\n\t\t\t\t\ttargetValueY = Integer.parseInt(targetFieldY.getText());\n\t\t\t\t} catch (NumberFormatException nfe) {\n\t\t\t\t\tnoTarget = true;\n\t\t\t\t}\n\t\t\t\tif (headingField.getText() == null || !isValidHeading(headingField.getText())) {\n\t\t\t\t\tif (noTarget) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please enter a heading value greater than or equal to 0 and less than 360\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\theadingValue = Float.parseFloat(headingField.getText());\n\t\t\t\t}\n\t\t\t\tif (lengthField.getText() == null || !isValidLength(lengthField.getText())) {\n\t\t\t\t\tif (noTarget) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please enter an integer length value greater than 0\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlengthValue = Integer.parseInt(lengthField.getText());\n\t\t\t\t}\n\t\t\t\tif (counterField.getText() == null || !isValidCounter(counterField.getText(), Integer.parseInt(lengthField.getText()))) {\n\t\t\t\t\tif (noTarget) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please enter an integer counter value greater than 0 and less than the length value\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcounterValue = Integer.parseInt(counterField.getText());\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tActionMetadata data = new ActionMetadata(actionButtonGroup.getSelection().getActionCommand(),\n\t\t\t\t\t\theadingValue, lengthValue, counterValue, false, targetValueX, targetValueY);\n\t\t\t\t((TreeSite) object).actionQueue.add(data);\n\t\t\t\tcreateActionPanel(cyclicButtons, data);\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tfor (ActionMetadata metadata : ((TreeSite) object).actionQueue) {\n\t\t\tcreateActionPanel(cyclicButtons, metadata);\n\t\t}\n\t\t\n\t}", "public void visKontingenthaandteringMenu ()\r\n {\r\n System.out.println(\"Du har valgt kontingent.\");\r\n System.out.println(\"Hvad oensker du at foretage dig?\");\r\n System.out.println(\"1: Se priser\");\r\n System.out.println(\"2: Se medlemmer i restance\");\r\n System.out.println(\"0: Afslut\");\r\n\r\n }", "public void configurarTermino() {\n System.out.println(\"......................\");\n System.out.println(\"Seleccionar Termino Academico para el juego\");\n int i = 1;\n if (Termino.terminos.size() != 0) {\n for (Termino t : Termino.terminos) {\n System.out.println(i + \". \" + t);\n i++;\n }\n Entrada entrada = new Entrada();\n int opc;\n do {\n opc = entrada.Entera(\"Ingrese opcion(1-\" + (i - 1) + \"): \");\n if (!(opc >= 1 && opc <= (i - 1))) {\n System.out.println(\"opcion no valida\");\n }\n } while (!(opc >= 1 && opc <= (i - 1)));\n this.t = Termino.terminos.get(opc - 1);\n Juego juego = new Juego(t);\n PrcTermino.juego = juego;\n } else {\n System.out.println(\"No hay terminos academicos registrados\");\n }\n }" ]
[ "0.6994073", "0.68654484", "0.6865306", "0.68469673", "0.6805996", "0.6783696", "0.6703497", "0.666717", "0.66038793", "0.65434957", "0.65374213", "0.6525826", "0.652432", "0.6523913", "0.6521095", "0.64252424", "0.64251196", "0.64223784", "0.63940966", "0.63906294", "0.636293", "0.63581234", "0.6350155", "0.6342342", "0.631269", "0.6310691", "0.63094926", "0.62531936", "0.6247885", "0.6239968", "0.62350136", "0.6232213", "0.6231972", "0.62003416", "0.6192917", "0.61892486", "0.61865956", "0.61765337", "0.61610526", "0.61606586", "0.6144776", "0.61418235", "0.61008227", "0.6095449", "0.60739845", "0.6062475", "0.60597396", "0.60552335", "0.60509163", "0.60454226", "0.6043846", "0.6043806", "0.6033028", "0.602531", "0.60005265", "0.5993053", "0.598458", "0.5980721", "0.5980304", "0.59525", "0.5921022", "0.59191096", "0.59183085", "0.5915894", "0.59121656", "0.5910749", "0.5905318", "0.59035254", "0.59007895", "0.58865315", "0.58841324", "0.5879623", "0.5855832", "0.5844121", "0.58250695", "0.58230823", "0.5813705", "0.58134675", "0.581024", "0.58011997", "0.5787088", "0.57801265", "0.5764821", "0.5760877", "0.5750599", "0.5743459", "0.57385284", "0.5738457", "0.57341707", "0.5731536", "0.5724899", "0.5720599", "0.5706031", "0.5701021", "0.5693654", "0.569257", "0.5687506", "0.5686151", "0.56833506", "0.56833166", "0.56775045" ]
0.0
-1
Sort a stack only with the function of the stack push pop peek isEmpty.
public Stack<Integer> sortInAscendingOrder(Stack<Integer> s) { Stack<Integer> r = new Stack<>(); while (s.size() != 0) { int temp = s.pop(); while (!r.isEmpty() && temp > r.peek()) s.push(r.pop()); r.push(temp); } return r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sortStack(){\n Stack small = new Stack();\n Stack large = new Stack();\n while(isEmpty()==false){\n Node n = pop();\n if(small.isEmpty() == true){\n small.push(n);\n }\n else if(n.data > small.peek()){\n small.push(n); \n }\n else{\n while(small.isEmpty() == false){\n if(small.peek() > n.data){\n large.push(small.pop());\n }else{\n break;\n }\n }\n small.push(n);\n shift(large,small);\n }\n }\n shift(small,large);\n shift(large,this);\n }", "public static void sortStack2(Stack s){\n Stack ordered = new Stack();\n while(s.isEmpty() == false){\n Node top = s.pop();\n while(ordered.isEmpty() == false && ordered.peek() >= top.data){\n s.push(ordered.pop());\n }\n ordered.push(top);\n }\n while(ordered.isEmpty()==false){\n s.push(ordered.pop());\n }\n }", "static void sortStack(Stack<Integer> s)\n\t{\n\t\t// If stack is not empty\n\t\tif (!s.isEmpty()) \n\t\t{\n\t\t\t// Remove the top item\n\t\t\tint x = s.pop();\n\n\t\t\t// Sort remaining stack\n\t\t\tsortStack(s);\n\n\t\t\t// Push the top item back in sorted stack\n\t\t\tsortedInsert(s, x);\n\t\t}\n\t}", "public static void sortStack(Stack<Integer> toSort) {\n Stack<Integer> tempStack = new Stack<>();\n sortStack(toSort, tempStack);\n }", "public static void sort(Stack<Integer> s) {\n Stack<Integer> temp = new Stack<Integer>();\n\n while(!s.isEmpty()) {\n int n = s.pop();\n\n while(!temp.isEmpty() && n > temp.peek())\n s.push(temp.pop());\n\n temp.push(n);\n }\n\n while(!temp.isEmpty())\n s.push(temp.pop());\n }", "public static Stack<Integer> sortstack(Stack<Integer> input) {\n\n Stack<Integer> tmpStack = new Stack<Integer>(); \n \n while(!input.isEmpty()) {\n // pop out the first element \n int tmp = input.pop(); \n // while temporary stack is not empty and top of stack is greater than temp \n while(!tmpStack.isEmpty() && tmpStack.peek() > tmp) { \n // pop from temporary stack and push it to the input stack \n input.push(tmpStack.pop()); \n } \n // push temp in tempory of stack \n tmpStack.push(tmp); \n } \n return tmpStack; \n }", "public static void sortStack(Stack<Integer> toSort, Stack<Integer> tempStack) {\n tempStack.push(toSort.pop());\n while (!toSort.isEmpty()) {\n if(toSort.peek() >= tempStack.peek()) {\n tempStack.push(toSort.pop());\n }\n else {\n int left = toSort.pop();\n int right = tempStack.pop();\n toSort.push(right);\n toSort.push(left);\n }\n }\n while (!tempStack.isEmpty()) {\n toSort.push(tempStack.pop());\n }\n }", "public void stackUsage() {\n\t\tStack<String> s = new Stack<String>();\n\t\ts.add(\"1\");\n\t\ts.add(\"2\");\n\t\ts.add(\"3\");\n\t\ts.add(\"10\");\n\t\ts.add(\"11\");\n\t\tSystem.out.println(s.peek());\n\t\t\n\t\tCollections.sort(s, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\tint a = Integer.valueOf(o1);\n\t\t\t\tint b = Integer.valueOf(o2);\n\t\t\t\tif (a > b) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\t\tSystem.out.println(s.peek());\n\t}", "public static void main(String[] args) {\n Stack<Integer> s = new Stack<>();\n s.push(11);\n s.push(2);\n\n s.push(32);\n s.push(3);\n s.push(41);\n System.out.println(s);\n s = sort(s);\n System.out.println(s);\n\n }", "public static void main(String[] args)\n {\n Stack<Integer> s = new Stack<>();\n \n Random generate = new Random();\n \n for (int i = 0; i < 20; i++) // add values to s\n {\n s.push(generate.nextInt(50));\n }\n\n System.out.println(StackSort.sort(s)); \n }", "public ArrayStack<Integer> sort(ArrayStack<Integer> inputStack) {\r\n\t\tArrayStack<Integer> resStack = new ArrayStack<>();\r\n\t\twhile (!inputStack.isEmpty()) {\r\n\t\t\tint elem = inputStack.pop();\r\n\t\t\twhile (!resStack.isEmpty() && (Integer) resStack.top() > elem) {// for smallest item on top change to <\r\n\t\t\t\tinputStack.push((Integer) resStack.pop());\r\n\t\t\t}\r\n\t\t\tresStack.push(elem);\r\n\t\t}\r\n\t\treturn resStack;\r\n\t}", "private static boolean isSorted() {\n for (int i=0; i<stack.size()-1; i++)\n if (stack.get(i)<stack.get(i+1)) return false;\n\n return true;\n }", "public static Stack<Integer> sort(Stack<Integer> s)\n {\n if (s.isEmpty()) // check if the stack is empty\n {\n return s;\n }\n else // otherwise...\n {\n int slinky = s.pop();\n\n // divide the s stack into 2 parts\n Stack<Integer> low = new Stack<>();\n Stack<Integer> high = new Stack<>();\n\n while (!s.isEmpty())\n {\n int i = s.pop();\n if (i < slinky)\n {\n low.push(i);\n }\n else\n {\n high.push(i);\n }\n } \n // sort both stacks\n sort(low);\n sort(high);\n\n // combine low and high values\n Stack<Integer> t = new Stack<>();\n while (!high.isEmpty()) // push high values first\n {\n t.push(high.pop());\n }\n t.push(slinky); //.. then the middle values\n while (!low.isEmpty()) //...following the small values\n {\n t.push(low.pop());\n }\n while (!t.isEmpty()) // push values into s\n {\n s.push(t.pop());\n } \n }\n return s; // s is now sorted\n }", "public static void main(String[] args)\n {\n Stack<Integer> s=new Stack<Integer>();\n s.push(28);\n s.push(2);\n s.push(16);\n s.push(3);\n s.push(72);\n s.push(19);\n s.push(6);\n System.out.print(\"Before sorting: \");\n for(int e : s)\n System.out.print(e+\" \");\n System.out.println();\n sort(s);\n //the iteration starts from stack bottom\n System.out.print(\"After sorting: \");\n for(int e : s)\n System.out.print(e+\" \");\n System.out.println();\n }", "public static void sort(final Stack<Integer> s) {\n final Stack<Integer> r = new Stack<>();\n\n // Sort in descending order\n while (!s.isEmpty()) {\n final int tmp = s.pop();\n while (!r.isEmpty() && r.peek() < tmp) {\n s.push(r.pop());\n }\n r.push(tmp);\n }\n\n // Rebuild the stack in ascending order\n while (!r.isEmpty()) {\n s.push(r.pop());\n }\n }", "public void sort() {\n Stack<Pair> stack = new Stack();\n //fill the stack\n Pair temp = new Pair(0, a.length);\n stack.push(temp);\n quickSort(stack,stack.peek().first, stack.peek().n);\n }", "public static void main(String[] args) {\n\t\tStack<Integer>stack =new Stack<>();\n\t\tstack.push(23);\n\t\tstack.push(12);\n\t\tstack.push(78);\n\t\tstack.push(2);\n\t\tstack.push(14);\n sort(stack);\n while(!stack.isEmpty())\n {\n \tSystem.out.print(stack.pop()+\" \");\n }\n\t}", "static\nboolean\ncheck(\nint\nA[], \nint\nN) { \n\n// Stack S \n\nStack<Integer> S = \nnew\nStack<Integer>(); \n\n\n// Pointer to the end value of array B. \n\nint\nB_end = \n0\n; \n\n\n// Traversing each element of A[] from starting \n\n// Checking if there is a valid operation \n\n// that can be performed. \n\nfor\n(\nint\ni = \n0\n; i < N; i++) { \n\n// If the stack is not empty \n\nif\n(!S.empty()) { \n\n// Top of the Stack. \n\nint\ntop = S.peek(); \n\n\n// If the top of the stack is \n\n// Equal to B_end+1, we will pop it \n\n// And increment B_end by 1. \n\nwhile\n(top == B_end + \n1\n) { \n\n// if current top is equal to \n\n// B_end+1, we will increment \n\n// B_end to B_end+1 \n\nB_end = B_end + \n1\n; \n\n\n// Pop the top element. \n\nS.pop(); \n\n\n// If the stack is empty We cannot \n\n// further perfom this operation. \n\n// Therefore break \n\nif\n(S.empty()) { \n\nbreak\n; \n\n} \n\n\n// Current Top \n\ntop = S.peek(); \n\n} \n\n\n// If stack is empty \n\n// Push the Current element \n\nif\n(S.empty()) { \n\nS.push(A[i]); \n\n} \nelse\n{ \n\ntop = S.peek(); \n\n\n// If the Current element of the array A[] \n\n// if smaller than the top of the stack \n\n// We can push it in the Stack. \n\nif\n(A[i] < top) { \n\nS.push(A[i]); \n\n} \n// Else We cannot sort the array \n\n// Using any valid operations. \n\nelse\n{ \n\n// Not Stack Sortable \n\nreturn\nfalse\n; \n\n} \n\n} \n\n} \nelse\n{ \n\n// If the stack is empty push the current \n\n// element in the stack. \n\nS.push(A[i]); \n\n} \n\n} \n\n\n// Stack Sortable \n\nreturn\ntrue\n; \n\n}", "public void sort()\n {\n\tstrack.sort((Node n1, Node n2) ->\n\t{\n\t if (n1.getCost() < n2.getCost()) return -1;\n\t if (n1.getCost() > n2.getCost()) return 1;\n\t return 0;\n\t});\n }", "void topologicalSort(){ \n Stack<Integer> stack = new Stack<Integer>(); \n \n // Mark all the vertices as not visited \n boolean visited[] = new boolean[V]; \n for (int i = 0; i < V; i++) \n visited[i] = false; \n \n // Call the recursive helper function to store Topological Sort starting from all vertices one by one \n for (int i = 0; i < V; i++) \n if (visited[i] == false) \n topologicalSortUtil(i, visited, stack); \n \n // Print contents of stack \n while (stack.empty()==false) \n System.out.print(stack.pop() + \" \"); \n }", "public MinStack() {\n sort = new Stack<>();\n stack = new Stack<>();\n }", "public static void main(String[] args) {\n\t\t\n\t\tSolution sol = new Solution();\n\t\t\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tstack.push(1);\n\t\tstack.push(5);\n\t\tstack.push(4);\n\t\tstack.push(3);\n\t\t\n\t\tstack = sol.sortStack(stack);\n\t\t\n\t\twhile(!stack.isEmpty()){\n\t\t\tSystem.out.println(stack.pop());\n\t\t}\n\t}", "public T push(T data){\r\n \tboolean sorted = false;\r\n \twhile(!sorted) {\r\n \t\tif(stack1.empty() || data.compareTo(stack1.peek()) < 0) {\r\n \t\t\tstack2.push(data);\r\n \t\t\tsorted = true;\r\n \t\t}else {\r\n \t\t\tstack2.push(stack1.pop());\r\n \t\t}\r\n \t}\r\n \twhile(stack1.size() > 0) {\r\n \t\tstack2.push(stack1.pop());\r\n \t}\r\n \twhile(stack2.size() > 0) {\r\n \t\tstack1.push(stack2.pop());\r\n \t}\r\n \t++this.size;\r\n \treturn data;\r\n }", "@Test\n public void testPushCallTop(){\n ms = new MyStack();\n ms.push(1);\n ms.top();\n assertFalse(ms.IsEmpty());\n }", "public void sortRecursively() {\n\t\tif (!this.isEmpty()) {\n\t\t\tT x = this.peek();\n\t\t\tthis.pop();\n\t\t\tsortRecursively();\n\t\t\tinsertInOrder(x);\n\t\t} else\n\t\t\treturn;\n\t}", "@Test\n public void testStack() {\n DatastructureTest.STACK.push(3);\n DatastructureTest.STACK.push(7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == 7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == 7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == 3);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == 3);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == -1);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == -1);\n }", "public static void main(String[] args) {\n Stack<Integer> st = new Stack<Integer>();\n System.out.println(\"push\"+st.push(2));\n st.push((54));\n st.push(10);\n System.out.println(\"pop \"+st.pop());\n System.out.println(st.peek());\n System.out.println(st.isEmpty());\n \n System.out.println(\"----\");\n \n Queue<Integer> qu = new LinkedList<Integer>();\n System.out.println(qu.isEmpty());\n System.out.println(qu.add(5));\n System.out.println(qu.add(12));\n System.out.println(qu.size());\n qu.clear();\n System.out.println(qu.size());\n \n }", "public static void main(String[] args) {\r\n\r\n\t\tArrayStack arrst = new ArrayStack(5);\r\n\t\tIntStream.range(0, 5).forEach(arrst::push);\r\n\t\tSystem.out.println(\"Response of peek \" + arrst.peek());\r\n\t\tSystem.out.println(\"Response of pop\" + arrst.pop());\r\n\t\tSystem.out.println(\"push one random number in the middle\");\r\n\t\tarrst.push(10);\r\n\t\tSystem.out.println(\"printing stack after first pop\");\r\n\t\tarrst.display();\r\n\r\n\t\tIntStream.range(0, arrst.size()).forEach(i -> arrst.pop());\r\n\r\n\t\tSystem.out.println(\"isEmpty after poping all the elements ???\" + arrst.isEmpty());\r\n\r\n\t\tarrst.display();\r\n\r\n\t}", "private void topologicalSort(final Operation operation, final Deque<Operation> stack, final Set<Operation>\n visited) {\n\n LOG.trace(\"Topologically sorting operation: {} with stack: {} and visited: {}\", operation, stack, visited);\n\n visited.add(operation);\n\n //DFS active edges & add to stack\n if (operation.hasActiveEdges()) {\n\n for (final Edge activeEdge : operation.getActiveEdges()) {\n\n final Operation childOperation = activeEdge.getOperationTo();\n if (visited.contains(childOperation)) {\n continue;\n }\n\n topologicalSort(childOperation, stack, visited);\n }\n }\n stack.offerFirst(operation);\n }", "void topologicalSort() {\n Stack stack = new Stack();\n\n // Mark all the vertices as not visited\n Boolean visited[] = new Boolean[V];\n for (int i = 0; i < V; i++)\n visited [i] = false;\n\n // Call the recursive helper function to store Topological\n // Sort starting from all vertices one by one\n for (int i = 0; i < V; i++)\n if (visited [i] == false)\n topologicalSortUtil(i, visited, stack);\n\n // Print contents of stack\n while (stack.empty() == false)\n System.out.print(stack.pop() + \" \");\n }", "public void popAllStacks(){\n // if top is lost then all elements are lost.\n top = null;\n }", "public static void QtoS(){\n while(!POOR.isEmpty()){\n stack.push(POOR.remove());\n }\n while(!FAIR.isEmpty()){\n stack.push(FAIR.remove());\n }\n while(!GOOD.isEmpty()){\n stack.push(GOOD.remove());\n }\n while(!VGOOD.isEmpty()){\n stack.push(VGOOD.remove());\n }\n while(!EXCELLENT.isEmpty()){\n stack.push(EXCELLENT.remove());\n }\n \n \n}", "private void heapSort() {\n\n\t\tint queueSize = priorityQueue.size();\n\n\t\tfor (int j = 0; j < queueSize; j++) {\n\n\t\t\theapified[j] = binaryHeap.top(priorityQueue);\n\t\t\tbinaryHeap.outHeap(priorityQueue);\n\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\t\tStack<Integer> S = new Stack<>();\r\n\t\tfor(int i = 0; i<5; i++){\r\n\t\t\t//S.push(args);\r\n\t\t\tS.push(i);\r\n\t\t}\r\n\t\tSystem.out.println(\"Bottom-->\"+S+\"<--Top\");\r\n\t\t//S.pop();\r\n\t\twhile(!S.isEmpty()){\r\n\t\t\tSystem.out.println(\"After poping \"+S.pop());\r\n\t\t\tSystem.out.println(\"Now\tBottom-->\"+S+\"<--Top\");\r\n\t\t}\r\n\t\t\r\n\t\t//System.out.println(\"After poping \"+S.pop());\r\n\t\t//System.out.println(\"Now\tBottom-->\"+S+\"<--Top\");\r\n\t}", "public void testPush() {\n assertEquals(this.stack.size(), 10, 0.01);\n this.stack.push(10);\n assertEquals(this.stack.size(), 11, 0.01);\n assertEquals(this.stack.peek(), 10, 0.01);\n }", "public void quickSort(Stack<Pair> stack, int first, int n){\n while(!stack.empty()){\n Pair temp2 = stack.pop();\n int test = partition(temp2.first, temp2.n);\n if(test>1){\n Pair temp3 = new Pair(test,n);\n stack.push(temp3);\n }\n } \n }", "@Test\r\npublic void testTop()\r\n{\n\tassertEquals(null,myStack.top());\r\n\r\n\tassertEquals(true, myStack.push(new Element(2,\"Basel\")));\t\r\n\tassertEquals(true, myStack.push(new Element(4,\"Wil\")));\t\r\n\tassertEquals(true, myStack.push(new Element(27,\"Chur\")));\r\n\tassertEquals(27,myStack.top().getId());\r\n\tassertEquals(27,myStack.pop().getId());\r\n\tassertEquals(4,myStack.top().getId());\r\n\tassertEquals(4,myStack.pop().getId());\r\n\tassertEquals(2,myStack.pop().getId());\r\n\t\r\n\t// Stack leer\r\n\tassertEquals(null,myStack.top());\r\n\r\n}", "public void StackTest() {\n\tSystem.out.println( \"\\nQuestion (8) Stack Test\" );\n\tSystem.out.println( \"-----------------------\");\n\tStack s = new Stack(3);\n\tSystem.out.println( \"push 0\");\n\ts.push(0);\n\tSystem.out.println( \"push 1\");\n\ts.push(1);\n\tSystem.out.println( \"push 2\");\n\ts.push(2);\n\tSystem.out.println( \"try to push 3\");\n\ts.push(3); // error here pushing beyond stack depth, will print error messgae\n\n\tSystem.out.println( \"pop \" + s.pop() );\n\tSystem.out.println( \"pop \" + s.pop() );\n\tSystem.out.println( \"pop \" + s.pop() ); \n\tSystem.out.println( \"try to pop \" ); // error here poping off empty stack\n\ts.pop();\n }", "public void printStack(){\n Stack<Integer> tempStack = new Stack<>();\n if (numStack.empty()==true){\n System.out.println(Integer.MIN_VALUE);\n }\n else{\n while (numStack.empty() == false){\n tempStack.push(numStack.peek());\n numStack.pop();\n }\n while (tempStack.empty() == false){\n int i = tempStack.peek();\n System.out.println(i);\n tempStack.pop();\n numStack.push(i);\n } \n }\n }", "public static void main(String[] args) \r\n\t{\n\t \r\n Stack st=new Stack();\r\n st.push(6);\r\n st.push(5);\r\n st.push(3);\r\n st.push(2);\r\n st.push(1);\r\n \r\n System.out.println( st.peek());\r\n \r\n \r\n // System.out.println( st.isEmpty());\r\n\t}", "@Test\r\n public void testStackstack() {\r\n StackArrayList<Integer> stack = new StackArrayList<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEquals(5, stack.peek());\r\n assertEquals(5, stack.pop());\r\n assertEquals(4, stack.size());\r\n }", "public void pop(){\n \n if(top==null) System.out.println(\"stack is empty\");\n else top=top.next;\n \t\n }", "public void sort(){\n\t\t\n\t\tif(Q.size() != 1){\n\t\t\tArrayQueue<E> tempQueue1 = Q.dequeue();\n\t\t\tArrayQueue<E> tempQueue2 = Q.dequeue();\n\t\t\tArrayQueue<E> tempQueue3 = merge(tempQueue1, tempQueue2);\n\t\t\tQ.enqueue(tempQueue3);\n\t\t\tsort();\n\t\t}\n\t\t\n\t}", "public void pop(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // check if stack is empty\n if(this.topOfStack==-1){\n System.out.println(\"Stack is empty, can't pop from stack\");\n return;\n }\n // if stack is not empty\n this.arr[this.topOfStack]=Integer.MIN_VALUE;\n this.topOfStack--;\n }", "@Test\n public void testStackCodeExamples() {\n logger.info(\"Beginning testStackCodeExamples()...\");\n\n // Allocate an empty stack\n Stack<String> stack = new Stack<>();\n logger.info(\"Start with an empty stack: {}\", stack);\n\n // Push a rock onto it\n String rock = \"rock\";\n stack.pushElement(rock);\n assert stack.getTop().equals(rock);\n logger.info(\"Push a rock on it: {}\", stack);\n\n // Push paper onto it\n String paper = \"paper\";\n stack.pushElement(paper);\n assert stack.getTop().equals(paper);\n logger.info(\"Push paper on it: {}\", stack);\n\n // Push scissors onto it\n String scissors = \"scissors\";\n stack.pushElement(scissors);\n assert stack.getTop().equals(scissors);\n assert stack.getSize() == 3;\n logger.info(\"Push scissors on it: {}\", stack);\n\n // Pop off the scissors\n assert stack.popElement().equals(scissors);\n assert stack.getSize() == 2;\n logger.info(\"Pop scissors from it: {}\", stack);\n\n // Pop off the paper\n assert stack.popElement().equals(paper);\n assert stack.getSize() == 1;\n logger.info(\"Pop paper from it: {}\", stack);\n\n // Pop off the rock\n assert stack.popElement().equals(rock);\n assert stack.isEmpty();\n logger.info(\"Pop rock from it: {}\", stack);\n\n logger.info(\"Completed testStackCodeExamples().\\n\");\n }", "@SubL(source = \"cycl/stacks.lisp\", position = 2117) \n public static final SubLObject stack_empty_p(SubLObject stack) {\n checkType(stack, $sym1$STACK_P);\n return Types.sublisp_null(stack_struc_elements(stack));\n }", "@Test\n void whenPopTillStackEmptyReturnNodeShouldBeFirstNode() {\n\n MyNode<Integer> myFirstNode = new MyNode<>(70);\n MyNode<Integer> mySecondNode = new MyNode<>(30);\n MyNode<Integer> myThirdNode = new MyNode<>(56);\n MyStack myStack = new MyStack();\n myStack.push(myFirstNode);\n myStack.push(mySecondNode);\n myStack.push(myThirdNode);\n boolean isEmpty = myStack.popTillEmpty();\n\n System.out.println(isEmpty);\n boolean result = myStack.head == null && myStack.tail == null;\n }", "public interface Stack<T> {\n boolean isEmpty();\n T pop();\n void push(T t);\n T getTop();\n void clear();\n int size();\n}", "@Test\n public void testPushTop(){\n ms = new MyStack();\n ms.push(2);\n assertEquals(2,ms.top());\n }", "@Test\r\n public void isEmptyTest1(){\r\n stack.pop();\r\n stack.pop();\r\n stack.pop();\r\n assertThat(stack.isEmpty(), is(true));\r\n }", "public TopologicalSort(DirectedGraph graph) {\r\n visited = new boolean[graph.numOfVertices()];\r\n inRecursionStack = new boolean[graph.numOfVertices()];\r\n reversePostOrder = new Stack<Integer>();\r\n topologicalOrder = new ArrayList<Integer>();\r\n \r\n // Perform DFS, adding vertices to stack\r\n for(int vertex = 0; vertex < graph.numOfVertices(); vertex++) {\r\n if(!visited[vertex]) {\r\n depthFirstSearch(graph, vertex);\r\n }\r\n }\r\n \r\n // Pop the stack\r\n while(!reversePostOrder.empty()) {\r\n topologicalOrder.add(reversePostOrder.pop());\r\n }\r\n }", "public static void mergeSortNonRecursive(int[] input){\n int[] arr;\n Stack<int[]> unsortedStack = new Stack();\n Stack<int[]> sortedStack = new Stack();\n unsortedStack.push(input);\n //while !unsortedStack.isempty, needs to pop int[] from stack , assign to arr, pop status\n //if(arr.length>1), split arr to arr.left and arr.right,push left and right into stack, push false to stack twice\n //else if(arr.length<=1), push arr to sortedStack (while (!unsorted.isempty && peek().length==arr,merge and pushback to stack again)\n //\n\n while(!unsortedStack.empty()) {\n arr = unsortedStack.pop();\n if (arr.length > 1) {\n int begin = 0,end=arr.length,mid=arr.length/2;\n int[] left = Arrays.copyOfRange(arr, begin, mid);\n int[] right = Arrays.copyOfRange(arr, mid, end);\n unsortedStack.push(left);\n unsortedStack.push(right);\n } else {\n while(!sortedStack.isEmpty() && sortedStack.peek().length<=arr.length){\n arr = merge(arr, sortedStack.pop());\n }\n sortedStack.push(arr);\n }\n }\n while(sortedStack.size()>1){\n arr = merge(sortedStack.pop(), sortedStack.pop());\n sortedStack.push(arr);\n }\n int[] tmp = sortedStack.pop();\n for(int i=0;i<input.length;i++){\n input[i]=tmp[i];\n }\n\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"A\".compareTo(\"B\"));\n//\t\tArrayStack<String> s1 = new ArrayStack<String>(5);\n//\t\ts1.push(\"A\");\n//\t\ts1.push(\"B\");\n//\t\ts1.push(\"C\");\n//\t\t\n//\t\tSystem.out.println(s1);\n//\t\t\n//\t\ts1.pop();\n//\t\tSystem.out.println(\"\\n\" + s1);\n//\t\t\n//\t\ts1.push(\"D\");\n//\t\ts1.push(\"E\");\n//\t\ts1.push(\"F\");\n//\t\t\n//\t\ts1.pop();\n//\t\tSystem.out.println(s1);\n\t\t\n\t}", "public void pop() {\r\n \t Queue<Integer> temp=new LinkedList<Integer>();\r\n \t int counter=0;\r\n \t while(!stack.isEmpty()){\r\n \t temp.add((Integer) stack.poll());\r\n \t counter++;\r\n \t \r\n \t }\r\n \t while(counter>1)\r\n \t {\r\n \t \r\n \t stack.add(temp.poll());\r\n \t counter--;\r\n \t }\r\n }", "public void sort() {\n Card.arraySort(this.cards, this.topCard);\n }", "public static void main(String[] args) {\n// System.out.println(\"as.getSize() == \" + as.getSize());\n// as.pop();\n// System.out.println(\"as.pop() == \" + as);\n// System.out.println(\"as.peek() == \" + as.peek());\n// as.push(\"17\");\n// System.out.println(as);\n\n LinkedListStack<Integer> stack = new LinkedListStack<>();\n\n for(int i = 0 ; i < 5 ; i ++){\n stack.push(i);\n System.out.println(stack);\n }\n\n stack.pop();\n System.out.println(stack);\n\n }", "private static void sortedInsert(Stack<Integer> stack, int x) {\n if (stack.isEmpty() || stack.peek() < x) {\n stack.push(x);\n return;\n }\n int temp = stack.pop();\n sortedInsert(stack, x);\n stack.push(temp);\n }", "@Test\r\n\tpublic void testPop()\r\n\t{\n\t\tassertEquals(null,myStack.pop());\r\n\t\r\n\t\tassertEquals(true, myStack.push(new Element(2,\"Basel\")));\t\r\n\t\tassertEquals(true, myStack.push(new Element(4,\"Wil\")));\t\r\n\t\tassertEquals(true, myStack.push(new Element(27,\"Chur\")));\r\n\t\tassertEquals(27,myStack.top().getId());\r\n\t\tassertEquals(\"Chur\",myStack.pop().getName());\r\n\t\tassertEquals(4,myStack.pop().getId());\r\n\t\tassertEquals(2,myStack.pop().getId());\r\n\t\t\r\n\t\t// leerer Stack\r\n\t\tassertEquals(null,myStack.pop());\r\n\t\tassertEquals(null,myStack.top());\r\n\t}", "public static void main(String[] args) {\n\t\tstack s = new stack();\n\t\ts.push(6);\n\t\ts.push(5);\n\t\ts.min();\n\t\ts.push(3);\n\t\ts.push(4);\n\t\ts.push(2);\n\t\ts.min();\n\t\ts.push(6);\n\t\t// s.print();\n\t\ts.pop();\n\t\ts.pop();\n\t\ts.min();\n\t\ts.min();\n\t\ts.pop();\n\t\ts.pop();\n\t\ts.pop();\n\t\ts.pop();\n\t\ts.min();\n\t\t// s.print();\n\n\t}", "private void topologicalSort(Vertex start, Set<Vertex> visited, Stack<Vertex> stack) {\n\t\tvisited.add(start);\r\n\r\n\t\tSet<Vertex> neighbors = start.getNeighbors();\r\n\r\n\t\t// Get all adjacent vertices of the vertex s and recurse\r\n\t\tneighbors.forEach(n -> {\r\n\t\t\tif (!visited.contains(n))\r\n\t\t\t\ttopologicalSort(n, visited, stack);\r\n\t\t});\r\n\r\n\t\tstack.push(start);\r\n\t}", "public boolean stackEmpty() {\r\n\t\treturn (top == -1) ? true : false;\r\n\t }", "@Test\n void whenElementAddedToStackLastElementShouldTop() {\n\n MyNode<Integer> myFirstNode = new MyNode<>(70);\n MyNode<Integer> mySecondNode = new MyNode<>(30);\n MyNode<Integer> myThirdNode = new MyNode<>(56);\n MyStack myStack = new MyStack();\n myStack.push(myFirstNode);\n myStack.push(mySecondNode);\n myStack.push(myThirdNode);\n\n boolean result = myStack.head.equals(myFirstNode) && myStack.head.getNext().equals(mySecondNode)\n && myStack.tail.equals(myThirdNode);\n\n Assertions.assertTrue(result);\n }", "public static void main(String[] args) throws Exception {\n StackUsingArrays stack=new StackUsingArrays(5);\n \n for(int i=1;i<=5;i++) {\n \tstack.push(i*10);\n \tstack.display();\n }\n \n System.out.println(stack.size());\n \n //stack.push(60);\n System.out.println(stack.top());\n \n// while(!stack.isEmpty()) {\n// \tstack.display();\n// \tstack.pop();\n// \t\n// }\n// \n// stack.pop();\n\t}", "public static void main(String[] args) {\n\t\tStack stack = new Stack(3);\n\t\tSystem.out.println(\"Is stack empty ? - \" + isEmpty(stack));\n\t\tpush(stack, 10);\n\t\tpush(stack, 20);\n\t\tpush(stack, 30);\n\t\tpush(stack, 40);\n\t\tfor(int i = 0; i <= stack.top; i++){\n\t\t\tSystem.out.print(stack.list[i] + \" -\");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"No of element in stack - \"+(stack.top +1));\n\t\twhile(!isEmpty(stack)){\n\t\t\tSystem.out.println(\"Poping ...\"+ pop(stack));\n\t\t}\n\t}", "public Solution67() {\n stack = new Stack<>();\n min_stack = new Stack<>();\n }", "@Test\n public void testPushPop(){\n ms=new MyStack();\n ms.push(2);\n ms.pop();\n assertTrue(ms.IsEmpty());\n }", "protected void stackEmptyButton() {\n \tif (stack.empty()) {\n \t\tenter();\n \t}\n \telse {\n \t\tstack.pop();\n \t\tif (stack.empty()) {\n \t\t\tenter();\n \t}\n \t}\n }", "@Test\n public void testPushAndPopD() {\n System.out.println(\"popC - Out of Order\");\n\n String elementOne = \"Bill\";\n String elementTwo = \"Steve\";\n String elementThree = \"Tim\";\n String elementFour = \"Dave\";\n\n //Stack<String> instance = new StackArrayImpl();\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n instance.push(elementOne);\n instance.push(elementTwo);\n instance.push(elementThree);\n\n int fourSize = instance.size();\n assertEquals(fourSize, 3);\n assertEquals(instance.isEmpty(), false);\n\n String resultThree = instance.pop();\n String resultTwo = instance.pop();\n\n instance.push(elementFour);\n String resultFour = instance.pop();\n\n String resultOne = instance.pop();\n\n assertEquals(elementOne, resultOne);\n assertEquals(elementTwo, resultTwo);\n assertEquals(elementThree, resultThree);\n assertEquals(elementFour, resultFour);\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public static void main(String[] args) throws StackFullException, StackEmptyException {\n\t try {\n\t DiscardPile<Card> discardPile1 = null; \n\t\tdiscardPile1 = new DiscardPile<Card>(52, 0);// max is 52\n\t\tdiscardPile1.push(new Card(8));\n\t\tdiscardPile1.push(new Card(32));\n\t\tdiscardPile1.push(new Card(48));\t\t\n\t\tdiscardPile1.push(new Card(2));\n\t\tdiscardPile1.push(new Card(17));\n\t\tdiscardPile1.push(new Card(20)); //removeTopCard should remove all that's above\n\t\tdiscardPile1.push(new Card(25));\n\t\tdiscardPile1.push(new Card(50));\n\t\tdiscardPile1.push(new Card(19));\n\t\tdiscardPile1.push(new Card(41)); //10 Cards that must be popped\n\t\tSystem.out.println(\"*********************************************************************************\"); \n\t\tCollections.reverse(discardPile1);\n\t\tfor(Card comi : discardPile1) { //for loop for objects\n\t\t\tSystem.out.println(comi);\n\t\t\t}\t\t\t\n\t }\n\t catch (StackFullException SFE) {\n\t System.out.println(\"StackFullException: \" + SFE.getMessage());\n}\n\t try {\n\t\t\tDiscardPile<Card> discardPile = null; \n\t\t\tdiscardPile = new DiscardPile<Card>(52, 0);\n\t\t\tdiscardPile.push(new Card(8));\n\t\t\tdiscardPile.push(new Card(32));\n\t\t\tdiscardPile.push(new Card(48));\t\t\n\t\t\tdiscardPile.push(new Card(2));\n\t\t\tdiscardPile.push(new Card(17));\n\t\t\tdiscardPile.push(new Card(20)); //removeTopCard should remove all that's above\n\t\t\tdiscardPile.push(new Card(25));\n\t\t\tdiscardPile.push(new Card(50));\n\t\t\tdiscardPile.push(new Card(19));\n\t\t\tdiscardPile.push(new Card(41)); //10 Cards that must be popped\n\t\t\t \n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\t\t\t\n\t\t\tCard[] cardArr = discardPile.removeTopCard(new Card(20));\n\t\t\tfor(Card co : cardArr) { //for loop for objects\n\t\t\t\tSystem.out.println(co);\n\t\t\t\t}\t\t\n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\n\t\t }\n\t\t catch (StackFullException SFE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SFE.getMessage());\n\t\t }\n\t\t catch (StackEmptyException SEE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SEE.getMessage());\n\t\t }\n\t try {\n\t\t\tDiscardPile<Card> discardPile = null; \n\t\t\tdiscardPile = new DiscardPile<Card>(52, 0);\n\t\t\tdiscardPile.push(new Card(8));\n\t\t\tdiscardPile.push(new Card(32));\n\t\t\tdiscardPile.push(new Card(48));\t\t\n\t\t\tdiscardPile.push(new Card(2));\n\t\t\tdiscardPile.push(new Card(17));\n\t\t\tdiscardPile.push(new Card(20)); //removeTopCard should remove all that's above\n\t\t\tdiscardPile.push(new Card(25));\n\t\t\tdiscardPile.push(new Card(50));\n\t\t\tdiscardPile.push(new Card(19));\n\t\t\tdiscardPile.push(new Card(41)); //10 Cards that must be popped\n\t\t\t \n\t\t\t\n\t\t\tCard[] cardArr = discardPile.removeTopCard(new Card(50));\n\t\t\tfor(Card co : cardArr) { //for loop for objects\n\t\t\t\tSystem.out.println(co);\n\t\t\t\t}\t\t\n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\n\t\t }\n\t\t catch (StackFullException SFE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SFE.getMessage());\n\t\t }\n\t\t catch (StackEmptyException SEE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SEE.getMessage());\n\t\t }\n\n}", "@Test /*Test 19 - implemented push() method to NumStack class.*/\n public void testPush() {\n numStackTest.push(5);\n assertFalse(\"NumStack object shouldn't be empty after pushing first entry onto it\", \n numStackTest.isEmpty());\n numStackTest.push(10);\n assertFalse(\"NumStack object shouldn't be empty after pushing second entry onto it\", \n numStackTest.isEmpty());\n numStackTest.push(15);\n assertFalse(\"NumStack object shouldn't be empty after pushing third entry onto it\", \n numStackTest.isEmpty());\n }", "@Test\n public void testPush(){\n ms=new MyStack();\n ms.push(1);\n assertFalse(ms.IsEmpty());\n }", "public interface StackTest<T> {\n\n T pop();\n void push(T t);\n boolean isEmpty();\n int getSize();\n}", "public interface Stack<E> {\r\n \r\n /** \r\n * Pre: Se ingresa el dato\r\n * @param data se ingresa un dato para agregar al Vector\r\n * Post: Se guarda el dato en Stack\r\n */\r\n public void push(E data);\r\n\r\n /** \r\n * Pre: Estan todos los datos en el Stack\r\n * @return E se regresa un item.\r\n * Post: Se regresa y elimina un dato del Stack\r\n */\r\n public E pop();\r\n\r\n /** \r\n * Pre: Se encuentra el Stack con sus datos\r\n * @return E se regresa cualquier tipo de dato\r\n * @throws EmptyStackException regresa un error\r\n * Post: Se regresa el dato sobre la lista\r\n */\r\n public E peek();\r\n\r\n /** \r\n * Pre:Se encuentra el Stack\r\n * @return boolean se regresa un valor True o False\r\n * Post: Si el Stack se encuentra vacio este regresa True\r\n */\r\n public boolean empty();\r\n\r\n /** \r\n * Pre:Se encuentra el Stack \r\n * @return int se regrea cualquier numero\r\n * Post: Se devuelve el numero de objetos que tiene el Stack\r\n */\r\n public int size();\r\n\r\n}", "public MinStack() {\n st = new Stack<>();\n }", "public interface Stack<T> extends Iterable<T> {\n\n // -----------------------\n // Base Function\n // -----------------------\n\n /**\n * push object to stack\n * @param item object, the item could be null\n */\n void push(T item);\n\n T pop();\n\n int size();\n\n boolean isEmpty();\n\n /**\n * get the last element, but not pop it\n * @return the top element\n */\n T peek();\n\n // ---------------------\n // Extend Function\n // ---------------------\n default boolean isNotEmpty() {\n return !isEmpty();\n }\n\n}", "static void sortedInsert(Stack<Integer> s, int x)\n\t{\n\t\t// Base case: Either stack is empty or newly\n\t\t// inserted item is greater than top (more than all\n\t\t// existing)\n\t\tif (s.isEmpty() || x > s.peek()) \n\t\t{\n\t\t\ts.push(x);\n\t\t\treturn;\n\t\t}\n\t\t// If top is greater, remove the top item and recur\n\t\tint temp = s.pop();\n\t\tsortedInsert(s, x);\n\n\t\t// Put back the top item removed earlier\n\t\ts.push(temp);\n\t}", "@Test\r\n public void testStackListaEncadenada() {\r\n StackListaEncadenada<Integer> stack = new StackListaEncadenada<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEquals(5, stack.peek());\r\n assertEquals(5, stack.pop());\r\n assertEquals(4, stack.size());\r\n }", "@Override\n public int compareTo(StackedItem stack2) {\n Entity entity1 = this.getItem();\n Entity entity2 = stack2.getItem();\n\n if (this == stack2)\n return 0;\n\n if (Setting.ITEM_MERGE_INTO_NEWEST.getBoolean())\n return entity1.getTicksLived() < entity2.getTicksLived() ? 1 : -1;\n\n if (this.getStackSize() == stack2.getStackSize())\n return entity1.getTicksLived() > entity2.getTicksLived() ? 2 : -2;\n\n return this.getStackSize() > stack2.getStackSize() ? 1 : -1;\n }", "public boolean stackPop() {\r\n\t\t if(stackEmpty())\r\n\t\t {\r\n\t\t\t return false;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t if(top == 0)\r\n\t\t {\r\n\t\t \ttop = -1;\r\n\t\t \tcount--;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t \tarray[top] = array[top-1];\r\n\t\t \ttop--;\r\n\t\t \tcount--;\r\n\t\t }\r\n\t\t\t return true;\r\n\t\t } \t\r\n\t }", "public void testMyStack() {\n\t\tMyStack<String> s = new MyStack<String>();\n\t\ts.push(\"1\");\n\t\ts.push(\"2\");\n\t\ts.push(\"3\");\n\t\ts.pop();\n\t\ts.push(\"4\");\n\t\ts.toString();\n\t\tSystem.out.println(\"MyStack size is: \" + s.size());\n\t}", "static void stackPush(Stack<Integer> stack)\r\n\t{\r\n\t\tfor(int i=0;i<5;i++)\r\n\t\t{\r\n\t\t\tstack.push(i*5);\r\n\t\t}\r\n\t\tSystem.out.println(\"Printing the stack value which is push:\");\r\n\t\tSystem.out.println(\"Push :\"+stack +\"\\nsize of stack: \"+ stack.size());\r\n\t}", "static void stack_peek(Stack<Integer> stack)\r\n\t{\r\n\t\tInteger element=stack.peek();\r\n\t\tSystem.out.println(\"Element on stack top :\" + element);\r\n\t}", "private List<ThroughNode> popStackStackForward() {\n List<ThroughNode> popped = nodeStackStack.peek();\n nodeStackStack.push(C.tail(popped));\n return popped;\n }", "public void mergesort()\n { sort(this.heap, 0, heap.size()-1);\n }", "public static void main(String[] args) {\n// reverse(queue);\n// System.out.println(queue);\n\n Stack<Integer> stack=new Stack<>();\n stack.push(1);\n stack.push(2);\n stack.push(3);\n stack.push(4);\n System.out.println(stack);\n stack=reverse(stack);\n System.out.println(stack);\n\n\n\n\n }", "void sort(ItemStack itemstack, SortType type, short width);", "@Test\n public void testPushAndPopC() {\n\n System.out.println(\"pushB - All Nulls\");\n String elementOne = null;\n String elementTwo = null;\n String elementThree = null;\n String elementFour = null;\n\n //Stack<String> instance = new StackArrayImpl();\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n instance.push(elementOne);\n instance.push(elementTwo);\n instance.push(elementThree);\n instance.push(elementFour);\n\n int fourSize = instance.size();\n assertEquals(fourSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String resultFour = instance.pop();\n String resultThree = instance.pop();\n String resultTwo = instance.pop();\n String resultOne = instance.pop();\n\n assertEquals(elementOne, resultOne);\n assertEquals(elementTwo, resultTwo);\n assertEquals(elementThree, resultThree);\n assertEquals(elementFour, resultFour);\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public static void flipStack(Stack<Integer> s){\n\t //Creates a new queue\n\t\tQueue<Integer> qList = new Queue<Integer>();\n\n\t\t\t//Moves the numbers from stack to a queue\n\t\twhile(!s.isEmpty()){\n\t\t\tqList.enqueue(s.pop());\n\t\t}\n\n\t\t\t//Pushes the numbers back into the stack in reverse order\n\t\twhile(!qList.isEmpty()){\n\t\t\ts.push(qList.dequeue());\n\t\t}\n\t}", "public static void main(String[] args) {\n ArrayDeque<Integer> stack = new ArrayDeque<>();\n stack.push(10);\n stack.push(20);\n stack.push(30);\n \n System.out.println(\"stack : \"+stack);\n System.out.println(\"Top : \"+stack.peek());\n \n while(stack.isEmpty() != true)\n {\n System.out.println(stack.poll()+\" \");\n }\n }", "public GetMinStack() {\n stackData = new Stack<>();\n stackMin = new Stack<>();\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tStackUsingQueues st = new StackUsingQueues();\r\n\t\t\r\n\t\tst.push(1);\r\n\t\tst.push(2);\r\n\t\tst.push(3);\r\n\t\tst.push(4);\r\n\t\t\r\n\t\tSystem.out.println(st.pop());\r\n\t\tSystem.out.println(st.pop());\r\n\t\tSystem.out.println(st.pop());\r\n\t\tSystem.out.println(st.pop());\r\n\t\t\r\n\t\tst.push(5);\r\n\t\tst.push(6);\r\n\t\tst.push(7);\r\n\t\tst.push(8);\r\n\t\t\r\n\t\tSystem.out.println(st.pop());\r\n\t\tSystem.out.println(st.pop());\r\n\t\tSystem.out.println(st.pop());\r\n\t\tSystem.out.println(st.pop());\r\n\r\n\t}", "public static void main(String[] args) {\n \n QueuetoStack a=new QueuetoStack();\n a.add(1);\n a.add(2);\n a.add(3);\n a.add(4);\n a.remove();\n a.remove();\n a.remove();\n a.remove();\n }", "@Test\n public void push() {\n SimpleStack stack = new DefaultSimpleStack();\n Item item = new Item();\n\n // When the item is pushed in the stack\n stack.push(item);\n\n // Then…\n assertFalse(\"The stack must be not empty\", stack.isEmpty());\n assertEquals(\"The stack constains 1 item\", 1, stack.getSize());\n assertSame(\"The pushed item is on top of the stack\", item, stack.peek());\n }", "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}", "public static void main(String[] args) {\n\t\tQueueOfStack test = new QueueOfStack();\n\t\ttest.enqueue(2);\n\t\ttest.enqueue(3);\n\t\tSystem.out.println(test.dequeue());\n\t\ttest.enqueue(7);\n\t\ttest.enqueue(1);\n\t\ttest.enqueue(6);\n\t\ttest.enqueue(4);\n\t\tSystem.out.println(test.dequeue());\n\t\tSystem.out.println(test.dequeue());\n\t\tSystem.out.println(test.peek());\n\t}", "static void postOrderTwoStacks(Node root) {\n Stack<Node> stack = new Stack<>();\n Stack<Node> stack2 = new Stack<>();\n if (root == null) {\n return;\n } else {\n stack.push(root);\n while (!stack.isEmpty()) {\n Node temp = stack.pop();\n stack2.push(temp);\n if (temp.left != null) {\n stack.push(temp.left);\n }\n if (temp.right != null) {\n stack.push(temp.right);\n }\n }\n while (!stack2.isEmpty()) {\n Node temp = stack2.pop();\n System.out.print(temp.data + \" \");\n }\n }\n }", "public MinStack() {\n dataStack=new Stack<>();\n minStack=new Stack<>();\n }", "public MinStack() {\n data = new ArrayDeque<>();\n helper = new ArrayDeque<>();\n }", "@Test\n public void testThreePushPop(){\n ms = new MyStack();\n int pn1=3, pn2=4, pn3=5;\n ms.push(pn1);\n ms.push(pn2);\n ms.push(pn3);\n assertEquals(pn3,ms.pop());\n assertEquals(pn2,ms.pop());\n assertEquals(pn1,ms.pop());\n }", "@Test\n public void testIsEmpty() {\n System.out.println(\"isEmpty\");\n instance = new Stack();\n assertTrue(instance.isEmpty());\n instance.push(\"ab\");\n instance.push(\"cd\");\n assertFalse(instance.isEmpty());\n instance.pop();\n instance.pop();\n assertTrue(instance.isEmpty());\n }" ]
[ "0.7621658", "0.75241196", "0.7351891", "0.70204705", "0.69818854", "0.6929361", "0.68996114", "0.6840715", "0.6768543", "0.67556524", "0.67454255", "0.6584398", "0.6546802", "0.65293515", "0.63806766", "0.62880236", "0.6224298", "0.62196934", "0.6126987", "0.608244", "0.60415226", "0.5943436", "0.59148824", "0.58633035", "0.58197886", "0.580478", "0.5787692", "0.57643044", "0.5740001", "0.5671605", "0.5661481", "0.5612918", "0.56098", "0.55965656", "0.5581315", "0.55735356", "0.5571424", "0.5570922", "0.555446", "0.5550618", "0.55321676", "0.5509332", "0.5504296", "0.5488542", "0.54872227", "0.54292476", "0.5422791", "0.53893995", "0.5384044", "0.53838134", "0.5355681", "0.53504384", "0.534753", "0.5340063", "0.53364754", "0.5333489", "0.5332636", "0.53271526", "0.5320969", "0.531942", "0.53180593", "0.5312112", "0.53000516", "0.528647", "0.527922", "0.5276234", "0.5273543", "0.5272016", "0.5262558", "0.5255905", "0.52555144", "0.5196991", "0.51937413", "0.51858544", "0.5184378", "0.51789874", "0.51780796", "0.51742405", "0.5171883", "0.5165996", "0.5163029", "0.516136", "0.5159564", "0.51587355", "0.5158222", "0.5157375", "0.51560426", "0.5140793", "0.5139424", "0.51316446", "0.5125733", "0.5117169", "0.5101307", "0.5099983", "0.50984323", "0.5090395", "0.5086927", "0.50851756", "0.5083329", "0.507359" ]
0.6575834
12
/ The check method takes the inputed and removes all the spaces and reduces any possible letters to lower case to prevent any bugs/
public static char[] format(String expression){ expression = expression.replaceAll(" ", ""); expression = expression.toLowerCase(); return expression.toCharArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static String cleanString(String s) {\n return s.replaceAll(\"[^a-zA-Z ]\", \"\").toLowerCase();\n }", "static String cleanString(String s) {\n return s.replaceAll(\"[^a-zA-Z ]\", \"\").toLowerCase();\n }", "static String cleanString(String s) {\n return s.replaceAll(\"[^a-zA-Z ]\", \"\").toLowerCase();\n }", "public String nameCheck(String name) {\n\t\twhile(true) {\n\t\t\tif(Pattern.matches(\"[A-Z][a-z]{3,10}\", name)){\n\t\t\t\treturn name;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Name should have first capital alphabet and rest small alphabets.\");\n\t\t\t\tSystem.out.println(\"Enter again: \");\n\t\t\t\tname = sc.next();\n\t\t\t}\n\t\t}\n\t}", "private String filter(String line) {\n return line.toLowerCase().replaceAll(\"[^a-z]\", \"\");\n }", "public boolean validateName(String input)//true if valid\n\t{\n\t\t//loop through string verifying for numbers\n\t\tfor(int i = 0;i<input.length(); i++)\n\t\t{\n\t\t\tchar c = input.charAt(i);\n\t\t\t\n\t\t\tif(!Character.isAlphabetic(c))\n\t\t\t{\n\t\t\t if(c == '-' || c == ' ')\n\t\t\t\t{\n\t\t\t\treturn true;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t else return false;\n\t\t\t}\t\n\t\t\t\n\t\t}\n\t\treturn true;\n\t}", "public static String getValidation(String message) { // Example of using Method Overloading\r\n\r\n Scanner reader = new Scanner(System.in); // Create a Scanner object\r\n String input = null;\r\n int charIsNotSpace = 0;\r\n\r\n do {\r\n System.out.print(message);\r\n\r\n while (!reader.hasNextLine()) { // I think that the program never enters this while because .hasNextLine identifies\r\n System.out.print(\"Please enter a valid name with at least 3 characters\"); // any type of input as a valid\r\n reader.next(); // value, including \"enter\" and space, but it is like this in the \"PPT Input Validation\"\r\n }\r\n\r\n input = reader.nextLine();\r\n\r\n for (int i=0; i < input.length(); i++) { // checks if at least three characters are not space\r\n if (input.charAt(i) != ' ') {\r\n charIsNotSpace ++;\r\n }\r\n }\r\n\r\n } while (input == null || input.equals(\"\") || input.length() < 3 || charIsNotSpace < 3); //While the input value is not a null value or empty string or least 3 characters.\r\n\r\n // Loop used to capitalize the first letter of the name and without using any other auxiliary class, such as the StringBuilder\r\n String letter = \"\";\r\n String capitalizedName = \"\";\r\n boolean isFirstLetter;\r\n for (int i=0; i < input.length(); i++) {\r\n\r\n isFirstLetter = false;\r\n\r\n if (i == 0) {\r\n while (input.charAt(i) == ' ') { // Ignores spaces that the user typed before the first letter of the name\r\n i++;\r\n }\r\n isFirstLetter = true;\r\n }\r\n\r\n if (input.charAt(i) == ' ' && (i+1) < input.length()) {\r\n if (input.charAt(i) == ' ' && input.charAt(i + 1) == ' ') {\r\n letter = \"\";\r\n } else {\r\n letter += \" \" + input.charAt(i + 1);\r\n capitalizedName += letter.toUpperCase();\r\n i++;\r\n letter = \"\";\r\n }\r\n }\r\n else if (isFirstLetter == true) {\r\n letter += input.charAt(i);\r\n capitalizedName += letter.toUpperCase();\r\n letter = \"\";\r\n }\r\n else if (input.charAt(i) != ' ') {\r\n letter += input.charAt(i);\r\n capitalizedName += letter.toLowerCase();\r\n letter = \"\";\r\n }\r\n }\r\n\r\n return capitalizedName;\r\n }", "private String sanitizeString(String string) {\n if (string == null) {\n return \"\";\n }\n return string.toLowerCase().trim();\n }", "private boolean checkInputContent(String contents){\n try {\n char[] temC = contents.toCharArray();\n for (int i=0;i<temC.length;i++) {\n char mid = temC[i];\n if(mid>=48&&mid<=57){//数字\n continue;\n }\n if(mid>=65&&mid<=90){//大写字母\n continue ;\n }\n if(mid>=97&&mid<=122){//小写字母\n continue ;\n }\n// temp.replace(i, i+1, \" \");\n return false;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return true;\n }", "private String cleanMake(String make) {\n\t\tString cleanMake = make.trim().replaceAll(\"[^a-zA-Z]\", \"\");\n\t\treturn cleanMake.substring(0,1).toUpperCase() + cleanMake.substring(1).toLowerCase();\n\t}", "@Test\n\tpublic void caseNameWithCorrectInput() {\n\t\tString caseName = \"led case\";\n\t\tboolean isNameValid;\n\t\ttry {\n\t\t\tisNameValid = StringNumberUtil.stringUtil(caseName);\n\t\t\tassertTrue(isNameValid);\n\t\t} catch (StringException e) {\n\t\t\tfail();\n\t\t}\n\t\t\n\t}", "String filter(String text)\n {\n return text.trim().toLowerCase();\n }", "public static void main(String[] args) {\n\n\n\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Enter your name here: \");\n String name = scan.next();\n System.out.println(\"Your name corrected is: \");\n String name2 = name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase();\n System.out.println(name2);\n\n // make whole name uppercase the get the first character\n // get the rest of the characters starting from 2nd character\n /// then make it lowercase\n // eventually concatenate them\n\n\n }", "private boolean validate(String s)\r\n\t{\r\n\t\tint i=0;\r\n\t\tchar[] s1=s.toLowerCase().toCharArray();\r\n\t\twhile(i<s1.length)\r\n\t\t{\r\n\t\t\tif(s1[i]=='*' || s1[i]=='?')\r\n\t\t\t\tbreak;\r\n\t\t\tif(s1[i]<'a' || s1[i]>'z') return false;\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static String sanitize(String input) {\n input = input.replaceAll(\"[^A-Za-z0-9_]\", \"\").toLowerCase();\n if (input.matches(\"[0-9]+\") || input.startsWith(\"href\")) {\n return \"\";\n }\n return input;\n }", "public boolean checkLowerCase(String password) {\n return password.matches(\".*[a-z].*\");\n }", "public static String validString(String input) throws IllegalArgumentException {\n\t\tif (input == null || input.length() == 0) {\n\t\t throw new IllegalArgumentException(\"String value is not present.\");\n\t\t}\n\t\tinput = input.trim(); \n\t\tinput = input.substring(0, 1).toUpperCase() + input.substring(1);\n\t\treturn input;\n\t}", "public static Boolean validateInput(String input) {\n\t\tString xInput = input.substring(0,1);\n\n\t\n\n\t\t\n\t\tboolean xIsLetter = Character.isLetter(xInput.charAt(0));\n\n\t\tif((!input.isEmpty()) || (!xIsLetter)) {\n\t\n\t\t\treturn false;\n\t\t} else {\n\n\t\t\treturn true; \n\t\t\t}\n\t\t}", "public static void main(String[] args) {\n Function<String, String> func = text -> text.toLowerCase().trim();\n String original = \" WIELKI NAPIS \";\n //wywołujemy funkcję przekazująć jej oryginał jako parametr\n String loweCaseTrim = func.apply(original);\n System.out.println(loweCaseTrim);\n\n }", "static boolean isValidWord(String word){\n\t\tword = word.toLowerCase();\n\t\tchar check;\n\t\tfor(int i=0; i<word.length(); i++){\n\t\t\tcheck = word.charAt(i);\n\t\t\tif((check<97 || check>122)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean isAllCaps(String name) {\r\n for (int ndx = 0; ndx < name.length(); ndx++) {\r\n char ch = name.charAt(ndx);\r\n if (ch == '_') {\r\n // OK\r\n } else if (Character.isUpperCase(ch)) {\r\n // OK\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "protected void validateFirstName(){\n Boolean firstName = Pattern.matches(\"[A-Z][a-z]{2,}\",getFirstName());\n System.out.println(nameResult(firstName));\n }", "@Test\r\n public final void rawInputNamesShouldNotHaveSpaces() {\r\n \tString actual = proc.preprocessRawInputName(\" AndThis String\");\r\n \tassertEquals(\"AndThisString\", actual);\r\n }", "public static void main(String[] args) throws IOException {\n File file = new File(\"input.txt\");\n BufferedReader buffer = new BufferedReader(new FileReader(file));\n String line;\n\n while ((line = buffer.readLine()) != null) {\n line = line.trim();\n\n char[] chars = line.toCharArray();\n boolean isSpaceAdded = false;\n\n StringBuilder sb = new StringBuilder();\n for (int i = 0, len = chars.length; i < len; i++) {\n if (Character.isLetter(chars[i])) {\n sb.append(chars[i]);\n isSpaceAdded = false;\n } else {\n if (!isSpaceAdded) {\n sb.append(\" \");\n isSpaceAdded = true;\n }\n }\n }\n System.out.println(sb.toString().trim().toLowerCase());\n }\n }", "public static void main(String[] args) {\n// System.out.println(alphanumeric.replaceAll(\"[aei]\", \"x\"));\n\n\n String regex = \"^[A-Z]|[a-z]\";\n String username = \"kaaviya\";\n\n System.out.println(username.replaceAll( \"^[A-Za-z][A-Za-z0-9_]{7,29}$\", \"x\"));\n System.out.println(username.matches(regex));\n\n }", "public static void solve() {\n\t\tint loop = in.nextInt();\r\n\t\tin.nextLine();\r\n\t\tfor(int t = 0; t < loop; t++) {\r\n\t\t\tString inputtemp = in.nextLine();\r\n\t\t\tString inputcheck = inputtemp.toLowerCase();\r\n\t\t\tString result = \"\";\r\n\t\t\tString input = \"\";\r\n\t\t\tfor(int i = 0; i < inputcheck.length(); i++) {\r\n\t\t\t\tif(Character.isLetter(inputcheck.charAt(i)) || inputcheck.charAt(i) == ' ') input +=inputcheck.charAt(i);\r\n\t\t\t}\r\n\t\t\tfor(int i = input.length() - 1; i >= 0; i--) {\r\n\t\t\t\tchar c = input.charAt(i);\r\n\t\t\t\tif(c == 'o' || c == 's' || c == 'x' || c == 'z') {\r\n\t\t\t\t\tresult+=c;\r\n\t\t\t\t} else if(c == 'a') {\r\n\t\t\t\t\tresult+='e';\r\n\t\t\t\t} else if(c == 'e') {\r\n\t\t\t\t\tresult+='a';\r\n\t\t\t\t} else if(c == 'b') {\r\n\t\t\t\t\tresult+='q';\r\n\t\t\t\t} else if(c == 'q') {\r\n\t\t\t\t\tresult+='b';\r\n\t\t\t\t} else if(c == 'd') {\r\n\t\t\t\t\tresult+='p';\r\n\t\t\t\t} else if(c == 'p') {\r\n\t\t\t\t\tresult+='d';\r\n\t\t\t\t} else if(c == 'h') {\r\n\t\t\t\t\tresult+='y';\r\n\t\t\t\t} else if(c == 'y') {\r\n\t\t\t\t\tresult+='h';\r\n\t\t\t\t} else if(c == 'm') {\r\n\t\t\t\t\tresult+='w';\r\n\t\t\t\t} else if(c == 'w') {\r\n\t\t\t\t\tresult+='m';\r\n\t\t\t\t} else if(c == 'n') {\r\n\t\t\t\t\tresult+='u';\r\n\t\t\t\t} else if(c == 'u') {\r\n\t\t\t\t\tresult+='n';\r\n\t\t\t\t} else if(Character.isAlphabetic(c)) {\r\n\t\t\t\t\tresult+=c;\r\n\t\t\t\t} else result+=\" \";\r\n\t\t\t}\r\n\t\t\tString resulttemp = \"\";\r\n\t\t\tinputtemp = \"\";\r\n\t\t\tfor(int i = 0; i < input.length(); i++) {\r\n\t\t\t\tif(input.charAt(i) != ' ') inputtemp+=input.charAt(i);\r\n\t\t\t}\r\n\t\t\tfor(int i = 0; i < result.length(); i++) {\r\n\t\t\t\tif(result.charAt(i) != ' ') resulttemp += result.charAt(i);\r\n\t\t\t}\r\n\t\t\tboolean is = false;\r\n\t\t\tif(inputtemp.equals(resulttemp)) is = true;\r\n\t\t\tif(is) System.out.println(input + \" (is) \" + result);\r\n\t\t\telse System.out.println(input + \" (not) \" + result);\r\n\t\t}\r\n\t}", "@Test\n public void testIsStringOnlyAlphabetAndWhiteSpaces() {\n System.out.println(\"isStringOnlyAlphabetAndWhiteSpaces\");\n String str = \"52374ggs\";\n boolean expResult = false;\n boolean result = ValidVariables.isStringOnlyAlphabetAndWhiteSpaces(str);\n assertEquals(expResult, result);\n }", "private String fixupCase(String s) {\r\n boolean nextIsUpper = true;\r\n StringBuffer sb = new StringBuffer();\r\n\r\n for (int i = 0; i < s.length(); i++) {\r\n char c = s.charAt(i);\r\n if (nextIsUpper) {\r\n c = Character.toUpperCase(c);\r\n } else {\r\n c = Character.toLowerCase(c);\r\n }\r\n sb.append(c);\r\n nextIsUpper = Character.isWhitespace(c);\r\n }\r\n return sb.toString();\r\n }", "protected String normalize(String text) {\r\n\t\tString normalized = text.toLowerCase();\r\n\t\treturn normalized;\r\n\t}", "@Test\n public void testIsStringOnlyAlphabetAndNumbersAndWhiteSpaces() {\n System.out.println(\"isStringOnlyAlphabetAndNumbersAndWhiteSpaces\");\n String input = \".%6gwdye\";\n boolean expResult = false;\n boolean result = ValidVariables.isStringOnlyAlphabetAndNumbersAndWhiteSpaces(input);\n assertEquals(expResult, result);\n }", "private int sanitizeCharacter(char value)\n\t{\n\t\tint returnValue = -1;\n\n\t\t// make sure only 'A' through 'Z' are acceptable.\n\t\tif (((value >= 'A') && (value <= 'Z')) || ((value >= 'a') && (value <= 'z')))\n\t\t{\n\t\t\treturnValue = Character.toUpperCase(value);\n\t\t}\n\n\t\treturn returnValue;\n\t}", "public static String sanitizeInput(String input) {\n\t\t\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor (int i = 0 ; i < input.length(); i++) {\n\t\t\tchar c = input.charAt(i);\n\t\t\tif (c >= 48 && c <= 57) {\n\t\t\t\tsb.append(c);\n\t\t\t} else if (c >= 65 && c <= 90) {\n\t\t\t\tsb.append(c);\n\t\t\t} else if (c >= 97 && c <= 122) {\n\t\t\t\tsb.append(c);\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t\t\n\t}", "@Test\n public void spacesInKeywordTest() {\n tester.correct(\"Laaa Laaa Laaaa Li\" );\n }", "private boolean noUpper(String password) {\n return !password.equals(password.toLowerCase());\n }", "public static String userInput()\r\n {\r\n Scanner link = new Scanner(System.in);\r\n String word = link.next();\r\n char[] chars = word.toCharArray();\r\n boolean checkWord = false; \r\n for(int i = 0; i < chars.length; i++)\r\n {\r\n char c = chars[i];\r\n if((c < 97 || c > 122))\r\n {\r\n checkWord = true;\r\n }\r\n }\r\n link.close();\r\n if(!checkWord)\r\n {\r\n return word;\r\n } \r\n else \r\n System.out.println(\"Not a valid input\");\r\n return null;\r\n }", "public static void main(String[] args) {\nString s = \"HElLo WoRlD WelCOMe To JaVa\";\nSystem.out.println(s.toLowerCase());\n\t}", "public static boolean isAllLower(String word) {\n \tfor(int iChar = 0; iChar < word.length(); iChar++)\n \t\tif(!Character.isLowerCase(word.charAt(iChar)))\n \t\t\treturn false;\n \t\n \treturn true;\n }", "public static String sanitize(String inputString) {\n\t\tif(inputString == null) {\n\t\t\treturn new String();\n\t\t}\n\t\treturn inputString.toLowerCase()\n\t\t\t\t.replaceAll(\"[#%&*'\\\"/\\\\+\\\\-\\\\.]\",\" \")\n\t\t\t\t.replaceAll(\"[^a-z0-9 ]\", \"\")\n\t\t\t\t.replaceAll(\"\\\\s+\",\" \").trim();\n\t}", "private static boolean equalsIgnoreCase(String inputOfCustomer) {\n\t\treturn false;\n\t}", "@Test\n\tpublic void caseNameWithEmpty() {\n\t\tString caseName = \" \";\n\t\ttry {\n\t\t\tStringNumberUtil.stringUtil(caseName);\n\t\t} catch (StringException e) {\n\t\t}\n\t}", "private String preprocessName(String original){\n\t\t// Remove non-alphabetical characters from the name\n\t\toriginal = original.replaceAll( \"[^A-Za-z]\", \"\" );\n\t\t\t\t\n\t\t// Convert to uppercase to help us ignore case-sensitivity\n\t\toriginal = original.toUpperCase();\n\t\t\n\t\t// Remove all occurences of the letters outlined in step 3\n\t\toriginal = original.substring(0,1) + original.substring(1).replaceAll(\"[AEIHOUWY]\",\"\");\n\t\t\n\t\t// Return the result\n\t\treturn original;\n\t}", "public static boolean checkAllAlphabets(String input) {\n if (input.length() < 26) {\n return false;\n }\n\n //Even a single character is missing, return false\n for (char ch = 'A'; ch <= 'Z'; ch++) {\n if (input.indexOf(ch) < 0 && input.indexOf((char) (ch + 32)) < 0) {\n return false;\n }\n }\n return true;\n }", "protected static String reduceString(String input) {\n String newString = input.toLowerCase();\n int len = newString.length();\n String retval = \"\";\n for (int i = 0; i < len; i++) {\n if (newString.charAt(i) == ' ' || newString.charAt(i) == '\\t') continue; else retval += newString.charAt(i);\n }\n return retval;\n }", "@Test //TEST FIVE\n void testSpacesAndLowercaseBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"silver fox\");\n assertTrue(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z-][a-zA-z- ]*\"));\n }", "private void checkIfRedName(TextField nameTextField, KeyEvent event) {\n\n final Tooltip tooltip = new Tooltip();\n tooltip.setText(\"Enter the name \");\n nameTextField.setTooltip(tooltip);\n\n nameTextField.textProperty().addListener((observable, oldValue, newValue) -> {\n if (!newValue.matches(\"\\\\sa-zA-Z*\")) {\n nameTextField.setText(newValue.replaceAll(\"[^\\\\sa-zA-Z]\", \"\")); // Allows only wirte a letters!\n }\n });\n\n\n }", "@Override\n\tpublic String clean(String input) {\n\t\tinput = input.replaceAll(removeCommonWords.toString(), \" \");\n\t\t//input = input.replaceAll(removeSingleCharacterOrOnlyDigits.toString(), \" \");\n\t\t//input = input.replaceAll(removeTime.toString(), \" \");\n\t\t//input = input.replaceAll(\"(\\\\s+>+\\\\s+)+\", \" \");\n\t\treturn input;\n\t}", "public static String normalizeText(String text) {\r\n if (text.equals(\"\")) {\r\n throw new IllegalArgumentException(\"Please enter some text\");\r\n } else {\r\n return text.replaceAll(\"[?.\\\\s\\\"()!]\", \"\").toUpperCase();\r\n }\r\n }", "private boolean isAlpha(char toCheck) {\n return (toCheck >= 'a' && toCheck <= 'z') ||\n (toCheck >= 'A' && toCheck <= 'Z') ||\n toCheck == '_';\n }", "private String cleanModel(String model) {\n\t\tString cleanModel = model.replaceAll(\"[$|#|@|!|%|^|&|*|(|)|]\", \"\").trim();\n\t\treturn cleanModel.substring(0,1).toUpperCase() + cleanModel.substring(1).toLowerCase();\n\t}", "private static String updateSpelling(String text) {\n\t\tStringBuilder upSpell = new StringBuilder(32);\n\t\tchar ch = ' ';\n\t\t\n\t\tfor (int i = 0; i<text.length(); i++) {\n\t\t\tif(ch == ' ' && text.charAt(i) != ' ') {\n\t\t\t\tupSpell.append(Character.toUpperCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}else if(Character.isLetter(text.charAt(i))) {\n\t\t\t\tupSpell.append(Character.toLowerCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}\n\t\t\t// if anything other type of input is added besides letters.\n\t\t\telse {\n\t\t\t\tupSpell.append(text.charAt(i));\n\t\t\t}\n\t\t\t//This will keep track of previous characters inputed.\n\t\t\tch = text.charAt(i);\t\t\t\n\t\t\t\n\t\t}\n\t\treturn upSpell.toString(); \n\t\t\n\t}", "public String nameValidate() {\r\n String regex = \"[a-zA-Z]{1,10}\";\r\n\r\n // create user input\r\n Scanner scanner = new Scanner(System.in);\r\n\r\n while (true) {\r\n System.out.print(\"Enter the name: \");\r\n String input = scanner.nextLine();\r\n // check if user enter a string between 1-10\r\n if (input.matches(regex)) {\r\n return input;\r\n } else {\r\n System.out.println(\"Please enter a correct name, name's length should between 1 and 10.\");\r\n }\r\n }\r\n\r\n }", "private static String cup(String str) {\n\t\treturn str.substring(0,1).toLowerCase() + str.substring(1); \n\t}", "@Test\r\n\tpublic void testNameValid() {\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"JANE\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"John\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"Mary\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\" Kurisu\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"Bond \"));\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 static String checkUsername(String in) {\n\t\tif (in.isEmpty())\r\n\t\t\treturn \"Username is empty\";\r\n\t\telse {\r\n\t\t\tPattern passPat = Pattern.compile(\"\\\\w*\");\r\n\t\t\tMatcher matchpass = passPat.matcher(in);\r\n\t\t\tif (!matchpass.matches()) {\r\n\t\t\t\treturn \"The username must only contain character and numeric\";\r\n\t\t\t} else\r\n\t\t\t\treturn null;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n String S1=\"THE QUICK BROWN FOR JUMPS OVER THE LAZY DOG.\";//convert into lowercase\n String result = S1.toLowerCase();//formula to convert\n System.out.println(result);//print the outcome\n }", "public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\r\n\t\tchar a=sc.next().charAt(0);\r\n\t\t\r\n\t\tif(Character.isLowerCase(a))\r\n\t\t{\r\n\t\t\tSystem.out.println(Character.toUpperCase(a));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(Character.toLowerCase(a));\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t// Positive test case\n\t\tString strTest = \"I am done with this code.\";\n\t\tSystem.out.println(\"Validating positve scenario : \" + Process(strTest));\n\n\t\t// More than one space between 2 words\n\t\tstrTest = \" aaaaabbbbbb Sharma\";\n\t\tSystem.out.println(\"Validating string it has more than one space between 2 words : \" + Process(strTest));\n\n\t\t// when sting is null\n\t\tstrTest = null;\n\t\tSystem.out.println(\"Validating Null String: \" + Process(strTest));\n\n\t\t// single word string\n\t\tstrTest = \"Saurabh \";\n\t\tSystem.out.println(\"Validating single word string: \" + Process(strTest));\n\n\t}", "public void correctStrings() {\n this.content = StringUtils.correctWhiteSpaces(content);\n }", "boolean checkName (String name){\r\n \r\n // Use for loop to check each character\r\n for (int i = 0; i < name.length(); i++) {\r\n // If character is below 'A' in Unicode table then return false\r\n if (name.charAt(i) < 65 && name.charAt(i) != 32 && name.charAt(i) != 10){\r\n return false;\r\n }\r\n // Else if character is between 'Z' and 'a' in unicode table,\r\n // then return false\r\n else if (name.charAt(i) > 90 && name.charAt(i) < 97){\r\n return false;\r\n }\r\n else if (name.charAt(i) > 122)\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean check (String s){\n\n boolean value = false;\n\n if (s.length()>=3){\n\n for (int i= 0;i<s.length();i++){\n\n if (s.charAt(i)>= 'A' && s.charAt(i)<= 'Z' || s.charAt(i) >='a' &&s.charAt(i)<='z'){\n\n value = true;\n }\n else {\n value = false;\n return value;\n\n\n }\n }\n }\n\n\n return value;\n }", "private static char normalize(char input) {\n if (input == ' ') {\n return input;\n }\n\n if (input < 'a') {\n return 'a';\n }\n if (input > 'z') {\n return 'z';\n }\n\n return input;\n }", "@Test\n\tpublic void inputVoucher_is_alphanumeric(){\n\t\tString pattern = \"^[a-zA-Z0-9]*$\";\n\t\tvoucher.getInputVoucher().sendKeys(\"aaa aaaa 123\");\n\t\tSystem.out.println(voucher.getInputVoucher().getText().matches(pattern));\n\t\tAssert.assertEquals(voucher.getInputVoucher().getText().matches(pattern), true, \"input voucher code tidak alphanumeric\");\n\t}", "public boolean validWord(String input){\n\t\t//if it is a valid word, return true\n\t\tif(input.matches(\"[a-zA-Z]+\") && input.length()>1){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean hasUnwantedChar(String name, String field) {\r\n\t\tboolean unwantedCharacter = false;\r\n\t\tchar checkName[] = name.toCharArray();\r\n\t\tif(field == \"names\") {\r\n\t\t\tint find = 0;\r\n\t\t\twhile(find < checkName.length) {\r\n\t\t\t\tswitch(checkName[find]) {\r\n\t\t\t\tcase 'A':case 'a':case 'B':case 'b':case 'C':case 'c':case 'D':case 'd':case 'E':case 'e':case 'F':case 'f':case 'G':case 'g':\r\n\t\t\t\tcase 'H':case 'h':case 'I':case 'i':case 'J':case 'j':case 'K':case 'k':case 'L':case 'l':case 'M':case 'm':case 'N':case 'n':\r\n\t\t\t\tcase 'O':case 'o':case 'P':case 'p':case 'Q':case 'q':case 'R':case 'r':case 'S':case 's':case 'T':case 't':case 'U':case 'u':\r\n\t\t\t\tcase 'V':case 'v':case 'W':case 'w':case 'X':case 'x':case 'Y':case 'y':case 'Z':case 'z':\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tunwantedCharacter = true;\r\n\t\t\t\t}\r\n\t\t\t\tif(unwantedCharacter == true)\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t++find;\r\n\t\t\t}\t\r\n\t\t}else if(field == \"password & physical address\") {\r\n\t\t\tint find = 0;\r\n\t\t\twhile(find < checkName.length) {\r\n\t\t\t\tswitch(checkName[find]) {\r\n\t\t\t\tcase 'A':case 'a':case 'B':case 'b':case 'C':case 'c':case 'D':case 'd':case 'E':case 'e':case 'F':case 'f':case 'G':case 'g':\r\n\t\t\t\tcase 'H':case 'h':case 'I':case 'i':case 'J':case 'j':case 'K':case 'k':case 'L':case 'l':case 'M':case 'm':case 'N':case 'n':\r\n\t\t\t\tcase 'O':case 'o':case 'P':case 'p':case 'Q':case 'q':case 'R':case 'r':case 'S':case 's':case 'T':case 't':case 'U':case 'u':\r\n\t\t\t\tcase 'V':case 'v':case 'W':case 'w':case 'X':case 'x':case 'Y':case 'y':case 'Z':case 'z':\t\r\n\t\t\t\tcase '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8':case '9':case '0':case ' ':case '-':\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\t\r\n\t\t\t\t\tunwantedCharacter = true;\r\n\t\t\t\t}\r\n\t\t\t\tif(unwantedCharacter == true)\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t++find;\r\n\t\t\t}\t\r\n\t\t}else if(field == \"email\") {\r\n\t\t\tint find = 0;\r\n\t\t\twhile(find < checkName.length) {\r\n\t\t\t\tswitch(checkName[find]) {\r\n\t\t\t\tcase 'A':case 'a':case 'B':case 'b':case 'C':case 'c':case 'D':case 'd':case 'E':case 'e':case 'F':case 'f':case 'G':case 'g':\r\n\t\t\t\tcase 'H':case 'h':case 'I':case 'i':case 'J':case 'j':case 'K':case 'k':case 'L':case 'l':case 'M':case 'm':case 'N':case 'n':\r\n\t\t\t\tcase 'O':case 'o':case 'P':case 'p':case 'Q':case 'q':case 'R':case 'r':case 'S':case 's':case 'T':case 't':case 'U':case 'u':\r\n\t\t\t\tcase 'V':case 'v':case 'W':case 'w':case 'X':case 'x':case 'Y':case 'y':case 'Z':case 'z':\t\r\n\t\t\t\tcase '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8':case '9':case '0':case '@':case '.':\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tunwantedCharacter = true;\r\n\t\t\t\t}\r\n\t\t\t\tif(unwantedCharacter == true)\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t++find;\r\n\t\t\t}\r\n\t\t}else if(field == \"mobileNumber\") {\r\n\t\t\tint find = 0;\r\n\t\t\twhile(find < checkName.length) {\r\n\t\t\t\tswitch(checkName[find]) {\r\n\t\t\t\tcase '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8':case '9':case '0':case ' ':\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tunwantedCharacter = true;\r\n\t\t\t\t}\r\n\t\t\t\tif(unwantedCharacter == true)\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t++find;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn unwantedCharacter;\r\n\t}", "private boolean isAllLetters(String text) {\n for ( int i = 0; i < text.length(); i++){\n if(!(Character.isAlphabetic(text.charAt(i)) || text.charAt(i) == ' '))\n {\n return false;\n }\n }\n return true;\n }", "private static boolean isValidWord(String s) {\r\n\t\tString valid = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-'\";\r\n\t\tfor (int i = 0; i < s.length(); i++) {\r\n\t\t\tif (valid.indexOf(s.charAt(i)) < 0) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\r\n\t}", "public static boolean check(String s)\n {\n if (s.length() < 0 || s.length() > 10)\n {\n return true;\n }\n for (int i = 0 ; i < s.length(); i++)\n {\n if ((s.charAt(i) < 'a' || s.charAt(i) > 'z') && \n (s.charAt(i) < 'A' || s.charAt(i) > 'Z') && \n (s.charAt(i) < '0' || s.charAt(i) > '9'))\n {\n return true;\n }\n }\n return false;\n }", "public boolean canRecover(String input) {\n if(encode(input) != -1) return true;\n for(int i=0; i<input.length(); i++) {\n if(Character.isLowerCase(input.charAt(i))) {\n String next = input.substring(0, i) + Character.toUpperCase(input.charAt(i)) + input.substring(i+1);\n if(canRecover(next)) return true;\n }\n }\n return false;\n }", "@Test\r\n\tpublic void testIsValidPasswordNoLowerAlpha()\r\n\t{\r\n\t\ttry{\r\n\t\t\tassertTrue(PasswordCheckerUtility.isValidPassword(\"RAINBOW\"));\r\n\t\t}\r\n\t\tcatch(NoLowerAlphaException e)\r\n\t\t{\r\n\t\t\tassertTrue(\"Successfully threw a NoLowerAlphaExcepetion\",true);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n System.out.println(\"1. \" + StringTools.isAlpha(\"Happy\"));\n System.out.println(\"2. \" + StringTools.isAlpha(\"Happy-Happy\"));\n System.out.println(\"3. \" + StringTools.isAlpha(\"Happy-Happy\", '-'));\n System.out.println(\"\");\n System.out.println(\"1. \" + StringTools.isNumeric(\"09368955866\"));\n System.out.println(\"2. \" + StringTools.isNumeric(\"0936-895-5866\"));\n System.out.println(\"3. \" + StringTools.isNumeric(\"0936/895/5866\", '/'));\n System.out.println(\"\");\n System.out.println(\"1. \" + StringTools.isAlpha(\"HappyDay\"));\n System.out.println(\"2. \" + StringTools.isAlpha(\"#Happy-Day\"));\n System.out.println(\"3. \" + StringTools.isAlpha(\"Happy-Happy\", '#', '-'));\n // alpha space\n System.out.println(\"1. \" + StringTools.isAlpha(\"asd\", ' '));\n }", "private String validateAndGetLowerCaseKey(String key) {\n Strings.requireNonNullAndNotEmpty(key);\n return key.toLowerCase(Locale.ROOT);\n }", "public boolean Check(String InputString)\r\n\t{\r\n \tStringtoCheck = InputString;\r\n \tString patternStr = \"[^a-zA-Z]\";\r\n \tString replacementStr = \"\";\r\n \t\r\n\t\t\t//Creates a regular expression pattern.\r\n \tPattern pattern = Pattern.compile(patternStr);\r\n \t\r\n \tMatcher matcher = pattern.matcher(StringtoCheck);\r\n\t\t\t\r\n\t\t\t//Strips the string of any non alphabetic characters.\r\n \tString output = matcher.replaceAll(replacementStr);\r\n\t\t\t\r\n\t\t\t//Creates a new reverse object.\r\n \treverse inverseString = new reverse();\r\n\t\t\t\r\n \t//Compares the two strings.\r\n \tif (output.equalsIgnoreCase(inverseString.reversestr(output)))\r\n \t{\r\n \t\t\treturn true;\r\n \t}\r\n \telse\r\n \t{\r\n \t\t\treturn false;\r\n \t}\r\n\t\t\t\r\n\t\r\n\t\t\t\r\n\t}", "public static void isValidNameOnCreditCard(String userInput) {\n\t\tif (!userInput.matches(\"^(?!.* )[a-zA-Z ]+$\")) {\n\t\t\tthrow new IllegalArgumentException(\"You must enter your name as it appears on the card. Please try again:\");\n\t\t}\n\t}", "private String validateWord (String word) {\r\n String chars = \"\";\r\n for (int i = 0; i < word.length (); ++i) {\r\n if (!Character.isLetter (word.charAt (i))) {\r\n chars += \"\\\"\" + word.charAt (i) + \"\\\" \";\r\n }\r\n }\r\n return chars;\r\n }", "@Test\n\tpublic void caseNameWithWrongLength() {\n\t\tString caseName = \"le\";\n\t\ttry {\n\t\t\tCaseManagerValidator.isCharAllowed(caseName);\n\t\t\tfail();\n\t\t} catch (ValidationException e) {\n\t\t}\n\t}", "private boolean isValidName(String name)\n {\n String reg = \"^[a-zA-Z]+$\";\n return name.matches(reg);\n }", "public abstract boolean containsUppercaseLetters(String str);", "private boolean preTest(String str) {\n\t\treturn str.matches(\"^[\\\"A-Z][\\u0000-\\u0080]+$\");\n\t}", "private boolean isLowerCase(final String message) {\n\t\treturn message.contains(\"variable should be in lower case\"); //$NON-NLS-1$\n\t}", "public static void main(String args[]) {\n\t\tScanner in = new Scanner(System.in);\n\t\tString str = in.nextLine();\n\t\tboolean flag = false;\n\t\tstr = str.toLowerCase();\n\t\tfor (char ch = 'a'; ch <= 'z'; ch++) {\n\t\t\tflag = false;\n\t\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\t\tif (str.charAt(i) == ch) {\n\t\t\t\t\tflag = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (false == flag) {\n\t\t\t\tSystem.out.print(ch+\" \");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\t\tValidationStratagy LowerCaseValidatoin=(s)->s.matches(\"[a-z]+\");\n\t\t//Providing validation stratigy for nueric comparison\n\t\tValidationStratagy numericValidation=(s->s.matches(\"\\\\d+\"));\n\t\tSystem.out.println(LowerCaseValidatoin.execute(\"abcd\"));\n\t\tSystem.out.println(LowerCaseValidatoin.execute(\"1234\"));\n\t\tSystem.out.println(numericValidation.execute(\"1234\"));\n\t\tSystem.out.println(numericValidation.execute(\"abcd\"));\n\t}", "public static boolean checkOccurrence(String toCheck) {\n if (!toCheck.equals(\"\")) {\n String firstChar = \"\" + toCheck.charAt(0);\n return firstChar.matches(\".*[A-Z].*\");\n }\n return false;\n }", "private static void readInput() { input = sc.nextLine().toLowerCase().toCharArray(); }", "private boolean isValidCI(String text){\n Boolean validation = true;\n int lenght = text.length();\n char lastCharacter = text.charAt(lenght-1);\n if(Character.isDigit(lastCharacter) || Character.isAlphabetic(lastCharacter)){\n for(int i=0;i<lenght-1;i++){\n char ch = text.charAt(i);\n if(!Character.isDigit(ch)){\n validation = false;\n break;\n }\n }\n }\n else{\n validation = false;\n }\n if(isOnlySpaces(text)){\n validation = false;\n }\n return validation;\n }", "public static boolean isValidWord(String word) {\n\t\t\n\t\t// Creating char array\n\t\tString wordIn = word.toLowerCase();\n\t\tchar[] wordChars = wordIn.toCharArray();\n\t\t\n\t\t// If any of the characters are alphabetic return true\n\t\tfor( char c : wordChars ) {\n\t\t\tif( Character.isAlphabetic(c) == false ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean hasLower(){\n return (alg.hasLower(input.getText().toString()));\n }", "boolean checkchars(String str,String validchars, boolean casesensitive) {\n\n // If not case sensitive then convert both value and valid\n // characters to upper case\n if (casesensitive) {\n str.toUpperCase();\n validchars.toUpperCase();\n }\n\n // Go through each character in value until either end or hit an invalid char\n int charposn=0;\n while ((charposn<str.length())&&(validchars.indexOf(str.charAt(charposn))!=-1)) {\n charposn++;\n }\n\n // Check if stop was due to end of input string or invalid char and set return code\n // accordingly\n if (charposn==str.length())\n return(true);\n else\n return(false);\n }", "public boolean nameValidation(String name) {\n\t char[] chars = name.toCharArray();\n\t int tempNum = 0;\n\t for (char c : chars) {\n\t tempNum += 1;\n\t \tif(!Character.isLetter(c)) {\n\t return false;\n\t }\n\t }\n\t if (tempNum == 0)\n\t \treturn false;\n\n\t return true;\n\t}", "public static boolean hasLowerAlpha(String password) throws NoLowerAlphaException\r\n {\r\n Pattern pattern = Pattern.compile(\".*[a-z].*\");\r\n Matcher matcher = pattern.matcher(password);\r\n if (!matcher.matches())\r\n throw new NoLowerAlphaException();\r\n return true;\r\n }", "@Test\n void returnsTrueIfOnlyLetters() {\n Assertions.assertTrue(new UserValidator().isValidUsername(null));\n }", "public String getData() {\r\n Scanner sc = new Scanner(System.in);\r\n String s = sc.nextLine();\r\n while ((s.startsWith(\"\") && s.endsWith(\" \")) || (s.length() == 0) || (s.startsWith(\" \"))) {\r\n System.out.print(\"A space record, or a space at the beginning is not acceptable. \\n\"\r\n + \"Please try again: \");\r\n s = sc.nextLine();\r\n }\r\n return s;\r\n }", "static public boolean validateName(String proposedName, boolean allowSpace)\n {\n Pattern p;\n if (allowSpace)\n p = Pattern.compile(\"[A-Z][A-Z0-9_. -]*\", Pattern.CASE_INSENSITIVE);\n else\n p = Pattern.compile(\"[A-Z][A-Z0-9_.-]*\", Pattern.CASE_INSENSITIVE);\n \n return (p.matcher(proposedName).matches());\n\n }", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\r\n\r\n System.out.println(\"Please enter a String\");\r\n String input = sc.nextLine();\r\n\r\n if (isUnique(input)) {\r\n System.out.println(\"All characters of String are unique\");\r\n } else {\r\n System.out.println(\"All characters of String are not unique\");\r\n }\r\n\r\n sc.close();\r\n}", "@Test\n\tpublic void testRemoveWhiteSpacesAndPunctuation() {\n\t\tString input = \"2$2?5 5!63\";\n\t\tString actual = GeneralUtility.removeWhiteSpacesAndPunctuation(input);\n\t\tString expected = \"225563\";\n\t\tAssert.assertEquals(expected, actual);\n\t}", "protected static String sanitise(final String name) {\n // Replace illegal chars with\n return name.replaceAll(\"[^\\\\w\\\\.\\\\s\\\\-#&_]\", \"_\");\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter the String:\");\r\n\t\tString word=sc.next();\r\n\t\tchar ch[]=word.toCharArray();\r\n\t\t\r\n\t\tfor(int i=0;i<word.length();i++)\r\n\t\t{\r\n\t\t\tif(ch[i]=='a'||ch[i]=='e'||ch[i]=='i'||ch[i]=='o'||ch[i]=='u')\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"remove vowels is:\"+ch[i]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\r\n\r\n\t}", "private static boolean nameIsValid(String name) {\n if (name.length() < 4 || name.length() > 11)\n return false;\n\n for (int i = 0; i < name.length(); i++) {\n int charIndex = name.charAt(i);\n\n // Each character can only be a letter or number\n if (charIndex < 48 || (charIndex > 57 && charIndex < 65) || (charIndex > 90 && charIndex < 97) || charIndex > 122)\n return false;\n }\n\n return true;\n }", "public boolean validarEntradaLetra(String letra) {\n\n\t\tPattern p = Pattern.compile(\"[a-zA-Z]{1,1}\");\n\n\t\tMatcher m = p.matcher(letra);\n\n\t\tif (m.matches() == false) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Letra inválida, favor insira uma letra válida!\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String input = sc.next();\n \n // count number of upper case chars\n int upperCaseCount = 0;\n \n for(int i = 0; i < input.length(); i++)\n \tif(Character.isUpperCase(input.charAt(i))) upperCaseCount ++;\n \n // return answer\n if(upperCaseCount > input.length() / 2) {\n \tSystem.out.print(input.toUpperCase());\n } else {\n \tSystem.out.println(input.toLowerCase());\n } \n\t}", "public static void main(String[] args) {\nScanner scan = new Scanner(System.in);\n\nString name = \"Batyr\";\n\n\n// 1. length();\n\n\nSystem.out.println(name.length());\n\n// 2. toUpperCase();\n\n\nSystem.out.println(name.toUpperCase());\n\n// 3. toLoweCase();\n\n\nSystem.out.println(name.toLowerCase());\n\n// 4. charAt(index);\n\nSystem.out.println(name.charAt(0));\nSystem.out.println(name.charAt(1));\nSystem.out.println(name.charAt(2));\nSystem.out.println(name.charAt(3));\nSystem.out.println(name.charAt(4));\n\n// 4. ******OR*****\n\nchar c1= name.charAt(0);\nchar c2= name.charAt(1);\nchar c3= name.charAt(2);\nchar c4= name.charAt(3);\nchar c5= name.charAt(4);\n\nSystem.out.println(c1);\nSystem.out.println(c2);\nSystem.out.println(c3);\nSystem.out.println(c4);\nSystem.out.println(c5);\n\n// 5. str.equal(\"value\")\n\nSystem.out.println(name.equals(\"Batyr\"));\nSystem.out.println(name.equalsIgnoreCase(\"Batyr\"));\n\n// 6. contains\n\nSystem.out.println(name.contains(\"at\"));\n\n// 6. ******OR******\n\nboolean containsOrNot = name.contains(\"at\");\n\nSystem.out.println(containsOrNot);\n\n// 7. indexOf\n\nSystem.out.println(name.indexOf(\"a\"));\n\n// will show you the first letter's index only\n\nSystem.out.println(name.indexOf(\"ty\"));\n\n//will show -1 when the char which entered is abcent\n\nSystem.out.println(name.indexOf(\"wty\"));\n\nString uName=name.toUpperCase();\n\nSystem.out.println(uName.indexOf(\"BATYR\"));\n\nSystem.out.println(name.toUpperCase().indexOf(\"BA\"));\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nscan.close();\n\t}" ]
[ "0.70145327", "0.70145327", "0.70145327", "0.68506545", "0.6669563", "0.6641871", "0.6614577", "0.6612342", "0.6514195", "0.64922047", "0.6463211", "0.6429553", "0.6334732", "0.6296547", "0.6295171", "0.62859166", "0.62413925", "0.62074816", "0.62066275", "0.6199968", "0.6192179", "0.61558634", "0.6137481", "0.61360675", "0.610978", "0.6105588", "0.61012524", "0.60962296", "0.60689026", "0.60278946", "0.6020192", "0.6018076", "0.6011517", "0.60087836", "0.60046804", "0.5996102", "0.59941244", "0.5979089", "0.59711343", "0.59707034", "0.5969459", "0.59692717", "0.5959168", "0.59387624", "0.593645", "0.5932863", "0.5927758", "0.5926242", "0.59257174", "0.5916921", "0.59089893", "0.59082615", "0.58770466", "0.5876584", "0.58763653", "0.5872594", "0.58687913", "0.5867288", "0.5862043", "0.5861587", "0.58602583", "0.58546203", "0.584184", "0.5841117", "0.58364034", "0.583208", "0.5804321", "0.5801836", "0.5796388", "0.5796068", "0.57933444", "0.5785782", "0.57853836", "0.5780786", "0.57717425", "0.5760433", "0.5752481", "0.57380277", "0.5733267", "0.57309157", "0.57303625", "0.57250166", "0.57182914", "0.5716423", "0.5705169", "0.57044125", "0.5699663", "0.569408", "0.5688188", "0.56870073", "0.56852245", "0.56852174", "0.5681266", "0.5680909", "0.567546", "0.5675334", "0.56717557", "0.5669525", "0.5658783", "0.56554276", "0.5654497" ]
0.0
-1
/ The algorithm for checking each sequence is very simple. Each time one of the three possible opening brackets is found they are pushed into the stack. when an closing bracket is found it peeks at the stack top and if the closing bracket matches the opening bracket then the stack pops the top and continues; if it doesn't then the sequence is not properly formatted. at the end of the loop the stack should be empty if the sequence is correctly formatted.
public static boolean check(char[] expression){ Stack stack = new Stack(); for(int i =0; i < expression.length; i++){ if(expression[i] == '(' || expression[i] == '{' || expression[i] == '['){ stack.push(expression[i]); } if(expression[i] == ')' || expression[i] == '}' || expression[i] == ']'){ if(stack.isEmpty()){ return false; } if((expression[i] == ')' && stack.peek() == '(') || (expression[i] == '}' && stack.peek() == '{') || (expression[i] == ']' && stack.peek() == '[')){ stack.pop(); }else{ return false; } } } return stack.isEmpty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n String s=\"[()]{}{[()()]()}\";\n char s1[]=s.toCharArray();\n Stack<Character> a=new Stack<>();\n \n for (int i = 0; i < s.length(); i++) {\n \t char x=s.charAt(i);\n// \t if(a.isEmpty()) {\n// \t\t a.push(x);\n// \t }\n \t \n\t\tif(x=='{'||x=='['||x=='('){\n\t\t\ta.push(x);\n\t\t}\n\t\telse if(x=='}'||x==']'||x==')'&& !a.isEmpty()) {\n//\t\t\tif(a.peek()=='}'||a.peek()==']'||a.peek()==')')\n\t\t\ta.pop();\n\t\t}\n\t}\n System.out.println(a.toString());\n if(a.isEmpty()) {\n \t System.out.println(\"balanced\");\n }\n else\n {\n \t System.out.println(\"Unbalanced\"); \t \n }\n\t}", "static boolean areParanthesisBalanced(String str) \r\n\t\t{ \r\n\t\t\t// Using ArrayDeque is faster than using Stack class \r\n\t\t\tDeque<Character> stack = new ArrayDeque<Character>(); \r\n\t\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\tchar ch = str.charAt(i);\r\n\t\t\tif (ch == '[' || ch == '(' || ch == '{') {\r\n\t\t\t\tstack.push(ch);\r\n\t\t\t} else if ((ch == ']' || ch == '}' || ch == ')')\r\n\t\t\t\t\t&& (!stack.isEmpty())) {\r\n\t\t\t\tif (((char) stack.peek() == '(' && ch == ')')\r\n\t\t\t\t\t\t|| ((char) stack.peek() == '{' && ch == '}')\r\n\t\t\t\t\t\t|| ((char) stack.peek() == '[' && ch == ']')) {\r\n\t\t\t\t\tstack.pop();\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ((ch == ']' || ch == '}' || ch == ')')) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t\t}\r\n\t\t\treturn (stack.isEmpty());\r\n\t\t\t}", "public boolean validateStackSequences_stack(int[] pushed, int[] popped) {\n Stack<Integer> stack = new Stack<>();\n int i = 0;\n for (int x : pushed) {\n stack.push(x);\n while (!stack.empty() && stack.peek() == popped[i]) {\n stack.pop();\n i++;\n }\n }\n return stack.empty();\n }", "public boolean validateStackSequences(int[] pushed, int[] popped) \n {\n if (pushed == null || pushed.length == 0)\n {\n return (popped == null || popped.length == 0);\n }\n else if (pushed.length != popped.length)\n {\n return false;\n }\n \n Stack<Integer> stack = new Stack<>();\n int size = pushed.length;\n int index1 = 0, index2 = 0;\n \n while (index2 < size && index1 < size)\n {\n if (pushed[index1] != popped[index2])\n {\n if (!stack.isEmpty() && popped[index2] == stack.peek())\n {\n stack.pop();\n index2++;\n }\n else\n {\n stack.push(pushed[index1]);\n index1++;\n }\n }\n else\n {\n index1++;\n index2++;\n }\n }\n \n while (index2 < size && !stack.isEmpty())\n {\n if (popped[index2++] != stack.pop())\n {\n return false;\n }\n }\n \n return index2 == size && stack.isEmpty();\n }", "private static boolean Question5(String s) {\n\t\t// take a empty stack of characters\n\t\tStack<Character> st = new Stack<Character>();\n\t\t\n\t\t// traverse the input expression\n\t\tfor(int i=0, n = s.length(); i<n ; i++) {\n\t\t\t\n\t\t\tchar curr = s.charAt(i);\n\t\t\t\n\t\t\t// if current char in the expression is a opening brace,\n\t\t\t// push it to the stack\n\t\t\tif(curr == '(' || curr == '{' || curr == '[' ) {\n\t\t\t\tst.push(curr);\n\t\t\t}\t\t\t\n\t\t\telse { // Its } or ) or ]\n\t\t\t\t\n\t\t\t\t// return false if mismatch is found (i.e. if stack is\n\t\t\t\t// empty, the number of opening braces is less than number\n\t\t\t\t// of closing brace, so expression cannot be balanced)\n\t\t\t\tif(st.isEmpty())\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\t// pop character from the stack\n\t\t\t\tchar top = st.pop();\n\t\t\t\tif( top == '(' && curr != ')' ||\n\t\t\t\t\ttop == '[' && curr != ']' ||\n\t\t\t\t\ttop == '{' && curr != '}' )\n\t\t\t\t\treturn false;\t\t\t\n\t\t\t}\n\t\t}\n\t\t// expression is balanced only if stack is empty at this point\n\t\treturn st.isEmpty();\n\t}", "static boolean checkingBalanceBrackets(String brac) {\r\n\t\t\r\n\t\tStack <Character> inputString = new Stack<Character>();\r\n\t\t\r\n\t\tfor(int i=0;i<brac.length();i++) {\r\n\t\t\tchar bracChar = brac.charAt(i);\r\n\t\t\tif(bracChar == '(' || bracChar == '{' || bracChar == '[') {\r\n\t\t\t\tinputString.push(bracChar);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\t\r\n\t\t\tif(inputString.isEmpty()) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t//Check if we had inputed closing braces and start check for matching Open braces\r\n\t\t\tchar localChar;\r\n\t\t\tswitch(bracChar) \r\n\t\t\t{\r\n\t\t\t\tcase')' :\r\n\t\t\t\t{\r\n\t\t\t\t\tlocalChar = inputString.pop();\r\n\t\t\t\t\tif(localChar == '{' || localChar == '[') {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t\t}\r\n\t\t\t\tcase '}' :\r\n\t\t\t\t{\r\n\t\t\t\t\tlocalChar = inputString.pop();\r\n\t\t\t\t\tif(localChar == '(' || localChar == '[') \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak; \r\n\t\t\t\t}\r\n\t\t\t\tcase ']' :\r\n\t\t\t\t{\r\n\t\t\t\t\tlocalChar = inputString.pop();\r\n\t\t\t\t\tif(localChar == '(' || localChar == '{') \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak; \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t\r\n\t\treturn (inputString.isEmpty());\r\n\t}", "private static boolean balancedBrackets(String str) {\n String openingBrackets = \"({[\";\n String closingBrackets = \")}]\";\n HashMap<Character, Character> matchingBrackets = new HashMap<>();\n matchingBrackets.put(')', '(');\n matchingBrackets.put('}', '{');\n matchingBrackets.put(']', '[');\n Stack<Character> stack = new Stack<>();\n for (int i = 0; i < str.length(); i++) {\n char c = str.charAt(i);\n if (openingBrackets.indexOf(c) != -1) {\n stack.push(c);\n } else if (closingBrackets.indexOf(c) != -1) {\n if (stack.isEmpty()) return false;\n if (stack.pop() != matchingBrackets.get(c)) return false;\n }\n }\n return stack.isEmpty();\n }", "public void start(){\n try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {\n System.out.println(\"Input N of open/close brackets:\");\n while (true){\n String s = reader.readLine();\n if (s.matches(\"^\\\\d+$\")){\n N = Integer.parseInt(s);\n break;\n }\n else\n System.out.println(\"Wrong data! Try to again.\");\n }\n } catch (IOException e){\n e.printStackTrace();\n }\n\n if (N <= 0){\n System.out.println(\"N must be a non-negative integer\");\n System.exit(1);\n } else {\n /*\n * Replaces the position of open and closed brackets\n */\n while (count < N) {\n for (String symbol : currentList) {\n for (int i = 0; i < symbol.length(); i++) {\n temp = symbol.substring(0, i) + \"()\" + symbol.substring(i);\n\n if (tempList.contains(temp)) //Check for temp in tempList, if any, skip iteration.\n continue;\n\n tempList.add(temp); //add temp to tempList\n }\n }\n // Setting before next loop\n currentList = tempList;\n tempList = new ArrayList<>(); // create empty tempList\n count++;\n }\n\n currentList.forEach(System.out::println); //Shows bracket options\n }\n }", "private void emptyBracket() {\n\n\t\twhile (!stack.peek().matches(\"[(]\")) {\n\t\t\tqueue.add(stack.pop());\n\t\t}\n\t\t// Remove opening bracket from the stack.\n\t\tstack.pop();\n\t}", "private static boolean checkParanthesesIfBalanced(String input) throws Exception {\r\n\t\tStack<Character> stack = new Stack<>();\r\n\t\tchar[] charArray = input.toCharArray();\r\n\t\tfor (char c : charArray) {\r\n\t\t\tif (checkIfCharIsOpenParantheses(c)) {\r\n\t\t\t\tstack.push(c);\r\n\t\t\t} else {\r\n\t\t\t\tif (stack.isEmpty()) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t} else if (!isMatchingPair(stack.pop(), c)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn stack.isEmpty();\r\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\twhile(sc.hasNext()){\r\n\t\t\tString str = sc.nextLine();\r\n\t\t\tStack<String> digit = new Stack<>();\r\n\t\t\tStringBuffer buffer = new StringBuffer();\r\n\t\t\tchar ch;\r\n\t\t\tboolean isHasOperator = false;\r\n\t\t\tboolean isLegal = true;\r\n\t\t\tint len = str.length();\r\n\t\t\tint i = 0;\r\n\t\t\twhile(i<len){\r\n\t\t\t\tch = str.charAt(i);\r\n\t\t\t\tswitch (ch) {\r\n\t\t\t\tcase '[':\r\n\t\t\t\tcase '{':\r\n\t\t\t\tcase '(':\r\n\t\t\t\tcase '+':\r\n\t\t\t\tcase '-':\r\n\t\t\t\tcase '*':\r\n\t\t\t\tcase '/':\r\n\t\t\t\t\tdigit.push(ch+\"\");\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase ']':\r\n\t\t\t\tcase '}':\r\n\t\t\t\tcase ')':\r\n\t\t\t\t\tString second = null;\r\n\t\t\t\t\twhile(digit.size()>1){\r\n\t\t\t\t\t\t//!digit.peek().equals(\"{\")&&!digit.peek().equals(\"[\")&&!digit.peek().equals(\"(\")\r\n\t\t\t\t\t\tif(!digit.peek().equals(\"{\")&&!digit.peek().equals(\"[\")&&!digit.peek().equals(\"(\")&&!digit.peek().equals(\")\")\r\n\t\t\t\t\t\t\t\t&&!digit.peek().equals(\"]\")&&!digit.peek().equals(\"}\")&&!digit.peek().equals(\"+\")&&!digit.peek().equals(\"-\")&&!digit.peek().equals(\"*\")&&!digit.peek().equals(\"/\")){\r\n\t\t\t\t\t\t\tsecond = digit.pop();\r\n\t\t\t\t\t\t\tif (digit.size()>0&&(digit.peek().equals(\"+\")||digit.peek().equals(\"-\")||digit.peek().equals(\"*\")||digit.peek().equals(\"/\"))) {\r\n\t\t\t\t\t\t\t\tisHasOperator = true;\r\n\t\t\t\t\t\t\t\tdigit.pop();\r\n\t\t\t\t\t\t\t\tif (digit.size()>0) {\r\n\t\t\t\t\t\t\t\t\tsecond = digit.pop();\r\n\t\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\t\tisLegal = false;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tisLegal = false;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tString first = digit.pop();\r\n\t\t\t\t\t\tif (digit.size()>0&&!digit.peek().equals(\"{\")&&!digit.peek().equals(\"[\")&&!digit.peek().equals(\"(\")) {\r\n\t\t\t\t\t\t\tif (digit.peek().equals(\"+\")||digit.peek().equals(\"-\")||digit.peek().equals(\"*\")||digit.peek().equals(\"/\")) {\r\n\t\t\t\t\t\t\t\tisHasOperator = true;\r\n\t\t\t\t\t\t\t\tdigit.pop();\r\n\t\t\t\t\t\t\t\tif (isHasOperator&&!digit.peek().equals(\"{\")&&!digit.peek().equals(\"[\")&&!digit.peek().equals(\"(\")&&!digit.peek().equals(\")\")\r\n\t\t\t\t\t\t\t\t\t\t&&!digit.peek().equals(\"]\")&&!digit.peek().equals(\"}\")&&!digit.peek().equals(\"+\")&&!digit.peek().equals(\"-\")&&!digit.peek().equals(\"*\")&&!digit.peek().equals(\"/\")) {\r\n\t\t\t\t\t\t\t\t\tsecond = digit.pop();\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}\r\n\t\t\t\t\tif (second==null) {\r\n\t\t\t\t\t\tisLegal = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdigit.pop();\r\n\t\t\t\t\t\tdigit.push(second);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbuffer.append(ch);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\twhile(i<len&&ch!='+'&&ch!='-'&&ch!='*'&&ch!='/'&&ch!='['&&ch!='{'&&ch!='('&&ch!=')'&&ch!=']'&&ch!='}'){\r\n\t\t\t\t\t\tch = str.charAt(i);\r\n\t\t\t\t\t\tbuffer.append(ch);\r\n\t\t\t\t\t\ti++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdigit.push(buffer.toString());\r\n\t\t\t\t\tbuffer.setLength(0);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (!isLegal) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (digit.size()==1&&!digit.peek().equals(\"{\")&&!digit.peek().equals(\"[\")&&!digit.peek().equals(\"(\")) {\r\n\t\t\t\t\r\n\t\t\t}else {\r\n\t\t\t\tisLegal = false;\r\n\t\t\t}\r\n\t\t\tSystem.out.println(isLegal);\r\n\t\t}\r\n\t}", "public boolean validateStackSequences2(int[] pushed, int[] popped) \n {\n if (pushed == null || pushed.length == 0)\n {\n return (popped == null || popped.length == 0);\n }\n else if (pushed.length != popped.length)\n {\n return false;\n }\n \n int index1 = 0, stackTop = -1;\n int size = pushed.length;\n Set<Integer> visited = new HashSet<>();\n \n for (int index2 = 0; index2 < size; index2++)\n {\n while (stackTop != -1 && visited.contains(pushed[stackTop]))\n {\n stackTop--;\n }\n \n if (stackTop != -1 && pushed[stackTop] == popped[index2])\n {\n visited.add(popped[index2]);\n stackTop--;\n continue;\n }\n \n while (index1 < size && pushed[index1] != popped[index2])\n {\n index1++;\n }\n \n if (index1 == size)\n {\n return false;\n }\n \n stackTop = index1-1;\n visited.add(popped[index2]);\n index1++;\n }\n \n return true;\n }", "public static boolean isValidSymbolPattern(String s) throws Exception{\n Stack<Character> stack = new Stack<Character>();\n if(s == null || s.length() == 0){\n return true;\n }\n for(int i = 0; i < s.length(); i++){\n if(s.charAt(i) == ')'){\n if(!stack.isEmpty() && stack.peek() == '('){\n stack.pop();\n }else{\n return false;\n }\n }else if(s.charAt(i) == ']'){\n if(!stack.isEmpty() && stack.peek() == '['){\n stack.pop();\n }else{\n return false;\n }\n }else if(s.charAt(i) == '}'){\n if(!stack.isEmpty() && stack.peek() == '{'){\n stack.pop();\n }else{\n return false;\n }\n }else{\n stack.push(s.charAt(i));\n }\n }\n if(stack.isEmpty()){\n return true;\n }else{\n return false;\n }\n }", "public boolean isValid(String s) {\n if (s.isEmpty()) {\n return true;\n }\n\n HashMap<Character, Character> p = new HashMap<>();\n p.put('{', '}');\n p.put('(', ')');\n p.put('[', ']');\n\n Stack<Character> st = new Stack<>();\n\n for (char c : s.toCharArray()) {\n if (p.containsKey(c)) { // open\n st.push(p.get(c)); // lest push closed bracket to the stack\n } else { // close\n // we've got unexpected bracket\n if (st.empty() || !st.pop().equals(c)) {\n return false;\n }\n }\n }\n\n return st.empty();\n }", "private boolean isBracketAhead() {\r\n\t\treturn expression[currentIndex] == '(' || expression[currentIndex] == ')';\r\n\t}", "static boolean validBrackets(String s){\n ArrayList<Character> arr = new ArrayList<Character>();\n for(int i = 0; i < s.length(); i++){\n if(s.charAt(i) == '{' || s.charAt(i) == '[' || s.charAt(i) == '('){\n arr.add(s.charAt(i));\n }else if(s.charAt(i) == '}'){\n if(arr.get(arr.size()-1) != '{'){\n return false;\n }\n arr.remove(arr.size()-1);\n }else if(s.charAt(i) == ']'){\n if(arr.get(arr.size()-1) != '['){\n return false;\n }\n arr.remove(arr.size()-1);\n }else if(s.charAt(i) == ')'){\n if(arr.get(arr.size()-1) != '('){\n return false;\n }\n arr.remove(arr.size()-1);\n }\n }\n return arr.isEmpty();\n }", "static int match(char[] s, int length) {\n\tint count=0;\r\n\tboolean flag=true;\r\n\tStack<Character> stack=new Stack<Character>();\r\n\tfor(int i=0;i<length;i++)\r\n\t{\r\n\t\tif(s[i]=='(' || s[i]=='[' || s[i]=='{')\r\n\t\t{\r\n\t\t stack.push(s[i]);\r\n\t\t count++;\r\n\t\t continue;\r\n\t\t}\r\n\t\t\r\n\t\telse\tif(s[i]=='}' && stack.peek()=='{')\r\n\t\t{\r\n\t\t\tstack.pop();\r\n\t\t}\r\n\t\t\r\n\t\telse\tif(s[i]==')' && stack.peek()=='(')\r\n\t\t{\r\n\t\t\tstack.pop();\r\n\t\t}\r\n\t\telse\tif(s[i]==']' && stack.peek()=='[')\r\n\t\t{\r\n\t\t\tstack.pop();\r\n\t\t}\r\n\t\t\t\t\t\t\r\n\t\telse\r\n\t\t\tflag=false;\r\n\t\t\r\n\t}\r\n\t\t \r\n\t\t if(flag && stack.empty()) return count;\r\n\t\t else return -1;\r\n\t}", "static boolean findDuplicateparenthesis(String s) {\n\t\tStack<Character> Stack = new Stack<>();\r\n\t\tfor(int i=0;i<s.length();i++)\r\n\t\t{\r\n\t\t if(s.charAt(i)!=')')\r\n\t\t {\r\n\t\t Stack.push(s.charAt(i));\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t int top= Stack.pop();\r\n\t\t int count=0;\r\n\t\t while(top!='(')\r\n\t\t {\r\n\t\t top= Stack.pop();\r\n\t\t count++;\r\n\t\t }\r\n\t\t if(count<1)\r\n\t\t {\r\n\t\t return true;\r\n\t\t }\r\n\t\t }\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint t = Integer.parseInt(br.readLine());\n\n\t\tfor (int i = 0; i < t; i++) {\n\t\t\tStack<Integer> stk = new Stack<>();\n\t\t\tString[] input = br.readLine().split(\"\");\n\t\t\tboolean wrong = false;\n\t\t\t\n\t\t\t\n\t\t\tfor (int j = 0; j <input.length; j++) {\n\t\t\t\tif(input[j].equals(\"(\"))\n\t\t\t\t\tstk.push(1);\n\t\t\t\telse if(input[j].equals(\")\")) {\n\t\t\t\t\t if(stk.isEmpty()) {\n\t\t\t\t\t\t wrong = true;\n\t\t\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t\t\t stk.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(stk.isEmpty() && !wrong)\n\t\t\t\tSystem.out.println(\"YES\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"NO\");\n\t\t}\n\n\t\t\n\n\t}", "public boolean balancedparantheses(String exp) {\n\t\tStack<Character> stack = new Stack<Character>();\n\t\tfor (int i = 0; i < exp.length(); i++) {\n\t\t\tchar charValue = exp.charAt(i);\n\t\t\tif (charValue == '[' || charValue == '(' || charValue == '{') {\n\t\t\t\tstack.push(charValue);\n\t\t\t} else if (charValue == ']') {\n\t\t\t\tif (stack.isEmpty()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (stack.pop() != '[') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (charValue == ')') {\n\t\t\t\tif (stack.isEmpty()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (stack.pop() != '(') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (charValue == '}') {\n\t\t\t\tif (stack.isEmpty()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (stack.pop() != '{') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn stack.isEmpty();\n\t}", "public static boolean isBalancedParentheses(String str) {\r\n\t\tStack<Character> stk = new Stack<Character>();\r\n\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\tchar ch = str.charAt(i);\r\n\t\t\tif (ch == '(' || ch == '[') {\r\n\t\t\t\tstk.push(ch);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (ch == ')' || ch == ']') {\r\n\t\t\t\tif (!stk.isEmpty() && (stk.peek() == '(' || stk.peek() == '[')) {\r\n\t\t\t\t\tstk.pop();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tstk.push(ch);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn stk.isEmpty();\r\n\t}", "private boolean parseOpeningBracket() {\n if (index < end && source.charAt(index) == '[') {\n index++;\n return true;\n }\n return false;\n }", "private void SolveCondition() {\n Pattern pt = Pattern.compile(\"(?<!\\\")\\\\[(.*?)\\\\](?<!\\\")\");\n //another greedy matching will be \\[([^}]+)\\]\n Matcher ma = pt.matcher(Input);\n while(ma.find()) {\n if(ma.groupCount()>0){\n System.out.println(ma.group(1));\n }\n }\n\n }", "public boolean validateStackSequences_3_pointer(int[] pushed, int[] popped) {\n\t\tint n = pushed.length, left = 0, right = 0, p = 0;\n\n\t\twhile (p < n && (left >= 0 || right < n)) {\n\t\t\t// search right\n\t\t\tint tmp = right;\n\t\t\twhile (right < n && pushed[right] != popped[p]) {\n\t\t\t\tright++;\n\t\t\t}\n\t\t\tif (right < n) {\n\t\t\t\tp++;\n\t\t\t\t\n\t\t\t\t// reset left if found the popped one on the right and there are \n\t\t\t\t// new elements need to be pushed into stack\n\t\t\t\tif (right > tmp + 1)\n\t\t\t\t\tleft = right - 1;\n\t\t\t\t\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tright = tmp; // restore right if not found\n\n\t\t\t// search left\n\t\t\twhile (left >= 0 && !inStack(pushed, left, popped, p - 1)) {\n\t\t\t\tleft--;\n\t\t\t}\n\t\t\tif (left >= 0 && pushed[left] == popped[p]) {\n\t\t\t\tleft--;\n\t\t\t\tp++;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn p == n;\n\t}", "static String isBalanced(String s) {\n\n Stack<Integer> stackChars = new Stack<Integer>();\n char arr[] = s.toCharArray();\n int topElement= 0;\n for(int i=0;i<s.length();i++){\n if(i>0 && !stackChars.isEmpty()){\n topElement = stackChars.peek();\n }\n stackChars.push((int)arr[i]);\n if(topElement!=0 && stackChars.size() > 1){\n if((topElement==91 && stackChars.peek() ==93) || (topElement==123 && stackChars.peek() ==125) || \n (topElement== 40 && stackChars.peek() ==41)\n ){\n stackChars.pop();\n stackChars.pop();\n }\n }\n }\n String result = \"\";\n if(stackChars.isEmpty()){\n result = \"YES\";\n }else{\n result = \"NO\";\n }\n return result;\n }", "public static boolean balancedBrackets(String str) {\n Hashtable < Character, Character > lookUpClosingBracket = new Hashtable < Character, Character > ();\n lookUpClosingBracket.put('{', '}');\n lookUpClosingBracket.put('(', ')');\n lookUpClosingBracket.put('[', ']');\n\n Stack < Character > stack = new Stack < Character > ();\n\n for (int i = 0; i < str.length(); i++) {\n char currentBracket = str.charAt(i);\n\n if (currentBracket == '{' || currentBracket == '(' || currentBracket == '[')\n stack.push(currentBracket);\n else if (currentBracket == '}' || currentBracket == ')' || currentBracket == ']') {\n if (stack.isEmpty())\n return false;\n\n char openingBracket = (Character) stack.pop();\n\n char expectedClosingBracket = lookUpClosingBracket.get(openingBracket);\n\n if (currentBracket != expectedClosingBracket)\n return false;\n }\n\n }\n\n if (!stack.isEmpty())\n return false;\n\n return true;\n }", "private boolean syntaxOkay(String in){\n\t\tint numOpenBraces = 0;\n\t\tint numCloseBraces = 0;\n\t\tint countQuote = 0;\n\t\tfor(int i = 0; i < in.length(); i++){\n\t\t\tchar currentChar = in.charAt(i);\n\t\t\tif(currentChar == '{'){\n\t\t\t\tint open = i;\n\t\t\t\tnumOpenBraces++;\n\t\t\t}else if(currentChar == '}'){\n\t\t\t\tint close = i;\n\t\t\t\tnumCloseBraces++;\n\t\t\t}else if(currentChar == '\"'){\n\t\t\t\tcountQuote++;\n\t\t\t}\n\t\t}\n\t\treturn numOpenBraces == numCloseBraces && countQuote % 2 == 0;\n\t}", "public static void main(String[] args) throws IOException {\n\t\t\n\t\tBufferedReader buffer = new BufferedReader(new InputStreamReader(System.in)); \n\t\t int n = Integer.parseInt(buffer.readLine()); \n\t\t Stack<String> stack = new Stack<>(); \n\t\t \n\t\t \n\t\t for (int i=0; i<n; ++i) \n\t\t { //temp에 문자가 한글자씩 끊어서 저장이 된다.\n\t\t String[] temp = buffer.readLine().split(\"\"); \n\t\t for (int j=0; j<temp.length; ++j) \n\t\t { \n\t\t if (temp[j].equals(\"(\")) \n\t\t stack.push(temp[j]); \n\t\t if(temp[j].equals(\")\") && stack.isEmpty()) \n\t\t { \n\t\t stack.push(temp[j]); \n\t\t break; \n\t\t } \n\t\t if (temp[j].equals(\")\") && !stack.isEmpty()) \n\t\t stack.pop(); \n\t\t } \n\t\t if (stack.isEmpty()) \n\t\t System.out.println(\"YES\"); \n\t\t else \n\t\t System.out.println(\"NO\"); \n\t\t //stack에 존재하는 모든 자료를 삭제하는 메소드 -> stack.clear()\n\t\t stack.clear(); \n\t\t } \n\t\t }", "public boolean checkRedundancy(String str) {\n Stack<Character> stack = new Stack<>();\n for(char ch : str.toCharArray()) {\n if(ch == ')') {\n if(stack.isEmpty()) return false;\n if(stack.peek() == '(') return true;\n int elementInside = 0;\n while(stack.pop() != '(') {\n elementInside++;\n stack.pop();\n }\n stack.pop();\n if(elementInside < 2) {\n return false;\n }\n\n }else{\n stack.push(ch);\n }\n }\n return true;\n }", "public int solution(String S){\n if(S.length() == 0) return 1;\n if(S.length() % 2 != 0) return 0;\n\n // new Stack<Character>()\n Stack<Character> stack = new Stack<>();\n // scan the string (just one pass)\n for(int i=0; i< S.length(); i++){\n // note: push \"its pair\"\n if( S.charAt(i) == '(' ){\n stack.push(')');\n }\n else if( S.charAt(i) == '[' ){\n stack.push(']');\n }\n else if( S.charAt(i) == '{' ){\n stack.push('}');\n }\n // pop and check\n else if( S.charAt(i) == ')' || S.charAt(i) == ']' || S.charAt(i) == '}'){\n // important: check if the stack is empty or not (be careful)\n if(stack.isEmpty()){\n return 0;\n }\n else{\n if(stack.pop() != S.charAt(i)){ // not a pair\n return 0;\n }\n }\n }\n }\n // note: check if the stack is empty or not\n if(stack.isEmpty())\n return 1;\n return 0;\n\n }", "Boolean parse() {\n // if errors during initial scanning\n // of program, immediately exit.\n if(scanner.hasErrors()) {\n System.out.println(ERRORMESSAGE);\n return false;\n }\n\n Stack<Integer> rStack = new Stack<Integer>(); // keeps track of production rules\n Stack<String> pStack = new Stack<String>(); // parsing stack\n STstack = new Stack<TNode>(); // syntax tree stack\n\n // pushing first production rule onto stack\n pStack.push(\"0\");\n Token token = scanner.next();\n String token_type = tokenToGrammar(token);\n boolean newToken = false;\n\n int row = 0;\n int col = 0;\n\n // push all tokens of program onto\n // parsing stack before parsing\n while(scanner.ongoing() >= 0) {\n // examine top of stack\n String top = pStack.peek();\n// System.out.println(\"top of stack \" + top);\n // retrieve next valid token of program\n if(newToken && scanner.ongoing() > 0) {\n token = scanner.next();\n token_type = tokenToGrammar(token);\n col = parseTableHeader.get(token_type);\n }\n// System.out.print(\"lookahead \" + token +\", \");\n\n try {\n // is the top of the stack a row number?\n row = Integer.parseInt(top);\n // get value of cell in parse table\n String cell = parseTable.get(row).get(col);\n// System.out.println(\"cell value \" + cell);\n String[] cellParts = cell.split(\"\");\n\n // if cell value is 'b', this is\n // an error and program is not\n // syntactically correct\n if(cellParts[0].equals(\"b\")) {\n System.out.println(ERRORMESSAGE);\n return false;\n }\n\n // if the cell entry is a shift\n else if(cellParts[0].equals(\"s\")) {\n\n // push the lookahead on stack\n pStack.push(token_type);\n // push the lookahead's token on STstack\n if(!token.getChVals().equals(\";\") || !token.getChVals().equals(\"$\")) {\n STstack.push(new TNode(\"general\", token));\n }\n\n // set the shift value as current row\n row = Integer.parseInt(\n String.join(\"\", Arrays.copyOfRange(cellParts, 1, cellParts.length))\n );\n// System.out.println(\"new row \" + row);\n\n // push row value to pStack\n pStack.push(Integer.toString(row));\n\n // set newToken param\n newToken = true;\n }\n\n // if cell entry is a reduce\n else if(cellParts[0].equals(\"r\")) {\n // first pop off the current row number\n pStack.pop();\n\n // get the production rule's index from the cell\n int prodIdx = Integer.parseInt(\n String.join(\"\", Arrays.copyOfRange(cellParts, 1, cellParts.length))\n );\n// System.out.println(\"production number \" + prodIdx);\n\n // get the production rule we are reducing by\n ArrayList<String> production = grammar.get(prodIdx);\n // which syntax tree node do we need?\n SNType nodeType;\n if(prodIdx == 2) {\n nodeType = STstack.peek().getType();\n } else {\n nodeType = idNodeType(prodIdx);\n }\n // also need a temporary stack to hold\n // popped tokens from STstack to make\n // a new node\n Stack<TNode> tempNodeHolder = new Stack<TNode>();\n\n // put all elements of the right side of\n // production rule onto a new stack so\n // we can keep track of them while\n // popping off the actual parsing stack\n Stack<String> rules = new Stack<String>();\n for(int i = 1; i < production.size(); i++) {\n rules.push(production.get(i));\n }\n\n // now pop off right side of\n // production from parsing stack\n while(!rules.empty()){\n String t = pStack.pop();\n if(t.equals(rules.peek())) {\n rules.pop();\n // also pop from STstack for syntax tree\n // and add to temporary stack\n if(!t.equals(\";\") || !token.getChVals().equals(\"$\")) {\n TNode tempNode = STstack.pop();\n tempNodeHolder.push(tempNode);\n }\n }\n }\n\n // synthesize new syntax tree node\n // and add back to STstack\n TNode newNode = makeNode(nodeType, tempNodeHolder);\n STstack.push(newNode);\n\n // push production number to rStack\n rStack.push(prodIdx);\n\n// if(prodIdx == 1) {\n// break;\n// }\n\n // check what current top of pStack is\n // to check for next row\n row = Integer.parseInt(pStack.peek());\n\n // push left side of production\n // onto stack\n pStack.push(production.get(0));\n\n // identify column of the left side of production\n col = parseTableHeader.get(pStack.peek());\n\n // set new row number\n row = Integer.parseInt(parseTable.get(row).get(col));\n// System.out.print(\"new row \" + row + \", \");\n\n // set new col number\n col = parseTableHeader.get(token_type);\n// System.out.println(\"new col \" + col);\n\n // push row value to pStack\n pStack.push(Integer.toString(row));\n\n // set newToken param\n newToken = false;\n\n }\n\n // we are done, so accept!\n else if(cellParts[0].equals(\"a\")) {\n break;\n }\n\n } catch (NumberFormatException e) {\n\n }\n\n }\n\n System.out.println(PASSMESSAGE);\n\n // Prints out the production rules used to derive program.\n// while(!rStack.isEmpty()) {\n// int idx = rStack.pop();\n// ArrayList<String> production = grammar.get(idx);\n// System.out.print(production.get(0) + \" -> \");\n// for(int i = 1; i < production.size(); i++) {\n// System.out.print(production.get(i) + \" \");\n// }\n// System.out.println();\n// }\n\n return true;\n\n\n }", "private static void StackofStrings (Scanner in, PrintStream out) {\n StackofStrings stack = new StackofStrings();\n while(in.hasNext()){\n String s = in.next();\n if ((s.equals(\"-\"))){\n out.print(stack.pop()+ \" \");\n }else{\n stack.push(s);\n }\n }\n}", "public boolean isLegallyMatched() \n {\n int length = expr.length();\n int num = 0;\n int count = 0;\n Stack <Character> openParenBrack = new Stack <Character>();\n Stack <Integer> location = new Stack <Integer>();\n openingBracketIndex = new ArrayList <Integer>();\n closingBracketIndex = new ArrayList <Integer>();\n \n for (int i = 0; i < length; i++)\n {\n if(expr.charAt(i) == ')' || expr.charAt(i) == ']')\n num++;\n }\n for (int j = 0; j <= num; j++)\n closingBracketIndex.add(0);\n for (int k = 0; k < length; k++)\n {\n if (expr.charAt(k) == '(' || expr.charAt(k) == '[')\n {\n openingBracketIndex.add(k); \n openParenBrack.push(expr.charAt(k));\n location.push(count);\n count++;\n }\n else if (expr.charAt(k) == ')' || expr.charAt(k) == ']')\n {\n if (openParenBrack.isEmpty())\n return false;\n else \n {\n char ch = openParenBrack.pop();\n if (expr.charAt(k) == ')' && ch != '(' || expr.charAt(k) == ']' && ch != '[')\n return false;\n closingBracketIndex.set(location.pop(), k);\n }\n }\n }\n if (!openParenBrack.isEmpty())\n return false;\n return true;\n }", "public boolean correcto(String pars)\n {\n //><\n Stack pos= new Stack();\n ArrayList pos1= new ArrayList(2);\n ArrayList pos2= new ArrayList(2);\n for(int i=0; i<pars.length(); i++)\n {\n if(pars.charAt(i) == '(')\n {\n pos.push(i);\n }\n else if(pars.charAt(i) == ')')\n {\n if(pos.empty() == false)\n {\n pos1.add(pos.pop());\n pos1.add(i);\n }\n else\n {\n pos2.add(i);\n }\n }\n }\n \n int i=0;\n System.out.println(\"Con pareja\");\n while(i < pos1.size())\n {\n System.out.println(\"[\"+pos1.get(i)+\",\"+pos1.get(i+1)+\"]\");\n i+=2;\n }\n \n if(pos.empty()==true && pos2.isEmpty()==true)\n {\n return true;\n }\n else\n {\n System.out.println(\"\\nSin pareja\");\n if(pos.isEmpty()==false)\n {\n System.out.println(pos);\n }\n else\n {\n System.out.println(pos2);\n }\n return false;\n }\n }", "private static boolean checkValidTokenSequence(String curToken, String lastToken){\n\t\t//If an operand or right bracket comes directly before an operand return false\n\t\tif(curToken.equals(\"operand\") && (lastToken.equals(\"operand\") || lastToken.equals(\"right bracket\"))){\n\t\t\treturn false;\n\t\t}\n\t\t//If an operator or left bracket comes directly before an operator, return false\n\t\telse if(curToken.equals(\"operator\") && (lastToken.equals(\"operator\") || lastToken.equals(\"left bracket\"))){\n\t\t\treturn false;\n\t\t}\n\t\t//If a left bracket or operator comes directly before a right bracket return false\n\t\telse if(curToken.equals(\"right bracket\") && (lastToken.equals(\"left bracket\") || lastToken.equals(\"operator\"))){\n\t\t\treturn false;\n\t\t}\n\t\t//If an operand or right bracket comes directly before a left bracket, return false\n\t\telse if(curToken.equals(\"left bracket\") && (lastToken.equals(\"operand\") || lastToken.equals(\"right bracket\"))){\n\t\t\treturn false;\n\t\t}\n\n\t\t//Otherwise the sequence is valid\n\t\treturn true;\n\t}", "public boolean isValid(String s) {\n Stack<Character> st = new Stack<>();\n for (int i = 0; i < s.length(); i++) {\n char input = s.charAt(i);\n if (input == '(' || input == '[' || input == '{') {\n st.push(input);\n } else {\n if (!st.isEmpty()) {\n char bracket = st.pop();\n switch (bracket) {\n case '[':\n if (input != ']') {\n return false;\n }\n break;\n case '(':\n if (input != ')') {\n return false;\n }\n break;\n default:\n if (input != '}') {\n return false;\n }\n\n }\n } else {\n return false;\n }\n }\n }\n return st.isEmpty();\n }", "public static void QtoS(){\n while(!POOR.isEmpty()){\n stack.push(POOR.remove());\n }\n while(!FAIR.isEmpty()){\n stack.push(FAIR.remove());\n }\n while(!GOOD.isEmpty()){\n stack.push(GOOD.remove());\n }\n while(!VGOOD.isEmpty()){\n stack.push(VGOOD.remove());\n }\n while(!EXCELLENT.isEmpty()){\n stack.push(EXCELLENT.remove());\n }\n \n \n}", "private static boolean checkBalance(String expression)\r\n {\r\n StackInterface<Character> open_delimiter_stack = new ArrayStack<>();\r\n\r\n switch(stack_type)\r\n {\r\n case(\"vector\"):\r\n open_delimiter_stack = new VectorStack<>();\r\n break;\r\n \r\n case(\"linked\"):\r\n open_delimiter_stack = new LinkedListStack<>();\r\n break;\r\n }\r\n\r\n int character_count = expression.length();\r\n boolean is_balanced = true;\r\n int index = 0;\r\n char next_character = ' ';\r\n\r\n //makes sure open delimiter hits its equivalent closer\r\n while(is_balanced && (index < character_count))\r\n {\r\n next_character = expression.charAt(index);\r\n switch(next_character)\r\n {\r\n case '(': case '{': case '[':\r\n open_delimiter_stack.push(next_character);\r\n break;\r\n case ')': case '}': case ']':\r\n if(open_delimiter_stack.isEmpty())\r\n {\r\n is_balanced = false;\r\n }\r\n else\r\n {\r\n char open_delimiter = open_delimiter_stack.pop();\r\n is_balanced = isPaired(open_delimiter, next_character);\r\n }\r\n break;\r\n default: break;\r\n }\r\n index++;\r\n }\r\n if (!open_delimiter_stack.isEmpty())\r\n {\r\n is_balanced = false;\r\n }\r\n\r\n return is_balanced;\r\n }", "static\nboolean\ncheck(\nint\nA[], \nint\nN) { \n\n// Stack S \n\nStack<Integer> S = \nnew\nStack<Integer>(); \n\n\n// Pointer to the end value of array B. \n\nint\nB_end = \n0\n; \n\n\n// Traversing each element of A[] from starting \n\n// Checking if there is a valid operation \n\n// that can be performed. \n\nfor\n(\nint\ni = \n0\n; i < N; i++) { \n\n// If the stack is not empty \n\nif\n(!S.empty()) { \n\n// Top of the Stack. \n\nint\ntop = S.peek(); \n\n\n// If the top of the stack is \n\n// Equal to B_end+1, we will pop it \n\n// And increment B_end by 1. \n\nwhile\n(top == B_end + \n1\n) { \n\n// if current top is equal to \n\n// B_end+1, we will increment \n\n// B_end to B_end+1 \n\nB_end = B_end + \n1\n; \n\n\n// Pop the top element. \n\nS.pop(); \n\n\n// If the stack is empty We cannot \n\n// further perfom this operation. \n\n// Therefore break \n\nif\n(S.empty()) { \n\nbreak\n; \n\n} \n\n\n// Current Top \n\ntop = S.peek(); \n\n} \n\n\n// If stack is empty \n\n// Push the Current element \n\nif\n(S.empty()) { \n\nS.push(A[i]); \n\n} \nelse\n{ \n\ntop = S.peek(); \n\n\n// If the Current element of the array A[] \n\n// if smaller than the top of the stack \n\n// We can push it in the Stack. \n\nif\n(A[i] < top) { \n\nS.push(A[i]); \n\n} \n// Else We cannot sort the array \n\n// Using any valid operations. \n\nelse\n{ \n\n// Not Stack Sortable \n\nreturn\nfalse\n; \n\n} \n\n} \n\n} \nelse\n{ \n\n// If the stack is empty push the current \n\n// element in the stack. \n\nS.push(A[i]); \n\n} \n\n} \n\n\n// Stack Sortable \n\nreturn\ntrue\n; \n\n}", "public static boolean stackHelper(Stack st)\n\t{\n\t\tif (st.empty() || (int) st.peek() < 0)\n\t\t{\n\t\t\tthrow new InvalidSequenceException();\n\t\t}\n\t\treturn true;\n\t}", "public boolean validCheck(String input) {\n\n int open= 0, closed = 0; //To count number of open and closed brackets\n\n if (input.length() >= 3 && input.length() <= 20) {\n inputArray = input.toCharArray(); //Convert the string to a Char Array\n\n if(!Character.isDigit(inputArray[0])) //If the first character isn't a number, it's not valid e.g +3*6\n return false;\n\n for (int i = 0; i < inputArray.length; i++) {\n\n if(inputArray[i] == '(') //if open bracket increment the open value..\n open +=1;\n if(inputArray[i] == ')') //same but with closed bracket\n closed+=1;\n\n if(i+1 < inputArray.length){ //to avoid array index out of bounds exception\n if (Character.isDigit(inputArray[i]) && Character.isDigit(inputArray[i + 1])) { //This makes sure no double digits\n return false;\n } else if ((validOperator(inputArray[i])) && (validOperator(inputArray[i + 1]) && inputArray[i+1] != '(')){ //no 2 operators in a row BUT ok if operator and open bracket\n if(inputArray[i] != ')'){ //To allow operand after a closed bracket e.g (3+1)+2\n return false;\n }\n\n }\n }\n if (!Character.isDigit(inputArray[i]) && !validOperator(inputArray[i])) { //not a number AND not a valid operator\n return false;\n }\n }\n\n if(open!= closed){ //Make sure the all open brackets are closed\n return false;\n }\n return true;\n\n }\n\n return false;\n }", "@Test\n public void test_accepts_parens() {\n List<FARule> rules = Arrays.asList(\n new FARule(STATE0, '(', STATE1), new FARule(STATE1, ')', STATE0),\n new FARule(STATE1, '(', STATE2), new FARule(STATE2, ')', STATE1),\n new FARule(STATE2, '(', STATE3), new FARule(STATE3, ')', STATE2));\n NFARulebook rulebook = new NFARulebook(rules);\n\n NFADesign nfaDesign = new NFADesign(STATE0, Arrays.asList(STATE0), rulebook);\n assertFalse(nfaDesign.accepts(\"(()\"));\n assertFalse(nfaDesign.accepts(\"())\"));\n assertTrue(nfaDesign.accepts(\"(())\"));\n assertTrue(nfaDesign.accepts(\"(()(()()))\"));\n\n // Here is a flaw though - we can't make rules out to infinity - these brackets are balanced, but our rulebook\n // does not go out enough levels to recognize it:\n assertFalse(nfaDesign.accepts(\"(((())))\")); // Should be TRUE!\n // We can always add more levels, but there is no real solution to this problem with an NFA (no matter how many\n // rules we provide, nesting could always go 1 level deeper).\n }", "public static boolean validateCharacters(String s) {\n if(s.length() % 2 != 0) {\n return false;\n }\n Stack<Character> stack = new Stack();\n for(char c : s.toCharArray()) {\n if(c == '(' || c == '[' || c == '{') {\n stack.push(c);\n } else if (c == ')' && !stack.isEmpty() && stack.peek() == '(') {\n stack.pop();\n } else if (c == ']' && !stack.isEmpty() && stack.peek() == '[') {\n stack.pop();\n } else if (c == '}' && !stack.isEmpty() && stack.peek() == '{') {\n stack.pop();\n } else {\n return false;\n }\n }\n\n return stack.isEmpty();\n }", "public static void main( String[] args )\n {\n\tStack<String> cakes = new LLStack<String>();\n\n\t//\"bronze jungle fail smite challenger nunu consume blue\"\n\tSystem.out.println( \"is cakes empty: \" + cakes.isEmpty() + \"\\n\" );\n\t\n\t//push tests\n\tcakes.push( \"blue\" );\t\n\tSystem.out.println( \"top value of cakes after pushing blue:\\n\" + cakes.peek() );\t\n\tcakes.push( \"consume\" );\t\n\tSystem.out.println( \"top value of cakes after pushing consume:\\n\" + cakes.peek() );\t\n\tcakes.push( \"nunu\" );\n\tSystem.out.println( \"top value of cakes after pushing nunu:\\n\" + cakes.peek() );\t\t\n\tcakes.push( \"challenger\" );\n\tSystem.out.println( \"top value of cakes after pushing challenger:\\n\" + cakes.peek() );\t\n\tcakes.push( \"smite\" );\t\n\tSystem.out.println( \"top value of cakes after pushing smite:\\n\" + cakes.peek() );\t\n\tcakes.push( \"fail\" );\t\n\tSystem.out.println( \"top value of cakes after pushing fail:\\n\" + cakes.peek() );\t\n\tcakes.push( \"jungle\" );\t\n\tSystem.out.println( \"top value of cakes after pushing jungle:\\n\" + cakes.peek() );\t\n\tcakes.push( \"bronze\" );\t\n\tSystem.out.println( \"top value of cakes after pushing bronze:\\n\" + cakes.peek() );\n\t\n\tSystem.out.println( \"\\nis cakes empty: \" + cakes.isEmpty() + \"\\n\" );\n\t\n\t//pop tests\n\tfor( int i = 0; i < 8; i ++ ){\n\t\tSystem.out.println( \"top value of cakes: \" + cakes.peek() );\n\t\tSystem.out.println( \"value popped from cakes: \" + cakes.pop() );\n\t}\n\t\n\tSystem.out.println( \"\\nis cakes empty: \" + cakes.isEmpty() + \"\\n\" );\n\t\n }", "void evalua(String expresion){\n Queue entrada=stringtoChars(expresion); //entrada cola\r\n Queue salida= new Queue();//salida cola\r\n Stack pila=new Stack(); //pila\r\n char caracter;\r\n int cont=0;\r\n \r\n while((caracter=entrada.dequeue())!=0){//mientras que\r\n System.out.println(\"dequeue \"+caracter);\r\n System.out.println(\"contador \"+cont);\r\n if(isLetra(caracter)){//si es una letra\r\n salida.queue(caracter);//inserta a la cola de salida\r\n }else{//si es un signo ++++++++\r\n System.out.println(\"entra\");\r\n if(pila.isPilaVacia()){//si la pila está vacía\r\n pila.push(caracter);//inserta el caracter\r\n }else{//falta checar los () si no es vacia\r\n if(peso(caracter)==0){\r\n char c;\r\n while((c=pila.pop())!='('){//mientras que sacar de la pila es diferente de cero\r\n salida.queue(c); // a la salida insertar los caracteres\r\n } \r\n \r\n }else{\r\n char signo=pila.pop();\r\n if(signo=='('){\r\n pila.push(signo);\r\n pila.push(caracter);\r\n pila.imprimir();\r\n }else{\r\n //signo es igual al primer caracter de la pila\r\n //signo=adentro\r\n //caracter=afuera\r\n if(isAfuerMayorDentro(signo, caracter)){//si el que esta afuera es mayor que el de adentro\r\n\r\n // pila.push(caracter);//insertamos el que estaba adentro\r\n pila.push(signo);//insertamos el afuera\r\n pila.push(caracter);//insertamos el que estaba adentro\r\n pila.imprimir(); \r\n }else{//si el de adentro es mayor que el de afuera\r\n salida.queue(signo);//a la salida insertamos el signo afyera\r\n pila.push(caracter);//a la pila insertamos el que estaba \r\n pila.imprimir();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n cont++;\r\n }\r\n while((caracter=pila.pop())!=0){//mientras que sacar de la pila es diferente de cero\r\n salida.queue(caracter); // a la salida insertar los caracteres\r\n }\r\n while((caracter= salida.dequeue())!=0){//mientras que sacar de la salida es diferente de cero\r\n System.out.print(caracter);//imprimir los caracteres\r\n }\r\n \r\n }", "private boolean isPair(StringBuilder input) {\n\t\tboolean isPair = false;\n\t\tStack<String> balancedStack = new Stack<String>();\n\t\t\n\t\tfor(int i = 0; i < input.length(); i++)\n\t\t{\n\t\t\tif(input.charAt(i) =='(')\n\t\t\t{\n\t\t\t\tchar tempVal = input.charAt(i);\n\t\t\t\tbalancedStack.push(Character.toString(tempVal));\n\t\t\t}\n\t\t\telse if(input.charAt(i) ==')')\n\t\t\t{\n\t\t\t\tbalancedStack.pop();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(balancedStack.empty() == true)\n\t\t{\n\t\t\tisPair = true;\n\t\t}\n\t\t\n\t\treturn isPair;\n\t}", "private void LL1Parser() throws IOException {\n\n LA.ReadLine(0);\n ParsStack.push(\"$\");\n ParsStack.push(\"P\");\n int prod;\n token = LA.Scanner();\n while (token.getValue() == null)\n {\n token = LA.Scanner();\n }\n// System.out.println(\"in ll1 parser\");\n// System.out.println(token.getValue() + \" \" + token.getType());\n while (true)\n {\n// System.out.println(ParsStack.peek());\n if (!CheckTerminal(ParsStack.peek()) && (!ParsStack.peek().equals(\"$\")) && (ParsStack.peek().charAt(0) != '@'))\n {\n /**inja be nazarm bayad BUparser run she agar BE bashe sare parse stack**/\n if (ParsStack.peek().equals(\"BE\"))\n {\n// System.out.println(\"go to SLR parser\");\n SLRParser();\n// System.out.println(\"Come back from SLR parser\");\n// System.out.println(ParsStack.peek());\n ParsStack.pop();\n token = LA.Scanner();\n// System.out.println(token.getValue());\n }\n else\n {\n prod = getProduction(ParsStack.peek(), token);\n// System.out.println(ParsStack.peek() + \" \" + token.getValue() + \" \" + prod);\n if (prod == 0) {\n error(4);\n break;\n } else {\n ParsStack.pop();\n for (int i = TempGrammer.get(prod - 1).getRight().length - 2 ; i > 0 ; i--) {\n if (TempGrammer.get(prod - 1).getRight()[i].equals(\"!\"))\n break;\n ParsStack.push(TempGrammer.get(prod - 1).getRight()[i]);\n// System.out.println(\"fill stack \" + ParsStack.peek());\n }\n }\n }\n }\n else if (CheckTerminal(ParsStack.peek()))\n {\n if (!CheckTerminal(token.getValue()))\n {\n if (ParsStack.peek().equals(\"id\"))\n {\n// System.out.println(token.getValue() + \" pop\");\n ParsStack.pop();\n token = LA.Scanner();\n while (token.getValue() == null)\n {\n token = LA.Scanner();\n }\n// System.out.println(\"new token is \" + token.getValue());\n }\n else\n {\n if (token.getValue().equals(\"$\"))\n {\n error(1);\n break;\n }\n }\n }\n else if (ParsStack.peek().equals(token.getValue()))\n {\n// System.out.println(token.getValue() + \" pop\");\n ParsStack.pop();\n token = LA.Scanner();\n while (token.getValue() == null)\n {\n token = LA.Scanner();\n }\n// System.out.println(\"new token is \" + token.getValue());\n\n }\n else\n {\n error(1);\n break;\n }\n }\n /**inja ham ye else if dige bashe baraye @semanticrule ha ke codeGenerator seda zade beshe**/\n /** nazar man ro injast **/\n else if (ParsStack.peek().charAt(0) == '@')\n {\n// System.out.println(\"see semantic role\");\n if (ParsStack.peek().equals(\"@push\"))\n terminat = CodeGen.run( ParsStack.pop() , token.getValue() , LA.Line - 1);\n else\n terminat = CodeGen.run( ParsStack.pop() , ParsStack.peek() , LA.Line - 1);\n\n\n if(terminat)\n Terminate();\n /** code generation inja seda mishe **/\n }\n else if (ParsStack.peek().equals(\"$\"))\n {\n if (token.getValue().equals(\"$\"))\n {\n Accept();\n break;\n }\n else {\n error(2);\n break;\n }\n }\n else {\n error(3);\n break;\n }\n }\n\n }", "public void processSingleToken(String[] token){\n for (int i =0; i<token.length; i++){ \n\n if (isOperator(token[i])){ //Checks if token[i] is an operator by calling isOperator()\n processOperator(token[i]); //Method on line 52\n }\n else if (token[i].equals(\"d\")){\n printStack();//method on line \n }\n else if (token[i].equals(\"r\")){\n addRValueToStack();\n }\n else if (token[i].equals(\"=\")){\n printOutResult();\n }\n else if(isInteger(token[i])){ //Checks if token[i] is an integer by calling isInteger()\n addToStack(token[i]);\n }\n else{\n System.out.println(\"Unrecognised operator or operand \\\"\" + token[i] + \"\\\".\");\n } \n }\n }", "public boolean isValid_(String s) {\n\n if (s.length() % 2 != 0){\n return false;\n }\n\n Stack st = new Stack();\n\n for (int i = 0; i < s.length(); i++){\n\n String cur = String.valueOf(s.charAt(i));\n\n if (cur.equals(\"(\")){\n st.push(\")\");\n continue;\n }\n else if (cur.equals(\"{\")){\n st.push(\"}\");\n continue;\n }\n else if (cur.equals(\"[\")){\n st.push(\"]\");\n continue;\n }\n else{\n if (st.empty()){\n return false;\n }else{\n String _cur = (String) st.pop();\n if (!_cur.equals(cur)){\n return false;\n }\n }\n }\n\n }\n return true ? st.empty() : false;\n }", "public boolean isValidSerialization(String preorder) {\n Stack<String> stack = new Stack<>();\n String[] arr = preorder.split(\",\");\n for (String str : arr) {\n stack.push(str);\n\n while(stack.size() >= 3 &&\n stack.get(stack.size() - 1).equals(\"#\") &&\n stack.get(stack.size() - 2).equals(\"#\") &&\n !stack.get(stack.size() - 3).equals(\"#\")) {\n stack.pop();\n stack.pop();\n stack.pop();\n stack.push(\"#\");\n }\n }\n return stack.size() == 1 && stack.peek().equals(\"#\");\n }", "private boolean performRearrange(List<CommonToken> tokens) throws BadLocationException\n\t{\n\t\tList<TagHolder> topLevelTags=new ArrayList<MXMLRearranger.TagHolder>();\n\t\tint tagLevel=0;\n\t\tfor (int tokenIndex=0;tokenIndex<tokens.size();tokenIndex++)\n\t\t{\n\t\t\tCommonToken token=tokens.get(tokenIndex);\n\t\t\tSystem.out.println(token.getText());\n\t\t\tswitch (token.getType())\n\t\t\t{\n\t\t\t\tcase MXMLLexer.TAG_OPEN:\n\t\t\t\t\tif (tagLevel==1)\n\t\t\t\t\t{\n\t\t\t\t\t\t//capture tag\n\t\t\t\t\t\tint previousWSIndex=findPreviousWhitespaceIndex(tokens, tokenIndex-1);\n\t\t\t\t\t\tTagHolder holder=new TagHolder(tokens.get(previousWSIndex), previousWSIndex);\n\t\t\t\t\t\taddTagName(holder, tokens, tokenIndex);\n\t\t\t\t\t\tupdateCommentTagNames(topLevelTags, holder.mTagName);\n\t\t\t\t\t\ttopLevelTags.add(holder);\n\t\t\t\t\t}\n\t\t\t\t\ttagLevel++;\n\t\t\t\t\ttokenIndex=findToken(tokenIndex, tokens, MXMLLexer.TAG_CLOSE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MXMLLexer.END_TAG_OPEN:\n\t\t\t\t\ttagLevel--;\n\t\t\t\t\ttokenIndex=findToken(tokenIndex, tokens, MXMLLexer.TAG_CLOSE);\n\t\t\t\t\tif (tagLevel==1)\n\t\t\t\t\t{\n\t\t\t\t\t\tmarkTopLevelTagEnd(tokenIndex, topLevelTags);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase MXMLLexer.EMPTY_TAG_OPEN:\n\t\t\t\t\tif (tagLevel==1)\n\t\t\t\t\t{\n\t\t\t\t\t\t//capture tag\n\t\t\t\t\t\tint previousWSIndex=findPreviousWhitespaceIndex(tokens, tokenIndex-1);\n\t\t\t\t\t\tTagHolder holder=new TagHolder(tokens.get(previousWSIndex), previousWSIndex);\n\t\t\t\t\t\taddTagName(holder, tokens, tokenIndex);\n\t\t\t\t\t\tupdateCommentTagNames(topLevelTags, holder.mTagName);\n\t\t\t\t\t\ttopLevelTags.add(holder);\n\t\t\t\t\t}\n\t\t\t\t\ttokenIndex=findToken(tokenIndex, tokens, MXMLLexer.EMPTYTAG_CLOSE);\n\t\t\t\t\tif (tagLevel==1)\n\t\t\t\t\t\tmarkTopLevelTagEnd(tokenIndex, topLevelTags);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MXMLLexer.COMMENT:\n\t\t\t\t\tif (tagLevel==1)\n\t\t\t\t\t{\n\t\t\t\t\t\tint previousWSIndex=findPreviousWhitespaceIndex(tokens, tokenIndex-1);\n\t\t\t\t\t\tTagHolder holder=new TagHolder(tokens.get(previousWSIndex), previousWSIndex);\n\t\t\t\t\t\ttopLevelTags.add(holder);\n\t\t\t\t\t\tmarkTopLevelTagEnd(tokenIndex, topLevelTags);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n//\t\t\t\tcase MXMLLexer.DECL_START:\n//\t\t\t\tcase MXMLLexer.CDATA:\n//\t\t\t\tcase MXMLLexer.PCDATA:\n//\t\t\t\tcase MXMLLexer.EOL:\n//\t\t\t\tcase MXMLLexer.WS:\n\t\t\t}\n\t\t}\n\t\t\n\t\tList<TagHolder> unsortedList=new ArrayList<MXMLRearranger.TagHolder>();\n\t\tunsortedList.addAll(topLevelTags);\n\t\t\n\t\t//sort the elements in the tag list based on the supplied ordering\n\t\tString ordering=mPrefs.getString(PreferenceConstants.MXMLRearr_RearrangeTagOrdering);\n\t\tString[] tagNames=ordering.split(PreferenceConstants.AS_Pref_Line_Separator);\n\t\tSet<String> usedTags=new HashSet<String>();\n\t\tfor (String tagName : tagNames) {\n\t\t\tif (!tagName.equals(PreferenceConstants.MXMLUnmatchedTagsConstant))\n\t\t\t\tusedTags.add(tagName);\n\t\t}\n\t\tList<TagHolder> sortedList=new ArrayList<MXMLRearranger.TagHolder>();\n\t\tfor (String tagName : tagNames) \n\t\t{\n\t\t\tboolean isSpecOther=tagName.equals(PreferenceConstants.MXMLUnmatchedTagsConstant);\n\t\t\t//find all the items that match\n\t\t\tfor (int i=0;i<topLevelTags.size();i++)\n\t\t\t{\n\t\t\t\tTagHolder tagHolder=topLevelTags.get(i);\n\t\t\t\t\n\t\t\t\t//if the tagname matches the current specification \n\t\t\t\t//OR if the current spec is the \"other\" and the current tag doesn't match any in the list\n\t\t\t\tboolean tagMatches=false;\n\t\t\t\tif (!isSpecOther)\n\t\t\t\t{\n\t\t\t\t\tSet<String> testTag=new HashSet<String>();\n\t\t\t\t\ttestTag.add(tagName);\n\t\t\t\t\ttagMatches=matchesRegEx(tagHolder.mTagName, testTag);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttagMatches=(!matchesRegEx(tagHolder.mTagName, usedTags));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (tagMatches)\n\t\t\t\t{\n\t\t\t\t\ttopLevelTags.remove(i);\n\t\t\t\t\tsortedList.add(tagHolder);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsortedList.addAll(topLevelTags);\n\t\t\n\t\t//check for changes: if no changes, do nothing\n\t\tif (sortedList.size()!=unsortedList.size())\n\t\t{\n\t\t\t//error, just kick out\n\t\t\tSystem.out.println(\"Error performing mxml rearrange; tag count doesn't match\");\n\t\t\tmInternalError=\"Internal error replacing text: tag count doesn't match\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tboolean differences=false;\n\t\tfor (int i=0;i<sortedList.size();i++)\n\t\t{\n\t\t\tif (sortedList.get(i)!=unsortedList.get(i))\n\t\t\t{\n\t\t\t\tdifferences=true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!differences)\n\t\t\treturn true; //succeeded, just nothing done\n\t\t\n\t\t//reconstruct document in the sorted order\n\t\tString source=mSourceDocument.get();\n\t\tStringBuffer newText=new StringBuffer();\n\t\tfor (TagHolder tagHolder : sortedList) \n\t\t{\n\t\t\tCommonToken startToken=tokens.get(tagHolder.mStartTokenIndex);\n\t\t\tCommonToken endToken=tokens.get(tagHolder.mEndTokenIndex);\n\t\t\tString data=source.substring(startToken.getStartIndex(), endToken.getStopIndex()+1);\n\t\t\tnewText.append(data);\n\t\t}\n\t\t\n\t\tint startOffset=tokens.get(unsortedList.get(0).mStartTokenIndex).getStartIndex();\n\t\tint endOffset=tokens.get(unsortedList.get(unsortedList.size()-1).mEndTokenIndex).getStopIndex()+1;\n\t\tString oldData=mSourceDocument.get(startOffset, endOffset-startOffset);\n\t\tif (!ActionScriptFormatter.validateNonWhitespaceCharCounts(oldData, newText.toString()))\n\t\t{\n\t\t\tmInternalError=\"Internal error replacing text: new text doesn't match replaced text(\"+oldData+\")!=(\"+newText.toString()+\")\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tmSourceDocument.replace(startOffset, endOffset-startOffset, newText.toString());\n\t\t\n\t\treturn true;\n\t}", "public static int longestValidParentheses3(String str) {\n\t\tint max = 0;\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\tstack.push(-1);//先前最远的不可匹配的位置,\n\t\tint i = -1;\n// for(int i = 0;i < str.length();i++){\n\t\tfor (int j = 0; j < str.length(); j++) {\n\t\t\tchar ch = str.charAt(j);\n\t\t\tif (ch != '(' && ch != ')') {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tif (ch == '(') {\n\t\t\t\tstack.push(i);//不进行匹配,那么它就是先前最远的不可匹配的位置,\n\t\t\t} else {\n\t\t\t\tstack.pop();//闭起眼睛,匹配先前不可匹配的字符,\n\t\t\t\tif (stack.empty()) {\n\t\t\t\t\tstack.push(i);//如果栈为空,说明其实没有什么可以进行匹配的,所以当前就是新的最近的不可匹配的位置\n\t\t\t\t} else {\n\t\t\t\t\t//如果栈不为空,说明有可以进行匹配的,并且匹配完成,那么匹配的字符串长度为 i-stack.peek()\n\t\t\t\t\tif (i - stack.peek() > max) {\n\t\t\t\t\t\tSystem.out.printf(\"start:end %d:%d \\n\", stack.peek() + 1, i);\n\t\t\t\t\t}\n\t\t\t\t\tmax = Math.max(i - stack.peek(), max);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}", "public static String structureTraceback(){\r\n // Set multipleOptimal to false\r\n boolean multipleOptimal = false;\r\n\r\n // Set i,j values to 0\r\n int i = 0;\r\n int j = 0;\r\n\r\n // Set isPair to false\r\n boolean isPair = false;\r\n\r\n // Initialize string to store structure\r\n StringBuilder optimalStructure = new StringBuilder();\r\n\r\n // Loop through to traceback\r\n for (int k = 0; k < sequence.length()-1; k++) {\r\n // First thing to be added to string builder\r\n if (k == 0) {\r\n // Check if there are multiple paths\r\n if(DPMatrix[0][sequence.length() - 1] == DPMatrix[0][sequence.length() - 2] && DPMatrix[0][sequence.length() -1] == DPMatrix[1][sequence.length()-1]){\r\n // Set multiple optimal to true\r\n multipleOptimal = true;\r\n\r\n // Came from the left\r\n i = 0;\r\n\r\n // Keep going left\r\n j = sequence.length() - 2;\r\n\r\n // Add to optimal structure\r\n optimalStructure.insert(0,\".\");\r\n\r\n } else if (DPMatrix[0][sequence.length() - 1] == DPMatrix[0][sequence.length() - 2]) {\r\n // Came from left\r\n i = 0;\r\n\r\n // Keep going left\r\n j = sequence.length() - 2;\r\n\r\n // Add to optimal structure\r\n optimalStructure.insert(0,\".\");\r\n\r\n } else if (DPMatrix[0][sequence.length() - 1] == DPMatrix[1][sequence.length() - 1]){\r\n // Came from up\r\n i = 1;\r\n\r\n // Don't go left\r\n j = sequence.length() - 1;\r\n\r\n // Add to optimal structure\r\n optimalStructure.insert(0,\".\");\r\n\r\n } else if (checkPair(sequence.charAt(0), sequence.charAt(sequence.length() - 1)) == 1) {\r\n // Came from up (diagonal)\r\n i = 1;\r\n\r\n // Go left\r\n j = sequence.length() - 2;\r\n\r\n // It is a pair (with -2)\r\n isPair = true;\r\n\r\n // Add to optimal structure\r\n optimalStructure.insert(0, \"(\");\r\n\r\n } else if (checkPair(sequence.charAt(0), sequence.charAt(sequence.length() - 1)) == 2) {\r\n // Came form up (diagonal)\r\n i = 1;\r\n\r\n // Go left\r\n j = sequence.length() - 2;\r\n\r\n // It is a pair (with -3)\r\n isPair = true;\r\n\r\n // Add to optimal structure\r\n optimalStructure.insert(0, \"(\");\r\n\r\n } else {\r\n // Bifurcation\r\n optimalStructure.insert(0,\".\");\r\n }\r\n // Not first thing in string builder\r\n } else {\r\n //\r\n if (DPMatrix[i][j] == DPMatrix[i][j - 1] && DPMatrix[i][j] == DPMatrix[i + 1][j]){\r\n // Go left\r\n j = j-1;\r\n\r\n // Add to optimal structure\r\n optimalStructure.insert(0,\".\");\r\n\r\n // There is multiple optimal\r\n multipleOptimal = true;\r\n\r\n } else if (DPMatrix[i][j] == DPMatrix[i][j - 1]) {\r\n // Go left\r\n j = j-1;\r\n\r\n // Add to optimal structure\r\n optimalStructure.insert(0,\".\");\r\n\r\n } else if (DPMatrix[i][j] == DPMatrix[i + 1][j]){\r\n // Go down\r\n i = i+1;\r\n\r\n // Add to optimal structure\r\n optimalStructure.insert(0,\".\");\r\n\r\n // Check if it is a pair resulting in -2\r\n } else if (checkPair(sequence.charAt(i), sequence.charAt(j)) == 1) {\r\n // Move diagonally\r\n i = i+1;\r\n j = j-1;\r\n\r\n // If not pair\r\n if (!isPair) {\r\n // Add to optimal structure\r\n optimalStructure.insert(0, \")\");\r\n } else if (isPair){\r\n // Add to optimal structure\r\n optimalStructure.insert(0, \"(\");\r\n }\r\n\r\n // Set pair to true\r\n isPair = true;\r\n\r\n // Check if it is a pair resulting in -3\r\n } else if (checkPair(sequence.charAt(i), sequence.charAt(j)) == 2) {\r\n // Check if it is a pair resulting in -2\r\n if (DPMatrix[i][j] == DPMatrix[i + 1][j - 1] - 3){\r\n // Move diagonally\r\n i = i+1;\r\n j = j-1;\r\n\r\n // If not pair\r\n if (!isPair) {\r\n // Add to optimal structure\r\n optimalStructure.insert(0, \")\");\r\n } else if (isPair){\r\n // Add to optimal structure\r\n optimalStructure.insert(0, \"(\");\r\n }\r\n\r\n // Set pair to true\r\n isPair = true;\r\n }\r\n } else {\r\n // add to optimal structure\r\n optimalStructure.insert(0,\".\");\r\n }\r\n }\r\n }\r\n\r\n // If pair\r\n if (isPair) {\r\n // Add to optimal structure\r\n optimalStructure.insert(0, \"(\");\r\n } else {\r\n // Add to optimal structure\r\n optimalStructure.insert(0, \".\");\r\n }\r\n\r\n // Create file for multiple optimal\r\n File file = new File(\"5.o2\");\r\n\r\n // Try opening a file to write to\r\n try {\r\n // Create writer\r\n BufferedWriter writer = new BufferedWriter(new FileWriter(file));\r\n\r\n // Determine what to write\r\n if (multipleOptimal){\r\n writer.write(\"YES\");\r\n } else {\r\n writer.write(\"NO\");\r\n }\r\n\r\n // Close writer\r\n writer.close();\r\n\r\n } catch (IOException e) {\r\n // Display error message\r\n System.out.println(\"Error opening file 5.o2\");\r\n }\r\n\r\n // Change structure into a string\r\n String structure = optimalStructure.toString();\r\n\r\n // Return the string\r\n return structure;\r\n\r\n }", "public static boolean isBalanced(String str) {\n int count = 0;\n\n for (int i = 0; i < str.length() && count >= 0; i++) {\n if (str.charAt(i) == '(')\n count++;\n else if (str.charAt(i) == ')')\n count--;\n }\n\n return count == 0;\n}", "public void stack()\r\n\t{\r\n\t\tfor(Character c: stack)\r\n\t\t{\r\n\t\t\tSystem.out.println(c);\r\n\t\t}\r\n\t}", "public boolean isWellFormed(String inputPattern) {\n //empty or zero length patterns results in not well-form\n \tif (inputPattern == null || inputPattern.length() == 0) {\n return false;\n }\n // odd number of alphabets in the pattern would always result in false\n if ((inputPattern.length() % 2) != 0) {\n return false;\n }\n\n final Stack<Character> stack = new Stack<Character>();\n \n //process each alphabet in the input pattern until its get finished or \n //some decision is made \n \n for (int i = 0; i < inputPattern.length(); i++) {\n \t//tests if selected character is starting bracket or any other character\n if (brackets.containsKey(inputPattern.charAt(i))) {\n \t//testing case where inside parenthesis () only braces {} are allowed \n \tif(!stack.empty() && stack.peek() == '('){\n \t\tif(inputPattern.charAt(i) == '{'){\n \t\t\tstack.push(inputPattern.charAt(i));\n \t\t}else {\n \t\t\treturn false;\n \t\t}\n \t//testing case where inside braces {} only square brackets [] are allowed\n \t}else if(!stack.empty() && stack.peek() == '{'){\n \t\tif(inputPattern.charAt(i) == '['){\n \t\t\tstack.push(inputPattern.charAt(i));\n \t\t}else {\n \t\t\treturn false;\n \t\t}\n \t}else {\n \t\tstack.push(inputPattern.charAt(i));\n \t}\n //tests unexpectedly stack is empty or the closing bracket(unexpected character) unmatched\n } else if (stack.empty() || (inputPattern.charAt(i) != brackets.get(stack.pop()))) {\n return false;\n } \n }\n return true;\n }", "private void processBracket() {\r\n\t\tif (expression[currentIndex] == '(') {\r\n\t\t\ttoken = new Token(TokenType.OPEN_BRACKET, expression[currentIndex]);\r\n\t\t} else {\r\n\t\t\ttoken = new Token(TokenType.CLOSED_BRACKET, expression[currentIndex]);\r\n\t\t}\r\n\r\n\t\tcurrentIndex++;\r\n\t}", "@Test\n\tpublic void testLookaheadBoundary() {\n\t\t\n\t\t\n\t\tString lookaheads[] = {\"[true, f\", \"{\\\"boo\\\": nu\", \"[false, tr\", \"[false, t\", \"[false, tru\"};\n\t\t\n\t\tfor (String lookahead: lookaheads) {\n\t\t\tJSONParser jp = new JSONParser();\n\t\t\tList<ParsedElement> elements = jp.parse(lookahead);\n\t\t\tassertTrue(String.format(\"lookahead <%s> doesn't crash the parser\", lookahead),elements.size() == 3);\n\t\t}\n\t\t\n\t\tJSONParser jp = new JSONParser();\n\t\tList<ParsedElement> elements = jp.parse(\"{\\\"foo\\\": true\");\n\t\tassertTrue(\"Barewords are parsed at the right lookahead length\", elements.size() == 4);\n\t\t\n\t\telements = jp.parse(\"{\\\"foo\\\": false\");\n\t\tassertTrue(\"Barewords are parsed at the right lookahead length\", elements.size() == 4);\n\t\t\n\t\telements = jp.parse(\"[1, 2, 3, nul\");\n\t\tassertTrue(\"Barewords are parsed at the right lookahead length\", elements.size() == 7);\n\t}", "static void testCase() throws IOException{\r\n /*\r\n [\"MinStack\",\"push\",\"push\",\"push\",\"top\",\"pop\",\"getMin\",\"pop\",\"getMin\",\"pop\",\"push\",\"top\",\"getMin\",\"push\",\"top\",\"getMin\",\"pop\",\"getMin\"]\r\n[[],[2147483646],[2147483646],[2147483647],[],[],[],[],[],[],[2147483647],[],[],[-2147483648],[],[],[],[]]\r\n */\r\n\r\n try{\r\n long startTime, stopTime;\r\n startTime = System.currentTimeMillis();\r\n printSpace(logic(0));\r\n println(0);\r\n stopTime = System.currentTimeMillis();\r\n println((stopTime - startTime)+\" ms\");\r\n\r\n startTime = System.currentTimeMillis();\r\n printSpace(logic(4));\r\n println(4);\r\n stopTime = System.currentTimeMillis();\r\n println((stopTime - startTime)+\" ms\");\r\n }catch(IOException ex){\r\n ex.printStackTrace();\r\n }\r\n }", "public void traverseStack(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // check if stack is empty\n if(this.topOfStack==-1){\n System.out.println(\"Stack is empty, can't traverse\");\n return;\n }\n // if stack is not empty\n System.out.println(\"Printing stack...\");\n for(int i=0;i<=this.topOfStack;i++){\n System.out.print(this.arr[i]+\" \");\n }\n System.out.println();\n }", "public static int longestValidParentheses_stack(String s) {\n if (s == null || s.length() <= 1) {\n return 0;\n }\n\n int max = 0;\n int len = s.length();\n Stack<Integer> stack = new Stack<>();\n stack.push(-1);\n for (int i = 0; i < len; i++) {\n char ch = s.charAt(i);\n if (ch == '(') {\n stack.push(i);\n } else {\n stack.pop();\n if (stack.empty()) {\n stack.push(i);\n } else {\n max = Math.max(max, i - stack.peek());\n }\n }\n }\n\n return max;\n }", "public static boolean isBalanced(String expression) {\n if ((expression.length() % 2) == 1) return false;\n else {\n char[] brackets = expression.toCharArray();\n LinkedList<Character> cList = new LinkedList<>();\n for (char bracket : brackets) {\n switch (bracket) {\n case '{':\n cList.addFirst('}');\n break;\n case '(':\n cList.addFirst(')');\n break;\n case '[':\n cList.addFirst(']');\n break;\n default:\n if (cList.isEmpty() || bracket != cList.removeFirst()) return false;\n }\n }\n return cList.isEmpty();\n }\n }", "public void buildStack(State [] sa) {\r\n for(State s : sa) {\r\n if(s != null && !(contains(open,s)||contains(close,s))) {\r\n open.add(s);\r\n }\r\n }\r\n }", "public static String isMatching(String str){\n\t\tint l=str.length();\n\t\tSolution obj = new Solution();\n\t\tfor(int i=0;i<l;i++){\n\t\t\tchar temp = str.charAt(i);\n\t\t\tif(temp=='{' || temp=='[' || temp=='('){\n\t\t\t\tobj.push(temp);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tchar top=obj.peek();\n\t\t\t\tif((top=='{' && temp=='}') || (top=='(' && temp==')') ||(top=='[' && temp==']'))\n\t\t\t\t\tobj.pop();\n\t\t\t\telse\n\t\t\t\t\treturn \"NO\";\n\t\t\t}\n\t\t}\n\t\tif(obj.isEmpty()){\n\t\t\treturn \"YES\";\n\t\t}\n\t\telse{\n\t\t\treturn \"NO\";\n\t\t}\n\t}", "public void print_stacks(ArrayList<ArrayList<Stack<Integer>>> stacks) {\n\t\tfor (int k=0; k<size*size; k++) {\n\t\t\tSystem.out.println(\"----------------------------------------\\n\\tRow \"+k+\"'s Possible Values\\n----------------------------------------\");\n\t\t\tfor (int l=0; l<size*size; l++) {\n\t\t\t\tSystem.out.print(\"col \"+l+\" |\");\n\t\t\t\tif (!stacks.get(k).get(l).empty()) System.out.println(stacks.get(k).get(l));\n\t\t\t\telse System.out.println();\t\n\t\t\t}\n\t\t}\n\t}", "private boolean solveNext(){\n Stack<Integer[]> emptyPositions = findEmptyPositions();\n\n while (!emptyPositions.isEmpty()) {\n\n //get the top empty position from the stack.\n Integer[] position = emptyPositions.peek();\n int row = position[0];\n int col = position[1];\n\n for (int value = 1; value <= size; value++) {\n if (isPositionValid(row, col, value)){\n\n //value is valid, we can set it to the board.\n board[row][col] = value;\n\n //recursive backtracking\n if(solveNext()) {\n\n //if the value leads to a solution, pop it from the stack.\n emptyPositions.pop();\n return true;\n }\n else board[row][col] = 0;\n\n }\n }\n return false;\n }\n return true;\n }", "public int longestValidParenthesesBrute(String s) {\n Stack<Integer> stack = new Stack<>();\n stack.push(-2);\n\n for (int i = 0; i < s.length(); i++) {\n if (s.charAt(i) == '(') {\n stack.push(-1);\n } else if (s.charAt(i) == ')') {\n int count = 0;\n while (true) {\n int len = stack.pop();\n if (len == -1) {\n count += 2;\n stack.push(count);\n break;\n } else if (len == -2) {\n stack.push(-2);\n if (count > 0) {\n stack.push(count);\n stack.push(-2);\n } else {\n stack.push(-2);\n }\n break;\n } else {\n count += len;\n }\n }\n }\n }\n int maxLength = 0;\n int count = 0;\n while (!stack.empty()) {\n int len = stack.pop();\n if (len == -2 || len == -1) {\n maxLength = Math.max(maxLength, count);\n count = 0;\n } else {\n count += len;\n }\n }\n\n return Math.max(maxLength, count);\n }", "public static boolean isBalanced(String exp) {\n\t\tStack<Character> stack = new Stack<>(exp.length());\n\t\tfor (int i = 0; i < exp.length(); i++) {\n\t\t\tchar ch = exp.charAt(i);\n\t\t\tswitch (ch) {\n\t\t\tcase '(':\n\t\t\tcase '{':\n\t\t\tcase '[':\n\t\t\t\tstack.push(ch);\n\t\t\t\tbreak;\n\t\t\tcase ')': {\n\t\t\t\tchar ch1 = stack.pop();\n\t\t\t\tif (ch1 != '(')\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '}': {\n\t\t\t\tchar ch1 = stack.pop();\n\t\t\t\tif (ch1 != '{')\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ']': {\n\t\t\t\tchar ch1 = stack.pop();\n\t\t\t\tif (ch1 != '[')\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn stack.isEmpty();\n\t}", "private boolean split(String tests) {\n\n//\tSystem.out.println(\"Now in the split function\\nand the tests are \"+tests);\n\tArrayList<String> conditions = new ArrayList<String>();\n\tPattern p_node_name;\n\tMatcher matcher;\n\tint count = 0, start=-1, j, end = -1, quot = 0;\n\tp_node_name = Pattern.compile(\"^\\\\s*([A-Z]|[a-z]|\\\\_)+([A-Z]|[a-z]|[0-9]|\\\\_|\\\\.|\\\\-)*\\\\s*$\");\n\tString childrenStep;\n\tfor(j = 0; j < tests.length(); j++){\n\t\tif(quot == 0 && tests.charAt(j)=='['){\n//\t\t\tSystem.out.println(\"char at \"+j+\" is [\\n\");\n\t\t\tif(count==0){\n\t\t\t\tstart = j+1;\n\t\t\t}\n\t\t\tcount++;\n//\t\t\tSystem.out.println(\"and the count is \"+count);\n\t\t}\n\t\tif(tests.charAt(j)=='\"' && quot == 0){\n//\t\t\tSystem.out.println(\"char at \"+j+\" is \\\"\\n\");\n\t\t\tquot = 1;\n\t\t\tj++;\n\t\t}\n\t\tif(tests.charAt(j)=='\"' && quot == 1){\n\t\t\tif(tests.charAt(j-1)!='\\\\'){\n//\t\t\t\tSystem.out.println(\"char at \"+j+\" is \\\"\\nand it is the second \\\"\");\n\t\t\t\tj++;\n\t\t\t\twhile(j<tests.length() && (tests.charAt(j)==' ')){\n\t\t\t\t\tj++;\t\t\n\t\t\t\t}\n\t\t\t\tif(j== tests.length()) return false;\n\t\t\t\tif(tests.charAt(j)==')'){\n\t\t\t\t\tj++;\n\t\t\t\t\twhile(j<tests.length() && (tests.charAt(j)==' ')){\n\t\t\t\t\t\tj++;\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(j== tests.length()) return false;\n\t\t\t\t}\n\t\t\t\tif(tests.charAt(j)!=']') return false;\n\t\t\t\tquot = 0;\n\t\t\t}\n\t\t}\n\t\tif(quot ==0 && tests.charAt(j)==']'){\n//\t\t\tSystem.out.println(\"char at \"+j+\" is ]\\n\");\n\t\t\tcount--;\n\t\t\tend = j;\n//\t\t\tSystem.out.println(\"and the count is \"+count);\n\t\t}\n\t\tif(tests.charAt(j)=='/' && quot == 0 && end == -1 && start == -1){\n\t\t\tchildrenStep = tests.substring(j+1);\n\t\t\ttests = tests.substring(0,j);\n\t\t\tif(validHelper(tests)){\n\t\t\t\treturn validHelper(childrenStep);\n\t\t\t}\n\t\t}\n\t\tif(start!= -1 && count==0){\n//\t\t\tSystem.out.println(\"the condition is \"+tests.substring(start,end));\n\t\t\tconditions.add(tests.substring(start,end));\n\t\t\tstart=-1;\n\t\t\tend = -1;\n\t\t\tquot = 0;\n\t\t}\n\t}\n//\tSystem.out.println(conditions.size());\n\tif(conditions.size()!=0){\n\t\tfor(j = 0; j <conditions.size(); j++){\n\t\t\tString temp = conditions.get(j);\n\t\t\tif(!validTest(temp)){\n//\t\t\t\tSystem.out.println(\"######1\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n//\t\tSystem.out.println(\"######2\");\n\t\tif(j==conditions.size()) return true;\n\t}\n//\tSystem.out.println(\"######3\");\n\treturn false;\n\t\n}", "@Override\n public boolean isValidParenthesis(String str) {\n if (isEmptyOrNull(str)) {\n return true;\n }\n int counter = 0;\n int maxCounter = 0;\n for (char c : str.toCharArray()) {\n if (c == OPEN.getExpr()) {\n ++counter;\n ++maxCounter;\n }\n if (c == CLOSE.getExpr()) {\n if (counter > 0) {\n --counter;\n }\n --maxCounter;\n }\n if (c == WILDCHAR.getExpr()) {\n if (counter > 0) {\n --counter;\n }\n ++maxCounter;\n }\n if (maxCounter < 0) {\n return false; // too many CLOSE\n }\n }\n return (counter == 0);\n }", "static boolean findDuplicate (String word)\n {\n Stack<Character> st = new Stack<>();\n for (int i = 0; i < word.length(); i++) {\n\n char currentChar = word.charAt(i);\n\n if (currentChar == ')') {\n\n if (st.peek() == '(') {\n return true;\n }\n else {\n while (st.peek() != '(') {\n st.pop();\n }\n st.pop();\n }\n }\n else {\n st.push(currentChar);\n }\n }\n return false;\n }", "public static ArrayDeque<String> parseSingle (String inputString) {\n\n //using ArrayDeque here since it does everything and is flexible. Could do a linkedList though..?\n ArrayDeque inputQueue = new ArrayDeque<String>();; //input queue. not sure if i really need this\n ArrayDeque outputQueue = new ArrayDeque<String>();//output queue\n ArrayDeque operatorStack = new ArrayDeque<String>(); //operator stack\n\n //remove spaces\n inputString = inputString.replaceAll(\"\\\\s+\", \"\");\n\n String inputArray[] = inputString.split(\"(?<==>|&|~|\\\\/|<=>)|(?==>|&|~|\\\\/|<=>)\"); //TODO build this regex dynamically from Connective enum\n for (String inputElement: inputArray) {\n inputQueue.add(inputElement);\n }\n\n //convert to rpn form\n //don't worry about parentheses, do later as part of research\n while (!inputQueue.isEmpty()) {\n //check if element is a operator\n if (isOperator((String)inputQueue.peekFirst())) {\n\n //add operator to stack if empty\n if (operatorStack.isEmpty()) {\n operatorStack.addLast(inputQueue.pollFirst());\n\n //while there is an operator on the operatorStack with greater precedence than the current pop that one\n } else if (compare((String)inputQueue.peekFirst(), (String)operatorStack.peekLast()) <= 0) {\n outputQueue.add(operatorStack.pollLast());\n continue; //need to restart loop since may be operatorStack.size() > 1\n } else {\n operatorStack.addLast(inputQueue.pollFirst());\n }\n //operands\n } else {\n outputQueue.add(inputQueue.pollFirst());\n }\n }\n\n //once inputQueue is empty need to finish draining the operators\n while (!operatorStack.isEmpty()) {\n outputQueue.add(operatorStack.pollLast());\n }\n\n //TODO: maybe convert proposition symbol to Horn form\n\n return (outputQueue);\n }", "@Test\n public void subSequencesTest3() {\n String text = \"wnylazlzeqntfpwtsmabjqinaweaocfewgpsrmyluadlybfgaltgljrlzaaxvjehhygggdsrygvnjmpyklvyilykdrphepbfgdspjtaap\"\n + \"sxrpayholutqfxstptffbcrkxvvjhorawfwaejxlgafilmzrywpfxjgaltdhjvjgtyguretajegpyirpxfpagodmzrhstrxjrpirlbfgkhhce\"\n + \"wgpsrvtuvlvepmwkpaeqlstaqolmsvjwnegmzafoslaaohalvwfkttfxdrphepqobqzdqnytagtrhspnmprtfnhmsrmznplrcijrosnrlwgds\"\n + \"bylapqgemyxeaeucgulwbajrkvowsrhxvngtahmaphhcyjrmielvqbbqinawepsxrewgpsrqtfqpveltkfkqiymwtqssqxvchoilmwkpzermw\"\n + \"eokiraluaammkwkownrawpedhcklrthtftfnjmtfbftazsclmtcssrlluwhxahjeagpmgvfpceggluadlybfgaltznlgdwsglfbpqepmsvjha\"\n + \"lwsnnsajlgiafyahezkbilxfthwsflgkiwgfmtrawtfxjbbhhcfsyocirbkhjziixdlpcbcthywwnrxpgvcropzvyvapxdrogcmfebjhhsllu\"\n + \"aqrwilnjolwllzwmncxvgkhrwlwiafajvgzxwnymabjgodfsclwneltrpkecguvlvepmwkponbidnebtcqlyahtckk\";\n\n String[] expected = new String[6];\n expected[0] = \"wlfaafrdarvgypipgaputcjflmftgepfmrrhpvwllnfofdqqtmhnjlyeewvxhceqpgftysopelkrhhjtmlapcagllpasazflfthohdtrrvobliwnhazafeevpnlk\";\n expected[1] = \"nzpbwemllljggylhdaatprhwgzxdttypzxlhslksmeohkronrpmprwlmubovmylispqkmqizouwactmatlhmedagfmlafktgmfhcjlhxoagjullcrfxbslceoeyk\";\n expected[2] = \"yewjewyytzegvkyespyqtkoaarjhyaiarjbcrvptsgsatpbyhrslogaycawnajvnxspfwxlekakwkftzcujgglldbswjybhktxcizpypppchanlxwawjctgpnba\";\n expected[3] = \"lqtqaglbgahdnlkppshffxrefygjgjrghrfeveaavmllthqtstrrsdpxgjsgprqarrvktvmriaopltfsswevgytwpvslaiwirjfricwgzxmhqjzvljnglrumbth\";\n expected[4] = \"ansiopuflahsjvdbjxoxfvajiwavuepospgwtpeqjzavfezapfmcnsqeurrthmbweqeqqcwmrmwerfbcshaflbzsqjnghlswabsbibwvvdfsrowgwvyowpvwict\";\n expected[5] = \"ztmncsagjxyrmyrftrlsbvwxlpljrgxdtikgumqowaawxpdgnnzirbgalkhahibewtlishkwamndtnflrxgpufngehniexfgwbykxcncyrelwlmkigmdnklkdqc\";\n int keyLen = 6;\n String[] owns = this.ic.subSequences(text, keyLen);\n for (int i = 0; i < expected.length; i++) {\n assertEquals(expected[i], owns[i]);\n }\n }", "private static boolean wrongClosingScope(char top, char val) {\n return (top == '{' || top == '[' || top == '(') &&\n (val == '}' || val == ']' || val == ')');\n }", "public boolean stackEmpty() {\r\n\t\treturn (top == -1) ? true : false;\r\n\t }", "public static String SimpleSymbols(String str) {\n char curr_char = '0';\n char prev_char = '0';\n char next_char = '0';\n String out_str = \"true\";\n int i = 0;\n boolean parsing_done = false;\n boolean pattern_found = false;\n boolean wrong_pattern_found = false;\n \n if( Character.isLetterOrDigit(str.charAt(0)))\n {\n wrong_pattern_found = true;\n }\n do\n {\n if( str.length() < 3 )\n {\n parsing_done = true;\n }\n else\n {\n int last_index = str.length() - 1;\n if( i + 2 == last_index )\n {\n parsing_done = true;\n //pattern_found = false;\n //System.out.print(\"Check of last index\" + i + last_index ); \n next_char = str.charAt(i+2);\n curr_char = str.charAt(i+1);\n prev_char = str.charAt(i);\n }\n else if( i+2 > last_index )\n {\n parsing_done = true;\n } //pattern_found = false;\n else\n {\n next_char = str.charAt(i+2);\n curr_char = str.charAt(i+1);\n prev_char = str.charAt(i);\n }\n \n if(Character.isLetterOrDigit(curr_char))\n {\n if(prev_char == '+' && next_char == '+')\n {\n i++;\n pattern_found = true;\n }\n else\n {\n wrong_pattern_found = true;\n parsing_done = true;\n }\n }\n else\n {\n i++;\n }\n }\n } while( !parsing_done );\n \n if(wrong_pattern_found )\n {\n out_str = \"false\";\n } \n else if( pattern_found )\n out_str = \"true\";\n else\n out_str = \"false\";\n \n return out_str;\n \n }", "public boolean try_parse_ahead(boolean z) throws Exception {\r\n virtual_parse_stack virtual_parse_stack = new virtual_parse_stack(this.stack);\r\n while (true) {\r\n short s = get_action(virtual_parse_stack.top(), cur_err_token().sym);\r\n if (s == 0) {\r\n return false;\r\n }\r\n if (s > 0) {\r\n int i = s - 1;\r\n virtual_parse_stack.push(i);\r\n if (z) {\r\n debug_message(\"# Parse-ahead shifts Symbol #\" + cur_err_token().sym + \" into state #\" + i);\r\n }\r\n if (!advance_lookahead()) {\r\n return true;\r\n }\r\n } else {\r\n int i2 = (-s) - 1;\r\n if (i2 == start_production()) {\r\n if (z) {\r\n debug_message(\"# Parse-ahead accepts\");\r\n }\r\n return true;\r\n }\r\n short[][] sArr = this.production_tab;\r\n short s2 = sArr[i2][0];\r\n short s3 = sArr[i2][1];\r\n for (int i3 = 0; i3 < s3; i3++) {\r\n virtual_parse_stack.pop();\r\n }\r\n if (z) {\r\n debug_message(\"# Parse-ahead reduces: handle size = \" + ((int) s3) + \" lhs = #\" + ((int) s2) + \" from state #\" + virtual_parse_stack.top());\r\n }\r\n virtual_parse_stack.push(get_reduce(virtual_parse_stack.top(), s2));\r\n if (z) {\r\n debug_message(\"# Goto state #\" + virtual_parse_stack.top());\r\n }\r\n }\r\n }\r\n }", "public int maxLengthOfValidParenthesesStack(String s) {\n if (s == null || s.length() == 0) return 0;\n int n = s.length(), p = -1, max = 0;\n int [] st = new int[n + 1];\n st[++p] = -1;\n\n for (int i = 0; i < n; ++i) {\n if (st[p] != -1 && s.charAt(st[p]) == '(' && s.charAt(i) == ')') {\n --p;\n max = Math.max(max, i - st[p]);\n } else st[++p] = i;\n }\n return max;\n }", "public void clearTheStack() {\n int size = expStack.size();\n for (int i = size - 1; i >= 0; i--) {\n String str = expStack.get(i);\n if (!str.equals(\"(\")) {\n postFix.add(str);\n }\n }\n }", "private boolean isComplete() {\n if (this.content.charAt(0) != '<' || this.content.charAt(this.content.length() - 1) != '>') {\n throw new IllegalArgumentException(\"Invalid XML file.\");\n }\n Stack<String> xmlTags = new Stack<>();\n for (int i = 0; i < this.content.length();) {\n String currTag = \"\";\n int j = 0;\n for (j = 0; i + j < this.content.length(); ++j) {\n if (this.content.charAt(i + j) == '>') {\n currTag = this.content.substring(i, i + j + 1);\n break;\n }\n }\n String word = \"\";\n if (currTag.charAt(1) == '/') {\n word = currTag.substring(2, currTag.length() - 1);\n if (!word.equals(xmlTags.peek())) {\n throw new IllegalArgumentException(\"Invalid end tag: should be \"\n + xmlTags.peek() + \", but got \" + word);\n }\n xmlTags.pop();\n if (xmlTags.size() == 0 && i + word.length() + 3 < this.content.length() - 1) {\n throw new IllegalArgumentException(\"Content after root tag.\");\n }\n this.result.add(\"end:\" + word);\n }\n else {\n word = currTag.substring(1, currTag.length() - 1);\n if (checkTag(word)) {\n xmlTags.push(word);\n this.result.add(\"start:\" + word);\n }\n else {\n throw new IllegalArgumentException(\"Invalid tag.\");\n }\n }\n i = i + j + 1;\n for (j = i; j < this.content.length(); ++j) {\n if (this.content.charAt(j) == '<') {\n break;\n }\n }\n word = \"\";\n if (i != j) {\n word = this.content.substring(i, j);\n }\n if (word.length() > 0) {\n this.result.add(\"char:\" + word);\n }\n i = j;\n }\n return xmlTags.empty();\n }", "public static void main(String[] args) {\n\t\n\t\tString exp =\"({})\";\n\t\t\n\t\tboolean b = isBalancedParenthesis(exp);\n\t\t\n\t\tSystem.out.println(b);\n\t\t\t}", "public static void main(String[] args) {\n\t\tString s = \"((({}{}[])))\";\n\t\tValidBrackets vb = new ValidBrackets();\n\t\tSystem.out.println(vb.isValid(s));\n\t\t\n\t}", "public static boolean checkSequence(String cards){\r\n //split all the cards and store in card array\r\n String[] cardArray = cards.split(\",\");\r\n //convert card array into card object arrayList\r\n ArrayList<Card> cardList = new ArrayList<Card>();\r\n int numCards = cardArray.length;\r\n //if there is less than 3 cards eliminate deck\r\n if(numCards < 3) return false;\r\n //store suit and face value in card object\r\n for(int i=0;i<numCards;i++){\r\n Card c = new Card(cardArray[i].split(\"#\")[0].trim(),cardArray[i].split(\"#\")[1].trim());\r\n cardList.add(c);\r\n }\r\n int i=0;\r\n String cardSuit=\"\",nextCardSuit=\"\";\r\n int cardValue=-1,nextCardValue=-1,prevCardValue = -1;\r\n \r\n //loop till penultimate card\r\n for(i=0; i<numCards-1 ;i++){ \r\n \r\n cardValue = cardList.get(i).value;\r\n nextCardValue = cardList.get(i+1).value;\r\n cardSuit = cardList.get(i).suit;\r\n nextCardSuit = cardList.get(i+1).suit;\r\n \r\n //suit check\r\n if(!cardSuit.equals(nextCardSuit)) return false;\r\n \r\n //card check\r\n if(cardValue != nextCardValue-1){\r\n \r\n //exception only for queen followed by king followed by ace\r\n if(!(prevCardValue==11 && cardValue == 12 && nextCardValue ==0)){\r\n return false;\r\n }\r\n }\r\n //execption for king followed by ace followed by 2\r\n if(prevCardValue == 12 && cardValue == 0 && nextCardValue==1) return false;\r\n prevCardValue = cardValue;\r\n }\r\n \r\n return true;\r\n }", "@Test\n public void testNesting() {\n assertThat(regex(\n seq(\n e(\"0\"),\n or(\n e(\"1\"),\n seq(\n e(\"2\"),\n opt(e(\"3\"), e(\"4\")))),\n e(\"5\"), e(\"6\"))))\n .isEqualTo(\"0(?:1|2(?:3|4)?)56\");\n }", "public static void main(String[] args) {\n String s=\"[()]{}{[()()]()}\";\n \n System.out.println(isBalanced(s));\n String s1=\"[(])\";\n System.out.println(isBalanced(s1));\n \n \n }", "public boolean isValid(String s) {\n if (s.charAt(0) == ')' || s.charAt(0) == ']' || s.charAt(0) == '}') {\n return false;\n }\n Stack<Character> stack = new Stack<>();\n for (char c : s.toCharArray()) {\n switch (c) {\n case '(':\n case '[':\n case '{':\n stack.push(c);\n break;\n case ')':\n if (stack.isEmpty() || stack.pop() != '(') {\n return false;\n }\n break;\n case '}':\n if (stack.isEmpty() || stack.pop() != '{') {\n return false;\n }\n break;\n case ']':\n if (stack.isEmpty() || stack.pop() != '[') {\n return false;\n }\n break;\n }\n }\n return stack.isEmpty();\n }", "int isStructure(String[] h, int start) {\r\n\t\tfor (int i = start; i < h.length; i++) {\r\n\t\t\tif (openStatement(h[i]) == 0) {// if variable\r\n\t\t\t\ti++;\r\n\t\t\t\tif (i < (h.length - 1)) { // if not last input\r\n\t\t\t\t\tif (isSymbol(h[i]) == 0) { //\r\n\t\t\t\t\t\tSystem.out.println(h[i]);\r\n\t\t\t\t\t\terrorMsg = \"inncorrect structure\";\r\n\t\t\t\t\t\treturn 0; // will not run\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (i == (h.length - 1)) {// if last input\r\n\t\t\t\t\tif (isSymbol(h[i]) == 0) { // if not operand or ends on variable\r\n\t\t\t\t\t\tSystem.out.println(h[i]);\r\n\t\t\t\t\t\terrorMsg = \"unknown operand or ends on variable\";\r\n\t\t\t\t\t\treturn 0; // will not run\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (openStatement(h[i]) == 2) {\r\n\t\t\t\tSystem.out.println(h[i]);\r\n\t\t\t\terrorMsg = \"inncorrect structure\";\r\n\t\t\t\treturn 0; // will not run\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(h[i] + \" \" + h[i + 1]);\r\n\t\t\t\terrorMsg = \"cant have keywords side by side\";\r\n\t\t\t\treturn 0; // if not a variable will not run\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 1;\r\n\t}", "private int doCheckBrackets(String text) {\n int countLeftBracket = 0;\n int countRightBracket = 0;\n\n String[] members = text.split(\"\");\n for (int i = 0; i < members.length; i++){\n if (members[i].equals(\"(\")){\n countLeftBracket++;\n }else if (members[i].equals(\")\")){\n countRightBracket++;\n }\n }\n\n return countLeftBracket - countRightBracket;\n }", "@Test\n public void basicQueueOfStacksTest() {\n \n QueueOfStacks<String> tempQueue = new QueueOfStacks<String>();\n String tempCurrentElement;\n \n assertTrue(\"Element not in queue\", tempQueue.isEmpty());\n tempQueue.add(\"a\");\n assertTrue(\"Element not in queue\", !tempQueue.isEmpty());\n tempQueue.add(\"b\");\n assertTrue(\"Number of elements not correct\", tempQueue.size() == 2);\n \n tempCurrentElement = tempQueue.peek();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"a\"));\n\n tempCurrentElement = tempQueue.remove();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"a\") &&\n tempQueue.size() == 1);\n \n tempQueue.add(\"c\");\n assertTrue(\"Number of elements not correct\", tempQueue.size() == 2);\n \n tempCurrentElement = tempQueue.remove();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"b\") &&\n tempQueue.size() == 1 &&\n !tempQueue.isEmpty());\n \n tempCurrentElement = tempQueue.remove();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"c\") &&\n tempQueue.size() == 0 &&\n tempQueue.isEmpty());\n \n }", "private boolean scanFrameOpen() {\n\n // scan until we find the three sequential opens...\n int openCount = 0;\n boolean done = false;\n while( !done & (openCount < 3) ) {\n if( OPEN == buffer.get() ) {\n openCount++;\n if( openCount == 1 ) buffer.mark(); // remember where this started, in case we have to rewind to here...\n }\n else openCount = 0;\n done = !buffer.hasRemaining();\n }\n\n // if we ran out of characters, go back to our marked position (if we have one) so we can rescan it after bytes are added...\n if( done ) if( openCount > 0 ) buffer.reset();\n\n return done;\n }", "public boolean isValid(String s) {\n\n if (s.length() % 2 != 0){\n return false;\n }\n\n HashMap<String, String> map = new HashMap<>();\n Stack st = new Stack();\n\n map.put(\"(\", \")\");\n map.put(\"{\", \"}\");\n map.put(\"[\", \"]\");\n\n for (int i = 0; i < s.length(); i++){\n String cur = String.valueOf(s.charAt(i));\n if (st.empty() && !map.containsKey(cur)){\n return false;\n }\n if (map.containsKey(cur)){\n st.push(cur);\n }\n else{\n String popElement = (String) st.pop();\n String expect = map.get(popElement);\n if (!expect.equals(cur)){\n return false;\n }\n }\n }\n return true ? st.empty() : false;\n }", "private boolean isOutsideOfBracket(String expr, int pos) {\r\n int level = 0;\r\n \r\n for (int i = 0; i < expr.length(); i++) {\r\n char c = expr.charAt(i);\r\n \r\n if (c == BRACKET_OPEN) {\r\n level++;\r\n } else if (c == BRACKET_CLOSE) {\r\n level--;\r\n }\r\n \r\n if (i == pos) {\r\n return level == 0;\r\n }\r\n }\r\n \r\n return true;\r\n }", "public static boolean isMatched(String expression) {\n final String opening = \"({[\"; // opening delimiters\n final String closing = \")}]\"; // respective closing delimiters\n Stack<Character> buffer = new LinkedStack<>();\n for (char c : expression.toCharArray()) {\n if (opening.indexOf(c) != -1) // this is a left delimiter\n buffer.push(c);\n else if (closing.indexOf(c) != -1) { // this is a right delimiter\n if (buffer.isEmpty()) // nothing to match with\n return false;\n if (closing.indexOf(c) != opening.indexOf(buffer.pop()))\n return false; // mismatched delimiter\n }\n }\n return buffer.isEmpty(); // were all opening delimiters matched?\n }", "public void printStack(){\n\t\tswitch (type) {\n\t\tcase 's' : {\n\t\t\tSystem.out.print(\"[XX]\");\n\t\t}\n\t\tbreak;\n\t\tcase 'w' : {\n\t\t\tSystem.out.print(this.peek().toString());\n\t\t}\n\t\tbreak;\n\t\tcase 't' : {\n\t\t\tStack<Card> temp = new Stack<Card>();\n\t\t\tCard currentCard = null;\n\t\t\tString fullStack = \"\";\n\t\t\twhile(!this.isEmpty()){\n\t\t\t\ttemp.push(this.pop());\n\t\t\t}\n\t\t\twhile(!temp.isEmpty()){\n\t\t\t\tcurrentCard = temp.pop();\n\t\t\t\tfullStack += currentCard.isFaceUp() ? currentCard.toString() : \"[XX]\";\n\t\t\t\tthis.push(currentCard);\n\t\t\t}\n\t\t\tSystem.out.println(fullStack);\n\t\t}\n\t\tbreak;\n\t\tcase 'f' : {\n\t\t\tSystem.out.print(this.peek().toString());\n\t\t}\n\t\tbreak;\n\t\t}\n\t}", "public static Stack<String> stringArr(String[] words){\r\n Stack<String> stack = new Stack<String>(); \r\n int i=0;\r\n \r\n //checking for IOL and LOI\r\n if(words[0].equals(\"IOL\")){\r\n stack.push(words[0]);\r\n i++;\r\n while(i<words.length){\r\n if(words[i].equals(\"LOI\")&&i!=words.length-1){\r\n System.out.println(\"Error! LOI not end of code.\");\r\n System.exit(0);//terminates program\r\n }\r\n stack.push(words[i]);\r\n i++;\r\n }\r\n }\r\n else{\r\n System.out.println(\"Illegal start of code. IOL missing.\");\r\n }\r\n \r\n //System.out.println(\"Stack: \"+ stack);\r\n \r\n return stack;\r\n }", "void backtrackTree(StringBuilder sequence1, StringBuilder sequence2, int position) {\n int n = table[0].length;\n if (position == 0) {\n results.add(new StringBuilder[]{new StringBuilder(sequence1), new StringBuilder(sequence2)});\n }\n else {\n List<Integer> listOfParents = parents.get(position);\n for (Integer parent: listOfParents) {\n if (parent == northWest(position)) {\n StringBuilder newSeq1 = new StringBuilder(sequence1);\n StringBuilder newSeq2 = new StringBuilder(sequence2);\n newSeq1.append(seq1.charAt(seq1position(position)));\n newSeq2.append(seq2.charAt(seq2position(position)));\n backtrackTree(newSeq1, newSeq2, parent);\n }\n else if (parent / n == position / n) {\n StringBuilder newSeq1 = new StringBuilder(sequence1);\n StringBuilder newSeq2 = new StringBuilder(sequence2);\n while (position != parent) {\n newSeq1.append('_');\n newSeq2.append(seq2.charAt(seq2position(position)));\n position--;\n }\n backtrackTree(newSeq1, newSeq2, parent);\n }\n else if (parent % n == position % n) {\n StringBuilder newSeq1 = new StringBuilder(sequence1);\n StringBuilder newSeq2 = new StringBuilder(sequence2);\n while (position != parent) {\n newSeq1.append(seq1.charAt(seq1position(position)));\n newSeq2.append('_');\n position = position - n;\n }\n backtrackTree(newSeq1, newSeq2, parent);\n }\n }\n }\n }", "@Test\n public void nonBracket(){\n assertTrue(BalancedBrackets.hasBalancedBrackets(\"\"));\n }", "public String processInfix(char[] input) {\n String result = \"\"; //Initialize the string. This will be the postfix formatted input.\n\n for (int i = 0; i < input.length; i++) {\n\n //If it is a digit it is sent straight to the result\n if (Character.isDigit(input[i])) {\n result += input[i];\n }\n\n //If it is an open bracket it is pushed into the stack.\n else if (input[i] == '(') {\n s.push(input[i]);\n }\n\n //If it is a closed bracket, all items in the stack are popped until an open bracket is found.\n //Both brackets are then discarded\n else if (input[i] == ')') {\n\n while (!s.isEmpty() && (char)s.top() != '(') {\n result += (char)s.pop();\n }\n\n if (!s.isEmpty() && (char)s.top() != '(') {\n System.out.println(\"Invalid Expression. A '(' character must be followed by a ')' in the Expression.\");\n } else {\n s.pop(); //get rid of ( from the eq.\n }\n }\n\n //Else it must be an operand...\n else {\n //loop checks:\n // 1. that the stack is not empty and\n // 2. that the current token is less or equal in priority to the one on the top of the stack\n // If it both are true then the operator is sent to the result\n while(!s.isEmpty() && getPriority(input[i]) <= getPriority((char)s.top())){\n result += (char)s.pop();\n }\n s.push(input[i]);\n }\n }\n\n //Pop the remainder of the stack to the result\n while(!s.isEmpty()){\n result += (char)s.pop();\n }\n\n return result;\n }", "public static void main(String[] args) { //Here we create the method\n Scanner myScanner = new Scanner(System.in); // Here we define the scanner\n System.out.println(\"Enter a number between 1 and 9: \"); // here we promt the user to enter a value\n int x = myScanner.nextInt(); //Here we prompt the user to enter a value\n System.out.println(\"Using for loops: \"); // Here we print which method we are using to create this stack of numbers\n\n for (int i = 1; i < (x + 1); i++) { //for each number group\n for (int k = i; k > 0; k--) { //for each row\n for (int spaces = 0; spaces < (x - i); spaces++) { // for the spaces\n System.out.print(\" \");\n\n }\n for (int j = 0; j < i + (i - 1); j++) { //for each column\n System.out.print(i); //print number\n }\n System.out.println(\"\"); //end row\n }\n for (int spaces = 0; spaces < (x - i); spaces++) { //for the tab spaces\n System.out.print(\" \");\n\n }\n for (int j = 0; j < i + (i - 1); j++) { //for the tabs to be printed\n System.out.print(\"-\");\n }\n System.out.println(\"\");\n }\n\n System.out.println(\"Using while loops: \"); //Declaring what method is used\n int i = 1; // Declaring the variables outside the loop as it is a while loop\n int j = 0;\n int k = i;\n int spaces = 0;\n while (i < (x + 1)) { // For each number group\n k = i; // setting the variables inside the loop as it is while loop\n while (k > 0) { // For each row\n spaces = 0;\n while (spaces < (x - i)) { // for the spaces\n System.out.print(\" \"); //print space\n spaces++;\n }\n j = 0;\n\n while (j < i + (i - 1)) { //for each column\n System.out.print(i); // print number\n j++;\n }\n System.out.println(\"\"); //end row\n k--;\n }\n spaces = 0;\n while (spaces < (x - i)) { // for the tab spaces\n System.out.print(\" \");\n spaces++;\n }\n j = 0;\n\n while (j < i + (i - 1)) { // for the tabs\n System.out.print(\"-\"); //printing the tabs\n j++;\n }\n System.out.println(\"\");\n i++;\n }\n\n System.out.println(\"Using do while loop\"); // declaring what method is used\n i = 1; // resetting the variables\n j = 0;\n k = i;\n spaces = 0;\n\n do { // setting the output\n k = i;\n do {\n spaces = 0; // setting the output\n do {\n System.out.print(\" \"); \n spaces++;\n } while (spaces < (x - i)); // for the spaces\n j = 0;\n do {\n System.out.print(i);\n j++;\n } while (j < i + (i - 1)); // for each column\n System.out.println(\"\");\n k--;\n spaces = 0;\n } while (k > 0); // for each row\n\n do {\n System.out.print(\" \");\n spaces++;\n } while (spaces < (x - i)); // for each tab spaces\n j = 0;\n do {\n System.out.print(\"-\");\n j++;\n } while (j < i + (i - 1)); //for the tabs\n System.out.println(\"\");\n i++;\n } while (i < (x + 1)); //for each number group\n\n }", "@Test\n public void testStackCodeExamples() {\n logger.info(\"Beginning testStackCodeExamples()...\");\n\n // Allocate an empty stack\n Stack<String> stack = new Stack<>();\n logger.info(\"Start with an empty stack: {}\", stack);\n\n // Push a rock onto it\n String rock = \"rock\";\n stack.pushElement(rock);\n assert stack.getTop().equals(rock);\n logger.info(\"Push a rock on it: {}\", stack);\n\n // Push paper onto it\n String paper = \"paper\";\n stack.pushElement(paper);\n assert stack.getTop().equals(paper);\n logger.info(\"Push paper on it: {}\", stack);\n\n // Push scissors onto it\n String scissors = \"scissors\";\n stack.pushElement(scissors);\n assert stack.getTop().equals(scissors);\n assert stack.getSize() == 3;\n logger.info(\"Push scissors on it: {}\", stack);\n\n // Pop off the scissors\n assert stack.popElement().equals(scissors);\n assert stack.getSize() == 2;\n logger.info(\"Pop scissors from it: {}\", stack);\n\n // Pop off the paper\n assert stack.popElement().equals(paper);\n assert stack.getSize() == 1;\n logger.info(\"Pop paper from it: {}\", stack);\n\n // Pop off the rock\n assert stack.popElement().equals(rock);\n assert stack.isEmpty();\n logger.info(\"Pop rock from it: {}\", stack);\n\n logger.info(\"Completed testStackCodeExamples().\\n\");\n }" ]
[ "0.6550423", "0.63902026", "0.6354791", "0.63023263", "0.6221364", "0.62125653", "0.61903274", "0.6171029", "0.6150031", "0.6021835", "0.59625", "0.5949692", "0.5949518", "0.58972067", "0.58508205", "0.58494073", "0.58047605", "0.57780516", "0.5775163", "0.5744798", "0.57411015", "0.56855017", "0.56799626", "0.56793314", "0.56589544", "0.56508315", "0.5632112", "0.5618497", "0.5608546", "0.55475914", "0.5543268", "0.55394953", "0.55394095", "0.5533431", "0.5529742", "0.5487686", "0.5463088", "0.5454495", "0.543996", "0.5424008", "0.541571", "0.54128146", "0.53995043", "0.53968084", "0.5396435", "0.5387371", "0.53856146", "0.5383485", "0.5372862", "0.53434044", "0.5333872", "0.526983", "0.52618515", "0.52322966", "0.5230295", "0.52234584", "0.5203737", "0.519095", "0.51812226", "0.51794904", "0.5173752", "0.51686466", "0.5165774", "0.5154519", "0.5151832", "0.5140025", "0.5135852", "0.5126921", "0.5124913", "0.51161987", "0.5108356", "0.5107218", "0.51059884", "0.5105366", "0.51007175", "0.5093952", "0.50938195", "0.5088566", "0.5084869", "0.507584", "0.5073319", "0.50548637", "0.5054235", "0.5040684", "0.50236857", "0.5018925", "0.50166005", "0.50081414", "0.50071764", "0.50029284", "0.49948815", "0.49934983", "0.49907988", "0.4986792", "0.4979274", "0.4976616", "0.49764732", "0.49736848", "0.49703717", "0.49670506" ]
0.55818444
29
Creates a file with the given name and fileextension.
public File createFile(String fileName, String fileextension) throws IOException { // create actual file File f = getFile(fileName, fileextension); f.createNewFile(); return f; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String createFile(String name) {\t\t\n\t\tString filename = this.path + name;\n\t\tFile file = new File(filename);\n\t\t\n\t\ttry {\n\t\t\tif (file.createNewFile()) {\n\t\t System.out.println(\"Created file '\" + filename + \"'.\");\n\t\t \n\t\t // Add file to files list\n\t\t\t\tthis.files.add(name);\t\n\t\t\t\t\n\t\t } else {\n\t\t \t// Null filename to report it was NOT created\n\t\t\t\tfilename = null;\n\t\t System.out.println(\"ERROR - File name already exists!\");\n\t\t }\n\t\t} catch(IOException e) {\n\t\t\t// Null filename to report it was NOT created\n\t\t\tfilename = null;\n\t\t e.printStackTrace();\n\t\t}\t\t\n\t\t\n\t\treturn filename;\n\t}", "public static void CreateFile (String filename) {\r\n\t\t try {\r\n\t\t File myObj = new File(filename + \".txt\");\r\n\t\t if (myObj.createNewFile()) {\r\n\t\t System.out.println(\"File created: \" + myObj.getName());\r\n\t\t } else {\r\n\t\t System.out.println(\"File already exists.\");\r\n\t\t }\r\n\t\t } catch (IOException e) {\r\n\t\t System.out.println(\"An error occurred.\");\r\n\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t }", "public void createFile(String ext) throws IOException {\n\t\tString name = JOptionPane\n\t\t\t\t.showInputDialog(\"Please Enter a new file name:\");\n\t\tif (name == null)\n\t\t\treturn;\n\n\t\t// get the current selected node and the file attached to it\n\t\tDefaultMutableTreeNode node = (DefaultMutableTreeNode) getLastSelectedPathComponent();\n\t\tEllowFile pfile = (EllowFile) node.getUserObject();\n\t\tEllowFile file;\n\n\t\tif (pfile.isDirectory()) {\n\t\t\tfile = new EllowFile(pfile.getAbsolutePath() + \"\\\\\\\\\" + name + \".\"\n\t\t\t\t\t+ ext);\n\t\t\tfile.createNewFile();\n\t\t\tfile.parentProject = pfile.parentProject;\n\t\t\t// use insert node instead of add to update the tree without\n\t\t\t// reloading it, which cause the tree to be reset\n\t\t\tmodel.insertNodeInto(new DefaultMutableTreeNode(file), node,\n\t\t\t\t\tnode.getChildCount());\n\t\t} else {\n\t\t\tfile = new EllowFile(pfile.getParent() + \"\\\\\\\\\" + name + \".\" + ext);\n\t\t\tfile.createNewFile();\n\t\t\tfile.parentProject = pfile.parentProject;\n\t\t\tnode = ((DefaultMutableTreeNode) node.getParent());\n\t\t\tmodel.insertNodeInto(new DefaultMutableTreeNode(file), node,\n\t\t\t\t\tnode.getChildCount());\n\t\t}\n\t\t// save the project to the file, and the file to the project, for later\n\t\t// reference\n\t\tpfile.parentProject.rebuild();\n\t\tmodel.nodeChanged(root);\n\n\t\t/*\n\t\t * if (ext.equals(ProjectDefault.EXT_NOTE))\n\t\t * desktopPane.createFrameNote(file);\n\t\t */\n\t\tdesktopPane.openFile(file);\n\t}", "private void createFile(String fileName, String content) throws IOException {\n File file = new File(fileName);\n if (!file.exists()) {\n file.createNewFile();\n }\n FileWriter fileWriter = new FileWriter(fileName, false);\n fileWriter.append(content);\n fileWriter.close();\n }", "public static void createFile(String name)\n {\n file = new File(name);\n try\n {\n if(file.exists())\n {\n file.delete();\n file.createNewFile();\n }else file.createNewFile();\n \n fileWriter = new FileWriter(file);\n fileWriter.append(\"Generation, \");\n fileWriter.append(\"Fitness, \");\n fileWriter.append(\"Average\\n\");\n \n }catch (IOException e) \n {\n System.out.println(e);\n }\n \n }", "public static void createFile(String file) throws FileNotFoundException {\n\t\tif(!file.contains(\".txt\")) {\n\t\t\tthrow new IllegalArgumentException(\"Wrong format\"); \n\t\t}\n\t\tPrintWriter pw = new PrintWriter(file);\n\t\tpw.close();\n\n\t}", "public void createFile (String filePath){\n try{\n File newFile = new File(filePath);\n if(newFile.createNewFile()){\n System.out.println(\"File created: \"+newFile.getName());\n } else {\n System.out.println(\"File already exists.\");\n }\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }", "private File getFile(String fileName, String fileextension) {\n\t\treturn new File(outputDir + File.separator + fileName + \".\"\n\t\t\t\t+ fileextension);\n\t}", "public void createFile(String fname) {\n\t\tprintMsg(\"running createFiles() in \\\"\" + this.getClass().getName() + \"\\\" class.\");\n\t\t\n\t\t// Check if the scratch directory exists, create it if it doesn't\n\t\tPath rootpath = Paths.get(theRootPath);\n\t\tcreateScratchDirectory(rootpath);\n\n\t\t// Check if the file name is null or empty, if it is, use default name\n\t\tPath filepath = null;\n\t\tif(fname == null || fname.isEmpty()) {\n\t\t\tfilepath = Paths.get(rootpath + System.getProperty(\"file.separator\") + theFilename);\n\t\t} else {\n\t\t\tfilepath = Paths.get(rootpath + System.getProperty(\"file.separator\") + fname);\n\t\t}\n\t\t\n\t\t// Create file\n\t\ttry {\n\t\t\t// If file exists already, don't override it.\n\t\t\tif(!Files.exists(filepath)) {\n\t\t\t\tFiles.createFile(filepath);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public File createFile(final String path) {\n return new com.good.gd.file.File(path);\n }", "void createFile()\n {\n //Check if file already exists\n try {\n File myObj = new File(\"src/main/java/ex45/exercise45_output.txt\");\n if (myObj.createNewFile()) {\n System.out.println(\"File created: \" + myObj.getName());// created\n } else {\n System.out.println(\"File already exists.\"); //exists\n }\n //Error check\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }", "private File createNewRotationFile(String clearName, String extension, Path parent){\n\n Path newPath = getPathRotationFile(clearName, lastCountRotation+1, extension, parent);\n try{\n File ret = Files.createFile(newPath).toFile();\n return ret;\n } catch (IOException ex){\n System.out.println(\"Ошибка в создании файла: \"+ex.getMessage());\n }\n System.out.println(\"Ошибка в создании файла: \"+newPath);\n return file;\n }", "public File createFile(String fileName) throws IOException {\n File file = new File(FILES_PATH + \"/\" + fileName);\n if (!file.exists()) {\n file.createNewFile();\n }\n return file;\n }", "public static void makeNewFile(File root, String name) {\n File directory = new File(root, name);\n try {\n if (!directory.createNewFile()) {\n throw new IOException(\"Could not create \" + name + \", file already exists\");\n }\n } catch (IOException e) {\n throw new UncheckedIOException(\"Failed to create file: \" + name, e);\n }\n }", "public void createFile(String name, String type) {\n\n final String fileName = name;\n\n final String fileType = type;\n\n // create new contents resource\n Drive.DriveApi.newDriveContents(mGoogleApiClient)\n .setResultCallback(new ResultCallback<DriveApi.DriveContentsResult>() {\n @Override\n public void onResult(DriveApi.DriveContentsResult result) {\n\n if (!result.getStatus().isSuccess()) {\n\n return;\n }\n\n final DriveContents driveContents = result.getDriveContents();\n\n // Perform I/O off the UI thread.\n new Thread() {\n\n @Override\n public void run() {\n\n if (mCRUDapi != null) {\n // write content to DriveContents\n mCRUDapi.onCreateFile(driveContents.getOutputStream());\n }\n\n createFile(fileName, fileType, driveContents);\n }\n }.start();\n\n\n }\n });\n }", "private void createFile(PonsFileFactory ponsFileFactory, Profile profile){\n moveX(profile);\n ponsFileFactory.setProfile(profile);\n String text = ponsFileFactory.createPonsFile();\n String profileName = profile.getName();\n WriteFile.write(text,pathTextField.getText() + \"/\" + profileName.substring(0,profileName.indexOf(\".\")));\n }", "public FileOutputStream makefile(String filename, String extension){\r\n\t\r\n\t FileOutputStream fout = null;\r\n\t \r\n\t try {\r\n\t\tfout = new FileOutputStream(filename\r\n\t\t\t\t+ \"\"\r\n\t\t\t\t+ extension);\r\n\t} catch (FileNotFoundException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t}\r\n\t \t \r\n\t return fout;\r\n }", "public FileOutputStream makefileappend(String filename, String extension){\n\t\t\r\n\t FileOutputStream fout = null;\r\n\t \r\n\t try {\r\n\t\tfout = new FileOutputStream(filename\r\n\t\t\t\t+ \"\"\r\n\t\t\t\t+ extension, true);\r\n\t} catch (FileNotFoundException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t}\r\n\t \t \r\n\t return fout;\r\n }", "public GridFSInputFile createFile(File f) throws IOException {\n\treturn createFile(new FileInputStream(f), f.getName(), true);\n }", "public static File createNewFile(String filename){\n try {\n File outputFile = new File(filename + \".csv\");\n\n //Creates File\n outputFile.createNewFile();\n\n return outputFile;\n\n } catch (IOException ex) {\n Logger.getLogger(CSVWriter.class.getName()).log(Level.SEVERE, null, ex);\n return null;\n }\n }", "@Override\n public File createFile(String path) throws IOException {\n String pathStr=path+fileSeparator+\"Mail.json\";\n File file = new File(pathStr);\n file.createNewFile();\n return file;\n }", "public static File createFile(String filename){\n try {\n File outputFile = new File(filename + \".csv\");\n\n //Prevent File Overwrite\n int tmp = 1;\n while (outputFile.exists()){\n outputFile = new File(filename + \".csv\" + \".\" + tmp);\n tmp++;\n }\n\n //Creates File\n outputFile.createNewFile();\n\n return outputFile;\n\n } catch (IOException ex) {\n Logger.getLogger(CSVWriter.class.getName()).log(Level.SEVERE, null, ex);\n return null;\n }\n }", "public static void createNewFile(File file) {\n\t\ttry {\n\t\t\tfile.createNewFile();\n\t\t} catch (Exception exp) {\n\t\t\tthrow new RuntimeException(exp);\n\t\t}\n\t}", "public void createFile(File file) throws IOException {\n if (!file.exists()) {\n file.createNewFile();\n }\n }", "public void createFile(File file) {\n\t\tif (file.exists())\n\t\t\treturn;\n\t\ttry {\n\t\t\tfile.createNewFile();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static File createFile(String fileName) {\n\t\tif (fileName == null || fileName.matches(\"\") { System.out.println(\"Utils|createFile|fileName is null or empty\"); return null; }\n\t\tFile file = new File(fileName);\n\t\tfile.mkdirs();\n\t\treturn file;\n\t}", "File createFile(String name, Properties properties) throws IOException {\n File file = new File(directory, name);\n try (FileOutputStream fos = new FileOutputStream(file)) {\n properties.store(fos, \"Property file '\" + name + \"'\");\n }\n return (file);\n }", "private File writeToFile(Context context, final byte[] data, final String fileName,\n String fileExtension)\n throws IOException {\n final File file = File.createTempFile(fileName, fileExtension, context.getCacheDir());\n try {\n if (!file.exists()) {\n file.createNewFile();\n }\n final FileOutputStream fos = new FileOutputStream(file);\n fos.write(data);\n fos.close();\n } catch (final Exception throwable) {\n Timber.e(throwable, \"Failed to create file\");\n }\n return file;\n }", "void toFile (String fileName);", "public static PicoFile create(String filename) throws IOException {\n if (filename == null) {\n throw new NullPointerException(\"The filename is null.\");\n }\n return create(filename, KeyUtils.makeKey());\n }", "File createFile(String name) throws IOException {\n File storageFile = File.createTempFile(FILE_PREFIX + name + \"_\", null, this.subDirectories[fileCounter.getAndIncrement()&(this.subDirectories.length-1)]); //$NON-NLS-1$\n if (LogManager.isMessageToBeRecorded(org.teiid.logging.LogConstants.CTX_BUFFER_MGR, MessageLevel.DETAIL)) {\n LogManager.logDetail(org.teiid.logging.LogConstants.CTX_BUFFER_MGR, \"Created temporary storage area file \" + storageFile.getAbsoluteFile()); //$NON-NLS-1$\n }\n return storageFile;\n }", "public static boolean createFile() throws IOException {\n String bytes = \"\";\n byte[] write = bytes.getBytes(); //Salva i bytes della stringa nel byte array\n if(!fileName.exists()){\n Path filePath = Paths.get(fileName.toString()); //Converte il percorso in stringa\n Files.write(filePath, write); // Creare il File\n Main.log(\"File \\\"parametri\\\" creato con successo in \" + fileName.toString());\n return true;\n }\n return false;\n }", "public static File saveFile(String name, String data) {\n if (name == null) {\n name = \"\";\n }\n String fullyQualifiedName = name;\n\n // if filename is not absolute use current path as base dir\n if (!new File(fullyQualifiedName).isAbsolute()) {\n fullyQualifiedName = Paths.get(\"\").toAbsolutePath() + \"/\" + name;\n }\n try {\n // create subdirs (if there any)\n if (fullyQualifiedName.contains(\"/\")) {\n File f = new File(fullyQualifiedName.substring(0, fullyQualifiedName.lastIndexOf(\"/\")));\n f.mkdirs();\n }\n File file = new File(fullyQualifiedName);\n file.createNewFile();\n FileUtils.write(file, data, \"UTF-8\");\n log.info(\"Wrote: {}\", file.getAbsolutePath());\n return file;\n } catch (IOException e) {\n log.error(\"Could not create file {}\", name, e);\n return null;\n }\n }", "public static File MakeNewFile(String hint) throws IOException {\n File file = new File(hint);\n String name = GetFileNameWithoutExt(hint);\n String ext = GetFileExtension(hint);\n int i = 0;\n while (file.exists()) {\n file = new File(name + i + \".\" + ext);\n ++i;\n }\n\n file.createNewFile();\n\n return file;\n }", "public boolean buildsFileType(String extension);", "public OutputStream writeFile( String filename, FileType type );", "public static File createTestFile(File directory, String name) throws IOException {\n return createTestFile(directory, name, /* length= */ 1);\n }", "public abstract FileName createName(String absolutePath, FileType fileType);", "public static File createImageFile(Context context, String name) throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\r\n String imageFileName = name + \"_\" + timeStamp + \"_\";\r\n File storageDir = context.getExternalFilesDir(Environment.DIRECTORY_PICTURES);\r\n File image = File.createTempFile(\r\n imageFileName, /* prefix */\r\n \".jpg\", /* suffix */\r\n storageDir /* directory */\r\n );\r\n return image;\r\n }", "public ActionScriptBuilder createFile(String filecontents, String filepath){\n\t\treturn createFile(filecontents,filepath,true);\n\t}", "public static void createFile(String path) {\n try {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter the file name :\");\n String filepath = path+\"/\"+scanner.next();\n File newFile = new File(filepath);\n newFile.createNewFile();\n System.out.println(\"File is Created Successfully\");\n\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }", "public static void createFile(File source) {\n try {\n if (!source.createNewFile()) {\n throw new IOException();\n }\n } catch (IOException e) {\n throw new RuntimeException(\"Failed to create file: \" + source.getAbsolutePath(), e);\n }\n }", "public ActionScriptBuilder createFile(String filecontents,String filepath,boolean overwrite,String delimeter){\n\t\tline(\"createfile until \"+delimeter);\n\t\tlines(Arrays.asList(filecontents.split(\"\\n\")));\n\t\tline(delimeter);\n\t\tmove(\"__createfile\",filepath,overwrite);\n\t\treturn this;\n\t}", "public static PicoFile create(String filename, byte[] key) throws IOException {\n if (filename == null) {\n throw new NullPointerException(\"The filename is null.\");\n }\n if (key == null) {\n throw new NullPointerException(\"The key is null.\");\n }\n if (key.length == 0) {\n throw new IllegalArgumentException(\"Encryption key is empty.\");\n }\n return new PicoFile(new RandomAccessFile(filename, \"rw\"), key);\n }", "private File createNewFileName(File branch, String fileName)\r\n \t{\r\n \t\ttry {\r\n \r\n \t\t\tString newFileName = branch.getCanonicalFile() + \"/\"+ fileName;\r\n \t\t\tFile newFile= new File(newFileName);\r\n \t\t\t//if this filename already exists\r\n \t\t\tif (newFile.exists())\r\n \t\t\t{\r\n \t\t\t\tString prefix= fileName;\r\n \t\t\t\tString suffix= \"\";\r\n \t\t\t\tString[] parts= fileName.split(\"[.]\");\r\n \t\t\t\tif (parts.length >1)\r\n \t\t\t\t{\r\n \t\t\t\t\tprefix= \"\";\r\n \t\t\t\t\tfor (int i= 0; i < parts.length-1; i++)\r\n \t\t\t\t\t{\r\n \t\t\t\t\t\tif (i==0) prefix= prefix + parts[i];\r\n \t\t\t\t\t\telse prefix= prefix + \".\" + parts[i];\r\n \t\t\t\t\t}\r\n \t\t\t\t\tsuffix= \".\"+parts[parts.length-1];\r\n \t\t\t\t}\t\r\n \t\t\t\tint i= 0;\r\n \t\t\t\t//searching for new name\r\n \t\t\t\twhile(newFile.exists())\r\n \t\t\t\t{\r\n \t\t\t\t\tnewFileName= branch.getCanonicalFile() + \"/\"+ prefix+ \"_\"+i+suffix;\r\n \t\t\t\t\tnewFile= new File(newFileName);\r\n \t\t\t\t\ti++;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\treturn(newFile);\r\n \t\t} catch (IOException e) {\r\n \t\t\tthrow new ExternalFileMgrException(e);\r\n \t\t}\r\n \t}", "FileReference createFile(String fileName, String toolId);", "private static void createFile(String fileType) throws Exception {\n DateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"yyyy-MM-dd-HH-mm-ss\");\n LocalDateTime now = LocalDateTime.now();\n File xmlFile = new File(System.getProperty(\"user.dir\")+\"/data/saved/\"+dtf.format(now) + fileType + \".xml\");\n OutputFormat out = new OutputFormat();\n out.setIndent(5);\n FileOutputStream fos = new FileOutputStream(xmlFile);\n XML11Serializer serializer = new XML11Serializer(fos, out);\n serializer.serialize(xmlDoc);\n\n }", "@Test\n public void CreateFile() throws Exception {\n createFile(\"src\\\\TestSuite\\\\SampleFiles\\\\supervisor.xlsx\",\n readTemplateXLSX(\"src\\\\TestSuite\\\\SampleFiles\\\\template_supervisor.xlsx\"));\n File file = new File(\"src\\\\TestSuite\\\\SampleFiles\\\\supervisor.xlsx\");\n Assert.assertTrue(file.exists());\n }", "int createFile(String pFileNamePath, String pContent, String pPath, String pRoot, boolean pOverride) throws RemoteException;", "private static void prepareSaveFile(String filename) {\n\t\tFile f = new File(filename);\n\t\tif(!f.exists()) {\n\t\t\ttry {\n\t\t\t\tf.createNewFile();\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}\n\t}", "final public static File changeFileExtension(File file, String extension) {\n\n if ((file == null) || (extension == null) || extension.trim().equals(\"\")) {\n return null;\n }\n\n String path = file.getAbsolutePath();\n String newPath = \"\";\n String filename = file.getName().trim();\n\n if ((filename != null) && !filename.equals(\"\")) {\n\n int periodIndex = path.lastIndexOf(\".\");\n\n newPath = path.substring(0, periodIndex);\n newPath += extension;\n }\n\n return new File(newPath);\n }", "@Override\n protected void createFile(String directoryName, String fileNamePrefix) {\n }", "public void createFiles() {\r\n try {\r\n FileWriter file = new FileWriter(registerNumber + \".txt\");\r\n file.write(\"Name : \" + name + \"\\n\");\r\n file.write(\"Surname : \" + surname + \"\\n\");\r\n file.write(\"Registration Number : \" + registerNumber + \"\\n\");\r\n file.write(\"Position : \" + position + \"\\n\");\r\n file.write(\"Year of Start : \" + yearOfStart + \"\\n\");\r\n file.write(\"Total Salary : \" + Math.round(totalSalary) + \".00 TL\" +\"\\n\");\r\n file.close();\r\n }\r\n catch(IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public static void create(\n UUID parentUUID, String filePath, String fileExtension, String fileContent) {\n FileData entry = new FileData();\n entry.parentUUID = parentUUID;\n entry.file = new FileDataId(filePath, fileExtension);\n entry.fileContent = fileContent;\n entry.save();\n }", "void putFile(String filename, byte[] file) throws FileAlreadyExistsException;", "private void createFile() {\n if (mDriveServiceHelper != null) {\n Log.d(\"error\", \"Creating a file.\");\n\n mDriveServiceHelper.createFile()\n .addOnSuccessListener(fileId -> readFile(fileId))\n .addOnFailureListener(exception ->\n Log.e(\"error\", \"Couldn't create file.\", exception));\n }\n }", "public static void appendFile(final String contents, final String name) {\n writeFile(contents, name, true);\n }", "private void createFile(String packageName, String enclosingName, String methodName, String returnType) {\n try {\n JavaFileObject jfo = mFiler.createSourceFile(enclosingName, new Element[]{});\n Writer writer = jfo.openWriter();\n writer.write(brewCode(packageName, enclosingName, methodName, returnType));\n writer.flush();\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "@Override\n\tpublic String createFile(AuthenticationToken authenticationToken, String directory, String idealFileName, boolean force) \n\t\t\tthrows CreateFileFailedException, PermissionDeniedException {\t\t\t\t\t\n\t\tidealFileName = fileNameNormalizer.normalize(idealFileName);\n\t\tboolean permissionResult = filePermissionService.hasWritePermission(authenticationToken, directory);\n\t\tif(!permissionResult)\n\t\t\tthrow new PermissionDeniedException();\n\t\telse {\n\t\t\tFile file = new File(directory + File.separator + idealFileName);\n\t\t\t\tboolean createResult = false;\n\t\t\t\ttry {\n\t\t\t\t\tcreateResult = file.createNewFile();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog(LogLevel.ERROR, \"Create new file failed\", e);\n\t\t\t\t\tthrow new CreateFileFailedException();\n\t\t\t\t}\n\t\t\t\tint i = 1;\n\t\t\t\twhile(!createResult && force) {\n\t\t\t\t\tString namePart = idealFileName;\n\t\t\t\t\tif(idealFileName.lastIndexOf(\".\") != -1) {\n\t\t\t\t\t\tnamePart = idealFileName.substring(0, idealFileName.lastIndexOf(\".\"));\n\t\t\t\t\t}\n\t\t\t\t\tfile = new File(directory + File.separator + namePart + \"_\" + i++ + \".\" + \n\t\t\t\t\t\t\tidealFileName.substring(idealFileName.lastIndexOf(\".\") + 1, idealFileName.length()));\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcreateResult = file.createNewFile();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlog(LogLevel.ERROR, \"Create new file failed\", e);\n\t\t\t\t\t\tthrow new CreateFileFailedException();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(createResult)\n\t\t\t\t\treturn file.getAbsolutePath();\n\t\t\t\telse\n\t\t\t\t\tthrow new CreateFileFailedException();\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tFile file = new File(\"test/a.txt\");\r\n\t\tFileUtil.createFile(file);\r\n\t\t/*if(! file.exists()){\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(file.getAbsolutePath());\r\n\t\t\t\tfile.createNewFile();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t*/\r\n\t}", "@SuppressWarnings(\"unused\")\r\n\tprivate static File createFile(String path) {\r\n\t\t\r\n\t\t// open the file\r\n\t\tFile currentFile = new File(path);\r\n\t\t\r\n\t\t\r\n\t\t// check if it is a valid file\r\n\t\tif (currentFile == null) {\r\n\t\t\tSystem.out.println(\"Could not create the file\");\r\n\t\t\tthrow new NullPointerException();\r\n\t\t}\r\n\r\n\t\t// hopefully things went perfect\r\n\t\treturn currentFile;\r\n\r\n\t}", "private File appendFileExtension(File file) {\r\n \t\tString filename = file.getName();\r\n \t\tif (isMissingExtension(filename)) {\r\n \t\t\tcurFile = new File(curFile.getAbsolutePath() + EXTENSION);\r\n \t\t}\r\n \r\n \t\treturn curFile;\r\n \t}", "public boolean createFile() {\n String filename = name + \".ics\";\n String directory = \"Calendar-Files\";\n String userHome = System.getProperty(\"user.home\") + \"/Desktop/\";\n System.out.println(\"Generating Event File...\");\n \n try {\n File folder = new File(userHome, directory);\n\n // if no folder exists, create it\n if (!folder.exists()) {\n folder.mkdir();\n }\n\n // change file location\n File file = new File(userHome + \"/\" + directory, filename);\n\n // if no file exists, create it\n if (!file.exists()) {\n file.createNewFile();\n }\n\n // write the content string to the event file\n FileWriter fw = new FileWriter(file.getAbsoluteFile());\n BufferedWriter bw = new BufferedWriter(fw);\n bw.write(createContent());\n bw.close();\n }\n catch (IOException e) {\n return false;\n }\n return true;\n }", "private File createTempFile(TransferSongMessage message)\n throws IOException {\n File outputDir = MessagingService.this.getCacheDir(); // context being the Activity pointer\n String filePrefix = UUID.randomUUID().toString().replace(\"-\", \"\");\n int inx = message.getSongFileName().lastIndexOf(\".\");\n String extension = message.getSongFileName().substring(inx + 1);\n File outputFile = File.createTempFile(filePrefix, extension, outputDir);\n return outputFile;\n }", "private static void addFile(File filedir) throws Exception {\n String fileName = getFileNameInput();\n File newFile = new File(filedir.toString() + \"\\\\\" + fileName);\n boolean fileAlreadyExists = newFile.exists();\n if (fileAlreadyExists) {\n throw new FileAlreadyExistsException(\"File already exists in current directory.\");\n } else {\n try {\n if (newFile.createNewFile()) {\n System.out.println(\"File created successfully\");\n } else {\n System.out.println(\"Something went wrong, please try again.\");\n }\n } catch (IOException e) {\n throw new IOException(e.getMessage());\n }\n }\n }", "public void create_registerFile(String name,String roll){\n try{\n outputStreamWriter=new OutputStreamWriter(context.openFileOutput(Constant.REGISTER_FILE,Context.MODE_PRIVATE));\n outputStreamWriter.write(name+\",\");\n outputStreamWriter.write(roll+\",\");\n outputStreamWriter.close();\n }\n catch (Exception e){\n Message.logMessages(\"ERROR: \",e.toString());\n }\n }", "private File createImageFile() throws IOException {\n @SuppressLint({\"NewApi\", \"LocalSuppress\"}) String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\", Locale.getDefault()).format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES);\n return File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n }", "public void writeFile(String path, String name, String content)\n\t\t\tthrows Exception {\n\n\t\ttry {\n\t\t\tString ruta = path + File.separator + name;\n\n\t\t\t// Create file\n\t\t\tFileWriter fstream = new FileWriter(ruta);\n\t\t\tBufferedWriter out = new BufferedWriter(fstream);\n\t\t\tout.write(content);\n\t\t\t// Close the output stream\n\t\t\tout.close();\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Error escribiendo fichero\", e);\n\t\t}\n\n\t}", "private File createVideoFileName() throws IOException {\n String timestamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n //there are two types of SimpleDateFormat and Date()\n String prepend = \"VIDEO_\" + timestamp + \"_\";\n File videoFile = File.createTempFile(prepend, \".mp4\", mVideoFolder);\n mVideoFileName = videoFile.getAbsolutePath();\n return videoFile;\n\n }", "public ActionScriptBuilder createFile(String filecontents, String filepath,boolean overwrite){\n\t\treturn createFile(filecontents,filepath,true,\"[EOF]\");\n\t}", "FileInfo create(FileInfo fileInfo);", "public static void writeFile(final String contents, final String name) {\n writeFile(contents, name, false);\n }", "public String createUniqueSuffix(String filename) {\n \t\tint fileTypeIdx = filename.lastIndexOf('.');\n \t\tString fileType = filename.substring(fileTypeIdx); // Let the fileType include the leading '.'\n \n \t\tfilename = filename.substring(0, fileTypeIdx); // Strip off the leading '/' from the filename\n \n \tSimpleDateFormat timestampFormatter = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n \t\tString timstampStr = '_' + timestampFormatter.format(new Date());\n \n \t\treturn filename + timstampStr + fileType;\n \t}", "public FilePath withExt(String newExtension) {\n return FilePath.of(Filenames.replaceExt(path, newExtension));\n }", "public void createFile(View view) {\n // start the background file creation task\n CreateFileTask task = new CreateFileTask();\n task.execute();\n }", "private void createFile() {\n if (mDriveServiceHelper != null) {\n Log.d(TAG, \"Creating a file.\");\n\n mDriveServiceHelper.createFile()\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n //progressDialog.setProgress(100);\n progressDialog.dismiss();\n Toast.makeText(MainActivity.this, \"Download Successful\", Toast.LENGTH_SHORT).show();\n }\n })\n .addOnFailureListener(exception ->\n Log.e(TAG, \"Couldn't Create file.\", exception));}\n }", "public static String createFileName(String customer, Date date) {\n \n String name = removeBannedCharacters(customer);\n if (name.length() == 0) {\n name = \"Customer\"; // Something, if there are no valid filename characters. Can you think of a better solution? Ask the user for a name?\n }\n \n // Format the date into a String\n String dateString = simpleDateFormat.format(date);\n \n String filename = String.format(\"%s_%s_invoice.txt\", name, dateString);\n \n return filename;\n \n }", "String getFileExtensionByFileString(String name);", "void saveToFile(String filename) throws IOException;", "public File saveFile(String fileExtension) throws UnsupportedEncodingException, FileNotFoundException, IOException\r\n\t{\r\n\t\tDate date = new Date();\t\t\t\t\t\t\t\t\t\t\t\t// date object created, used in naming file as time stamp.\r\n\t\tSimpleDateFormat ft = new SimpleDateFormat (\"MM_dd HH mm ss\");\t\t// setting format\r\n\t\tString fileName=\"serverResponse_\"+ft.format(date)+\".\"+fileExtension;//setting file name.\t\t\t \r\n\t\tString location = PropertyReader.getFieldValue(\"xmlFileLocation\");\t//getting location from properties file\r\n\t\tFile file=new File(location+fileName);\t\t\t\t\t\t\t//file object of newly saved file.\r\n\t\tif (!file.exists()) \r\n\t\t\tfile.createNewFile();\r\n\t\t\r\n\t\t\r\n\t\toutputString.trim();\t\t\t\t//removing white spaces around server response.\r\n\t\t\t\t\r\n\t\tFileWriter fw = new FileWriter(file.getAbsoluteFile());\r\n\t\tBufferedWriter bw = new BufferedWriter(fw);\r\n\t\tbw.write(outputString);\t\t\t\t//writing content to file.\r\n\t\tbw.close();\t\t\t\t\t\t\t//closing buffered reader.\r\n\t\t\r\n\t\treturn file;\t\t\t\t\t\t//returning file object of xml file.\r\n\t}", "public void touch(String name) throws FileExistsException\n\t{\n\t\tcheckMakeFile(name);\n\t\tFileElement add = new FileElement(name, false);\n\t\tfileSystem.addChild(currentFileElement, add);\n\t}", "public void retrieveFile(String fileName, String ext);", "private File createImageFile(String mode) throws IOException {\n String imageFileName = getImageFileName(mode);\n\n File storageDir;\n if(mode.equals(getString(R.string.training_on))){\n storageDir = getActivity().getExternalFilesDir(null);\n } else {\n storageDir = getActivity().getExternalCacheDir();\n }\n\n File image;\n image = new File(storageDir, imageFileName+\".jpg\");\n\n return image;\n }", "private void createFile(String outputData, File file) {\n try {\n FileWriter writer = new FileWriter(file);\n writer.write(outputData);\n writer.close();\n } catch (IOException e) {\n e.getSuppressed();\n }\n }", "private static File createImageFile(Activity activity) throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = activity.getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n return image;\n }", "public void createNoteBookFile(NoteBook myNoteBook) throws DaoException {\n\t\tFile notebookFile = new File(FILE_NAME);\n\t\tif (notebookFile.exists()) {\n\t\t\tnotebookFile.delete();\n\t\t}\n\t\ttry {\n\t\t\tnotebookFile.createNewFile();\n\t\t} catch (IOException e) {\n\t\t\tthrow new DaoException(\"Create NoteBook file error\", e);\n\t\t}\n\t}", "public static File annadirExtension(File archivo) {\n\t\tString extension = archivo.getPath();\n\t\tif (!extension.endsWith(\".zoo\"))\n\t\t\treturn new File(archivo + \".zoo\");\n\t\treturn archivo;\n\t}", "public GridFSInputFile createFile(byte[] data) {\n\treturn createFile(new ByteArrayInputStream(data), true);\n }", "public File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = mContext.getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n return File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n }", "public static void createFile(String fileString) {\n\t\tPath filePath = Paths.get(fileString);\n\t\t// this will only happen if the file is not there\n\t\tif (Files.notExists(filePath)) {\n\t\t\ttry {\n\t\t\t\tFiles.createFile(filePath);\n\t\t\t\tSystem.out.println(\"Your file was cerated successfully\");\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Something went wrong with file creation \");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public GeppettoRecordingCreator(String name)\n\t{\n\t\t_fileName = name;\n\t}", "public static void CreateFile(){\n try{\n new File(\"wipimages\").mkdir();\n logscommissions.createNewFile();\n }catch(Exception e){\n e.printStackTrace();\n System.out.println(\"CreateFile Failed\\n\");\n }\n }", "public static boolean createFile(String filePath)\n\t{\n\t\tFile file = new File(filePath);\n\t\tfile.mkdirs();\n\t\ttry\n\t\t{\n\t\t\treturn file.createNewFile();\n\t\t} catch (IOException e)\n\t\t{\n\t\t}\n\t\treturn false;\n\t}", "public FileCat(String file1, String file2, String extension) {\n this.file1 = file1;\n this.file2 = file2;\n this.extension = \".\" + extension;\n }", "public void mkdir(String name) throws FileExistsException\n\t{\n\t\tcheckMakeFile(name);\n\t\tFileElement add = new FileElement(name, true);\n\t\tfileSystem.addChild(currentFileElement, add);\n\t}", "public boolean producesFileType(String outputExtension);", "private File createImageFile() throws IOException {\n // Create an image file name\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n return File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n }", "private File createImageFile() throws IOException\n {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"Picko_JPEG\" + timeStamp + \"_\";\n File storageDir = new File(Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DOCUMENTS),\"Whatsapp\");\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n String mCurrentPhotoPath = \"file:\" + image.getAbsolutePath();\n return image;\n\n\n }", "static void createNew() \r\n\t {\n boolean flag = false;\r\n Scanner file = new Scanner(System.in);\r\n System.out.println(\"Enter a new file name\");\r\n String newfilename = file.next();\r\n File createfile = new File(\"D:\\\\java_project\\\\\"+newfilename+\".txt\");\r\n try\r\n\t\t {\r\n\t\t flag = createfile.createNewFile();\r\n\t\t System.out.println(\"flag value\" + flag);\r\n\t\t if(!flag)\r\n\t\t {\r\n\t\t \t System.out.println(\"Same file name already exisy\" + createfile.getPath());\r\n\t\t } \r\n\t\t else \r\n\t\t {\r\n\t\t \t System.out.println(\"file is created sucessfully\" + createfile.getPath() + \" created \");\r\n\t\t }\r\n\t\t } \r\n\t\t catch (IOException ioe) \r\n\t\t {\r\n\t\t System.out.println(\"Error while Creating File in Java\" + ioe);\r\n\t\t }\r\n\t\t \r\n\t\t \t }", "@SuppressLint(\"SimpleDateFormat\")\n public static File createVideoFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = VIDEO_FILE_PREFIX + timeStamp + MP4_FILE_SUFFIX;\n String nameAlbum = Environment.getExternalStorageDirectory().getAbsolutePath() + \"/\" + nameDir;// getString(R.string.app_name);\n File albumF = new File(nameAlbum);\n if (!albumF.exists()) {\n albumF.mkdirs();\n File noMedia = new File(albumF, \".nomedia\");\n noMedia.createNewFile();\n }\n\n File imageF = new File(albumF, imageFileName);\n imageF.createNewFile();\n return imageF;\n }" ]
[ "0.7056077", "0.69225925", "0.66678184", "0.6398675", "0.63201773", "0.62328", "0.60508275", "0.6047028", "0.5953069", "0.59135133", "0.5908634", "0.5882768", "0.58502626", "0.5843329", "0.583819", "0.583326", "0.582763", "0.58104306", "0.5806666", "0.5769171", "0.57629365", "0.5745775", "0.57227886", "0.5705057", "0.57000464", "0.56944567", "0.5667761", "0.56541616", "0.5639542", "0.5633701", "0.5604216", "0.55683154", "0.5553833", "0.5553633", "0.55174994", "0.5498133", "0.5487553", "0.5480271", "0.54755694", "0.5461091", "0.54454166", "0.5442108", "0.53852355", "0.5362692", "0.5346849", "0.53458065", "0.53418237", "0.5329535", "0.53086376", "0.5296215", "0.5275097", "0.5264898", "0.5252907", "0.52345747", "0.5233843", "0.52304536", "0.5228684", "0.51858914", "0.5172696", "0.51662177", "0.51510954", "0.5148073", "0.5132402", "0.51322293", "0.5121314", "0.5103189", "0.5100178", "0.50944674", "0.50859684", "0.50614727", "0.5050479", "0.50487113", "0.5029251", "0.5027305", "0.50261515", "0.50242114", "0.50127417", "0.500752", "0.49921438", "0.4990965", "0.498989", "0.49888927", "0.49880624", "0.4982759", "0.49732158", "0.49718833", "0.49595973", "0.49579242", "0.49556077", "0.49555838", "0.49550706", "0.4952555", "0.4949726", "0.49313265", "0.49295965", "0.49232775", "0.4922502", "0.49193004", "0.49183416", "0.4914868" ]
0.7844414
0
Writes a single line to an open file
public void writeLineToFile(File file, String content) throws IOException { BufferedWriter writer = writers.get(file); writer.append(content + "\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void writeLine(String line){\n\t\ttry{\n\t\t\tout.write(line);\n\t\t}\n\t\tcatch (IOException e){\n\t\t\tSystem.out.println(\"File cannot be written too.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "private void writeFile(String line, BufferedWriter theOutFile) throws Exception {\n\t\ttheOutFile.append(line);\t\t\t// write the line out\n\t\ttheOutFile.newLine();\t\t\t\t// skip to the next line\t\t\n\t}", "public static void writeToFile(String filename, String line) {\n try {\n FileWriter fw = new FileWriter(PATH + filename, true); //the true will append the new data\n fw.write(line + \"\\n\");//appends the string to the file\n fw.close();\n } catch (IOException ioe) {\n System.err.println(\"IOException: \" + ioe.getMessage());\n }\n }", "private void writeFileLine(String s, File file)throws IOException{\n\t\tFileWriter filewriter = new FileWriter(file);\n\t\tPrintWriter printWriter = new PrintWriter(filewriter);\n\t\tprintWriter.print(s);\n\t\tprintWriter.close();\n\t}", "public static void writeLine(String filePath, String line) {\n\t\ttry {\n\t\t\tDataOutputStream os = new DataOutputStream(new FileOutputStream(filePath));\n\t\t\tos.write(line.getBytes());\n\t\t\tos.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "private void writeLine(String s) throws IOException {\n\tfbuf.write(s, 0, s.length());\n\tfbuf.newLine();\n }", "public static void writeFile(String line, String filename) throws IOException {\n\t\tFile file = new File(filename);\r\n\r\n\t\tif (!file.exists()) {\r\n\t\t\tfile.createNewFile();\r\n\t\t}\r\n\r\n\t\tFileWriter fw = new FileWriter(file.getAbsoluteFile());\r\n\t\tBufferedWriter bw = new BufferedWriter(fw);\r\n\t\tbw.write(line);\r\n\t\tbw.close();\r\n\t}", "public static void save(String line)\n {\n \ttry (BufferedWriter writer = Files.newBufferedWriter(path, StandardCharsets.UTF_8)) {\n \t\twriter.write(line,0,line.length());//takes the lines stars from the index 0 and saves till the end\n \t} catch (Exception x) {\n \t\tx.printStackTrace();//prints stack if something is worng\n \t}\n }", "protected void writeLine(String line) throws IOException {\n writer.write(line);\n writer.write(EOL);\n }", "public boolean writeFirstLine( String line ) {\n PrintWriter fileWriteStream = null;\n boolean operation = false;\n\n try {\n fileWriteStream = new PrintWriter( this.fileName );\n fileWriteStream.println( line );\n operation = true;\n } catch ( Exception error ) {\n System.out.println(error.toString());\n } finally {\n fileWriteStream.close();\n }\n\n return operation;\n }", "public void writeLine(String line) {\n try {\n out.println(line);\n } catch (Exception e) {\n // done\n cleanup();\n }\n }", "public static void write(boolean isLine, String ID, String line, Function function, DawnParser parser) throws DawnRuntimeException\n {\n if (line == null)\n throw new DawnRuntimeException(function, parser, \"attempted to write a null string\");\n\n Object obj = parser.getProperty(\"DAWN.IO#FILE.\" + ID);\n if (!(obj instanceof BufferedWriter))\n throw new DawnRuntimeException(function, parser, \"attempted to write into an input file\");\n\n BufferedWriter out = (BufferedWriter) obj;\n if (out != null)\n {\n try\n {\n out.write(line, 0, line.length());\n if (isLine)\n out.write(NEW_LINE);\n } catch (IOException ioe) {\n throw new DawnRuntimeException(function, parser, \"file ID \" + ID + \" cannot be written properly\");\n }\n } else\n throw new DawnRuntimeException(function, parser, \"file ID \" + ID + \" points to a non-opened file\");\n }", "public void writeLineToSdcard(String filename, String line) {\n final String outputFile = Environment.getExternalStorageDirectory().toString() + \"/\"\n + filename;\n try {\n FileWriter fstream = null;\n fstream = new FileWriter(outputFile, true);\n BufferedWriter out = new BufferedWriter(fstream);\n out.write(line + \"\\n\");\n out.close();\n fstream.close();\n Log.print(\"write log: \" + outputFile);\n } catch (Exception e) {\n Log.print(\"exception for write log\");\n }\n }", "public void writePrintStream(String line, String path) {\n PrintStream fileStream = null;\n File file = new File(path);\n\n try {\n fileStream = new PrintStream(new FileOutputStream(file, true));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n fileStream.println(line);\n fileStream.close();\n }", "public void writeLine(String s) throws IOException {\n raos.writeLine(s);\n }", "public static void fileWriter(String path, String fileName, Object printLine) throws NumberFormatException, IOException {\n // Create File:\n\t\t\t\tFile f = new File(path + File.separator + fileName);\t\t\t\t \n\t\t\t // Write or add a String line into File:\t\n\t\t\t FileWriter fw = new FileWriter(f,true);\n\t\t\t PrintWriter pw = new PrintWriter(fw);\n\t\t\t pw.println(printLine);\n\t\t\t pw.close();\n\t\t\t}", "public static void saveAs(String line,String path)\n {\n \ttry (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), \"utf-8\"))) {//goes to the directory\n \t\n \t\twriter.write(line,0,line.length());//saves the lines starting from 0 till the length of the lines\n \t} catch (Exception x) {\n \t\tx.printStackTrace();\n \t}\n }", "public static void overwriteFile(String fileName, String lineToWrite) throws IOException\n\t{\n\t\tFileWriter writer = new FileWriter(fileName);\n\t\twriter.write(lineToWrite);\n\t\twriter.close();\n\t}", "public static void writeLineToFile(String filePath, String text) throws IOException {\n\t\t\n\t\t// Create the writer\n\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(filePath, true)));\n\t\t\n\t\t// Write a line to the file\n\t\tout.println(text);\n\t\tout.close();\n\t}", "private void addLine (String line) {\n writer.write (line);\n writer.newLine();\n // blockOut.append (line);\n // blockOut.append (GlobalConstants.LINE_FEED);\n }", "public static void randomAccessWrite() {\n try {\n RandomAccessFile f = new RandomAccessFile(FILES_TEST_PATH, \"rw\");\n f.writeInt(10);\n f.writeChars(\"test line\");\n f.close();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "public static void writeToFile(String fileName, String lineToWrite) throws IOException\n\t{\n\t\tFileWriter writer = new FileWriter(fileName, true);\n\t\twriter.write(lineToWrite);\n\t\twriter.close();\n\t}", "public void write_line(String string)\n {\n String[] current = read();\n\n try\n {\n dir = new File(contextRef.getFilesDir(), filename);\n PrintWriter writer = new PrintWriter(dir);\n\n for (int i = 0; i < current.length; i++)\n {\n String line = current[i];\n if (line != null)\n {\n writer.println(line);\n }\n }\n writer.println(string);\n writer.close();\n }catch (Exception ex)\n {\n debug = \"test write failure\";\n }\n }", "void putLine(String line);", "private void writeTo(String logEntry, File logFile) throws IOException {\n try (FileWriter logFileWriter = new FileWriter(logFile, true);) {\n logFileWriter.write(logEntry);\n logFileWriter.write(System.lineSeparator());\n logFileWriter.flush();\n logFileWriter.close();\n }\n}", "protected void append(String line) {\n\t\t\tout.append(line);\n\t\t}", "public static void writeLine(String fileName, String content) {\r\n write(fileName, content + System.lineSeparator());\r\n\r\n }", "protected boolean appendLine(final String filename, final String line) {\n final StringBuilder finalLine = new StringBuilder();\n \n if (addtime) {\n String dateString;\n try {\n final DateFormat dateFormat = new SimpleDateFormat(timestamp);\n dateString = dateFormat.format(new Date()).trim();\n } catch (IllegalArgumentException iae) {\n // Default to known good format\n final DateFormat dateFormat = new SimpleDateFormat(\"[dd/MM/yyyy HH:mm:ss]\");\n dateString = dateFormat.format(new Date()).trim();\n \n eventBus.publishAsync(new UserErrorEvent(ErrorLevel.LOW, iae,\n \"Dateformat String '\" + timestamp + \"' is invalid. For more information: \"\n + \"http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html\",\n \"\"));\n }\n finalLine.append(dateString);\n finalLine.append(' ');\n }\n \n if (stripcodes) {\n finalLine.append(Styliser.stipControlCodes(line));\n } else {\n finalLine.append(line);\n }\n \n try {\n final BufferedWriter out;\n if (openFiles.containsKey(filename)) {\n final OpenFile of = openFiles.get(filename);\n of.lastUsedTime = System.currentTimeMillis();\n out = of.writer;\n } else {\n out = new BufferedWriter(new FileWriter(filename, true));\n openFiles.put(filename, new OpenFile(out));\n }\n out.write(finalLine.toString());\n out.newLine();\n out.flush();\n return true;\n } catch (IOException e) {\n /*\n * Do Nothing\n *\n * Makes no sense to keep adding errors to the logger when we can't write to the file,\n * as chances are it will happen on every incomming line.\n */\n }\n return false;\n }", "public static void fileWriterPrinter(String path, String fileName, Object printLine) throws NumberFormatException, IOException {\n // Create File:\n\t\t\t\tFile f = new File(path + fileName);\t\t \n\t\t\t // Write or add a String line into File:\t\n\t\t\t FileWriter fw = new FileWriter(f,true);\n\t\t\t PrintWriter pw = new PrintWriter(fw);\n\t\t\t pw.println(printLine);\n\t\t\t pw.close();\n\t\t\t // System Out Print Line:\n\t\t\t fileWriterPrinter(printLine);\n\t\t\t}", "public static void fileWriter(String fileName, Object printLine) throws NumberFormatException, IOException {\n // Create File:\n\t\t\t\tFile f = new File(Common.testOutputFileDir + fileName);\t\t\t\t \n\t\t\t // Write or add a String line into File:\t\n\t\t\t FileWriter fw = new FileWriter(f,true);\n\t\t\t PrintWriter pw = new PrintWriter(fw);\n\t\t\t pw.println(printLine);\n\t\t\t pw.close();\n\t\t\t}", "protected void openWriteFile(Path filePath, String s) throws IOException{\n\t\tBufferedWriter writer = Files.newBufferedWriter(filePath, ENCODING);\n\t\twriter.write(s, 0, s.length());\n\t\twriter.close();\n\t}", "private static void write(BufferedWriter fileWriter,int startLine, int endLine) throws IOException {\n try(BufferedReader fileReader = new BufferedReader\n (new FileReader(\"C:\\\\Users\\\\radha\\\\Documents\\\\Research\\\\ml-25m\\\\ml-25m\\\\ratings.csv\"))){\n String line = null;\n int lineNo = 0;\n while ((line = fileReader.readLine()) != null) {\n lineNo++;\n if(lineNo < startLine){\n continue;\n }\n fileWriter.write(line);\n fileWriter.write(\"\\n\");\n if(lineNo > endLine){\n break;\n }\n\n }\n }\n\n\n }", "public abstract AbstractLine newLine() throws IOException;", "private void writeEndOfLine(final BufferedWriter file) throws IOException {\n file.write(\"\\\\\\\\\");\n file.newLine();\n }", "public void write(LineWriter writer) {\n\t\tsuper.write(writer);\n\t\twriter.writeLine(1); // version\n\t}", "public void sequenceWriter(String sequence) {\n try {\n Files.write(file, ((sequence + \"\\r\\n\")).getBytes(), StandardOpenOption.APPEND);\n } catch (IOException e) {\n System.out.println(\"Error:\" + e);\n }\n }", "protected abstract void writeFile();", "private static void appendWordLineToFile(Path wordFilePath, Path srcFilePath, Path destFilePath, int lineNum) throws IOException {\n try (FileReader inputStream = new FileReader(srcFilePath.toFile().getAbsolutePath());\n FileWriter outputStream = new FileWriter(destFilePath.toFile().getAbsoluteFile(), false)) {\n\n // If insert to the first line\n if (lineNum == 0) {\n // Insert the word\n writeWordLineToFile(wordFilePath, outputStream);\n\n // Append the rest of the words\n int i;\n while ((i = inputStream.read()) != -1) {\n outputStream.write(toChars(i));\n }\n } else {\n int lineCount = 0;\n\n // Copy the words until the given line is reached\n int i;\n while ((i = inputStream.read()) != -1) {\n outputStream.write(toChars(i));\n\n if (isWhitespace(i)) {\n lineCount++; // new line\n\n if (lineCount == lineNum) { // if the given line is reached, insert the given word\n writeWordLineToFile(wordFilePath, outputStream);\n }\n }\n }\n\n // Insert the word to the end\n if (lineCount < lineNum) {\n writeWordLineToFile(wordFilePath, outputStream);\n }\n }\n }\n }", "public void line(String line) {\n\t\t}", "public void newLogFileLine(String line) {\n System.out.println(line);\n }", "@Override\n public void write(String str) {\n BufferedWriter writer;\n try {\n String path = FileManager.getInstance().getPath();\n writer = new BufferedWriter(new FileWriter(path, true));\n writer.write(str);\n writer.newLine();\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "void write();", "public void writeFile(String data){\n\t\t\n\t\tcurrentLine = data;\n\t\t\n\t\t\ttry{ \n\t\t\t\tFile file = new File(\"/Users/bpfruin/Documents/CSPP51036/hw3-bpfruin/src/phfmm/output.txt\");\n \n\t\t\t\t//if file doesnt exists, then create it\n\t\t\t\tif(!file.exists()){\n\t\t\t\t\tfile.createNewFile();\n\t\t\t\t}\n \n\t\t\t\t//true = append file\n\t\t\t\tFileWriter fileWriter = new FileWriter(file,true);\n \t \tBufferedWriter bufferWriter = new BufferedWriter(fileWriter);\n \t \tbufferWriter.write(data);\n \t \tbufferWriter.close();\n \n \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}", "private void writeFile(File file, String... lines) throws IOException {\n try (BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file))) {\n for (String line : lines) {\n bufferedWriter.write(line);\n bufferedWriter.newLine();\n }\n }\n }", "public static void newLine()\r\n {\r\n logFile.println();\r\n logFile.flush();\r\n }", "private void writeOutputLine(String textLine) {\n String outputText = Calendar.getInstance().getTime().toString();\n if (textLine != null) {\n outputText = outputText + \" : \" + textLine;\n }\n try {\n this.bufferedWriter.write(outputText);\n this.bufferedWriter.newLine();\n this.bufferedWriter.flush();\n } catch (IOException e) {\n LOG.error(\"Can not write text line.\", e);\n }\n }", "public void writeFile() {\n try {\n FileWriter writer = new FileWriter(writeFile, true);\n writer.write(user + \" \" + password);\n writer.write(\"\\r\\n\"); // write new line\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n }", "private void writeHline(final BufferedWriter file) throws IOException {\n file.write(\"\\\\hline\");\n file.newLine();\n }", "public static void writeLine(String string, int line) {\r\n\t\taddLine(string, line);\r\n\t\trefresh();\r\n\t}", "public abstract AbstractLineWriter newWriter(String filename)\r\n\t\t\tthrows FileNotFoundException, IOException;", "public int write(byte[] b, int off, int len)\n {\n synchronized (this) {\n if (!open) {\n return 0;\n }\n\n writing = true;\n started = true;\n reset = false;\n timeTracker.start();\n }\n line.start();\n int written = line.write(b, off, len);\n synchronized (this) {\n // drain() might be waiting, so we should wake it up.\n notifyAll();\n writing = false;\n\t\t\tif (!reset) {\n\t\t\t\ttotalWritten += written;\n\t\t\t} else if (reset && open) {\n\t\t\t\t// Flush what we just wrote to keep it reset.\n\t\t\t\tline.flush();\n\t\t\t}\n return written;\n }\n }", "public void write(int c) throws IOException {\n ensureOpen();\n out.write(c);\n }", "void createSingleFileComment(ChangedFile file, Integer line, String comment);", "public static void fileWriterPrinter(String fileName, Object printLine) throws NumberFormatException, IOException {\n // Create File:\n\t\t\t\tFile f = new File(Common.testOutputFileDir + fileName);\t\t\t\t \n\t\t\t // Write or add a String line into File:\t\n\t\t\t FileWriter fw = new FileWriter(f,true);\n\t\t\t PrintWriter pw = new PrintWriter(fw);\n\t\t\t pw.println(printLine);\n\t\t\t pw.close();\n\t\t\t // System Out Print Line:\n\t\t\t fileWriterPrinter(printLine);\n\t\t\t}", "protected void emitLine(String line) {\n if (writer == null) {\n super.emitLine(line);\n return;\n }\n line = line.replaceAll(\"\\t\", \" \");\n writer.println(line);\n }", "public void recordOrder(){\n PrintWriter output = null;\n try{\n output = \n new PrintWriter(new FileOutputStream(\"record.txt\", true));\n }\n catch(Exception e){//throws exception\n System.out.println(\"File not found\");\n System.exit(0);\n }\n output.println(Coffee);//prints in file contents of Coffee\n output.close();//closes file\n }", "private void writeToFile(E entity){\n try (BufferedWriter bw = new BufferedWriter(new FileWriter(this.fileName,true))) {\n bw.write(entity.toFile());\n bw.newLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public abstract AbstractLineWriter newWriter(OutputStream datastream)\r\n\t\t\tthrows IOException;", "public static void addLine(File file, String lineToAdd) throws Exception {\n BufferedReader in = new BufferedReader(new FileReader(file));\n Vector<String> vLines = new Vector<String>();\n String line;\n\n while ((line = in.readLine()) != null) {\n vLines.add(line + \"\\n\");\n }\n in.close();\n\n BufferedWriter out = new BufferedWriter(new FileWriter(file));\n for (String lineToWrite : vLines) {\n out.write(lineToWrite);\n }\n out.write(lineToAdd);\n out.close();\n }", "public void recordOrder(){ \n PrintWriter output = null;\n try{\n output = \n new PrintWriter(new FileOutputStream(\"record.txt\", true));\n }\n catch(Exception e){\n System.out.println(\"File not found\");\n System.exit(0);\n }\n output.println(Tea);//writes into the file contents of String Tea\n output.close();//closes file\n }", "private void open()\n {\n try\n {\n // Found how to append to a file here \n //http://stackoverflow.com/questions/1625234/how-to-append-text-to-an-existing-file-in-java\n r = new PrintWriter( new BufferedWriter(new FileWriter(filePath, true)));\n }\n catch( IOException e )\n {\n r = null;\n UI.println(\"An error occored when operning stream to the log file.\\n This game wont be logged\");\n Trace.println(e);\n }\n }", "private static void writeWordLineToFile(Path wordFilePath, FileWriter outputStream) throws IOException {\n try (FileReader wordStream = new FileReader(wordFilePath.toFile().getAbsoluteFile())) {\n int iw;\n while ((iw = wordStream.read()) != -1 && !isWhitespace(iw)) {\n outputStream.write(toChars(iw));\n }\n outputStream.write('\\n');\n }\n }", "public static void writeLine(String sLine)\n\t{\n\t\tif (bJunit == true)\n\t\t{\n\t\t\tsJunitOutput = sLine;\n\t\t\tSystem.out.println(sLine);\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(sLine);\n\t\t}\n\t}", "public static void writeFile(ArrayList<String> lines, String fileName)\n {\n try\n {\n // Create file \n FileWriter fstream = new FileWriter(fileName);\n BufferedWriter out = new BufferedWriter(fstream);\n for (String line: lines)\n {\n out.write(line);\n }\n //Close the output stream\n out.close();\n }\n catch (Exception e){//Catch exception if any\n System.err.println(\"Error: \" + e.getMessage());\n }\n }", "public void FilesBufferWrite2Append() throws IOException {\n \ttry { \t\n \t\t\n \t \t/* This logic will check whether the file\n \t \t \t * exists or not. If the file is not found\n \t \t \t * at the specified location it would create\n \t \t \t * a new file*/\n \t \t \tif (!file.exists()) {\n \t \t\t file.createNewFile();\n \t \t \t}\n \t\t\n \t \t \t//KP : java.nio.file.Files.write - NIO is buffer oriented & IO is stream oriented!]\n \t\tString str2Write = \"\\n\" + LocalDateTime.now().toString() + \"\\t\" + outPrintLn + \"\\n\";\n \t\tFiles.write(Paths.get(outFilePath), str2Write.getBytes(), StandardOpenOption.APPEND);\n \t\t\n \t}catch (IOException e) {\n\t \t// TODO Auto-generated catch block\n\t \te.printStackTrace();\t\t\n\t\t\tSystem.out.print(outPrintLn);\n\t\t\tSystem.out.println(outPrintLn);\t\n \t}\n }", "public void append_report(String line) {\n output.println(line);\n }", "protected static void closeLine (SourceDataLine line)\n {\n line.drain ();\n line.close ();\n }", "public void writeIDfile(String ID,String password)throws IOException\n {\n\n\n List<String> lines = Files.readAllLines(Paths.get(\"idpassword.txt\"));\n /*write part*/\n\n BufferedWriter bw = null;\n FileWriter fw = null;\n try {\n int j=0;\n String content = \"\";\n while (j<lines.size())\n {\n content+= lines.get(j)+\"\\n\";\n j++;\n }\n content+=ID+\",\"+password;\n\n fw = new FileWriter(\"idpassword.txt\");\n bw = new BufferedWriter(fw);\n bw.write(content);\n\n bw.close();\n fw.close();\n\n } catch (IOException e) {\n\n e.printStackTrace();\n\n } finally {\n\n try {\n\n if (bw != null)\n bw.close();\n\n if (fw != null)\n fw.close();\n\n } catch (IOException ex) {\n\n ex.printStackTrace();\n\n }\n\n }\n }", "private static void writeStream(Path path) {\n try (DataOutputStream dataOutputStream = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(path.toString())))) {\n dataOutputStream.writeUTF(\"go\");\n dataOutputStream.writeInt(5);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "void writeLine(Object... columns) throws IOException;", "private boolean writeWithoutWaiting(final String line, final LogTailer tailer) {\n final Future<Boolean> result = this.e.submit(new Callable<Boolean>() {\n\n @Override\n public Boolean call() throws Exception {\n BufferedWriter w = null;\n try {\n if (!LogWriter.this.target.exists()) {\n LogWriter.this.target.createNewFile();\n // give the tailer some time to figure out that the file\n // already exists\n Thread.sleep(1000);\n }\n w = new BufferedWriter(new FileWriter(LogWriter.this.target, true));\n w.write(line);\n w.newLine();\n LogWriter.LOGGER.info(\"Written log message '{}'.\", line);\n return true;\n } catch (final IOException ex) {\n LogWriter.LOGGER.warn(\"Failed writing log message '{}'.\", line, ex);\n return false;\n } finally {\n IOUtils.closeQuietly(w);\n }\n }\n\n });\n try {\n return result.get();\n } catch (final Exception ex) {\n LogWriter.LOGGER.warn(\"Failed writing log message '{}'.\", line, ex);\n return false;\n }\n }", "public void updateLine(long objectId, SupplierSettlementLine line) throws CoreException {\n try (Response response = clientApi.put(path + \"/\" + objectId + LINES + line.getId(), line)) {\n readResponse(response, String.class);\n }\n }", "public abstract void newLine();", "public static void writeInfoTofile() throws FileNotFoundException {\n try {\n FileOutputStream outputStream = new FileOutputStream(\"ex1.txt\");\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n throw e;\n }\n }", "public Writer openWriter() throws IOException {\n return new FileWriter(this);\n }", "public static void write(String path, String message) {\r\n\t\t\r\n\t\t// open the file\r\n\t\tFile file = new File(path);\r\n\t\t\r\n\t\t\r\n\t\t// if the file does not exist try to create one\r\n\t\tif (!file.exists())\r\n\t\t\tfile = createFile(path);\r\n\t\t\r\n\t\t\r\n\t\t// write to the file\r\n\t\ttry {\r\n\t\t\t// open stream\r\n\t\t\tFileWriter fWrite = new FileWriter(file);\r\n\t\t\tBufferedWriter bufferedWriter = new BufferedWriter(fWrite);\r\n\t\t\t\r\n\t\t\t// write new lines if any was found\r\n\t\t\tfor (String i : message.split(\"(\\n)+\")) {\r\n\t\t\t\tbufferedWriter.write(i);\r\n\t\t\t\tbufferedWriter.newLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// close anything was opened\r\n\t\t\tbufferedWriter.close();\r\n\t\t\tfWrite.close();\r\n\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public void write_file(String filename)\n {\n out.println(\"WRITE\");\n out.println(filename);\n int timestamp = 0;\n synchronized(cnode.r_list)\n {\n timestamp = cnode.r_list.get(filename).cword.our_sn;\n }\n // content = client <ID>, <ts>\n out.println(\"Client \"+my_c_id+\", \"+timestamp);\n // check if write operation finished on server and then exit method\n try\n {\n String em = null;\n em = in.readLine();\n Matcher m_eom = eom.matcher(em);\n if (m_eom.find())\n {\n System.out.println(\"WRITE operation finished on server : \"+remote_c_id);\n }\n else\n {\n System.out.println(\"WRITE operation ERROR on server : \"+remote_c_id);\n }\n }\n catch (IOException e) \n {\n \tSystem.out.println(\"Read failed\");\n \tSystem.exit(-1);\n }\n }", "public static void writeLine(String ID, String line, Function function, DawnParser parser) throws DawnRuntimeException\n {\n write(true, ID, line, function, parser);\n }", "public static void appendFile(PrintWriter pw, String file) throws IOException {\n\t\tfw = new FileWriter(file, true);\n\t\tmyFile = new File(file);\n\t\t//allows me to read file\n\t\tinFile = new Scanner(myFile);\n\t\t\n\t}", "void storeline(String linebuffer, fileInfo pinfo) {\n\t\tint linenum = ++pinfo.maxLine; /* note, no line zero */\n\t\tif (linenum > fileInfo.MAXLINECOUNT) {\n\t\t\tSystem.err.println(\"MAXLINECOUNT exceeded, must stop.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tpinfo.symbol[linenum] = node.addSymbol(linebuffer, pinfo == oldinfo,\n\t\t\t\tlinenum);\n\t}", "public FileWriter(FileDescriptor fd) {\n super(new FileOutputStream(fd));\n }", "public void reopen() throws IOException {\r\n writer.close();\r\n writer = new BufferedWriter(new java.io.FileWriter(file));\r\n }", "public static void writeNumberToFile() {\n try {\n FileOutputStream outputStream = new FileOutputStream(\"ex1.txt\");\n outputStream.write(String.valueOf(53).getBytes());\n } catch (FileNotFoundException e) {\n // handle FileNotFoundException\n } catch (IOException e) {\n // handle IOException\n } finally {\n System.out.println(\"Finally block\");\n }\n }", "public static void main(String[] args) throws IOException {\n \r\nFile f=new File(\"d:\\\\addition.txt\");\r\nString s=\" addition\"+\"\\n\"+( 2+ 1);\r\n FileOutputStream fos=new FileOutputStream(f,true);\r\n byte[] b=s.getBytes();\r\n fos.write(13);\r\n fos.write(b);\r\n fos.flush();\r\n\t}", "private static void writeFileOnClient(FileStore.Client client) throws SystemException, TException, IOException {\n String fileName = \"sample.txt\";\n\n String content = \"Content\";\n\n try {\n\n RFile rFile = new RFile();\n RFileMetadata rFileMetaData = new RFileMetadata();\n\n rFileMetaData.setFilename(fileName);\n rFileMetaData.setFilenameIsSet(true);\n\n rFile.setMeta(rFileMetaData);\n rFile.setMetaIsSet(true);\n\n rFile.setContent(content);\n rFile.setContentIsSet(true);\n\n client.writeFile(rFile);\n\n } catch (TException x) {\n throw x;\n }\n }", "@Override\n public OutputStream openOutputFile(String pathname) throws IOException {\n return new FileOutputStream(pathname);\n }", "public void writeToTextFile(String filename){\n try{\n FileWriter myWriter = new FileWriter(filename); \n myWriter.write(toString());\n myWriter.close();\n } \n catch(IOException e) { \n System.out.println(\"An error occurred.\"); \n e.printStackTrace();\n } \n }", "public void write(int b) throws IOException\n {\n checkThreshold(1);\n getStream().write(b);\n written++;\n }", "private static void writeToOrder() throws IOException {\n FileWriter write = new FileWriter(path5, append);\n PrintWriter print_line = new PrintWriter(write);\n ArrayList<Order> orders = Inventory.getOrderHistory();\n for (int i = 0; i < orders.size(); i++) {\n Order o = (Order) orders.get(i);\n\n String orderNum = String.valueOf(o.getOrderNumber());\n String UPC = String.valueOf(o.getUpc());\n String productName = o.getProductName();\n String distName = o.getDistributorName();\n String cost = String.valueOf(o.getCost());\n String quantity = String.valueOf(o.getQuantity());\n String isProcesed = String.valueOf(o.isProcessed());\n\n textLine =\n orderNum + \", \" + UPC + \", \" + quantity + \",\" + productName + \", \" + distName + \", \" + cost\n + \", \" + isProcesed;\n print_line.printf(\"%s\" + \"%n\", textLine);\n\n }\n print_line.close();\n\n }", "public void write(String filePath) {\n\t\tcmd = new WriteCommand(editor, filePath);\n\t\tinvoker = new MiniEditorInvoker(cmd);\n\t\tinvoker.action();\n\t}", "public void writeToLogFile(String entry) {\r\n\t\ttry{\r\n\t\t\tStringBuilder out = new StringBuilder(50);\r\n\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);\r\n\t\t out.append(sdf.format(cal.getTime()) + \";\" + entry);\r\n\t\t \r\n\t\t this.write(out);\r\n\t\t}catch (Exception e){\r\n\t\t System.err.println(\"Error: \" + e.getMessage());\r\n\t\t}\r\n\t}", "public void write(int c) throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n getBuffer().append((char)c);\r\n }", "public static void w(String text, File loc) throws Exception {\n\r\n\t\tFileWriter fw = new FileWriter(loc, true);\r\n\t\tBufferedWriter writer = new BufferedWriter(fw);\r\n\r\n\t\twriter.newLine();\r\n\t\twriter.write(text);\r\n\r\n\t\twriter.close();\r\n\t\tfw.close();\r\n\t}", "public void WriteRecordsTo(final String filePath) throws IOException\r\n {\r\n BufferedWriter writer = FileUtilities.OpenWriter(filePath);\r\n Iterator<ServiceRecord> iterator = records.iterator();\r\n if (iterator.hasNext())\r\n {\r\n String record = iterator.next().toString();\r\n record += Format.SERVICE_RECORD_SEPARATOR; //I repeat code here to prevent having a new line\r\n writer.write(record); //inserted into the file after the first entry.\r\n while (iterator.hasNext()) //This makes it easier to read from the file in case we have only one service record on disk\r\n {\r\n record = \"\\n\"+iterator.next().toString();\r\n record += Format.SERVICE_RECORD_SEPARATOR;\r\n writer.write(record);\r\n } \r\n } \r\n writer.close(); \r\n }", "public void writeToFile(PrintWriter ofile1)\n {\n if(ofile1 != null)\n {\n ofile1.println(this.plainDataToString());\n }\n \n return;\n \n }", "public abstract void saveToFile(PrintWriter out);", "public void writeObject(RandomAccessFile arq) throws IOException{\n byte[] dados = this.getByteArray();\n arq.writeChar(' ');\n arq.writeShort(dados.length);\n arq.write(dados);\n }", "public void write(final File out) throws IOException;", "public void setLine(int line);", "public static void WriteStreamAppendByRandomAccessFile(String fileName, String content) throws IOException {\n try {\n RandomAccessFile randomFile = new RandomAccessFile(fileName, \"rw\");\n long fileLength = randomFile.length();\n // Write point to the end of file.\n randomFile.seek(fileLength);\n randomFile.writeBytes(content);\n randomFile.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }" ]
[ "0.7110234", "0.6670682", "0.66418636", "0.6564084", "0.64680755", "0.64281356", "0.6421658", "0.6389916", "0.63587785", "0.6336587", "0.6244747", "0.62022996", "0.6106127", "0.60312706", "0.5971415", "0.5967926", "0.59524184", "0.5896088", "0.5890885", "0.5871325", "0.58542556", "0.58337075", "0.5726221", "0.56974494", "0.5657411", "0.56224644", "0.5602411", "0.55597645", "0.55547935", "0.55505306", "0.55490446", "0.5494309", "0.54598516", "0.54530245", "0.5442391", "0.5427575", "0.53925383", "0.52826995", "0.5272578", "0.5268726", "0.526534", "0.5256633", "0.52523077", "0.52470535", "0.52407914", "0.52247643", "0.52173233", "0.52145827", "0.51981217", "0.5181962", "0.51597476", "0.5144344", "0.51085544", "0.5107938", "0.5098469", "0.50820655", "0.50731236", "0.5055994", "0.50512415", "0.5046953", "0.5034759", "0.50260043", "0.50028664", "0.4997983", "0.49950442", "0.49710825", "0.49567017", "0.49462003", "0.4943655", "0.49308273", "0.4928911", "0.4926427", "0.49174392", "0.4914438", "0.49128342", "0.49117133", "0.49044493", "0.48915306", "0.48908335", "0.4886643", "0.48788577", "0.48549506", "0.48298308", "0.48280674", "0.4827667", "0.48260638", "0.48258653", "0.48253742", "0.48223218", "0.48096156", "0.48048145", "0.48037115", "0.47984374", "0.4796455", "0.47950017", "0.4793294", "0.47918582", "0.47918352", "0.4785852", "0.47857893" ]
0.6192641
12
Closes the given file
public void closeFile(File file) throws IOException { BufferedWriter writer = writers.get(file); writer.close(); writers.remove(file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void closeFile() \r\n {\r\n try // close file and exit\r\n {\r\n if ( input != null )\r\n input.close();\r\n } // end try\r\n catch ( IOException ioException )\r\n {\r\n System.err.println( \"Error closing file.\" );\r\n System.exit( 1 );\r\n } // end catch\r\n }", "public static void closeFile() {\n\t\tif (input != null)\n\t\t\tinput.close();\n\t\t\n\t}", "public void closeFile(){\n\t\t\n\t\ttry{\n\n\t\t\tbufferedInput.close();\n\t\t}\n\t\tcatch(IOException ex) {\n \t\tSystem.err.println(\"Error: Some problem while closing file\");; \n\t\t\tSystem.exit(1); \n \t}\n\t}", "public void closeFile(){\n }", "public void closeFile() throws IOException{\r\n\t\toutRCVictim.close();\r\n\t\tf[0][0].close();\r\n\t\t\r\n\t}", "public void closeFile() throws IOException{\n\t\tsourceReader.close();\n\t}", "public void closeFile() throws IOException {\n finstream.close();\n writer.close();\n }", "private void closeFile() {\n if (fileSpec != null) {\n boolean modOK = modIfChanged();\n if (currentFileModified) {\n filePrefs.handleClose();\n }\n }\n currentFileModified = false;\n }", "public static void closeFile() throws IOException {\n\t\ttry {\n\t\t\tinput.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Could not close input file. Make sure it isn't open elsewhere.\");\n\t\t\tthrow e;\n\t\t}\t\t\n\t}", "@Override\n public void closeFile(@Nonnull final VirtualFile file) {\n closeFile(file, true, false);\n }", "public void close() throws java.io.IOException {\n\t\tbr.close(); \t\t\t//Closes the file\n\t}", "public static void close( RandomAccessFile file )\n {\n if ( file != null )\n {\n try\n {\n file.close();\n }\n catch ( IOException e )\n {\n log.error( \"Error closing random access file: \" + file, e );\n }\n }\n }", "public void close(){\n\t\ttry {\n\t\t\tout.close();\n\t\t\tout = null;\n\t\t}\n\t\tcatch (IOException e){\n\t\t\tSystem.out.println(\"Problem closing file.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "@Override\r\n\tpublic final void close() throws IOException {\r\n\t\tf.close();\r\n\t\tf = null;\r\n\t}", "public static void closeFile(String ID, Function function, DawnParser parser) throws DawnRuntimeException\n {\n Object obj = parser.getProperty(\"DAWN.IO#FILE.\" + ID);\n if (obj == null)\n return;\n\n if (!(obj instanceof Reader) && !(obj instanceof Writer))\n throw new DawnRuntimeException(function, parser, \"error, given ID \" + ID + \" does not point to a file\");\n\n try\n {\n if (obj instanceof Reader)\n ((BufferedReader) obj).close();\n else\n {\n BufferedWriter out = (BufferedWriter) obj;\n out.flush();\n out.close();\n }\n\n parser.unsetProperty(\"DAWN.IO#FILE.\" + ID);\n } catch (IOException ioe) {\n throw new DawnRuntimeException(function, parser, \"cannot close file ID \" + ID);\n }\n }", "public final void yyclose() throws java.io.IOException {\r\n zzAtEOF = true; /* indicate end of file */\r\n zzEndRead = zzStartRead; /* invalidate buffer */\r\n\r\n if (zzReader != null)\r\n zzReader.close();\r\n }", "public final void yyclose() throws java.io.IOException {\r\n zzAtEOF = true; /* indicate end of file */\r\n zzEndRead = zzStartRead; /* invalidate buffer */\r\n\r\n if (zzReader != null)\r\n zzReader.close();\r\n }", "public final void yyclose() throws java.io.IOException {\r\n zzAtEOF = true; /* indicate end of file */\r\n zzEndRead = zzStartRead; /* invalidate buffer */\r\n\r\n if (zzReader != null)\r\n zzReader.close();\r\n }", "public final void yyclose() throws java.io.IOException {\r\n zzAtEOF = true; /* indicate end of file */\r\n zzEndRead = zzStartRead; /* invalidate buffer */\r\n\r\n if (zzReader != null)\r\n zzReader.close();\r\n }", "public final void yyclose() throws java.io.IOException {\r\n zzAtEOF = true; /* indicate end of file */\r\n zzEndRead = zzStartRead; /* invalidate buffer */\r\n\r\n if (zzReader != null)\r\n zzReader.close();\r\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; // indicate end of file\n zzEndRead = zzStartRead; // invalidate buffer\n\n if (zzReader != null) {\n zzReader.close();\n }\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; // indicate end of file\n zzEndRead = zzStartRead; // invalidate buffer\n\n if (zzReader != null) {\n zzReader.close();\n }\n }", "protected void close() {\r\n\t\ttry {\r\n\t\t\t_asciiIn.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\r\n\t\t\t\t\t\"Error ocurred while closing file \" + _directory + _filename + _filetype + \":\" + e.getMessage());\r\n\t\t} // catch\r\n\t}", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "void close() throws FileSystemException;", "public void closeFile(SrvSession sess, TreeConnection tree, NetworkFile file)\n throws IOException {\n \n // Access the database context\n\n DBDeviceContext dbCtx = (DBDeviceContext) tree.getContext();\n\n // Check if the file is an NTFS stream\n \n if ( file.isStream()) {\n \n // Close the NTFS stream\n \n closeStream(sess, tree, file);\n \n // Check if the stream is marked for deletion\n \n if ( file.hasDeleteOnClose())\n deleteStream(sess, tree, file.getFullNameStream());\n return; \n }\n \n // Debug\n \n if ( Debug.EnableInfo && hasDebug())\n Debug.println(\"DB closeFile() file=\" + file.getFullName());\n \n // Close the file\n\n dbCtx.getFileLoader().closeFile(sess, file);\n\n // Access the JDBC file\n \n DBNetworkFile jdbcFile = null;\n \n if ( file instanceof DBNetworkFile) {\n \n // Access the JDBC file\n \n jdbcFile = (DBNetworkFile) file;\n\n // Decrement the open file count\n \n FileState fstate = jdbcFile.getFileState();\n\n // Check if the file state is valid, if not then check the main file state cache\n\n if ( fstate == null) {\n \n // Check the main file state cache\n \n fstate = getFileState(file.getFullName(), dbCtx, false);\n }\n else {\n \n // Decrement the open file count for this file\n \n fstate.decrementOpenCount();\n }\n\n // Release any locks on the file owned by this session\n \n if ( jdbcFile.hasLocks()) {\n \n // Get the lock manager\n \n FileLockingInterface flIface = (FileLockingInterface) this;\n LockManager lockMgr = flIface.getLockManager(sess, tree);\n \n // DEBUG\n \n if ( Debug.EnableInfo && hasDebug())\n Debug.println(\"Releasing locks for closed file, file=\" + jdbcFile.getFullName() + \", locks=\" + jdbcFile.numberOfLocks());\n \n // Release all locks on the file owned by this session\n \n lockMgr.releaseLocksForFile(sess, tree, file);\n }\n \n // Check if we have a valid file state\n \n if ( fstate != null) {\n \n // Update the cached file size\n \n DBFileInfo finfo = (DBFileInfo) fstate.findAttribute(FileState.FileInformation);\n if ( finfo != null && file.getWriteCount() > 0) {\n \n // Update the file size\n \n finfo.setSize(jdbcFile.getFileSize());\n \n // Update the modified date/time\n \n finfo.setModifyDateTime(jdbcFile.getModifyDate());\n \n // DEBUG\n \n if ( Debug.EnableInfo && hasDebug())\n Debug.println(\" File size=\" + jdbcFile.getFileSize() + \", modifyDate=\" + jdbcFile.getModifyDate());\n }\n\n // DEBUG\n \n if ( Debug.EnableInfo && hasDebug())\n Debug.println(\" Open count=\" + jdbcFile.getFileState().getOpenCount());\n }\n \n // Check if the file/directory is marked for delete\n \n if ( file.hasDeleteOnClose()) {\n \n // Check for a file or directory\n \n if ( file.isDirectory())\n deleteDirectory(sess, tree, file.getFullName());\n else\n deleteFile(sess, tree, file.getFullName());\n \n // DEBUG\n\n if ( Debug.EnableInfo && hasDebug())\n Debug.println(\" Marked for delete\");\n }\n }\n else if ( Debug.EnableError)\n Debug.println(\"closeFile() Not DBNetworkFile file=\" + file);\n \n // Check if the file was opened for write access, if so then update the file size and modify date/time\n \n if ( file.getGrantedAccess() != NetworkFile.READONLY && file.isDirectory() == false &&\n file.getWriteCount() > 0) {\n \n // DEBUG\n \n if ( Debug.EnableInfo && hasDebug())\n Debug.println(\" Update file size=\" + file.getFileSize());\n \n // Get the current date/time\n \n long modifiedTime = 0L;\n if ( file.hasModifyDate())\n modifiedTime = file.getModifyDate();\n else\n modifiedTime = System.currentTimeMillis();\n\n // Check if the modified time is earlier than the file creation date/time\n \n if ( file.hasCreationDate() && modifiedTime < file.getCreationDate()) {\n \n // Use the creation date/time for the modified date/time\n \n modifiedTime = file.getCreationDate();\n \n // DEBUG\n \n if ( Debug.EnableInfo && hasDebug())\n Debug.println(\"Close file using creation date/time for modified date/time\");\n }\n \n // Update the file details\n \n try {\n \n // Update the file details\n\n FileInfo finfo = new FileInfo();\n \n finfo.setFileSize( file.getFileSize());\n finfo.setModifyDateTime(modifiedTime);\n \n finfo.setFileInformationFlags(FileInfo.SetFileSize + FileInfo.SetModifyDate);\n\n // Call the database interface\n \n dbCtx.getDBInterface().setFileInformation(file.getDirectoryId(), file.getFileId(), finfo);\n }\n catch (DBException ex) {\n }\n }\n }", "public final void yyclose() throws IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public void close() {\n Preconditions.checkState(channel != null, \"File not open.\");\n try {\n if (channel.isOpen())\n channel.close();\n } catch (IOException e) {\n LOGGER.error(\"Failed to closed file channel for {}\", path, e);\n } finally {\n channel = null;\n }\n }", "public final void yyclose() throws java.io.IOException {\n\t\tzzAtEOF = true; /* indicate end of file */\n\t\tzzEndRead = zzStartRead; /* invalidate buffer */\n\n\t\tif (zzReader != null)\n\t\t\tzzReader.close();\n\t}", "final public void yyclose() throws java.io.IOException {\n yy_atEOF = true; /* indicate end of file */\n yy_endRead = yy_startRead; /* invalidate buffer */\n\n if (yy_reader != null)\n yy_reader.close();\n }", "final public void yyclose() throws java.io.IOException {\n yy_atEOF = true; /* indicate end of file */\n yy_endRead = yy_startRead; /* invalidate buffer */\n\n if (yy_reader != null)\n yy_reader.close();\n }", "public void close()\r\n\t{\r\n\t if (isOpen()) try {\r\n\t \tfd.close();\r\n\t } catch (IOException ex) {\r\n\t \t/* do nothing */\r\n\t } finally {\r\n\t\t thisc = EOF;\r\n\t\t holdc = EOF;\r\n\t\t fd = null;\r\n\t }\r\n\t}", "public void close() throws IOException {\n/* 202 */ this.randomAccessFile.close();\n/* */ }", "LogFile close() throws IOException\n {\n try {\n if (channel.isOpen())\n {\n // prevent multiple close\n position = channel.position(); // remember postion at close\n // FEATURE 300922; unlock the file if we obtained a lock.\n if (lock != null)\n {\n lock.release();\n // TODO: log lock released\n // System.err.println(file.getName() + \" unlocked\");\n }\n channel.close();\n // TODO: log file closed\n // System.err.println(file.getName() + \" closed\");\n }\n } catch(IOException e) {\n // BUG 303907 - add message to IOException\n IOException ioe = new IOException(\"LogFile.close(): attempting to close \" + \n file.getName() + \" [\" + e.getMessage() + \"]\");;\n ioe.setStackTrace(e.getStackTrace());\n throw ioe;\n }\n return this;\n }", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() {\r\n Log.d(LOG_TAG, \"close()\");\r\n if (mCurrentFileStream != null) {\r\n try {\r\n mCurrentFileStream.close();\r\n } catch (IOException e) {\r\n Log.e(LOG_TAG, \"Error closing file\", e);\r\n }\r\n }\r\n mFailedOpen = false;\r\n mCurrentFileStream = null;\r\n }", "public void close() throws IOException {\n FileOutputStream out = new FileOutputStream(fileName);\n wb.write(out);\n\n out.close();\n wb.close();\n }", "public void closeTemplate(String fxmlFile) throws IOException {\n\t}", "public void close(){\r\n\t\tif (this.fileWriter != null){\r\n\t\t\ttry {\r\n\t\t\t\tthis.fileWriter.flush();\r\n\t\t\t\tthis.fileWriter.close();\r\n\t\t\t\tthis.fileWriter = null;\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tlogger.error(\"Cannot close the file handle \"+this.myfilename+\". Your results might be lost. Cause: \"+e.getMessage());\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\r\n\t\t}\r\n\t}", "void close() throws IOException;", "void close() throws IOException;", "void close() throws IOException;", "void close() throws IOException;", "void close() throws IOException;", "void close() throws IOException;", "void close() throws IOException;", "void close() throws IOException;", "void close() throws IOException;", "void close() throws IOException;", "void close() throws IOException;", "public void close() throws IOException{\n\t\tcp.close();\n\t\tSuaDB.fileMgr().flushFile(fileName);\n\t}", "private void closeInputFile() {\n try {\n fileInputStream.close();\n } catch (IOException ioException) {\n Log.d(LOG_TAG, \"closeInputFile (165): Error while closing input file.\");\n ioException.printStackTrace();\n this.finishedEncoding = true;\n }\n }", "public void close() {}", "public void closeResourceInFinally() {\n FileInputStream inputStream = null;\n try {\n File file = new File(\"./tmp.txt\");\n inputStream = new FileInputStream(file);\n\n // use the inputStream to read a file\n\n } catch (FileNotFoundException e) {\n log.error(String.valueOf(e));\n } finally {\n if (inputStream != null) {\n try {\n inputStream.close();\n } catch (IOException e) {\n log.error(String.valueOf(e));\n }\n }\n }\n }", "public void Close() {\n\t\tfd.close();\r\n\t}", "public void close() {\n if (this.accessFile != null) {\n try {\n this.accessFile.close();\n } catch (IOException unused) {\n }\n this.accessFile = null;\n }\n }", "public int closeFile() {\n int test=0;\n try{\n _file=null;\n rows.clear();\n _fis.close();\n _bis.close();\n _dis.close();\n test=1;\n }catch( IOException ioe){\n test=0;\n }\n return test;\n }", "public boolean closeFile() \r\n\t{\r\n\t\tboolean result = true;\r\n\t\t// Close the input file\r\n\t\ttry \r\n\t\t{\r\n\t\t\tinFile.close();\r\n\t\t} // try\r\n\t\tcatch (Exception Error) \r\n\t\t{\r\n\t\t\tresult = false;\r\n\t\t} // catch\r\n\r\n\t\treturn (result);\r\n\t}", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();" ]
[ "0.76881474", "0.76115113", "0.7606387", "0.7248532", "0.71181864", "0.70334643", "0.7029296", "0.7013881", "0.69922453", "0.695177", "0.66060144", "0.6597649", "0.65421486", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394605", "0.6394076", "0.6357342", "0.6339391", "0.6339391", "0.6339391", "0.6339391", "0.6339391", "0.6332336", "0.6332336", "0.63197565", "0.62575215", "0.62284166", "0.6227332", "0.6226961", "0.622664", "0.6225246", "0.6225148", "0.6225148", "0.6215487", "0.61817443", "0.61737096", "0.6166121", "0.6166121", "0.6166121", "0.6166121", "0.6166121", "0.6166121", "0.6166121", "0.6166121", "0.6158064", "0.6156849", "0.61414516", "0.6102637", "0.6094895", "0.6094895", "0.6094895", "0.6094895", "0.6094895", "0.6094895", "0.6094895", "0.6094895", "0.6094895", "0.6094895", "0.6094895", "0.6068705", "0.59993607", "0.5957416", "0.5948033", "0.59468657", "0.59275633", "0.5925694", "0.5924354", "0.58429354", "0.58429354", "0.58429354", "0.58429354", "0.58429354", "0.58429354", "0.58429354", "0.58429354", "0.58429354", "0.58429354", "0.58429354", "0.58429354" ]
0.6723434
10
Closes all open files
public void closeAll() throws IOException { for (BufferedWriter writer : writers.values()) { writer.close(); } writers.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void closeFiles() {\n try {\n inputFile.close();\n debugFile.close();\n reportFile.close();\n workFile.close();\n stnFile.close();\n } catch(Exception e) {}\n }", "void closeAll();", "private void closeAll(){\r\n\t\t\r\n\t}", "public void closeAll() throws IOException {\n\t\tscMessages.close();\n\t\tscFiles.close();\n\t}", "private static void closeAll() {\n try {\n outputFileBuffer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n Encog.getInstance().shutdown();\n }", "public void shutdown() {\n\t\tint i = 0;\n\t\twhile (i < openFiles.size()) {\n\t\t\tPhile phile = openFiles.get(i);\n\t\t\ttry {\n\t\t\t\tclose(phile);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t\ti++;\n\t\t}\n }", "private void close() {\r\n\t\tfor ( int i = 0; i < _headerObject._filenames.length; ++i) {\r\n\t\t\tFileObject fileObject = ( FileObject)_headerObject._fileObjectMap.get( _headerObject._filenames[ i]);\r\n\t\t\tif ( null == fileObject)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tfileObject.close();\r\n\t\t}\r\n\t}", "public void dispose() {\n Collection<File> values = compareFiles.values();\n for (File file : values) {\n file.delete();\n }\n\n compareFiles.clear();\n }", "public void closeFile(){\n }", "public void closeAllFrames() {\r\n\t\tfor (int i = 0; i < frames.size(); i++) {\r\n\t\t\tframes.get(i).attemptClose();\r\n\t\t}\r\n\t}", "static void dispose() {\n for (final Writer w : logFiles.values()) {\n try {\n w.close();\n } catch (IOException ioe) {\n // don't care\n }\n }\n logFiles.clear();\n }", "public static void closeFile() {\n\t\tif (input != null)\n\t\t\tinput.close();\n\t\t\n\t}", "public void closeAll() throws IOException {\n\n if (objectInputStream != null) {\n objectInputStream.close();\n objectInputStream = null;\n fileInputStream = null;\n }\n\n if (objectOutputStream != null) {\n objectOutputStream.flush();\n objectOutputStream.close();\n objectOutputStream = null;\n fileOutputStream = null;\n }\n }", "void close() throws FileSystemException;", "public void close() throws FileSystemException {\n\t\tlogger.info(\"Closing \" + this.getClass().getSimpleName());\n\t\tWebDriver wd = Connection.getDriver();\n\t\twd.close();\n\t\tif (callersWindowHandle != null) {\n\t\t\twd.switchTo().window(callersWindowHandle);\n\t\t}\n\t}", "public synchronized void close() {}", "public void close() {}", "public void closeFile() throws IOException {\n finstream.close();\n writer.close();\n }", "public void closeFile() throws IOException{\r\n\t\toutRCVictim.close();\r\n\t\tf[0][0].close();\r\n\t\t\r\n\t}", "public void close()\r\n\t{\r\n\t if (isOpen()) try {\r\n\t \tfd.close();\r\n\t } catch (IOException ex) {\r\n\t \t/* do nothing */\r\n\t } finally {\r\n\t\t thisc = EOF;\r\n\t\t holdc = EOF;\r\n\t\t fd = null;\r\n\t }\r\n\t}", "public void close(){\n\t\ttry {\n\t\t\tout.close();\n\t\t\tout = null;\n\t\t}\n\t\tcatch (IOException e){\n\t\t\tSystem.out.println(\"Problem closing file.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "public void close() {\r\n Log.d(LOG_TAG, \"close()\");\r\n if (mCurrentFileStream != null) {\r\n try {\r\n mCurrentFileStream.close();\r\n } catch (IOException e) {\r\n Log.e(LOG_TAG, \"Error closing file\", e);\r\n }\r\n }\r\n mFailedOpen = false;\r\n mCurrentFileStream = null;\r\n }", "public void closeFile(){\n\t\t\n\t\ttry{\n\n\t\t\tbufferedInput.close();\n\t\t}\n\t\tcatch(IOException ex) {\n \t\tSystem.err.println(\"Error: Some problem while closing file\");; \n\t\t\tSystem.exit(1); \n \t}\n\t}", "protected void close() {\r\n\t\ttry {\r\n\t\t\t_asciiIn.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\r\n\t\t\t\t\t\"Error ocurred while closing file \" + _directory + _filename + _filetype + \":\" + e.getMessage());\r\n\t\t} // catch\r\n\t}", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close() throws IOException{\n\t\tcp.close();\n\t\tSuaDB.fileMgr().flushFile(fileName);\n\t}", "public static void closeAllWindows() {\n\t\tcloseAllWindows(false);\n\t}", "@Override\n public void close() {\n while (!blocks.isEmpty()) {\n blocks.poll().clean();\n }\n }", "public void close() {\n if (cleanup != null) {\n cleanup.disable();\n }\n if (isOpen()) {\n forceClose();\n }\n }", "public void closeFile() throws IOException{\n\t\tsourceReader.close();\n\t}", "private void setFileClosed() {\n \topenFiles.pop();\n \trelativeNames.pop();\n }", "public void close(){\r\n\t\tif (this.fileWriter != null){\r\n\t\t\ttry {\r\n\t\t\t\tthis.fileWriter.flush();\r\n\t\t\t\tthis.fileWriter.close();\r\n\t\t\t\tthis.fileWriter = null;\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tlogger.error(\"Cannot close the file handle \"+this.myfilename+\". Your results might be lost. Cause: \"+e.getMessage());\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\r\n\t\t}\r\n\t}", "@Override\n public void onClose() {\n logger.info(\"Closing {} streams for file {}\", this.getTransferType(), this.getResource().file);\n try {\n if (inputChannel != null) {\n inputChannel.close();\n inputChannel = null;\n inputBuffer.clear();\n inputBuffer = null;\n }\n if (outputStream != null) {\n outputStream.close();\n outputStream = null;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "final private void closeAll() throws IOException {\n // This method is final since version 2.2\n\n try {\n // Close the socket\n if (clientSocket != null)\n clientSocket.close();\n\n // Close the output stream\n if (output != null)\n output.close();\n\n // Close the input stream\n if (input != null)\n input.close();\n } finally {\n // Set the streams and the sockets to NULL no matter what\n // Doing so allows, but does not require, any finalizers\n // of these objects to reclaim system resources if and\n // when they are garbage collected.\n output = null;\n input = null;\n clientSocket = null;\n }\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; // indicate end of file\n zzEndRead = zzStartRead; // invalidate buffer\n\n if (zzReader != null) {\n zzReader.close();\n }\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; // indicate end of file\n zzEndRead = zzStartRead; // invalidate buffer\n\n if (zzReader != null) {\n zzReader.close();\n }\n }", "public void close() {\r\n\t}", "public void closeFile() \r\n {\r\n try // close file and exit\r\n {\r\n if ( input != null )\r\n input.close();\r\n } // end try\r\n catch ( IOException ioException )\r\n {\r\n System.err.println( \"Error closing file.\" );\r\n System.exit( 1 );\r\n } // end catch\r\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }" ]
[ "0.79999405", "0.7693239", "0.74204856", "0.7327293", "0.7288266", "0.72837603", "0.68894184", "0.6886775", "0.68061143", "0.678456", "0.6732315", "0.66951287", "0.66904175", "0.6664395", "0.6607096", "0.6602554", "0.6589082", "0.6564879", "0.65190023", "0.65082985", "0.6435646", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.64196247", "0.63965243", "0.63920105", "0.63918954", "0.63859755", "0.63859755", "0.63859755", "0.63859755", "0.63859755", "0.63859755", "0.63859755", "0.63859755", "0.63859755", "0.63859755", "0.63859755", "0.63859755", "0.63859755", "0.63859755", "0.63859755", "0.63822377", "0.6378064", "0.6348428", "0.63319", "0.6316351", "0.62986517", "0.62951857", "0.6288804", "0.6282652", "0.6280791", "0.6280791", "0.6271863", "0.6269964", "0.6268517", "0.6268517", "0.6268517", "0.6268517", "0.6268517", "0.6268517", "0.6268517", "0.6268517", "0.6268517", "0.6268517", "0.6268517", "0.6268517", "0.6268517" ]
0.64681435
20
Removes the file with the given name and extension
public boolean deleteFile(String fileName, String fileextension) { File f = getFile(fileName, fileextension); if (f.isFile()) { return f.delete(); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String removeFileExtension(String fileName) {\n int endIndex = fileName.lastIndexOf('.');\n if (endIndex != -1) {\n return fileName.substring(0, endIndex);\n } else {\n return fileName;\n }\n }", "private String removeFileExtension(String filename) {\n int extensionIndex = filename.indexOf(CODE_FILE_EXTENSION);\n if (extensionIndex != -1) {\n return filename.substring(0, extensionIndex);\n }\n return filename;\n }", "public void removeFile(FileContentType fileContentType, String fileName) throws ServiceException;", "public static String fileNameRemoveExtension(String fileName) {\r\n\tif (fileName == null)\r\n\t return null;\r\n\r\n\tfinal int idx = fileName.indexOf(\".\");\r\n\r\n\tif (idx == -1)\r\n\t return fileName;\r\n\r\n\telse\r\n\t return fileName.substring(0, idx);\r\n }", "private void deleteFile() {\n\t\tFile dir = getFilesDir();\n\t\tFile file = new File(dir, FILENAME);\n\t\tfile.delete();\n\t}", "private String stripFileExtension(String fileName) {\n int locationOfDot = fileName.lastIndexOf('.');\n return fileName.substring(0, locationOfDot);\n }", "public void removeArtifact(String name, String part, String ext) {\n artifacts.remove(keyFor(name, part, ext));\n }", "private void delete(String name) {\n File f = new File(name);\n if (f.exists()) {\n f.delete();\n }\n }", "private static void removeFromWorking(String fileName) {\n for (File file : WORKING_DIR.listFiles()) {\n if (!file.isDirectory()) {\n if (file.getName().equals(fileName)) {\n file.delete();\n break;\n }\n }\n }\n }", "protected void remove(String filename) throws IOException {\n\t\tthrow new IOException( \"not implemented\" ); //TODO map this to the FileSystem\n\t}", "public static void doRemove(String fileName) {\n Stage fromSave = Utils.readObject(STAGED_FILES,\n Stage.class);\n HashSet<String> stagedFiles = fromSave.getStagedFiles();\n Commit currHead = Utils.readObject(TREE_DIR, Tree.class).\n getCurrHead();\n if (stagedFiles.contains(fileName) && currHead.getBlobs().\n containsKey(fileName)) {\n File stagedFile = Utils.join(STAGE_DIR, fileName);\n addToStageRemoval(fileName);\n removeFromWorking(fileName);\n stagedFile.delete();\n\n stagedFiles.remove(fileName);\n Stage.save(fromSave);\n } else if (stagedFiles.contains(fileName) && !currHead.getBlobs().\n containsKey(fileName)) {\n File stagedFile = Utils.join(STAGE_DIR, fileName);\n stagedFile.delete();\n\n stagedFiles.remove(fileName);\n Stage.save(fromSave);\n } else if (!stagedFiles.contains(fileName) && currHead.getBlobs().\n containsKey(fileName)) {\n if (!Utils.filesSet(WORKING_DIR).contains(fileName)) {\n File removedFile = Utils.join(STAGE_RM_DIR, fileName);\n try {\n removedFile.createNewFile();\n } catch (IOException ignored) {\n return;\n }\n String contents = currHead.getBlobs().get(fileName).\n getContents();\n Utils.writeContents(removedFile, contents);\n } else {\n addToStageRemoval(fileName);\n removeFromWorking(fileName);\n }\n } else {\n System.out.println(\"No reason to remove the file.\");\n System.exit(0);\n }\n }", "public static String fileNameWithoutExt(String file) {\n\t\tint lastIndexDot = file.lastIndexOf('.');\n\t\treturn file.substring(0, lastIndexDot); \n\t}", "public static String stripExtension(String name) {\n return name.split(\"\\\\.\")[0];\n }", "@Override\r\n\tpublic void remFile(String path) {\n\t\t\r\n\t}", "public void deleteFile(File f);", "public void delete_file(String file_name) throws Exception{\n\t\tFile file = new File(file_name);\n\t\tif (file.exists() && file.isFile()) file.delete();\n\t\telse if(file.isDirectory()){\n\t\t\tfor(File f : file.listFiles()){\n\t\t\t\tdelete_file(f.getAbsolutePath());\n\t\t\t}\n\t\t\tfile.delete();\n\t\t}\n\t}", "@Override\r\n public void removeExtension(String name) {\n this.DecoratedSortAlgo.removeExtension(name);\r\n }", "public void delete( String name) throws PhileNotFoundException {\n\t\tif (!fileList.containsKey(name)) {\n\t\t\tthrow new PhileNotFoundException(\"File doesn't exist\");\n\t\t}\n\t\telse {\n\t\t\tPhile phile = fileList.get(name);\n\t\t\tfileList.remove(name);\n\t\t\ttotalNumberOfFiles--;\n\t\t\tif (openFiles.contains(phile)) {\n\t\t\t\topenFiles.remove(phile);\n\t\t\t\tnumberOfOpenFiles--;\n\t\t\t}\n\t\t}\n }", "public void removeFile(String filename){\r\n\t\t//take it out of the input node\r\n\t\tFileInfo f = (FileInfo) input.getFirstChild();\r\n\t\t//go through all the files of the input node\r\n\t\twhile(f != null){\r\n\t\t\t//check the file\r\n\t\t\tif(filename.equals(f.toString())){\r\n\t\t\t\t\t//remove the node\r\n\t\t\t\t\tf.removeFromParent();\r\n\t\t\t\t\t//notify the tree that the node\r\n\t\t\t\t\t//...has changed\r\n\t\t\t\t\tif(parentTree != null)\r\n\t\t\t\t\t\tparentTree.nodeStructureChanged(input);\r\n\t\t\t}\r\n\t\t\t//check the rest of the files\r\n\t\t\tf = (FileInfo)f.getNextSibling();\r\n\t\t}\r\n\t\t\r\n\t\t//take it out of the output note\r\n\t\tf = (FileInfo) output.getFirstChild();\r\n\t\t\r\n\t\twhile(f != null){\r\n\t\t\tif(filename.equals(f.toString())){\r\n\t\t\t\tf.removeFromParent();\r\n\t\t\t\tif(parentTree != null)\r\n\t\t\t\t\tparentTree.nodeStructureChanged(output);\r\n\t\t\r\n\t\t\t}\r\n\t\t\tf = (FileInfo)f.getNextSibling();\r\n\t\t}\r\n\t\t\r\n\t}", "private static void removeFile(File fileDir) throws Exception {\n String fileName = getFileNameInput();\n File fileToRemove = new File(fileDir.toString() + \"\\\\\" + fileName);\n boolean fileRemoved = fileToRemove.delete();\n if (fileRemoved) {\n System.out.println(\"File removed successfully.\");\n } else {\n throw new FileNotFoundException(\"No such file under current directory.\");\n }\n }", "public boolean delete(String filename);", "public void remove(String filename) {\n\tremove(new BasicDBObject(\"filename\", filename));\n }", "public static void delete(String filename) \n throws IOException {\n if ((filename != null) && (!filename.isEmpty())) {\n delete(new File(filename));\n }\n }", "private static void deleteFile(String fileName) {\n\t\tFile f = new File(fileName);\n\n\t\t// Make sure the file or directory exists and isn't write protected\n\t\tif (!f.exists())\n\t\t\treturn;\n\t\t// throw new IllegalArgumentException(\"Delete: no such file or directory: \" + fileName);\n\n\t\tif (!f.canWrite())\n\t\t\tthrow new IllegalArgumentException(\"Delete: write protected: \"\n\t\t\t\t\t+ fileName);\n\n\t\t// If it is a directory, make sure it is empty\n\t\tif (f.isDirectory()) {\n\t\t\tString[] files = f.list();\n\t\t\tif (files.length > 0)\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"Delete: directory not empty: \" + fileName);\n\t\t}\n\n\t\t// Attempt to delete it\n\t\tboolean success = f.delete();\n\n\t\tif (!success)\n\t\t\tthrow new IllegalArgumentException(\"Delete: deletion failed\");\n\t}", "public void removeOriginalFilename(java.lang.String value) {\r\n\t\tBase.remove(this.model, this.getResource(), ORIGINALFILENAME, value);\r\n\t}", "void deleteFile(FsPath path);", "public int remove(String pathname) throws YAPI_Exception\n {\n byte[] json = new byte[0];\n String res;\n json = sendCommand(String.format(Locale.US, \"del&f=%s\",pathname));\n res = _json_get_key(json, \"res\");\n //noinspection DoubleNegation\n if (!(res.equals(\"ok\"))) { throw new YAPI_Exception( YAPI.IO_ERROR, \"unable to remove file\");}\n return YAPI.SUCCESS;\n }", "public ImageFile removeImageFile(int f) { return imageFiles.remove(f); }", "public void deleteData(String filename, SaveType type);", "private static String getFileNameWithoutExtension(File file) {\n String fileName = \"\";\n \n try {\n if (file != null && file.exists()) {\n String name = file.getName();\n fileName = name.replaceFirst(\"[.][^.]+$\", \"\");\n }\n } catch (Exception e) {\n e.printStackTrace();\n fileName = \"\";\n }\n return fileName;\n }", "boolean deleteFile(File f);", "public boolean removeExtension(String extension) {\n return extensions.removeIf(target -> target.equalsIgnoreCase(extension));\n }", "@Test\n public void filesByNameDeleteTest() throws ApiException {\n String name = null;\n api.filesByNameDelete(name);\n\n // TODO: test validations\n }", "public static String getFileNameWithoutExtension(String filePath) {\n if (isFileExist(filePath)) {\n return filePath;\n }\n\n int extenPosi = filePath.lastIndexOf(\".\");\n int filePosi = filePath.lastIndexOf(File.separator);\n if (filePosi == -1) {\n return (extenPosi == -1 ? filePath : filePath.substring(0, extenPosi));\n }\n if (extenPosi == -1) {\n return filePath.substring(filePosi + 1);\n }\n return (filePosi < extenPosi ? filePath.substring(filePosi + 1, extenPosi) : filePath.substring(filePosi + 1));\n }", "void remove(String name) throws Exception;", "public void removeFileType(java.lang.String value) {\r\n\t\tBase.remove(this.model, this.getResource(), FILETYPE, value);\r\n\t}", "public void delete_File(){\n context.deleteFile(Constant.FILE_NAME);\n }", "public void remove(String name);", "public void removeFile(Note note) {\n File f = new File(SaveProperties.getPath() + \"/\" + note.getTitle() + \".txt\");\n f.delete();\n }", "public void rm(String name) throws IsDirectoryException, NoSuchFileException\n\t{\n\t\tIterable<Position<FileElement>> toCheck = fileSystem.children(currentFileElement);\n\t\tif (toCheck != null)\n\t\t{\n\t\t\tfor (Position<FileElement> fe : toCheck )\n\t\t\t{\n\t\t\t\tif (fe.toString().equals(name) && fe.getValue().isDirectory() )\n\t\t\t\t{\n\t\t\t\t\tthrow new IsDirectoryException();\n\t\t\t\t}\n\t\t\t\tif (fe.toString().equals(name) && fe.getValue().isDirectory() == false)\n\t\t\t\t{\n\t\t\t\t\tfileSystem.remove(fe);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {throw new NoSuchFileException();}\n\t}", "String noExt(String name) {\r\n int last=name.lastIndexOf(\".\");\r\n if(last>0)\r\n return name.substring(0, last);\r\n\r\n return name;\r\n }", "public static void remove(File file) throws IOException {\n\t\tif (!file.exists())\n\t\t\treturn;\n\t\tif (file.isDirectory()) {\n\t\t\tFile[] files = file.listFiles();\n\t\t\tfor (File f : files)\n\t\t\t\tremove(f);\n\t\t}\n\t\tif (!file.delete())\n\t\t\tthrow new IOException(\"Can't delete the file \\\"\"\n\t\t\t\t\t+ file.getAbsolutePath() + \"\\\"\");\n\t}", "public void remove(final String name) {\r\n\t\tremove(names.indexOf(name));\r\n\t}", "void remove(String name);", "void remove(String name);", "public static void deleteFilesMatchingExpression(String path,\n \t\t\tString expression) {\n \t\tdeleteFilesMatchingExpression(new File(path), expression, false);\n \t}", "public void deleteFileByName(String nomFichier) throws IOException {\n\t\tif (nomFichier != null && !nomFichier.isEmpty()) {\n\t\t\tPath target = Paths.get(folder_photo + nomFichier);\n\t\t\tFiles.deleteIfExists(target);\n\t\t}\n\n\t}", "public void unsetFileName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FILENAME$0, 0);\n }\n }", "public static void deleteFile()\n\t{\n\t\t//Variable Declaration\n\t\tString fileName;\n\t\tScanner obj = new Scanner(System.in);\n\t\t\n\t\t//Read file name from user\n\t\tSystem.out.println(\"Enter file name to delete:\");\n\t\tfileName= obj.nextLine();\n\t\t\n\t\t//Deleting the file\n\t\tboolean isDeleted = FileManager.deleteFile(folderpath, fileName);\n\t\t\n\t\tif(isDeleted)\n\t\t\tSystem.out.println(\"File deleted successfully\");\n\t\telse\n\t\t\tSystem.out.println(\"File not found! Enter valid file name.\");\n\t}", "public void deleteFile(IAttachment file)\n throws OculusException;", "public void deleteMoreFile() {\n\t\tFile outfile = new File(outFileString);\n\t\tFile files[] = outfile.listFiles();\n\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\tString name = files[i].getAbsolutePath();\n\t\t\tif ((!name.contains(\"SICG\")) && (!name.contains(\"AndroidManifest.xml\"))) {\n\t\t\t\tDirDelete delete = new DirDelete();\n\t\t\t\tdelete.deleteDir(files[i]);\n\t\t\t}\n\t\t}\n\t}", "public void deleteFile(String filePath){\n File myFile = new File(filePath);\n if (myFile.exists()) {\n myFile.delete();\n System.out.println(\"File successfully deleted.\");\n } else {\n System.out.println(\"File does not exists\");\n }\n }", "public void deleteImgFromDirectory1(String fileName) {\n File f = new File(fileName);\r\n\r\n // Mi assicuro che il file esista\r\n if (!f.exists()) {\r\n throw new IllegalArgumentException(\"Il File o la Directory non esiste: \" + fileName);\r\n }\r\n\r\n // Mi assicuro che il file sia scrivibile\r\n if (!f.canWrite()) {\r\n throw new IllegalArgumentException(\"Non ho il permesso di scrittura: \" + fileName);\r\n }\r\n\r\n // Se è una cartella verifico che sia vuota\r\n if (f.isDirectory()) {\r\n String[] files = f.list();\r\n if (files.length > 0) {\r\n throw new IllegalArgumentException(\"La Directory non è vuota: \" + fileName);\r\n }\r\n }\r\n\r\n // Profo a cancellare\r\n boolean success = f.delete();\r\n\r\n // Se si è verificato un errore...\r\n if (!success) {\r\n throw new IllegalArgumentException(\"Cancellazione fallita\");\r\n }\r\n }", "abstract public void remove( String path )\r\n throws Exception;", "@RequestMapping(value=\"/remove/{filename}&{subdir}\", method = RequestMethod.GET)\r\n public String processRemoveFile(@PathVariable String filename, @PathVariable String subdir, Locale locale, Model model, HttpServletRequest request) {\r\n\t\t\r\n\t\tlogger.info(\"Delete file: \" + filename + \" in \" + QRDA_URIResolver.REPOSITORY_TESTFILES + \"/\" + subdir);\r\n\t\tfileService.deleteFile(filename, QRDA_URIResolver.REPOSITORY_TESTFILES, subdir);\r\n\t\treturn \"redirect:/testFiles\";\r\n\t}", "private static void rm(Gitlet currCommit, String[] args) {\n if (args.length != 2) {\n System.out.println(\"Please input the file to remove\");\n return;\n }\n Commit headCommit = currCommit.tree.getHeadCommit();\n if (!headCommit.containsFile(args[1])\n && !currCommit.status.isStaged(args[1])) {\n System.out.println(\"No reason to remove the file.\");\n } else {\n currCommit.status.markForRemoval(args[1]);\n }\n addSerializeFile(currCommit);\n }", "public static void clear(final String filename) throws IOException {\n\t\tif (!new File(SAVES_FOLDER + filename).delete()) {\n\t\t\tthrow new IOException();\n\t\t}\n\t}", "public void removeFromFile(String pathName, String removeFile) throws IOException{\n FileInputStream fis = new FileInputStream(pathName);\n\n Scanner reader = new Scanner(fis);\n StringBuilder dataKept = new StringBuilder();\n\n while(reader.hasNextLine()){\n String data = reader.nextLine().trim();\n\n if ( !data.equals(removeFile) ){\n dataKept.append(data).append(\"\\n\");\n }\n }\n\n FileWriter fl = new FileWriter(pathName);\n fl.write(\"\");\n FileOutputStream out = new FileOutputStream(pathName);\n out.write(dataKept.toString().trim().getBytes());\n fl.close();\n out.close();\n fis.close();\n }", "private void removePolicyFile(boolean granted){\n\tString fileName = getPolicyFileName(granted);\n\tFile f = new File(fileName);\n\tif(f.exists()){\n\t if (!f.delete()) {\n String defMsg = \"Failure removing policy file: \"+fileName; \n String msg=localStrings.getLocalString(\"pc.file_delete_error\", defMsg,new Object []{ fileName} );\n\t\tlogger.log(Level.SEVERE,msg);\n\t\tthrow new RuntimeException(defMsg);\n\t } else if(logger.isLoggable(Level.FINE)){\n\t\tlogger.fine(\"JACC Policy Provider: Policy file removed: \"+fileName);\n\t }\n\t}\n }", "public void remove(File file) throws IOException {\n String fileName = file.getName();\n File realFile = new File(INDEX, fileName);\n boolean isStaged = realFile.exists();\n Commit curCommit = getHeadCommit();\n if (isStaged) {\n realFile.delete();\n }\n HashMap<String, Blob> filesInHeadCommit = curCommit.getFile();\n boolean trackedByCurrCommit = filesInHeadCommit.containsKey(fileName);\n if (trackedByCurrCommit) {\n if (file.exists()) {\n file.delete();\n }\n String content = filesInHeadCommit.get(fileName).getContent();\n File fileInRemovingStage = new File(REMOVAL, fileName);\n if (!fileInRemovingStage.exists()) {\n fileInRemovingStage.createNewFile();\n }\n Utils.writeContents(fileInRemovingStage, content);\n }\n if (!isStaged && !trackedByCurrCommit) {\n System.out.println(\"No reason to remove the file.\");\n System.exit(0);\n }\n\n }", "@Override\n\t\t\tpublic boolean accept(File dir, String filename) {\n\t\t\t\tif(filename.endsWith(\".wmm\"))\n\t\t\t\t{\n\t\t\t\t\tnew File(dir,filename).delete();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}", "public final GetHTTP removeFilename() {\n properties.remove(FILENAME_PROPERTY);\n return this;\n }", "private void actionRemoveFile ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//---- Get currently selected file index in the combo box\r\n\t\t\tint index = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t//---- Remove the file from the project by its index\r\n\t\t\tDataController.scenarioRemoveFile(index);\r\n\r\n\t\t\thelperDisplayProjectFiles();\r\n\t\t\thelperDisplaySamplesCombobox();\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\t}", "public void removeOriginalFilename( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), ORIGINALFILENAME, value);\r\n\t}", "public String getFilenameWithoutExtension(@NonNull String pathname) {\n File srcFile = new File(pathname);\n String srcFilename = srcFile.getName();\n int lastPeriodPos = srcFilename.lastIndexOf('.');\n return lastPeriodPos > 0 ? srcFilename.substring(0, lastPeriodPos) : srcFilename;\n }", "public void removeByname(java.lang.String name)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public synchronized void removeFile(@Nonnull final VirtualFile file) {\n final HistoryEntry entry = getEntry(file);\n if (entry != null) {\n removeEntry(entry);\n }\n }", "void removeClass(final String name);", "@Override\n public void delete(File file) {\n }", "public static void deleteFile(String filePath) {\n File file = getFile(filePath);\n if (file.exists()) {\n file.delete();\n }\n }", "public void remFile(){\n ((MvwDefinitionDMO) core).remFile();\n }", "public static void deleteFile(String inputFile){\n File file = new File(inputFile);\n //validate the file\n if(file.isFile()){\n try{\n if(file.delete())\n System.out.println(\"File \"+inputFile+\" has been deleted.\");\n else\n System.out.println(\"Error in deleting the file.\");\n }catch(Exception e){\n e.printStackTrace();\n }\n }else{\n System.out.println(\"Invalid file path.\");\n }\n }", "private void deleteFile(java.io.File file) {\n if (file.isDirectory()) {\n for (java.io.File f : file.listFiles()) \n deleteFile(f);\n }\n \n if (!file.delete())\n try {\n throw new FileNotFoundException(\"Failed to delete file: \" + file.getName());\n } catch (FileNotFoundException e) {\n System.err.println(\"Delete of file \" + file.getAbsolutePath() + \" failed\");\n e.printStackTrace();\n }\n }", "public String clean(String file_name)\n\t{\n\t\treturn file_name;\n\t}", "public static native boolean remove(String path) throws IOException;", "public int deleteFile(String datastore, String filename) throws HyperVException;", "private void deleteFile(String oldPic) {\n\n\n File fileDir = new File(oldPic);\n if (fileDir.exists()) {\n \n fileDir.delete();\n }\n\n }", "public void removeFileFromList(ChatFile file){\n\t\tfilelist.remove(file);\t\t\t\n\t}", "public void remove(String id) {\n\t\tif (!filesMap.containsKey(id)) {\n\t\t\treturn;\n\t\t}\n\t\tMap<String, String> uploadedFileInfo = filesMap.get(id);\n\t\tFile file = new File(uploadedFileInfo.get(UPLOADED_FILE_PATH));\n\t\tif (!file.exists()) {\n\t\t\treturn;\n\t\t}\n\t\tfile.delete();\n\t}", "public void deleteFile(String url)\n\t{\n\t\t\n\t\tIterator<UserInfo> itr= iterator();\n\t\tUserInfo info=null;\n\t\twhile(itr.hasNext()) {\n\t\t\t\n\t\t\tinfo= itr.next();\n\t\t\tif( info.getUrl().equalsIgnoreCase(url)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( info!=null)\n\t\t{\n\t\t\tSystem.out.println(\"file has been deleted!\");\n\t\t\tuserinfos.remove(info);\n\t\t}\n\t\t\n\t}", "public void removeFileType( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), FILETYPE, value);\r\n\t}", "public static void removeFileType(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.String value) {\r\n\t\tBase.remove(model, instanceResource, FILETYPE, value);\r\n\t}", "boolean remove(String name);", "public HttpResponse doRemoveScript(StaplerRequest res, StaplerResponse rsp, @QueryParameter(\"name\") String name) throws IOException {\n \t\tcheckPermission(Hudson.ADMINISTER);\n \n \t\t// remove the file\n \t\tFile oldScript = new File(getScriptDirectory(), name);\n \t\toldScript.delete();\n \n \t\t// remove the meta information\n \t\tScriptlerConfiguration cfg = getConfiguration();\n \t\tcfg.removeScript(name);\n \t\tcfg.save();\n \n \t\treturn new HttpRedirect(\"index\");\n \t}", "public void remove(String name)\n/* */ {\n/* 1177 */ for (int i = 0; i < this.attributes.size(); i++) {\n/* 1178 */ XMLAttribute attr = (XMLAttribute)this.attributes.elementAt(i);\n/* 1179 */ if (attr.getName().equals(name)) {\n/* 1180 */ this.attributes.removeElementAt(i);\n/* 1181 */ return;\n/* */ }\n/* */ }\n/* */ }", "public static void fileDelete(String filePath) {\n\t\tFile f = new File(filePath);\n\n\t\t// noinspection ResultOfMethodCallIgnored\n\t\tf.delete();\n\t}", "public void removeFiles() throws ServiceException;", "public static String removeFileExt(String primary, String secondary) {\r\n String r = null;\r\n if (primary != null && secondary != null) {\r\n Matcher matcher = Pattern.compile(\"^\\\\^+\").matcher(secondary);\r\n if (matcher.find()) {\r\n String carets = matcher.group(0);\r\n String ext = secondary.replace(carets, \"\");\r\n for (int i = 0; i < carets.length(); i++) {\r\n int last = primary.lastIndexOf('.');\r\n if (last != -1) {\r\n primary = primary.substring(0, primary.lastIndexOf('.'));\r\n }\r\n }\r\n r = primary + ext;\r\n }\r\n }\r\n return r;\r\n }", "final public static File changeFileExtension(File file, String extension) {\n\n if ((file == null) || (extension == null) || extension.trim().equals(\"\")) {\n return null;\n }\n\n String path = file.getAbsolutePath();\n String newPath = \"\";\n String filename = file.getName().trim();\n\n if ((filename != null) && !filename.equals(\"\")) {\n\n int periodIndex = path.lastIndexOf(\".\");\n\n newPath = path.substring(0, periodIndex);\n newPath += extension;\n }\n\n return new File(newPath);\n }", "public void EliminarArchivo()//Método que eliminar un archivo\n {\n JFileChooser fichero = new JFileChooser();//Creamos objeto de la clase JFileChooser\n fichero.showOpenDialog(null);//Abrimos la ventana para seleccionar el archivo\n File archivo = fichero.getSelectedFile();//En objeto File asignamos el objeto fichero a renombrar\n\n if (archivo.delete())//Si se eliminó correctamente, muestra le mensaje\n {\n JOptionPane.showMessageDialog(null, \"Archivo correctamente eliminado\");\n } else//Si no, muestra el mensaje\n {\n JOptionPane.showMessageDialog(null, \"El archivo no ha podido ser eliminado\");\n }\n }", "public static boolean rm(final String fileName) {\n return new File(fileName).delete();\n }", "void removeXML(String path)\n throws ProcessingException;", "public static void clearFile(File fileName)\r\n {\r\n try \r\n {\r\n FileWriter fw = new FileWriter(fileName);\r\n fw.write(\"\");\r\n\r\n fw.close();\r\n }\r\n catch(IOException ioe)\r\n {\r\n //Output error message \r\n System.out.println(ioe); \r\n }\r\n }", "public static void removeOriginalFilename(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.String value) {\r\n\t\tBase.remove(model, instanceResource, ORIGINALFILENAME, value);\r\n\t}", "private void deleteSelectedFile() {\r\n\t\tString sel = this.displayFileNames.getSelectedValue();\r\n\t\tif(sel != null) {\r\n\t\t\tFileModel model = FileData.getFileModel(sel);\r\n\t\t\tFileType type = model.getFileType();\r\n\t\t\tFileData.deleteFileModel(type);\r\n\t\t\tthis.setButtonEnabled(type);\r\n\t\t\tthis.loadFileNames();\r\n\t\t\tthis.updateColumnSelections(type);\r\n\t\t\tColumnData.clearMatchedCells(type);\r\n\t\t}\r\n\t}", "public boolean removeCapabilityFile(Capability cap) {\n File file = new File(SifebUtil.CAP_FILE_DIR + cap.getCapID() + \".xml\");\n return file.delete();\n }", "public static int delete(String fileName) {\n return Kernel.interrupt(Kernel.INTERRUPT_SOFTWARE, Kernel.DELETE, 0, fileName);\n }", "public static void delete(File f) {\n delete_(f, false);\n }", "private void deleteFile(@Nonnull File file) throws IOException {\n Files.delete(file.toPath());\n }", "private void deleteDhiFiles(File f) {\n\t\tString hdfName = f.getName().substring(0, f.getName().lastIndexOf(\".\"));\n\t\tFile dirFile = new File(f.getParent());\n\t\tfor (File file : dirFile.listFiles()) {\n\t\t\tString fileName = file.getName();\n\t\t\tif (fileName.contains(hdfName)) {\n\t\t\t\tSystem.out.println(\"Delete: \" + fileName);\n\t\t\t\tfile.delete();\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.69292873", "0.68736726", "0.6644003", "0.6552259", "0.6491383", "0.64830995", "0.6463731", "0.6425611", "0.63115454", "0.6250429", "0.62144476", "0.6212675", "0.6202389", "0.616219", "0.61561894", "0.6114848", "0.61118215", "0.61065", "0.60833615", "0.60810196", "0.607349", "0.6030168", "0.5990811", "0.59753615", "0.5959428", "0.59184426", "0.5885678", "0.58846754", "0.5869545", "0.58626115", "0.58284855", "0.5822254", "0.58178854", "0.5806531", "0.5788494", "0.57773775", "0.5755261", "0.575468", "0.57376593", "0.57281053", "0.5727321", "0.56845295", "0.5667395", "0.56339747", "0.56339747", "0.56325275", "0.56286126", "0.5627471", "0.5614139", "0.56140774", "0.5610121", "0.5578875", "0.55711496", "0.55706096", "0.55670625", "0.5565816", "0.55610996", "0.5550927", "0.5545241", "0.55308133", "0.5527444", "0.5517967", "0.5516129", "0.5492485", "0.5487407", "0.54806674", "0.54614896", "0.5451228", "0.5446879", "0.5446075", "0.5439191", "0.5416546", "0.54141504", "0.5410639", "0.54020905", "0.5386135", "0.538022", "0.53781146", "0.5370854", "0.53691304", "0.5368662", "0.5366554", "0.5352467", "0.5346632", "0.53382266", "0.53357106", "0.5335056", "0.53335667", "0.53303885", "0.53290385", "0.53285927", "0.5326006", "0.5312214", "0.53105015", "0.5308084", "0.5302237", "0.52972347", "0.5295143", "0.52906805", "0.5283971" ]
0.6423053
8
Returns a file object for the given qualified name and fileextension
private File getFile(String fileName, String fileextension) { return new File(outputDir + File.separator + fileName + "." + fileextension); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void retrieveFile(String fileName, String ext);", "public static FileObject findFile (FileObject f, String ext)\n\t{\n\t\tif (f != null)\n\t\t{\n\t\t\tString name = f.getName();\n\t\t\tint index = name.indexOf('$');\n\n\t\t\tif (index > 0)\n\t\t\t\tname = name.substring(0, index);\n\n\t\t\treturn f.getParent().getFileObject(name, ext);\n\t\t}\n\n\t\treturn null;\n\t}", "String getFileExtensionByFileString(String name);", "protected abstract String getFileExtension();", "String getFileExtension();", "public abstract String getFileExtension();", "java.lang.String getFilename();", "java.lang.String getFilename();", "public String getFileExtension();", "String getFilename();", "FileReference getFile(String fileName);", "public String getFileExtension(File objFile) {\n\n String sFileName = null;\n String sExtension = null;\n\n try {\n\n if (!objFile.exists()) {\n throw new Exception(\"File does not exists\");\n }\n\n sFileName = objFile.getName();\n int i = sFileName.lastIndexOf('.');\n if (i > 0) {\n sExtension = sFileName.substring(i + 1).trim();\n }\n\n } catch (Exception e) {\n println(\"Methods.getFileExtension : \" + e.toString());\n sExtension = \"\";\n } finally {\n return sExtension;\n }\n }", "String getContentType(String fileExtension);", "public int lookupWriteFileExtension(String extension);", "FileObject getFile();", "FileObject getFile();", "public static String fileNameAndExt(String fullPath){\n return filename(fullPath) + extension(fullPath);\n }", "File downloadExtension(DownloadExtensionRequest request);", "public String getFilename();", "public static String getFileExtension(String f) {\n\t\tif (f == null) return \"\";\n\t\tint lastIndex = f.lastIndexOf('.');\n\t\treturn lastIndex > 0 ? f.substring(lastIndex + 1) : \"\";\n\t}", "public boolean buildsFileType(String extension);", "public int lookupReadFileExtension(String extension);", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "private String getFileExtension(File f) {\n String fileName = f.getName();\n return getFileExtension(fileName);\n }", "private File getFile(String path, String name)\r\n {\r\n File file = null;\r\n boolean found = false;\r\n String ext = \"\";\r\n\r\n for (int i = 0; i < name.length(); i++)\r\n ext += \"\" + ( (name.charAt(i) == '.') ? '\\\\' : name.charAt(i));\r\n\r\n while(ext.length() > 0 && !found)\r\n {\r\n file = new File(path + \"\\\\\" + ext + \".java\");\r\n found = file != null && file.exists() && file.isFile();\r\n ext = ext.substring(0, Math.max(0, ext.lastIndexOf('\\\\')));\r\n }\r\n\r\n return (found)?file:null;\r\n }", "private String getTypeFromExtension()\n {\n String filename = getFileName();\n String ext = \"\";\n\n if (filename != null && filename.length() > 0)\n {\n int index = filename.lastIndexOf('.');\n if (index >= 0)\n {\n ext = filename.substring(index + 1);\n }\n }\n\n return ext;\n }", "public static FileFormat getFileFormat(String ext)\r\n {\r\n return getFileFormat(ext, null);\r\n }", "public ClassFile getClassFile(String name) throws IOException {\n if (name.indexOf('.') > 0) {\n int i = name.lastIndexOf('.');\n String pathname = name.replace('.', File.separatorChar) + \".class\";\n if (baseFileName.equals(pathname) ||\n baseFileName.equals(pathname.substring(0, i) + \"$\" +\n pathname.substring(i+1, pathname.length()))) {\n return readClassFile(path);\n }\n } else {\n if (baseFileName.equals(name.replace('/', File.separatorChar) + \".class\")) {\n return readClassFile(path);\n }\n }\n return null;\n }", "private String getFileExtension(String fileName) {\n return fileName.substring(fileName.lastIndexOf('.') + 1);\n }", "FileNameReference createFileNameReference();", "String getExtension();", "public String getFileExtension() {\n return toString().toLowerCase();\n }", "public static String contentToFileExtension(String mimeType) {\r\n\t\tint slashPos = mimeType.indexOf(MIMEConstants.SEPARATOR);\r\n\t\tif ((slashPos < 1) || (slashPos == (mimeType.length() - 1))) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tString type = mimeType.substring(0, slashPos);\r\n\t\tString subtype;\r\n\t\tint semicolonPos = mimeType.indexOf(\";\", slashPos + 1);\r\n\t\tif (semicolonPos < 0) {\r\n\t\t\tsubtype = mimeType.substring(slashPos + 1).trim();\r\n\t\t} else {\r\n\t\t\tsubtype = mimeType.substring(slashPos + 1, semicolonPos).trim();\r\n\t\t}\r\n\r\n\t\treturn contentToFileExtension(type, subtype);\r\n\t}", "private File getFile(String filename) throws Exception {\n\t\tFile file = new File(filename);\n\t\tif (file.exists()) {\n\t\t\treturn file;\n\t\t} else if (!file.isAbsolute()) {\n\t\t\tfinal Resource r = context.getThisInstance().eResource();\n\t\t\tfinal Path p = new Path(r.getURI().segment(1) + File.separator + filename);\n\t\t\tfinal IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(p);\n\t\t\tif (f.exists()) {\n\t\t\t\treturn f.getRawLocation().makeAbsolute().toFile();\n\t\t\t}\n\t\t}\n\n\t\tthrow new Exception(\"Filename \" + filename + \" not found\");\n\n\t}", "public edu.umich.icpsr.ddi.FileNameType getFileName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileNameType target = null;\n target = (edu.umich.icpsr.ddi.FileNameType)get_store().find_element_user(FILENAME$0, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public File getFile();", "public File getFile();", "private File getFile(String fileName) {\n\t\tClassLoader classLoader = getClass().getClassLoader();\n\t\tFile file = new File(classLoader.getResource(fileName).getFile());\n\t\treturn file;\n\t}", "String getFile();", "String getFile();", "String getFile();", "private String getExtension(File f) {\n\t\tString e = null;\n\t\tString s = f.getName();\n\t\tint i = s.lastIndexOf('.');\n\n\t\tif (i > 0 && i < s.length() - 1) {\n\t\t\te = s.substring(i + 1).toLowerCase();\n\t\t}\n\t\treturn e;\n\t}", "private static char getFileExt(String file) {\r\n \treturn file.charAt(file.indexOf('.')+1);\r\n }", "protected File getDocumentByName(String documentName, String documentType,\r\n\t\t\tString ext) {\r\n\r\n\t\tStringBuilder sbDql = new StringBuilder();\r\n\r\n\t\tsbDql.append(documentType).append(WHERE).append(OBJECT_NAME)\r\n\t\t.append(EQ_QUOTE).append(documentName).append(QUOTE);\r\n\r\n\t\treturn this.getDocument(sbDql.toString(), ext);\r\n\r\n\t}", "public static String getFileExtension(File f) {\n\t\tString fileName = f.getName();\n\t\tint lastIndex = fileName.lastIndexOf('.');\n\t\treturn lastIndex > 0 ? fileName.substring(lastIndex + 1) : \"\";\n\t}", "public String filename() {\n int dot = fullPath.lastIndexOf(extensionSeparator);\n int sep = fullPath.lastIndexOf(pathSeparator);\n return fullPath.substring(sep + 1, dot);\n }", "String getFileName();", "String getFileName();", "String getFileName();", "String getFileName();", "String getFileName();", "public PDFileSpecification getFile() throws IOException {\n/* 398 */ COSBase f = this.stream.getDictionaryObject(COSName.F);\n/* 399 */ return PDFileSpecification.createFS(f);\n/* */ }", "public static String getFileExtension(File f) {\r\n\tfinal int idx = f.getName().indexOf(\".\");\r\n\tif (idx == -1)\r\n\t return \"\";\r\n\telse\r\n\t return f.getName().substring(idx + 1);\r\n }", "public File getFile() {\n\t\treturn new File(filepath);\n\t}", "public String extension() {\n int dot = fullPath.lastIndexOf(extensionSeparator);\n return fullPath.substring(dot + 1);\n }", "public String getFileName ();", "private static String getFileExtension(String fileName) {\r\n\t\tString ext = IConstants.emptyString;\r\n\t\tint mid = fileName.lastIndexOf(\".\");\r\n\t\text = fileName.substring(mid + 1, fileName.length());\r\n\t\tSystem.out.println(\"File Extension --\" + ext);\r\n\t\treturn ext;\r\n\t}", "private File createRefFile( File f )\n {\n \tfinal String refExtension = \".ref\";\n \n \tString origFileName = f.getName();\n \tint dotPos = origFileName.lastIndexOf( \".\" );\n \tString strippedFileName = origFileName.substring( 0, dotPos ); // filename without extension, and without the dot!\n \n \treturn FileHandler.getFile( new String( harvesterDirName + File.separator + strippedFileName + refExtension ) );\n }", "public static FileType valueOf(File file){\r\n\t\tString fileName = file.getName().toUpperCase();\r\n\t\treturn FileType.valueOf(fileName.substring(fileName.lastIndexOf(\".\")+1));\r\n\t}", "public static String getFileExtension(File f) {\n String name = f.getName();\n int index = name.lastIndexOf(\".\");\n if(index == -1) return null;\n \n // the file must have a name other than the extension\n if(index == 0) return null;\n \n // if the last character of the string is the \".\", then there's\n // no extension\n if(index == (name.length()-1)) return null;\n \n return name.substring(index+1);\n }", "public String getExtension(File f) {\n\t\t\tString ext = null;\n\t\t\tString s = f.getName();\n\t\t\tint i = s.lastIndexOf('.');\n\n\t\t\tif (i > 0 && i < s.length() - 1)\n\t\t\t\text = s.substring(i + 1).toLowerCase();\n\t\t\treturn ext;\n\t\t}", "VirtualFile getFile(String uuid);", "public String getFilePath(Extension extension) {\n\t\treturn extension.eResource().getURI().toString();\n\t}", "File retrieveFile(String absolutePath);", "File getFile();", "File getFile();", "private String getExtension(java.io.File file){\n String name = file.getName();\n int idx = name.lastIndexOf(\".\");\n if (idx > -1) return name.substring(idx+1);\n else return \"\";\n }", "protected abstract ExtensionAttachment instantiateExtensionAttachment();", "public static File toFile(String filenameOrFileURI) {\n try {\n if (hasScheme(filenameOrFileURI)) {\n try { \n File f = new File(URIUtils.createURI(filenameOrFileURI));\n return f;\n } catch (URISyntaxException e) {\n e.printStackTrace(); \n }\n return null;\n } \n return new File(filenameOrFileURI);\n } catch (IllegalArgumentException e) {\n e.printStackTrace();\n }\n return null;\n }", "@Override\r\n protected FileObject findPrimaryFile(FileObject fo) {\r\n String fileExt = fo.getExt();\r\n\r\n // Ensure all the mandatory files that comprise a shapefile are avialable...\r\n for (String mandatoryExt : MANDATORY_EXTENSIONS) {\r\n FileObject brother = FileUtil.findBrother(fo, mandatoryExt);\r\n if (brother == null) {\r\n return null;\r\n }\r\n }\r\n // ... and then return the primary file object\r\n if (PRIMARY_EXTENSION.equalsIgnoreCase(fileExt)) {\r\n return fo;\r\n }\r\n else {\r\n return FileUtil.findBrother(fo, PRIMARY_EXTENSION);\r\n }\r\n }", "public static String getExtension(File f) {\n String ext = null;\n String s = f.getName();\n int i = s.lastIndexOf('.');\n\n if (i > 0 && i < s.length() - 1) {\n ext = s.substring(i + 1).toLowerCase();\n }\n\n return ext;\n }", "public String getFileName();", "public String getFileName();", "public static String filename(String fullPath) {\n int dot = fullPath.lastIndexOf(extensionSeparator);\n int sep = fullPath.lastIndexOf(pathSeparator);\n return fullPath.substring(sep + 1, dot);\n }", "ResourceLocation withExtension(String newExtension);", "public File getFile ();", "public String filename(File f) {\r\n int dot = f.toString().lastIndexOf(\".\");\r\n int sep = f.toString().lastIndexOf(\"\\\\\");\r\n return f.toString().substring(sep + 1, dot);\r\n }", "private String getAFileFromSegment(Value segment, Repository repository)\n {\n \n RepositoryConnection con = null;\n try\n {\n con = getRepositoryConnection(repository);\n \n String adaptorQuery = \"SELECT ?fileName WHERE { <\" + segment + \"> <http://toif/contains> ?file . \"\n + \"?file <http://toif/type> \\\"toif:File\\\" .\" + \"?file <http://toif/name> ?fileName . }\";\n \n TupleQuery adaptorTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, adaptorQuery);\n \n TupleQueryResult queryResult = adaptorTupleQuery.evaluate();\n \n while (queryResult.hasNext())\n {\n BindingSet adaptorSet = queryResult.next();\n Value name = adaptorSet.getValue(\"fileName\");\n \n return name.stringValue();\n }\n \n queryResult.close();\n }\n catch (RepositoryException e)\n {\n e.printStackTrace();\n }\n catch (MalformedQueryException e)\n {\n e.printStackTrace();\n }\n catch (QueryEvaluationException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n con.close();\n }\n catch (RepositoryException e)\n {\n e.printStackTrace();\n }\n }\n return null;\n }", "public static String getExtension(File f) {\n String ext = null;\n String s = f.getName();\n int i = s.lastIndexOf(\".\");\n ext = s.substring(i+1).toLowerCase();\n return ext;\n }", "public TypedFile getTypedFile(String path, String name) {\r\n\tTypedFile f = new TypedFile(path, name);\r\n\tdeduceAndSetTypeOfFile(f);\r\n\treturn f;\r\n }", "@Get\r\n\tpublic Representation getFile() throws Exception {\n\r\n\t\tString remainPart = StringUtil.split(getRequest().getResourceRef().getRemainingPart(), \"?\")[0];\r\n\t\tFile file = getAradon().getGlobalConfig().plugin().findPlugInFile(MyConstants.PLUGIN_ID, \"jminix/js/\" + remainPart ) ;\r\n\t\t\r\n\t\tif (! file.exists()) throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, getRequest().getResourceRef().getPath()) ; \r\n\r\n\t\tMediaType mtype = getMetadataService().getMediaType(StringUtil.substringAfterLast(file.getName(), \".\")) ;\r\n\t\tif (mtype == null) mtype = MediaType.ALL ; \r\n\t\t\r\n\t\tfinal FileRepresentation result = new FileRepresentation(file, mtype);\r\n\t\treturn result;\r\n\t}", "public PDFileSpecification getFile() throws IOException\n {\n COSBase f = stream.getDictionaryObject(COSName.F);\n return PDFileSpecification.createFS(f);\n }", "public IFile getIFile ();", "public final String getExtension(File f) {\n\t String ext = null;\n\t String s = f.getName();\n\t int i = s.lastIndexOf('.');\n\n\t if (i > 0 && i < s.length() - 1) {\n\t ext = s.substring(i+1).toLowerCase();\n\t }\n\t return ext;\n\t }", "public static File annadirExtension(File archivo) {\n\t\tString extension = archivo.getPath();\n\t\tif (!extension.endsWith(\".zoo\"))\n\t\t\treturn new File(archivo + \".zoo\");\n\t\treturn archivo;\n\t}", "public String getReadFileExtension(int formatIndex);", "public static File getFile(String property) {\n\t\tFile file = null;\n\t\t// lookup the property\n\t\tString fileString = get(property);\n\t\tif (!fileString.equals(\"\")) {\n\t\t\t// lets see if this file exists if it does not then try and get a resource\n\t\t\tfile = new File(fileString);\n\t\t\tif (!file.exists()) {\n\t\t\t\t// in order to get a resource for a class we need to have a class\n\t\t\t\tif (singleton == null) {\n\t\t\t\t\tgetInstance();\n\t\t\t\t}\n\t\t\t\t// we only want to look for the name of the file as a resource, remove any path information\n\t\t\t\tURL url = singleton.getClass().getResource(file.getName());\n\t\t\t\tif (url != null) {\n\t\t\t\t\tfile = new File(url.getFile());\n\t\t\t\t\tif (!file.exists()) {\n\t\t\t\t\t\tfile = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn file;\n\t}", "public static File getFile(String resourceOrFile)\n throws FileNotFoundException {\n\n try {\n File file = new File(resourceOrFile);\n if (file.exists()) {\n return file;\n }\n } catch (Exception e) {// nope\n }\n\n return getFile(resourceOrFile, Thread.class, false);\n }", "public File getFile(final String fileName) {\r\n return IOUtil.getFile(fileName, getClass());\r\n }", "public static File getFile(String name) {\n\t\treturn getFile(name, false);\n\t}", "public final String getExtension(File f) {\n String ext = null;\n String s = f.getName();\n int i = s.lastIndexOf('.');\n\n if (i > 0 && i < s.length() - 1) {\n ext = s.substring(i+1).toLowerCase();\n }\n return ext;\n }", "protected FileObject findFile(List<String> loadPaths, String moduleName) {\n\t\tif(moduleName.startsWith(\"./\")) {\n\t\t\tmoduleName = moduleName.substring(2);\n\t\t}\n\t\tString fileName = normalizeName(moduleName);\n\t\tFileObject file = null;\n\t\tfor (String loadPath : loadPaths) {\n\t\t\t// require('foo');\n\t\t\tfor (String startPath : this.startPaths) {\n\t\t\t\ttry {\n\t\t\t\t\tString newName = startPath+loadPath+fileName;\n\t\t\t\t\tfile = fetchFile(newName);\n\t\t\t\t\tif(file != null){\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t//System.out.println(\"Error getting file \"+moduleName+\": \"+ex.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn file;\n\t}" ]
[ "0.64122057", "0.6390519", "0.628095", "0.60518146", "0.6003196", "0.5967236", "0.59113", "0.59113", "0.59084076", "0.57548404", "0.5699519", "0.56823087", "0.56536347", "0.5653139", "0.5643803", "0.5643803", "0.5606302", "0.55930054", "0.5577908", "0.5574578", "0.55718136", "0.55469733", "0.55169016", "0.55169016", "0.55169016", "0.55169016", "0.55169016", "0.55169016", "0.55169016", "0.55169016", "0.55169016", "0.5497862", "0.5455591", "0.5448503", "0.5428415", "0.54259086", "0.5406952", "0.54056454", "0.53664595", "0.53630507", "0.5356789", "0.53530365", "0.5349275", "0.5344583", "0.5344583", "0.5340861", "0.5339759", "0.5339759", "0.5339759", "0.53392005", "0.52992815", "0.52857816", "0.5282662", "0.5282187", "0.52818626", "0.52818626", "0.52818626", "0.52818626", "0.52818626", "0.5272271", "0.52668244", "0.526373", "0.5262557", "0.52560145", "0.5255444", "0.52465665", "0.5228195", "0.5227115", "0.52228606", "0.52197975", "0.52123076", "0.52118516", "0.5208975", "0.5208975", "0.5207722", "0.52073604", "0.52055603", "0.52012503", "0.5199635", "0.51991826", "0.51991826", "0.519829", "0.5197661", "0.5195795", "0.519411", "0.51888615", "0.51839906", "0.51836324", "0.5178627", "0.51779324", "0.51778203", "0.51564646", "0.51560456", "0.51525754", "0.5151882", "0.51459473", "0.51396996", "0.51369", "0.51252955", "0.5124372" ]
0.5837268
9
/ Adds a new symbol to the current scope.
public void addSymbol(String key, Symbol token) { this.variables.put(key, token); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addSymbol(Symbol symbol) {\n this.symbols.add(symbol);\n symbol.setProject(this);\n }", "public void addEntry(Symbol sym){\n\t\tif(sym == null)\n\t\t\treturn;\n\t\t\n\t\tSymbolEntry se = new SymbolEntry(sym, scopeLevel);\n\t\tif(findEntryGlobal(sym.name) == null){\n\t\t\tList<SymbolEntry> l = new ArrayList<SymbolEntry>();\n\t\t\tl.add(0, se);\n\t\t\tsymbolMap.put(sym.name, l);\n\t\t}\n\t\telse\n\t\t\tsymbolMap.get(sym.name).add(0, se);\n\t\tscope.get(0).add(se);\n\t}", "void addScope() {\n\t\tlist.addFirst(new HashMap<String, Sym>());\n\t}", "public int addSymbol(ISymbol newSymbol)\r\n {\r\n if (symbols.add(newSymbol)) {\r\n\t\t\treturn symbols.size()-1;\r\n\t\t}\r\n return -1;\r\n\r\n }", "void setSymbol(Environment environment, Character newSymbol);", "@Override\n public void define(Symbol symbol) {\n }", "@Override\n public void define(Symbol symbol) {\n }", "public void put(String symbol, D data) {\n if (isEmpty()) {\n openScope();\n }\n scopes.get(currentScopeLevel).put(symbol, data);\n }", "@Override\n\tpublic LSystemBuilder registerCommand(char symbol, String command) {\n\t\tcommands.put(symbol, command);\n\t\treturn this;\n\t}", "public void enterScope(){\n\t\tscope.add(0, new ArrayList<SymbolEntry>());\n\t\t++scopeLevel;\n\t}", "void define(Symbol sym);", "public void addSymbol(String sequence, SymbolType type) {\n\tparseContextConfig.getNestedSymbols().add(sequence, new Symbol(sequence, type));\n }", "public static synchronized Unit addSymbol (String symbol, String equiv) \n\tthrows ParseException {\n\t\treturn(addSymbol(symbol, equiv, equiv + \" \")) ;\n\t}", "public void setSymbol(String symbol) {\n this.symbol = symbol;\n }", "public ScopedSymbol(String name){\r\n\t\tthis(name, Access.PUBLIC);\r\n\t}", "public Symbol(String _name) {\n\t\tsetName(_name);\n\t}", "public void setSymbol(Symbol symbol) {\r\n\t\tthis.symbol = symbol;\r\n\t}", "public final void push(final Symbol symbol) {\n\t\tEntry entry = new Entry(symbol);\n\t\topstack.push(entry);\n\t}", "void put(String symbol, int id);", "public void pushScope() {\n\t\tscopeStack.add(new Scope());\n\t\t\n\t}", "public InsertSymbolResponse insertSymbol(InsertSymbolRequest request) throws GPUdbException {\n InsertSymbolResponse actualResponse_ = new InsertSymbolResponse();\n submitRequest(\"/insert/symbol\", request, actualResponse_, false);\n return actualResponse_;\n }", "public void addToSymbolsTable(Token t) {\n\t\tif (!t.hasError()\n && (t.getType().equals(\"Constante\") || (t.getType().equals(\"Cadena\")))\n && !reservedWords.containsKey(t.getToken())\n && !symbolsTable.contains(t.getToken())\n ) {\n\n\t\t\tsymbolsTable.add(t);\n\t\t\t//System.out.println(\"[V] Token added line: \" + line + \" TokenType: \"\n\t\t\t//\t\t+ t.getType() + \" Token: \" + t.getToken());\n\t\t} else {\n\t\t\t//System.out.println(\"[X] Token NOT added to the symbol table. line: \"\n\t\t\t//\t\t+ line + \" TokenType: \" + t.getType() + \" Token: \"\n\t\t\t//\t\t+ t.getToken());\n\t\t}\n\n\t}", "public void increment(int symbol);", "public void push(Symbol i) {\n opStack.push(new Entry(i));\n }", "protected void setSymbol(char c){\r\n\t\tthis.symbol = c;\r\n\t}", "@Override\n\tpublic LSystemBuilder registerProduction(char symbol, String production) {\n\t\tproductions.put(symbol, production);\n\t\treturn this;\n\t}", "public void setSymbol(char symbol) {\n\t\tthis.symbol = symbol;\n\t}", "public void addSymbol(String sequence, SymbolType type, int priority) {\n\tparseContextConfig.getNestedSymbols().add(sequence, new Symbol(sequence, type, priority));\n }", "@Override\n public void saveSymbol(SecuritySymbols symbol) {\n\n }", "@Override\n public Symbol put(String key, Symbol value) {\n value.setIndex(this.local++);\n return super.put(key, value);\n }", "protected void addSymbolToRenderer(Symbol symbol) {\n Symbol.Renderer renderer = getSymbolRenderer();\r\n if (renderer != null) {\r\n logger.fine(Bundle.info_adding_symbol_to_renderer(symbol.getName()));\r\n renderer.addSymbol(symbol);\r\n }\r\n // Queue symbols while waiting for a renderer to show up.\r\n else {\r\n logger.warning(Bundle.err_symbol_renderer_not_found(symbol.getName()));\r\n pendingAdds.add(symbol);\r\n }\r\n }", "public void addNewScope(){\n List<String> varScope = new ArrayList<>();\n newVarInCurrentScope.add(varScope);\n\n List<String> objScope = new ArrayList<>();\n newObjInCurrentScope.add(objScope);\n }", "@Override\n public void add(Symbol symbol) {\n\n super.add(symbol);\n\n Symbol_MultiPart multiPartSymbol = (Symbol_MultiPart) symbol;\n\n multiPart_Index_ByID.put(new Integer(multiPartSymbol.ID), multiPartSymbol);\n\n multiPart_Index_ByMultiPartName.put(multiPartSymbol.name_MultiPart, multiPartSymbol);\n multiPart_Index_ByName.put(multiPartSymbol.name, multiPartSymbol);\n multiPart_Index_ByName_IdentFormat.put(multiPartSymbol.name_IdentFormat, multiPartSymbol);\n\n multiPart_List.add(multiPartSymbol);\n\n singleAndMultiPart_SymbolIndex_ByID.put(new Integer(symbol.ID), symbol);\n\n\n }", "public void newScope() {\n Map<String, Type> scope = new HashMap<String, Type>();\n scopes.push(scope);\n Map<String, Type> typeScope = new HashMap<String, Type>();\n typeScopes.push(typeScope);\n }", "public void addSubscribedSymbol(String symbol) {\n\t\tunrecoginzedSymbols.put(symbol, System.currentTimeMillis());\n\t}", "public void putNewPrice(String symbol, double price);", "CharacterTarget put(char symbol) throws PrintingException;", "public void add_switch(String symbol, SLR1_automat.State state) throws Exception;", "public Builder setSymbol(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000008;\n symbol_ = value;\n onChanged();\n return this;\n }", "public void insert(SymbolTableEntry newEntry) {\n if (table.containsKey(newEntry.getName())) {\n table.remove(newEntry.getName());\n }\n table.put(newEntry.getName(), newEntry);\n }", "public void addNewVarInCurrentScope(String varName, String graphNodeId){\n symbolTable.computeIfAbsent(varName, v -> new ArrayList<>()).add(graphNodeId);\n newVarInCurrentScope.get(newVarInCurrentScope.size() - 1).add(varName);\n }", "public ScopedSymbol(String name, Access access){\r\n\t\tObjects.nonNull(name);\r\n\t\tObjects.nonNull(access);\r\n\t\tthis.name = name;\r\n\t\tthis.access = access;\r\n\t}", "public SymbolicFeature(String symbol) {\r\n\t\tthis.symbol = symbol;\r\n\t\tthis.isResolved = false;\r\n\t}", "public Builder setSymbol(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n symbol_ = value;\n onChanged();\n return this;\n }", "org.hl7.fhir.CodeableConcept addNewName();", "private StockData addSymbolToCurrentWatchList(String symbol)\r\n {\r\n debug(\"addSymbolToCurrentWatchList(\" + symbol + \")\");\r\n // Get the index into the current selected Tabpane\r\n int index = tabPane.getSelectedIndex();\r\n // Now grab our Table and Models\r\n HGTable table = (HGTable) tableVector.elementAt(index);\r\n StockDataTableModel dataModel = (StockDataTableModel) modelVector.elementAt(index);\r\n // Get the current Selected Row.\r\n int row = ((table.getSelectedRow() >= 0) ? table.getSelectedRow() : 0);\r\n\r\n debug(\"Insert Row After row [\" + row + \"] The Row being inserted is \" + (row + 1));\r\n dataModel.insert(row + 1);\r\n // Fire a notification that we are changing the table\r\n table.tableChanged(\r\n new TableModelEvent(dataModel, row + 1, row + 1, TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT));\r\n // Set the row to be selected\r\n table.setRowSelectionInterval(row, row);\r\n table.repaint();\r\n // Now Get the StockData Obj at that row\r\n StockData sd = (StockData) dataModel.getData().elementAt(row + 1);\r\n // Now we have the Object - We still Need to pre-fill in the data\r\n sd.setSymbol(symbol, 0.00);\r\n // Set the Name as we are still Searching\r\n sd.setName(\"Search for \" + symbol);\r\n // Lets Load the Historic Data.\r\n this.loadHistoricData(sd);\r\n // We are done now.\r\n debug(\"addSymbolToCurrentWatchList(\" + symbol + \") - complete\");\r\n\r\n return sd;\r\n }", "protected void pushScope() {\n Scope newScope = new Scope(currentScope);\n currentScope = newScope;\n }", "String getSymbol();", "public void setSymbol(int symbol, String newSymbolString) {\n if (symbol >= 0) {\n throw new IllegalArgumentException(\"Symbol may not be a normal character:\"+symbol);\n } else {\n slexicinv.set(-symbol - 1, newSymbolString);\n }\n }", "public Symbol create(char input) {\n if (cacheSymbol.containsKey(input)) {\n return cacheSymbol.get(input);\n } else {\n Symbol symbol = (Symbol) Factory.getInstance().create(TypeData.SYMBOL);\n symbol.setSymbol(input);\n cacheSymbol.put(input, symbol);\n return symbol;\n }\n }", "@Override\n public void addCode(char symbol, String code) throws IllegalStateException {\n\n if (symbol == '\\0' || code == null || code.equals(\"\")) {\n throw new IllegalStateException(\"the code or symbol cannot be null or empty.\");\n }\n\n for (int i = 0; i < code.length(); i++) {\n if (!encodingArray.contains(code.charAt(i))) {\n throw new IllegalStateException(\"the code contains illegal entry.\");\n }\n }\n allCode = allCode + symbol + \":\" + code + \"\\n\";\n\n\n for (String sym : symbolDictonary.keySet()) {\n\n String indir = symbolDictonary.get(sym);\n\n String a = indir.length() > code.length() ? indir : code;\n String b = indir.length() <= code.length() ? indir : code;\n\n if (b.equals(a.substring(0, b.length()))) {\n throw new IllegalStateException(\"prefix code detected!\");\n }\n }\n\n if (!symbolDictonary.keySet().contains(symbol + \"\")) {\n root = root.addChild(symbol + \"\", code);\n } else {\n throw new IllegalStateException(\"trying to insert duplicate symbol.\");\n }\n\n symbolDictonary.put(symbol + \"\", code);\n\n }", "private void onSymbol(final Attributes attributes) throws SAXException\r\n\t{\r\n\t\tString name = attributes.getValue(\"name\");\r\n\t\tint size = getInt(attributes, \"size\", 1);\r\n\t\tString loc = attributes.getValue(\"loc\");\r\n\t\tString decl = attributes.getValue(\"decl\");\r\n\r\n SymbolOwnership ownership = readOwnership(decl);\r\n\t\t\r\n\t\tif(loc == null)\r\n\t\t{\r\n\t\t\tthrow new SAXException(\"Symbol declaration missing 'loc' location information\");\r\n\t\t}\r\n\t\tif(\"rom\".equals(loc))\r\n\t\t{\r\n\t\t\tRomLocation rom = new RomLocation(name, ownership);\r\n\t\t\tif(!\"none\".equals(decl))\r\n\t\t\t{\r\n\t\t\t\tm_model.registerExternalMethod(rom);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tint page = readPage(loc);\r\n\r\n\t\tm_variable = new Variable(name, ownership, page, size);\r\n\t\tm_model.addVariable(m_variable);\r\n\t}", "public void changeSymbol(char symbol) {\n\t\tsetSymbol(symbol);\n\t\tsetBorder(symbol);\n\t\t//symbol has been changed\n\t}", "public abstract String getSymbol();", "public void includeSymbol(String s) {\n if (!slexic.containsKey(s)) {\n int slexic_size = slexic.size();\n slexic.put(s, -(slexic_size + 1));\n slexicinv.add(s);\n }\n }", "public static synchronized Unit addSymbol (String symbol, String equiv, \n\t\t\tString explain) throws ParseException {\n\t\tUdef old_def, new_def;\n\t\tUnit new_unit, old_unit;\n\t\tint i;\n\n\t\t// if (!initialized) init(); -- executed in uLookup\n\t\told_def = uLookup(symbol) ; \n\t\tif (old_def == null) old_unit = null;\n\t\telse old_unit = new Unit(old_def.symb);\n\t\tnew_unit = new Unit(equiv);\n\n\t\tif (DEBUG>0) System.out.println(\"----addSymbol(\" + symbol + \") = \" \n\t\t\t\t+ equiv + \" = \" + new_unit);\n\n\t\t// Create a vector of additional units if not existing\n\t\tif (aUnit == null) aUnit = new Vector(16);\n\n\t\t// Transform the unit into a new definition\n\t\tif (!Double.isNaN(new_unit.value)) {\n\t\t\tif ((new_unit.mksa&_LOG) != 0) {\t// Convert the log scale\n\t\t\t\tUnit u = new Unit(new_unit);\n\t\t\t\tu.dexp();\n\t\t\t\tnew_unit.factor = u.factor * u.value;\n\t\t\t}\n\t\t\telse new_unit.factor *= new_unit.value;\n\t\t}\n\t\tnew_def = new Udef(symbol, explain, new_unit.mksa, new_unit.factor);\n\n\t\t// Add the new unit into the Vector, and into the Hashtable\n\t\ti = aUnit.size() + uDef.length;\t\t// Index of new unit for Htable\n\t\taUnit.addElement(new_def);\n\t\thUnit.put(symbol, new Integer(i));\n\n\t\tif (DEBUG>0) System.out.println(\"====Added units #\" + i + \" = \" \n\t\t\t\t+ new_def);\n\n\t\t// Return the old Explanation\n\t\treturn(old_unit);\n\t}", "public void addCharacter(Character chr) {\n chars.add(chr);\n }", "public void setMorelinesSymbol(Character symbol);", "private void putSymbol(String symbol, String type, String eqn){\n System.out.println(symbol+ \" \"+ type + \" \"+ eqn);\n }", "@Override\r\n\t\tpublic void setMorelinesSymbol(Character symbol) {\n\r\n\t\t}", "public void setCurrentPlayerSymbol(Symbol symbol) throws IllegalArgumentException;", "@Override\n public String getSymbol() {\n return SYMBOL;\n }", "char getSymbol();", "@Override\n\tpublic void nest(Scope scope) {\n\t\tif (scope instanceof SymbolWithScope) {\n\t\t\tthrow new SymbolTableException(\"Add SymbolWithScope instance \" + scope.getName() + \" via define()\");\n\t\t}\n\t\tnestedScopesNotSymbols.add(scope);\n\t}", "Character symbolStackWrite();", "public void addOperation(String symbol, Class<?> clazz) {\n checkForNull(symbol);\n checkForNull(clazz);\n\n try {\n Double.parseDouble(symbol);\n\n // exception was not caught - \"symbol\" is a number\n throw new IllegalArgumentException(SYMBOL_IS_NUMBER_EXCEPTION_MESSAGE +\n \"\\\"\" + symbol + \"\\\"\");\n } catch (NumberFormatException e) {\n // normal case - \"symbol\" is not a number\n }\n\n map.put(symbol, clazz);\n }", "SquareType ( char symbol ) {\n this.symbol = symbol;\n }", "public void addGroup(SymbolGroup group) {\n this.groups.add(group);\n group.setProject(this);\n }", "public String getSymbol(){\n return this.symbol;\n }", "public String getSymbol() {\r\n\t\treturn symbol;\r\n\t}", "public String getSymbol() {\r\n\t\treturn symbol;\r\n\t}", "void setSymbol(@MaxUtf8Length(20) CharSequence symbol);", "public void addScopeMetric(int sgold, int ssystem, int stp, int sfp,\n \t\t\tint sfn, float sprec, float srec, float sf) {\n \t\tthis.sgold = sgold;\n \t\tthis.ssystem = ssystem;\n \t\tthis.stp = stp;\n \t\tthis.sfp = sfp;\n \t\tthis.sfn = sfn;\n \t\tthis.sprec = sprec;\n \t\tthis.srec = srec;\n \t\tthis.sf = sf;\n \t}", "@Override\r\n public void addCode(char symbol, String code) throws IllegalStateException {\r\n if (code == null || code.length() == 0 || symbol == '\\u0000') {\r\n throw new IllegalStateException();\r\n }\r\n //if any digit of the code doesn't belong to the symbol set, throw exception\r\n for (char ch : code.toCharArray()) {\r\n if (!this.codeSymbolsSet.contains(ch)) {\r\n throw new IllegalStateException();\r\n }\r\n }\r\n //the symbol is legal\r\n TrieNode currNode = root;\r\n //insert the group nodes(code)\r\n for (int i = 0; i < code.length() - 1; i++) {\r\n char currChar = code.charAt(i);\r\n //currChar is not currNode's children\r\n if (!currNode.getChildrenMap().containsKey(currChar)) {\r\n currNode.getChildrenMap().put(currChar, new TrieGroupNode());\r\n }\r\n //travel down the tree\r\n currNode = currNode.getChildrenMap().get(currChar);\r\n }\r\n //same symbol e.g. 00a, 01a, throw ex\r\n if (this.symbolsSet.contains(symbol)) {\r\n throw new IllegalStateException();\r\n } else {\r\n char lastChar = code.charAt(code.length() - 1);\r\n //same code diff symbol: 00a , 00b throw ex\r\n if (currNode.getChildrenMap().get(lastChar) != null) {\r\n throw new IllegalStateException();\r\n }\r\n //insert the leaf node\r\n else {\r\n currNode.getChildrenMap().put(lastChar, new TrieLeafNode());\r\n //insert the leaf properly\r\n ((TrieLeafNode) currNode.getChildrenMap().get(lastChar)).setSymbol(symbol);\r\n symbolsSet.add(symbol);\r\n }\r\n }\r\n }", "public String getSymbol() {\n return symbol;\n }", "public final void setSymbol(String symbol)\n {\n String newSymbol = \"None\";\n if (\"paragraph\".equals(symbol))\n {\n newSymbol = \"P\";\n }\n annot.setString(COSName.SY, newSymbol);\n }", "private void make_extended() {\n Iterator it = this.getIncreased_grammar().getGrammar().iterator();\n C_Production tmp_pr;\n C_Symbol searcher_symbol; \n \n while(it.hasNext()) {\n tmp_pr = (C_Production)it.next();\n searcher_symbol = new C_Symbol(String.valueOf((char)176));\n tmp_pr.getRight().add(0, searcher_symbol);\n }\n }", "public void add() {\n //TODO: Fill in this method, then remove the RuntimeException\n throw new RuntimeException(\"RatPolyStack->add() unimplemented!\\n\");\n }", "public Symbol getSymbol() {\r\n\t\treturn symbol;\r\n\t}", "@Override public String symbol() {\n return symbol;\n }", "void add(char c);", "public String getSymbol( )\n {\n return symbol;\n }", "void addDecl(String name, Sym sym) throws DuplicateSymException,\n\t\t\tEmptySymTableException {\n\t\t// if SymTable's list is empty, throw Empty\n\t\tif (list.isEmpty()) {\n\t\t\tthrow new EmptySymTableException();\n\t\t}\n\t\t// if name or sym or both are null, throw NullPointer Exception\n\t\tif ((name == null) || (sym == null)) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\t// if first hashmap in list already contains given name as a key, throw\n\t\t// Duplicate\n\n\t\tmap = list.peekFirst();\n\t\tif (map.containsKey(name)) {\n\t\t\tthrow new DuplicateSymException();\n\t\t} else {\n\t\t\tmap.put(name, sym); // else add given name and sym to first hashmap\n\t\t}\n\t}", "public void registerScope(OntologyScope scope);", "public String getSymbol() {\n\t\treturn symbol;\n\t}", "public String getSymbol() {\n return symbol;\n }", "public void addChar(String name, char value) {\n CHARS.add(new SimpleMessageObjectCharItem(name, value));\n }", "public char getSymbol() {\n return symbol;\n }", "public void add(JavaType type, JavaScope s) {\n\t\tif (type == null)\n\t\t\tthrow new NullPointerException();\n\t\tthis.sig.add(new TypeContainer(type, s));\n\t}", "public String getSymbol() {\n return this.symbol ;\n }", "public void addSelector( SelectorName symbol ) {\n if (symbol != null) selectors.add(symbol);\n }", "public DynamicSymbol(String name) {\n this.setName(name);\n // this.setType(DynamicSymbolType.values()[info & 0x0f]);\n // this.setBinding(DynamicSymbolBinding.values()[info >>> 4]);\n // this.setVisibility(DynamicSymbolVisibility.values()[other & 0x03]);\n // this.setShndx(shndx);\n // this.setValue(value);\n // this.setSize(size);\n }", "public String getSymbolName() {\n return this.name;\n }", "public String getSymbol() {\n }", "int getOrAdd(String symbol);", "public static void addGlobal(String s, Ident i) {\n\t\t\tglobaux.put(s, i);\n\t\t}", "public Builder setSymbolBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000008;\n symbol_ = value;\n onChanged();\n return this;\n }", "public void addPendingEdge(@Nullable final PsiElement pendingScope, final Instruction instruction) {\n if (instruction == null) {\n return;\n }\n\n int i = 0;\n // another optimization! Place pending before first scope, not contained in pendingScope\n // the same logic is used in checkPending\n if (pendingScope != null) {\n for (; i < pending.size(); i++) {\n final Pair<PsiElement, Instruction> pair = pending.get(i);\n final PsiElement scope = pair.getFirst();\n if (scope == null) {\n continue;\n }\n if (!PsiTreeUtil.isAncestor(scope, pendingScope, true)) {\n break;\n }\n }\n }\n pending.add(i, Pair.create(pendingScope, instruction));\n }", "public Symbol(String nm , String tp, int adrs, String scp, int lngth){\n\t\tname = nm;\n\t\ttype = tp;\n\t\taddress = adrs;\n\t\tscope = scp;\n\t\tlength = lngth;\n\t\tnext = null;\n\t}", "public void registerScope(OntologyScope scope, boolean activate);" ]
[ "0.68872267", "0.67507505", "0.6731153", "0.66870385", "0.66702175", "0.6595892", "0.6595892", "0.6435051", "0.64040875", "0.6249157", "0.6216501", "0.62137604", "0.6198688", "0.6152566", "0.61396486", "0.61377954", "0.6137646", "0.6097125", "0.6067397", "0.6067284", "0.60548043", "0.6027994", "0.6010353", "0.5999308", "0.5993742", "0.5986124", "0.5950292", "0.5943899", "0.59257865", "0.5917743", "0.58904994", "0.58845603", "0.5860408", "0.5854354", "0.582509", "0.5808159", "0.5801775", "0.577017", "0.5758605", "0.5757926", "0.5736123", "0.57240343", "0.5694167", "0.5691174", "0.5671955", "0.56606776", "0.5647341", "0.56207967", "0.56182104", "0.55941707", "0.55778784", "0.55522776", "0.5550084", "0.5539103", "0.5535144", "0.55344707", "0.54931676", "0.5491386", "0.547414", "0.5473202", "0.547231", "0.54630345", "0.54621595", "0.5457711", "0.5445076", "0.54433537", "0.5390536", "0.5377694", "0.537538", "0.5365194", "0.5365194", "0.5360709", "0.53448814", "0.5343962", "0.5338295", "0.5336127", "0.5329857", "0.53187263", "0.5318419", "0.53180605", "0.53179616", "0.5302856", "0.52955747", "0.5286218", "0.5284016", "0.5282843", "0.5264089", "0.52639675", "0.5261686", "0.5259482", "0.52572185", "0.5238841", "0.5231798", "0.52096015", "0.5204072", "0.52011627", "0.51983154", "0.5184839", "0.5179222", "0.51742846" ]
0.72924703
0
TODO Autogenerated method stub
public static void write(Context context, String key, String value) { SharedPreferences sp = context.getSharedPreferences(Constant.PRE_CSDN_APP, Context.MODE_PRIVATE); sp.edit().putString(key, value).commit(); }
{ "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
public static String readString(Context context, String key) { SharedPreferences sp = context.getSharedPreferences(Constant.PRE_CSDN_APP, Context.MODE_PRIVATE); return sp.getString(key, ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0.6080555", "0.6076938", "0.6041293", "0.6024541", "0.6019185", "0.5998426", "0.5967487", "0.5967487", "0.5964935", "0.59489644", "0.59404725", "0.5922823", "0.5908894", "0.5903041", "0.5893847", "0.5885641", "0.5883141", "0.586924", "0.5856793", "0.58503157", "0.58464456", "0.5823378", "0.5809384", "0.58089525", "0.58065355", "0.58065355", "0.5800514", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57896614", "0.5789486", "0.5786597", "0.5783299", "0.5783299", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5760369", "0.5758614", "0.5758614", "0.574912", "0.574912", "0.574912", "0.57482654", "0.5732775", "0.5732775", "0.5732775", "0.57207066", "0.57149917", "0.5714821", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57115865", "0.57045746", "0.5699", "0.5696016", "0.5687285", "0.5677473", "0.5673346", "0.56716853", "0.56688815", "0.5661065", "0.5657898", "0.5654782", "0.5654782", "0.5654782", "0.5654563", "0.56536144", "0.5652585", "0.5649566" ]
0.0
-1
Created by xiepan on 16/8/22.
public interface GankApi { String HOST = "http://gank.io/api/"; /** * @param pagesize * @param page * @return */ @GET("data/福利/{pagesize}/{page}") Observable<GirlData> getGirls(@Path("pagesize") int pagesize, @Path("page") int page); /** * @param pagesize * @param page * @return */ @GET("data/休息视频/{pagesize}/{page}") Observable<VideoData> getVideos(@Path("pagesize") int pagesize, @Path("page") int page); /** * http://gank.io/api/day/2015/08/07 * * @param year * @param month * @param day * @return */ @GET("day/{year}/{month}/{day}") Observable<GankData> getGanks(@Path("year") int year, @Path("month") int month, @Path("day") int day); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@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}", "public void mo38117a() {\n }", "private void kk12() {\n\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "public void mo4359a() {\n }", "protected boolean func_70814_o() { return true; }", "@Override\n\tprotected void getExras() {\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\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "private void strin() {\n\n\t}", "private void m50366E() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private void init() {\n\n\t}", "@Override\n\tpublic void ligar() {\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\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo6081a() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@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\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void one() {\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 public void init() {\n\n }", "@Override\n public void init() {\n\n }", "public void mo55254a() {\n }", "@Override\n void init() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void skystonePos4() {\n }", "public void mo21877s() {\n }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void mo12628c() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "private void init() {\n\n\n\n }", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n public void init() {}", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\n protected void getExras() {\n }", "public abstract void mo70713b();", "protected void mo6255a() {\n }", "Constructor() {\r\n\t\t \r\n\t }", "static void feladat9() {\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n protected void initialize() \n {\n \n }", "public void mo12930a() {\n }", "public void mo21779D() {\n }", "public void skystonePos6() {\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "static void feladat4() {\n\t}", "@Override\n public void memoria() {\n \n }" ]
[ "0.61221045", "0.6026803", "0.59584993", "0.5942983", "0.58962095", "0.588887", "0.588887", "0.58562833", "0.5821367", "0.58212686", "0.58047765", "0.5801397", "0.57970756", "0.57934016", "0.57914203", "0.5790329", "0.5759653", "0.5743118", "0.57392627", "0.5732705", "0.57316685", "0.5726644", "0.5722632", "0.57211107", "0.57211107", "0.57211107", "0.57211107", "0.57211107", "0.5704719", "0.57043105", "0.57022345", "0.5696058", "0.5672564", "0.5669081", "0.5668541", "0.56582797", "0.56409067", "0.5621345", "0.5617768", "0.5617768", "0.5617768", "0.5617768", "0.5617768", "0.5617768", "0.5617768", "0.56080717", "0.55693096", "0.55680114", "0.55605686", "0.55605686", "0.5557924", "0.5555491", "0.5555491", "0.5555491", "0.555509", "0.555509", "0.555509", "0.55494213", "0.55380464", "0.55347514", "0.5533889", "0.5531645", "0.5520678", "0.5520678", "0.5520678", "0.551953", "0.551953", "0.55086565", "0.5507458", "0.5507251", "0.5507251", "0.5496618", "0.5488622", "0.5486627", "0.54851526", "0.5481629", "0.5481226", "0.5479354", "0.5477386", "0.54693794", "0.54682684", "0.54668677", "0.5462423", "0.54588544", "0.54585516", "0.545804", "0.54514945", "0.54513806", "0.5450549", "0.5448689", "0.5445618", "0.5443052", "0.5442996", "0.54394037", "0.543764", "0.54340047", "0.54337084", "0.5430935", "0.54293185", "0.542389", "0.5419048" ]
0.0
-1
Returns the content of this text file as a single string. Line breaks are preserved.
public String asString() { StringBuffer result = new StringBuffer(); for (String line : this) { result.append(line).append('\n'); } return result.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getContent() {\n String s = null;\n try {\n s = new String(Files.readAllBytes(Paths.get(filename)), StandardCharsets.UTF_8);\n }\n catch (IOException e) {\n message = \"Problem reading a file: \" + filename;\n }\n return s;\n }", "public String read() {\n\t\tStringBuffer text = new StringBuffer((int)file.length());\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader b = new BufferedReader(fr);\n\t\t\tboolean eof = false;\n\t\t\tString line;\n\t\t\tString ret = \"\\n\";\n\t\t\twhile (!eof) {\n\t\t\t\tline = b.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\teof = true;\n\t\t\t\t} else {\n\t\t\t\t\ttext.append(line);\n\t\t\t\t\ttext.append(ret);\n\t\t\t\t}\n\t\t\t}\n\t\t\tb.close();\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"File \" + file.getName() +\n\t\t\t\t\" is unreadable : \" + e.toString());\n\t\t}\n\t\treturn text.toString();\n\t}", "static public String getContents(File aFile) {\n\t\tStringBuilder contents = new StringBuilder();\r\n\r\n\t\ttry {\r\n\t\t\t// use buffering, reading one line at a time\r\n\t\t\t// FileReader always assumes default encoding is OK!\r\n\t\t\tBufferedReader input = new BufferedReader(new FileReader(aFile));\r\n\t\t\ttry {\r\n\t\t\t\tString line = null; // not declared within while loop\r\n\t\t\t\t/*\r\n\t\t\t\t * readLine is a bit quirky : it returns the content of a line\r\n\t\t\t\t * MINUS the newline. it returns null only for the END of the\r\n\t\t\t\t * stream. it returns an empty String if two newlines appear in\r\n\t\t\t\t * a row.\r\n\t\t\t\t */\r\n\t\t\t\twhile ((line = input.readLine()) != null) {\r\n\t\t\t\t\tcontents.append(line);\r\n\t\t\t\t\tcontents.append(System.getProperty(\"line.separator\"));\r\n\t\t\t\t}\r\n\t\t\t} finally {\r\n\t\t\t\tinput.close();\r\n\t\t\t}\r\n\t\t} catch (IOException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\treturn contents.toString();\r\n\t}", "public String getContents(File file) {\n\t //...checks on file are elided\n\t StringBuilder contents = new StringBuilder();\n\t \n\t try {\n\t //use buffering, reading one line at a time\n\t //FileReader always assumes default encoding is OK!\n\t BufferedReader input = new BufferedReader(new FileReader(file));\n\t try {\n\t String line = null; \n\n\t while (( line = input.readLine()) != null){\n\t contents.append(line);\n\t contents.append(\"\\r\\n\");\t }\n\t }\n\t finally {\n\t input.close();\n\t }\n\t }\n\t catch (IOException ex){\n\t log.error(\"Greska prilikom citanja iz fajla: \"+ex);\n\t }\n\t \n\t return contents.toString();\n\t}", "private String getStringFromFile() throws FileNotFoundException {\n String contents;\n FileInputStream fis = new FileInputStream(f);\n StringBuilder stringBuilder = new StringBuilder();\n try {\n InputStreamReader inputStreamReader = new InputStreamReader(fis, \"UTF-8\");\n BufferedReader reader = new BufferedReader(inputStreamReader);\n String line = reader.readLine();\n while (line != null) {\n stringBuilder.append(line).append('\\n');\n line = reader.readLine();\n }\n } catch (IOException e) {\n // Error occurred when opening raw file for reading.\n } finally {\n contents = stringBuilder.toString();\n }\n return contents;\n }", "public static String readFile() {\n\t\tFileReader file;\n\t\tString textFile = \"\";\n\n\t\ttry {\n\t\t\tfile = new FileReader(path);\n\n\t\t\t// Output string.\n\t\t\ttextFile = new String();\n\n\t\t\tBufferedReader bfr = new BufferedReader(file);\n\n\t\t\ttextFile= bfr.readLine();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error reading the file\");\n\t\t}\n\t\treturn textFile;\n\n\t}", "private String getFileContents ()\n {\n final String s = m_buffers.values ()//\n .stream ()//\n .flatMap (List::stream)//\n .collect (Collectors.joining ());\n\n return s;\n }", "java.lang.String getContents();", "java.lang.String getContents();", "public String readFileContent(File file) {\n StringBuilder fileContentBuilder = new StringBuilder();\n if (file.exists()) {\n String stringLine;\n try {\n FileReader fileReader = new FileReader(file);\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n while ((stringLine = bufferedReader.readLine()) != null) {\n fileContentBuilder.append(stringLine + \"\\n\");\n }\n bufferedReader.close();\n fileReader.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n return fileContentBuilder.toString();\n }", "private static String getText(IFile file) throws CoreException, IOException {\n\t\tInputStream in = file.getContents();\n\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\tbyte[] buf = new byte[1024];\n\t\tint read = in.read(buf);\n\t\twhile (read > 0) {\n\t\t\tout.write(buf, 0, read);\n\t\t\tread = in.read(buf);\n\t\t}\n\t\treturn out.toString();\n\t}", "@NonNull\n public String getSourceContents() {\n if (mSourceContents == null) {\n File sourceFile = getSourceFile();\n if (sourceFile != null) {\n mSourceContents = getClient().readFile(mSourceFile);\n }\n\n if (mSourceContents == null) {\n mSourceContents = \"\";\n }\n }\n\n return mSourceContents;\n }", "@Override\n public String getContent() throws FileNotFound, CannotReadFile\n {\n Reader input = null;\n try\n {\n input = new InputStreamReader(resource.openStream());\n String content = IOUtils.toString(input).replace(\"\\r\\n\", \"\\n\");\n\n return content;\n } catch (FileNotFoundException ex)\n {\n throw new FileNotFound();\n } catch (IOException ex)\n {\n throw new CannotReadFile();\n } finally\n {\n InternalUtils.close(input);\n }\n }", "public String readFile(){\r\n StringBuffer str = new StringBuffer(); //StringBuffer is a mutable string\r\n Charset charset = Charset.forName(\"UTF-8\"); //UTF-8 character encoding\r\n Path file = Paths.get(filename + \".txt\");\r\n try (BufferedReader reader = Files.newBufferedReader(file, charset)) { // Buffer: a memory area that buffered streams read\r\n String line = null;\r\n while ((line = reader.readLine()) != null) { //Readers and writers are on top of streams and converts bytes to characters and back, using a character encoding\r\n str.append(line + \"\\n\");\r\n }\r\n }\r\n catch (IOException x) {\r\n System.err.format(\"IOException: %s%n\", x);\r\n }\r\n return str.toString();\r\n }", "public String getStringContent() throws IOException;", "public String readFile(File file) {\r\n\t\tString line;\r\n\t\tString allText = \"\";\r\n\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(file))) {\r\n\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\r\n\t\t\t\tallText += line + \"\\n\";\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn allText;\r\n\t}", "public String read() throws Exception {\r\n\t\tBufferedReader reader = null;\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\ttry {\r\n\t\t\tif (input==null) input = new FileInputStream(file);\r\n\t\t\treader = new BufferedReader(new InputStreamReader(input,charset));\r\n\t\t\tchar[] c= null;\r\n\t\t\twhile (reader.read(c=new char[8192])!=-1) {\r\n\t\t\t\tsb.append(c);\r\n\t\t\t}\r\n\t\t\tc=null;\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow e;\r\n\t\t} finally {\r\n\t\t\treader.close();\r\n\t\t}\r\n\t\treturn sb.toString().trim();\r\n\t}", "public static String getContent(String path){\t\n\t\t\n\t\tStringBuilder content = new StringBuilder();\n\t\tFile file = new File(path);\n\t\t\n\t\ttry{\n\t\t\tScanner fileReader = new Scanner(file);\n\t\t\twhile (fileReader.hasNextLine()) \n\t\t\t\tcontent.append(fileReader.nextLine() + \"\\n\");\t\n\t\t\tfileReader.close();\n\t\t}\n\t\tcatch(FileNotFoundException f){\n\t\t\tf.printStackTrace();\n }\n \n return content.toString();\n\t}", "public String toString() {\n return (\"\\\"\" + contents + \"\\\"\");\n }", "public static String getText(File file) {\n\t try {\n\t StringBuilder builder = new StringBuilder();\n\t BufferedReader input = new BufferedReader(new FileReader(file));\n\t try {\n\t String lineSeparator = System.getProperty(\"line.separator\");\n\t if (lineSeparator == null) {\n\t lineSeparator = \"\\n\";\n\t }\n\t for (String line; (line = input.readLine()) != null; ) {\n\t builder.append(line);\n\t builder.append(lineSeparator);\n\t }\n\t return builder.toString();\n\t } finally {\n\t input.close();\n\t }\n\t } catch (Exception e) {\n\t throw new RuntimeException(e.getMessage(), e);\n\t }\n\t }", "public List<String> getFileContent() {\r\n\t\tTextFileProcessor proc = new TextFileProcessor();\r\n\t\tthis.processFile(proc);\r\n\t\treturn proc.strList;\r\n\t}", "String getContents();", "@Override\n public String toTxt() {\n return this.content;\n }", "public String getContentAsString() {\n \tif (getContent()!=null && isText()) {\n \t\treturn new String(getContent());\n \t}\n \treturn \"\";\n }", "public String readFileContents(String filename) {\n return null;\n\n }", "public static String sourceContent()\n {\n read_if_needed_();\n \n return _src_content;\n }", "public String getFormattedFileContents ();", "private static String readTextFile(File file) throws IOException {\n return Files.lines(file.toPath()).collect(Collectors.joining(\"\\n\"));\n }", "public static String getTextFromFile(File file) {\n InputStream fis = null;\n InputStreamReader isr = null;\n BufferedReader bufferedReader = null;\n StringBuilder sb = new StringBuilder(\"\");\n try {\n fis = new FileInputStream(file);\n isr = new InputStreamReader(fis);\n bufferedReader = new BufferedReader(isr);\n String line;\n while ((line = bufferedReader.readLine()) != null) sb.append(line);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (fis != null && isr != null && bufferedReader != null) {\n try {\n fis.close();\n isr.close();\n bufferedReader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return sb.toString();\n }", "private String getFileContent(){\n\t\tString employeesJsonString=\"\";\n\t\ttry {\n\t\t\tScanner sc = new Scanner(file);\n\t\t\twhile(sc.hasNextLine()){\n\t\t\t\temployeesJsonString += sc.nextLine();\n\t\t\t}\n\t\t\t\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tSystem.out.println(\"file error\");\n\t\t}\n\t\treturn employeesJsonString;\n\t}", "private String getFileContent(java.io.File fileObj) {\n String returned = \"\";\n try {\n java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.FileReader(fileObj));\n while (reader.ready()) {\n returned = returned + reader.readLine() + lineSeparator;\n }\n } catch (FileNotFoundException ex) {\n JTVProg.logPrint(this, 0, \"файл [\" + fileObj.getName() + \"] не найден\");\n } catch (IOException ex) {\n JTVProg.logPrint(this, 0, \"[\" + fileObj.getName() + \"]: ошибка ввода/вывода\");\n }\n return returned;\n }", "public String readFileToString(String file) throws IOException {\n BufferedReader reader = new BufferedReader( new FileReader(file));\n String line = null;\n StringBuilder stringBuilder = new StringBuilder();\n String ls = System.getProperty(\"line.separator\");\n\n while( ( line = reader.readLine() ) != null ) {\n stringBuilder.append( line );\n stringBuilder.append( ls );\n }\n return stringBuilder.toString();\n }", "public static String readFile(String path) {\n String contents = \"\";\n try {\n BufferedReader br = new BufferedReader(new FileReader(path));\n\n StringBuilder sb = new StringBuilder();\n String line = br.readLine();\n while (line != null) {\n sb.append(line);\n sb.append(System.lineSeparator());\n line = br.readLine();\n }\n contents = sb.toString();\n br.close();\n } catch (Exception e) {\n System.out.println(e.toString());\n System.exit(1);\n }\n return contents;\n }", "public static String readFileAsString(String fileName) {\n String text = \"\";\n\n try {\n text = new String(Files.readAllBytes(Paths.get(fileName)));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return text;\n }", "public static String readFileAsString(String file) throws IOException {\n \t\tStringBuilder contents = new StringBuilder();\n \t\tBufferedReader input = new BufferedReader(new FileReader(file));\n \t\tString line = null;\n \t\twhile ((line = input.readLine()) != null) {\n \t\t\tcontents.append(line);\n \t\t\tcontents.append(System.getProperty(\"line.separator\"));\n \t\t}\n \t\tinput.close();\n \t\treturn contents.toString();\n \t}", "public static String getFileContentsAsString(String filename) {\n\n // Java uses Paths as an operating system-independent specification of the location of files.\n // In this case, we're looking for files that are in a directory called 'data' located in the\n // root directory of the project, which is the 'current working directory'.\n final Path path = FileSystems.getDefault().getPath(\"Resources\", filename);\n\n try {\n // Read all of the bytes out of the file specified by 'path' and then convert those bytes\n // into a Java String. Because this operation can fail if the file doesn't exist, we\n // include this in a try/catch block\n return new String(Files.readAllBytes(path));\n } catch (IOException e) {\n // Since we couldn't find the file, there is no point in trying to continue. Let the\n // user know what happened and exit the run of the program. Note: we're only exiting\n // in this way because we haven't talked about exceptions and throwing them in CS 126 yet.\n System.out.println(\"Couldn't find file: \" + filename);\n System.exit(-1);\n return null; // note that this return will never execute, but Java wants it there.\n }\n }", "public String ReadFile() throws IOException {\n File file = context.getFilesDir();\n File textfile = new File(file + \"/\" + this.fileName);\n\n FileInputStream input = context.openFileInput(this.fileName);\n byte[] buffer = new byte[(int)textfile.length()];\n\n input.read(buffer);\n\n return new String(buffer);\n }", "public static String getContent(IFile file) throws Exception {\n return getContent(file.getContents(true));\n }", "public String readFileIntoString(String sourceFilepath) throws IOException {\n StringBuilder sb = new StringBuilder();\n URL url = new URL(sourceFilepath);\n BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));\n String line = null;\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n reader.close();\n return sb.toString();\n }", "public static String fileToString(File file) throws IOException{\n\t\tBufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(file));\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(inputStream));\n\t\tStringBuilder file_content = new StringBuilder();\n\t\tString line;\n\t\twhile ((line = r.readLine()) != null) {\n\t\t file_content.append(line);\n\t\t}\n\t\t\n\t\treturn file_content.toString();\n\t}", "public String getFileContents(String myFile) {\n\n\t\t// Creates a new StringBuilder object.\n\t\tthis.fileContents = new StringBuilder();\n\n\t\t// Creates a new File object.\n\t\tthis.file = new File(myFile);\n\n\t\ttry {\n\t\t\t// Creates a FileReader object.\n\t\t\tthis.fileReader = new FileReader(file);\n\n\t\t\t// Wraps the FileReader in a BufferedReader.\n\t\t\tthis.bufferedReader = new BufferedReader(fileReader);\n\n\t\t\t// Reads from the FileReader via the BufferedReader and appends to the String.\n\t\t\twhile ((this.line = bufferedReader.readLine()) != null) {\n\t\t\t\tfileContents.append(line + \"\\n\");\n\t\t\t}\n\t\t\t// If file cannot be located.\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"[ERROR] File not found: \" + file.toString());\n\t\t\t// If file cannot be read.\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"[ERROR] Unable to read file: \" + file.toString());\n\t\t}\n\n\t\ttry {\n\t\t\tbufferedReader.close();\n\t\t\t// If file cannot be closed.\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"[ERROR] Unable to close file: \" + file.toString());\n\t\t\t// If file contains a null value.\n\t\t} catch (NullPointerException ex) {\n\t\t\tSystem.out.println(\"[ERROR] \" + file.toString() + \"contains no information.\");\n\t\t}\n\t\treturn fileContents.toString();\n\t}", "public String readFile(){\n\t\tString res = \"\";\n\t\t\n\t\tFile log = new File(filePath);\n\t\tBufferedReader bf = null;\n\t\t\n\t\ttry{\n\t\t\tbf = new BufferedReader(new FileReader(log));\n\t\t\tString line = bf.readLine();\n\t\t\n\t\t\n\t\t\twhile (line != null){\n\t\t\t\tres += line+\"\\n\";\n\t\t\t\tline = bf.readLine();\n\t\t\t}\n\t\t\n\t\t\treturn res;\n\t\t}\n\t\tcatch(Exception oops){\n\t\t\tSystem.err.println(\"There was an error reading the file \"+oops.getStackTrace());\n\t\t\treturn \"\";\n\t\t}\n\t\tfinally{\n\t\t\ttry {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"There was an error closing the read Buffer \"+e.getStackTrace());\n\t\t\t}\n\t\t}\n\t}", "private String readFile(String file) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(file), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n\n }", "public static String readTextFile(File file) {\n\n\t\tBufferedInputStream bis = null;\n\t\tFileInputStream fis = null;\n\t\tStringBuffer sb = new StringBuffer();\n\t\ttry {\n\t\t\t// FileInputStream to read the file\n\t\t\tfis = new FileInputStream(file);\n\n\t\t\t/*\n\t\t\t * Passed the FileInputStream to BufferedInputStream For Fast read\n\t\t\t * using the buffer array.\n\t\t\t */\n\t\t\tbis = new BufferedInputStream(fis);\n\n\t\t\t/*\n\t\t\t * available() method of BufferedInputStream returns 0 when there\n\t\t\t * are no more bytes present in the file to be read\n\t\t\t */\n\t\t\twhile (bis.available() > 0) {\n\t\t\t\tsb.append((char) bis.read());\n\t\t\t}\n\n\t\t} catch (FileNotFoundException fnfe) {\n\t\t\tSystem.out.println(\"The specified file not found\" + fnfe);\n\t\t} catch (IOException ioe) {\n\t\t\tSystem.out.println(\"I/O Exception: \" + ioe);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (bis != null && fis != null) {\n\t\t\t\t\tfis.close();\n\t\t\t\t\tbis.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tSystem.out.println(\"Error in InputStream close(): \" + ioe);\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\n\t}", "public String getText() {\n getLock().getReadLock();\n try {\n return getTextBuffer().toString();\n } finally {\n getLock().relinquishReadLock();\n }\n }", "private void get_text() {\n InputStream inputStream = JsonUtil.class.getClassLoader().getResourceAsStream(\"data.txt\");\n BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));\n StringBuilder sb = new StringBuilder();\n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line);\n }\n } catch (Exception e) {\n e.printStackTrace();\n System.out.println(e.getMessage());\n }\n this.text = sb.toString().trim();\n }", "public static String read(String path) {\r\n\t\t\r\n\t\t// open the file\r\n\t\tFile file = new File(path);\r\n\t\t\r\n\t\t\r\n\t\t// if the file does not exist return null\r\n\t\tif (!file.exists())\r\n\t\t\treturn null;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tString content = \"\";\r\n\t\t\r\n\t\t// write to the file\r\n\t\ttry {\r\n\t\t\t// open stream\r\n\t\t\tFileReader fReader = new FileReader(file);\r\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fReader);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// read all the content of the file\r\n\t\t\tString current = bufferedReader.readLine();\r\n\t\t\twhile (current != null) {\r\n\t\t\t\tcontent = content.concat(current + \"\\n\");\r\n\t\t\t\tcurrent = bufferedReader.readLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// close anything was opened\r\n\t\t\tbufferedReader.close();\r\n\t\t\tfReader.close();\r\n\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t\t\r\n\t\treturn content;\r\n\t}", "public String readFromFile() throws IOException {\n return br.readLine();\n }", "public String getString() {\n\t\treturn getString(\"\\n\");\n\t}", "private String getFileContent(String filePath) {\r\n\r\n\t\ttry {\r\n\t\t\tString text = new String(Files.readAllBytes(Paths.get(filePath)), StandardCharsets.UTF_8);\r\n\t\t\treturn text;\r\n\t\t} catch (Exception ex) {\r\n\t\t\treturn \"-1\";\r\n\t\t}\r\n\t}", "public String getConteudoArquivo() {\n\t\tfinal StringBuilder builder = new StringBuilder();\n\t\tFileReader leitor = null;\n\t\tBufferedReader buffer = null;\n\t\ttry {\n\n\t\t\tleitor = new FileReader(this.arquivo);\n\t\t\tbuffer = new BufferedReader(leitor);\n\n\t\t\twhile (buffer.ready()) {\n\t\t\t\tbuilder.append(buffer.readLine() + \"\\n\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"Imposivel de ler o arquivo \"\n\t\t\t\t\t+ this.arquivo.getName());\n\t\t} finally {\n\t\t\tRessourcesUtils.closeRessources(buffer);\n\t\t}\n\n\t\treturn builder.toString();\n\t}", "public static String readFileToString (File file) {\n try {\n final var END_OF_FILE = \"\\\\z\";\n var input = new Scanner(file);\n input.useDelimiter(END_OF_FILE);\n var result = input.next();\n input.close();\n return result;\n }\n catch(IOException e){\n return \"\";\n }\n }", "@SuppressWarnings(\"unused\")\n private String readFile(File f) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(f));\n String line = reader.readLine();\n StringBuilder builder = new StringBuilder();\n while (line != null) {\n builder.append(line).append('\\n');\n line = reader.readLine();\n }\n reader.close();\n return builder.toString();\n }", "public String loadFromFile() {\n StringBuilder sb = new StringBuilder();\n try {\n Log.d(\"DEBUG\", this.context.getPackageName());\n Log.d(\"DEBUG\", this.file);\n FileInputStream fis = context.openFileInput(file);\n BufferedReader br = new BufferedReader(new InputStreamReader(fis, this.encoding));\n String line;\n while(( line = br.readLine()) != null ) {\n sb.append( line );\n sb.append( '\\n' );\n }\n } catch (IOException e) {\n e.printStackTrace();\n return \"\";\n }\n return sb.toString();\n }", "String getContent() throws IOException;", "String input() {\n\n try {\n\n FileReader reader = new FileReader(\"the text.txt\");\n BufferedReader bufferedReader = new BufferedReader(reader);\n StringBuilder builder = new StringBuilder();\n String line;\n\n while ((line = bufferedReader.readLine()) != null)\n builder.append(line);\n\n return builder.toString();\n\n } catch (IOException e) {\n\n System.out.println(\"Input Failure\");\n return null;\n }\n }", "public static String readTextFile(File file) throws IOException {\n StringBuffer sb = new StringBuffer();\n BufferedReader fileReader = new BufferedReader(new FileReader(file));\n FileHelper.read(sb, fileReader);\n return sb.toString();\n }", "public String getText(String path) {\r\n\t\treturn getTextStructure(path, \"\\n\");\r\n\t}", "public String getContentsAsString() throws VlException\n {\n return getContentsAsString(getCharSet());\n }", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(contentBuilder::append);\n }\n return contentBuilder.toString();\n }", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n }", "public String getContent() {\r\n \r\n return text;\r\n }", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n return contentBuilder.toString();\n }", "public static String getContentForFileFromDisk(IFile file) {\n\t\treturn getContentForFileFromDisk(file, 0);\n\t}", "public String getFileText(String filePath) {\n String fileText = \"\"; \n \n File myFile = new File(filePath);\n Scanner myReader; \n \n try {\n myReader = new Scanner(myFile);\n \n while(myReader.hasNext()) {\n fileText+= myReader.nextLine() + \"\\n\"; \n }\n \n } catch (FileNotFoundException ex) {\n logger.log(Level.SEVERE, \"Error getting text from text file\", ex.getMessage()); \n }\n \n return fileText; \n }", "public String readText(String _filename) {\r\n\t\treturn readText(_filename, \"text\", (java.net.URL) null);\r\n\t}", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n }", "public java.lang.String getContents() {\n java.lang.Object ref = contents_;\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 if (bs.isValidUtf8()) {\n contents_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String toString() {\n StringBuffer result = new StringBuffer(this.m_content.length() + 2);\n result.append('\"');\n if (this.m_content != null) result.append(escape(this.m_content));\n result.append('\"');\n return result.toString();\n }", "public String getStringFile(){\n return fileView(file);\n }", "@Override\n\tpublic String getContents() {\n\t\treturn this.contents;\n\t}", "String readText(FsPath path);", "public java.lang.String getContents() {\n java.lang.Object ref = contents_;\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 if (bs.isValidUtf8()) {\n contents_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getContents() {\n java.lang.Object ref = contents_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n contents_ = s;\n }\n return s;\n }\n }", "private static String readFileContents(File file) throws FileNotFoundException {\n StringBuilder fileContents = new StringBuilder((int) file.length());\n\n try (Scanner scanner = new Scanner(file)) {\n while (scanner.hasNext()) {\n fileContents.append(scanner.next());\n }\n return fileContents.toString();\n }\n }", "public static String getStringFromFile(String filename) {\r\n try {\r\n FileInputStream fis = new FileInputStream(filename);\r\n int available = fis.available();\r\n byte buffer[] = new byte[available];\r\n fis.read(buffer);\r\n fis.close();\r\n\r\n String tmp = new String(buffer);\r\n //System.out.println(\"\\nfrom file:\"+filename+\":\\n\"+tmp);\r\n return tmp;\r\n\r\n } catch (Exception ex) {\r\n // System.out.println(ex);\r\n // ex.printStackTrace();\r\n return \"\";\r\n } // endtry\r\n }", "public java.lang.String getContents() {\n java.lang.Object ref = contents_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n contents_ = s;\n }\n return s;\n }\n }", "public static String getStringFromFile(String filename) {\r\n BufferedReader br = null;\r\n StringBuilder sb = new StringBuilder();\r\n try {\r\n br = new BufferedReader(new FileReader(filename));\r\n try {\r\n String s;\r\n while ((s = br.readLine()) != null) {\r\n sb.append(s);\r\n sb.append(\"\\n\");\r\n }\r\n } finally {\r\n br.close();\r\n }\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n\r\n return sb.toString();\r\n }", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "public static String readFileToString(File file) throws IOException {\n return readFileToString(file, null);\n }", "public java.lang.String getContent(\n ) {\n return this._content;\n }", "public String getFileContent(String filePath) {\n\t\tString content = \"\";\n\t\t// get the path\n\t\tString path = filePath.substring(0, filePath.lastIndexOf(\"/\"));\n\t\t// get the file's name\n\t\tString name = filePath.substring(filePath.lastIndexOf(\"/\") + 1);\n\t\t// iterate through all the files to see if we can find it...\n\t\tfor (FileObjects t : getDirectory(path, directory).getFiles()) {\n\t\t\tif (name.equals(t.getName())) {\n\t\t\t\tcontent = t.getContent();\n\t\t\t}\n\t\t}\n\t\t// return the content of the file, or just an empty string if it's\n\t\t// empty.\n\t\treturn content;\n\n\t}", "public static char[] getFileContents(File file) {\n // char array to store the file contents in\n char[] contents = null;\n try {\n BufferedReader br = new BufferedReader(new FileReader(file));\n StringBuffer sb = new StringBuffer();\n String line = \"\";\n while ((line = br.readLine()) != null) {\n // append the content and the lost new line.\n sb.append(line + \"\\n\");\n }\n contents = new char[sb.length()];\n sb.getChars(0, sb.length() - 1, contents, 0);\n\n assert (contents.length > 0);\n } catch (IOException e) {\n System.out.println(e.getMessage());\n }\n\n return contents;\n }", "public static String readFile(final File file) throws IOException\n\t{\n\t\tfinal BufferedReader input = new BufferedReader(new InputStreamReader(\n\t\t\t\tnew FileInputStream(file), FILE_CHARSET_NAME));\n\t\ttry\n\t\t{\n\t\t\tfinal StringBuilder contents = new StringBuilder(BUFFER_SIZE);\n\n\t\t\t// copy from input stream\n\t\t\tfinal char[] charBuffer = new char[BUFFER_SIZE];\n\t\t\tint len;\n\t\t\twhile ((len = input.read(charBuffer)) > 0)\n\t\t\t{\n\t\t\t\tcontents.append(charBuffer, 0, len);\n\t\t\t}\n\n\t\t\treturn contents.toString();\n\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tinput.close();\n\t\t}\n\t}", "@Override\n\tpublic String readBlob() throws PersistBlobException {\n\t\tlog.debug(\"readString: \");\n\t\ttry {\n\t\t\tString contents = FileUtils.readFileToString(new File(full_file_name), \"UTF-8\");\n\t\t\tlog.debug(\"returned string: \"+contents);\n\t\t\treturn contents;\n\t\t} catch (IOException e) {\n\t\t\tthrow new PersistBlobException(\"can not read string\",e);\n\t\t}\n\n\t}", "protected String openReadFile(Path filePath) throws IOException{\n\t\tString line;\n\t\tStringBuilder sb = new StringBuilder();\n\t\t// Read the document\n\t\tBufferedReader reader = Files.newBufferedReader(filePath, ENCODING);\n\t\t// Append each line in the document to our string\n\t\twhile ((line = reader.readLine()) != null) {\n\t\t\tsb.append(line);\n\t\t\tsb.append(\"\\n\"); // readLine discards new-row characters, re-append them.\n\t\t}\n\t\tif(sb.length() != 0){\n\t\t\tsb.deleteCharAt(sb.length()-1); // However last line doesn't contain one, remove it.\n\t\t}\n\t\treader.close();\n\t\treturn new String(sb.toString());\n\t}", "public String read(File file) throws IOException {\n\t\t\tInputStream is = null;\r\n\t\t\tis = new FileInputStream(file);\r\n\t\t\t\r\n\t\t\tAccessTextFile test = new AccessTextFile();\r\n//\t\t\tInputStream is = new FileInputStream(\"E:\\\\test.txt\");\r\n\t\t\tStringBuffer buffer = new StringBuffer();\r\n\t\t\ttest.readToBuffer(buffer, is);\r\n\t\t\tSystem.out.println(buffer); // 将读到 buffer 中的内容写出来\r\n\t\t\tis.close();\t\t\r\n\t\t\treturn buffer.toString();\r\n\t\t }", "public static String textToString( String fileName )\n { \n String temp = \"\";\n try {\n Scanner input = new Scanner(new File(fileName));\n \n //add 'words' in the file to the string, separated by a single space\n while(input.hasNext()){\n temp = temp + input.next() + \" \";\n }\n input.close();\n \n }\n catch(Exception e){\n System.out.println(\"Unable to locate \" + fileName);\n }\n //make sure to remove any additional space that may have been added at the end of the string.\n return temp.trim();\n }", "public String read(String filename) {\n StringBuilder stringBuilder = new StringBuilder();\n try (BufferedReader bufferedReader = new BufferedReader(new FileReader(filename))) {\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n stringBuilder.append(line).append(\"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n return stringBuilder.toString();\n }", "private String readStringFromFile(final File file) {\n try {\n FileInputStream fin = new FileInputStream(file);\n BufferedReader reader = new BufferedReader(new InputStreamReader(fin));\n StringBuilder sb = new StringBuilder();\n String line = null;\n while ((line = reader.readLine()) != null) {\n sb.append(line).append(\"\\n\");\n }\n reader.close();\n String result = sb.toString();\n fin.close();\n return result;\n } catch (IOException ioEx) {\n Log.e(TAG, \"Error reading String from a file: \" + ioEx.getLocalizedMessage());\n }\n return null;\n }", "public String readTextFromFile()\n\t{\n\t\tString fileText = \"\";\n\t\tString filePath = \"/Users/zcon5199/Documents/\";\n\t\tString fileName = filePath + \"saved text.txt\";\n\t\tFile inputFile = new File(fileName);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tScanner fileScanner = new Scanner(inputFile);\n\t\t\twhile(fileScanner.hasNext())\n\t\t\t{\n\t\t\t\tfileText += fileScanner.nextLine() + \"\\n\";\n\t\t\t}\n\t\t\t\n\t\t\tfileScanner.close();\n\t\t\t\n\t\t}\n\t\tcatch(FileNotFoundException fileException)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(baseFrame, \"the file is not here :/\");\n\t\t}\n\t\t\n\t\treturn fileText;\n\t}", "public String getContents() {\n return contents;\n }", "public static String readTextStream(String filename) throws IOException {\n StringBuffer sb = new StringBuffer();\n BufferedReader fileReader = new BufferedReader(new InputStreamReader(FileHelper.class.getClassLoader().getResourceAsStream(filename)));\n FileHelper.read(sb, fileReader);\n return sb.toString();\n }" ]
[ "0.7880319", "0.7494115", "0.7406195", "0.7161371", "0.71514994", "0.70595276", "0.7019867", "0.7003651", "0.7003651", "0.6993667", "0.698148", "0.6976932", "0.6931102", "0.6906469", "0.6872317", "0.68508685", "0.6841111", "0.6814224", "0.6797495", "0.6796116", "0.6778167", "0.67734367", "0.6724495", "0.67217493", "0.6701509", "0.66850114", "0.6652468", "0.6652404", "0.6649363", "0.6644476", "0.6631089", "0.6623138", "0.6611238", "0.6606133", "0.6595709", "0.658815", "0.6565567", "0.6555339", "0.6554094", "0.6552525", "0.65441674", "0.65365064", "0.65357995", "0.65235037", "0.65107435", "0.6500922", "0.6488453", "0.6460393", "0.6458079", "0.64424485", "0.6438056", "0.6419752", "0.6412001", "0.64053273", "0.63775754", "0.63761944", "0.635658", "0.6351504", "0.6340515", "0.63250506", "0.63245755", "0.63239634", "0.6322717", "0.6322516", "0.6302907", "0.63013846", "0.6299733", "0.6296872", "0.6291732", "0.6287769", "0.6287616", "0.62868553", "0.6280404", "0.6276883", "0.62624025", "0.62493944", "0.6249069", "0.624695", "0.6244252", "0.6244252", "0.6244252", "0.6244252", "0.6244252", "0.6244252", "0.6244252", "0.6244252", "0.6243186", "0.622417", "0.6223989", "0.622238", "0.62029886", "0.62023133", "0.6198181", "0.6170507", "0.61601883", "0.61545545", "0.61523324", "0.6151954", "0.6142929", "0.6132772" ]
0.6934168
12
Returns whether there are more lines.
public boolean hasNext() { return fNextLine != null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean hasMoreInstances() {\n\t\treturn scanner.hasNextLine();\n\t}", "public boolean hasMoreCommands() {\r\n return in.hasNextLine();\r\n }", "public boolean hasNextLine() {\n return nextLine != null;\n }", "public boolean hasMore() {\n if (currentCursor != null && !NULL.equalsIgnoreCase(currentCursor)) {\n return true;\n } else {\n return false;\n }\n }", "public boolean hasNextLine() {\n return sc.hasNextLine();\n }", "public static boolean hasNextLine() {\n return sc.hasNext();\n }", "public boolean hasMoreCommands() {\n return fileStream.hasNext();\n }", "public boolean isAtEnd()\n\t{\n\t\treturn (lineNow >= lineTime);\n\t}", "public static boolean hasNextLine(){\n \tboolean result = scanner.hasNext();\n \treturn result;\n }", "public boolean hasMoreRecords() throws LRException\n\t{\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\tgetBackground();\n\t\ttry\n\t\t{\n\t\t\treturn myData.record.hasMoreRecords(background.getClient());\n\t\t}\n\t\tcatch (LDBException e) { setStatus(e); }\n\t\treturn false;\n\t}", "public boolean hasMoreTokens() {\n return pointer < tokens.size();\n }", "public boolean hasMoreCommands(){\r\n\t\t/*\r\n\t\tif (nextCommand != null)\r\n\t\t\treturn true;\r\n\t\telse return false;\r\n\t\t*/\r\n\t\treturn (tokenizer.ttype != StreamTokenizer.TT_EOF);\r\n\t}", "boolean moreRecords() { return (tok != null && tok.length() > 0); }", "public boolean hasMoreData() {\n return iterator.hasNext();\n }", "public boolean hasMoreTokens()\n {\n return (currentPosition >= maxPosition) ? false : true;\n }", "public boolean hasLine(){\r\n\t\tif (getLine().equals(\"\"))\r\n\t\t\treturn false;\r\n\t\telse return true;\r\n\t}", "private boolean isThereMoreData() {\n return nextUrl != null;\n }", "boolean isMore();", "private boolean more() {\n return regEx.length() > 0;\n }", "@Override\n\t\tpublic boolean hasMoreElements() {\n\t\t\treturn cursor != size();\n\t\t}", "boolean hasMore();", "public boolean hasNext()\n {\n return position < text.length;\n }", "@Override\n\tpublic boolean hasMore() {\n\t\treturn false;\n\t}", "public boolean hasEndLineNumber() {\n return ((bitField0_ & 0x00000040) != 0);\n }", "public boolean hasNext() {\r\n return (length > 0);\r\n }", "public boolean hasMoreTokens(){\n return !ended;\n }", "public boolean hasMore(){\r\n return curr != null;\r\n }", "public boolean hasMoreTokens() {\n\t\treturn\t(current <=\tmax);\n\t}", "public boolean hasNext()\n {\n return (!isEmpty() && (cursor < numberOfEntries));\n }", "public boolean hasNext()\n {\n return (!isEmpty() && (cursor < numberOfEntries));\n }", "public boolean hasEndLineNumber() {\n return ((bitField0_ & 0x00000040) != 0);\n }", "public boolean hasMoreElements() {\n\t return hasMoreTokens();\n\t}", "public boolean isHasMorePages() {\n\t\treturn (this.skipEntries + this.NUM_PER_PAGE - 1) < this.totalEntries;\n\t}", "public boolean moreToIterate() {\r\n\t\treturn curr != null;\r\n\t}", "private boolean endline() {\r\n return (CHAR('\\r') || true) && CHAR('\\n');\r\n }", "public boolean hasRemaining() {\r\n\t\treturn cursor < limit - 1;\r\n\t}", "public boolean hasNext()\n {\n return (count > 0);\n }", "boolean hasEndLineNumber();", "protected boolean isFinished() {\r\n if (lineHasBeenFound) {\r\n lineTrackTime = System.currentTimeMillis();\r\n }\r\n if(System.currentTimeMillis()-lineTrackTime > 4000){\r\n return true;\r\n }\r\n return false;\r\n }", "public boolean hasNext() {\n return fakeSize > 0;\n }", "@Override\n public boolean hasNext() {\n return this.paragraphIndex < this.paragraphs.size();\n }", "public boolean hasNext() {\n return current < len;\n }", "public boolean isValid() {\n\t\treturn !lines.isEmpty();\n\t}", "public Boolean hasMorePages() {\n return (this.paging.hasMore());\n }", "public boolean hasNext() {\n\t\t\treturn cursor != size();\n\t\t}", "public boolean hasNext() {\n\t if(nextCount>=size) {\n\t \treturn false;\n\t }\n\t return true;\n\t }", "public boolean hasNext() {\n\t if(nextCount>=size) {\n\t \treturn false;\n\t }\n\t return true;\n\t }", "@Override\n\t\t\tpublic boolean hasNext() {\n\t\t\t\treturn (this.current<StringArray.this.max);\n\t\t\t}", "public boolean hasMoreErrors() {\n return false;\n }", "public boolean hasNext() {\n return position < history.size() - 1;\n }", "public boolean hasNext() {\n\t\t\t\t\treturn lastReadChar != ']' && lastReadChar != -1;\n\t\t\t\t}", "public boolean hasNext() {\n return (itrCounter < size());\n }", "public boolean hasMoreElements() {\n/* 64 */ return this.iterator.hasNext();\n/* */ }", "private boolean reachedEnd() {\n return current >= source.length();\n }", "public boolean getHasNext() {\n\t\t\treturn !endsWithIgnoreCase(getCursor(), STARTEND);\n\t\t}", "@Override\r\n\tpublic boolean hasMoreElements() {\n\t\treturn it.hasNext();\r\n\t}", "@ScriptyCommand(name = \"dbg-moresteps?\", description =\n \"(dbg-moresteps?)\\n\" +\n \"Verify if more steps can still be executed in the current debugging session.\\n\" +\n \"See also: dbg-expr.\")\n @ScriptyRefArgList(ref = \"no arguments\")\n public boolean hasMoreSteps()\n throws CommandException {\n checkTrace();\n return trace.hasMoreSteps();\n }", "public synchronized boolean hasNext() {\n\t\treturn peek(1) != CharacterIterator.DONE;\n\t}", "@DISPID(1610940416) //= 0x60050000. The runtime will prefer the VTID if present\n @VTID(22)\n boolean atEndOfLine();", "public boolean hasNext() throws IOException {\r\n if (next != null) {\r\n return true;\r\n }\r\n next = readLine();\r\n return next != null;\r\n }", "public boolean hasMoreItems();", "protected abstract boolean definitelyNotLastLine(String message);", "private boolean moreServerContent() {\n Stopwatch stopwatch = Stopwatch.createStarted();\n boolean moreDataAvailable;\n try {\n if (resIterator == null) {\n return false;\n }\n moreDataAvailable = resIterator.hasNext();\n recordSuccessMetric(MESSAGE_LATENCY_MS, stopwatch.elapsed(MILLISECONDS));\n } catch (Exception e) {\n recordErrorMetric(MESSAGE_LATENCY_MS, stopwatch.elapsed(MILLISECONDS), e);\n throw e;\n }\n if (!moreDataAvailable) {\n cancelCurrentRequest();\n }\n return moreDataAvailable;\n }", "public boolean hasNext() {\r\n\r\n\t\treturn counter < links.size();\r\n\t}", "public boolean hasNext() {\n return cursor <= arrayLimit;\n }", "public boolean isLineCountNull() {\n\t\treturn lineCount == null;\n\t}", "public boolean hasMoreElements() {\r\n \t\tif(numItems == 0 || currentObject == numItems) {\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\treturn true;\r\n \t}", "public boolean hasNext() {\n return cursor < size(); \n }", "public boolean hasNext() {\n return nextIndex < size;\n }", "private boolean isNewLine(int nextVal) {\n\t\treturn nextVal == CR || nextVal == LF || nextVal == EOF;\n\t}", "public boolean hasNext() {\n\t\t\treturn nextPosition > -1;\n\t\t\t\n\t\t}", "public boolean hasNext() {\n\t\t\treturn index < size;\n\t\t}", "private boolean isAtEnd() {\n return peek().type == EOF;\n }", "public boolean hasMore()\n\t{\n\t\treturn numLeft.compareTo(BigInteger.ZERO) == 1;\n\t}", "public boolean hasNext() {\n return index < results.size();\n }", "public boolean hasNextToken() {\r\n return this.stream.hasNext(); // based on the method hasNext() of the stream\r\n }", "public boolean hasNext() {\n return getPage() + 1 < getTotalPage();\n }", "boolean hasMoreBytes();", "public boolean hasNext() {\n\t\t\t\t\treturn !record.isEmpty();\n\t\t\t\t}", "public boolean more() throws JSONException {\n this.next();\n if(this.end()) {\n return false;\n }\n this.back();\n\n return true;\n }", "public boolean isFullyParsed() {\r\n return textIndex == getTextLength();\r\n }", "public int checkLines() {\n\t\tint completedLines = 0;\n\t\tfor(int row = 0; row < ROW_COUNT; row++) {\n\t\t\tif(checkLine(row)) {\n\t\t\t\tcompletedLines++;\n\t\t\t}\n\t\t}\n\t\treturn completedLines;\n\t}", "public boolean hasMoreCards() {\n if (cardHold == 0)\n return false;\n else\n return true;\n }", "@Override\r\n public boolean hasMoreObjects() {\r\n return hasMore;\r\n }", "public boolean hasNext() {\n\t\tMemoryBlock dummyTail = new MemoryBlock(-1, -1); // Dummy for tail\n\t\tboolean hasNext = (current.next.block.equals(dummyTail));\n\t\treturn (!hasNext);\n\t}", "public boolean hasMore () {\n\t return numLeft.compareTo (BigInteger.ZERO) == 1;\n\t }", "public final boolean hasNext() {\n return rowIndex < tables.getTablesHeader().getRowCount(getTableId())-1;\n }", "public boolean hasTokens() {\r\n\t\treturn nextTokenPos < tokens.size();\r\n\t}", "public boolean hasNext() {\n\t\t\treturn mCurrentIndex < mSize;\n\t\t}", "public boolean hasNext(){\n return ci < size;\n }", "public boolean isEmpty() {\n return cursor==-1 && lines.isEmpty();\n }", "public boolean existMoreArticles() {\n return getTotalArticlesCount() > fromIndex;\n //return !articlesEndFlag;\n }", "public static boolean presentLine() {\n\t\treturn presentLine(\"\\n\");\n\t}", "public boolean isEndOfHeader() {\n \t\t\tint i = count;\n \t\t\treturn i > 4 && buf[i - 4] == '\\r' && buf[i - 3] == '\\n'\n \t\t\t\t\t&& buf[i - 2] == '\\r' && buf[i - 1] == '\\n';\n \t\t}", "public boolean isLastBatch() {\r\n\t\treturn (getTotalMatches() == getEndRange());\r\n\t}", "public boolean hasNext() {\n\n\t\tif (tokenPosition < tokens.size()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public int size()\r\n\t{\r\n\t\tsynchronized (lines)\r\n\t\t{\r\n\t\t\treturn lines.size();\r\n\t\t}\r\n\t}", "public boolean hasNext() {\n for (int i = 0; i < len; i++) {\n // 0 + 4 - 2 = 2.\n if (index[i] < i + characters.length() - len) {\n return true;\n }\n }\n return false;\n }", "public int size() {\n return lines.size();\n }", "public boolean hasNext() \n {\n return next < size;\n }" ]
[ "0.76102865", "0.7585178", "0.7574583", "0.736322", "0.7281602", "0.725542", "0.7252403", "0.7179495", "0.7093769", "0.70683867", "0.70508254", "0.70413864", "0.70258236", "0.68961436", "0.68515193", "0.68041015", "0.6791502", "0.6785058", "0.6780333", "0.66987383", "0.6684324", "0.6668917", "0.66311365", "0.66308904", "0.6609316", "0.66055995", "0.6594293", "0.65908384", "0.65776885", "0.65776885", "0.6576941", "0.65684193", "0.6511852", "0.6495072", "0.646721", "0.6461166", "0.6442109", "0.64192796", "0.6414217", "0.6410887", "0.64020646", "0.6400125", "0.6393585", "0.63517046", "0.6348163", "0.6343554", "0.6343554", "0.63142633", "0.6313623", "0.6312604", "0.6297172", "0.62891215", "0.62824726", "0.62796074", "0.62778616", "0.6249497", "0.624305", "0.6236654", "0.6228105", "0.62231785", "0.6209452", "0.620608", "0.61889786", "0.61809456", "0.6171453", "0.61700445", "0.6168064", "0.6165427", "0.61614156", "0.61434025", "0.613924", "0.613727", "0.6135569", "0.61265755", "0.6117946", "0.61177146", "0.6114529", "0.60844433", "0.6080613", "0.6075434", "0.60702795", "0.60697454", "0.6062171", "0.6056708", "0.6056361", "0.6042323", "0.6037698", "0.60324144", "0.60281944", "0.6020624", "0.6014077", "0.60119694", "0.60019004", "0.599528", "0.5989869", "0.59855586", "0.5974297", "0.5966403", "0.5947122", "0.5945076" ]
0.71088606
8
Returns the next line.
public String next() { try { String result = fNextLine; if (fNextLine != null) { fNextLine = fIn.readLine(); if (fNextLine == null) { fIn.close(); } } return result; } catch (IOException e) { throw new IllegalArgumentException(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getNextLine() {\n return peekToken().location.start.line;\n }", "public VCFLine getNextLine () throws IOException {\n\t\tgoNextLine();\n\t\treturn reader.getCurrentLine();\n\t}", "private String getNextLine() throws IOException {\n final BufferedReader in = this.in;\n if (in == null) {\n throw new NoSuchElementException();\n } else {\n final String nextLine = this.in.readLine();\n if (nextLine == null) {\n throw new NoSuchElementException();\n }\n return nextLine;\n }\n }", "public String getNextLine() throws IOException {\n\n String currentLine = nextLine;\n this.nextLine = bufferedReader.readLine();\n\n return currentLine;\n }", "public String nextLine()\n\t{\t\t\n\t\t\n\t\treturn this.getIn().nextLine();\n\t}", "public String nextLine() {\n\t\treturn null;\r\n\t}", "public static String readNextLine() {\n return sc.nextLine();\n }", "private String readNextLine() {\n StringBuilder sb = new StringBuilder();\n\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(stream));\n sb.append(br.readLine());\n } catch (IOException e) {\n e.fillInStackTrace();\n }\n\n return sb.toString();\n }", "public VCFLine getNextValidLine () throws IOException {\n\t\tgoNextLine();\n\t\treturn getCurrentValidLine();\n\t}", "private String getNextLine () {\n String line;\n if (endOfText()) {\n line = \"\";\n } else {\n int lineEndLength = 1;\n char c = ' ';\n char d = ' ';\n char x = ' ';\n lineEnd = index;\n boolean endOfLine = false;\n while (! endOfLine) {\n if (lineEnd >= blockIn.length()) {\n endOfLine = true;\n } else {\n c = blockIn.charAt (lineEnd);\n if (c == GlobalConstants.CARRIAGE_RETURN) {\n x = GlobalConstants.LINE_FEED;\n endOfLine = true;\n }\n else\n if (c == GlobalConstants.LINE_FEED) {\n x = GlobalConstants.CARRIAGE_RETURN;\n endOfLine = true;\n }\n if (endOfLine) {\n if ((lineEnd + 1) < blockIn.length()) {\n d = blockIn.charAt (lineEnd + 1);\n if (d == x) {\n lineEndLength = 2;\n }\n }\n } else { \n // not end of line\n lineEnd++;\n }\n } // end if another char to look at\n } // end while not end of line\n lineStart = index;\n if (lineEnd < lineStart) {\n lineEnd = blockIn.length();\n }\n if (lineEnd >= lineStart) {\n index = lineEnd + lineEndLength;\n line = blockIn.substring (lineStart, lineEnd);\n if (line.equals (getBlockEnd())) {\n blockEnded = true;\n }\n } else {\n line = \"\";\n } // end if no line to return\n } // end if more of block left\n checkNextField();\n return line;\n }", "public char next()\n {\n char current = text[position];\n\n if (position > 0 && text[position - 1] == '\\n')\n {\n lineNo++;\n begin = position;\n }\n\n position++;\n\n return current;\n }", "void getNextLine()\n\t\t\tthrows IOException, FileNotFoundException {\n String nextLine = \"\";\n if (reader == null) {\n nextLine = textLineReader.readLine();\n } else {\n nextLine = reader.readLine();\n }\n if (nextLine == null) {\n atEnd = true;\n line = new StringBuffer();\n } else {\n\t\t line = new StringBuffer (nextLine);\n }\n if (context.isTextile()) {\n textilize ();\n }\n\t\tlineLength = line.length();\n\t\tlineIndex = 0;\n\t}", "public String getNextLine() throws IOException{\n String nextLine;\n\n if (this.bufferedReader == null) {\n log.error(\"{} : Input file not open when trying to read next line\", LOG_TAG);\n }\n try {\n nextLine = this.bufferedReader.readLine();\n while(nextLine != null && (StringUtils.isBlank(nextLine) || nextLine.startsWith(\"/\"))) {\n nextLine = this.bufferedReader.readLine();\n }\n } catch (IOException e) {\n log.error(\"{} : IOException, file read error {}\", LOG_TAG, e.getStackTrace());\n throw e;\n }\n\n log.debug(\"Next line read : {}\", nextLine);\n return nextLine;\n }", "private String nextLine() {\n if (console) {\n return con.nextLine();\n }\n return scan.nextLine();\n\n }", "public void goNextLine () throws IOException {\n\t\treader.goNextLine();\n\t\tcurrentLine = reader.getCurrentLine();\n\t}", "public final void nextRow() {\n this.line++;\n }", "public String readNextLine() throws IOException {\n if (this.reader == null) {\n return null;\n }\n\n boolean openNext = false;\n String line;\n while ((line = this.reader.readLine()) == null) {\n // The current file is read at the end, ready to read next one\n this.close(this.index);\n\n if (++this.index < this.readables.size()) {\n // Open the second or subsequent readables, need\n this.reader = this.open(this.index);\n openNext = true;\n } else {\n return null;\n }\n }\n // Determine if need to skip duplicate header\n if (openNext && isDuplicateHeader(line)) {\n line = this.readNextLine();\n }\n return line;\n }", "private String nextLine(BufferedReader reader) throws IOException {\n String ln = reader.readLine();\n if (ln != null) {\n int ci = ln.indexOf('#');\n if (ci >= 0)\n ln = ln.substring(0, ci);\n ln = ln.trim();\n }\n return ln;\n }", "private void getNextToken() throws IOException {\n if (tok.ttype==LexAnn.TT_EOL) {\n if (code.getCurLine() < maxLine) {\n code.setCurLine(code.getCurLine()+1);\n tok.setString(code.getLine());\n tok.nextToken();\n } else {\n tok.ttype=LexAnn.TT_EOF; //the only place this gets set\n }\n } else {\n tok.nextToken();\n }\n }", "public int nextFreeBufferLine() {\n\t\tlogger.debug(\">> nextFreeBufferLine()\");\n\t\tint line = getRndLine();\n\t\tlogger.debug(\"<< nextFreeBufferLine(): %s\", line);\n\t\treturn line;\n\t}", "private void readNext() {\n nextLine = null;\n try {\n while (nextLine == null) {\n nextLine = reader.readNext();\n reader.consumeEmptyLines();\n if (reader.eof()) {\n break;\n }\n }\n if (nextLine != null) {\n super.recordCounter++;\n if (super.readLimit > 0 && super.recordCounter > super.readLimit) {\n nextLine = null;\n }\n }\n } catch (Exception ignore) {\n // no more lines\n }\n }", "public final String readNextLine() throws IOException {\r\n String str;\r\n if (buf_end-buf_pos <= 0) {\r\n if (fillBuffer() < 0) {\r\n throw new IOException(\"Error filling buffer!\");\r\n }\r\n }\r\n int lineEnd = -1;\r\n for (int i = buf_pos; i < buf_end; i++) {\r\n if (buffer[i] == '\\n') {\r\n lineEnd = i;\r\n break;\r\n }\r\n }\r\n if (lineEnd < 0) {\r\n StringBuilder input = new StringBuilder(256);\r\n int c;\r\n while (((c = read()) != -1) && (c != '\\n')) {\r\n input.append((char)c);\r\n }\r\n if ((c == -1) && (input.length() == 0)) {\r\n return null;\r\n }\r\n return input.toString();\r\n }\r\n\r\n if (lineEnd > 0 && buffer[lineEnd-1] == '\\r') {\r\n str = new String(buffer, buf_pos, lineEnd - buf_pos -1);\r\n }\r\n else {\r\n str = new String(buffer, buf_pos, lineEnd - buf_pos);\r\n }\r\n buf_pos = lineEnd +1;\r\n return str;\r\n }", "@Override\n\tpublic String getNext() throws IOException {\n\t\ttry {\n\t\t\t// Ignore space, tab, newLine, commentary\n\t\t\tint nextVal = reader.read();\n\t\t\tnextVal = this.ignore(nextVal);\n\n\t\t\treturn (!isEndOfFile(nextVal)) ? this.getInstruction(nextVal) : null;\n\t\t} catch (java.io.IOException e) {\n\t\t\tthrow new IOException();\n\t\t}\n\n\t}", "private String getNextLine(Scanner input)\n\t{\n\t\tString line = input.nextLine().trim();\n\t\twhile ((line.length() == 0 || line.startsWith(\"#\") || line.startsWith(\"!\")) && input.hasNext())\n\t\t\tline = input.nextLine().trim();\n\t\tif (line.startsWith(\"#\") || line.startsWith(\"!\"))\n\t\t\tline = \"\";\n\t\treturn line;\n\t}", "@Override\r\n\tpublic String next() {\n\t\tString nx;\r\n\r\n\t\tnx = p.getNext();\r\n\r\n\t\tif (nx != null) {\r\n\t\t\tthisNext = true;\r\n\t\t\tinput(nx);\r\n\t\t}\r\n\t\treturn nx;\r\n\t}", "public static int getLine() {\r\n\t\treturn rline;\r\n\t}", "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 int getLine() { \n\t// * JFlex starts in zero\n\treturn yyline+1;\n}", "public String getLine() {\r\n\t\treturn currentString;\r\n\t}", "private String readLine() {\n\t\ttry {\n\t\t\treturn reader.nextLine();\t\n\t\t} catch (NoSuchElementException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "int nextLine(int allocate) throws IOException {\n final int length = lineLoader.nextLine(allocate);\n if(length>=0)\n lineNumber++;\n return length;\n }", "public String getNextToken() {\n return this.nextToken;\n }", "public String getNextToken() {\n return this.nextToken;\n }", "public String getNextToken() {\n return this.nextToken;\n }", "public String getNextToken() {\n return this.nextToken;\n }", "public static String CURSOR_NEXT_LINE(int n) {\n return CSI + n + \"E\";\n }", "String getNext();", "String getNext();", "protected Word getNext()\n/* */ {\n/* 63 */ Word token = null;\n/* 64 */ if (this.lexer == null) {\n/* 65 */ return token;\n/* */ }\n/* */ try {\n/* 68 */ token = this.lexer.next();\n/* 69 */ while (token == WhitespaceLexer.crValue) {\n/* 70 */ if (this.eolIsSignificant) {\n/* 71 */ return token;\n/* */ }\n/* 73 */ token = this.lexer.next();\n/* */ }\n/* */ }\n/* */ catch (IOException e) {}\n/* */ \n/* */ \n/* 79 */ return token;\n/* */ }", "public Stacktrace next() throws IOException {\n\t\tString line;\n\t\tStacktrace stacktrace = null;\n\t\twhile (stacktrace == null && (line = input.readLine()) != null) {\n\t\t\tif (!StringUtils.isEmpty(line)) {\n\t\t\t\tlineBuffer.add(line);\n\t\t\t\tstacktrace = processLine(line);\n\t\t\t}\n\t\t}\n\t\treturn stacktrace;\n\t}", "private String nextToken()\n {\n // ensure that the current line has a token\n while (line == null || !line.hasMoreTokens())\n {\n try\n {\n // attempt to input another line\n String newLine = in.readLine();\n if (newLine == null) // end of file encountered\n throw new MyInputException(\"End of file\");\n\n // convert newLine to tokens\n line = new StringTokenizer(newLine);\n }\n catch (IOException e)\n {throw new MyInputException(e.getMessage());}\n\n }\n\n // extract and return the next token\n return line.nextToken();\n }", "public String getline() {\n\t\treturn _line;\n\t}", "public boolean hasNextLine() {\n return nextLine != null;\n }", "public String getLine() {\n return this.line;\n }", "public String readLine(){\n\t\tString line;\n\t\ttry{\n\t\t\tline=scanner.nextLine();\n\t\t}catch (NoSuchElementException e){\n\t\t\tline=null;\n\t\t}\n\t\treturn line;\n\t}", "protected Word getNext()\n/* */ {\n/* 58 */ Word token = null;\n/* 59 */ if (this.lexer == null) {\n/* 60 */ return token;\n/* */ }\n/* */ try {\n/* 63 */ token = this.lexer.next();\n/* 64 */ while (token == ArabicLexer.crValue) {\n/* 65 */ if (this.eolIsSignificant) {\n/* 66 */ return token;\n/* */ }\n/* 68 */ token = this.lexer.next();\n/* */ }\n/* */ }\n/* */ catch (IOException e) {}\n/* */ \n/* */ \n/* 74 */ return token;\n/* */ }", "public Line getLine ()\r\n {\r\n if (line == null) {\r\n computeLine();\r\n }\r\n\r\n return line;\r\n }", "private static String readNextLine(BufferedReader reader) {\n\t\t\n\t\ttry {\n\t\t\tString line = reader.readLine();\n\t\t\treturn line;\n\t\t} catch(IOException e) {\n\t\t\tGdx.app.error(TAG, \"Failed to read the file\", e);\n\t\t\ttry {\n\t\t\t\treader.close();\n\t\t\t} catch(IOException ex) {\n\t\t\t\tGdx.app.error(TAG, \"Failed to close file\");\n\t\t\t\tGdx.app.exit();\n\t\t\t}\n\t\t\tGdx.app.exit();\n\t\t\treturn null;\n\t\t}\n\t}", "String getCurrentLine();", "public int getLine() {\r\n\t\treturn line;\r\n\t}", "private String next() {\n if (console) {\n return con.next();\n }\n return scan.next();\n }", "public List<String> nextOneLine() throws IOException {\n counterSeveralLines = linesAfter;\n if (StringUtils.isBlank(currentPath)) return null;\n String sCurrentLine;\n if ((sCurrentLine = bufferReader.readLine()) != null) {\n listBefore = addToArray(sCurrentLine);\n }\n return listBefore;\n }", "public int getLine() {\n\t\treturn line;\n\t}", "public String getNextToken() {\n return nextToken;\n }", "public void next() {\n\t\tSystem.out.println(al.get(pos));\r\n\t\tpos++;\r\n\t}", "public int getLine() {\n return line;\n }", "public String readFirstLine() {\n if ( scanner.hasNextLine() ) {\n return scanner.nextLine();\n }\n return \"\";\n }", "public int getLine() {\r\n return line;\r\n }", "public Token getNextToken() {\r\n \r\n // if no next token, abort\r\n if (!this.hasNextToken()) return null;\r\n \r\n // get the current character\r\n char c = this.stream.peek();\r\n \r\n // comment\r\n if (c==this.charComment) {\r\n // read the line and return the token\r\n this.current = new Token(this.getUntilMeetChar('\\n'));\r\n return this.current;\r\n }\r\n \r\n // !\r\n if (c==this.charSize) {\r\n this.stream.next(); // consume the character\r\n this.current = new Token(String.valueOf(this.charSize)); // and build the token\r\n return this.current;\r\n }\r\n \r\n // else\r\n this.current = new Token(this.getUntilMeetChar(this.charSeparator)); // extract until a charSeparator is met\r\n return this.current;\r\n \r\n }", "public MInOutLine getLine()\n\t{\n\t\tif (m_line == null)\n\t\t\tm_line = new MInOutLine (getCtx(), getM_InOutLine_ID(), get_TrxName());\n\t\treturn m_line;\n\t}", "public int getLine() {return _line;}", "public int getLine() {\n return lineNum;\n }", "public final int getLine() {\n/* 377 */ return this.bufline[this.bufpos];\n/* */ }", "public int getLine() {\n return line;\n }", "public Cell getNext()\n { return next; }", "@Override\n\t\tpublic int next() {\n\t\t\treturn current++;\n\t\t}", "java.lang.String getNextStep();", "public String getNextToken() {\n return nextToken;\n }", "public abstract String getFirstLine();", "public String getLine()\n\t{\n\t\ttry\n\t\t{\n\t\t\tline = reader.readLine();\n\t\t} catch (IOException ioe)\n\t\t{\n\t\t\t//\n\t\t}\n\n\t\treturn line;\n\t}", "public String readLine() throws IOException {\n/* 176 */ String line = this.currentFilePart.readLine();\n/* 177 */ while (line == null) {\n/* 178 */ this.currentFilePart = this.currentFilePart.rollOver();\n/* 179 */ if (this.currentFilePart != null) {\n/* 180 */ line = this.currentFilePart.readLine();\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 188 */ if (\"\".equals(line) && !this.trailingNewlineOfFileSkipped) {\n/* 189 */ this.trailingNewlineOfFileSkipped = true;\n/* 190 */ line = readLine();\n/* */ } \n/* */ \n/* 193 */ return line;\n/* */ }", "public void next() {\n\t\t}", "public int getLine()\n/* */ {\n/* 1312 */ return this.line;\n/* */ }", "public int next() {\n\treturn _current < _last ? _data[_current++] : END;\n }", "public final int getLineNumber()\n {\n return _lineNumber + 1;\n }", "public String getLine ()\n {\n return line;\n }", "public Line getLine()\n {\n return line;\n }", "public LinearNode<T> getNext() {\r\n\t\t\r\n\t\treturn next;\r\n\t\r\n\t}", "private void advanceUntilNL() throws BufferEndedException {\twhile (reader.getLastDelimiter()!='\\n') reader.nextToken();}", "@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 }", "private Row nextRow() {\n\t\tRow row = (nextRow == null) ? getStarts().next() : nextRow;\n\n\t\ttry {\n\t\t\tnextRow = getStarts().next();\n\t\t} catch (NoSuchElementException e) {\n\t\t\tnextRow = null;\n\t\t}\n\n\t\treturn row;\n\t}", "private int getNextChar() throws IOException{\n\t\tpos++;\n\t\tsourceReader.mark(20);\n\t\treturn sourceReader.read();\n\t}", "public int line() {\r\n return line;\r\n }", "protected int getNextToken(){\n if( currentToken == 1){\n currentToken = -1;\n }else{\n currentToken = 1;\n }\n return currentToken;\n }", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n return token;\n }", "final public Token getNextToken() {\r\n if (token.next != null) token = token.next;\r\n else token = token.next = token_source.getNextToken();\r\n jj_ntk = -1;\r\n return token;\r\n }", "public ListNode getNext()\r\n {\r\n return next;\r\n }", "int getAfterLineNumber();", "public Nodo getnext ()\n\t\t{\n\t\t\treturn next;\n\t\t\t\n\t\t}", "public Vertex getNext() {\n\t\treturn next;\n\t}", "@Override\n public Line getLine() {\n return line;\n }", "private boolean isNewLine(int nextVal) {\n\t\treturn nextVal == CR || nextVal == LF || nextVal == EOF;\n\t}", "public node getNext() {\n\t\t\treturn next;\n\t\t}", "public VCFLine getCurrentValidLine () {\n\t\tcurrentLine = reader.getCurrentLine();\n\t\tpassValidation(currentLine);\n\t\treturn currentLine;\n\t}", "public final T next()\n {\n return skip(1);\n }", "public LLNode<T> getNext() {\n return next;\n }", "public void next() {\n\t\tif ((position == 0) && (pause != 3)) {\n\t\t\tpause++;\n\t\t} else {\n\t\t\tposition++;\n\t\t\tpause = 0;\n\t\t\tif (position == (origionalMessage.length() + 10)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\t\t}\n\n\t}", "final public Token getNextToken() {\n if (token.next != null) {\n token = token.next;\n } else {\n token = token.next = token_source.getNextToken();\n }\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "public DNode getNext() { return next; }", "public static String moveNextLine(int n) {\n return CSI + n + \"E\";\n }" ]
[ "0.8389935", "0.8107488", "0.802509", "0.7743382", "0.7672626", "0.75529057", "0.74202114", "0.7315213", "0.7312565", "0.7306949", "0.7262156", "0.7192011", "0.71816266", "0.7114123", "0.7042551", "0.7010124", "0.6937143", "0.6687144", "0.6666779", "0.6639501", "0.66371936", "0.66160727", "0.65853435", "0.6561282", "0.6509694", "0.64897585", "0.6489036", "0.648642", "0.6459085", "0.64444274", "0.64123905", "0.6389972", "0.6389972", "0.6389972", "0.6389972", "0.6356056", "0.6337228", "0.6337228", "0.6305596", "0.62803227", "0.62788135", "0.62705696", "0.6269082", "0.62572604", "0.62466675", "0.6242793", "0.6241499", "0.62298477", "0.6227353", "0.6213075", "0.62009317", "0.62001187", "0.6172469", "0.6149367", "0.6131936", "0.6131852", "0.6121527", "0.61170757", "0.6107934", "0.60992014", "0.6089392", "0.60770655", "0.60739523", "0.6072888", "0.6069877", "0.6062469", "0.6060567", "0.60574883", "0.60532886", "0.6047218", "0.6041034", "0.6039625", "0.60385776", "0.6015391", "0.59862196", "0.59761995", "0.59595865", "0.5959499", "0.5955569", "0.59477115", "0.5947026", "0.59437406", "0.5935809", "0.5925477", "0.5917885", "0.5909234", "0.590555", "0.59020925", "0.5900708", "0.5899813", "0.58993375", "0.58918154", "0.5890171", "0.5886144", "0.58787256", "0.5878291", "0.58754903", "0.58742523", "0.5873958", "0.58685005" ]
0.7613427
5
ctrl.setPuzzleDao(puzzleDao); ctrl.setHelperGenerator(helperGen); loadPage(); generatePuzzle(1, "normal"); Progress progress = ctrl.getProgress(); assertEquals(1, progress.getNormal()); assertEquals(3, progress.getStoredNormal());
@Test public void testNormalPuzzleGeneration() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testTotalPuzzleGenerated() {\n\t}", "@Test\n public void testGetProgressOfQuestionnaireById(){\n Date dateKey = new Date();\n String userName = \"Regina for president\";\n\n\n User user = new User(userName);\n userDB.insertUser(user);\n\n //add questionnaires\n HADSDQuestionnaire q1 = new HADSDQuestionnaire(userName);\n q1.setCreationDate_PK(dateKey);\n q1.setLastQuestionEditedNr(4);\n q1.setProgressInPercent(99);\n new HADSDQuestionnaireManager(context).insertQuestionnaire(q1);\n\n DistressThermometerQuestionnaire q2 = new DistressThermometerQuestionnaire(userName);\n q2.setCreationDate_PK(dateKey);\n q2.setLastQuestionEditedNr(2);\n q2.setProgressInPercent(77);\n new DistressThermometerQuestionnaireManager(context).insertQuestionnaire(q2);\n\n QolQuestionnaire q3 = new QolQuestionnaire(userName);\n q3.setCreationDate_PK(dateKey);\n q3.setLastQuestionEditedNr(0);\n q3.setProgressInPercent(33);\n new QualityOfLifeManager(context).insertQuestionnaire(q3);\n\n // get selected questionnaire\n user = userDB.getUserByName(userName);\n\n int hadsProgress = new HADSDQuestionnaireManager(context).getHADSDQuestionnaireByDate_PK(user.getName(), dateKey).getProgressInPercent();\n int distressProgress = new DistressThermometerQuestionnaireManager(context).getDistressThermometerQuestionnaireByDate(user.getName(), dateKey).getProgressInPercent();\n int qualityProgress = new QualityOfLifeManager(context).getQolQuestionnaireByDate(user.getName(), dateKey).getProgressInPercent();\n\n assertEquals(99, hadsProgress);\n assertEquals(77, distressProgress);\n assertEquals(33, qualityProgress);\n }", "@Test\n public void testIsSolved() {\n setUpCorrect();\n assertTrue(boardManager.puzzleSolved());\n swapFirstTwoTiles();\n assertFalse(boardManager.puzzleSolved());\n }", "@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 }", "@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 testPercentages(){\n assertTrue(Results.percentages());\n }", "@Test\n\tpublic void testHardPuzzleGeneration() {\n\t}", "@Test\n public void setProgression() {\n final int progress = 16;\n final String progressText = \"0:16\";\n expandPanel();\n onView(withId(R.id.play)).perform(click()); //Pause playback\n\n onView(withId(R.id.mpi_seek_bar)).perform(ViewActions.slideSeekBar(progress));\n\n onView(withId(R.id.mpi_progress)).check(matches(withText(progressText)));\n assertTrue(getPlayerHandler().getTimeElapsed() == progress);\n }", "@Test\n public void testDAM30901001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30901001Click();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n todoListPage.selectCompleteStatRadio();\n\n todoListPage = todoListPage.ifElementUsageSearch();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n\n // 1 and 3 todos are incomplete. hence not displayed\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000003\");\n assertThat(isTodoPresent, is(false));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(false));\n // 10 todo is complete. hence displayed.\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(true));\n\n // default value of finished is now false.hence todos like 1,3 will be displayed\n // where as todo like 10 will not be displayed.\n todoListPage.selectInCompleteStatRadio();\n todoListPage = todoListPage.ifElementUsageSearch();\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000003\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(true));\n // 10 todo is complete. hence displayed.\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(false));\n\n // scenario when finished property of criteria is null.\n\n }", "public void testGame1EmulateIncorrectAnswers() {\n int[] indicators;\n MainPage mainPage = getMainPage();\n GameObjectImpl game1 = mainPage.gameOpen(1);\n game1.waitIndicatorsLoad();\n indicators = game1.getIndicators();\n int qtyTasksBeforeCycle = indicators[3];\n int tasksFailedBeforeCycle = indicators[1];\n for(int iter = 0; iter < qtyTasksBeforeCycle - 1; iter++) {\n game1.waitTaskBegin();\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n indicators = game1.getIndicators();\n int varTasksPassedBegin = indicators[0];\n int varTasksFailedBegin = indicators[1];\n int varTasksRemainBegin = indicators[2];\n int qtyTasksInLoopBegin = indicators[3];\n\n String[] partsOfTask = game1.getPartsOfTask();\n String firstNumberVar = partsOfTask[0];\n String secondNumberVar = partsOfTask[1];\n String operationVar = partsOfTask[2];\n int actualResult = game1.getResultWithKeys(firstNumberVar, secondNumberVar, operationVar);\n // press wrong button\n String strActualResult = Integer.toString(actualResult + 1);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n //press correct button\n strActualResult = Integer.toString(actualResult);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n indicators = game1.getIndicators();\n int varTasksPassedEnd = indicators[0];\n int varTasksFailedEnd = indicators[1];\n int varTasksRemainEnd = indicators[2];\n int qtyTasksInLoopEnd = indicators[3];\n\n assert varTasksRemainEnd == varTasksRemainBegin : \"positiveTestCorrectAnswers: tasks remain\";//\n assert varTasksFailedEnd == (varTasksFailedBegin + 1) : \"positiveTestCorrectAnswers: tasks failed\";\n assert varTasksPassedEnd == varTasksPassedBegin : \"positiveTestCorrectAnswers: tasks passed\";\n assert qtyTasksInLoopEnd == qtyTasksInLoopBegin + 1 : \"negativeTestWrongAnswers: tasks all\";\n }\n indicators = game1.getIndicators();\n int varTasksFailedAfterCycle = indicators[1];\n int qtyTasksAfterCycle = indicators[3];\n assert varTasksFailedAfterCycle - tasksFailedBeforeCycle == qtyTasksAfterCycle - qtyTasksBeforeCycle\n : \"positiveTestCorrectAnswers: tasks summ\" ;//\n game1.clickCloseGame();\n\n }", "@Test\n public void testScriptProgressContainer_1()\n throws Exception {\n\n ScriptProgressContainer result = new ScriptProgressContainer();\n\n assertNotNull(result);\n assertEquals(null, result.getErrorMessage());\n assertEquals(0, result.getPercentComplete());\n }", "@Test\n public void testScriptProgressContainer_2()\n throws Exception {\n int percentComplete = 1;\n String errorMessage = \"\";\n\n ScriptProgressContainer result = new ScriptProgressContainer(percentComplete, errorMessage);\n\n assertNotNull(result);\n assertEquals(\"\", result.getErrorMessage());\n assertEquals(1, result.getPercentComplete());\n }", "@Test\n void displayCompletedTasks() {\n }", "@Test\n public final void testInitialSpinners() {\n int standardrows = 5;\n int standardcolumns = 5;\n assertEquals(standardrows, spysizedialog.getRows());\n assertEquals(standardcolumns, spysizedialog.getColumns());\n}", "@Test(priority = 3)\n public void checkCourseProgress() {\n \twait.until(ExpectedConditions.titleContains(\"Email Marketing Strategies\"));\n \t\n \t//Assert Course progress\n \tString courseProgress = driver.findElement(By.xpath(\"//div[contains(@class, 'ld-progress-percentage')]\")).getText();\n \tAssert.assertEquals(courseProgress, \"100% COMPLETE\");\n }", "@Test\n void testInProgressTrue() {\n Mockito.when(level.isAnyPlayerAlive()).thenReturn(true);\n Mockito.when(level.remainingPellets()).thenReturn(1);\n\n game.start();\n game.start();\n\n Assertions.assertThat(game.isInProgress()).isTrue();\n Mockito.verify(level, Mockito.times(1)).addObserver(Mockito.eq(game));\n Mockito.verify(level, Mockito.times(1)).start();\n }", "@Test\n void displayIncompleteTasks() {\n }", "@Test\r\n public void testIsSolved() {\r\n assertTrue(boardManager4.puzzleSolved());\r\n boardManager4.getBoard().swapTiles(0,0,0,1);\r\n assertFalse(boardManager4.puzzleSolved());\r\n }", "@Test\n public void updatePage() {\n }", "@Test(description = \"Verify that task is created and visual editor is visible\")\n public void verifyIfHighPriority() {\n\n LoginPage loginPage = new LoginPage();\n TaskPage taskPage = new TaskPage();\n loginPage.login(\"[email protected]\", \"UserUser\");\n\n test = report.createTest(\"Task tab is visible!\");\n Assert.assertEquals(taskPage.taskTab(\"Demo Meeting!\"), \"TASK\");\n test.pass(\"Task tab is visible\");\n\n\n test = report.createTest(\"High Priority checkbox is clicked\");\n Assert.assertEquals(taskPage.highPriorityLabel(), \"High Priority\");\n taskPage.highPriorityCheckBox();\n test.pass(\"High Priority checkbox visible and clickable\");\n\n\n test = report.createTest(\"Visual editor is visible and the bar is displayed\");\n taskPage.visualEditor();\n taskPage.visualEditorBarIsDisplayed();\n Assert.assertTrue(taskPage.visualEditorBarIsDisplayed());\n test.pass(\"Visual editor is clicked and the bar is displayed\");\n\n }", "public void testGetModo() {\n System.out.println(\"getModo\");\n int modo= 0;\n ObjectTempSwapWizard instance = new ObjectTempSwapWizard(modo);\n int expResult = 0;\n int result = instance.getModo();\n assertEquals(expResult, result);\n }", "@Test\n public void z_topDown_TC03() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n\n Statistica statistica = appService.getStatistica();\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"Literatura\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"Literatura\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"M\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"M\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"A\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"A\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"B\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"B\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"C\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"C\")==1);\n\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n } catch (NotAbleToCreateStatisticsException e) {\n assertTrue(false);\n }\n }", "public void testExecute() {\n panel.execute();\n }", "@Test\r\n public void testPartido3() throws Exception {\r\n P3.fijarEquipos(\"Barça\",\"Depor\"); \r\n P3.comenzar(); \r\n P3.tantoVisitante();\r\n P3.terminar(); \r\n assertEquals(\"Depor\",P3.ganador());\r\n }", "@Test\n public void progressionUpdaterStartedAfterPlay() {\n expandPanel();\n SeekBar seekBar = (SeekBar) getActivity().findViewById(R.id.mpi_seek_bar);\n final int progress = seekBar.getProgress();\n\n onView(isRoot()).perform(ViewActions.waitForView(\n R.id.mpi_seek_bar, new ViewActions.CheckStatus() {\n @Override\n public boolean check(View v) {\n return ((SeekBar) v).getProgress() > progress;\n }\n }, 10000));\n }", "@Test\n\tpublic void testEvilPuzzleGeneration() {\n\t}", "@Test\n public void loadAllTasksFromRepositoryAndLoadIntoView() {\n mPlaylistPresenter.setFiltering(PlaylistFilterType.ALL_TASKS);\n mPlaylistPresenter.loadTasks(true);\n\n // Callback is captured and invoked with stubbed tasks\n verify(mSongsRepository).getSongs(mLoadTasksCallbackCaptor.capture());\n mLoadTasksCallbackCaptor.getValue().onSongsLoaded(TASKS);\n\n // Then progress indicator is shown\n InOrder inOrder = inOrder(mTasksView);\n inOrder.verify(mTasksView).setLoadingIndicator(true);\n // Then progress indicator is hidden and all tasks are shown in UI\n inOrder.verify(mTasksView).setLoadingIndicator(false);\n ArgumentCaptor<List> showTasksArgumentCaptor = ArgumentCaptor.forClass(List.class);\n verify(mTasksView).showTasks(showTasksArgumentCaptor.capture());\n assertTrue(showTasksArgumentCaptor.getValue().size() == 3);\n }", "@Test\n public void testDAM30801001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30801001Click();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n TodoUpdatePage todoUpdatePage = todoListPage.updateTodo(\"0000000003\");\n\n todoListPage = todoUpdatePage.deleteByUsingTodoObj();\n\n // Confirmation of total cou nt after a record is deleted.\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"6\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"9\"));\n\n // confirm that the todo is deleted.\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000003\");\n assertThat(isTodoPresent, is(false));\n\n }", "@Test\n public void testDAM30504001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n TodoListPage todoListPage = dam3IndexPage.dam30504001Click();\n\n // Assert the todo record count from DB table\n // These count are computed from the list returned and not fetched using query.\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n // by default the radio button for incomplete todos is selected for retrievingits count.\n todoListPage = todoListPage.clickCountByStatusBtn();\n\n String todoCnt = todoListPage.getTodoCountwithStatus();\n\n // This count is fetched from db using count query : status in-complete.\n assertThat(todoCnt, equalTo(\"InComplete : 7\"));\n\n // Status selected as complete now\n todoListPage.selectCompleteStatRadio();\n\n todoListPage = todoListPage.clickCountByStatusBtn();\n todoCnt = todoListPage.getTodoCountwithStatus();\n\n // This count is fetched from db using count query : status complete.\n assertThat(todoCnt, equalTo(\"Completed : 3\"));\n\n }", "@Test\n public void testDAM30201001() {\n\n // データ初期化\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n // Connect to DB and fetch the Todo list\n TodoListPage todoListPage = dam3IndexPage.dam30201001Click();\n\n todoListPage = todoListPage.registerBulkTodo();\n\n // データ反映までの待ち時間\n webDriverOperations.waitForDisplayed(ExpectedConditions\n .textToBePresentInElementLocated(By.id(\"completedTodo\"),\n \"993\"));\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"993\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"1000\"));\n\n }", "@Test\n public void testDAM31601001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam31601001Click();\n\n // Confirmation of database state before any update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n todoListPage.setTodoForSearch(\"0000000001\");\n\n TodoDetailsPage todoDetailsPage = todoListPage.searchUsingStoredProc();\n\n webDriverOperations.waitForDisplayed(id(\"finished\"));\n\n // assert all the properties of fetched record.\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"Todo 1\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000001\"));\n assertThat(todoDetailsPage.getTodoCategory(), equalTo(\"CA1\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"In-Complete\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/24\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"1\"));\n }", "@Test\n\tpublic void Cases_23275_execute() throws Exception {\n\t\tVoodooUtils.voodoo.log.info(\"Running \" + testName + \"...\");\n\n\t\t// Go to Active tasks dashlet\n\t\t// TODO: VOOD-960 - Dashlet selection \n\t\tnew VoodooControl(\"span\", \"css\", \".row-fluid > li div span a span\").click();\n\t\tnew VoodooControl(\"a\", \"css\", \"[data-dashletaction='createRecord']\").click();\n\t\tsugar().tasks.createDrawer.getEditField(\"subject\").set(testName);\n\t\tsugar().tasks.createDrawer.save();\n\t\tif(sugar().alerts.getSuccess().queryVisible()) {\n\t\t\tsugar().alerts.getSuccess().closeAlert();\n\t\t}\n\n\t\t// refresh the Dashlet\n\t\tnew VoodooControl(\"a\", \"css\", \".dashboard-pane ul > li > ul > li .btn-group [title='Configure']\").click();\n\t\tnew VoodooControl(\"a\", \"css\", \"li > div li div [data-dashletaction='refreshClicked']\").click();\n\t\tVoodooUtils.waitForReady();\n\n\t\t// Verify task is in Active-Task Dashlet (i.e in TODO tab, if we have no related date for that record)\n\t\tnew VoodooControl(\"div\", \"css\", \"div[data-voodoo-name='active-tasks'] .dashlet-unordered-list .dashlet-tabs-row div.dashlet-tab:nth-of-type(3)\").click();\n\t\tnew VoodooControl(\"div\", \"css\", \"div.tab-pane.active p a:nth-of-type(2)\").assertEquals(testName, true);\n\n\t\tVoodooUtils.voodoo.log.info(testName + \" complete.\");\n\t}", "@Test\n public void loadCompletedTasksFromRepositoryAndLoadIntoView() {\n mPlaylistPresenter.setFiltering(PlaylistFilterType.COMPLETED_TASKS);\n mPlaylistPresenter.loadTasks(true);\n\n // Callback is captured and invoked with stubbed tasks\n verify(mSongsRepository).getSongs(mLoadTasksCallbackCaptor.capture());\n mLoadTasksCallbackCaptor.getValue().onSongsLoaded(TASKS);\n\n // Then progress indicator is hidden and completed tasks are shown in UI\n verify(mTasksView).setLoadingIndicator(false);\n ArgumentCaptor<List> showTasksArgumentCaptor = ArgumentCaptor.forClass(List.class);\n verify(mTasksView).showTasks(showTasksArgumentCaptor.capture());\n assertTrue(showTasksArgumentCaptor.getValue().size() == 2);\n }", "@Test\n public void TestGameStatus(){\n int gameTime = b.Game_Status();\n assertEquals(35, gameTime);\n }", "@Test(timeout = 4000)\n public void test011() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n errorPage0.placeholder(\"h4\");\n assertEquals(\"wheel_ErrorPage\", errorPage0.getComponentId());\n }", "@Test\n public void testDAM30202001() {\n // データ初期化\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n // Connect to DB and fetch the Todo list\n TodoListPage todoListPage = dam3IndexPage.dam30202001Click();\n\n todoListPage = todoListPage.registerBulkTodoByReUseMode();\n\n // データ反映までの待ち時間\n webDriverOperations.waitForDisplayed(ExpectedConditions\n .textToBePresentInElementLocated(By.id(\"completedTodo\"),\n \"993\"));\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"993\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"1000\"));\n }", "@Test\n public void testDAM30601003() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30601003Click();\n\n TodoRegisterPage registerTodoPage = todoListPage.registerTodo();\n\n // input todo details\n registerTodoPage.setTodoId(\"0000000030\");\n registerTodoPage.setTodoCategory(\"CA2\");\n registerTodoPage.setTodoTitle(\"Todo 30\");\n\n TodoDetailsPage todoDetailsPage = registerTodoPage.addTodoAndRetInt();\n\n String booleanStr = todoDetailsPage.getRegistrationResult();\n\n assertThat(booleanStr, equalTo(\"1\"));\n\n // assert all the properties of fetched record.\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"Todo 30\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000030\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"In-Complete\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/28\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"0\"));\n\n // Now check for false return value\n webDriverOperations.displayPage(getPackageRootUrl());\n dam3IndexPage = new DAM3IndexPage(driver);\n\n todoListPage = dam3IndexPage.dam30601003Click();\n\n registerTodoPage = todoListPage.registerTodo();\n\n registerTodoPage.setTodoId(\"0000000030\");\n registerTodoPage.setTodoCategory(\"CA2\");\n registerTodoPage.setTodoTitle(\"Todo 30\");\n\n todoDetailsPage = registerTodoPage.addTodoAndRetInt();\n\n booleanStr = todoDetailsPage.getRegistrationResult();\n\n assertThat(booleanStr, equalTo(\"0\"));\n }", "@Test\n public void proximaSequencia(){\n\n }", "@Test\n public void testModuloExpectedUse() {\n MainPanel mp = new MainPanel();\n ProgramArea pa = new ProgramArea();\n ProgramStack ps = new ProgramStack();\n\n ps.push(10);\n ps.push(3);\n\n ProgramExecutor pe = new ProgramExecutor(mp, ps, pa);\n\n pe.modulo();\n\n Assert.assertEquals(1, ps.pop());\n }", "public void testGameSetupCorrectly() throws Throwable {\n GameSetupFragment gameSetupFragment = GameSetupFragment.newInstance();\n Fragment fragPost = startFragment(gameSetupFragment, \"4\");\n assertNotNull(fragPost);\n\n //4x4 should give 16 in adapter\n final GameFragment gameFragment = GameFragment.newInstance(\"4x4\");\n startFragment(gameFragment, \"5\");\n assertNotNull(gameFragment);\n\n //check that two of each number have been placed on the board\n CubeView.Adapter adapter = (CubeView.Adapter) gameFragment.cubeGrid.getAdapter();\n\n int numCubes = adapter.getCount();\n assertEquals(16, numCubes);\n\n final int[] leftCounts = new int[8];\n final int[] topCounts = new int[8];\n final int[] rightCounts = new int[8];\n final int[] bottomCounts = new int[8];\n\n final ArrayList<CubeView> cubes = adapter.cubes;\n\n runTestOnUiThread(new Runnable() {\n @Override\n public void run() {\n for (CubeView cube : cubes) {\n for(int j = 0; j < 4; j++) {\n switch(j) {\n case 0: leftCounts[cube.showLeft()]++;\n break;\n case 1: topCounts[cube.showTop()]++;\n break;\n case 2: rightCounts[cube.showRight()]++;\n break;\n case 3: bottomCounts[cube.showBottom()]++;\n break;\n }\n }\n }\n }\n });\n\n for(int i = 0; i < 8; i++) {\n assertEquals(2, leftCounts[i]);\n assertEquals(2, topCounts[i]);\n assertEquals(2, rightCounts[i]);\n assertEquals(2, bottomCounts[i]);\n }\n\n //========================================\n // Test the settings.xml parsing functions\n //========================================\n\n Settings settings = Settings.deserialize();\n // Test theme parsing\n settings.setTheme(\"Red\");\n assertEquals(\"red\",settings.getTheme());\n settings.setTheme(\"green\");\n assertEquals(\"green\",settings.getTheme());\n // Test topic parsing\n settings.setTopic(\"Reptile\");\n assertEquals(\"reptile\", settings.getTopic());\n settings.setTopic(\"fish\");\n assertEquals(\"fish\", settings.getTopic());\n settings.setTopic(\"Mammal\");\n assertEquals(\"mammal\", settings.getTopic());\n\n // Test fling parsing\n settings.setFling(false);\n assertEquals(false, settings.isFling());\n settings.setFling(true);\n assertEquals(true, settings.isFling());\n // Test swipe parsing\n settings.setSwipe(false);\n assertEquals(false, settings.isSwipe());\n settings.setSwipe(true);\n assertEquals(true, settings.isSwipe());\n }", "@Test\n\tpublic void testHintsLoading() {\n\t\tassertArrayEquals(p1.getPuzzleHints(), p2.getPuzzleHints());\n\t\tDatabase.deleteEntry(rowid);\t\t//delete database entry after testing\t\n\t}", "@Test\n public void runNewGameTest() {\n\tassertNotEquals(-1,score);\n }", "@Test\n public void testLogicStep_1()\n throws Exception {\n LogicStep result = new LogicStep();\n assertNotNull(result);\n }", "@Test\n void isComplete() {\n }", "@Test\n public void testSetPercentComplete_1()\n throws Exception {\n ScriptProgressContainer fixture = new ScriptProgressContainer(1, \"\");\n int percentComplete = 1;\n\n fixture.setPercentComplete(percentComplete);\n\n }", "void testDrawBoard(Tester t) {\r\n initData();\r\n\r\n //testing draw board on a world\r\n t.checkExpect(this.game2.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(1) + \"/\"\r\n + Integer.toString(100), Cnst.textHeight, Color.BLACK),\r\n this.game2.indexHelp(0,0).drawBoard(2)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n t.checkExpect(this.game3.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(1) + \"/\"\r\n + Integer.toString(10), Cnst.textHeight, Color.BLACK),\r\n this.game3.indexHelp(0,0).drawBoard(3)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n t.checkExpect(this.game5.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(5) + \"/\"\r\n + Integer.toString(5), Cnst.textHeight, Color.BLACK),\r\n this.game5.indexHelp(0,0).drawBoard(4)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n //testing draw board on a visible cell\r\n t.checkExpect(this.game2.indexHelp(0, 0).drawBoard(2),\r\n new AboveImage(this.game2.indexHelp(0, 0).drawRow(2),\r\n this.game2.indexHelp(0, 0).bottom.drawBoard(2)));\r\n\r\n t.checkExpect(this.game3.indexHelp(0, 0).drawBoard(3),\r\n new AboveImage(this.game3.indexHelp(0, 0).drawRow(3),\r\n this.game3.indexHelp(0, 0).bottom.drawBoard(3)));\r\n\r\n t.checkExpect(this.game5.indexHelp(0, 0).drawBoard(4),\r\n new AboveImage(this.game5.indexHelp(0, 0).drawRow(4),\r\n this.game5.indexHelp(0, 0).bottom.drawBoard(4)));\r\n\r\n //testing it on an end cell\r\n t.checkExpect(this.game2.indexHelp(-1, 1).drawBoard(2), new EmptyImage());\r\n }", "@Test\n public void TEST_FR_SELECTDIFFICULTY_UI() {\n GameData.gameDifficulty = \"unchanged\";\n ChooseDifficultyUI testUI = new ChooseDifficultyUI();\n clickButton(testUI, 1, \"easy\");\n clickButton(testUI, 2, \"medium\");\n clickButton(testUI, 3, \"hard\");\n }", "@Test\n public void testNextWaiting() {\n }", "@Test\n\tpublic void testPowerUpView_8()\n\t\tthrows Exception {\n\t\tGameObject gameObject = new Tile(new Point());\n\t\tGfxFactory gfxFactory = new GfxFactory();\n\n\t\tPowerUpView result = new PowerUpView(gameObject, gfxFactory);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.LogManager\n\t\t// at org.apache.log4j.Logger.getLogger(Logger.java:116)\n\t\t// at client.view.GfxFactory.<init>(GfxFactory.java:45)\n\t\tassertNotNull(result);\n\t}", "@Test\n\tpublic void completeHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfCompleteHires() == 2);\n\t}", "@org.junit.Test\n public void testEstDivisibleParOK() {\n //given\n long n = 2;\n long div = 10;\n Parfait instance = new Parfait();\n\n //when\n boolean result = instance.estDivisiblePar(n, div);\n\n //then\n Assert.assertTrue(\"OK\", result);\n }", "@Test\r\n public void testPartido2() throws Exception { \r\n P2.fijarEquipos(\"Barça\",\"Depor\"); \r\n P2.comenzar(); \r\n P2.tantoLocal();\r\n P2.terminar(); \r\n assertEquals(\"Barça\",P2.ganador());\r\n }", "@Test\r\n public void testPartido1() throws Exception {\r\n /* \r\n * En el estado EN_ESPERA\r\n */\r\n assertEquals( \"Ubicación: Camp Nou\" \r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido está en espera, aún no se han concretado los equipos\"\r\n , P1.datos());\r\n /* \r\n * En el estado NO_JUGADO\r\n */\r\n P1.fijarEquipos(\"Barça\",\"Depor\"); \r\n assertEquals( \"Ubicación: Camp Nou\"\r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido aún no se ha jugado\"\r\n + \"\\nEquipo local: Barça\"\r\n + \"\\nEquipo visitante: Depor\" \r\n , P1.datos()\r\n );\r\n /* \r\n * En el estado EN_JUEGO\r\n */\r\n P1.comenzar(); \r\n P1.tantoLocal();\r\n P1.tantoVisitante();\r\n assertEquals( \"Ubicación: Camp Nou\"\r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido está en juego\"\r\n + \"\\nEquipo local: Barça\"\r\n + \"\\nTantos locales: 1\"\r\n + \"\\nEquipo visitante: Depor\"\r\n + \"\\nTantos visitantes: 1\"\r\n , P1.datos()\r\n );\r\n /* \r\n * En el estado FINALIZADO\r\n */\r\n P1.terminar(); \r\n assertEquals( \"Ubicación: Camp Nou\"\r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido ha finalizado\"\r\n + \"\\nEquipo local: Barça\"\r\n + \"\\nTantos locales: 1\"\r\n + \"\\nEquipo visitante: Depor\"\r\n + \"\\nTantos visitantes: 1\"\r\n , P1.datos()\r\n );\r\n assertEquals(\"Empate\",P1.ganador());\r\n }", "@Test\n public void testSaveGame(){\n assertEquals(d_gameEngine.saveGame(d_gameData, \"testGame\"), true);\n }", "@Test\n public void testDAM30503001() {\n\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30503001Click();\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000002\");\n\n assertThat(isTodoPresent, is(true));\n\n todoListPage.setTodoTitleContent(\"Todo 1\");\n todoListPage.setTodoCreationDate(\"2016-12-30\");\n\n todoListPage = todoListPage.searchByCriteriaBean();\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"1\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"1\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"2\"));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(true));\n\n // this todo does not meets the criteria.Hence not displayed.\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000002\");\n assertThat(isTodoPresent, is(false));\n\n }", "@Override\r\n\t\t\tpublic Integer call() throws Exception {\n\t\t\t\ttry {\r\n\t\t\t\t\tbutton.setEnabled(false);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getChoosePatternLabel().setEnabled(false);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeModelLabel().setEnabled(false);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeSeq().setEnabled(false);\r\n\t\t\t\t\tmainFrame.getStepThreeBottom().UnEnable();\r\n\t\t\t\t\tmainFrame.getStepThreeNoTimeTabbedPane().getTestData().removeAll();\r\n\t\t\t\t\t\r\n\t\t\t\t\tmarkov = mainFrame.getNoTimeSeqOperation1().getMarkov();\r\n\t\t\t\t\tdom = mainFrame.getNoTimeSeqOperation1().getDom();\r\n\t\t\t\t\troot = mainFrame.getNoTimeSeqOperation1().getRoot();\r\n\t\t\t\t\tPI = mainFrame.getNoTimeSeqOperation1().getPI();\r\n\t\t\t\t\tmin = mainFrame.getStepThreeLeftButton().getMin();\r\n\t\t\t\t\tminSeq = mainFrame.getNoTimeSeqOperation1().getMinSeq();\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\ttopLabel.removeAll();\r\n\t\t\t\t\ttopLabel.setText(\"正在生成可靠性测试数据(该过程需要较久时间,请耐心等待)....\");\r\n\t\t\t\t\tThread.sleep(150);\r\n\r\n\t\t\t\t\tCalculate.getAllTransValues(markov);\r\n\r\n\t\t\t\t\tnew BestAssign().assign(markov, root);\r\n\t\t\t\t\t\r\n\t\t\t\t\tmarkov.setDeviation(CalculateSimilarity.statistic(markov, PI));\r\n\r\n\t\t\t\t\tOutputFormat format = OutputFormat.createPrettyPrint();\r\n\r\n\t\t\t\t\twriter = new XMLWriter(\r\n\t\t\t\t\t\t\tnew FileOutputStream(mainFrame.getBathRoute() + \"/TestCase/\" + ModelName + \"_Custom#1.xml\"),\r\n\t\t\t\t\t\t\tformat);\r\n\t\t\t\t\twriter.write(dom);\r\n\t\t\t\t\twriter.close();\r\n\r\n\t\t\t\t\tmainFrame.renewPanel();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\ttopLabel.removeAll();\r\n\t\t\t\t\ttopLabel.setText(\"生成可靠性测试数据出错!\");\r\n\r\n\t\t\t\t\tbutton.setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getChoosePatternLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeModelLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeSeq().setEnabled(true);\r\n\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getChoosePatternLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeBottom().Enable();\r\n\t\t\t\t\tmainFrame.renewPanel();\r\n\t\t\t\t}\r\n\t\t\t\treturn 1;\r\n\t\t\t}", "@Test\n public void testGameProcess() {\n // set test player data\n mTournament.setPlayerCollection(getTestPlayersData());\n\n int roundNumber = mTournament.calculateRoundsNumber(mTournament.getPlayersCount());\n for (int i = 0; i < roundNumber; ++i) {\n Round round = mTournament.createNewRound();\n assertTrue(\"State of new round must be CREATED\", round.getState() == State.CREATED);\n\n // tests can't create new round because not all rounds are completed\n Round falseRound = mTournament.createNewRound();\n assertEquals(\"Instance must be null\", null, falseRound);\n\n round.startRound();\n assertTrue(\"State of starting round must be RUNNING\", round.getState() == State.RUNNING);\n\n randomiseResults(round.getMatches());\n round.endRound();\n assertTrue(\"State of ending round must be COMPLETED\", round.getState() == State.COMPLETED);\n\n // tests that ended round can't be started again\n round.startRound();\n assertTrue(\"State of ended round must be COMPLETED\", round.getState() == State.COMPLETED);\n }\n // tests can't create one more round because game is over at this point\n Round round = mTournament.createNewRound();\n assertEquals(\"Instance must be null\", null, round);\n\n }", "@Test\r\n public void startNextOptionTest()\r\n {\r\n presenter.onClickNext();\r\n\r\n Assert.assertEquals(stub.getNextCounter(), 1);\r\n }", "@Test\n public void saveSearch_withExecutedSearch(){\n fillSearchFields();\n int accountID = new AccountDAO().findAccount(\"[email protected]\").getId();\n int savedSearchesSize = new AccountDAO().findAccount(accountID).getStoredSearches().size();\n\n presenter.doSearch();\n presenter.saveSearch();\n Assert.assertEquals(savedSearchesSize + 1, new AccountDAO().findAccount(accountID).getStoredSearches().size());\n }", "@Test\n public void loadActiveTasksFromRepositoryAndLoadIntoView() {\n mPlaylistPresenter.setFiltering(PlaylistFilterType.ACTIVE_TASKS);\n mPlaylistPresenter.loadTasks(true);\n\n // Callback is captured and invoked with stubbed tasks\n verify(mSongsRepository).getSongs(mLoadTasksCallbackCaptor.capture());\n mLoadTasksCallbackCaptor.getValue().onSongsLoaded(TASKS);\n\n // Then progress indicator is hidden and active tasks are shown in UI\n verify(mTasksView).setLoadingIndicator(false);\n ArgumentCaptor<List> showTasksArgumentCaptor = ArgumentCaptor.forClass(List.class);\n verify(mTasksView).showTasks(showTasksArgumentCaptor.capture());\n assertTrue(showTasksArgumentCaptor.getValue().size() == 1);\n }", "public void testGetObj() {\n System.out.println(\"getObj\");\n int modo= 0;\n ObjectTempSwapWizard instance = new ObjectTempSwapWizard(modo);\n Object expResult = null;\n Object result = instance.getObj();\n assertEquals(expResult, result);\n }", "@Test\n public void testCalculScoreAvecQueDesSpares(){\n Jeu leJeu = new Jeu(5,5);\n Jeu jeuBonus1 = new Jeu(5, null);\n Partie laPartie = new Partie(leJeu, jeuBonus1);\n //when : on calcul le score\n Integer score = laPartie.calculerScore();\n //then : on obtient un score de 150\n assertEquals(new Integer(150), score);\n }", "@Test\n public void testDAM30503002() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n TodoListPage todoListPage = dam3IndexPage.dam30503002Click();\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000002\");\n\n assertThat(isTodoPresent, is(true));\n\n todoListPage.setTodoTitleContent(\"Todo 1\");\n todoListPage.setTodoCreationDate(\"2016-12-30\");\n\n todoListPage = todoListPage.searchByCriteriaBeanRetMap();\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"1\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"1\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"2\"));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(true));\n\n // this todo does not meets the criteria.Hence not displayed.\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000002\");\n assertThat(isTodoPresent, is(false));\n }", "@Test(timeout = 4000)\n public void test100() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"c5!DqhIQ,!L'eP\", \"0dj!E;iRV]\", (Content) null, 0, 0, \"0dj!E;iRV]\");\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment(0, homeTexture0, 0, 0, 0);\n int int0 = homeEnvironment0.getLightColor();\n assertEquals(0, homeEnvironment0.getSkyColor());\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals(0.0F, homeEnvironment0.getWallsAlpha(), 0.01F);\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals(0, int0);\n assertEquals(0, homeEnvironment0.getGroundColor());\n assertEquals(240, homeEnvironment0.getVideoHeight());\n }", "public void testGetReturnCode() {\n System.out.println(\"getReturnCode\");\n Wizard instance = new Wizard();\n int expResult = 0;\n int result = instance.getReturnCode();\n assertEquals(expResult, result);\n }", "@Test\n public void testSaveCurrentProgress() throws Exception {\n try{\n service.saveCurrentProgress();\n } catch(Exception e){\n fail(\"Exception should not be thrown on save!!!\");\n }\n }", "@Test\n public void testDAM30506001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30506001Click();\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n todoListPage = todoListPage.registerBulkTodoByReUseMode();\n\n // データ反映までの待ち時間\n webDriverOperations.waitForDisplayed(ExpectedConditions\n .textToBePresentInElementLocated(By.id(\"completedTodo\"),\n \"993\"));\n\n todoListPage.setTodoTitleContent(\"TT\");\n todoListPage.setTodoCreationDate(\"2016-12-30\");\n\n todoListPage = todoListPage.fetchUsingSQLRefinePaging();\n\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(false));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000011\");\n assertThat(isTodoPresent, is(true));\n\n // move to last page of pagination\n todoListPage = todoListPage.displayLastPage();\n\n // confirm the last ToDo on the page\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000001000\");\n assertThat(isTodoPresent, is(true));\n }", "@Test(dataProvider = \"testData\")\r\n\r\n public void createVacancyTest(String CVOption, String jobVisibility) throws InterruptedException {\r\n //STEP 1\r\n homePage.getSideBar().clickOnJobsMenu();\r\n Assert.assertTrue(jobsPage.isDisplayed());\r\n\r\n //STEP 2\r\n jobsPage.addNewJob();\r\n Assert.assertTrue(newJobPage.isDisplayed());\r\n Assert.assertTrue(newJobPage.getDetails().isDisplayed());\r\n\r\n //STEP 3\r\n newJobPage.getDetails().enterJobTitle(jobTitle);\r\n\r\n //STEP 4\r\n newJobPage.getDetails().enterJobLocation(randomCountry());\r\n Assert.assertTrue(newJobPage.getSearchSuggestion().isDisplayed());\r\n newJobPage.getSearchSuggestion().clickSuggestionByIndex();\r\n\r\n //STEP 5\r\n newJobPage.getDetails().enterSomeNote(randomText());\r\n\r\n //STEP 6\r\n newJobPage.getDetails().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getApplication().isDisplayed());\r\n\r\n //STEP 7\r\n newJobPage.getApplication().clickOnCVOption();\r\n Assert.assertTrue(newJobPage.getOptions().isDisplayed());\r\n newJobPage.getOptions().clickOnOption(CVOption);\r\n Assert.assertTrue(newJobPage.getApplication().isUpdateMessageDisplayed());\r\n\r\n //STEP 8\r\n newJobPage.getApplication().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getTeam().isDisplayed());\r\n\r\n //STEP 9\r\n newJobPage.getTeam().inviteTeamMember(email);\r\n Assert.assertTrue(newJobPage.getInvitedEmail().isDisplayed());\r\n Assert.assertEquals(newJobPage.getInvitedEmail().invitedEmailAddress(), email, \"the emails are not matching\");\r\n\r\n //STEP 10\r\n newJobPage.getTeam().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getEvaluation().isDisplayed());\r\n\r\n //STEP 11\r\n int skillCount = newJobPage.getEvaluation().getSkillCount();\r\n newJobPage.getEvaluation().addSomeSkill(randomSkill());\r\n int newSkillCount = newJobPage.getEvaluation().getSkillCount();\r\n Assert.assertTrue(newSkillCount > skillCount);\r\n\r\n //STEP 12\r\n newJobPage.getEvaluation().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getWorkflow().isDisplayed());\r\n\r\n //STEP 13\r\n newJobPage.getWorkflow().enterPipelineStage(stage);\r\n\r\n //STEP 14\r\n newJobPage.getWorkflow().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getOptional().isDisplayed());\r\n Assert.assertTrue(newJobPage.getInternalJobInformation().isDisplayed());\r\n Assert.assertTrue(newJobPage.getSalaryInfromation().isDisplayed());\r\n\r\n //STEP 15\r\n newJobPage.getInternalJobInformation().enterInternalJobInformation(internalJobTitle, id + \"\");\r\n\r\n //STEP 16\r\n newJobPage.getSalaryInfromation().enterSalaryInformation(minSalary + \"\", maxSalary + \"\", currency, minHour + \"\", maxHour + \"\");\r\n\r\n //STEP 17\r\n newJobPage.getOptional().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getPublish().isDisplayed());\r\n\r\n //STEP 18\r\n newJobPage.getPublish().chooseVisibility(jobVisibility);\r\n Assert.assertTrue(newJobPage.getPublish().updateMessageDisplayed());\r\n\r\n //STEP 19\r\n newJobPage.getPublish().clickOnSaveButton();\r\n Assert.assertTrue(newJobPage.getCreatedJobPage().isDisplayed());\r\n\r\n //EXPECTED RESULT\r\n Assert.assertEquals(newJobPage.getCreatedJobPage().getJobTitle(), internalJobTitle);\r\n Assert.assertEquals(newJobPage.getCreatedJobPage().getCreatedJobStatus(), jobVisibility);\r\n Assert.assertNotEquals(newJobPage.getCreatedJobPage().getJobInfo(), \"Remote\");\r\n }", "@Test\n public void testGetScore() {\n assertEquals(250, board3by3.getScore());\n }", "@Test\n\tpublic void testMainScenario() {\n\t\tProject project = this.db.project().create(\"Test project\", 200, \"13-05-2014\", null);\n\n//Test #1\t\t\n\t\tassertEquals(project.getActivities().size(), 0);\n\t\tassertEquals(project.getEstPercentageCompletion(), 0);\n\t\tassertEquals(project.getEstHoursRemaining(), 200);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 0);\n\t\tassertEquals(project.getHoursRegistered(), 0);\n\t\t\n\t\tActivity activity1 = this.db.activity().createProjectActivity(project.getId(), \"activity1\", 10, this.stringDateTimeToLong(\"01-05-2013 01:00\"), this.stringDateTimeToLong(\"01-05-2014 01:00\"));\n\t\tActivity activity2 = this.db.activity().createProjectActivity(project.getId(), \"activity2\", 10, this.stringDateTimeToLong(\"01-05-2013 01:00\"), this.stringDateTimeToLong(\"01-05-2014 01:00\"));\n\n//Test #2\t\t\n\t\tassertEquals(project.getActivities().size(), 2);\n\t\tassertEquals(project.getEstPercentageCompletion(), 0);\n\t\tassertEquals(project.getEstHoursRemaining(), 200);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 0);\n\t\t\n\t\tDeveloper developer = this.db.developer().readByInitials(\"JL\").get(0);\n\t\tDeveloper developer2 = this.db.developer().readByInitials(\"PM\").get(0);\n\t\tDeveloper developer3 = this.db.developer().readByInitials(\"GH\").get(0);\n\t\tDeveloper developer4 = this.db.developer().readByInitials(\"RS\").get(0);\n\t\tactivity1.addDeveloper(developer);\n\t\tactivity1.addDeveloper(developer2);\n\t\tactivity1.addDeveloper(developer3);\n\t\tactivity1.addDeveloper(developer4);\n\n//Test #3\n\t\t//Tests that the initials of all developers are stored correctly\t\t\n\t\tassertEquals(activity1.getAllDevsInitials(),\"JL,PM,GH,RS\");\n\t\tassertEquals(activity1.getAllDevsInitials() == \"The Beatles\", false); //Please fail!\n\t\t\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"11-05-2013 06:30\"), this.stringDateTimeToLong(\"11-05-2013 09:30\"), developer.getId(), activity1.getId(), false);\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"11-05-2013 06:30\"), this.stringDateTimeToLong(\"11-05-2013 09:30\"), developer2.getId(), activity1.getId(), false);\n\t\t\n\t\t//Showed in the project maintainance view, and is relevant to the report\n\t\tassertEquals(activity1.getHoursRegistered(),6);\n\t\t\n//Test #4\n\t\t//Tests normal registration\t\t\n\t\tassertEquals(project.getEstPercentageCompletion(), 3);\n\t\tassertEquals(project.getEstHoursRemaining(), 194);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 6);\n\t\t\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"12-05-2013 06:30\"), this.stringDateTimeToLong(\"12-05-2013 09:30\"), developer3.getId(), activity2.getId(), true);\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"12-05-2013 06:30\"), this.stringDateTimeToLong(\"12-05-2013 09:30\"), developer4.getId(), activity2.getId(), true);\n\n//Test #5\n\t\t//Tests that assits also count\t\t\n\t\tassertEquals(project.getEstPercentageCompletion(), 6);\n\t\tassertEquals(project.getEstHoursRemaining(), 188);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 12);\n\t}", "@Test\n\tpublic void testIrParaCarrinho_InformacoesPersistidas() {\n\t\ttestIncluirProdutoNoCarrinho_ProdutoIncluidoComSucesso();\n\t\tcarrinhoPage = modalProdutoPage.clicarBotaoProceedToCheckout();\n\t\t\t\n\t\tassertEquals(esperado_nomeDoProduto, carrinhoPage.obter_nomeDoProduto());\n\t\tassertEquals(esperado_precoDoProduto, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_precoDoProduto()));\n\t\tassertEquals(esperado_tamanhoDoProduto, carrinhoPage.obter_tamanhoDoProduto());\n\t\tassertEquals(esperado_corDoProduto, carrinhoPage.obter_corDoProduto());\n\t\tassertEquals(esperado_inputQuantidadeDoProduto, Integer.parseInt(carrinhoPage.obter_inputQuantidadeDoProduto()));\n\t\tassertEquals(esperado_subTotalDoProduto, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_subTotalDoProduto()));\n\t\t\n\t\tassertEquals(esperado_numeroItensTotal, Funcoes.removeTextoItemsDevolveInt(carrinhoPage.obter_numeroItensTotal()));\n\t\tassertEquals(esperado_subtotalTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_subtotalTotal()));\n\t\tassertEquals(esperado_shippingTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_shippingTotal()));\n\t\tassertEquals(esperado_totalTaxExclTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_totalTaxExclTotal()));\n\t\tassertEquals(esperado_totalTaxInclTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_totalTaxInclTotal()));\n\t\tassertEquals(esperado_taxesTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_taxesTotal()));\n\t\t\n\t}", "@Test\n public void testCalculScoreAvecQueDesStrikes(){\n Jeu leJeu = new Jeu(10, 0);\n Partie laPartie = new Partie(leJeu, leJeu, leJeu);\n //when : on calcul le score\n Integer score = laPartie.calculerScore();\n //then : on obtient un score de 150\n assertEquals(new Integer(300), score);\n }", "@Test\r\n void testTitForTatWithHistoryDefect() {\r\n TitForTat testStrat = new TitForTat();\r\n AlwaysDefect testStrat2 = new AlwaysDefect();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 2, payoffs);\r\n game.playGame();\r\n int points = testStrat.getPoints();\r\n assertEquals(points, 1, \"tit for tat not returning \"\r\n + \"correctly against defecting opponent\"); \r\n }", "@Test\n public void autocreateLesson() throws Exception{\n\n }", "@Test\n void setCompleted() {\n }", "public void runTests() throws Exception {\n\t\tArrayList<KaidaComposer> als = getCrossOverPermutationTest();\r\n//\t\tArrayList<KaidaComposer> als = getMutationProbabilityTests();\r\n\t\t\r\n\t\tsynchronized (results) {\r\n\t\t\tresults.clear();\r\n\t\t\tfor (KaidaComposer al : als) {\r\n\t\t\t\tresults.add(new TestRunGenerationStatistics(nrOfContests,nrOfGenerations,al.getLabel(),al));\t\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tsetProgress(0f);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tfor (int runs = 0; runs < nrOfContests; runs++) {\r\n\t\t\t//run the test n times\r\n\t\t\t\r\n\t\t\t\tSystem.out.println(\"\\nContest Nr. \" + runs + \" started\");\r\n\t\t\t\tTimer t = new Timer(\"Contest Nr. \" + runs);\r\n\t\t\t\tt.start();\r\n\t\t\t\t\r\n\t\t\t\tfor (KaidaComposer algorithm : als) {\r\n\t\t\t\t\talgorithm.restartOrTakeOver();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfor (int g = 0; g < nrOfGenerations; g++) {\r\n\t\t\t\t\t//do one evolution step\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (KaidaComposer algorithm : als) {\r\n\t\t\t\t\t\tif (algorithm.isCycleCompleted()) {\r\n\t\t\t\t\t\t\talgorithm.startNextCycle();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\talgorithm.doOneEvolutionCycle();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tt.stopAndPrint();\r\n\t\t\t\tt.start(\"Adding to results\");\r\n\t\t\t\tsynchronized (results) {\r\n\t\t\t\t\tfor (int z=0; z < als.size(); z++) {\r\n\t\t\t\t\t\tresults.get(z).addTestRun(als.get(z).getGenerations().getRange(0,nrOfGenerations));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tt.stopAndPrint();\r\n\t\t\t\tt.start(\"Calculating statistics\");\r\n\t\t\t\tsynchronized (results) {\r\n\t\t\t\t\tfor (int z=0; z < als.size(); z++) {\r\n\t\t\t\t\t\tresults.get(z).calculateStats();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tt.stopAndPrint();\r\n\t\t\t\t\r\n\t\t\t\tsetProgress((double)runs/(double)(nrOfContests-1));\r\n\t\t\t\t\r\n\t\t\t\tif (pause!=0) {\r\n\t\t\t\t\tsleep(pause);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (isPleasePause()) break;\r\n\t\t\t}\r\n\t\t\tsynchronized (results) {\r\n\t\t\t\tfor (int z=0; z < als.size(); z++) { //als.size()\r\n\t\t\t\t\tresults.get(z).calculateStats();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetProgress(1.0f);\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t//fail(\"al threw some Exception\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\t\r\n\t}", "public void testGetTitle() {\n System.out.println(\"getTitle\");\n Wizard instance = new Wizard();\n String expResult = \"\";\n String result = instance.getTitle();\n assertEquals(expResult, result);\n }", "@Test\n\tpublic void test() {\n\t\t// CHECKSTYPE:OFF\n\n\t\t// Test the addPlayer(Player player) method\n\t\tPlayer player1 = new Player(\"Iris\");\n\t\tPlayer player2 = new Player(\"Emily\");\n\t\tPlayer player3 = new Player(\"Jason\");\n\t\tPlayer player4 = new Player(\"Rain\");\n\t\tPlayer player5 = new Player(\"Mandy\");\n\t\tscrabbleSystem.addPlayer(player1);\n\t\tscrabbleSystem.addPlayer(player2);\n\t\tscrabbleSystem.addPlayer(player3);\n\t\tscrabbleSystem.addPlayer(player4);\n\t\tscrabbleSystem.addPlayer(player5);\n\t\tList<Player> playersList = scrabbleSystem.getPlayers();\n\t\tassertEquals(4, playersList.size());\n\n\t\t// Test the startNewGame() method\n\t\t/**\n\t\t * The first Turn -- place some tiles on the board\n\t\t */\n\t\tscrabbleSystem.startNewGame();\n\t\tPlayer currentPlayer1 = scrabbleSystem.getCurrentPlayer();\n\t\tSystem.out.println(currentPlayer1.getName());\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tList<SpecialTile> specialStore = scrabbleSystem.getSpecialStore();\n\t\tassertEquals(5, specialStore.size());\n\t\tassertEquals(\"Boom\", specialStore.get(0).getName());\n\t\tassertEquals(\"NegativePoint\", specialStore.get(1).getName());\n\t\tassertEquals(\"RetrieveOrder\", specialStore.get(2).getName());\n\t\tassertEquals(\"ReverseOrder\", specialStore.get(3).getName());\n\t\tassertEquals(70, scrabbleSystem.getLetterBag().getNumber());\n\n\t\t// Test the playMove(Move move) method\n\t\tSquare square1 = scrabbleSystem.getBoard().getSquare(7, 7);\n\t\tSquare square2 = scrabbleSystem.getBoard().getSquare(8, 7);\n\t\tSquare square3 = scrabbleSystem.getBoard().getSquare(9, 7);\n\n\t\tTile tile1 = currentPlayer1.getTileList().get(0);\n\t\tTile tile2 = currentPlayer1.getTileList().get(1);\n\t\tTile tile3 = currentPlayer1.getTileList().get(2);\n\n\t\tint scoreSum1 = tile1.getValue() + tile2.getValue() + tile3.getValue();\n\t\t// The first Player\n\t\tMove move = scrabbleSystem.getMove();\n\t\tmove.addTile(square2, tile2);\n\t\tmove.addTile(square3, tile3);\n\n\t\tscrabbleSystem.playMove(move);\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tassertEquals(70, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tmove.addTile(square1, tile1);\n\t\tscrabbleSystem.playMove(move);\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(7, 7).isOccuppied());\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(8, 7).isOccuppied());\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(9, 7).isOccuppied());\n\t\tassertFalse(scrabbleSystem.getBoard().getSquare(10, 7).isOccuppied());\n\t\tassertFalse(scrabbleSystem.isGameOver());\n\t\t// check player's score\n\t\tassertEquals(scoreSum1, currentPlayer1.getScore());\n\n\t\tPlayer challengePlayer1 = playersList.get(0);\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tPlayer playerTmp = playersList.get(i);\n\t\t\tif (playerTmp != currentPlayer1) {\n\t\t\t\tchallengePlayer1 = playerTmp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// if there is no player invoke a challenge\n\t\tscrabbleSystem.updateOrder();\n\n\t\t/**\n\t\t * The secord turn -- place some tiles on the board and challenges by\n\t\t * another player\n\t\t */\n\t\tPlayer currentPlayer2 = scrabbleSystem.getCurrentPlayer();\n\t\tassertNotEquals(currentPlayer1, currentPlayer2);\n\t\tSystem.out.println(currentPlayer1.getName());\n\t\tSystem.out.println(currentPlayer2.getName());\n\n\t\tSquare square4 = scrabbleSystem.getBoard().getSquare(8, 6);\n\t\tSquare square5 = scrabbleSystem.getBoard().getSquare(8, 8);\n\t\tSquare square6 = scrabbleSystem.getBoard().getSquare(8, 9);\n\t\tSquare square7 = scrabbleSystem.getBoard().getSquare(7, 8);\n\n\t\tTile tile4 = currentPlayer2.getTileList().get(0);\n\t\tTile tile5 = currentPlayer2.getTileList().get(1);\n\t\tTile tile6 = currentPlayer2.getTileList().get(2);\n\n\t\tMove move2 = scrabbleSystem.getMove();\n\t\tassertEquals(0, move2.getTileMap().size());\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square5, tile5);\n\t\tmove2.addTile(square7, tile6);\n\t\t// check invalid move\n\t\tscrabbleSystem.playMove(move2);\n\n\t\t// check invalid move\n\t\tmove2.clearMove();\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square6, tile6);\n\t\tscrabbleSystem.playMove(move2);\n\n\t\t// make valid move\n\t\tmove2.clearMove();\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square5, tile5);\n\t\tmove2.addTile(square6, tile6);\n\t\tscrabbleSystem.playMove(move2);\n\n\t\tint scoreSum2 = tile2.getValue() + tile4.getValue() * 2 + tile5.getValue() * 2 + tile6.getValue();\n\t\tassertEquals(scoreSum2, currentPlayer2.getScore());\n\n\t\t// get the challenge player\n\t\tPlayer challengePlayer2 = playersList.get(0);\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tPlayer playerTmp = playersList.get(i);\n\t\t\tif (playerTmp != currentPlayer1) {\n\t\t\t\tchallengePlayer2 = playerTmp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tassertEquals(64, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tscrabbleSystem.challenge(challengePlayer2);\n\t\tscrabbleSystem.updateOrder();\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\t\tassertFalse(square4.isOccuppied());\n\t\tassertFalse(square5.isOccuppied());\n\t\tassertFalse(square6.isOccuppied());\n\n\t\t/**\n\t\t * The third turn -- buy a Boom special tile and pass this turn\n\t\t */\n\n\t\tPlayer currentPlayer3 = scrabbleSystem.getCurrentPlayer();\n\t\tMove move3 = scrabbleSystem.getMove();\n\t\tcurrentPlayer3.addScore(100);\n\t\tscrabbleSystem.buySpecialTile(\"Boom\");\n\t\tassertEquals(80, currentPlayer3.getScore());\n\n\t\tSquare square8 = scrabbleSystem.getBoard().getSquare(8, 8);\n\t\tSquare square9 = scrabbleSystem.getBoard().getSquare(9, 8);\n\t\tSquare square10 = scrabbleSystem.getBoard().getSquare(10, 8);\n\t\tSquare square11 = scrabbleSystem.getBoard().getSquare(10, 7);\n\n\t\tTile tile8 = currentPlayer3.getTileList().get(0);\n\t\tTile tile9 = currentPlayer3.getTileList().get(1);\n\t\tTile tile10 = currentPlayer3.getTileList().get(2);\n\t\tSpecialTile specialTile = currentPlayer3.getSpecialTiles().get(\"Boom\").get(0);\n\t\tmove3.addTile(square8, tile8);\n\t\tmove3.addTile(square9, tile9);\n\t\tmove3.addTile(square10, tile10);\n\t\tmove3.addSpecialTile(specialTile, square11);\n\n\t\tint scoreSum3 = 2 * tile8.getValue() + tile9.getValue() + tile10.getValue() + 2 * tile8.getValue()\n\t\t\t\t+ tile2.getValue() + tile3.getValue() + tile9.getValue() + 80;\n\t\tscrabbleSystem.playMove(move3);\n\t\tassertEquals(scoreSum3, currentPlayer3.getScore());\n\t\tscrabbleSystem.challenge(currentPlayer2);\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\t\tassertTrue(square11.hasSpecialTile());\n\n\t\t/**\n\t\t * The fourth turn -- buy a NegativePoint special tile and place it on\n\t\t * the board\n\t\t */\n\t\tPlayer currentPlayer4 = scrabbleSystem.getCurrentPlayer();\n\t\tcurrentPlayer4.addScore(10);\n\t\tscrabbleSystem.buySpecialTile(\"NegativePoint\");\n\t\tassertEquals(1, currentPlayer4.getSpecialTiles().get(\"NegativePoint\").size());\n\n\t\tcurrentPlayer4.addScore(50);\n\t\tSystem.out.println(currentPlayer4.getScore());\n\t\tscrabbleSystem.buySpecialTile(\"NegativePoint\");\n\t\tint scoreSum4 = currentPlayer4.getScore();\n\n\t\tMove move4 = scrabbleSystem.getMove();\n\t\tSpecialTile specialTile2 = currentPlayer4.getSpecialTiles().get(\"NegativePoint\").get(0);\n\n\t\tSquare square12 = scrabbleSystem.getBoard().getSquare(11, 7);\n\t\tmove4.addSpecialTile(specialTile2, square12);\n\n\t\tscrabbleSystem.pass(move4);\n\t\tassertEquals(scoreSum4, currentPlayer4.getScore());\n\t\tassertTrue(square12.hasSpecialTile());\n\t\tassertEquals(1, currentPlayer4.getSpecialTiles().get(\"NegativePoint\").size());\n\n\t\t/**\n\t\t * The fifth turn -- invork the Boom and NegativePoint special tiles at\n\t\t * the same time\n\t\t */\n\t\tPlayer currentPlayer5 = scrabbleSystem.getCurrentPlayer();\n\t\tMove move5 = scrabbleSystem.getMove();\n\t\tSquare square13 = scrabbleSystem.getBoard().getSquare(10, 7);\n\t\tSquare square14 = scrabbleSystem.getBoard().getSquare(11, 7);\n\t\tSquare square15 = scrabbleSystem.getBoard().getSquare(12, 7);\n\t\tSquare square16 = scrabbleSystem.getBoard().getSquare(13, 7);\n\t\tSquare square17 = scrabbleSystem.getBoard().getSquare(14, 7);\n\n\t\tTile tile13 = currentPlayer5.getTileList().get(0);\n\t\tTile tile14 = currentPlayer5.getTileList().get(1);\n\t\tTile tile15 = currentPlayer5.getTileList().get(2);\n\t\tTile tile16 = currentPlayer5.getTileList().get(3);\n\t\tTile tile17 = currentPlayer5.getTileList().get(4);\n\n\t\tmove5.addTile(square13, tile13);\n\t\tmove5.addTile(square14, tile14);\n\t\tmove5.addTile(square15, tile15);\n\t\tmove5.addTile(square16, tile16);\n\t\tmove5.addTile(square17, tile17);\n\t\tscrabbleSystem.playMove(move5);\n\t\tassertFalse(square13.isOccuppied());\n\t\tassertFalse(square14.isOccuppied());\n\t\tassertFalse(square15.isOccuppied());\n\t\tassertFalse(square2.isOccuppied());\n\t\tassertFalse(square3.isOccuppied());\n\t\tassertTrue(square1.isOccuppied());\n\t\tscrabbleSystem.updateOrder();\n\n\t\tint scoreSum5 = scoreSum1 - 3 * (tile13.getValue() + tile14.getValue() + tile1.getValue());\n\t\tSystem.out.println(scoreSum5);\n\n\t\t/**\n\t\t * The sixth turn -- The player exchanges some tiles\n\t\t */\n\t\tPlayer currentPlayer6 = scrabbleSystem.getCurrentPlayer();\n\t\tList<Tile> tiles = new ArrayList<>();\n\t\tTile tile18 = currentPlayer6.getTileList().get(0);\n\t\tTile tile19 = currentPlayer6.getTileList().get(1);\n\t\tTile tile20 = currentPlayer6.getTileList().get(2);\n\t\ttiles.add(tile18);\n\t\ttiles.add(tile19);\n\t\ttiles.add(tile20);\n\t\tscrabbleSystem.exchangeTile(tiles);\n\t\tassertEquals(7, currentPlayer6.getTileList().size());\n\n\t\t/**\n\t\t * Get winner\n\t\t */\n\n\t\tList<Player> playersWinner = scrabbleSystem.getWinner();\n\t\tassertEquals(currentPlayer3.getName(), playersWinner.get(0).getName());\n\t}", "@Test\r\n public void getBoardTest() {\r\n assertEquals(board4, boardManager4.getBoard());\r\n }", "@Test\n\tpublic void progressBarTest() throws IllegalArgumentException, IllegalAccessException {\n\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\tConfiguration.mp3 &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.showtime &&\n\t\t\t\tConfiguration.tracktime &&\n\t\t\t\tConfiguration.progressbar\n\t\t\t\t) {\n\t\t\tstart();\n\t\t\tdemo.menuItemWithPath(\"Datei\", \"Datei \\u00F6ffnen\").click();\n\t\t\tdemo.fileChooser().setCurrentDirectory(new File(\"media/\"));\n\t\t\tFile file = new File(\"note.mp3\");\n\t\t\tdemo.fileChooser().selectFile(file);\n\t\t\tdemo.fileChooser().approveButton().click();\n\t\t\tdemo.button(\"play\").click();\n\t\t\tJMenu menu = (JMenu) MemberModifier.field(Application.class, \"menu\").get(gui);\n\t\t\tassertEquals(menu.getName(), \"menu\");\n\t\t\tdemo.progressBar(\"progressBar\").requireValue(25);\n\n\t\t}\n\t\t\n\t}", "@Test(enabled = true, retryAnalyzer=RetryAnalyzer.class)\r\n\tpublic void testParkingResrvSummeryAndPrintTabs(){\r\n\r\n\t\tReporter.log(\"<span style='font-weight:bold;color:#000033'> \"\r\n\r\n\t\t +\"test:C74386: Summary and Printing are not available, if required field is not filled out for parking Reservation\", true);\r\n\r\n\r\n\t\tString region = \"1preRgRef\";\r\n\r\n\t\tint random = (int)(Math.random() * 10)+18;\r\n\r\n\t\tString date = this.getFutureDate(random);\r\n\r\n\t\tString from = \"01:00\";\r\n\t\tString until = \"01:30\";\r\n\r\n\t\tString parking = \"1prePrkEqRef\";\r\n\t\t String summaryTabText= \"A summary is not available for the currently entered data\\n\"\r\n\t\t\t\t +\"\\n\"+\r\n\t\t\t\t \"Please fill in the Reservation Responsible.\\n\"+\r\n\t\t\t\t \"\\n\"+\"Please make sure you have filled out all mandatory fields.\";\r\n\t\t \r\n\r\n\t\tString printIconWarningMsg =\"Printing requires all changes to be saved first\";\r\n\r\n\t\tSoftAssert softAssert = new SoftAssert();\r\n\r\n\t\tsoftAssert.setMethodName(\"testParkingResrvSummeryAndPrintTabs\");\r\n\r\n\t\texpandAdministration();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\texpandSubMainMenu(\"Reservation\");\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\twaitAndClick(XPATH_NEWRESERVATIONS);\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\t//waitForExtJSAjaxComplete(20);\r\n\r\n\t\tsetRegion(region);\r\n\r\n\t\tsetDate(date);\r\n\r\n\t\tsetTimeFrom(from);\r\n\r\n\t\tsetTimeUntil(until);\r\n\r\n\t\twaitForExtJSAjaxComplete(5);\r\n\r\n\t\tclickParkingTab();\r\n\r\n\t\twaitForExtJSAjaxComplete(5);\r\n\r\n\t\tclickSearch();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tclickLaunchReservation(parking);\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tclickSummaryTab();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tsoftAssert.assertEquals(getSummaryTabText(),summaryTabText,\"'A summary is not available for the currently entered data' is display with a message to fill out required fields.\");\r\n\r\n\t\tclickReportIconInSummarySection();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tsoftAssert.assertTrue(verifyWarningDialogTextMessage(printIconWarningMsg),\"'Printing requires all changes to be saved first' alert message is displayed.\");\r\n\r\n\t\tthis.clickOnDialogButton(\"OK\");\r\n\r\n\t\tsoftAssert.assertAll();\r\n\r\n\t\tReporter.log(\"Summary pane is display with a message to fill out required fields.\"\r\n\t\t\t\t+ \"Alert message is displayed for print icon <br>\", true);\r\n\t}", "@Test\r\n public void testTotalNumberOfQuestion() {\r\n Application.loadQuestions();\r\n assertEquals(Application.allQuestions.size(), 2126);\r\n }", "@Test(timeout = 4000)\n public void test187() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n StandaloneComponent standaloneComponent0 = errorPage0.getPage();\n assertEquals(\"wheel_ErrorPage\", standaloneComponent0.getComponentId());\n }", "@Test\n public void continueProgressionAfterSwitchingActivity() throws Throwable {\n final int progress = 24;\n expandPanel();\n onView(withId(R.id.mpi_seek_bar)).perform(ViewActions.slideSeekBar(progress));\n\n Utils.openDrawer(getActivityTestRule());\n clickAdapterViewItem(2, R.id.navigation_drawer); //select movie activity\n\n waitForPanelState(BottomSheetBehavior.STATE_COLLAPSED);\n expandPanel();\n\n onView(isRoot()).perform(ViewActions.waitForView(R.id.mpi_seek_bar, new ViewActions.CheckStatus() {\n @Override\n public boolean check(View v) {\n int seekBarProgress = ((SeekBar) v).getProgress();\n return (seekBarProgress > progress) && (seekBarProgress < (progress + 4));\n }\n }, 10000));\n }", "@Test\n public void testDAM31401001() {\n\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam31401001Click();\n\n // Confirmation of database state before any update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n todoListPage.setTodoTitleContent(\"T\");\n todoListPage.setCutOffDate(\"2016/12/30\");\n\n todoListPage = todoListPage.downloadCSVUsingResHndlr();\n // path of downloaded csv.\n String csvPath = todoListPage.getResultHandlerCSVPath();\n\n assertThat(csvPath.isEmpty(), is(false));\n\n // The data displayed as list is extracted form the CSV file and\n // sent back to the client side.\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n TodoDetailsPage todoDetailsPage = todoListPage.displayTodoDetail(\n \"0000000010\");\n\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"Todo 10\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000010\"));\n assertThat(todoDetailsPage.getTodoCategory(), equalTo(\"CA5\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"true\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/29\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"1\"));\n\n // Back to list page:\n todoListPage = todoDetailsPage.showTodoListPage();\n todoListPage.setTodoTitleContent(\"T\");\n todoListPage.setCutOffDate(\"2016/12/30\");\n\n todoListPage = todoListPage.downloadCSVUsingResHndlr();\n\n todoDetailsPage = todoListPage.displayTodoDetail(\"0000000001\");\n // assert all the properties of fetched record.\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"Todo 1\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000001\"));\n assertThat(todoDetailsPage.getTodoCategory(), equalTo(\"CA1\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"false\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/24\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"1\"));\n\n }", "@Test\n public void testDAM30603001() {\n // Data preparation\n {\n clearTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30603001Click();\n\n todoListPage = todoListPage.batchRegister();\n\n String cntOfRegisteredTodo = todoListPage\n .getCountOfBatchRegisteredTodos();\n\n assertThat(cntOfRegisteredTodo, equalTo(\n \"Total Todos Registered/Updated in Batch : 10\"));\n\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"5\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"5\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n // confirm for some todos as present and some as not present.\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000005\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000011\");\n assertThat(isTodoPresent, is(false));\n }", "@Test(dependsOnMethods = {\"createThingByTopButton\"})\n public void createThingByNextButton() {\n int before = mainPage.countThings();\n // create a new thing\n mainPage.newThingByNext();\n // count things after creation\n int after = mainPage.countThings();\n\n Assert.assertTrue(mainPage.isNewThingCreated(before, after), \"Thing was not created!\");\n }", "@Test\r\n\tpublic void testSanity() {\n\t}", "@Test\r\n public void testCompleteTask() throws Exception {\r\n System.out.println(\"completeTask\");\r\n QueueTaskDTO task = null;\r\n QueueDAOImpl instance = new QueueDAOImpl();\r\n QueueTaskDTO expResult = null;\r\n QueueTaskDTO result = instance.completeTask(task);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Test\n public void testDAM30701001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30701001Click();\n\n TodoUpdatePage todoUpdatePage = todoListPage.updateTodo(\"0000000001\");\n\n // Confirm the values before update.\n assertThat(todoUpdatePage.getTodoTitle(), equalTo(\"Todo 1\"));\n assertThat(todoUpdatePage.getTodoID(), equalTo(\"0000000001\"));\n assertThat(todoUpdatePage.getTodoCategory(), equalTo(\"CA1\"));\n assertThat(todoUpdatePage.getTodoStatus(), equalTo(\"false\"));\n assertThat(todoUpdatePage.getTodoCreatedDate(), equalTo(\"2016/12/24\"));\n assertThat(todoUpdatePage.getTodoVersion(), equalTo(\"1\"));\n\n // modify ToDo properties\n todoUpdatePage.setTodoTitle(\"TitleUpdate1\");\n todoUpdatePage.setTodoStatus(\"true\");\n\n // Call Update process\n TodoDetailsPage todoDetailsPage = todoUpdatePage.updateTodoOpt();\n\n // confirmation of update values : value 1\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\n \"Todo 1TitleUpdate1\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000001\"));\n assertThat(todoDetailsPage.getTodoCategory(), equalTo(\"CA1\"));\n\n // confirmation of update values : value 2\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"true\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/24\"));\n\n // confirmation of update values : value 3\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"2\"));\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\tpublic void addButtons__wrappee__ProgressBarTest() throws Exception {\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\tConfiguration.mp3 &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.showtime &&\n\t\t\t\tConfiguration.tracktime &&\n\t\t\t\tConfiguration.progressbar\n\t\t\t\t) {\n\t\t\tstart();\n\t\t\t\n\t\t\t\n\t\t\tWhitebox.invokeMethod(gui, \"addButtons__wrappee__ProgressBar\");\n\t\t\tJProgressBar bar = (JProgressBar) MemberModifier.field(Application.class, \"progressBar\").get(gui);\n\t\t\tassertTrue(bar.getBounds().getX() == 26);\n\t\t\tassertTrue(bar.getBounds().getY() == 251);\n\t\t\tassertTrue(bar.getBounds().getWidth() == 301);\n\t\t\tassertTrue(bar.getBounds().getHeight() == 17);\n\t\t\tassertTrue(bar.isStringPainted());\n\t\t}\n\t}", "@Test\n public void testSmallSize(){\n assertEquals(9, smallMaze.size());\n }", "@Test\n public void testDAM30505001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30505001Click();\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n todoListPage = todoListPage.registerBulkTodoByReUseMode();\n\n // データ反映までの待ち時間\n webDriverOperations.waitForDisplayed(ExpectedConditions\n .textToBePresentInElementLocated(By.id(\"completedTodo\"),\n \"993\"));\n\n todoListPage.setTodoTitleContent(\"TT\");\n todoListPage.setTodoCreationDate(\"2016-12-30\");\n\n todoListPage = todoListPage.fetchUsingStdPaging();\n\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(false));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000011\");\n assertThat(isTodoPresent, is(true));\n\n // move to last page of pagination\n todoListPage = todoListPage.displayLastPage();\n\n // confirm the last ToDo on the page\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000001000\");\n assertThat(isTodoPresent, is(true));\n }", "@Test\n public void testDAM30601002() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30601002Click();\n\n TodoRegisterPage registerTodoPage = todoListPage.registerTodo();\n\n // input todo details\n registerTodoPage.setTodoId(\"0000000030\");\n registerTodoPage.setTodoCategory(\"CA2\");\n registerTodoPage.setTodoTitle(\"Todo 30\");\n\n TodoDetailsPage todoDetailsPage = registerTodoPage\n .addTodoWithAndReturnBool();\n\n String booleanStr = todoDetailsPage.getRegistrationResult();\n\n assertThat(booleanStr, equalTo(\"true\"));\n\n // assert all the properties of fetched record.\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"Todo 30\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000030\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"In-Complete\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/28\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"0\"));\n\n // Now check for false return value\n webDriverOperations.displayPage(getPackageRootUrl());\n dam3IndexPage = new DAM3IndexPage(driver);\n\n todoListPage = dam3IndexPage.dam30601002Click();\n\n registerTodoPage = todoListPage.registerTodo();\n\n registerTodoPage.setTodoId(\"0000000030\");\n registerTodoPage.setTodoCategory(\"CA2\");\n registerTodoPage.setTodoTitle(\"Todo 30\");\n\n todoDetailsPage = registerTodoPage.addTodoWithAndReturnBool();\n\n booleanStr = todoDetailsPage.getRegistrationResult();\n\n assertThat(booleanStr, equalTo(\"false\"));\n\n }", "@Test(dataProvider=\"getData\")\n\tpublic void BVisibility_AddButton(String tst, int i) throws IOException, InterruptedException\n\t{\n\t\tlog.info(\"Test for - \"+tst);\n\t\tLoginPage lip=new LoginPage(driver);\n\t\tlip.getUsername().clear();\n\t\tlip.getUsername().sendKeys(prop.getProperty(\"username\"));\n\t\tlip.getPassword().clear();\n\t\tlip.getPassword().sendKeys(prop.getProperty(\"password\"));\n\t\tThread.sleep(2000);\n\t\tlip.getSubmit().click();\n\t\tThread.sleep(2000);\n\t\tif (lip.getSessionOut().isDisplayed()) {\n\t\t\tlip.getSessionOut().click();\n\t }\n\t\tlog.info(\"Login successfully\");\n\t\t\n\t\tThread.sleep(5000);\n\t\t\n\t\tLandingPage LP=new LandingPage(driver);\n\t\t\n\t\tlog.info(\"enter dashboard page\");\n\t\tif(i==1) {\n\t\tLP.getDepartment().click();\n\t\tThread.sleep(3000);\n\t\tdepartmentPage dp=new departmentPage(driver);\n\t\tif(dp.getAdd().isDisplayed()){\n\t\t\tlog.info(\"Department add button is not displaying\");\n\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t}\n\t\telse {\n\t\t\tlog.info(\"Testcase failed- Department add button is visible\");\n\t\t\t\n\t\t}\n\t\t}\n\t\telse if(i==2) {\n\t\t\tLP.getProjects().click();\n\t\t\tThread.sleep(3000);\n\t\t\tProjectPage pp=new ProjectPage(driver);\n\t\t\tif(pp.getAdd().isDisplayed()){\n\t\t\t\tlog.info(\"Project add button is not displaying\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Testcase failed- Project add button is visible\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(i==3) {\n\t\t\tLP.getFields().click();\n\t\t\tThread.sleep(3000);\n\t\t\tFieldPage fp=new FieldPage(driver);\n\t\t\tif(fp.getAdd().isDisplayed()){\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- Field add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Field add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(i==4) {\n\t\t\tLP.getFilter().click();\n\t\t\tThread.sleep(3000);\n\t\t\tFilterPage fp=new FilterPage(driver);\n\t\t\tif(fp.getAdd().isDisplayed()){\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- Filter add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Filter add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(i==5) {\n\t\t\tLP.getViews().click();\n\t\t\tThread.sleep(3000);\n\t\t\tlog.info(\"Enter view page\");\n\t\t\tViewPage vp=new ViewPage(driver);\n\t\t\tif(vp.getAdd().isDisplayed()){\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- view add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"View add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tLP.getRoles().click();\n\t\t\tlog.info(\"Enter login page\");\n\t\t\tThread.sleep(3000);\n\t\t\tRolePage rp=new RolePage(driver);\n\t\t\tif(rp.getAdd().isDisplayed()) {\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- Role add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Role add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testAddprof_curso() {\n System.out.println(\"addprof_curso\");\n int codprof = 0;\n int codcurso = 0;\n cursoDAO instance = new cursoDAO();\n boolean expResult = false;\n boolean result = instance.addprof_curso(codprof, codcurso);\n assertEquals(expResult, result);\n \n }", "@Test(priority = 7, retryAnalyzer = Retry.class)\n\tpublic void VPORT_16_EnablingBenchmarkScoresManageRosterProgressMonitoring()\n\t{\n\t\tString trackName = dependentData.getProperty(\"VPORT_001_TrackName\");\n\t\tvportloginpage.enterLoginCredentials(vportData.vportUsername, vportData.vportPassword);\n\t\tvporttrackfilterPage = (VportTrackFilterPage) vportloginpage.clickSignInButton(ReturnPage.FILTERPAGE);\n\t\tvporttrackfilterPage.verifyFilterPage();\n\t\t//2.Select any product track & navigate to IPT tab - District track - technology section\n\t\tvporttrackfilterPage.trackFilters(vportData.productName, vportData.userType, vportData.alpha, trackName);\n\t\tvporttrackfilterPage.clickUpdateButton();\n\t\tdistrictTrackContactsPage = vporttrackfilterPage.clickonTrackName(trackName);\n\t\t// To verify Contacts page is loaded\n\t\tdistrictTrackContactsPage.verifyDistrictTrackContactsPage(trackName);\n\t\tdistrictTrackContactsPage.clickOnIPTTab();\n\t\tdistrictTrackContactsPage.clickOnTechnologyTab();\t\t\n\t\t//3.Find that Customer interface section is being displayed\n\t\tdistrictTrackContactsPage.verifyCustomerInterface();\n\t\t//4.Here we can explicitly enable or disable Benchmark Scores, Manage Roster & Progress monitoring sections for a particular levels for products having assesment plans\"\n\t\tdistrictTrackContactsPage.verifyTheRadioButtons();\n\t\tdistrictTrackContactsPage.verifyTheSaveChangesButton();\n\t\tdistrictTrackContactsPage.verifyTheAssessmentsplansSelectOptions();\n\t\t//Log Off from the application\n\t\tvportloginpage=districtTrackContactsPage.clickLogoutLink();\n\t\tvportloginpage.verifyLoginPage();\n\n\t}", "@Test\n public void executeSavedSearch(){\n fillSearchFields();\n int accountID = new AccountDAO().findAccount(\"[email protected]\").getId();\n presenter.doSearch();\n presenter.saveSearch();\n\n int counterBeforeSavedSearch = AccountDAO.getSearchID();\n int savedSearchID = new AccountDAO().findAccount(accountID).getStoredSearches().get(0).getSearchId();\n presenter.searchSaved(savedSearchID); //since we do searchID++ on search creation\n Assert.assertEquals(counterBeforeSavedSearch, AccountDAO.getSearchID()); //searchID shouldn't be incremented\n Assert.assertTrue(presenter.hasNextResult());\n }", "@Test\n\tpublic void progressBar_2Test() throws IllegalArgumentException, IllegalAccessException {\n\t\t\n\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\t!Configuration.mp3 &&\n\t\t\t\tConfiguration.ogg &&\n\t\t\t\t!Configuration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.tracktime &&\n\t\t\t\t!Configuration.progressbar \n\t\t\t\t) {\n\t\t\tstart();\n\t\t\tdemo.menuItemWithPath(\"Datei\", \"Datei \\u00F6ffnen\").click();\n\t\t\tdemo.fileChooser().setCurrentDirectory(new File(\"media/\"));\n\t\t\tFile file = new File(\"note.mp3\");\n\t\t\tdemo.fileChooser().selectFile(file);\n\t\t\tdemo.fileChooser().approveButton().click();\n\t\t\tdemo.button(\"play\").click();\n\t\t\n\t\t\tassertTrue(gui.OGG);\n\t\t}\n\t\t\n\t}" ]
[ "0.68420434", "0.6595508", "0.647444", "0.637188", "0.61857307", "0.6175639", "0.61479735", "0.61048734", "0.60998094", "0.60486937", "0.6000847", "0.59683347", "0.59664154", "0.59290916", "0.59280586", "0.58828235", "0.5862413", "0.5857278", "0.583025", "0.58234406", "0.58163774", "0.5775459", "0.57666683", "0.5754158", "0.5749101", "0.57422334", "0.5738286", "0.57115924", "0.5694742", "0.56746805", "0.5671501", "0.56706035", "0.5659002", "0.56466544", "0.5627934", "0.5623615", "0.5620549", "0.55990463", "0.55978966", "0.5588423", "0.55873895", "0.5580598", "0.55778944", "0.55700505", "0.5562013", "0.55588377", "0.5555674", "0.5554225", "0.5547718", "0.5541128", "0.55404043", "0.5532311", "0.5531889", "0.55314994", "0.552644", "0.55263937", "0.5525946", "0.5525186", "0.5510007", "0.54996866", "0.54956216", "0.5495075", "0.5488324", "0.54879457", "0.5487775", "0.54848486", "0.54843575", "0.5481808", "0.5479841", "0.5477008", "0.5476185", "0.54755646", "0.54725945", "0.5469885", "0.5469382", "0.54658204", "0.5463664", "0.54603845", "0.54586035", "0.5453415", "0.54513955", "0.54499865", "0.5449694", "0.54490733", "0.5447742", "0.5445137", "0.5444727", "0.54443645", "0.5439496", "0.54391044", "0.5438857", "0.5438659", "0.54361546", "0.5431577", "0.5429953", "0.5424175", "0.5423919", "0.54231566", "0.5419073", "0.5418564" ]
0.643361
3
ctrl.setPuzzleDao(puzzleDao); ctrl.setHelperGenerator(helperGen); loadPage(); generatePuzzle(1, "hard"); Progress progress = ctrl.getProgress(); assertEquals(1, progress.getHard()); assertEquals(4, progress.getStoredHard());
@Test public void testHardPuzzleGeneration() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testTotalPuzzleGenerated() {\n\t}", "@Test\n public void testGetProgressOfQuestionnaireById(){\n Date dateKey = new Date();\n String userName = \"Regina for president\";\n\n\n User user = new User(userName);\n userDB.insertUser(user);\n\n //add questionnaires\n HADSDQuestionnaire q1 = new HADSDQuestionnaire(userName);\n q1.setCreationDate_PK(dateKey);\n q1.setLastQuestionEditedNr(4);\n q1.setProgressInPercent(99);\n new HADSDQuestionnaireManager(context).insertQuestionnaire(q1);\n\n DistressThermometerQuestionnaire q2 = new DistressThermometerQuestionnaire(userName);\n q2.setCreationDate_PK(dateKey);\n q2.setLastQuestionEditedNr(2);\n q2.setProgressInPercent(77);\n new DistressThermometerQuestionnaireManager(context).insertQuestionnaire(q2);\n\n QolQuestionnaire q3 = new QolQuestionnaire(userName);\n q3.setCreationDate_PK(dateKey);\n q3.setLastQuestionEditedNr(0);\n q3.setProgressInPercent(33);\n new QualityOfLifeManager(context).insertQuestionnaire(q3);\n\n // get selected questionnaire\n user = userDB.getUserByName(userName);\n\n int hadsProgress = new HADSDQuestionnaireManager(context).getHADSDQuestionnaireByDate_PK(user.getName(), dateKey).getProgressInPercent();\n int distressProgress = new DistressThermometerQuestionnaireManager(context).getDistressThermometerQuestionnaireByDate(user.getName(), dateKey).getProgressInPercent();\n int qualityProgress = new QualityOfLifeManager(context).getQolQuestionnaireByDate(user.getName(), dateKey).getProgressInPercent();\n\n assertEquals(99, hadsProgress);\n assertEquals(77, distressProgress);\n assertEquals(33, qualityProgress);\n }", "@Test\n public void testIsSolved() {\n setUpCorrect();\n assertTrue(boardManager.puzzleSolved());\n swapFirstTwoTiles();\n assertFalse(boardManager.puzzleSolved());\n }", "@Test\n\tpublic void testNormalPuzzleGeneration() {\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 }", "@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 }", "public void testGame1EmulateIncorrectAnswers() {\n int[] indicators;\n MainPage mainPage = getMainPage();\n GameObjectImpl game1 = mainPage.gameOpen(1);\n game1.waitIndicatorsLoad();\n indicators = game1.getIndicators();\n int qtyTasksBeforeCycle = indicators[3];\n int tasksFailedBeforeCycle = indicators[1];\n for(int iter = 0; iter < qtyTasksBeforeCycle - 1; iter++) {\n game1.waitTaskBegin();\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n indicators = game1.getIndicators();\n int varTasksPassedBegin = indicators[0];\n int varTasksFailedBegin = indicators[1];\n int varTasksRemainBegin = indicators[2];\n int qtyTasksInLoopBegin = indicators[3];\n\n String[] partsOfTask = game1.getPartsOfTask();\n String firstNumberVar = partsOfTask[0];\n String secondNumberVar = partsOfTask[1];\n String operationVar = partsOfTask[2];\n int actualResult = game1.getResultWithKeys(firstNumberVar, secondNumberVar, operationVar);\n // press wrong button\n String strActualResult = Integer.toString(actualResult + 1);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n //press correct button\n strActualResult = Integer.toString(actualResult);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n indicators = game1.getIndicators();\n int varTasksPassedEnd = indicators[0];\n int varTasksFailedEnd = indicators[1];\n int varTasksRemainEnd = indicators[2];\n int qtyTasksInLoopEnd = indicators[3];\n\n assert varTasksRemainEnd == varTasksRemainBegin : \"positiveTestCorrectAnswers: tasks remain\";//\n assert varTasksFailedEnd == (varTasksFailedBegin + 1) : \"positiveTestCorrectAnswers: tasks failed\";\n assert varTasksPassedEnd == varTasksPassedBegin : \"positiveTestCorrectAnswers: tasks passed\";\n assert qtyTasksInLoopEnd == qtyTasksInLoopBegin + 1 : \"negativeTestWrongAnswers: tasks all\";\n }\n indicators = game1.getIndicators();\n int varTasksFailedAfterCycle = indicators[1];\n int qtyTasksAfterCycle = indicators[3];\n assert varTasksFailedAfterCycle - tasksFailedBeforeCycle == qtyTasksAfterCycle - qtyTasksBeforeCycle\n : \"positiveTestCorrectAnswers: tasks summ\" ;//\n game1.clickCloseGame();\n\n }", "@Test\n public void testPercentages(){\n assertTrue(Results.percentages());\n }", "@Test\n public void setProgression() {\n final int progress = 16;\n final String progressText = \"0:16\";\n expandPanel();\n onView(withId(R.id.play)).perform(click()); //Pause playback\n\n onView(withId(R.id.mpi_seek_bar)).perform(ViewActions.slideSeekBar(progress));\n\n onView(withId(R.id.mpi_progress)).check(matches(withText(progressText)));\n assertTrue(getPlayerHandler().getTimeElapsed() == progress);\n }", "@Test\r\n public void testIsSolved() {\r\n assertTrue(boardManager4.puzzleSolved());\r\n boardManager4.getBoard().swapTiles(0,0,0,1);\r\n assertFalse(boardManager4.puzzleSolved());\r\n }", "@Test\n public void testDAM30901001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30901001Click();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n todoListPage.selectCompleteStatRadio();\n\n todoListPage = todoListPage.ifElementUsageSearch();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n\n // 1 and 3 todos are incomplete. hence not displayed\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000003\");\n assertThat(isTodoPresent, is(false));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(false));\n // 10 todo is complete. hence displayed.\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(true));\n\n // default value of finished is now false.hence todos like 1,3 will be displayed\n // where as todo like 10 will not be displayed.\n todoListPage.selectInCompleteStatRadio();\n todoListPage = todoListPage.ifElementUsageSearch();\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000003\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(true));\n // 10 todo is complete. hence displayed.\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(false));\n\n // scenario when finished property of criteria is null.\n\n }", "@Test\n void displayCompletedTasks() {\n }", "@Test\n void displayIncompleteTasks() {\n }", "@Test\n public final void testInitialSpinners() {\n int standardrows = 5;\n int standardcolumns = 5;\n assertEquals(standardrows, spysizedialog.getRows());\n assertEquals(standardcolumns, spysizedialog.getColumns());\n}", "@Test(priority = 3)\n public void checkCourseProgress() {\n \twait.until(ExpectedConditions.titleContains(\"Email Marketing Strategies\"));\n \t\n \t//Assert Course progress\n \tString courseProgress = driver.findElement(By.xpath(\"//div[contains(@class, 'ld-progress-percentage')]\")).getText();\n \tAssert.assertEquals(courseProgress, \"100% COMPLETE\");\n }", "@Test\n public void z_topDown_TC03() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n\n Statistica statistica = appService.getStatistica();\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"Literatura\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"Literatura\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"M\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"M\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"A\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"A\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"B\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"B\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"C\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"C\")==1);\n\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n } catch (NotAbleToCreateStatisticsException e) {\n assertTrue(false);\n }\n }", "@Test\n public void testScriptProgressContainer_2()\n throws Exception {\n int percentComplete = 1;\n String errorMessage = \"\";\n\n ScriptProgressContainer result = new ScriptProgressContainer(percentComplete, errorMessage);\n\n assertNotNull(result);\n assertEquals(\"\", result.getErrorMessage());\n assertEquals(1, result.getPercentComplete());\n }", "@Test\n public void testScriptProgressContainer_1()\n throws Exception {\n\n ScriptProgressContainer result = new ScriptProgressContainer();\n\n assertNotNull(result);\n assertEquals(null, result.getErrorMessage());\n assertEquals(0, result.getPercentComplete());\n }", "@Test\n\tpublic void testEvilPuzzleGeneration() {\n\t}", "public void testGetModo() {\n System.out.println(\"getModo\");\n int modo= 0;\n ObjectTempSwapWizard instance = new ObjectTempSwapWizard(modo);\n int expResult = 0;\n int result = instance.getModo();\n assertEquals(expResult, result);\n }", "@Test(description = \"Verify that task is created and visual editor is visible\")\n public void verifyIfHighPriority() {\n\n LoginPage loginPage = new LoginPage();\n TaskPage taskPage = new TaskPage();\n loginPage.login(\"[email protected]\", \"UserUser\");\n\n test = report.createTest(\"Task tab is visible!\");\n Assert.assertEquals(taskPage.taskTab(\"Demo Meeting!\"), \"TASK\");\n test.pass(\"Task tab is visible\");\n\n\n test = report.createTest(\"High Priority checkbox is clicked\");\n Assert.assertEquals(taskPage.highPriorityLabel(), \"High Priority\");\n taskPage.highPriorityCheckBox();\n test.pass(\"High Priority checkbox visible and clickable\");\n\n\n test = report.createTest(\"Visual editor is visible and the bar is displayed\");\n taskPage.visualEditor();\n taskPage.visualEditorBarIsDisplayed();\n Assert.assertTrue(taskPage.visualEditorBarIsDisplayed());\n test.pass(\"Visual editor is clicked and the bar is displayed\");\n\n }", "@Test\n\tpublic void Cases_23275_execute() throws Exception {\n\t\tVoodooUtils.voodoo.log.info(\"Running \" + testName + \"...\");\n\n\t\t// Go to Active tasks dashlet\n\t\t// TODO: VOOD-960 - Dashlet selection \n\t\tnew VoodooControl(\"span\", \"css\", \".row-fluid > li div span a span\").click();\n\t\tnew VoodooControl(\"a\", \"css\", \"[data-dashletaction='createRecord']\").click();\n\t\tsugar().tasks.createDrawer.getEditField(\"subject\").set(testName);\n\t\tsugar().tasks.createDrawer.save();\n\t\tif(sugar().alerts.getSuccess().queryVisible()) {\n\t\t\tsugar().alerts.getSuccess().closeAlert();\n\t\t}\n\n\t\t// refresh the Dashlet\n\t\tnew VoodooControl(\"a\", \"css\", \".dashboard-pane ul > li > ul > li .btn-group [title='Configure']\").click();\n\t\tnew VoodooControl(\"a\", \"css\", \"li > div li div [data-dashletaction='refreshClicked']\").click();\n\t\tVoodooUtils.waitForReady();\n\n\t\t// Verify task is in Active-Task Dashlet (i.e in TODO tab, if we have no related date for that record)\n\t\tnew VoodooControl(\"div\", \"css\", \"div[data-voodoo-name='active-tasks'] .dashlet-unordered-list .dashlet-tabs-row div.dashlet-tab:nth-of-type(3)\").click();\n\t\tnew VoodooControl(\"div\", \"css\", \"div.tab-pane.active p a:nth-of-type(2)\").assertEquals(testName, true);\n\n\t\tVoodooUtils.voodoo.log.info(testName + \" complete.\");\n\t}", "@Test\r\n public void testPartido3() throws Exception {\r\n P3.fijarEquipos(\"Barça\",\"Depor\"); \r\n P3.comenzar(); \r\n P3.tantoVisitante();\r\n P3.terminar(); \r\n assertEquals(\"Depor\",P3.ganador());\r\n }", "@Test\n public void TestGameStatus(){\n int gameTime = b.Game_Status();\n assertEquals(35, gameTime);\n }", "@Test\n void testInProgressTrue() {\n Mockito.when(level.isAnyPlayerAlive()).thenReturn(true);\n Mockito.when(level.remainingPellets()).thenReturn(1);\n\n game.start();\n game.start();\n\n Assertions.assertThat(game.isInProgress()).isTrue();\n Mockito.verify(level, Mockito.times(1)).addObserver(Mockito.eq(game));\n Mockito.verify(level, Mockito.times(1)).start();\n }", "@Test\n\tpublic void completeHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfCompleteHires() == 2);\n\t}", "@Test\n public void TEST_FR_SELECTDIFFICULTY_UI() {\n GameData.gameDifficulty = \"unchanged\";\n ChooseDifficultyUI testUI = new ChooseDifficultyUI();\n clickButton(testUI, 1, \"easy\");\n clickButton(testUI, 2, \"medium\");\n clickButton(testUI, 3, \"hard\");\n }", "@Test\n public void updatePage() {\n }", "@Test\n\tpublic void test() {\n\t\t// CHECKSTYPE:OFF\n\n\t\t// Test the addPlayer(Player player) method\n\t\tPlayer player1 = new Player(\"Iris\");\n\t\tPlayer player2 = new Player(\"Emily\");\n\t\tPlayer player3 = new Player(\"Jason\");\n\t\tPlayer player4 = new Player(\"Rain\");\n\t\tPlayer player5 = new Player(\"Mandy\");\n\t\tscrabbleSystem.addPlayer(player1);\n\t\tscrabbleSystem.addPlayer(player2);\n\t\tscrabbleSystem.addPlayer(player3);\n\t\tscrabbleSystem.addPlayer(player4);\n\t\tscrabbleSystem.addPlayer(player5);\n\t\tList<Player> playersList = scrabbleSystem.getPlayers();\n\t\tassertEquals(4, playersList.size());\n\n\t\t// Test the startNewGame() method\n\t\t/**\n\t\t * The first Turn -- place some tiles on the board\n\t\t */\n\t\tscrabbleSystem.startNewGame();\n\t\tPlayer currentPlayer1 = scrabbleSystem.getCurrentPlayer();\n\t\tSystem.out.println(currentPlayer1.getName());\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tList<SpecialTile> specialStore = scrabbleSystem.getSpecialStore();\n\t\tassertEquals(5, specialStore.size());\n\t\tassertEquals(\"Boom\", specialStore.get(0).getName());\n\t\tassertEquals(\"NegativePoint\", specialStore.get(1).getName());\n\t\tassertEquals(\"RetrieveOrder\", specialStore.get(2).getName());\n\t\tassertEquals(\"ReverseOrder\", specialStore.get(3).getName());\n\t\tassertEquals(70, scrabbleSystem.getLetterBag().getNumber());\n\n\t\t// Test the playMove(Move move) method\n\t\tSquare square1 = scrabbleSystem.getBoard().getSquare(7, 7);\n\t\tSquare square2 = scrabbleSystem.getBoard().getSquare(8, 7);\n\t\tSquare square3 = scrabbleSystem.getBoard().getSquare(9, 7);\n\n\t\tTile tile1 = currentPlayer1.getTileList().get(0);\n\t\tTile tile2 = currentPlayer1.getTileList().get(1);\n\t\tTile tile3 = currentPlayer1.getTileList().get(2);\n\n\t\tint scoreSum1 = tile1.getValue() + tile2.getValue() + tile3.getValue();\n\t\t// The first Player\n\t\tMove move = scrabbleSystem.getMove();\n\t\tmove.addTile(square2, tile2);\n\t\tmove.addTile(square3, tile3);\n\n\t\tscrabbleSystem.playMove(move);\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tassertEquals(70, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tmove.addTile(square1, tile1);\n\t\tscrabbleSystem.playMove(move);\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(7, 7).isOccuppied());\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(8, 7).isOccuppied());\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(9, 7).isOccuppied());\n\t\tassertFalse(scrabbleSystem.getBoard().getSquare(10, 7).isOccuppied());\n\t\tassertFalse(scrabbleSystem.isGameOver());\n\t\t// check player's score\n\t\tassertEquals(scoreSum1, currentPlayer1.getScore());\n\n\t\tPlayer challengePlayer1 = playersList.get(0);\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tPlayer playerTmp = playersList.get(i);\n\t\t\tif (playerTmp != currentPlayer1) {\n\t\t\t\tchallengePlayer1 = playerTmp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// if there is no player invoke a challenge\n\t\tscrabbleSystem.updateOrder();\n\n\t\t/**\n\t\t * The secord turn -- place some tiles on the board and challenges by\n\t\t * another player\n\t\t */\n\t\tPlayer currentPlayer2 = scrabbleSystem.getCurrentPlayer();\n\t\tassertNotEquals(currentPlayer1, currentPlayer2);\n\t\tSystem.out.println(currentPlayer1.getName());\n\t\tSystem.out.println(currentPlayer2.getName());\n\n\t\tSquare square4 = scrabbleSystem.getBoard().getSquare(8, 6);\n\t\tSquare square5 = scrabbleSystem.getBoard().getSquare(8, 8);\n\t\tSquare square6 = scrabbleSystem.getBoard().getSquare(8, 9);\n\t\tSquare square7 = scrabbleSystem.getBoard().getSquare(7, 8);\n\n\t\tTile tile4 = currentPlayer2.getTileList().get(0);\n\t\tTile tile5 = currentPlayer2.getTileList().get(1);\n\t\tTile tile6 = currentPlayer2.getTileList().get(2);\n\n\t\tMove move2 = scrabbleSystem.getMove();\n\t\tassertEquals(0, move2.getTileMap().size());\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square5, tile5);\n\t\tmove2.addTile(square7, tile6);\n\t\t// check invalid move\n\t\tscrabbleSystem.playMove(move2);\n\n\t\t// check invalid move\n\t\tmove2.clearMove();\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square6, tile6);\n\t\tscrabbleSystem.playMove(move2);\n\n\t\t// make valid move\n\t\tmove2.clearMove();\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square5, tile5);\n\t\tmove2.addTile(square6, tile6);\n\t\tscrabbleSystem.playMove(move2);\n\n\t\tint scoreSum2 = tile2.getValue() + tile4.getValue() * 2 + tile5.getValue() * 2 + tile6.getValue();\n\t\tassertEquals(scoreSum2, currentPlayer2.getScore());\n\n\t\t// get the challenge player\n\t\tPlayer challengePlayer2 = playersList.get(0);\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tPlayer playerTmp = playersList.get(i);\n\t\t\tif (playerTmp != currentPlayer1) {\n\t\t\t\tchallengePlayer2 = playerTmp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tassertEquals(64, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tscrabbleSystem.challenge(challengePlayer2);\n\t\tscrabbleSystem.updateOrder();\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\t\tassertFalse(square4.isOccuppied());\n\t\tassertFalse(square5.isOccuppied());\n\t\tassertFalse(square6.isOccuppied());\n\n\t\t/**\n\t\t * The third turn -- buy a Boom special tile and pass this turn\n\t\t */\n\n\t\tPlayer currentPlayer3 = scrabbleSystem.getCurrentPlayer();\n\t\tMove move3 = scrabbleSystem.getMove();\n\t\tcurrentPlayer3.addScore(100);\n\t\tscrabbleSystem.buySpecialTile(\"Boom\");\n\t\tassertEquals(80, currentPlayer3.getScore());\n\n\t\tSquare square8 = scrabbleSystem.getBoard().getSquare(8, 8);\n\t\tSquare square9 = scrabbleSystem.getBoard().getSquare(9, 8);\n\t\tSquare square10 = scrabbleSystem.getBoard().getSquare(10, 8);\n\t\tSquare square11 = scrabbleSystem.getBoard().getSquare(10, 7);\n\n\t\tTile tile8 = currentPlayer3.getTileList().get(0);\n\t\tTile tile9 = currentPlayer3.getTileList().get(1);\n\t\tTile tile10 = currentPlayer3.getTileList().get(2);\n\t\tSpecialTile specialTile = currentPlayer3.getSpecialTiles().get(\"Boom\").get(0);\n\t\tmove3.addTile(square8, tile8);\n\t\tmove3.addTile(square9, tile9);\n\t\tmove3.addTile(square10, tile10);\n\t\tmove3.addSpecialTile(specialTile, square11);\n\n\t\tint scoreSum3 = 2 * tile8.getValue() + tile9.getValue() + tile10.getValue() + 2 * tile8.getValue()\n\t\t\t\t+ tile2.getValue() + tile3.getValue() + tile9.getValue() + 80;\n\t\tscrabbleSystem.playMove(move3);\n\t\tassertEquals(scoreSum3, currentPlayer3.getScore());\n\t\tscrabbleSystem.challenge(currentPlayer2);\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\t\tassertTrue(square11.hasSpecialTile());\n\n\t\t/**\n\t\t * The fourth turn -- buy a NegativePoint special tile and place it on\n\t\t * the board\n\t\t */\n\t\tPlayer currentPlayer4 = scrabbleSystem.getCurrentPlayer();\n\t\tcurrentPlayer4.addScore(10);\n\t\tscrabbleSystem.buySpecialTile(\"NegativePoint\");\n\t\tassertEquals(1, currentPlayer4.getSpecialTiles().get(\"NegativePoint\").size());\n\n\t\tcurrentPlayer4.addScore(50);\n\t\tSystem.out.println(currentPlayer4.getScore());\n\t\tscrabbleSystem.buySpecialTile(\"NegativePoint\");\n\t\tint scoreSum4 = currentPlayer4.getScore();\n\n\t\tMove move4 = scrabbleSystem.getMove();\n\t\tSpecialTile specialTile2 = currentPlayer4.getSpecialTiles().get(\"NegativePoint\").get(0);\n\n\t\tSquare square12 = scrabbleSystem.getBoard().getSquare(11, 7);\n\t\tmove4.addSpecialTile(specialTile2, square12);\n\n\t\tscrabbleSystem.pass(move4);\n\t\tassertEquals(scoreSum4, currentPlayer4.getScore());\n\t\tassertTrue(square12.hasSpecialTile());\n\t\tassertEquals(1, currentPlayer4.getSpecialTiles().get(\"NegativePoint\").size());\n\n\t\t/**\n\t\t * The fifth turn -- invork the Boom and NegativePoint special tiles at\n\t\t * the same time\n\t\t */\n\t\tPlayer currentPlayer5 = scrabbleSystem.getCurrentPlayer();\n\t\tMove move5 = scrabbleSystem.getMove();\n\t\tSquare square13 = scrabbleSystem.getBoard().getSquare(10, 7);\n\t\tSquare square14 = scrabbleSystem.getBoard().getSquare(11, 7);\n\t\tSquare square15 = scrabbleSystem.getBoard().getSquare(12, 7);\n\t\tSquare square16 = scrabbleSystem.getBoard().getSquare(13, 7);\n\t\tSquare square17 = scrabbleSystem.getBoard().getSquare(14, 7);\n\n\t\tTile tile13 = currentPlayer5.getTileList().get(0);\n\t\tTile tile14 = currentPlayer5.getTileList().get(1);\n\t\tTile tile15 = currentPlayer5.getTileList().get(2);\n\t\tTile tile16 = currentPlayer5.getTileList().get(3);\n\t\tTile tile17 = currentPlayer5.getTileList().get(4);\n\n\t\tmove5.addTile(square13, tile13);\n\t\tmove5.addTile(square14, tile14);\n\t\tmove5.addTile(square15, tile15);\n\t\tmove5.addTile(square16, tile16);\n\t\tmove5.addTile(square17, tile17);\n\t\tscrabbleSystem.playMove(move5);\n\t\tassertFalse(square13.isOccuppied());\n\t\tassertFalse(square14.isOccuppied());\n\t\tassertFalse(square15.isOccuppied());\n\t\tassertFalse(square2.isOccuppied());\n\t\tassertFalse(square3.isOccuppied());\n\t\tassertTrue(square1.isOccuppied());\n\t\tscrabbleSystem.updateOrder();\n\n\t\tint scoreSum5 = scoreSum1 - 3 * (tile13.getValue() + tile14.getValue() + tile1.getValue());\n\t\tSystem.out.println(scoreSum5);\n\n\t\t/**\n\t\t * The sixth turn -- The player exchanges some tiles\n\t\t */\n\t\tPlayer currentPlayer6 = scrabbleSystem.getCurrentPlayer();\n\t\tList<Tile> tiles = new ArrayList<>();\n\t\tTile tile18 = currentPlayer6.getTileList().get(0);\n\t\tTile tile19 = currentPlayer6.getTileList().get(1);\n\t\tTile tile20 = currentPlayer6.getTileList().get(2);\n\t\ttiles.add(tile18);\n\t\ttiles.add(tile19);\n\t\ttiles.add(tile20);\n\t\tscrabbleSystem.exchangeTile(tiles);\n\t\tassertEquals(7, currentPlayer6.getTileList().size());\n\n\t\t/**\n\t\t * Get winner\n\t\t */\n\n\t\tList<Player> playersWinner = scrabbleSystem.getWinner();\n\t\tassertEquals(currentPlayer3.getName(), playersWinner.get(0).getName());\n\t}", "@org.junit.Test\n public void testEstDivisibleParOK() {\n //given\n long n = 2;\n long div = 10;\n Parfait instance = new Parfait();\n\n //when\n boolean result = instance.estDivisiblePar(n, div);\n\n //then\n Assert.assertTrue(\"OK\", result);\n }", "@Test\r\n public void testPartido1() throws Exception {\r\n /* \r\n * En el estado EN_ESPERA\r\n */\r\n assertEquals( \"Ubicación: Camp Nou\" \r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido está en espera, aún no se han concretado los equipos\"\r\n , P1.datos());\r\n /* \r\n * En el estado NO_JUGADO\r\n */\r\n P1.fijarEquipos(\"Barça\",\"Depor\"); \r\n assertEquals( \"Ubicación: Camp Nou\"\r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido aún no se ha jugado\"\r\n + \"\\nEquipo local: Barça\"\r\n + \"\\nEquipo visitante: Depor\" \r\n , P1.datos()\r\n );\r\n /* \r\n * En el estado EN_JUEGO\r\n */\r\n P1.comenzar(); \r\n P1.tantoLocal();\r\n P1.tantoVisitante();\r\n assertEquals( \"Ubicación: Camp Nou\"\r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido está en juego\"\r\n + \"\\nEquipo local: Barça\"\r\n + \"\\nTantos locales: 1\"\r\n + \"\\nEquipo visitante: Depor\"\r\n + \"\\nTantos visitantes: 1\"\r\n , P1.datos()\r\n );\r\n /* \r\n * En el estado FINALIZADO\r\n */\r\n P1.terminar(); \r\n assertEquals( \"Ubicación: Camp Nou\"\r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido ha finalizado\"\r\n + \"\\nEquipo local: Barça\"\r\n + \"\\nTantos locales: 1\"\r\n + \"\\nEquipo visitante: Depor\"\r\n + \"\\nTantos visitantes: 1\"\r\n , P1.datos()\r\n );\r\n assertEquals(\"Empate\",P1.ganador());\r\n }", "@Test\r\n public void getBoardTest() {\r\n assertEquals(board4, boardManager4.getBoard());\r\n }", "@Test\n public void testDAM30504001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n TodoListPage todoListPage = dam3IndexPage.dam30504001Click();\n\n // Assert the todo record count from DB table\n // These count are computed from the list returned and not fetched using query.\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n // by default the radio button for incomplete todos is selected for retrievingits count.\n todoListPage = todoListPage.clickCountByStatusBtn();\n\n String todoCnt = todoListPage.getTodoCountwithStatus();\n\n // This count is fetched from db using count query : status in-complete.\n assertThat(todoCnt, equalTo(\"InComplete : 7\"));\n\n // Status selected as complete now\n todoListPage.selectCompleteStatRadio();\n\n todoListPage = todoListPage.clickCountByStatusBtn();\n todoCnt = todoListPage.getTodoCountwithStatus();\n\n // This count is fetched from db using count query : status complete.\n assertThat(todoCnt, equalTo(\"Completed : 3\"));\n\n }", "@Test\n public void mainFlowTest() {\n type.insert();\n engineer.insert();\n\n Equipment equipment1 = new Equipment(\"equipment1\", type.getId(), model, location, installTime1);\n Equipment equipment2 = new Equipment(\"equipment2\", type.getId(), model, location, installTime2);\n equipment1.insert();\n equipment2.insert();\n\n Plan plan1 = new Plan(\"plan1\", type.getId(), 30, \"large\", \"checking\");\n Plan plan2 = new Plan(\"plan2\", type.getId(), 60, \"small\", \"repairing\");\n plan1.insert();\n plan2.insert();\n\n Record record1 = new Record(\"r1\", plan1.getId(), equipment1.getId(), engineer.getId(),\n DateUtils.getCalendar(2015, 11, 1).getTime(), 2, \"换过滤网\");\n Record record2 = new Record(\"r2\", plan2.getId(), equipment1.getId(), engineer.getId(),\n DateUtils.getCalendar(2015, 11, 31).getTime(), 1, \"发动机清理\");\n Record record3 = new Record(\"r3\", plan1.getId(), equipment2.getId(), engineer.getId(),\n DateUtils.getCalendar(2015, 11, 5).getTime(), 3, \"cleaning\");\n Record record4 = new Record(\"r4\", plan2.getId(), equipment2.getId(), engineer.getId(),\n DateUtils.getCalendar(2016, 0, 4).getTime(), 2, \"tiny repairing\");\n record1.insert();\n record2.insert();\n record3.insert();\n record4.insert();\n\n // test the correctness of 10 days tasks\n List<Task> tenDayTasks = MaintenanceOperation.getTenDaysTask(DateUtils.getCalendar(2015, 11, 30).getTime());\n assertEquals(\"wrong with 10 days' tasks\", 2, tenDayTasks.size());\n\n // test the total maintenance time\n int time1 = MaintenanceOperation.getTotalMaintenanceTime(equipment1.getId());\n assertEquals(\"wrong with total time of equipment 1\", 3, time1);\n int time2 = MaintenanceOperation.getTotalMaintenanceTime(equipment2.getId());\n assertEquals(\"wrong with total time of equipment 2\", 5, time2);\n\n // test the total maintenance time of certain type\n int time3 = MaintenanceOperation.getTotalMaintenanceTime(equipment1, plan1.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 2, time3);\n int time4 = MaintenanceOperation.getTotalMaintenanceTime(equipment1, plan2.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 1, time4);\n int time5 = MaintenanceOperation.getTotalMaintenanceTime(equipment2, plan1.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 3, time5);\n int time6 = MaintenanceOperation.getTotalMaintenanceTime(equipment2, plan2.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 2, time6);\n }", "@Test\r\n void testTitForTatWithHistoryDefect() {\r\n TitForTat testStrat = new TitForTat();\r\n AlwaysDefect testStrat2 = new AlwaysDefect();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 2, payoffs);\r\n game.playGame();\r\n int points = testStrat.getPoints();\r\n assertEquals(points, 1, \"tit for tat not returning \"\r\n + \"correctly against defecting opponent\"); \r\n }", "@Test\n public void testModuloExpectedUse() {\n MainPanel mp = new MainPanel();\n ProgramArea pa = new ProgramArea();\n ProgramStack ps = new ProgramStack();\n\n ps.push(10);\n ps.push(3);\n\n ProgramExecutor pe = new ProgramExecutor(mp, ps, pa);\n\n pe.modulo();\n\n Assert.assertEquals(1, ps.pop());\n }", "public void testExecute() {\n panel.execute();\n }", "@Test\n public void testCalculScoreAvecQueDesSpares(){\n Jeu leJeu = new Jeu(5,5);\n Jeu jeuBonus1 = new Jeu(5, null);\n Partie laPartie = new Partie(leJeu, jeuBonus1);\n //when : on calcul le score\n Integer score = laPartie.calculerScore();\n //then : on obtient un score de 150\n assertEquals(new Integer(150), score);\n }", "@Test\n public void testGetScore() {\n assertEquals(250, board3by3.getScore());\n }", "@Test\n public void testCalculScoreAvecQueDesStrikes(){\n Jeu leJeu = new Jeu(10, 0);\n Partie laPartie = new Partie(leJeu, leJeu, leJeu);\n //when : on calcul le score\n Integer score = laPartie.calculerScore();\n //then : on obtient un score de 150\n assertEquals(new Integer(300), score);\n }", "@Test\n public void progressionUpdaterStartedAfterPlay() {\n expandPanel();\n SeekBar seekBar = (SeekBar) getActivity().findViewById(R.id.mpi_seek_bar);\n final int progress = seekBar.getProgress();\n\n onView(isRoot()).perform(ViewActions.waitForView(\n R.id.mpi_seek_bar, new ViewActions.CheckStatus() {\n @Override\n public boolean check(View v) {\n return ((SeekBar) v).getProgress() > progress;\n }\n }, 10000));\n }", "void testDrawBoard(Tester t) {\r\n initData();\r\n\r\n //testing draw board on a world\r\n t.checkExpect(this.game2.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(1) + \"/\"\r\n + Integer.toString(100), Cnst.textHeight, Color.BLACK),\r\n this.game2.indexHelp(0,0).drawBoard(2)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n t.checkExpect(this.game3.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(1) + \"/\"\r\n + Integer.toString(10), Cnst.textHeight, Color.BLACK),\r\n this.game3.indexHelp(0,0).drawBoard(3)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n t.checkExpect(this.game5.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(5) + \"/\"\r\n + Integer.toString(5), Cnst.textHeight, Color.BLACK),\r\n this.game5.indexHelp(0,0).drawBoard(4)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n //testing draw board on a visible cell\r\n t.checkExpect(this.game2.indexHelp(0, 0).drawBoard(2),\r\n new AboveImage(this.game2.indexHelp(0, 0).drawRow(2),\r\n this.game2.indexHelp(0, 0).bottom.drawBoard(2)));\r\n\r\n t.checkExpect(this.game3.indexHelp(0, 0).drawBoard(3),\r\n new AboveImage(this.game3.indexHelp(0, 0).drawRow(3),\r\n this.game3.indexHelp(0, 0).bottom.drawBoard(3)));\r\n\r\n t.checkExpect(this.game5.indexHelp(0, 0).drawBoard(4),\r\n new AboveImage(this.game5.indexHelp(0, 0).drawRow(4),\r\n this.game5.indexHelp(0, 0).bottom.drawBoard(4)));\r\n\r\n //testing it on an end cell\r\n t.checkExpect(this.game2.indexHelp(-1, 1).drawBoard(2), new EmptyImage());\r\n }", "@Test\n public void testDAM30201001() {\n\n // データ初期化\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n // Connect to DB and fetch the Todo list\n TodoListPage todoListPage = dam3IndexPage.dam30201001Click();\n\n todoListPage = todoListPage.registerBulkTodo();\n\n // データ反映までの待ち時間\n webDriverOperations.waitForDisplayed(ExpectedConditions\n .textToBePresentInElementLocated(By.id(\"completedTodo\"),\n \"993\"));\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"993\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"1000\"));\n\n }", "@Test\r\n public void testPartido2() throws Exception { \r\n P2.fijarEquipos(\"Barça\",\"Depor\"); \r\n P2.comenzar(); \r\n P2.tantoLocal();\r\n P2.terminar(); \r\n assertEquals(\"Barça\",P2.ganador());\r\n }", "@Test\n public void runNewGameTest() {\n\tassertNotEquals(-1,score);\n }", "@Test(enabled = true, retryAnalyzer=RetryAnalyzer.class)\r\n\tpublic void testParkingResrvSummeryAndPrintTabs(){\r\n\r\n\t\tReporter.log(\"<span style='font-weight:bold;color:#000033'> \"\r\n\r\n\t\t +\"test:C74386: Summary and Printing are not available, if required field is not filled out for parking Reservation\", true);\r\n\r\n\r\n\t\tString region = \"1preRgRef\";\r\n\r\n\t\tint random = (int)(Math.random() * 10)+18;\r\n\r\n\t\tString date = this.getFutureDate(random);\r\n\r\n\t\tString from = \"01:00\";\r\n\t\tString until = \"01:30\";\r\n\r\n\t\tString parking = \"1prePrkEqRef\";\r\n\t\t String summaryTabText= \"A summary is not available for the currently entered data\\n\"\r\n\t\t\t\t +\"\\n\"+\r\n\t\t\t\t \"Please fill in the Reservation Responsible.\\n\"+\r\n\t\t\t\t \"\\n\"+\"Please make sure you have filled out all mandatory fields.\";\r\n\t\t \r\n\r\n\t\tString printIconWarningMsg =\"Printing requires all changes to be saved first\";\r\n\r\n\t\tSoftAssert softAssert = new SoftAssert();\r\n\r\n\t\tsoftAssert.setMethodName(\"testParkingResrvSummeryAndPrintTabs\");\r\n\r\n\t\texpandAdministration();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\texpandSubMainMenu(\"Reservation\");\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\twaitAndClick(XPATH_NEWRESERVATIONS);\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\t//waitForExtJSAjaxComplete(20);\r\n\r\n\t\tsetRegion(region);\r\n\r\n\t\tsetDate(date);\r\n\r\n\t\tsetTimeFrom(from);\r\n\r\n\t\tsetTimeUntil(until);\r\n\r\n\t\twaitForExtJSAjaxComplete(5);\r\n\r\n\t\tclickParkingTab();\r\n\r\n\t\twaitForExtJSAjaxComplete(5);\r\n\r\n\t\tclickSearch();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tclickLaunchReservation(parking);\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tclickSummaryTab();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tsoftAssert.assertEquals(getSummaryTabText(),summaryTabText,\"'A summary is not available for the currently entered data' is display with a message to fill out required fields.\");\r\n\r\n\t\tclickReportIconInSummarySection();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tsoftAssert.assertTrue(verifyWarningDialogTextMessage(printIconWarningMsg),\"'Printing requires all changes to be saved first' alert message is displayed.\");\r\n\r\n\t\tthis.clickOnDialogButton(\"OK\");\r\n\r\n\t\tsoftAssert.assertAll();\r\n\r\n\t\tReporter.log(\"Summary pane is display with a message to fill out required fields.\"\r\n\t\t\t\t+ \"Alert message is displayed for print icon <br>\", true);\r\n\t}", "@Test\n public void testBuild() {\n System.out.println(\"build\");\n game.getPlayer().setEps(0);\n assertEquals((Integer) 1, building.build());\n assertEquals((Integer) 0, game.getPlayer().getEps());\n \n game.getPlayer().setEps(600);\n assertEquals((Integer) 3, building.build());\n assertEquals((Integer) 600, game.getPlayer().getEps());\n \n game.getPlayer().setEps(800);\n assertEquals((Integer) 0, building.build());\n assertEquals((Integer) 300, game.getPlayer().getEps());\n \n game.getPlayer().setEps(1000);\n assertEquals((Integer) 2, building.build());\n assertEquals((Integer) 1000, game.getPlayer().getEps());\n }", "@Test\n public void testNextWaiting() {\n }", "@Test\n public void testAssignReinforcements() {\n IssueOrderPhase l_issueOrder = new IssueOrderPhase(d_gameEngine);\n l_issueOrder.d_gameData = d_gameData;\n l_issueOrder.assignReinforcements();\n d_gameData = l_issueOrder.d_gameData;\n int l_actualNoOfArmies = d_gameData.getD_playerList().get(0).getD_noOfArmies();\n int l_expectedNoOfArmies = 8;\n assertEquals(l_expectedNoOfArmies, l_actualNoOfArmies);\n }", "@Test\n void testPartA_Example4() {\n assertEquals(33583, Day01.getFuelNeededForMass(100756));\n }", "@Test\n public void testDAM30202001() {\n // データ初期化\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n // Connect to DB and fetch the Todo list\n TodoListPage todoListPage = dam3IndexPage.dam30202001Click();\n\n todoListPage = todoListPage.registerBulkTodoByReUseMode();\n\n // データ反映までの待ち時間\n webDriverOperations.waitForDisplayed(ExpectedConditions\n .textToBePresentInElementLocated(By.id(\"completedTodo\"),\n \"993\"));\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"993\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"1000\"));\n }", "@Test\n public void testDAM30601003() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30601003Click();\n\n TodoRegisterPage registerTodoPage = todoListPage.registerTodo();\n\n // input todo details\n registerTodoPage.setTodoId(\"0000000030\");\n registerTodoPage.setTodoCategory(\"CA2\");\n registerTodoPage.setTodoTitle(\"Todo 30\");\n\n TodoDetailsPage todoDetailsPage = registerTodoPage.addTodoAndRetInt();\n\n String booleanStr = todoDetailsPage.getRegistrationResult();\n\n assertThat(booleanStr, equalTo(\"1\"));\n\n // assert all the properties of fetched record.\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"Todo 30\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000030\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"In-Complete\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/28\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"0\"));\n\n // Now check for false return value\n webDriverOperations.displayPage(getPackageRootUrl());\n dam3IndexPage = new DAM3IndexPage(driver);\n\n todoListPage = dam3IndexPage.dam30601003Click();\n\n registerTodoPage = todoListPage.registerTodo();\n\n registerTodoPage.setTodoId(\"0000000030\");\n registerTodoPage.setTodoCategory(\"CA2\");\n registerTodoPage.setTodoTitle(\"Todo 30\");\n\n todoDetailsPage = registerTodoPage.addTodoAndRetInt();\n\n booleanStr = todoDetailsPage.getRegistrationResult();\n\n assertThat(booleanStr, equalTo(\"0\"));\n }", "@Test\n\tvoid fillDrawTest() {\n\t\tMainPlay.getPlayer1Discard().add(2); //Adding the elements to discarded pile and the draw pile does not contain any elements as of now\n\t\tMainPlay.getPlayer1Discard().add(4);\n\t\tMainPlay.getPlayer2Discard().add(1);\n\t\tMainPlay.getPlayer2Discard().add(2);\n\t\tMainPlay.playTurn(); // Calling the function where the process of filling draw pile happens\n\t\tSystem.out.println(\"The discarded pile of player1 after comparing: \"+MainPlay.getPlayer1Discard());\n\t\tassertEquals(MainPlay.getPlayer1Discard().size(),4,\"The test failed as the draw pile cannot be updated\");\n\t\t//After the playTurn function the the draw pile of player1 and player 2 gets loaded and the comparison happens and as we can see the player1 cards are hight valued \n\t\t// in both the turns hence his discarded pile should be having 4 elements in the end to pass the test\n\t}", "@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\tpublic void testPowerUpView_8()\n\t\tthrows Exception {\n\t\tGameObject gameObject = new Tile(new Point());\n\t\tGfxFactory gfxFactory = new GfxFactory();\n\n\t\tPowerUpView result = new PowerUpView(gameObject, gfxFactory);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.LogManager\n\t\t// at org.apache.log4j.Logger.getLogger(Logger.java:116)\n\t\t// at client.view.GfxFactory.<init>(GfxFactory.java:45)\n\t\tassertNotNull(result);\n\t}", "@Test\n public void proximaSequencia(){\n\n }", "public void testGameSetupCorrectly() throws Throwable {\n GameSetupFragment gameSetupFragment = GameSetupFragment.newInstance();\n Fragment fragPost = startFragment(gameSetupFragment, \"4\");\n assertNotNull(fragPost);\n\n //4x4 should give 16 in adapter\n final GameFragment gameFragment = GameFragment.newInstance(\"4x4\");\n startFragment(gameFragment, \"5\");\n assertNotNull(gameFragment);\n\n //check that two of each number have been placed on the board\n CubeView.Adapter adapter = (CubeView.Adapter) gameFragment.cubeGrid.getAdapter();\n\n int numCubes = adapter.getCount();\n assertEquals(16, numCubes);\n\n final int[] leftCounts = new int[8];\n final int[] topCounts = new int[8];\n final int[] rightCounts = new int[8];\n final int[] bottomCounts = new int[8];\n\n final ArrayList<CubeView> cubes = adapter.cubes;\n\n runTestOnUiThread(new Runnable() {\n @Override\n public void run() {\n for (CubeView cube : cubes) {\n for(int j = 0; j < 4; j++) {\n switch(j) {\n case 0: leftCounts[cube.showLeft()]++;\n break;\n case 1: topCounts[cube.showTop()]++;\n break;\n case 2: rightCounts[cube.showRight()]++;\n break;\n case 3: bottomCounts[cube.showBottom()]++;\n break;\n }\n }\n }\n }\n });\n\n for(int i = 0; i < 8; i++) {\n assertEquals(2, leftCounts[i]);\n assertEquals(2, topCounts[i]);\n assertEquals(2, rightCounts[i]);\n assertEquals(2, bottomCounts[i]);\n }\n\n //========================================\n // Test the settings.xml parsing functions\n //========================================\n\n Settings settings = Settings.deserialize();\n // Test theme parsing\n settings.setTheme(\"Red\");\n assertEquals(\"red\",settings.getTheme());\n settings.setTheme(\"green\");\n assertEquals(\"green\",settings.getTheme());\n // Test topic parsing\n settings.setTopic(\"Reptile\");\n assertEquals(\"reptile\", settings.getTopic());\n settings.setTopic(\"fish\");\n assertEquals(\"fish\", settings.getTopic());\n settings.setTopic(\"Mammal\");\n assertEquals(\"mammal\", settings.getTopic());\n\n // Test fling parsing\n settings.setFling(false);\n assertEquals(false, settings.isFling());\n settings.setFling(true);\n assertEquals(true, settings.isFling());\n // Test swipe parsing\n settings.setSwipe(false);\n assertEquals(false, settings.isSwipe());\n settings.setSwipe(true);\n assertEquals(true, settings.isSwipe());\n }", "@Test\n public void testDAM30801001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30801001Click();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n TodoUpdatePage todoUpdatePage = todoListPage.updateTodo(\"0000000003\");\n\n todoListPage = todoUpdatePage.deleteByUsingTodoObj();\n\n // Confirmation of total cou nt after a record is deleted.\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"6\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"9\"));\n\n // confirm that the todo is deleted.\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000003\");\n assertThat(isTodoPresent, is(false));\n\n }", "@Test(timeout = 4000)\n public void test011() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n errorPage0.placeholder(\"h4\");\n assertEquals(\"wheel_ErrorPage\", errorPage0.getComponentId());\n }", "@Test\n @DisplayName(\"Verify collecting the remaining stones after end-game\")\n void collectRemainingStones() {\n boardService.collectRemainingStones();\n int homeCount1 = boardService.getPlayerHomeCount(playerService.getP1());\n int homeCount2 = boardService.getPlayerHomeCount(playerService.getP2());\n Assert.assertEquals(36, homeCount1);\n Assert.assertEquals(36, homeCount2);\n }", "@Test\n void testPartA_Example1() {\n assertEquals(2, Day01.getFuelNeededForMass(12));\n }", "@Test\n\tpublic void testMainScenario() {\n\t\tProject project = this.db.project().create(\"Test project\", 200, \"13-05-2014\", null);\n\n//Test #1\t\t\n\t\tassertEquals(project.getActivities().size(), 0);\n\t\tassertEquals(project.getEstPercentageCompletion(), 0);\n\t\tassertEquals(project.getEstHoursRemaining(), 200);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 0);\n\t\tassertEquals(project.getHoursRegistered(), 0);\n\t\t\n\t\tActivity activity1 = this.db.activity().createProjectActivity(project.getId(), \"activity1\", 10, this.stringDateTimeToLong(\"01-05-2013 01:00\"), this.stringDateTimeToLong(\"01-05-2014 01:00\"));\n\t\tActivity activity2 = this.db.activity().createProjectActivity(project.getId(), \"activity2\", 10, this.stringDateTimeToLong(\"01-05-2013 01:00\"), this.stringDateTimeToLong(\"01-05-2014 01:00\"));\n\n//Test #2\t\t\n\t\tassertEquals(project.getActivities().size(), 2);\n\t\tassertEquals(project.getEstPercentageCompletion(), 0);\n\t\tassertEquals(project.getEstHoursRemaining(), 200);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 0);\n\t\t\n\t\tDeveloper developer = this.db.developer().readByInitials(\"JL\").get(0);\n\t\tDeveloper developer2 = this.db.developer().readByInitials(\"PM\").get(0);\n\t\tDeveloper developer3 = this.db.developer().readByInitials(\"GH\").get(0);\n\t\tDeveloper developer4 = this.db.developer().readByInitials(\"RS\").get(0);\n\t\tactivity1.addDeveloper(developer);\n\t\tactivity1.addDeveloper(developer2);\n\t\tactivity1.addDeveloper(developer3);\n\t\tactivity1.addDeveloper(developer4);\n\n//Test #3\n\t\t//Tests that the initials of all developers are stored correctly\t\t\n\t\tassertEquals(activity1.getAllDevsInitials(),\"JL,PM,GH,RS\");\n\t\tassertEquals(activity1.getAllDevsInitials() == \"The Beatles\", false); //Please fail!\n\t\t\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"11-05-2013 06:30\"), this.stringDateTimeToLong(\"11-05-2013 09:30\"), developer.getId(), activity1.getId(), false);\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"11-05-2013 06:30\"), this.stringDateTimeToLong(\"11-05-2013 09:30\"), developer2.getId(), activity1.getId(), false);\n\t\t\n\t\t//Showed in the project maintainance view, and is relevant to the report\n\t\tassertEquals(activity1.getHoursRegistered(),6);\n\t\t\n//Test #4\n\t\t//Tests normal registration\t\t\n\t\tassertEquals(project.getEstPercentageCompletion(), 3);\n\t\tassertEquals(project.getEstHoursRemaining(), 194);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 6);\n\t\t\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"12-05-2013 06:30\"), this.stringDateTimeToLong(\"12-05-2013 09:30\"), developer3.getId(), activity2.getId(), true);\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"12-05-2013 06:30\"), this.stringDateTimeToLong(\"12-05-2013 09:30\"), developer4.getId(), activity2.getId(), true);\n\n//Test #5\n\t\t//Tests that assits also count\t\t\n\t\tassertEquals(project.getEstPercentageCompletion(), 6);\n\t\tassertEquals(project.getEstHoursRemaining(), 188);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 12);\n\t}", "@Test\n public void test13() { \n Board board13 = new Board();\n board13.put(1,1,1); \n board13.put(1,2,1);\n board13.put(1,3,2);\n board13.put(2,1,2);\n board13.put(2,2,2);\n board13.put(2,3,1);\n board13.put(3,1,1);\n board13.put(3,2,1);\n board13.put(3,3,2);\n assertTrue(board13.checkTie());\n }", "@Test\n void isComplete() {\n }", "@Test\n void testPartA_Example2() {\n assertEquals(2, Day01.getFuelNeededForMass(14));\n }", "@Test\n\tpublic void testHintsLoading() {\n\t\tassertArrayEquals(p1.getPuzzleHints(), p2.getPuzzleHints());\n\t\tDatabase.deleteEntry(rowid);\t\t//delete database entry after testing\t\n\t}", "@Override\r\n\t\t\tpublic Integer call() throws Exception {\n\t\t\t\ttry {\r\n\t\t\t\t\tbutton.setEnabled(false);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getChoosePatternLabel().setEnabled(false);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeModelLabel().setEnabled(false);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeSeq().setEnabled(false);\r\n\t\t\t\t\tmainFrame.getStepThreeBottom().UnEnable();\r\n\t\t\t\t\tmainFrame.getStepThreeNoTimeTabbedPane().getTestData().removeAll();\r\n\t\t\t\t\t\r\n\t\t\t\t\tmarkov = mainFrame.getNoTimeSeqOperation1().getMarkov();\r\n\t\t\t\t\tdom = mainFrame.getNoTimeSeqOperation1().getDom();\r\n\t\t\t\t\troot = mainFrame.getNoTimeSeqOperation1().getRoot();\r\n\t\t\t\t\tPI = mainFrame.getNoTimeSeqOperation1().getPI();\r\n\t\t\t\t\tmin = mainFrame.getStepThreeLeftButton().getMin();\r\n\t\t\t\t\tminSeq = mainFrame.getNoTimeSeqOperation1().getMinSeq();\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\ttopLabel.removeAll();\r\n\t\t\t\t\ttopLabel.setText(\"正在生成可靠性测试数据(该过程需要较久时间,请耐心等待)....\");\r\n\t\t\t\t\tThread.sleep(150);\r\n\r\n\t\t\t\t\tCalculate.getAllTransValues(markov);\r\n\r\n\t\t\t\t\tnew BestAssign().assign(markov, root);\r\n\t\t\t\t\t\r\n\t\t\t\t\tmarkov.setDeviation(CalculateSimilarity.statistic(markov, PI));\r\n\r\n\t\t\t\t\tOutputFormat format = OutputFormat.createPrettyPrint();\r\n\r\n\t\t\t\t\twriter = new XMLWriter(\r\n\t\t\t\t\t\t\tnew FileOutputStream(mainFrame.getBathRoute() + \"/TestCase/\" + ModelName + \"_Custom#1.xml\"),\r\n\t\t\t\t\t\t\tformat);\r\n\t\t\t\t\twriter.write(dom);\r\n\t\t\t\t\twriter.close();\r\n\r\n\t\t\t\t\tmainFrame.renewPanel();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\ttopLabel.removeAll();\r\n\t\t\t\t\ttopLabel.setText(\"生成可靠性测试数据出错!\");\r\n\r\n\t\t\t\t\tbutton.setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getChoosePatternLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeModelLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeSeq().setEnabled(true);\r\n\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getChoosePatternLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeBottom().Enable();\r\n\t\t\t\t\tmainFrame.renewPanel();\r\n\t\t\t\t}\r\n\t\t\t\treturn 1;\r\n\t\t\t}", "@Test\n public void testDAM31601001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam31601001Click();\n\n // Confirmation of database state before any update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n todoListPage.setTodoForSearch(\"0000000001\");\n\n TodoDetailsPage todoDetailsPage = todoListPage.searchUsingStoredProc();\n\n webDriverOperations.waitForDisplayed(id(\"finished\"));\n\n // assert all the properties of fetched record.\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"Todo 1\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000001\"));\n assertThat(todoDetailsPage.getTodoCategory(), equalTo(\"CA1\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"In-Complete\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/24\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"1\"));\n }", "@Test(enabled = true, retryAnalyzer=RetryAnalyzer.class)\r\n\tpublic void testParkingBookingPreparationTimeAndCleanupNotConsidered() throws IOException{\r\n\t\tReporter.log(\"<span style='font-weight:bold;color:#000033'> \"\r\n\t\t\t\t+ \"C118064: Preparation and Cleanup time should not be considered while calculating Total Cost in Parking reservation\", true);\r\n\r\n\t\t int random = (int)(Math.random() * 10)+24;\r\n\t\t String date = this.getFutureDate(random);\r\n\t\t String region = \"1preRgRef\";\r\n\t\t String from = \"18:00\";\r\n\t\t String until = \"19:00\";\r\n\t\t String prakingResv = \"prePrkDefRef\";\r\n\t\t String prepTime = \"00:30\";\r\n\t\t String cleanupTime = \"00:30\";\r\n\t\t String responsible=getUserLastNameOfLoggedInUser();\r\n\r\n\t\t SoftAssert softAssert = new SoftAssert();\r\n\t\t softAssert.setMethodName(\"testParkingBookingPreparationTimeAndCleanupNotConsidered\");\r\n\t\t \r\n\t\t expandAdministration();\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t expandSubMainMenu(\"Reservation\");\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t waitAndClick(XPATH_NEWRESERVATIONS);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t //C118064\r\n\t\t setRegion(region);\r\n\t\t setDate(date);\r\n\t\t setTimeFrom(from);\r\n\t\t setTimeUntil(until);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t clickParkingTab();\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t clickSearch();\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t clickLaunchReservation(prakingResv);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t setTimePrepareFromReservationPanel(prepTime);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t setTimeCleanupFromReservationPanel(cleanupTime);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t setResponsible(responsible);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t clickSummaryTab();\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t String getSummaryText = getItemDetailsFromReservationSummary(prakingResv);\r\n\t\t softAssert.assertTrue( getSummaryText.contains(\"1 h x 4.00 EUR\"),\"Total cost is calculated without considering Prepare/Cleanup time\");\r\n\t\t softAssert.assertTrue(getSummaryTitle().contains(\"4.04 EUR\"),\"summary title is ok before adding additional Equipment, Vehicles & Parking\");\r\n\t}", "public void testGetReturnCode() {\n System.out.println(\"getReturnCode\");\n Wizard instance = new Wizard();\n int expResult = 0;\n int result = instance.getReturnCode();\n assertEquals(expResult, result);\n }", "@Test\n public void testSaveGame(){\n assertEquals(d_gameEngine.saveGame(d_gameData, \"testGame\"), true);\n }", "@Test\n @DisplayName(\"Action Marker Production Green And Buy Test\")\n public void ActionMarkerProductionGreenAndBuyTest() throws IOException, InterruptedException {\n ActionMarkerProductionGreen actionMarker = new ActionMarkerProductionGreen();\n Server server= new Server();\n ClientHandler clientHandler= new ClientHandler(server);\n ClientController clientController= new ClientController(server,clientHandler) ;\n VirtualView virtualView = new VirtualView(clientController);\n\n GameSolitaire game = new GameSolitaire(\"Ali\",true,clientController);\n\n assertEquals(4, game.productionDeckSize(3));\n assertEquals(4, game.productionDeckSize(4));\n assertEquals(4, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(2, game.productionDeckSize(3));\n assertEquals(4, game.productionDeckSize(4));\n assertEquals(4, game.productionDeckSize(5));\n\n try {\n game.deckFromDeckNumber(9).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(1, game.productionDeckSize(3));\n assertEquals(4, game.productionDeckSize(4));\n assertEquals(4, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(3, game.productionDeckSize(4));\n assertEquals(4, game.productionDeckSize(5));\n\n try {\n game.deckFromDeckNumber(1).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(3, game.productionDeckSize(4));\n assertEquals(3, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(1, game.productionDeckSize(4));\n assertEquals(3, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(0, game.productionDeckSize(4));\n assertEquals(2, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(0, game.productionDeckSize(4));\n assertEquals(0, game.productionDeckSize(5));\n\n FileClass.FileDestroyer();\n\n }", "@Test\n public void loadAllTasksFromRepositoryAndLoadIntoView() {\n mPlaylistPresenter.setFiltering(PlaylistFilterType.ALL_TASKS);\n mPlaylistPresenter.loadTasks(true);\n\n // Callback is captured and invoked with stubbed tasks\n verify(mSongsRepository).getSongs(mLoadTasksCallbackCaptor.capture());\n mLoadTasksCallbackCaptor.getValue().onSongsLoaded(TASKS);\n\n // Then progress indicator is shown\n InOrder inOrder = inOrder(mTasksView);\n inOrder.verify(mTasksView).setLoadingIndicator(true);\n // Then progress indicator is hidden and all tasks are shown in UI\n inOrder.verify(mTasksView).setLoadingIndicator(false);\n ArgumentCaptor<List> showTasksArgumentCaptor = ArgumentCaptor.forClass(List.class);\n verify(mTasksView).showTasks(showTasksArgumentCaptor.capture());\n assertTrue(showTasksArgumentCaptor.getValue().size() == 3);\n }", "@Test\n public void testLogicStep_1()\n throws Exception {\n LogicStep result = new LogicStep();\n assertNotNull(result);\n }", "@Test\n public void autocreateLesson() throws Exception{\n\n }", "@Test\n\tpublic void testIrParaCarrinho_InformacoesPersistidas() {\n\t\ttestIncluirProdutoNoCarrinho_ProdutoIncluidoComSucesso();\n\t\tcarrinhoPage = modalProdutoPage.clicarBotaoProceedToCheckout();\n\t\t\t\n\t\tassertEquals(esperado_nomeDoProduto, carrinhoPage.obter_nomeDoProduto());\n\t\tassertEquals(esperado_precoDoProduto, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_precoDoProduto()));\n\t\tassertEquals(esperado_tamanhoDoProduto, carrinhoPage.obter_tamanhoDoProduto());\n\t\tassertEquals(esperado_corDoProduto, carrinhoPage.obter_corDoProduto());\n\t\tassertEquals(esperado_inputQuantidadeDoProduto, Integer.parseInt(carrinhoPage.obter_inputQuantidadeDoProduto()));\n\t\tassertEquals(esperado_subTotalDoProduto, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_subTotalDoProduto()));\n\t\t\n\t\tassertEquals(esperado_numeroItensTotal, Funcoes.removeTextoItemsDevolveInt(carrinhoPage.obter_numeroItensTotal()));\n\t\tassertEquals(esperado_subtotalTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_subtotalTotal()));\n\t\tassertEquals(esperado_shippingTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_shippingTotal()));\n\t\tassertEquals(esperado_totalTaxExclTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_totalTaxExclTotal()));\n\t\tassertEquals(esperado_totalTaxInclTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_totalTaxInclTotal()));\n\t\tassertEquals(esperado_taxesTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_taxesTotal()));\n\t\t\n\t}", "@Test\n @DisplayName(\"Action Marker Production Yellow And Buy Test\")\n public void ActionMarkerProductionYellowAndBuyTest() throws IOException, InterruptedException {\n ActionMarkerProductionYellow actionMarker = new ActionMarkerProductionYellow();\n Server server= new Server();\n ClientHandler clientHandler= new ClientHandler(server);\n ClientController clientController= new ClientController(server,clientHandler) ;\n VirtualView virtualView = new VirtualView(clientController);\n\n GameSolitaire game = new GameSolitaire(\"Ali\",true,clientController);\n\n assertEquals(4, game.productionDeckSize(9));\n assertEquals(4, game.productionDeckSize(10));\n assertEquals(4, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(2, game.productionDeckSize(9));\n assertEquals(4, game.productionDeckSize(10));\n assertEquals(4, game.productionDeckSize(11));\n\n try {\n game.deckFromDeckNumber(11).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(1, game.productionDeckSize(9));\n assertEquals(4, game.productionDeckSize(10));\n assertEquals(4, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(3, game.productionDeckSize(10));\n assertEquals(4, game.productionDeckSize(11));\n\n try {\n game.deckFromDeckNumber(3).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(3, game.productionDeckSize(10));\n assertEquals(3, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(1, game.productionDeckSize(10));\n assertEquals(3, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(0, game.productionDeckSize(10));\n assertEquals(2, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(0, game.productionDeckSize(10));\n assertEquals(0, game.productionDeckSize(11));\n\n FileClass.FileDestroyer();\n\n }", "@Test\r\n public void testTotalNumberOfQuestion() {\r\n Application.loadQuestions();\r\n assertEquals(Application.allQuestions.size(), 2126);\r\n }", "public void testSaveNewPuzzleLevel()\n {\n window.comboBox(\"levelTypeSelector\").selectItem(\"Puzzle\");\n\n window.radioButton(\"activeTileButton\").click();\n window.panel(\"square0\").click();\n window.button(\"saveButton\").click();\n ClassLoader classLoader = getClass().getClassLoader();\n File folder = null;\n try\n {\n folder = new File(classLoader.getResource(\"levels\").toURI().getPath());\n } catch (URISyntaxException e)\n {\n e.printStackTrace();\n }\n File[] listOfFiles = folder.listFiles();\n\n Arrays.sort(listOfFiles, new Comparator<File>() {\n public int compare(File f1, File f2) {\n try {\n int i1 = Integer.parseInt(f1.getName().replace(\"level\", \"\").replace(\".txt\", \"\"));\n int i2 = Integer.parseInt(f2.getName().replace(\"level\", \"\").replace(\".txt\", \"\"));\n return i1 - i2;\n } catch (NumberFormatException e) {\n throw new AssertionError(e);\n }\n }\n });\n\n assertTrue(listOfFiles[listOfFiles.length - 1].getPath().contains(\"level\" +\n listOfFiles.length +\".txt\"));\n\n String content = null;\n Scanner scanner = null;\n try\n {\n scanner = new Scanner(listOfFiles[listOfFiles.length - 1]);\n content = scanner.useDelimiter(\"\\\\Z\").next();\n scanner.close();\n } catch (FileNotFoundException e)\n {\n e.printStackTrace();\n }\n String correctContent = \"NewLevel Puzzle 1 0 10 50 0 20 30 20 15 10 5 70 20 \" +\n \"10 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\" +\n \" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\" +\n \" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \";\n assertEquals(correctContent, content);\n }", "@Test(dataProvider = \"testData\")\r\n\r\n public void createVacancyTest(String CVOption, String jobVisibility) throws InterruptedException {\r\n //STEP 1\r\n homePage.getSideBar().clickOnJobsMenu();\r\n Assert.assertTrue(jobsPage.isDisplayed());\r\n\r\n //STEP 2\r\n jobsPage.addNewJob();\r\n Assert.assertTrue(newJobPage.isDisplayed());\r\n Assert.assertTrue(newJobPage.getDetails().isDisplayed());\r\n\r\n //STEP 3\r\n newJobPage.getDetails().enterJobTitle(jobTitle);\r\n\r\n //STEP 4\r\n newJobPage.getDetails().enterJobLocation(randomCountry());\r\n Assert.assertTrue(newJobPage.getSearchSuggestion().isDisplayed());\r\n newJobPage.getSearchSuggestion().clickSuggestionByIndex();\r\n\r\n //STEP 5\r\n newJobPage.getDetails().enterSomeNote(randomText());\r\n\r\n //STEP 6\r\n newJobPage.getDetails().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getApplication().isDisplayed());\r\n\r\n //STEP 7\r\n newJobPage.getApplication().clickOnCVOption();\r\n Assert.assertTrue(newJobPage.getOptions().isDisplayed());\r\n newJobPage.getOptions().clickOnOption(CVOption);\r\n Assert.assertTrue(newJobPage.getApplication().isUpdateMessageDisplayed());\r\n\r\n //STEP 8\r\n newJobPage.getApplication().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getTeam().isDisplayed());\r\n\r\n //STEP 9\r\n newJobPage.getTeam().inviteTeamMember(email);\r\n Assert.assertTrue(newJobPage.getInvitedEmail().isDisplayed());\r\n Assert.assertEquals(newJobPage.getInvitedEmail().invitedEmailAddress(), email, \"the emails are not matching\");\r\n\r\n //STEP 10\r\n newJobPage.getTeam().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getEvaluation().isDisplayed());\r\n\r\n //STEP 11\r\n int skillCount = newJobPage.getEvaluation().getSkillCount();\r\n newJobPage.getEvaluation().addSomeSkill(randomSkill());\r\n int newSkillCount = newJobPage.getEvaluation().getSkillCount();\r\n Assert.assertTrue(newSkillCount > skillCount);\r\n\r\n //STEP 12\r\n newJobPage.getEvaluation().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getWorkflow().isDisplayed());\r\n\r\n //STEP 13\r\n newJobPage.getWorkflow().enterPipelineStage(stage);\r\n\r\n //STEP 14\r\n newJobPage.getWorkflow().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getOptional().isDisplayed());\r\n Assert.assertTrue(newJobPage.getInternalJobInformation().isDisplayed());\r\n Assert.assertTrue(newJobPage.getSalaryInfromation().isDisplayed());\r\n\r\n //STEP 15\r\n newJobPage.getInternalJobInformation().enterInternalJobInformation(internalJobTitle, id + \"\");\r\n\r\n //STEP 16\r\n newJobPage.getSalaryInfromation().enterSalaryInformation(minSalary + \"\", maxSalary + \"\", currency, minHour + \"\", maxHour + \"\");\r\n\r\n //STEP 17\r\n newJobPage.getOptional().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getPublish().isDisplayed());\r\n\r\n //STEP 18\r\n newJobPage.getPublish().chooseVisibility(jobVisibility);\r\n Assert.assertTrue(newJobPage.getPublish().updateMessageDisplayed());\r\n\r\n //STEP 19\r\n newJobPage.getPublish().clickOnSaveButton();\r\n Assert.assertTrue(newJobPage.getCreatedJobPage().isDisplayed());\r\n\r\n //EXPECTED RESULT\r\n Assert.assertEquals(newJobPage.getCreatedJobPage().getJobTitle(), internalJobTitle);\r\n Assert.assertEquals(newJobPage.getCreatedJobPage().getCreatedJobStatus(), jobVisibility);\r\n Assert.assertNotEquals(newJobPage.getCreatedJobPage().getJobInfo(), \"Remote\");\r\n }", "@Test\n public void testSetPercentComplete_1()\n throws Exception {\n ScriptProgressContainer fixture = new ScriptProgressContainer(1, \"\");\n int percentComplete = 1;\n\n fixture.setPercentComplete(percentComplete);\n\n }", "@Test\r\n public void testCompleteTask() throws Exception {\r\n System.out.println(\"completeTask\");\r\n QueueTaskDTO task = null;\r\n QueueDAOImpl instance = new QueueDAOImpl();\r\n QueueTaskDTO expResult = null;\r\n QueueTaskDTO result = instance.completeTask(task);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Test(dataProvider=\"getData\")\n\tpublic void BVisibility_AddButton(String tst, int i) throws IOException, InterruptedException\n\t{\n\t\tlog.info(\"Test for - \"+tst);\n\t\tLoginPage lip=new LoginPage(driver);\n\t\tlip.getUsername().clear();\n\t\tlip.getUsername().sendKeys(prop.getProperty(\"username\"));\n\t\tlip.getPassword().clear();\n\t\tlip.getPassword().sendKeys(prop.getProperty(\"password\"));\n\t\tThread.sleep(2000);\n\t\tlip.getSubmit().click();\n\t\tThread.sleep(2000);\n\t\tif (lip.getSessionOut().isDisplayed()) {\n\t\t\tlip.getSessionOut().click();\n\t }\n\t\tlog.info(\"Login successfully\");\n\t\t\n\t\tThread.sleep(5000);\n\t\t\n\t\tLandingPage LP=new LandingPage(driver);\n\t\t\n\t\tlog.info(\"enter dashboard page\");\n\t\tif(i==1) {\n\t\tLP.getDepartment().click();\n\t\tThread.sleep(3000);\n\t\tdepartmentPage dp=new departmentPage(driver);\n\t\tif(dp.getAdd().isDisplayed()){\n\t\t\tlog.info(\"Department add button is not displaying\");\n\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t}\n\t\telse {\n\t\t\tlog.info(\"Testcase failed- Department add button is visible\");\n\t\t\t\n\t\t}\n\t\t}\n\t\telse if(i==2) {\n\t\t\tLP.getProjects().click();\n\t\t\tThread.sleep(3000);\n\t\t\tProjectPage pp=new ProjectPage(driver);\n\t\t\tif(pp.getAdd().isDisplayed()){\n\t\t\t\tlog.info(\"Project add button is not displaying\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Testcase failed- Project add button is visible\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(i==3) {\n\t\t\tLP.getFields().click();\n\t\t\tThread.sleep(3000);\n\t\t\tFieldPage fp=new FieldPage(driver);\n\t\t\tif(fp.getAdd().isDisplayed()){\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- Field add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Field add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(i==4) {\n\t\t\tLP.getFilter().click();\n\t\t\tThread.sleep(3000);\n\t\t\tFilterPage fp=new FilterPage(driver);\n\t\t\tif(fp.getAdd().isDisplayed()){\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- Filter add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Filter add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(i==5) {\n\t\t\tLP.getViews().click();\n\t\t\tThread.sleep(3000);\n\t\t\tlog.info(\"Enter view page\");\n\t\t\tViewPage vp=new ViewPage(driver);\n\t\t\tif(vp.getAdd().isDisplayed()){\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- view add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"View add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tLP.getRoles().click();\n\t\t\tlog.info(\"Enter login page\");\n\t\t\tThread.sleep(3000);\n\t\t\tRolePage rp=new RolePage(driver);\n\t\t\tif(rp.getAdd().isDisplayed()) {\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- Role add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Role add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic Integer call() throws Exception {\n\t\t\t\ttry {\r\n\t\t\t\t\t// 获取参数的求解\r\n\t\t\t\t\tList<Route> routeList = markov.getRouteList();\r\n\r\n\t\t\t\t\tconstraintNameString.clear();\r\n\t\t\t\t\tpros.clear();\r\n\t\t\t\t\tnumbers.clear();\r\n\t\t\t\t\tfor (Route route : routeList) {\r\n\t\t\t\t\t\tconstraintNameString.add(route.getTcSequence());\r\n\t\t\t\t\t\tpros.add(route.getRouteProbability());\r\n\t\t\t\t\t\tnumbers.add(route.getNumber());\r\n\t\t\t\t\t\tactualPercentsDoubles.add(route.getActualPercent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tStepThreeTabelPanel stepThreeTabelPanel = new StepThreeTabelPanel(constraintNameString,\r\n\t\t\t\t\t\t\tactualPercentsDoubles, pros, numbers);\r\n\t\t\t\t\tStepThreeTabelPanel testRoute = new StepThreeTabelPanel(constraintNameString, actualPercentsDoubles,\r\n\t\t\t\t\t\t\tpros, numbers);\r\n\r\n\t\t\t\t\tList<TCDetail> lists = DataBaseUtil.showTCDetailAll(\"select * from tcdetail\");\r\n\r\n\t\t\t\t\tmainFrame.getStepThreeTimeTabbedPane().getTestData().removeAll();\r\n\r\n\t\t\t\t\tCasePagePanel casePagePanel = new CasePagePanel(lists, mainFrame);\r\n\t\t\t\t\tmainFrame.getStepThreeNoTimeTabbedPane().getTestData().add(casePagePanel);\r\n\r\n\r\n\t\t\t\t\tJPanel TestDataPanel = new JPanel();\r\n\r\n\t\t\t\t\tint index = 0;\r\n\t\t\t\t\tif (lists.size() < 500) {\r\n\t\t\t\t\t\tindex = lists.size();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tindex = 500;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcasePagePanel.getCasePanel().add(new JPanel(),\r\n\t\t\t\t\t\t\tnew GBC(0, index).setFill(GBC.BOTH).setWeight(1, 1));\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int j = 0; j < index; j++) {\r\n\t\t\t\t\t\tStepThreeTabelPanel testTabelPanel = new StepThreeTabelPanel(lists.get(j).getTestCase(), 2,\r\n\t\t\t\t\t\t\t\tmainFrame);\r\n\t\t\t\t\t\tcasePagePanel.getCasePanel().add(testTabelPanel,\r\n\t\t\t\t\t\t\t\tnew GBC(0, j).setFill(GBC.BOTH).setWeight(1, 0));\r\n\t\t\t\t\t\tcasePagePanel.getCasePanel().repaint();\r\n\t\t\t\t\t\tmainFrame.getStepThreeNoTimeTabbedPane().getTestData().repaint();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tprogressBar.setValue(60 + (int) (((double) (j+1) / index) * 40));\r\n\r\n\t\t\t\t\t\tThread.sleep(10);\r\n\t\t\t\t\t\tmainFrame.renewPanel();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcasePagePanel.getPageTestField().setText(\"1\");\r\n\r\n\t\t\t\t\tmainFrame.getStepThreeNoTimeTabbedPane().getTestData().removeAll();\r\n\t mainFrame.getStepThreeNoTimeTabbedPane().getTestData().add(casePagePanel);\r\n\t mainFrame.renewPanel();\r\n\t \r\n//\t\t\t\t\tfor (Route route : routeList) {\r\n//\t\t\t\t\t\tmainFrame.getOutputinformation().geTextArea()\r\n//\t\t\t\t\t\t\t\t.append(\"\t\t\t测试序列:\" + testSequence + \"\t 路径概率(指标-可靠性可靠性测试数据生成比率\"\r\n//\t\t\t\t\t\t\t\t\t\t+ route.getActualPercent() + \"): \" + route.getRouteProbability() + \"\t此类用例包含\"\r\n//\t\t\t\t\t\t\t\t\t\t+ route.getNumber() + \"个\" + \"\\n\");\r\n//\r\n//\t\t\t\t\t\tint length = DisplayForm.mainFrame.getOutputinformation().geTextArea().getText().length();\r\n//\t\t\t\t\t\tDisplayForm.mainFrame.getOutputinformation().geTextArea().setCaretPosition(length);\r\n//\t\t\t\t\t\tThread.sleep(10);\r\n//\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbigDecimal = new BigDecimal(markov.getDeviation());\r\n\t\t\t\t\tString ii = bigDecimal.toPlainString();\r\n\t\t\t\t\tdouble d = Double.valueOf(ii);\r\n\t\t\t\t\t\r\n\t\t\t\t\ttopLabel.removeAll();\r\n\t\t\t\t\ttopLabel.setText(\"可靠性测试数据生成完成, 实际共生成\" + lists.size() + \"条!\" + \"可靠性测试用例数据库覆盖率:\"\r\n\t\t\t\t\t\t\t+ df.format(markov.getDbCoverage()) + \" 可靠性测试用例生成比率与使用模型实际使用概率平均偏差:\" + df.format(markov.getDeviation()));\r\n//\t\t\t\t\ttopLabel.setText(\"可靠性测试数据生成完成,共生成8379条,耗时36s!\" + \"Discriminant值:3.44EE-3\");\r\n\t\t\t\t\t\r\n\t mainFrame.getOutputinformation().geTextArea().append(\"指标:可靠性可靠性测试数据数据库覆盖率 = 覆盖的马尔可夫链路径/总的马尔可夫链路径\" + \"\\n\");\r\n\t\t\t\t\tint length = mainFrame.getOutputinformation().geTextArea().getText().length(); \r\n\t mainFrame.getOutputinformation().geTextArea().setCaretPosition(length);\r\n\t\t\t\t\t\r\n\t\t\t\t\tNoTimeTestCaseNode noTimeTestCaseLabel = new NoTimeTestCaseNode(ModelName + \"_自定义\", mainFrame);\r\n\t\t\t\t\tquota = \"可靠性测试数据生成完成, 实际共生成\" + lists.size() + \"条!\" + \"可靠性测试用例数据库覆盖率:\" + df.format(markov.getDbCoverage())\r\n\t\t\t\t\t\t\t+ \" 可靠性测试用例生成比率与使用模型实际使用概率平均偏差:\" + df.format(d);\r\n\t\t\t\t\tnoTimeTestCaseLabel.setQuota(quota);\r\n\t\t\t\t\tnoTimeTestCaseLabel.setTestRoute(testRoute);\r\n\t\t\t\t\tnoTimeTestCaseLabel.setCasePagePanel(casePagePanel);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeCaseNodePanel()\r\n\t\t\t\t\t\t\t.insertCustomNodeLabel(noTimeTestCaseLabel, casePagePanel, testRoute, quota);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//保存指标\r\n\t\t\t\t\tTarget target = new Target();\r\n\t\t\t\t\tdouble Deviationalue = Double.valueOf(df.format(markov.getDbCoverage()));\r\n\t\t\t\t\tdouble CoverageRate = Double.valueOf(df.format(d));\r\n\t\t\t\t\ttarget.setCoverageRate(Deviationalue);\r\n\t\t\t\t\ttarget.setDeviationalue(CoverageRate);\r\n\t\t\t\t\tHibernateUtils hibernateUtils = RandomCase.hibernateUtils;\r\n\t\t\t\t\thibernateUtils.saveTCDetail(target);\r\n\r\n\t\t\t\t\tbutton.setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getChoosePatternLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeModelLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeSeq().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeBottom().Enable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tmainFrame.renewPanel();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\ttopLabel.removeAll();\r\n\t\t\t\t\ttopLabel.setText(\"生成可靠性测试数据出错!\");\r\n\r\n\t\t\t\t\tbutton.setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getChoosePatternLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeModelLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeSeq().setEnabled(true);\r\n\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getChoosePatternLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeBottom().Enable();\r\n\t\t\t\t\tmainFrame.renewPanel();\r\n\t\t\t\t}\r\n\t\t\t\treturn 1;\r\n\t\t\t}", "public void runTests() throws Exception {\n\t\tArrayList<KaidaComposer> als = getCrossOverPermutationTest();\r\n//\t\tArrayList<KaidaComposer> als = getMutationProbabilityTests();\r\n\t\t\r\n\t\tsynchronized (results) {\r\n\t\t\tresults.clear();\r\n\t\t\tfor (KaidaComposer al : als) {\r\n\t\t\t\tresults.add(new TestRunGenerationStatistics(nrOfContests,nrOfGenerations,al.getLabel(),al));\t\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tsetProgress(0f);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tfor (int runs = 0; runs < nrOfContests; runs++) {\r\n\t\t\t//run the test n times\r\n\t\t\t\r\n\t\t\t\tSystem.out.println(\"\\nContest Nr. \" + runs + \" started\");\r\n\t\t\t\tTimer t = new Timer(\"Contest Nr. \" + runs);\r\n\t\t\t\tt.start();\r\n\t\t\t\t\r\n\t\t\t\tfor (KaidaComposer algorithm : als) {\r\n\t\t\t\t\talgorithm.restartOrTakeOver();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfor (int g = 0; g < nrOfGenerations; g++) {\r\n\t\t\t\t\t//do one evolution step\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (KaidaComposer algorithm : als) {\r\n\t\t\t\t\t\tif (algorithm.isCycleCompleted()) {\r\n\t\t\t\t\t\t\talgorithm.startNextCycle();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\talgorithm.doOneEvolutionCycle();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tt.stopAndPrint();\r\n\t\t\t\tt.start(\"Adding to results\");\r\n\t\t\t\tsynchronized (results) {\r\n\t\t\t\t\tfor (int z=0; z < als.size(); z++) {\r\n\t\t\t\t\t\tresults.get(z).addTestRun(als.get(z).getGenerations().getRange(0,nrOfGenerations));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tt.stopAndPrint();\r\n\t\t\t\tt.start(\"Calculating statistics\");\r\n\t\t\t\tsynchronized (results) {\r\n\t\t\t\t\tfor (int z=0; z < als.size(); z++) {\r\n\t\t\t\t\t\tresults.get(z).calculateStats();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tt.stopAndPrint();\r\n\t\t\t\t\r\n\t\t\t\tsetProgress((double)runs/(double)(nrOfContests-1));\r\n\t\t\t\t\r\n\t\t\t\tif (pause!=0) {\r\n\t\t\t\t\tsleep(pause);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (isPleasePause()) break;\r\n\t\t\t}\r\n\t\t\tsynchronized (results) {\r\n\t\t\t\tfor (int z=0; z < als.size(); z++) { //als.size()\r\n\t\t\t\t\tresults.get(z).calculateStats();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetProgress(1.0f);\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t//fail(\"al threw some Exception\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\t\r\n\t}", "@Test\n public void testSmallSize(){\n assertEquals(9, smallMaze.size());\n }", "@Before\n public void setUp() {\n this.scoreBoard = new ScoreBoard();\n\n\n // Add some record with complexity 3\n DataManager.INSTANCE.setCurrentUserName(\"@u1\");\n DataManager.INSTANCE.setCurrentGameName(\"CM\");\n DataManager.INSTANCE.startNewGame(5);\n DataManager.INSTANCE.setCurrentGameName(\"ST\");\n DataManager.INSTANCE.setBoardManager(new BoardManager(3));\n DataManager.INSTANCE.getBoardManager().addScoreBy(1);\n this.scoreBoard.addNewRecords(new Record());\n\n this.scoreBoard.addNewRecords(new Record(3, 10, \"@u2\", \"ST\"));\n this.scoreBoard.addNewRecords(new Record(3, 25, \"@u3\", \"ST\"));\n this.scoreBoard.addNewRecords(new Record(4, 5, \"@u1\", \"ST\"));\n this.scoreBoard.addNewRecords(new Record(3, 15, \"@u3\", \"ST\"));\n }", "@Test\n public void solve1() {\n }", "@Test\r\n\tpublic void testSanity() {\n\t}", "@Test\n public void testGameProcess() {\n // set test player data\n mTournament.setPlayerCollection(getTestPlayersData());\n\n int roundNumber = mTournament.calculateRoundsNumber(mTournament.getPlayersCount());\n for (int i = 0; i < roundNumber; ++i) {\n Round round = mTournament.createNewRound();\n assertTrue(\"State of new round must be CREATED\", round.getState() == State.CREATED);\n\n // tests can't create new round because not all rounds are completed\n Round falseRound = mTournament.createNewRound();\n assertEquals(\"Instance must be null\", null, falseRound);\n\n round.startRound();\n assertTrue(\"State of starting round must be RUNNING\", round.getState() == State.RUNNING);\n\n randomiseResults(round.getMatches());\n round.endRound();\n assertTrue(\"State of ending round must be COMPLETED\", round.getState() == State.COMPLETED);\n\n // tests that ended round can't be started again\n round.startRound();\n assertTrue(\"State of ended round must be COMPLETED\", round.getState() == State.COMPLETED);\n }\n // tests can't create one more round because game is over at this point\n Round round = mTournament.createNewRound();\n assertEquals(\"Instance must be null\", null, round);\n\n }", "@Test\n public void z_topDown_TC02() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n }", "public void testGetObj() {\n System.out.println(\"getObj\");\n int modo= 0;\n ObjectTempSwapWizard instance = new ObjectTempSwapWizard(modo);\n Object expResult = null;\n Object result = instance.getObj();\n assertEquals(expResult, result);\n }", "@Test\n public void loadCompletedTasksFromRepositoryAndLoadIntoView() {\n mPlaylistPresenter.setFiltering(PlaylistFilterType.COMPLETED_TASKS);\n mPlaylistPresenter.loadTasks(true);\n\n // Callback is captured and invoked with stubbed tasks\n verify(mSongsRepository).getSongs(mLoadTasksCallbackCaptor.capture());\n mLoadTasksCallbackCaptor.getValue().onSongsLoaded(TASKS);\n\n // Then progress indicator is hidden and completed tasks are shown in UI\n verify(mTasksView).setLoadingIndicator(false);\n ArgumentCaptor<List> showTasksArgumentCaptor = ArgumentCaptor.forClass(List.class);\n verify(mTasksView).showTasks(showTasksArgumentCaptor.capture());\n assertTrue(showTasksArgumentCaptor.getValue().size() == 2);\n }", "@Test\r\n public void testGetPasses() {\r\n System.out.println(\"getPasses\");\r\n Course c = null;\r\n Student instance = new Student();\r\n int expResult = 0;\r\n int result = instance.getPasses(c);\r\n assertEquals(expResult, result);\r\n \r\n }", "@Test\n public void shouldIncrementAndThenReleaseScorePlayerOne() {\n int expected = 0 ;\n scoreService.incrementScorePlayerOne() ;\n scoreService.incrementScorePlayerOne() ;\n scoreService.releaseScores() ;\n int scorePlayerOne = scoreService.getScorePlayerOne() ;\n assertThat(scorePlayerOne, is(expected)) ;\n }", "@Test\n public void saveSearch_withExecutedSearch(){\n fillSearchFields();\n int accountID = new AccountDAO().findAccount(\"[email protected]\").getId();\n int savedSearchesSize = new AccountDAO().findAccount(accountID).getStoredSearches().size();\n\n presenter.doSearch();\n presenter.saveSearch();\n Assert.assertEquals(savedSearchesSize + 1, new AccountDAO().findAccount(accountID).getStoredSearches().size());\n }", "@Test\n public void shouldCurrentGameBeZeroWhenStartingGame() {\n\n int expResult = 0 ;\n int result = scoreService.getCurrentGame() ;\n assertThat(expResult, is(result) ) ;\n }", "@Test(timeout = 4000)\n public void test100() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"c5!DqhIQ,!L'eP\", \"0dj!E;iRV]\", (Content) null, 0, 0, \"0dj!E;iRV]\");\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment(0, homeTexture0, 0, 0, 0);\n int int0 = homeEnvironment0.getLightColor();\n assertEquals(0, homeEnvironment0.getSkyColor());\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals(0.0F, homeEnvironment0.getWallsAlpha(), 0.01F);\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals(0, int0);\n assertEquals(0, homeEnvironment0.getGroundColor());\n assertEquals(240, homeEnvironment0.getVideoHeight());\n }", "@Test\n public void testAddprof_curso() {\n System.out.println(\"addprof_curso\");\n int codprof = 0;\n int codcurso = 0;\n cursoDAO instance = new cursoDAO();\n boolean expResult = false;\n boolean result = instance.addprof_curso(codprof, codcurso);\n assertEquals(expResult, result);\n \n }", "@Test\n public void continueProgressionAfterSwitchingActivity() throws Throwable {\n final int progress = 24;\n expandPanel();\n onView(withId(R.id.mpi_seek_bar)).perform(ViewActions.slideSeekBar(progress));\n\n Utils.openDrawer(getActivityTestRule());\n clickAdapterViewItem(2, R.id.navigation_drawer); //select movie activity\n\n waitForPanelState(BottomSheetBehavior.STATE_COLLAPSED);\n expandPanel();\n\n onView(isRoot()).perform(ViewActions.waitForView(R.id.mpi_seek_bar, new ViewActions.CheckStatus() {\n @Override\n public boolean check(View v) {\n int seekBarProgress = ((SeekBar) v).getProgress();\n return (seekBarProgress > progress) && (seekBarProgress < (progress + 4));\n }\n }, 10000));\n }" ]
[ "0.6967138", "0.6762316", "0.656981", "0.6412508", "0.62956107", "0.6201085", "0.61662453", "0.61285454", "0.6083066", "0.6035027", "0.6019076", "0.6014069", "0.59826493", "0.5981074", "0.5912356", "0.5910173", "0.5898013", "0.58951277", "0.5881884", "0.5881575", "0.5808985", "0.5803605", "0.57824206", "0.57674056", "0.57592154", "0.5753473", "0.5750954", "0.5735227", "0.5693229", "0.5682765", "0.567928", "0.56707096", "0.56671125", "0.5664573", "0.56623864", "0.56524426", "0.5650243", "0.56460154", "0.56453633", "0.5626849", "0.56236154", "0.56229866", "0.5621438", "0.561122", "0.5602323", "0.5601863", "0.5599737", "0.5595005", "0.55949104", "0.558691", "0.5577665", "0.5573452", "0.55674857", "0.5567164", "0.5566674", "0.5565667", "0.5562853", "0.55591494", "0.55567384", "0.55547255", "0.5550504", "0.5546067", "0.5543413", "0.55432975", "0.55421567", "0.55362225", "0.55350584", "0.5534266", "0.5531778", "0.5530083", "0.5525286", "0.55240935", "0.55234706", "0.5520253", "0.5519669", "0.5514055", "0.55068576", "0.5506635", "0.54963773", "0.54944813", "0.5490617", "0.5488047", "0.5485648", "0.54833966", "0.54806066", "0.5479307", "0.5468121", "0.54665196", "0.54625833", "0.54605955", "0.5459883", "0.5458569", "0.5455005", "0.54471105", "0.5446692", "0.5443285", "0.54425776", "0.54392755", "0.54361725", "0.5434377" ]
0.64454246
3
ctrl.setPuzzleDao(puzzleDao); ctrl.setHelperGenerator(helperGen); loadPage(); generatePuzzle(1, "evil"); Progress progress = ctrl.getProgress(); assertEquals(1, progress.getEvil()); assertEquals(5, progress.getStoredEvil());
@Test public void testEvilPuzzleGeneration() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testTotalPuzzleGenerated() {\n\t}", "@Test\n public void testIsSolved() {\n setUpCorrect();\n assertTrue(boardManager.puzzleSolved());\n swapFirstTwoTiles();\n assertFalse(boardManager.puzzleSolved());\n }", "@Test\n public void testGetProgressOfQuestionnaireById(){\n Date dateKey = new Date();\n String userName = \"Regina for president\";\n\n\n User user = new User(userName);\n userDB.insertUser(user);\n\n //add questionnaires\n HADSDQuestionnaire q1 = new HADSDQuestionnaire(userName);\n q1.setCreationDate_PK(dateKey);\n q1.setLastQuestionEditedNr(4);\n q1.setProgressInPercent(99);\n new HADSDQuestionnaireManager(context).insertQuestionnaire(q1);\n\n DistressThermometerQuestionnaire q2 = new DistressThermometerQuestionnaire(userName);\n q2.setCreationDate_PK(dateKey);\n q2.setLastQuestionEditedNr(2);\n q2.setProgressInPercent(77);\n new DistressThermometerQuestionnaireManager(context).insertQuestionnaire(q2);\n\n QolQuestionnaire q3 = new QolQuestionnaire(userName);\n q3.setCreationDate_PK(dateKey);\n q3.setLastQuestionEditedNr(0);\n q3.setProgressInPercent(33);\n new QualityOfLifeManager(context).insertQuestionnaire(q3);\n\n // get selected questionnaire\n user = userDB.getUserByName(userName);\n\n int hadsProgress = new HADSDQuestionnaireManager(context).getHADSDQuestionnaireByDate_PK(user.getName(), dateKey).getProgressInPercent();\n int distressProgress = new DistressThermometerQuestionnaireManager(context).getDistressThermometerQuestionnaireByDate(user.getName(), dateKey).getProgressInPercent();\n int qualityProgress = new QualityOfLifeManager(context).getQolQuestionnaireByDate(user.getName(), dateKey).getProgressInPercent();\n\n assertEquals(99, hadsProgress);\n assertEquals(77, distressProgress);\n assertEquals(33, qualityProgress);\n }", "@Test\n\tpublic void testNormalPuzzleGeneration() {\n\t}", "@Test\n\tpublic void testHardPuzzleGeneration() {\n\t}", "public void testGame1EmulateIncorrectAnswers() {\n int[] indicators;\n MainPage mainPage = getMainPage();\n GameObjectImpl game1 = mainPage.gameOpen(1);\n game1.waitIndicatorsLoad();\n indicators = game1.getIndicators();\n int qtyTasksBeforeCycle = indicators[3];\n int tasksFailedBeforeCycle = indicators[1];\n for(int iter = 0; iter < qtyTasksBeforeCycle - 1; iter++) {\n game1.waitTaskBegin();\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n indicators = game1.getIndicators();\n int varTasksPassedBegin = indicators[0];\n int varTasksFailedBegin = indicators[1];\n int varTasksRemainBegin = indicators[2];\n int qtyTasksInLoopBegin = indicators[3];\n\n String[] partsOfTask = game1.getPartsOfTask();\n String firstNumberVar = partsOfTask[0];\n String secondNumberVar = partsOfTask[1];\n String operationVar = partsOfTask[2];\n int actualResult = game1.getResultWithKeys(firstNumberVar, secondNumberVar, operationVar);\n // press wrong button\n String strActualResult = Integer.toString(actualResult + 1);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n //press correct button\n strActualResult = Integer.toString(actualResult);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n indicators = game1.getIndicators();\n int varTasksPassedEnd = indicators[0];\n int varTasksFailedEnd = indicators[1];\n int varTasksRemainEnd = indicators[2];\n int qtyTasksInLoopEnd = indicators[3];\n\n assert varTasksRemainEnd == varTasksRemainBegin : \"positiveTestCorrectAnswers: tasks remain\";//\n assert varTasksFailedEnd == (varTasksFailedBegin + 1) : \"positiveTestCorrectAnswers: tasks failed\";\n assert varTasksPassedEnd == varTasksPassedBegin : \"positiveTestCorrectAnswers: tasks passed\";\n assert qtyTasksInLoopEnd == qtyTasksInLoopBegin + 1 : \"negativeTestWrongAnswers: tasks all\";\n }\n indicators = game1.getIndicators();\n int varTasksFailedAfterCycle = indicators[1];\n int qtyTasksAfterCycle = indicators[3];\n assert varTasksFailedAfterCycle - tasksFailedBeforeCycle == qtyTasksAfterCycle - qtyTasksBeforeCycle\n : \"positiveTestCorrectAnswers: tasks summ\" ;//\n game1.clickCloseGame();\n\n }", "@Test\n void displayIncompleteTasks() {\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 testGetPercentComplete_1()\n throws Exception {\n ScriptProgressContainer fixture = new ScriptProgressContainer(1, \"\");\n\n int result = fixture.getPercentComplete();\n\n assertEquals(1, result);\n }", "@Test\n void displayCompletedTasks() {\n }", "@Test\n public void testDAM30901001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30901001Click();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n todoListPage.selectCompleteStatRadio();\n\n todoListPage = todoListPage.ifElementUsageSearch();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n\n // 1 and 3 todos are incomplete. hence not displayed\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000003\");\n assertThat(isTodoPresent, is(false));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(false));\n // 10 todo is complete. hence displayed.\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(true));\n\n // default value of finished is now false.hence todos like 1,3 will be displayed\n // where as todo like 10 will not be displayed.\n todoListPage.selectInCompleteStatRadio();\n todoListPage = todoListPage.ifElementUsageSearch();\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000003\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(true));\n // 10 todo is complete. hence displayed.\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(false));\n\n // scenario when finished property of criteria is null.\n\n }", "@Test\n public void testPercentages(){\n assertTrue(Results.percentages());\n }", "@Test\r\n public void testIsSolved() {\r\n assertTrue(boardManager4.puzzleSolved());\r\n boardManager4.getBoard().swapTiles(0,0,0,1);\r\n assertFalse(boardManager4.puzzleSolved());\r\n }", "@Test\n public void setProgression() {\n final int progress = 16;\n final String progressText = \"0:16\";\n expandPanel();\n onView(withId(R.id.play)).perform(click()); //Pause playback\n\n onView(withId(R.id.mpi_seek_bar)).perform(ViewActions.slideSeekBar(progress));\n\n onView(withId(R.id.mpi_progress)).check(matches(withText(progressText)));\n assertTrue(getPlayerHandler().getTimeElapsed() == progress);\n }", "@Test\n public void z_topDown_TC03() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n\n Statistica statistica = appService.getStatistica();\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"Literatura\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"Literatura\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"M\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"M\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"A\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"A\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"B\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"B\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"C\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"C\")==1);\n\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n } catch (NotAbleToCreateStatisticsException e) {\n assertTrue(false);\n }\n }", "@Test\n public final void testInitialSpinners() {\n int standardrows = 5;\n int standardcolumns = 5;\n assertEquals(standardrows, spysizedialog.getRows());\n assertEquals(standardcolumns, spysizedialog.getColumns());\n}", "@Test\n public void testScriptProgressContainer_2()\n throws Exception {\n int percentComplete = 1;\n String errorMessage = \"\";\n\n ScriptProgressContainer result = new ScriptProgressContainer(percentComplete, errorMessage);\n\n assertNotNull(result);\n assertEquals(\"\", result.getErrorMessage());\n assertEquals(1, result.getPercentComplete());\n }", "@Test\n\tpublic void completeHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfCompleteHires() == 2);\n\t}", "@Test(description = \"Verify that task is created and visual editor is visible\")\n public void verifyIfHighPriority() {\n\n LoginPage loginPage = new LoginPage();\n TaskPage taskPage = new TaskPage();\n loginPage.login(\"[email protected]\", \"UserUser\");\n\n test = report.createTest(\"Task tab is visible!\");\n Assert.assertEquals(taskPage.taskTab(\"Demo Meeting!\"), \"TASK\");\n test.pass(\"Task tab is visible\");\n\n\n test = report.createTest(\"High Priority checkbox is clicked\");\n Assert.assertEquals(taskPage.highPriorityLabel(), \"High Priority\");\n taskPage.highPriorityCheckBox();\n test.pass(\"High Priority checkbox visible and clickable\");\n\n\n test = report.createTest(\"Visual editor is visible and the bar is displayed\");\n taskPage.visualEditor();\n taskPage.visualEditorBarIsDisplayed();\n Assert.assertTrue(taskPage.visualEditorBarIsDisplayed());\n test.pass(\"Visual editor is clicked and the bar is displayed\");\n\n }", "@Test\n public void testScriptProgressContainer_1()\n throws Exception {\n\n ScriptProgressContainer result = new ScriptProgressContainer();\n\n assertNotNull(result);\n assertEquals(null, result.getErrorMessage());\n assertEquals(0, result.getPercentComplete());\n }", "@Test(priority = 3)\n public void checkCourseProgress() {\n \twait.until(ExpectedConditions.titleContains(\"Email Marketing Strategies\"));\n \t\n \t//Assert Course progress\n \tString courseProgress = driver.findElement(By.xpath(\"//div[contains(@class, 'ld-progress-percentage')]\")).getText();\n \tAssert.assertEquals(courseProgress, \"100% COMPLETE\");\n }", "@Test\n void testInProgressTrue() {\n Mockito.when(level.isAnyPlayerAlive()).thenReturn(true);\n Mockito.when(level.remainingPellets()).thenReturn(1);\n\n game.start();\n game.start();\n\n Assertions.assertThat(game.isInProgress()).isTrue();\n Mockito.verify(level, Mockito.times(1)).addObserver(Mockito.eq(game));\n Mockito.verify(level, Mockito.times(1)).start();\n }", "@Test\n\tpublic void Cases_23275_execute() throws Exception {\n\t\tVoodooUtils.voodoo.log.info(\"Running \" + testName + \"...\");\n\n\t\t// Go to Active tasks dashlet\n\t\t// TODO: VOOD-960 - Dashlet selection \n\t\tnew VoodooControl(\"span\", \"css\", \".row-fluid > li div span a span\").click();\n\t\tnew VoodooControl(\"a\", \"css\", \"[data-dashletaction='createRecord']\").click();\n\t\tsugar().tasks.createDrawer.getEditField(\"subject\").set(testName);\n\t\tsugar().tasks.createDrawer.save();\n\t\tif(sugar().alerts.getSuccess().queryVisible()) {\n\t\t\tsugar().alerts.getSuccess().closeAlert();\n\t\t}\n\n\t\t// refresh the Dashlet\n\t\tnew VoodooControl(\"a\", \"css\", \".dashboard-pane ul > li > ul > li .btn-group [title='Configure']\").click();\n\t\tnew VoodooControl(\"a\", \"css\", \"li > div li div [data-dashletaction='refreshClicked']\").click();\n\t\tVoodooUtils.waitForReady();\n\n\t\t// Verify task is in Active-Task Dashlet (i.e in TODO tab, if we have no related date for that record)\n\t\tnew VoodooControl(\"div\", \"css\", \"div[data-voodoo-name='active-tasks'] .dashlet-unordered-list .dashlet-tabs-row div.dashlet-tab:nth-of-type(3)\").click();\n\t\tnew VoodooControl(\"div\", \"css\", \"div.tab-pane.active p a:nth-of-type(2)\").assertEquals(testName, true);\n\n\t\tVoodooUtils.voodoo.log.info(testName + \" complete.\");\n\t}", "@Test(enabled = true, retryAnalyzer=RetryAnalyzer.class)\r\n\tpublic void testParkingBookingPreparationTimeAndCleanupNotConsidered() throws IOException{\r\n\t\tReporter.log(\"<span style='font-weight:bold;color:#000033'> \"\r\n\t\t\t\t+ \"C118064: Preparation and Cleanup time should not be considered while calculating Total Cost in Parking reservation\", true);\r\n\r\n\t\t int random = (int)(Math.random() * 10)+24;\r\n\t\t String date = this.getFutureDate(random);\r\n\t\t String region = \"1preRgRef\";\r\n\t\t String from = \"18:00\";\r\n\t\t String until = \"19:00\";\r\n\t\t String prakingResv = \"prePrkDefRef\";\r\n\t\t String prepTime = \"00:30\";\r\n\t\t String cleanupTime = \"00:30\";\r\n\t\t String responsible=getUserLastNameOfLoggedInUser();\r\n\r\n\t\t SoftAssert softAssert = new SoftAssert();\r\n\t\t softAssert.setMethodName(\"testParkingBookingPreparationTimeAndCleanupNotConsidered\");\r\n\t\t \r\n\t\t expandAdministration();\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t expandSubMainMenu(\"Reservation\");\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t waitAndClick(XPATH_NEWRESERVATIONS);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t //C118064\r\n\t\t setRegion(region);\r\n\t\t setDate(date);\r\n\t\t setTimeFrom(from);\r\n\t\t setTimeUntil(until);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t clickParkingTab();\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t clickSearch();\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t clickLaunchReservation(prakingResv);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t setTimePrepareFromReservationPanel(prepTime);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t setTimeCleanupFromReservationPanel(cleanupTime);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t setResponsible(responsible);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t clickSummaryTab();\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t String getSummaryText = getItemDetailsFromReservationSummary(prakingResv);\r\n\t\t softAssert.assertTrue( getSummaryText.contains(\"1 h x 4.00 EUR\"),\"Total cost is calculated without considering Prepare/Cleanup time\");\r\n\t\t softAssert.assertTrue(getSummaryTitle().contains(\"4.04 EUR\"),\"summary title is ok before adding additional Equipment, Vehicles & Parking\");\r\n\t}", "@Test\n public void updatePage() {\n }", "@Test(dataProvider = \"testData\")\r\n\r\n public void createVacancyTest(String CVOption, String jobVisibility) throws InterruptedException {\r\n //STEP 1\r\n homePage.getSideBar().clickOnJobsMenu();\r\n Assert.assertTrue(jobsPage.isDisplayed());\r\n\r\n //STEP 2\r\n jobsPage.addNewJob();\r\n Assert.assertTrue(newJobPage.isDisplayed());\r\n Assert.assertTrue(newJobPage.getDetails().isDisplayed());\r\n\r\n //STEP 3\r\n newJobPage.getDetails().enterJobTitle(jobTitle);\r\n\r\n //STEP 4\r\n newJobPage.getDetails().enterJobLocation(randomCountry());\r\n Assert.assertTrue(newJobPage.getSearchSuggestion().isDisplayed());\r\n newJobPage.getSearchSuggestion().clickSuggestionByIndex();\r\n\r\n //STEP 5\r\n newJobPage.getDetails().enterSomeNote(randomText());\r\n\r\n //STEP 6\r\n newJobPage.getDetails().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getApplication().isDisplayed());\r\n\r\n //STEP 7\r\n newJobPage.getApplication().clickOnCVOption();\r\n Assert.assertTrue(newJobPage.getOptions().isDisplayed());\r\n newJobPage.getOptions().clickOnOption(CVOption);\r\n Assert.assertTrue(newJobPage.getApplication().isUpdateMessageDisplayed());\r\n\r\n //STEP 8\r\n newJobPage.getApplication().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getTeam().isDisplayed());\r\n\r\n //STEP 9\r\n newJobPage.getTeam().inviteTeamMember(email);\r\n Assert.assertTrue(newJobPage.getInvitedEmail().isDisplayed());\r\n Assert.assertEquals(newJobPage.getInvitedEmail().invitedEmailAddress(), email, \"the emails are not matching\");\r\n\r\n //STEP 10\r\n newJobPage.getTeam().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getEvaluation().isDisplayed());\r\n\r\n //STEP 11\r\n int skillCount = newJobPage.getEvaluation().getSkillCount();\r\n newJobPage.getEvaluation().addSomeSkill(randomSkill());\r\n int newSkillCount = newJobPage.getEvaluation().getSkillCount();\r\n Assert.assertTrue(newSkillCount > skillCount);\r\n\r\n //STEP 12\r\n newJobPage.getEvaluation().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getWorkflow().isDisplayed());\r\n\r\n //STEP 13\r\n newJobPage.getWorkflow().enterPipelineStage(stage);\r\n\r\n //STEP 14\r\n newJobPage.getWorkflow().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getOptional().isDisplayed());\r\n Assert.assertTrue(newJobPage.getInternalJobInformation().isDisplayed());\r\n Assert.assertTrue(newJobPage.getSalaryInfromation().isDisplayed());\r\n\r\n //STEP 15\r\n newJobPage.getInternalJobInformation().enterInternalJobInformation(internalJobTitle, id + \"\");\r\n\r\n //STEP 16\r\n newJobPage.getSalaryInfromation().enterSalaryInformation(minSalary + \"\", maxSalary + \"\", currency, minHour + \"\", maxHour + \"\");\r\n\r\n //STEP 17\r\n newJobPage.getOptional().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getPublish().isDisplayed());\r\n\r\n //STEP 18\r\n newJobPage.getPublish().chooseVisibility(jobVisibility);\r\n Assert.assertTrue(newJobPage.getPublish().updateMessageDisplayed());\r\n\r\n //STEP 19\r\n newJobPage.getPublish().clickOnSaveButton();\r\n Assert.assertTrue(newJobPage.getCreatedJobPage().isDisplayed());\r\n\r\n //EXPECTED RESULT\r\n Assert.assertEquals(newJobPage.getCreatedJobPage().getJobTitle(), internalJobTitle);\r\n Assert.assertEquals(newJobPage.getCreatedJobPage().getCreatedJobStatus(), jobVisibility);\r\n Assert.assertNotEquals(newJobPage.getCreatedJobPage().getJobInfo(), \"Remote\");\r\n }", "@Test\n public void testNextWaiting() {\n }", "@Test\n public void mainFlowTest() {\n type.insert();\n engineer.insert();\n\n Equipment equipment1 = new Equipment(\"equipment1\", type.getId(), model, location, installTime1);\n Equipment equipment2 = new Equipment(\"equipment2\", type.getId(), model, location, installTime2);\n equipment1.insert();\n equipment2.insert();\n\n Plan plan1 = new Plan(\"plan1\", type.getId(), 30, \"large\", \"checking\");\n Plan plan2 = new Plan(\"plan2\", type.getId(), 60, \"small\", \"repairing\");\n plan1.insert();\n plan2.insert();\n\n Record record1 = new Record(\"r1\", plan1.getId(), equipment1.getId(), engineer.getId(),\n DateUtils.getCalendar(2015, 11, 1).getTime(), 2, \"换过滤网\");\n Record record2 = new Record(\"r2\", plan2.getId(), equipment1.getId(), engineer.getId(),\n DateUtils.getCalendar(2015, 11, 31).getTime(), 1, \"发动机清理\");\n Record record3 = new Record(\"r3\", plan1.getId(), equipment2.getId(), engineer.getId(),\n DateUtils.getCalendar(2015, 11, 5).getTime(), 3, \"cleaning\");\n Record record4 = new Record(\"r4\", plan2.getId(), equipment2.getId(), engineer.getId(),\n DateUtils.getCalendar(2016, 0, 4).getTime(), 2, \"tiny repairing\");\n record1.insert();\n record2.insert();\n record3.insert();\n record4.insert();\n\n // test the correctness of 10 days tasks\n List<Task> tenDayTasks = MaintenanceOperation.getTenDaysTask(DateUtils.getCalendar(2015, 11, 30).getTime());\n assertEquals(\"wrong with 10 days' tasks\", 2, tenDayTasks.size());\n\n // test the total maintenance time\n int time1 = MaintenanceOperation.getTotalMaintenanceTime(equipment1.getId());\n assertEquals(\"wrong with total time of equipment 1\", 3, time1);\n int time2 = MaintenanceOperation.getTotalMaintenanceTime(equipment2.getId());\n assertEquals(\"wrong with total time of equipment 2\", 5, time2);\n\n // test the total maintenance time of certain type\n int time3 = MaintenanceOperation.getTotalMaintenanceTime(equipment1, plan1.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 2, time3);\n int time4 = MaintenanceOperation.getTotalMaintenanceTime(equipment1, plan2.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 1, time4);\n int time5 = MaintenanceOperation.getTotalMaintenanceTime(equipment2, plan1.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 3, time5);\n int time6 = MaintenanceOperation.getTotalMaintenanceTime(equipment2, plan2.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 2, time6);\n }", "@Test\r\n void testTitForTatWithHistoryDefect() {\r\n TitForTat testStrat = new TitForTat();\r\n AlwaysDefect testStrat2 = new AlwaysDefect();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 2, payoffs);\r\n game.playGame();\r\n int points = testStrat.getPoints();\r\n assertEquals(points, 1, \"tit for tat not returning \"\r\n + \"correctly against defecting opponent\"); \r\n }", "@Test(timeout = 4000)\n public void test011() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n errorPage0.placeholder(\"h4\");\n assertEquals(\"wheel_ErrorPage\", errorPage0.getComponentId());\n }", "@Test\n public void testModuloExpectedUse() {\n MainPanel mp = new MainPanel();\n ProgramArea pa = new ProgramArea();\n ProgramStack ps = new ProgramStack();\n\n ps.push(10);\n ps.push(3);\n\n ProgramExecutor pe = new ProgramExecutor(mp, ps, pa);\n\n pe.modulo();\n\n Assert.assertEquals(1, ps.pop());\n }", "@Test(enabled = true, retryAnalyzer=RetryAnalyzer.class)\r\n\tpublic void testParkingResrvSummeryAndPrintTabs(){\r\n\r\n\t\tReporter.log(\"<span style='font-weight:bold;color:#000033'> \"\r\n\r\n\t\t +\"test:C74386: Summary and Printing are not available, if required field is not filled out for parking Reservation\", true);\r\n\r\n\r\n\t\tString region = \"1preRgRef\";\r\n\r\n\t\tint random = (int)(Math.random() * 10)+18;\r\n\r\n\t\tString date = this.getFutureDate(random);\r\n\r\n\t\tString from = \"01:00\";\r\n\t\tString until = \"01:30\";\r\n\r\n\t\tString parking = \"1prePrkEqRef\";\r\n\t\t String summaryTabText= \"A summary is not available for the currently entered data\\n\"\r\n\t\t\t\t +\"\\n\"+\r\n\t\t\t\t \"Please fill in the Reservation Responsible.\\n\"+\r\n\t\t\t\t \"\\n\"+\"Please make sure you have filled out all mandatory fields.\";\r\n\t\t \r\n\r\n\t\tString printIconWarningMsg =\"Printing requires all changes to be saved first\";\r\n\r\n\t\tSoftAssert softAssert = new SoftAssert();\r\n\r\n\t\tsoftAssert.setMethodName(\"testParkingResrvSummeryAndPrintTabs\");\r\n\r\n\t\texpandAdministration();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\texpandSubMainMenu(\"Reservation\");\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\twaitAndClick(XPATH_NEWRESERVATIONS);\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\t//waitForExtJSAjaxComplete(20);\r\n\r\n\t\tsetRegion(region);\r\n\r\n\t\tsetDate(date);\r\n\r\n\t\tsetTimeFrom(from);\r\n\r\n\t\tsetTimeUntil(until);\r\n\r\n\t\twaitForExtJSAjaxComplete(5);\r\n\r\n\t\tclickParkingTab();\r\n\r\n\t\twaitForExtJSAjaxComplete(5);\r\n\r\n\t\tclickSearch();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tclickLaunchReservation(parking);\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tclickSummaryTab();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tsoftAssert.assertEquals(getSummaryTabText(),summaryTabText,\"'A summary is not available for the currently entered data' is display with a message to fill out required fields.\");\r\n\r\n\t\tclickReportIconInSummarySection();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tsoftAssert.assertTrue(verifyWarningDialogTextMessage(printIconWarningMsg),\"'Printing requires all changes to be saved first' alert message is displayed.\");\r\n\r\n\t\tthis.clickOnDialogButton(\"OK\");\r\n\r\n\t\tsoftAssert.assertAll();\r\n\r\n\t\tReporter.log(\"Summary pane is display with a message to fill out required fields.\"\r\n\t\t\t\t+ \"Alert message is displayed for print icon <br>\", true);\r\n\t}", "@Test\n public void runNewGameTest() {\n\tassertNotEquals(-1,score);\n }", "@Test\r\n public void testPartido3() throws Exception {\r\n P3.fijarEquipos(\"Barça\",\"Depor\"); \r\n P3.comenzar(); \r\n P3.tantoVisitante();\r\n P3.terminar(); \r\n assertEquals(\"Depor\",P3.ganador());\r\n }", "void testDrawBoard(Tester t) {\r\n initData();\r\n\r\n //testing draw board on a world\r\n t.checkExpect(this.game2.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(1) + \"/\"\r\n + Integer.toString(100), Cnst.textHeight, Color.BLACK),\r\n this.game2.indexHelp(0,0).drawBoard(2)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n t.checkExpect(this.game3.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(1) + \"/\"\r\n + Integer.toString(10), Cnst.textHeight, Color.BLACK),\r\n this.game3.indexHelp(0,0).drawBoard(3)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n t.checkExpect(this.game5.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(5) + \"/\"\r\n + Integer.toString(5), Cnst.textHeight, Color.BLACK),\r\n this.game5.indexHelp(0,0).drawBoard(4)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n //testing draw board on a visible cell\r\n t.checkExpect(this.game2.indexHelp(0, 0).drawBoard(2),\r\n new AboveImage(this.game2.indexHelp(0, 0).drawRow(2),\r\n this.game2.indexHelp(0, 0).bottom.drawBoard(2)));\r\n\r\n t.checkExpect(this.game3.indexHelp(0, 0).drawBoard(3),\r\n new AboveImage(this.game3.indexHelp(0, 0).drawRow(3),\r\n this.game3.indexHelp(0, 0).bottom.drawBoard(3)));\r\n\r\n t.checkExpect(this.game5.indexHelp(0, 0).drawBoard(4),\r\n new AboveImage(this.game5.indexHelp(0, 0).drawRow(4),\r\n this.game5.indexHelp(0, 0).bottom.drawBoard(4)));\r\n\r\n //testing it on an end cell\r\n t.checkExpect(this.game2.indexHelp(-1, 1).drawBoard(2), new EmptyImage());\r\n }", "@Test\n public void assertSanity() throws InterruptedException {\n int count = 1_000_000;\n\n AtomicInteger npes = new AtomicInteger(0);\n AtomicInteger insanities = new AtomicInteger(0);\n ExecutorService executorService = Executors.newFixedThreadPool(2);\n\n for (int i = 0; i < count; i++) {\n StuffIntoPublic stuffIntoPublic = new StuffIntoPublic();\n CountDownLatch startLatch = new CountDownLatch(1);\n\n executorService.submit(() -> {\n try {\n startLatch.await();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n stuffIntoPublic.initialize();\n });\n executorService.submit(() -> {\n try {\n startLatch.await();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n try{\n stuffIntoPublic.holder.assertSanity();\n } catch (NullPointerException npe) {\n npes.incrementAndGet();\n } catch (AssertionError e) {\n insanities.incrementAndGet();\n }\n });\n\n startLatch.countDown();\n }\n\n executorService.shutdown();\n executorService.awaitTermination(10, TimeUnit.SECONDS);\n\n System.out.printf(\"npes: %d, insanities: %d\", npes.get(), insanities.get());\n }", "@Test\n\tpublic void testPowerUpView_8()\n\t\tthrows Exception {\n\t\tGameObject gameObject = new Tile(new Point());\n\t\tGfxFactory gfxFactory = new GfxFactory();\n\n\t\tPowerUpView result = new PowerUpView(gameObject, gfxFactory);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.LogManager\n\t\t// at org.apache.log4j.Logger.getLogger(Logger.java:116)\n\t\t// at client.view.GfxFactory.<init>(GfxFactory.java:45)\n\t\tassertNotNull(result);\n\t}", "public void testExecute() {\n panel.execute();\n }", "@Test\n void invalidCREATED() {\n // when not started, nothing can be done.\n getGame().move(getPlayer(), Direction.EAST);\n assertThat(getGame().isInProgress()).isFalse();\n verifyNoMoreInteractions(observer);\n }", "@Test\n @DisplayName(\"Action Marker Production Yellow And Buy Test\")\n public void ActionMarkerProductionYellowAndBuyTest() throws IOException, InterruptedException {\n ActionMarkerProductionYellow actionMarker = new ActionMarkerProductionYellow();\n Server server= new Server();\n ClientHandler clientHandler= new ClientHandler(server);\n ClientController clientController= new ClientController(server,clientHandler) ;\n VirtualView virtualView = new VirtualView(clientController);\n\n GameSolitaire game = new GameSolitaire(\"Ali\",true,clientController);\n\n assertEquals(4, game.productionDeckSize(9));\n assertEquals(4, game.productionDeckSize(10));\n assertEquals(4, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(2, game.productionDeckSize(9));\n assertEquals(4, game.productionDeckSize(10));\n assertEquals(4, game.productionDeckSize(11));\n\n try {\n game.deckFromDeckNumber(11).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(1, game.productionDeckSize(9));\n assertEquals(4, game.productionDeckSize(10));\n assertEquals(4, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(3, game.productionDeckSize(10));\n assertEquals(4, game.productionDeckSize(11));\n\n try {\n game.deckFromDeckNumber(3).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(3, game.productionDeckSize(10));\n assertEquals(3, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(1, game.productionDeckSize(10));\n assertEquals(3, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(0, game.productionDeckSize(10));\n assertEquals(2, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(0, game.productionDeckSize(10));\n assertEquals(0, game.productionDeckSize(11));\n\n FileClass.FileDestroyer();\n\n }", "@Test\n public void loadAllTasksFromRepositoryAndLoadIntoView() {\n mPlaylistPresenter.setFiltering(PlaylistFilterType.ALL_TASKS);\n mPlaylistPresenter.loadTasks(true);\n\n // Callback is captured and invoked with stubbed tasks\n verify(mSongsRepository).getSongs(mLoadTasksCallbackCaptor.capture());\n mLoadTasksCallbackCaptor.getValue().onSongsLoaded(TASKS);\n\n // Then progress indicator is shown\n InOrder inOrder = inOrder(mTasksView);\n inOrder.verify(mTasksView).setLoadingIndicator(true);\n // Then progress indicator is hidden and all tasks are shown in UI\n inOrder.verify(mTasksView).setLoadingIndicator(false);\n ArgumentCaptor<List> showTasksArgumentCaptor = ArgumentCaptor.forClass(List.class);\n verify(mTasksView).showTasks(showTasksArgumentCaptor.capture());\n assertTrue(showTasksArgumentCaptor.getValue().size() == 3);\n }", "@Test\n public void testDAM30801001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30801001Click();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n TodoUpdatePage todoUpdatePage = todoListPage.updateTodo(\"0000000003\");\n\n todoListPage = todoUpdatePage.deleteByUsingTodoObj();\n\n // Confirmation of total cou nt after a record is deleted.\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"6\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"9\"));\n\n // confirm that the todo is deleted.\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000003\");\n assertThat(isTodoPresent, is(false));\n\n }", "@Test\n\tpublic void test() {\n\t\t// CHECKSTYPE:OFF\n\n\t\t// Test the addPlayer(Player player) method\n\t\tPlayer player1 = new Player(\"Iris\");\n\t\tPlayer player2 = new Player(\"Emily\");\n\t\tPlayer player3 = new Player(\"Jason\");\n\t\tPlayer player4 = new Player(\"Rain\");\n\t\tPlayer player5 = new Player(\"Mandy\");\n\t\tscrabbleSystem.addPlayer(player1);\n\t\tscrabbleSystem.addPlayer(player2);\n\t\tscrabbleSystem.addPlayer(player3);\n\t\tscrabbleSystem.addPlayer(player4);\n\t\tscrabbleSystem.addPlayer(player5);\n\t\tList<Player> playersList = scrabbleSystem.getPlayers();\n\t\tassertEquals(4, playersList.size());\n\n\t\t// Test the startNewGame() method\n\t\t/**\n\t\t * The first Turn -- place some tiles on the board\n\t\t */\n\t\tscrabbleSystem.startNewGame();\n\t\tPlayer currentPlayer1 = scrabbleSystem.getCurrentPlayer();\n\t\tSystem.out.println(currentPlayer1.getName());\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tList<SpecialTile> specialStore = scrabbleSystem.getSpecialStore();\n\t\tassertEquals(5, specialStore.size());\n\t\tassertEquals(\"Boom\", specialStore.get(0).getName());\n\t\tassertEquals(\"NegativePoint\", specialStore.get(1).getName());\n\t\tassertEquals(\"RetrieveOrder\", specialStore.get(2).getName());\n\t\tassertEquals(\"ReverseOrder\", specialStore.get(3).getName());\n\t\tassertEquals(70, scrabbleSystem.getLetterBag().getNumber());\n\n\t\t// Test the playMove(Move move) method\n\t\tSquare square1 = scrabbleSystem.getBoard().getSquare(7, 7);\n\t\tSquare square2 = scrabbleSystem.getBoard().getSquare(8, 7);\n\t\tSquare square3 = scrabbleSystem.getBoard().getSquare(9, 7);\n\n\t\tTile tile1 = currentPlayer1.getTileList().get(0);\n\t\tTile tile2 = currentPlayer1.getTileList().get(1);\n\t\tTile tile3 = currentPlayer1.getTileList().get(2);\n\n\t\tint scoreSum1 = tile1.getValue() + tile2.getValue() + tile3.getValue();\n\t\t// The first Player\n\t\tMove move = scrabbleSystem.getMove();\n\t\tmove.addTile(square2, tile2);\n\t\tmove.addTile(square3, tile3);\n\n\t\tscrabbleSystem.playMove(move);\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tassertEquals(70, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tmove.addTile(square1, tile1);\n\t\tscrabbleSystem.playMove(move);\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(7, 7).isOccuppied());\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(8, 7).isOccuppied());\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(9, 7).isOccuppied());\n\t\tassertFalse(scrabbleSystem.getBoard().getSquare(10, 7).isOccuppied());\n\t\tassertFalse(scrabbleSystem.isGameOver());\n\t\t// check player's score\n\t\tassertEquals(scoreSum1, currentPlayer1.getScore());\n\n\t\tPlayer challengePlayer1 = playersList.get(0);\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tPlayer playerTmp = playersList.get(i);\n\t\t\tif (playerTmp != currentPlayer1) {\n\t\t\t\tchallengePlayer1 = playerTmp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// if there is no player invoke a challenge\n\t\tscrabbleSystem.updateOrder();\n\n\t\t/**\n\t\t * The secord turn -- place some tiles on the board and challenges by\n\t\t * another player\n\t\t */\n\t\tPlayer currentPlayer2 = scrabbleSystem.getCurrentPlayer();\n\t\tassertNotEquals(currentPlayer1, currentPlayer2);\n\t\tSystem.out.println(currentPlayer1.getName());\n\t\tSystem.out.println(currentPlayer2.getName());\n\n\t\tSquare square4 = scrabbleSystem.getBoard().getSquare(8, 6);\n\t\tSquare square5 = scrabbleSystem.getBoard().getSquare(8, 8);\n\t\tSquare square6 = scrabbleSystem.getBoard().getSquare(8, 9);\n\t\tSquare square7 = scrabbleSystem.getBoard().getSquare(7, 8);\n\n\t\tTile tile4 = currentPlayer2.getTileList().get(0);\n\t\tTile tile5 = currentPlayer2.getTileList().get(1);\n\t\tTile tile6 = currentPlayer2.getTileList().get(2);\n\n\t\tMove move2 = scrabbleSystem.getMove();\n\t\tassertEquals(0, move2.getTileMap().size());\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square5, tile5);\n\t\tmove2.addTile(square7, tile6);\n\t\t// check invalid move\n\t\tscrabbleSystem.playMove(move2);\n\n\t\t// check invalid move\n\t\tmove2.clearMove();\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square6, tile6);\n\t\tscrabbleSystem.playMove(move2);\n\n\t\t// make valid move\n\t\tmove2.clearMove();\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square5, tile5);\n\t\tmove2.addTile(square6, tile6);\n\t\tscrabbleSystem.playMove(move2);\n\n\t\tint scoreSum2 = tile2.getValue() + tile4.getValue() * 2 + tile5.getValue() * 2 + tile6.getValue();\n\t\tassertEquals(scoreSum2, currentPlayer2.getScore());\n\n\t\t// get the challenge player\n\t\tPlayer challengePlayer2 = playersList.get(0);\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tPlayer playerTmp = playersList.get(i);\n\t\t\tif (playerTmp != currentPlayer1) {\n\t\t\t\tchallengePlayer2 = playerTmp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tassertEquals(64, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tscrabbleSystem.challenge(challengePlayer2);\n\t\tscrabbleSystem.updateOrder();\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\t\tassertFalse(square4.isOccuppied());\n\t\tassertFalse(square5.isOccuppied());\n\t\tassertFalse(square6.isOccuppied());\n\n\t\t/**\n\t\t * The third turn -- buy a Boom special tile and pass this turn\n\t\t */\n\n\t\tPlayer currentPlayer3 = scrabbleSystem.getCurrentPlayer();\n\t\tMove move3 = scrabbleSystem.getMove();\n\t\tcurrentPlayer3.addScore(100);\n\t\tscrabbleSystem.buySpecialTile(\"Boom\");\n\t\tassertEquals(80, currentPlayer3.getScore());\n\n\t\tSquare square8 = scrabbleSystem.getBoard().getSquare(8, 8);\n\t\tSquare square9 = scrabbleSystem.getBoard().getSquare(9, 8);\n\t\tSquare square10 = scrabbleSystem.getBoard().getSquare(10, 8);\n\t\tSquare square11 = scrabbleSystem.getBoard().getSquare(10, 7);\n\n\t\tTile tile8 = currentPlayer3.getTileList().get(0);\n\t\tTile tile9 = currentPlayer3.getTileList().get(1);\n\t\tTile tile10 = currentPlayer3.getTileList().get(2);\n\t\tSpecialTile specialTile = currentPlayer3.getSpecialTiles().get(\"Boom\").get(0);\n\t\tmove3.addTile(square8, tile8);\n\t\tmove3.addTile(square9, tile9);\n\t\tmove3.addTile(square10, tile10);\n\t\tmove3.addSpecialTile(specialTile, square11);\n\n\t\tint scoreSum3 = 2 * tile8.getValue() + tile9.getValue() + tile10.getValue() + 2 * tile8.getValue()\n\t\t\t\t+ tile2.getValue() + tile3.getValue() + tile9.getValue() + 80;\n\t\tscrabbleSystem.playMove(move3);\n\t\tassertEquals(scoreSum3, currentPlayer3.getScore());\n\t\tscrabbleSystem.challenge(currentPlayer2);\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\t\tassertTrue(square11.hasSpecialTile());\n\n\t\t/**\n\t\t * The fourth turn -- buy a NegativePoint special tile and place it on\n\t\t * the board\n\t\t */\n\t\tPlayer currentPlayer4 = scrabbleSystem.getCurrentPlayer();\n\t\tcurrentPlayer4.addScore(10);\n\t\tscrabbleSystem.buySpecialTile(\"NegativePoint\");\n\t\tassertEquals(1, currentPlayer4.getSpecialTiles().get(\"NegativePoint\").size());\n\n\t\tcurrentPlayer4.addScore(50);\n\t\tSystem.out.println(currentPlayer4.getScore());\n\t\tscrabbleSystem.buySpecialTile(\"NegativePoint\");\n\t\tint scoreSum4 = currentPlayer4.getScore();\n\n\t\tMove move4 = scrabbleSystem.getMove();\n\t\tSpecialTile specialTile2 = currentPlayer4.getSpecialTiles().get(\"NegativePoint\").get(0);\n\n\t\tSquare square12 = scrabbleSystem.getBoard().getSquare(11, 7);\n\t\tmove4.addSpecialTile(specialTile2, square12);\n\n\t\tscrabbleSystem.pass(move4);\n\t\tassertEquals(scoreSum4, currentPlayer4.getScore());\n\t\tassertTrue(square12.hasSpecialTile());\n\t\tassertEquals(1, currentPlayer4.getSpecialTiles().get(\"NegativePoint\").size());\n\n\t\t/**\n\t\t * The fifth turn -- invork the Boom and NegativePoint special tiles at\n\t\t * the same time\n\t\t */\n\t\tPlayer currentPlayer5 = scrabbleSystem.getCurrentPlayer();\n\t\tMove move5 = scrabbleSystem.getMove();\n\t\tSquare square13 = scrabbleSystem.getBoard().getSquare(10, 7);\n\t\tSquare square14 = scrabbleSystem.getBoard().getSquare(11, 7);\n\t\tSquare square15 = scrabbleSystem.getBoard().getSquare(12, 7);\n\t\tSquare square16 = scrabbleSystem.getBoard().getSquare(13, 7);\n\t\tSquare square17 = scrabbleSystem.getBoard().getSquare(14, 7);\n\n\t\tTile tile13 = currentPlayer5.getTileList().get(0);\n\t\tTile tile14 = currentPlayer5.getTileList().get(1);\n\t\tTile tile15 = currentPlayer5.getTileList().get(2);\n\t\tTile tile16 = currentPlayer5.getTileList().get(3);\n\t\tTile tile17 = currentPlayer5.getTileList().get(4);\n\n\t\tmove5.addTile(square13, tile13);\n\t\tmove5.addTile(square14, tile14);\n\t\tmove5.addTile(square15, tile15);\n\t\tmove5.addTile(square16, tile16);\n\t\tmove5.addTile(square17, tile17);\n\t\tscrabbleSystem.playMove(move5);\n\t\tassertFalse(square13.isOccuppied());\n\t\tassertFalse(square14.isOccuppied());\n\t\tassertFalse(square15.isOccuppied());\n\t\tassertFalse(square2.isOccuppied());\n\t\tassertFalse(square3.isOccuppied());\n\t\tassertTrue(square1.isOccuppied());\n\t\tscrabbleSystem.updateOrder();\n\n\t\tint scoreSum5 = scoreSum1 - 3 * (tile13.getValue() + tile14.getValue() + tile1.getValue());\n\t\tSystem.out.println(scoreSum5);\n\n\t\t/**\n\t\t * The sixth turn -- The player exchanges some tiles\n\t\t */\n\t\tPlayer currentPlayer6 = scrabbleSystem.getCurrentPlayer();\n\t\tList<Tile> tiles = new ArrayList<>();\n\t\tTile tile18 = currentPlayer6.getTileList().get(0);\n\t\tTile tile19 = currentPlayer6.getTileList().get(1);\n\t\tTile tile20 = currentPlayer6.getTileList().get(2);\n\t\ttiles.add(tile18);\n\t\ttiles.add(tile19);\n\t\ttiles.add(tile20);\n\t\tscrabbleSystem.exchangeTile(tiles);\n\t\tassertEquals(7, currentPlayer6.getTileList().size());\n\n\t\t/**\n\t\t * Get winner\n\t\t */\n\n\t\tList<Player> playersWinner = scrabbleSystem.getWinner();\n\t\tassertEquals(currentPlayer3.getName(), playersWinner.get(0).getName());\n\t}", "@Test\n public void progressionUpdaterStartedAfterPlay() {\n expandPanel();\n SeekBar seekBar = (SeekBar) getActivity().findViewById(R.id.mpi_seek_bar);\n final int progress = seekBar.getProgress();\n\n onView(isRoot()).perform(ViewActions.waitForView(\n R.id.mpi_seek_bar, new ViewActions.CheckStatus() {\n @Override\n public boolean check(View v) {\n return ((SeekBar) v).getProgress() > progress;\n }\n }, 10000));\n }", "@Test\n @DisplayName(\"Action Marker Production Green And Buy Test\")\n public void ActionMarkerProductionGreenAndBuyTest() throws IOException, InterruptedException {\n ActionMarkerProductionGreen actionMarker = new ActionMarkerProductionGreen();\n Server server= new Server();\n ClientHandler clientHandler= new ClientHandler(server);\n ClientController clientController= new ClientController(server,clientHandler) ;\n VirtualView virtualView = new VirtualView(clientController);\n\n GameSolitaire game = new GameSolitaire(\"Ali\",true,clientController);\n\n assertEquals(4, game.productionDeckSize(3));\n assertEquals(4, game.productionDeckSize(4));\n assertEquals(4, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(2, game.productionDeckSize(3));\n assertEquals(4, game.productionDeckSize(4));\n assertEquals(4, game.productionDeckSize(5));\n\n try {\n game.deckFromDeckNumber(9).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(1, game.productionDeckSize(3));\n assertEquals(4, game.productionDeckSize(4));\n assertEquals(4, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(3, game.productionDeckSize(4));\n assertEquals(4, game.productionDeckSize(5));\n\n try {\n game.deckFromDeckNumber(1).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(3, game.productionDeckSize(4));\n assertEquals(3, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(1, game.productionDeckSize(4));\n assertEquals(3, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(0, game.productionDeckSize(4));\n assertEquals(2, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(0, game.productionDeckSize(4));\n assertEquals(0, game.productionDeckSize(5));\n\n FileClass.FileDestroyer();\n\n }", "@Test\n\tpublic void testHintsLoading() {\n\t\tassertArrayEquals(p1.getPuzzleHints(), p2.getPuzzleHints());\n\t\tDatabase.deleteEntry(rowid);\t\t//delete database entry after testing\t\n\t}", "@Test\r\n\tpublic void testSanity() {\n\t}", "@Test(timeout = 4000)\n public void test007() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Component component0 = errorPage0.q();\n Component component1 = component0.span();\n assertEquals(\"wheel_ErrorPage\", errorPage0.getComponentId());\n assertEquals(\"Block_2\", component1.getComponentId());\n }", "@Test\n\tvoid fillDrawTest() {\n\t\tMainPlay.getPlayer1Discard().add(2); //Adding the elements to discarded pile and the draw pile does not contain any elements as of now\n\t\tMainPlay.getPlayer1Discard().add(4);\n\t\tMainPlay.getPlayer2Discard().add(1);\n\t\tMainPlay.getPlayer2Discard().add(2);\n\t\tMainPlay.playTurn(); // Calling the function where the process of filling draw pile happens\n\t\tSystem.out.println(\"The discarded pile of player1 after comparing: \"+MainPlay.getPlayer1Discard());\n\t\tassertEquals(MainPlay.getPlayer1Discard().size(),4,\"The test failed as the draw pile cannot be updated\");\n\t\t//After the playTurn function the the draw pile of player1 and player 2 gets loaded and the comparison happens and as we can see the player1 cards are hight valued \n\t\t// in both the turns hence his discarded pile should be having 4 elements in the end to pass the test\n\t}", "@Test\n void isComplete() {\n }", "@Test(timeout = 4000)\n public void test187() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n StandaloneComponent standaloneComponent0 = errorPage0.getPage();\n assertEquals(\"wheel_ErrorPage\", standaloneComponent0.getComponentId());\n }", "@Test\n public void testDAM30201001() {\n\n // データ初期化\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n // Connect to DB and fetch the Todo list\n TodoListPage todoListPage = dam3IndexPage.dam30201001Click();\n\n todoListPage = todoListPage.registerBulkTodo();\n\n // データ反映までの待ち時間\n webDriverOperations.waitForDisplayed(ExpectedConditions\n .textToBePresentInElementLocated(By.id(\"completedTodo\"),\n \"993\"));\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"993\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"1000\"));\n\n }", "@Test\n public void TEST_FR_SELECTDIFFICULTY_UI() {\n GameData.gameDifficulty = \"unchanged\";\n ChooseDifficultyUI testUI = new ChooseDifficultyUI();\n clickButton(testUI, 1, \"easy\");\n clickButton(testUI, 2, \"medium\");\n clickButton(testUI, 3, \"hard\");\n }", "@Test\n public void testDAM30504001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n TodoListPage todoListPage = dam3IndexPage.dam30504001Click();\n\n // Assert the todo record count from DB table\n // These count are computed from the list returned and not fetched using query.\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n // by default the radio button for incomplete todos is selected for retrievingits count.\n todoListPage = todoListPage.clickCountByStatusBtn();\n\n String todoCnt = todoListPage.getTodoCountwithStatus();\n\n // This count is fetched from db using count query : status in-complete.\n assertThat(todoCnt, equalTo(\"InComplete : 7\"));\n\n // Status selected as complete now\n todoListPage.selectCompleteStatRadio();\n\n todoListPage = todoListPage.clickCountByStatusBtn();\n todoCnt = todoListPage.getTodoCountwithStatus();\n\n // This count is fetched from db using count query : status complete.\n assertThat(todoCnt, equalTo(\"Completed : 3\"));\n\n }", "public static boolean testLoading() {\r\n Data instance = new Data();\r\n Pokemon[] list;\r\n try {\r\n instance.update();\r\n list = instance.getPokemonList();\r\n int cnt = 0;\r\n while (cnt < list.length && list[cnt] != null)\r\n cnt++;\r\n if (cnt != 799) {\r\n System.out.print(\"Pokemon num incorrect: \");\r\n System.out.println(cnt - 1);\r\n return false;\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n System.out.println(\"fall the test in exception\");\r\n return false;\r\n }\r\n\r\n for (int i = 0; i < 6; i++) {\r\n if (!pokemonEq(testList[i], list[indices[i]])) {\r\n System.out.print(\"fail the test in check element \");\r\n System.out.println(i);\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "@Test\n public void testDAM30601003() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30601003Click();\n\n TodoRegisterPage registerTodoPage = todoListPage.registerTodo();\n\n // input todo details\n registerTodoPage.setTodoId(\"0000000030\");\n registerTodoPage.setTodoCategory(\"CA2\");\n registerTodoPage.setTodoTitle(\"Todo 30\");\n\n TodoDetailsPage todoDetailsPage = registerTodoPage.addTodoAndRetInt();\n\n String booleanStr = todoDetailsPage.getRegistrationResult();\n\n assertThat(booleanStr, equalTo(\"1\"));\n\n // assert all the properties of fetched record.\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"Todo 30\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000030\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"In-Complete\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/28\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"0\"));\n\n // Now check for false return value\n webDriverOperations.displayPage(getPackageRootUrl());\n dam3IndexPage = new DAM3IndexPage(driver);\n\n todoListPage = dam3IndexPage.dam30601003Click();\n\n registerTodoPage = todoListPage.registerTodo();\n\n registerTodoPage.setTodoId(\"0000000030\");\n registerTodoPage.setTodoCategory(\"CA2\");\n registerTodoPage.setTodoTitle(\"Todo 30\");\n\n todoDetailsPage = registerTodoPage.addTodoAndRetInt();\n\n booleanStr = todoDetailsPage.getRegistrationResult();\n\n assertThat(booleanStr, equalTo(\"0\"));\n }", "@Test\n public void z_topDown_TC02() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n }", "@Test\n void cadastraEspecialidadeProfessorInvalido(){\n assertEquals(\"Campo email nao pode ser nulo ou vazio.\", verificaExcecao(() ->\n controllerPesquisador.cadastraEspecialidadeProfessor(\"\", \"Doutorado\", \"DSC\", \"01/01/2011\")));\n assertEquals(\"Campo formacao nao pode ser nulo ou vazio.\", verificaExcecao(() ->\n controllerPesquisador.cadastraEspecialidadeProfessor(\"email@email\", null, \"DSC\", \"01/01/2011\")));\n assertEquals(\"Campo unidade nao pode ser nulo ou vazio.\", verificaExcecao(() ->\n controllerPesquisador.cadastraEspecialidadeProfessor(\"email@email\", \"Doutorado\", \"\", \"01/01/2011\")));\n assertEquals(\"Campo data nao pode ser nulo ou vazio.\", verificaExcecao(() ->\n controllerPesquisador.cadastraEspecialidadeProfessor(\"email@email\", \"Doutorado\", \"DSC\", null)));\n assertEquals(\"Formato de email invalido.\", verificaExcecao(() ->\n controllerPesquisador.cadastraEspecialidadeProfessor(\"email@\", \"Doutorado\", \"DSC\", \"01/05/2015\")));\n assertEquals(\"Pesquisadora nao encontrada.\", verificaExcecao(() ->\n controllerPesquisador.cadastraEspecialidadeProfessor(\"email1@email\", \"Doutorado\", \"DSC\", \"01/05/2015\")));\n cadastraPesquisador();\n assertEquals(\"Pesquisador nao compativel com a especialidade.\",\n verificaExcecao(() -> controllerPesquisador.cadastraEspecialidadeProfessor(\"hunterxhunter@1998\",\"Doutorado\", \"DSC\", \"01/05/2015\")));\n assertEquals(\"Atributo data com formato invalido.\",\n verificaExcecao(() -> controllerPesquisador.cadastraEspecialidadeProfessor(\"breakingbad@2008\",\"Doutorado\", \"DSC\", \"01052015\")));\n assertEquals(\"Atributo data com formato invalido.\",\n verificaExcecao(() -> controllerPesquisador.cadastraEspecialidadeProfessor(\"breakingbad@2008\",\"Doutorado\", \"DSC\", \"2015/05/15\")));\n assertEquals(\"Atributo data com formato invalido.\",\n verificaExcecao(() -> controllerPesquisador.cadastraEspecialidadeProfessor(\"breakingbad@2008\",\"Doutorado\", \"DSC\", \"1/5/2015\")));\n }", "public static void internal_test() {\n\t\tTest.start(\"PetrinetIO\");\n\t\tPetrinet pn = PetrinetIO.loadXML(\"data/agv.xml\");\n\t\tTest.checkEquality(pn.numberOfPlaces(), 64, \"# of places loaded\");\n\t\tTest.checkEquality(pn.numberOfTransitions(), 53, \"# of transition loaded\");\n\n\t\t// XXX: we need more tests !\n\t\tTest.end();\n\t}", "@Test\r\n public void testPartido1() throws Exception {\r\n /* \r\n * En el estado EN_ESPERA\r\n */\r\n assertEquals( \"Ubicación: Camp Nou\" \r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido está en espera, aún no se han concretado los equipos\"\r\n , P1.datos());\r\n /* \r\n * En el estado NO_JUGADO\r\n */\r\n P1.fijarEquipos(\"Barça\",\"Depor\"); \r\n assertEquals( \"Ubicación: Camp Nou\"\r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido aún no se ha jugado\"\r\n + \"\\nEquipo local: Barça\"\r\n + \"\\nEquipo visitante: Depor\" \r\n , P1.datos()\r\n );\r\n /* \r\n * En el estado EN_JUEGO\r\n */\r\n P1.comenzar(); \r\n P1.tantoLocal();\r\n P1.tantoVisitante();\r\n assertEquals( \"Ubicación: Camp Nou\"\r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido está en juego\"\r\n + \"\\nEquipo local: Barça\"\r\n + \"\\nTantos locales: 1\"\r\n + \"\\nEquipo visitante: Depor\"\r\n + \"\\nTantos visitantes: 1\"\r\n , P1.datos()\r\n );\r\n /* \r\n * En el estado FINALIZADO\r\n */\r\n P1.terminar(); \r\n assertEquals( \"Ubicación: Camp Nou\"\r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido ha finalizado\"\r\n + \"\\nEquipo local: Barça\"\r\n + \"\\nTantos locales: 1\"\r\n + \"\\nEquipo visitante: Depor\"\r\n + \"\\nTantos visitantes: 1\"\r\n , P1.datos()\r\n );\r\n assertEquals(\"Empate\",P1.ganador());\r\n }", "@Test\n public void test13() { \n Board board13 = new Board();\n board13.put(1,1,1); \n board13.put(1,2,1);\n board13.put(1,3,2);\n board13.put(2,1,2);\n board13.put(2,2,2);\n board13.put(2,3,1);\n board13.put(3,1,1);\n board13.put(3,2,1);\n board13.put(3,3,2);\n assertTrue(board13.checkTie());\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Component component0 = errorPage0.i();\n assertTrue(component0._isGeneratedId());\n assertEquals(\"wheel_ErrorPage\", errorPage0.getComponentId());\n }", "public void runTests() throws Exception {\n\t\tArrayList<KaidaComposer> als = getCrossOverPermutationTest();\r\n//\t\tArrayList<KaidaComposer> als = getMutationProbabilityTests();\r\n\t\t\r\n\t\tsynchronized (results) {\r\n\t\t\tresults.clear();\r\n\t\t\tfor (KaidaComposer al : als) {\r\n\t\t\t\tresults.add(new TestRunGenerationStatistics(nrOfContests,nrOfGenerations,al.getLabel(),al));\t\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tsetProgress(0f);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tfor (int runs = 0; runs < nrOfContests; runs++) {\r\n\t\t\t//run the test n times\r\n\t\t\t\r\n\t\t\t\tSystem.out.println(\"\\nContest Nr. \" + runs + \" started\");\r\n\t\t\t\tTimer t = new Timer(\"Contest Nr. \" + runs);\r\n\t\t\t\tt.start();\r\n\t\t\t\t\r\n\t\t\t\tfor (KaidaComposer algorithm : als) {\r\n\t\t\t\t\talgorithm.restartOrTakeOver();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfor (int g = 0; g < nrOfGenerations; g++) {\r\n\t\t\t\t\t//do one evolution step\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (KaidaComposer algorithm : als) {\r\n\t\t\t\t\t\tif (algorithm.isCycleCompleted()) {\r\n\t\t\t\t\t\t\talgorithm.startNextCycle();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\talgorithm.doOneEvolutionCycle();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tt.stopAndPrint();\r\n\t\t\t\tt.start(\"Adding to results\");\r\n\t\t\t\tsynchronized (results) {\r\n\t\t\t\t\tfor (int z=0; z < als.size(); z++) {\r\n\t\t\t\t\t\tresults.get(z).addTestRun(als.get(z).getGenerations().getRange(0,nrOfGenerations));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tt.stopAndPrint();\r\n\t\t\t\tt.start(\"Calculating statistics\");\r\n\t\t\t\tsynchronized (results) {\r\n\t\t\t\t\tfor (int z=0; z < als.size(); z++) {\r\n\t\t\t\t\t\tresults.get(z).calculateStats();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tt.stopAndPrint();\r\n\t\t\t\t\r\n\t\t\t\tsetProgress((double)runs/(double)(nrOfContests-1));\r\n\t\t\t\t\r\n\t\t\t\tif (pause!=0) {\r\n\t\t\t\t\tsleep(pause);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (isPleasePause()) break;\r\n\t\t\t}\r\n\t\t\tsynchronized (results) {\r\n\t\t\t\tfor (int z=0; z < als.size(); z++) { //als.size()\r\n\t\t\t\t\tresults.get(z).calculateStats();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetProgress(1.0f);\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t//fail(\"al threw some Exception\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\t\r\n\t}", "public void testGameSetupCorrectly() throws Throwable {\n GameSetupFragment gameSetupFragment = GameSetupFragment.newInstance();\n Fragment fragPost = startFragment(gameSetupFragment, \"4\");\n assertNotNull(fragPost);\n\n //4x4 should give 16 in adapter\n final GameFragment gameFragment = GameFragment.newInstance(\"4x4\");\n startFragment(gameFragment, \"5\");\n assertNotNull(gameFragment);\n\n //check that two of each number have been placed on the board\n CubeView.Adapter adapter = (CubeView.Adapter) gameFragment.cubeGrid.getAdapter();\n\n int numCubes = adapter.getCount();\n assertEquals(16, numCubes);\n\n final int[] leftCounts = new int[8];\n final int[] topCounts = new int[8];\n final int[] rightCounts = new int[8];\n final int[] bottomCounts = new int[8];\n\n final ArrayList<CubeView> cubes = adapter.cubes;\n\n runTestOnUiThread(new Runnable() {\n @Override\n public void run() {\n for (CubeView cube : cubes) {\n for(int j = 0; j < 4; j++) {\n switch(j) {\n case 0: leftCounts[cube.showLeft()]++;\n break;\n case 1: topCounts[cube.showTop()]++;\n break;\n case 2: rightCounts[cube.showRight()]++;\n break;\n case 3: bottomCounts[cube.showBottom()]++;\n break;\n }\n }\n }\n }\n });\n\n for(int i = 0; i < 8; i++) {\n assertEquals(2, leftCounts[i]);\n assertEquals(2, topCounts[i]);\n assertEquals(2, rightCounts[i]);\n assertEquals(2, bottomCounts[i]);\n }\n\n //========================================\n // Test the settings.xml parsing functions\n //========================================\n\n Settings settings = Settings.deserialize();\n // Test theme parsing\n settings.setTheme(\"Red\");\n assertEquals(\"red\",settings.getTheme());\n settings.setTheme(\"green\");\n assertEquals(\"green\",settings.getTheme());\n // Test topic parsing\n settings.setTopic(\"Reptile\");\n assertEquals(\"reptile\", settings.getTopic());\n settings.setTopic(\"fish\");\n assertEquals(\"fish\", settings.getTopic());\n settings.setTopic(\"Mammal\");\n assertEquals(\"mammal\", settings.getTopic());\n\n // Test fling parsing\n settings.setFling(false);\n assertEquals(false, settings.isFling());\n settings.setFling(true);\n assertEquals(true, settings.isFling());\n // Test swipe parsing\n settings.setSwipe(false);\n assertEquals(false, settings.isSwipe());\n settings.setSwipe(true);\n assertEquals(true, settings.isSwipe());\n }", "@Test(timeout = 4000)\n public void test253() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Component component0 = errorPage0.ol();\n assertEquals(\"wheel_ErrorPage\", errorPage0.getComponentId());\n assertEquals(\"Block_1\", component0.getComponentId());\n }", "@Test\n @DisplayName(\"Verify collecting the remaining stones after end-game\")\n void collectRemainingStones() {\n boardService.collectRemainingStones();\n int homeCount1 = boardService.getPlayerHomeCount(playerService.getP1());\n int homeCount2 = boardService.getPlayerHomeCount(playerService.getP2());\n Assert.assertEquals(36, homeCount1);\n Assert.assertEquals(36, homeCount2);\n }", "@Test\n public void testDAM31601001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam31601001Click();\n\n // Confirmation of database state before any update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n todoListPage.setTodoForSearch(\"0000000001\");\n\n TodoDetailsPage todoDetailsPage = todoListPage.searchUsingStoredProc();\n\n webDriverOperations.waitForDisplayed(id(\"finished\"));\n\n // assert all the properties of fetched record.\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"Todo 1\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000001\"));\n assertThat(todoDetailsPage.getTodoCategory(), equalTo(\"CA1\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"In-Complete\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/24\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"1\"));\n }", "@Test\n public void loadCompletedTasksFromRepositoryAndLoadIntoView() {\n mPlaylistPresenter.setFiltering(PlaylistFilterType.COMPLETED_TASKS);\n mPlaylistPresenter.loadTasks(true);\n\n // Callback is captured and invoked with stubbed tasks\n verify(mSongsRepository).getSongs(mLoadTasksCallbackCaptor.capture());\n mLoadTasksCallbackCaptor.getValue().onSongsLoaded(TASKS);\n\n // Then progress indicator is hidden and completed tasks are shown in UI\n verify(mTasksView).setLoadingIndicator(false);\n ArgumentCaptor<List> showTasksArgumentCaptor = ArgumentCaptor.forClass(List.class);\n verify(mTasksView).showTasks(showTasksArgumentCaptor.capture());\n assertTrue(showTasksArgumentCaptor.getValue().size() == 2);\n }", "@Test\n\tpublic void testMainScenario() {\n\t\tProject project = this.db.project().create(\"Test project\", 200, \"13-05-2014\", null);\n\n//Test #1\t\t\n\t\tassertEquals(project.getActivities().size(), 0);\n\t\tassertEquals(project.getEstPercentageCompletion(), 0);\n\t\tassertEquals(project.getEstHoursRemaining(), 200);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 0);\n\t\tassertEquals(project.getHoursRegistered(), 0);\n\t\t\n\t\tActivity activity1 = this.db.activity().createProjectActivity(project.getId(), \"activity1\", 10, this.stringDateTimeToLong(\"01-05-2013 01:00\"), this.stringDateTimeToLong(\"01-05-2014 01:00\"));\n\t\tActivity activity2 = this.db.activity().createProjectActivity(project.getId(), \"activity2\", 10, this.stringDateTimeToLong(\"01-05-2013 01:00\"), this.stringDateTimeToLong(\"01-05-2014 01:00\"));\n\n//Test #2\t\t\n\t\tassertEquals(project.getActivities().size(), 2);\n\t\tassertEquals(project.getEstPercentageCompletion(), 0);\n\t\tassertEquals(project.getEstHoursRemaining(), 200);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 0);\n\t\t\n\t\tDeveloper developer = this.db.developer().readByInitials(\"JL\").get(0);\n\t\tDeveloper developer2 = this.db.developer().readByInitials(\"PM\").get(0);\n\t\tDeveloper developer3 = this.db.developer().readByInitials(\"GH\").get(0);\n\t\tDeveloper developer4 = this.db.developer().readByInitials(\"RS\").get(0);\n\t\tactivity1.addDeveloper(developer);\n\t\tactivity1.addDeveloper(developer2);\n\t\tactivity1.addDeveloper(developer3);\n\t\tactivity1.addDeveloper(developer4);\n\n//Test #3\n\t\t//Tests that the initials of all developers are stored correctly\t\t\n\t\tassertEquals(activity1.getAllDevsInitials(),\"JL,PM,GH,RS\");\n\t\tassertEquals(activity1.getAllDevsInitials() == \"The Beatles\", false); //Please fail!\n\t\t\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"11-05-2013 06:30\"), this.stringDateTimeToLong(\"11-05-2013 09:30\"), developer.getId(), activity1.getId(), false);\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"11-05-2013 06:30\"), this.stringDateTimeToLong(\"11-05-2013 09:30\"), developer2.getId(), activity1.getId(), false);\n\t\t\n\t\t//Showed in the project maintainance view, and is relevant to the report\n\t\tassertEquals(activity1.getHoursRegistered(),6);\n\t\t\n//Test #4\n\t\t//Tests normal registration\t\t\n\t\tassertEquals(project.getEstPercentageCompletion(), 3);\n\t\tassertEquals(project.getEstHoursRemaining(), 194);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 6);\n\t\t\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"12-05-2013 06:30\"), this.stringDateTimeToLong(\"12-05-2013 09:30\"), developer3.getId(), activity2.getId(), true);\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"12-05-2013 06:30\"), this.stringDateTimeToLong(\"12-05-2013 09:30\"), developer4.getId(), activity2.getId(), true);\n\n//Test #5\n\t\t//Tests that assits also count\t\t\n\t\tassertEquals(project.getEstPercentageCompletion(), 6);\n\t\tassertEquals(project.getEstHoursRemaining(), 188);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 12);\n\t}", "@Test\n public void testDAM30202001() {\n // データ初期化\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n // Connect to DB and fetch the Todo list\n TodoListPage todoListPage = dam3IndexPage.dam30202001Click();\n\n todoListPage = todoListPage.registerBulkTodoByReUseMode();\n\n // データ反映までの待ち時間\n webDriverOperations.waitForDisplayed(ExpectedConditions\n .textToBePresentInElementLocated(By.id(\"completedTodo\"),\n \"993\"));\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"993\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"1000\"));\n }", "@Test\n\tpublic void testIrParaCarrinho_InformacoesPersistidas() {\n\t\ttestIncluirProdutoNoCarrinho_ProdutoIncluidoComSucesso();\n\t\tcarrinhoPage = modalProdutoPage.clicarBotaoProceedToCheckout();\n\t\t\t\n\t\tassertEquals(esperado_nomeDoProduto, carrinhoPage.obter_nomeDoProduto());\n\t\tassertEquals(esperado_precoDoProduto, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_precoDoProduto()));\n\t\tassertEquals(esperado_tamanhoDoProduto, carrinhoPage.obter_tamanhoDoProduto());\n\t\tassertEquals(esperado_corDoProduto, carrinhoPage.obter_corDoProduto());\n\t\tassertEquals(esperado_inputQuantidadeDoProduto, Integer.parseInt(carrinhoPage.obter_inputQuantidadeDoProduto()));\n\t\tassertEquals(esperado_subTotalDoProduto, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_subTotalDoProduto()));\n\t\t\n\t\tassertEquals(esperado_numeroItensTotal, Funcoes.removeTextoItemsDevolveInt(carrinhoPage.obter_numeroItensTotal()));\n\t\tassertEquals(esperado_subtotalTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_subtotalTotal()));\n\t\tassertEquals(esperado_shippingTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_shippingTotal()));\n\t\tassertEquals(esperado_totalTaxExclTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_totalTaxExclTotal()));\n\t\tassertEquals(esperado_totalTaxInclTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_totalTaxInclTotal()));\n\t\tassertEquals(esperado_taxesTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_taxesTotal()));\n\t\t\n\t}", "@Override\r\n\t\t\tpublic Integer call() throws Exception {\n\t\t\t\ttry {\r\n\t\t\t\t\tbutton.setEnabled(false);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getChoosePatternLabel().setEnabled(false);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeModelLabel().setEnabled(false);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeSeq().setEnabled(false);\r\n\t\t\t\t\tmainFrame.getStepThreeBottom().UnEnable();\r\n\t\t\t\t\tmainFrame.getStepThreeNoTimeTabbedPane().getTestData().removeAll();\r\n\t\t\t\t\t\r\n\t\t\t\t\tmarkov = mainFrame.getNoTimeSeqOperation1().getMarkov();\r\n\t\t\t\t\tdom = mainFrame.getNoTimeSeqOperation1().getDom();\r\n\t\t\t\t\troot = mainFrame.getNoTimeSeqOperation1().getRoot();\r\n\t\t\t\t\tPI = mainFrame.getNoTimeSeqOperation1().getPI();\r\n\t\t\t\t\tmin = mainFrame.getStepThreeLeftButton().getMin();\r\n\t\t\t\t\tminSeq = mainFrame.getNoTimeSeqOperation1().getMinSeq();\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\ttopLabel.removeAll();\r\n\t\t\t\t\ttopLabel.setText(\"正在生成可靠性测试数据(该过程需要较久时间,请耐心等待)....\");\r\n\t\t\t\t\tThread.sleep(150);\r\n\r\n\t\t\t\t\tCalculate.getAllTransValues(markov);\r\n\r\n\t\t\t\t\tnew BestAssign().assign(markov, root);\r\n\t\t\t\t\t\r\n\t\t\t\t\tmarkov.setDeviation(CalculateSimilarity.statistic(markov, PI));\r\n\r\n\t\t\t\t\tOutputFormat format = OutputFormat.createPrettyPrint();\r\n\r\n\t\t\t\t\twriter = new XMLWriter(\r\n\t\t\t\t\t\t\tnew FileOutputStream(mainFrame.getBathRoute() + \"/TestCase/\" + ModelName + \"_Custom#1.xml\"),\r\n\t\t\t\t\t\t\tformat);\r\n\t\t\t\t\twriter.write(dom);\r\n\t\t\t\t\twriter.close();\r\n\r\n\t\t\t\t\tmainFrame.renewPanel();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\ttopLabel.removeAll();\r\n\t\t\t\t\ttopLabel.setText(\"生成可靠性测试数据出错!\");\r\n\r\n\t\t\t\t\tbutton.setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getChoosePatternLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeModelLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getNoTimeSeq().setEnabled(true);\r\n\r\n\t\t\t\t\tmainFrame.getStepThreeLeftButton().getChoosePatternLabel().setEnabled(true);\r\n\t\t\t\t\tmainFrame.getStepThreeBottom().Enable();\r\n\t\t\t\t\tmainFrame.renewPanel();\r\n\t\t\t\t}\r\n\t\t\t\treturn 1;\r\n\t\t\t}", "@Test\n @DisplayName(\"Action Marker Production Violet And Buy Test\")\n public void ActionMarkerProductionVioletAndBuyTest() throws IOException, InterruptedException {\n ActionMarkerProductionViolet actionMarker = new ActionMarkerProductionViolet();\n Server server= new Server();\n ClientHandler clientHandler= new ClientHandler(server);\n ClientController clientController= new ClientController(server,clientHandler) ;\n VirtualView virtualView = new VirtualView(clientController);\n\n GameSolitaire game = new GameSolitaire(\"Ali\",true,clientController);\n\n assertEquals(4, game.productionDeckSize(6));\n assertEquals(4, game.productionDeckSize(7));\n assertEquals(4, game.productionDeckSize(8));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(2, game.productionDeckSize(6));\n assertEquals(4, game.productionDeckSize(7));\n assertEquals(4, game.productionDeckSize(8));\n\n try {\n game.deckFromDeckNumber(12).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(1, game.productionDeckSize(6));\n assertEquals(4, game.productionDeckSize(7));\n assertEquals(4, game.productionDeckSize(8));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(6));\n assertEquals(3, game.productionDeckSize(7));\n assertEquals(4, game.productionDeckSize(8));\n\n try {\n game.deckFromDeckNumber(4).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(0, game.productionDeckSize(6));\n assertEquals(3, game.productionDeckSize(7));\n assertEquals(3, game.productionDeckSize(8));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(6));\n assertEquals(1, game.productionDeckSize(7));\n assertEquals(3, game.productionDeckSize(8));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(6));\n assertEquals(0, game.productionDeckSize(7));\n assertEquals(2, game.productionDeckSize(8));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(6));\n assertEquals(0, game.productionDeckSize(7));\n assertEquals(0, game.productionDeckSize(8));\n\n FileClass.FileDestroyer();\n\n }", "@Test\n public void TestGameStatus(){\n int gameTime = b.Game_Status();\n assertEquals(35, gameTime);\n }", "@Test\n public void testBuild() {\n System.out.println(\"build\");\n game.getPlayer().setEps(0);\n assertEquals((Integer) 1, building.build());\n assertEquals((Integer) 0, game.getPlayer().getEps());\n \n game.getPlayer().setEps(600);\n assertEquals((Integer) 3, building.build());\n assertEquals((Integer) 600, game.getPlayer().getEps());\n \n game.getPlayer().setEps(800);\n assertEquals((Integer) 0, building.build());\n assertEquals((Integer) 300, game.getPlayer().getEps());\n \n game.getPlayer().setEps(1000);\n assertEquals((Integer) 2, building.build());\n assertEquals((Integer) 1000, game.getPlayer().getEps());\n }", "@Test\n public void testDAM30503001() {\n\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30503001Click();\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000002\");\n\n assertThat(isTodoPresent, is(true));\n\n todoListPage.setTodoTitleContent(\"Todo 1\");\n todoListPage.setTodoCreationDate(\"2016-12-30\");\n\n todoListPage = todoListPage.searchByCriteriaBean();\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"1\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"1\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"2\"));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(true));\n\n // this todo does not meets the criteria.Hence not displayed.\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000002\");\n assertThat(isTodoPresent, is(false));\n\n }", "@Test\n public void testAssignReinforcements() {\n IssueOrderPhase l_issueOrder = new IssueOrderPhase(d_gameEngine);\n l_issueOrder.d_gameData = d_gameData;\n l_issueOrder.assignReinforcements();\n d_gameData = l_issueOrder.d_gameData;\n int l_actualNoOfArmies = d_gameData.getD_playerList().get(0).getD_noOfArmies();\n int l_expectedNoOfArmies = 8;\n assertEquals(l_expectedNoOfArmies, l_actualNoOfArmies);\n }", "@org.junit.Test\n public void testEstDivisibleParOK() {\n //given\n long n = 2;\n long div = 10;\n Parfait instance = new Parfait();\n\n //when\n boolean result = instance.estDivisiblePar(n, div);\n\n //then\n Assert.assertTrue(\"OK\", result);\n }", "public void testOutputIsVaild()\n {\n Collection<Puzzle> puzzles = new ArrayList<Puzzle>();\n\n puzzles = (Collection<Puzzle>) Config.get(\"Puzzles\", puzzles);\n\n for (Puzzle puzzle : puzzles)\n {\n byte[] grid = puzzle.getData();\n GridSolver cs = new GridSolver(grid);\n cs.solveGrid();\n assertTrue(new GridChecker(cs.getDataSolution()).checkGrid());\n }\n }", "@Test\n public void test11() {\n cashRegister.addPennies(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addDimes(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addDimes(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addFives(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addNickels(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addOnes(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addQuarters(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addTens(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n }", "@Test\n public void saveSearch_noExecutedSearch() {\n fillSearchFields();\n int accountID = new AccountDAO().findAccount(\"[email protected]\").getId();\n\n int savedSearchesSize = new AccountDAO().findAccount(accountID).getStoredSearches().size();\n //Trying to save a search without actually executing one should do nothing\n presenter.saveSearch();\n Assert.assertEquals(savedSearchesSize, new AccountDAO().findAccount(accountID).getStoredSearches().size());\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 @DisplayName(\"Action Marker Production Blue And Buy Test\")\n public void ActionMarkerProductionBlueAndBuyTest() throws IOException, InterruptedException {\n ActionMarkerProductionBlue actionMarker = new ActionMarkerProductionBlue();\n Server server= new Server();\n ClientHandler clientHandler= new ClientHandler(server);\n ClientController clientController= new ClientController(server,clientHandler) ;\n VirtualView virtualView = new VirtualView(clientController);\n\n GameSolitaire game = new GameSolitaire(\"Ali\",true,clientController);\n\n assertEquals(4, game.productionDeckSize(0));\n assertEquals(4, game.productionDeckSize(1));\n assertEquals(4, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(2, game.productionDeckSize(0));\n assertEquals(4, game.productionDeckSize(1));\n assertEquals(4, game.productionDeckSize(2));\n\n try {\n game.deckFromDeckNumber(10).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(1, game.productionDeckSize(0));\n assertEquals(4, game.productionDeckSize(1));\n assertEquals(4, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(3, game.productionDeckSize(1));\n assertEquals(4, game.productionDeckSize(2));\n\n try {\n game.deckFromDeckNumber(2).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(3, game.productionDeckSize(1));\n assertEquals(3, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(1, game.productionDeckSize(1));\n assertEquals(3, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(0, game.productionDeckSize(1));\n assertEquals(2, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(0, game.productionDeckSize(1));\n assertEquals(0, game.productionDeckSize(2));\n\n FileClass.FileDestroyer();\n\n }", "@Test\r\n\tvoid testGeneratePlayersShouldFail() {\r\n\t\tModel dataModel = new Model();\r\n\t\t \r\n\t\tdataModel.generatePlayers();\r\n\t\t\r\n\t\tArrayList<Player> players = dataModel.getAllPlayers();;\r\n\t\tint size = players.size();\r\n\t\t\r\n\t\tassertNotEquals(0, size);\r\n\t}", "public UnitTestData() throws Exception {\n String[] runsData = {\n \"1,1,A,1,No,No,4\", // 0 (a No before first yes Security Violation)\n \"2,1,A,1,No,No,2\", // 0 (a No before first yes Compilation Error)\n \"3,1,A,1,No,No,1\", // 20 (a No before first yes)\n \"4,1,A,3,Yes,No,0\", // 3 (first yes counts Minute points but never Run Penalty points)\n \"5,1,A,5,No,No,1\", // zero -- after Yes\n \"6,1,A,7,Yes,No,0\", // zero -- after Yes\n \"7,1,A,9,No,No,1\", // zero -- after Yes\n \"8,1,B,11,No,No,1\", // zero -- not solved\n \"9,2,A,48,No,No,4\", // 0 (a No before first yes Security Violation)\n \"10,2,A,50,Yes,No,0\", // 50 (minute points; no Run points on first Yes)\n \"11,2,B,35,No,No,1\", // zero -- not solved\n \"12,2,B,40,No,No,1\", // zero -- not solved\n };\n\n // Assign half eams random team member names\n addTeamMembers(contest, getTeamAccounts(contest).length / 2, 5);\n\n assertEquals(\"Expectig team member names\", 5, getFirstAccount(contest, Type.TEAM).getMemberNames().length);\n\n assertEquals(\"team count\", 120, contest.getAccounts(Type.TEAM).size());\n\n for (String runInfoLine : runsData) {\n SampleContest.addRunFromInfo(contest, runInfoLine);\n }\n\n Problem problem = contest.getProblems()[0];\n Account judge = getFirstAccount(contest, Type.JUDGE);\n generateClarifications(contest, 20, problem, judge.getClientId(), false, false);\n generateClarifications(contest, 20, problem, judge.getClientId(), true, false);\n generateClarifications(contest, 20, problem, judge.getClientId(), true, true);\n\n sampleContest.assignSampleGroups(contest, \"North Group\", \"South Group\");\n\n assertEquals(\"Runs\", 12, contest.getRuns().length);\n\n }", "@Test\r\n public void testTotalNumberOfQuestion() {\r\n Application.loadQuestions();\r\n assertEquals(Application.allQuestions.size(), 2126);\r\n }", "@Test\n public void testDAM30503002() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n TodoListPage todoListPage = dam3IndexPage.dam30503002Click();\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000002\");\n\n assertThat(isTodoPresent, is(true));\n\n todoListPage.setTodoTitleContent(\"Todo 1\");\n todoListPage.setTodoCreationDate(\"2016-12-30\");\n\n todoListPage = todoListPage.searchByCriteriaBeanRetMap();\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"1\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"1\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"2\"));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(true));\n\n // this todo does not meets the criteria.Hence not displayed.\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000002\");\n assertThat(isTodoPresent, is(false));\n }", "@Test(timeout = 4000)\n public void test100() throws Throwable {\n CatalogTexture catalogTexture0 = new CatalogTexture(\"c5!DqhIQ,!L'eP\", \"0dj!E;iRV]\", (Content) null, 0, 0, \"0dj!E;iRV]\");\n HomeTexture homeTexture0 = new HomeTexture(catalogTexture0);\n HomeEnvironment homeEnvironment0 = new HomeEnvironment(0, homeTexture0, 0, 0, 0);\n int int0 = homeEnvironment0.getLightColor();\n assertEquals(0, homeEnvironment0.getSkyColor());\n assertTrue(homeEnvironment0.isObserverCameraElevationAdjusted());\n assertEquals(25, homeEnvironment0.getVideoFrameRate());\n assertEquals(300, homeEnvironment0.getPhotoHeight());\n assertEquals(13684944, homeEnvironment0.getCeillingLightColor());\n assertEquals(0.0F, homeEnvironment0.getWallsAlpha(), 0.01F);\n assertEquals(400, homeEnvironment0.getPhotoWidth());\n assertEquals(0, int0);\n assertEquals(0, homeEnvironment0.getGroundColor());\n assertEquals(240, homeEnvironment0.getVideoHeight());\n }", "@Test\n public void autocreateLesson() throws Exception{\n\n }", "@Test(priority = 7, retryAnalyzer = Retry.class)\n\tpublic void VPORT_16_EnablingBenchmarkScoresManageRosterProgressMonitoring()\n\t{\n\t\tString trackName = dependentData.getProperty(\"VPORT_001_TrackName\");\n\t\tvportloginpage.enterLoginCredentials(vportData.vportUsername, vportData.vportPassword);\n\t\tvporttrackfilterPage = (VportTrackFilterPage) vportloginpage.clickSignInButton(ReturnPage.FILTERPAGE);\n\t\tvporttrackfilterPage.verifyFilterPage();\n\t\t//2.Select any product track & navigate to IPT tab - District track - technology section\n\t\tvporttrackfilterPage.trackFilters(vportData.productName, vportData.userType, vportData.alpha, trackName);\n\t\tvporttrackfilterPage.clickUpdateButton();\n\t\tdistrictTrackContactsPage = vporttrackfilterPage.clickonTrackName(trackName);\n\t\t// To verify Contacts page is loaded\n\t\tdistrictTrackContactsPage.verifyDistrictTrackContactsPage(trackName);\n\t\tdistrictTrackContactsPage.clickOnIPTTab();\n\t\tdistrictTrackContactsPage.clickOnTechnologyTab();\t\t\n\t\t//3.Find that Customer interface section is being displayed\n\t\tdistrictTrackContactsPage.verifyCustomerInterface();\n\t\t//4.Here we can explicitly enable or disable Benchmark Scores, Manage Roster & Progress monitoring sections for a particular levels for products having assesment plans\"\n\t\tdistrictTrackContactsPage.verifyTheRadioButtons();\n\t\tdistrictTrackContactsPage.verifyTheSaveChangesButton();\n\t\tdistrictTrackContactsPage.verifyTheAssessmentsplansSelectOptions();\n\t\t//Log Off from the application\n\t\tvportloginpage=districtTrackContactsPage.clickLogoutLink();\n\t\tvportloginpage.verifyLoginPage();\n\n\t}", "@Test\n void invalidPLAYING() {\n getGame().start();\n getGame().start();\n verifyZeroInteractions(observer);\n assertThat(getGame().isInProgress()).isTrue();\n }", "@Test\n public void proximaSequencia(){\n\n }", "@Test\n public void testParkingACar(){\n ParkingService parkingService = new ParkingService(inputReaderUtil, parkingSpotDAO, ticketDAO);\n parkingService.processIncomingVehicle();\n //TODO: check that a ticket is actually saved in DB and Parking table is updated with availability\n assertAll(\n () -> assertEquals(1,dataBasePrepareService.calculateTheNumberOfTicketSavedInTheDB()),\n () -> assertFalse(dataBasePrepareService.checkIfThisSpotIsAvailable(1))\n );\n }", "@Test\n public void testDAM30506001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30506001Click();\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n todoListPage = todoListPage.registerBulkTodoByReUseMode();\n\n // データ反映までの待ち時間\n webDriverOperations.waitForDisplayed(ExpectedConditions\n .textToBePresentInElementLocated(By.id(\"completedTodo\"),\n \"993\"));\n\n todoListPage.setTodoTitleContent(\"TT\");\n todoListPage.setTodoCreationDate(\"2016-12-30\");\n\n todoListPage = todoListPage.fetchUsingSQLRefinePaging();\n\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(false));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000011\");\n assertThat(isTodoPresent, is(true));\n\n // move to last page of pagination\n todoListPage = todoListPage.displayLastPage();\n\n // confirm the last ToDo on the page\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000001000\");\n assertThat(isTodoPresent, is(true));\n }", "@Test\n public void testDAM30603001() {\n // Data preparation\n {\n clearTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30603001Click();\n\n todoListPage = todoListPage.batchRegister();\n\n String cntOfRegisteredTodo = todoListPage\n .getCountOfBatchRegisteredTodos();\n\n assertThat(cntOfRegisteredTodo, equalTo(\n \"Total Todos Registered/Updated in Batch : 10\"));\n\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"5\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"5\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n // confirm for some todos as present and some as not present.\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000005\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000011\");\n assertThat(isTodoPresent, is(false));\n }", "@Test(timeout = 4000)\n public void test214() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Component component0 = errorPage0.up((-1));\n assertNotNull(component0);\n assertEquals(\"wheel_ErrorPage\", component0.getComponentId());\n }", "public void testGetModo() {\n System.out.println(\"getModo\");\n int modo= 0;\n ObjectTempSwapWizard instance = new ObjectTempSwapWizard(modo);\n int expResult = 0;\n int result = instance.getModo();\n assertEquals(expResult, result);\n }", "@Test\n public void solve1() {\n }", "@Test(dataProvider=\"getData\")\n\tpublic void BVisibility_AddButton(String tst, int i) throws IOException, InterruptedException\n\t{\n\t\tlog.info(\"Test for - \"+tst);\n\t\tLoginPage lip=new LoginPage(driver);\n\t\tlip.getUsername().clear();\n\t\tlip.getUsername().sendKeys(prop.getProperty(\"username\"));\n\t\tlip.getPassword().clear();\n\t\tlip.getPassword().sendKeys(prop.getProperty(\"password\"));\n\t\tThread.sleep(2000);\n\t\tlip.getSubmit().click();\n\t\tThread.sleep(2000);\n\t\tif (lip.getSessionOut().isDisplayed()) {\n\t\t\tlip.getSessionOut().click();\n\t }\n\t\tlog.info(\"Login successfully\");\n\t\t\n\t\tThread.sleep(5000);\n\t\t\n\t\tLandingPage LP=new LandingPage(driver);\n\t\t\n\t\tlog.info(\"enter dashboard page\");\n\t\tif(i==1) {\n\t\tLP.getDepartment().click();\n\t\tThread.sleep(3000);\n\t\tdepartmentPage dp=new departmentPage(driver);\n\t\tif(dp.getAdd().isDisplayed()){\n\t\t\tlog.info(\"Department add button is not displaying\");\n\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t}\n\t\telse {\n\t\t\tlog.info(\"Testcase failed- Department add button is visible\");\n\t\t\t\n\t\t}\n\t\t}\n\t\telse if(i==2) {\n\t\t\tLP.getProjects().click();\n\t\t\tThread.sleep(3000);\n\t\t\tProjectPage pp=new ProjectPage(driver);\n\t\t\tif(pp.getAdd().isDisplayed()){\n\t\t\t\tlog.info(\"Project add button is not displaying\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Testcase failed- Project add button is visible\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(i==3) {\n\t\t\tLP.getFields().click();\n\t\t\tThread.sleep(3000);\n\t\t\tFieldPage fp=new FieldPage(driver);\n\t\t\tif(fp.getAdd().isDisplayed()){\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- Field add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Field add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(i==4) {\n\t\t\tLP.getFilter().click();\n\t\t\tThread.sleep(3000);\n\t\t\tFilterPage fp=new FilterPage(driver);\n\t\t\tif(fp.getAdd().isDisplayed()){\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- Filter add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Filter add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(i==5) {\n\t\t\tLP.getViews().click();\n\t\t\tThread.sleep(3000);\n\t\t\tlog.info(\"Enter view page\");\n\t\t\tViewPage vp=new ViewPage(driver);\n\t\t\tif(vp.getAdd().isDisplayed()){\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- view add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"View add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tLP.getRoles().click();\n\t\t\tlog.info(\"Enter login page\");\n\t\t\tThread.sleep(3000);\n\t\t\tRolePage rp=new RolePage(driver);\n\t\t\tif(rp.getAdd().isDisplayed()) {\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- Role add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Role add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void temporaryTeamClosingUnavalableOption() {\n\n }" ]
[ "0.7001744", "0.65075743", "0.64745593", "0.6460211", "0.6414467", "0.62727475", "0.62634987", "0.6186106", "0.61715007", "0.6071531", "0.60545504", "0.5973697", "0.5936995", "0.59308493", "0.59301865", "0.59026295", "0.5897931", "0.5888837", "0.5878759", "0.586523", "0.5845756", "0.5812972", "0.5778138", "0.5775263", "0.5750797", "0.57074845", "0.5704112", "0.569659", "0.5692369", "0.56841016", "0.5681264", "0.56812274", "0.5676874", "0.5667209", "0.56543505", "0.56459165", "0.56379086", "0.5633411", "0.56305176", "0.56270087", "0.5621755", "0.5619986", "0.56194586", "0.561883", "0.56182754", "0.56172097", "0.56169415", "0.5614902", "0.5611391", "0.5610716", "0.5603206", "0.5593568", "0.55912876", "0.5585875", "0.5585537", "0.55830836", "0.55816036", "0.55745965", "0.55733037", "0.5570719", "0.55696756", "0.5567207", "0.5567066", "0.55665016", "0.5565478", "0.5565156", "0.5562646", "0.5562335", "0.5553249", "0.554943", "0.5540545", "0.5535056", "0.5532345", "0.5532107", "0.55213076", "0.5514226", "0.5514031", "0.55132943", "0.5509958", "0.55048305", "0.5502641", "0.5501763", "0.5497419", "0.54968333", "0.54956925", "0.5486395", "0.54854816", "0.5483218", "0.54811734", "0.547996", "0.5477746", "0.5476666", "0.5475072", "0.546914", "0.54681534", "0.54652375", "0.54591525", "0.54590106", "0.5458922", "0.5456103" ]
0.63381344
5
ctrl.setPuzzleDao(puzzleDao); ctrl.setHelperGenerator(helperGen); loadPage(); generatePuzzle(2, "evil"); Progress progress = ctrl.getProgress(); assertEquals(2, progress.getTotal()); assertEquals(2, progress.getEvil()); assertEquals(6, progress.getStoredEvil()); generatePuzzle(3, "evil"); progress = ctrl.getProgress(); assertEquals(3, progress.getTotal()); assertEquals(3, progress.getEvil()); assertEquals(9, progress.getStoredEvil());
@Test public void testTotalPuzzleGenerated() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testGetProgressOfQuestionnaireById(){\n Date dateKey = new Date();\n String userName = \"Regina for president\";\n\n\n User user = new User(userName);\n userDB.insertUser(user);\n\n //add questionnaires\n HADSDQuestionnaire q1 = new HADSDQuestionnaire(userName);\n q1.setCreationDate_PK(dateKey);\n q1.setLastQuestionEditedNr(4);\n q1.setProgressInPercent(99);\n new HADSDQuestionnaireManager(context).insertQuestionnaire(q1);\n\n DistressThermometerQuestionnaire q2 = new DistressThermometerQuestionnaire(userName);\n q2.setCreationDate_PK(dateKey);\n q2.setLastQuestionEditedNr(2);\n q2.setProgressInPercent(77);\n new DistressThermometerQuestionnaireManager(context).insertQuestionnaire(q2);\n\n QolQuestionnaire q3 = new QolQuestionnaire(userName);\n q3.setCreationDate_PK(dateKey);\n q3.setLastQuestionEditedNr(0);\n q3.setProgressInPercent(33);\n new QualityOfLifeManager(context).insertQuestionnaire(q3);\n\n // get selected questionnaire\n user = userDB.getUserByName(userName);\n\n int hadsProgress = new HADSDQuestionnaireManager(context).getHADSDQuestionnaireByDate_PK(user.getName(), dateKey).getProgressInPercent();\n int distressProgress = new DistressThermometerQuestionnaireManager(context).getDistressThermometerQuestionnaireByDate(user.getName(), dateKey).getProgressInPercent();\n int qualityProgress = new QualityOfLifeManager(context).getQolQuestionnaireByDate(user.getName(), dateKey).getProgressInPercent();\n\n assertEquals(99, hadsProgress);\n assertEquals(77, distressProgress);\n assertEquals(33, qualityProgress);\n }", "@Test\n\tpublic void testNormalPuzzleGeneration() {\n\t}", "@Test\n public void testIsSolved() {\n setUpCorrect();\n assertTrue(boardManager.puzzleSolved());\n swapFirstTwoTiles();\n assertFalse(boardManager.puzzleSolved());\n }", "@Test\n\tpublic void testHardPuzzleGeneration() {\n\t}", "public void testGame1EmulateIncorrectAnswers() {\n int[] indicators;\n MainPage mainPage = getMainPage();\n GameObjectImpl game1 = mainPage.gameOpen(1);\n game1.waitIndicatorsLoad();\n indicators = game1.getIndicators();\n int qtyTasksBeforeCycle = indicators[3];\n int tasksFailedBeforeCycle = indicators[1];\n for(int iter = 0; iter < qtyTasksBeforeCycle - 1; iter++) {\n game1.waitTaskBegin();\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n indicators = game1.getIndicators();\n int varTasksPassedBegin = indicators[0];\n int varTasksFailedBegin = indicators[1];\n int varTasksRemainBegin = indicators[2];\n int qtyTasksInLoopBegin = indicators[3];\n\n String[] partsOfTask = game1.getPartsOfTask();\n String firstNumberVar = partsOfTask[0];\n String secondNumberVar = partsOfTask[1];\n String operationVar = partsOfTask[2];\n int actualResult = game1.getResultWithKeys(firstNumberVar, secondNumberVar, operationVar);\n // press wrong button\n String strActualResult = Integer.toString(actualResult + 1);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n //press correct button\n strActualResult = Integer.toString(actualResult);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n indicators = game1.getIndicators();\n int varTasksPassedEnd = indicators[0];\n int varTasksFailedEnd = indicators[1];\n int varTasksRemainEnd = indicators[2];\n int qtyTasksInLoopEnd = indicators[3];\n\n assert varTasksRemainEnd == varTasksRemainBegin : \"positiveTestCorrectAnswers: tasks remain\";//\n assert varTasksFailedEnd == (varTasksFailedBegin + 1) : \"positiveTestCorrectAnswers: tasks failed\";\n assert varTasksPassedEnd == varTasksPassedBegin : \"positiveTestCorrectAnswers: tasks passed\";\n assert qtyTasksInLoopEnd == qtyTasksInLoopBegin + 1 : \"negativeTestWrongAnswers: tasks all\";\n }\n indicators = game1.getIndicators();\n int varTasksFailedAfterCycle = indicators[1];\n int qtyTasksAfterCycle = indicators[3];\n assert varTasksFailedAfterCycle - tasksFailedBeforeCycle == qtyTasksAfterCycle - qtyTasksBeforeCycle\n : \"positiveTestCorrectAnswers: tasks summ\" ;//\n game1.clickCloseGame();\n\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 z_topDown_TC03() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n\n Statistica statistica = appService.getStatistica();\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"Literatura\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"Literatura\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"M\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"M\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"A\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"A\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"B\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"B\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"C\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"C\")==1);\n\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n } catch (NotAbleToCreateStatisticsException e) {\n assertTrue(false);\n }\n }", "@Test\n\tpublic void testEvilPuzzleGeneration() {\n\t}", "@Test\n void displayIncompleteTasks() {\n }", "@Test\n void displayCompletedTasks() {\n }", "@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 }", "@Test\n public final void testInitialSpinners() {\n int standardrows = 5;\n int standardcolumns = 5;\n assertEquals(standardrows, spysizedialog.getRows());\n assertEquals(standardcolumns, spysizedialog.getColumns());\n}", "@Test\n public void testPercentages(){\n assertTrue(Results.percentages());\n }", "@Test\n public void testDAM30901001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30901001Click();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n todoListPage.selectCompleteStatRadio();\n\n todoListPage = todoListPage.ifElementUsageSearch();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n\n // 1 and 3 todos are incomplete. hence not displayed\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000003\");\n assertThat(isTodoPresent, is(false));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(false));\n // 10 todo is complete. hence displayed.\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(true));\n\n // default value of finished is now false.hence todos like 1,3 will be displayed\n // where as todo like 10 will not be displayed.\n todoListPage.selectInCompleteStatRadio();\n todoListPage = todoListPage.ifElementUsageSearch();\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000003\");\n assertThat(isTodoPresent, is(true));\n\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000001\");\n assertThat(isTodoPresent, is(true));\n // 10 todo is complete. hence displayed.\n isTodoPresent = todoListPage.isTodoDisplayed(\"0000000010\");\n assertThat(isTodoPresent, is(false));\n\n // scenario when finished property of criteria is null.\n\n }", "@Test\n public void testScriptProgressContainer_2()\n throws Exception {\n int percentComplete = 1;\n String errorMessage = \"\";\n\n ScriptProgressContainer result = new ScriptProgressContainer(percentComplete, errorMessage);\n\n assertNotNull(result);\n assertEquals(\"\", result.getErrorMessage());\n assertEquals(1, result.getPercentComplete());\n }", "@Test\n void cadastraEspecialidadeProfessorInvalido(){\n assertEquals(\"Campo email nao pode ser nulo ou vazio.\", verificaExcecao(() ->\n controllerPesquisador.cadastraEspecialidadeProfessor(\"\", \"Doutorado\", \"DSC\", \"01/01/2011\")));\n assertEquals(\"Campo formacao nao pode ser nulo ou vazio.\", verificaExcecao(() ->\n controllerPesquisador.cadastraEspecialidadeProfessor(\"email@email\", null, \"DSC\", \"01/01/2011\")));\n assertEquals(\"Campo unidade nao pode ser nulo ou vazio.\", verificaExcecao(() ->\n controllerPesquisador.cadastraEspecialidadeProfessor(\"email@email\", \"Doutorado\", \"\", \"01/01/2011\")));\n assertEquals(\"Campo data nao pode ser nulo ou vazio.\", verificaExcecao(() ->\n controllerPesquisador.cadastraEspecialidadeProfessor(\"email@email\", \"Doutorado\", \"DSC\", null)));\n assertEquals(\"Formato de email invalido.\", verificaExcecao(() ->\n controllerPesquisador.cadastraEspecialidadeProfessor(\"email@\", \"Doutorado\", \"DSC\", \"01/05/2015\")));\n assertEquals(\"Pesquisadora nao encontrada.\", verificaExcecao(() ->\n controllerPesquisador.cadastraEspecialidadeProfessor(\"email1@email\", \"Doutorado\", \"DSC\", \"01/05/2015\")));\n cadastraPesquisador();\n assertEquals(\"Pesquisador nao compativel com a especialidade.\",\n verificaExcecao(() -> controllerPesquisador.cadastraEspecialidadeProfessor(\"hunterxhunter@1998\",\"Doutorado\", \"DSC\", \"01/05/2015\")));\n assertEquals(\"Atributo data com formato invalido.\",\n verificaExcecao(() -> controllerPesquisador.cadastraEspecialidadeProfessor(\"breakingbad@2008\",\"Doutorado\", \"DSC\", \"01052015\")));\n assertEquals(\"Atributo data com formato invalido.\",\n verificaExcecao(() -> controllerPesquisador.cadastraEspecialidadeProfessor(\"breakingbad@2008\",\"Doutorado\", \"DSC\", \"2015/05/15\")));\n assertEquals(\"Atributo data com formato invalido.\",\n verificaExcecao(() -> controllerPesquisador.cadastraEspecialidadeProfessor(\"breakingbad@2008\",\"Doutorado\", \"DSC\", \"1/5/2015\")));\n }", "@Test\r\n public void testPartido1() throws Exception {\r\n /* \r\n * En el estado EN_ESPERA\r\n */\r\n assertEquals( \"Ubicación: Camp Nou\" \r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido está en espera, aún no se han concretado los equipos\"\r\n , P1.datos());\r\n /* \r\n * En el estado NO_JUGADO\r\n */\r\n P1.fijarEquipos(\"Barça\",\"Depor\"); \r\n assertEquals( \"Ubicación: Camp Nou\"\r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido aún no se ha jugado\"\r\n + \"\\nEquipo local: Barça\"\r\n + \"\\nEquipo visitante: Depor\" \r\n , P1.datos()\r\n );\r\n /* \r\n * En el estado EN_JUEGO\r\n */\r\n P1.comenzar(); \r\n P1.tantoLocal();\r\n P1.tantoVisitante();\r\n assertEquals( \"Ubicación: Camp Nou\"\r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido está en juego\"\r\n + \"\\nEquipo local: Barça\"\r\n + \"\\nTantos locales: 1\"\r\n + \"\\nEquipo visitante: Depor\"\r\n + \"\\nTantos visitantes: 1\"\r\n , P1.datos()\r\n );\r\n /* \r\n * En el estado FINALIZADO\r\n */\r\n P1.terminar(); \r\n assertEquals( \"Ubicación: Camp Nou\"\r\n + \"\\nFecha: 2010-04-28\"\r\n + \"\\nEl partido ha finalizado\"\r\n + \"\\nEquipo local: Barça\"\r\n + \"\\nTantos locales: 1\"\r\n + \"\\nEquipo visitante: Depor\"\r\n + \"\\nTantos visitantes: 1\"\r\n , P1.datos()\r\n );\r\n assertEquals(\"Empate\",P1.ganador());\r\n }", "@Test\n public void setProgression() {\n final int progress = 16;\n final String progressText = \"0:16\";\n expandPanel();\n onView(withId(R.id.play)).perform(click()); //Pause playback\n\n onView(withId(R.id.mpi_seek_bar)).perform(ViewActions.slideSeekBar(progress));\n\n onView(withId(R.id.mpi_progress)).check(matches(withText(progressText)));\n assertTrue(getPlayerHandler().getTimeElapsed() == progress);\n }", "@Test\r\n public void testIsSolved() {\r\n assertTrue(boardManager4.puzzleSolved());\r\n boardManager4.getBoard().swapTiles(0,0,0,1);\r\n assertFalse(boardManager4.puzzleSolved());\r\n }", "void testDrawBoard(Tester t) {\r\n initData();\r\n\r\n //testing draw board on a world\r\n t.checkExpect(this.game2.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(1) + \"/\"\r\n + Integer.toString(100), Cnst.textHeight, Color.BLACK),\r\n this.game2.indexHelp(0,0).drawBoard(2)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n t.checkExpect(this.game3.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(1) + \"/\"\r\n + Integer.toString(10), Cnst.textHeight, Color.BLACK),\r\n this.game3.indexHelp(0,0).drawBoard(3)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n t.checkExpect(this.game5.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(5) + \"/\"\r\n + Integer.toString(5), Cnst.textHeight, Color.BLACK),\r\n this.game5.indexHelp(0,0).drawBoard(4)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n //testing draw board on a visible cell\r\n t.checkExpect(this.game2.indexHelp(0, 0).drawBoard(2),\r\n new AboveImage(this.game2.indexHelp(0, 0).drawRow(2),\r\n this.game2.indexHelp(0, 0).bottom.drawBoard(2)));\r\n\r\n t.checkExpect(this.game3.indexHelp(0, 0).drawBoard(3),\r\n new AboveImage(this.game3.indexHelp(0, 0).drawRow(3),\r\n this.game3.indexHelp(0, 0).bottom.drawBoard(3)));\r\n\r\n t.checkExpect(this.game5.indexHelp(0, 0).drawBoard(4),\r\n new AboveImage(this.game5.indexHelp(0, 0).drawRow(4),\r\n this.game5.indexHelp(0, 0).bottom.drawBoard(4)));\r\n\r\n //testing it on an end cell\r\n t.checkExpect(this.game2.indexHelp(-1, 1).drawBoard(2), new EmptyImage());\r\n }", "@Test\n public void test11() {\n cashRegister.addPennies(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addDimes(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addDimes(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addFives(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addNickels(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addOnes(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addQuarters(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n cashRegister.addTens(0);\n assertEquals(\"\", cashRegister.getAuditLog());\n }", "@Test\r\n public void testPartido3() throws Exception {\r\n P3.fijarEquipos(\"Barça\",\"Depor\"); \r\n P3.comenzar(); \r\n P3.tantoVisitante();\r\n P3.terminar(); \r\n assertEquals(\"Depor\",P3.ganador());\r\n }", "@Test\n public void proximaSequencia(){\n\n }", "@Test\n public void testScriptProgressContainer_1()\n throws Exception {\n\n ScriptProgressContainer result = new ScriptProgressContainer();\n\n assertNotNull(result);\n assertEquals(null, result.getErrorMessage());\n assertEquals(0, result.getPercentComplete());\n }", "@Test\n public void z_topDown_TC02() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n }", "@Test\n public void testModuloExpectedUse() {\n MainPanel mp = new MainPanel();\n ProgramArea pa = new ProgramArea();\n ProgramStack ps = new ProgramStack();\n\n ps.push(10);\n ps.push(3);\n\n ProgramExecutor pe = new ProgramExecutor(mp, ps, pa);\n\n pe.modulo();\n\n Assert.assertEquals(1, ps.pop());\n }", "@Test\n public void updatePage() {\n }", "@Test\n public void mainFlowTest() {\n type.insert();\n engineer.insert();\n\n Equipment equipment1 = new Equipment(\"equipment1\", type.getId(), model, location, installTime1);\n Equipment equipment2 = new Equipment(\"equipment2\", type.getId(), model, location, installTime2);\n equipment1.insert();\n equipment2.insert();\n\n Plan plan1 = new Plan(\"plan1\", type.getId(), 30, \"large\", \"checking\");\n Plan plan2 = new Plan(\"plan2\", type.getId(), 60, \"small\", \"repairing\");\n plan1.insert();\n plan2.insert();\n\n Record record1 = new Record(\"r1\", plan1.getId(), equipment1.getId(), engineer.getId(),\n DateUtils.getCalendar(2015, 11, 1).getTime(), 2, \"换过滤网\");\n Record record2 = new Record(\"r2\", plan2.getId(), equipment1.getId(), engineer.getId(),\n DateUtils.getCalendar(2015, 11, 31).getTime(), 1, \"发动机清理\");\n Record record3 = new Record(\"r3\", plan1.getId(), equipment2.getId(), engineer.getId(),\n DateUtils.getCalendar(2015, 11, 5).getTime(), 3, \"cleaning\");\n Record record4 = new Record(\"r4\", plan2.getId(), equipment2.getId(), engineer.getId(),\n DateUtils.getCalendar(2016, 0, 4).getTime(), 2, \"tiny repairing\");\n record1.insert();\n record2.insert();\n record3.insert();\n record4.insert();\n\n // test the correctness of 10 days tasks\n List<Task> tenDayTasks = MaintenanceOperation.getTenDaysTask(DateUtils.getCalendar(2015, 11, 30).getTime());\n assertEquals(\"wrong with 10 days' tasks\", 2, tenDayTasks.size());\n\n // test the total maintenance time\n int time1 = MaintenanceOperation.getTotalMaintenanceTime(equipment1.getId());\n assertEquals(\"wrong with total time of equipment 1\", 3, time1);\n int time2 = MaintenanceOperation.getTotalMaintenanceTime(equipment2.getId());\n assertEquals(\"wrong with total time of equipment 2\", 5, time2);\n\n // test the total maintenance time of certain type\n int time3 = MaintenanceOperation.getTotalMaintenanceTime(equipment1, plan1.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 2, time3);\n int time4 = MaintenanceOperation.getTotalMaintenanceTime(equipment1, plan2.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 1, time4);\n int time5 = MaintenanceOperation.getTotalMaintenanceTime(equipment2, plan1.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 3, time5);\n int time6 = MaintenanceOperation.getTotalMaintenanceTime(equipment2, plan2.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 2, time6);\n }", "@Test\n\tpublic void test() {\n\t\t// CHECKSTYPE:OFF\n\n\t\t// Test the addPlayer(Player player) method\n\t\tPlayer player1 = new Player(\"Iris\");\n\t\tPlayer player2 = new Player(\"Emily\");\n\t\tPlayer player3 = new Player(\"Jason\");\n\t\tPlayer player4 = new Player(\"Rain\");\n\t\tPlayer player5 = new Player(\"Mandy\");\n\t\tscrabbleSystem.addPlayer(player1);\n\t\tscrabbleSystem.addPlayer(player2);\n\t\tscrabbleSystem.addPlayer(player3);\n\t\tscrabbleSystem.addPlayer(player4);\n\t\tscrabbleSystem.addPlayer(player5);\n\t\tList<Player> playersList = scrabbleSystem.getPlayers();\n\t\tassertEquals(4, playersList.size());\n\n\t\t// Test the startNewGame() method\n\t\t/**\n\t\t * The first Turn -- place some tiles on the board\n\t\t */\n\t\tscrabbleSystem.startNewGame();\n\t\tPlayer currentPlayer1 = scrabbleSystem.getCurrentPlayer();\n\t\tSystem.out.println(currentPlayer1.getName());\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tList<SpecialTile> specialStore = scrabbleSystem.getSpecialStore();\n\t\tassertEquals(5, specialStore.size());\n\t\tassertEquals(\"Boom\", specialStore.get(0).getName());\n\t\tassertEquals(\"NegativePoint\", specialStore.get(1).getName());\n\t\tassertEquals(\"RetrieveOrder\", specialStore.get(2).getName());\n\t\tassertEquals(\"ReverseOrder\", specialStore.get(3).getName());\n\t\tassertEquals(70, scrabbleSystem.getLetterBag().getNumber());\n\n\t\t// Test the playMove(Move move) method\n\t\tSquare square1 = scrabbleSystem.getBoard().getSquare(7, 7);\n\t\tSquare square2 = scrabbleSystem.getBoard().getSquare(8, 7);\n\t\tSquare square3 = scrabbleSystem.getBoard().getSquare(9, 7);\n\n\t\tTile tile1 = currentPlayer1.getTileList().get(0);\n\t\tTile tile2 = currentPlayer1.getTileList().get(1);\n\t\tTile tile3 = currentPlayer1.getTileList().get(2);\n\n\t\tint scoreSum1 = tile1.getValue() + tile2.getValue() + tile3.getValue();\n\t\t// The first Player\n\t\tMove move = scrabbleSystem.getMove();\n\t\tmove.addTile(square2, tile2);\n\t\tmove.addTile(square3, tile3);\n\n\t\tscrabbleSystem.playMove(move);\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tassertEquals(70, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tmove.addTile(square1, tile1);\n\t\tscrabbleSystem.playMove(move);\n\t\tassertEquals(7, currentPlayer1.getTileList().size());\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(7, 7).isOccuppied());\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(8, 7).isOccuppied());\n\t\tassertTrue(scrabbleSystem.getBoard().getSquare(9, 7).isOccuppied());\n\t\tassertFalse(scrabbleSystem.getBoard().getSquare(10, 7).isOccuppied());\n\t\tassertFalse(scrabbleSystem.isGameOver());\n\t\t// check player's score\n\t\tassertEquals(scoreSum1, currentPlayer1.getScore());\n\n\t\tPlayer challengePlayer1 = playersList.get(0);\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tPlayer playerTmp = playersList.get(i);\n\t\t\tif (playerTmp != currentPlayer1) {\n\t\t\t\tchallengePlayer1 = playerTmp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// if there is no player invoke a challenge\n\t\tscrabbleSystem.updateOrder();\n\n\t\t/**\n\t\t * The secord turn -- place some tiles on the board and challenges by\n\t\t * another player\n\t\t */\n\t\tPlayer currentPlayer2 = scrabbleSystem.getCurrentPlayer();\n\t\tassertNotEquals(currentPlayer1, currentPlayer2);\n\t\tSystem.out.println(currentPlayer1.getName());\n\t\tSystem.out.println(currentPlayer2.getName());\n\n\t\tSquare square4 = scrabbleSystem.getBoard().getSquare(8, 6);\n\t\tSquare square5 = scrabbleSystem.getBoard().getSquare(8, 8);\n\t\tSquare square6 = scrabbleSystem.getBoard().getSquare(8, 9);\n\t\tSquare square7 = scrabbleSystem.getBoard().getSquare(7, 8);\n\n\t\tTile tile4 = currentPlayer2.getTileList().get(0);\n\t\tTile tile5 = currentPlayer2.getTileList().get(1);\n\t\tTile tile6 = currentPlayer2.getTileList().get(2);\n\n\t\tMove move2 = scrabbleSystem.getMove();\n\t\tassertEquals(0, move2.getTileMap().size());\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square5, tile5);\n\t\tmove2.addTile(square7, tile6);\n\t\t// check invalid move\n\t\tscrabbleSystem.playMove(move2);\n\n\t\t// check invalid move\n\t\tmove2.clearMove();\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square6, tile6);\n\t\tscrabbleSystem.playMove(move2);\n\n\t\t// make valid move\n\t\tmove2.clearMove();\n\t\tmove2.addTile(square4, tile4);\n\t\tmove2.addTile(square5, tile5);\n\t\tmove2.addTile(square6, tile6);\n\t\tscrabbleSystem.playMove(move2);\n\n\t\tint scoreSum2 = tile2.getValue() + tile4.getValue() * 2 + tile5.getValue() * 2 + tile6.getValue();\n\t\tassertEquals(scoreSum2, currentPlayer2.getScore());\n\n\t\t// get the challenge player\n\t\tPlayer challengePlayer2 = playersList.get(0);\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tPlayer playerTmp = playersList.get(i);\n\t\t\tif (playerTmp != currentPlayer1) {\n\t\t\t\tchallengePlayer2 = playerTmp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tassertEquals(64, scrabbleSystem.getLetterBag().getNumber());\n\n\t\tscrabbleSystem.challenge(challengePlayer2);\n\t\tscrabbleSystem.updateOrder();\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\t\tassertFalse(square4.isOccuppied());\n\t\tassertFalse(square5.isOccuppied());\n\t\tassertFalse(square6.isOccuppied());\n\n\t\t/**\n\t\t * The third turn -- buy a Boom special tile and pass this turn\n\t\t */\n\n\t\tPlayer currentPlayer3 = scrabbleSystem.getCurrentPlayer();\n\t\tMove move3 = scrabbleSystem.getMove();\n\t\tcurrentPlayer3.addScore(100);\n\t\tscrabbleSystem.buySpecialTile(\"Boom\");\n\t\tassertEquals(80, currentPlayer3.getScore());\n\n\t\tSquare square8 = scrabbleSystem.getBoard().getSquare(8, 8);\n\t\tSquare square9 = scrabbleSystem.getBoard().getSquare(9, 8);\n\t\tSquare square10 = scrabbleSystem.getBoard().getSquare(10, 8);\n\t\tSquare square11 = scrabbleSystem.getBoard().getSquare(10, 7);\n\n\t\tTile tile8 = currentPlayer3.getTileList().get(0);\n\t\tTile tile9 = currentPlayer3.getTileList().get(1);\n\t\tTile tile10 = currentPlayer3.getTileList().get(2);\n\t\tSpecialTile specialTile = currentPlayer3.getSpecialTiles().get(\"Boom\").get(0);\n\t\tmove3.addTile(square8, tile8);\n\t\tmove3.addTile(square9, tile9);\n\t\tmove3.addTile(square10, tile10);\n\t\tmove3.addSpecialTile(specialTile, square11);\n\n\t\tint scoreSum3 = 2 * tile8.getValue() + tile9.getValue() + tile10.getValue() + 2 * tile8.getValue()\n\t\t\t\t+ tile2.getValue() + tile3.getValue() + tile9.getValue() + 80;\n\t\tscrabbleSystem.playMove(move3);\n\t\tassertEquals(scoreSum3, currentPlayer3.getScore());\n\t\tscrabbleSystem.challenge(currentPlayer2);\n\t\tassertEquals(67, scrabbleSystem.getLetterBag().getNumber());\n\t\tassertTrue(square11.hasSpecialTile());\n\n\t\t/**\n\t\t * The fourth turn -- buy a NegativePoint special tile and place it on\n\t\t * the board\n\t\t */\n\t\tPlayer currentPlayer4 = scrabbleSystem.getCurrentPlayer();\n\t\tcurrentPlayer4.addScore(10);\n\t\tscrabbleSystem.buySpecialTile(\"NegativePoint\");\n\t\tassertEquals(1, currentPlayer4.getSpecialTiles().get(\"NegativePoint\").size());\n\n\t\tcurrentPlayer4.addScore(50);\n\t\tSystem.out.println(currentPlayer4.getScore());\n\t\tscrabbleSystem.buySpecialTile(\"NegativePoint\");\n\t\tint scoreSum4 = currentPlayer4.getScore();\n\n\t\tMove move4 = scrabbleSystem.getMove();\n\t\tSpecialTile specialTile2 = currentPlayer4.getSpecialTiles().get(\"NegativePoint\").get(0);\n\n\t\tSquare square12 = scrabbleSystem.getBoard().getSquare(11, 7);\n\t\tmove4.addSpecialTile(specialTile2, square12);\n\n\t\tscrabbleSystem.pass(move4);\n\t\tassertEquals(scoreSum4, currentPlayer4.getScore());\n\t\tassertTrue(square12.hasSpecialTile());\n\t\tassertEquals(1, currentPlayer4.getSpecialTiles().get(\"NegativePoint\").size());\n\n\t\t/**\n\t\t * The fifth turn -- invork the Boom and NegativePoint special tiles at\n\t\t * the same time\n\t\t */\n\t\tPlayer currentPlayer5 = scrabbleSystem.getCurrentPlayer();\n\t\tMove move5 = scrabbleSystem.getMove();\n\t\tSquare square13 = scrabbleSystem.getBoard().getSquare(10, 7);\n\t\tSquare square14 = scrabbleSystem.getBoard().getSquare(11, 7);\n\t\tSquare square15 = scrabbleSystem.getBoard().getSquare(12, 7);\n\t\tSquare square16 = scrabbleSystem.getBoard().getSquare(13, 7);\n\t\tSquare square17 = scrabbleSystem.getBoard().getSquare(14, 7);\n\n\t\tTile tile13 = currentPlayer5.getTileList().get(0);\n\t\tTile tile14 = currentPlayer5.getTileList().get(1);\n\t\tTile tile15 = currentPlayer5.getTileList().get(2);\n\t\tTile tile16 = currentPlayer5.getTileList().get(3);\n\t\tTile tile17 = currentPlayer5.getTileList().get(4);\n\n\t\tmove5.addTile(square13, tile13);\n\t\tmove5.addTile(square14, tile14);\n\t\tmove5.addTile(square15, tile15);\n\t\tmove5.addTile(square16, tile16);\n\t\tmove5.addTile(square17, tile17);\n\t\tscrabbleSystem.playMove(move5);\n\t\tassertFalse(square13.isOccuppied());\n\t\tassertFalse(square14.isOccuppied());\n\t\tassertFalse(square15.isOccuppied());\n\t\tassertFalse(square2.isOccuppied());\n\t\tassertFalse(square3.isOccuppied());\n\t\tassertTrue(square1.isOccuppied());\n\t\tscrabbleSystem.updateOrder();\n\n\t\tint scoreSum5 = scoreSum1 - 3 * (tile13.getValue() + tile14.getValue() + tile1.getValue());\n\t\tSystem.out.println(scoreSum5);\n\n\t\t/**\n\t\t * The sixth turn -- The player exchanges some tiles\n\t\t */\n\t\tPlayer currentPlayer6 = scrabbleSystem.getCurrentPlayer();\n\t\tList<Tile> tiles = new ArrayList<>();\n\t\tTile tile18 = currentPlayer6.getTileList().get(0);\n\t\tTile tile19 = currentPlayer6.getTileList().get(1);\n\t\tTile tile20 = currentPlayer6.getTileList().get(2);\n\t\ttiles.add(tile18);\n\t\ttiles.add(tile19);\n\t\ttiles.add(tile20);\n\t\tscrabbleSystem.exchangeTile(tiles);\n\t\tassertEquals(7, currentPlayer6.getTileList().size());\n\n\t\t/**\n\t\t * Get winner\n\t\t */\n\n\t\tList<Player> playersWinner = scrabbleSystem.getWinner();\n\t\tassertEquals(currentPlayer3.getName(), playersWinner.get(0).getName());\n\t}", "@Test\n\tpublic void testMainScenario() {\n\t\tProject project = this.db.project().create(\"Test project\", 200, \"13-05-2014\", null);\n\n//Test #1\t\t\n\t\tassertEquals(project.getActivities().size(), 0);\n\t\tassertEquals(project.getEstPercentageCompletion(), 0);\n\t\tassertEquals(project.getEstHoursRemaining(), 200);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 0);\n\t\tassertEquals(project.getHoursRegistered(), 0);\n\t\t\n\t\tActivity activity1 = this.db.activity().createProjectActivity(project.getId(), \"activity1\", 10, this.stringDateTimeToLong(\"01-05-2013 01:00\"), this.stringDateTimeToLong(\"01-05-2014 01:00\"));\n\t\tActivity activity2 = this.db.activity().createProjectActivity(project.getId(), \"activity2\", 10, this.stringDateTimeToLong(\"01-05-2013 01:00\"), this.stringDateTimeToLong(\"01-05-2014 01:00\"));\n\n//Test #2\t\t\n\t\tassertEquals(project.getActivities().size(), 2);\n\t\tassertEquals(project.getEstPercentageCompletion(), 0);\n\t\tassertEquals(project.getEstHoursRemaining(), 200);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 0);\n\t\t\n\t\tDeveloper developer = this.db.developer().readByInitials(\"JL\").get(0);\n\t\tDeveloper developer2 = this.db.developer().readByInitials(\"PM\").get(0);\n\t\tDeveloper developer3 = this.db.developer().readByInitials(\"GH\").get(0);\n\t\tDeveloper developer4 = this.db.developer().readByInitials(\"RS\").get(0);\n\t\tactivity1.addDeveloper(developer);\n\t\tactivity1.addDeveloper(developer2);\n\t\tactivity1.addDeveloper(developer3);\n\t\tactivity1.addDeveloper(developer4);\n\n//Test #3\n\t\t//Tests that the initials of all developers are stored correctly\t\t\n\t\tassertEquals(activity1.getAllDevsInitials(),\"JL,PM,GH,RS\");\n\t\tassertEquals(activity1.getAllDevsInitials() == \"The Beatles\", false); //Please fail!\n\t\t\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"11-05-2013 06:30\"), this.stringDateTimeToLong(\"11-05-2013 09:30\"), developer.getId(), activity1.getId(), false);\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"11-05-2013 06:30\"), this.stringDateTimeToLong(\"11-05-2013 09:30\"), developer2.getId(), activity1.getId(), false);\n\t\t\n\t\t//Showed in the project maintainance view, and is relevant to the report\n\t\tassertEquals(activity1.getHoursRegistered(),6);\n\t\t\n//Test #4\n\t\t//Tests normal registration\t\t\n\t\tassertEquals(project.getEstPercentageCompletion(), 3);\n\t\tassertEquals(project.getEstHoursRemaining(), 194);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 6);\n\t\t\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"12-05-2013 06:30\"), this.stringDateTimeToLong(\"12-05-2013 09:30\"), developer3.getId(), activity2.getId(), true);\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"12-05-2013 06:30\"), this.stringDateTimeToLong(\"12-05-2013 09:30\"), developer4.getId(), activity2.getId(), true);\n\n//Test #5\n\t\t//Tests that assits also count\t\t\n\t\tassertEquals(project.getEstPercentageCompletion(), 6);\n\t\tassertEquals(project.getEstHoursRemaining(), 188);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 12);\n\t}", "@Test\r\n void testTitForTatWithHistoryDefect() {\r\n TitForTat testStrat = new TitForTat();\r\n AlwaysDefect testStrat2 = new AlwaysDefect();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 2, payoffs);\r\n game.playGame();\r\n int points = testStrat.getPoints();\r\n assertEquals(points, 1, \"tit for tat not returning \"\r\n + \"correctly against defecting opponent\"); \r\n }", "@Test\n public void test13() { \n Board board13 = new Board();\n board13.put(1,1,1); \n board13.put(1,2,1);\n board13.put(1,3,2);\n board13.put(2,1,2);\n board13.put(2,2,2);\n board13.put(2,3,1);\n board13.put(3,1,1);\n board13.put(3,2,1);\n board13.put(3,3,2);\n assertTrue(board13.checkTie());\n }", "@Test\n\tvoid fillDrawTest() {\n\t\tMainPlay.getPlayer1Discard().add(2); //Adding the elements to discarded pile and the draw pile does not contain any elements as of now\n\t\tMainPlay.getPlayer1Discard().add(4);\n\t\tMainPlay.getPlayer2Discard().add(1);\n\t\tMainPlay.getPlayer2Discard().add(2);\n\t\tMainPlay.playTurn(); // Calling the function where the process of filling draw pile happens\n\t\tSystem.out.println(\"The discarded pile of player1 after comparing: \"+MainPlay.getPlayer1Discard());\n\t\tassertEquals(MainPlay.getPlayer1Discard().size(),4,\"The test failed as the draw pile cannot be updated\");\n\t\t//After the playTurn function the the draw pile of player1 and player 2 gets loaded and the comparison happens and as we can see the player1 cards are hight valued \n\t\t// in both the turns hence his discarded pile should be having 4 elements in the end to pass the test\n\t}", "@Test\n public void TEST_FR_SELECTDIFFICULTY_UI() {\n GameData.gameDifficulty = \"unchanged\";\n ChooseDifficultyUI testUI = new ChooseDifficultyUI();\n clickButton(testUI, 1, \"easy\");\n clickButton(testUI, 2, \"medium\");\n clickButton(testUI, 3, \"hard\");\n }", "@Test\n\tpublic void Cases_23275_execute() throws Exception {\n\t\tVoodooUtils.voodoo.log.info(\"Running \" + testName + \"...\");\n\n\t\t// Go to Active tasks dashlet\n\t\t// TODO: VOOD-960 - Dashlet selection \n\t\tnew VoodooControl(\"span\", \"css\", \".row-fluid > li div span a span\").click();\n\t\tnew VoodooControl(\"a\", \"css\", \"[data-dashletaction='createRecord']\").click();\n\t\tsugar().tasks.createDrawer.getEditField(\"subject\").set(testName);\n\t\tsugar().tasks.createDrawer.save();\n\t\tif(sugar().alerts.getSuccess().queryVisible()) {\n\t\t\tsugar().alerts.getSuccess().closeAlert();\n\t\t}\n\n\t\t// refresh the Dashlet\n\t\tnew VoodooControl(\"a\", \"css\", \".dashboard-pane ul > li > ul > li .btn-group [title='Configure']\").click();\n\t\tnew VoodooControl(\"a\", \"css\", \"li > div li div [data-dashletaction='refreshClicked']\").click();\n\t\tVoodooUtils.waitForReady();\n\n\t\t// Verify task is in Active-Task Dashlet (i.e in TODO tab, if we have no related date for that record)\n\t\tnew VoodooControl(\"div\", \"css\", \"div[data-voodoo-name='active-tasks'] .dashlet-unordered-list .dashlet-tabs-row div.dashlet-tab:nth-of-type(3)\").click();\n\t\tnew VoodooControl(\"div\", \"css\", \"div.tab-pane.active p a:nth-of-type(2)\").assertEquals(testName, true);\n\n\t\tVoodooUtils.voodoo.log.info(testName + \" complete.\");\n\t}", "@Test(enabled = true, retryAnalyzer=RetryAnalyzer.class)\r\n\tpublic void testParkingResrvSummeryAndPrintTabs(){\r\n\r\n\t\tReporter.log(\"<span style='font-weight:bold;color:#000033'> \"\r\n\r\n\t\t +\"test:C74386: Summary and Printing are not available, if required field is not filled out for parking Reservation\", true);\r\n\r\n\r\n\t\tString region = \"1preRgRef\";\r\n\r\n\t\tint random = (int)(Math.random() * 10)+18;\r\n\r\n\t\tString date = this.getFutureDate(random);\r\n\r\n\t\tString from = \"01:00\";\r\n\t\tString until = \"01:30\";\r\n\r\n\t\tString parking = \"1prePrkEqRef\";\r\n\t\t String summaryTabText= \"A summary is not available for the currently entered data\\n\"\r\n\t\t\t\t +\"\\n\"+\r\n\t\t\t\t \"Please fill in the Reservation Responsible.\\n\"+\r\n\t\t\t\t \"\\n\"+\"Please make sure you have filled out all mandatory fields.\";\r\n\t\t \r\n\r\n\t\tString printIconWarningMsg =\"Printing requires all changes to be saved first\";\r\n\r\n\t\tSoftAssert softAssert = new SoftAssert();\r\n\r\n\t\tsoftAssert.setMethodName(\"testParkingResrvSummeryAndPrintTabs\");\r\n\r\n\t\texpandAdministration();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\texpandSubMainMenu(\"Reservation\");\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\twaitAndClick(XPATH_NEWRESERVATIONS);\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\t//waitForExtJSAjaxComplete(20);\r\n\r\n\t\tsetRegion(region);\r\n\r\n\t\tsetDate(date);\r\n\r\n\t\tsetTimeFrom(from);\r\n\r\n\t\tsetTimeUntil(until);\r\n\r\n\t\twaitForExtJSAjaxComplete(5);\r\n\r\n\t\tclickParkingTab();\r\n\r\n\t\twaitForExtJSAjaxComplete(5);\r\n\r\n\t\tclickSearch();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tclickLaunchReservation(parking);\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tclickSummaryTab();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tsoftAssert.assertEquals(getSummaryTabText(),summaryTabText,\"'A summary is not available for the currently entered data' is display with a message to fill out required fields.\");\r\n\r\n\t\tclickReportIconInSummarySection();\r\n\r\n\t\twaitForExtJSAjaxComplete(20);\r\n\r\n\t\tsoftAssert.assertTrue(verifyWarningDialogTextMessage(printIconWarningMsg),\"'Printing requires all changes to be saved first' alert message is displayed.\");\r\n\r\n\t\tthis.clickOnDialogButton(\"OK\");\r\n\r\n\t\tsoftAssert.assertAll();\r\n\r\n\t\tReporter.log(\"Summary pane is display with a message to fill out required fields.\"\r\n\t\t\t\t+ \"Alert message is displayed for print icon <br>\", true);\r\n\t}", "@Test\n public void testNextWaiting() {\n }", "@Test(description = \"Verify that task is created and visual editor is visible\")\n public void verifyIfHighPriority() {\n\n LoginPage loginPage = new LoginPage();\n TaskPage taskPage = new TaskPage();\n loginPage.login(\"[email protected]\", \"UserUser\");\n\n test = report.createTest(\"Task tab is visible!\");\n Assert.assertEquals(taskPage.taskTab(\"Demo Meeting!\"), \"TASK\");\n test.pass(\"Task tab is visible\");\n\n\n test = report.createTest(\"High Priority checkbox is clicked\");\n Assert.assertEquals(taskPage.highPriorityLabel(), \"High Priority\");\n taskPage.highPriorityCheckBox();\n test.pass(\"High Priority checkbox visible and clickable\");\n\n\n test = report.createTest(\"Visual editor is visible and the bar is displayed\");\n taskPage.visualEditor();\n taskPage.visualEditorBarIsDisplayed();\n Assert.assertTrue(taskPage.visualEditorBarIsDisplayed());\n test.pass(\"Visual editor is clicked and the bar is displayed\");\n\n }", "public void testGameSetupCorrectly() throws Throwable {\n GameSetupFragment gameSetupFragment = GameSetupFragment.newInstance();\n Fragment fragPost = startFragment(gameSetupFragment, \"4\");\n assertNotNull(fragPost);\n\n //4x4 should give 16 in adapter\n final GameFragment gameFragment = GameFragment.newInstance(\"4x4\");\n startFragment(gameFragment, \"5\");\n assertNotNull(gameFragment);\n\n //check that two of each number have been placed on the board\n CubeView.Adapter adapter = (CubeView.Adapter) gameFragment.cubeGrid.getAdapter();\n\n int numCubes = adapter.getCount();\n assertEquals(16, numCubes);\n\n final int[] leftCounts = new int[8];\n final int[] topCounts = new int[8];\n final int[] rightCounts = new int[8];\n final int[] bottomCounts = new int[8];\n\n final ArrayList<CubeView> cubes = adapter.cubes;\n\n runTestOnUiThread(new Runnable() {\n @Override\n public void run() {\n for (CubeView cube : cubes) {\n for(int j = 0; j < 4; j++) {\n switch(j) {\n case 0: leftCounts[cube.showLeft()]++;\n break;\n case 1: topCounts[cube.showTop()]++;\n break;\n case 2: rightCounts[cube.showRight()]++;\n break;\n case 3: bottomCounts[cube.showBottom()]++;\n break;\n }\n }\n }\n }\n });\n\n for(int i = 0; i < 8; i++) {\n assertEquals(2, leftCounts[i]);\n assertEquals(2, topCounts[i]);\n assertEquals(2, rightCounts[i]);\n assertEquals(2, bottomCounts[i]);\n }\n\n //========================================\n // Test the settings.xml parsing functions\n //========================================\n\n Settings settings = Settings.deserialize();\n // Test theme parsing\n settings.setTheme(\"Red\");\n assertEquals(\"red\",settings.getTheme());\n settings.setTheme(\"green\");\n assertEquals(\"green\",settings.getTheme());\n // Test topic parsing\n settings.setTopic(\"Reptile\");\n assertEquals(\"reptile\", settings.getTopic());\n settings.setTopic(\"fish\");\n assertEquals(\"fish\", settings.getTopic());\n settings.setTopic(\"Mammal\");\n assertEquals(\"mammal\", settings.getTopic());\n\n // Test fling parsing\n settings.setFling(false);\n assertEquals(false, settings.isFling());\n settings.setFling(true);\n assertEquals(true, settings.isFling());\n // Test swipe parsing\n settings.setSwipe(false);\n assertEquals(false, settings.isSwipe());\n settings.setSwipe(true);\n assertEquals(true, settings.isSwipe());\n }", "@Test\n\tpublic void testResultadosEsperados() {\n\t\t\n\t\t\n\t\t\n\t\tbicicleta.darPedalada(utilidadesCiclista.getCadencia(), 75);\n\t\t\n\t\t\n\t\t//se comprueba que la velocidad sea la esperada\n\t\t\n\t\tdouble velocidadesperada = utilidadesBicicleta.velocidadDeBici(0, utilidadesCiclista.getCadencia(), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t65, bicicleta.getRadiorueda(), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbicicleta.getPlatos()[bicicleta.getPlatoactual()], \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbicicleta.getPinhones()[bicicleta.getPinhonactual()]);\n\t\t\n\t\t\n\t\tassertEquals(\"Error: La velocidad de la bicicleta no es la correcta\", velocidadesperada, bicicleta.getVelocidad(), 2);\n\t\t\n\t\t\n\t\t//se comprueba que el espacio de la pedalada sea el esperado\n\t\t\n\t\tdouble espaciodelapedaladaesperado = utilidadesBicicleta.espacioDePedalada(bicicleta.getRadiorueda(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbicicleta.getPlatos()[bicicleta.getPlatoactual()], \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbicicleta.getPinhones()[bicicleta.getPinhonactual()]);\n\t\t\n\t\tassertEquals(\"Error: El espacio recorrido de la bicicleta no es el correcta\", espaciodelapedaladaesperado, utilidadesBicicleta.espacioDePedalada(bicicleta.getRadiorueda(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbicicleta.getPlatos()[bicicleta.getPlatoactual()],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbicicleta.getPinhones()[bicicleta.getPinhonactual()]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t), 0);\n\t\t\n\t\t\n\t\t//se comprueba que la relacion de transmision sea la esperada\n\t\t\n\t\tdouble relaciondeetransmisionesperado = utilidadesBicicleta.relacionDeTransmision(bicicleta.getPlatos()[bicicleta.getPlatoactual()], \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbicicleta.getPinhones()[bicicleta.getPinhonactual()]);\n\t\t\n\t\tassertEquals(\"Error: El espacio recorrido de la bicicleta no es el correcta\", relaciondeetransmisionesperado, utilidadesBicicleta.relacionDeTransmision(bicicleta.getPlatos()[bicicleta.getPlatoactual()],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbicicleta.getPinhones()[bicicleta.getPinhonactual()]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t), 0);\n\t\t\n\t\t\n\t\t//se comprueba que el recorrido lineal sea el esperado\n\t\t\n\t\tdouble recorridoLinealDeLaRuedaesperado = utilidadesBicicleta.recorridoLinealDeLaRueda(bicicleta.getRadiorueda());\n\t\t\n\t\tassertEquals(\"Error: El espacio recorrido de la bicicleta no es el correcta\", recorridoLinealDeLaRuedaesperado, utilidadesBicicleta.recorridoLinealDeLaRueda(bicicleta.getRadiorueda()), 0);\n\t\t\n\t\t\n\t\t\n\t\t//Se comprueban las variables despues de frenar\n\t\t\n\t\tbicicleta.frenar();\n\t\t\n\t\t//se comprueba que la velocidad halla decrementado como esperamos despues de frenar\n\t\t\n\t\tdouble velocidadfrenado = utilidadesBicicleta.velocidadDeBici(0, 1, 65, bicicleta.getRadiorueda(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbicicleta.getPlatos()[bicicleta.getPlatoactual()], \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbicicleta.getPinhones()[bicicleta.getPinhonactual()]);\n\t\t\n\t\tvelocidadfrenado = -(velocidadfrenado *0.2);\n\t\t\n\t\tdouble velocidadesperadafrenando = UtilidadesNumericas.redondear(velocidadesperada + velocidadfrenado,1);\n\n\t\tassertEquals(\"Error: La velocidad de frenado de la bicicleta no es la correcta\", velocidadesperadafrenando, UtilidadesNumericas.redondear(bicicleta.getVelocidad(),1),2);\n\t\t\n\t\t\n\t\t\n\t\t//Se comprueban que los piñones se incremente y decrementen correctamente\n\t\t\n\t\tint incrementarpinhonesperado = bicicleta.getPinhonactual() +1;\n\t\t\n\t\tbicicleta.incrementarPinhon();\n\t\t\n\t\tassertEquals(\"Error: El incremento de piñon de la bicicleta no es la correcta\", incrementarpinhonesperado, bicicleta.getPinhonactual(), 0);\n\t\t\n\t\tint decrementarpinhonesperado = bicicleta.getPinhonactual() -1;\n\t\t\t\n\t\tbicicleta.decrementarPinhon();\n\t\t\n\t\tassertEquals(\"Error: El decremento de piñon de la bicicleta no es la correcta\", decrementarpinhonesperado, bicicleta.getPinhonactual(), 0);\n\t\t\n\t\t\n\t\t\n\t\t//Se comprueban que los platos se incremente y decrementen correctamente\n\t\t\n\t\tint incrementarplatoesperado = bicicleta.getPlatoactual() +1;\n\t\t\n\t\tbicicleta.incrementarPlato();\n\t\t\n\t\tassertEquals(\"Error: El incremento del plato de la bicicleta no es la correcta\", incrementarplatoesperado, bicicleta.getPlatoactual(), 2);\n\t\t\n\t\tint decrementarplatoesperado = bicicleta.getPlatoactual() -1;\n\t\t\n\t\tbicicleta.decrementarPlato();\n\t\t\n\t\tassertEquals(\"Error: El decremento de piñon de la bicicleta no es la correcta\", decrementarplatoesperado, bicicleta.getPlatoactual(), 0);\n\t}", "public void runTests() throws Exception {\n\t\tArrayList<KaidaComposer> als = getCrossOverPermutationTest();\r\n//\t\tArrayList<KaidaComposer> als = getMutationProbabilityTests();\r\n\t\t\r\n\t\tsynchronized (results) {\r\n\t\t\tresults.clear();\r\n\t\t\tfor (KaidaComposer al : als) {\r\n\t\t\t\tresults.add(new TestRunGenerationStatistics(nrOfContests,nrOfGenerations,al.getLabel(),al));\t\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tsetProgress(0f);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tfor (int runs = 0; runs < nrOfContests; runs++) {\r\n\t\t\t//run the test n times\r\n\t\t\t\r\n\t\t\t\tSystem.out.println(\"\\nContest Nr. \" + runs + \" started\");\r\n\t\t\t\tTimer t = new Timer(\"Contest Nr. \" + runs);\r\n\t\t\t\tt.start();\r\n\t\t\t\t\r\n\t\t\t\tfor (KaidaComposer algorithm : als) {\r\n\t\t\t\t\talgorithm.restartOrTakeOver();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfor (int g = 0; g < nrOfGenerations; g++) {\r\n\t\t\t\t\t//do one evolution step\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (KaidaComposer algorithm : als) {\r\n\t\t\t\t\t\tif (algorithm.isCycleCompleted()) {\r\n\t\t\t\t\t\t\talgorithm.startNextCycle();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\talgorithm.doOneEvolutionCycle();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tt.stopAndPrint();\r\n\t\t\t\tt.start(\"Adding to results\");\r\n\t\t\t\tsynchronized (results) {\r\n\t\t\t\t\tfor (int z=0; z < als.size(); z++) {\r\n\t\t\t\t\t\tresults.get(z).addTestRun(als.get(z).getGenerations().getRange(0,nrOfGenerations));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tt.stopAndPrint();\r\n\t\t\t\tt.start(\"Calculating statistics\");\r\n\t\t\t\tsynchronized (results) {\r\n\t\t\t\t\tfor (int z=0; z < als.size(); z++) {\r\n\t\t\t\t\t\tresults.get(z).calculateStats();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tt.stopAndPrint();\r\n\t\t\t\t\r\n\t\t\t\tsetProgress((double)runs/(double)(nrOfContests-1));\r\n\t\t\t\t\r\n\t\t\t\tif (pause!=0) {\r\n\t\t\t\t\tsleep(pause);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (isPleasePause()) break;\r\n\t\t\t}\r\n\t\t\tsynchronized (results) {\r\n\t\t\t\tfor (int z=0; z < als.size(); z++) { //als.size()\r\n\t\t\t\t\tresults.get(z).calculateStats();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetProgress(1.0f);\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t//fail(\"al threw some Exception\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\t\r\n\t}", "@Test\n public void solve1() {\n }", "@Test(enabled = true, retryAnalyzer=RetryAnalyzer.class)\r\n\tpublic void testParkingBookingPreparationTimeAndCleanupNotConsidered() throws IOException{\r\n\t\tReporter.log(\"<span style='font-weight:bold;color:#000033'> \"\r\n\t\t\t\t+ \"C118064: Preparation and Cleanup time should not be considered while calculating Total Cost in Parking reservation\", true);\r\n\r\n\t\t int random = (int)(Math.random() * 10)+24;\r\n\t\t String date = this.getFutureDate(random);\r\n\t\t String region = \"1preRgRef\";\r\n\t\t String from = \"18:00\";\r\n\t\t String until = \"19:00\";\r\n\t\t String prakingResv = \"prePrkDefRef\";\r\n\t\t String prepTime = \"00:30\";\r\n\t\t String cleanupTime = \"00:30\";\r\n\t\t String responsible=getUserLastNameOfLoggedInUser();\r\n\r\n\t\t SoftAssert softAssert = new SoftAssert();\r\n\t\t softAssert.setMethodName(\"testParkingBookingPreparationTimeAndCleanupNotConsidered\");\r\n\t\t \r\n\t\t expandAdministration();\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t expandSubMainMenu(\"Reservation\");\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t waitAndClick(XPATH_NEWRESERVATIONS);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t //C118064\r\n\t\t setRegion(region);\r\n\t\t setDate(date);\r\n\t\t setTimeFrom(from);\r\n\t\t setTimeUntil(until);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t clickParkingTab();\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t clickSearch();\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t clickLaunchReservation(prakingResv);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t setTimePrepareFromReservationPanel(prepTime);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t setTimeCleanupFromReservationPanel(cleanupTime);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t setResponsible(responsible);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t clickSummaryTab();\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t String getSummaryText = getItemDetailsFromReservationSummary(prakingResv);\r\n\t\t softAssert.assertTrue( getSummaryText.contains(\"1 h x 4.00 EUR\"),\"Total cost is calculated without considering Prepare/Cleanup time\");\r\n\t\t softAssert.assertTrue(getSummaryTitle().contains(\"4.04 EUR\"),\"summary title is ok before adding additional Equipment, Vehicles & Parking\");\r\n\t}", "@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\r\n public void testPartido2() throws Exception { \r\n P2.fijarEquipos(\"Barça\",\"Depor\"); \r\n P2.comenzar(); \r\n P2.tantoLocal();\r\n P2.terminar(); \r\n assertEquals(\"Barça\",P2.ganador());\r\n }", "@Test\n @DisplayName(\"Action Marker Production Yellow And Buy Test\")\n public void ActionMarkerProductionYellowAndBuyTest() throws IOException, InterruptedException {\n ActionMarkerProductionYellow actionMarker = new ActionMarkerProductionYellow();\n Server server= new Server();\n ClientHandler clientHandler= new ClientHandler(server);\n ClientController clientController= new ClientController(server,clientHandler) ;\n VirtualView virtualView = new VirtualView(clientController);\n\n GameSolitaire game = new GameSolitaire(\"Ali\",true,clientController);\n\n assertEquals(4, game.productionDeckSize(9));\n assertEquals(4, game.productionDeckSize(10));\n assertEquals(4, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(2, game.productionDeckSize(9));\n assertEquals(4, game.productionDeckSize(10));\n assertEquals(4, game.productionDeckSize(11));\n\n try {\n game.deckFromDeckNumber(11).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(1, game.productionDeckSize(9));\n assertEquals(4, game.productionDeckSize(10));\n assertEquals(4, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(3, game.productionDeckSize(10));\n assertEquals(4, game.productionDeckSize(11));\n\n try {\n game.deckFromDeckNumber(3).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(3, game.productionDeckSize(10));\n assertEquals(3, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(1, game.productionDeckSize(10));\n assertEquals(3, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(0, game.productionDeckSize(10));\n assertEquals(2, game.productionDeckSize(11));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(9));\n assertEquals(0, game.productionDeckSize(10));\n assertEquals(0, game.productionDeckSize(11));\n\n FileClass.FileDestroyer();\n\n }", "@Test\n public void makeMoveTest() {\n\n //get the board of the enemy with the method getBoard() from enemyGameBoard\n board = enemyGameBoard.getBoard();\n\n //try two times to hit a field on the board that is water, and after that assert it is done succesfully\n enemyGameBoard.makeMove(2, 3, false);\n assertTrue(board[2][3].equals(EnemyGameBoard.WATER_HIT));\n enemyGameBoard.makeMove(9, 9, false);\n assertTrue(board[9][9].equals(EnemyGameBoard.WATER_HIT));\n\n //try two times to hit a field on the board that is not water, and after that assert it is done succesfully\n enemyGameBoard.makeMove(5, 4, true);\n assertTrue(board[5][4].equals(EnemyGameBoard.SHIP_HIT));\n enemyGameBoard.makeMove(8, 1, true);\n assertTrue(board[8][1].equals(EnemyGameBoard.SHIP_HIT));\n }", "@Test\n\tpublic void completeHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfCompleteHires() == 2);\n\t}", "@Test\n\tpublic void testPrimeActionnairePrincipal(){\n\t\tassertEquals(2000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 2));\n\t\tassertEquals(3000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 3));\n\t\tassertEquals(4000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 4));\n\t\tassertEquals(5000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 5));\n\t\tassertEquals(6000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 6));\n\t\tassertEquals(6000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 8));\n\t\tassertEquals(6000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 10));\n\t\tassertEquals(7000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 11));\n\t\tassertEquals(7000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 15));\n\t\tassertEquals(7000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 20));\n\t\tassertEquals(8000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 21));\n\t\tassertEquals(8000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 22));\n\t\tassertEquals(8000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 30));\n\t\tassertEquals(9000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 31));\n\t\tassertEquals(9000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 33));\n\t\tassertEquals(9000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 40));\n\t\tassertEquals(10000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 41));\n\t\tassertEquals(10000, TypeChaine.primeActionnairePrincipal(TypeChaine.SACKSON, 42));\n\n\t\t// cas categorie hotel = 2\n\t\tassertEquals(3000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 2));\n\t\tassertEquals(4000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 3));\n\t\tassertEquals(5000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 4));\n\t\tassertEquals(6000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 5));\n\t\tassertEquals(7000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 6));\n\t\tassertEquals(7000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 8));\n\t\tassertEquals(7000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 10));\n\t\tassertEquals(8000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 11));\n\t\tassertEquals(8000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 15));\n\t\tassertEquals(8000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 20));\n\t\tassertEquals(9000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 21));\n\t\tassertEquals(9000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 22));\n\t\tassertEquals(9000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 30));\n\t\tassertEquals(10000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 31));\n\t\tassertEquals(10000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 33));\n\t\tassertEquals(10000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 40));\n\t\tassertEquals(11000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 41));\n\t\tassertEquals(11000, TypeChaine.primeActionnairePrincipal(TypeChaine.HYDRA, 42));\n\n\t\t// cas categorie hotel = 3\n\t\tassertEquals(4000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 2));\n\t\tassertEquals(5000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 3));\n\t\tassertEquals(6000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 4));\n\t\tassertEquals(7000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 5));\n\t\tassertEquals(8000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 6));\n\t\tassertEquals(8000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 8));\n\t\tassertEquals(8000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 10));\n\t\tassertEquals(9000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 11));\n\t\tassertEquals(9000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 15));\n\t\tassertEquals(9000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 20));\n\t\tassertEquals(10000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 21));\n\t\tassertEquals(10000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 22));\n\t\tassertEquals(10000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 30));\n\t\tassertEquals(11000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 31));\n\t\tassertEquals(11000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 33));\n\t\tassertEquals(11000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 40));\n\t\tassertEquals(12000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 41));\n\t\tassertEquals(12000, TypeChaine.primeActionnairePrincipal(TypeChaine.PHOENIX, 42));\n\t}", "@Test\n @DisplayName(\"Action Marker Production Green And Buy Test\")\n public void ActionMarkerProductionGreenAndBuyTest() throws IOException, InterruptedException {\n ActionMarkerProductionGreen actionMarker = new ActionMarkerProductionGreen();\n Server server= new Server();\n ClientHandler clientHandler= new ClientHandler(server);\n ClientController clientController= new ClientController(server,clientHandler) ;\n VirtualView virtualView = new VirtualView(clientController);\n\n GameSolitaire game = new GameSolitaire(\"Ali\",true,clientController);\n\n assertEquals(4, game.productionDeckSize(3));\n assertEquals(4, game.productionDeckSize(4));\n assertEquals(4, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(2, game.productionDeckSize(3));\n assertEquals(4, game.productionDeckSize(4));\n assertEquals(4, game.productionDeckSize(5));\n\n try {\n game.deckFromDeckNumber(9).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(1, game.productionDeckSize(3));\n assertEquals(4, game.productionDeckSize(4));\n assertEquals(4, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(3, game.productionDeckSize(4));\n assertEquals(4, game.productionDeckSize(5));\n\n try {\n game.deckFromDeckNumber(1).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(3, game.productionDeckSize(4));\n assertEquals(3, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(1, game.productionDeckSize(4));\n assertEquals(3, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(0, game.productionDeckSize(4));\n assertEquals(2, game.productionDeckSize(5));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(3));\n assertEquals(0, game.productionDeckSize(4));\n assertEquals(0, game.productionDeckSize(5));\n\n FileClass.FileDestroyer();\n\n }", "@Test\n public void doTest4() {\n }", "@org.junit.Test\n public void testEstDivisibleParOK() {\n //given\n long n = 2;\n long div = 10;\n Parfait instance = new Parfait();\n\n //when\n boolean result = instance.estDivisiblePar(n, div);\n\n //then\n Assert.assertTrue(\"OK\", result);\n }", "@Test(dataProvider = \"testData\")\r\n\r\n public void createVacancyTest(String CVOption, String jobVisibility) throws InterruptedException {\r\n //STEP 1\r\n homePage.getSideBar().clickOnJobsMenu();\r\n Assert.assertTrue(jobsPage.isDisplayed());\r\n\r\n //STEP 2\r\n jobsPage.addNewJob();\r\n Assert.assertTrue(newJobPage.isDisplayed());\r\n Assert.assertTrue(newJobPage.getDetails().isDisplayed());\r\n\r\n //STEP 3\r\n newJobPage.getDetails().enterJobTitle(jobTitle);\r\n\r\n //STEP 4\r\n newJobPage.getDetails().enterJobLocation(randomCountry());\r\n Assert.assertTrue(newJobPage.getSearchSuggestion().isDisplayed());\r\n newJobPage.getSearchSuggestion().clickSuggestionByIndex();\r\n\r\n //STEP 5\r\n newJobPage.getDetails().enterSomeNote(randomText());\r\n\r\n //STEP 6\r\n newJobPage.getDetails().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getApplication().isDisplayed());\r\n\r\n //STEP 7\r\n newJobPage.getApplication().clickOnCVOption();\r\n Assert.assertTrue(newJobPage.getOptions().isDisplayed());\r\n newJobPage.getOptions().clickOnOption(CVOption);\r\n Assert.assertTrue(newJobPage.getApplication().isUpdateMessageDisplayed());\r\n\r\n //STEP 8\r\n newJobPage.getApplication().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getTeam().isDisplayed());\r\n\r\n //STEP 9\r\n newJobPage.getTeam().inviteTeamMember(email);\r\n Assert.assertTrue(newJobPage.getInvitedEmail().isDisplayed());\r\n Assert.assertEquals(newJobPage.getInvitedEmail().invitedEmailAddress(), email, \"the emails are not matching\");\r\n\r\n //STEP 10\r\n newJobPage.getTeam().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getEvaluation().isDisplayed());\r\n\r\n //STEP 11\r\n int skillCount = newJobPage.getEvaluation().getSkillCount();\r\n newJobPage.getEvaluation().addSomeSkill(randomSkill());\r\n int newSkillCount = newJobPage.getEvaluation().getSkillCount();\r\n Assert.assertTrue(newSkillCount > skillCount);\r\n\r\n //STEP 12\r\n newJobPage.getEvaluation().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getWorkflow().isDisplayed());\r\n\r\n //STEP 13\r\n newJobPage.getWorkflow().enterPipelineStage(stage);\r\n\r\n //STEP 14\r\n newJobPage.getWorkflow().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getOptional().isDisplayed());\r\n Assert.assertTrue(newJobPage.getInternalJobInformation().isDisplayed());\r\n Assert.assertTrue(newJobPage.getSalaryInfromation().isDisplayed());\r\n\r\n //STEP 15\r\n newJobPage.getInternalJobInformation().enterInternalJobInformation(internalJobTitle, id + \"\");\r\n\r\n //STEP 16\r\n newJobPage.getSalaryInfromation().enterSalaryInformation(minSalary + \"\", maxSalary + \"\", currency, minHour + \"\", maxHour + \"\");\r\n\r\n //STEP 17\r\n newJobPage.getOptional().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getPublish().isDisplayed());\r\n\r\n //STEP 18\r\n newJobPage.getPublish().chooseVisibility(jobVisibility);\r\n Assert.assertTrue(newJobPage.getPublish().updateMessageDisplayed());\r\n\r\n //STEP 19\r\n newJobPage.getPublish().clickOnSaveButton();\r\n Assert.assertTrue(newJobPage.getCreatedJobPage().isDisplayed());\r\n\r\n //EXPECTED RESULT\r\n Assert.assertEquals(newJobPage.getCreatedJobPage().getJobTitle(), internalJobTitle);\r\n Assert.assertEquals(newJobPage.getCreatedJobPage().getCreatedJobStatus(), jobVisibility);\r\n Assert.assertNotEquals(newJobPage.getCreatedJobPage().getJobInfo(), \"Remote\");\r\n }", "@Test\n public void testBuild() {\n System.out.println(\"build\");\n game.getPlayer().setEps(0);\n assertEquals((Integer) 1, building.build());\n assertEquals((Integer) 0, game.getPlayer().getEps());\n \n game.getPlayer().setEps(600);\n assertEquals((Integer) 3, building.build());\n assertEquals((Integer) 600, game.getPlayer().getEps());\n \n game.getPlayer().setEps(800);\n assertEquals((Integer) 0, building.build());\n assertEquals((Integer) 300, game.getPlayer().getEps());\n \n game.getPlayer().setEps(1000);\n assertEquals((Integer) 2, building.build());\n assertEquals((Integer) 1000, game.getPlayer().getEps());\n }", "@Test\n public void testGetScore() {\n assertEquals(250, board3by3.getScore());\n }", "@Test\n public void testDAM30504001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n TodoListPage todoListPage = dam3IndexPage.dam30504001Click();\n\n // Assert the todo record count from DB table\n // These count are computed from the list returned and not fetched using query.\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n // by default the radio button for incomplete todos is selected for retrievingits count.\n todoListPage = todoListPage.clickCountByStatusBtn();\n\n String todoCnt = todoListPage.getTodoCountwithStatus();\n\n // This count is fetched from db using count query : status in-complete.\n assertThat(todoCnt, equalTo(\"InComplete : 7\"));\n\n // Status selected as complete now\n todoListPage.selectCompleteStatRadio();\n\n todoListPage = todoListPage.clickCountByStatusBtn();\n todoCnt = todoListPage.getTodoCountwithStatus();\n\n // This count is fetched from db using count query : status complete.\n assertThat(todoCnt, equalTo(\"Completed : 3\"));\n\n }", "@Test\n public void runNewGameTest() {\n\tassertNotEquals(-1,score);\n }", "@Test\n public void testCalculScoreAvecQueDesSpares(){\n Jeu leJeu = new Jeu(5,5);\n Jeu jeuBonus1 = new Jeu(5, null);\n Partie laPartie = new Partie(leJeu, jeuBonus1);\n //when : on calcul le score\n Integer score = laPartie.calculerScore();\n //then : on obtient un score de 150\n assertEquals(new Integer(150), score);\n }", "@Test(priority = 3)\n public void checkCourseProgress() {\n \twait.until(ExpectedConditions.titleContains(\"Email Marketing Strategies\"));\n \t\n \t//Assert Course progress\n \tString courseProgress = driver.findElement(By.xpath(\"//div[contains(@class, 'ld-progress-percentage')]\")).getText();\n \tAssert.assertEquals(courseProgress, \"100% COMPLETE\");\n }", "public UnitTestData() throws Exception {\n String[] runsData = {\n \"1,1,A,1,No,No,4\", // 0 (a No before first yes Security Violation)\n \"2,1,A,1,No,No,2\", // 0 (a No before first yes Compilation Error)\n \"3,1,A,1,No,No,1\", // 20 (a No before first yes)\n \"4,1,A,3,Yes,No,0\", // 3 (first yes counts Minute points but never Run Penalty points)\n \"5,1,A,5,No,No,1\", // zero -- after Yes\n \"6,1,A,7,Yes,No,0\", // zero -- after Yes\n \"7,1,A,9,No,No,1\", // zero -- after Yes\n \"8,1,B,11,No,No,1\", // zero -- not solved\n \"9,2,A,48,No,No,4\", // 0 (a No before first yes Security Violation)\n \"10,2,A,50,Yes,No,0\", // 50 (minute points; no Run points on first Yes)\n \"11,2,B,35,No,No,1\", // zero -- not solved\n \"12,2,B,40,No,No,1\", // zero -- not solved\n };\n\n // Assign half eams random team member names\n addTeamMembers(contest, getTeamAccounts(contest).length / 2, 5);\n\n assertEquals(\"Expectig team member names\", 5, getFirstAccount(contest, Type.TEAM).getMemberNames().length);\n\n assertEquals(\"team count\", 120, contest.getAccounts(Type.TEAM).size());\n\n for (String runInfoLine : runsData) {\n SampleContest.addRunFromInfo(contest, runInfoLine);\n }\n\n Problem problem = contest.getProblems()[0];\n Account judge = getFirstAccount(contest, Type.JUDGE);\n generateClarifications(contest, 20, problem, judge.getClientId(), false, false);\n generateClarifications(contest, 20, problem, judge.getClientId(), true, false);\n generateClarifications(contest, 20, problem, judge.getClientId(), true, true);\n\n sampleContest.assignSampleGroups(contest, \"North Group\", \"South Group\");\n\n assertEquals(\"Runs\", 12, contest.getRuns().length);\n\n }", "@Test(dataProvider=\"getData\")\n\tpublic void BVisibility_AddButton(String tst, int i) throws IOException, InterruptedException\n\t{\n\t\tlog.info(\"Test for - \"+tst);\n\t\tLoginPage lip=new LoginPage(driver);\n\t\tlip.getUsername().clear();\n\t\tlip.getUsername().sendKeys(prop.getProperty(\"username\"));\n\t\tlip.getPassword().clear();\n\t\tlip.getPassword().sendKeys(prop.getProperty(\"password\"));\n\t\tThread.sleep(2000);\n\t\tlip.getSubmit().click();\n\t\tThread.sleep(2000);\n\t\tif (lip.getSessionOut().isDisplayed()) {\n\t\t\tlip.getSessionOut().click();\n\t }\n\t\tlog.info(\"Login successfully\");\n\t\t\n\t\tThread.sleep(5000);\n\t\t\n\t\tLandingPage LP=new LandingPage(driver);\n\t\t\n\t\tlog.info(\"enter dashboard page\");\n\t\tif(i==1) {\n\t\tLP.getDepartment().click();\n\t\tThread.sleep(3000);\n\t\tdepartmentPage dp=new departmentPage(driver);\n\t\tif(dp.getAdd().isDisplayed()){\n\t\t\tlog.info(\"Department add button is not displaying\");\n\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t}\n\t\telse {\n\t\t\tlog.info(\"Testcase failed- Department add button is visible\");\n\t\t\t\n\t\t}\n\t\t}\n\t\telse if(i==2) {\n\t\t\tLP.getProjects().click();\n\t\t\tThread.sleep(3000);\n\t\t\tProjectPage pp=new ProjectPage(driver);\n\t\t\tif(pp.getAdd().isDisplayed()){\n\t\t\t\tlog.info(\"Project add button is not displaying\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Testcase failed- Project add button is visible\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(i==3) {\n\t\t\tLP.getFields().click();\n\t\t\tThread.sleep(3000);\n\t\t\tFieldPage fp=new FieldPage(driver);\n\t\t\tif(fp.getAdd().isDisplayed()){\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- Field add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Field add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(i==4) {\n\t\t\tLP.getFilter().click();\n\t\t\tThread.sleep(3000);\n\t\t\tFilterPage fp=new FilterPage(driver);\n\t\t\tif(fp.getAdd().isDisplayed()){\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- Filter add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Filter add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(i==5) {\n\t\t\tLP.getViews().click();\n\t\t\tThread.sleep(3000);\n\t\t\tlog.info(\"Enter view page\");\n\t\t\tViewPage vp=new ViewPage(driver);\n\t\t\tif(vp.getAdd().isDisplayed()){\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- view add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"View add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tLP.getRoles().click();\n\t\t\tlog.info(\"Enter login page\");\n\t\t\tThread.sleep(3000);\n\t\t\tRolePage rp=new RolePage(driver);\n\t\t\tif(rp.getAdd().isDisplayed()) {\n\t\t\t\t\n\t\t\t\tlog.info(\"Testcase failed- Role add button is visible\");\n\t\t\t\tAssert.assertEquals(\"google\", \"gooooogle\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog.info(\"Role add button is not displaying\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void TestGameStatus(){\n int gameTime = b.Game_Status();\n assertEquals(35, gameTime);\n }", "@Test\n public void loadAllTasksFromRepositoryAndLoadIntoView() {\n mPlaylistPresenter.setFiltering(PlaylistFilterType.ALL_TASKS);\n mPlaylistPresenter.loadTasks(true);\n\n // Callback is captured and invoked with stubbed tasks\n verify(mSongsRepository).getSongs(mLoadTasksCallbackCaptor.capture());\n mLoadTasksCallbackCaptor.getValue().onSongsLoaded(TASKS);\n\n // Then progress indicator is shown\n InOrder inOrder = inOrder(mTasksView);\n inOrder.verify(mTasksView).setLoadingIndicator(true);\n // Then progress indicator is hidden and all tasks are shown in UI\n inOrder.verify(mTasksView).setLoadingIndicator(false);\n ArgumentCaptor<List> showTasksArgumentCaptor = ArgumentCaptor.forClass(List.class);\n verify(mTasksView).showTasks(showTasksArgumentCaptor.capture());\n assertTrue(showTasksArgumentCaptor.getValue().size() == 3);\n }", "@Test\n\tpublic void testPrimeActionnaireSecondaire(){\n\t\tassertEquals(1000, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 2));\n\t\tassertEquals(1500, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 3));\n\t\tassertEquals(2000, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 4));\n\t\tassertEquals(2500, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 5));\n\t\tassertEquals(3000, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 6));\n\t\tassertEquals(3000, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 8));\n\t\tassertEquals(3000, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 10));\n\t\tassertEquals(3500, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 11));\n\t\tassertEquals(3500, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 15));\n\t\tassertEquals(3500, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 20));\n\t\tassertEquals(4000, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 21));\n\t\tassertEquals(4000, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 22));\n\t\tassertEquals(4000, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 30));\n\t\tassertEquals(4500, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 31));\n\t\tassertEquals(4500, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 33));\n\t\tassertEquals(4500, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 40));\n\t\tassertEquals(5000, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 41));\n\t\tassertEquals(5000, TypeChaine.primeActionnaireSecondaire(TypeChaine.SACKSON, 42));\n\n\t\t// cas categorie hotel = 2\n\t\tassertEquals(1500, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 2));\n\t\tassertEquals(2000, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 3));\n\t\tassertEquals(2500, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 4));\n\t\tassertEquals(3000, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 5));\n\t\tassertEquals(3500, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 6));\n\t\tassertEquals(3500, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 8));\n\t\tassertEquals(3500, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 10));\n\t\tassertEquals(4000, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 11));\n\t\tassertEquals(4000, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 15));\n\t\tassertEquals(4000, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 20));\n\t\tassertEquals(4500, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 21));\n\t\tassertEquals(4500, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 22));\n\t\tassertEquals(4500, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 30));\n\t\tassertEquals(5000, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 31));\n\t\tassertEquals(5000, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 33));\n\t\tassertEquals(5000, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 40));\n\t\tassertEquals(5500, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 41));\n\t\tassertEquals(5500, TypeChaine.primeActionnaireSecondaire(TypeChaine.HYDRA, 42));\n\n\t\t// cas categorie hotel = 3\n\t\tassertEquals(2000, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 2));\n\t\tassertEquals(2500, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 3));\n\t\tassertEquals(3000, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 4));\n\t\tassertEquals(3500, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 5));\n\t\tassertEquals(4000, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 6));\n\t\tassertEquals(4000, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 8));\n\t\tassertEquals(4000, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 10));\n\t\tassertEquals(4500, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 11));\n\t\tassertEquals(4500, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 15));\n\t\tassertEquals(4500, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 20));\n\t\tassertEquals(5000, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 21));\n\t\tassertEquals(5000, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 22));\n\t\tassertEquals(5000, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 30));\n\t\tassertEquals(5500, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 31));\n\t\tassertEquals(5500, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 33));\n\t\tassertEquals(5500, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 40));\n\t\tassertEquals(6000, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 41));\n\t\tassertEquals(6000, TypeChaine.primeActionnaireSecondaire(TypeChaine.PHOENIX, 42));\n\t}", "@Test\n\tpublic void testIrParaCarrinho_InformacoesPersistidas() {\n\t\ttestIncluirProdutoNoCarrinho_ProdutoIncluidoComSucesso();\n\t\tcarrinhoPage = modalProdutoPage.clicarBotaoProceedToCheckout();\n\t\t\t\n\t\tassertEquals(esperado_nomeDoProduto, carrinhoPage.obter_nomeDoProduto());\n\t\tassertEquals(esperado_precoDoProduto, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_precoDoProduto()));\n\t\tassertEquals(esperado_tamanhoDoProduto, carrinhoPage.obter_tamanhoDoProduto());\n\t\tassertEquals(esperado_corDoProduto, carrinhoPage.obter_corDoProduto());\n\t\tassertEquals(esperado_inputQuantidadeDoProduto, Integer.parseInt(carrinhoPage.obter_inputQuantidadeDoProduto()));\n\t\tassertEquals(esperado_subTotalDoProduto, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_subTotalDoProduto()));\n\t\t\n\t\tassertEquals(esperado_numeroItensTotal, Funcoes.removeTextoItemsDevolveInt(carrinhoPage.obter_numeroItensTotal()));\n\t\tassertEquals(esperado_subtotalTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_subtotalTotal()));\n\t\tassertEquals(esperado_shippingTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_shippingTotal()));\n\t\tassertEquals(esperado_totalTaxExclTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_totalTaxExclTotal()));\n\t\tassertEquals(esperado_totalTaxInclTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_totalTaxInclTotal()));\n\t\tassertEquals(esperado_taxesTotal, Funcoes.removeCifraoDevolveDouble(carrinhoPage.obter_taxesTotal()));\n\t\t\n\t}", "@Test\n//Verify that new created API is displayed properly at API Revision wizard \n public void APIM_CreateAPI_004() throws Exception {\n try {\n assertEquals(\"DTSS-TESTAUTO-1\", driver.findElement(By.cssSelector(\"div.subNav > h2\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Delete Revision\", driver.findElement(By.linkText(\"Delete Revision\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Edit API Details\", driver.findElement(By.linkText(\"Edit API Details\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Deploy Revision\", driver.findElement(By.linkText(\"Deploy Revision\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Copy Revision As New API\", driver.findElement(By.linkText(\"Copy Revision As New API\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Revision: 1\", driver.findElement(By.cssSelector(\"div.myapis_DetailInfo\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"API Version: 1\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div/div[2]/div[2]/div/div/div[2]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Status: Enabled\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div/div[2]/div[2]/div/div/div[3]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Visibility:\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div/div[2]/div[2]/div/div/div[4]/span\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Taxonomy Id: 1752\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div/div[2]/div[2]/div/div/div[6]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Documentation URI:\", driver.findElement(By.cssSelector(\"div.clear > div.myapis_DetailInfo > span.label\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"www.disney.go.com/docs\", driver.findElement(By.linkText(\"www.disney.go.com/docs\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Last Modified:\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div/div[2]/div[2]/div/div[2]/div/span\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"API Owners: \" + EmailValue, driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div/div[2]/div[2]/div/div[2]/div[2]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Release Managers: \" + EmailValue, driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div/div[2]/div[2]/div/div[2]/div[3]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Origin Base Names: \" + OriginBaseName + \" Before you are able to deploy your API to an environment, you must specify at least one Origin Base Name. Origin Base Names will be matched with named Origin Base URIs in the environment in which the API is deployed. Upon deployment the environment will be checked to ensure these Origin Base Names are defined before allowing the deployment.\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div/div[2]/div[2]/div/div[3]/div\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Authenticator:\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div/div[2]/div[2]/div/div[3]/div[2]/span\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Allow Public Tokens:\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div/div[2]/div[2]/div/div[3]/div[3]/span\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Description:\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div/div[2]/div[2]/div[2]/div[2]/span\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"For automation purposes\", driver.findElement(By.cssSelector(\"div.infoBox\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Resources\", driver.findElement(By.cssSelector(\"button.active\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Variables\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div[2]/div/button[2]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Headers\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div[2]/div/button[3]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Security\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div[2]/div/button[4]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"URI Rewriting\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div[2]/div/button[5]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Logging\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div[2]/div/button[6]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Assertions\", driver.findElement(By.xpath(\"//div[@id='myapis_api_revision_details_view_container']/div/div/div[2]/div/button[7]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n assertTrue(isElementPresent(By.id(\"DataTables_Table_3_wrapper\")));\n try {\n assertEquals(\"API Resources\", driver.findElement(By.cssSelector(\"#DataTables_Table_3_filter > h2\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Add Resource\", driver.findElement(By.cssSelector(\"#DataTables_Table_3_filter > button.new.primary\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Edit Resource Ordering\", driver.findElement(By.cssSelector(\"button.ordering\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"\", driver.findElement(By.cssSelector(\"#DataTables_Table_3_filter > input.on.searchInput\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Resource\\nAccess\\nAction\", driver.findElement(By.cssSelector(\"#DataTables_Table_3 > thead > tr > th.cog.sorting\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Resource\", driver.findElement(By.xpath(\"//table[@id='DataTables_Table_3']/thead/tr/th[2]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Access\", driver.findElement(By.xpath(\"//table[@id='DataTables_Table_3']/thead/tr/th[3]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"Action\", driver.findElement(By.xpath(\"//table[@id='DataTables_Table_3']/thead/tr/th[4]\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n try {\n assertEquals(\"No data available in table\", driver.findElement(By.cssSelector(\"#DataTables_Table_3 > tbody > tr.odd > td.dataTables_empty\")).getText());\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*Add ResourceEdit Resource OrderingAPI Resources\\n Resource\\nAccess\\nAction\\n\\n ResourceAccessAction No data available in tableShowing 0 to 0 of 0 entries\\nFirstPreviousNextLast[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n }", "@Test\n public void testGameProcess() {\n // set test player data\n mTournament.setPlayerCollection(getTestPlayersData());\n\n int roundNumber = mTournament.calculateRoundsNumber(mTournament.getPlayersCount());\n for (int i = 0; i < roundNumber; ++i) {\n Round round = mTournament.createNewRound();\n assertTrue(\"State of new round must be CREATED\", round.getState() == State.CREATED);\n\n // tests can't create new round because not all rounds are completed\n Round falseRound = mTournament.createNewRound();\n assertEquals(\"Instance must be null\", null, falseRound);\n\n round.startRound();\n assertTrue(\"State of starting round must be RUNNING\", round.getState() == State.RUNNING);\n\n randomiseResults(round.getMatches());\n round.endRound();\n assertTrue(\"State of ending round must be COMPLETED\", round.getState() == State.COMPLETED);\n\n // tests that ended round can't be started again\n round.startRound();\n assertTrue(\"State of ended round must be COMPLETED\", round.getState() == State.COMPLETED);\n }\n // tests can't create one more round because game is over at this point\n Round round = mTournament.createNewRound();\n assertEquals(\"Instance must be null\", null, round);\n\n }", "@Test\n public void testActualizar3() {\n System.out.println(\"actualizar\");\n int codigo = 2;\n Usuario usuario = usuario1;\n usuario.setEstado(\"desactivado\");\n boolean expResult = false;\n boolean result = usuarioController.actualizar(codigo, usuario);\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 }", "@Test\n public void testDAM30601003() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30601003Click();\n\n TodoRegisterPage registerTodoPage = todoListPage.registerTodo();\n\n // input todo details\n registerTodoPage.setTodoId(\"0000000030\");\n registerTodoPage.setTodoCategory(\"CA2\");\n registerTodoPage.setTodoTitle(\"Todo 30\");\n\n TodoDetailsPage todoDetailsPage = registerTodoPage.addTodoAndRetInt();\n\n String booleanStr = todoDetailsPage.getRegistrationResult();\n\n assertThat(booleanStr, equalTo(\"1\"));\n\n // assert all the properties of fetched record.\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"Todo 30\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000030\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"In-Complete\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/28\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"0\"));\n\n // Now check for false return value\n webDriverOperations.displayPage(getPackageRootUrl());\n dam3IndexPage = new DAM3IndexPage(driver);\n\n todoListPage = dam3IndexPage.dam30601003Click();\n\n registerTodoPage = todoListPage.registerTodo();\n\n registerTodoPage.setTodoId(\"0000000030\");\n registerTodoPage.setTodoCategory(\"CA2\");\n registerTodoPage.setTodoTitle(\"Todo 30\");\n\n todoDetailsPage = registerTodoPage.addTodoAndRetInt();\n\n booleanStr = todoDetailsPage.getRegistrationResult();\n\n assertThat(booleanStr, equalTo(\"0\"));\n }", "@Test\n\tpublic void testPowerUpView_8()\n\t\tthrows Exception {\n\t\tGameObject gameObject = new Tile(new Point());\n\t\tGfxFactory gfxFactory = new GfxFactory();\n\n\t\tPowerUpView result = new PowerUpView(gameObject, gfxFactory);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.LogManager\n\t\t// at org.apache.log4j.Logger.getLogger(Logger.java:116)\n\t\t// at client.view.GfxFactory.<init>(GfxFactory.java:45)\n\t\tassertNotNull(result);\n\t}", "@Test\n public void testAssignReinforcements() {\n IssueOrderPhase l_issueOrder = new IssueOrderPhase(d_gameEngine);\n l_issueOrder.d_gameData = d_gameData;\n l_issueOrder.assignReinforcements();\n d_gameData = l_issueOrder.d_gameData;\n int l_actualNoOfArmies = d_gameData.getD_playerList().get(0).getD_noOfArmies();\n int l_expectedNoOfArmies = 8;\n assertEquals(l_expectedNoOfArmies, l_actualNoOfArmies);\n }", "@Test\n public void testDAM30801001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30801001Click();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n TodoUpdatePage todoUpdatePage = todoListPage.updateTodo(\"0000000003\");\n\n todoListPage = todoUpdatePage.deleteByUsingTodoObj();\n\n // Confirmation of total cou nt after a record is deleted.\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"6\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"9\"));\n\n // confirm that the todo is deleted.\n boolean isTodoPresent = todoListPage.isTodoDisplayed(\"0000000003\");\n assertThat(isTodoPresent, is(false));\n\n }", "@Test\n void cadastraPesquisadorInvalido() {\n assertEquals(\"Campo fotoURL nao pode ser nulo ou vazio.\", verificaExcecao(() -> controllerPesquisador.cadastraPesquisador(\"killua zoldyck\", \"estudante\",\n \"Interessado em eletricidade, o terceiro de cinco filhos da famosa familia Zaoldyeck.\", \"hunterxhunter@1998\",\"\")));\n assertEquals(\"Campo nome nao pode ser nulo ou vazio.\", verificaExcecao(() -> controllerPesquisador.cadastraPesquisador(null, \"estudante\",\n \"Interessado em eletricidade, o terceiro de cinco filhos da famosa familia Zaoldyeck.\", \"hunterxhunter@1998\",\"https://godspeed\")));\n assertEquals(\"Formato de foto invalido.\", verificaExcecao(() -> controllerPesquisador.cadastraPesquisador(\"killua zoldyck\", \"estudante\",\n \"Interessado em eletricidade, o terceiro de cinco filhos da famosa familia Zaoldyeck.\", \"hunterxhunter@1998\",\"sem o necessario\")));\n assertEquals(\"Formato de foto invalido.\", verificaExcecao(() -> controllerPesquisador.cadastraPesquisador(\"killua zoldyck\", \"estudante\",\n \"Interessado em eletricidade, o terceiro de cinco filhos da famosa familia Zaoldyeck.\", \"hunterxhunter@1998\",\"https\")));\n assertEquals(\"Formato de email invalido.\", verificaExcecao(() -> controllerPesquisador.cadastraPesquisador(\"killua zoldyck\", \"estudante\",\n \"Interessado em eletricidade, o terceiro de cinco filhos da famosa familia Zaoldyeck.\", \"testeteste\",\"https://godspeed\")));\n assertEquals(\"Formato de email invalido.\", verificaExcecao(() -> controllerPesquisador.cadastraPesquisador(\"killua zoldyck\", \"estudante\",\n \"Interessado em eletricidade, o terceiro de cinco filhos da famosa familia Zaoldyeck.\", \"teste@\",\"https://godspeed\")));\n }", "@Test\n public void testCalculScoreAvecQueDesStrikes(){\n Jeu leJeu = new Jeu(10, 0);\n Partie laPartie = new Partie(leJeu, leJeu, leJeu);\n //when : on calcul le score\n Integer score = laPartie.calculerScore();\n //then : on obtient un score de 150\n assertEquals(new Integer(300), score);\n }", "@Test\r\n\tpublic void testSanity() {\n\t}", "@Test\n public void checkingBoardManagerAlwaysProduceASolvable3x3Board() {\n BoardManager boardManager1 = new BoardManager(3,3);\n List<Tile> flatTile = new ArrayList<>();\n int z = 0;\n for (int i = 0; i < Board.NUM_ROWS; i++) {\n for (int j = 0; j < Board.NUM_COLS; j++) {\n flatTile.add(z, boardManager1.getBoard().getTiles()[i][j]);\n z++;\n }\n }\n BoardManager boardManager2 = new BoardManager(3,3);\n List<Tile> flatTile1 = new ArrayList<>();\n int z1 = 0;\n for (int i1 = 0; i1 < Board.NUM_ROWS; i1++) {\n for (int j = 0; j < Board.NUM_COLS; j++) {\n flatTile1.add(z1, boardManager2.getBoard().getTiles()[i1][j]);\n z1++;\n }\n }\n BoardManager boardManager3 = new BoardManager(3,3);\n List<Tile> flatTile2 = new ArrayList<>();\n int z2 = 0;\n for (int i2 = 0; i2 < Board.NUM_ROWS; i2++) {\n for (int j = 0; j < Board.NUM_COLS; j++) {\n flatTile2.add(z2, boardManager3.getBoard().getTiles()[i2][j]);\n z2++;\n }\n }\n assertTrue(boardManager1.isSolvable(flatTile));\n assertTrue(boardManager2.isSolvable(flatTile1));\n assertTrue(boardManager3.isSolvable(flatTile2));\n }", "@Test\n void testPartA_Example2() {\n assertEquals(2, Day01.getFuelNeededForMass(14));\n }", "@Test(timeout = 4000)\n public void test011() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n errorPage0.placeholder(\"h4\");\n assertEquals(\"wheel_ErrorPage\", errorPage0.getComponentId());\n }", "@Test\n public void test() throws Exception {\n// diversifiedRankingxPM2()\n diversifiedRankingxQuAD();\n }", "@Test\r\n public void getBoardTest() {\r\n assertEquals(board4, boardManager4.getBoard());\r\n }", "@Test\n void testInProgressTrue() {\n Mockito.when(level.isAnyPlayerAlive()).thenReturn(true);\n Mockito.when(level.remainingPellets()).thenReturn(1);\n\n game.start();\n game.start();\n\n Assertions.assertThat(game.isInProgress()).isTrue();\n Mockito.verify(level, Mockito.times(1)).addObserver(Mockito.eq(game));\n Mockito.verify(level, Mockito.times(1)).start();\n }", "@Test\n @DisplayName(\"Action Marker Production Violet And Buy Test\")\n public void ActionMarkerProductionVioletAndBuyTest() throws IOException, InterruptedException {\n ActionMarkerProductionViolet actionMarker = new ActionMarkerProductionViolet();\n Server server= new Server();\n ClientHandler clientHandler= new ClientHandler(server);\n ClientController clientController= new ClientController(server,clientHandler) ;\n VirtualView virtualView = new VirtualView(clientController);\n\n GameSolitaire game = new GameSolitaire(\"Ali\",true,clientController);\n\n assertEquals(4, game.productionDeckSize(6));\n assertEquals(4, game.productionDeckSize(7));\n assertEquals(4, game.productionDeckSize(8));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(2, game.productionDeckSize(6));\n assertEquals(4, game.productionDeckSize(7));\n assertEquals(4, game.productionDeckSize(8));\n\n try {\n game.deckFromDeckNumber(12).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(1, game.productionDeckSize(6));\n assertEquals(4, game.productionDeckSize(7));\n assertEquals(4, game.productionDeckSize(8));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(6));\n assertEquals(3, game.productionDeckSize(7));\n assertEquals(4, game.productionDeckSize(8));\n\n try {\n game.deckFromDeckNumber(4).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(0, game.productionDeckSize(6));\n assertEquals(3, game.productionDeckSize(7));\n assertEquals(3, game.productionDeckSize(8));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(6));\n assertEquals(1, game.productionDeckSize(7));\n assertEquals(3, game.productionDeckSize(8));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(6));\n assertEquals(0, game.productionDeckSize(7));\n assertEquals(2, game.productionDeckSize(8));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(6));\n assertEquals(0, game.productionDeckSize(7));\n assertEquals(0, game.productionDeckSize(8));\n\n FileClass.FileDestroyer();\n\n }", "@Test\n public void testResetGame(){\n scoresModel.resetGame();\n try {\n scoresModel.resetGame();\n for(int i = 0; i < ScoresModel.maxNumOfAttempts; i++) {\n assertEquals(scoresModel.attemptsScore[i], 0);\n }\n for(int i = 0; i < ScoresModel.maxNumOfFrames; i++){\n assertEquals(scoresModel.frameTypes[i], FrameType.NOT_PLAYED);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Test\n public void assertSanity() throws InterruptedException {\n int count = 1_000_000;\n\n AtomicInteger npes = new AtomicInteger(0);\n AtomicInteger insanities = new AtomicInteger(0);\n ExecutorService executorService = Executors.newFixedThreadPool(2);\n\n for (int i = 0; i < count; i++) {\n StuffIntoPublic stuffIntoPublic = new StuffIntoPublic();\n CountDownLatch startLatch = new CountDownLatch(1);\n\n executorService.submit(() -> {\n try {\n startLatch.await();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n stuffIntoPublic.initialize();\n });\n executorService.submit(() -> {\n try {\n startLatch.await();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n try{\n stuffIntoPublic.holder.assertSanity();\n } catch (NullPointerException npe) {\n npes.incrementAndGet();\n } catch (AssertionError e) {\n insanities.incrementAndGet();\n }\n });\n\n startLatch.countDown();\n }\n\n executorService.shutdown();\n executorService.awaitTermination(10, TimeUnit.SECONDS);\n\n System.out.printf(\"npes: %d, insanities: %d\", npes.get(), insanities.get());\n }", "public void testGetModo() {\n System.out.println(\"getModo\");\n int modo= 0;\n ObjectTempSwapWizard instance = new ObjectTempSwapWizard(modo);\n int expResult = 0;\n int result = instance.getModo();\n assertEquals(expResult, result);\n }", "@Test\n public void loadCompletedTasksFromRepositoryAndLoadIntoView() {\n mPlaylistPresenter.setFiltering(PlaylistFilterType.COMPLETED_TASKS);\n mPlaylistPresenter.loadTasks(true);\n\n // Callback is captured and invoked with stubbed tasks\n verify(mSongsRepository).getSongs(mLoadTasksCallbackCaptor.capture());\n mLoadTasksCallbackCaptor.getValue().onSongsLoaded(TASKS);\n\n // Then progress indicator is hidden and completed tasks are shown in UI\n verify(mTasksView).setLoadingIndicator(false);\n ArgumentCaptor<List> showTasksArgumentCaptor = ArgumentCaptor.forClass(List.class);\n verify(mTasksView).showTasks(showTasksArgumentCaptor.capture());\n assertTrue(showTasksArgumentCaptor.getValue().size() == 2);\n }", "public void testExecute() {\n panel.execute();\n }", "@Test\n public void testDAM30201001() {\n\n // データ初期化\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n // Connect to DB and fetch the Todo list\n TodoListPage todoListPage = dam3IndexPage.dam30201001Click();\n\n todoListPage = todoListPage.registerBulkTodo();\n\n // データ反映までの待ち時間\n webDriverOperations.waitForDisplayed(ExpectedConditions\n .textToBePresentInElementLocated(By.id(\"completedTodo\"),\n \"993\"));\n\n // Assert the todo record count from DB table\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"993\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"1000\"));\n\n }", "@Test\n void testPartA_Example1() {\n assertEquals(2, Day01.getFuelNeededForMass(12));\n }", "@Before\n public void setUp() {\n this.scoreBoard = new ScoreBoard();\n\n\n // Add some record with complexity 3\n DataManager.INSTANCE.setCurrentUserName(\"@u1\");\n DataManager.INSTANCE.setCurrentGameName(\"CM\");\n DataManager.INSTANCE.startNewGame(5);\n DataManager.INSTANCE.setCurrentGameName(\"ST\");\n DataManager.INSTANCE.setBoardManager(new BoardManager(3));\n DataManager.INSTANCE.getBoardManager().addScoreBy(1);\n this.scoreBoard.addNewRecords(new Record());\n\n this.scoreBoard.addNewRecords(new Record(3, 10, \"@u2\", \"ST\"));\n this.scoreBoard.addNewRecords(new Record(3, 25, \"@u3\", \"ST\"));\n this.scoreBoard.addNewRecords(new Record(4, 5, \"@u1\", \"ST\"));\n this.scoreBoard.addNewRecords(new Record(3, 15, \"@u3\", \"ST\"));\n }", "@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 @DisplayName(\"Action Marker Production Blue And Buy Test\")\n public void ActionMarkerProductionBlueAndBuyTest() throws IOException, InterruptedException {\n ActionMarkerProductionBlue actionMarker = new ActionMarkerProductionBlue();\n Server server= new Server();\n ClientHandler clientHandler= new ClientHandler(server);\n ClientController clientController= new ClientController(server,clientHandler) ;\n VirtualView virtualView = new VirtualView(clientController);\n\n GameSolitaire game = new GameSolitaire(\"Ali\",true,clientController);\n\n assertEquals(4, game.productionDeckSize(0));\n assertEquals(4, game.productionDeckSize(1));\n assertEquals(4, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(2, game.productionDeckSize(0));\n assertEquals(4, game.productionDeckSize(1));\n assertEquals(4, game.productionDeckSize(2));\n\n try {\n game.deckFromDeckNumber(10).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(1, game.productionDeckSize(0));\n assertEquals(4, game.productionDeckSize(1));\n assertEquals(4, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(3, game.productionDeckSize(1));\n assertEquals(4, game.productionDeckSize(2));\n\n try {\n game.deckFromDeckNumber(2).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(3, game.productionDeckSize(1));\n assertEquals(3, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(1, game.productionDeckSize(1));\n assertEquals(3, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(0, game.productionDeckSize(1));\n assertEquals(2, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(0, game.productionDeckSize(1));\n assertEquals(0, game.productionDeckSize(2));\n\n FileClass.FileDestroyer();\n\n }", "@Test\n public void test14() { \n Board board14 = new Board();\n board14.put(1,1,1); \n board14.put(1,2,1);\n board14.put(1,3,1);\n board14.put(2,1,2);\n board14.put(2,2,2);\n board14.put(2,3,1);\n board14.put(3,1,1);\n board14.put(3,2,1);\n board14.put(3,3,2);\n assertFalse(board14.checkTie());\n }", "@Test\n public void testDAM31001001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam31001001Click();\n\n // Confirmation of database state before any update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n TodoRegisterPage todoRegisterPage = todoListPage.registerTodo();\n\n todoRegisterPage.setTodoCategory(\"CA3\");\n todoRegisterPage.setTodoId(\"0000001000\");\n todoRegisterPage.setTodoTitle(\"ESC Test1\");\n // add couple of todos for escape search operation.\n todoRegisterPage.addTodo();\n\n webDriverOperations.displayPage(getPackageRootUrl());\n dam3IndexPage = new DAM3IndexPage(driver);\n\n todoListPage = dam3IndexPage.dam31001001Click();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"8\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"11\"));\n\n todoRegisterPage = todoListPage.registerTodo();\n\n todoRegisterPage.setTodoCategory(\"CA4\");\n todoRegisterPage.setTodoId(\"0000000031\");\n todoRegisterPage.setTodoTitle(\"2 ESC Test\");\n todoRegisterPage.addTodo();\n\n webDriverOperations.displayPage(getPackageRootUrl());\n dam3IndexPage = new DAM3IndexPage(driver);\n\n todoListPage = dam3IndexPage.dam31001001Click();\n\n // Confirmation of database state after adding 1 todo\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"9\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"12\"));\n\n todoListPage.setTodoTitleContent(\"ESC\");\n\n // perform escape search\n todoListPage = todoListPage.escapeSearch();\n\n // Confirmation of todos retrieved satisfying the escape search criteria\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"0\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"2\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"2\"));\n\n // on sampling basis check the details of todo retrieved as a result of escape\n // search.\n TodoDetailsPage todoDetailsPage = todoListPage.displayTodoDetail(\n \"0000001000\");\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"ESC Test1\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000001000\"));\n assertThat(todoDetailsPage.getTodoCategory(), equalTo(\"CA3\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"false\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/28\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"0\"));\n\n }", "@Test\r\n public void testGetCodigo() {\r\n int expResult = 2;\r\n articuloPrueba.setCodigo(expResult);\r\n int result = articuloPrueba.getCodigo();\r\n assertEquals(expResult, result);\r\n }", "@Test\n void testPartA_Example4() {\n assertEquals(33583, Day01.getFuelNeededForMass(100756));\n }", "@Test\n @DisplayName(\"Verify collecting the remaining stones after end-game\")\n void collectRemainingStones() {\n boardService.collectRemainingStones();\n int homeCount1 = boardService.getPlayerHomeCount(playerService.getP1());\n int homeCount2 = boardService.getPlayerHomeCount(playerService.getP2());\n Assert.assertEquals(36, homeCount1);\n Assert.assertEquals(36, homeCount2);\n }", "@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 void displayAllTasks() {\n }", "@Test\n public void temporaryTeamClosingUnavalableOption() {\n\n }" ]
[ "0.68430287", "0.6591861", "0.65626925", "0.6486031", "0.6451438", "0.63361156", "0.63088506", "0.63025516", "0.62917525", "0.6251481", "0.6244992", "0.6206476", "0.6196762", "0.61250347", "0.6113678", "0.6092923", "0.6072923", "0.6038766", "0.60251075", "0.59511876", "0.59454566", "0.5937968", "0.58943", "0.5891232", "0.58901095", "0.58879143", "0.5873523", "0.5869503", "0.58630925", "0.5848801", "0.58473164", "0.5844715", "0.5822134", "0.58178735", "0.58175576", "0.5815658", "0.58098376", "0.5804756", "0.5799507", "0.57847846", "0.5776855", "0.57745814", "0.57689846", "0.5759445", "0.5748884", "0.57444066", "0.5738219", "0.5733854", "0.5733704", "0.5733601", "0.5731119", "0.5730368", "0.57275575", "0.572724", "0.5726971", "0.57269484", "0.5726912", "0.5726117", "0.5724336", "0.5721477", "0.57203597", "0.57194954", "0.57180244", "0.5711198", "0.5690012", "0.56829894", "0.56817555", "0.5677703", "0.5670492", "0.5667695", "0.5666764", "0.5661839", "0.56609964", "0.5658269", "0.56579465", "0.56565636", "0.5654041", "0.5648234", "0.5643345", "0.5643337", "0.5637651", "0.5637073", "0.5636388", "0.563391", "0.5631714", "0.56311893", "0.56301665", "0.56277055", "0.5626416", "0.5622773", "0.5621606", "0.56189007", "0.56158143", "0.56156623", "0.56154025", "0.5609757", "0.5607538", "0.5605656", "0.5605016", "0.5603239" ]
0.7162598
0
stampare il registro ordinato per data
public String print() { Collections.sort(ordini, Comparator.comparing(o -> o.dataAcquisto)); return ordini.stream() .map(o->o.toString()+"\n") .reduce(String::concat).orElse(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setDateOrdered (Timestamp DateOrdered);", "int insert(BpmInstanciaHistorica record);", "public void setDateTrx (Timestamp DateTrx);", "public void setDateTrx (Timestamp DateTrx);", "@Transactional\n DataRistorante insert(DataRistorante risto);", "public void setFechaInsercion(String p) { this.fechaInsercion = p; }", "public void setFechaInsercion(String p) { this.fechaInsercion = p; }", "public void setOriginalServiceData (Timestamp OriginalServiceData);", "int insert(Movimiento record);", "@Override\n\tpublic int insertOrderTrading(Order_TradingVO otvo) {\n\t\treturn sql.insert(\"insertOrderTrading\", otvo);\n\t}", "private String makeEventStamp() {\n String name = \"DTSTAMP\";\n return formatTimeProperty(LocalDateTime.now(), name) + \"\\n\";\n }", "int insert(TSortOrder record);", "int insert(UvStatDay record);", "public abstract void setFecha_ingreso(java.sql.Timestamp newFecha_ingreso);", "int insert(Orderall record);", "int insert(TCar record);", "public Timestamp getOriginalServiceData();", "@PrePersist\n\tvoid erstelltam() {\n\t\tthis.erstelltam = new GregorianCalendar();\n\t}", "@Override\n\tpublic int insert(SysActionLog vo) {\n\t\tSequenceGenerator oid = new SequenceGenerator();\n\t\tString [] ids = oid.generate(1);\n\t\tvo.setSal_id(ids[0]);\n\t\t//todo\n\t\t//增加版本号和新增时间\n\t\treturn sysActionLogDao.insert(vo);\n\t}", "@RequiresApi(api = Build.VERSION_CODES.O)\n private void storeHistory(OrderData obj)\n {\n LocalDate currentdate = LocalDate.now();\n Month currentMonth = currentdate.getMonth();\n int currentYear = currentdate.getYear();\n\n// Date date=new Date();\n// int month=date.getMonth();\n// int year=date.getYear();\n\n //this part is to store order\n final String yea=String.valueOf(currentYear);\n final String mon=currentMonth.toString();\n final String day=String.valueOf(currentdate.getDayOfMonth());\n final String dat=yea+\"-\"+mon+\"-\"+day;\n\n\n db.collection(\"shop\")\n .document(new Auth().getUId())\n .collection(\"orders\")\n .document(new Auth().getUId())\n .collection(dat)\n .add(obj)\n .addOnSuccessListener(new OnSuccessListener<DocumentReference>() {\n @Override\n public void onSuccess(DocumentReference documentReference) {\n //Log.d(TAG, \"DocumentSnapshot added with ID: \" + documentReference.getId());\n //Toast.makeText(getContext(),\"DocumentSnapshot added with ID: \" + documentReference.getId(), Toast.LENGTH_SHORT).show();\n //orderList.remove(position);\n\n\n\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n //Log.w(TAG, \"Error adding document\", e);\n //Toast.makeText(getContext(),\"Erroe adding doc\", Toast.LENGTH_SHORT).show();\n }\n });\n\n\n }", "int insert(Tipologia record);", "public Timestamp getDateOrdered();", "@PrePersist\r\n\tpublic void prePersist() {\n\t\ttry { Thread.sleep(1); } catch (Exception e) { System.out.println(\"Impossibile fermare il thread per 1 ms.\");}\r\n\t\tGregorianCalendar now = new GregorianCalendar();\r\n\t\tdataArrivoFile = new Date(now.getTimeInMillis());\r\n\t\tannoOrdine = now.get(Calendar.YEAR);\r\n\t\tannodoc = now.get(Calendar.YEAR);\r\n\t\tgenMovUscita = \"NO\";\r\n\t\t// il numero di lista è necessario, se non c'è lo genero.\r\n\t\tif (nrLista == null || nrLista.isEmpty()) {\r\n\t\t\tnrLista = sdf.format(now.getTime());\r\n\t\t}\r\n\t\t// il raggruppamento stampe è necessario, se non c'è lo imposto uguale al numero di lista.\r\n\t\tif (ragstampe == null || ragstampe.isEmpty()) {\r\n\t\t\tragstampe = nrLista;\r\n\t\t}\r\n\t\tnrListaArrivato = 0; // TODO, in teoria sarebbe come un autoincrement\r\n\t\tif (nomeFileArrivo == null || nomeFileArrivo.isEmpty()) nomeFileArrivo = sdf.format(now.getTime());\r\n\t\t// Se non ho specificato l'operatore assumo che sia un servizio.\r\n\t\tif (operatore == null || operatore.isEmpty()) operatore = \"SERVIZIO\";\r\n\t\t// Priorita', se non valorizzata imposto il default.\r\n\t\tif (priorita <= 0) priorita = 1;\r\n\t\t// Contrassegno\r\n\t\tif (tipoIncasso == null) tipoIncasso = \"\";\r\n\t\tif (valContrassegno == null) valContrassegno = 0.0;\r\n\t\tif (valoreDoganale == null)\tvaloreDoganale = 0.0;\r\n\t\t// Corriere, se null imposto a stringa vuota.\r\n\t\tif (corriere == null) corriere = \"\";\r\n\t\t// Codice cliente per il corriere, se null imposto a stringa vuota.\r\n\t\tif (codiceClienteCorriere == null) codiceClienteCorriere = \"\";\r\n\t\tif (stato == null) stato = \"INSE\";\r\n\t\tif (sessioneLavoro == null) sessioneLavoro = \"\";\r\n\t\tif (tipoDoc == null) tipoDoc = \"ORDINE\";\r\n\t}", "int insert(NjOrderCallbackLog record);", "int insertSelective(BpmInstanciaHistorica record);", "public void setDia_especifico(java.sql.Timestamp newDia_especifico);", "int insert(AfterServiceSheet record);", "int insert(FinMonthlySnapModel record);", "int insert(OrderPO record);", "int insert(PayLogInfoPo record);", "private void insertData() \n {\n for (int i = 0; i < 3; i++) {\n TarjetaPrepagoEntity entity = factory.manufacturePojo(TarjetaPrepagoEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n for(int i = 0; i < 3; i++)\n {\n PagoEntity pagos = factory.manufacturePojo(PagoEntity.class);\n em.persist(pagos);\n pagosData.add(pagos);\n\n }\n \n data.get(2).setSaldo(0.0);\n data.get(2).setPuntos(0.0);\n \n double valor = (Math.random()+1) *100;\n data.get(0).setSaldo(valor);\n data.get(0).setPuntos(valor); \n data.get(1).setSaldo(valor);\n data.get(1).setPuntos(valor);\n \n }", "private void stamp() {\n mInternalStamp = SystemClock.elapsedRealtime();\n }", "int insertSelective(Movimiento record);", "int insertSelective(NjOrderCallbackLog record);", "@PrePersist\r\n void createdAt() {\r\n setDateRecordAdded();\r\n setDateRecordUpdated();\r\n }", "int insert(R_order record);", "public void insertHistory(RecordDTO recordDTO);", "private void obtenerEstampas(int tipo) {\n try {\n switch(tipo){\n case 0:\n listaSobreNormal = new ListaSobreNormal();\n for (int i = 0; i < 5; i++) {\n listaSobreNormal.insertar(App.listaEstampas.obtenerEstampaSobre(tipo).getEstampa());\n }\n //listaSobreNormal.mostrar();\n App.listaUsuarios.agregarEstampasObtenidas(listaSobreNormal);\n mostrarEstampas(listaSobreNormal.getActual().getEstampa());\n break;\n case 1:\n listaSobreDorado = new ListaSobreDorado();\n for (int i = 0; i < 5; i++) {\n listaSobreDorado.insertar(App.listaEstampas.obtenerEstampaSobre(tipo).getEstampa());\n }\n //listaSobreDorado.mostrar();\n App.listaUsuarios.agregarEstampasObtenidas(listaSobreDorado);\n mostrarEstampas(listaSobreDorado.getActual().getEstampa());\n break;\n }\n } catch (Exception e) {\n System.err.println(\"error\");\n e.printStackTrace();\n }\n }", "public void setFecha_envio(java.sql.Timestamp newFecha_envio);", "void insert(PaymentTrade record);", "int insert(TRefundOrder record);", "void saveActivityHistForAddEntity(Record inputRecord);", "private void insertData() {\n\n for (int i = 0; i < 3; i++) {\n ProveedorEntity proveedor = factory.manufacturePojo(ProveedorEntity.class);\n BonoEntity entity = factory.manufacturePojo(BonoEntity.class);\n int noOfDays = 8;\n Date dateOfOrder = new Date();\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n Date date = calendar.getTime();\n entity.setExpira(date);\n noOfDays = 1;\n calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n date = calendar.getTime();\n entity.setAplicaDesde(date);\n entity.setProveedor(proveedor);\n em.persist(entity);\n ArrayList lista=new ArrayList<>();\n lista.add(entity);\n proveedor.setBonos(lista);\n em.persist(proveedor);\n pData.add(proveedor);\n data.add(entity); \n }\n }", "@Override\r\n\t@Transactional\r\n\tpublic void doService() {\n\t\tTbookingrecord booking = new Tbookingrecord();\r\n\t\tbooking.setId(Long.valueOf(31622L));\r\n\t\tbooking.setInstrumentid(2);\r\n\t\tbooking.setUserid(3);\r\n\t\tmappper.insertSelective(booking);\r\n\t\tlogger.debug(booking);\r\n\t\t//int i = 1/0;\r\n\t}", "private void insertData() {\r\n \r\n TeatroEntity teatro = factory.manufacturePojo(TeatroEntity.class);\r\n em.persist(teatro);\r\n FuncionEntity funcion = factory.manufacturePojo(FuncionEntity.class);\r\n List<FuncionEntity> lista = new ArrayList();\r\n lista.add(funcion);\r\n em.persist(funcion);\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n sala.setFuncion(lista);\r\n em.persist(sala);\r\n data.add(sala);\r\n }\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n em.persist(sala);\r\n sfdata.add(sala);\r\n }\r\n \r\n }", "@Override\n\tpublic long insert(OrderDetail t) {\n\t\tt.setState(\"1\");\n\t\tlong insert = orderDetailDao.insert(t);\n\t\treturn insert;\n\t}", "int insert(TbSnapshot record);", "@Override\r\n\tpublic void inserir(Evento evento) {\n\t\trepository.save(evento);\r\n\t}", "int insert(OrderDetail record);", "public void insertar(String dato){\r\n \r\n if(estaVacia()){\r\n \r\n primero = new NodoJugador(dato);\r\n }else{\r\n NodoJugador temporal = primero;\r\n while(temporal.getSiguiente()!=null){\r\n temporal = temporal.getSiguiente();\r\n }\r\n \r\n temporal.setSiguiente(new NodoJugador(dato));\r\n }\r\n }", "int insert(InternalTradeEpa022016 record);", "public void saveTTData(UniversityTimeTable param0);", "int insert(NjOrderWork2 record);", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "public void setMovementDate (Timestamp MovementDate);", "@Override\n\tpublic void addTransactionToDatabase(Transaction trans) throws SQLException {\n\t\tConnection connect = db.getConnection();\n\t\tString insertQuery = \"insert into transaction_history values(default, ?, ?, ?, now())\";\n\t\tPreparedStatement prepStmt = connect.prepareStatement(insertQuery);\n \n\t\t\tprepStmt.setInt(1, trans.getAccountId());\n\t\t\tprepStmt.setString(2, trans.getUsername());\n\t\t\tprepStmt.setDouble(3, trans.getAmount());\n\t\t\tprepStmt.executeUpdate();\n\t}", "int insert(ExchangeOrder record);", "void updateLastAccessed(int id);", "@Override\n public void insertUpdate(DocumentEvent e) {\n String order = \"\";\n if(fromSplit != null && toSplit != null){\n String query = \n \"Select * from StockOut where cast(dbo.StockOut.Date as date ) between '\"+fromSplit[0]+\"' and \"\n + \" '\"+toSplit[0]+\"' and \" +\n \" (ProductId like '%\"+searchtf.getText()+\"%' or Barcode like '%\"+searchtf.getText()+\"%' or\"\n + \" ProductName like '%\"+searchtf.getText()+\"%' or ProductDesc like '%\"+searchtf.getText()+\"%' or \"\n + \"Category \" \n + \" like '%\"+searchtf.getText()+\"%' or Quantity like '%\"+searchtf.getText()+\"' or \"\n + \"SellPrice like '%\"+searchtf.getText()+\"'or Total like '%\"+searchtf.getText()+\"%' or \"\n + \"InvoiceNo like '%\"+searchtf.getText()+\"%' ) order by invoiceNo \";\n findUsers(query);\n }else{\n String query = \"Select * from StockOut where ProductId like '%\"+searchtf.getText()+\"%' or Barcode like '%\"+searchtf.getText()+\"%' or\"\n + \" ProductName like '%\"+searchtf.getText()+\"%' or ProductDesc like '%\"+searchtf.getText()+\"%' or \"\n + \"Category \" \n + \" like '%\"+searchtf.getText()+\"%' or Quantity like '%\"+searchtf.getText()+\"' or \"\n + \"SellPrice like '%\"+searchtf.getText()+\"'or Total like '%\"+searchtf.getText()+\"%' or \"\n + \"InvoiceNo like '%\"+searchtf.getText()+\"%' order by invoiceNo\";\n findUsers(query);\n }\n \n }", "@PrePersist\n protected void onPersist() {\n this.data = LocalDate.now();\n }", "@Override\n\tpublic void exportarData() {\n\t\tDate date=new Date();\n\t\tString nameFile=\"client-\"+date.getTime()+\".xls\";\n\t\tTableToExcel.save(grid,nameFile);\n\t}", "int insert(BehaveLog record);", "@Override\n public void setUserTimestamp(Date date) {\n }", "public static void audit(String nume_op) {\n try (FileWriter fileWriter = new FileWriter(\"audit.csv\",true)) {\r\n fileWriter.append(nume_op+\": \"+ LocalDate.now().toString()+'\\n');\r\n } catch (IOException e) {\r\n System.out.println(\"Something went wrong in writeUsingFileWriter method\");\r\n }\r\n }", "@Override\r\n\tpublic void salvar(Registro registro) {\n\t\t\r\n\t}", "public Timestamp getDateTrx();", "public Timestamp getDateTrx();", "public void setDateTrx (Timestamp DateTrx)\n{\nif (DateTrx == null) throw new IllegalArgumentException (\"DateTrx is mandatory\");\nset_Value (\"DateTrx\", DateTrx);\n}", "int insert(PineAlarm record);", "public void setDateAcct (Timestamp DateAcct);", "public void setDateAcct (Timestamp DateAcct);", "private void updateTimeStamp() {\n\t\tthis.timeStamp = new Timestamp(System.currentTimeMillis());\n\t}", "@NoProxy\n public void updateDtstamp() {\n setDtstamp(new DtStamp(new DateTime(true)).getValue());\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tSimpleDateFormat sdf=new SimpleDateFormat(\"yyyy年MM月dd日\"+\"hh:mm:ss\");\n\t\t\t\teditor.putString(\"time\", sdf.format(new Date()));\n\t\t\t\teditor.putInt(\"random\", (int)(Math.random()*100));\n\t\t\t\t//编辑完成后要提交\n\t\t\t\teditor.commit();\n\t\t\t}", "int insert(Tourst record);", "public Timestamp getMovementDate();", "int insert(ClOrderInfo record);", "int insert(AoD5e466WorkingDay record);", "public void logrec()\r\n {\n Object[] row = new Object[4];\r\n\r\n if(true){\r\n row[0] = date;\r\n row[1] = un;\r\n row[2] = tn;\r\n // add row to the model\r\n\r\n\r\n model.addRow(row);}\r\n\r\n\r\n }", "public long getStamp() {\n return stamp;\n }", "@PostMapping(\"/demande\")\n public Demande addDemande(@RequestBody Demande demande)\n {\n try\n {\n \n /* ajout traitement spécial :\n * setDateCreate setCreatedBy\n * */\n demande.setDateOp(LocalDateTime.now());\n demande.setUtil(\"admin\");\n demande.setOp(\"A\"); // D,E\n demande= demandeRepository.save(demande);\n }\n catch(Exception e)\n {\n \n }\n return demande;\n }", "private void addGeneratedTimestamp() {\n\t\tif (getConfig().skipGeneratedTimestamps()) {\n\t\t\treturn;\n\t\t}\n\t\tString value = Processor.class.getName();\n\t\tString date = new SimpleDateFormat(\"dd MMM yyyy hh:mm\").format(new Date());\n\t\tthis.pathBindingClass.addImports(Generated.class);\n\t\tthis.pathBindingClass.addAnnotation(\"@Generated(value = \\\"\" + value + \"\\\", date = \\\"\" + date + \"\\\")\");\n\t\tthis.rootBindingClass.addImports(Generated.class);\n\t\tthis.rootBindingClass.addAnnotation(\"@Generated(value = \\\"\" + value + \"\\\", date = \\\"\" + date + \"\\\")\");\n\t}", "public void insertEstudio(){\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\n //Metodo apra almacenar fecha en SQLite\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n String date = sdf.format(new Date());\n\n ContentValues registro = new ContentValues(); // Instanciamos el objeto contenedor de valores.\n registro.put(\"fecha\", date); // Aqui asociamos los atributos de la tabla con los valores de los campos (Recuerda el campo de la tabla debe ser igual aqui)\n registro.put(\"co_actividad\", \"1\"); // Aqui asociamos los atributos de la tabla con los valores de los campos (Recuerda el campo de la tabla debe ser igual aqui)\n\n //Conectamos con la base datos insertamos.\n BasesDeDatos.insert(\"t_estudios\", null, registro);\n BasesDeDatos.close();\n\n }", "public void almacenoDatos(){\n BaseDatosSecundaria administrador= new BaseDatosSecundaria(this);\n SQLiteDatabase bdsecunadaria= administrador.getWritableDatabase();\n _valuesPedido.put(\"Producto\", this._productoNombre);\n _valuesPedido.put(\"Precio\",this._productoPrecio);\n _valuesPedido.put(\"Cantidad\",this._etAdquirir.getText().toString());\n _valuesPedido.put(\"Vendedor\",this.username);\n _valuesPedido.put(\"Id_Producto\",this._productoId);\n bdsecunadaria.insert(\"DATOS\",null,this._valuesPedido);\n bdsecunadaria.close();\n }", "int insertSelective(FinMonthlySnapModel record);", "void setCreationDateTimes(final Order order) {\n final LocalDateTime now = LocalDateTime.now();\n order.setCreatedAt(now);\n order.setUpdatedAt(now);\n order.getData().setOrderedAt(now);\n }", "int insert(R_dept_trade record);", "int insertSelective(NjOrderWork2 record);", "public void saveDay() {\n day.setServices(serviciosTotales);\n day.setTasks(tasksTotales);\n\n databaseReference.child(day.getDate() + \"_\" + day.getUserId()).setValue(day);\n Toast.makeText(context, \"Creando archivo para enviar por correo.\", Toast.LENGTH_LONG).show();\n //todo, so far it will keep updating the day\naskPermissions();\n createExcel();\n\n }", "public void createTimeStamp (Object timeStamp) {\n LineTranslations.getTranslations().createTimeStamp(timeStamp);\n }", "@Override\n\tpublic void exportarData() {\n\t\tDate date=new Date();\n\t\tString nameFile=\"recaudado-\"+date.getTime()+\".xls\";\n\t\tTableToExcel.save(grid,nameFile);\n\t}", "int insert(CalendarDate record);", "int insertSelective(Tipologia record);", "@Transactional\r\n\r\n\t@Override\r\n\tpublic void insertar(Distrito distrito) {\n\t\tem.persist(distrito);\t\r\n\t}", "public void insertarTratamiento(String fecha, String tratamiento)\n {\n ContentValues valores = new ContentValues();\n valores.put(\"fecha\",fecha);\n valores.put(\"tipoTratamiento\",tratamiento);\n db.insert(\"tratamiento\",null,valores);\n\n }", "public abstract java.sql.Timestamp getFecha_ingreso();", "@Override\r\n\tpublic void inserOrder(Good_ordVO good_ordVO, List<PointgoodsVO> list) {\n\t\t\r\n\t}", "int insertSelective(UvStatDay record);", "int insert(TbSerdeParams record);", "@PrePersist\n protected void onCreate(){\n this.createdAt = new Date();\n }", "@NoProxy\n public void updateStag(final Timestamp val) {\n DateTime dt = new DateTime(val);\n// dt.setUtc(true);\n\n setStag(new LastModified(dt).getValue() + \"-\" +\n hex4FromNanos(val.getNanos()));\n }" ]
[ "0.5744472", "0.5628822", "0.56028056", "0.56028056", "0.5601335", "0.55966866", "0.55966866", "0.556211", "0.55150914", "0.5503614", "0.5495126", "0.5480247", "0.54506624", "0.54446894", "0.543884", "0.54169095", "0.5404144", "0.5397883", "0.5381755", "0.5378859", "0.53781015", "0.5377695", "0.5375321", "0.53712636", "0.536354", "0.53554493", "0.53548044", "0.5354513", "0.5340031", "0.5335408", "0.5319683", "0.52929646", "0.52880186", "0.52849567", "0.5276217", "0.527073", "0.5269674", "0.5268084", "0.52670914", "0.5263786", "0.52373654", "0.52296406", "0.52160877", "0.5214041", "0.52092916", "0.5194769", "0.5186158", "0.5185997", "0.5184019", "0.5178353", "0.51765835", "0.51761955", "0.5165384", "0.5164574", "0.51645315", "0.51630723", "0.5160657", "0.51594895", "0.5152627", "0.5146176", "0.51460016", "0.5138394", "0.5134944", "0.51323277", "0.51263046", "0.5122506", "0.5122506", "0.51180106", "0.51150537", "0.510922", "0.510922", "0.5108327", "0.5103601", "0.51011807", "0.509917", "0.5095822", "0.50937337", "0.50825536", "0.5075168", "0.50749785", "0.5074681", "0.50726527", "0.50715065", "0.50705916", "0.5066682", "0.50486386", "0.5046761", "0.5042244", "0.5042164", "0.5036147", "0.50312126", "0.5030068", "0.5029243", "0.5025002", "0.5024711", "0.5020593", "0.5019632", "0.5017816", "0.50166124", "0.5010595", "0.50103784" ]
0.0
-1
Declaring a Location Manager protected LocationManager locationManager; private final Context mContext = null;
public BankATM() { getLocation(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public GPSManager(Activity context) {\n this.mContext = context;\n //Get the current location\n getLocation();\n }", "private synchronized void initLocation() {\n if (locationManager == null) {\n LocationManager manager =\n (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);\n\n Criteria criteriaCoarse = new Criteria();\n /* \"Coarse\" accuracy means \"no need to use GPS\".\n * Typically a gShots phone would be located in a building,\n * and GPS may not be able to acquire a location.\n * We only care about the location to determine the country,\n * so we don't need a super accurate location, cell/wifi is good enough.\n */\n criteriaCoarse.setAccuracy(Criteria.ACCURACY_COARSE);\n criteriaCoarse.setPowerRequirement(Criteria.POWER_LOW);\n String providerName =\n manager.getBestProvider(criteriaCoarse, /*enabledOnly=*/true);\n \n \n List<String> providers = manager.getAllProviders();\n for (String providerNameIter : providers) {\n try {\n LocationProvider provider = manager.getProvider(providerNameIter);\n } catch (SecurityException se) {\n // Not allowed to use this provider\n Logger.w(\"Unable to use provider \" + providerNameIter);\n continue;\n }\n Logger.i(providerNameIter + \": \" +\n (manager.isProviderEnabled(providerNameIter) ? \"enabled\" : \"disabled\"));\n }\n\n /* Make sure the provider updates its location.\n * Without this, we may get a very old location, even a\n * device powercycle may not update it.\n * {@see android.location.LocationManager.getLastKnownLocation}.\n */\n manager.requestLocationUpdates(providerName,\n /*minTime=*/0,\n /*minDistance=*/0,\n new LoggingLocationListener(),\n Looper.getMainLooper());\n locationManager = manager;\n locationProviderName = providerName;\n }\n assert locationManager != null;\n assert locationProviderName != null;\n }", "public void init() {\n mLocationManager = (LocationManager) this.activity.getSystemService(Context\n .LOCATION_SERVICE);\n // checking run time location access permissions only for API version >= 23 (Marshmallow)\n if (ActivityCompat.checkSelfPermission(this.activity, Manifest.permission\n .ACCESS_FINE_LOCATION) !=\n PackageManager.PERMISSION_GRANTED) {\n // if permission is already granted request for permissions\n // ActivityCompat.requestPermissions(\n // this.activity, new String[]{Manifest.permission\n // .ACCESS_FINE_LOCATION},\n // MY_PERMISSIONS_REQUEST_ACCESS_LOCATION);\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,\n UPDATE_INTERVAL_IN_MILLISECONDS, MIN_DISTANCE, locationListener);\n mLocationManager.addGpsStatusListener(gpsStatusListener);\n mLocationManager.addNmeaListener(nmeaListener);\n }", "public LocationUtils(Context context)\r\n {\r\n this.context = context;\r\n this.mFusedLocationClient = LocationServices.getFusedLocationProviderClient(context);\r\n }", "private void locationManager()\n\t{\n mMap.setMyLocationEnabled(true);\n\n // Getting LocationManager object from System Service LOCATION_SERVICE\n LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n\n // Creating a criteria object to retrieve provider\n Criteria criteria = new Criteria();\n\n // Getting the name of the best provider\n String provider = locationManager.getBestProvider(criteria, true);\n\n // Getting Current Location\n Location location = locationManager.getLastKnownLocation(provider);\n\n if(location!=null){\n onLocationChanged(location);\n }\n locationManager.requestLocationUpdates(provider, 20000, 0, this);\n\t\t\n\t}", "protected void setDeviceLocation() {\n\t\tmLocationMgr = (LocationManager) getActivity().getSystemService(\n\t\t\t\tContext.LOCATION_SERVICE);\n\n\t\t// Get last known location from either GPS or Network provider\n\t\tLocation loc = null;\n\t\tboolean netAvail = (mLocationMgr\n\t\t\t\t.getProvider(LocationManager.NETWORK_PROVIDER) != null);\n\t\tboolean gpsAvail = (mLocationMgr\n\t\t\t\t.getProvider(LocationManager.GPS_PROVIDER) != null);\n\t\tif (gpsAvail) {\n\t\t\tloc = mLocationMgr\n\t\t\t\t\t.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n\t\t} else if (netAvail) {\n\t\t\tloc = mLocationMgr\n\t\t\t\t\t.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n\t\t}\n\n\t\t// Just use last location if it's less than 10 minutes old\n\t\tif (loc != null\n\t\t\t\t&& ((new Date()).getTime() - loc.getTime() < 10 * 60 * 1000)) {\n\t\t\tonLocationChanged(loc);\n\t\t} else {\n\t\t\tif (gpsAvail) {\n\t\t\t\tmLocationMgr.requestLocationUpdates(\n\t\t\t\t\t\tLocationManager.GPS_PROVIDER, 0, 0, this);\n\t\t\t}\n\t\t\tif (netAvail) {\n\t\t\t\tmLocationMgr.requestLocationUpdates(\n\t\t\t\t\t\tLocationManager.NETWORK_PROVIDER, 0, 0, this);\n\t\t\t}\n\t\t}\n\t}", "public MainMapLocationSession(Context context, Handler sessionManagerHandler) {\n super(context, sessionManagerHandler);\n mContext = context;\n }", "private FusedLocationProviderClient getLocationProvider() {\n if (mLocationProvider == null) {\n mLocationProvider = LocationServices.getFusedLocationProviderClient(mContext);\n }\n return mLocationProvider;\n }", "private Location getLocation() {\n try {\n locationManager = (LocationManager) getContext().getSystemService(Context.LOCATION_SERVICE);\n\n isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);\n\n isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n\n\n if (!isGPSEnabled && !isNetworkEnabled) {\n\n } else {\n this.canGetLocation = true;\n\n if (isNetworkEnabled) {\n\n if (ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n Log.d(TAG, \"nagy nulla\");\n return null;\n }\n locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 60000, 3, locationListener);\n\n if (locationManager != null){\n location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n if (location != null){\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n }\n }\n }\n\n if (isGPSEnabled){\n if (location == null){\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 3, locationListener);\n if (locationManager != null){\n location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (location != null){\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n }\n }\n }\n } else {\n //showAlertDialog();\n }\n }\n }catch(Exception e){\n e.printStackTrace();\n }\n return location;\n }", "public Location getLocation() {\n\n try {\n\n locationManager = (LocationManager) mContext.getSystemService(LOCATION_SERVICE);\n\n isGPSEnabled = locationManager.isProviderEnabled(GPS_PROVIDER);\n isNetworkEnabled = locationManager.isProviderEnabled(NETWORK_PROVIDER);\n\n if (!isGPSEnabled && !isNetworkEnabled) {\n //Nothing is enabled...\n } else {\n canGetLocation = true;\n\n if (isNetworkEnabled) {\n if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n\n Intent trackingIntent = new Intent(CustomConstants.SEND_TRACKING_MAIL);\n sendBroadcast(trackingIntent);\n\n return null;\n }\n locationManager.requestLocationUpdates(NETWORK_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this);\n\n if (locationManager != null) {\n location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n location.setAccuracy(LOCATION_ACCURACY);\n\n if (location != null) {\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n }\n }\n }\n\n if (isGPSEnabled) {\n\n if (locationManager == null) {\n\n locationManager.requestLocationUpdates(GPS_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this);\n location.setAccuracy(LOCATION_ACCURACY);\n if (locationManager != null) {\n location = locationManager.getLastKnownLocation(GPS_PROVIDER);\n\n if (location != null) {\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n }\n }\n }\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return location;\n }", "private void initializeLocation() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) !=\n PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // Permission is not granted\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n Constants.PERMISSION_FINE_LOCATION);\n } else {\n createLocationRequest();\n }\n } else {\n createLocationRequest();\n }\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.main);\n\t\t// Otteniamo il riferimento al LocationManager\n\t\tLocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n\t\tLog.i(LOG_TAG,\"LocationManager created!\");\n\t\t// Registriamo il LocationListener al provider GPS\n\t\tlocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,\n\t\t\t\t0, new LocationListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\t\t\tLog.i(LOG_TAG,\"onLocationChanged \"+location.getLatitude()+\":\"+location.getLongitude());\n\t\t\t\t\t\tToast.makeText(LocationManagerTest.this,\n\t\t\t\t\t\t\t\t\"onLocationChanged \"+location.getLatitude()+\":\"+location.getLongitude(), Toast.LENGTH_SHORT).show();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onProviderDisabled(String provider) {\n\t\t\t\t\t\tLog.i(LOG_TAG,\"onProviderDisabled \"+provider);\n\t\t\t\t\t\tToast.makeText(LocationManagerTest.this,\n\t\t\t\t\t\t\t\t\"onProviderDisabled \"+provider, Toast.LENGTH_SHORT).show();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\t\t\tLog.i(LOG_TAG,\"onProviderEnabled \"+provider);\n\t\t\t\t\t\tToast.makeText(LocationManagerTest.this,\n\t\t\t\t\t\t\t\t\"onProviderEnabled \"+provider, Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onStatusChanged(String provider, int status,Bundle extras) {\n\t\t\t\t\t\tLog.i(LOG_TAG,\"onStatusChanged \"+provider+\" status: \"+status);\n\t\t\t\t\t\tToast.makeText(LocationManagerTest.this,\n\t\t\t\t\t\t\t\t\"onStatusChanged \"+provider+\" status: \"+status, Toast.LENGTH_SHORT).show();\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t}", "private void initLocation() {\n\t\tlocationManager = (LocationManager) this\n\t\t\t\t.getSystemService(Context.LOCATION_SERVICE);\n\t\t// Define a listener that responds to location updates\n\t\tnetworkLocListener = new MyLocationListener();\n\t\tgpsLocListener = new MyLocationListener();\n\n\t\tlocationProvider2 = LocationManager.NETWORK_PROVIDER;\n\t\tlocationProvider1 = LocationManager.GPS_PROVIDER;\n\n\t\tgps_enabled = false;\n\t\tnetwork_enabled = false;\n\t\t// exceptions will be thrown if provider is not permitted.\n\n\t\t// try{gps_enabled=mlocManager.isProviderEnabled(LocationManager.GPS_PROVIDER);}catch(Exception\n\t\t// ex){}\n\t\tgps_enabled = locationManager\n\t\t\t\t.isProviderEnabled(LocationManager.GPS_PROVIDER);\n\t\t// try{network_enabled=mlocManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);}catch(Exception\n\t\t// ex){}\n\t\tnetwork_enabled = locationManager\n\t\t\t\t.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n\n\t\t// don't start listeners if no provider is enabled\n\t\tif (!gps_enabled && !network_enabled) {\n\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\"Either network or GPS not enabled, please check\",\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t/*\n\t\t\t * Intent gpsOptionsIntent = new\n\t\t\t * Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS\n\t\t\t * ); startActivity(gpsOptionsIntent);\n\t\t\t */\n\t\t}\n\n\t\t// Define a listener that responds to location updates\n\t\t// LocationListener locationListener = new LocationListener() {\n\t\t// @Override\n\t\t// public void onLocationChanged(Location location) {\n\t\t// // Called when a new location is found by the network location\n\t\t// // provider.\n\t\t// if (D)\n\t\t// Log.i(TAG, \"Updating current location\");\n\t\t// Toast.makeText(getApplicationContext(),\n\t\t// \"Updating current location\", Toast.LENGTH_LONG).show();\n\t\t// }\n\t\t//\n\t\t// public void onStatusChanged(String provider, int status,\n\t\t// Bundle extras) {\n\t\t// if (D)\n\t\t// Log.i(TAG, \"status changed\");\n\t\t// }\n\t\t//\n\t\t// public void onProviderEnabled(String provider) {\n\t\t// if (D)\n\t\t// Log.i(TAG, \"location enabled\");\n\t\t// }\n\t\t//\n\t\t// public void onProviderDisabled(String provider) {\n\t\t// if (D)\n\t\t// Log.i(TAG, \"Location disabled\");\n\t\t// }\n\t\t// };\n\n\t\tif (network_enabled) {\n\t\t\tlocationManager.requestLocationUpdates(\n\t\t\t\t\tLocationManager.NETWORK_PROVIDER, 1, 1, networkLocListener);\n\t\t}\n\t\tif (gps_enabled) {\n\t\t\tlocationManager.requestLocationUpdates(\n\t\t\t\t\tLocationManager.GPS_PROVIDER, 1, 1, gpsLocListener);\n\t\t}\n\t}", "@SuppressLint(\"MissingPermission\")\n private void doStuff() {\n LocationManager locationManager = (LocationManager) getApplicationContext().getSystemService(Context.LOCATION_SERVICE);\n if (locationManager != null) {\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, (LocationListener) this);\n }\n\n }", "private void setLocationRequest() {\n locationRequest = new LocationRequest();\n locationRequest.setInterval(10000); // how often we ask provider for location\n locationRequest.setFastestInterval(5000); // 'steal' location from other app\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); // can pick balanced power accuracy\n }", "public void setLocation(Context context) {\n Location location = Util.getLocation(context);\n if (location == null) {\n Logger.e(TAG, \"Location information not available.\");\n } else {\n addToGeoLocationContext(Parameters.LATITUDE, location.getLatitude());\n addToGeoLocationContext(Parameters.LONGITUDE, location.getLongitude());\n addToGeoLocationContext(Parameters.ALTITUDE, location.getAltitude());\n addToGeoLocationContext(Parameters.LATLONG_ACCURACY, location.getAccuracy());\n addToGeoLocationContext(Parameters.SPEED, location.getSpeed());\n addToGeoLocationContext(Parameters.BEARING, location.getBearing());\n }\n }", "public Location(Context context){\n//\t\tthis.context = context;\n\t\tinit(context);\n\t}", "@SuppressLint(\"MissingPermission\")\r\n public void initLocation(){\r\n //LocationManager.NETWORK_PROVIDER Otra opcion\r\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 2, new LocationListener() {\r\n @Override\r\n public void onLocationChanged(@NonNull Location location) {\r\n LatLng pos = new LatLng(location.getLatitude(), location.getLongitude());\r\n myMarker.setPosition(pos);\r\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(pos, 16));\r\n }\r\n\r\n @Override\r\n public void onStatusChanged(String provider, int status, Bundle extras) {\r\n\r\n }\r\n\r\n @Override\r\n public void onProviderDisabled(@NonNull String provider) {\r\n\r\n }\r\n\r\n @Override\r\n public void onProviderEnabled(@NonNull String provider) {\r\n\r\n }\r\n });\r\n }", "private void startForegroundLocationManager() {\n foregroundLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n mlocListener = new MyLocationListener();\n // 0, 0, is minTime ms, minDistance meters\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n foregroundLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mlocListener);\n }", "protected void startLocationUpdates() {\n mLocationRequest = LocationRequest.create()\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY)\n .setInterval(1000000)\n .setFastestInterval(1000000);\n // Request location updates\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, new LocationListener() {\n @Override\n public void onLocationChanged(Location location) {\n mLastLocation = location;\n }\n });\n }\n\n }", "protected void getLocation() {\n if (isLocationEnabled(Navigate.this)) {\n locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n criteria = new Criteria();\n bestProvider = String.valueOf(locationManager.getBestProvider(criteria, true)).toString();\n\n //You can still do this if you like, you might get lucky:\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n Location location = locationManager.getLastKnownLocation(bestProvider);\n if (location != null) {\n Log.e(\"TAG\", \"GPS is on\");\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n } else {\n //This is what you need:\n locationManager.requestLocationUpdates(bestProvider, 1000, 0, this);\n }\n } else {\n// final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n// builder.setMessage(\"Your GPS seems to be disabled, do you want to enable it?\")\n// .setCancelable(false)\n// .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n// public void onClick(final DialogInterface dialog, final int id) {\n// startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS));\n// }\n// })\n// .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n// public void onClick(final DialogInterface dialog, final int id) {\n// dialog.cancel();\n// }\n// });\n// final AlertDialog alert = builder.create();\n// alert.show();\n }\n }", "private void getLocation() {\n //if you don't have permission for location services yet, ask\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_LOCATION_PERMISSION);\n //have the app ask for location permission\n } else {\n fusedLocationClient.requestLocationUpdates\n (getLocationRequest(), mLocationCallback,\n null /* Looper */);\n //uses the type of request and the location callback to update the location\n /**fusedLocationClient.getLastLocation().addOnSuccessListener(\n new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n TextView error = findViewById(R.id.errorMsg);\n error.setVisibility(View.VISIBLE);\n\n if (location != null) {\n lastLocation = location;\n error.setText(\"location: \" + lastLocation.getLatitude());\n } else {\n error.setText(\"location not available\");\n }\n }\n });**/\n }\n }", "private void setupLocationProvider() {\n final LocationManager locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n mGPSLocationProvider = new AppLocationProvider(locManager, LocationManager.GPS_PROVIDER, 1000L);\n mGPSLocationProvider.start();\n\n mActiveLocationProvider = new AppLocationProvider(locManager, LocationManager.NETWORK_PROVIDER, 1000L);\n mActiveLocationProvider.start();\n }", "private void setupLocation() {\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n // Permission is not granted.\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION) &&\n ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_COARSE_LOCATION)) {\n\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n LOCATION_PERMISSION_REQUEST);\n } else {\n // Request the permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n LOCATION_PERMISSION_REQUEST);\n }\n } else {\n // Permission has already been granted\n }\n }", "private void getLocation() {\n LocationRequest mLocationRequestHighAccuracy = new LocationRequest();\n mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL);\n mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL);\n\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"getLocation: stopping the location service.\");\n stopSelf();\n return;\n }\n Log.d(TAG, \"getLocation: getting location information.\");\n mFusedLocationClient.requestLocationUpdates(mLocationRequestHighAccuracy, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Log.d(TAG, \"onLocationResult: got location result.\");\n\n Location location = locationResult.getLastLocation();\n\n if (location != null) {\n\n saveUserLocation(new LatLng(location.getLatitude(),location.getLongitude()));\n }\n }\n },\n Looper.myLooper()); // Looper.myLooper tells this to repeat forever until thread is destroyed\n }", "public LocationService() {\r\n\t\tSettings settings = Settings.getInstance();\r\n\t\tthis.location = settings.getLocation();\r\n\t\tthis.ebAddress = settings.getEbAddress();\r\n\t\tthis.ebPort = settings.getEbPort();\r\n\t\tloggedIn = false;\r\n\t\tobservers = new ArrayList<IObserver>();\r\n\t\tdbAdapter = InformationStorageFactory.getStorageAdapter();\r\n\t}", "Location getLocation(LocationManager locationManager) {\n\t\t// Set criteria necessary for a provider\n\t\tCriteria providerCriteria = new Criteria();\n\t\tproviderCriteria.setAltitudeRequired(true);\n\t\tproviderCriteria.setHorizontalAccuracy(Criteria.ACCURACY_HIGH);\n\t\tproviderCriteria.setVerticalAccuracy(Criteria.ACCURACY_HIGH);\n\t\tproviderCriteria.setBearingAccuracy(Criteria.ACCURACY_HIGH);\n\t\t\n\t\tString providerString = locationManager.getBestProvider(providerCriteria, true);\n\t\tLocationProvider provider = locationManager.getProvider(providerString);\n\t\t\n\t\t// Checks if there is a provider and if that provider meets the criteria\n\t\t// getBestProvider() can return a provider with criteria less than specified\n\t\tif (provider == null || !provider.meetsCriteria(providerCriteria)) {\n\t\t\t\n\t\t\t// No suitable provider found meeting the criteria. Ask user to enable \n\t\t\t// location services.\n\t\t\t\n\t\t\tToast.makeText(this, \"Cannot locate Glass. Please ensure location services are enabled.\", \n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\n\t\t\tLog.e(TAG, \"No location providers. Enable location services to allow \"\n\t\t\t\t\t+ \"location based content.\");\n\t\t\treturn null;\n\t\t}\n\t\treturn locationManager.getLastKnownLocation(providerString);\n\t}", "public Location getLocation() {\n /* if ( Build.VERSION.SDK_INT >= 23 &&\n ContextCompat.checkSelfPermission( mContext, android.Manifest.permission.ACCESS_FINE_LOCATION ) != PackageManager.PERMISSION_GRANTED ) {\n Toast.makeText(mContext,\"Permission is not granted so returning back \",Toast.LENGTH_LONG).show();\n// showSettingsAlert();\n return null ;\n }*/\n\n try {\n\n locationManager = (LocationManager) mContext.getSystemService(LOCATION_SERVICE);\n\n Criteria criteria = new Criteria();\n provider = locationManager.getBestProvider(criteria, false);\n if(provider != null) {\n Location location = locationManager.getLastKnownLocation(provider);\n\n // Initialize the location fields\n if (location != null) {\n System.out.println(\"Provider \" + provider + \" has been selected.\");\n onLocationChanged(location);\n resumeGpsService();\n }\n }else {\n// ISSUtils.checkPermission(mContext);\n }\n\n\n }catch (SecurityException secx) {\n secx.printStackTrace();\n// ISSUtils.checkPermission(mContext);\n showSettingsAlert();\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n\n return location;\n }", "protected void startLocationUpdates() {\n try {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "private void startLocationService() {\n\t\tmLocationMngr = (LocationManager) this\r\n\t\t\t\t.getSystemService(Context.LOCATION_SERVICE);\r\n\r\n\t\tmGpsListener = new GPSListener();\r\n\t\tlong minTime = 10000;\r\n\t\tfloat minDistance = 0;\r\n\r\n\t\tmLocationMngr.requestLocationUpdates(LocationManager.GPS_PROVIDER,\r\n\t\t\t\tminTime, minDistance, mGpsListener);\r\n\t\tmLocationMngr.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,\r\n\t\t\t\tminTime, minDistance, mGpsListener);\r\n\r\n\t\ttry {\r\n\t\t\tLocation lastLocation = mLocationMngr\r\n\t\t\t\t\t.getLastKnownLocation(LocationManager.GPS_PROVIDER);\r\n\t\t\tif (lastLocation != null) {\r\n\t\t\t\tDouble latitude = lastLocation.getLatitude();\r\n\t\t\t\tDouble longitude = lastLocation.getLongitude();\r\n\t\t\t\tString msg = \"Your Current Location \\nLatitude: \" + latitude\r\n\t\t\t\t\t\t+ \", Longitude: \" + longitude;\r\n\t\t\t\tLog.i(TAG, msg);\r\n\t\t\t\t// this.showToastMsg(msg);\r\n\t\t\t\tshowCurrentLocation(latitude, longitude);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tString msg = \"Failed to get current location. Please try later.\";\r\n\t\t\tLog.e(TAG, msg);\r\n\t\t\tshowToastMsg(msg);\r\n\t\t}\r\n\r\n\t}", "@SuppressWarnings(\"unused\")\n Location getCurrentLocation();", "private void getDeviceLocation(){\n mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);\n\n try {\n if (mLocationPermissionsGranted) {\n\n final Task location = mFusedLocationProviderClient.getLastLocation();\n location.addOnCompleteListener(new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if(task.isSuccessful()){\n\n Location currentLocation = (Location) task.getResult();\n\n if (currentLocation == null) {\n\n // Provide default current location\n\n currentLocation = new Location(\"\");\n currentLocation.setLatitude(51.454514);\n currentLocation.setLongitude(-2.587910);\n }\n\n } else {\n Helpers.showToast(getApplicationContext(), \"Could not get current location\");\n }\n }\n });\n }\n } catch (SecurityException e) {\n Helpers.showToast(getApplicationContext(), \"Could not get current location\");\n }\n }", "public void getLocation() {\n\t\tLocationResult locationResult = new LocationResult() {\n\t\t\t@Override\n\t\t\tpublic void gotLocation(Location location) {\n\t\t\t\tLog.d(TAG, \"Got location!\");\n\t\t\t\tmyLocation = location;\n\t\t\t}\n\t\t};\n\t\tMyLocation myLocation = new MyLocation();\n\t\tmyLocation.getLocation(this, locationResult);\n\t}", "protected Location getLocation()\n {\n return location;\n }", "protected Location getLocation()\n {\n return location;\n }", "@SuppressWarnings(\"MissingPermission\")\n private void initializeLocationEngine(){\n locationEngine = new LocationEngineProvider(this).obtainBestLocationEngineAvailable();\n locationEngine.setPriority(LocationEnginePriority.BALANCED_POWER_ACCURACY);\n locationEngine.activate();\n\n Location lastLocation = locationEngine.getLastLocation();\n if(lastLocation != null){\n originLocation = lastLocation;\n setCameraPosition(lastLocation);\n } else{\n locationEngine.addLocationEngineListener(this);\n }\n }", "@RequiresPermission(anyOf = {Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION})\n public LocationTracker(@NonNull Context context) {\n this(context, TrackerSettings.DEFAULT);\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n mLocationPermissionGranted = false;\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n mLocationPermissionGranted = false;\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "@Override\n public void onCreate() {\n super.onCreate();\n\n Integer response = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);\n\n if (response != ConnectionResult.SUCCESS) {\n Log.d(\"LocationUpdateService\", \"Google Play services unavailable\");\n stopSelf();\n return;\n }\n\n locationClient = new LocationClient(this, this, this);\n }", "private void turnOnLocationManager(){\n mLocationManager=(LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n mLocationManager.addTestProvider(LocationManager.GPS_PROVIDER, false, false, false,\n false, true, true, true, 0, 5);\n mLocationManager.setTestProviderEnabled(LocationManager.GPS_PROVIDER, true);\n //mLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, mLocationSource);\n }", "void initializesLocationManager()\n {\n\n try\n {\n //Getting the location manager\n locationManager = (LocationManager)fragment.getActivity().getSystemService(Context.LOCATION_SERVICE);\n\n //Checking if network provider is enabled\n if(locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER))\n {\n //Requesting location updates\n locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MIN_TIME, MIN_DISTANCE, this);\n currentProvider = LocationManager.NETWORK_PROVIDER;\n isListening = true;\n }\n //Checking if gps is enabled\n else if(locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER))\n {\n //Requesting location updates\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, MIN_TIME, MIN_DISTANCE, this);\n currentProvider = LocationManager.GPS_PROVIDER;\n isListening = true;\n }\n else\n {\n isListening = false;\n //Asking the user to enable location provider\n AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(fragment.getActivity()); //The dialog builder\n dialogBuilder.setTitle(R.string.switch_on_location_dialog_title)\n .setMessage(R.string.switch_on_location_dialog_msg)\n .setPositiveButton(R.string.permission_rationale_accept_btn, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which)\n {\n Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); //The intent for switching on the location sources\n fragment.getActivity().startActivity(intent); //Switching on the location services\n }\n });\n dialogBuilder.show();\n }\n\n userLocation = locationManager.getLastKnownLocation(currentProvider);\n }\n catch (SecurityException e)\n {\n e.printStackTrace();\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocation() {\n\t\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n\t\t\tif (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tFusedLocationProviderClient locationProviderClient = LocationServices.getFusedLocationProviderClient(getApplicationContext());\n\t\tlocationProviderClient.getLastLocation().addOnSuccessListener(new OnSuccessListener<Location>() {\n\t\t\t@Override\n\t\t\tpublic void onSuccess(Location location) {\n\t\t\t\t\n\t\t\t\tfinal Location finalLocation = location;\n\t\t\t\t\n\t\t\t\tbtnGoToYou.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tLatLng userLocation = new LatLng(finalLocation.getLatitude(), finalLocation.getLongitude());\n\t\t\t\t\t\tmMap.addMarker(new MarkerOptions().position(userLocation).title(\"You are Here!\"));\n\t\t\t\t\t\tmMap.moveCamera(CameraUpdateFactory.newLatLng(userLocation));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t}", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(mContext,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(mActivity,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "@Override\n protected void onStart() {\n super.onStart();\n // -----------location config ------------\n locationService = ((MyApplication) getApplication()).locationService;\n //获取locationservice实例,建议应用中只初始化1个location实例,然后使用,可以参考其他示例的activity,都是通过此种方式获取locationservice实例的\n locationService.registerListener(mListener);\n //注册监听\n int type = getIntent().getIntExtra(\"from\", 0);\n if (type == 0) {\n locationService.setLocationOption(locationService.getDefaultLocationClientOption());\n } else if (type == 1) {\n locationService.setLocationOption(locationService.getOption());\n }\n locationService.start();// 定位SDK\n }", "private void getDeviceLocation() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n if (mLocationPermissionGranted) {\n mLastKnownLocation = LocationServices.FusedLocationApi\n .getLastLocation(mGoogleApiClient);\n }\n\n // Set the map's camera position to the current location of the device.\n if (mCameraPosition != null) {\n mMap.moveCamera(CameraUpdateFactory.newCameraPosition(mCameraPosition));\n } else if (mLastKnownLocation != null) {\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n Log.d(TAG, \"Permission Result\");\n String[] permissions = {ACCESS_FINE_LOCATION,\n ACCESS_COURSE_LOCATION};\n\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n ACCESS_FINE_LOCATION) == PERMISSION_GRANTED) {\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n ACCESS_COURSE_LOCATION) == PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n permissions,\n LOCATION_PERMISSION_REQUEST_CODE);}\n } else{\n ActivityCompat.requestPermissions(this,\n permissions,\n LOCATION_PERMISSION_REQUEST_CODE);\n }\n }", "private LatLng getCurrentLocation() {\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n return new LatLng(0, 0);\n }\n LocationManager locationManager = (LocationManager) getSystemService(this.LOCATION_SERVICE);\n Location current_location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (current_location == null) {\n return new LatLng(0, 0);\n }\n return new LatLng(current_location.getLatitude(), current_location.getLongitude());\n }", "@SuppressLint(\"MissingPermission\")\n private void Locate(){\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 0, (LocationListener) this);\n\n // Obtain the SupportMapFragment and get notified when the map is ready to be used.\n mapFragment = (SupportMapFragment) getSupportFragmentManager()\n .findFragmentById(R.id.map);\n\n //Initialize fused location\n client = LocationServices.getFusedLocationProviderClient(this);\n }", "protected void SetupLocationRequest()\n {\n mLocationRequest = LocationRequest.create()\n .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)\n .setInterval(30 * 1000) // 30 seconds, in milliseconds\n .setFastestInterval(1 * 1000); // 1 second, in milliseconds\n }", "public synchronized boolean start(Context context, BTManager btManager) {\n mBTManager = btManager;\n if (mLocationManager == null)\n mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);\n if (mLocationManager != null) {\n // check permissions.\n if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return false;\n }\n // retrive provider from settings\n int provider = Integer.parseInt(PreferenceManager.getDefaultSharedPreferences(context).getString(context.getString(R.string.pref_key_location_provider), \"0\"));\n mLocationManager.requestLocationUpdates((provider == 0) ? LocationManager.GPS_PROVIDER : LocationManager.NETWORK_PROVIDER,\n 0, 0, mLocationListener);\n mLocationManager.addNmeaListener(mNmeaMessageListener);\n return true;\n }\n return false;\n }", "@Override\n public void onConnected(Bundle connectionHint) {\n //LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, REQUEST, this); // LocationListener\n }", "private void getDeviceLocation( ) {\n\n if (searchLocationMarker != null) {\n searchLocationMarker.remove();\n }\n\n mFusedLocationProviderClient =\n LocationServices.getFusedLocationProviderClient(this);\n //Task locationResult = mFusedLocationProviderClient.getLastLocation();\n try {\n if (mLocationPermissionGranted) {\n Task locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(this, new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n System.out.println(\"Current location retrieved successfully!\");\n mLastKnownLocation = (Location) task.getResult(); // location?\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n searchLocationMarker = mMap.addMarker(new MarkerOptions()\n .position(new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()))\n .title(\"Current Location\")\n .icon(BitmapDescriptorFactory.fromBitmap(\n getBitmapFromVectorDrawable(\n MainActivity.this, R.drawable.ic_current_location_marker))));\n getNearbyStations(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude());\n\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n searchLocationMarker = mMap.addMarker(new MarkerOptions()\n .position(mDefaultLocation)\n .title(\"Current Location\")\n .icon(BitmapDescriptorFactory.fromBitmap(\n getBitmapFromVectorDrawable(\n MainActivity.this, R.drawable.ic_current_location_marker))));\n }\n }\n });\n }\n } catch(SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(getContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)\n {\n mLocationPermissionGranted = true;\n } else {\n requestPermissions(\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION\n );\n }\n }", "public Location getLocation() {\r\n try {\r\n\r\n locationManager = (LocationManager) mContext\r\n .getSystemService(Context.LOCATION_SERVICE);\r\n\r\n // getting GPS status\r\n isGPSEnabled = locationManager\r\n .isProviderEnabled(LocationManager.GPS_PROVIDER);\r\n\r\n\r\n Log.v(\"isGPSEnabled\", \"=\" + isGPSEnabled);\r\n\r\n // getting network status\r\n isNetworkEnabled = locationManager\r\n .isProviderEnabled(LocationManager.NETWORK_PROVIDER);\r\n\r\n Log.v(\"isNetworkEnabled\", \"=\" + isNetworkEnabled);\r\n\r\n if (isGPSEnabled == false && isNetworkEnabled == false) {\r\n // no network provider is enabled\r\n } else {\r\n this.canGetLocation = true;\r\n if (isNetworkEnabled) {\r\n location=null;\r\n locationManager.requestLocationUpdates(\r\n LocationManager.NETWORK_PROVIDER,\r\n MIN_TIME_BW_UPDATES,\r\n MIN_DISTANCE_CHANGE_FOR_UPDATES, this);\r\n Log.d(\"Network\", \"Network\");\r\n if (locationManager != null) {\r\n location = locationManager\r\n .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\r\n if (location != null) {\r\n latitude = location.getLatitude();\r\n longitude = location.getLongitude();\r\n }\r\n }\r\n }\r\n // if GPS Enabled get lat/long using GPS Services\r\n if (isGPSEnabled) {\r\n location=null;\r\n if (location == null) {\r\n locationManager.requestLocationUpdates(\r\n LocationManager.GPS_PROVIDER,\r\n MIN_TIME_BW_UPDATES,\r\n MIN_DISTANCE_CHANGE_FOR_UPDATES, this);\r\n Log.d(\"GPS Enabled\", \"GPS Enabled\");\r\n if (locationManager != null) {\r\n Criteria crit = new Criteria();\r\n crit.setAccuracy(Criteria.ACCURACY_FINE);\r\n// Gets the best matched provider, and only if it's on\r\n String provider = locationManager.getBestProvider(crit, true);\r\n float accuracy = locationManager.getProvider(provider).getAccuracy();\r\n Log.i(\"show teste\", provider +\" \"+ accuracy);\r\n location = locationManager\r\n .getLastKnownLocation(provider);\r\n location.getAccuracy();\r\n if (location != null) {\r\n latitude = location.getLatitude();\r\n longitude = location.getLongitude();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return location;\r\n }", "public void startLocationService(Context context){\n createLocationRequest();\n mGoogleApiClient = new GoogleApiClient.Builder(context)\n .addApi(LocationServices.API)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .build();\n mGoogleApiClient.connect();\n }", "private void getLocation() {\n if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.INTERNET}\n , 10);\n }\n return;\n }\n\n //Update location\n locationManager.requestLocationUpdates(\"gps\", 5000, 0, listener);\n }", "protected void startLocationUpdates() {\n try {\n// LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n\n /* mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(6000); // two minute interval\n mLocationRequest.setFastestInterval(6000);//120000\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);*/\n /*if (ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }*/\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n// LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, (LocationListener) this);\n LocationServices.getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, null);\n// requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);\n// requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n\n } catch (Exception e) {\n // TODO: handle exception\n e.printStackTrace();\n }\n }", "private void Location() {\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSION_ACCESS_FINE_LOCATION);\n }\n\n //Google Play Location stored in loc variable\n fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n fusedLocationClient.getLastLocation()\n .addOnSuccessListener(this, new OnSuccessListener<Location>() {\n\n\n @Override\n public void onSuccess(Location location) {\n\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n loc = location;\n getAddressFromLocation(loc.getLatitude(), loc.getLongitude());\n\n }\n }\n });\n }", "private void getLocation() {\n LocationRequest mLocationRequestHighAccuracy = new LocationRequest();\n mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL);\n mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL);\n\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"getLocation: stopping the location service.\");\n stopSelf();\n return;\n }\n Log.d(TAG, \"getLocation: getting location information.\");\n mFusedLocationClient.requestLocationUpdates(mLocationRequestHighAccuracy, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n Log.d(TAG, \"onLocationResult: got location result.\");\n Location location = locationResult.getLastLocation();\n if (location != null) {\n GeoPoint geoPoint = new GeoPoint(location.getLatitude(), location.getLongitude());\n userInfoDoc.get().addOnCompleteListener(task -> {\n Boolean av = (Boolean) task.getResult().get(\"Availability\");\n saveUserLocation(geoPoint , av);\n });\n saveDistance(geoPoint);\n\n }\n }\n },\n Looper.myLooper()); // Looper.myLooper tells this to repeat forever until thread is destroyed\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n locationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void activateLocationManager() {\r\n locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\r\n String bestProvider = getBestLocationProvider();\r\n locationAvailable = false;\r\n\r\n // If the bestProvider is not accessible and/or enabled\r\n if (!locationManager.isProviderEnabled(bestProvider)) {\r\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n builder.setMessage(\"Your LOCATION provider seems to be disabled, do you want to enable it?\")\r\n .setCancelable(false)\r\n .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\r\n public void onClick(final DialogInterface dialog, final int id) {\r\n startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));\r\n }\r\n })\r\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\r\n public void onClick(final DialogInterface dialog, final int id) {\r\n dialog.cancel();\r\n }\r\n });\r\n final AlertDialog alert = builder.create();\r\n alert.show();\r\n }\r\n\r\n if (locationManager != null && bestProvider != \"\") {\r\n locationManager.requestLocationUpdates(bestProvider, 3000, 1, locationListener);\r\n }\r\n }", "private void getLocation() {\n if(ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED){\n if(ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION)){\n new AlertDialog.Builder(this)\n .setTitle(\"Location Permission Required\")\n .setMessage(\"This app needs permission to use your location\")\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n ActivityCompat.requestPermissions(RestaurantsActivity.this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_LOCATIONS);\n }\n })\n .create()\n .show();\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_LOCATIONS);\n }\n }\n }", "private void getDeviceLocation() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n if (mLocationPermissionGranted) {\n mLastKnownLocation = LocationServices.FusedLocationApi\n .getLastLocation(mGoogleApiClient);\n if (world.geoHome == null && mLastKnownLocation != null) {\n world.geoHome = new Vector2f(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude());\n }\n }\n\n // Set the map's camera position to the current location of the device.\n /*if (mCameraPosition != null) {\n mMap.moveCamera(CameraUpdateFactory.newCameraPosition(mCameraPosition));\n } else if (mLastKnownLocation != null) {\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), mMap.getCameraPosition().zoom));\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }*/\n }", "private void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(activity.getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(activity,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private UserLocation getLocation() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION)) {\n Toast.makeText(this, \"The Location Permission is needed to show the weather \", Toast.LENGTH_SHORT).show();\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_LOCATION_CODE_PERMISSION);\n }\n }\n\n } else {\n Log.d(TAG, \"getLocation: Permission Granted\");\n mFusedLocationClient.getLastLocation().addOnSuccessListener(new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n if (location != null) {\n msLocation = location;\n userLocation.setLat(location.getLatitude());\n userLocation.setLon(location.getLongitude());\n\n mLocationText.setText(getString(R.string.location_text\n , msLocation.getLatitude()\n , msLocation.getLongitude()\n , msLocation.getTime()));\n RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\n params.addRule(RelativeLayout.CENTER_HORIZONTAL);\n mLocationText.setGravity(Gravity.CENTER_HORIZONTAL);\n mLocationText.setLayoutParams(params);\n mLocationText.setTextSize(24);\n\n } else {\n mLocationText.setText(R.string.no_location);\n }\n }\n });\n\n }\n return userLocation;\n }", "private void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n locationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void initLocationData() {\n\n // init google client and request for fused location provider\n fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);\n\n locationRequest = new LocationRequest()\n //.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) // GPS quality location points\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY) // optimized for battery\n .setInterval(20000) // at least once every 20 seconds\n .setFastestInterval(10000); // at most once every 10 seconds\n\n locationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Point userPoint;\n if (locationResult != null) {\n // update user location\n Location lastLocation = locationResult.getLastLocation();\n userPoint = new Point(lastLocation.getLatitude(), lastLocation.getLongitude());\n // cache location\n PreferencesCache.setLastLatitude(lastLocation.getLatitude());\n PreferencesCache.setLastLongitude(lastLocation.getLongitude());\n } else {\n // get cached data\n userPoint = new Point(PreferencesCache.getLastLatitude(), PreferencesCache.getLastLongitude());\n }\n\n navigator.updateUserLocation(userPoint);\n }\n };\n }", "protected void startLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n //mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n // Create LocationSettingsRequest object using location request\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n // Check whether location settings are satisfied\n // https://developers.google.com/android/reference/com/google/android/gms/location/SettingsClient\n SettingsClient settingsClient = LocationServices.getSettingsClient(this);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n try{\n getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation(),false);\n }\n },\n Looper.myLooper());\n }\n catch(SecurityException e){\n e.printStackTrace();\n }\n\n }", "protected void createLocationRequest() {\n mLocationRequest = new LocationRequest();\n\n // Sets the desired interval for active location updates. This interval is\n // inexact.\n mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MILLISECONDS);\n\n // Sets the fastest rate for active location updates. This interval is exact, and your\n // application will never receive updates faster than this value.\n mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS);\n\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n Log.d(Constants.LOCATION_REQUEST, Constants.LOCATION_REQUEST);\n }", "private void getUserCurrentLocation()\n\t {\n\t NicerLocationManager locationMgr = new NicerLocationManager(this.getApplicationContext());\n\t if (locationMgr.isAnyLocationServicesAvailble())\n\t {\n\t Log.i(\"MAIN\",\"retrieving current location...\");\n\n\t // get current location\n\t locationMgr.getBestGuessLocation(1000,\n\t new NicerLocationListener() {\n\n\t @Override\n\t public void locationLoaded(final Location location)\n\t {\n\t // parse the current site forecast for users current\n\t // location in the background\n\t //LocationForecastSetup currentForecast = new LocationForecastSetup();\n\t //currentForecast.execute(location);\n\n\t // QLog.i(\"location loaded. finding nearest location...\");\n\t //\n\t // // find nearest weather location\n\t // Site nearestLocation =\n\t // Utils.findNearestSite(mApp, location);\n\t //\n\t // // insert the new current user location site\n\t // SitesProviderHelper.addSavedSite(mApp,\n\t // Long.valueOf(nearestLocation.getmSiteId()), true);\n\t //\n\t Log.i(\"MAIN\",\"location found \"+location.getLatitude()+\" \"+location.getLongitude());\n\t dS.lat=(float) location.getLatitude();\n\t dS.lon=(float) location.getLongitude();\n\t //TextView versionText = (TextView) findViewById(R.id.info_area_string);\n\t //versionText.setText(\"lat \" + location.getLatitude()+\" lon \"+location.getLongitude());\n\t \n\t //\n\t // /*\n\t // * add blank site if user has no saved sites. a blank site\n\t // * forecast is also added in the WeatherService class\n\t // * (runWeatherService method) to display correctly in the\n\t // * view pager.this is later removed when a user adds a\n\t // site\n\t // * and added again when user removes last site.\n\t // */\n\t // SitesProviderHelper.addBlankSavedSite(mApp);\n\t //\n\t // // re-order sites so current location is first\n\t // SitesProviderHelper.setSiteOrder(mApp,\n\t // nearestLocation.getmSiteId(), \"0\");\n\t // SitesProviderHelper.setSiteOrder(mApp,\n\t // Consts.BLANK_SITE_ID, \"1\");\n\n\t }\n\n\t @Override\n\t public void error()\n\t {\n\t // give option to change location settings or select a\n\t // location manually\n\t Log.e(\"MAIN\",\"Error finding best guess location\");\n dS.lat=0;\n dS.lon=0;\n if(once)\n {\n\t //promptSetLocationService(MainActivity.this);\n }\n once=false;\n\t }\n\n\t @Override\n\t public void onFinished()\n\t {\n\t //runUpdateService(false, false);\n\t \tLog.i(\"MAIN\",\"onFinished\");\n\t }\n\t });\n\n\t }\n\t else\n\t {\n\t \n\t \tdS.lat=0;\n dS.lon=0;\n\t \n\t }\n\n\t }", "protected void startLocationUpdates()\n {\n try\n {\n if (googleApiClient.isConnected())\n {\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);\n isRequestingLocationUpdates = true;\n }\n }\n catch (SecurityException e)\n {\n Toast.makeText(getContext(), \"Unable to get your current location!\" +\n \" Please enable the location permission in Settings > Apps \" +\n \"> Bengaluru Buses.\", Toast.LENGTH_LONG).show();\n }\n }", "private void getDeviceLocation() {\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(getActivity(), new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful()) {\n // Set the customer_map's camera position to the current location of the device.\n mLastKnownLocation = task.getResult();\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n getNearestDriver();\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n mMap.moveCamera(CameraUpdateFactory\n .newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n\n }\n }\n });\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "public Location getLocation(){\n try{\n\n locationManager = (LocationManager) context.getSystemService(LOCATION_SERVICE);\n isGPSEnabled = locationManager.isProviderEnabled(locationManager.GPS_PROVIDER);\n isNetworkEnabled=locationManager.isProviderEnabled(locationManager.NETWORK_PROVIDER);\n\n if(ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED\n || ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED ){\n\n if(isGPSEnabled){\n if(location==null){\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000,10,this);\n if(locationManager!=null){\n location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }\n }\n }\n // if lcoation is not found from GPS than it will found from network //\n if(location==null){\n if(isNetworkEnabled){\n\n locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 10000,10,this);\n if(locationManager!=null){\n location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n }\n\n }\n }\n\n }\n\n }catch(Exception ex){\n\n }\n\n\n\n return location;\n }", "private void StartLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n // Create LocationSettings object using location request\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n // Checks if location settings are OK\n SettingsClient settingsClient = LocationServices.getSettingsClient(context);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission\n (context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n return;\n }else {\n getFusedLocationProviderClient(context).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation());\n// getLastLocation();\n }\n },\n Looper.myLooper());\n }\n\n }", "public void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(getActivity().getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(getActivity(), new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "public Location getCurrentLocation() {\n\n Location location = null;\n\n try {\n mLocationManager = (LocationManager) mContext\n .getSystemService(Context.LOCATION_SERVICE);\n\n // get GPS status\n mIsGpsEnabled = mLocationManager\n .isProviderEnabled(LocationManager.GPS_PROVIDER);\n\n // get network status\n mIsNetworkEnabled = mLocationManager\n .isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n\n if (mIsGpsEnabled || mIsNetworkEnabled) {\n this.mGetLocationPossible = true;\n\n if (mIsNetworkEnabled) {\n mLocationManager.requestLocationUpdates(\n LocationManager.NETWORK_PROVIDER,\n MIN_TIME_BW_UPDATES,\n MIN_DISTANCE_CHANGE_FOR_UPDATES, this);\n\n if (mLocationManager != null) {\n location = mLocationManager\n .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n }\n }\n\n // if GPS Enabled get lat/long using GPS Services\n if (mIsGpsEnabled) {\n location = null;\n\n if (location == null) {\n mLocationManager.requestLocationUpdates(\n LocationManager.GPS_PROVIDER,\n MIN_TIME_BW_UPDATES,\n MIN_DISTANCE_CHANGE_FOR_UPDATES, this);\n\n if (mLocationManager != null) {\n location = mLocationManager\n .getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }\n }\n }\n }\n\n } catch (Exception aExc) {\n aExc.printStackTrace();\n }\n\n return location;\n }", "private void enableMyLocation() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n // Permission to access the location is missing.\n PermissionUtils.requestPermission(this, LOCATION_PERMISSION_REQUEST_CODE,\n Manifest.permission.ACCESS_FINE_LOCATION, true);\n mMap.setMyLocationEnabled(true);\n } else if (mMap != null) {\n // Access to the location has been granted to the app.\n mMap.setMyLocationEnabled(true);\n }\n Log.i(\"Current Location\", \"Location Enabled:\" + mMap.isMyLocationEnabled());\n LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n LocationListener locationListener = new OrderLocationListener();\n\n // Register the listener with the Location Manager to receive location updates\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 9000, 0, locationListener);\n Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n\n makeUseOfNewLocation(location);\n\n location = LocationServices.FusedLocationApi.getLastLocation(client);\n\n makeUseOfNewLocation(location);\n\n }", "private void initLocation() {\n BaiduLocationHolder.OPTION.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);\n //可选,默认高精度,设置定位模式,高精度,低功耗,仅设备\n\n BaiduLocationHolder.OPTION.setCoorType(\"bd09ll\");\n //可选,默认gcj02,设置返回的定位结果坐标系\n\n int span = 1000;\n BaiduLocationHolder.OPTION.setScanSpan(span);\n //可选,默认0,即仅定位一次,设置发起定位请求的间隔需要大于等于1000ms才是有效的\n\n BaiduLocationHolder.OPTION.setIsNeedAddress(true);\n //可选,设置是否需要地址信息,默认不需要\n\n BaiduLocationHolder.OPTION.setOpenGps(true);\n //可选,默认false,设置是否使用gps\n\n BaiduLocationHolder.OPTION.setLocationNotify(true);\n //可选,默认false,设置是否当GPS有效时按照1S/1次频率输出GPS结果\n\n BaiduLocationHolder.OPTION.setIsNeedLocationDescribe(true);\n //可选,默认false,设置是否需要位置语义化结果,可以在BDLocation.getLocationDescribe里得到,结果类似于“在北京天安门附近”\n\n BaiduLocationHolder.OPTION.setIsNeedLocationPoiList(true);\n //可选,默认false,设置是否需要POI结果,可以在BDLocation.getPoiList里得到\n\n BaiduLocationHolder.OPTION.setIgnoreKillProcess(false);\n //可选,默认true,定位SDK内部是一个SERVICE,并放到了独立进程,设置是否在stop的时候杀死这个进程,默认不杀死\n\n BaiduLocationHolder.OPTION.SetIgnoreCacheException(false);\n //可选,默认false,设置是否收集CRASH信息,默认收集\n\n BaiduLocationHolder.OPTION.setEnableSimulateGps(false);\n //可选,默认false,设置是否需要过滤GPS仿真结果,默认需要\n\n// BaiduLocationHolder.OPTION.setWifiValidTime(5*60*1000);\n //可选,7.2版本新增能力,如果您设置了这个接口,首次启动定位时,会先判断当前WiFi是否超出有效期,超出有效期的话,会先重新扫描WiFi,然后再定位\n\n BaiduLocationHolder.CLIENT.setLocOption(BaiduLocationHolder.OPTION);\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(getActivity().getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(getActivity(),\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "@Override\n public void onConnected(Bundle connectionHint) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest,\n this);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public void onConnected(@Nullable Bundle bundle) {\n\n locationReq = new LocationRequest();\n locationReq.setInterval(1000);\n locationReq.setFastestInterval(1000);\n //accuracy can be changed to save battery/resources\n locationReq.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n /*\n TODO: Consider calling\n ActivityCompat#requestPermissions\n here to request the missing permissions, and then overriding\n public void onRequestPermissionsResult(int requestCode, String[] permissions,\n int[] grantResults)\n to handle the case where the user grants the permission. See the documentation\n for ActivityCompat#requestPermissions for more details.\n */\n return;\n }\n\n\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationReq, this);\n }", "@SuppressLint(\"RestrictedApi\")\n protected void startLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n SettingsClient settingsClient = LocationServices.getSettingsClient(this);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation());\n }\n },\n Looper.myLooper());\n }", "private void startService() {\r\n\r\n\t\t// ---use the LocationManager class to obtain GPS locations---\r\n\t\tlm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\r\n\t\tlocationListener = new MyLocationListener();\r\n\r\n\t\tlm.requestLocationUpdates(LocationManager.GPS_PROVIDER, minTimeMillis,\r\n\t\t\t\tminDistanceMeters, locationListener);\r\n\t\tlocationListener.onLocationChanged(lm.getLastKnownLocation(LocationManager.GPS_PROVIDER));\r\n\t}", "public AppLocationProvider(LocationManager locationManager, String provider, long updateInterval) {\n super(locationManager, provider, updateInterval);\n mProvider = provider;\n }", "@SuppressWarnings({\"MissingPermission\"})\n void getMyLocation() {\n mGoogleMap.setMyLocationEnabled(true);\n FusedLocationProviderClient locationClient = getFusedLocationProviderClient(getContext());\n locationClient.getLastLocation()\n .addOnSuccessListener(new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n if (location != null) {\n onLocationChanged(location);\n moveCamera();\n drawCircle();\n drawMarkers();\n }\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(\"MapDemoActivity\", \"Error trying to get last GPS location\");\n e.printStackTrace();\n }\n });\n }", "private void enableLocation(){\n if(PermissionsManager.areLocationPermissionsGranted(this))\n {\n initializeLocationEngine();\n initializeLocationLayer();\n\n\n }else{\n permissionsManager = new PermissionsManager(this);\n permissionsManager.requestLocationPermissions(this);\n }\n }", "private void getDeviceLocation() {\n try {\n if (mLocationPermissionGranted) {\n Task locationResult = fusedLocationClient.getLastLocation();\n locationResult.addOnCompleteListener(this, new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful() && task.getResult() != null) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = task.getResult();\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n } else {\n Log.d(TAG,\"Current location is null. Using defaults.\");\n Log.e(TAG, task.getException().toString());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n } catch(SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "@SuppressLint(\"MissingPermission\")\n private void configureLocation() {\n\n locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000, 1, (android.location.LocationListener) locationListener);\n location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n Toast.makeText(getApplicationContext(), \"net acquired\", Toast.LENGTH_LONG).show();\n }", "@Override\r\n public void onConnected(Bundle bundle) { // Implemented Methods\r\n if (Build.VERSION.SDK_INT < 23) { // Lower than Marshmallow build\r\n mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);\r\n } else { // User to approve the permission\r\n if (ActivityCompat.checkSelfPermission(LocationActivity.this, Manifest.permission.ACCESS_FINE_LOCATION)\r\n == PackageManager.PERMISSION_GRANTED)\r\n mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);\r\n else\r\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION},0);\r\n }\r\n if (mLocation != null) {\r\n latitude = String.valueOf(mLocation.getLatitude());\r\n longitude = String.valueOf(mLocation.getLongitude());\r\n //Log.i(\"value\",\"Latitude: \" + latitude + \" Longitude: \" + longitude);\r\n // Pass location coordinate for user login\r\n Intent intent = new Intent(LocationActivity.this, UserActivity.class);\r\n intent.putExtra(\"latitude\", latitude);\r\n intent.putExtra(\"longitude\", longitude);\r\n LocationActivity.this.startActivity(intent);\r\n finish();\r\n } else {\r\n // Request user to turn on Location\r\n displayLocationSettingsRequest(LocationActivity.this);\r\n //Log.i(\"value\",\"Location not Detected\");\r\n }\r\n\r\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(), ACCESS_FINE_LOCATION) == PERMISSION_GRANTED &&\n ContextCompat.checkSelfPermission(this.getApplicationContext(), ACCESS_COARSE_LOCATION) == PERMISSION_GRANTED) {\n locationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{\n ACCESS_FINE_LOCATION,\n ACCESS_COARSE_LOCATION\n }, PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "public LocationAdapter(Context mCtx, LocationViewModel viewModel) {\n this.mCtx = mCtx;\n this.locationList = new ArrayList<Location>();\n this.viewModel = viewModel;\n }", "private void createLocationCallback() {\n mLocationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n\n app.mCurrentLocation = locationResult.getLastLocation();\n initCamera(app.mCurrentLocation);\n }\n };\n }", "private void getLocation() { \n LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); \n Criteria criteria = new Criteria(); \n criteria.setAccuracy(Criteria.ACCURACY_FINE); \n criteria.setAltitudeRequired(false); \n criteria.setBearingRequired(false); \n criteria.setCostAllowed(true);\n criteria.setPowerRequirement(Criteria.POWER_LOW); \n String provider = locationManager.getBestProvider(criteria,true); \n \n //In order to make sure the device is getting location, request updates. locationManager.requestLocationUpdates(provider, 1, 0, this); \n mostRecentLocation = locationManager.getLastKnownLocation(provider); \n }", "private void getLocationPermission() {\n Log.wtf(TAG, \"getLocationPermission() has been instantiated\");\n\n Log.d(TAG, \"getLocationPermission: getting location permissions\");\n String[] permissions = {\n FINE_LOCATION,\n COARSE_LOCATION\n };\n\n if (ContextCompat.checkSelfPermission(getActivity(), FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n if (ContextCompat.checkSelfPermission(getActivity(), COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n Log.d(TAG, \"getLocationPermission: Permission granted\");\n initMap();\n\n } else {\n Log.d(TAG, \"getLocationPermission: requesting permission\");\n requestPermissions(permissions, LOCATION_PERMISSION_REQUEST_CODE);\n }\n } else {\n Log.d(TAG, \"getLocationPermission: requesting permission\");\n requestPermissions(permissions, LOCATION_PERMISSION_REQUEST_CODE);\n }\n }", "public Location getLocation() {\n try {\n initLocation();\n Location location = locationManager.getLastKnownLocation(locationProviderName);\n if (location == null) {\n Logger.e(\"Cannot obtain location from provider \" + locationProviderName);\n return new Location(\"unknown\");\n }\n return location;\n } catch (IllegalArgumentException e) {\n Logger.e(\"Cannot obtain location\", e);\n return new Location(\"unknown\");\n }\n }", "private void startLoggerService() {\n\n // ---use the LocationManager class to obtain GPS locations---\n lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n GPSLoggerService.setLocationManager(lm);\n\n locationListener = new MyLocationListener();\n\n lm.requestLocationUpdates(LocationManager.GPS_PROVIDER,\n minTimeMillis,\n minDistanceMeters,\n locationListener);\n lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,\n minTimeMillis,\n minDistanceMeters,\n locationListener);\n\n }" ]
[ "0.7542527", "0.7353045", "0.72733647", "0.70098686", "0.6915131", "0.6769254", "0.6702591", "0.6675654", "0.66699404", "0.66564953", "0.66356415", "0.65962845", "0.6543707", "0.65255094", "0.6521939", "0.65202916", "0.6436812", "0.64028645", "0.63648504", "0.63601744", "0.6358829", "0.6357443", "0.63505656", "0.63291806", "0.6320624", "0.6319098", "0.631208", "0.6271249", "0.62558484", "0.6241493", "0.62190855", "0.619929", "0.6188393", "0.6167713", "0.6167713", "0.61596745", "0.61576355", "0.6145599", "0.6145599", "0.61446404", "0.61404365", "0.6118165", "0.6094769", "0.6094769", "0.6084719", "0.6084719", "0.60770726", "0.6075008", "0.60687846", "0.6063068", "0.60566014", "0.60511816", "0.6049656", "0.6044614", "0.6043823", "0.60417056", "0.60408", "0.60393703", "0.6038241", "0.60359627", "0.60248375", "0.60158384", "0.601375", "0.6011544", "0.60089374", "0.6006423", "0.60024726", "0.6000656", "0.5999424", "0.59988505", "0.59986925", "0.59968", "0.5992309", "0.59873563", "0.5983267", "0.598096", "0.5978882", "0.59780633", "0.5977715", "0.5973597", "0.59674543", "0.59644073", "0.59626675", "0.5957256", "0.5955224", "0.59501654", "0.59493786", "0.59454894", "0.59418356", "0.5928043", "0.5927081", "0.59250253", "0.5924194", "0.59229237", "0.59182066", "0.5917318", "0.59141624", "0.59140587", "0.59135056", "0.59101105", "0.5905691" ]
0.0
-1
Manipulates the map once available. This callback is triggered when the map is ready to be used. This is where we can add markers or lines, add listeners or move the camera. In this case, we just add a marker near Sydney, Australia. If Google Play services is not installed on the device, the user will be prompted to install it inside the SupportMapFragment. This method will only be triggered once the user has installed Google Play services and returned to the app. Function to get latitude
public double getLatitude(){ if(location != null){ latitude = location.getLatitude(); } // return latitude return latitude; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onMapReady(GoogleMap googleMap) {\n Geocoder geoCoder = new Geocoder(getActivity(), Locale.getDefault());\n double lat, lng;\n try {\n List<Address> addresses = geoCoder.getFromLocationName(\"Western Sydney Paramatta, NSW\", 5);\n lat = addresses.get(0).getLatitude();\n lng = addresses.get(0).getLongitude();\n } catch (Exception e) {\n lat = -34;\n lng = 151;\n }\n\n LatLng sydney = new LatLng(lat, lng);\n googleMap.addMarker(new MarkerOptions().position(sydney).title(\"WSU Paramatta\"));\n googleMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n googleMap.setMyLocationEnabled(true);\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\r\n googleMap.setMyLocationEnabled(true);\r\n\r\n LocationManager locationManager = (LocationManager)\r\n getSystemService(Context.LOCATION_SERVICE);\r\n Criteria criteria = new Criteria();\r\n\r\n Location currentLocation = locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, false));\r\n\r\n LatLng sydney = new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude());\r\n\r\n googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));\r\n\r\n } else {\r\n PermissionUtils.requestPermission(this, LOCATION_PERMISSION_REQUEST_CODE, Manifest.permission.ACCESS_FINE_LOCATION, true);\r\n }\r\n\r\n updateMarkersData(googleMap);\r\n\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mMap.setMyLocationEnabled(true);\n } else {\n ActivityCompat.requestPermissions(this,new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 1);\n }\n // Add a marker in Sydney and move the camera\n if (loc != -1 && loc != 0) {\n locationManager.removeUpdates(this);\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(MainActivity.locations.get(loc), 10));\n\n mMap.addMarker(new MarkerOptions().position(MainActivity.locations.get(loc)).title(MainActivity.places.get(loc)));\n } else {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n locationManager.requestLocationUpdates(provider, 400, 1, this);\n\n }\n mMap.setOnMapLongClickListener(this);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n gpsTracker = new GPSTracker(this);\n\n // TODO Cek Permission >= Marshmellow\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED\n &&\n ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&\n checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n requestPermissions(new String[]{\n Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION\n }, 110);\n return;\n }\n }\n\n if (gpsTracker.canGetLocation()) {\n latawal = gpsTracker.getLatitude();\n lonawal = gpsTracker.getLongitude();\n namelocationawal = myLocation(latawal, lonawal);\n }\n\n // Add a marker in Sydney and move the camera\n LatLng myLocation = new LatLng(latawal, lonawal);\n locawal.setText(namelocationawal);\n mMap.addMarker(new MarkerOptions().position(myLocation).title(namelocationawal));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 14));\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n mMap.setPadding(30, 80, 30, 80);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_REQUEST_CODE);\n\n } else {\n buildGoogleApiClient();\n mMap.setMyLocationEnabled(true);\n }\n\n /* // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));*/\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n mMap = googleMap;\r\n if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)!= PackageManager.PERMISSION_GRANTED){\r\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},101);\r\n }\r\n loc = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);\r\n populateMap(loc);\r\n try {\r\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lm.getLastKnownLocation(LocationManager.GPS_PROVIDER).getLatitude(), lm.getLastKnownLocation(LocationManager.GPS_PROVIDER).getLongitude()), 15.0f));\r\n }catch(Exception blyat){\r\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n builder.setMessage(\"No hemos podido acceder a tu localización, revisa el estado de GPS y reinicia la app\");\r\n builder.show();\r\n }\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.setTrafficEnabled(true);\n mMap.setIndoorEnabled(true);\n mMap.setBuildingsEnabled(true);\n mMap.getUiSettings().setZoomControlsEnabled(true);\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(43.777365,-79.3406);\n LatLng loc22=new LatLng(43.775748,-79.336674);\n LatLng loc3=new LatLng(43.769240,-79.360010);\n LatLng loc4=new LatLng(43.769290,-79.400101);\n LatLng loc5=new LatLng(43.769552,-79.601201);\n mMap.addMarker(new MarkerOptions().position(sydney).title(values[0]));\n mMap.addMarker(new MarkerOptions().position(loc22).title(values[1]));\n mMap.addMarker(new MarkerOptions().position(loc3).title(values[2]));\n mMap.addMarker(new MarkerOptions().position(loc4).title(values[3]));\n mMap.addMarker(new MarkerOptions().position(loc5).title(values[4]));\n\n //mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n Log.d(\"TEST\", \"MAP READY\");\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n\n LatLng curLocation = new LatLng(latitude,longitude);\n CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(curLocation,15.0f);\n setPin(latitude,longitude, null);\n mMap.moveCamera(cameraUpdate);\n for(int i = 0; i < restaurantList.size(); i++){\n double lat = restaurantList.get(i).getLatitude();\n double lng = restaurantList.get(i).getLongitude();\n setPin(lat, lng, restaurantList.get(i));\n }\n //Check we have the users permission to access their location\n // if we dont have it, we have to request it\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)== PackageManager.PERMISSION_GRANTED){\n mMap.setMyLocationEnabled(true);\n\n } else {\n //we dont have permission, so we have to ask for it\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_LOCATION_REQUEST_CODE);\n //run asychronously.. show an alert dialog\n //user can choose allow or deny\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n getLat g = new getLat();\n g.execute(tid);\n\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Pula and move the camera\n LatLng pula = new LatLng(44.86726450096342, 13.850460687162476);\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(pula, 13));\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n enableUserLocation();\n zoomTooUserLocation();\n } else {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission\n .ACCESS_FINE_LOCATION)) {\n //we can show user dialog why this permission is necessery\n\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission\n .ACCESS_FINE_LOCATION}, LOCATION_REQUEST_CODE);\n\n } else {\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission\n .ACCESS_FINE_LOCATION}, LOCATION_REQUEST_CODE);\n }\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n mLocationRequest = LocationRequest.create()\n .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)\n .setInterval(1*1000)\n .setFastestInterval(5 * 100);\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mMap.setMyLocationEnabled(true);\n } else {\n // Show rationale and request permission.\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n getMarkers();\n\n // Add a marker in Sydney and move the camera\n LatLng penn = new LatLng(39.952290, -75.197060);\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(penn, 15));\n mMap.setMyLocationEnabled(true);\n UiSettings uiSettings = mMap.getUiSettings();\n uiSettings.setZoomControlsEnabled(true);\n uiSettings.setCompassEnabled(true);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n mMap = googleMap;\n //Agafar la localitzacio actual per mostrar-ho al mapa\n LocationManager locationManager = (LocationManager)\n getSystemService(Context.LOCATION_SERVICE);\n Criteria criteria = new Criteria();\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n Location location = locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, false));\n LatLng actual = new LatLng((location.getLatitude()),location.getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(actual,13));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(LocationStorage.getInstance().getLocation().getLatitude(), LocationStorage.getInstance().getLocation().getLongitude());\n// BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.ic_large_marker);\n Marker marker = mMap.addMarker(new MarkerOptions().position(sydney).title(\"Current Location\").snippet(\"Hold and drag to your desired location\"));\n marker.showInfoWindow();\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(sydney, 15);\n mMap.animateCamera(cameraUpdate);\n marker.setDraggable(true);\n mMap.setOnMarkerDragListener(new GoogleMap.OnMarkerDragListener() {\n @Override\n public void onMarkerDragStart(Marker marker) {\n\n }\n\n @Override\n public void onMarkerDrag(Marker marker) {\n\n }\n\n @Override\n public void onMarkerDragEnd(Marker marker) {\n LatLng latLng=marker.getPosition();\n Location temp = new Location(LocationManager.GPS_PROVIDER);\n temp.setLatitude(latLng.latitude);\n temp.setLongitude(latLng.longitude);\n LocationStorage.getInstance().setLocation(temp);\n }\n });\n// mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {\n// @Override\n// public boolean onMarkerClick(Marker marker) {\n//\n// return true;\n// }\n// });\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n riderLat = getIntent().getDoubleExtra(DriverActivity.RIDER_LATITUDE_EXTRA, 0.0);\n riderLong = getIntent().getDoubleExtra(DriverActivity.RIDER_LONGITUDE_EXTRA, 0.0);\n LatLng rider = new LatLng(riderLat, riderLong);\n riderMarker = mMap.addMarker(new MarkerOptions()\n .position(rider)\n .title(\"Rider\")\n .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)));\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED\n\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n Toast.makeText(this, \"You don't have location permission\", Toast.LENGTH_LONG).show();\n return;\n }\n\n Location hereNow = mLocationManager.getLastKnownLocation(mBestProvider);\n if (hereNow != null) {\n onLocationChanged(hereNow);\n }\n\n mLocationManager.requestLocationUpdates(mBestProvider, 400, 1, this);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n LatLng location = new LatLng(mLat, mLng);\n moveCamera(location, DEFAUT_ZOOM);\n if (ActivityCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(\n this,\n android.Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mMap.setMyLocationEnabled(true);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n frLatLng = new LatLng(getLatitude, getLongitude);\n\n map = googleMap;\n map.getUiSettings().setMyLocationButtonEnabled(false);\n\n if (ActivityCompat.checkSelfPermission(getContext()\n , Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(getContext(),\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n return;\n }\n\n map.addMarker(new MarkerOptions().position(frLatLng)).setTitle(getString(R.string.my_location));\n googleMap.getUiSettings().setMyLocationButtonEnabled(true);\n map.animateCamera(CameraUpdateFactory.newLatLngZoom(frLatLng, 520));\n\n }", "@Override\n @SuppressWarnings({\"MissingPermission\"})\n public void onMapReady(GoogleMap googleMap) {\n\n Log.d(TAG, \"Map is ready.\");\n mMap = googleMap;\n\n mMap.setMyLocationEnabled(true);\n mLastLocation = LocationServices.FusedLocationApi.getLastLocation(\n mGoogleApiClient);\n\n setMarkerToCurrentLocation();\n }", "public static void onMapReady() {\n mMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)).title(\"My Home\").snippet(\"Home Address\"));\n // For zooming automatically to the Dropped PIN Location\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude,\n longitude), 12.0f));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n Log.d(TAG, \"onMapReady: map is ready\");\n mMap = googleMap;\n\n if (mLocationPermissionsGranted) {\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n\n\n mMap.getUiSettings().setCompassEnabled(true);\n// mMap.getUiSettings().setZoomControlsEnabled(true);\n mMap.getUiSettings().setCompassEnabled(true);\n mMap.getUiSettings().setIndoorLevelPickerEnabled(true);\n mMap.getUiSettings().setMapToolbarEnabled(true);\n\n mMap.getUiSettings().setAllGesturesEnabled(true);\n getDeviceLocation();\n mMap.setOnMarkerDragListener(this);\n\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mMap.setMyLocationEnabled(true);\n\n addMarkers();\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n try{\n Geocoder geo = new Geocoder(this);\n\n //Get address provided for location as Address object\n List<Address> foundAddresses = geo.getFromLocationName(location.getAddress(),1);\n Address address = geo.getFromLocationName(location.getAddress(),1).get(0);\n\n LatLng position= new LatLng(address.getLatitude(),address.getLongitude());\n\n googleMap.addMarker(new MarkerOptions().position(position)\n .title(location.getTitle()));\n googleMap.setMinZoomPreference(12);\n googleMap.setMaxZoomPreference(15);\n googleMap.moveCamera(CameraUpdateFactory.newLatLng(position));\n }\n catch (IOException e){\n e.printStackTrace();\n }\n catch(IndexOutOfBoundsException e){\n e.printStackTrace();\n }\n }", "@SuppressLint(\"MissingPermission\")\n @Override\n public void onMapReady(GoogleMap googleMap) {\n retrieveInformation();\n mMap = googleMap;\n //User set location = true\n try {\n mMap.setMyLocationEnabled(true);\n\n //Test - Get Location Instantly once APP starts\n\n\n locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n locationListener = new LocationListener() {\n @Override\n public void onLocationChanged(Location location) {\n// textView.append(\"\\n Current Location: \"+location.getLatitude() + \" \" + location.getLongitude()); //For Testing, display coordinates on textView every time it's triggered\n LatLng newLocation = new LatLng(location.getLatitude(), location.getLongitude());\n if (marker == null) {\n String address = getAddressFromCoordinates(location.getLatitude(), location.getLongitude());\n textView.setText(\"Your Current Location: \" + address); //For Testing, display coordinates on textView every time it's triggered\n marker = mMap.addMarker(new MarkerOptions().position(newLocation).title(\"Your current location:\"));\n arrayMarker.add(0, marker);\n builder.include(marker.getPosition());\n marker.setSnippet(address);\n } else {\n marker.setPosition(newLocation);\n String address = getAddressFromCoordinates(location.getLatitude(), location.getLongitude());\n// textView.setText(\"\\nCurrent Location: \" + address);\n marker.setTitle(\"Your current location:\");\n marker.setSnippet(address);\n }\n// mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(newLocation, 14.0f));\n renderCamera();\n }\n\n @Override\n public void onStatusChanged(String s, int i, Bundle bundle) {\n\n }\n\n @Override\n public void onProviderEnabled(String s) {\n\n }\n\n @Override\n public void onProviderDisabled(String s) {\n //if GPS is down\n Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(intent);\n }\n };\n\n locationManager.requestLocationUpdates(\"gps\", 8000, 0, locationListener);\n\n Intent i = new Intent(getApplicationContext(), GPS_Service.class);\n startService(i);\n\n } catch (Exception e) {\n System.out.println(e);\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng place = new LatLng(Double.parseDouble(lat),Double.parseDouble(longitude));\n\n mMap.addMarker(new MarkerOptions().position(place));\n moveToCurrentLocation(place);\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n CameraUpdate cUpdate = CameraUpdateFactory.newLatLngZoom(new LatLng(35.68, 139.76), 12);\n //mMap.addMarker(new MarkerOptions().position(new LatLng(35.68, 139.76)).title(\"Marker in Tokyo\"));\n mMap.moveCamera(cUpdate);\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.setTrafficEnabled(true);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(17.2231, 78.2827);\n marker = mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Hyderbbad\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n initializeMap();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n Log.d(logTag,\"4\");\n mMap = googleMap;\n mMap.getUiSettings().setZoomControlsEnabled(true);\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_REQUEST);\n return;\n }\n mMap.setOnMapLongClickListener(this);\n mMap.setOnInfoWindowClickListener( this );\n mMap.setOnMapClickListener(this);\n mMap.setMyLocationEnabled(true);\n ll=new LatLng(currentLocation.getLatitude(),currentLocation.getLongitude());\n MarkerOptions options = new MarkerOptions().position(ll);\n options.title(getAddressFromLatLng(ll));\n\n Log.d(logTag,\"5\");\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mMap.setMyLocationEnabled(true);\n } else {\n // Show rationale and request permission.\n int i = 12;\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n i);\n\n }\n mMap.setMyLocationEnabled(true); //when location changed call line. loaction manager\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n\n // Enable the zoom controls for the map\n mMap.getUiSettings().setZoomControlsEnabled(true);\n\n // Prompt the user for permission.\n getLocationPermission();\n\n addMarkerToMap(mMap.getCameraPosition().target, \"Plceaaa\");\n\n mMap.setOnMarkerDragListener(new GoogleMap.OnMarkerDragListener() {\n @Override\n public void onMarkerDragStart(Marker marker) {\n\n }\n\n @Override\n public void onMarkerDrag(Marker marker) {\n // draggedMarker.setPosition(marker.getPosition());\n /*LatLng midLatLng = mMap.getCameraPosition().target;\n draggedMarker.setPosition(midLatLng);*/\n }\n\n @Override\n public void onMarkerDragEnd(Marker marker) {\n Log.d(TAG, \"Marker dragged to latitude\" + marker.getPosition().latitude + \" longitude \" + marker.getPosition().longitude);\n // draggedMarker = marker;\n // marker.setPosition(marker.getPosition());\n }\n });\n\n mMap.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() {\n @Override\n public void onCameraIdle() {\n //get latlng at the center by calling\n LatLng midLatLng = mMap.getCameraPosition().target;\n draggedMarker.setPosition(midLatLng);\n }\n });\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n\n if (displayGpsStatus()) {\n\n Log.v(TAG, \"onClick\");\n\n\n locationListener = new MyLocationListener();\n\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ) {\n locationMangaer.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n\n }\n else{\n Toast.makeText(this,\"Kindly Provide Location Acces\",Toast.LENGTH_SHORT).show();\n }\n\n Log.v(TAG,latitudeUsers +\" , \"+longitudeUsers);\n\n } else {\n Toast.makeText(this,\"GPS not available!!\",Toast.LENGTH_SHORT).show();\n }\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.setOnMyLocationChangeListener(this);\n markerIconBitmapDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.ic_driver_check_in);\n\n mFillColor = Color.HSVToColor(50, new float[]{0, 1, 1});\n mStrokeColor = Color.BLACK;\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney, Australia, and move the camera.\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n LatLng position = new LatLng(latitude, longitude);\n\n // centre the map around the specified location\n mMap.animateCamera(CameraUpdateFactory.newLatLng(position));\n\n // add a marker at the specified location\n MarkerOptions options = new MarkerOptions();\n mMap.addMarker(options.position(position).title(locationName));\n\n // configure the map settings\n mMap.setTrafficEnabled(true);\n mMap.setBuildingsEnabled(true);\n mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);\n\n // enable the zoom controls\n mMap.getUiSettings().setZoomControlsEnabled(true);\n mMap.getUiSettings().setZoomGesturesEnabled(true);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n this.googleMap = googleMap;\n this.addMarkers();\n\n\n fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n if (checkPermissions()) {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n return;\n }\n fusedLocationClient.getLastLocation()\n .addOnSuccessListener(this, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n current_location = location;\n markCurrentLocation(location);\n\n }\n });\n }\n\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n // Add a marker in Sydney, Australia,\n // and move the map's camera to the same location.\n LatLng singapore = new LatLng(1.338709, 103.819519);\n googleMap.addMarker(new MarkerOptions().position(singapore)\n .title(\"Marker in Singapore\"));\n googleMap.moveCamera(CameraUpdateFactory.newLatLng(singapore));\n googleMap.animateCamera(CameraUpdateFactory.zoomTo(11),3000,null);\n }", "@SuppressLint(\"MissingPermission\")\n @Override\n public void onMapReady(GoogleMap googleMap) {\n Log.d(\"MAP_FRAG\", \"MapCallback\");\n\n mMap = googleMap;\n\n Log.d(\"MAP\", mMap.toString());\n\n mMap.setPadding(0, 0, 0, 300);\n\n mMap.setMyLocationEnabled(true);\n mMap.setTrafficEnabled(true);\n mMap.getUiSettings().setCompassEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mMap.getUiSettings().setMapToolbarEnabled(false);\n\n mMap.addMarker(new MarkerOptions().position(new LatLng(Common.latitude, Common.longitude))\n .icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_mark_red)));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(Common.latitude, Common.longitude), 15.0f));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n updateLocationUI();\n getDeviceLocation();\n // Add a marker in Sydney and move the camera\n //float zoom = 15;\n //LatLng gbc = new LatLng(43.676209, -79.410703);\n //mMap.addMarker(new MarkerOptions().position(gbc).title(\"Marker in GBC\"));\n //mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(gbc, zoom));\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in city and move the camera\n LatLng cityCoord = new LatLng(lat, lng);\n float zoom = (float) 9.0;\n mMap.addMarker(new MarkerOptions().position(cityCoord).title(cityAddr));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(cityCoord, zoom));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mapReady = true;\n mMap = googleMap;\n // Add a marker in Sydney and move the camera\n LatLng Bangalore = new LatLng(12.972442, 77.580643);\n CameraPosition cameraPosition = new CameraPosition.Builder()\n .target(Bangalore)\n .zoom(17)\n .bearing(90)\n .tilt(30)\n .build();\n mMap.addMarker(new MarkerOptions().position(Bangalore).title(\"Marker in Bangalore\"));\n mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n\n mMap = googleMap;\n\n attachLocationListener();\n\n\n mMap.setOnMarkerDragListener(this);\n\n }", "@SuppressLint(\"MissingPermission\")\n @Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n if(checkPermissions()) {\n googleMap.setMyLocationEnabled(true);\n }\n\n getLastLocation();\n\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n mMap = googleMap;\r\n mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\r\n\r\n //Initialize Google Play Services\r\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\r\n if (ContextCompat.checkSelfPermission(this,\r\n Manifest.permission.ACCESS_FINE_LOCATION)\r\n == PackageManager.PERMISSION_GRANTED) {\r\n buildGoogleApiClient();\r\n mMap.setMyLocationEnabled(true);\r\n }\r\n }\r\n else {\r\n buildGoogleApiClient();\r\n mMap.setMyLocationEnabled(true);\r\n }\r\n }", "public void onMapReady(GoogleMap googleMap) {\r\n mMap = googleMap;\r\n\r\n mMap.moveCamera(CameraUpdateFactory.zoomTo(1));\r\n\r\n\r\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\r\n // TODO: Consider calling\r\n // ActivityCompat#requestPermissions\r\n // here to request the missing permissions, and then overriding\r\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\r\n // int[] grantResults)\r\n // to handle the case where the user grants the permission. See the documentation\r\n // for ActivityCompat#requestPermissions for more details.\r\n return;\r\n }\r\n mMap.setMyLocationEnabled(true);\r\n\r\n /// This allows the user to zoom in and out of the map\r\n mMap.getUiSettings().setZoomControlsEnabled(true);\r\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\r\n mMap.getUiSettings().isMyLocationButtonEnabled();\r\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\r\n\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n map = googleMap;\n GetLastKnownLocation();\n }", "public void onMapReady(GoogleMap googleMap , double lati, double longi) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(lati, longi);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Your Current Location\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n Log.i(TAG, \"map is ready\");\r\n mMap = googleMap;\r\n\r\n mMap.setMyLocationEnabled(true);\r\n mMap.setOnMyLocationButtonClickListener(this);\r\n mMap.setOnMyLocationClickListener(this);\r\n\r\n startLocationUpdates();\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n Toast.makeText(this, \"Map is Ready\", Toast.LENGTH_SHORT).show();\n Log.d(TAG, \"onMapReady: map is ready\");\n mMap = googleMap;\n\n if (mLocationPermissionsGranted) {\n getDeviceLocation();\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n\n init();\n }\n\n }", "@Override\n public void onMapReady(final GoogleMap map) {\n map.moveCamera(CameraUpdateFactory.zoomTo(14));\n //map.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n map.setMyLocationEnabled(true);\n map.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {\n @Override\n public boolean onMyLocationButtonClick() {\n\n return true;\n }\n });\n map.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() {\n @Override\n public void onMyLocationChange(Location location) {\n Log.d(\"map\", \"onMyLocationChange\");\n if (!isinit) {\n isinit = true;\n if (now_Location == null ||\n now_Location.getLatitude() != location.getLatitude() ||\n now_Location.getLongitude() != location.getLongitude()) {\n now_Location = location;\n initStreetView();\n }\n }\n LatLng sydney = new LatLng(location.getLatitude(), location.getLongitude());\n map.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }\n });\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n //Enable Current location\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.\n PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.\n ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.ACCESS_FINE_LOCATION}, MY_REQUEST_INT);\n\n }\n\n\n return;\n\n } else {\n mMap.setMyLocationEnabled(true);\n\n\n }\n\n\n // Add a marker in Sydney and move the camera\n //LatLng sydney = new LatLng(-34, 151);\n //mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\")\n // .icon(BitmapDescriptorFactory.fromResource(R.drawable.blackspot))\n // );\n //mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n //mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(sydney,16),5000,null);\n //new MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.blackspot));\n\n //LatLng latLng = new LatLng(-1.2652560778411037, 36.81265354156495);\n //mMap.addMarker(new MarkerOptions().position(latLng).title(\"Marker in Parklands\"));\n //mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng,16),5000,null);\n //mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n\n //BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.blackspot);\n ////LatLng harmbug = new LatLng(-37, 120);\n //mMap.addMarker(new MarkerOptions().position(harmbug).title(\"Marker in Harmbug\")\n //.icon(icon));\n //mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(harmbug,16),5000,null);\n //mMap.moveCamera(CameraUpdateFactory.newLatLng(harmbug));\n\n //LatLng kenya = new LatLng(-2.456, 37);\n //mMap.addMarker(new MarkerOptions().position(kenya).title(\"Marker in Kenya\"));\n //mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(kenya,16),5000,null);\n //mMap.moveCamera(CameraUpdateFactory.newLatLng(kenya));\n\n LatLng sydney = new LatLng(-0.8041213212075744, 36.53117179870606);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Blackspot at Kinungi\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(sydney, 18), 5000, null);\n\n LatLng gilgil = new LatLng(-0.2167, 36.2667);\n mMap.addMarker(new MarkerOptions().position(gilgil).title(\"Blackspot at Gilgil\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(gilgil));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(gilgil, 18), 5000, null);\n\n LatLng njoro = new LatLng(-0.3290, 35.9440);\n mMap.addMarker(new MarkerOptions().position(njoro).title(\"Blackspot at Njoro\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(njoro));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(njoro, 18), 5000, null);\n\n LatLng bluepost = new LatLng(-1.0226988092777693, 37.06806957721711);\n mMap.addMarker(new MarkerOptions().position(bluepost).title(\"Blackspot at Bluepost Bridge\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(bluepost));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(bluepost, 18), 5000, null);\n\n LatLng Nithi = new LatLng(-0.26649259802107667, 37.66248464584351);\n mMap.addMarker(new MarkerOptions().position(Nithi).title(\"Blackspot at Nithi Bridge\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(Nithi));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(bluepost, 18), 5000, null);\n\n LatLng Maungu = new LatLng(-3.558353542362671, 38.74993801116944);\n mMap.addMarker(new MarkerOptions().position(Maungu).title(\"Blackspot at Maungu Area\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(Maungu));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(Maungu, 18), 5000, null);\n\n LatLng Misikhu = new LatLng(0.6662027919912484, 34.75215911865235);\n mMap.addMarker(new MarkerOptions().position(Misikhu).title(\"Blackspot at Misikhu\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(Misikhu));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(Maungu, 18), 5000, null);\n\n LatLng Muthaiga = new LatLng(-1.2614375406469367, 36.840720176696784);\n mMap.addMarker(new MarkerOptions().position(Muthaiga).title(\"Blackspot at Muthaiga Road\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(Muthaiga));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(Maungu, 18), 5000, null);\n\n LatLng Pangani = new LatLng(-1.2665003190843396, 36.834239959716804);\n mMap.addMarker(new MarkerOptions().position(Muthaiga).title(\"Blackspot at Pangani\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(Pangani));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(Pangani, 18), 5000, null);\n\n LatLng KU = new LatLng(-1.1823303731373749, 36.93703293800355);\n mMap.addMarker(new MarkerOptions().position(KU).title(\"Blackspot at KU\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(KU));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(KU, 18), 5000, null);\n\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n marker = mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng wroclaw = new LatLng(51.110, 17.034);\n mMap.addMarker(new MarkerOptions().position(wroclaw));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(wroclaw, 12));\n mMap.clear();\n // Setting a click event handler for the map\n mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n\n @Override\n public void onMapClick(LatLng latLng) {\n bSelect.setEnabled(true);\n // Creating a marker\n MarkerOptions markerOptions = new MarkerOptions();\n\n // Setting the position for the marker\n markerOptions.position(latLng);\n\n // Setting the title for the marker.\n // This will be displayed on taping the marker\n markerOptions.title(\"NOWY: \" + latLng.latitude + \" : \" + latLng.longitude);\n\n markerOptions.alpha(0.6f);\n // Clears the previously touched position\n mMap.clear();\n\n // Animating to the touched position\n mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));\n\n // Placing a marker on the touched position\n mMap.addMarker(markerOptions);\n\n location = latLng.latitude + \" \" + latLng.longitude;\n\n setupMarker();\n }\n });\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.clear();\n\n\n loc = null;\n try {\n loc = getLocation();\n } catch (SecurityException ex) {\n Toast.makeText(MapsActivity.this, \"Current location not accesed\", Toast.LENGTH_SHORT).show();\n }\n if (loc != null) {\n LatLng latLng = new LatLng(loc.getLatitude(), loc.getLongitude());\n mMap.addMarker(new MarkerOptions().position(latLng).title(\"Current location\")).setDraggable(true);\n CameraUpdate update = CameraUpdateFactory.newLatLngZoom(latLng, 27);\n mMap.moveCamera(update);\n\n } else\n Toast.makeText(MapsActivity.this, \"Location Not Foound\", Toast.LENGTH_SHORT).show();\n\n\n getloc.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Location loc = null;\n try {\n loc = getLocation();\n } catch (SecurityException ex) {\n Toast.makeText(MapsActivity.this, \"Current location not accesed\", Toast.LENGTH_SHORT).show();\n }\n\n\n }\n });\n\n // Add a marker in Sydney and move the camera\n // LatLng sydney = new LatLng(-34, 151);\n // mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n //mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n client = new GoogleApiClient.Builder(this)\n .addApi(LocationServices.API)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this).build();\n client.connect();\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n LatLng posini = new LatLng(3.4,-76.5);\n myMarker = mMap.addMarker(new MarkerOptions().position(posini));\n\n requestLocation();\n\n googleMap.setOnCameraMoveListener(new GoogleMap.OnCameraMoveListener() {\n @Override\n public void onCameraMove() {\n if (!flag) {\n\n addMarker();\n flag = true;\n }\n }\n });\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n\n // Add a marker in Sydney and move the camera\n /*LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));*/\n\n LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n\n // Recherche de la derniere localisation\n Criteria criteria = new Criteria();\n String provider = locationManager.getBestProvider(criteria, false);\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n Location location = locationManager.getLastKnownLocation(provider);\n\n // Initialize the location fields\n if (location != null) {\n float lat = (float) (location.getLatitude());\n float lng = (float) (location.getLongitude());\n\n currentPosition = new Point(location.getLongitude(), location.getLatitude());\n\n // Add a marker at our position and move the camera\n LatLng lastCoord = new LatLng(lat, lng);\n mMap.addMarker(new MarkerOptions().position(lastCoord).title(\"Last time we were here\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(lastCoord));\n\n lblPosition.setText(\"Last Position: \"+location.getLatitude()+\", \"+location.getLongitude());\n\n Log.i(this.getClass().getName(), String.valueOf(lat));\n Log.i(this.getClass().getName(), String.valueOf(lng));\n } else {\n Log.w(this.getClass().getName(), \"Provider not available\");\n }\n\n // dessine points intérets et sector de la database\n loadPOI();\n loadSector();\n\n // attache le callback\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10, 1, this);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\")\n //below line is use to add custom marker on our map.\n .icon(BitmapFromVector(getApplicationContext(), R.drawable.ic_flag)));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng montesson = new LatLng(48.9190286,2.1380955);\n mMap.addMarker(new MarkerOptions().position(montesson).title(\"Marker in Montesson\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(montesson));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n uiSettings = mMap.getUiSettings();\n uiSettings.setZoomControlsEnabled(false);\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n mcircleOptions = mcircleOptions.center(sydney);\n mcircleOptions = mcircleOptions.radius(500);\n mcircleOptions = mcircleOptions.strokeWidth(2);\n mcircleOptions = mcircleOptions.strokeColor(Color.argb(100, 255, 73, 73));\n mcircleOptions = mcircleOptions.fillColor(Color.argb(100, 255, 73, 73));\n mMap.addCircle(mcircleOptions);\n if (ActivityCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n !=\n PackageManager.PERMISSION_GRANTED\n &&\n ActivityCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n mMap.setMyLocationEnabled(true);\n\n mMap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() {\n @Override\n public void onMapLongClick(LatLng latLng) {\n mlatLng = latLng;\n mMap.clear();\n mMap.addMarker(new MarkerOptions().position(mlatLng));\n mcircleOptions = mcircleOptions.center(mlatLng);\n mMap.addCircle(mcircleOptions);\n mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));\n geocoder = new Geocoder(Maps.this, Locale.getDefault());\n try {\n List<Address> addresses = geocoder.getFromLocation(mlatLng.latitude, mlatLng.longitude, 1);\n for (int i=0; i < addresses.get(0).getMaxAddressLineIndex(); i++) {\n Log.e(\"Address\", addresses.get(0).getAddressLine(i) + \"\");\n caddress = addresses.get(0).getAddressLine(i);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n loc_data = getSharedPreferences(\"loc_data\", MODE_PRIVATE);\n SharedPreferences.Editor loc_data_editor = loc_data.edit();\n loc_data_editor.putString(\"lat\", Double.toString(mlatLng.latitude));\n loc_data_editor.putString(\"lng\", Double.toString(mlatLng.longitude));\n loc_data_editor.putString(\"add\", caddress + \"\");\n loc_data_editor.commit();\n }\n });\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng myLocation = new LatLng(latitude, longitude);\n addMarker(myLocation, name);\n moveCamera(myLocation, 3);\n\n //search a place\n /*searchInput = (EditText) findViewById(R.id.map_search_input);\n searchInput.setOnEditorActionListener(new TextView.OnEditorActionListener() {\n @Override\n public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {\n if(actionId == EditorInfo.IME_ACTION_SEARCH\n || actionId == EditorInfo.IME_ACTION_DONE\n || actionId == KeyEvent.ACTION_DOWN\n || actionId == KeyEvent.KEYCODE_ENTER)\n //search location\n geoLocate();\n return false;\n }\n });*/\n\n //add location\n addButton = findViewById(R.id.map_add_button);\n addButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Intent intent = new Intent();\n intent.putExtra(\"latitude\", marker.getPosition().latitude);\n intent.putExtra(\"longitude\", marker.getPosition().longitude);\n intent.putExtra(\"name\", marker.getTitle());\n setResult(4, intent);\n finish();\n }\n });\n\n //long tap to add a marker\n mMap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() {\n @Override\n public void onMapLongClick(@NonNull LatLng latLng) {\n addMarker(latLng, name);\n }\n });\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n mMap = googleMap;\r\n\r\n // Add a marker in Sydney and move the camera\r\n LatLng charlotte = new LatLng(35.22, -80.84);\r\n //currentMarker = mMap.addMarker(new MarkerOptions().position(charlotte).title(\"Charlotte, NC\"));\r\n mMap.moveCamera(CameraUpdateFactory.newLatLng(charlotte));\r\n //currentMarker.setTag(0);\r\n\r\n mMap.setOnMapLongClickListener(this);\r\n\r\n\r\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\r\n //&& ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED\r\n ) {\r\n // TODO: Consider calling\r\n\r\n return;\r\n }\r\n mMap.setMyLocationEnabled(true);\r\n mMap.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {\r\n @Override\r\n public boolean onMyLocationButtonClick() {\r\n Log.d(\"maps\", \"On my location button click\");\r\n return false;\r\n }\r\n });\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n LatLng latlong = new LatLng(29.375859, 47.977405);\n googleMap.addMarker(new MarkerOptions().position(latlong).title(\"\"));\n googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latlong, 9.0f));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n\n final LatLng[] myLoc = {new LatLng(1, 1)};\n mMap.setMyLocationEnabled(true);\n// mMap.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() {\n// @Override\n// public void onMyLocationChange(Location location) {\n// myLoc[0] = new LatLng(location.getLatitude(), location.getLongitude());\n// mMap.addCircle(new CircleOptions().center(myLoc[0]));\n// mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLoc[0], 15));\n// }\n// });\n\n mMap.addCircle(new CircleOptions().center(new LatLng(lat, lng)));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lat, lng), 18));\n\n mMap.setOnPoiClickListener(new GoogleMap.OnPoiClickListener() {\n @Override\n public void onPoiClick(PointOfInterest poi) {\n\n }\n });\n\n mMap.getUiSettings().setMapToolbarEnabled(true);\n\n // Add a marker in Sydney and move the camera\n\n\n showItems(lat, lng, radius);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"you are in sydney\").draggable(true));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n mMap.setOnMarkerDragListener(this);\n mMap.setOnMapLongClickListener(this);\n\n }", "@Override\n public void onMapReady(GoogleMap map) {\n googleMap = map;\n map.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n // map.setTrafficEnabled(true);\n map.setIndoorEnabled(true);\n map.setBuildingsEnabled(true);\n map.getUiSettings().setZoomControlsEnabled(true);\n\n if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n map.setMyLocationEnabled(true);\n }\n\n double lat = Double.parseDouble(getIntent().getStringExtra(\"lat\"));\n double lng = Double.parseDouble(getIntent().getStringExtra(\"lng\"));\n a = new LatLng(lat, lng);\n\n map.moveCamera(CameraUpdateFactory.newLatLngZoom(a, 14));\n new callGooglePlaceApi().execute();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n //if(ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)!= PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.INTERNET) != PackageManager.PERMISSION_GRANTED)\n // return;\n buildGoogleApiClient();\n mMap.setMyLocationEnabled(true);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n listener.onMapSuccess(mMap);\n\n // Turn on the My Location layer and the related control on the map.\n updateLocationUI();\n\n System.out.println(\"Perm Loc\" + mLocationPermissionGranted);\n createLocationRequest();\n // Get the current location of the device and set the position of the map.\n getDeviceLocation();\n getCurrentPlace();\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n this.googleMap = googleMap;\n\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n buildGoogleApiClient();\n this.googleMap.setMyLocationEnabled(true);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public void onMapReady(GoogleMap googleMap) {\n MapsInitializer.initialize(getContext());\n mMap = googleMap;\n mMap.setMinZoomPreference(13.0f);\n mMap.setMaxZoomPreference(20.0f);\n mMap.setOnMapClickListener(this);\n mMap.setInfoWindowAdapter(this);\n mMap.setOnInfoWindowClickListener(MyOnInfoWindowClickListener);\n\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.\n ACCESS_FINE_LOCATION}, 1);\n } else {\n mMap.setMyLocationEnabled(true);\n }\n }\n\n mMap.setMyLocationEnabled(true);\n\n buildGoogleApiClient();\n mGoogleApiClient.connect();\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n setInitialLocation(VehicleData.getLatitude(), VehicleData.getLongitude());\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n// updateMap(new LocationModel(41.806363, 44.768531, \"Agmasheneblis Xeivani\"));\n if (shoppingList.getLocationReminder() != null) {\n updateMap(shoppingList.getLocationReminder());\n } else {\n updateMap(null);\n }\n }", "@Override\n public void onMapLoaded() {\n mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 13.3f));\n\n // Placing a marker on the touched position\n mMap.addMarker(markerOptions);\n }", "@Override\n public void onMapReady(GoogleMap map) {\n mGoogleMap = map;\n mGoogleMap.setMyLocationEnabled(true);\n Log.d(TAG, \"Map Ready\");\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n bulidGoogleApiClient();\n mMap.setMyLocationEnabled(true);\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n LatLng israelLatLng = new LatLng(31.2175427,34.6095679);\n mMap.moveCamera(CameraUpdateFactory.newLatLng(israelLatLng));\n init();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n\n ////run with it to check what is happening and remove it to see\n\n\n //Initialize Google Play Services\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n buildGoogleApiClient();\n mMap.setMyLocationEnabled(true);\n }\n } else {\n buildGoogleApiClient();\n mMap.setMyLocationEnabled(true);\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.setTrafficEnabled(true);\n googleMap.setMyLocationEnabled(true);\n mMap.setOnMyLocationChangeListener(onMyLocationChangeListener);\n\n // mMap.setPadding(0, 0, 0, 100);\n UiSettings uiSettings = mMap.getUiSettings();\n uiSettings.setZoomControlsEnabled(true);\n\n mMap.addMarker(new MarkerOptions()\n .position(new LatLng(65.9667, -18.5333))\n .title(\"Hello world\"));\n\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n mMap.setMyLocationEnabled(true);\n } else {\n ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.ACCESS_FINE_LOCATION},1);\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n // Home Mark\n LatLng home = new LatLng(41.374736, 2.168308);\n float zoom = 13;\n\n // Inicialitzem mapa\n mMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN); //Tipus de mapa\n mMap.addMarker(new MarkerOptions().position(home).title(\"IOC\")); //Marcador inicial\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(home, zoom)); //Centrem mapa en el marcador inicial\n\n this.setMapLongClick(mMap);\n this.enableMyLocation();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n // Add a marker in Sydney and move the camera\n LatLng CSN = new LatLng(51.87, -8.481);\n mMap.setMapType(MAP_TYPE_HYBRID);\n mMap.addMarker(new MarkerOptions().position(CSN).title(\"Marker at CSN college\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(CSN, 15F));\n mMap.getUiSettings().setZoomControlsEnabled(true);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n enableMyLocation();\n buildGoogleApiClient();\n\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n mMap = googleMap;\r\n mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);\r\n\r\n //Initialize Google Play Services\r\n if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\r\n if (ContextCompat.checkSelfPermission(this,\r\n Manifest.permission.ACCESS_FINE_LOCATION)\r\n == PackageManager.PERMISSION_GRANTED) {\r\n buildGoogleApiClient();\r\n mMap.setMyLocationEnabled(true);\r\n }\r\n }\r\n else {\r\n buildGoogleApiClient();\r\n mMap.setMyLocationEnabled(true);\r\n }\r\n\r\n\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mUiSettings = mMap.getUiSettings();\n mUiSettings.setAllGesturesEnabled(mLock);\n\n mMap.setOnMyLocationButtonClickListener(this);\n mMap.setOnMapClickListener(this);\n mMap.setOnMapLongClickListener(this);\n mMap.setOnMarkerDragListener(this);\n\n enableMyLocation();\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n mMap = googleMap;\r\n if (checkPermissions()) {\r\n mMap.setMyLocationEnabled(true);\r\n }\r\n mMap.addMarker(new MarkerOptions().position(currLocation).title(\"Current Location\"));\r\n mMap.moveCamera(CameraUpdateFactory.newLatLng(currLocation));\r\n getLastLocation();\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng hn = new LatLng(14.079526, -87.180662);\n mMap.moveCamera(CameraUpdateFactory.newLatLng(hn));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(hn,7));\n helperFacturacion = new FacturacionHelper(MapListClientesActivity.this);\n\n\n addMarkers();\n }", "@Override\n public void onMapReady(GoogleMap map) {\n mMap = map;\n\n // Use a custom info window adapter to handle multiple lines of text in the\n // info window contents.\n mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {\n\n @Override\n // Return null here, so that getInfoContents() is called next.\n public View getInfoWindow(Marker arg0) {\n return null;\n }\n\n @Override\n public View getInfoContents(Marker marker) {\n // Inflate the layouts for the info window, title and snippet.\n View infoWindow = getLayoutInflater().inflate(R.layout.custom_info_contents,\n (FrameLayout) findViewById(R.id.map), false);\n\n TextView title = ((TextView) infoWindow.findViewById(R.id.title));\n title.setText(marker.getTitle());\n\n TextView snippet = ((TextView) infoWindow.findViewById(R.id.snippet));\n snippet.setText(marker.getSnippet());\n\n return infoWindow;\n }\n });\n\n // Turn on the My Location layer and the related control on the map.\n updateLocationUI();\n\n // Get the current location of the device and set the position of the map.\n getDeviceLocation();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.setOnMapLongClickListener(this);\n if(ContextCompat.checkSelfPermission(this, ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED){\n //Adds a center on me button to map\n mMap.setMyLocationEnabled(true);\n Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if(location != null){\n LatLng myLatLng = new LatLng(location.getLatitude(), location.getLongitude());\n routePoints.add(myLatLng);\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLatLng, 15.5f));\n }\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n buildGoogleApiClient();\n mMap.setMyLocationEnabled(true);\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n mMap = googleMap;\n\n\n\n // Add a marker in Sydney and move the camera\n sydney = new LatLng(8.552161651991246, 79.94052328405958);\n\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n\n\n\n //mMap.setMinZoomPreference(11);\n\n\n\n\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n /*To find map coordinates for database\n mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n @Override\n public void onMapClick(LatLng latLng) {\n Log.i(\"MAP\", latLng.latitude + \", \" + latLng.longitude);\n }\n });\n */\n\n\n styleMap();\n populateMap();\n setUpDirectionIntegration();\n\n Intent intent = getIntent();\n String location = intent.getStringExtra(\"Location\");\n if (location != null) {\n showSelectedLocation(location);\n } else {\n //showCurrentLocation();\n showCurrentLocation();\n }\n\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n //If the book already has a location set place a marker on that location and zoom in\n if (getIntent().hasExtra(\"lat\")) {\n LatLng currentlySetLocation = new LatLng(lat, lon);\n\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(currentlySetLocation);\n String address = getMarkerAddress(currentlySetLocation);\n markerOptions.title(address);\n mMap.addMarker(markerOptions);\n mMap.moveCamera(CameraUpdateFactory.newLatLng(currentlySetLocation));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(currentlySetLocation, 15));\n }\n else {\n //if owner has location enabled, place marker on last location\n if (ActivityCompat.checkSelfPermission(SetLocationActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n fusedLocationProviderClient.getLastLocation()\n .addOnSuccessListener(new OnSuccessListener<Location>() {\n /**\n * Run when onSuccess button is clicked\n * @param location: location to get latitude and longitude for\n */\n @Override\n public void onSuccess(Location location) {\n if (location != null) {\n LatLng currentLocation = new LatLng(location.getLatitude(), location.getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLng(currentLocation));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(currentLocation, 15));\n }\n }\n });\n }\n }\n mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n /**\n * Run when onMapClick button is clicked to set latitude and longitude\n * @param latLng: set value for latitude and longitude\n */\n @Override\n public void onMapClick(LatLng latLng) {\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n\n String address = getMarkerAddress(latLng);\n //if there is a valid address associated with marker\n if (address != null) {\n markerOptions.title(address);\n }\n mMap.clear();\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 15));\n mMap.addMarker(markerOptions);\n markerPlaced = true;\n lat = latLng.latitude;\n lon = latLng.longitude;\n }\n });\n\n //Save location button listener\n FloatingActionButton saveButton = findViewById(R.id.saveButton);\n saveButton.setOnClickListener(new View.OnClickListener() {\n /**\n * Run when button to save location is clicked\n * @param view: current view\n */\n @Override\n public void onClick(View view) {\n if (markerPlaced) {\n //Firestore handler method that adds geopoint as a field in database\n setPickupLocation(bookId, lat, lon);\n Toast toast = Toast.makeText(SetLocationActivity.this,\n \"Pickup location has been updated\", Toast.LENGTH_SHORT);\n toast.show();\n } else {\n Toast toast = Toast.makeText(SetLocationActivity.this,\n \"Place a marker first\", Toast.LENGTH_SHORT);\n toast.show();\n }\n }\n });\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.setMyLocationEnabled(true);\n // Get LocationManager object from System Service LOCATION_SERVICE\n LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n\n // Create a criteria object to retrieve provider\n Criteria criteria = new Criteria();\n\n // Get the name of the best provider\n String provider = locationManager.getBestProvider(criteria, true);\n\n // Get Current Location\n if (this.checkCallingOrSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n Location myLocation = locationManager.getLastKnownLocation(provider);\n // set map type\n mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n\n // Get latitude of the current location\n double latitude = myLocation.getLatitude();\n\n // Get longitude of the current location\n double longitude = myLocation.getLongitude();\n\n // Create a LatLng object for the current location\n LatLng latLng = new LatLng(latitude, longitude);\n\n // Show the current location in Google Map\n mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));\n\n // Zoom in the Google Map\n mMap.animateCamera(CameraUpdateFactory.zoomTo(14));\n\n for (int i = restoList.size(); i >= 1; i--) {\n Restaurant current = restoList.get(i-1);\n LatLng curPos = new LatLng(current.getLatitude(),current.getLongitude());\n mMap.addMarker(new MarkerOptions().position(curPos).title(current.getName()));\n }\n\n } else {\n //TODO this stuff here\n }\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(121.5729889, 25.0776557);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"This is my first Maker\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n // Add a marker in Sydney and move the camera\n LatLng loc = new LatLng(v, v1);\n mMap.addMarker(new\n MarkerOptions().position(loc).title(\"0000000000\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(loc));\n }", "private void setUpMapIfNeeded() {\n if (mGoogleMap != null) {\n if (checkPermission()) {\n mGoogleMap.setMyLocationEnabled(true);\n }\n // Check if we were successful in obtaining the map.\n if (mMapView != null) {\n\n mGoogleMap.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() {\n @Override\n public void onMyLocationChange(Location location) {\n mGoogleMap.addMarker(new MarkerOptions().position(new LatLng(location.getLatitude(), location.getLongitude())).title(\"It's Me!\"));\n mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(location.getLatitude(), location.getLongitude()), 10));\n }\n });\n\n }\n }\n }", "private void setupMap() {\n if (googleMap == null) {\n SupportMapFragment mapFrag = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);\n mapFrag.getMapAsync(this);\n mLocationProvider = new LocationProvider(this, this);\n }\n }", "private void initilizeMap() \n {\n \tmContext = getApplicationContext();\n \ttry \n \t{\n locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n \n // Getting GPS status\n isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);\n\n // Getting network status\n isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n\n if (!isGPSEnabled && !isNetworkEnabled) \n {\n // No network provider is enabled\n } \n else \n {\n this.canGetLocation = true;\n if (isNetworkEnabled) \n {\n locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);\n Log.d(\"Network\", \"Network\");\n if (locationManager != null)\n {\n// Criteria criteria = new Criteria();\n// provider = locationManager.getBestProvider(criteria, false);\n location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n if (location != null) \n {\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n// initialLocation = new LatLng(latitude, longitude);\n initialLocation = new Location(\"inicial\");\n initialLocation.setLatitude(latitude);\n initialLocation.setLongitude(longitude);\n }\n }\n }\n // If GPS enabled, get latitude/longitude using GPS Services\n if (isGPSEnabled) \n {\n if (location == null) \n {\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);\n Log.d(\"GPS Enabled\", \"GPS Enabled\");\n if (locationManager != null) \n {\n location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (location != null)\n {\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n// initialLocation = new LatLng(latitude, longitude);\n initialLocation = new Location(\"inicial\");\n initialLocation.setLatitude(latitude);\n initialLocation.setLongitude(longitude);\n }\n }\n }\n }\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n\n gMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();\n myLocation = new LatLng(latitude,longitude);\n gMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 15));\n// \n// // check if map is created successfully or not\n// if (gMap == null) \n// {\n// Toast.makeText(getApplicationContext(),\n// \"Sorry! unable to create maps\", Toast.LENGTH_SHORT)\n// .show();\n// }\n gMap.setMyLocationEnabled(true);\n// Marker TP = gMap.addMarker(new MarkerOptions().position(myLocation).title(\"Estoy aca\").icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_VIOLET)));\n\n// lstLatLngs = new ArrayList<LatLng>();\n gMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() \n {\n \t@Override\n \tpublic void onMapClick(final LatLng point) \n \t{\n \t\t// TODO Auto-generated method stub\n \t\t\n \t\t AlertDialog.Builder builder = new AlertDialog.Builder(CrearIncidenteGPS.this);\n \t\t builder.setMessage(\"Desea agregar un incidente en este lugar?\")\n \t\t .setCancelable(false)\n \t\t .setPositiveButton(\"Si\", new DialogInterface.OnClickListener() \n \t\t {\n \t\t public void onClick(DialogInterface dialog, int id) \n \t\t {\n \t\t \t//Agregar el incidente\n// \t\t \tlstLatLngs.add(point);\n \t\t \tinsertarIncidente(point);\n// \t\t \tgMap.addMarker(new MarkerOptions().position(point));\n \t\t }\n \t\t })\n \t\t .setNegativeButton(\"No\", new DialogInterface.OnClickListener() \n \t\t {\n \t\t public void onClick(DialogInterface dialog, int id) \n \t\t {\n \t\t dialog.cancel();\n \t\t }\n \t\t });\n \t\t AlertDialog alert = builder.create();\n \t\t alert.show();\n \t\t\n \t}\n });\n \n// HttpRequestFactory httpRequestFactory = createRequestFactory(transport);\n// HttpRequest request = httpRequestFactory.buildGetRequest(new GenericUrl(PLACES_SEARCH_URL));\n// request.url.put(\"key\", \"\");\n// request.url.put(\"location\", latitude + \",\" + longitude);\n// request.url.put(\"radius\", 500);\n// request.url.put(\"sensor\", \"false\");\n// infowindow = new google.maps.InfoWindow();\n \n// var service = new google.maps.places.PlacesService(gMap);\n// service.nearbySearch(request, callback);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n mMap.setOnCameraChangeListener(new GoogleMap.OnCameraChangeListener() {\n @Override\n public void onCameraChange(CameraPosition cameraPosition) {\n updateHalos(cameraPosition);\n }\n });\n\n int permission_check = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\n\n if (permission_check == PackageManager.PERMISSION_GRANTED) {\n // instanciate location manager to retrieve positions\n mManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n\n // retrieve best provider for position tracking\n String provider = mManager.getBestProvider(new Criteria(), true);\n\n // get current location\n Location location = mManager.getLastKnownLocation(provider);\n\n mListener = new LocationListener() {\n @Override\n public void onLocationChanged(Location location) {\n //redraw marker when getLocation updates\n drawUserMarker(location);\n }\n\n @Override\n public void onProviderEnabled(String p) {\n }\n\n @Override\n public void onProviderDisabled(String p) {\n }\n\n @Override\n public void onStatusChanged(String p, int status, Bundle extras) {\n }\n };\n\n // place initial marker if current position retrieved\n if(location != null) {\n drawUserMarker(location);\n }\n\n // register location updates with given parameters\n mManager.requestLocationUpdates(provider, 1000, 0, mListener);\n } else {\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }\n\n // implement event listener for long map clicks\n GoogleMap.OnMapLongClickListener onMapLongClick = new GoogleMap.OnMapLongClickListener() {\n @Override\n public void onMapLongClick(LatLng latLng) {\n\n // get marker name from text field\n String markerName = mTextField.getText().toString();\n\n // check if a marker name is set\n if(markerName.isEmpty()) {\n markerName = \"Marker\" + Integer.toString(numberOfMarkers);\n }\n\n // add marker\n Marker marker = mMap.addMarker(\n new MarkerOptions()\n .position(latLng)\n .title(markerName)\n .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED))\n );\n\n // add halo\n Circle halo = mMap.addCircle(new CircleOptions()\n .center(latLng)\n .radius(100.0)\n .strokeColor(Color.RED)\n .visible(false)\n );\n\n // add marker and halo to tracked markers\n mMarkerHalos.put(marker, halo);\n\n // lat and long to separate values\n double markerLat = latLng.latitude;\n double markerLong = latLng.longitude;\n\n // save marker to shared preferences\n Set<String> positionSet = new HashSet<String>();\n positionSet.add(Double.toString(markerLat));\n positionSet.add(Double.toString(markerLong));\n mPrefEditor.putStringSet(markerName, positionSet);\n mPrefEditor.apply();\n\n // clear text field\n mTextField.setText(\"\");\n\n // increase marker counter\n ++numberOfMarkers;\n }\n };\n\n // assign event listener to map\n mMap.setOnMapLongClickListener(onMapLongClick);\n }" ]
[ "0.7467034", "0.72152394", "0.71180516", "0.7091597", "0.7035943", "0.7010689", "0.6921798", "0.6900896", "0.6896892", "0.6878912", "0.68537396", "0.6839038", "0.6817563", "0.68011713", "0.6799467", "0.679907", "0.67974794", "0.6778607", "0.6764933", "0.6763946", "0.6762692", "0.6755212", "0.6751934", "0.67495346", "0.6741417", "0.6739403", "0.6739144", "0.6738184", "0.6733966", "0.67327386", "0.67266333", "0.6702644", "0.67022884", "0.6698555", "0.669729", "0.66950226", "0.66844326", "0.6684225", "0.66664404", "0.6665993", "0.6661129", "0.6650063", "0.6647232", "0.66340566", "0.6613165", "0.6600475", "0.65916663", "0.6575407", "0.65748066", "0.6562681", "0.6553875", "0.65469056", "0.65463996", "0.65463996", "0.65463996", "0.65463996", "0.654455", "0.6540394", "0.6539616", "0.6534924", "0.65335953", "0.65318555", "0.6524111", "0.65175533", "0.65171295", "0.6509576", "0.6500936", "0.6493769", "0.6488127", "0.647373", "0.6469917", "0.6469135", "0.6461277", "0.64599425", "0.64594585", "0.64566034", "0.64559", "0.6451823", "0.64424825", "0.6440061", "0.64295304", "0.6420739", "0.6418497", "0.6400854", "0.63922924", "0.63903487", "0.63879246", "0.6379709", "0.6371725", "0.63682723", "0.6365968", "0.63582057", "0.63543266", "0.63275117", "0.632431", "0.6322564", "0.63183516", "0.6317256", "0.630581", "0.6299691", "0.62896043" ]
0.0
-1
Function to get longitude
public double getLongitude(){ if(location != null){ longitude = location.getLongitude(); } // return longitude return longitude; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long getLongitude();", "double getLongitude();", "Double getLongitude();", "Double getLongitude();", "int getLongitude();", "public int getLon();", "public double longitude() {\n return this.longitude;\n }", "public double getLongitude() {\n if (slon == GempakConstants.IMISSD) {\n return slon;\n }\n return slon / 100.;\n }", "public double getLon() {\n return lon;\n }", "public double getLon() {\n return lon;\n }", "public double getLongitude()\n {\n \treturn longitude;\n }", "public double getLongitude() {\n return longitude_;\n }", "public String getLongitude()\r\n {\r\n return longitude;\r\n }", "public double getLongitude() {\n return longitude;\n }", "public double getLongitude() {\n return longitude;\n }", "public double getLongitude() {\n return longitude;\n }", "public double getLongitude() {\n return longitude;\n }", "public double getLon() {\r\n\t\t\treturn lon;\r\n\t\t}", "public synchronized Double getLongitude() {\r\n\t\treturn longitude;\r\n\t}", "public double getLongitude() {\n return longitude_;\n }", "public double getLongitude() {\n return longitude_;\n }", "public Double getLongitude() {\n return longitude;\n }", "public Double getLongitude() {\n return longitude;\n }", "public Double getLongitude() {\n return longitude;\n }", "public Double getLongitude() {\n return longitude;\n }", "@Override\r\n\tpublic double getLon() {\n\t\treturn this.lon;\r\n\t}", "@Override\n public String getLon() {\n return lon;\n }", "public int getLongitude() {\n return longitude;\n }", "public double getLongitude() {\n\t\treturn longitude;\n\t}", "public long getLongitude() {\n return longitude_;\n }", "public String getLongitude() {\n return longitude;\n }", "public String getLongitude() {\n return longitude;\n }", "public double getLongitude() {\n return longitude_;\n }", "@Override\n\tpublic double getLongitude() {\n\t\treturn _locMstLocation.getLongitude();\n\t}", "public int getLongitude() {\n return longitude_;\n }", "public Float getLongitude() {\n return longitude;\n }", "public float getLongitude() { return longitude; }", "public float getLongitude() {\n return longitude;\n }", "public float getLongitude() {\n return longitude;\n }", "public float getLongitude() {\n return longitude;\n }", "public double getLongitude() {\r\n if (location != null) {\r\n longitude = location.getLongitude();\r\n }\r\n\r\n // return longitude\r\n return longitude;\r\n }", "public BigDecimal getLongitude() {\n return longitude;\n }", "public long getLongitude() {\n return longitude_;\n }", "public String getLongitude() {\n\t\treturn longitude;\n\t}", "public float getLongitudeValue (){\n return trackLon.getValue ();\n }", "public double getLongitude() {\n if (location != null) {\n curr_longitude = location.getLongitude();\n }\n\n // return longitude\n return curr_longitude;\n }", "public int getLongitude() {\n checkRep();\n return this.longitude;\n }", "public int getLongitude() {\n return longitude_;\n }", "long getLatitude();", "public float getLongitude() {\n\t\treturn longitude;\n\t}", "public float getLongitude() {\n\t\treturn longitude;\n\t}", "public String getLongitude() {\n return String.valueOf(longitude);\n }", "public double getLongitude() {\n if (location != null) {\n longitude = location.getLongitude();\n }\n\n // return longitude\n return longitude;\n }", "public double getLongitude() {\n if (location != null) {\n longitude = location.getLongitude();\n }\n\n // return longitude\n return longitude;\n }", "public double getLongitude() {\n return location.getLongitude();\n }", "public double getLongitude() {\r\n if (location != null) {\r\n longitude = location.getLongitude();\r\n }\r\n\r\n return longitude;\r\n }", "public double getLongitude() {\n\t\treturn Longitude;\n\t}", "public double getLongitude() {\n\t\tif (mLastLocation != null) {\n\t\t\tlongitude = mLastLocation.getLongitude();\n\t\t}\n\n\t\t// return longitude\n\t\treturn longitude;\n\t}", "public double getLongitude() {\n double lon = 0.0;\n if (mLocationHelper != null) {\n lon = mLocationHelper.getLongitude();\n }\n\n return lon;\n }", "public double getLongitude() {\n if (currentLocation != null) {\n longitude = currentLocation.getLongitude();\n }\n // return longitude\n return longitude;\n }", "public int getLat();", "public Longitude get_long()\n {\n\treturn this._long;\n }", "public Longitude getLongitude (){\n return trackLon;\n }", "public double getLongitude()\n\t{\n\t\treturn this.realBin.getLocation().getLongitude();\n\t}", "public double getLongitude_() { \n return longitude_; \n }", "Double getLatitude();", "Double getLatitude();", "public static String longitude(GeoPoint p) {\r\n\t\treturn Float.toString((float) p.getLongitudeE6() / (float) 1E6);\r\n\t}", "double lon(long v) {\n return world.get(v).lon;\n }", "public Double getLongitude()\n\t{\n\t\treturn null;\n\t}", "public double getLng() {\n return lng;\n }", "private String longitudeConversion() {\n int lon = record[5];\n if (lon >= 0) {\n lon = lon & 255;\n }\n lon = (lon << 8) + (record[4] & 255);\n float flon = Float.parseFloat(\"\" + lon + \".\" + (((record[7] & 255) << 8) + (record[6] & 255)));\n int degs = (int) flon / 100;\n float min = flon - degs * 100;\n String retVal = \"\" + (degs + min / 60);\n\n if (retVal.compareTo(\"200.0\") == 0) {\n return \"\";\n } else {\n return retVal;\n }\n }", "public String getLongitude(String s) {\n return ((longitude != FLOATNULL) ? new Float(longitude).toString() : \"\");\n }", "double getLatitude();", "public double getLng() {\r\n\t\treturn lng;\r\n\t}", "public double getResultLocationLongitude() {\n return resultLocationLongitude;\n }", "public double getStartLon() {\n\t\treturn startLon;\n\t}", "public final flipsParser.longitude_return longitude() throws RecognitionException {\n flipsParser.longitude_return retval = new flipsParser.longitude_return();\n retval.start = input.LT(1);\n\n CommonTree root_0 = null;\n\n Token char_literal527=null;\n Token char_literal528=null;\n flipsParser.numericValuePositive_return x = null;\n\n flipsParser.longitudeEastWest_return ew = null;\n\n flipsParser.angularUnit_return xu = null;\n\n flipsParser.integerValuePositive_return deg = null;\n\n flipsParser.numericValuePositive_return min = null;\n\n\n CommonTree char_literal527_tree=null;\n CommonTree char_literal528_tree=null;\n RewriteRuleTokenStream stream_329=new RewriteRuleTokenStream(adaptor,\"token 329\");\n RewriteRuleTokenStream stream_243=new RewriteRuleTokenStream(adaptor,\"token 243\");\n RewriteRuleSubtreeStream stream_numericValuePositive=new RewriteRuleSubtreeStream(adaptor,\"rule numericValuePositive\");\n RewriteRuleSubtreeStream stream_longitudeEastWest=new RewriteRuleSubtreeStream(adaptor,\"rule longitudeEastWest\");\n RewriteRuleSubtreeStream stream_angularUnit=new RewriteRuleSubtreeStream(adaptor,\"rule angularUnit\");\n RewriteRuleSubtreeStream stream_integerValuePositive=new RewriteRuleSubtreeStream(adaptor,\"rule integerValuePositive\");\n try {\n // flips.g:779:2: (x= numericValuePositive ew= longitudeEastWest -> ^( ANGLE $ew $x DEGREE ) | x= numericValuePositive xu= angularUnit ew= longitudeEastWest -> ^( ANGLE $ew $x $xu) | deg= integerValuePositive 'd' min= numericValuePositive '\\\\'' ew= longitudeEastWest -> ^( ANGLE $ew $deg DEGREE $min MINUTE ) )\n int alt208=3;\n int LA208_0 = input.LA(1);\n\n if ( ((LA208_0>=BinaryLiteral && LA208_0<=HexLiteral)) ) {\n switch ( input.LA(2) ) {\n case 268:\n case 269:\n case 270:\n case 271:\n {\n alt208=1;\n }\n break;\n case 243:\n {\n alt208=3;\n }\n break;\n case 330:\n case 331:\n case 332:\n case 333:\n case 334:\n case 335:\n case 336:\n case 337:\n {\n alt208=2;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 208, 1, input);\n\n throw nvae;\n }\n\n }\n else if ( (LA208_0==FloatingPointLiteral) ) {\n int LA208_2 = input.LA(2);\n\n if ( ((LA208_2>=330 && LA208_2<=337)) ) {\n alt208=2;\n }\n else if ( ((LA208_2>=268 && LA208_2<=271)) ) {\n alt208=1;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 208, 2, input);\n\n throw nvae;\n }\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 208, 0, input);\n\n throw nvae;\n }\n switch (alt208) {\n case 1 :\n // flips.g:779:4: x= numericValuePositive ew= longitudeEastWest\n {\n pushFollow(FOLLOW_numericValuePositive_in_longitude4626);\n x=numericValuePositive();\n\n state._fsp--;\n\n stream_numericValuePositive.add(x.getTree());\n pushFollow(FOLLOW_longitudeEastWest_in_longitude4630);\n ew=longitudeEastWest();\n\n state._fsp--;\n\n stream_longitudeEastWest.add(ew.getTree());\n\n\n // AST REWRITE\n // elements: x, ew\n // token labels: \n // rule labels: ew, retval, x\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_ew=new RewriteRuleSubtreeStream(adaptor,\"rule ew\",ew!=null?ew.tree:null);\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n RewriteRuleSubtreeStream stream_x=new RewriteRuleSubtreeStream(adaptor,\"rule x\",x!=null?x.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 780:2: -> ^( ANGLE $ew $x DEGREE )\n {\n // flips.g:780:5: ^( ANGLE $ew $x DEGREE )\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ANGLE, \"ANGLE\"), root_1);\n\n adaptor.addChild(root_1, stream_ew.nextTree());\n adaptor.addChild(root_1, stream_x.nextTree());\n adaptor.addChild(root_1, (CommonTree)adaptor.create(DEGREE, \"DEGREE\"));\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;\n }\n break;\n case 2 :\n // flips.g:781:4: x= numericValuePositive xu= angularUnit ew= longitudeEastWest\n {\n pushFollow(FOLLOW_numericValuePositive_in_longitude4652);\n x=numericValuePositive();\n\n state._fsp--;\n\n stream_numericValuePositive.add(x.getTree());\n pushFollow(FOLLOW_angularUnit_in_longitude4656);\n xu=angularUnit();\n\n state._fsp--;\n\n stream_angularUnit.add(xu.getTree());\n pushFollow(FOLLOW_longitudeEastWest_in_longitude4660);\n ew=longitudeEastWest();\n\n state._fsp--;\n\n stream_longitudeEastWest.add(ew.getTree());\n\n\n // AST REWRITE\n // elements: xu, x, ew\n // token labels: \n // rule labels: ew, retval, x, xu\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_ew=new RewriteRuleSubtreeStream(adaptor,\"rule ew\",ew!=null?ew.tree:null);\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n RewriteRuleSubtreeStream stream_x=new RewriteRuleSubtreeStream(adaptor,\"rule x\",x!=null?x.tree:null);\n RewriteRuleSubtreeStream stream_xu=new RewriteRuleSubtreeStream(adaptor,\"rule xu\",xu!=null?xu.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 782:2: -> ^( ANGLE $ew $x $xu)\n {\n // flips.g:782:5: ^( ANGLE $ew $x $xu)\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ANGLE, \"ANGLE\"), root_1);\n\n adaptor.addChild(root_1, stream_ew.nextTree());\n adaptor.addChild(root_1, stream_x.nextTree());\n adaptor.addChild(root_1, stream_xu.nextTree());\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;\n }\n break;\n case 3 :\n // flips.g:783:4: deg= integerValuePositive 'd' min= numericValuePositive '\\\\'' ew= longitudeEastWest\n {\n pushFollow(FOLLOW_integerValuePositive_in_longitude4683);\n deg=integerValuePositive();\n\n state._fsp--;\n\n stream_integerValuePositive.add(deg.getTree());\n char_literal527=(Token)match(input,243,FOLLOW_243_in_longitude4685); \n stream_243.add(char_literal527);\n\n pushFollow(FOLLOW_numericValuePositive_in_longitude4689);\n min=numericValuePositive();\n\n state._fsp--;\n\n stream_numericValuePositive.add(min.getTree());\n char_literal528=(Token)match(input,329,FOLLOW_329_in_longitude4691); \n stream_329.add(char_literal528);\n\n pushFollow(FOLLOW_longitudeEastWest_in_longitude4695);\n ew=longitudeEastWest();\n\n state._fsp--;\n\n stream_longitudeEastWest.add(ew.getTree());\n\n\n // AST REWRITE\n // elements: min, ew, deg\n // token labels: \n // rule labels: ew, min, retval, deg\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_ew=new RewriteRuleSubtreeStream(adaptor,\"rule ew\",ew!=null?ew.tree:null);\n RewriteRuleSubtreeStream stream_min=new RewriteRuleSubtreeStream(adaptor,\"rule min\",min!=null?min.tree:null);\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n RewriteRuleSubtreeStream stream_deg=new RewriteRuleSubtreeStream(adaptor,\"rule deg\",deg!=null?deg.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 784:2: -> ^( ANGLE $ew $deg DEGREE $min MINUTE )\n {\n // flips.g:784:5: ^( ANGLE $ew $deg DEGREE $min MINUTE )\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ANGLE, \"ANGLE\"), root_1);\n\n adaptor.addChild(root_1, stream_ew.nextTree());\n adaptor.addChild(root_1, stream_deg.nextTree());\n adaptor.addChild(root_1, (CommonTree)adaptor.create(DEGREE, \"DEGREE\"));\n adaptor.addChild(root_1, stream_min.nextTree());\n adaptor.addChild(root_1, (CommonTree)adaptor.create(MINUTE, \"MINUTE\"));\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;\n }\n break;\n\n }\n retval.stop = input.LT(-1);\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n \tretval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n\n }\n finally {\n }\n return retval;\n }", "public static final double getCurrentLongitude() {\n if (getCurrentLongitudeGpsValid() != ZERO) {\n return getCurrentLongitudeGpsValid();\n } else {\n return getCurrentLongitudeNetworkValid();\n }\n }", "int getLatitude();", "public Double A() {\n return this.f917a.getAsDouble(\"CFG_LOCATION_LONGITUDE\");\n }", "BigDecimal getWgs84Longitude();", "public static float getLocY(double lon) {\n\t\treturn (float) ((lon - Graph.CENTRE_LON) * Graph.SCALE_LON * Graph.zoom);\n\t}", "BigDecimal getWgs84EndingLongitude();", "public double generateLongitude(double longitude, Double plusMinusRange);", "@Min(-180)\n @Max(180)\n public double getLng() {\n return lng;\n }", "int getLngE6();", "int getLngE6();", "public static double longitudeFromString(String pLongitude)\r\n {\r\n if (!Waypoint.testLongitude(pLongitude)) return 0;\r\n double Longitude = Double.parseDouble(pLongitude.substring(1,4)); //Grade abschneiden\r\n Longitude += Double.parseDouble(pLongitude.substring(4,7))/600; //Minuten dazuzählen\r\n if(pLongitude.charAt(0)=='E') return Longitude;\r\n else if (pLongitude.charAt(0)=='W') return Longitude*(-1);\r\n return 0;\r\n \r\n }", "public java.lang.String getListLatLon()\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(LISTLATLON$0, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public String getLocation() {\n\t\treturn \"-12.9990189,-38.5140298\";\n\t}", "public static final double getLastKnownLocationLongitude() {\n loadLocationManager();\n double longitude = 0.0;\n // Load last known location coordinate, if available, so that user doesn't have to wait as long for a location.\n if (isGpsEnabled()) {\n Location gpsLocation = mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (gpsLocation != null) {\n longitude = gpsLocation.getLongitude();\n }\n } else if (isNetworkEnabled()) {\n Location networkLocation = mLocationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n if (networkLocation != null) {\n longitude = networkLocation.getLongitude();\n }\n }\n return longitude;\n }", "public double getLastLatitude(){\n if(location != null){\n lastLatitude = location.getLatitude();\n }else{\n lastLatitude = longitude;\n }\n return lastLatitude;\n }", "public void setLon(double value) {\n lon = value;\n }", "boolean hasHasLongitude();", "protected double getLongitudeAttributeValue(XDIMEContextInternal context, \n XDIMEAttributes attributes) throws XDIMEException {\n\n double longitude = Double.NaN;\n String attrVal = attributes.getValue(\"\",\"longitude\");\n if (attrVal != null) {\n try {\n longitude = Double.parseDouble(attrVal);\n } catch (NumberFormatException nfe) {\n throw new XDIMEException(\"\\\"longitude\\\" attribute of map \"\n + \"element must be double\");\n }\n }\n return longitude;\n }", "public double getGpsLng() {\n return gpsLng;\n }", "private String getLocationForPrint(double latitude, double longitude) {\n int latDegree = (new Double(Math.floor(latitude))).intValue();\n int longDegree = (new Double(Math.floor(longitude))).intValue();\n String latEnd = getString(R.string.latitude_south);\n String longEnd = getString(R.string.longitude_west);\n if (latDegree > 0) {\n latEnd = getString(R.string.latitude_north);\n\n }\n if (longDegree > 0) {\n longEnd = getString(R.string.longitude_east);\n }\n double latSecond = (latitude - latDegree) * 100;\n double latMinDouble = (latSecond * 3d / 5d);\n int latMinute = new Double(Math.floor(latMinDouble)).intValue();\n\n double longSecond = (longitude - longDegree) * 100;\n double longMinDouble = (longSecond * 3d / 5d);\n int longMinute = new Double(Math.floor(longMinDouble)).intValue();\n// return String.format(getString(R.string.geo_location_info), latDegree,\n// latMinute, latEnd, longDegree, longMinute, longEnd);\n return getString(R.string.geo_location_info);\n\n }", "boolean hasLongitude();" ]
[ "0.8602916", "0.853075", "0.8410497", "0.8410497", "0.83965623", "0.8221652", "0.7853045", "0.78060216", "0.77919036", "0.77919036", "0.77500486", "0.76826", "0.7644077", "0.7633809", "0.7633809", "0.7633809", "0.7633809", "0.7632238", "0.7624257", "0.76031595", "0.76031595", "0.7573233", "0.7573233", "0.7573233", "0.7573233", "0.75684226", "0.7553684", "0.75471073", "0.75223106", "0.75145525", "0.751297", "0.751297", "0.7510817", "0.74898285", "0.7486019", "0.7485138", "0.7468398", "0.74465024", "0.7440167", "0.7440167", "0.740091", "0.73896456", "0.73846513", "0.7377092", "0.73613167", "0.735274", "0.7341618", "0.73377615", "0.7324497", "0.7310969", "0.7310969", "0.73026437", "0.7299909", "0.7299909", "0.72755355", "0.7257508", "0.7245147", "0.71998775", "0.71622103", "0.71421087", "0.71253175", "0.70923203", "0.7080458", "0.70793134", "0.70685583", "0.69904876", "0.69904876", "0.6935682", "0.69202805", "0.6913263", "0.69121444", "0.6911871", "0.69095963", "0.6906595", "0.6905107", "0.6901965", "0.68745476", "0.6852554", "0.6847157", "0.68161714", "0.6803419", "0.68015283", "0.6778402", "0.67728513", "0.67651576", "0.67609286", "0.67350394", "0.67350394", "0.6729176", "0.6714375", "0.6703037", "0.66944", "0.6631193", "0.6589746", "0.65843767", "0.6577299", "0.6555973", "0.65393424", "0.6522907" ]
0.76840246
12
show all transaction, both expenses and incomes
@RequestMapping(value = {"/", "/transactions"}) public String listAllTransactions(Model model) { // fetch one user and transactions for that user UserDetails user = (UserDetails) SecurityContextHolder.getContext() .getAuthentication().getPrincipal(); String username = user.getUsername(); User currentUser = userRepo.findByUsername(username); model.addAttribute("transactions", traRepo.findByUser(currentUser)); List<Transaction> traList = traRepo.findByUser(currentUser); double sum = 0; for(int i = 0; i < traList.size(); i++) { if(traList.get(i).getType().getName() == "income") { sum += traList.get(i).getAmount(); } if(traList.get(i).getType().getName() == "expense") { sum -= traList.get(i).getAmount(); } } model.addAttribute("sum", sum); return "transactions"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic List<Transaction> getAllTransactions() { \n\t\t/* begin transaction */ \n\t\tSession session = getCurrentSession(); \n\t\tsession.beginTransaction();\n\n\t\tQuery query = session.createQuery(\"from Transaction\");\n\t\tList<Transaction> expenses = query.list();\n\n\t\t/* commit */ \n\t\tsession.getTransaction().commit();\n\n\t\treturn expenses; \n\t}", "private void printAllTransactions(){\n Set<Transaction> transactions = ctrl.getAllTransactions();\n transactions.stream().forEach(System.out::println);\n }", "public void printTransactions() {\n for (int i = 0; i < transactions.size(); i++) {\n\t\t\tint indeks = i+1;\n\t\t\tSystem.out.println(\"Transactions \" + indeks + \": \" + transactions.get(i).getType() + \" \" + transactions.get(i).getAmount());\n\t\t}\n }", "public List<TransactionInfo> getAll() {\n return transactions;\n }", "public Collection<Transaction> getAllTransactions();", "public String reportTransaction() {\n String verb = type.equals(\"buy\") ? \"bought\" : \"sold\";\n return volume + \" stocks of \" + symbol + \" \" + verb + \" @\" + price +\n \" USD (total value \" + String.format(\"%.2f\", getTransactionAmount()) + \" USD).\";\n }", "@RequestMapping(value = \"/admin/trans\", method = RequestMethod.GET)\n public String adminTransactionsPage(Model model) {\n model.addAttribute(\"transactions\", transactionService.findAllTransactions());\n return \"admin/admin-trans\";\n }", "public List<TransactionInfo> list() {\n LOG.debug(\"loading all transaction info\");\n try {\n return getEditor().list();\n } catch (IOException e) {\n throw new CommandExecutionException(\"error occurred while loading transactions\", e);\n }\n }", "@GetMapping(path=\"/expenses/all\")\n\tpublic @ResponseBody Iterable<Expenses> getAllExpenses(){\n\t\treturn expenseRepository.findAll();\n\t}", "List<ObjectExpenseEntity> getAllObjectExpenses();", "public List<Transaction> readAllTransaction() throws TransactionNotFoundException {\n\t\treturn transactionDAO.listAccountTransactionTable();\n\t}", "public void show() {\r\n List<Benefit> listBeneficio = service.findAll();\r\n if(listBeneficio!=null && !listBeneficio.isEmpty()){\r\n for(Benefit c: listBeneficio){\r\n LOGGER.info(c.toString());\r\n }\r\n }\r\n }", "public void printAllTransaction() {\n\t\tregister[registerSelected].printAllTransactions();\n\t}", "@GetMapping(\"/rest\")\n\t\tpublic @ResponseBody List<Transaction> transactionsListRest() {\n\t\t\tUserDetails user = (UserDetails) SecurityContextHolder.getContext()\n\t\t\t\t\t.getAuthentication().getPrincipal();\n\t\t\tString username = user.getUsername();\n\t\t\tUser currentUser = userRepo.findByUsername(username);\n\t\t\treturn (List<Transaction>) traRepo.findByUser(currentUser);\n\t\t}", "public List<Income> getAllIncome() {\n\t\tSession session=null;\n\t\tTransaction tx=null;\n\t\tList<Income> list=null;\n\t\ttry {\n\t\t\tsession=BuildSessionFactory.getCurrentSession();\n\t\t\ttx=session.beginTransaction();\n\t\t\tlist=incomeDao.findAll(session, \"from Income\");\n\t\t\ttx.commit();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t\tif(tx!=null){\n\t\t\t\ttx.rollback();\n\t\t\t\tthrow new UserException(e.getMessage());\n\t\t\t}\n\t\t}finally{\n\t\t\tif(session!=null && session.isOpen()){\n\t\t\t\tsession.close();\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "public List<Transaction> getAllTransaction() throws SQLException {\n String sql = \"SELECT * FROM LabStore.Transaction_Detail\";\n List<Transaction> transactions = new ArrayList<>();\n\n try (Connection conn = database.getConnection();\n PreparedStatement preStmt = conn.prepareStatement(sql)) {\n try (ResultSet rs = preStmt.executeQuery()) {\n while (rs.next()) {\n Transaction transaction = new Transaction();\n transaction.setId(rs.getInt(\"id\"));\n transaction.setUser(userDbManager.getUser(rs.getInt(\"uId\")));\n transaction.setPurchaseDetail(purchaseDetailDbManager\n .getPurchaseDetailById(rs.getInt(\"pdId\")));\n transaction.setCount(rs.getInt(\"count\"));\n transaction.setTime(rs.getTimestamp(\"time\"));\n transactions.add(transaction);\n }\n }\n }\n\n return transactions;\n }", "public lnrpc.Rpc.TransactionDetails getTransactions(lnrpc.Rpc.GetTransactionsRequest request) {\n return blockingUnaryCall(\n getChannel(), getGetTransactionsMethod(), getCallOptions(), request);\n }", "public TransactionDetailResp transaction_show(String txId) throws Exception {\n String s = main(\"transaction_show\", \"[{\\\"txid\\\":\\\"\" + txId +\"\\\"}]\");\n return JsonHelper.jsonStr2Obj(s, TransactionDetailResp.class);\n }", "void listAllDeposit(Ui ui, int depositsToDisplay) throws TransactionException, BankException {\n throw new BankException(\"This account does not support this feature\");\n }", "public List findAll() {\n return findAll(TransactionItem.class);\n }", "public String toString() {\r\n\t\tString s = \"\";\r\n\t\tfor(String t : transactions) {\r\n\t\t\ts += t + \"\\n\";\r\n\t\t}\r\n\t\treturn s;\r\n\t}", "@Override\n public List<Transaksi> getAll() {\n List<Transaksi> listTransaksi = new ArrayList<>();\n\n try {\n String query = \"SELECT id, date_format(tgl_transaksi, '%d-%m-%Y') AS tgl_transaksi FROM transaksi\";\n\n PreparedStatement ps = Koneksi().prepareStatement(query);\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n Transaksi transaksi = new Transaksi();\n\n transaksi.setId(rs.getString(\"id\"));\n transaksi.setTglTransaksi(rs.getString(\"tgl_transaksi\"));\n\n listTransaksi.add(transaksi);\n }\n } catch (SQLException se) {\n se.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return listTransaksi;\n }", "ArrayList<Transaction> getFilteredTransactions(long startTimestamp,\n long endTimestamp, long accountNumber, boolean showExpense, boolean showIncome) {\n ArrayList<Transaction> filteredTransactionList = new ArrayList<>();\n int low = 0;\n int high = transactionList.size() - 1;\n if (startTimestamp != -1 && endTimestamp != -1) {\n /*\n If start and end time are set, then get the range of\n transaction corresponding to the time range.\n */\n Points p = getTransactions(startTimestamp, endTimestamp);\n if (p.x == -1 && p.y == -1)\n return filteredTransactionList;\n low = p.x;\n high = p.y;\n }\n for (int i = low; i <= high; i++) {\n if (accountNumber != -1 && transactionList.get(i).transactionAccountNumber != accountNumber)\n continue;\n if (!showExpense && (transactionList.get(i).transactionType == 0 || transactionList.get(i).transactionType == 2))\n continue;\n if (!showIncome && (transactionList.get(i).transactionType == 1 || transactionList.get(i).transactionType == 3))\n continue;\n filteredTransactionList.add(transactionList.get(i));\n }\n return filteredTransactionList;\n }", "List<Trade> getAllTrades();", "private String marketBuyAmounts() {\r\n\t\tint[] amounts= market.getBuyAmounts();\r\n\t\tString out = \"Buy Requests Are: \";\r\n\t\tfor(int i=0; i<amounts.length;i++) {\r\n\t\t\tout=out.concat(i+\": \"+amounts[i]+\" || \");\r\n\t\t}\r\n\t\treturn out;\r\n\t}", "@Override\n\tpublic List<BankTransaction> getAllTransactions() throws BusinessException {\n\t\tBankTransaction bankTransaction = null;\n\t\tList<BankTransaction> bankTransactionList = new ArrayList<>();\n\t\tConnection connection;\n\n\t\ttry {\n\t\t\tconnection = PostgresqlConnection.getConnection();\n\t\t\tString sql = \"select transaction_id, account_id, transaction_type, amount, transaction_date from dutybank.transactionss\";\n\t\t\t\n\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(sql);\n\n\t\t\tResultSet resultSet = preparedStatement.executeQuery();\n\t\t\t\n\t\t\t\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tbankTransaction = new BankTransaction();\n\t\t\t\tbankTransaction.setTransactionid(resultSet.getInt(\"transaction_id\"));\n\t\t\t\tbankTransaction.setAccountid(resultSet.getInt(\"account_id\"));\n\t\t\t\tbankTransaction.setTransactiontype(resultSet.getString(\"transaction_type\"));\n\t\t\t\tbankTransaction.setTransactionamount(resultSet.getDouble(\"amount\"));\n\t\t\t\tbankTransaction.setTransactiondate(resultSet.getDate(\"transaction_date\"));\n\n\t\t\t\tbankTransactionList.add(bankTransaction);\n\t\t\t} \n\t\t\t\n\t\t\tif (bankTransactionList.size() == 0) {\n\t\t\t\tthrow new BusinessException(\"There is not data to retrieve\");\n\t\t\t}\n\t\t\n\t\t} catch (ClassNotFoundException | SQLException e) {\n\t\t\tthrow new BusinessException(\"Some Error ocurred retrieving data for transactions\");\n\t\t}\n\t\t\n\t\treturn bankTransactionList;\n\t}", "@GET(\"points-transaction-history?expand=translations&sort=-created_at\")\n Call<HistoryExchangeResponse> getTransactionHistoryAll();", "public List<Transaction> getAllTransactions(){\n Cursor cursor = fetchAllRecords();\n List<Transaction> transactions = new ArrayList<Transaction>();\n if (cursor != null){\n while(cursor.moveToNext()){\n transactions.add(buildTransactionInstance(cursor));\n }\n cursor.close();\n }\n return transactions;\n }", "public String toString() {\n\t\tNumberFormat currency = NumberFormat.getCurrencyInstance();\n return \"\" + id + \"\\t\\t\" + currency.format(income) + \"\\t\" + members;\n }", "List<DenialReasonDto> showAll();", "public String toStringIdIncome() {\n\t\tNumberFormat currency = NumberFormat.getCurrencyInstance();\n return \"\" + id + \"\\t\\t\" + currency.format(income);\n }", "@PostMapping(\"/tlb-trade/getAll\")\n @Timed\n public ResponseEntity<ResponseResult> getAll() {\n log.debug(\"REST request to get a page of TlbTrades\");\n List<TlbTradeDTO> tlbTradeDTOList = tlbTradeService.findAll();\n ResponseResult json = new ResponseResult();\n json.setData(tlbTradeDTOList);\n json.setStatusCode(ResponseResult.SUCCESS_CODE);\n return new ResponseEntity<>(json, HttpStatus.OK);\n }", "@GET\n @Path(\"account/transactions/{account_id}\")\n public Response getAccountTransactions(@PathParam(\"account_id\") \n String accountId) {\n \n String output = \"This entry point will return all transactions related to the account: \" + accountId;\n return Response.status(200).entity(output).build();\n \n }", "@GetMapping(\"/payment\")\n\tpublic ResponseEntity<List<Payment>> viewAllPayments() {\n\t\tlogger.info(\"View all Payments\");\n\t\treturn ResponseEntity.ok().body(payService.viewAllPayments());\n\t}", "void listAllExpenditure(Ui ui, int expendituresToDisplay) throws TransactionException {\n throw new TransactionException(\"This account does not support this feature\");\n }", "@Transactional(readOnly = true)\n public List<OrderTransactionDTO> findAll() {\n log.debug(\"Request to get all OrderTransactions\");\n return orderTransactionRepository.findAll().stream()\n .map(orderTransactionMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@RequestMapping(value = \"/viewAllBank\", method = RequestMethod.GET)\n\tpublic List<Bank> viewAllBank() {\n\t\tAtmDAO ad = new AtmDAO();\n\t\tList<Bank> listBank = ad.getAllBank();\n\t\treturn listBank;\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\tString chaine = \"\\t * Transaction * \\t\\n\";\r\n\t\tchaine = chaine + \"[somme : \"+ this.somme + \"] \";\r\n\t\tchaine = chaine + \"[payeur : \"+ this.payeur + \"] \";\r\n\t\tchaine = chaine + \"[receveur :\"+ this.receveur + \"] \";\r\n\t\treturn chaine;\r\n\t}", "public List<Transaction> getAllDepositTransactions(int start, int numOfRows) throws MiddlewareQueryException;", "@RequestMapping(value = \"/\")\n public Map<String, Object> showAll() {\n// Get all invoices\n List<Invoice> invoices = invoiceService.findAll();\n// Build response\n Map<String, Object> response = new LinkedHashMap<String, Object>();\n response.put(\"totalInvoices\", invoices.size());\n response.put(\"invoices\", invoices);\n// Send to client\n return response;\n }", "public void displayAll() {\n\t\t\n\t\tbankop.display();\n\t\n\t}", "public\n void\n displayTransactions(Transaction trans)\n {\n getRegisterPanel().updateView(getFilter(), trans);\n }", "public void printTransaction() {\n\t\tdao.printTransaction();\r\n\t\t\r\n\t}", "public void showBalance(){\n for(Player player: players){\n System.out.println(player + \"'s balance: \" + player.getWallet());\n }\n System.out.println();\n dealer.showProfit();\n System.out.println();\n }", "public List<DBIncomesModel> getAllIncomeList() {\n List<DBIncomesModel> incomeArrayList = new ArrayList<DBIncomesModel>();\n\n String selectQuery = \"SELECT * FROM \" + TABLE_INCOME;\n Log.d(TAG, selectQuery);\n\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (c.moveToFirst()) {\n do {\n DBIncomesModel income = new DBIncomesModel();\n income.id = c.getInt(c.getColumnIndex(KEY_ID));\n income.type = c.getString(c.getColumnIndex(KEY_TYPE));\n income.amount = c.getInt(c.getColumnIndex(KEY_AMOUNT));\n income.place = c.getString(c.getColumnIndex(KEY_PLACE));\n income.note = c.getString(c.getColumnIndex(KEY_NOTE));\n income.cheque = c.getInt(c.getColumnIndex(KEY_CHEQUE));\n income.date = c.getString(c.getColumnIndex(KEY_DATE));\n\n // adding to Expenses list\n incomeArrayList.add(income);\n } while (c.moveToNext());\n }\n return incomeArrayList;\n }", "public List<moneytree.persist.db.generated.tables.pojos.Income> fetchByTransactionAmount(BigDecimal... values) {\n return fetch(Income.INCOME.TRANSACTION_AMOUNT, values);\n }", "public com.google.common.util.concurrent.ListenableFuture<lnrpc.Rpc.TransactionDetails> getTransactions(\n lnrpc.Rpc.GetTransactionsRequest request) {\n return futureUnaryCall(\n getChannel().newCall(getGetTransactionsMethod(), getCallOptions()), request);\n }", "List<String> getTransactionInfos() {\n\t\tList<String> result = new ArrayList<String>();\n\t\tfor (Transaction transaction : transactionLog.getTransactions()) {\n\t\t\tresult.add(transaction.toString());\n\t\t}\n\t\treturn result;\n\t}", "@RequestMapping(method=RequestMethod.GET, value = \"/summary\")\n\tpublic List<ExpenseSummary> getSummaries() {\n\t\treturn service.getSummary();\n\t}", "@Override\n\t\tpublic List<AccountTransaction> findAll() {\n\t\t\treturn null;\n\t\t}", "public static Transactions getTransactions() {\n return Transactions;\n }", "public Transaction[] getTransactionsList() throws Exception;", "private void printAll() {\n\n String infuraAddress = \"70ddb1f89ca9421885b6268e847a459d\";\n dappSmartcontractAddress = \"0x07d55a62b487d61a0b47c2937016f68e4bcec0e9\";\n smartContractGetfunctionAddress = \"0x7355a424\";\n\n CoinNetworkInfo coinNetworkInfo = new CoinNetworkInfo(\n CoinType.ETH,\n EthereumNetworkType.ROPSTEN,\n \"https://ropsten.infura.io/v3/\"+infuraAddress\n );\n\n List<Account> accountList = sBlockchain.getAccountManager()\n .getAccounts(hardwareWallet.getWalletId(), CoinType.ETH, EthereumNetworkType.ROPSTEN);\n\n ethereumService = (EthereumService) CoinServiceFactory.getCoinService(this, coinNetworkInfo);\n\n\n ethereumService.callSmartContractFunction(\n (EthereumAccount) accountList.get(0),\n dappSmartcontractAddress,\n smartContractGetfunctionAddress\n ).setCallback(new ListenableFutureTask.Callback<String>() {\n @Override\n public void onSuccess(String result) { //return hex string\n Log.d(\"SUCCESS TAG\", \"transaction data : \"+result);\n\n getPost(result, accountList);\n\n\n }\n\n @Override\n public void onFailure(@NotNull ExecutionException e) {\n Log.d(\"ERROR TAG #101\",e.toString());\n }\n\n @Override\n public void onCancelled(@NotNull InterruptedException e) {\n Log.d(\"ERROR TAG #102\",e.toString());\n }\n });\n\n\n }", "protected void showReservations() {\n storageDao.findAllRented()\n .forEach(System.out::println);\n }", "@Transactional\n\tpublic Set<TransactionTable> findAllTransactions() {\n\t\t List<TransactionTable> list = new ArrayList<TransactionTable>();\n\t TypedQuery<TransactionTable> query = entityManager.createNamedQuery(\"TransactionTable.findAll\", TransactionTable.class);\n\t list = query.getResultList();\n\t Set<TransactionTable> TransactionSet = new HashSet<TransactionTable>(list);\n\t return TransactionSet;\n\t\n\t}", "@Override\r\n\tpublic List<Expense> findAll() {\n\t\treturn expenseRepository.findAll();\r\n\t}", "public static void total(double income, double expense){\n double dailyIncome = difference(income / DAYS_IN_MONTH);\n double dailyExpense = difference(expense / DAYS_IN_MONTH);\n \n System.out.println(\"Total income = $\" + income + \" ($\" + dailyIncome + \"/day)\" );\n System.out.println(\"Total expenses = $\" + expense + \" ($\" + dailyExpense + \"/day)\");\n System.out.println();\n }", "@Override\n\tpublic ResponseEntity<?> list() {\n\t\treturn ResponseEntity.ok(service.deposit.list(0));\n\t}", "public List<Order> showAllInventory() {\r\n\t\tEntityManager em = emfactory.createEntityManager();\r\n\t\t//I may need to change the query criteria\r\n\t\tTypedQuery<Order> typedQuery = em.createQuery(\"select orderNumber from Order orderNumber\", Order.class);\r\n\t\tList<Order> allInventory = typedQuery.getResultList();\r\n\t\tem.close();\r\n\t\treturn allInventory;\r\n\t}", "public List<Buy> getAll() throws PersistException;", "public void printPaymentSummary() {\n System.out.print(\"+========================+\\n\");\n System.out.print(\"| Payment Summary |\\n\");\n System.out.print(\"+========================+\\n\");\n System.out.printf(\"Payment_ID: %s\\n\", payment_id);\n System.out.printf(\"STAFF_NAME: %s\\t\\t\\tSTAFF_ID : %s\\n\", order_staff.getName().toUpperCase(),\n order_staff.getId());\n System.out.printf(\"CUST_NAME : %s\\t\\tCurrent_Date: %s\\n\", order_member.getName().toUpperCase(),\n java.time.LocalDate.now());\n System.out.printf(\"CUST_ICNO : %s\\t\\tCurrent_Time: %s\\n\", order_member.getMemberIC(),\n java.time.LocalTime.now());\n System.out.print(\"----------------------------------------------------------------\\n\");\n System.out.printf(\"Total : %.2f\\n\", total_sales_of_transaction);\n System.out.printf(\"Payment Type Used : %s\\n\", payment_used);\n System.out.printf(\"Bike Brand : %s\\n\", order.getBike().getBrand());\n System.out.printf(\"Bike Price : %.2f\\n\", order.getBike().getPrice());\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n }", "public List<TransactionType> listESETransactionTypes();", "@Override\n\tpublic ResultSet displayTotalFinancialBudget() {\n\t\tResultSet rs = null;\n\t\ttry {\n\t\t\tc=MakeConnection.getConnection();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\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\ttry {\n\t\t\tPreparedStatement pr=c.prepareStatement(\"select sum(TrainingModule.Budget) from TrainingModule NATURAL JOIN link_tm_tp\");\n\t\t\trs=pr.executeQuery();\n\t\t\t\treturn rs;\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\treturn rs;\n\t}", "public String getTotalDeposits(){\n double sum = 0;\n for(Customer record : bank.getName2CustomersMapping().values()){\n for(Account acc: record.getAccounts()){\n sum += acc.getOpeningBalance();\n }\n }\n return \"Total deposits: \"+sum;\n }", "@GetMapping(\"/rent\")\n public ResultEntity<List<ItemDTO>> getAllRent()\n {\n\n return itemService.getItemsBySubCategory(ConstantUtil.TYPE_SALE_RENT,\"Rent\");\n }", "public List<Transaction> getTransactions() throws SQLException {\n\t\tList<Transaction> result = new ArrayList<>();\n\t\tStatement statement = conn.createStatement();\n\t\ttry (ResultSet resultSet = statement.executeQuery(\"select Date, Amount, Category, Type from transaction\")) {\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tresult.add(new Transaction(resultSet.getDate(1), resultSet.getDouble(2), resultSet.getString(3), resultSet.getString(4)));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "private String marketSellAmounts() {\r\n\t\tint[] amounts= market.getSellAmounts();\r\n\t\tString out = \"Sell Requests Are: \";\r\n\t\tfor(int i=0; i<amounts.length;i++) {\r\n\t\t\tout=out.concat(i+\": \"+amounts[i]+\" || \");\r\n\t\t}\r\n\t\treturn out;\r\n\t}", "@Override\r\n\tpublic List<MarketDto> readMarketAll() {\n\t\treturn session.selectList(\"kdc.market.readMarketAll\");\r\n\t}", "public String displayAccount() {\r\n\t return id+\",\"+name+\",\"+balance+\",\"+email+\",\"+dateOfOpening;\r\n }", "List<Consumption> listAll();", "@SkipValidation\n public String getAllCurrency() {\n currencyList = currencyService.getAllCurrency();\n return SUCCESS;\n }", "public TransactionResp transaction_list() throws Exception {\n String s = main(\"transaction_list\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, TransactionResp.class);\n }", "@RequestMapping(method = RequestMethod.GET)\n public ModelAndView start(\n @RequestParam final Map<String, String> queryParameters,\n\t\tfinal HttpServletRequest request\n ) {\n \n final Optional<ActiveUserEntity> activeUserEntity = this.getCurrentUser(request);\n if(!activeUserEntity.isPresent()){\n return this.buildInvalidSessionResponse();\n }\n \n\n final ModelAndView modelAndView =\n this.setErrorMessageFromQueryString(\n new ModelAndView(ViewNames.TRANSACTION_DETAIL.getViewName()),\n queryParameters);\n modelAndView.addObject( //TODO: Do we need the user to be elevated?\n ViewModelNames.IS_ELEVATED_USER.getValue(),\n this.isElevatedUser(activeUserEntity.get()));\n \n try {\n modelAndView.addObject(\n ViewModelNames.PRODUCTS.getValue(),\n this.productsQuery.execute());\n } catch (final Exception e) {\n modelAndView.addObject(\n ViewModelNames.ERROR_MESSAGE.getValue(),\n e.getMessage());\n modelAndView.addObject(\n ViewModelNames.PRODUCTS.getValue(),\n (new Product[0]));\n }\n final List<TransactionEntry> transactionEntries;\n long totalPrice = 0L;\n double totalQuantity = 0.0;\n try {\n transactionEntries = this.transactionEntriesQuery.execute();\n final List<TransactionEntry> actualTransactionEntries = new LinkedList<>();\n //all transactionentris with all 0 transactionIds are current transaction, this removes all others\n for (int i = 0; i < transactionEntries.size(); i++)\n {\n UUID defaultUUID = UUID.fromString(\"00000000-0000-0000-0000-000000000000\");\n //System.out.println(\"in the \" + i + \" loop\");\n if(defaultUUID.equals(transactionEntries.get(i).getTransactionId()))\n {\n //System.out.println(\"the \" + i + \" has the \" + transactionEntries.get(i).getTransactionId().toString() + \"yeet\");\n //System.out.println(\"removing \" + i + \" from the list\");\n actualTransactionEntries.add(transactionEntries.get(i));\n totalPrice += (transactionEntries.get(i).getPrice() * transactionEntries.get(i).getQuantity());\n totalQuantity += transactionEntries.get(i).getQuantity();\n }\n\n }\n modelAndView.addObject(\"totalPrice\", totalPrice);\n modelAndView.addObject(\"totalQuantity\", totalQuantity);\n modelAndView.addObject(\n ViewModelNames.TRANSACTION_ENTRIES.getValue(),\n actualTransactionEntries);\n } catch (final Exception e) {\n modelAndView.addObject(\n ViewModelNames.ERROR_MESSAGE.getValue(),\n e.getMessage());\n modelAndView.addObject(\n ViewModelNames.TRANSACTION_ENTRIES.getValue(),\n (new TransactionEntry[0]));\n }\n\n\n\n modelAndView.addObject(\n ViewModelNames.TRANSACTION.getValue(),\n (new Transaction()));\n \n return modelAndView;\n }", "public List<String> getTransactionsToStringList() {\n List<String> newTransactions = new ArrayList<>(transactions.size());\n for (List<Integer> transaction : transactions) {\n List<String> newList = new ArrayList<String>(transaction.size());\n for (Integer integer : transaction) {\n newList.add(String.valueOf(integer)); \n }\n newTransactions.add(String.join(\" \", newList));\n }\n return newTransactions;\n }", "public String getExpenseTable(String searchCriteria) {\n List<Expense> expenseList = new ArrayList<Expense>();\n List<Expense> tempExpenseList;\n HashSet<Integer> uniqueIdList = new HashSet<Integer>();\n ExpenseDAO expenseDAO = new ExpenseDAO();\n TagLogic tagLogic = new TagLogic();\n DateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\n DataTableGenerator dataTableGenerator = new DataTableGenerator();\n String table;\n\n if (searchCriteria.equals(\"\")) {\n tempExpenseList = expenseDAO.getAll();\n\n for (Expense expense : tempExpenseList) {\n uniqueIdList.add(expense.getId());\n }\n\n for (Integer expenseId : uniqueIdList) {\n Expense expense = expenseDAO.getById(expenseId);\n expenseList.add(expense);\n }\n\n } else {\n expenseList = new ArrayList<Expense>();\n if (expenseDAO.getById(searchCriteria) != null) {\n expenseList.add(expenseDAO.getById(searchCriteria));\n }\n }\n\n table = dataTableGenerator.getStartTable();\n String dataArray[] = new String[4];\n dataArray[0] = \"Transaction ID\";\n dataArray[1] = \"Date\";\n dataArray[2] = \"Tags\";\n dataArray[3] = \"Amount\";\n table = table + dataTableGenerator.getTableHeader(dataArray);\n table = table + dataTableGenerator.getStartTableBody();\n\n for (Expense expense : expenseList) {\n dataArray[0] = String.valueOf(expense.getId());\n dataArray[1] = dateFormat.format(expense.getDate());\n dataArray[2] = tagLogic.getTagValue(expense.getTags());\n dataArray[3] = expense.getAmount().toString();\n table = table + dataTableGenerator.getTableBodyRow(dataArray, \"edit/\" + expense.getId(), \"delete/\" + expense.getId());\n }\n\n table = table + dataTableGenerator.getEndTableBody();\n table = table + dataTableGenerator.getEndTable();\n return table;\n }", "public List<Transaction> getTransactions(String startdate, String enddate) {\r\n List<Transaction> transactionList = null;\r\n Session session = HibernateUtil.getSessionFactory().getCurrentSession();\r\n try {\r\n org.hibernate.Transaction hbtransaction = session.beginTransaction();\r\n Query q = session.createQuery (\"from finance.entity.Transaction trans WHERE (trans.effdate BETWEEN :startdate AND :enddate) AND trans.category.extra = false AND trans.deleted = false ORDER BY trans.effdate, trans.category.sortId\");\r\n q.setParameter(\"startdate\", java.sql.Date.valueOf(startdate));\r\n q.setParameter(\"enddate\", java.sql.Date.valueOf(enddate));\r\n transactionList = (List<Transaction>) q.list();\r\n hbtransaction.commit();\r\n } catch (Exception e) {\r\n throw e;\r\n }\r\n return transactionList;\r\n }", "public void printAllRegionsEarnings() {\n for (int i = 0; i < numRegions; i++) {\n System.out.println(\"The earning of \" + regionList[i].getRegionName() + \" is $\" + regionList[i].calcEarnings());\n } //hey we need to change the double with the good proper formatting\n }", "void showAll();", "public List<Transaction> checkTransactions(List<Transaction> transactions) {\r\n List<Transaction> transactionList = new ArrayList<Transaction>();\r\n Session session = HibernateUtil.getSessionFactory().getCurrentSession();\r\n try {\r\n org.hibernate.Transaction hbtransaction = session.beginTransaction();\r\n for(Transaction trans : transactions) {\r\n Query q = session.createQuery (\"from finance.entity.Transaction trans WHERE trans.transdate = :transdate AND trans.amount = :amount AND trans.vendor = :vendor AND trans.account.uid = :accountuid\");\r\n q.setParameter(\"transdate\", trans.getTransdate());\r\n q.setParameter(\"amount\", trans.getAmount());\r\n q.setParameter(\"vendor\", trans.getVendor());\r\n Account acct = trans.getAccount();\r\n q.setParameter(\"accountuid\", acct.getUid());\r\n List<Transaction> foundTransactions = (List<Transaction>) q.list();\r\n if (foundTransactions.isEmpty()) {\r\n transactionList.add(trans);\r\n }\r\n }\r\n hbtransaction.commit();\r\n } catch (Exception e) {\r\n throw e;\r\n }\r\n return transactionList;\r\n }", "ListView getManageTransactionListView();", "@Override\n\tpublic String showAll() {\n\t\treturn null;\n\t}", "private void viewTransferHistory() {\n\t\tTransfer[] allTransfers = transferService.getTransferHistory(currentUser.getToken(),\n\t\t\t\tcurrentUser.getUser().getId());\n\n\t\tSystem.out.println(\"----------------------------------------------\");\n\t\tSystem.out.println(\"Transfers\");\n\t\tSystem.out.println(\"ID From/To Amount\");\n\t\tSystem.out.println(\"----------------------------------------------\");\n\n\t\t//loop through each transfer and print them out if they are associated with the current user\n\t\tfor (int i = 0; i < allTransfers.length; i++) {\n\n\n\t\t\tif (allTransfers[i].getToUserId() == currentUser.getUser().getId()) {\n\t\t\t\t\n\n\t\t\t\tSystem.out.println(allTransfers[i].getTransferId() + \" From: \"\n\t\t\t\t\t\t+ allTransfers[i].getFromUsername() + \" $ \" + allTransfers[i].getTransferAmount());\n\n\t\t\t} else if (allTransfers[i].getFromUserId() == currentUser.getUser().getId()) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(allTransfers[i].getTransferId() + \" To: \" + allTransfers[i].getToUserName()\n\t\t\t\t\t\t+ \" $ \" + allTransfers[i].getTransferAmount());\n\t\t\t}\n\n\t\t}\n\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter the 'Transfer ID' to retreive details of the transfer or (0) to exit>>>>\");\n\t\tString stringTransferId = input.nextLine();\n\t\tboolean flagFoundId = false;\n\t\tlong transfersId = 0;\n\t\tBigDecimal transferAmount = new BigDecimal(0);\n\t\tString fromUserName = \"\";\n\t\tString toUserName = \"\";\n\t\tString typeOfTransfer = \"\";\n\t\tString statusOfTransfer = \"\";\n\t\t\n\n\t\t//display transfer details for selected transfer if a valid response\n\t\twhile (true && !String.valueOf(stringTransferId).equals(String.valueOf(0))) {\n\n\t\t\tfor (int i = 0; i < allTransfers.length; i++) {\n\t\t\t\tif (String.valueOf(stringTransferId).equals(String.valueOf(allTransfers[i].getTransferId()))) {\n\n\t\t\t\t\n\t\t\t\t\ttransfersId = allTransfers[i].getTransferId();\n\t\t\t\t\tfromUserName = allTransfers[i].getFromUsername();\n\t\t\t\t\ttoUserName = allTransfers[i].getToUserName();\n\t\t\t\t\ttypeOfTransfer = allTransfers[i].getTypeOfTransfer();\n\t\t\t\t\tstatusOfTransfer = allTransfers[i].getStatusOfTransfer();\n\t\t\t\t\ttransferAmount = allTransfers[i].getTransferAmount();\n\n\t\t\t\t\tflagFoundId = true;\n\t\t\t\t\tstringTransferId = \"0\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (flagFoundId == false) {\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\"Please enter the valid 'Transfer ID' to retreive details of the transfer or (0) to exit>>>>\");\n\t\t\t\tstringTransferId = input.nextLine();\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (flagFoundId == true) {\n\t\t\tSystem.out.println(\"----------------------------------------------\");\n\t\t\tSystem.out.println(\"Transfer Details\");\n\t\t\tSystem.out.println(\"----------------------------------------------\");\n\t\t\tSystem.out.println(\"Id: \" + transfersId);\n\t\t\tSystem.out.println(\"From: \" + fromUserName);\n\t\t\tSystem.out.println(\"To: \" + toUserName);\n\t\t\tSystem.out.println(\"Type: \" + typeOfTransfer);\n\t\t\tSystem.out.println(\"Status: \" + statusOfTransfer);\n\t\t\tSystem.out.println(\"Amount: \" + transferAmount);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t// }\n\n\t}", "private void displayAll() {\n\t\tif(inventoryObject.totalNumCards() == 0) { // checks to see if there are 0 StockIndexCards\n\t\t\tSystem.out.println(\"The Inventory is empty\\n\");\n\t\t\tgetUserInfo();\n\t\t}\n\t\telse {\n\t\tSystem.out.println(inventoryObject.displayAll());\n\t\tgetUserInfo();\n\t\t}\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return instance.getTransactions(index);\n }", "public String getMarketSummaries() {\n\n\t\treturn getJson(API_VERSION, PUBLIC, \"getmarketsummaries\");\n\t}", "@Override\r\n\tpublic String toStringFormat() {\n\t\treturn transactionId + \" \" + merhcantId\r\n\t\t\t\t+ \" \" + transactionVolume + \" \" + transactionAmount\r\n\t\t\t\t+ \" \" + transactionDate+\"\\n\";\r\n\t}", "@Transactional(readOnly = true)\n public List<ActivityEstimationDTO> findAll() {\n log.debug(\"Request to get all ActivityEstimations\");\n return activityEstimationRepository.findAll().stream()\n .map(activityEstimationMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@RequestMapping(value = \"/estados\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Estado> getAll() {\n log.debug(\"REST request to get all Estados\");\n return estadoRepository.findAll();\n }", "public void printSummary(){\r\n for (Map.Entry<String, Account[]> list : allAccounts.entrySet()){\r\n Account[] accountList = list.getValue();\r\n for (int i = 0; i < accountList.length; i++){\r\n if (accountList[i] == null){\r\n break;\r\n }\r\n System.out.println(list.getKey() + \" \" + (i+1) + \": \" + accountList[i].getCurrentBalance());\r\n }\r\n }\r\n }", "List<TransactionType> listAgentTransactionTypes();", "@Test\n public void getHouseholdClientTransactionUsingGetTest() throws ApiException {\n UUID householdId = null;\n Boolean ascending = null;\n String currencyConversion = null;\n LocalDate endDate = null;\n String filter = null;\n String orderBy = null;\n Integer page = null;\n Integer size = null;\n LocalDate startDate = null;\n PagePortfolioTransaction response = api.getHouseholdClientTransactionUsingGet(householdId, ascending, currencyConversion, endDate, filter, orderBy, page, size, startDate);\n\n // TODO: test validations\n }", "public void show() {\r\n\t\tSystem.out.println(\"Id \\t Name \\t Address\");\r\n\t\t\r\n\t\tfor (int index = 0; index < emp.size(); index++) {\r\n\t\t\tSystem.out.println(emp.get(index).empId + \"\\t\" + emp.get(index).name +\"\\t\" + emp.get(index).adress);\r\n\t\t}\r\n\t}", "public void loadTransactions() {\n try {\n new GetRecents().execute().get();//first we get the transactions from the database\n for (final TransactionModel model : Alltransactions) {\n final View cardView = getLayoutInflater().inflate(R.layout.transaction_card, null, false);\n ImageView transaction_logo = cardView.findViewById(R.id.transaction_type_img);\n if (model.getType() == TransactionModel.typeTransaction.SEND) {//if send then add the logo of send\n transaction_logo.setImageResource(R.drawable.send);\n transaction_logo.setColorFilter(getResources().getColor(R.color.green));\n } else transaction_logo.setImageResource(R.drawable.receive);\n\n TextView crypto_amount = cardView.findViewById(R.id.transaction_amount_value);\n model.setAmount_crypto(model.getAmount_crypto().setScale(10, BigDecimal.ROUND_DOWN));//change the scale of the crypto amount\n DecimalFormat df = new DecimalFormat();\n df.setMaximumFractionDigits(10);\n df.setMinimumFractionDigits(5);\n df.setGroupingUsed(false);\n\n String result = df.format(model.getAmount_crypto());//format the amount\n crypto_amount.setText(result);\n TextView crypto_Type = cardView.findViewById(R.id.transaction_type);\n crypto_Type.setText(model.getType_symbol());//put the symbol\n TextView usd_amount = cardView.findViewById(R.id.transaction_amount_usd);\n NumberFormat defaultFormat = NumberFormat.getCurrencyInstance(new Locale(\"en\", \"US\"));\n usd_amount.setText(\"US\" + defaultFormat.format(model.getAmount_us()));\n TextView dateTransac = cardView.findViewById(R.id.transaction_date);\n Date date = model.getDate();\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n String strDate = dateFormat.format(date);//format the date to the chosen format\n String[] dateTime = strDate.split(\" \");\n dateTransac.setText(dateTime[0]);//put the date\n TextView timeTransac = cardView.findViewById(R.id.transaction_time);\n timeTransac.setText(dateTime[1]);//put the time\n\n cardView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n TransactionBottomSheet bottomSheet = new TransactionBottomSheet(model.getWallet_addr_sender(), model.getWallet_addr_receiver());\n bottomSheet.show(getFragmentManager(), \"transactionSheet\");\n }\n });\n transactionsView.addView(cardView);//add the card\n }\n\n } catch (Exception e) {\n Log.v(\"ExceptionLoad\", Arrays.toString(e.getStackTrace()));\n }\n }", "@Transactional\n\t@Override\n\tpublic List<ApplicantModel> viewAllApplicants() {\n\t\treturn applicantRepo.findAll().stream().map(course -> parser.parse(course))\n\t\t\t\t.collect(Collectors.toList());\n\t}", "List<DangerMerchant> selectAll();", "public Iterator getTransactions() {\n return (transactions.listIterator());\n }", "public long countAllDepositTransactions() throws MiddlewareQueryException;", "@Override\r\n public String toString() {\r\n return \"V1Settlement [\" + \"id=\" + id + \", status=\" + status + \", totalMoney=\" + totalMoney\r\n + \", initiatedAt=\" + initiatedAt + \", bankAccountId=\" + bankAccountId + \", entries=\"\r\n + entries + \"]\";\r\n }", "@Transactional(readOnly = true)\n public List<Currency> findAll() {\n log.debug(\"Request to get all Currencies\");\n return currencyRepository.findAll();\n }", "public List<CustomerPurchase> getAll() throws SQLException;" ]
[ "0.70571303", "0.69154996", "0.6815832", "0.6202376", "0.6056593", "0.59512526", "0.59445953", "0.58748937", "0.5863861", "0.58403707", "0.5817507", "0.5791707", "0.57826364", "0.57704395", "0.57418025", "0.57327694", "0.5648704", "0.5638135", "0.5612717", "0.56076103", "0.5605751", "0.55778676", "0.55679005", "0.5558436", "0.5557037", "0.554189", "0.5513", "0.5504874", "0.54983515", "0.54597884", "0.54595715", "0.5458045", "0.5448449", "0.54460776", "0.5409757", "0.54084426", "0.5407122", "0.53809065", "0.53805494", "0.5365313", "0.536528", "0.53588593", "0.5357181", "0.5352779", "0.5351658", "0.5340091", "0.5314926", "0.53124034", "0.53042763", "0.5301935", "0.5300399", "0.5295052", "0.5287792", "0.52859235", "0.5280202", "0.5275692", "0.52454484", "0.52382135", "0.52357334", "0.52208835", "0.5218575", "0.51949084", "0.51914334", "0.5190123", "0.5188226", "0.51848", "0.5173625", "0.51724845", "0.5163533", "0.5160635", "0.5159997", "0.51546526", "0.51460713", "0.5145709", "0.51445436", "0.5133465", "0.5124218", "0.5123694", "0.51206416", "0.5116089", "0.5116066", "0.5106576", "0.5106029", "0.5089185", "0.50886625", "0.5083322", "0.50824034", "0.5080226", "0.5078605", "0.5076813", "0.5076697", "0.5069077", "0.50663906", "0.5059597", "0.5056721", "0.5054379", "0.5051916", "0.50519073", "0.5050051", "0.5049861" ]
0.65607506
3
RESTful show all transactions
@GetMapping("/rest") public @ResponseBody List<Transaction> transactionsListRest() { UserDetails user = (UserDetails) SecurityContextHolder.getContext() .getAuthentication().getPrincipal(); String username = user.getUsername(); User currentUser = userRepo.findByUsername(username); return (List<Transaction>) traRepo.findByUser(currentUser); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Collection<Transaction> getAllTransactions();", "public List<TransactionInfo> getAll() {\n return transactions;\n }", "@GET\n @Path(\"account/transactions/{account_id}\")\n public Response getAccountTransactions(@PathParam(\"account_id\") \n String accountId) {\n \n String output = \"This entry point will return all transactions related to the account: \" + accountId;\n return Response.status(200).entity(output).build();\n \n }", "@PostMapping(\"/tlb-trade/getAll\")\n @Timed\n public ResponseEntity<ResponseResult> getAll() {\n log.debug(\"REST request to get a page of TlbTrades\");\n List<TlbTradeDTO> tlbTradeDTOList = tlbTradeService.findAll();\n ResponseResult json = new ResponseResult();\n json.setData(tlbTradeDTOList);\n json.setStatusCode(ResponseResult.SUCCESS_CODE);\n return new ResponseEntity<>(json, HttpStatus.OK);\n }", "@RequestMapping(value = \"/estados\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Estado> getAll() {\n log.debug(\"REST request to get all Estados\");\n return estadoRepository.findAll();\n }", "@Override\n\tpublic List<Transaction> getAllTransactions() { \n\t\t/* begin transaction */ \n\t\tSession session = getCurrentSession(); \n\t\tsession.beginTransaction();\n\n\t\tQuery query = session.createQuery(\"from Transaction\");\n\t\tList<Transaction> expenses = query.list();\n\n\t\t/* commit */ \n\t\tsession.getTransaction().commit();\n\n\t\treturn expenses; \n\t}", "@RequestMapping(value = \"/admin/trans\", method = RequestMethod.GET)\n public String adminTransactionsPage(Model model) {\n model.addAttribute(\"transactions\", transactionService.findAllTransactions());\n return \"admin/admin-trans\";\n }", "public List<Transaction> readAllTransaction() throws TransactionNotFoundException {\n\t\treturn transactionDAO.listAccountTransactionTable();\n\t}", "@RequestMapping(value = \"/transactionservice/transaction/{transaction_id}\", method=RequestMethod.GET, produces = \"application/json\")\n\t@ResponseBody\n\tpublic Transaction getTransaction(@PathVariable long transaction_id) {\n\t\tif(transactions.size() > transaction_id) {\n\t\t\treturn transactions.get((int) transaction_id);\n\t\t} else {\n\t\t\tthrow new TransactionNotFoundException(transaction_id);\n\t\t}\n\t}", "@GET\n @Path(\"public/transactions/{CurrencyPair}\")\n GatecoinTransactionResult getTransactions(\n @PathParam(\"CurrencyPair\") String CurrencyPair,\n @QueryParam(\"Count\") int Count,\n @QueryParam(\"TransactionId\") long TransactionId\n ) throws IOException, GatecoinException;", "@GET\n @Path(\"public/transactions/{CurrencyPair}\")\n GatecoinTransactionResult getTransactions(@PathParam(\"CurrencyPair\") String CurrencyPair) throws IOException, GatecoinException;", "@GET(\"points-transaction-history?expand=translations&sort=-created_at\")\n Call<HistoryExchangeResponse> getTransactionHistoryAll();", "@Transactional(readOnly = true)\n public List<OrderTransactionDTO> findAll() {\n log.debug(\"Request to get all OrderTransactions\");\n return orderTransactionRepository.findAll().stream()\n .map(orderTransactionMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "public static Response controllerGetTransactions(\n Account account,\n Token authorization\n ) {\n if (userOwnsAccount(account.accountId, authorization.userId) == null) {\n return new Response(\n 401,\n Router.AUTHENTICATION_ERROR,\n Response.ResponseType.TEXT\n );\n }\n try {\n ArrayList<Transaction> transactions = TransactionDatabase.retrieveTransactions(\n account.accountId\n );\n return new Response(200, transactions, Response.ResponseType.JSON);\n } catch (SQLException e) {\n return new Response(500, SQL_ERROR, Response.ResponseType.TEXT);\n }\n }", "@RequestMapping(value = {\"/\", \"/transactions\"})\n\tpublic String listAllTransactions(Model model) {\n\t\t\n\t\t// fetch one user and transactions for that user\n\t\tUserDetails user = (UserDetails) SecurityContextHolder.getContext()\n\t\t\t\t.getAuthentication().getPrincipal();\n\t\tString username = user.getUsername();\n\t\tUser currentUser = userRepo.findByUsername(username);\n\t\tmodel.addAttribute(\"transactions\", traRepo.findByUser(currentUser));\n\t\t\n\t\tList<Transaction> traList = traRepo.findByUser(currentUser);\n\t\tdouble sum = 0;\n\t\tfor(int i = 0; i < traList.size(); i++) {\n\t\t\tif(traList.get(i).getType().getName() == \"income\") {\n\t\t\t\tsum += traList.get(i).getAmount();\n\t\t\t}\n\t\t\tif(traList.get(i).getType().getName() == \"expense\") {\n\t\t\t\tsum -= traList.get(i).getAmount();\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t\tmodel.addAttribute(\"sum\", sum);\n\t\t\n\t\treturn \"transactions\";\n\t}", "public List<TransactionInfo> list() {\n LOG.debug(\"loading all transaction info\");\n try {\n return getEditor().list();\n } catch (IOException e) {\n throw new CommandExecutionException(\"error occurred while loading transactions\", e);\n }\n }", "@GET\n @Path( \"transactions\" )\n void getTransactions( @QueryParam( \"orderId\" ) Long orderId,\n @QueryParam( \"invoiceId\" ) Long invoiceId,\n SuccessCallback<Items<Transaction>> callback );", "@Override\n public List<Transaksi> getAll() {\n List<Transaksi> listTransaksi = new ArrayList<>();\n\n try {\n String query = \"SELECT id, date_format(tgl_transaksi, '%d-%m-%Y') AS tgl_transaksi FROM transaksi\";\n\n PreparedStatement ps = Koneksi().prepareStatement(query);\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n Transaksi transaksi = new Transaksi();\n\n transaksi.setId(rs.getString(\"id\"));\n transaksi.setTglTransaksi(rs.getString(\"tgl_transaksi\"));\n\n listTransaksi.add(transaksi);\n }\n } catch (SQLException se) {\n se.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return listTransaksi;\n }", "public List findAll() {\n return findAll(TransactionItem.class);\n }", "public TransactionResp transaction_list() throws Exception {\n String s = main(\"transaction_list\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, TransactionResp.class);\n }", "private void printAllTransactions(){\n Set<Transaction> transactions = ctrl.getAllTransactions();\n transactions.stream().forEach(System.out::println);\n }", "public Transaction[] getTransactionsList() throws Exception;", "List<Trade> getAllTrades();", "@RequestMapping(value = \"/\")\n public Map<String, Object> showAll() {\n// Get all invoices\n List<Invoice> invoices = invoiceService.findAll();\n// Build response\n Map<String, Object> response = new LinkedHashMap<String, Object>();\n response.put(\"totalInvoices\", invoices.size());\n response.put(\"invoices\", invoices);\n// Send to client\n return response;\n }", "@GET\n\t@Path(\"all\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getAll() {\n\t\treturn Response.ok(taxBusiness.getAllTaxes()).build();\n\n\t}", "public List<Transaction> getAllTransaction() throws SQLException {\n String sql = \"SELECT * FROM LabStore.Transaction_Detail\";\n List<Transaction> transactions = new ArrayList<>();\n\n try (Connection conn = database.getConnection();\n PreparedStatement preStmt = conn.prepareStatement(sql)) {\n try (ResultSet rs = preStmt.executeQuery()) {\n while (rs.next()) {\n Transaction transaction = new Transaction();\n transaction.setId(rs.getInt(\"id\"));\n transaction.setUser(userDbManager.getUser(rs.getInt(\"uId\")));\n transaction.setPurchaseDetail(purchaseDetailDbManager\n .getPurchaseDetailById(rs.getInt(\"pdId\")));\n transaction.setCount(rs.getInt(\"count\"));\n transaction.setTime(rs.getTimestamp(\"time\"));\n transactions.add(transaction);\n }\n }\n }\n\n return transactions;\n }", "public List<Transaction> getAllTransactions(){\n Cursor cursor = fetchAllRecords();\n List<Transaction> transactions = new ArrayList<Transaction>();\n if (cursor != null){\n while(cursor.moveToNext()){\n transactions.add(buildTransactionInstance(cursor));\n }\n cursor.close();\n }\n return transactions;\n }", "@Override\n\tpublic ResponseEntity<?> list() {\n\t\treturn ResponseEntity.ok(service.deposit.list(0));\n\t}", "@GetMapping(\"/payment\")\n\tpublic ResponseEntity<List<Payment>> viewAllPayments() {\n\t\tlogger.info(\"View all Payments\");\n\t\treturn ResponseEntity.ok().body(payService.viewAllPayments());\n\t}", "@GetMapping(\"/getall\")\n public List<Task> getAll() {\n return taskService.allTasks();\n\n }", "@GetMapping(\"/payments\")\n public List<Payment> getAllPayments() {\n log.debug(\"REST request to get all Payments\");\n return paymentRepository.findAll();\n }", "public static Transactions getTransactions() {\n return Transactions;\n }", "@RequestMapping(value = \"/tiempos/\", \n\t method = RequestMethod.GET, \n\t headers=\"Accept=application/json\"\n\t ) \n\tpublic List<TiempoSensado> getTiempos(){\n\t\treturn tiemposensadoRepository.findAll();\n\t}", "@Override\n\tpublic List<BankTransaction> getAllTransactions() throws BusinessException {\n\t\tBankTransaction bankTransaction = null;\n\t\tList<BankTransaction> bankTransactionList = new ArrayList<>();\n\t\tConnection connection;\n\n\t\ttry {\n\t\t\tconnection = PostgresqlConnection.getConnection();\n\t\t\tString sql = \"select transaction_id, account_id, transaction_type, amount, transaction_date from dutybank.transactionss\";\n\t\t\t\n\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(sql);\n\n\t\t\tResultSet resultSet = preparedStatement.executeQuery();\n\t\t\t\n\t\t\t\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tbankTransaction = new BankTransaction();\n\t\t\t\tbankTransaction.setTransactionid(resultSet.getInt(\"transaction_id\"));\n\t\t\t\tbankTransaction.setAccountid(resultSet.getInt(\"account_id\"));\n\t\t\t\tbankTransaction.setTransactiontype(resultSet.getString(\"transaction_type\"));\n\t\t\t\tbankTransaction.setTransactionamount(resultSet.getDouble(\"amount\"));\n\t\t\t\tbankTransaction.setTransactiondate(resultSet.getDate(\"transaction_date\"));\n\n\t\t\t\tbankTransactionList.add(bankTransaction);\n\t\t\t} \n\t\t\t\n\t\t\tif (bankTransactionList.size() == 0) {\n\t\t\t\tthrow new BusinessException(\"There is not data to retrieve\");\n\t\t\t}\n\t\t\n\t\t} catch (ClassNotFoundException | SQLException e) {\n\t\t\tthrow new BusinessException(\"Some Error ocurred retrieving data for transactions\");\n\t\t}\n\t\t\n\t\treturn bankTransactionList;\n\t}", "public Collection<CleaningTransaction> findAll();", "protected ArrayList<Transaction> refreshTransactions() {\r\n\t\ttry {\r\n\t\t\tHttpResponse response = serverAccess.getAllTransactionsResponse();\r\n\t\t\tif (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {\r\n\t\t\t\tString transactionsJson = EntityUtils.toString(response.getEntity());\r\n\t\t\t\tGson gson = new GsonBuilder().create();\r\n\t\t\t\tTransaction[] transactionArray = gson.fromJson(transactionsJson, Transaction[].class);\r\n\t\t\t\tArrayList<Transaction> transactionList = new ArrayList<Transaction>(Arrays.asList(transactionArray));\r\n\t\t\t\ttxtError.setText(\"\");\r\n\t\t\t\treturn transactionList;\r\n\t\t\t} else {\r\n\t\t\t\ttxtError.setText(EntityUtils.toString(response.getEntity()) + \" (Fehler: \"\r\n\t\t\t\t\t\t+ response.getStatusLine().getStatusCode() + \")\");\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\ttxtError.setText(\"Server nicht verfügbar\");\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@RequestMapping(\"/accounts\")\n public List<Account> getAllAccounts(){\n return accountService.getAllAccounts();\n }", "@GetMapping(\"/rest/{id}\")\n\t\tpublic @ResponseBody Optional<Transaction> findTranscationRest(@PathVariable(\"id\") Long transactionId) {\n\t\t\tUserDetails user = (UserDetails) SecurityContextHolder.getContext()\n\t\t\t\t\t.getAuthentication().getPrincipal();\n\t\t\tString username = user.getUsername();\n\t\t\tUser currentUser = userRepo.findByUsername(username);\n\t\t\tList<Transaction> transactions = traRepo.findByUser(currentUser);\n\t\t\tfor(int i = 0; i < transactions.size(); i++) {\n\t\t\t\tif(transactions.get(i).getId() == transactionId) {\n\t\t\t\t\ttransactionId = transactions.get(i).getId();\n\t\t\t\t\treturn traRepo.findById(transactionId);\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t}\n\t\t\treturn Optional.empty();\n\t\t}", "@Override\n\t\tpublic List<AccountTransaction> findAll() {\n\t\t\treturn null;\n\t\t}", "@Override\r\n\tpublic List<Trainee> getAll() {\n\t\treturn dao.getAll();\r\n\t}", "@RequestMapping(value = \"/all\")\n public List<Account> getAll(){\n return new ArrayList<>(accountHelper.getAllAccounts().values());\n }", "public lnrpc.Rpc.TransactionDetails getTransactions(lnrpc.Rpc.GetTransactionsRequest request) {\n return blockingUnaryCall(\n getChannel(), getGetTransactionsMethod(), getCallOptions(), request);\n }", "@RequestMapping(value = \"/customer-addres\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<CustomerAddres> getAllCustomerAddres() {\n log.debug(\"REST request to get all CustomerAddres\");\n List<CustomerAddres> customerAddres = customerAddresRepository.findAll();\n return customerAddres;\n }", "@Transactional\n\tpublic Set<TransactionTable> findAllTransactions() {\n\t\t List<TransactionTable> list = new ArrayList<TransactionTable>();\n\t TypedQuery<TransactionTable> query = entityManager.createNamedQuery(\"TransactionTable.findAll\", TransactionTable.class);\n\t list = query.getResultList();\n\t Set<TransactionTable> TransactionSet = new HashSet<TransactionTable>(list);\n\t return TransactionSet;\n\t\n\t}", "@RequestMapping(value = \"/Reservation/{reservation_reservationId}/transactionses\", method = RequestMethod.GET)\n\t@ResponseBody\n\tpublic List<Transactions> getReservationTransactionses(@PathVariable Integer reservation_reservationId) {\n\t\treturn new java.util.ArrayList<Transactions>(reservationDAO.findReservationByPrimaryKey(reservation_reservationId).getTransactionses());\n\t}", "@GetMapping(\"/act-kodus\")\n @Timed\n public List<ActKodu> getAllActKodus() {\n log.debug(\"REST request to get all ActKodus\");\n return actKoduRepository.findAll();\n }", "public List<Buy> getAll() throws PersistException;", "public List<Transaction> getAllDepositTransactions(int start, int numOfRows) throws MiddlewareQueryException;", "public com.google.common.util.concurrent.ListenableFuture<lnrpc.Rpc.TransactionDetails> getTransactions(\n lnrpc.Rpc.GetTransactionsRequest request) {\n return futureUnaryCall(\n getChannel().newCall(getGetTransactionsMethod(), getCallOptions()), request);\n }", "public @ResponseBody List<Contract> getAllContract();", "@GetMapping(value=\"/all\",produces= { MediaType.APPLICATION_JSON_VALUE })\n\tpublic List<TaskDTO> getAllTasks()\n\t{ \t\n\t\treturn taskService.getAllTasks();\n\t}", "@RequestMapping(value = \"/viewAllBank\", method = RequestMethod.GET)\n\tpublic List<Bank> viewAllBank() {\n\t\tAtmDAO ad = new AtmDAO();\n\t\tList<Bank> listBank = ad.getAllBank();\n\t\treturn listBank;\n\t}", "@GetMapping(\"/view-all-order\")\n\tpublic List<OrderDTO> viewAllOrders() {\n\t\tLOGGER.info(\"view-all-Order URL is opened\");\n\t\tLOGGER.info(\"view-all-Order() is initiated\");\n\t\tLOGGER.info(\"view-all-Order() has executed\");\n\t\treturn orderService.getAllOrders();\n\t}", "@GET\n @Produces(\"application/hal+json\")\n public Response list(@PathParam(\"regNo\") String regNo, @PathParam(\"accountNo\") String accountNo) {\n Optional<Account> account = admin.findAccount(regNo, accountNo);\n if (account.isPresent()) {\n CacheControl cc = new CacheControl();\n cc.setMaxAge(10);\n return Response.ok(entityBuilder.buildTransactionsJson(account.get(), uriInfo)).cacheControl(cc).build();\n } else {\n return Response.status(Response.Status.NOT_FOUND).build();\n }\n }", "@GetMapping(\"/payment-infos\")\n @Timed\n public List<PaymentInfoDTO> getAllPaymentInfos() {\n log.debug(\"REST request to get all PaymentInfos\");\n return paymentInfoService.findAll();\n }", "@Transactional(readOnly = true)\n public List<Currency> findAll() {\n log.debug(\"Request to get all Currencies\");\n return currencyRepository.findAll();\n }", "@Override\n @Transactional\n public List getAll() {\n return routDAO.getAll();\n }", "public static void getUserTransactions(String id) {\n APICalls invocations = getRetrofitEngine().create(APICalls.class);\n Call<UserTransactionsDAO> call = invocations.getUserTransactions();\n call.enqueue(new retrofit2.Callback<UserTransactionsDAO>() {\n @Override\n public void onResponse(Call<UserTransactionsDAO> call, Response<UserTransactionsDAO> response) {\n BankCraftApplication.getInstance().getEventBus().post(new GetUserTransactionsResponseEvent(response.body()));\n }\n\n @Override\n public void onFailure(Call<UserTransactionsDAO> call, Throwable t) {\n BankCraftApplication.getInstance().getEventBus().post(new GetUserTransactionsResponseEvent(t.getMessage()));\n }\n });\n }", "@SuppressWarnings(\"unchecked\")\n @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED)\n public List<Reservations> getAll() {\n Session s = sessionFactory.getCurrentSession();\n Query hql = s.createQuery(\"From Reservations\");\n return hql.list();\n }", "public List<Transaction> readByTransactionId(int transactionId) throws TransactionNotFoundException {\n\t\treturn transactionDAO.selectByTransactionId(transactionId);\n\t}", "public void printTransactions() {\n for (int i = 0; i < transactions.size(); i++) {\n\t\t\tint indeks = i+1;\n\t\t\tSystem.out.println(\"Transactions \" + indeks + \": \" + transactions.get(i).getType() + \" \" + transactions.get(i).getAmount());\n\t\t}\n }", "@GET\n public GridResponse<UsuarioDTO> getAll() {\n return service.getAll();\n }", "@GET\n\t@Path(\"/getAll\")\n\t@Produces(MediaType.TEXT_XML)\n\tpublic String getXmlAccounts() {\n\t\tString res = \"<?xml version=\\\"1.0\\\"?>\" + \"\\n\" + \"<TRANSFER>\";\n\n\t\tVector<Account> vs = MyAccountDAO.getAllAccounts();\n\n\t\tfor (int i = 0; i < vs.size(); i++) {\n\t\t\tres += vs.elementAt(i).toXml();\n\t\t}\n\t\tres += \"</TRANSFER>\";\n\t\treturn res;\n\t}", "@GetMapping(\"/{id}\")\n\tpublic Transaction getTransactionById(@PathVariable Long id) {\n\t\tTransaction transaction = null;\n\t\t\n\t\ttry {\n\t\t\ttransaction = transactionService.getTransactionById(id);\n\t\t}\n\t\tcatch (TransactionNotFoundException e) {\n\t\t\tthrow new TransactionNotFoundException(id);\n\t\t}\n\t\tcatch (UserDoesNotOwnResourceException e) {\n\t\t\tthrow new UserDoesNotOwnResourceException();\n\t\t}\n\t\t\n\t\treturn transaction;\n\t}", "@GetMapping(\"/terrenos\")\n @Timed\n public List<Terreno> getAllTerrenos() {\n log.debug(\"REST request to get all Terrenos\");\n List<Terreno> terrenos = terrenoRepository.findAll();\n return terrenos;\n }", "@JsonProperty(\"transaction\")\n public List<Transaction> getTransactionList() {\n return this.transactionList;\n }", "public Transaction getTransactionById(Integer id) throws MiddlewareQueryException;", "@RequestMapping(value=\"/tasks\", method = RequestMethod.GET)\npublic @ResponseBody List<Task> tasks(){\n\treturn (List<Task>) taskrepository.findAll();\n}", "@RequestMapping(method = RequestMethod.GET)\n public ModelAndView start(\n @RequestParam final Map<String, String> queryParameters,\n\t\tfinal HttpServletRequest request\n ) {\n \n final Optional<ActiveUserEntity> activeUserEntity = this.getCurrentUser(request);\n if(!activeUserEntity.isPresent()){\n return this.buildInvalidSessionResponse();\n }\n \n\n final ModelAndView modelAndView =\n this.setErrorMessageFromQueryString(\n new ModelAndView(ViewNames.TRANSACTION_DETAIL.getViewName()),\n queryParameters);\n modelAndView.addObject( //TODO: Do we need the user to be elevated?\n ViewModelNames.IS_ELEVATED_USER.getValue(),\n this.isElevatedUser(activeUserEntity.get()));\n \n try {\n modelAndView.addObject(\n ViewModelNames.PRODUCTS.getValue(),\n this.productsQuery.execute());\n } catch (final Exception e) {\n modelAndView.addObject(\n ViewModelNames.ERROR_MESSAGE.getValue(),\n e.getMessage());\n modelAndView.addObject(\n ViewModelNames.PRODUCTS.getValue(),\n (new Product[0]));\n }\n final List<TransactionEntry> transactionEntries;\n long totalPrice = 0L;\n double totalQuantity = 0.0;\n try {\n transactionEntries = this.transactionEntriesQuery.execute();\n final List<TransactionEntry> actualTransactionEntries = new LinkedList<>();\n //all transactionentris with all 0 transactionIds are current transaction, this removes all others\n for (int i = 0; i < transactionEntries.size(); i++)\n {\n UUID defaultUUID = UUID.fromString(\"00000000-0000-0000-0000-000000000000\");\n //System.out.println(\"in the \" + i + \" loop\");\n if(defaultUUID.equals(transactionEntries.get(i).getTransactionId()))\n {\n //System.out.println(\"the \" + i + \" has the \" + transactionEntries.get(i).getTransactionId().toString() + \"yeet\");\n //System.out.println(\"removing \" + i + \" from the list\");\n actualTransactionEntries.add(transactionEntries.get(i));\n totalPrice += (transactionEntries.get(i).getPrice() * transactionEntries.get(i).getQuantity());\n totalQuantity += transactionEntries.get(i).getQuantity();\n }\n\n }\n modelAndView.addObject(\"totalPrice\", totalPrice);\n modelAndView.addObject(\"totalQuantity\", totalQuantity);\n modelAndView.addObject(\n ViewModelNames.TRANSACTION_ENTRIES.getValue(),\n actualTransactionEntries);\n } catch (final Exception e) {\n modelAndView.addObject(\n ViewModelNames.ERROR_MESSAGE.getValue(),\n e.getMessage());\n modelAndView.addObject(\n ViewModelNames.TRANSACTION_ENTRIES.getValue(),\n (new TransactionEntry[0]));\n }\n\n\n\n modelAndView.addObject(\n ViewModelNames.TRANSACTION.getValue(),\n (new Transaction()));\n \n return modelAndView;\n }", "@GetMapping(\"/api/rents\")\r\n public ResponseEntity<List<Rent>> findAll(){\r\n final List<Rent> rentList = rentService.findAll();\r\n return rentList != null && !rentList.isEmpty()\r\n ? new ResponseEntity<>(rentList, HttpStatus.OK)\r\n : new ResponseEntity<>(HttpStatus.NOT_FOUND);\r\n }", "@GetMapping(\"/customers\")\n public List<Customer> findAll()\n {\n return customerService.findAll();\n }", "public static Response controllerGetFutureTransactions(\n Account account,\n Token authorization\n ) {\n if (userOwnsAccount(account.accountId, authorization.userId) == null) {\n return new Response(\n 401,\n Router.AUTHENTICATION_ERROR,\n Response.ResponseType.TEXT\n );\n }\n try {\n ArrayList<FutureTransaction> transactions = TransactionDatabase.retrieveFutureTransactions(\n account.accountId\n );\n return new Response(200, transactions, Response.ResponseType.JSON);\n } catch (SQLException e) {\n return new Response(500, SQL_ERROR, Response.ResponseType.TEXT);\n }\n }", "@RequestMapping(value = \"\", method = RequestMethod.GET)\n public ArrayList<Invoice> getAllInvoice() {\n return DatabaseInvoicePostgre.getAllInvoice();\n }", "public List<SeatEntity> getAll();", "public ArrayList<Transaction> getTransactions() throws SQLException {\n return transactions.getAll();\n }", "@Override\n public List list() throws TransactionException {\n return hibernateQuery.list();\n }", "@RequestMapping(method = RequestMethod.POST, value = \"/viewAllCustomer\", consumes = \"application/json\")\n\tpublic ResponseEntity<List<CustomerDaoBean>> viewuser(){\n\t\tList<CustomerDaoBean> beans = payService.viewdetails();\n\t\treturn ResponseEntity.accepted().body(beans);\n\t}", "public ArrayList<Transaction> GetUserTransactions(int UserID);", "public List<CustomerPurchase> getAll() throws SQLException;", "@RequestMapping(value = \"/rest/accesss\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Access> getAll() {\n log.debug(\"REST request to get all Accesss\");\n return accessRepository.findAll();\n }", "public List<HCLFieldTransaction> getAllTransactionListService()\r\n\t\t\tthrows JsonProcessingException, MalformedURLException, IOException {\r\n\t\tlogger.info(\"Logger Name: getAllTransactionListService() :: \" + logger.getName());\r\n\t\tObjectMapper mapper = new ObjectMapper();\r\n\r\n\t\tlogger.info(\"Open Bank API URL :: getTotalAmountbyTransactionType() :: \"\r\n\t\t\t\t+ TransactionConstant.THIRD_PARTY_REST_API);\r\n\t\tJsonNode root = mapper.readTree(new URL(TransactionConstant.THIRD_PARTY_REST_API));\r\n\r\n\t\tList<HCLFieldTransaction> transactionList = new ArrayList<HCLFieldTransaction>();\r\n\r\n\t\t/* Traversing Nested JSON node to publish the relevant data */\r\n\t\ttry {\r\n\t\t\tJsonNode transactionsNodes = root.path(\"transactions\");\r\n\r\n\t\t\tfor (JsonNode transactionsNode : transactionsNodes) {\r\n\r\n\t\t\t\tHCLFieldTransaction hclFieldTransaction = new HCLFieldTransaction();\r\n\t\t\t\thclFieldTransaction.setId(transactionsNode.path(\"id\").asText());\r\n\r\n\t\t\t\tJsonNode thisAccount_Node = transactionsNode.path(\"this_account\");\r\n\t\t\t\thclFieldTransaction.setAccountId(thisAccount_Node.path(\"id\").asText());\r\n\r\n\t\t\t\tJsonNode otherAccount_Node = transactionsNode.path(\"other_account\");\r\n\t\t\t\thclFieldTransaction.setCounterpartyAccount(otherAccount_Node.path(\"number\").asText());\r\n\r\n\t\t\t\tJsonNode otherAccount_holder_Node = otherAccount_Node.path(\"holder\");\r\n\t\t\t\thclFieldTransaction.setCounterpartyName(otherAccount_holder_Node.path(\"name\").asText());\r\n\t\t\t\tJsonNode metadata = otherAccount_Node.path(\"metadata\");\r\n\t\t\t\thclFieldTransaction.setCounterPartyLogoPath(metadata.path(\"open_corporates_URL\").asText());\r\n\r\n\t\t\t\tJsonNode details = transactionsNode.path(\"details\");\r\n\t\t\t\thclFieldTransaction.setTransactionType(details.path(\"type\").asText());\r\n\t\t\t\thclFieldTransaction.setDescription(details.path(\"description\").asText());\r\n\r\n\t\t\t\tJsonNode value = details.path(\"value\");\r\n\t\t\t\thclFieldTransaction.setInstructedAmount(value.path(\"amount\").asDouble());\r\n\r\n\t\t\t\thclFieldTransaction.setInstructedCurrency(value.path(\"currency\").asText());\r\n\r\n\t\t\t\thclFieldTransaction.setTransactionAmount(value.path(\"amount\").asDouble());\r\n\t\t\t\thclFieldTransaction.setTransactionCurrency(value.path(\"currency\").asText());\r\n\t\t\t\tlogger.debug(\"Transaction Field Row Value:: \" + hclFieldTransaction.toString());\r\n\r\n\t\t\t\t/* Adding all transaction list into one ArrayList */\r\n\t\t\t\ttransactionList.add(hclFieldTransaction);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"Exception : getAllTransactionListService() :: \", e);\r\n\t\t}\r\n\t\tlogger.info(\r\n\t\t\t\t\"Return value from service layer :: getAllTransactionListService() :: \" + transactionList.toString());\r\n\t\treturn transactionList;\r\n\t}", "List<TransactionType> listClientTransactionTypes();", "@Transactional(readOnly = true)\n public List<UsuarioEncuesta> findAll() {\n log.debug(\"Request to get all UsuarioEncuestas\");\n return usuarioEncuestaRepository.findAll();\n }", "@GetMapping(\"/rent\")\n public ResultEntity<List<ItemDTO>> getAllRent()\n {\n\n return itemService.getItemsBySubCategory(ConstantUtil.TYPE_SALE_RENT,\"Rent\");\n }", "Collection<Account> getAll();", "@GET\n @Path(\"{id}\")\n @Produces(\"application/hal+json\")\n public Response get(@PathParam(\"regNo\") String regNo, @PathParam(\"accountNo\") String accountNo, @PathParam(\"id\") String id) {\n Optional<Transaction> transaction = admin.findTransaction(regNo, accountNo, id);\n if (transaction.isPresent()) {\n CacheControl cc = new CacheControl();\n cc.setMaxAge(24 * 60 * 60);\n return Response.ok(entityBuilder.buildTransactionJson(transaction.get(), uriInfo)).cacheControl(cc).build();\n } else {\n return Response.status(Response.Status.NOT_FOUND).build();\n }\n }", "@RequestMapping(value=\"/treenit\", method = RequestMethod.GET)\n\tpublic @ResponseBody List<Treeni> treeniListaRest() {\t\n\t return (List<Treeni>) repository.findAll();\n\t}", "public Iterator getTransactions() {\n return (transactions.listIterator());\n }", "@RequestMapping(value = \"/details\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Detail> getAllDetails() {\n log.debug(\"REST request to get all Details\");\n List<Detail> details = detailRepository.findAll();\n return details;\n }", "public List<Transaction> readByAccountId(int accountId) throws TransactionNotFoundException {\n\t\treturn transactionDAO.selectByAccountId(accountId);\n\t}", "@GetMapping(\"/getAllRecords\")\n public ResponseEntity< List<Record> > getAllRecords(){\n return ResponseEntity.ok().body(this.recordService.getAllRecords());\n }", "@GetMapping(value = CustomerRestURIConstants.GET_ALL_CUSTOMER )\n\tpublic ResponseEntity<List<Customer>> list() {\n\t\tList<Customer> customers = customerService.getAllCustomers();\n\t\treturn ResponseEntity.ok().body(customers);\n\t}", "@Override\r\n\tpublic List<Transaction> getTransactions() {\n\t\treturn null;\r\n\t}", "@GetMapping(\"/\")\n public ResponseEntity<List<BillProjection>> getBillAll() {\n List<BillProjection> bills = billController.getBillAll();\n if (bills.size() > 0) {\n return ResponseEntity.ok().body(bills);\n } else {\n return ResponseEntity.noContent().build();\n }\n }", "public TransactionDetailResp transaction_show(String txId) throws Exception {\n String s = main(\"transaction_show\", \"[{\\\"txid\\\":\\\"\" + txId +\"\\\"}]\");\n return JsonHelper.jsonStr2Obj(s, TransactionDetailResp.class);\n }", "public List<Consulta> getAll() throws BusinessException;", "@Override\n @Transactional(readOnly = true)\n public List<SintomaDTO> findAll() {\n log.debug(\"Request to get all Sintomas\");\n return sintomaRepository.findAll().stream()\n .map(sintomaMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@GetMapping(\"/loan\")\n @Timed\n public ResponseEntity<List<Loan>> getAllLoans() {\n log.debug(\"REST request to get all ILoan\");\n List<Loan> loans = loanService.findAll();\n return new ResponseEntity<>(loans, null, HttpStatus.OK);\n }", "@GetMapping(\"/accounts\")\n public List<Account> getAccounts() {\n Iterable<Account> accounts = repository.findAll(Sort.by(\"name\"));\n return StreamSupport.stream(accounts.spliterator(), false).collect(Collectors.toList());\n }", "@GET\n\t@Path(\"/getAll\")\n\t@Produces(MediaType.TEXT_HTML)\n\tpublic String getHtmlAccounts() {\n\t\tString res = \"<html> \" + \"<title>\" + \"Hello Jersey\" + \"</title>\" + \"<body>\";\n\n\t\tVector<Account> vs = MyAccountDAO.getAllAccounts();\n\t\tif ((vs == null) || (vs.size() == 0)) {\n\t\t\tres += \"<h1>No TRANSFERS available</h1>\\n\";\n\t\t} else {\n\t\t\tfor (int i = 0; i < vs.size(); i++) {\n\t\t\t\tres += \"<h1>\" + vs.elementAt(i) + \"</h1>\\n\";\n\t\t\t}\n\t\t}\n\t\tres += \"</body>\";\n\t\tres += \"</html>\";\n\t\treturn res;\n\n\t}" ]
[ "0.7343916", "0.7313739", "0.7094882", "0.70655245", "0.6966181", "0.6874268", "0.68548983", "0.68515366", "0.68286467", "0.675592", "0.67163485", "0.6679181", "0.66709626", "0.65883905", "0.6526077", "0.6523126", "0.6518794", "0.6513581", "0.64999866", "0.6484475", "0.64565164", "0.64355797", "0.63719314", "0.6368341", "0.63410836", "0.63399917", "0.6330177", "0.630642", "0.63022083", "0.62981683", "0.6277734", "0.62408626", "0.6226787", "0.6226257", "0.6206805", "0.61998445", "0.61993986", "0.6196451", "0.6180739", "0.6155026", "0.6129977", "0.6127957", "0.61251485", "0.6123048", "0.6105366", "0.61029226", "0.6098877", "0.6087631", "0.607445", "0.6061916", "0.604524", "0.604349", "0.60391784", "0.6037557", "0.6035849", "0.60268843", "0.60148257", "0.6009981", "0.59894854", "0.59733623", "0.59546703", "0.5949956", "0.5924939", "0.5924301", "0.5918658", "0.5904382", "0.5895653", "0.58945143", "0.58865523", "0.5885326", "0.58835745", "0.5880041", "0.58657044", "0.5858028", "0.5846902", "0.5834163", "0.5828052", "0.58151203", "0.5808867", "0.58039093", "0.57990605", "0.5794745", "0.57919014", "0.5791062", "0.5789469", "0.5781859", "0.5776692", "0.57760155", "0.5769524", "0.57654524", "0.5763363", "0.57587284", "0.57426304", "0.5739562", "0.57377374", "0.5730185", "0.57265943", "0.57255477", "0.572251", "0.5722088" ]
0.7898975
0
RESTful to get a transaction by id
@GetMapping("/rest/{id}") public @ResponseBody Optional<Transaction> findTranscationRest(@PathVariable("id") Long transactionId) { UserDetails user = (UserDetails) SecurityContextHolder.getContext() .getAuthentication().getPrincipal(); String username = user.getUsername(); User currentUser = userRepo.findByUsername(username); List<Transaction> transactions = traRepo.findByUser(currentUser); for(int i = 0; i < transactions.size(); i++) { if(transactions.get(i).getId() == transactionId) { transactionId = transactions.get(i).getId(); return traRepo.findById(transactionId); } } return Optional.empty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Transaction getById(String id) throws Exception;", "@RequestMapping(value = \"/transactionservice/transaction/{transaction_id}\", method=RequestMethod.GET, produces = \"application/json\")\n\t@ResponseBody\n\tpublic Transaction getTransaction(@PathVariable long transaction_id) {\n\t\tif(transactions.size() > transaction_id) {\n\t\t\treturn transactions.get((int) transaction_id);\n\t\t} else {\n\t\t\tthrow new TransactionNotFoundException(transaction_id);\n\t\t}\n\t}", "@GetMapping(\"/{id}\")\n\tpublic Transaction getTransactionById(@PathVariable Long id) {\n\t\tTransaction transaction = null;\n\t\t\n\t\ttry {\n\t\t\ttransaction = transactionService.getTransactionById(id);\n\t\t}\n\t\tcatch (TransactionNotFoundException e) {\n\t\t\tthrow new TransactionNotFoundException(id);\n\t\t}\n\t\tcatch (UserDoesNotOwnResourceException e) {\n\t\t\tthrow new UserDoesNotOwnResourceException();\n\t\t}\n\t\t\n\t\treturn transaction;\n\t}", "Transaction get(String id) throws Exception;", "public Transaction getTransactionById(Integer id) throws MiddlewareQueryException;", "@GET\n @Path(\"{id}\")\n @Produces(\"application/hal+json\")\n public Response get(@PathParam(\"regNo\") String regNo, @PathParam(\"accountNo\") String accountNo, @PathParam(\"id\") String id) {\n Optional<Transaction> transaction = admin.findTransaction(regNo, accountNo, id);\n if (transaction.isPresent()) {\n CacheControl cc = new CacheControl();\n cc.setMaxAge(24 * 60 * 60);\n return Response.ok(entityBuilder.buildTransactionJson(transaction.get(), uriInfo)).cacheControl(cc).build();\n } else {\n return Response.status(Response.Status.NOT_FOUND).build();\n }\n }", "BusinessTransaction get(String tenantId, String id);", "Transaction findTransactionById(Long id);", "Transaction getTransctionByTxId(String txId);", "public Optional<Transaction> findTransactionById(int id);", "@Override\n\tpublic ResponseEntity<?> get(Long id) {\n\t\treturn ResponseEntity.ok(service.deposit.get(id));\n\t}", "@GET\n @Path(\"{id}\")\n @Produces({ \"application/json\" })\n public abstract Response find(@PathParam(\"id\") Long id);", "public static void getUserTransactions(String id) {\n APICalls invocations = getRetrofitEngine().create(APICalls.class);\n Call<UserTransactionsDAO> call = invocations.getUserTransactions();\n call.enqueue(new retrofit2.Callback<UserTransactionsDAO>() {\n @Override\n public void onResponse(Call<UserTransactionsDAO> call, Response<UserTransactionsDAO> response) {\n BankCraftApplication.getInstance().getEventBus().post(new GetUserTransactionsResponseEvent(response.body()));\n }\n\n @Override\n public void onFailure(Call<UserTransactionsDAO> call, Throwable t) {\n BankCraftApplication.getInstance().getEventBus().post(new GetUserTransactionsResponseEvent(t.getMessage()));\n }\n });\n }", "public TransactionDetailResp transaction_show(String txId) throws Exception {\n String s = main(\"transaction_show\", \"[{\\\"txid\\\":\\\"\" + txId +\"\\\"}]\");\n return JsonHelper.jsonStr2Obj(s, TransactionDetailResp.class);\n }", "@GET\n @Path(\"account/transactions/{account_id}\")\n public Response getAccountTransactions(@PathParam(\"account_id\") \n String accountId) {\n \n String output = \"This entry point will return all transactions related to the account: \" + accountId;\n return Response.status(200).entity(output).build();\n \n }", "@Test\n public void retrieveTransactionTest() throws ApiException {\n Long loanId = null;\n Long transactionId = null;\n GetSelfLoansLoanIdTransactionsTransactionIdResponse response = api.retrieveTransaction(loanId, transactionId);\n\n // TODO: test validations\n }", "@Override\n\tpublic Transaction findTransactionById(int id) {\n\t\treturn null;\n\t}", "public Transaction getTransaction(int id){\n return accSystem.get(id);\n }", "public Transaction getTransactionById(int id) throws SQLException {\n String sql = \"SELECT * FROM LabStore.Transaction_Detail WHERE id = ?\";\n Transaction transaction = new Transaction();\n\n try (Connection conn = database.getConnection();\n PreparedStatement preStmt = conn.prepareStatement(sql)) {\n preStmt.setInt(1, id);\n try (ResultSet rs = preStmt.executeQuery()) {\n while (rs.next()) {\n transaction.setId(id);\n transaction.setUser(userDbManager.getUser(rs.getInt(\"uId\")));\n transaction.setPurchaseDetail(purchaseDetailDbManager\n .getPurchaseDetailById(rs.getInt(\"pdId\")));\n transaction.setCount(rs.getInt(\"count\"));\n transaction.setTime(rs.getTimestamp(\"time\"));\n }\n }\n }\n\n return transaction;\n }", "@DeleteMapping(\"/{id}\")\n\tpublic Transaction deleteTransactionById(@PathVariable Long id) {\n\t\tTransaction deletedTransaction = null;\n\t\t\n\t\ttry {\n\t\t\tdeletedTransaction = transactionService.deleteTransactionById(id);\n\t\t} \n\t\tcatch (TransactionNotFoundException e) {\n\t\t\tthrow new TransactionNotFoundException(id);\n\t\t}\n\t\tcatch (UserDoesNotOwnResourceException e) {\n\t\t\tthrow new UserDoesNotOwnResourceException();\n\t\t}\n\t\t\n\t\treturn deletedTransaction;\n\t}", "@GetMapping(\"/invoices/{invoice_number}/paytransactions/{transaction_id}\")\r\n public PayTransaction findById(@PathVariable long invoice_number, @PathVariable long transaction_id) {\n invoiceRepository.findById(invoice_number)\r\n .orElseThrow(() -> new ResourceNotFoundException(\"Invoice not found with ID: \" + invoice_number));\r\n\r\n // After validated, retrieve Pay Transaction by ID\r\n return payTransactionRepository.findById(transaction_id)\r\n .orElseThrow(() -> new ResourceNotFoundException(\"Pay transaction not found with ID: \" + transaction_id));\r\n }", "RequesterVO get(int id);", "RespuestaRest<ParqueaderoEntidad> consultar(String id);", "@Transactional(readOnly = true)\n public Optional<OrderTransactionDTO> findOne(Long id) {\n log.debug(\"Request to get OrderTransaction : {}\", id);\n return orderTransactionRepository.findById(id)\n .map(orderTransactionMapper::toDto);\n }", "@GET\n\t@Path(\"{id}\")\n\tpublic Response getOrder(@PathParam(\"id\") String id) {\n\t\t String orderJSON = null;\n\t\t try {\n\t\t \torderJSON = backend.getOrder(id);\n\t\t \t// returns a JSON string based on a UUID\n\t\t } catch ( NotFoundException e) {\n\t\t \treturn Response.status(404).entity(id).build();\n\t\t }\n\t\t return Response.status(200).entity(orderJSON).build();\n\t}", "String getTransactionID();", "String getTransactionId();", "String getTransactionId();", "@Override\n\t\tpublic AccountTransaction findById(int id) {\n\t\t\treturn null;\n\t\t}", "Purchase retrieve(Long id) throws SQLException, DAOException;", "public BookingInfoEntity getBookingById(int id, Transaction transaction) {\n BookingInfoEntity bookingInfoEntity = null;\n\n if (transaction.getPaymentMode().equalsIgnoreCase(\"UPI\") ||\n transaction.getPaymentMode().equalsIgnoreCase(\"CARD\") ) {\n Optional<BookingInfoEntity> optionalBookingInfoEntity = bookingRepository.findById(id);\n if (!optionalBookingInfoEntity.isPresent()) {\n throw new BookingIDNotFoundException(\"Invalid Booking Id\");\n } else {\n bookingInfoEntity = optionalBookingInfoEntity.get();\n transaction.setBookingId(bookingInfoEntity.getBookingId());\n\n //Call PaymentService Api\n transaction = callPaymentServiceApi(transaction);\n bookingInfoEntity.setTransactionId(transaction.getTransactionId());\n bookingInfoEntity = bookingRepository.save(bookingInfoEntity);\n try {\n \t\t\trunProducer(1, bookingInfoEntity.toString());\n \t\t} catch (InterruptedException e) {\n \t\t\te.printStackTrace(); //Internally throw 500 error\n \t\t}\n }\n } else {\n throw new InvalidPaymentModeException(\"Invalid mode of payment\");\n }\n return bookingInfoEntity;\n }", "@GetMapping(\"/payments/{id}\")\n @Timed\n public ResponseEntity<PaymentDTO> getPayment(@PathVariable Long id) {\n log.debug(\"REST request to get Payment : {}\", id);\n Optional<PaymentDTO> paymentDTO = paymentQueryService.findOne(id);\n return ResponseUtil.wrapOrNotFound(paymentDTO);\n }", "@GET\n @Path( \"transactions\" )\n void getTransactions( @QueryParam( \"orderId\" ) Long orderId,\n @QueryParam( \"invoiceId\" ) Long invoiceId,\n SuccessCallback<Items<Transaction>> callback );", "T getById(int id);", "public Transaction findTransaction(long transactionId) {\n log.trace(\"findTransaction {}\", transactionId);\n TransactionEntity entity = transactionRepository.findOne(transactionId);\n if (entity == null) {\n throw new NotFoundException(\"not found\");\n }\n\n Transaction transaction = new Transaction();\n transaction.setAmount(entity.getAmount());\n transaction.setType(entity.getType());\n if (entity.getParent() != null) {\n transaction.setParentId(entity.getParent().getId());\n }\n return transaction;\n }", "@RequestMapping(value = \"{id}\", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<?> get(@PathVariable long id) {\n Todo result = getTodoOrThrow(id);\n\n return ResponseEntity.ok(dtoConverter.convert(result));\n }", "@GetMapping(\"/payments/{id}\")\n public ResponseEntity<Payment> getPayment(@PathVariable Long id) {\n log.debug(\"REST request to get Payment : {}\", id);\n Optional<Payment> payment = paymentRepository.findById(id);\n return ResponseUtil.wrapOrNotFound(payment);\n }", "@Transactional(readOnly = true)\n public Result get(Integer id) {\n Tag tag = TagService.find(id);\n if (tag == null) {\n return util.Json.jsonResult(response(), notFound(util.Json.generateJsonErrorMessages(Messages.get(\"error.not-found\", Messages.get(\"article.female-single\"), Messages.get(\"field.tag\"), id))));\n }\n return util.Json.jsonResult(response(), ok(Json.toJson(tag)));\n }", "@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public Invoice getInvoiceById(@PathVariable int id) {\n return DatabaseInvoicePostgre.getInvoiceById(id);\n }", "@GetMapping(\"/getPaymentById2\")\n public CommonResult ResponseEntity(Long id) {\n ResponseEntity<CommonResult> entity = restTemplate.getForEntity(PAYMENT_URL + \"/getPaymentById?id=\" + id, CommonResult.class);\n if (entity.getStatusCode().is2xxSuccessful()) {\n return entity.getBody();\n }\n return new CommonResult(444, \"操作失败\");\n }", "@GetMapping(\"/cuentas/{id}\")\n @Timed\n public ResponseEntity<Cuenta> getCuenta(@PathVariable Long id) {\n log.debug(\"REST request to get Cuenta : {}\", id);\n Optional<Cuenta> cuenta = cuentaRepository.findById(id);\n return ResponseUtil.wrapOrNotFound(cuenta);\n }", "Transaction selectByPrimaryKey(Long id);", "public List<Transaction> readByTransactionId(int transactionId) throws TransactionNotFoundException {\n\t\treturn transactionDAO.selectByTransactionId(transactionId);\n\t}", "T getById(Long id);", "@RequestMapping(value = \"/translations/{id}\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<Translation> getTranslation(@PathVariable Long id) {\n log.debug(\"REST request to get Translation : {}\", id);\n Translation translation = translationRepository.findOne(id);\n return Optional.ofNullable(translation)\n .map(result -> new ResponseEntity<>(\n result,\n HttpStatus.OK))\n .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));\n }", "String get(String id);", "@Override\n\tpublic Transaction read(int id) {\n\t\treturn null;\n\t}", "public CustomerPurchase getById(Integer id) throws SQLException;", "@JsonProperty(\"id\")\n public TransactionId getId() {\n return id;\n }", "@GetMapping(\"/tlb-trade/TlbTrade/{id}\")\n @Timed\n public ResponseEntity<ResponseResult> getTlbTrade(@PathVariable String id) {\n log.debug(\"REST request to get TlbTrade : {}\", id);\n ResponseResult json = new ResponseResult();\n try {\n TlbTradeDTO sysComponentDTO = tlbTradeService.findOne(id);\n json.setData(sysComponentDTO);\n json.setStatusCode(ResponseResult.SUCCESS_CODE);\n }catch (Exception e){\n json.setStatusCode(ResponseResult.FAIL_CODE);\n }\n\n return new ResponseEntity<>(json, null, HttpStatus.OK);\n }", "T getById(ID id);", "Order getOrder(int id) throws ServiceException;", "UUID getTransactionId();", "public TransactionObj getTransaction(String sID){\n\t\treturn hmTransaction.get(sID);\n\t}", "Contract findById(int id);", "@RequestMapping(value = \"/tasks/{id}\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<TaskDTO> getTask(@PathVariable Long id) {\n log.debug(\"REST request to get Task : {}\", id);\n TaskDTO taskDTO = taskService.findOne(id);\n return Optional.ofNullable(taskDTO)\n .map(result -> new ResponseEntity<>(\n result,\n HttpStatus.OK))\n .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));\n }", "@GetMapping(\"/act-kodus/{id}\")\n @Timed\n public ResponseEntity<ActKodu> getActKodu(@PathVariable Long id) {\n log.debug(\"REST request to get ActKodu : {}\", id);\n ActKodu actKodu = actKoduRepository.findOne(id);\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(actKodu));\n }", "@GET\n @Path(\"/{accountID}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Account getAccount(@PathParam(\"accountID\") int a_id ) {\n \tSystem.out.println(\"get Account by ID: \"+a_id );\n\treturn AccountService.getAccount(a_id);\n }", "public Object getTransactionId() throws StandardException;", "T get(ID id);", "public BankThing retrieve(String id);", "@GetMapping(\"/{id}\")\n public Account account(@PathVariable(\"id\") Long id){\n return accountRepository.findOne(id);\n }", "@GET\n @Path(\"{id}\")\n @Produces(MediaType.TEXT_PLAIN)\n public String getQoute(@PathParam(\"id\") int id) {\n String quote;\n quote = quotes.get(id);\n return quote;\n }", "@RequestMapping(value = \"/estados/{id}\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<Estado> get(@PathVariable Long id, HttpServletResponse response) {\n log.debug(\"REST request to get Estado : {}\", id);\n Estado estado = estadoRepository.findOne(id);\n if (estado == null) {\n return new ResponseEntity<>(HttpStatus.NOT_FOUND);\n }\n return new ResponseEntity<>(estado, HttpStatus.OK);\n }", "public ResponseEntity<customer.controller.Customer> getCustomerById(Long id);", "@GetMapping(\"/rest\")\n\t\tpublic @ResponseBody List<Transaction> transactionsListRest() {\n\t\t\tUserDetails user = (UserDetails) SecurityContextHolder.getContext()\n\t\t\t\t\t.getAuthentication().getPrincipal();\n\t\t\tString username = user.getUsername();\n\t\t\tUser currentUser = userRepo.findByUsername(username);\n\t\t\treturn (List<Transaction>) traRepo.findByUser(currentUser);\n\t\t}", "public TransactionItem get(Long id) {\n return (TransactionItem)get(TransactionItem.class, id);\n }", "@RequestMapping(value = \"/accounts/{id}\", method = RequestMethod.GET)\n\tpublic ResponseEntity<Account> find(@PathVariable(\"id\") final Integer id) {\n\n\t\tlogger.info(\"AccountController.find: id=\" + id);\n\n\t\tAccount accountResponse = this.service.findAccount(id);\n\t\treturn new ResponseEntity<Account>(accountResponse,\n\t\t\t\tgetNoCacheHeaders(), HttpStatus.OK);\n\n\t}", "@Override\n @LogMethod\n public T get(long id) throws InventoryException {\n \tInventoryHelper.checkPositive(id, \"id\");\n T entity = repository.getByKey(id);\n InventoryHelper.checkEntityExist(entity, id);\n return entity;\n }", "@Transactional(readOnly = true)\n DataRistorante getByID(String id);", "public Transaction getTransaction(String transactionId) throws LedgerException {\n Iterator<Map.Entry<Integer, Block>> blocks = listBlocks();\n\n // Check committed Blocks\n while( blocks.hasNext() ) {\n Block block = blocks.next().getValue();\n Transaction transaction = block.getTransaction(transactionId);\n\n // Transaction was found\n if (transaction != null) {\n return transaction;\n }\n }\n\n throw new LedgerException(\"get transaction\", \"Transaction \" + transactionId + \" does not exist.\");\n }", "@GET\n @Path(\"public/transactions/{CurrencyPair}\")\n GatecoinTransactionResult getTransactions(@PathParam(\"CurrencyPair\") String CurrencyPair) throws IOException, GatecoinException;", "public TransactionResponse getTransactionByIdAndDate(String id, Date date) throws ParseException {\n TransactionResponse response = new TransactionResponse();\n Predicate<Transaction> byId = t -> t.getId().equals(id);\n Predicate<Transaction> byDate = t -> t.getDate().equals(date);\n response.setTransaction(idAndDatefilterTransaction(byDate, byId));\n return response;\n }", "@GetMapping(\"/payment-infos/{id}\")\n @Timed\n public ResponseEntity<PaymentInfoDTO> getPaymentInfo(@PathVariable Long id) {\n log.debug(\"REST request to get PaymentInfo : {}\", id);\n PaymentInfoDTO paymentInfoDTO = paymentInfoService.findOne(id);\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(paymentInfoDTO));\n }", "@RequestMapping(value = \"/customer-addres/{id}\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<CustomerAddres> getCustomerAddres(@PathVariable Long id) {\n log.debug(\"REST request to get CustomerAddres : {}\", id);\n CustomerAddres customerAddres = customerAddresRepository.findOne(id);\n return Optional.ofNullable(customerAddres)\n .map(result -> new ResponseEntity<>(\n result,\n HttpStatus.OK))\n .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));\n }", "public Ticket getTicket(String id);", "public TransactionResponse getTransactionByIdAndType(String id, String type) throws ParseException {\n TransactionResponse response = new TransactionResponse();\n Predicate<Transaction> byId = t -> t.getId().equals(id);\n Predicate<Transaction> byType = t -> t.getType().equals(type);\n response.setTransaction(idAndTypefilterTransaction(byType, byId));\n return response;\n }", "@GetMapping(\"/vehicle-tasks/{id}\")\n @Timed\n @Secured(AuthoritiesConstants.ADMIN)\n public ResponseEntity<VehicleTask> getVehicleTask(@PathVariable Long id) {\n log.debug(\"REST request to get VehicleTask : {}\", id);\n VehicleTask vehicleTask = vehicleTaskService.findOne(id);\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(vehicleTask));\n }", "T get(Integer id);", "@GetMapping(\"/consumer/payment/get/{id}\")\n //@HystrixCommand\n public CommonResult<Payment> getPayment(@PathVariable(\"id\") Long id) {\n return paymentService.getPaymentById(id);\n }", "@GetMapping(\"/view-order/{id}\")\n\tpublic ResponseEntity<Object> getOrderById(@PathVariable Long id) throws OrderNotFoundException {\n\t\tLOGGER.info(\"view-Order URL is opened\");\n\t\tLOGGER.info(\"viewOrder() is initiated\");\n\t\tOrderDTO orderDTO = orderService.getOrderById(id);\n\t\tLOGGER.info(\"viewOrder() has executed\");\n\t\treturn new ResponseEntity<>(orderDTO, HttpStatus.OK);\n\t}", "@GetMapping(\"/{id}\")\n public ResponseEntity<JsonResponse<OrderDTO>> getBasketById(@PathVariable Long id) throws Exception {\n log.info(\"REST request to get order: {}\", id);\n return new ResponseEntity<>(new JsonResponse<>(this.orderService.getOrderById(id)), HttpStatus.OK);\n }", "@Override\n //@Transactional(readOnly = true)\n public ProjectTransactionRecordDTO findOne(Long id) {\n log.debug(\"Request to get ProjectTransactionRecord : {}\", id);\n ProjectTransactionRecord projectTransactionRecord = projectTransactionRecordRepository.findOne(id);\n return projectTransactionRecordMapper.toDto(projectTransactionRecord);\n }", "public long getTransactionId();", "@GET\n @Path(\"{id}\")\n @JWTTokenNeeded\n @Produces({MediaType.APPLICATION_JSON})\n public EscenarioDTO getById(@PathParam(\"id\") int id) {\n logger.log(Level.INFO, \"id:{0}\", id);\n Escenario entidad = managerDAO.find(id);\n return entidad.toDTO();\n\n }", "Account getAccount(int id);", "@RequestMapping(method=RequestMethod.GET, value = \"/item/{id}\", produces = \"application/json\")\n public Item getItem(@PathVariable (name = \"id\") UUID id)\n {\n return this.itemRepository.getItem(id);\n }", "java.lang.String getTxId();", "@GetMapping(\"/{id}\")\n\tpublic ResponseEntity<Contato> getById(@PathVariable long id) \n\t{\n\t\tContato contato = contatoService.getById(id);\n\n\t\tif(contato == null) \n\t\t{\n\t\t\treturn ResponseEntity.notFound().build();\n\t\t}\n\t\treturn ResponseEntity.ok(contato);\n\t}", "public Set<Transaction> getTransactionsByLotId(Integer id) throws MiddlewareQueryException;", "@GetMapping(\"/accounts/{id}\")\n\tpublic ResponseEntity<Account> findById(@PathVariable(\"id\") int id){\n\t\tAccount body = this.accService.findById(id);\n\t\tResponseEntity<Account> response = new ResponseEntity<Account>(body, HttpStatus.OK);\n\t\treturn response;\n\t}", "@GetMapping(\"/transport-methods/{id}\")\n @Timed\n public ResponseEntity<TransportMethod> getTransportMethod(@PathVariable UUID id) {\n log.debug(\"REST request to get TransportMethod : {}\", id);\n Optional<TransportMethod> transportMethod = transportMethodService.findOne(id);\n return ResponseUtil.wrapOrNotFound(transportMethod);\n }", "Long getAmount(Integer id) throws Exception;", "@RequestMapping(method = RequestMethod.GET, value = \"/{id}\")\n\t public ResponseEntity<Customer> getCustomerWithId(@PathVariable Long id) {\n\t return service.getCustomerWithId(id);\n\t }", "@Override\n\tpublic ResponseObject<ActivityDTO> getById(Long id) {\n\t\ttry{\n\t\t\treturn createResponse(createDTO(activityDAO.findById(id).get()), SUCCESS_MESSAGE, null);\n\t\t}catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn createResponse(null, ERROR_MESSAGE, e);\n\t\t}\n\t}", "T get(PK id);", "@Path(\"{id}\") //Dizendo que vou receber um parametro da requisicao que vai vir pela uri\r\n\t@GET //Digo que esse metodo deve ser acessado usando GET\r\n\t@Produces(MediaType.APPLICATION_XML) //Digo que qual eh tipo do retorno,nesse caso XML\r\n\tpublic String busca( @PathParam (\"id\") long id ){\n\t\tCarrinho carrinho = new CarrinhoDAO().busca( id );\r\n\t\t\r\n\t\t\r\n\t\t//retorna um XML do objeto pego\r\n\t\treturn carrinho.toXML();\r\n\t\t\r\n\t}", "@Transactional(readOnly = true)\n public Reservations getById(int id) {\n Session session = sessionFactory.getCurrentSession();\n return (Reservations) session.get(Reservations.class, id);\n }", "@GET\n @Path(\"/id/{id}\")\n public Book findById(@PathParam(\"id\") long id) {\n return new Book();\n }", "@Override\n\tpublic Recipe getRecipe(int id) {\n\t\tRestTemplate restTemplate = new RestTemplate();\n\t\t\n\t\tResponseEntity<Recipe> rateResponse =\n\t\t restTemplate.exchange(BASE_URL + RECIPE_URL + id, HttpMethod.GET, \n\t\t \t\tnull, new ParameterizedTypeReference<Recipe>() {\n\t\t });\n\t\tRecipe recipe = rateResponse.getBody();\n\t\tlogger.debug(\"RECIPE Info :\" + recipe);\n\t\treturn recipe;\n\t}" ]
[ "0.8072414", "0.8043043", "0.7943884", "0.7901474", "0.78758115", "0.7616917", "0.72370726", "0.72348803", "0.71285486", "0.71146595", "0.6763936", "0.67109084", "0.66835016", "0.66438895", "0.6592482", "0.6445179", "0.64408946", "0.6436088", "0.63996035", "0.63264394", "0.6309561", "0.6300575", "0.6254732", "0.62102246", "0.61994094", "0.618143", "0.616364", "0.616364", "0.61300904", "0.6120171", "0.6115763", "0.61141604", "0.61054415", "0.6099751", "0.6093264", "0.6087237", "0.6074825", "0.6063677", "0.6059275", "0.60480493", "0.604709", "0.60445964", "0.60409117", "0.6035835", "0.60316086", "0.6022103", "0.60205275", "0.6020187", "0.6019384", "0.6017143", "0.6015778", "0.60151917", "0.6005998", "0.6001913", "0.600031", "0.5992744", "0.59815", "0.5976951", "0.5975002", "0.5971376", "0.5963377", "0.5958449", "0.59517944", "0.5942545", "0.59279317", "0.59261554", "0.59223384", "0.59214103", "0.5920309", "0.5916844", "0.59112257", "0.5897234", "0.5888198", "0.58776176", "0.5874679", "0.5874213", "0.5871393", "0.5864928", "0.5857797", "0.5853962", "0.5842237", "0.5835599", "0.583439", "0.5821071", "0.5818593", "0.58184355", "0.5816185", "0.58144665", "0.580665", "0.58060324", "0.58059955", "0.5799392", "0.5791205", "0.578457", "0.57814276", "0.5776849", "0.57739866", "0.5771992", "0.5768085", "0.5764543" ]
0.7733206
5
Program to print duplicate characters from String
public static void main(String[] args) { String s1 = "ShivaniKashyap"; char[] chararray = s1.toCharArray(); LinkedHashSet set = new LinkedHashSet(); LinkedHashSet newset = new LinkedHashSet(); for(int i=0;i<chararray.length;i++) { if( !set.add(chararray[i])) { newset.add(chararray[i]); } } System.out.println(newset); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void printDuplicateCharacters(String word) {\r\n\t\tchar[] characters = word.toCharArray();\r\n\t\t// build HashMap with character and number of times they appear in\r\n\t\tMap<Character, Integer> charMap = new HashMap<Character, Integer>();\r\n\t\tfor (Character ch : characters) {\r\n\t\t\tif (charMap.containsKey(ch)) {\r\n\t\t\t\tcharMap.put(ch, charMap.get(ch) + 1);\r\n\t\t\t} else {\r\n\t\t\t\tcharMap.put(ch, 1);\r\n\t\t\t}\r\n\t\t} // Iterate through HashMap to print all duplicate characters of String\r\n\t\tSet<Map.Entry<Character, Integer>> entrySet = charMap.entrySet();\r\n\t\tSystem.out.printf(\"List of duplicate characters in String '%s' %n\", word);\r\n\t\tfor (Map.Entry<Character, Integer> entry : entrySet) {\r\n\t\t\tif (entry.getValue() > 1) {\r\n\t\t\t\tSystem.out.printf(\"%s : %d %n\", entry.getKey(), entry.getValue());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void nonRepeatingCharacter(String s)\n\t{\n\t\tMap<Character, Integer> charMap = new LinkedHashMap<>();\n\t\tCharacter unique = null;\n\t\tchar[] stringArray = s.toCharArray();\n\t\tint repeat =0;\n\t\tfor(int i=0; i< stringArray.length; i++ )\n\t\t{\n\t\t\tif(!charMap.keySet().contains(stringArray[i]))\n\t\t\t{\n\t\t\t\tcharMap.put(stringArray[i], 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tInteger value = charMap.get(stringArray[i]);\n\t\t\t\tvalue++;\n\t\t\t\tcharMap.put(stringArray[i], value);\n\t\t\t}\n\t\t}\n\t\t//System.out.println(charMap.toString());\n\t\tfor(Character i : charMap.keySet())\n\t\t{\n\t\t\tint value = charMap.get(i);\n\t\t\tif(value == 1)\n\t\t\t{\n\t\t\t\tunique = i;\n\t\t\t\t//System.out.println(\"found unique \"+ unique);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i< stringArray.length; i++ )\n\t\t{\n\t\t\tif(unique!= null && stringArray[i] == unique)\n\t\t\t{\n\t\t\t\tSystem.out.println(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args){\n\t\tString str=\"Automation\";\r\n\t\tint count=0;\r\n\t\tchar[] ch=str.toCharArray();//ch={w,3,S,c,h,o,o,l,s}\r\n\t\tSystem.out.println(ch);\r\n\t\tfor(int i=0; i<ch.length-1; i++){\r\n\t\tfor(int j=i+1; j<=ch.length-1; j++){\r\n\t\t\tif(ch[i]==ch[j]){\r\n\t\t\t\tSystem.out.print(\"Duplicate chars are : \" +ch[i]);\r\n\t\t\t\tSystem.out.println();\r\n\t\t\r\n\t\tcount++;\r\n\t\t\r\n\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\t\r\n\t\tSystem.out.println(\"The no of duplicate chars are: \" +count);\r\n\t}", "public static void printDuplicate(String str){\n\t\t\n\t\tString[] strArray = str.split(\" \");\n\t\t\n\t\tHashMap<String, Integer> hm = new HashMap<>();\n\t\t\n\t\t/*for(String tempString : strArray){\n\t\t\tif(hm.containsKey(strArray[i])){\n\t\t\t\t\n\t\t\t\thm.put(strArray[i], hm.get(strArray[i])+1);\n\t\t\t}else{\n\t\t\t\thm.put(strArray[i], 1);\n\t\t\t}\n\t\t}*/\n\t\t\n\t\t//or\n\t\t\n\t\tfor(int i=0; i<strArray.length; i++){\n\t\t\t\n\t\t\tif(hm.containsKey(strArray[i])){\n\t\t\t\t\n\t\t\t\thm.put(strArray[i], hm.get(strArray[i])+1);\n\t\t\t}else{\n\t\t\t\thm.put(strArray[i], 1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(hm);\n\t\t\n\t\tfor (Map.Entry<String, Integer> entry : hm.entrySet()) {\n\t\t\tif(entry.getValue()>1){\n\t\t\t\tSystem.out.print(\"Item : \" + entry.getKey() + \" Count : \" + entry.getValue());\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t//java 8 iteration\n\t\thm.forEach((k,v)->{\n\t\t\t//System.out.println(\"Item : \" + k + \" Count : \" + v);\n\t\t\t\n\t\t\tif(v > 1){\n\t\t\t\t\n\t\t\t\tSystem.out.println(k +\" \" + v);\n\t\t\t}\n\t\t});\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tString s=\"hello world lokl\";\n\t\tchar[] chararray=s.toCharArray();\n\t\tSet<Character> set = new HashSet<Character>();\n\t\t//hashset is implementation of set interface\n\t\t\n\t\tint ctr=0;\n\t\tfor(int i=0; i<chararray.length;i++)\n\t\t{\n\t\t\tif(!set.add(chararray[i]))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"index of duplicate char-\" + chararray[i]+\" \" +i);\n\t\t\t\tctr++;\n\t\t\t}\n\n\n\t\t}\n\t\t\n\t\tSystem.out.println(\"total no of duplicate characters\"+ ctr);\n\t\t\n\n\t}", "private void repeatingCharacter(String input) {\n\t\tMap<Character,Integer> map = new HashMap<Character,Integer>();\n\t\t//O[n]\n\t\tfor (int i = 0; i < input.length(); i++) {\n\t\t\tmap.put(input.charAt(i),map.getOrDefault(input.charAt(i), 0)+1);\n\t\t}\n\t\t//o[n]\n\t\tint max = Collections.max(map.values());\n\t\tint secondMax = 0;\n\t\tchar output = 0;\n\t\t//o[n]\n\t\tfor(Map.Entry<Character, Integer> a : map.entrySet()) {\n\t\t\tif(a.getValue()<max && a.getValue()>secondMax) {\n\t\t\t\tsecondMax = a.getValue();\n\t\t\t\toutput = a.getKey();\n\t\t\t}\n\t\t}\n\t\tif(!(secondMax == max)) {\n\t\t\tSystem.out.println(output);\n\t\t}else {\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tString str1 = \"garima\";\r\n\t\t\r\n\t\tSystem.out.println(\"The given string is:\"+str1);\r\n\t\t\r\n\t\tfor(int i = 0; i < str1.length(); i++)\r\n\t\t{\r\n\t\t\tboolean unique = true;\r\n\t\t\t\r\n\t\t\tfor(int j = 0; j < str1.length(); j++)\r\n\t\t\t{\r\n\t\t\t\tif(i != j && str1.charAt(i) == str1.charAt(j)) {\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(unique)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"The first non-repeating character in String:\"+str1.charAt(i));\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n // Taking the input string from the user\n System.out.println(\"Enter the string to be evaluated : \");\n String inputString = sc.nextLine();\n\n char previousChar = inputString.charAt(0);\n String finalString = \"\" + inputString.charAt(0);\n\n // Iterating through the string and identification of duplicate characters\n for(int i = 1; i < inputString.length(); i++){\n char currentChar = inputString.charAt(i);\n\n // Checking the duplication of characters in the string\n if(currentChar == previousChar){\n int ascValue = currentChar;\n currentChar = (char)(ascValue + 1);\n }\n\n // Adding to the final output string\n finalString += currentChar;\n previousChar = currentChar;\n }\n\n // Output the final string\n System.out.println(\"Here is the final string : \" + finalString);\n }", "public static void main(String[] args) {\n String str = \"abcDaaafmOO\";\n String uniques = \"\";//lets use string str to find unique characters\n // int count = frequency(str,'a');//return type is int, therefore assign to int variable\n // System.out.println(count);//print the frequency of char 'a'\n//This step is use to identify if the character is unique, let's use loop for this\n for (char each : str.toCharArray()){\n // char ch = str.charAt(i); //to get char as a data type\n int count = frequency(str, each);\n //this is a frequency\n if(count == 1){//if count is equal to 1, concat it to unique variable\n uniques += each;\n }\n }\n System.out.println(\"unique values are: \"+uniques);\n System.out.println(\"========================\");\n String str2 = \"ppppoifugggggsxL\";\n String uniques2 = uniques(str2);\n System.out.println(\"unique values are: \"+uniques2);\n }", "public static void main(String[] args) {\n\t\t\t\n\tString str = \"aaabbbddddcccaabd\";\n\t\n\tString RemoveDup = \"\";//to store non-duplicate values of the str\n\t\n\t\n\t\n\tfor(int i = 0; i < str.length(); i++) {\n\t\tif (!RemoveDup.contains(str.substring(i, i+1))) {\n\t\t\tRemoveDup += str.substring(i, i+1);//will concat character from str to RemoveDup\n\t\t}\n\t\t\n\t}\n\tSystem.out.println(RemoveDup);\t\n\t\t\n\t\t\n\t// str = \"aaabbbddddcccaabd\"; RemoveDup = \"abcd\"\n\t//\t\t\t\t\t\t\t\t\t\t j, j+1\n\t\t// result = a5b4c3d5\n\t\t\n\t\tString result = \"\";//store expected result\n\t\t int count = 0;//count the numbers occurred characters\n\t\t\n\t\tfor(int j=0; j < RemoveDup.length(); j++) {\n\t\t for(int i=0; i <str.length(); i++) {\n\t\t\t if(str.substring(i, i+1).equals(RemoveDup.substring(j, j+1))) {\n\t\t\t\t count++;\n\t\t\t }\n\t\t }\n\t\t result += RemoveDup.substring(j, j+1)+count;\n\t\t\n\t\t}\n\t\t System.out.println(result);\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 void firstNonRepeated(String str){\n Map<Character, Integer> map = new LinkedHashMap<Character, Integer>();\n\n /*Input string convert to array of char*/\n char[] charArray = str.toCharArray();\n\n\n /*Iterating through array, count and put in hashmap */\n for(char c:charArray) {\n if (map.get(c) != null)\n map.put(c, map.get(c) + 1);\n else\n map.put(c, new Integer(1));\n }\n\n\n /*Iterating through map and check if there is character with just one occurrence*/\n Set<Character> keySet = map.keySet();\n for(Character key : keySet){\n if (map.get(key) == 1){\n System.out.println(\"Character is: \"+ key);\n System.exit(0);\n }\n }\n System.out.println(\"There are no characters with just one occurrence!\");\n }", "public static String removeDuplicateLetters(String s) {\r\n\t\t\r\n\t\tStringBuilder output = new StringBuilder();\r\n\t\t\r\n\t\tSet<Character> letters = new HashSet<>();\r\n\t\t\r\n\t\tfor (Character c : s.toCharArray()) {\r\n\t\t\tif (!letters.contains(c) || c.equals(' ')) {\r\n\t\t\t\tletters.add(c);\r\n\t\t\t\toutput.append(c);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn output.toString();\r\n\t}", "public static void main(String[] args) {\n\n String str = \"aabccdddd\";\n String removeDup= \"\"; //a b c d\n //1 2 3 4\n int count = 0;\n for (int i = 0; i <str.length() ; i++) {\n char each = str.charAt(i);\n\n if (removeDup.contains(\"\"+each)){ //if the character is already contained in removeDup\n continue; //skip it\n }\n\n\n\n\n\n\n }\n System.out.println(removeDup);\n\n\n }", "public static void main(String[] args) {\n\t\tString str=\"aaabbccds\";\r\n\t\tint count=0;\r\n\t\tfor(int i=0;i<str.length();i++)\r\n\t\t{count=0;\r\n\t\t\tfor(int j=i+1;j<str.length();j++)\r\n\t\t\t{\r\n\t\t\t\tif(str.charAt(i)==str.charAt(j))\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(count==0)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(str.charAt(i));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{int countt = count+1;\r\n\t\t\t System.out.print(str.charAt(i));\r\n\t\t\t System.out.print(countt);\r\n\t\t\t}\r\n\t\t\ti=i+count;\r\n\t\t}\r\n\r\n\t}", "static char nonrepeatingCharacter(String S)\n {\n int arr[]=new int[256];\n for(int i=0;i<S.length();i++){\n arr[S.charAt(i)]++;\n }\n for(int i=0;i<S.length();i++){\n if(arr[S.charAt(i)]==1)\n return S.charAt(i);\n }\n return '$';\n }", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tString s = scan.nextLine();\r\n\t\tString st[] = s.split(\" \");\r\n\t\tString output =\"\";\r\n\t\t\r\n\t\tfor (int i = 0; i < st.length; i++) {\r\n\t\t\tString s1 = st[i];\r\n\t\t\tString dup =\"\";\r\n\t\t\tfor (int j = 0; j < s.length(); j++) {\r\n\t\t\tif(!(dup.contains(s.charAt(j)+\"\"))){\r\n\t\t\tdup+=s.charAt(j);\r\n\t\t}\r\n\t\t}\r\n\t\t\tif(!(output.contains(dup))){\r\n\t\t\t\toutput+=dup+\" \";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t}\r\n\t\tSystem.out.println(output);\r\n}", "public static void hashMapEx() {\n\t\tString str = \"habiletechE\";\n\t\tstr = str.toLowerCase();\n\t\tchar[] ch = str.toCharArray();\n\t\tint size = ch.length;\n\n\t\tHashMap<Character, Integer> hmap = new HashMap<Character, Integer>();\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (!hmap.containsKey(ch[i]))\n\t\t\t\thmap.put(ch[i], 1);\n\t\t\telse {\n\t\t\t\tint val = hmap.get(ch[i]) + 1;\n\t\t\t\thmap.put(ch[i], val);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Duplicate Charaacters :\");\n\t\tfor (Map.Entry<Character, Integer> hm : hmap.entrySet()) {\n\t\t\tif (hm.getValue() > 1)\n\t\t\t\tSystem.out.println(hm.getKey() + \" \" + hm.getValue());\n\t\t}\n\t}", "static int twoCharaters(String s) {\n\t\tList<String> list = Arrays.asList(s.split(\"\"));\n\t\tHashSet<String> uniqueValues = new HashSet<>(list);\n\t\tSystem.out.println(uniqueValues);\n\t\tString result;\n\t\twhile(check(list,1,list.get(0))) {\n\t\t\tresult = replace(list,1,list.get(0));\n\t\t\tif(result != null) {\n\t\t\t\tSystem.out.println(result);\n\t\t\t\ts = s.replaceAll(result,\"\");\n\t\t\t\tlist = Arrays.asList(s.split(\"\"));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(s);\n\t\treturn 5;\n }", "public static void main(String[] args) {\n\r\n\t\tString s=\"Programming\";\r\n\t\tString s1;\r\n\t\tCharacter ch;\r\n\t\tint count;\r\n\t\tfor(int i=0;i<s.length();i++)\r\n\t\t{\r\n\t\t\tch=s.charAt(i);\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=0;j<s.length();j++)\r\n\t\t\t{\r\n\t\t\t\tif(j<i&& ch==s.charAt(j))\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif(s.charAt(j)==ch)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t\tif(j==(s.length()-1))\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(ch+\" \"+count);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(count>1)\r\n\t\t\t{\r\n\t\t\t\t\ts=s.replace(ch.toString(),\"\");\r\n\t\t\t\t\t//System.out.println(s);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println(s.trim());\r\n\t}", "public static List<Character> duplicate (String text){\n HashMap<Character,Integer> map = new HashMap<>();\n char [] charArray = text.toCharArray();\n List<Character> duplicateChars = new ArrayList<>();\n for (char c: charArray){\n if(map.containsKey(c)){\n int count = map.get(c);\n map.put(c,++count);\n }\n else\n {\n map.put(c,1);\n }\n }\n for (char c: map.keySet()){\n if (map.get(c)>1){\n duplicateChars.add(c);\n }\n }\n return duplicateChars;\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tAnagramCheck();\n\t\tSet<Character> se = new HashSet<Character>();\n\t\tSet<Character> se1 = new HashSet<Character>();\n\t\t\n\t\tStringBuffer sb = new StringBuffer();\n\t\tStringBuffer sb1 = new StringBuffer();\n\t\tString str =\"javav\";\n\t\t\n\t\tfor(int i =0; i <str.length();i++)\n\t\t{\n\t\t\tCharacter ch = str.charAt(i);\n\t\t\t\n\t\t\tif(!se.contains(ch))\n\t\t\t{\n\t\t\t\tse.add(ch);\n\t\t\t\tsb.append(ch);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tse1.add(ch);\n\t\t\t\tsb1.append(ch);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"The duplicates after removed \"+sb.toString());\n\t\t\n\t\tSystem.out.println(\"The duplicate item is \"+sb1.toString());\n\t}", "public static void main(String[] args) {\n\t\tString str=\"aabcccccaaaa\";\n\t\tString str2=\"\";\n\t\tint freq=1;\n\t\tfor(int i=0;i<str.length()-1;i++){\n\t\t\tif(str.charAt(i)==str.charAt(i+1)){\n\t\t\t\tfreq++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstr2=str2+str.charAt(i)+freq;\n\t\t\t\tfreq=1;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(str2+str.charAt(str.length()-1)+freq);\n\t}", "public static String uniques(String str){\n String uniques = \"\";//lets use string str to find unique characters\n // int count = frequency(str,'a');//return type is int, therefore assign to int variable\n // System.out.println(count);//print the frequency of char 'a'\n//This step is use to identify if the character is unique, let's use loop for this\n for (char each : str.toCharArray()){\n // char ch = str.charAt(i); //to get char as a data type\n int count = frequency(str, each);\n //this is a frequency\n if(count == 1){//if count is equal to 1, concat it to unique variable\n uniques += each;\n }\n }\n return uniques;\n\n }", "public String solution(String s) {\n\t\tStream<Character> tmp = s.chars().mapToObj(value -> (char)value);\n\t\treturn tmp.collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().filter(characterLongEntry -> characterLongEntry.getValue() == 2).findFirst().get().getKey().toString();\n\t}", "public static void main(String[] args) {\n\t\tint n=3;\n\t\tString s=\"1\";\n\t\tint count =1;\n\t\tint k=1;\n\t\twhile(k<n){\n\t\t\tStringBuilder t=new StringBuilder();\n\t\t\t//t.append(s.charAt(0));\n\t\t\tfor(int i=1;i<=s.length();i++){\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(i==s.length() || s.charAt(i-1)!=s.charAt(i)){\n\t\t\t\t\tt.append(count); t.append(s.charAt(i-1));\n\t\t\t\t\tcount=1;\n\t\t\t\t}\n\t\t\t\telse if(s.charAt(i-1)==s.charAt(i)){count=count+1;}\n\t\t\t }\t\n\t\t\t\ts=t.toString();\n\t\t\t\tk=k+1;\n\t\t\t\tSystem.out.println(\"k:\"+k);\n\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(s);\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t}", "private static char firstNonRepeatingCharacterV1(String str) {\n if(str == null) return '_';\n Map<Character, Integer> charCountMap = new HashMap<>();\n Set<Character> linkedHashSet = new LinkedHashSet<>();\n\n for(int i = 0; i < str.length(); i++) {\n char ch = str.charAt(i);\n if(charCountMap.containsKey(ch)) {\n charCountMap.put(ch, charCountMap.get(ch) + 1); // do not need this step\n } else {\n charCountMap.put(ch, 1);\n }\n }\n for(int i = 0; i < str.length(); i++) {\n char ch = str.charAt(i);\n if(charCountMap.get(ch) == 1) {\n return ch;\n }\n }\n return '_';\n }", "public static void permutationsWithDups(String str) {\n HashSet<String> perm = new HashSet<String>();\n perm.add(str.substring(0,1));\n for(int i=1; i<str.length(); i++) {\n HashSet<String> output = new HashSet<String>();\n for(String p: perm) {\n for(int j=0; j<=p.length(); j++) {\n output.add(p.substring(0,j) + str.substring(i,i+1) + p.substring(j));\n }\n }\n perm = output;\n }\n\n for(String s: perm) {\n System.out.println(s);\n }\n }", "public static int firstUniqChar(String s) {\n\n HashMap<String, Integer> hm = new HashMap<>();\n\n for(int i = 0; i < s.length(); i++) {\n if(hm.containsKey(s.substring(i, i+1))) {\n hm.put(s.substring(i,i+1), hm.get(s.substring(i,i+1))+1);\n }\n else {\n hm.put(s.substring(i,i+1), 1);\n }\n }\n\n for(int i = 0; i< s.length(); i++) {\n if(hm.get(s.substring(i,i+1)) == 1) {\n return i;\n }\n }\n //this means all the string is repeating\n return -1;\n }", "private static char firstNonRepeatingCharacterV2(String str) {\n if(str == null) return '_';\n Map<Character, Integer> charCountMap = new HashMap<>();\n Set<Character> linkedHashSet = new LinkedHashSet<>();\n\n for(int i = 0; i < str.length(); i++) {\n char ch = str.charAt(i);\n if(charCountMap.containsKey(ch)) {\n charCountMap.put(ch, charCountMap.get(ch) + 1); // do not need this step\n linkedHashSet.remove(ch);\n } else {\n charCountMap.put(ch, 1);\n linkedHashSet.add(ch);\n }\n }\n //The first character in the linkedHashSet will be the firstNonRepeatingCharacter.\n Iterator<Character> itr = linkedHashSet.iterator();\n if(itr.hasNext()){\n return itr.next();\n } else {\n return '_';\n }\n }", "include<stdio.h>\nint main()\n{\n char str[100];\n scanf(\"%s\", str);\n int i, count=1, length; \n for(length=0; str[length]!='\\0'; length++);\n if(length>20)\n {\n printf(\"Invalid Input\");\n }\n else\n {\n for(i=0; i<length; i++)\n {\n if(str[i] == str[i+1])\n {\n count++;\n }\n else\n {\n printf(\"%c%d\", str[i], count); \n count = 1;\n }\n }\n }\n return 0;\n}", "public static void main(String[] args) {\n\t\tString myString = \"abcdea\";\n\t\tint flag = 1;\n\t\t\n\t\tfor (int i=0; i < myString.length(); i++) {\n\t\t\tfor (int j=0; j < myString.length(); j++) {\n\t\t\t\tif(myString.charAt(i)==myString.charAt(j) && i!=j) {\n\t\t\t\t\tflag = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tif(flag==1) {\n\t\t\tSystem.out.println(\"The string has unique characters\");\n\t\t}else {\n\t\t\tSystem.out.println(\"The string does not have unique characters\");\n\t\t}\n\n\t}", "public static String removeDuplicates(String s)\n {\n if (s==null||s.isEmpty()) return s;\n Set<Character> charSet = new HashSet<Character>(s.length());//maximum possible capacity\n //Set.add will only add characters not already in the list\n for (char c : s.toCharArray())\n {\n charSet.add(c);\n }\n StringBuilder sb = new StringBuilder(charSet.size());\n for (Character c : charSet)\n {\n sb.append(c);\n }\n return sb.toString();\n }", "public static int duplicateCount(String text) {\n \r\n int count=0; \r\n \r\n \r\n \r\n int l=text.length(); int index=0; String s1=\"\"; char [] c= new\r\n char [text.length()] ; for (int i=0;i <text.length();i++) {\r\n c[i]=text.toLowerCase().charAt(index++);\r\n \r\n System.out.println(\"Character at c[\"+i+\"] is\"+c[i]);\r\n \r\n }\r\n \r\n System.out.println(\"Character array is \"+Arrays.toString(c));\r\n \r\n int charSize=c.length; int index2=1;\r\n \r\n HashMap h =new HashMap();\r\n for (int i=0;i<charSize;i++)\r\n {\r\n for(int j=i+1;j<charSize;j++)\r\n {\r\n if (c[i]==c[j])\r\n {\r\n count++;\r\n //s1=s1+c[j];\r\n \r\n h.put(c[j],count);\r\n }\r\n }\r\n }\r\n \r\n \r\n System.out.println(h);\r\n \r\n int hsize= h.size();\r\n \r\n return hsize;\r\n }", "public static void main(String[] args) {\n\t\t\n\t\tboolean unique=true;\n\t\tString str=\"sami\";\n\t\tchar[] chars= str.toCharArray();\n\t\tArrays.sort(chars);\n\t\t\n\t\tfor(int i=0;i<=chars.length-2;i++){\n\t\t\t\n\t\t\tif(chars[i]==chars[i+1]){\n\t\t\t\tSystem.out.println(\"Not unique chracters\");\n\t\t\t\tunique=false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t if(unique){\n\t \t System.out.println(\" unique chracters\");\n\t }\n\n\t}", "public static String evensOnlyNoDupes( String s ) {\n Set<Character> h = new LinkedHashSet<Character>(); //--initializing the hashset\n String s2 = \"\"; //tkaing pieces of the string --> put it into s2 ean empty string\n\n for (int i = 0; i < s.length(); i++) {\n if ((int)s.charAt(i) % 2 == 0) {\n if (!h.contains(s.charAt(i))) {\n s2 += s.charAt(i); // a += b means a + b so youre adding the chracter to the s2 string\n h.add(s.charAt(i)); // a set contains a bunch of characters and you need to add the character to the set so that it can tell you if it has showed up or not yet in the set\n }\n }\n }\n return s2;\n }", "public static Map<Character, Integer> findDuplicateCharactersInAString(final String input){\n\n Map<Character, Integer> charCountMap= null;\n if(input !=null && input.length() > 0)\n {\n if(input.length() ==1){\n return charCountMap;\n }\n charCountMap = new LinkedHashMap<Character, Integer>();\n String inputString = input;\n // In case if the program need not consider capital and small letters,\n // if want to consider comment out below line\n inputString = inputString.toLowerCase();\n char [] inputChars = inputString.toCharArray();\n\n for(Character c : inputChars) {\n\n if (charCountMap.containsKey(c)) {\n charCountMap.put(c, charCountMap.get(c) + 1);\n } else {\n charCountMap.put(c, 1);\n }\n }\n }\n else{\n throw new IllegalArgumentException(\"Invalid input\");\n }\n return charCountMap;\n }", "public static void main(String args[]){\n String str = \"aabcadceklmeb\";\n\n HashMap<Character, Integer> map = new HashMap<>();\n\n\n for(int i = 0; i < str.length();i++){\n if(!map.containsKey(str.charAt(i))){\n map.put(str.charAt(i), 1);\n }else{\n int value = map.get(str.charAt(i));\n value++;\n map.put(str.charAt(i), value);\n }\n }\n\n for( char c : map.keySet()){\n if(map.get(c) == 2){\n System.out.println(c);\n }\n }\n \n }", "public static String removeConsecutiveDuplicates(String str){\n\n Stack<Character> st = null;\n String abc = \"\";\n char c = '0';\n int size = str.length();\n int x= 0;\n while(x+1<=size){\n char z = str.charAt(x);\n if(x+1==size){\n break;\n }\n else {\n c = str.charAt(x + 1);\n }\n if(abc==\"\") {\n abc = abc + z;\n }\n if(z==c){\n x++;\n }\n else{\n abc = abc + c;\n x++;\n }\n }\n return abc;\n // Your code here\n }", "public char firstAppearingOnce() { //思路与FirstNotRepeatingChar.java相同\n char[] charArray = s.toString().toCharArray();\n HashMap<Character, Integer> map = new HashMap<Character, Integer>(); //利用一个HashMap散列表存储每个字符出现的次数,字符为键次数为值\n int count;\n //遍历字符串,如果散列表中没有该字符的键就新建一个该字符的键,将值即出现次数设为1,若有说明该字符出现过,将值加一更新出现次数\n for (int i = 0; i < charArray.length; i++) {\n if (map.containsKey(charArray[i])) {\n count = map.get(charArray[i]);\n map.put(charArray[i], ++count); //++在前是因为先将出现次数加1,再更新该字符的出现次数\n } else {\n map.put(charArray[i], 1);\n }\n }\n for (int i = 0; i < charArray.length; i++) {\n if (map.get(charArray[i]) == 1) { //遍历字符数组,对每一个当前字符都去查找散列表对应键的值是不是1,找到就返回该字符\n return charArray[i];\n }\n }\n return '#';\n }", "public static void main(String[] args) {\n Path path = Paths.get(\"duplicated-chars.txt\");\n List<String> text = new ArrayList<String>();\n try {\n text = Files.readAllLines(path);\n } catch (IOException e) {\n e.printStackTrace();\n }\n String row = \"\";\n for (int i = 0; i < text.size(); i++) {\n row = text.get(i);\n for (int j = 0; j < row.length(); j++) {\n if (j % 2 == 0) {\n System.out.print(row.charAt(j));\n }\n }\n }\n }", "public static String uniqueChar(String str){\n\n char[] ch=str.toCharArray();\n str=\"\";\n HashMap<Character,Integer> map=new HashMap<>();\n for(int i=0;i<ch.length;i++)\n {\n if(map.containsKey(ch[i]));\n else\n {\n str+=ch[i];\n map.put(ch[i],1);\n }\n }\n \n return str;\n\t}", "public static String removeConsecutiveDuplicates(String input) {\n String ans =\"\";\n \n \n\t\n\t\n\tchar start = input.charAt(0);\n ans= ans + input.charAt(0);\n\tfor(int i = 1;i<input.length();i++){\n\t\t\n\t\tchar compare = input.charAt(i);\n\t\t\n\t\tif(compare != start){\n\t\t\tans = ans + input.charAt(i);\n\t\t\tstart = input.charAt(i);\n\t\t} \n }\n return ans;\n \n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter String :\");\n\t\tString str = sc.nextLine();\n\t\tint cnt = 0;\n Map<Character, Integer> map = new HashMap<Character, Integer>();\n for (int i =0;i<str.length();i++)\n {\n \tif (map.containsKey(str.charAt(i)))\n \t{\n \t\tint count = map.get(str.charAt(i));\n \t\tcount++;\n \t\tmap.put(str.charAt(i), count);\n \t}\n \telse\n \t{\n \t\tmap.put(str.charAt(i), 1);\n \t}\n \n }\n for (Map.Entry<Character,Integer> entry : map.entrySet())\n {\n \tif (entry.getValue()>1 && entry.getKey()!=' ')\n \t{\n \t\t\n \t \n \t\tSystem.out.println(entry.getKey() + \" \" +entry.getValue());\n \t}\n }\n \n }", "public static void main(String[] args) {\n\t\tString str = \"aaaaaaaa\";\n\t\tSystem.out.println(removeConsecutiveDuplicates(str));\n\n\t}", "public String[] findDuplicates(String string) {\n String[] temp = string.toLowerCase().replaceAll(\"[^a-zA-Z]\", \"\").split(\"\");\n List<String> output = new ArrayList<String>();\n\n for (int i = 0; i < temp.length; i++) {\n int nextElement = i + 1;\n int prevElement = i - 1;\n\n if (nextElement >= temp.length) {\n break;\n }\n\n if (temp[i].equals(temp[nextElement])) {\n if (prevElement != i && !temp[i].equals(temp[prevElement])) {\n output.add(temp[i]);\n }\n }\n }\n\n // Convert the ListString to a traditional array for output\n duplicates = new String[output.size()];\n output.toArray(duplicates);\n\n System.out.println(\"The duplicate chars found are: \" + Arrays.toString(duplicates));\n return duplicates;\n }", "static long repeatedString(String s, long n) {\n long l=s.length();\n long k=n/l;\n long r=n%l;\n long count=0;\n long count1=0;\n char ch[]=s.toCharArray();\n for(int t=0;t<ch.length;t++){\n if(ch[t]=='a')\n count1++;\n }\n for(int t=0;t<r;t++){\n if(ch[t]=='a')\n count++;\n }\n return k*count1+count;\n\n }", "public static char findFirstDuplicates(String str){\n //a green apple\n // ^ now set contains 'e'\n Set<Character> set = new HashSet<>();\n\n for(Character ch:str.toCharArray()){\n if(set.contains(ch)) return ch;\n\n set.add(ch);\n }\n return Character.MIN_VALUE;\n\n }", "public String removeDuplicates(String S) {\n if(S==null||S.length()==0){\n return S;\n }\n Deque<Character> stack=new LinkedList<>();\n for(int i=0,length=S.length();i<length;i++){\n if(stack.size()!=0&&(stack.peekFirst()==S.charAt(i))){\n stack.removeFirst();\n }\n else{\n stack.addFirst(S.charAt(i));\n }\n }\n StringBuilder builder=new StringBuilder();\n while(stack.size()!=0){\n builder.insert(0,stack.removeFirst());\n }\n return builder.toString();\n }", "public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tString st=sc.nextLine();\n\t\tint maxcount=0;\n\t\tint count=0;\n\t\tchar ch='a';\n\t\tfor(int i=0;i<st.length();i++)\n\t\t{\t\n\t\t\tcount=0;\n\t\t\tfor(int j=i+1;j<st.length();j++)\n\t\t\t{\n\t\t\t\tif(st.charAt(i)==st.charAt(j))\n\t\t\t\t{\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(count>maxcount)\n\t\t\t{\n\t\t\t\tmaxcount=count;\n\t\t\t\tch=st.charAt(i);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ch);\n\t\t\n\t}", "public String eliminateDuplicate(String s) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tchar prev = s.charAt(0);\n\t\tsb.append(String.valueOf(prev));\n\t\tfor (int i = 1; i < s.length(); i++) {\n\t\t\tif (s.charAt(i) != prev) {\n\t\t\t\tprev = s.charAt(i);\n\t\t\t\tsb.append(String.valueOf(prev));\n\t\t\t}\n\t\t}\n\n\t\treturn sb.toString();\n\t}", "public int distinctSubseqII(String S) {\n int[] end = new int[26]; // 本字符添加之前的长度\n int res = 0;\n int added; // 当前额外增加的数量\n int mod = (int) 1e9 + 7;\n\n System.out.println('\\n' + S);\n for (char c : S.toCharArray()) {\n // 额外增加的数量等于前面的数量加上1(当前字符串)减去最后一次相同字符添加之前的数量\n added = (res + 1 - end[c - 'a']) % mod;\n\n end[c - 'a'] = (res + 1) % mod; // 影响的为前一个字符的数量加上单字符的数量\n\n res = (res + added) % mod;\n System.out.printf(\"%2c, %2d, %2d\\n\", c, res, end[c - 'a']);\n }\n return (res + mod) % mod;\n }", "public static void main(String[] args) {\n\n\t\t\n\t\tList<Character>st1=new ArrayList<>();\n\t\n\t\tst1.add('a');\n\t\tst1.add('b');\n\t\tst1.add('a');\n\t\tst1.add('a');\n\t\tst1.add('c');\n\t\tst1.add('t');\n\t\n\t\tSystem.out.println(st1);//[a, b, a, a, c, t]\n\t\t\n\t\tList<Character>st2=new ArrayList<>();//empty []\n\t\tfor (int i=0; i<st1.size();i++) {\n\t\t\tif(!st2.contains(st1.get(i))) {\n\t\t\t\t// created str2 [empty], we will get the element from st1 to st2 while checking if there is repetition \n\t\t\t\tst2.add(st1.get(i));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(st2);//[a, b, c, t]\n\t\t\n\n\t}", "public static String RemoveDuplicatedLetters(String s, int k) {\n if (s.length() < k) {\n return s;\n }\n String result = \"\";\n int counter = 1;\n Stack<String> stack = new Stack<>();\n for (int i = 0; i < s.length(); i++) {\n stack.push(s.substring(i, i + 1));\n }\n result += stack.pop();\n\n while (!stack.isEmpty()) {\n if (stack.peek().equals(result.charAt(0) + \"\")) {\n counter += 1;\n } else {\n counter = 1;\n }\n result = stack.pop() + result;\n if (counter == k) {\n result = result.length() == k ? \"\" : result.substring(k);\n for (int i = 0; i < s.length(); i++) {\n stack.push(s.substring(i, i + 1));\n }\n counter = 0;\n }\n }\n return result;\n }", "public static String oddsOnlyNoDupes( String s ) {\n Set<Character> h = new LinkedHashSet<Character>(); //--initializing the hashset\n String s2 = \"\"; //tkaing pieces of the string --> put it into s2 ean empty string\n\n for (int i = 0; i < s.length(); i++) {\n if ((int)s.charAt(i) % 2 == 1) {\n if (!h.contains(s.charAt(i))) {\n s2 += s.charAt(i); // a += b means a + b so youre adding the chracter to the s2 string\n h.add(s.charAt(i)); // a set contains a bunch of characters and you need to add the character to the set so that it can tell you if it has showed up or not yet in the set\n }\n }\n }\n return s2;\n }", "public static String removeAdjacentDuplicateChars(String s) {\r\n \tif (s.length() == 0) {\r\n \t\treturn \"\";\r\n \t}\r\n \telse {\r\n \t\tint len = s.length();\r\n \t\tString result = removeHelper(s, len - 1);\r\n \t\treturn result;\r\n \t}\r\n }", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String initialString = \"Dong-ding-dong\";\n String secondaryString = in.nextLine();\n\n // Stage 1 : count the letters\n int letterCounter = 0;\n for (int i = 0; i < initialString.length(); i++) {\n if (Character.isLetter(initialString.charAt(i))) {\n letterCounter++;\n }\n }\n System.out.println(\"Initial string contains \" + letterCounter + \" letters.\");\n\n // Stage 2: check if hardcoded string and inputed string are equal ignoring the case\n System.out.println(\"Are the two strings equal? 0 if yes : \" + initialString.compareToIgnoreCase(secondaryString));\n\n // Stage 3: show initial string as all caps and all lowercase\n System.out.println(initialString.toUpperCase());\n System.out.println(initialString.toLowerCase());\n\n // Stage 4: show all dongdexes\n for(int i = -1; i <= initialString.length();){\n i = initialString.toLowerCase().indexOf(\"dong\", i+1);\n if(i != -1){\n System.out.println(i);\n }\n else{\n break;\n }\n }\n\n // Stage 5: replace all words \"dong\" with \"bong\"\n initialString = initialString.toLowerCase().replaceAll(\"dong\",\"bong\");\n System.out.println(initialString);\n\n // Stage 6: search for duplicated words and show their count\n String[] words = initialString.toLowerCase().split(\"-\");\n int counter = 0;\n for(String word : words){\n if(word != \"\"){\n for(int i = 0; i < words.length; i++){\n if(word.matches(words[i])){\n counter++;\n words[i] = \"\";\n }\n }\n System.out.println(\"The word \" + word + \" is repeated \" + counter + \" times.\");\n word = \"\";\n counter = 0;\n }\n }\n }", "public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Enter a word:\");\n String word = scan.next();\n System.out.println(\"Enter character:\");\n char character = scan.next().charAt(0);\n\n int count=0; //count frequency of character\n for (int i =0; i<word.length(); i++) {\n char each = word.charAt(i); //each character by given string word\n\n if (each == character) { //if each character in str is matching with ch\n count++; //count increase the frequency of ch by 1\n\n }\n }\n System.out.println(count);\n\n System.out.println(\"===========================\");\n\n\n\n }", "public static Character findFirstNonRepetedCharacter(String str){\n Map<Character,Integer> map = new HashMap<>();\n\n char[] chars = str.toCharArray();\n for(Character ch: chars){\n //Terinery operator if chracter contains value increment by one\n var count = map.containsKey(ch) ? map.get(ch) : 0;\n map.put(ch,count +1);\n }\n\n //due to hashfunction map store these values in different places in memory( not sequentially)\n //now match the character in String from first to end corresponding to Map values\n for(Character ch: chars){\n //first non repeated value a green apple in string | in { =2, p=2, a=2, r=1, e=3, g=1, l=1, n=1}\n if(map.get(ch)==1) return ch; // ^\n }\n\n return Character.MIN_VALUE; // a default value when cant find any 1st repeated\n }", "private static String stringCompress(String input) {\n int length = input.length();\n int count = 0;\n StringBuilder output = new StringBuilder();\n char curr = input.charAt(0);\n for(int i=0;i<length;i++){\n char temp = input.charAt(i);\n // If the current char is the same as previous one\n // we increment the counter and move to the next one\n if(curr == temp)\n count++;\n // If the current char is not same as previous one\n // we add the char and its frequency to output\n else{\n output.append(curr);\n output.append(count);\n // reset the counter for next char\n count = 1;\n curr = temp;\n }\n }\n // The last char and its frequency are yet to be added\n output.append(curr);\n output.append(count);\n return output.toString();\n }", "public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter a string:\");\n\t\tString inStr = in.nextLine();\n\t\tboolean isUnique = isUniqueChars( inStr);\n\t\tif( isUnique){\n\t\t\tSystem.out.println(inStr+\" has unique chars \");\n\t\t}else{\n\t\t\tSystem.out.println(inStr+\" has duplicate chars \");\n\t\t}\n\t\t\n\t}", "public List<String> findRepeatedDnaSequences(String s){\n HashMap<Character,Integer> map=new HashMap<>();\n Set<Integer> firstSet=new HashSet<>();\n Set<Integer> dupSet=new HashSet<>();\n List<String> res=new ArrayList<>();\n map.put('A',0);\n map.put('C',1);\n map.put('G',2);\n map.put('T',3);\n char[] chars=s.toCharArray();\n for(int i=0;i<chars.length-9;i++){\n int v=0;\n for(int j=i;j<i+10;j++){\n v<<=2;\n v|=map.get(chars[j]);\n }\n if(!firstSet.add(v)&&dupSet.add(v)){\n res.add(s.substring(i,i+10));\n }\n }\n return res;\n }", "public static String removeConsecutiveDuplicates(String s) {\n\n if(s.length() < 2){\n return s;\n }\n \n String smallAns = removeConsecutiveDuplicates(s.substring(1));\n \n char current = s.charAt(0);\n \n if(current == smallAns.charAt(0)){\n return smallAns;\n }\n \n return current + smallAns;\n\t}", "public static String duplicate(String word){\n\t\tStringBuilder result = new StringBuilder(word);\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}", "private static int firstUniqChar2(String s) {\n Map<Character, Integer> seen = new HashMap<>();\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n seen.put(c, seen.getOrDefault(c, 0) + 1);\n }\n\n int uniqueIdx = -1;\n for (int i = 0; i < s.length(); i++) {\n if (seen.get(s.charAt(i)) == 1) {\n uniqueIdx = i;\n break;\n }\n }\n\n return uniqueIdx;\n }", "public static void main(String[] args) {\n\r\n\t\tString str = \"learning automation is fun\";\r\n\t\tstr = str.replace(\" \", \"\");\r\n\t\tchar letters[] = str.toCharArray();\r\n\t\t\r\n\t\tfor(int i = 0;i<letters.length;i++) {\r\n\t\t\tint count = 0;\r\n\t\t\tfor(int j=0;j<letters.length;j++) {\r\n\t\t\t\t\r\n\t\t\t\tif (j<i&&(letters[j]==letters[i])) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif(letters[i]==letters[j]) {\r\n\t\t\t\t\tcount++;\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 (count>0)\r\n\t\t\tSystem.out.println(\"Occurrence of \"+letters[i]+\" is \"+count);\r\n\t\t}\r\n\t\t\r\n\t}", "static long repeatedString(String s, long n) {\n\n char[] str = s.toCharArray();\n\n String temp = \"\";\n\n int i=0;\n long count=0;\n\n while(i<str.length){\n if(str[i]=='a'){\n count++;\n }\n i++;\n }\n\n long occurance = n/str.length;\n long remainder = n%str.length;\n count = count*occurance;\n\n i=0;\n while(i<remainder){\n if(str[i]=='a'){\n count++;\n }\n i++;\n }\n\n return count;\n\n }", "public static Character nonRepeating(String s) {\n Map<Character, Integer> charCount = new HashMap<>();\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (charCount.containsKey(c)) {\n charCount.put(c, charCount.get(c) + 1);\n } else {\n charCount.put(c, 1);\n }\n }\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (charCount.get(c) == 1) {\n return c;\n }\n }\n return null;\n }", "public static void main(String[] args) throws IOException {\n String str=\"111111\";\n char[] chars = str.toCharArray();\n\n //处理特殊情况:字符个数小于三个\n if(chars.length==1){\n System.out.println(0);\n return;\n }else if(chars.length==2){\n if(chars[0]==chars[1]) {\n System.out.println(1);\n }else{\n System.out.println(0);\n }\n return;\n }\n //走到这里说明字符数组至少有三个元素,使用滑动窗口来处理\n int sum=0;\n for(int i=2;i<chars.length;i++){\n if(chars[i]==chars[i-1]&&chars[i-2]==chars[i-1]){//三个元素相等,修改第二个元素\n chars[i-1]='x';\n sum++;\n }else if(chars[i-1]==chars[i]){//后两个相等,修改最后一个\n chars[i]='x';\n sum++;\n }else if(chars[i-1]==chars[i-2]){//前两个相等,中间那个(只有开始的时候会出现这个判断)\n chars[i-1]='x';\n sum++;\n }\n }\n\n System.out.println(sum);\n return;\n }", "public static void findUniqueUsingHashMap(String inputString) {\n\n HashMap<Character, Integer> stringHashMap = new HashMap<>();\n for (int i = 0; i < inputString.length(); i++) {\n if (stringHashMap.containsKey(inputString.charAt(i))) {\n System.out.println(\"Input String dont have unique characters:\" + inputString);\n return;\n }\n stringHashMap.put(inputString.charAt(i), i);\n }\n System.out.println(\"Input String has unique characters \" + inputString);\n }", "public static void main(String[] args) {\n\t\tScanner mScanner = new Scanner(System.in);\r\n\t\tString mString = mScanner.nextLine();\r\n\t\tmString = mString.replaceAll(\"[\\\\s,{}]\",\"\");\r\n\t\tchar[] c = mString.toCharArray();\r\n\t\tint toReplace=1;\r\n\t\tint coun = 0;\r\n\t\tArrays.sort(c);\r\n HashSet<Character> mSet = new HashSet<Character>();\r\n for (Character x : c) {\r\n\t\t\tmSet.add(x);\r\n\t\t}\r\n System.out.println(mSet.size());\r\n// for (int i = 0; i < c.length; i++) {\r\n// \tSystem.out.println(c[i]);\r\n//\t\t}\r\n\t\t\r\n\t}", "static void findDuplicate()\n\t{\n\n\t\tList<String> oList = null;\n\t\tSet<String> oSet = null;\n\t\ttry {\n\t\t\toList = new ArrayList<String>();\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Dog\");\n\t\t\toList.add(\"Eagle\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\tSystem.out.println(oList);\n\t\t\t\n\t\t\toSet = new TreeSet<>();\n\t\t\t\n\t\t\tString s = \"\";\n\t\t\tfor(int i=0;i<oList.size();i++)\n\t\t\t{\n\t\t\t\tif((oSet.add(oList.get(i))==false) && (!s.contains(oList.get(i))))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Duplicate: \"+oList.get(i));\n\t\t\t\t\ts+=oList.get(i);\n\t\t\t\t}\n\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\tfinally {\n\t\t\toList = null;\n\t\t\toSet = null;\n\t\t}\n\t}", "public static void main(String[] args) {\n System.out.println(firstUniqChar(\"leetcode\")); //should return 0\n System.out.println(firstUniqChar(\"loveleetcode\")); //should return 2\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tString s1=\"Hi Hello\";\n\t\tfrequent(s1);\n//\t\tchar ch[] = s1.toCharArray();\n//\t\tchar ch1;\n//\t\tchar ch2[]=new char[10];\n//\t\t\n//\t\tfor(int i=0;i<ch.length;i++) {\n//\t\t\tSystem.out.println(ch[i]);\n//\t\t}\n//\t\t\n//\t\tfor(int i=0;i<ch.length;i++) {\n//\t\t\t\n//\t\t\tint count=1;\n//\t\t\tfor(int j=i+1;j<ch.length;j++) {\n//\t\t\t\t\n//\t\t\t\tif(ch[i]==ch[j]) {\n//\t\t\t\t\t\n//\t\t\t\t\tcount++;\n//\t\t\t\t}\n//\t\t\t\t\n//\t\t\t}System.out.println(\"Count of \"+ch[i]+\"=\"+count);\n//\t\t}\n\t\t\n\t\t\n\t\n\n\t}", "void ifUnique(char inputCharArray[])\n\t{\n\t\tint count=0;\n\t\t\n\t\tfor(int i=0; i<inputCharArray.length; i++)\n\t\t{\n\t\t\t//int ab = (int)inputCharArray[i]; \n\t\t\tchar ab = inputCharArray[i];\n\t\t\tfor (int j=0; j<i; j++)\n\t\t\t{\n\t\t\t\tif(ab==inputCharArray[j])\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\"String not unique!\");\n\t\t\t\t\tcount = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor (int j=i+1; j<inputCharArray.length; j++)\n\t\t\t{\n\t\t\t\tif(ab==inputCharArray[j])\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\"String not unique!\");\n\t\t\t\t\tcount = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (count==1)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif (count==0)\n\t\t{\n\t\t\tSystem.out.print(\"String unique!\");\n\t\t}\n\t}", "public static String findRepetitivePattern(String s) {\n if (s.isEmpty()) {\n return s;\n }\n int n = 0;\n int pLength = 1;\n\n int i = 1;\n char[] arr = s.toCharArray();\n while (i < arr.length) {\n\n boolean patternMatched = true;\n for (int j = 0; j < pLength && i + j < arr.length; ++j) {\n int k = i + j;\n if (k >= arr.length || arr[j] != arr[k]) {\n patternMatched = false;\n break;\n }\n }\n if (patternMatched) {\n n++;\n i += pLength;\n } else {\n i += 1;\n pLength = i;\n n = 0;\n }\n }\n return String.copyValueOf(arr, 0, pLength);\n }", "public static void main(String...args){\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tString s = scan.nextLine();\r\n//\t\tString str = s.replaceAll(\"\\\\s\", \"\"); // removing white space from string\r\n//\t\tSystem.out.println(str);\r\n\t\tchar[] ch = s.toCharArray();\r\n\t\tSet<Character> charSet = new HashSet<>();\r\n\t\tfor(char c: ch){\r\n\t\t\t\r\n\t\t\tcharSet.add(c);\t\r\n\t\t}\r\n\t\t\r\n//\t\tStringBuffer sb = new StringBuffer();\r\n\t\tfor(Character character : charSet){\r\n//\t\t\tsb.append(character);\r\n\t\t\tSystem.out.print(character);\r\n\t\t}\r\n//\t\tSystem.out.println(sb.toString());\r\n\t\t\r\n\t}", "public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n int T = Integer.parseInt(f.readLine());\n for(int t = 0; t < T; t++) {\n char[] s = f.readLine().toCharArray();\n boolean[] used = new boolean[26];\n StringBuilder sb = new StringBuilder();\n boolean valid = true;\n used[s[0]-'a'] = true;\n sb.append(s[0]);\n int index = 0;\n for(int i = 1; i < s.length; i++) {\n if(used[s[i]-'a']) {\n if(index > 0 && sb.charAt(index-1) == s[i]) {\n index--;\n } else if(index+1 < sb.length() && sb.charAt(index+1) == s[i]) {\n index++;\n } else {\n valid = false;\n break;\n }\n } else {\n if(index == 0) {\n sb.insert(0, s[i]);\n } else if(index+1 == sb.length()) {\n sb.append(s[i]);\n index++;\n } else {\n valid = false;\n break;\n }\n used[s[i]-'a'] = true;\n }\n }\n for(int i = 0; i < 26; i++) {\n if(!used[i]) {\n sb.append((char) (i+'a'));\n }\n }\n out.println(valid ? \"YES\" : \"NO\");\n if(valid) {\n out.println(sb);\n }\n }\n f.close();\n out.close();\n }", "public static String repeat1(char character, int repeats) {\n String answer = \"\";\n for (int j = 0; j < repeats; j++) {\n answer += character;\n }\n return answer;\n }", "public static String removeAdjDupes(String s) {\n //Shane Method first try\n// Stack<Character> stack = new Stack<Character>();\n// for(char c : s.toCharArray()) {\n// if(stack.isEmpty()) {\n// stack.push((c));\n// }else if(stack.peek() == c) {\n// stack.pop();\n// } else {\n// stack.push(c);\n// }\n// }\n// StringBuilder str = new StringBuilder();\n// for(char c : stack){\n// str.append(c);\n// }\n// return str.toString();\n\n // Daily Byte answer that is twice as fast as mine\n StringBuilder result = new StringBuilder();\n Stack<Character> stack = new Stack<>();\n for (char c: s.toCharArray()) {\n if (!stack.isEmpty() && c == stack.peek()) {\n stack.pop();\n } else {\n stack.push(c);\n }\n }\n\n while (!stack.isEmpty()) {\n result.append(stack.pop());\n }\n\n return result.reverse().toString();\n }", "public static void main(String[] args)\r\n\t{\n\t\tScanner s = new Scanner(System.in);\r\n\t\tString str = s.next();\r\n\t for(int i=0;i<str.length()-1;i++)\r\n\t {\r\n\t if(str.charAt(i)!=str.charAt(i+1))\r\n\t System.out.print(str.charAt(i));\r\n\t }\r\n\t \r\n\t\t\r\n\t System.out.print(str.charAt(str.length()-1));\r\n\t}", "static void findFirstNonRepeating()\n\t{\n\t\tList<Character> inDLL =new ArrayList<Character>();\n\t\t\n\t\t// repeated[x] is true if x is repeated two or more times.\n\t\t// If x is not seen so far or x is seen only once. then \n\t\t// repeated[x] is false\n\t\tboolean[] repeated =new boolean[MAX_CHAR];\n\t\t\n\t\t// Let us consider following stream and see the process\n\t\tString stream = \"geeksforgeeksandgeeksquizfor\";\n\t\tfor (int i=0;i < stream.length();i++)\n\t\t{\n\t\t\tchar x = stream.charAt(i);\n\t\t\tSystem.out.println(\"Reading \"+ x +\" from stream n\");\n\t\t\t\n\t\t\t// We process this character only if it has not occurred\n\t\t\t// or occurred only once. repeated[x] is true if x is \n\t\t\t// repeated twice or more.s\n\t\t\tif(!repeated[x])\n\t\t\t{\n\t\t\t\t// If the character is not in DLL, then add this at \n\t\t\t\t// the end of DLL.\n\t\t\t\tif(!(inDLL.contains(x)))\n\t\t\t\t{\n\t\t\t\t\tinDLL.add(x);\n\t\t\t\t}\n\t\t\t\telse // Otherwise remove this character from DLL\n\t\t\t\t{\n\t\t\t\t\tinDLL.remove((Character)x);\n\t\t\t\t\trepeated[x] = true; // Also mark it as repeated\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Print the current first non-repeating character from\n\t\t\t// stream\n\t\t\tif(inDLL.size() != 0)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"First non-repeating character so far is \");\n\t\t\t\tSystem.out.println(inDLL.get(0));\n\t\t\t}\n\t\t} \n\t}", "public static void main(String[] args) {\n\n\t\tString str = \"Better Butter\";\n\t\t// char[] chararray=s.toCharArray();\n\n\t\tHashMap<Character, Integer> map = new HashMap<>();\n\n\t\t// if(hm.containsKey(s.charAt(index)))\n\n\t\tfor (int i = str.length() - 1; i >= 0; i--) {\n\n\t\t\tif (map.containsKey(str.charAt(i))) {\n\n\t\t\t\tif (str.charAt(i) == '\\0') {\n\t\t\t\t\t++i;\n\t\t\t\t}\n\t\t\t\tint count = map.get(str.charAt(i));\n\t\t\t\tmap.put(str.charAt(i), ++count);\n\t\t\t\tSystem.out.println(map);\n\t\t\t} else {\n\t\t\t\tmap.put(str.charAt(i), 1);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(map);\n\t}", "Alphabet(String chars) {\n char[] newChars = chars.toCharArray();\n Map<Character, Integer> map = new HashMap<>();\n for (char c : newChars) {\n if (map.containsKey(c)) {\n int counter = map.get(c);\n map.put(c, ++counter);\n } else {\n map.put(c, 1);\n }\n }\n\n for (char c : map.keySet()) {\n if (map.get(c) > 1) {\n throw new EnigmaException(\"Duplicates Found\");\n } else {\n _letters = chars;\n }\n }\n }", "public char FirstAppearingOnce()\n {\n String s1 = sb.toString();\n for (int i = 0; i < s1.length(); i++){\n String s2 = s1.replace(String.valueOf(s1.charAt(i)),\"\");//用空代替第i位出现的所有字符\n //如果某个字符出现一次,则s1和s2的长度只差1,如果有多个字符,那么不差1\n if (s1.length()-s2.length() == 1) return s1.charAt(i);\n }\n return '#';\n }", "public static boolean hasAllUniqueChars1(String string) {\n for(int i = 0; i < string.length(); i++) {\n for(int j = i + 1; j < string.length(); j++) {\n if(string.charAt(i) == string.charAt(j)) return false;\n }\n }\n\n return true;\n }", "public static void main(String[] args) {\nString word = \"aabbaaaccbbaacc\";\n String result = \"\";\n\n for (int i = 0; i <=word.length()-1 ; i++) {\n\n if(!result.contains(\"\"+word.charAt(i))){ //if the character is not contained in the result yet\n result+=word.charAt(i); //then add the character to the result\n }\n\n }\n System.out.println(result);\n\n\n\n }", "public static void main(String[] args){\n\t\tString str = \"level\";\n\t\t\n\t\t// Approach-1\n\t\tfor(int i=0;i<str.length();i++){\n\t\t\tboolean unique = true;\n\t\t\t\n\t\t\tfor(int j=0;j<str.length();j++){\n\t\t\t\tif(i!=j && str.charAt(i)==str.charAt(j)){\n\t\t\t\t\tunique = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(unique){\n\t\t\t\tSystem.out.println(str.charAt(i));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Approach-2\n\t\tMap<Character, Integer> map = new HashMap<>();\n\t\t\n\t\tfor(int i=0;i<str.length();i++){\n\t\t\tchar ch = str.charAt(i);\n\t\t\tif(map.containsKey(ch)){\n\t\t\t\tmap.put(ch, map.get(ch)+1);\t\n\t\t\t}else{\n\t\t\t\tmap.put(ch,1);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(map);\n\t\t\n\t\tfor(Map.Entry<Character, Integer> entryset : map.entrySet()){\n\t\t\tif(entryset.getValue()==1){\n\t\t\t\tSystem.out.println(entryset.getKey());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public int firstUniqChar(String s) {\n int[] freq = new int[26];\n \n for (char c : s.toCharArray())\n freq[c - 'a']++;\n \n for (int i = 0; i < s.length(); i++)\n if (freq[s.charAt(i) - 'a'] == 1) return i;\n \n return -1;\n }", "public static String removeDuplicatesMaintainOrder(String str) {\n\t\tboolean seen[] = new boolean[256];\n\t\tStringBuilder sb = new StringBuilder(seen.length);\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tchar ch = str.charAt(i);\n\t\t\t// System.out.println((int)ch);\n\t\t\tif (!seen[ch]) {\n\t\t\t\tseen[ch] = true;\n\t\t\t\tsb.append(ch);\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}", "public static boolean uniqueCharStringNoDS(String s){\r\n for (int i = 0; i < s.length(); i++){\r\n for (int j = i+1; j < s.length(); j++){\r\n char temp = s.charAt(i);\r\n if (temp == s.charAt(j)){\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tString s=\"teeter\";\r\n\t\tfor(char ch:s.toCharArray())\r\n\t\t{\r\n\t\t\tif(s.indexOf(ch)==s.lastIndexOf(ch))\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(ch);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tString s = \"caaab\";\n\t\tString[] res = getUniqueSubstring(s,2);\n\t\tfor(String a : res){\n\t\t\tSystem.out.println(a);\n\t\t}\n\t}", "public List<String> findRepeatedDnaSequences(String s) {\n if(s.length() < 10) return new ArrayList<String>();\n \n int[] map = new int[256];\n map['A'] = 0;\n map['T'] = 1;\n map['C'] = 2;\n map['G'] = 3;\n \n List<String> result = new ArrayList<String>();\n \n //this set contains string that occurs before\n Set<Integer> visited = new HashSet<Integer>();\n //this set contains string that we have inserted into result\n Set<Integer> inResult = new HashSet<Integer>();\n \n int key = 0;\n \n //Since we only partially modify the key, we need to firstly initialize it\n for(int i = 0; i < 9; i++){\n key <<= 2;\n key |= map[s.charAt(i)];\n }\n \n for(int i = 9; i < s.length(); i++){\n key <<= 2;\n key |= map[s.charAt(i)];\n //our valid key has 20 digits, we use 0xFFFFF to remove digits that beyong this range\n key &= 0xFFFFF;\n \n String temp = s.substring(i - 9, i+1);\n \n //if this is not the first time we visit this substring\n if(!visited.add(key)){\n //if this is the first time we add this substring into result\n if(inResult.add(key)){\n result.add(temp);\n }\n }\n }\n \n return result;\n }", "private static void charCount(String str) {\n\t\t\n\t\tHashMap<Character, Integer> mp = new HashMap<Character, Integer>();\n\t\t\n\t\tchar[] cr=str.toCharArray();\n\t\t\n\t\tSystem.out.println(cr);\n\t\t\n\t\tfor(char c: cr) {\n\t\t\t\n\t\t\tif(mp.containsKey(c)) {\n\t\t\t\tmp.put(c, mp.get(c)+1);\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tmp.put(c, 1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(Map.Entry<Character, Integer> ent: mp.entrySet()) {\n\t\t\tSystem.out.println(ent.getKey() + \" \" + ent.getValue());\n\t\t}\n\t\t\n\t}", "public char FirstAppearingOnce()\n {\n \n for(int i = 0; i < stringstream.size(); i++){\n char ch = stringstream.get(i);\n\t\t\tif(!rep.contains(ch)){\n return ch;\n }\n }\n return '#';\n }", "public static boolean isUnique(String s) {\n if (s.length() > 128) return false;\n\n // we dont need to check the last element\n for (int i = 0; i < s.length() - 1; i++){\n String current = \"\";\n current += s.charAt(i);\n// System.out.println(current);\n if (s.substring(i + 1).contains(current))\n return false;\n }\n return true;\n }", "public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\r\n\t\tString str=s.nextLine();\r\n\t\tchar []ch=str.toCharArray();\r\n\t\tint i;\r\n\t\tint j;\r\n\t\t\r\n\t\tString s1=\"\";\r\n\t\tLinkedHashSet set=new LinkedHashSet();\r\n\t\tfor(i=0;i<ch.length;i++){\r\n\t\t\tset.add(ch[i]);\r\n\t\t}\r\n\t\tfor(Object o:set){\r\n\t\t\ts1=s1+o;\r\n\t\t}\r\n\t\tSystem.out.println(s1);\r\n\t}", "private static int firstUniqChar1(String s) {\n int[] counts = new int[128];\n for (int i = 0; i < s.length(); i++) {\n int c = s.charAt(i);\n counts[c] = counts[c] + 1;\n }\n\n int uniqueIdx = -1;\n for (int i = 0; i < s.length(); i++) {\n if (counts[(int) s.charAt(i)] == 1) {\n uniqueIdx = i;\n break;\n }\n }\n\n return uniqueIdx;\n }", "public static void main(String[] args) {\nString s = \"Paypal\";\r\nString s1 = s.toLowerCase();\r\nchar[] c= s1.toCharArray();\r\n\r\nSet<Character> charset = new HashSet<Character>();\r\nSet<Character> dupcharset = new HashSet<Character>();\r\nfor(int i=0;i<c.length;i++) {\r\n\tBoolean t = charset.add(c[i]);\r\n\tif(!t) {\r\n\t\tdupcharset.add(c[i]);\r\n\t}\r\n\t\r\n}\r\nSystem.out.println(charset);\r\nSystem.out.println(dupcharset);\r\ndupcharset.removeAll(charset);\r\nSystem.out.println(charset);\r\nSystem.out.println(dupcharset);\r\nfor (Character character : charset) {\r\n\tif(character!=' ') {\r\n\t\tSystem.out.println(character);\r\n\t}\r\n}\r\n\t}", "public static int firstUniqChar(String s) {\n Map<Character, Integer> map = new HashMap<>();\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (map.containsKey(c)) {\n map.put(c, map.get(c) + 1);\n } else {\n map.put(c, 1);\n }\n }\n\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (map.get(c) == 1) {\n return i;\n }\n }\n return -1;\n\n }", "public char FirstAppearingOnce() {\n HashMap<Character, Integer> map = new HashMap<Character, Integer>();\n for (int i = 0, len = sb.length(); i < len; i++) {\n char ch = sb.charAt(i);\n if (map.get(ch) == null) {\n map.put(ch, 1);\n } else {\n int k = map.get(ch);\n map.replace(ch, ++k);\n }\n }\n for (int i = 0, len = sb.length(); i < len; i++) {\n char ch = sb.charAt(i);\n if (map.get(ch) == 1) {\n return ch;\n }\n }\n return '#';\n }" ]
[ "0.77955973", "0.75362986", "0.7472098", "0.74583554", "0.7041078", "0.70400685", "0.6992629", "0.6974", "0.6942372", "0.6941117", "0.69199234", "0.6822728", "0.68100065", "0.67804503", "0.6768279", "0.67497975", "0.67437696", "0.67210597", "0.66532344", "0.6636021", "0.6631203", "0.6597226", "0.6555239", "0.6517651", "0.6512726", "0.64989704", "0.6482226", "0.6476512", "0.6467026", "0.6463524", "0.6459945", "0.64591265", "0.6403405", "0.6377412", "0.6371148", "0.6353607", "0.6351512", "0.63490796", "0.6293976", "0.6248218", "0.62472606", "0.6243911", "0.6234867", "0.62342834", "0.6232715", "0.6213364", "0.6193643", "0.6187069", "0.6186529", "0.61749953", "0.6173584", "0.6168686", "0.6163733", "0.61583716", "0.61555004", "0.6126756", "0.61028177", "0.60958827", "0.60929936", "0.6091677", "0.60896915", "0.6084794", "0.60762596", "0.6075977", "0.6067122", "0.6065123", "0.60577345", "0.60483897", "0.6048053", "0.6041826", "0.60415506", "0.6023994", "0.60231596", "0.60209996", "0.60150015", "0.6012509", "0.6008692", "0.60041606", "0.6002093", "0.59841084", "0.59808487", "0.59793955", "0.59787977", "0.5973775", "0.59600294", "0.5958153", "0.5947878", "0.5939027", "0.5935824", "0.5925234", "0.5911167", "0.59070784", "0.5903269", "0.5902324", "0.58993906", "0.58963966", "0.5895486", "0.58950675", "0.5892713", "0.58800226", "0.58719885" ]
0.0
-1
CalendarFrame constructor initializes the model, view, and controller. Sets the window size and the layouts of its components.
public CalendarFrame() { model = new Model(); controller = new ControllerPanel(model); view = new MonthlyView(model); model.attach(view); this.setSize(1500, 700); add(controller, BorderLayout.NORTH); add(view, BorderLayout.CENTER); setBackground(Color.WHITE); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // pack(); setVisible(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CalendarFrame(EventModel eM) {\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tsetTitle(\"CS151Project\");\n\t\tsetSize(1200, 400);\n\t\tsetVisible(true);\n\t\tsetLayout(new GridLayout(1, 2));\n\t\taddWindowListener(new WindowAdapter()\n\t\t{\n\t\t public void windowClosing(WindowEvent e)\n\t\t {\n\t\t \tObjectOutputStream out = null;\n\t\t\t\ttry {\n\t\t\t\t\tout = new ObjectOutputStream(new FileOutputStream(\"events.data\"));\n\t\t\t\t\tout.writeObject(eventsData.getAllEvents());\n\t\t\t\t\tout.close();\n\t\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\t\tpromptMsg(e1.getMessage(), \"Message\");\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\tpromptMsg(e1.getMessage(), \"Message\");\n\t\t\t\t}\n\t\t }\n\t\t});\n\n\t\teventsData = eM;\n\t\teventsRender = new DayViewRender();\n\n\t\teventsData.attach(new ChangeListener() {\n\n\t\t\t@Override\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tupdateData();\n\t\t\t\tupdateTableView();\n\t\t\t\tupdateEventsView(eventsRender);\n\t\t\t}\n\t\t});\n\n\t\t// previous day button\n\t\tJButton preDay = new JButton(\"<-\");\n\t\tpreDay.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\t\tcal.add(Calendar.DAY_OF_MONTH, -1);\n\t\t\t\teventsData.updateDate(cal);\n\t\t\t}\n\t\t});\n\n\t\t// current day button\n\t\tJButton today = new JButton(\"Today\");\n\t\ttoday.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\t\tcal = new GregorianCalendar();\n\t\t\t\teventsData.updateDate(cal);\n\t\t\t}\n\t\t});\n\n\t\t// next day button\n\t\tJButton nextDay = new JButton(\"->\");\n\t\tnextDay.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\t\tcal.add(Calendar.DAY_OF_MONTH, +1);\n\t\t\t\teventsData.updateDate(cal);\n\t\t\t}\n\t\t});\n\n\t\t// Top1 left: panel1\n\t\tJPanel panel1 = new JPanel();\n\t\tpanel1.setLayout(new BorderLayout());\n\t\tpanel1.add(preDay, BorderLayout.WEST);\n\t\tpanel1.add(today, BorderLayout.CENTER);\n\t\tpanel1.add(nextDay, BorderLayout.EAST);\n\n\t\t// previous month button\n\t\tJButton b1 = new JButton(\"<-\");\n\t\tb1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\t\tcal.add(Calendar.MONTH, -1);\n\t\t\t\teventsData.updateDate(cal);\n\t\t\t}\n\t\t});\n\n\t\t// next month button\n\t\tJButton b2 = new JButton(\"->\");\n\t\tb2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\t\tcal.add(Calendar.MONTH, +1);\n\t\t\t\teventsData.updateDate(cal);\n\t\t\t}\n\t\t});\n\n\t\t// Month year label\n\t\tlabel = new JLabel();\n\t\tlabel.setHorizontalAlignment(SwingConstants.CENTER);\n\n\t\t// Top2 left: panel2\n\t\tJPanel panel2 = new JPanel();\n\t\tpanel2.setLayout(new BorderLayout());\n\t\tpanel2.add(b1, BorderLayout.WEST);\n\t\tpanel2.add(label, BorderLayout.CENTER);\n\t\tpanel2.add(b2, BorderLayout.EAST);\n\n\t\tJPanel topLeft = new JPanel();\n\t\ttopLeft.setLayout(new GridLayout(2, 1));\n\t\ttopLeft.add(panel1);\n\t\ttopLeft.add(panel2);\n\n\t\t// Calendar model\n\t\tString[] columns = { \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" };\n\t\tmodel = new DefaultTableModel(null, columns) {\n\t\t\tpublic boolean isCellEditable(int row, int column) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\n\t\t// Calendar table\n\t\ttable = new JTable(model) {\n\t\t\tpublic TableCellRenderer getCellRenderer(int row, int column) {\n\t\t\t\treturn new CellRenderer();\n\t\t\t}\n\t\t};\n\t\ttable.setCellSelectionEnabled(true);\n\t\ttable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\t\ttable.addMouseListener(new MouseAdapter() {\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tint rowCal = table.getSelectedRow();\n\t\t\t\tint columnCal = table.getSelectedColumn();\n\t\t\t\tint val = (int) model.getValueAt(rowCal, columnCal);\n\t\t\t\tcal.set(Calendar.DAY_OF_MONTH, val);\n\t\t\t\teventsData.updateDate(cal);\n\t\t\t}\n\t\t});\n\n\t\t// middle left: pane1\n\t\tJScrollPane pane1 = new JScrollPane(table);\n\n\t\t// bottom left: create\n\t\tJButton create = new JButton(\"Create\");\n\t\tcreate.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tcreateFrame();\n\t\t\t}\n\t\t});\n\n\t\t// left: paneLeft\n\t\tJPanel panelLeft = new JPanel();\n\t\tpanelLeft.setLayout(new BorderLayout());\n\t\tpanelLeft.add(topLeft, BorderLayout.NORTH);\n\t\tpanelLeft.add(pane1, BorderLayout.CENTER);\n\t\tpanelLeft.add(create, BorderLayout.SOUTH);\n\n\t\t// top right\n\t\tJButton dayView = new JButton(\"Day\");\n\t\tdayView.addActionListener(eventsViewListener(DAY));\n\t\tJButton weekView = new JButton(\"Week\");\n\t\tweekView.addActionListener(eventsViewListener(WEEK));\n\t\tJButton monthView = new JButton(\"Month\");\n\t\tmonthView.addActionListener(eventsViewListener(MONTH));\n\t\tJButton agendaView = new JButton(\"Agenda\");\n\t\tagendaView.addActionListener(eventsViewListener(AGENDA));\n\t\tJButton inputFile = new JButton(\"From File\");\n\t\tinputFile.addActionListener(loadFile());\n\t\tJPanel topRightPanel = new JPanel();\n\t\ttopRightPanel.setLayout(new GridLayout(1, 5));\n\t\ttopRightPanel.add(dayView);\n\t\ttopRightPanel.add(weekView);\n\t\ttopRightPanel.add(monthView);\n\t\ttopRightPanel.add(agendaView);\n\t\ttopRightPanel.add(inputFile);\n\n\t\t// Events table\n\t\teventsTable = new JTable() {\n\t\t\tpublic Component prepareRenderer(TableCellRenderer renderer, int row, int column) {\n\t\t\t\tComponent result = super.prepareRenderer(renderer, row, column);\n\t\t\t\tif (result instanceof JComponent) {\n\t\t\t\t\t((JComponent) result).setBorder(new MatteBorder(1, 1, 0, 0, Color.BLACK));\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\n\t\tJScrollPane pane2 = new JScrollPane(eventsTable);\n\n\t\tJPanel panelRight = new JPanel();\n\t\tpanelRight.setLayout(new BorderLayout());\n\t\tpanelRight.add(topRightPanel, BorderLayout.NORTH);\n\t\tpanelRight.add(pane2, BorderLayout.CENTER);\n\n\t\tadd(panelLeft);\n\t\tadd(panelRight);\n\n\t\teventsRender = new DayViewRender();\n\t\tupdateData();\n\t\tupdateTableView();\n\t\tupdateEventsView(eventsRender);\n\n\t}", "public CalendarView(CalendarModel model) \n\t{\n\t\t//make no date be selected by giving it an impossible number\n\t\tbordered = -1;\n\t\t\n\t\tframe.setSize(700, 270);\n\t\tcModel = model;\n\t\tmonthMaxDays = cModel.getMonthMaxDays();\n\t\t\n\t\t//initialize all buttons\n\t\tnextMonth = new JButton(\"Month>\");\n\t\tprevMonth = new JButton(\"<Month\");\n\t\tnextDay = new JButton(\">\");\n\t\tprevDay = new JButton(\"<\");\n\t\tcreateButton = new JButton(\"Create\");\n\t\tcreateButton.setBackground(Color.GREEN);\n\t\tcreateButton.setFont(new Font(\"newFont\", Font.BOLD, 18));\n\t\t\n\t\tquitButton = new JButton(\"Quit\");\n\t\tquitButton.setBackground(Color.RED);\n\t\tquitButton.setForeground(Color.WHITE);\n\t\tquitButton.setFont(new Font(\"newFont\", Font.BOLD, 18));\n\t\t\n\t\t//part where all the dates are on\n\t\tnumberPanel.setLayout(new GridLayout(0,7));\n\t\t\n\t\t//box that contains the events\n\t\tDimension dim = new Dimension(300, 140);\n\t\teventsPane.setPreferredSize(dim);\n\t\teventsPane.setEditable(false);\n\t\t\n\t\t//make the new number buttons\n\t\t\n\t\tmakeDayButtons();\n\t\t\n\t\t//put in the empty buttons\n\t\tfor (int i = 1; i < cModel.findDayOfWeek(1); i++) \n\t\t{\n\t\t\tJButton emptyButton = new JButton();\n\t\t\t\n\t\t\t//these buttons will not work\n\t\t\temptyButton.setEnabled(false);\n\t\t\tnumberPanel.add(emptyButton); //add to panel\n\t\t}\n\t\t\n\t\t//add each button from ArrayList to the panel\n\t\tfor (JButton day : buttonArray) \n\t\t{\n\t\t\tnumberPanel.add(day);\n\t\t}\n\t\t\n\t\t//highlightEvents();\n\t\twriteEvents(cModel.getSelectedDate());\n\t\tborderSelected(cModel.getSelectedDate() - 1);\n\t\t\n\t\t//start adding actionListeners to the buttons\n\t\t\n\t\tnextDay.addActionListener(new \n\t\t\t\tActionListener() \n\t\t\t\t{\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t\t\t{\n\t\t\t\t\t\tmodel.nextDay();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\n\t\tprevDay.addActionListener(new \n\t\t\t\tActionListener() \n\t\t\t\t{\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t\t\t{\n\t\t\t\t\t\tmodel.previousDay();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\n\t\tnextMonth.addActionListener(new \n\t\t\t\tActionListener() \n\t\t\t\t{\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t\t\t{\n\t\t\t\t\t\tcModel.nextMonth();\n\t\t\t\t\t\tcreateButton.setEnabled(false);\n\t\t\t\t\t\teventsPane.setText(\"\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//can't switch to next date unless you select one\n\t\t\t\t\t\tnextDay.setEnabled(false);\n\t\t\t\t\t\tprevDay.setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\n\t\tprevMonth.addActionListener(new \n\t\t\t\tActionListener() \n\t\t\t\t{\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t\t\t{\n\t\t\t\t\t\tcModel.previousMonth();\n\t\t\t\t\t\tcreateButton.setEnabled(false);\n\t\t\t\t\t\teventsPane.setText(\"\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//can't switch to next date unless you select one\n\t\t\t\t\t\tnextDay.setEnabled(false);\n\t\t\t\t\t\tprevDay.setEnabled(false);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\n\t\tcreateButton.addActionListener(new ActionListener() \n\t\t{\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\tshowEventWindow();\n\t\t\t}\n\t\t});\n\t\t\n\t\tquitButton.addActionListener(new \n\t\t\t\tActionListener() \n\t\t\t\t{\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t\t\t{\n\t\t\t\t\t\t//save everything and exit screen\n\t\t\t\t\t\tcModel.saveData();\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\n\t\t\n\t\tleftContainer.setLayout(new BorderLayout());\n\t\tmonthYearLabel.setText(monthArray[cModel.getCalMonth()] + \" \" + model.getCalYear());;\n\t\tSMTWTFS.setText(\" S M T W T F S\");\n\t\t\n\t\tJPanel monthYearSMTWTFS = new JPanel();\n\t\tmonthYearSMTWTFS.setLayout(new BorderLayout());\n\t\tmonthYearSMTWTFS.add(monthYearLabel,BorderLayout.NORTH);\n\t\tmonthYearSMTWTFS.add(SMTWTFS,BorderLayout.SOUTH);\n\t\t\n\t\tJPanel createAndNextDays = new JPanel();\n\t\tcreateAndNextDays.add(createButton);\n\t\tcreateAndNextDays.add(prevDay);\n\t\tcreateAndNextDays.add(nextDay);\n\t\t\n\t\tleftContainer.add(createAndNextDays, BorderLayout.NORTH);\n\t\tleftContainer.add(monthYearSMTWTFS, BorderLayout.CENTER);\n\t\tleftContainer.add(numberPanel, BorderLayout.SOUTH);\n\t\t\n\t\t\n\t\trightContainer.setLayout(new BorderLayout());\n\t\tJScrollPane eventScroller = new JScrollPane(eventsPane);\n\t\teventScroller.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);\n\t\t\n\t\tJPanel nextMonthsAndQuit = new JPanel();\n\t\tnextMonthsAndQuit.add(prevMonth);\n\t\tnextMonthsAndQuit.add(nextMonth);\n\t\tnextMonthsAndQuit.add(quitButton);\n\t\t\n\t\tdayDateLabel.setText(dayArray[cModel.findDayOfWeek(cModel.getSelectedDate()) - 1] + \" \" + cModel.getCalMonth() + \"/\" + cModel.getCalDate());\n\t\t\n\t\trightContainer.add(nextMonthsAndQuit, BorderLayout.NORTH);\n\t\trightContainer.add(dayDateLabel, BorderLayout.CENTER);\n\t\trightContainer.add(eventScroller, BorderLayout.SOUTH);\n\t\t\n\t\t\n\t\t//add everything to the frame\n\t\tframe.setLayout(new FlowLayout());\n\t\tframe.add(leftContainer);\n\t\tframe.add(rightContainer);\n\t\t\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t//frame.pack();\n\t\tframe.setVisible(true);\n\t}", "public DashboardFrame() {\n WebLookAndFeel.install ();\n Controller = new Controller();\n initComponents();\n }", "private void init() {\n initComponents();\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(calendarPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(calendarPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));\n setVisible(true);\n setLocationRelativeTo(null);\n }", "public CalendarViewBase() {\r\n super();\r\n this.events = new ArrayList<>();\r\n this.windowControls = new WindowControls(0, 0, this.getWidth(), this.getHeight(), false);\r\n this.currentViewDate = CalendarMath.getCurrentDate();\r\n\r\n this.weekScrollPane = new ScrollPane();\r\n this.weekScrollPane.setHbarPolicy(ScrollBarPolicy.NEVER);\r\n this.weekScrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);\r\n\r\n WeekControls weekControls = new WeekControls(this.currentViewDate,\r\n event -> this.features.addEvent(event), this::refresh);\r\n\r\n LiveClock liveClock = new LiveClock(this::refresh, this.currentViewDate);\r\n\r\n StackPane topBar = new TopBar(weekControls, liveClock, this.windowControls);\r\n topBar.setOnMouseClicked(e -> {\r\n if (e.getClickCount() == 2) {\r\n this.windowControls.toggleMaximize();\r\n }\r\n });\r\n\r\n this.setTop(topBar);\r\n this.updateWeekView();\r\n }", "private void initView() {\n sdf = SimpleDateFormat.getInstance();\n\n /**\n * 自定义设置相关\n */\n MNCalendarVerticalConfig mnCalendarVerticalConfig = new MNCalendarVerticalConfig.Builder()\n .setMnCalendar_showWeek(true) //是否显示星期栏\n .setMnCalendar_showLunar(true) //是否显示阴历\n .setMnCalendar_colorWeek(\"#000000\") //星期栏的颜色\n .setMnCalendar_titleFormat(\"yyyy-MM\") //每个月的标题样式\n .setMnCalendar_colorTitle(\"#000000\") //每个月标题的颜色\n .setMnCalendar_colorSolar(\"#000000\") //阳历的颜色\n .setMnCalendar_colorLunar(\"#dcdcdc\") //阴历的颜色\n .setMnCalendar_colorBeforeToday(\"#dcdcdc\") //今天之前的日期的颜色\n .setMnCalendar_colorRangeBg(\"#A0E0BE\") //区间中间的背景颜色\n .setMnCalendar_colorRangeText(\"#FFFFFF\") //区间文字的颜色\n .setMnCalendar_colorStartAndEndBg(\"#5DC381\") //开始结束的背景颜色\n .setMnCalendar_countMonth(6) //显示多少月(默认6个月)\n .build();\n mnCalendar.setConfig(mnCalendarVerticalConfig);\n //设置导航图标要在setSupportActionBar方法之后\n setSupportActionBar(mToolbar);\n }", "private void init() {\r\n setLayout(new BorderLayout());\r\n\r\n // the embedded table\r\n calendarTable = new JCalendarTable();\r\n // catch property change event and forward them\r\n calendarTable.addPropertyChangeListener(new PropertyChangeListener() {\r\n public void propertyChange(PropertyChangeEvent evt) {\r\n firePropertyChange(evt.getPropertyName(), evt.getOldValue(),\r\n evt.getOldValue());\r\n }\r\n });\r\n // put the calendar table in a scroll pane in this component\r\n JScrollPane x = new JScrollPane(calendarTable);\r\n x.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r\n x.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);\r\n add(x, BorderLayout.CENTER);\r\n\r\n // the controls panel\r\n controlsPanel = new JPanel();\r\n add(controlsPanel,\r\n (controlsPosition == TOP ? BorderLayout.NORTH : BorderLayout.SOUTH));\r\n controlsPanel.setLayout(new BoxLayout(controlsPanel, BoxLayout.X_AXIS));\r\n\r\n // add controls\r\n controlsPanel.add(createControlButton(Calendar.YEAR, -1, 2));\r\n controlsPanel.add(createControlButton(Calendar.MONTH, -1));\r\n\r\n //the today button\r\n// JButton todayButton = new JButton(\"*\") {\r\n// public String getToolTipText(MouseEvent e) {\r\n// return getTooltipDateFormat().format(new Date());\r\n// }\r\n// };\r\n// todayButton.setToolTipText(\"Today\");\r\n// todayButton.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));\r\n// todayButton.setMargin(new Insets(0, 0, 0, 0));\r\n// todayButton.addActionListener(new ActionListener() {\r\n// public void actionPerformed(ActionEvent e) {\r\n// setTodayDate();\r\n// }\r\n// });\r\n// controlsPanel.add(todayButton);\r\n\r\n controlsPanel.add(Box.createHorizontalGlue());\r\n\r\n initMonthControl();\r\n controlsPanel.add(monthControl);\r\n\r\n controlsPanel.add(Box.createHorizontalStrut(3));\r\n\r\n initYearControl();\r\n controlsPanel.add(yearControl);\r\n\r\n controlsPanel.add(Box.createHorizontalGlue());\r\n\r\n controlsPanel.add(createControlButton(Calendar.MONTH, 1));\r\n\r\n controlsPanel.add(createControlButton(Calendar.YEAR, 1, 2));\r\n\r\n updateControlsFromTable();\r\n }", "public Calendar() {\n initComponents();\n }", "public FrameDesign() {\n initComponents();\n }", "private void initialize() throws LogicLayerException {\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(new BorderLayout(0, 0));\n\t\tframe.setSize(900, 700);\n\t\t\n\t\tCalendar calendar = new Calendar();\n\t\tStateContainer container = new StateContainer();\n\t\tcalendar.setStateContainer(container);\n\t\tframe.getContentPane().add(calendar);\n\t}", "public MainFrame() {\n initComponents();\n\n mAlmondUI.addWindowWatcher(this);\n mAlmondUI.initoptions();\n\n initActions();\n init();\n\n if (IS_MAC) {\n initMac();\n }\n\n initMenus();\n mActionManager.setEnabledDocumentActions(false);\n }", "public MCalendarEventView()\r\n {\r\n }", "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 VendaView() {\n initComponents();\n }", "public MyCalender() {\n initComponents();\n }", "public VendaComputadorView() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public FrameMain() {\n try {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n initComponents();\n refreshSchedule();\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(FrameMain.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n Logger.getLogger(FrameMain.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n Logger.getLogger(FrameMain.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedLookAndFeelException ex) {\n Logger.getLogger(FrameMain.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public MainFrame(){\n super(\"Across Madrid\");\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n setBounds(100,100,700,500);\n\n contentPane = new JPanel(new CardLayout());\n setContentPane(contentPane);\n \n fillContentPane();\n }", "public MainFrame() {\n\t\tsuper(\"Contry Detail\");\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tsetPreferredSize(new Dimension(450, 300));\n\t\tsetResizable(false);\n\t\t\n\t\tinitComponents();\n\t\t\n\t\tcontroller = new Service(this);\n\t}", "public TCalGUI() {\n\t\tthis.topFrame = new JFrame(\"TCalendar\");\n\t\tthis.calendar = new TCalendar();\n\t\tthis.currentWeek = 0; // Cursor, 0 = current week, negative for past,\n\t\t// positive for future weeks.\n\n\t\t// Initialize a monday to which weeks can be added and subtracted.\n\t\tthisMonday = new GregorianCalendar();\n\t\tthisMonday = DateCalc.startOf(thisMonday, Calendar.WEEK_OF_YEAR);\n\t\tthis.currentMonday = (GregorianCalendar) thisMonday.clone();\n\t\tJSeparator separator;\n\n\t\t// Create the menu bar.\n\t\tJMenuBar menu = new JMenuBar();\n\t\tmenu.setLayout(new BoxLayout(menu, BoxLayout.X_AXIS));\n\n\t\tseparator = new JSeparator(JSeparator.VERTICAL);\n\t\tseparator.setPreferredSize(new Dimension(10, menu.getHeight()));\n\t\tmenu.add(separator);\n\n\t\tJMenu file = new JMenu(\"File\");\n\t\tMENU_NEW = new JMenuItem(\"New Event\");\n\t\tMENU_IMPORT = new JMenuItem(\"Import Events\");\n\t\tMENU_LOAD = new JMenuItem(\"Load Calendar\");\n\t\tMENU_SAVE = new JMenuItem(\"Save Calendar\");\n\t\t// Set the action commands for the menu items.\n\t\tMENU_NEW.addActionListener(this);\n\t\tMENU_IMPORT.addActionListener(this);\n\t\tMENU_LOAD.addActionListener(this);\n\t\tMENU_SAVE.addActionListener(this);\n\n\t\tfile.add(MENU_NEW);\n\t\tfile.add(MENU_IMPORT);\n\t\tfile.add(MENU_LOAD);\n\t\tfile.add(MENU_SAVE);\n\t\tmenu.add(file);\n\n\t\tseparator = new JSeparator(JSeparator.VERTICAL);\n\t\tseparator.setPreferredSize(new Dimension(20, menu.getHeight()));\n\t\tmenu.add(separator);\n\n\t\t// Create navigation buttons for the week view.\n\t\tPREVIOUS_BUTTON = new JButton(\"Previous\");\n\t\tCURRENT_BUTTON = new JButton(\"Current\");\n\t\tNEXT_BUTTON = new JButton(\"Next\");\n\t\tPREVIOUS_BUTTON.addActionListener(this);\n\t\tCURRENT_BUTTON.addActionListener(this);\n\t\tNEXT_BUTTON.addActionListener(this);\n\n\t\t// Add to menuBar\n\t\tmenu.add(PREVIOUS_BUTTON);\n\t\tmenu.add(CURRENT_BUTTON);\n\t\tmenu.add(NEXT_BUTTON);\n\n\t\tseparator = new JSeparator(JSeparator.VERTICAL);\n\t\tseparator.setPreferredSize(new Dimension(70, menu.getHeight()));\n\t\tmenu.add(separator);\n\n\t\t// Create the GoTo textfield.\n\t\tJLabel goToLabel = new JLabel(\"Go To Date: \");\n\t\tGOTO = new JTextField();\n\t\tGOTO.addActionListener(this);\n\n\t\tmenu.add(goToLabel);\n\t\tmenu.add(GOTO);\n\n\t\tseparator = new JSeparator(JSeparator.VERTICAL);\n\t\tseparator.setPreferredSize(new Dimension(50, menu.getHeight()));\n\t\tmenu.add(separator);\n\n\t\t// Create the Month View button.\n\t\tMONTH_VIEW = new JButton(\"Month View\");\n\t\tMONTH_VIEW.addActionListener(this);\n\n\t\tmenu.add(MONTH_VIEW);\n\n\t\tseparator = new JSeparator(JSeparator.VERTICAL);\n\t\tseparator.setPreferredSize(new Dimension(50, menu.getHeight()));\n\t\tmenu.add(separator);\n\n\t\tthis.currentYear = new JLabel(\"\" + this.currentMonday.get(Calendar.YEAR));\n\t\tmenu.add(this.currentYear);\n\n\t\tseparator = new JSeparator(JSeparator.VERTICAL);\n\t\tseparator.setPreferredSize(new Dimension(300, menu.getHeight()));\n\t\tmenu.add(separator);\n\n\t\tthis.weekdates = new JToolBar();\n\t\tthis.weekdates.setLayout(new GridLayout(1, 0));\n\t\tthis.weekdates.setEnabled(false);\n\t\tthis.weekDateUpdate(new GregorianCalendar());\n\n\t\t// Create the week view with empty JTimeBlocks\n\t\tthis.weekPanel = new JPanel(new GridLayout(1, 8));\n\t\tthis.weekPanel.setBackground(Color.WHITE);\n\n\t\tJTimeBlock unit;\n\t\tJTimeBlock previousBlock = null;\n\t\tfor (int i = 1; i < 8; i++) {\n\t\t\tJPanel current = new JPanel();\n\t\t\tfor (int j = 1; j <= 24 * BLOCKS_IN_HOUR; j++) { // TimeBlocks are\n\t\t\t\t// set to be 15\n\t\t\t\t// min long.\n\t\t\t\tunit = new JTimeBlock(previousBlock);\n\t\t\t\tunit.setPreferredSize(new Dimension(50, 45));\n\t\t\t\t// Mark hours with light grey borders\n\t\t\t\tif (j % BLOCKS_IN_HOUR == 0) {\n\t\t\t\t\tunit.setBorder(BorderFactory.createMatteBorder(0, 1, 1, 1,\n\t\t\t\t\t\t\tColor.LIGHT_GRAY));\n\t\t\t\t} else {\n\t\t\t\t\tunit.setBorder(BorderFactory.createMatteBorder(0, 1, 0, 1,\n\t\t\t\t\t\t\tColor.LIGHT_GRAY));\n\t\t\t\t}\n\t\t\t\t// Add a MouseListener that processes clicks\n\t\t\t\tunit.addMouseListener(new MouseListener() {\n\n\t\t\t\t\t// Process the click\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\tprocessClick(e.getComponent());\n\t\t\t\t\t}\n\n\t\t\t\t\t// The rest intentionally left blank.\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void mouseExited(MouseEvent e) {\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void mouseEntered(MouseEvent e) {\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tcurrent.add(unit);\n\t\t\t\tpreviousBlock = unit;\n\t\t\t}\n\t\t\tcurrent.setLayout(new BoxLayout(current, BoxLayout.Y_AXIS));\n\t\t\tthis.weekPanel.add(current);\n\t\t}\n\n\t\t// Put the weekpanel, with the timeblocks, into scrollpane\n\t\tJScrollPane scrollPane = new JScrollPane(weekPanel,\n\t\t\t\tJScrollPane.VERTICAL_SCROLLBAR_ALWAYS,\n\t\t\t\tJScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n\t\tscrollPane.setLayout(new ScrollPaneLayout());\n\t\tscrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_SPEED);\n\n\t\t// Add the toolPane into its own scrollpane\n\t\tthis.toolPane = new JPanel();\n\t\tJScrollPane toolScroll = new JScrollPane(this.toolPane,\n\t\t\t\tJScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,\n\t\t\t\tJScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n\t\ttoolScroll.getVerticalScrollBar().setUnitIncrement(SCROLL_SPEED);\n\t\tJPanel week = new JPanel();\n\t\tweek.setLayout(new BoxLayout(week, BoxLayout.Y_AXIS));\n\t\tweek.add(this.weekdates);\n\t\tweek.add(scrollPane);\n\n\t\t// Add the week and tool scrollpanes to a splitpane\n\t\tJSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,\n\t\t\t\tweek, toolScroll);\n\t\tsplitPane.setResizeWeight(SPLIT_PANE_WEIGHT);\n\n\t\t// Add all the components to the frame and show the GUI\n\t\tthis.topFrame.add(splitPane);\n\t\tthis.topFrame.setJMenuBar(menu);\n\t\tthis.topFrame.setSize(1200, 800);\n\t\tthis.topFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tthis.topFrame.setVisible(true);\n\n\t}", "public MainView() {\n initComponents();\n setExtendedState(javax.swing.JFrame.MAXIMIZED_BOTH);\n }", "public CalendarDemo() {\r\n super();\r\n JPanel tmpPanel = new JPanel();\r\n tmpPanel.setLayout( new GridBagLayout() );\r\n GridBagConstraints c = new GridBagConstraints();\r\n\r\n c.fill = GridBagConstraints.BOTH;\r\n c.gridx = 0;\r\n c.gridy = 0;\r\n c.weightx = 1;\r\n c.weighty = 1;\r\n c.gridheight = 2;\r\n tmpPanel.add(chart[0], c);\r\n\r\n c.gridx = 1;\r\n c.gridy = 0;\r\n c.weightx = 0.4;\r\n c.weighty = 0.4;\r\n c.gridheight = 1;\r\n tmpPanel.add(chart[1], c);\r\n\r\n c.gridx = 1;\r\n c.gridy = 1;\r\n c.weightx = 0.3;\r\n c.weighty = 0.6;\r\n c.gridheight = 1;\r\n tmpPanel.add(chart[2], c);\r\n\r\n setSamplePane(tmpPanel);\r\n\r\n weekDaysButton.addItemListener(this);\r\n monthNameButton.addItemListener(this);\r\n editButton.addActionListener(this);\r\n }", "public Frame() {\n initComponents();\n }", "public Frame() {\n initComponents();\n }", "public Appointment()\r\n {\r\n // cView = new CalendarEventView(\"appointmentView\");\r\n }", "private void initFrame() {\n setLayout(new BorderLayout());\n }", "public SMFrame() {\n initComponents();\n updateComponents();\n }", "private void initialize()\n\t{\n\t\tthis.setModal(true);\t\t\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setSize(450,400);\n\t\tScreenResolution.centerComponent(this);\n\t}", "public MainFrame() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public RoomSchedulerFrame()\n {\n initComponents();\n \n // Load the combo boxes with data.\n rebuildFacultyComboBoxes();\n }", "private void initialize() {\r\n\t\tfrmStudentSchedule = new JFrame();\r\n\t\tfrmStudentSchedule.getContentPane().setBackground(new Color(255, 250, 250));\r\n\t\tfrmStudentSchedule.setBounds(100, 100, 693, 423);\r\n\t\tfrmStudentSchedule.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tfrmStudentSchedule.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tUtilDateModel model = new UtilDateModel();\r\n\t\tProperties p = new Properties();\r\n\t\tp.put(\"text.today\", \"Today\");\r\n\t\tp.put(\"text.month\", \"Month\");\r\n\t\tp.put(\"text.year\", \"Year\");\r\n\t\tJDatePanelImpl datePanel = new JDatePanelImpl(model, p);\r\n\t\tJDatePickerImpl datePicker = new JDatePickerImpl(datePanel, new DateLabelFormatter());\r\n\t\tdatePicker.setDoubleClickAction(true);\r\n\t\tdatePicker.setBounds(52, 11, 216, 23);\r\n frmStudentSchedule.getContentPane().add(datePicker);\r\n\t\t\r\n\t\tJScrollPane scrollPane = new JScrollPane();\r\n\t\tscrollPane.setBounds(48, 168, 539, 173);\r\n\t\tfrmStudentSchedule.getContentPane().add(scrollPane);\r\n\t\t\r\n\t\tstudentSchedule = new JTable();\r\n\t\tstudentSchedule.setBackground(new Color(255, 255, 255));\r\n\t\tscrollPane.setViewportView(studentSchedule);\r\n\t\tstudentSchedule.setModel(new DefaultTableModel(\r\n\t\t\tnew Object[][] {\r\n\t\t\t\t{null, null, null, null, null, null, null},\r\n\t\t\t\t{null, null, null, null, null, null, null},\r\n\t\t\t\t{null, null, null, null, null, null, null},\r\n\t\t\t},\r\n\t\t\tnew String[] {\r\n\t\t\t\t\"Day\", \"Period 1\", \"Period 2\", \"Period 3\", \"Period 4\", \"Period 5\", \"Period 6\"\r\n\t\t\t}\r\n\t\t) {\r\n\t\t\tClass[] columnTypes = new Class[] {\r\n\t\t\t\tString.class, String.class, String.class, String.class, String.class, String.class, String.class\r\n\t\t\t};\r\n\t\t\tpublic Class getColumnClass(int columnIndex) {\r\n\t\t\t\treturn columnTypes[columnIndex];\r\n\t\t\t}\r\n\t\t\tboolean[] columnEditables = new boolean[] {\r\n\t\t\t\tfalse, false, false, false, false, false, false\r\n\t\t\t};\r\n\t\t\tpublic boolean isCellEditable(int row, int column) {\r\n\t\t\t\treturn columnEditables[column];\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tlblCourse = new JLabel(\"Course\");\r\n\t\tlblCourse.setBounds(52, 65, 46, 14);\r\n\t\tfrmStudentSchedule.getContentPane().add(lblCourse);\r\n\t\t\r\n\t\tlblYear = new JLabel(\"Year\");\r\n\t\tlblYear.setBounds(52, 110, 46, 14);\r\n\t\tfrmStudentSchedule.getContentPane().add(lblYear);\r\n\t\t\r\n\t\tcomboBox = new JComboBox();\r\n\t\tcomboBox.setBounds(139, 62, 67, 20);\r\n\t\tfrmStudentSchedule.getContentPane().add(comboBox);\r\n\t\t\r\n\t\tcomboBox_1 = new JComboBox();\r\n\t\tcomboBox_1.setBounds(139, 107, 67, 20);\r\n\t\tfrmStudentSchedule.getContentPane().add(comboBox_1);\r\n\t\t\r\n\t\tlblSemester = new JLabel(\"Semester\");\r\n\t\tlblSemester.setBounds(266, 65, 46, 14);\r\n\t\tfrmStudentSchedule.getContentPane().add(lblSemester);\r\n\t\t\r\n\t\tlblSection = new JLabel(\"Section\");\r\n\t\tlblSection.setBounds(266, 110, 46, 14);\r\n\t\tfrmStudentSchedule.getContentPane().add(lblSection);\r\n\t\t\r\n\t\tcomboBox_2 = new JComboBox();\r\n\t\tcomboBox_2.setBounds(338, 59, 67, 20);\r\n\t\tfrmStudentSchedule.getContentPane().add(comboBox_2);\r\n\t\t\r\n\t\tcomboBox_3 = new JComboBox();\r\n\t\tcomboBox_3.setBounds(338, 104, 67, 20);\r\n\t\tfrmStudentSchedule.getContentPane().add(comboBox_3);\r\n\t\t\r\n\t\tlblDepartment = new JLabel(\"Department\");\r\n\t\tlblDepartment.setBounds(471, 65, 83, 14);\r\n\t\tfrmStudentSchedule.getContentPane().add(lblDepartment);\r\n\t\t\r\n\t\tcomboBox_4 = new JComboBox();\r\n\t\tcomboBox_4.setBounds(551, 62, 67, 20);\r\n\t\tfrmStudentSchedule.getContentPane().add(comboBox_4);\r\n\t\t\r\n\t\tbtnSubmit = new JButton(\"Submit\");\r\n\t\tbtnSubmit.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\r\n\t\t\t\tString month = \"\";\r\n\t\t\t\tswitch(model.getMonth()) {\r\n\t\t\t\t\tcase 0: month = \"Jan\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 1: month = \"Feb\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2: month = \"Mar\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3: month = \"Apr\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 4: month = \"May\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 5: month = \"Jun\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 6: month = \"Jul\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 7: month = \"Aug\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 8: month = \"Sep\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 9: month = \"Oct\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 10: month = \"Nov\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 11: month = \"Dec\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tString date = model.getDay()+\"-\"+month+\"-\"+model.getYear();\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnSubmit.setBounds(471, 106, 89, 23);\r\n\t\tfrmStudentSchedule.getContentPane().add(btnSubmit);\r\n\t\tstudentSchedule.getColumnModel().getColumn(0).setResizable(false);\r\n\t\tstudentSchedule.getColumnModel().getColumn(1).setResizable(false);\r\n\t\tstudentSchedule.getColumnModel().getColumn(2).setResizable(false);\r\n\t\tstudentSchedule.getColumnModel().getColumn(3).setResizable(false);\r\n\t\tstudentSchedule.getColumnModel().getColumn(4).setResizable(false);\r\n\t\tstudentSchedule.getColumnModel().getColumn(5).setResizable(false);\r\n\t\tstudentSchedule.getColumnModel().getColumn(6).setResizable(false);\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}", "public YearPage() {\n getStyleClass().add(\"year-page\");\n\n this.yearView = new YearView();\n\n this.monthSheetView = new MonthSheetView();\n this.monthSheetView.setCellFactory(param -> new MonthSheetView.DetailedDateCell(param.getView(), param.getDate()));\n this.monthSheetView.setClickBehaviour(ClickBehaviour.SHOW_DETAILS);\n\n bind(yearView, true);\n bind(monthSheetView, true);\n\n Bindings.bindBidirectional(monthSheetView.showTodayProperty(), showTodayProperty());\n\n setDateTimeFormatter(DateTimeFormatter.ofPattern(Messages.getString(\"YearPage.DATE_FORMAT\")));\n\n displayModeProperty().addListener(it -> updateDisplayModeIcon());\n\n displayModeButton = new ToggleButton();\n displayModeButton.setMaxHeight(Double.MAX_VALUE);\n displayModeButton.setId(\"display-mode-button\");\n displayModeButton.setTooltip(new Tooltip(Messages.getString(\"YearPage.TOOLTIP_DISPLAY_MODE\")));\n displayModeButton.setSelected(getDisplayMode().equals(DisplayMode.COLUMNS));\n displayModeButton.selectedProperty().addListener(it -> {\n if (displayModeButton.isSelected()) {\n setDisplayMode(DisplayMode.COLUMNS);\n } else {\n setDisplayMode(DisplayMode.GRID);\n }\n });\n\n displayModeProperty().addListener(it -> displayModeButton.setSelected(getDisplayMode().equals(DisplayMode.COLUMNS)));\n\n updateDisplayModeIcon();\n }", "public MainView() {\n initComponents();\n \n }", "public FrameOpcoesAgenda() {\n initComponents();\n }", "public MainView() {\n initComponents();\n }", "public MainView() {\n initComponents();\n }", "public IView() {\n initComponents();\n setLocationRelativeTo(null); //Center form on screen\n }", "public MercadoFrame() {\n initComponents();\n }", "public MainFrame() {\n \n initComponents();\n \n this.initNetwork();\n \n this.render();\n \n }", "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\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 View() {\n initComponents();\n }", "private void agendaFrame() {\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tfinal JFrame frame = new JFrame(\"Please select a time period.\");\n\t\t\t\tframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\t\t\ttry {\n\t\t\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tJPanel panel = new JPanel();\n\t\t\t\tpanel.setLayout(new GridLayout(1, 4));\n\t\t\t\t//JTextField d = new JTextField(\"\" + year + \"/\" + month + \"/\" + day);\n\t\t\t\tfinal JTextField startDate = new JTextField(\"1\" + \"/1\" + \"/2016\");\n\t\t\t\tJTextField to = new JTextField(\"to\");\n\t\t\t\tto.setEditable(false);\n\t\t\t\tfinal JTextField endDate = new JTextField(\"1\" + \"/2\" + \"/2016\");\n\t\t\t\tJButton go = new JButton(\"Go\");\n\t\t\t\t\n\t\t\t\tgo.addActionListener(new ActionListener() {\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\teventsRender = new AgendaViewRender();\n\t\t\t\t\t\tAgendaViewRender.setStartDate(startDate.getText());\n\t\t\t\t\t\tAgendaViewRender.setEndDate(endDate.getText());\n\t\t\t\t\t\tupdateEventsView(eventsRender);\n\t\t\t\t\t\tframe.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tpanel.add(startDate);\n\t\t\t\tpanel.add(to);\n\t\t\t\tpanel.add(endDate);\n\t\t\t\tpanel.add(go);\n\t\t\t\t\n\t\t\t\tframe.setSize(500, 100);\n\t\t\t\tframe.setLayout(new GridLayout(2, 1));\n\t\t\t\tframe.add(panel);\n\t\t\t\tframe.setLocationByPlatform(true);\n\t\t\t\tframe.setVisible(true);\n\n\t\t\t}\n\t\t});\n\t}", "public MFrame() {\n this.setTitle(\"Sistema Punto de Venta\");\n this.setLocationRelativeTo(null);\n this.setSize(new Dimension(800,600));\n this.setResizable(true);\n this.setVisible(true);\n initComponents();\n this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\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 MainApp() {\r\n\t\tsuper();\r\n\t\tthis.setSize(642, 455);\r\n\t\tthis.setContentPane(getJContentPane());\r\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() {\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 initialize() {\n\t\tthis.setSize(329, 270);\n\t\tthis.setContentPane(getJContentPane());\n\t}", "public Jframe() {\n initComponents();\n setIndice();\n loadTextBoxs();\n }", "public YearPanel(CalendarEx calendar) {\n initComponents();\n cal = calendar;\n year = CalendarEx.getCurrentYear();\n \n ListAppointMents();\n }", "public BaseView() {\r\n\t\tsuper();\r\n\t\tthis.modelView = new BaseModelView();\r\n\t\tthis.buildLayout();\r\n\t\tthis.setVisible(true);\r\n\t}", "public void createCalenderView() {\n fill();\n\n int currentDateGrid = 0;\n everydayGridPane.setBackground(new Background(\n new BackgroundFill(Color.valueOf(\"383838\"), CornerRadii.EMPTY, Insets.EMPTY)));\n dateGridPane.setBackground(new Background(\n new BackgroundFill(Color.valueOf(\"383838\"), CornerRadii.EMPTY, Insets.EMPTY)));\n\n for (int row = 0; row <= 5; row++) {\n for (int col = 0; col <= 6; col++) {\n VBox holder = placeHolderForLabel();\n\n if ((currentDateGrid < previousMonthBalance)\n || (currentDateGrid > TOTAL_NUM_OF_DATEGRID - 1 - nextMonthBalance)) {\n holder.setBlendMode(BlendMode.SOFT_LIGHT);\n }\n\n if ((currentDateGrid == previousMonthBalance + day - 1)\n && (isSameMonth(datePointer, fixedDatePointer))) {\n holder.setBackground(new Background(\n new BackgroundFill(Color.DARKORANGE.darker(), CornerRadii.EMPTY, Insets.EMPTY)));\n\n holder.setBorder(new Border(new BorderStroke(Color.valueOf(\"#FFFFFF\"),\n BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1))));\n }\n\n Label labelDay = createLabelDay(simulateGridPane[currentDateGrid]);\n holder.getChildren().add(labelDay);\n dateGridPane.add(holder, col, row);\n GridPane.setHalignment(holder, HPos.CENTER);\n GridPane.setValignment(holder, VPos.CENTER);\n\n currentDateGrid++;\n }\n }\n }", "public FrameControl() {\n initComponents();\n }", "public GUI() {\n super(\"Day Planner\");\n setSize(465,550);\n setDefaultCloseOperation(EXIT_ON_CLOSE);\n addWindowListener(new CheckOnExit() {});\n basePanel = new JPanel(new CardLayout());\n init();\n \n \n basePanel.setVisible(true);\n add(basePanel);\n }", "public Mainframe() {\n initComponents();\n }", "public MainWindow() {\n Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();\n this.setBounds(screenSize.width/2-150, screenSize.height/2-75, 300, 150);\n initComponents();\n }", "public ClientMainView() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public ColorPickerMainFrame()\n {\n initComponents();\n \n getContentPane().add(panel);\n setSize(640, 640);\n }", "public JCalendar() {\r\n init();\r\n resetToDefaults();\r\n }", "private void initialize() {\n this.setSize(300, 200);\n this.setContentPane(getJContentPane());\n this.pack();\n }", "public SceneJFrameController(Scene model, SceneEditorVisual view) {\r\n this.model = model;\r\n this.view = view;\r\n }", "public MainFrameController() {\n }", "public AcademicDepartmentFrame() {\n initComponents();\n }", "private void initView() {\n\n SwingUtilities.invokeLater(() -> {\n view = new MainWindow();\n view.setMinimumSize(new Dimension(1080, 720));\n view.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n view.setVisible(true);\n view.aboutListener(actionEvent -> showAboutDialog());\n view.helpListener(actionEvent -> showHelpDialog());\n view.addComboBox(comboBox);\n\n });\n\n }", "public HomeFrame() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "private void initialize() {\r\n this.setSize(new Dimension(666, 723));\r\n this.setContentPane(getJPanel());\r\n\t\t\t\r\n\t}", "public BreukFrame() {\n super();\n initialize();\n }", "private void initialize() {\n\t\tthis.setSize(211, 449);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setTitle(\"JFrame\");\n\t}", "public ContractView() {\n initComponents();\n }", "View(Controller c, Model m){\r\n\t\tmodel = m;\r\n\t\tcontroller = c;\r\n\t\tbackground = null;\r\n\t\tground = null;\r\n\t\twindowHeight = 0;\r\n\t}", "public JGSFrame() {\n\tsuper();\n\tinitialize();\n }", "public BuilderView(Model model, JPanel parent, BuilderApplication app) {\n\t\tsuper();\n\t\tthis.model = model;\n\t\tthis.cardLayoutPanel = parent;\n\t\tthis.bgColor = new Color(178, 34, 34);\n\t\tthis.app = app;\n\t\tthis.labelFont = new Font(\"Times New Roman\", Font.BOLD, 18);\n\t\tsetBackground(new Color(102,255,102));\n\t\tinitialize();\n\t}", "public BattleMatLayout() {\n\t\tcreateConent();\n\t\tinitWidget(dockPanel);\n\t\t// ensure this widget takes up as much space as possible\n\t\tthis.setSize(\"100%\", \"100%\");\n\t\tsetupEventHandler();\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(50, 50, 1050, 650);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tmtopJPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));\n\t\tframe.getContentPane().add(mtopJPanel, BorderLayout.NORTH);\n\t\ttopPanel();\n\t\t\n\t\tmleftJPanel = new JPanel();\n\t\tframe.getContentPane().add(mleftJPanel, BorderLayout.WEST);\n\t\twestPanel();\n\t\t\n\t\tmcenterJPanel = new JPanel();\n\t\tframe.getContentPane().add(mcenterJPanel, BorderLayout.CENTER);\n\t\tcenterPanel();\n\t\t\n\t\tmbottomJPanel = new JPanel();\n\t\tframe.getContentPane().add(mbottomJPanel, BorderLayout.SOUTH);\n\t\tbottomPanel();\n\t\t\n\t}", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public MainFrame() {\n initComponents();\n \n }", "public MainFrame() {\n super(\"ToDo List\");\n setLayout(new BorderLayout());\n toDoList = new ToDoList();\n toDoList.loadAll(fileLocation);\n initializeButtonPanel();\n add(buttonPanel, BorderLayout.NORTH);\n add(radioPanel, BorderLayout.LINE_START);\n\n setSize(1000, 1000);\n setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n setVisible(true);\n setListeners();\n exitListener();\n refresh();\n }", "public View(Model m) {\n super(\"Group G: Danmarkskort\");\n model = m;\n iconPanel.addObserverToIcons(this);\n routePanel = new RouteView(this, model);\n optionsPanel = new OptionsPanel(this,model);\n /*Three helper functions to set up the AffineTransform object and\n make the buttons and layout for the frame*/\n setScale();\n makeGUI();\n adjustZoomFactor();\n\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\n //This sets up a listener for when the frame is re-sized.\n createComponentListener();\n\n pack();\n canvas.requestFocusInWindow();\n model.addObserver(this);\n }", "private void setUpFrame() {\n rootPanel = new JPanel();\n rootPanel.setLayout(new BorderLayout());\n rootPanel.setBackground(Color.darkGray);\n }", "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}", "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 CalendarModel() {\n events = new ArrayList<>();\n }", "private void initialize() {\n\t\tthis.setBounds(100, 100, 950, 740);\n\t\tthis.setLayout(null);\n\n\t\n\t}", "public void init() {\n\t\tJFrame frame = new JFrame(\"员工管理系统\");\r\n\t\tframe.setSize(300, 200);\r\n\t\tframe.setLocationRelativeTo(null);// 居中\r\n\t\tframe.setResizable(false);// 不可放大\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// 关闭立即退出\r\n\t\tJPanel jPanel = (JPanel) frame.getContentPane();// 获得主面板\r\n\t\t\r\n\t\tjPanel.setLayout(new FlowLayout());\r\n\t\t\r\n\t\tempBt = new JButton(\"员工管理\");\r\n\t\t\r\n\t\tempBt.setPreferredSize(new Dimension(120, 70));\r\n\t\tempBt.addActionListener(new ActionListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tnew EmployeeView().init();\r\n\t\t\t}\r\n\t\t});\r\n\t\tdeptBt = new JButton(\"部门管理\");\r\n\t\tdeptBt.setPreferredSize(new Dimension(120, 70));\r\n\t\tdeptBt.addActionListener(new ActionListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tnew DeptView().init();\r\n\t\t\t}\r\n\t\t});\r\n\t\tprojectBt = new JButton(\"项目管理\");\r\n\t\tprojectBt.setPreferredSize(new Dimension(120, 70));\r\n\t\tprojectBt.addActionListener(new ActionListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tnew ProjectView().init();\r\n\t\t\t}\r\n\t\t});\r\n\t\tscBt = new JButton(\"绩效管理\");\r\n\t\tscBt.setPreferredSize(new Dimension(120, 70));\r\n\t\tscBt.addActionListener(new ActionListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tnew ScoreView().init();\r\n\t\t\t}\r\n\t\t});\r\n\t\tjPanel.add(empBt);\r\n\t\tjPanel.add(deptBt);\r\n\t\tjPanel.add(projectBt);\r\n\t\tjPanel.add(scBt);\r\n\t\tframe.setVisible(true);\r\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 createFrame() {\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tfinal JFrame frame = new JFrame(\"Create Event\");\n\t\t\t\tframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\t\t\ttry {\n\t\t\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tfinal JTextArea textArea = new JTextArea(15, 50);\n\t\t\t\ttextArea.setText(\"Untitled Event\");\n\t\t\t\ttextArea.setWrapStyleWord(true);\n\t\t\t\ttextArea.setEditable(true);\n\t\t\t\ttextArea.setFont(Font.getFont(Font.SANS_SERIF));\n\n\t\t\t\tJPanel panel = new JPanel();\n\t\t\t\tpanel.setLayout(new GridLayout(1, 4));\n\t\t\t\tfinal JTextField d = new JTextField(\"\" + year + \"/\" + month + \"/\" + day);\n\t\t\t\tfinal JTextField startTime = new JTextField(\"1:00am\");\n\t\t\t\tJTextField t = new JTextField(\"to\");\n\t\t\t\tt.setEditable(false);\n\t\t\t\tfinal JTextField endTime = new JTextField(\"2:00am\");\n\t\t\t\tJButton save = new JButton(\"Save\");\n\t\t\t\tpanel.add(d);\n\t\t\t\tpanel.add(startTime);\n\t\t\t\tpanel.add(t);\n\t\t\t\tpanel.add(endTime);\n\t\t\t\tpanel.add(save);\n\n\t\t\t\tsave.addActionListener(new ActionListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\teventsData.addEvent(new Event(YYYYMMDD(d.getText().trim()), startTime.getText(),\n\t\t\t\t\t\t\t\t\tendTime.getText(), textArea.getText()));\n\t\t\t\t\t\t\tupdateEventsView(eventsRender);\n\t\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\t\tif (ex instanceof IllegalArgumentException)\n\t\t\t\t\t\t\t\tpromptMsg(ex.getMessage(), \"Error\");\n\t\t\t\t\t\t\telse promptMsg(ex.getMessage(), \"Error\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tframe.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tframe.setSize(500, 100);\n\t\t\t\tframe.setLayout(new GridLayout(2, 1));\n\t\t\t\tframe.add(textArea);\n\t\t\t\tframe.add(panel);\n\t\t\t\tframe.setLocationByPlatform(true);\n\t\t\t\tframe.setVisible(true);\n\t\t\t}\n\t\t});\n\t}", "public JFrame_05_Mayor_De_10() {\n initComponents();\n \n }", "public GameFrame() {\n\t\tsuper(\"Treasure Hunt - Game\");\n\t\tthis.setSize(1800,1000);\n\t\t\n\t\tthis.setVisible(true);\n\t\tthis.setDefaultCloseOperation(EXIT_ON_CLOSE);\n\t\tthis.setMinimumSize(new Dimension(1775,850));\n\t\tthis.setLocationRelativeTo(null);\n\t\t\n\t\tthis.controller = new Controller(this);\n\t\t\n\t\t// Main container\n\t\tContainer main = this.getContentPane();\n\t\tmain.setLayout(new BorderLayout());\n\t\t\n\t\t// Buttons pane\n\t\tGameButtonsPanel buttonsPane = new GameButtonsPanel(controller);\n\t\tmain.add(buttonsPane,\"North\");\n\t\tthis.buttonsPanel = buttonsPane;\n\t\t\n\t\t// Game pane\n\t\tthis.gamePanel = new GamePanel(this);\n\t\tmain.add(gamePanel);\n\t\t\n\t\t\n\t\t// Menu bar\n\t\tthis.menuBar = new GameMenuBar(controller);\n\t\tthis.setJMenuBar(this.menuBar);\n\t\t\n\t\t\n\t\tthis.revalidate();\n\t\n\t}", "public ViewClass() {\n\t\tcreateGUI();\n\t\taddComponentsToFrame();\n\t\taddActionListeners();\n\t}", "public SimulationView() {\n initComponents();\n }", "public void initializeFrame() {\n frame.getContentPane().removeAll();\n createComponents(frame.getContentPane());\n// frame.setSize(new Dimension(1000, 600));\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}", "public CalendarPage() {\n\t\t\n\t\tPageFactory.initElements(driver, this);\n\t}", "public MainFrame() {\n try {\n initComponents();\n initElements();\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Error \" + e.getMessage());\n }\n }", "public FrameForm() {\n initComponents();\n }", "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}", "public mainframe() {\n initComponents();\n }", "public CardLayoutJFrame() {\n initComponents();\n }" ]
[ "0.725563", "0.69392174", "0.6462917", "0.6291406", "0.62775415", "0.62755287", "0.615286", "0.61296856", "0.6107129", "0.6096308", "0.60946196", "0.60836804", "0.6071087", "0.6058572", "0.6056666", "0.60072803", "0.5996306", "0.59822255", "0.59422046", "0.59359145", "0.59176034", "0.5911029", "0.58929425", "0.58929425", "0.5858471", "0.584275", "0.58253103", "0.5815943", "0.58135915", "0.5807219", "0.5803646", "0.5800956", "0.5793743", "0.57901245", "0.57858324", "0.5781011", "0.5781011", "0.57802016", "0.5771938", "0.57715285", "0.5765049", "0.57620436", "0.5757877", "0.573872", "0.57334846", "0.5713606", "0.57013434", "0.56994814", "0.56888914", "0.5681613", "0.56765693", "0.5642548", "0.5639965", "0.5636702", "0.56338394", "0.56318456", "0.5629844", "0.56283754", "0.56232125", "0.5619598", "0.5616696", "0.56166756", "0.5614609", "0.560829", "0.5604344", "0.5603838", "0.5590271", "0.5590026", "0.55786663", "0.5570964", "0.5565237", "0.55650634", "0.55614597", "0.55511093", "0.55510134", "0.5550725", "0.5550324", "0.5545899", "0.5544859", "0.55441695", "0.5543537", "0.55399513", "0.55391103", "0.55323076", "0.5528074", "0.5521462", "0.5520016", "0.5515268", "0.5514123", "0.5510105", "0.55022955", "0.54963195", "0.5496127", "0.5494677", "0.549315", "0.5492935", "0.54891306", "0.54834104", "0.54787403", "0.5478458" ]
0.85189754
0
Created by nacheteam on 19/06/16.
public interface HashtagsPresenter { void onResume(); void onPause(); void onDestroy(); void getHashtagsTweets(); void onEventMainThread(HashtagsEvent event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public final void mo51373a() {\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}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "public void mo38117a() {\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@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 rozmnozovat() {\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "private void poetries() {\n\n\t}", "@Override\n public void init() {\n }", "@Override\n protected void initialize() {\n\n \n }", "private void m50366E() {\n }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n public void init() {}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "private void init() {\n\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\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}", "private void kk12() {\n\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic void init() {\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\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 public int describeContents() { return 0; }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "protected void mo6255a() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "public void mo6081a() {\n }", "@Override\n public void initialize() { \n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}" ]
[ "0.61339265", "0.6070707", "0.5968594", "0.58937716", "0.5857141", "0.5857141", "0.584032", "0.5835843", "0.5833992", "0.58150893", "0.58018553", "0.58001566", "0.579935", "0.5763064", "0.5736162", "0.57359016", "0.57359016", "0.57359016", "0.57359016", "0.57359016", "0.572839", "0.5717679", "0.5711055", "0.57044166", "0.5704045", "0.56823784", "0.5679747", "0.56678855", "0.5657501", "0.5646657", "0.5646657", "0.5644534", "0.56254226", "0.56246567", "0.56147176", "0.5610862", "0.56018376", "0.5593811", "0.55881333", "0.5582066", "0.55715126", "0.55715126", "0.55715126", "0.5571187", "0.5564886", "0.5564886", "0.5564886", "0.55637634", "0.55637634", "0.55637634", "0.5559825", "0.5555181", "0.5555105", "0.5552422", "0.5546347", "0.5546347", "0.5546347", "0.5546347", "0.5546347", "0.5546347", "0.55435866", "0.55415666", "0.5540564", "0.55346155", "0.55345523", "0.55345523", "0.5532564", "0.5532564", "0.55203706", "0.5520172", "0.5518176", "0.55069697", "0.55041385", "0.5497343", "0.54954803", "0.54909045", "0.548703", "0.5482986", "0.5458235", "0.5458235", "0.5458235", "0.5458235", "0.5458235", "0.5458235", "0.5458235", "0.54458123", "0.54322225", "0.54232395", "0.5416714", "0.5416714", "0.5414708", "0.5414708", "0.54113054", "0.54022956", "0.53893155", "0.5389155", "0.5387612", "0.53845006", "0.5384286", "0.538325", "0.5373918" ]
0.0
-1
Factory method to create a Props.
public static Props props( final TcpSink sink, final String serverAddress, final int serverPort, final int maximumQueueSize, final Duration exponentialBackoffBase) { return Props.create(TcpSinkActor.class, sink, serverAddress, serverPort, maximumQueueSize, exponentialBackoffBase); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Props props () {\n return Props.create(Parent.class);\n }", "Property createProperty();", "public static Props getProps() {\n return Props.create((PrinterActor.class));\n }", "static public Props props(ActorRef printerActor) {\n return Props.create(Greeter.class, () -> new Greeter(printerActor));\n }", "protected abstract Property createProperty(String key, Object value);", "public static Props props(final MetricsFactory metricsFactory) {\n return Props.create(\n ProxyConnection.class,\n metricsFactory);\n }", "PropertyType createPropertyType();", "public static Props props(String name){\n return Props.create(Cinema.class, name);\n }", "Properties getProps()\n {\n return props;\n }", "public Property createProperty() {\n Property p = new Property();\n p.setProject(getProject());\n p.setTaskName(\"property\");\n properties.addElement(p);\n return p;\n }", "public static Props createActor() {\n\t\treturn Props.create(Merger.class, () -> {\n\t\t\treturn new Merger();\n\t\t});\n\t}", "public void init(Properties props) ;", "public interface PropertiesFactory {\n\n\t/**\n\t * Creates properties list.\n\t * @param app properties for app\n\t * @param localization localization for properties\n\t * @param onLanguageSetCallback callback when language is set\n\t * @return a list of properties\n\t */\n\tList<PropertiesArray> createProperties(App app, Localization localization,\n\t\t\tLanguageProperty.OnLanguageSetCallback onLanguageSetCallback);\n}", "public static Props props(){\n return Props.create(ManagingServer.class,ManagingServer::new);\n }", "Object getProps();", "public static Props props(final ActorRef target, final int numMessages) { \n return Props.create(new SRACreator(target, numMessages));\n }", "public Propuestas() {}", "public static Property createProperty(String key, String value) {\n Property prop = new Property();\n prop.setKey(key);\n prop.setValue(value);\n\n return prop;\n }", "public PropertyRefs(Properties p) {\n props = p;\n }", "public Property createProperty() {\n if (newProject == null) {\n reinit();\n }\n Property p = new Property(true, getProject());\n p.setProject(newProject);\n p.setTaskName(\"property\");\n properties.addElement(p);\n return p;\n }", "public PropertyParser(Properties props)\n\t{\n\t\t_props = props;\n\t}", "public void init(java.util.Properties props) {\r\n }", "public static final CMProps instance() {\n final CMProps p = p();\n if (p == null)\n return new CMProps();\n return p;\n }", "PropertyRule createPropertyRule();", "private PropertySetFactory() {}", "public static Props props(String groupId){\n\t\treturn Props.create(DeviceGroup.class, groupId);\n\t}", "@Override\n public ICMakeBuildElement createBuildProperties(Path path) {\n return CMakeBuildProperties.make(path);\n }", "public Object prop(String name, String type);", "public Properties(){\n\n }", "protected Properties newTestProperties() throws IOException\n {\n Properties props = new Properties();\n storeTestConf(props); \n return props;\n }", "private static Map<String, String> createPropertiesAttrib() {\r\n Map<String, String> map = new HashMap<String, String>();\r\n map.put(\"Property1\", \"Value1SA\");\r\n map.put(\"Property3\", \"Value3SA\");\r\n return map;\r\n }", "P createP();", "Context createContext( Properties properties ) throws NamingException;", "@Override\n public ICMakeBuildElement createBuildProperties(Path path) {\n return CMakeBuildProperties.make();\n }", "public Property(int xLength, int yWidth, int xLeft, int yTop) {\n this(xLength, yWidth, xLeft, yTop, DEFAULT_REGNUM);\n }", "public Property() {}", "protected Map createPropertiesMap() {\n return new HashMap();\n }", "public static SystemProps getProperty(String propID, boolean create)\n throws DBException\n {\n\n /* key specified? */\n if (StringTools.isBlank(propID)) {\n // invalid key specified\n throw new DBNotFoundException(\"Propery key/id not specified.\");\n }\n\n /* get/create */\n SystemProps prop = null;\n SystemProps.Key propKey = new SystemProps.Key(propID);\n if (!propKey.exists()) {\n if (create) {\n prop = propKey.getDBRecord();\n prop.setCreationDefaultValues();\n prop.setDescription(propID); // set description to original key case\n return prop; // not yet saved!\n } else {\n throw new DBNotFoundException(\"Property-ID does not exists: \" + propKey);\n }\n } else\n if (create) {\n // we've been asked to create the property, and it already exists\n throw new DBAlreadyExistsException(\"Property-ID already exists: \" + propKey);\n } else {\n prop = propKey.getDBRecord(true);\n if (prop == null) {\n throw new DBException(\"Unable to read existing Property-ID: \" + propKey);\n }\n return prop;\n }\n\n }", "public PropList(Context context) {\n props = new ArrayList<>(Arrays.asList(\n new Prop(context, 12, (float) 4.5, (float) 3.5, R.drawable.tree_brown, true),\n new Prop(context, 30, 6, (float) 4.5, R.drawable.twigs_brown, false),\n new Prop(context, 12, (float) 3.5, (float) 11.5, R.drawable.tree_brown, true),\n new Prop(context, 30, 5, (float) 12.5, R.drawable.twigs_brown, false),\n new Prop(context, 12, (float) 9.5, 8, R.drawable.tree_brown, true),\n new Prop(context, 56, (float) 11.5, (float) 3.2, R.drawable.fence_red_vertical, true)\n ));\n }", "public static Props createActor(int ID, int nb) {\n return Props.create(Process.class, () -> {\n return new Process(ID, nb);\n });\n }", "public JavaPropertyWriter(final Properties props) {\n Assert.exists(props, Properties.class);\n\n m_props = props;\n }", "InjectProperty create(ContextManagerFactory contextManagerFactory, Method property);", "public Properties getProperties() { return props; }", "public PSBeanProperties()\n {\n loadProperties();\n }", "public CMProps(final Properties p, final String filename) {\n super(p);\n final char c = Thread.currentThread().getThreadGroup().getName().charAt(0);\n if (props[c] == null)\n props[c] = this;\n\n try {\n this.load(new ByteArrayInputStream(new CMFile(filename, null).raw()));\n loaded = true;\n } catch (final IOException e) {\n loaded = false;\n }\n }", "@ProviderType\npublic interface Properties {\n\n\t/**\n\t * Returns a new builder of {@link TextProperty}.\n\t *\n\t * @param id the {@link Property#getId()} of the property\n\t * @param name the {@link Property#getName()} of the property\n\t * @return the new instance\n\t */\n\tTextProperty.Builder text(@NotNull String id, @NotNull String name);\n\n\t/**\n\t * Returns a new builder of {@link TextareaProperty}.\n\t *\n\t * @param id the {@link Property#getId()} of the property\n\t * @param name the {@link Property#getName()} of the property\n\t * @return the new instance\n\t */\n\tTextareaProperty.Builder textarea(@NotNull String id, @NotNull String name);\n\n\t/**\n\t * Returns a new builder of {@link BooleanProperty}.\n\t *\n\t * @param id the {@link Property#getId()} of the property\n\t * @param name the {@link Property#getName()} of the property\n\t * @return the new instance\n\t */\n\tBooleanProperty.Builder bool(@NotNull String id, @NotNull String name);\n\n\t/**\n\t * Returns a new builder of {@link DateProperty}.\n\t *\n\t * @param id the {@link Property#getId()} of the property\n\t * @param name the {@link Property#getName()} of the property\n\t * @return the new instance\n\t */\n\tDateProperty.Builder date(@NotNull String id, @NotNull String name);\n}", "public static Props createActor(ActorRef loadBalancer) {\n\t\treturn Props.create(Client.class, () -> {\n\t\t\treturn new Client(loadBalancer);\n\t\t});\n\t}", "private <T extends ProcessingElement> T makePE(PEMaker pem, Class<T> type) throws NoSuchFieldException,\n IllegalAccessException {\n T pe = app.createPE(type);\n pe.setSingleton(pem.isSingleton());\n\n if (pem.getCacheMaximumSize() > 0)\n pe.setPECache(pem.getCacheMaximumSize(), pem.getCacheDuration(), TimeUnit.MILLISECONDS);\n\n if (pem.getTimerInterval() > 0)\n pe.setTimerInterval(pem.getTimerInterval(), TimeUnit.MILLISECONDS);\n\n if (pem.getTriggerEventType() != null) {\n if (pem.getTriggerNumEvents() > 0 || pem.getTriggerInterval() > 0) {\n pe.setTrigger(pem.getTriggerEventType(), pem.getTriggerNumEvents(), pem.getTriggerInterval(),\n TimeUnit.MILLISECONDS);\n }\n }\n\n /* Use introspection to match properties to class fields. */\n setPEAttributes(pe, pem, type);\n return pe;\n }", "public DimensionProperties() {\n }", "<C, P> PropertyCallExp<C, P> createPropertyCallExp();", "private static Properties init(){\n // Get a Properties object\n Properties props = System.getProperties();\n props.setProperty(\"mail.smtp.host\", \"smtp.gmail.com\");\n props.setProperty(\"mail.smtp.socketFactory.class\", SSL_FACTORY);\n props.setProperty(\"mail.smtp.socketFactory.fallback\", \"false\");\n props.setProperty(\"mail.smtp.port\", \"465\");\n props.setProperty(\"mail.smtp.socketFactory.port\", \"465\");\n props.put(\"mail.smtp.auth\", \"true\");\n //props.put(\"mail.debug\", \"true\");\n props.put(\"mail.store.protocol\", \"pop3\");\n props.put(\"mail.transport.protocol\", \"smtp\");\n\n return props;\n }", "public\n YutilProperties(YutilProperties argprops)\n {\n super(new Properties());\n setPropertiesDefaults(argprops);\n }", "A createAttribute( @NonNull final String p_id, @Nonnull final String p_property );", "private RendezVousPropagateMessage newPropHeader(String serviceName, String serviceParam, int ttl) {\r\n\r\n RendezVousPropagateMessage propHdr = new RendezVousPropagateMessage();\r\n propHdr.setTTL(ttl);\r\n propHdr.setDestSName(serviceName);\r\n propHdr.setDestSParam(serviceParam);\r\n UUID msgID = createMsgId();\r\n propHdr.setMsgId(msgID);\r\n addMsgId(msgID);\r\n // Add this peer to the path.\r\n propHdr.addVisited(group.getPeerID().toURI());\r\n return propHdr;\r\n }", "public abstract AbstractProperties getProperties();", "private Props(String value) {\n\t\t\tthis.value = value;\n\t\t}", "private ConfigProperties() {\n\n }", "public WMSRendererFactory(ILiveDataProperties properties, String contextPath, String proxyUrl) {\n super(properties);\n this.contextPath = Val.chkStr(contextPath);\n this.proxyUrl = Val.chkStr(proxyUrl);\n }", "private static Property makeNewPropertyFromUserInput() {\n\t\tint regNum = requestRegNum();\r\n\t\t// check if a registrant with the regNum is available\r\n\t\tif (getRegControl().findRegistrant(regNum) == null) {\r\n\t\t\tSystem.out.println(\"Registrant number not found\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tString coordinateString = getResponseTo(\"Enter top and left coordinates of property (as X, Y): \");\r\n\t\t// split the xLeft and yTop from the string: \"xLeft, yTop\"\r\n\t\tString[] coordinates = coordinateString.split(\", \");\r\n\t\tString dimensionString = getResponseTo(\"Enter length and width of property (as length, width): \");\r\n\t\t// split the xLength and yWidth from the string: \"xLength, yWidth\"\r\n\t\tString[] dimensions = dimensionString.split(\", \");\r\n\t\t// convert all string in the lists to int and create a new Property object with them\r\n\t\tint xLeft = Integer.parseInt(coordinates[0]);\r\n\t\tint yTop = Integer.parseInt(coordinates[1]);\r\n\t\tint xLength = Integer.parseInt(dimensions[0]);\r\n\t\tint yWidth = Integer.parseInt(dimensions[1]);\r\n\t\t// Limit for registrant for property size minimum 20m x 10m and maximum size 1000m x 1000m\r\n\t\tif (xLength < 20 || yWidth < 10 || (xLength + xLeft) > 1000 || (yTop + yWidth) > 1000) {\r\n\t\t\tSystem.out.println(\"Invalid dimensions/coordinates inputs\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tProperty new_prop = new Property(xLength, yWidth, Integer.parseInt(coordinates[0]),\r\n\t\t\t\tInteger.parseInt(coordinates[1]), regNum);\r\n\t\treturn new_prop;\r\n\t}", "public SettableBeanProperty constructCreatorProperty(DeserializationContext ctxt, BeanDescription beanDesc, PropertyName name, int index, AnnotatedParameter param, Object injectableValueId) throws JsonMappingException {\n PropertyMetadata metadata;\n DeserializationConfig config = ctxt.getConfig();\n AnnotationIntrospector intr = ctxt.getAnnotationIntrospector();\n if (intr == null) {\n metadata = PropertyMetadata.STD_REQUIRED_OR_OPTIONAL;\n } else {\n metadata = PropertyMetadata.construct(intr.hasRequiredMarker(param), intr.findPropertyDescription(param), intr.findPropertyIndex(param), intr.findPropertyDefaultValue(param));\n }\n JavaType type = resolveMemberAndTypeAnnotations(ctxt, param, param.getType());\n Std property = new Std(name, type, intr.findWrapperName(param), beanDesc.getClassAnnotations(), param, metadata);\n TypeDeserializer typeDeser = (TypeDeserializer) type.getTypeHandler();\n if (typeDeser == null) {\n typeDeser = findTypeDeserializer(config, type);\n }\n SettableBeanProperty prop = new CreatorProperty(name, type, property.getWrapperName(), typeDeser, beanDesc.getClassAnnotations(), param, index, injectableValueId, metadata);\n JsonDeserializer<?> deser = findDeserializerFromAnnotation(ctxt, param);\n if (deser == null) {\n deser = (JsonDeserializer) type.getValueHandler();\n }\n if (deser != null) {\n return prop.withValueDeserializer(ctxt.handlePrimaryContextualization(deser, prop, type));\n }\n return prop;\n }", "public static ResourceData create(\n final InputStream stream,\n final Dictionary<String, Object> props)\n throws IOException {\n if ( stream == null ) {\n final Dictionary<String, Object> result = new Hashtable<String, Object>();\n final Enumeration<String> e = props.keys();\n while (e.hasMoreElements()) {\n final String key = e.nextElement();\n result.put(key, props.get(key));\n }\n return new ResourceData(result, null);\n\n }\n final File dataFile = FileDataStore.SHARED.createNewDataFile(stream,\n null, null, null);\n return new ResourceData(null, dataFile);\n }", "private PaletteFactory() {\n }", "public FileServicePropertiesProperties() {\n }", "public ComponentDescriptor() {\r\n\t\t// initialize empty collections\r\n\t\tconstructorParametersTypes = new LinkedList<List<Class<?>>>();\r\n//\t\trequiredProperties = new HashMap<String, MetaProperty>();\r\n//\t\toptionalProperties = new HashMap<String, MetaProperty>();\r\n\t}", "public static SystemProps createNewProperty(String propID, String type, String desc)\n throws DBException\n {\n if (!StringTools.isBlank(propID)) {\n SystemProps prop = SystemProps.getProperty(propID, true/*create*/); // does not return null\n prop.setDataType(StringTools.blankDefault(type,TYPE_STRING));\n if (!StringTools.isBlank(desc)) {\n prop.setDescription(desc);\n }\n prop.save();\n return prop;\n } else {\n throw new DBException(\"Invalid PropertyID specified\");\n }\n }", "public TestProperties() {\n\t\tthis.testProperties = new Properties();\n\t}", "Component createComponent();", "Component createComponent();", "@Test\n public void testCreateFromProperties_Properties() throws Exception {\n System.out.println(\"createFromProperties\");\n Properties props = new Properties();\n props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(propertiesName));\n EngineConfiguration result = EngineConfiguration.createFromProperties(props);\n assertProperties(result);\n }", "public abstract Properties getProperties();", "public static PasswordManager getInstance(Properties props) {\n return getInstance(new State(props));\n }", "protected PropertyList createPropertyList(PropertyList parent, \n FOEventHandler foEventHandler) throws FOPException {\n return foEventHandler.getPropertyListMaker().make(this, parent);\n }", "public abstract ICMakeBuildElement createBuildProperties(Path path);", "public Properties getProperties()\n {\n Properties properties = null;\n List<Props.Entry> props = this.props.getEntry();\n if ( props.size() > 0 )\n {\n properties = new Properties();\n //int size = props.size();\n for ( Props.Entry entry : props )\n {\n String key = entry.getKey();\n String val = entry.getValue();\n properties.setProperty( key, val );\n }\n }\n return properties;\n }", "public Value makePolymorphic(ObjectProperty prop) {\n Value r = new Value();\n r.var = prop;\n r.flags |= flags & (ATTR | ABSENT | PRESENT_DATA | PRESENT_ACCESSOR | EXTENDEDSCOPE);\n if (isMaybePresentData())\n r.flags |= PRESENT_DATA;\n if (isMaybePresentAccessor())\n r.flags |= PRESENT_ACCESSOR;\n return canonicalize(r);\n }", "public static PDPropertyList create(COSDictionary dict)\r\n {\r\n if (COSName.OCG.equals(dict.getItem(COSName.TYPE)))\r\n {\r\n return new PDOptionalContentGroup(dict);\r\n }\r\n else\r\n {\r\n // todo: more types\r\n return new PDPropertyList(dict);\r\n }\r\n }", "public ProyectFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "public CMProps() {\n super();\n final char c = Thread.currentThread().getThreadGroup().getName().charAt(0);\n if (props[c] == null)\n props[c] = this;\n }", "public\n YutilProperties()\n {\n super(new Properties());\n }", "public PropertyMap createPCDATAMap()\n {\n checkState();\n return super.createPCDATAMap();\n }", "public static Properties newEncryptionEnabledProps() {\n Properties props;\n // for production, we expect all sensitive properties to be encrypted\n if (PRODUCTION.equals(System.getProperty(CMS_ENV))) {\n String password = System.getProperty(CMS_CRYPT_PASSWORD);\n if (isBlank(password)) {\n throw new PortalServiceConfigurationException(CMS_CRYPT_PASSWORD\n + \" is not found, please set the environment \"\n + \"variable before starting up the application in PROD mode.\");\n }\n\n StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();\n encryptor.setPassword(password);\n props = new EncryptableProperties(encryptor);\n } else {\n props = new Properties();\n }\n return props;\n }", "PropertyCallExp createPropertyCallExp();", "private PerksFactory() {\n\n\t}", "protected DPP createDPP() {\n\t\tDPP dpp = new DPP();\n\t\tdpp.add(null, OP_CREATE, ST_CREATED);\n\t\t// dpp.add(ST_CREATED, ..., ...);\n\t\treturn dpp;\n\t}", "public static Props createActor(ActorRef b, ActorRef actorRef) {\n\t\treturn Props.create(FirstActor.class, () -> {\n\t\t\treturn new FirstActor(b, actorRef);\n\t\t});\n\t}", "protected static Properties getProperties(String fName) throws IOException {\r\n\t\tProperties props = new Properties();\r\n\t\tFile f = new File(fName);\r\n \r\n if (!f.exists()) {\r\n \treturn props;\r\n }\r\n \r\n props.load(new FileInputStream(f)); \r\n return props;\r\n }", "public PascalFactoryImpl()\n {\n super();\n }", "private GenericBean createTestBean(final String name, final String prename, final String dateofbirth) {\n\t\tString descr = \"<beantype name=\\\"TestBean\\\" idtype=\\\"keyprops\\\">\" + \"<property name=\\\"name\\\" key=\\\"true\\\"/>\"\n\t\t\t\t+ \"<property name=\\\"prename\\\" key=\\\"true\\\"/>\"\n\t\t\t\t+ \"<property name=\\\"dateofbirth\\\" type=\\\"date\\\" key=\\\"true\\\"/>\" + \"</beantype>\";\n\t\tGenericBean bean = null;\n\t\tTypeRapidBean testBeanType = (TypeRapidBean) RapidBeansTypeLoader.getInstance().lookupType(\"TestBean\");\n\t\tif (testBeanType == null) {\n\t\t\tbean = TestHelper.createGenericBeanInstance(descr);\n\t\t\tRapidBeansTypeLoader.getInstance().registerType(bean.getType());\n\t\t} else {\n\t\t\tbean = new GenericBean(testBeanType);\n\t\t}\n\t\tbean.setPropValue(\"name\", name);\n\t\tbean.setPropValue(\"prename\", prename);\n\t\tbean.setPropValue(\"dateofbirth\", dateofbirth);\n\t\treturn bean;\n\t}", "public JournalPropertyValueFactory(@NamedArg(\"property\") String property) {\n super(property);\n }", "public <T1 extends T> PropertySpec<T1> build()\n {\n try\n {\n check();\n }\n catch (Throwable t)\n {\n // this helps debugging when components cannot be instantiated\n logger.error(\"PropertySpecBuilder.check failed for property: \" + name, t);\n throw t;\n }\n\n return new PropertySpec<T1>()\n {\n @Override\n public Optional<String> deprecatedName()\n {\n return Optional.ofNullable(deprecatedName);\n }\n\n @Override\n public Optional<String> deprecatedShortName()\n {\n return Optional.ofNullable(deprecatedShortName);\n }\n\n @Override\n public String name()\n {\n return name;\n }\n\n @Override\n public String shortName()\n {\n return shortName;\n }\n\n @Override\n public String prefix()\n {\n return prefix;\n }\n\n @Override\n public Optional<String> alias()\n {\n return Optional.ofNullable(alias);\n }\n\n @Override\n public String describe()\n {\n return description;\n }\n\n @Override\n public Optional<String> category()\n {\n return Optional.ofNullable(category);\n }\n\n @Override\n public Optional<PropertySpec> dependsOn()\n {\n return Optional.ofNullable(dependsOn);\n }\n\n @Override\n public Optional<Value<T1>> defaultValue()\n {\n return Optional.ofNullable((Value<T1>) defaultValue);\n }\n\n @Override\n public Optional<String> defaultValueYaml()\n {\n return defaultValue().map(value -> dumperMethod != null ? dumperMethod.apply(value.value) :\n dumpYaml(value.value).replaceFirst(\"^!![^ ]* \", \"\"));\n }\n\n @Override\n public Optional<String> validationPattern()\n {\n return Optional.ofNullable(validationRegex).map(Pattern::toString);\n }\n\n @Override\n public T1 value(PropertyGroup propertyGroup)\n {\n return valueType(propertyGroup).value;\n }\n\n @Override\n public Optional<T1> optionalValue(PropertyGroup propertyGroup)\n {\n return Optional.ofNullable(valueType(propertyGroup).value);\n }\n\n private Pair<Optional<String>, Value<T1>> validatedValueType(PropertyGroup propertyGroup)\n {\n final Optional<Pair<String, Object>> foundPropNameAndValue = Stream\n .of(name, alias, deprecatedName)\n .map(propName -> Pair.of(propName, propertyGroup.get(propName)))\n .filter(pair -> pair.getRight() != null)\n .findFirst();\n\n final Optional<String> usedPropName = foundPropNameAndValue.map(Pair::getLeft);\n final Object value = foundPropNameAndValue.map(Pair::getRight).orElse(null);\n\n if (value == null)\n {\n if (defaultValue != null)\n {\n\n /* Note that we don't validate defaultValue: this is because for a PropertySpec<T>, default\n * values are specified as the type of the final value, T. Validation however is specified\n * as Function<Object, Boolean>, where the input is of whatever type was passed in: this\n * means that attempting to change the behaviour so that we validate the default value\n * would mean converting T to whatever came in (which may not be a string). */\n return Pair.of(usedPropName, (Value<T1>) defaultValue);\n }\n if (isRequired(propertyGroup))\n {\n throw new ValidationException(this, \"Missing required property\");\n }\n // No need to validate null\n return Pair.of(usedPropName, (Value<T1>) Value.empty);\n }\n\n if (valueOptions != null && (value instanceof String || value instanceof Boolean))\n {\n final String strVal = value.toString();\n\n final Optional<Value<T>> matchingOption = valueOptions.stream()\n .filter(option -> option.id.equalsIgnoreCase(strVal))\n .findFirst();\n\n if (matchingOption.isPresent())\n {\n return Pair.of(usedPropName, (Value<T1>) matchingOption.get());\n }\n\n if (valueOptionsMustMatch)\n {\n List<String> optionIds = valueOptions.stream().map(v -> v.id).collect(Collectors.toList());\n throw new ValidationException(this,\n String.format(\"Given value \\\"%s\\\" is not available in options: %s\", strVal, optionIds));\n }\n }\n\n if (valueMethod == null)\n {\n throw new ValidationException(this,\n String.format(\n \"Value method is null with value '%s' - are you passing in an invalid choice for an option spec?\",\n value));\n }\n\n //Use validation method\n if (validationMethod != null && !validationMethod.apply(value))\n {\n if (validationRegex != null)\n throw new ValidationException(this,\n String.format(\"Regexp \\\"%s\\\" failed for value: \\\"%s\\\"\", validationRegex, value));\n else\n throw new ValidationException(this,\n String.format(\"validationMethod failed for value: \\\"%s\\\"\", value));\n }\n\n return Pair.of(usedPropName, Value.of((T1) valueMethod.apply(value), category));\n }\n\n @Override\n public Value<T1> valueType(PropertyGroup propertyGroup)\n {\n return validatedValueType(propertyGroup).getRight();\n }\n\n @Override\n public boolean isRequired()\n {\n return required && defaultValue == null;\n }\n\n @Override\n public boolean isRequired(PropertyGroup propertyGroup)\n {\n return isRequired() &&\n //if the parent choice isn't selected then mark this not required\n (dependsOn == null || dependsOn.valueType(propertyGroup).category.get().equals(category));\n }\n\n @Override\n public boolean isOptionsOnly()\n {\n return valueMethod == null && valueOptions != null && valueOptionsMustMatch;\n }\n\n @Override\n public Optional<Collection<Value<T1>>> options()\n {\n return Optional.ofNullable((Collection) valueOptions);\n }\n\n @Override\n public Optional<String> validate(PropertyGroup propertyGroup) throws ValidationException\n {\n return validatedValueType(propertyGroup).getLeft();\n }\n\n @Override\n public String toString()\n {\n return \"DefaultPropertySpec(\" + this.name() + \")\";\n }\n };\n }", "public static EncFSPropertyHolder createFSPropertyHolder(String foldername) {\n foldername = emptyFilename(foldername);\n \n File propFolder = new File(foldername);\n\n // create folder\n propFolder.mkdirs();\n\n return new EncFSPropertyHolder(foldername);\n }", "public static CompetitivePropertiesPanel createCompetitivePropertiesPanel(\r\n final NetworkPanel np, final CompetitivePropsPanelType panelType)\r\n throws IllegalArgumentException {\r\n\r\n CompetitivePropertiesPanel cpp = new CompetitivePropertiesPanel(np,\r\n panelType);\r\n cpp.addListeners();\r\n return cpp;\r\n }", "public Property(String propertyName, ValueType retType,\n List<ValueType> paramsTypes, String tableName,\n String tableItemName, boolean isGlobal,\n String formatTemplate) {\n this.propertyName = propertyName;\n this.retType = retType;\n this.paramsTypes = paramsTypes;\n this.tableName = tableName;\n this.tableItemName = tableItemName;\n this.formatTemplate = formatTemplate;\n this.isGlobal = isGlobal;\n }", "private VisualPropertyType(final String calcName, final String propertyLabel,\n \t final String bypassAttrName, final String defaultPropertyLabel,\n \t final Class dataType, final VisualProperty vizProp, \n \t\t\t\t\t\t\t final ValueParser valueParser, final boolean isNodeProp,\n \t\t\t\t\t\t\t final boolean isAllowed) {\n \t\tthis.calcName = calcName;\n \t\tthis.propertyLabel = propertyLabel;\n \t\tthis.bypassAttrName = bypassAttrName;\n \t\tthis.defaultPropertyLabel = defaultPropertyLabel;\n \t\tthis.dataType = dataType;\n \t\tthis.vizProp = vizProp;\n \t\tthis.valueParser = valueParser;\n \t\tthis.isNodeProp = isNodeProp;\n \t\tthis.isAllowed = isAllowed;\n \t}", "public PDFProperties (){\n\t\tthis.title = DEFAULT_TITLE;\n\t\tthis.subtitle = DEFAULT_SUBTITLE;\n\t\tthis.spacing = DEFAULT_SPACING;\n\t\tthis.elementsize = DEFAULT_ELEMENTSIZE;\n\t\tthis.pagesize = DEFAULT_PAGESIZE;\n\t\tthis.title_fontsize = DEFAULT_TITLE_FONTSIZE;\n\t\tthis.subtitle_fontsize = DEFAULT_SUBTITLE_FONTSIZE;\n\t\tthis.leftmargin = DEFAULT_LEFTMARGIN;\n\t\tthis.rightmargin = DEFAULT_RIGHTMARGIN;\n\t\tthis.measurespace = DEFAULT_MEASURESPACE;\n\t}", "private File createTestSpecificPropFile(String errorLibName) throws Exception {\n\t\tFile testProp = testingdir.getFile(ERRORLIBPROPS);\n\t\tAssert.assertTrue(\"Creating empty file: \" + testProp, testProp.createNewFile());\n\t\t\n\t\treturn testProp;\n\t}", "public KeyVaultProperties() {\n }", "public MessageDestinationFactory() {\n this.properties = new ConfigMap();\n }", "public Property() {\n this(0, 0, 0, 0);\n }", "private PropertyEvaluator createEvaluator() {\n return helper.getStandardPropertyEvaluator();\n }", "private TerminalProperties() {\n this(new TerminalPropertiesBuilder());\n }" ]
[ "0.6549677", "0.6425793", "0.6356117", "0.62144315", "0.59490526", "0.59369767", "0.59348184", "0.58726674", "0.58595735", "0.57939583", "0.57490724", "0.574084", "0.5678737", "0.55997086", "0.55724937", "0.55145633", "0.5506356", "0.54991746", "0.54492307", "0.5448262", "0.5423583", "0.539978", "0.53144675", "0.53068554", "0.52914643", "0.5283309", "0.5283144", "0.5226436", "0.52216953", "0.51986206", "0.51636225", "0.5113029", "0.5092792", "0.5089707", "0.50685257", "0.5060971", "0.5057992", "0.5046874", "0.5032624", "0.50323975", "0.50289214", "0.5027714", "0.5021415", "0.5012003", "0.5006443", "0.4994919", "0.4992549", "0.49851885", "0.49833754", "0.49829525", "0.4968501", "0.49613115", "0.49500194", "0.4933911", "0.49328008", "0.49165404", "0.48844817", "0.48817712", "0.48704743", "0.48682696", "0.4866921", "0.48644406", "0.48568258", "0.48535913", "0.48446363", "0.48442563", "0.4843664", "0.4843664", "0.48424736", "0.484042", "0.48379484", "0.48327312", "0.48324168", "0.48293015", "0.4819798", "0.4811939", "0.48094428", "0.48027775", "0.47988155", "0.4792333", "0.47919345", "0.47859138", "0.47855508", "0.4779687", "0.47782323", "0.4764127", "0.4762295", "0.4756801", "0.47546282", "0.47382978", "0.4734388", "0.47242925", "0.47232434", "0.47166473", "0.471134", "0.47091258", "0.47067016", "0.4698013", "0.4694456", "0.4687966", "0.46845886" ]
0.0
-1
Generate a Steno log compatible representation.
@LogValue public Object toLogValue() { return LogValueMapFactory.builder(this) .put("sink", _sink) .put("serverAddress", _serverAddress) .put("serverPort", _serverPort) .put("exponentialBackoffBase", _exponentialBackoffBase) .build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void serializeLogs();", "public String createLogInfo() {\n String res = TXN_ID_TAG + REGEX + this.txnId + \"\\n\" +\n TXN_STATUS_TAG + REGEX + this.txnStatus + \"\\n\";\n if (this.readKeyList != null && this.readKeyList.length != 0) {\n for (String readKey : this.readKeyList) {\n res += TXN_READ_TAG + REGEX + readKey + \"\\n\";\n }\n }\n \n if (this.writeKeyList != null && this.writeKeyList.length != 0) {\n for (int i = 0; i < this.writeKeyList.length; i++) {\n res += TXN_WRITE_TAG + REGEX + this.writeKeyList[i] + \"\\n\";\n res += TXN_VAL_TAG + REGEX + this.writeValList[i] + \"\\n\";\n }\n }\n \n return res;\n }", "@Override \n public String toString(){\n return this.logRepresentation;\n }", "public String toString(){\n\t\treturn \"Log normal distribution [location = \" + location + \", scale = \" + scale + \"]\";\n\t}", "public String toString() {\n return \"\\n[roomstlog] \"\n + \"\\n - roomstlog.roomstlogid = \" + (roomstlogid_is_initialized ? (\"[\" + (roomstlogid == null ? null : roomstlogid.toString()) + \"]\") : \"not initialized\") + \"\"\n + \"\\n - roomstlog.roomstid = \" + (roomstid_is_initialized ? (\"[\" + (roomstid == null ? null : roomstid.toString()) + \"]\") : \"not initialized\") + \"\"\n + \"\\n - roomstlog.roomid = \" + (roomid_is_initialized ? (\"[\" + (roomid == null ? null : roomid.toString()) + \"]\") : \"not initialized\") + \"\"\n + \"\\n - roomstlog.statusdate = \" + (statusdate_is_initialized ? (\"[\" + (statusdate == null ? null : statusdate.toString()) + \"]\") : \"not initialized\") + \"\"\n + \"\\n - roomstlog.st = \" + (st_is_initialized ? (\"[\" + (st == null ? null : st.toString()) + \"]\") : \"not initialized\") + \"\"\n + \"\\n - roomstlog.regbyid = \" + (regbyid_is_initialized ? (\"[\" + (regbyid == null ? null : regbyid.toString()) + \"]\") : \"not initialized\") + \"\"\n + \"\\n - roomstlog.regdate = \" + (regdate_is_initialized ? (\"[\" + (regdate == null ? null : regdate.toString()) + \"]\") : \"not initialized\") + \"\"\n + \"\\n - roomstlog.reservationroomid = \" + (reservationroomid_is_initialized ? (\"[\" + (reservationroomid == null ? null : reservationroomid.toString()) + \"]\") : \"not initialized\") + \"\"\n + \"\\n - roomstlog.roomtypeid = \" + (roomtypeid_is_initialized ? (\"[\" + (roomtypeid == null ? null : roomtypeid.toString()) + \"]\") : \"not initialized\") + \"\"\n + \"\\n - roomstlog.blockroomid = \" + (blockroomid_is_initialized ? (\"[\" + (blockroomid == null ? null : blockroomid.toString()) + \"]\") : \"not initialized\") + \"\"\n + \"\\n - roomstlog.logdate = \" + (logdate_is_initialized ? (\"[\" + (logdate == null ? null : logdate.toString()) + \"]\") : \"not initialized\") + \"\"\n ;\n }", "public Log() { //Null constructor is adequate as all values start at zero\n\t}", "public SystemLogMessage() {\n\t\tthis.setVersion(Constants.VERSION);\t\t\t\t\t\t\t\t//version is universal for all log messages\n\t\tthis.setCertifiedDatatype(Constants.SYSTEM_LOG_OID);\t\t\t//certifiedDataType is the OID, for all transaction logs it is the same\n\t\t\n\t\t//algorithm parameter has to be set using the LogMessage setAlgorithm method.\n\t\t//the ERSSpecificModule has to set the algorithm\n\t\t//serial number has to be set by someone who has access to it \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}", "public LogEntry generateLogEntry() {\n long time = getTime();\n int bloodGlucose = getBloodGlucose();\n double bolus = getBolus();\n int carbohydrate = getCarbohydrate();\n return new LogEntry(time, bloodGlucose, bolus, carbohydrate);\n }", "private void divertLog() {\n wr = new StringWriter(1000);\n LogTarget[] lt = { new WriterTarget(wr, fmt) };\n SampleResult.log.setLogTargets(lt);\n }", "@Override\n public String toString() {\n // TODO: this, statically\n StringBuilder builder = new StringBuilder(getObs().toString());\n builder.append(\" S\");\n builder.append(firstStep + 1);\n if (lastStep > firstStep) {\n builder.append(\"-\");\n builder.append(lastStep + 1);\n }\n return builder.toString();\n }", "public String toString() {\n String s = \"Message <RxTxMonitoringMsg> \\n\";\n try {\n s += \" [infos.type=0x\"+Long.toHexString(get_infos_type())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.log_src=0x\"+Long.toHexString(get_infos_log_src())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.timestamp=0x\"+Long.toHexString(get_infos_timestamp())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.seq_num=0x\"+Long.toHexString(get_infos_seq_num())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.size_data=0x\"+Long.toHexString(get_infos_size_data())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.valid_noise_samples=0x\"+Long.toHexString(get_infos_valid_noise_samples())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.noise=\";\n for (int i = 0; i < 3; i++) {\n s += \"0x\"+Long.toHexString(getElement_infos_noise(i) & 0xffff)+\" \";\n }\n s += \"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.metadata=\";\n for (int i = 0; i < 2; i++) {\n s += \"0x\"+Long.toHexString(getElement_infos_metadata(i) & 0xff)+\" \";\n }\n s += \"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [data=\";\n for (int i = 0; i < 60; i++) {\n s += \"0x\"+Long.toHexString(getElement_data(i) & 0xff)+\" \";\n }\n s += \"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n return s;\n }", "public String getFromLog(int nbr) {\n StringBuffer sb = new StringBuffer();\n try {\n for (int i = 0; i < n && i < nbr; i++) {\n String[] split = history[i].split(\";\");\n String ms = split[2].trim();\n int millis = Integer.parseInt(ms);\n float s = ((float) millis / 1000); // turn ms to s\n sb.append(split[0] + \";\" + split[1] + \"; \" + s + \";\" + split[3] + \"\\n\");\n }\n }\n catch (Exception e) {\n // TODO: Catch the right type of exception\n }\n return sb.toString();\n }", "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 }", "private void constructLog() {\r\n String padStr = new String();\r\n padStr = \"Pad with slices \";\r\n\r\n if (padMode == PAD_FRONT) {\r\n padStr += \" using front slices\";\r\n } else if (padMode == PAD_BACK) {\r\n padStr += \" using back slices\";\r\n } else if (padMode == PAD_HALF) {\r\n padStr += \" using front and back slices\";\r\n }\r\n\r\n historyString = new String(\"PadWithSlices(\" + padStr + \")\\n\");\r\n }", "private String buildLog(double avg, double max, double min,\n GeneticNeuralNetwork worse, GeneticNeuralNetwork best) {\n return String.format(\"Generation %d\\tAvg %.5f\\t Min %.5f\\t Max %.5f\\t\\n\",\n generation, avg, min, max);\n }", "public ZLogRecord() {\n super(ZLog.Z_LOG);\n }", "public String toLogData() { \n\t return gson.toJson(this);\n\t}", "private static String formatLog() {\r\n String str = \"\";\r\n\r\n str = log.stream().map((temp) -> temp + \"\\n\").reduce(str, String::concat);\r\n\r\n return str;\r\n }", "public String toString() {\n StringBuilder builder = new StringBuilder();\n builder.append(StringUtil2.padRight((stid.trim() + std2.trim()), 8));\n builder.append(\" \");\n builder.append(Format.i(stnm, 6));\n builder.append(\" \");\n builder.append(StringUtil2.padRight(sdesc, 32));\n builder.append(\" \");\n builder.append(StringUtil2.padLeft(stat.trim(), 2));\n builder.append(\" \");\n builder.append(StringUtil2.padLeft(coun.trim(), 2));\n builder.append(\" \");\n builder.append(Format.i(slat, 5));\n builder.append(\" \");\n builder.append(Format.i(slon, 6));\n builder.append(\" \");\n builder.append(Format.i(selv, 5));\n builder.append(\" \");\n builder.append(Format.i(spri, 2));\n builder.append(\" \");\n builder.append(StringUtil2.padLeft(swfo.trim(), 3));\n return builder.toString();\n }", "public String toSL() {\n String results = new String(\"\");\n String attribute;\n ValueFunction value;\n for(Enumeration enum = this.keys(); enum.hasMoreElements(); ) {\n attribute = (String) enum.nextElement();\n value = (ValueFunction) this.get(attribute);\n\n results += \":\" + attribute + \" \" + value + \" \";\n }\n return results.trim() ;\n }", "public String toDebugString();", "public LogX() {\n\n }", "public String getLog();", "public String toString() {\n StringBuffer buffer = new StringBuffer(\"\\t<semantic_event\");\n\n if (transactionId != null) {\n buffer.append(\" transaction_id=\\\"\");\n buffer.append(LogFormatUtils.escapeAttribute(transactionId));\n buffer.append(\"\\\"\");\n }\n\n if (name != null) {\n buffer.append(\" name=\\\"\");\n buffer.append(LogFormatUtils.escapeAttribute(name));\n buffer.append(\"\\\"\");\n }\n\n if (trigger != null) {\n buffer.append(\" trigger=\\\"\");\n buffer.append(LogFormatUtils.escapeAttribute(trigger));\n buffer.append(\"\\\"\");\n }\n\n if (subtype != null) {\n buffer.append(\" subtype=\\\"\");\n buffer.append(LogFormatUtils.escapeAttribute(subtype));\n buffer.append(\"\\\"\");\n }\n\n buffer.append(\"/>\\n\");\n\n return buffer.toString();\n }", "protected void prtln(String s) {\n\t\tif (debug) {\n\t\t\tSystem.out.println(\"ccStandardsNode: \" + s);\n\t\t}\n\t}", "public Snippet visit(LogExpression n, Snippet argu) {\n\t Snippet _ret= new Snippet(\"\",\"\",null,false);\n\t n.nodeToken.accept(this, argu);\n\t n.nodeToken1.accept(this, argu);\n\t n.nodeToken2.accept(this, argu);\n\t n.nodeToken3.accept(this, argu);\n\t Snippet f4 = n.identifier.accept(this, argu);\n\t n.nodeToken4.accept(this, argu);\n\t _ret.returnTemp = \"Math.log(\"+f4.returnTemp+\")\";\n\t return _ret;\n\t }", "void storeSchema(LogSequenceNumber lsn, Table table);", "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 abstract String rawGraphToString();", "private String makeEventStamp() {\n String name = \"DTSTAMP\";\n return formatTimeProperty(LocalDateTime.now(), name) + \"\\n\";\n }", "@Override\n public String toString() {\n String result = \"\";\n\n for (int position = 0; position < 64; position++) {\n if (position > 0) {\n if (position % 16 == 0) { // New level\n result += '|';\n } else if (position % 4 == 0) {\n result += ' '; // New row\n }\n }\n result += get(position);\n }\n return result;\n }", "public LogNormalDistribution(){\n\t\tthis(0, 1);\n\t}", "public java.lang.String toDebugString () { throw new RuntimeException(); }", "public String toString() {\n StringBuffer buffer = new StringBuffer(getClass().getName());\n\n buffer.append(\": \");\t\t\t\t//NOI18N\n buffer.append(\" name: \");\t\t\t//NOI18N\n buffer.append(getName());\n buffer.append(\", logging level: \");\t//NOI18N\n buffer.append(toString(getLevel()));\n\n return buffer.toString();\n }", "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}", "private TypicalLogEntries() {}", "public ObjXportStusRecord() {\n\t\tsuper(ObjXportStus.OBJ_XPORT_STUS);\n\t}", "public static String GenLogTC()\t{\n\t\treturn sTC_ID + \" (step \" + iStep + \") \" ;\n\t}", "private ChainsTraceGraph makeSimpleGraph()\n throws InternalSynopticException, ParseException {\n\n String[] logArr = new String[] { \"a\", \"a\", \"--\", \"b\", \"--\", \"a\", \"b\" };\n TraceParser defParser = SynopticTest.genDefParser();\n\n ChainsTraceGraph ret = (ChainsTraceGraph) genChainsTraceGraph(logArr,\n defParser);\n return ret;\n }", "public TOpLogs() {\n this(DSL.name(\"t_op_logs\"), null);\n }", "public String pretty() {\n StringBuffer sb = new StringBuffer();\n for(int i =0;i<numOfVectors;i++){\n for (int j = 0; j < n; j++) {\n sb = j>0?sb.append(\", \"):sb.append(\"{\");\n sb.append(x[i][j].pretty());\n }\n sb= i+1==numOfVectors?sb.append(\"} \"):strict?sb.append(\"} < lex \"):sb.append(\"} <= lex \");\n }\n return sb.toString();\n }", "private void naturalLog()\n\t{\n\t\tif(Fun == null)\n\t\t{\n\t\t\tsetLeftValue();\n\t\t\tresult = calc.naturalLog ( );\n\t\t\tupdateText();\n\t\t}\n\t}", "@Override\n public String visit(HStoreStmt n) {\n String _ret = null;\n String r1 = this.reg[n.f1.f0.which];\n String offset = n.f2.f0.tokenImage;\n String r2 = this.reg[n.f3.f0.which];\n Global.outputString += \"sw $\" + r2 + \", \" + offset + \"($\" + r1 + \")\\n\";\n return _ret;\n }", "private void toSI (StringBuffer b, int option) {\n\t\tboolean close = false;\n\t\tif ((mksa&_log) != 0) b.append(\n\t\t\t\t(mksa&_mag) != 0 ? \"mag[\" : \"log[\");\n\t\tif (factor != 1) {\n\t\t\tedf(b, factor);\n\t\t\tif (offset != 0) { b.append('('); close = true; }\n\t\t}\n\t\tedu(b, mksa, option);\n\t\tif (offset != 0) {\t// V1.1: Edit offset\n\t\t\tb.append(\"#\");\n\t\t\tedf(b, -offset);\n\t\t\tif (close) b.append(')'); \n\t\t}\n\t\tif ((mksa&_log) != 0) b.append(\"]\") ;\n\t}", "public static String generate_rand_stream(int n) {\n int[] input = new int[n];\n //int[] input = {1,0,1,1};\n Matrix in = new Matrix(n, 1);\n Random numGen = new Random();\n for (int i = 0; i < input.length; i++) {\n input[i] = numGen.nextInt(200) % 2;\n }\n // create a Shift register object with the input\n ShiftRegister sr = new ShiftRegister(input);\n String r = \"\";\n r += \"Input: \" + Arrays.toString(input);\n r += \"\\t Output: \" + sr.get_y();\n // r += \"\\n\" + sr;\n r += \"\\n \" + \"A0\";\n r += \"\\n\" + sr.get_A0().toStringInt();\n r += \"\\n \" + \"A1\";\n r += \"\\n\" + sr.get_A1().toStringInt();\n return r;\n }", "public SystemLog () {\r\n\t\tsuper();\r\n\t}", "private void packageTraceModel(Tuple input, String[] s, Timestamp ts) {\n\t\tTraceModel model = new TraceModel();\r\n\t\ttry {\r\n\t\t\tmodel.setActionId(UUID.randomUUID().toString());\r\n\t\t\tmodel.setsLogTime(s[0]);\r\n\t\t\tmodel.setLogTime(ts);\r\n\t\t\tmodel.setClientIp(s[1]);\r\n\t\t\tmodel.setProjectName(s[2]);\r\n\t\t\tmodel.setExcutePoint(s[3]);\r\n\t\t\tmodel.setServerName(s[4]);\r\n\t\t\tmodel.setLocalIp(s[5]);\r\n\t\t\tmodel.setLocalMac(s[6]);\r\n\t\t\tmodel.setLogName(s[7]);\r\n\t\t\tmodel.setStandBy(s[8]);\r\n\t\t\tmodel.setTraceId(s[9]);\r\n\t\t\tmodel.setProjectId(s[10]);\r\n\t\t\tmodel.setProcessId(s[11]);\r\n\t\t\tmodel.setExecutionTime(s[12]);\r\n\t\t\tmodel.setPersonalityData(s[13]);\r\n\t\t\tmodel.setParentId(s[14]);\r\n\t\t\tmodel.setMyId(s[15]);\r\n\t\t\tmodel.setEntryParameter(s[16]);\r\n\t\t\tmodel.setExcuteResult(s[17]);\r\n\t\t\tmodel.setErrorMsg(s[18]);\r\n\t\t\tTraceDao dao = ApplicationManager.getContext().getBean(\r\n\t\t\t\t\tTraceDao.class);\r\n\t\t\tdao.addEntity(model);\r\n\t\t\tcollector.ack(input);\r\n\t\t} catch (Exception e) {\r\n\t\t\tLoggerUtil.error(\"TraceModel日志记录失败\", e);\r\n\t\t\tcollector.fail(input);\r\n\t\t}\r\n\t}", "public String toString() {\n\t\treturn \"S\";\n\t}", "public String toXML() {\n\t\tStringBuffer sb = new StringBuffer();\n\t\t\n\t\tsb.append(\"<logfilter>\\n\");\n\t\t// write description\n\t\tsb.append(\"<description>\" + description + \"</description>\\n\");\n\t\t// write logdata\n\t\tsb.append(\"<logdata>\" + logData + \"</logdata>\");\n\t\t// write accepted types\n\t\tsb.append(\"<acceptedtypes>\\n\");\n\t\tif (acceptedEventTypes != null) { \n\t\t\tSet<String> keys = acceptedEventTypes.keySet();\n\t\t\tfor (String key : keys) {\n\t\t\t\tsb.append(\"<class priority=\\\"\" + acceptedEventTypes.get(key) + \"\\\">\" + key + \"</class>\\n\");\n\t\t\t}\n\t\t}\n\t\tsb.append(\"</acceptedtypes>\\n\");\n\t\t\n\t\tsb.append(\"</logfilter>\");\n\t\t\n\t\treturn sb.toString();\n\t}", "public String makeString()\n\t{\n\t\treturn \"RandomLevelSource\";\n\t}", "@Override\n\tpublic String getLog() {\n\t\t\n\t\tString cartelSightings = \"\";\n\t\t\n\t\tfor (Sighting sight: sightings) {\n\t\t\tcartelSightings += sight.getLocation();\n\t\t\tcartelSightings += \" (\" + sight.getDetails() + \")\\n\";\n\t\t}\n\t\treturn cartelSightings;\n\t}", "public @Override String toString() {\n String res= \"[\";\n // invariant: res = \"[s0, s1, .., sk\" where sk is the object before node n\n for (Node n = sentinel.succ; n != sentinel; n= n.succ) {\n if (n != sentinel.succ)\n res= res + \", \";\n res= res + n.data;\n }\n return res + \"]\";\n }", "protected String getResultLog() {\n\t\tfinal StringBuilder ret = new StringBuilder(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\\n<signs>\\n\"); //$NON-NLS-1$\r\n\t\tfor (final SingleSign ss : this.signs) {\r\n\t\t\tret.append(\" \"); //$NON-NLS-1$\r\n\t\t\tret.append(ss.getProcessResult().toString());\r\n\t\t\tret.append(\"\\n\"); //$NON-NLS-1$\r\n\t\t}\r\n\t\tret.append(\"</signs>\"); //$NON-NLS-1$\r\n\t\treturn ret.toString();\r\n\t}", "public SystemLogMessage(String operationType, byte[] serialNumber) {\n\t\tthis.setVersion(Constants.VERSION);\t\t\t\t\t\t\t\t//version is universal for all log messages\n\t\tthis.setCertifiedDatatype(Constants.SYSTEM_LOG_OID);\t\t\t//certifiedDataType is the OID, for all transaction logs it is the same\n\t\tthis.setSerialNumber(serialNumber); \t\t\t//serial number has to be set by someone who has access to it (ERSSpecificModule or SecurityModule)\n\t\t\n\t\t//algorithm parameter has to be set using the LogMessage setAlgorithm method.\n\t\t//the ERSSpecificModule has to set the algorithm\n\t\t\n\t\tthis.operationType=operationType;\n\t}", "@LogValue\n @Override\n public Object toLogValue() {\n return LogValueMapFactory.of(\n \"super\", super.toLogValue(),\n \"Path\", _path,\n \"RrdTool\", _rrdTool);\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: */ }", "private final void prtln(String s) {\n\n\t\tif (debug) {\n\n\t\t\tSystem.out.println(getDateStamp() + \" \" + s);\n\n\t\t}\n\n\t}", "private void writeTrace()\r\n {\r\n TGCreator creator = new TGCreator();\r\n TGTrace trace = creator.createTrace(JVM.getVM(), this.stateGraph);\r\n TraceGraphWriter tgWriter = new TraceGraphWriter(trace);\r\n\r\n if (this.traceCompressed)\r\n {\r\n this.filename += ITraceConstants.ZIP_FILE_SUFFIX;\r\n tgWriter.saveCompressed(new File(this.filename));\r\n }\r\n else\r\n {\r\n this.filename += ITraceConstants.XML_FILE_SUFFIX;\r\n tgWriter.save(new File(this.filename));\r\n }\r\n\r\n SymbolicExecutionTracerPlugin.log(Status.INFO,\r\n \"Symbolic Execution Tracer wrote \" + this.numEndStates\r\n + \" traces to \" + this.filename);\r\n }", "@Override\r\n\tpublic String format(LogRecord record) {\n\t\tDate date = new Date(record.getMillis());\r\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\r\n\t\treturn format.format(date)+\" \" + record.getLevel()+\": \\n\" + record.getMessage()+\"\\n\";\r\n\t\t\r\n\t}", "@Override\n public String toString() {\n // | <M,C,B> |\n // | Depth = d |\n // -----------\n return \"\\n ----------- \\n\" + \"| <\" + this.state[0] + \",\" + this.state[1] + \",\" + this.state[2] + \"> |\\n\"\n + \"| Depth = \" + this.depth + \" |\\n\" + \" ----------- \\n\";\n }", "@Override\n\tpublic void publish(LogRecord record) {\n\tSystem.err.println(formatter.format(record));\n\tLogInfo info = new LogInfo(record.getTime(), \n\t\t\t\t record.getSource()+\":\"+record.getLevel(), \n\t\t\t\t formatter.format(record));\n\ttry {\n\t Telemetry.getInstance().publish(\"LOG\", info);\n\t} catch (Exception e) {\n\t System.err.println(\"Telemetry log error...\");\n\t e.printStackTrace();\n\t}\n }", "public String toString() {\n // The argument passed to StringBuilder is a pretty good estimate of the\n // length of the final string based on the row key and number of elements.\n final String metric = metricName();\n final StringBuilder buf = new StringBuilder(80 + metric.length()\n + row.length * 4 + size * 16);\n final long base_time = baseTime();\n buf.append(\"IncomingDataPoints(\")\n .append(row == null ? \"<null>\" : Arrays.toString(row))\n .append(\" (metric=\")\n .append(metric)\n .append(\"), base_time=\")\n .append(base_time)\n .append(\" (\")\n .append(base_time > 0 ? new Date(base_time * 1000) : \"no date\")\n .append(\"), [\");\n for (short i = 0; i < size; i++) {\n buf.append('+').append(delta(qualifiers[i]));\n if (isInteger(i)) {\n buf.append(\":long(\").append(longValue(i));\n } else {\n buf.append(\":float(\").append(doubleValue(i));\n }\n buf.append(')');\n if (i != size - 1) {\n buf.append(\", \");\n }\n }\n buf.append(\"])\");\n return buf.toString();\n }", "public String toDebugString() {\n StringBuffer str = new StringBuffer(mySelf()+\"\\n\");\n return str.toString();\n }", "public String toString() {\n\tStringBuffer buffer = new StringBuffer();\n\t//\tbuffer.append(\" 6 5 4 3 2 1 \\n\");\n\tbuffer.append(\"+---------------------------------------+\\n\");\n\t\n\tbuffer.append(\"| |\");\n\tfor (int i = 12; i >= 7; --i) {\n\t buffer.append(toString(state[i]));\n\t}\n\tbuffer.append(\" |\\n\");\n\t\n\tbuffer.append(\"|\");\n\tbuffer.append(toString(state[13]));\n\tbuffer.append(\"-----------------------------|\");\n\tbuffer.append(toString(state[6]));\n\tbuffer.append(\"\\n\");\n\t\n\tbuffer.append(\"| |\");\n\tfor (int i = 0; i <= 5; ++i) {\n\t buffer.append(toString(state[i]));\n\t}\n\tbuffer.append(\" |\\n\");\n\t\n\tbuffer.append(\"+---------------------------------------+\\n\");\n\tbuffer.append(\" 0 1 2 3 4 5 \\n\");\n\t\n\treturn buffer.toString();\n }", "public LogScrap() {\n\t\tconsumer = bin->Conveyor.LOG.debug(\"{}\",bin);\n\t}", "private HostessState(String logRepresentation){\n this.logRepresentation = logRepresentation;\n }", "public SensorLog() {\n }", "public String toString() {\n String s = \"Message <OctopusCollectedMsg> \\n\";\n try {\n s += \" [moteId=0x\"+Long.toHexString(get_moteId())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [count=0x\"+Long.toHexString(get_count())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [reading=0x\"+Long.toHexString(get_reading())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [quality=0x\"+Long.toHexString(get_quality())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [parentId=0x\"+Long.toHexString(get_parentId())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [reply=0x\"+Long.toHexString(get_reply())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n return s;\n }", "void log(Log log);", "public abstract WriteResult writeSystemLog(Log log);", "public void makeLogFile(long lognum, long seq, Slice key, Slice val) {\n\t\t String fname = FileName.getLogFileName(dbname, lognum);\n\t\t Object0<WritableFile> file0 = new Object0<>();\n\t\t Status s = env.newWritableFile(fname, file0);\n\t\t assertTrue(s.ok());\n\t\t LogWriter writer = new LogWriter(file0.getValue());\n\t\t WriteBatch batch = new WriteBatch();\n\t\t batch.put(key, val);\n\t\t WriteBatchInternal.setSequence(batch, seq);\n\t\t assertTrue(writer.addRecord(WriteBatchInternal.contents(batch)).ok());\n\t\t assertTrue(file0.getValue().flush().ok());\n\t\t file0.getValue().delete();;\n\t\t}", "public String toString()\n {\n String out = \"Treehash : \";\n for (int i = 0; i < 6 + tailLength; i++)\n {\n out = out + this.getStatInt()[i] + \" \";\n }\n for (int i = 0; i < 3 + tailLength; i++)\n {\n if (this.getStatByte()[i] != null)\n {\n out = out + new String(Hex.encode((this.getStatByte()[i]))) + \" \";\n }\n else\n {\n out = out + \"null \";\n }\n }\n out = out + \" \" + this.messDigestTree.getDigestSize();\n return out;\n }", "@Override\n\tprotected String toMips(Scope symbolTable, String indent) {\n\t\tStringBuilder build = new StringBuilder(indent).append(\"#SubProgramHeadNode\\n\");\n\n\t\t//load ptr to previous stack's head to pick up values\n\t\tbuild.append(indent).append(\"lw $t0, 8($sp)\\n\");\n\t\tbuild.append(indent).append(\"lw $t0, ($t0)\\n\");\n\n\t\t//iterate across arguments\n\t\tfor (int i = 0; i < arguments.length; i++) {\n\t\t\tbuild.append(indent).append(\"lw $t1, \").append((i + 1) * 4).append(\"($t0)\\t#get loaded value from stack\\n\");\n\t\t\tbuild.append(indent).append(\"sw $t1, \").append(symbolTable.getMemoryOffset(arguments[i])).append(\"($sp)\\t#save word in correct spot (hopefully?)\\n\");\t//This is done in SubProgramNode constructor\n\t\t}\n\n\t\treturn build.toString();\n\t}", "public StringBuilder buildLogContent() {\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tint numberOfServers = Integer.parseInt(properties.getProperty(\"numberOfServers\"));\n\t\tint numberOfCpus = Integer.parseInt(properties.getProperty(\"numberOfCpus\"));\n\t\tint numberOfDays = Integer.parseInt(properties.getProperty(\"numberOfDays\"));\n\t\tint numberOfMins = numberOfDays * 24 * 60;\n\n\t\tfor (int server = 0; server < numberOfServers; server++) {\n\t\t\tfor (int cpu = 0; cpu < numberOfCpus; cpu++) {\n\t\t\t\tfor (int min = 0; min < numberOfMins; min++) {\n\t\t\t\t\tsb.append(new Log(server, cpu, min).getLine()).append(\"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn sb;\n\n\t}", "final public void dump(StringBuffer buf) {\r\n\r\n\t\tForwardingInfo info;\r\n\r\n\t\tlock_.lock();\r\n\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < log_.size(); i++) {\r\n\t\t\t\tinfo = log_.get(i);\r\n\t\t\t\tString format = String.format(\"\\t%s -> %s [%s] %s at %s.%s \"\r\n\t\t\t\t\t\t+ \"[custody min %s pct %s max %s]\\n\", ForwardingInfo\r\n\t\t\t\t\t\t.state_to_str(info.state()), info.link_name(), info\r\n\t\t\t\t\t\t.remote_eid(), ForwardingInfo.action_to_str(info\r\n\t\t\t\t\t\t.action()), info.timestamp().getSeconds(), info\r\n\t\t\t\t\t\t.timestamp().getSeconds(), info.custody_spec().min(),\r\n\t\t\t\t\t\tinfo.custody_spec().lifetime_pct(), info.custody_spec()\r\n\t\t\t\t\t\t\t\t.max());\r\n\r\n\t\t\t\tbuf.append(format);\r\n\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tlock_.unlock();\r\n\t\t}\r\n\r\n\t}", "private void logNormalizedMessage(String exchangeId, Source msgSrc)\n\t{\n\t\tif (mLog.isLoggable(Level.INFO))\n\t\t{\n\t\t\tStringWriter out = null;\n\t\t\tif (msgSrc != null)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tTransformerFactory tFactory = TransformerFactory\n\t\t\t\t\t\t\t.newInstance();\n\t\t\t\t\tTransformer trans = tFactory.newTransformer();\n\t\t\t\t\ttrans.setOutputProperty(OutputKeys.ENCODING, \"UTF-8\");\n\t\t\t\t\ttrans.setOutputProperty(OutputKeys.INDENT, \"yes\");\n\t\t\t\t\ttrans.setOutputProperty(OutputKeys.METHOD, \"xml\");\n\t\t\t\t\ttrans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,\n\t\t\t\t\t\t\t\"yes\");\n\t\t\t\t\tout = new StringWriter();\n\t\t\t\t\tStreamResult result = new StreamResult(out);\n\t\t\t\t\ttrans.transform(msgSrc, result);\n\t\t\t\t\tout.flush();\n\t\t\t\t\tout.close();\n\t\t\t\t} catch (Throwable t)\n\t\t\t\t{\n\t\t\t\t\t;\n\t\t\t\t\t;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (mLog.isLoggable(Level.INFO))\n\t\t\t{\n\t\t\t\tmLog\n\t\t\t\t\t\t.log(\n\t\t\t\t\t\t\t\tLevel.INFO,\n\t\t\t\t\t\t\t\t\"InboundMessageProcessor_NORMALIZED_MESSAGE_CONTENT_DUMP\",\n\t\t\t\t\t\t\t\tnew Object[]\n\t\t\t\t\t\t\t\t{ exchangeId,\n\t\t\t\t\t\t\t\t\t\t(out == null ? \"null\" : out.toString()) });\n\t\t\t}\n\t\t}\n\t}", "public static void main(String []args) {\n\t\tlog.trace(\"111---\");\n\t\tlog.debug(\"2222\");\n\t\tlog.info(\"333\");\n\t\tlog.warn(\"444\");\n\t\tlog.error(\"555\");\n\t}", "public MyLogs() {\n }", "public final String getTraceString() throws StandardException {\n // Check if the value is SQL NULL.\n if (isNull()) {\n return \"NULL\";\n }\n\n // Check if we have a stream.\n if (hasStream()) {\n return (getTypeName() + \"(\" + getStream().toString() + \")\");\n }\n\n return (getTypeName() + \":Length=\" + getLength());\n }", "@Override\n public String toString()\n {\n return s;\n }", "public static void generate(Stream stream, PrintStream output) {\n generate(SparseStream.fromStream(stream, Ownership.None), output);\n }", "public String makeString()\n {\n return \"RandomLevelSource\";\n }", "@Override\n\tpublic String toString()\n\t{\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tfor (int i = 0; i < 2 * size + 1; i++)\n\t\t{\n\t\t\tstringBuilder.append(\"-\");\n\t\t}\n\t\tstringBuilder.append(\"\\n|\");\n\t\tfor (int i = 0; i < state.size(); i++)\n\t\t{\n\t\t\tstringBuilder.append(state.get(i)).append(\"|\");\n\t\t\tif (i % size == size - 1 && i < state.size() - 1)\n\t\t\t{\n\t\t\t\tstringBuilder.append(\"\\n|\");\n\t\t\t}\n\t\t}\n\t\tstringBuilder.append(\"\\n\");\n\t\tfor (int i = 0; i < 2 * size + 1; i++)\n\t\t{\n\t\t\tstringBuilder.append(\"-\");\n\t\t}\n\t\treturn stringBuilder.toString();\n\t}", "public String get_log(){\n }", "@Test\n\tpublic final void testWriteTraceFullFormat() {\n\t\t// do one that should be pinned on US\n\t\tLog.writeMessage(LogMessageSeverity.VERBOSE, LogWriteMode.QUEUED, 0, null, null,\n\t\t\t\t\"This message should be verbose and ascribed to the LogTests class.\", null);\n\t\tLog.writeMessage(LogMessageSeverity.CRITICAL, LogWriteMode.QUEUED, 1, null, null,\n\t\t\t\t\"This message should be critical and ascribed to whatever is calling our test class.\", null);\n\t\tLog.writeMessage(LogMessageSeverity.ERROR, LogWriteMode.QUEUED, -1, null, null,\n\t\t\t\t\"This message should be error and also ascribed to the LogTests class.\", null);\n\t}", "void log();", "private void dumpTransportStream(TransportStreamExt ts)\n {\n log(\"*\");\n log(\"* TransportStream Information\");\n assertNotNull(\"TransportStream Description cannot be null\", ts.getDescription());\n log(\"* TS Description: \" + ts.getDescription());\n assertTrue(\"TransportStream Frequency should be greater than zero\", ts.getFrequency() > 0);\n log(\"* TS Frequency: \" + ts.getFrequency());\n assertTrue(\"TransportStream Modulation Format should be greater than zero\", ts.getModulationFormat() > 0\n && ts.getModulationFormat() <= 255);\n log(\"* TS Modulation Format: \" + ts.getModulationFormat());\n log(\"* TS ID: \" + ts.getTransportStreamID());\n assertNotNull(\"TransportStream ServiceInformationType cannot be null\", ts.getServiceInformationType());\n log(\"* TS ServiceInformationType: \" + ts.getServiceInformationType());\n assertNotNull(\"TransportStream UpdateTime cannot be null\", ts.getUpdateTime());\n long now = new Date().getTime();\n long oneYearAgo = now - (1000 * 60 * 60 * 24 * 365);\n long oneYearAhead = now + (1000 * 60 * 60 * 24 * 365);\n assertTrue(\"ServiceDetails' Update time should not be more than a year off\", (oneYearAgo < ts.getUpdateTime()\n .getTime())\n && (oneYearAhead > ts.getUpdateTime().getTime()));\n log(\"* TS UpdateTime: \" + ts.getUpdateTime());\n assertNotNull(\"TransportStream Locator cannot be null\", ts.getLocator());\n log(\"* TS Locator: \" + ts.getLocator());\n assertNotNull(\"TransportStream Handle cannot be null\", ts.getTransportStreamHandle());\n log(\"* TS Handle: \" + ts.getTransportStreamHandle());\n assertNotNull(\"TransportStream's Network cannot be null\", ts.getNetwork());\n assertNotNull(\"TransportStream's Transport cannot be null\", ts.getTransport());\n }", "public String toString() {\n String s = \"Message <Int8Msg> \\n\";\n try {\n s += \" [dataType=0x\"+Long.toHexString(get_dataType())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [senderNodeID=0x\"+Long.toHexString(get_senderNodeID())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [receiverNodeID=0x\"+Long.toHexString(get_receiverNodeID())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [sampleCnt=0x\"+Long.toHexString(get_sampleCnt())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [min=0x\"+Long.toHexString(get_min())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [max=0x\"+Long.toHexString(get_max())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [sum_a=0x\"+Long.toHexString(get_sum_a())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [sum_e=0x\"+Long.toHexString(get_sum_e())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n return s;\n }", "public String toString(){\n\t\tStringBuilder s = new StringBuilder(\"\");\n\t\ts.append(\"\\nMD2 Model details\\n\");\n\t\ts.append(\"\\tThere are \" + numFrames + \" key framess\\n\");\n\t\ts.append(\"\\tThere are \"+ point.length + \" points (XYZ coordinates)\\n\");\n\t\ts.append(\"\\tFor rendering there are \" + glComannd.length + \" triangle strips/fans\\n\");\n\t\ts.append(\"\\t and these have \" + glVertex.length + \" vertex definitions\\n\");\n\t\ts.append(\"\\tThere are \" + state.length + \" animation sequences\\n\");\n\t\ts.append(\"Estimated memory used \" + memUsage() + \" bytes for model excluding texture.\");\n\n\t\treturn new String(s);\n\t}", "public OrderLogRecord() {\n super(OrderLog.ORDER_LOG);\n }", "String serialize(PushEventSource eventSource);", "@Override\n public String visit(AStoreStmt n) {\n String r1 = this.reg[n.f2.f0.which];\n int offset = Integer.parseInt(n.f1.f1.f0.tokenImage);\n Global.outputString += \"sw $\" + r1 + \", -\" + ((offset + 3) * 4)\n + \"($fp)\\n\";\n return null;\n }", "public static String createTimeStamp(){\n return new SimpleDateFormat( \"yyyy.MM.dd.HH.mm.ss\").format(new Date());\n }", "@Override\n\tpublic String toString() {\n\t\tswitch (this) {\n\t\tcase LOGISTIC_REGRESSION_WITH_SGD:\n\t\t\treturn \"LogisticRegressionWithSGD\";\n\t\tcase SVM_WITH_SGD:\n\t\t\treturn \"SVMWithSGD\";\n\t\tdefault:\n\t\t\tthrow new IllegalArgumentException();\n\t\t} // switch\n\t}", "public String getRunLog();", "private LogData getDefaultLogData(long address) {\n ByteBuf b = Unpooled.buffer();\n Serializers.CORFU.serialize(PAYLOAD_DATA.getBytes(), b);\n LogData ld = new LogData(DataType.DATA, b);\n ld.setGlobalAddress(address);\n ld.setEpoch(1L);\n return ld;\n }", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}" ]
[ "0.5388578", "0.53861076", "0.53587687", "0.5304039", "0.52779156", "0.5241724", "0.52018315", "0.5200442", "0.5182392", "0.51234555", "0.51171213", "0.510639", "0.5072024", "0.49421206", "0.4900127", "0.48710182", "0.48556814", "0.48517227", "0.48299983", "0.48141208", "0.48056585", "0.48030233", "0.47756892", "0.47740284", "0.47698167", "0.47500563", "0.47247645", "0.4702688", "0.47025034", "0.4700974", "0.46774963", "0.46760404", "0.4674191", "0.46737716", "0.46719247", "0.46705619", "0.4664477", "0.4659401", "0.46553627", "0.46520257", "0.46431702", "0.46343005", "0.46339935", "0.46327144", "0.46304405", "0.46194455", "0.46106115", "0.46026313", "0.45967755", "0.45880124", "0.45871848", "0.45687914", "0.45678538", "0.4565064", "0.45580637", "0.45520324", "0.45449388", "0.45417717", "0.45391744", "0.45323095", "0.45307574", "0.45190707", "0.45111737", "0.44919112", "0.44876596", "0.4481784", "0.44795153", "0.44781736", "0.44779506", "0.44669744", "0.44668227", "0.4462565", "0.4447937", "0.4447566", "0.44467822", "0.4445633", "0.44415975", "0.4432199", "0.44226056", "0.442205", "0.44195664", "0.44192356", "0.44156358", "0.44140318", "0.44138536", "0.44104636", "0.44098416", "0.4409823", "0.4408583", "0.44061312", "0.44030827", "0.44024724", "0.43953243", "0.4394379", "0.43923247", "0.43916798", "0.43899098", "0.43859315", "0.43859315", "0.43859315" ]
0.44934416
63